|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="production">
|
|
<div class="production">
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="排产模板详情"
|
|
|
|
|
|
+ :title="dialogTitle"
|
|
width="70%"
|
|
width="70%"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:visible.sync="visible"
|
|
:visible.sync="visible"
|
|
@@ -13,15 +13,18 @@
|
|
ref="dataForm"
|
|
ref="dataForm"
|
|
label-width="auto"
|
|
label-width="auto"
|
|
>
|
|
>
|
|
- <el-row class="my-row">
|
|
|
|
|
|
+ <el-row class="my-row" :gutter="20">
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="产品" prop="productId">
|
|
<el-form-item label="产品" prop="productId">
|
|
|
|
+ <el-input v-if="disable && productName" :disabled="disable" v-model="productName"></el-input>
|
|
<el-select
|
|
<el-select
|
|
|
|
+ v-else
|
|
v-model="dataForm.productId"
|
|
v-model="dataForm.productId"
|
|
- :disabled="display"
|
|
|
|
@change="productChange"
|
|
@change="productChange"
|
|
remote
|
|
remote
|
|
|
|
+ :disabled="disable"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
|
+ style="width:100%"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in productList"
|
|
v-for="item in productList"
|
|
@@ -33,7 +36,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <el-col :span="10">
|
|
<el-form-item label="模板名称" prop="mouldName">
|
|
<el-form-item label="模板名称" prop="mouldName">
|
|
<el-input
|
|
<el-input
|
|
placeholder="请输入模板名称"
|
|
placeholder="请输入模板名称"
|
|
@@ -82,13 +85,15 @@ export default {
|
|
return {
|
|
return {
|
|
mouldId: '',
|
|
mouldId: '',
|
|
visible: false,
|
|
visible: false,
|
|
|
|
+ dialogTitle: '',
|
|
dataForm: {
|
|
dataForm: {
|
|
mouldName: ''
|
|
mouldName: ''
|
|
},
|
|
},
|
|
operatorList: [],
|
|
operatorList: [],
|
|
operatorIds: [],
|
|
operatorIds: [],
|
|
productList: [],
|
|
productList: [],
|
|
- display: false,
|
|
|
|
|
|
+ disable: false,
|
|
|
|
+ productName: '',
|
|
datas: {},
|
|
datas: {},
|
|
workFlowData: {
|
|
workFlowData: {
|
|
nodeList: [],
|
|
nodeList: [],
|
|
@@ -118,12 +123,17 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 初始化表单
|
|
// 初始化表单
|
|
- async init (id, disable, productionId) {
|
|
|
|
- this.visible = true
|
|
|
|
- this.display = disable
|
|
|
|
|
|
+ async init (id, disable, productName) {
|
|
|
|
+ this.disable = disable
|
|
|
|
+ this.dialogTitle = disable ? '编辑排产模板' : '新增排产模板'
|
|
this.mouldId = id
|
|
this.mouldId = id
|
|
|
|
+ this.productName = productName
|
|
|
|
+ this.visible = true
|
|
|
|
|
|
- await this.initProductList()
|
|
|
|
|
|
+ if(!disable)
|
|
|
|
+ {
|
|
|
|
+ await this.initProductList()
|
|
|
|
+ }
|
|
|
|
|
|
if (id > 0) {
|
|
if (id > 0) {
|
|
await getMouldDetail(id).then(async ({ data }) => {
|
|
await getMouldDetail(id).then(async ({ data }) => {
|
|
@@ -137,31 +147,37 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- if (productionId && productionId > 0) {
|
|
|
|
- this.productChange(productionId)
|
|
|
|
- }
|
|
|
|
|
|
+ // if (productionId && productionId > 0) {
|
|
|
|
+ // this.productChange(productionId)
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
// 根据产品ID查询步骤详情
|
|
// 根据产品ID查询步骤详情
|
|
async productChange (productId) {
|
|
async productChange (productId) {
|
|
- // this.visible = false
|
|
|
|
- // this.$emit('reload', 0, false, productId)
|
|
|
|
- // return
|
|
|
|
- getMouldDetailByProductId(productId).then(async ({ data }) => {
|
|
|
|
- if (data && data.code === '200') {
|
|
|
|
- this.dataForm = {
|
|
|
|
- ...this.dataForm
|
|
|
|
- }
|
|
|
|
- // 流程图展示
|
|
|
|
- this.workFlowData = {
|
|
|
|
- nodeList: data.data.nodeList,
|
|
|
|
- lineList: data.data.lineList
|
|
|
|
|
|
+ this.$confirm('选中后不可更改,是否选择该产品?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.disable = true
|
|
|
|
+ getMouldDetailByProductId(productId).then(async ({ data }) => {
|
|
|
|
+ if (data && data.code === '200') {
|
|
|
|
+ this.dataForm = {
|
|
|
|
+ ...this.dataForm
|
|
|
|
+ }
|
|
|
|
+ // 流程图展示
|
|
|
|
+ this.workFlowData = {
|
|
|
|
+ nodeList: data.data.nodeList,
|
|
|
|
+ lineList: data.data.lineList
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: data.msg
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: data.msg
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.dataForm.productId = ''
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 按工种ID查询操作人列表
|
|
// 按工种ID查询操作人列表
|