Browse Source

bugfix 流程图线条

damon227 3 years ago
parent
commit
78826a0dcf

+ 6 - 5
src/views/modules/production/monitoring-details.vue

@@ -5,6 +5,7 @@
       width="70%"
       :close-on-click-modal="false"
       :visible.sync="visible"
+      @close="handleClose"
     >
       <el-form
         :model="dataForm"
@@ -28,7 +29,6 @@
             :nodeData="workFlowData"
             :selectOperator="true"
             :disabled="true"
-            @saveWorkFlow="saveWorkFlow"
           ></work-flow>
         </el-row>
       </el-form>
@@ -75,6 +75,9 @@ export default {
       }
     }
   },
+  mounted() {
+    this.visible = true
+  },
   methods: {
     // 初始化表单
     async init (id, prodCode, disable) {
@@ -98,10 +101,8 @@ export default {
         }
       })
     },
-    // 保存流程图
-    saveWorkFlow (workFlowData) {
-      this.clickFlowSave = true
-      this.workFlowData = workFlowData
+    handleClose () {
+      this.$emit('close')
     }
   }
 }

+ 4 - 1
src/views/modules/production/monitoring.vue

@@ -94,7 +94,7 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 查看 -->
-    <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
+    <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -186,6 +186,9 @@
       // 创建新产品
       createNewProduct () {
         this.$message.warning('功能暂未开放')
+      },
+      closeDialogEvent () {
+        this.detailsVisible = false
       }
     }
   }

+ 4 - 0
src/views/modules/production/recording-details.vue

@@ -5,6 +5,7 @@
       width="70%"
       :close-on-click-modal="false"
       :visible.sync="visible"
+      @close="handleClose"
     >
       <el-form
         :model="dataForm"
@@ -87,6 +88,9 @@ export default {
           }
         }
       })
+    },
+    handleClose () {
+      this.$emit('close')
     }
   }
 }

+ 4 - 1
src/views/modules/production/recording.vue

@@ -85,7 +85,7 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 查看 -->
-    <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
+    <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -172,6 +172,9 @@
         this.$nextTick(() => {
           this.$refs.details.init(id)
         })
+      },
+      closeDialogEvent () {
+        this.detailsVisible = false
       }
     }
   }

+ 3 - 5
src/views/modules/production/scheduling-details.vue

@@ -5,6 +5,7 @@
       width="70%"
       :close-on-click-modal="false"
       :visible.sync="visible"
+      @close="handleClose"
     >
       <el-form
         :model="dataForm"
@@ -20,7 +21,6 @@
             ref="workFlow"
             :nodeData="workFlowData"
             :selectOperator="true"
-            @saveWorkFlow="saveWorkFlow"
           ></work-flow>
         </el-row>
       </el-form>
@@ -153,10 +153,8 @@ export default {
         }
       })
     },
-    // 保存流程图
-    saveWorkFlow (workFlowData) {
-      this.clickFlowSave = true
-      this.workFlowData = workFlowData
+    handleClose () {
+      this.$emit('close')
     }
   }
 }

+ 30 - 14
src/views/modules/production/scheduling-mould-details.vue

@@ -5,6 +5,7 @@
       width="70%"
       :close-on-click-modal="false"
       :visible.sync="visible"
+      @close="handleClose"
     >
       <el-form
         :model="dataForm"
@@ -51,7 +52,6 @@
             ref="workFlow"
             :nodeData="workFlowData"
             :selectOperator="true"
-            @saveWorkFlow="saveWorkFlow"
           ></work-flow>
         </el-row>
       </el-form>
@@ -118,22 +118,34 @@ export default {
       })
     },
     // 初始化表单
-    async init (id, disable) {
+    async init (id, disable, productionId) {
       this.visible = true
       this.display = disable
       this.mouldId = id
-      if (!disable) {
-        await this.initProductList()
-      }
+    
+      await this.initProductList()
 
-      await getMouldDetail(id).then(async ({ data }) => {
-        if (data && data.code === '200') {
-          this.dataForm = data.data
-        }
-      })
+      if(id > 0) {
+        await getMouldDetail(id).then(async ({ data }) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+            // 流程图展示
+            this.workFlowData = {
+              nodeList: data.data.nodeList,
+              lineList: data.data.lineList
+            }
+          }
+        })
+      }
+      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 = {
@@ -144,8 +156,14 @@ export default {
             nodeList: data.data.nodeList,
             lineList: data.data.lineList
           }
+        } else {
+          this.$message({
+            type: 'error',
+            message: data.msg
+          })
         }
       })
