Ver Fonte

取样质检按钮

longfenglin há 1 ano atrás
pai
commit
6eefc4662d

+ 25 - 5
src/views/produce/components/footBtn.vue

@@ -51,11 +51,11 @@ export default {
 
       ],
       btnList2: [
-        {
-          name: '取样质检',
-          type: 'inspection',
-          bjColor: '#FBD114'
-        },
+        // {
+        //   name: '取样质检',
+        //   type: 'inspection',
+        //   bjColor: '#FBD114'
+        // },
         {
           name: '报工',
           type: 'job',
@@ -107,7 +107,9 @@ export default {
       type: String | Number,
       default: ''
     },
+    singleReportInspection:{
 
+    }
 
   },
 
@@ -161,6 +163,24 @@ export default {
       },
       immediate: true,
       deep: true
+    },
+    singleReportInspection:{
+      handler(v) {
+       if(v==1||v==null){
+          let index=this.btnList2.findIndex(obj => obj.name == '取样质检');
+          if( index !==-1){
+            this.btnList2.splice(0, 1);
+          }
+       }else if(v==0){
+         let arr= {
+          name: '取样质检',
+          type: 'inspection',
+          bjColor: '#FBD114'
+        }
+        this.btnList2.unshift(arr)
+       }
+
+      }
     }
 
   },

+ 0 - 1
src/views/produce/components/produceOrder.vue

@@ -357,7 +357,6 @@ export default {
       ids = val.map((item) => {
         return item.id;
       });
-
       this.$emit('workSelect', { ids: ids, list: val });
     },
 

+ 3 - 2
src/views/produce/index.vue

@@ -122,7 +122,7 @@
 
         </ele-split-layout>
 
-        <footBtn @footBtn="footBtn" :type="type" style="background: rgba(223, 250, 222,0.6);padding: 10px;"></footBtn>
+        <footBtn @footBtn="footBtn" :type="type" :singleReportInspection="singleReportInspection" style="background: rgba(223, 250, 222,0.6);padding: 10px;"></footBtn>
 
       </div>
       <!-- <footBtn @footBtn="footBtn"></footBtn> -->
@@ -209,6 +209,7 @@ export default {
       },
       feedNeedEquipment:0,//投料是否要添加生产设备1是0否
       reportNeedFeed:0,//生产质检是否需要处置再报工1是0否
+      singleReportInspection:null,//获取选中的工单是单个还是批量
     };
   },
 
@@ -373,7 +374,7 @@ export default {
     },
 
     workSelect(data) {
-
+      this.singleReportInspection=data.list.length>0?data.list[0].singleReport:null;//获取选中的工单是单个还是批量
       this.isStep = true;
       this.operationType = null;
       this.workListIds = data.ids;

+ 6 - 5
src/views/workReport/index.vue

@@ -44,6 +44,7 @@ export default {
 
   created() {
     this.init()
+    this.getTaskFn();
   },
   methods: {
     //  折叠悬浮中样式调整
@@ -58,12 +59,12 @@ export default {
         this.routeList = res;
 
         // 使用findIndex方法查找
-        const index = this.routeList.findIndex(
-          (item) => Number(item.taskId) == Number(this.workOrderInfo.taskId)
-        );
+        // const index = this.routeList.findIndex(
+        //   (item) => Number(item.taskId) == Number(this.workOrderInfo.taskId)
+        // );
 
         
-        this.desIndex = index;
+        // this.desIndex = index;
         console.log(this.routeList,'888888');
         // this.newId = this.routeList[this.desIndex].taskId||'';
 
@@ -73,7 +74,7 @@ export default {
         //   this.curTaskObj = JSON.parse(JSON.stringify(this.routeList[0]));
         //   this.desIndex = 0;
         // }
-        this.activeIndex = index;
+        // this.activeIndex = index;
       });
     },