longfenglin 1 год назад
Родитель
Сommit
6af17fd70d

+ 9 - 5
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -120,6 +120,7 @@
             placeholder="请选择"
             @change="(e) => selectVal(e, row, $index)"
             size="mini"
+            :disabled="isDetails"
           >
             <el-option
               v-for="item in deviceList"
@@ -143,6 +144,7 @@
             size="mini"
             v-model="row.extInfo.heatNumber"
             placeholder="请输入炉次号"
+            :disabled="isDetails"
           />
         </template>
       </el-table-column>
@@ -265,23 +267,25 @@
       },
 
       changeHeatNumber() {
-        console.log(this.deviceList);
+        console.log(this.deviceList,'aahashasoshaiuhuigwsiu');
 
         this.deviceList.forEach((f) => {
-          this.list.forEach((o) => {
+          this.list.forEach((o,index) => {
             if (
               o.deviceId &&
               f.id == o.deviceId &&
               this.deviceList.length > 1
             ) {
-              o.extInfo.heatNumber = f.extInfo.heatNumber;
+              // o.extInfo.heatNumber = f.extInfo.heatNumber;
               o['workstationName'] = f.workstationName;
+              this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
+              this.$forceUpdate();
             } else if (this.deviceList.length == 1) {
               o['deviceName'] = this.deviceList[0].name;
               o['deviceId'] = this.deviceList[0].id;
               o['workstationName'] = this.deviceList[0].workstationName;
-              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-
+              // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+              this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
               this.$forceUpdate();
             }
           });

+ 32 - 1
src/views/produce/components/feeding/components/workOrderBom.vue

@@ -43,6 +43,27 @@
             </div>
           </div>
         </div>
+
+        <div class="item rx-sc">
+          <div class="rx ww50">
+            <div class="lable rx-cc">生产编号</div>
+            <div class="content">{{ item.productionCodes }}</div>
+          </div>
+          <div class="rx ww30">
+            <div class="lable rx-cc">最新工单状态</div>
+            <div class="content rx-sc">
+              <div>{{ sumStatus(item) }}</div>
+            </div>
+          </div>
+
+          <div class="rx ww20">
+            <div class="lable rx-cc ww60">报工类型</div>
+            <div class="content content_num">
+              <div>{{ item.singleReport == 1 ? '单个报工' : '批量报工' }}</div>
+            </div>
+          </div>
+        </div>
+
       </div>
     </div>
   </div>
@@ -68,7 +89,17 @@
       return {};
     },
 
-    methods: {}
+    methods: {
+      sumStatus(row) {
+
+      if (row.reportStatus === 1) {
+        return '已报工'
+      }
+      if (row.feedStatus === 1) {
+        return '已投料'
+      }
+    },
+    }
   };
 </script>
 

+ 1 - 1
src/views/produce/components/jobBooking/components/jobDdBom.vue

@@ -109,7 +109,7 @@
                     <div class="rx ww43" v-if="item.currentTaskDiagram.isFirstTask">
                         <div class="lable lable100 rx-cc"></div>
                         <el-button class="" @click="singleQuery" type="primary">
-                            确认
+                            创建在制品
                         </el-button>
                     </div>
                 </div>

+ 32 - 14
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -83,13 +83,14 @@
 
       <el-table-column v-if="singleReport == 1 && deviceList.length > 0" width="140" label="设备" prop="deviceId">
         <template slot-scope="{ row, $index }">
-          <!-- <el-select
+          <el-select
             class="content_num"
             v-model="row.deviceId"
             filterable
             placeholder="请选择"
             @change="(e) => selectVal(e, row, $index)"
             size="mini"
+            :disabled="isDetails"
           >
             <el-option
               v-for="item in deviceList"
@@ -98,14 +99,14 @@
               :key="item.id || item.instanceId"
             >
             </el-option>
-          </el-select> -->
-          {{ row.deviceName || row.extInfo.deviceName }}
+          </el-select>
+          <!-- {{ row.deviceName || row.extInfo.deviceName }} -->
         </template>
       </el-table-column>
 
       <el-table-column v-if="singleReport == 1 && deviceList.length > 0" label="炉次号" width="90" prop="heatNumber">
         <template slot-scope="{ row, $index }">
-          <el-input size="mini" class="content_num" v-model="row.extInfo.heatNumber" placeholder="请输入炉次号" />
+          <el-input size="mini" class="content_num" v-model="row.extInfo.heatNumber" placeholder="请输入炉次号" :disabled="isDetails"/>
         </template>
       </el-table-column>
 
@@ -389,7 +390,6 @@ export default {
     this.getTaskFn();
   },
 
-
   // item
   data() {
     return {
@@ -483,31 +483,49 @@ export default {
       console.log('this.list33333',this.list)
     },
 
-    changeHeatNumber() {
-      if (this.deviceList.length > 0) {
-        const device = this.deviceList[0];
-        this.$emit('update:heatNumber', device.heatNumber);
-      }
-    },
+    // changeHeatNumber() {
+    //   if (this.deviceList.length > 0) {
+    //     const device = this.deviceList[0];
+    //     this.$emit('update:heatNumber', device.heatNumber);
+    //   }
+    // },
 
     getTaskFn() {
       getTaskInstanceList(this.item.workOrderId).then((res) => {
         this.stepsList = res;
       });
     },
+    selectVal(e, item, idx) {
+        let obj = this.deviceList.find((f) => f.id == e);
+
+        this.$set(
+          this.list[idx],
+          'deviceName',
+          obj.name + '-' + obj.codeNumber
+        );
+        this.$set(
+          this.list[idx]['extInfo'],
+          'heatNumber',
+          obj.extInfo.heatNumber
+        );
+      },
 
     changeHeatNumber() {
       this.deviceList.forEach((f) => {
-        this.list.forEach((o) => {
+        this.list.forEach((o,index) => {
           if (
             o.deviceId &&
             f.instanceId == o.deviceId &&
             this.deviceList.length > 1
           ) {
-            o.extInfo.heatNumber = f.extInfo.heatNumber;
+            // o.extInfo.heatNumber = f.extInfo.heatNumber;
+            this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
             this.$forceUpdate();
           } else if (this.deviceList.length == 1) {
-            o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+            o['deviceId'] = this.deviceList[0].id;
+            console.log('111111',this.deviceList[0].id)
+            // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+            this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
             this.$forceUpdate();
           }
         });

+ 62 - 12
src/views/produce/components/jobBooking/components/semiProductJobBomPL.vue

@@ -66,6 +66,7 @@
                         size="mini"
                         v-model="it.allReportWeight"
                         type="number"
+                        @input="blurWeight(it, $index, yyIdx)"
                       ></el-input>
                     </div>
 
@@ -150,6 +151,7 @@
                         size="mini"
                         v-model="it.allReportWeight"
                         type="number"
+                        @input="blurWeight2(it, $index, yyIdx)"
                       ></el-input>
                     </div>
 
@@ -295,13 +297,14 @@
         prop="deviceId"
       >
         <template slot-scope="{ row, $index }">
-          <!-- <el-select
+          <el-select
             class="content_num"
             v-model="row.deviceId"
             filterable
             placeholder="请选择"
             @change="(e) => selectVal(e, row, $index)"
             size="mini"
+            :disabled="isDetails"
           >
             <el-option
               v-for="item in deviceList"
@@ -310,8 +313,8 @@
               :key="item.id || item.instanceId"
             >
             </el-option>
-          </el-select> -->
-          {{ row.deviceName || row.extInfo.deviceName }}
+          </el-select>
+          <!-- {{ row.deviceName || row.extInfo.deviceName }} -->
         </template>
       </el-table-column>
 
@@ -327,6 +330,7 @@
             class="content_num"
             v-model="row.extInfo.heatNumber"
             placeholder="请输入炉次号"
+            :disabled="isDetails"
           />
         </template>
       </el-table-column>
@@ -379,6 +383,9 @@
       },
       singleReport: {
         default: null
+      },
+      index: {
+        default: null
       }
     },
 
@@ -387,6 +394,7 @@
         immediate: true,
         deep: true,
         handler(newVal) {
+          console.log('cccccc',newVal)
           this.deviceList = newVal;
           this.changeHeatNumber();
         }
@@ -431,19 +439,36 @@
           this.stepsList = res;
         });
       },
+      selectVal(e, item, idx) {
+        let obj = this.deviceList.find((f) => f.id == e);
+
+        this.$set(
+          this.list[idx],
+          'deviceName',
+          obj.name + '-' + obj.codeNumber
+        );
+        this.$set(
+          this.list[idx]['extInfo'],
+          'heatNumber',
+          obj.extInfo.heatNumber
+        );
+      },
 
       changeHeatNumber() {
         this.deviceList.forEach((f) => {
-          this.list.forEach((o) => {
+          this.list.forEach((o,index) => {
             if (
               o.deviceId &&
               f.instanceId == o.deviceId &&
               this.deviceList.length > 1
             ) {
-              o.extInfo.heatNumber = f.extInfo.heatNumber;
+              // o.extInfo.heatNumber = f.extInfo.heatNumber;
+              this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
               this.$forceUpdate();
             } else if (this.deviceList.length == 1) {
-              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+              o['deviceId'] = this.deviceList[0].id;
+              // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+              this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
               this.$forceUpdate();
             }
           });
@@ -476,13 +501,11 @@
         this.list[idx].extInfo.batchReportInfo.forEach((m) => {
           count = count + Number(m.allFeedQuantity || 0);
         });
-
+       
         let count2 = 0
 				this.list[idx].extInfo.notBatchReportInfo.forEach(m => {
 					count2 = count2 + Number(m.allFeedQuantity || 0)
 				})
-				
-
 
         if (Number(count + count2)  > this.list[idx].feedQuantity) {
           this.$set(
@@ -493,7 +516,21 @@
           this.$forceUpdate();
 
           this.$message.info('投料数不能大于投料数量');
+          this.$emit('countNumPl',this.list,this.index)
+        }else{
+          this.$emit('countNumPl',this.list,this.index)
         }
+        
+      },
+      blurWeight(it, idx, yyIdx) {
+        let value = it.allReportWeight;
+        value = value.replace(/\./g, '');
+        this.$set(
+          this.list[idx].extInfo.batchReportInfo[yyIdx],
+          'allReportWeight',
+          value
+        );
+        this.$emit('countNumPl',this.list,this.index)
       },
 
       blurNum2(it, idx, yyIdx) {
@@ -515,8 +552,6 @@
 					count2 = count2 + Number(m.allFeedQuantity || 0)
 				})
 				
-
-
         if (Number(count + count2)  > this.list[idx].feedQuantity) {
           this.$set(
             this.list[idx].extInfo.notBatchReportInfo[yyIdx],
@@ -524,13 +559,27 @@
             0
           );
           this.$forceUpdate();
-
           this.$message.info('投料数不能大于投料数量');
+
+          this.$emit('countNumPl',this.list,this.index)
+        }else{
+          this.$emit('countNumPl',this.list,this.index)
         }
       },
+      blurWeight2(it, idx, yyIdx) {
+        let value = it.allReportWeight;
+        value = value.replace(/\./g, '');
+        this.$set(
+          this.list[idx].extInfo.notBatchReportInfo[yyIdx],
+          'allReportWeight',
+          value
+        );
+        this.$emit('countNumPl',this.list,this.index)
+      },
 
       handDel3(idx, yyIdx) {
         this.list[idx].extInfo.batchReportInfo.splice(yyIdx, 1);
+        this.$emit('countNumPl',this.list,this.index)
       },
 
       selectName(value, idx, yyIdx) {
@@ -558,6 +607,7 @@
 
       handDel4(idx, yyIdx) {
         this.list[idx].extInfo.notBatchReportInfo.splice(yyIdx, 1);
+        this.$emit('countNumPl',this.list,this.index)
       },
 
 

+ 55 - 1
src/views/produce/components/jobBooking/index.vue

@@ -84,7 +84,7 @@
           taskObj.type != 4 &&
           taskObj.type != 6 &&
           item.singleReport == 0
-        " :item="item" :list="item.semiProductList" :equipmentList="item.equipmentList"></semiProductJobBomPL>
+        " :item="item" :list="item.semiProductList" :equipmentList="item.equipmentList" @countNumPl="countNumPl" :index="index"></semiProductJobBomPL>
 
         <!-- <semiProductJobBom v-if="
           item.pickOutInList &&
@@ -557,6 +557,25 @@ console.log('4444444444',this.List)
             L.semiProductList = [];
           }
         });
+        console.log('ashsaoghaoghoasg')
+      }
+      let isSemiProduct=false
+      this.List.map((semi)=>{
+        if(semi.semiProductList.length==0 && semi.singleReport==1){
+          isSemiProduct=true
+          this.loading.close();
+          setTimeout(() => {
+            this.$message.warning({
+              message: '请工单编号:' +semi.code+ '先创建在制品',
+              key: semi.code // 使用当前时间作为key,确保唯一性
+            });
+          },500)
+
+        }
+      })
+      if(isSemiProduct){
+        this.loading.close();
+        return
       }
 
       let arr = this.List.filter((L) => L.workReportInfo.executorTime)
@@ -662,6 +681,41 @@ console.log('4444444444',this.List)
       getWarehouseList().then((res) => {
         this.warehouseList = res.data;
       });
+    },
+
+    //批量报工合格不合格重量统计
+    countNumPl(list,index){
+      console.log('11111122222333',list)
+      //合格总数
+      let formedNumCount=0
+      //合格总重量
+      let formedWeightCount=0
+      //不合格总数
+      let notFormedNumCount=0
+      //不合格总重量
+      let notFormedWeightCount=0
+      list.map((item=>{
+        //合格总数
+        item.extInfo.batchReportInfo.forEach((m) => {
+          formedNumCount = formedNumCount + Number(m.allFeedQuantity || 0);
+        });
+        //合格总重量
+        item.extInfo.batchReportInfo.forEach((w) => {
+          formedWeightCount = formedWeightCount + Number(w.allReportWeight || 0);
+        });
+        //不合格总数
+        item.extInfo.notBatchReportInfo.forEach((nf) => {
+          notFormedNumCount = notFormedNumCount + Number(nf.allFeedQuantity || 0);
+        });
+        //不合格总重量
+        item.extInfo.notBatchReportInfo.forEach((nw) => {
+          notFormedWeightCount = notFormedWeightCount + Number(nw.allReportWeight || 0);
+        });
+      }))
+      this.$set(this.List[index].workReportInfo,'formedNum',formedNumCount);//合格总数
+      this.$set(this.List[index].workReportInfo,'formedWeight',formedWeightCount);//合格总重量
+      this.$set(this.List[index].workReportInfo,'notFormedNum',notFormedNumCount);//不合格总数
+      this.$set(this.List[index].workReportInfo,'notFormedWeight',notFormedWeightCount);//不合格总重量
     }
   }
 };

+ 1 - 1
src/views/produce/components/picking/index.vue

@@ -204,7 +204,7 @@ export default {
       workorderList(param).then((res) => {
         let arr = res.map((e) => {
           e.bomDetailDTOS.map((d) => {
-            e.warehouseId = d.warehouseList[0].id
+            e.warehouseId = d.warehouseList.length >0 ? d.warehouseList[0].id : ''
           })
           e.pickList = [...e.bomDetailDTOS];
           e.bomDetailDTOS = [];

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

@@ -355,7 +355,8 @@ export default {
       let req = {
         taskId: e.taskId,
         taskIds: e.taskIds,
-        workOrderId: e.workOrderId
+        workOrderId: e.workOrderId,
+        quantity:e.formedNumLast
       }
       const res = await checkOutsourceMaterial(req);