소스 검색

修改任务报工的bug

695593266@qq.com 5 달 전
부모
커밋
4035bc8358
3개의 변경된 파일95개의 추가작업 그리고 41개의 파일을 삭제
  1. 46 10
      src/views/produce/components/footBtn.vue
  2. 1 1
      src/views/produce/components/taskWorkList.vue
  3. 48 30
      src/views/produce/index.vue

+ 46 - 10
src/views/produce/components/footBtn.vue

@@ -30,6 +30,10 @@
         default: () => {
           return null;
         }
+      },
+      activeName: {
+        type: String,
+        default: '0'
       }
     },
     data() {
@@ -271,6 +275,34 @@
           }
         ],
         btnList: [],
+        taskList: [
+          {
+            name: '首件两检',
+            type: 'qualityInspection',
+            bjColor: '#920077',
+            isShow: 'mes:firstarticledualinspection'
+          },
+
+          {
+            name: '报工',
+            type: 'job',
+            bjColor: '#157A2C',
+            isShow: 'mes:workreport:save'
+          },
+
+          {
+            name: '产后检查',
+            type: 'postpartumExamination',
+            bjColor: '#9955FF',
+            isShow: 'mes:producetaskrulerecord:save3'
+          },
+          {
+            name: 'BOM',
+            type: 'bom',
+            bjColor: '#BB5500',
+            isShow: 'mes:workorder:bom'
+          }
+        ],
         disableObj: {
           preResult: {
             buts: ['投料', '过程控制', '产后检查', '报工'],
@@ -343,17 +375,21 @@
       },
       type: {
         handler(v) {
-          if (v == '2' || v == '3' || v == '6') {
-            let btnList2 = this.btnList2.filter((item) => {
-              if (v != 6) {
-              }
-            });
+          if (this.activeName == '0') {
+            if (v == '2' || v == '3' || v == '6') {
+              let btnList2 = this.btnList2.filter((item) => {
+                if (v != 6) {
+                }
+              });
 
-            this.$set(this, 'btnList', this.btnList2);
-          } else if (v == '5') {
-            this.$set(this, 'btnList', this.btnList3);
-          } else {
-            this.$set(this, 'btnList', this.btnList1);
+              this.$set(this, 'btnList', this.btnList2);
+            } else if (v == '5') {
+              this.$set(this, 'btnList', this.btnList3);
+            } else {
+              this.$set(this, 'btnList', this.btnList1);
+            }
+          } else if (this.activeName == '1') {
+            this.$set(this, 'btnList', this.taskList);
           }
         },
         immediate: true,

+ 1 - 1
src/views/produce/components/taskWorkList.vue

@@ -360,7 +360,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 200,
+            width: 120,
             align: 'center',
             resizable: false,
             fixed: 'right',

+ 48 - 30
src/views/produce/index.vue

@@ -345,6 +345,7 @@
           :singleReportInspection="singleReportInspection"
           style="background: rgba(223, 250, 222, 0.6); padding: 10px"
           :isPreProductionResult="isPreProductionResult"
+          :activeName="activeName"
         ></footBtn>
 
         <!-- <div class="box"> -->
@@ -1669,7 +1670,7 @@
       async handleJob() {
         const resultValue = await this.getFirstArticleConfig();
 
-        if (this.activeName === '1') {
+        if (this.activeName == '1') {
           return this.handleTaskJob(resultValue);
         }
 
@@ -1770,7 +1771,7 @@
 
       /* ================== pick ================== */
       handlePick() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (!this.checkWorkOrder({ min: 1 })) return;
 
         this.$nextTick(() => {
@@ -1780,7 +1781,7 @@
 
       /* ================== workStep ================== */
       handleWorkStep() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (
           !this.checkWorkOrder({
             min: 1,
@@ -1795,7 +1796,7 @@
 
       /* ================== task ================== */
       handleTask() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (
           !this.checkWorkOrder({
             min: 1,
@@ -1813,7 +1814,7 @@
 
       /* ================== work ================== */
       async handleWork() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (
           !this.checkWorkOrder({
             min: 1,
@@ -1840,7 +1841,7 @@
 
       /* ================== device ================== */
       handleDevice() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (!this.taskObj.id) {
           return this.$message.warning('请选择工序');
         }
@@ -1849,32 +1850,49 @@
 
       /* ================== bom ================== */
       handleBom() {
-        if (this.activeName !== '0') return;
-        if (
-          !this.checkWorkOrder({
-            min: 1,
-            max: 1,
-            msg: { max: '查看BOM详情只能选择一个工单!' }
-          })
-        )
-          return;
+        if (this.activeName == '0') {
+          if (
+            !this.checkWorkOrder({
+              min: 1,
+              max: 1,
+              msg: { max: '查看BOM详情只能选择一个工单!' }
+            })
+          )
+            return;
 
-        const row = this.workData.list[0];
-        this.$refs.bomDrawer.open({
-          categoryId: row.categoryId,
-          categoryName: row.bomCategoryName,
-          code: row.code,
-          versions: row.bomCategoryVersions,
-          rootPathIdParent: row.categoryLevelPathIdParent || '',
-          isProduct: true,
-          bomType: Number(row.bomType),
-          isTemp: 0
-        });
+          const row = this.workData.list[0];
+          this.$refs.bomDrawer.open({
+            categoryId: row.categoryId,
+            categoryName: row.bomCategoryName,
+            code: row.code,
+            versions: row.bomCategoryVersions,
+            rootPathIdParent: row.categoryLevelPathIdParent || '',
+            isProduct: true,
+            bomType: Number(row.bomType),
+            isTemp: 0
+          });
+        } else if (this.activeName == '1') {
+          if (!this.taskData) {
+            return this.$message.warning('请选择一条任务单');
+          }
+
+          const row = this.taskData;
+          this.$refs.bomDrawer.open({
+            categoryId: row.categoryId,
+            categoryName: row.bomCategoryName,
+            code: row.code,
+            versions: row.bomCategoryVersions,
+            rootPathIdParent: row.categoryLevelPathIdParent || '',
+            isProduct: true,
+            bomType: Number(row.bomType),
+            isTemp: 0
+          });
+        }
       },
 
       /* ================== Outsourcing ================== */
       handleOutsourcing() {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (
           !this.checkWorkOrder({
             min: 1,
@@ -1889,7 +1907,7 @@
 
       /* ================== 产前 / 过程 / 产后 ================== */
       handleInspection(type) {
-        if (this.activeName !== '0') return;
+        if (this.activeName != '0') return;
         if (
           !this.checkWorkOrder({
             min: 1,
@@ -1907,7 +1925,7 @@
 
       /* ================== error ================== */
       handleError() {
-        if (this.activeName === '0') {
+        if (this.activeName == '0') {
           if (this.workListIds.length !== 1) {
             return this.$message.warning('异常只能选择一个工单!');
           }
@@ -1917,7 +1935,7 @@
 
       /* ================== 首件两检 ================== */
       handleQualityInspection() {
-        if (this.activeName === '0') {
+        if (this.activeName == '0') {
           if (
             !this.checkWorkOrder({
               min: 1,