| 
					
				 | 
			
			
				@@ -1,7 +1,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   <div class="production"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <el-dialog 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title="排产模板详情" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :title="dialogTitle" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       width="70%" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :close-on-click-modal="false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :visible.sync="visible" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -13,15 +13,18 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ref="dataForm" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         label-width="auto" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-row class="my-row"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-row class="my-row" :gutter="20"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-col :span="8"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-form-item label="产品" prop="productId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <el-input v-if="disable && productName" :disabled="disable" v-model="productName"></el-input> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               <el-select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                v-else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 v-model="dataForm.productId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                :disabled="display" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 @change="productChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 remote 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                :disabled="disable" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 placeholder="请选择" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                style="width:100%" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   v-for="item in productList" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -33,7 +36,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-col :span="12"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-col :span="10"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-form-item label="模板名称" prop="mouldName"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               <el-input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 placeholder="请输入模板名称" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -82,13 +85,15 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       mouldId: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       visible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dialogTitle: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       dataForm: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         mouldName: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       operatorList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       operatorIds: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       productList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      display: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      disable: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      productName: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       datas: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       workFlowData: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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.productName = productName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.visible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      await this.initProductList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if(!disable) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        await this.initProductList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (id > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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查询步骤详情 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     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查询操作人列表 
			 |