浏览代码

质检工单报工样品清单未做完质检不能点击报工完成按钮;工单列表点击报工找不到页面给出提示;

yijing 1 年之前
父节点
当前提交
da09c0515e

+ 1 - 1
src/views/inspectionWork/components/baseInfo.vue

@@ -165,7 +165,7 @@
         </el-form-item>
       </el-col>
       <el-col :span="6">
-        <el-form-item label="质检状态:" prop="qualityResults">
+        <el-form-item label="质检结果:" prop="qualityResults">
           <el-select v-model="form.qualityResults" placeholder="请选择" style="width: 100%" :disabled="btnType == 'issued'"
             clearable>
             <el-option label="合格" :value=1 />

+ 0 - 1
src/views/inspectionWork/components/sampleListDialog.vue

@@ -138,7 +138,6 @@ export default {
           this.tableData = [];
             this.rowIndex = index
             this.type = type;
-            debugger;
             this.tableData = list;
 
             this.visible = true;

+ 12 - 5
src/views/inspectionWork/edit.vue

@@ -579,11 +579,18 @@ export default {
         if (!valid) {
           return false;
         }
-        // let form = {
-        //   qualityTimeEnd: this.getNowTime(),
-        //   qualityTimeStart: this.qualityTimeStart,
-        //   ...this.form,
-        // }
+
+        for (let i = 0; i < this.sampleList.length; i++) {
+        
+        const qualityStatus = this.sampleList[i].qualityStatus;
+        
+        if (qualityStatus == '2') {
+          this.$message.error('请完成以下样品质检!')
+          this.loading = false;
+          return
+        }
+      }
+
         this.form.qualityTimeEnd = new Date(this.getNowTime())
         this.form.qualityTimeStart = new Date(this.qualityTimeStart)
         let params = {

+ 30 - 16
src/views/inspectionWork/index.vue

@@ -268,24 +268,38 @@ export default {
       });
     },
     openEdit(type, row) {
-      let id = '';
-      let qualityType = null;
-      let qualityTimeStart = row.qualityTimeStart;
-      if (type != 'add') {
-        id = row.id;
-        qualityType = row.qualityType;
-      }
-      // this.$refs.edit.open(type, row);
-      this.$router.push({
-        path: '/inspectionWork/edit',
-        query: {
-          type: type,
-          id: id || '',
-          qualityType: qualityType,
-          qualityTimeStart: qualityTimeStart || ''
+      const menusList = this.$store.state.user.menus;
+      let found = false;
+      console.log(menusList, 'menusList')
+      for (const item of menusList) {
+        console.log(item, 'item')
+        if (item.children) {
+          for (const item2 of item.children) {
+            if (item2.path === '/inspectionWork/edit') {
+              found = true;
+              const id = type !== 'add' ? row.id : '';
+              const qualityType = type !== 'add' ? row.qualityType : null;
+              const qualityTimeStart = row.qualityTimeStart || '';
 
+              this.$router.push({
+                path: '/inspectionWork/edit',
+                query: {
+                  type,
+                  id,
+                  qualityType,
+                  qualityTimeStart
+                }
+              });
+              return;
+            }
+          }
         }
-      });
+
+      }
+
+      if (!found) {
+        this.$message.error('请到角色管理配置菜单权限!');
+      }
     },
     downloadFile(file) {
       getFile({ objectName: file.storePath }, file.name);