|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="production">
|
|
|
- <el-dialog title="排产模板详情"
|
|
|
- width="70%"
|
|
|
- :close-on-click-modal="false"
|
|
|
+ <el-dialog title="排产模板详情"
|
|
|
+ width="70%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
:visible.sync="visible">
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
<el-row class="my-row">
|
|
@@ -143,9 +143,9 @@
|
|
|
info: null,
|
|
|
open: (type, info) => {
|
|
|
if (info.meta.workTypeId && info.meta.prop !== 'end') {
|
|
|
- this.getOperatorList(info.meta.workTypeId);
|
|
|
+ this.getOperatorList(info.meta.workTypeId)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const conf = this.drawerConf
|
|
|
conf.visible = true
|
|
|
conf.type = type
|
|
@@ -160,7 +160,6 @@
|
|
|
this.$set(this.nodeSetting, 'type', info.meta.type)
|
|
|
this.$set(this.nodeSetting, 'workTypeId', info.meta.workTypeId)
|
|
|
this.$set(this.nodeSetting, 'operatorIds', info.meta.operatorIds)
|
|
|
-
|
|
|
} else {
|
|
|
conf.title = '连线'
|
|
|
if (this.$refs.linkSetting) this.$refs.linkSetting.resetFields()
|
|
@@ -301,15 +300,15 @@
|
|
|
mouldName: [{required: true, message: '请输入模板名称', trigger: 'blur'}]
|
|
|
},
|
|
|
dataRule1: {
|
|
|
- operatorIds: [{ required: true, message: '操作人员不能为空', trigger: 'change' }]
|
|
|
+ operatorIds: [{ required: true, message: '操作人员不能为空', trigger: 'change' }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
// 初始化产品名称列表
|
|
|
- async initProductList() {
|
|
|
+ async initProductList () {
|
|
|
getProductList().then(({data}) => {
|
|
|
- if(data && data.code === '200') {
|
|
|
+ if (data && data.code === '200') {
|
|
|
data.data.forEach(item => {
|
|
|
this.productList.push(item)
|
|
|
})
|
|
@@ -322,15 +321,15 @@
|
|
|
this.display = disable
|
|
|
this.nodeList = []
|
|
|
this.linkList = []
|
|
|
- this.mouldId = id;
|
|
|
- if(!disable){
|
|
|
- await this.initProductList();
|
|
|
+ this.mouldId = id
|
|
|
+ if (!disable) {
|
|
|
+ await this.initProductList()
|
|
|
}
|
|
|
|
|
|
await getMouldDetail(id).then(async ({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.dataForm = data.data
|
|
|
-
|
|
|
+
|
|
|
// 图纸
|
|
|
if (this.dataForm.proTechnologyStepList) {
|
|
|
const dataline = []
|
|
@@ -374,7 +373,7 @@
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
setTimeout(() => {
|
|
|
this.nodeList = datanode
|
|
@@ -385,11 +384,11 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //根据产品ID查询步骤详情
|
|
|
- async productChange(productId) {
|
|
|
+ // 根据产品ID查询步骤详情
|
|
|
+ async productChange (productId) {
|
|
|
getMouldDetailByProductId(productId).then(async ({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataForm = {...this.dataForm, proTechnologyStepLists :data.data}
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm = {...this.dataForm, proTechnologyStepLists: data.data}
|
|
|
// 图纸
|
|
|
if (this.dataForm.proTechnologyStepLists) {
|
|
|
const dataline = []
|
|
@@ -431,7 +430,7 @@
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
setTimeout(() => {
|
|
|
this.nodeList = datanode
|
|
@@ -443,12 +442,12 @@
|
|
|
})
|
|
|
},
|
|
|
// 按工种ID查询操作人列表
|
|
|
- getOperatorList(workTypeId) {
|
|
|
+ getOperatorList (workTypeId) {
|
|
|
workTypeMasterList(workTypeId).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.operatorList = []
|
|
|
data.data.forEach(item => {
|
|
|
- this.operatorList.push(item);
|
|
|
+ this.operatorList.push(item)
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -463,16 +462,16 @@
|
|
|
if (this.drawerConf.type === drawerType.node) {
|
|
|
if (!conf.info.meta) conf.info.meta = {}
|
|
|
Object.keys(this.nodeSetting).forEach(key => {
|
|
|
- if (key == 'operatorIds') {
|
|
|
- let idList = this.nodeSetting[key];
|
|
|
- let nameList = [];
|
|
|
+ if (key === 'operatorIds') {
|
|
|
+ let idList = this.nodeSetting[key]
|
|
|
+ let nameList = []
|
|
|
idList.forEach(id => {
|
|
|
let name = this.operatorList.find(item => {
|
|
|
return item.userId === id
|
|
|
}).name
|
|
|
nameList.push(name)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.$set(conf.info.meta, 'desc', nameList.join(','))
|
|
|
}
|
|
|
this.$set(conf.info.meta, key, this.nodeSetting[key])
|
|
@@ -500,14 +499,15 @@
|
|
|
}
|
|
|
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
- if(valid) {
|
|
|
+ if (valid) {
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
const proTechnologyStepLists = []
|
|
|
-
|
|
|
+
|
|
|
let productionPlanSteps = []
|
|
|
for (let index = 0; index < this.datas.nodeList.length; index++) {
|
|
|
- const v = this.datas.nodeList[index];
|
|
|
- let tmp = v.meta.operatorIds || []
|
|
|
- if(v.meta.prop !== 'end' && tmp.length == 0){
|
|
|
+ const v = this.datas.nodeList[index]
|
|
|
+ let tmp = v.meta.operatorIds || []
|
|
|
+ if (v.meta.prop !== 'end' && tmp.length === 0) {
|
|
|
this.$message.error(`请选择 ${v.meta.name} 的操作人员!`)
|
|
|
return
|
|
|
}
|
|
@@ -520,11 +520,11 @@
|
|
|
stepList: productionPlanSteps
|
|
|
}
|
|
|
|
|
|
- if(this.mouldId === 0) {
|
|
|
+ if (this.mouldId === 0) {
|
|
|
// 新增
|
|
|
saveProdProductionMould(submitData).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
- this.$message({
|
|
|
+ this.$message({
|
|
|
message: '操作成功',
|
|
|
type: 'success',
|
|
|
duration: 1500,
|
|
@@ -539,10 +539,10 @@
|
|
|
})
|
|
|
} else {
|
|
|
// 更新
|
|
|
- submitData.mouldId = this.mouldId;
|
|
|
+ submitData.mouldId = this.mouldId
|
|
|
updateProdProductionMould(submitData).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
- this.$message({
|
|
|
+ this.$message({
|
|
|
message: '操作成功',
|
|
|
type: 'success',
|
|
|
duration: 1500,
|
|
@@ -621,7 +621,7 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|