Переглянути джерело

fix(footBtn): 增加isSomeoneDisabled属性,禁用特定操作并提供提示信息

xieyong 1 день тому
батько
коміт
81217212ac

+ 20 - 0
src/views/produce/components/footBtn.vue

@@ -39,6 +39,15 @@
         type: String,
         default: ''
       },
+      // 当前工序已分配给他人(routeList 项 isSomeone 为 true)时禁用领料/投料/报工/委外请托
+      isSomeoneDisabled: {
+        type: Boolean,
+        default: false
+      },
+      isSomeoneDisabledMsg: {
+        type: String,
+        default: '无法操作'
+      },
       activeName: {
         type: String,
         default: '0'
@@ -388,6 +397,17 @@
                 '请先完成领料、投料后再进行首件两检'
             };
           }
+          // 当前工序已分配给他人时,禁用领料/投料/报工/委外请托
+          if (
+            this.isSomeoneDisabled &&
+            ['pick', 'feed', 'job', 'Outsourcing'].includes(i.type)
+          ) {
+            return {
+              ...i,
+              disable: true,
+              msg: this.isSomeoneDisabledMsg || '无法操作'
+            };
+          }
           if (this.isPreProductionResult) {
             for (let key in this.isPreProductionResult) {
               let obj = this.disableObj[key];

+ 5 - 0
src/views/produceOrder/workReport.vue

@@ -221,6 +221,8 @@
                 :singleReportInspection="singleReportInspection"
                 :qualityInspectionDisabled="qualityInspectionDisabled"
                 :qualityInspectionDisabledMsg="firstArticlePickFeedMsg"
+                :isSomeoneDisabled="isSomeoneDisabled"
+                :isSomeoneDisabledMsg="'无法操作'"
                 :activeName="activeName"
                 style="background: rgba(223, 250, 222, 0.6); padding: 10px"
               ></footBtn>
@@ -460,6 +462,9 @@
           !this.firstArticlePickFeedReady
         );
       },
+      isSomeoneDisabled() {
+        return !!this.curTaskObj?.isSomeone;
+      },
       rightShow() {
         return (type) => {};
       }