工艺任务分配
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<el-table-column align="center" type="selection"/>
|
||||
<el-table-column align="center" label="零件号" prop="零件号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件号 }}
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="零件名称" label="零件名称" width="150">
|
||||
@@ -83,7 +83,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGraphNum, getGroupNum, getTable, save, initPerson, save2 } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
|
||||
import { getGraphNum, getGroupNum, getTable, save, save2, initPerson, selectTechnology } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -174,14 +174,9 @@ export default {
|
||||
this.tableData = []
|
||||
getTable(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
||||
this.total = response.data.total
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
response.data.rows[i].工艺计划开始时间 = response.data.rows[i].工艺计划开始时间.split(' ')[0]
|
||||
response.data.rows[i].工艺计划结束时间 = response.data.rows[i].工艺计划结束时间.split(' ')[0]
|
||||
response.data.rows[i].操作时间 = response.data.rows[i].操作时间.split(' ')[0]
|
||||
}
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
零件号: response.data.rows[i].零件图号,
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
||||
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
||||
@@ -199,7 +194,16 @@ export default {
|
||||
}
|
||||
},
|
||||
rowClick(row) {
|
||||
console.log(row.工艺计划流水号)
|
||||
selectTechnology(row.零件图号, row.规格).then(response => {
|
||||
if (response.data[0].结果 === 1) {
|
||||
console.log(1)
|
||||
} else {
|
||||
console.log(0)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 全选
|
||||
selectAll(rows) {
|
||||
@@ -214,26 +218,27 @@ export default {
|
||||
})
|
||||
} else { this.$message.error('请在第一行中填写工艺员姓名') }
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
save() {
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].工艺员 === '') {
|
||||
this.$message.error('请选择工艺员')
|
||||
} else {
|
||||
this.result = 0
|
||||
save(this.multipleSelection[i].工艺计划流水号, this.multipleSelection[i].工艺员, this.multipleSelection[i].零件号).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.multipleSelection.length) {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.getTable()
|
||||
} else if (i === this.multipleSelection.length - 1 && this.result !== this.multipleSelection.length) {
|
||||
this.$message.error('存在保存失败项')
|
||||
}
|
||||
})
|
||||
this.工艺计划流水号组 = []
|
||||
this.通用件图号 = []
|
||||
this.工艺员 = []
|
||||
var check = 1
|
||||
this.multipleSelection.map(v => {
|
||||
if (!v.工艺员) {
|
||||
check = 0
|
||||
}
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.通用件图号.push(v.零件图号)
|
||||
this.工艺员.push(v.工艺员)
|
||||
})
|
||||
if (check === 1) {
|
||||
save(this.工艺计划流水号组, this.通用件图号, this.工艺员).then(response => {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.getTable()
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择工艺员')
|
||||
}
|
||||
},
|
||||
// 直接保存工艺
|
||||
@@ -251,14 +256,12 @@ export default {
|
||||
check = 0
|
||||
}
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.通用件图号.push(v.零件号)
|
||||
this.通用件图号.push(v.零件图号)
|
||||
this.通用件规格.push(v.规格)
|
||||
this.工艺员.push(v.工艺员)
|
||||
})
|
||||
if (check === 1) {
|
||||
console.log(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员)
|
||||
save2(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员).then(response => {
|
||||
console.log(response.data, 231)
|
||||
if (response.data[0].结果 === 'success') {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
@@ -267,8 +270,7 @@ export default {
|
||||
var messages = []
|
||||
messages = response.data[0].结果.split('||||')
|
||||
messages.shift()
|
||||
console.log(messages)
|
||||
this.$message.error(`图号${messages}无已完成`)
|
||||
this.$message.error(`图号${messages}无已完成工艺`)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user