+      
     },
     // 按工种ID查询操作人列表
     getOperatorList (workTypeId) {
@@ -237,10 +255,8 @@ export default {
         }
       })
     },
-    // 保存流程图
-    saveWorkFlow (workFlowData) {
-      this.clickFlowSave = true
-      this.workFlowData = workFlowData
+    handleClose () {
+      this.$emit('close')
     }
   }
 }

+ 12 - 1
src/views/modules/production/scheduling-mould.vue

@@ -74,7 +74,7 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 新增 / 修改 -->
-    <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
+    <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @reload="reloadDialog"  @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -146,6 +146,17 @@
         this.$nextTick(() => {
           this.$refs.details.init(id, disable)
         })
+      },
+      closeDialogEvent () {
+        this.detailsVisible = false
+      },
+      reloadDialog (id, disable, productionId) {
+        console.log("reloadDialog")
+        this.detailsVisible = false
+        this.detailsVisible = true
+        // this.$nextTick(() => {
+        //   this.$refs.details.init(id, disable, productionId)
+        // })
       }
     }
   }

+ 4 - 1
src/views/modules/production/scheduling.vue

@@ -105,7 +105,7 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 新增 / 修改 -->
-    <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
+    <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -225,6 +225,9 @@
         if (!row.state) return ''
         const item1 = this.optionsState.find((item) => item.code === row.state.toString())
         return item1 ? item1.value : ''
+      },
+      closeDialogEvent () {
+        this.detailsVisible = false
       }
     }
   }

+ 2 - 4
src/views/modules/tech/crafts-detail.vue

@@ -4,7 +4,7 @@
     width="70%"
     :close-on-click-modal="false"
     :visible.sync="visible"
-    :before-close="handleClose"
+    @close="handleClose"
   >
     <div style="margin-left: 20px;margin-right: 20px">
       <!-- 工作流 -->
@@ -93,7 +93,6 @@ export default {
     }
   },
   destroyed () {
-    console.log('destroyed')
   },
   methods: {
     async init (id, businessType, productName) {
@@ -156,8 +155,7 @@ export default {
       this.$emit('approveFinished')
     },
     handleClose () {
-      // this.visible = false
-      this.$emit('closeDialogEvent')
+      this.$emit('close')
     }
   }
 }

+ 6 - 2
src/views/modules/tech/crafts-management.vue

@@ -156,8 +156,8 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 新增 / 修改 -->
-    <ctafts-add-or-detail v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getTechnology" />
-    <detail v-if="detailVisible" ref="detail" @closeDialogEvent = "closeDetailDialogEvent"/>
+    <ctafts-add-or-detail v-if="addOrUpdateVisible" ref="addOrUpdate" @close = "closeEditDialogEvent" @refreshDataList="getTechnology" />
+    <detail v-if="detailVisible" ref="detail" @close = "closeDetailDialogEvent"/>
   </div>
 </template>
 
@@ -286,6 +286,10 @@
       // 关闭详情dialog事件
       closeDetailDialogEvent () {
         this.detailVisible = false
+      },
+      // 关闭编辑dialog事件
+      closeEditDialogEvent () {
+        this.addOrUpdateVisible = false
       }
     }
   }

+ 5 - 0
src/views/modules/tech/ctafts-add-or-detail.vue

@@ -5,6 +5,7 @@
       width="70%"
       :close-on-click-modal="false"
       :visible.sync="visible"
+      @close="handleClose"
     >
       <el-form
         :model="dataForm"
@@ -269,6 +270,10 @@ export default {
     // 保存流程图
     saveWorkFlow (workFlowData) {
       this.workFlowData = workFlowData
+    },
+    handleClose () {
+      // this.visible = false
+      this.$emit('close')
     }
   }
 }

+ 5 - 2
src/views/modules/works/work.vue

@@ -221,7 +221,10 @@ export default {
         transferUserId: [{required: true, message: '请选择移交用户', trigger: 'blur'}]
       },
       checkDialogFormVisible: false,
-      checkDialogForm: {},
+      checkDialogForm: {
+        checkType: '',
+        notes: ''
+      },
       checkDialogFormRules: {
         checkType: [{required: true, message: '请选择', trigger: 'blur'}]
       },
@@ -421,7 +424,7 @@ export default {
             if (data && data.code === '200') {
               this.$message({
                 type: 'success',
-                message: '移交成功!'
+                message: '检验成功!'
               })
               this.checkDialogFormVisible = false
               this.getDataList()