chris 3 năm trước cách đây
mục cha
commit
9b01e9afc0

+ 1 - 1
src/api/crafts.js

@@ -53,4 +53,4 @@ export function revoke (data) {
     method: 'POST',
     data
   })
-}
+}

+ 1 - 1
src/components/work-flow/config/methods.js

@@ -21,7 +21,7 @@ const methods = {
       })
       // 断开连线后,维护本地数据
       this.jsPlumb.bind('connectionDetached', evt => {
-        //this.deleLine(evt)
+        // this.deleLine(evt)
       })
       this.loadEasyFlow()
       // 会使整个jsPlumb立即重绘。

+ 2 - 2
src/components/work-flow/home.vue

@@ -164,7 +164,7 @@ export default {
       this.initNode()
       this.fixNodesPosition()
       this.$nextTick(() => {
-        this.jsPlumb.deleteEveryConnection();
+        this.jsPlumb.deleteEveryConnection()
         // this.jsPlumb.deleteEveryEndpoint();
         // this.deleteAllNode();
         this.init()
@@ -233,7 +233,7 @@ export default {
       // })
       // this.$emit('saveWorkFlow', data)
     },
-    getFlowData(){
+    getFlowData () {
       let data = JSON.parse(JSON.stringify(this.data))
       data.nodeList = data.nodeList.map(item => {
         delete item.logImg

+ 14 - 14
src/components/work-flow/node-edit.vue

@@ -148,22 +148,22 @@ export default {
         ...this.node
       }
       if (this.node.operatorId) {
-      this.form.operatorId = this.node.operatorId.split(',')
-    }
+        this.form.operatorId = this.node.operatorId.split(',')
+      }
 
     // 附件
-    if (this.node.attachList) {
-      this.$nextTick(() =>{
-      this.fileList = []
-      this.node.attachList.forEach(item => {
-        this.fileList.push({
-          name: item.fileName,
-          url: item.url,
-          id: item.url
+      if (this.node.attachList) {
+        this.$nextTick(() => {
+          this.fileList = []
+          this.node.attachList.forEach(item => {
+            this.fileList.push({
+              name: item.fileName,
+              url: item.url,
+              id: item.url
+            })
+          })
         })
-      })
-      })
-    }
+      }
     },
     disabled (val) {
       this.disabled = val
@@ -237,7 +237,7 @@ export default {
     },
     // 获取表单数据
     formData () {
-      const form = { ...this.form, operatorName: ''}
+      const form = { ...this.form, operatorName: '' }
       if (this.form.operatorId != null) {
         form.operatorId = this.form.operatorId.toString()
         this.form.operatorId.forEach(id => {

+ 9 - 9
src/views/modules/tech/crafts-management.vue

@@ -200,13 +200,13 @@
       }
     },
     methods: {
-      convertState(state){
-        switch(state){
-          case '0': return "待提交";
-          case '1': return "待审批";
-          case '2': return "审批中";
-          case '3': return "审批完成";
-          default: return "审批不通过";
+      convertState (state) {
+        switch (state) {
+          case '0': return '待提交'
+          case '1': return '待审批'
+          case '2': return '审批中'
+          case '3': return '审批完成'
+          default: return '审批不通过'
         }
       },
       // 查询
@@ -259,8 +259,8 @@
         })
       },
       // 撤销
-      revokeHandle(id){
-        revoke({techId:id}).then(({data}) => {
+      revokeHandle (id) {
+        revoke({techId: id}).then(({data}) => {
           if (data && data.code === '200') {
             this.getTechnology()
           }

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

@@ -185,7 +185,7 @@ export default {
       await getInfo(id).then(async ({ data }) => {
         if (data && data.code === '200') {
           this.dataForm = data.data
-           this.workFlowData = {
+          this.workFlowData = {
             nodeList: data.data.nodeList,
             lineList: data.data.lineList
           }

+ 7 - 3
src/views/modules/warehouse/stock-add-or-update.vue

@@ -15,7 +15,8 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="类别" prop="materialTypeId">
-            <dict-select v-model:dict-id="dataForm.cateId" v-bind:dict-type="dictType" :disabled="isEdit"/>
+            <dict-select v-if="!id"  v-model:dict-id="dataForm.cateId" v-bind:dict-type="dictType" :disabled="isEdit"/>
+            <el-input v-else v-model="dataForm.categoryName" :disabled="true"/>
           </el-form-item>
         </el-col>
       </el-row>
@@ -46,11 +47,11 @@
       <el-row class="my-row">
         <el-col :span="12">
           <el-form-item label="金额" prop="amount">
-            <el-input :value="dataForm.price * dataForm.cnt" :disabled="true" placeholder="物品(零件)总金额"></el-input>
+            <el-input :value="!id?(dataForm.price * dataForm.cnt):dataForm.amount" :disabled="true" placeholder="物品(零件)总金额"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row class="my-row">
+      <el-row class="my-row">methods.js
         <el-col :span="12">
           <el-form-item label="存放仓库" prop="warehouseId">
             <warehouse-select ref="warehouse" v-model:warehouse-id="dataForm.warehouseId"/>
@@ -88,6 +89,7 @@
       return {
         visible: false,
         isEdit: false,
+        id: 0,
         dictType: 'material_type',
         dataForm: {
           materialId: 0,
@@ -112,6 +114,7 @@
     methods: {
       init (id) {
         this.isEdit = !!id
+        this.id = id || 0
         this.dataForm.materialId = id || 0
         if (this.dataForm.materialId) {
           this.$http({
@@ -134,6 +137,7 @@
               this.dataForm.shelveName = data.data.shelveName
               this.dataForm.notes = data.data.notes
               this.dataForm.cateId = data.data.cateId
+              this.dataForm.categoryName = data.data.categoryName
             } else {
               this.$message.error(data.msg)
             }

+ 243 - 247
src/views/modules/works/work.vue

@@ -186,114 +186,147 @@ import { getTaskList, startTask, transferTask, completeTask, checkTask, damageTa
 import { workTypeMasterList } from '@/api/worktype'
 import template from '../warehouse/template.vue'
 import { downloadUrl } from '@/api/file'
-  export default {
+export default {
   components: { template },
-    name: 'work',
-    data () {
-      return {
-        addOrUpdateVisible: false,
-        dataForm: {
-          state: '1'
-        },
-        dataList: [],
-        pageIndex: 1,
-        pageSize: 10,
-        totalPage: 0,
-        dataListLoading: false,
-        dataListSelections: [],
-        optionsState: [
-          {
-            code: '1', value: '未完成'
-          },
-          {
-            code: '2', value: '待操作'
-          },
-          {
-            code: '3', value: '已完成'
-          }
-        ],
-        transferDialogFormVisible: false,
-        transferDialogForm: {},
-        transferUserList: [],
-        transferDialogFormRules: {
-          transferType: [{required: true, message: '请选择移交类型', trigger: 'blur'}],
-          transferUserId: [{required: true, message: '请选择移交用户', trigger: 'blur'}]
-        },
-        checkDialogFormVisible: false,
-        checkDialogForm: {},
-        checkDialogFormRules: {
-          checkType: [{required: true, message: '请选择', trigger: 'blur'}]
+  name: 'work',
+  data () {
+    return {
+      addOrUpdateVisible: false,
+      dataForm: {
+        state: '1'
+      },
+      dataList: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPage: 0,
+      dataListLoading: false,
+      dataListSelections: [],
+      optionsState: [
+        {
+          code: '1', value: '未完成'
         },
-        damageDialogFormVisible: false,
-        damageDialogForm: {},
-        damageDialogFormRules: {
-          damageReason: [{required: true, message: '请输入', trigger: 'blur'}]
+        {
+          code: '2', value: '待操作'
         },
+        {
+          code: '3', value: '已完成'
+        }
+      ],
+      transferDialogFormVisible: false,
+      transferDialogForm: {},
+      transferUserList: [],
+      transferDialogFormRules: {
+        transferType: [{required: true, message: '请选择移交类型', trigger: 'blur'}],
+        transferUserId: [{required: true, message: '请选择移交用户', trigger: 'blur'}]
+      },
+      checkDialogFormVisible: false,
+      checkDialogForm: {},
+      checkDialogFormRules: {
+        checkType: [{required: true, message: '请选择', trigger: 'blur'}]
+      },
+      damageDialogFormVisible: false,
+      damageDialogForm: {},
+      damageDialogFormRules: {
+        damageReason: [{required: true, message: '请输入', trigger: 'blur'}]
+      },
         // 是否显示进度条列
-        showProgress: true
-      }
-    },
-    created () {
+      showProgress: true
+    }
+  },
+  created () {
+    this.getDataList()
+  },
+  methods: {
+      // 查询
+    queryData () {
+      this.pageIndex = 1
+      this.showProgress = this.dataForm.state !== '2'
       this.getDataList()
     },
-    methods: {
-      // 查询
-      queryData () {
-        this.pageIndex = 1
-        if(this.dataForm.state === '2'){
-          this.showProgress = false
-        } else {
-          this.showProgress = true
-        }
-        this.getDataList()
-      },
       // 获取数据列表
-      getDataList () {
-        this.dataListLoading = true
-        let params = {
-          'current': this.pageIndex,
-          'size': this.pageSize,
-          'state': this.dataForm.state
+    getDataList () {
+      this.dataListLoading = true
+      let params = {
+        'current': this.pageIndex,
+        'size': this.pageSize,
+        'state': this.dataForm.state
+      }
+      getTaskList(params).then(({data}) => {
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
+        } else {
+          this.dataList = []
+          this.totalPage = 0
         }
-        getTaskList(params).then(({data}) => {
-          if (data && data.code === '200') {
-            this.dataList = data.data.records
-            this.totalPage = Number(data.data.total)
-          } else {
-            this.dataList = []
-            this.totalPage = 0
-          }
-          this.dataListLoading = false
-        })
-      },
+        this.dataListLoading = false
+      })
+    },
       // 每页数
-      sizeChangeHandle (val) {
-        this.pageSize = val
-        this.pageIndex = 1
-        this.getDataList()
-      },
+    sizeChangeHandle (val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
+    },
       // 当前页
-      currentChangeHandle (val) {
-        this.pageIndex = val
-        this.getDataList()
-      },
+    currentChangeHandle (val) {
+      this.pageIndex = val
+      this.getDataList()
+    },
       // 多选
-      selectionChangeHandle (val) {
-        this.dataListSelections = val
-      },
+    selectionChangeHandle (val) {
+      this.dataListSelections = val
+    },
       // 开始
-      startTask (taskId) {
-        this.$confirm('是否开始任务?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          startTask({taskId}).then(({data}) => {
+    startTask (taskId) {
+      this.$confirm('是否开始任务?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        startTask({taskId}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            this.getDataList()
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        })
+      })
+    },
+      // 移交
+    transferTask (taskId, workTypeId) {
+      this.transferDialogFormVisible = true
+      this.transferDialogForm.taskId = taskId
+
+      workTypeMasterList(workTypeId).then(({data}) => {
+        if (data && data.code === '200') {
+          this.transferUserList = data.data
+        }
+      })
+    },
+      // 确认移交
+    transferSubmit () {
+      this.$refs['transferDialogForm'].validate((valid) => {
+        if (valid) {
+          transferTask(this.transferDialogForm).then(({data}) => {
             if (data && data.code === '200') {
               this.$message({
                 type: 'success',
-                message: '操作成功!'
+                message: '移交成功!'
               })
+              this.transferDialogFormVisible = false
               this.getDataList()
             } else {
               this.$message({
@@ -302,59 +335,94 @@ import { downloadUrl } from '@/api/file'
               })
             }
           })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
-        })
-      },
-      // 移交
-      transferTask (taskId, workTypeId) {
-        this.transferDialogFormVisible = true
-        this.transferDialogForm.taskId = taskId
-
-        workTypeMasterList(workTypeId).then(({data}) => {
+        }
+      })
+    },
+      // 完成
+    completeTask (taskId) {
+      this.$confirm('是否完成任务?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        completeTask({taskId}).then(({data}) => {
           if (data && data.code === '200') {
-            this.transferUserList = data.data
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            this.getDataList()
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
           }
         })
-      },
-      // 确认移交
-      transferSubmit () {
-        this.$refs['transferDialogForm'].validate((valid) => {
-          if (valid) {
-            transferTask(this.transferDialogForm).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  type: 'success',
-                  message: '移交成功!'
-                })
-                this.transferDialogFormVisible = false
-                this.getDataList()
-              } else {
-                this.$message({
-                  type: 'error',
-                  message: data.msg
-                })
-              }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        })
+      })
+    },
+      // 检验
+    checkTask (taskId, checkType) {
+      this.checkDialogForm.taskId = taskId
+      if (checkType === 1) {
+        this.checkDialogForm.checkType = checkType
+        this.passTask()
+      } else {
+        this.checkDialogForm.checkType = null
+        this.refuseTask()
+      }
+    },
+      // 通过
+    passTask () {
+      this.$confirm('是否完成任务?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let submitData = this.checkDialogForm
+        checkTask(submitData).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '移交成功!'
+            })
+            this.checkDialogFormVisible = false
+            this.getDataList()
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
             })
           }
         })
-      },
-      // 完成
-      completeTask (taskId) {
-        this.$confirm('是否完成任务?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          completeTask({taskId}).then(({data}) => {
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        })
+      })
+    },
+    refuseTask () {
+      this.checkDialogFormVisible = true
+    },
+      // 不通过
+      // 确认检验
+    checkSubmit () {
+      this.$refs['checkDialogForm'].validate((valid) => {
+        if (valid) {
+          let submitData = this.checkDialogForm
+          checkTask(submitData).then(({data}) => {
             if (data && data.code === '200') {
               this.$message({
                 type: 'success',
-                message: '操作成功!'
+                message: '移交成功!'
               })
+              this.checkDialogFormVisible = false
               this.getDataList()
             } else {
               this.$message({
@@ -363,127 +431,55 @@ import { downloadUrl } from '@/api/file'
               })
             }
           })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
-        })
-      },
-      // 检验
-      checkTask (taskId, checkType) {
-        this.checkDialogForm.taskId = taskId
-        if(checkType === 1){
-          this.checkDialogForm.checkType = checkType
-          this.passTask()
-        } else {
-          this.checkDialogForm.checkType = null
-          this.refuseTask()
         }
-      },
-      // 通过
-      passTask(){
-        this.$confirm('是否完成任务?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          let submitData = this.checkDialogForm
-          checkTask(submitData).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  type: 'success',
-                  message: '移交成功!'
-                })
-                this.checkDialogFormVisible = false
-                this.getDataList()
-              } else {
-                this.$message({
-                  type: 'error',
-                  message: data.msg
-                })
-              }
-            })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
-        })
-      },
-      refuseTask(){
-        this.checkDialogFormVisible = true
-      },
-      // 不通过
-      // 确认检验
-      checkSubmit () {
-        this.$refs['checkDialogForm'].validate((valid) => {
-          if (valid) {
-            let submitData = this.checkDialogForm
-            checkTask(submitData).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  type: 'success',
-                  message: '移交成功!'
-                })
-                this.checkDialogFormVisible = false
-                this.getDataList()
-              } else {
-                this.$message({
-                  type: 'error',
-                  message: data.msg
-                })
-              }
-            })
-          }
-        })
-      },
+      })
+    },
       // 操作损坏
-      damageTask(taskId, productionId){
-        this.damageDialogFormVisible = true
-        this.damageDialogForm.taskId = taskId
-        this.damageDialogForm.productionId = productionId
-      },
+    damageTask (taskId, productionId) {
+      this.damageDialogFormVisible = true
+      this.damageDialogForm.taskId = taskId
+      this.damageDialogForm.productionId = productionId
+    },
       // 确认操作损坏
-      damageSubmit(){
-        this.$refs['damageDialogForm'].validate((valid) => {
-          if (valid) {
-            let submitData = this.checkDialogForm
-            damageTask(submitData).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  type: 'success',
-                  message: '操作成功!'
-                })
-                this.checkDialogFormVisible = false
-                this.getDataList()
-              } else {
-                this.$message({
-                  type: 'error',
-                  message: data.msg
-                })
-              }
-            })
-          }
-        })
-      },
+    damageSubmit () {
+      this.$refs['damageDialogForm'].validate((valid) => {
+        if (valid) {
+          let submitData = this.checkDialogForm
+          damageTask(submitData).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                type: 'success',
+                message: '操作成功!'
+              })
+              this.checkDialogFormVisible = false
+              this.getDataList()
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }
+      })
+    },
       // 预览
-      previewFile (url) {
+    previewFile (url) {
         // 弹出新页面显示下载文件
-        window.open(downloadUrl + url, '_blank')
-      },
+      window.open(downloadUrl + url, '_blank')
+    },
       // 计算进度百分比,返回0到100的整数
-      getPercentage(completeNum, totalNum){
-        completeNum = completeNum == null ? 0 : parseInt(completeNum)
-        totalNum = totalNum == null ? 100 : parseInt(totalNum)
-        if(totalNum === 0){
-          return 100
-        }
-
-        return (completeNum/totalNum).toFixed(2) * 100
+    getPercentage (completeNum, totalNum) {
+      completeNum = completeNum == null ? 0 : parseInt(completeNum)
+      totalNum = totalNum == null ? 100 : parseInt(totalNum)
+      if (totalNum === 0) {
+        return 100
       }
+
+      return (completeNum / totalNum).toFixed(2) * 100
     }
   }
+}
 </script>
 
 <style scoped>