longfenglin hai 1 ano
pai
achega
52317fa202

+ 9 - 0
src/api/produce/picking.js

@@ -10,6 +10,15 @@ export async function batchSave(data) {
     }
     return Promise.reject(new Error(res.data.message));
   }
+
+  // 中能领料保存
+export async function znfindVoucherList(data) {
+    const res = await request.post(`/mes/workorder/findVoucherList`, data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
   
  
 

+ 9 - 0
src/api/produce/workOrder.js

@@ -108,6 +108,15 @@ export async function workorderList(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 中能根据工单ids获取工单列表
+export async function znworkorderList(data) {
+  const res = await request.post('/mes/workorder/znList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 
 
 

+ 165 - 9
src/views/produce/components/jobBooking/components/semiProductJobBomPL.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="title_box rx-bc mt6">
-      <div class="name">报工信息({{ list.length || 0 }})个 </div>
+      <div class="name">报工信息1111({{ list.length || 0 }})个 </div>
 
       <div class="rx-bc"> </div>
     </div>
@@ -36,6 +36,8 @@
                   <div class="item ww30"
                     >报工总重量 /{{ row.extInfo.weightUnit }}
                   </div>
+                  <div class="item ww30">设备</div>
+                  <div class="item ww30">炉次号</div>
                   <div class="item ww30">处置</div>
                   <div class="item ww10">操作</div>
                 </div>
@@ -69,7 +71,37 @@
                         @input="blurWeight(it, $index, yyIdx)"
                       ></el-input>
                     </div>
+<!-- 1 -->
+                    <div class="item ww30">
+                      <el-select
+                        class="content_num"
+                        v-model="it.deviceId"
+                        filterable
+                        placeholder="请选择"
+                        @change="(e) => selectValBatch(e, row, $index, yyIdx)"
+                        size="mini"
+                        :disabled="isDetails"
+                       >
+                     <el-option
+                       v-for="item in deviceList"
+                      :label="item.name"
+                      :value="item.id || item.instanceId"
+                      :key="item.id || item.instanceId"
+                     >
+                      </el-option>
+                    </el-select>
+                    </div>
 
+                    <div class="item ww30">
+                      <el-input
+                       size="mini"
+                       class="content_num"
+                       v-model="it.heatNumber"
+                       placeholder="请输入炉次号"
+                      :disabled="isDetails"
+                    />
+                    </div>
+<!-- 2 -->
                     <div class="item ww30">
                       <el-select
                         size="mini"
@@ -120,6 +152,8 @@
                   <div class="item ww20"
                     >类型
                   </div>
+                  <div class="item ww30">设备</div>
+                  <div class="item ww30">炉次号</div>
                   <div class="item ww30">处置/原因</div>
                   <div class="item ww10">操作</div>
                 </div>
@@ -176,7 +210,37 @@
                       </el-select>
                     </div>
 
+<!-- 1 -->
+                    <div class="item ww30">
+                      <el-select
+                        class="content_num"
+                        v-model="it.deviceId"
+                        filterable
+                        placeholder="请选择"
+                        @change="(e) => selectValNoBatch(e, row, $index, yyIdx)"
+                        size="mini"
+                        :disabled="isDetails"
+                       >
+                     <el-option
+                       v-for="item in deviceList"
+                      :label="item.name"
+                      :value="item.id || item.instanceId"
+                      :key="item.id || item.instanceId"
+                     >
+                      </el-option>
+                    </el-select>
+                    </div>
 
+                    <div class="item ww30">
+                      <el-input
+                       size="mini"
+                       class="content_num"
+                       v-model="it.heatNumber"
+                       placeholder="请输入炉次号"
+                      :disabled="isDetails"
+                    />
+                    </div>
+<!-- 2 -->
                     <div class="item ww30" v-if="it.notType != 5">
                       <div v-if="isDetails">{{ it.notReason }}</div>
                       <el-input
@@ -186,6 +250,7 @@
                         v-model="it.notReason"
                       ></el-input>
                     </div>
+                    
 
                     <div class="item ww30" v-if="it.notType == 5">
                       <el-select
@@ -290,7 +355,7 @@
         </template>
       </el-table-column>
 
-      <el-table-column
+      <!-- <el-table-column
         v-if="deviceList.length > 0"
         width="140"
         label="设备"
@@ -314,7 +379,7 @@
             >
             </el-option>
           </el-select>
-          <!-- {{ row.deviceName || row.extInfo.deviceName }} -->
+          {{ row.deviceName || row.extInfo.deviceName }}
         </template>
       </el-table-column>
 
@@ -333,7 +398,7 @@
             :disabled="isDetails"
           />
         </template>
-      </el-table-column>
+      </el-table-column> -->
 
       <el-table-column label="投料数量" width="90" prop="feedQuantity">
         <template slot-scope="{ row, $index }">
@@ -395,7 +460,12 @@
         deep: true,
         handler(newVal) {
           console.log('cccccc',newVal)
-          this.deviceList = newVal;
+          
+          //设备下拉框数据来源
+          let newData=JSON.parse(JSON.stringify(newVal))
+          // this.deviceList = newData;
+          this.deviceArr(newData)
+
           this.changeHeatNumber();
         }
       }
@@ -453,22 +523,94 @@
           obj.extInfo.heatNumber
         );
       },
+      selectValBatch(e, item, idx,bidx){
+         let obj = this.deviceList.find((f) => f.id||f.instanceId == e);
+         //设备名称
+         this.$set(this.list[idx].extInfo.batchReportInfo[bidx],'deviceName',obj.name)
+         //炉次号
+         this.$set(this.list[idx].extInfo.batchReportInfo[bidx], 'heatNumber',obj.extInfo.heatNumber)
+         //设备id
+         this.$set(this.list[idx].extInfo.batchReportInfo[bidx],'deviceId',obj.id||obj.instanceId)
+      },
+      selectValNoBatch(e, item, idx,bidx){
+         let obj = this.deviceList.find((f) => f.id||f.instanceId == e);
+         //设备名称
+         this.$set(this.list[idx].extInfo.notBatchReportInfo[bidx],'deviceName',obj.name)
+         //炉次号
+         this.$set(this.list[idx].extInfo.notBatchReportInfo[bidx], 'heatNumber',obj.extInfo.heatNumber)
+         //设备id
+         this.$set(this.list[idx].extInfo.notBatchReportInfo[bidx],'deviceId',obj.id||obj.instanceId)
+      },
+
+      deviceArr(data){
+        data.forEach((o,i) => {
+            o.id=o.id ? o.id.toString()+'/'+i : '';
+            o.instanceId=o.instanceId ? o.instanceId.toString()+'/'+i : '';
+        })
+
+        this.deviceList = data;
+        if (this.deviceList.length > 0) {
+            this.list.forEach((o,index) => {
+           
+              //合格分批设备炉次号
+              o.extInfo.batchReportInfo.map((report,ridx)=>{
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceName',this.deviceList[0].name)
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceId',this.deviceList[0].id||this.deviceList[0].instanceId)
+              })
+              o.extInfo.notBatchReportInfo.map((noReport,noidx)=>{
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceName',this.deviceList[0].name)
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceId',this.deviceList[0].id||this.deviceList[0].instanceId)
+              })
+              //合格分批设备炉次号
+              this.$forceUpdate();
+            
+            })
+          }
+      },
 
       changeHeatNumber() {
         this.deviceList.forEach((f) => {
           this.list.forEach((o,index) => {
+            //  o.deviceId &&
+            //   f.instanceId == o.deviceId &&
             if (
-              o.deviceId &&
-              f.instanceId == o.deviceId &&
               this.deviceList.length > 1
             ) {
               // o.extInfo.heatNumber = f.extInfo.heatNumber;
               this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
+
+              //合格分批设备炉次号
+              o.extInfo.batchReportInfo.map((report,ridx)=>{
+                if(report.deviceId==f.instanceId){
+                   this.$set(this.list[index].extInfo.batchReportInfo[ridx],'heatNumber',f.extInfo.heatNumber)
+                }
+              })
+              o.extInfo.notBatchReportInfo.map((noReport,noidx)=>{
+                if(noReport.deviceId==f.instanceId){
+                   this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'heatNumber',f.extInfo.heatNumber)
+                }
+              })
+              //合格分批设备炉次号
               this.$forceUpdate();
+              
             } else if (this.deviceList.length == 1) {
               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)
+              
+               //合格分批设备炉次号
+              o.extInfo.batchReportInfo.map((report,ridx)=>{
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceId',this.deviceList[0].id)
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'heatNumber',this.deviceList[0].extInfo.heatNumber)
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceName',this.deviceList[0].extInfo.name)
+              })
+              //合格分批设备炉次号
+              o.extInfo.notBatchReportInfo.map((noReport,noidx)=>{
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceId',this.deviceList[0].id)
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'heatNumber',this.deviceList[0].extInfo.heatNumber)
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceName',this.deviceList[0].extInfo.name)
+              })
+
               this.$forceUpdate();
             }
           });
@@ -480,11 +622,18 @@
       },
 
       handAddListPL(idx) {
+        let deviceid=''
+        if(this.deviceList.length>0){
+          deviceid=this.deviceList[0].id||this.deviceList[0].instanceId
+        }
         this.list[idx].extInfo.batchReportInfo.push({
           allFeedQuantity: '',
           allReportWeight: '',
           taskId: '',
-          taskName: ''
+          taskName: '',
+          deviceId: deviceid?deviceid:'',
+          deviceName:this.deviceList.length>0?this.deviceList[0].deviceName:'',
+          heatNumber: this.deviceList.length>0?this.deviceList[0].extInfo.heatNumber:'',
         });
       },
 
@@ -594,12 +743,19 @@
 
       
       handAddListPL4(idx) {
+        let deviceid=''
+        if(this.deviceList.length>0){
+          deviceid=this.deviceList[0].id||this.deviceList[0].instanceId
+        }
         this.list[idx].extInfo.notBatchReportInfo.push({
           allFeedQuantity: '',
 					notType: '',
 					taskId: '',
 					taskName: '',
-					notReason: ''
+					notReason: '',
+          deviceId: deviceid?deviceid:'',
+          deviceName:this.deviceList.length>0?this.deviceList[0].deviceName:'',
+          heatNumber: this.deviceList.length>0?this.deviceList[0].extInfo.heatNumber:''
         });
         this.$forceUpdate();
        

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

@@ -570,8 +570,25 @@ console.log('4444444444',this.List)
               key: semi.code // 使用当前时间作为key,确保唯一性
             });
           },500)
-
+        }else{
+          semi.semiProductList.map((ditem)=>{
+            if(ditem.extInfo.batchReportInfo){
+              ditem.extInfo.batchReportInfo.map((baItem)=>{
+                 let idvalue=baItem.deviceId?baItem.deviceId.split('/'):''
+                 baItem.deviceId=idvalue?idvalue[0]:''
+              })
+              
+            }
+            if(ditem.extInfo.notBatchReportInfo){
+              ditem.extInfo.notBatchReportInfo.map((noItem)=>{
+                 let idvalue=noItem.deviceId?noItem.deviceId.split('/'):''
+                 noItem.deviceId=idvalue?idvalue[0]:''
+              })
+            }
+          })
         }
+
+
       })
       if(isSemiProduct){
         this.loading.close();

+ 3 - 3
src/views/produce/components/outsourcing/index.vue

@@ -197,18 +197,18 @@ export default {
             console.log(arr);
 
             if (this.newStepsList.length) {
-                const id = this.newStepsList[0].sourceTaskId;
+                const id = this.newStepsList[0].taskId;
                 //isFirstTask 1是首工序 0不是
                 if (arr.isFirstTask) {
 
                     this.attributeData.sceneText = "首工序";
                     this.attributeData.outsourceScene = 1;
-                    if (arr.taskIds !== id) {
+                    if (arr.taskId !== id) {
                         this.attributeData.sceneText = "首工序及多工序";
                         this.attributeData.outsourceScene = 4;
                     }
                 } else {
-                    if (arr.taskIds === id) {
+                    if (arr.taskId === id) {
                         // 单工序
                         this.attributeData.sceneText = "单工序"
                         this.attributeData.outsourceScene = 2;

+ 1 - 0
src/views/produce/components/outsourcing/outsourceList.vue

@@ -563,6 +563,7 @@ export default {
 				materialList: this.materialList,
 				standardOutputList: this.standardOutputList,
 			}
+			
 			applyoutsourceSave(param).then(res => {
 				return this.$message({
 					message: "提交成功",

+ 65 - 14
src/views/produce/components/picking/index.vue

@@ -38,7 +38,7 @@
               <div class="name">批次号</div>
               <div class="content">{{ item.batchNo }}</div>
             </div>
-            <div class="col pd6">
+            <div class="col pd6" v-if="clientEnvironmentId!=21">
               <el-button type="primary" size="mini" @click="openPicking(item.id, item)">新增</el-button>
             </div>
           </div>
@@ -125,6 +125,13 @@
                     </el-option>
                   </el-select>
                 </div>
+                <div v-else-if="clientEnvironmentId==21">
+                
+                  <el-select v-model="row.warehouseId" placeholder="请选择" filterable>
+                    <el-option v-for="item in row.warehouseList" :label="item.name" :value="item.id" :key="item.id">
+                    </el-option>
+                  </el-select>
+                </div>
 
                 <div v-else>
                   <el-select v-model="row.warehouseId" placeholder="请选择" filterable>
@@ -157,9 +164,9 @@
 
 <script>
 import pickingList from './pickingList.vue';
-import { workorderList, getCode,getInventoryTotal } from '@/api/produce/workOrder';
+import { workorderList, getCode,getInventoryTotal,znworkorderList } from '@/api/produce/workOrder';
 import { typeName } from '../common.js';
-import { batchSave } from '@/api/produce/picking';
+import { batchSave,znfindVoucherList } from '@/api/produce/picking';
 
 export default {
   components: {
@@ -191,6 +198,9 @@ export default {
   computed: {
     taskObj() {
       return this.$store.state.user.taskObj;
+    },
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     }
   },
 
@@ -201,7 +211,34 @@ export default {
         ids: this.workListIds,
         taskId: this.taskObj.id
       };
-      workorderList(param).then((res) => {
+      console.log('1111122222',this.clientEnvironmentId)
+      if(this.clientEnvironmentId==21){
+      znworkorderList(param).then((res) => {
+        let arr = res.map((e) => {
+          e.bomDetailDTOS.map((d) => {
+            e.warehouseId = d.warehouseList.length >0 ? d.warehouseList[0].id : ''
+          })
+          e.pickList = [...e.bomDetailDTOS];
+          e.bomDetailDTOS = [];
+          return e;
+        });
+        this.pickName = res[0].batchNo||'' + res[0].bomCategoryId||'';
+
+        // arr.bomDetailDTOS.map(v=>{
+        //   this.getInventoryTotalFn(v.id)
+        // })
+
+        // getInventoryTotal
+        // this.workList = arr;
+        this.$set(this, 'workList', arr);
+        
+
+
+        this.getOrderCode();
+        this.$forceUpdate();
+      });
+      }else{
+        workorderList(param).then((res) => {
         let arr = res.map((e) => {
           e.bomDetailDTOS.map((d) => {
             e.warehouseId = d.warehouseList.length >0 ? d.warehouseList[0].id : ''
@@ -225,6 +262,8 @@ export default {
         this.getOrderCode();
         this.$forceUpdate();
       });
+      }
+      
     },
 
     async getInventoryTotalFn(id) {
@@ -269,7 +308,7 @@ export default {
     },
 
     save() {
-      console.log(this.workList);
+      console.log(this.workList,'cvassasasag');
       if (this.workList.length > 0) {
         let bol;
         let _i;
@@ -337,16 +376,28 @@ export default {
         };
       });
 
-      let param = {
-        allPickList: _arr,
-        pickName: this.pickName,
-        pickCode: this.pickCode
-      };
+      if(this.clientEnvironmentId==21){
+        let param={
+          workOrderId: this.workListIds[0],
+          pickingCode: this.pickCode
+        }
+          znfindVoucherList(param).then((res) => {
+            this.$message.success('领料成功');
+          });
+      }
+        let param = {
+          allPickList: _arr,
+          pickName: this.pickName,
+          pickCode: this.pickCode
+        };
+        batchSave(param).then((res) => {
+          this.$message.success('领料成功');
+          this.$emit('close', true);
+        });
+      
 
-      batchSave(param).then((res) => {
-        this.$message.success('领料成功');
-        this.$emit('close', true);
-      });
+
+      
     }
   },
 

+ 569 - 0
src/views/produce/components/warehousing/components/jobDdBom.vue

@@ -0,0 +1,569 @@
+<template>
+    <div>
+        <div class="title_box rx-bc mt6">
+            <div class="name">报工信息 </div>
+
+            <div class="rx-bc"> </div>
+        </div>
+
+        <div class="material">
+            <div class="content_table">
+                <div class="item rx-sc">
+                    <div class="rx ww33"
+                        v-if="Object.prototype.hasOwnProperty.call(item, 'product') && clientEnvironmentId != 3">
+                        <div class="lable rx-cc">投料数量</div>
+                        <div class="content">
+                            {{ item.product[0] && item.product[0].feedQuantity }}
+                        </div>
+                    </div>
+
+                    <div class="rx ww33">
+                        <div class="lable lable100 rx-cc">要求生产数量</div>
+                        <div class="content">{{ item.formingNum }} {{ item.unit }}</div>
+                    </div>
+
+                    <div class="rx ww33">
+                        <div class="lable rx-cc">重量</div>
+                        <div class="content">{{ item.formingWeight }}{{ item.weightUnit }}</div>
+                    </div>
+                </div>
+
+
+                <!-- v-if="(clientEnvironmentId == 3 && item.singleReport == 0) ||  taskObj.type == 4 || clientEnvironmentId == 2" -->
+                <div class="item rx-sc">
+                    <div class="rx ww40">
+                        <div class="lable lable100 rx-cc">合格品数量</div>
+                        <div class="content content_num rx-sc">
+                            <el-input size="mini" v-model="item.workReportInfo.formedNum" placeholder="请输入合格品数量"
+                                @input="blurNum">
+                                <template slot="append">{{ item.unit }}</template>
+                            </el-input>
+                        </div>
+                    </div>
+
+                    <div class="rx ww40">
+                        <div class="lable rx-cc">重量</div>
+                        <div class="content content_num rx-sc">
+                            <el-input size="mini" v-model="item.workReportInfo.formedWeight" placeholder="请输入合格品重量">
+                                <template slot="append">{{ item.weightUnit }}</template>
+                            </el-input>
+                        </div>
+                    </div>
+                </div>
+                <!-- v-if="(clientEnvironmentId == 3 && item.singleReport == 0) || taskObj.type == 4 || clientEnvironmentId == 2" -->
+                <!-- v-for="(not, notIndex) in notFormedList" :key="notIndex" -->
+
+                <div class="item rx-sc">
+                    <div class="rx ww40">
+                        <div class="lable lable100 rx-cc">不合格数量</div>
+                        <div class="content content_num rx-sc">
+                            <el-input size="mini" v-model="item.workReportInfo.notFormedNum" placeholder="请输入不合格数量"
+                                @input="changeNum">
+                                <template slot="append">{{ item.unit }}</template>
+                            </el-input>
+                        </div>
+                    </div>
+
+                    <div class="rx ww40">
+                        <div class="lable rx-cc">重量</div>
+                        <div class="content content_num rx-sc">
+                            <el-input size="mini" v-model="item.workReportInfo.notFormedWeight" placeholder="请输入不合格品重量">
+                                <template slot="append">{{ item.weightUnit }}</template>
+                            </el-input>
+                        </div>
+                    </div>
+
+                    <!-- <div class="rw ww20 rx-cc">
+              <div class="penalize" v-if="!isDetails" :style="{ background: not.warehouseId ? '#FFA07A' : '' }"
+                @click="penalize">
+                处置</div>
+              <div class="penalize" v-if="isDetails" :style="{ background: not.warehouseId ? '#FFA07A' : '' }" @click="
+                handleView(isDetails ? not.warehouseName : item.warehouseName)
+                ">
+                查看</div>
+            </div> -->
+                </div>
+
+                <!-- 报工备注 -->
+                <div class="item rx-sc">
+                    <div class="rx ww43"
+                        v-if="Object.prototype.hasOwnProperty.call(item, 'product') && clientEnvironmentId != 3">
+                        <div class="lable lable100 rx-cc">报工备注</div>
+                        <div class="content content_num rx-sc">
+                            <el-input size="mini" v-model="item.workReportInfo.remark" placeholder="请输入报工备注">
+
+                            </el-input>
+
+                        </div>
+                    </div>
+
+                    <div class="rx ww43" v-if="clientEnvironmentId == 2">
+                        <div class="lable lable100 rx-cc">批次号</div>
+                        <div class="content content_num rx-sc">
+                            {{ item.batchNo }}
+                            <el-input size="mini" v-model="item.workReportInfo.batchNo" placeholder="请输入批次号"></el-input>
+
+                        </div>
+                    </div>
+
+                    <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>
+            </div>
+
+        
+
+        </div>
+
+        <!-- <checkbox @click='singleQuery' v-if="item.currentTaskDiagram.isFirstTask"></checkbox> -->
+    </div>
+</template>
+<script>
+import {
+    createInProduct,
+} from '@/api/produce/workOrder';
+
+export default {
+    props: {
+        item: {
+            type: Object,
+            default: () => { }
+        },
+        notFormed: {
+            type: Array,
+            default: () => []
+        },
+        isDetails: {
+            type: Boolean,
+            default: false
+        },
+        warehouseList: {
+            type: Array,
+            default: () => []
+        }
+    },
+
+    watch: {
+        item: {
+            immediate: true,
+            deep: true,
+            handler(newVal) {
+                console.log(newVal, '996633');
+
+                if (newVal.semiProductList.length) {
+                    let formedNum = 0;
+                    let noFormingNum = 0;
+                    let formedWeight = 0
+                    let notFormedWeight = 0
+
+                    newVal.semiProductList.forEach(v => {
+                        // 合格品数量
+                        if (v.extInfo.isQualified == 1) {
+                            formedNum += 1;
+                            formedWeight += (Number(v.extInfo.reportWeight)||0)
+                        } else {
+                            noFormingNum += 1;
+                            notFormedWeight += (Number(v.extInfo.reportWeight)||0)
+                        }
+                    });
+
+                    newVal.workReportInfo.formedNum = formedNum;
+                    newVal.workReportInfo.notFormedNum = noFormingNum;
+                    newVal.workReportInfo.formedWeight = parseFloat(formedWeight.toFixed(3))
+                    newVal.workReportInfo.notFormedWeight = parseFloat(notFormedWeight.toFixed(3))
+                    this.$forceUpdate()
+                   
+
+
+                }
+            }
+        },
+
+        notFormed: {
+            immediate: true,
+            deep: true,
+            handler(newVal) {
+                this.notFormedList = newVal;
+            }
+        }
+    },
+
+    computed: {
+
+        taskObj() {
+            return this.$store.state.user.taskObj;
+        },
+
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        }
+    },
+
+
+    data() {
+        return {
+            list: [],
+            notFormedList: [],
+
+            form: {
+                warehouseId: null
+            },
+
+            visible: false
+        };
+    },
+
+    created() {
+        if (this.isDetails) {
+            this.notFormedList = this.notFormedList.map((m) => {
+                return {
+                    notFormedNum: Number(m.quantity),
+                    notFormedWeight: m.weight,
+                    ...m
+                };
+            });
+        }
+    },
+
+    methods: {
+        getSemiProductList(newVal) {
+            console.log(newVal);
+            if (newVal.semiProductList.length) {
+
+                newVal.semiProductList.map(v => {
+                    v.selected = true;
+                })
+                this.arrDataStatistics(newVal.semiProductList);
+                this.tableData = newVal.semiProductList;
+
+            }
+            if (newVal.pickOutInList.length) {
+
+                newVal.pickOutInList.map(v => {
+                    v.selected = true;
+                })
+                this.arrDataStatistics(newVal.pickOutInList);
+                this.tableData = newVal.pickOutInList;
+
+            }
+        },
+
+
+
+        tableDataFn(tableData) {
+            console.log(tableData);
+            let adultCount = 0;
+            let noAdultCount = 0;
+
+            this.arrDataStatistics(tableData);
+            tableData.forEach(v => {
+                if (v.selected) {
+                    if (v.extInfo.isQualified == 1) {
+                        adultCount += 1
+                    } else {
+                        noAdultCount += 1
+                    }
+
+                }
+            })
+            this.$set(this.item.workReportInfo, 'formedNum', adultCount);
+            this.$set(this.notFormedList[0], 'notFormedNum', noAdultCount);
+            // this.tableData = this.notFormedList;
+            if (!(this.clientEnvironmentId == 3 || this.item.singleReport !== 1)) {
+
+
+
+                this.item.semiProductList = tableData;
+
+
+            }
+
+
+
+        },
+
+
+        singleQuery() {
+            console.log(this.item.workReportInfo);
+
+            if (!this.item.workReportInfo.formedNum) return this.$message.info("请输入合格品数")
+            if (this.item.workReportInfo.notFormedNum == '' || this.item.workReportInfo.notFormedNum == null) return this.$message.info(
+                "请输入不合格品数"
+            )
+
+
+            const req = {
+                "formedNum": this.item.workReportInfo.formedNum,
+                "notFormedNum": this.item.workReportInfo.notFormedNum,
+                "taskId": this.item.workReportInfo.taskId,
+                "workOrderId": this.item.workReportInfo.workOrderId
+            };
+
+            createInProduct(req).then(res => {
+                if (res && res.length) {
+                    this.forValue = res[0];
+
+                    res.map(v => {
+                        v.selected = true;
+                    })
+                    this.list = res;
+                    this.item.semiProductList = res;
+                }
+
+            })
+        },
+
+        penalize() {
+            this.visible = true;
+        },
+
+        handleClose() {
+            this.visible = false;
+        },
+
+        warehouseSave() {
+            this.$set(this.item.notFormedList[0], 'warehouseId', this.form.warehouseId || null)
+
+            this.handleClose()
+            this.$forceUpdate()
+        },
+
+        handleView(name) {
+            this.$message.info(name || '未设置');
+        },
+
+        getDelete(index) {
+            this.list.splice(index, 1);
+        },
+
+        blurNum() {
+
+            let total =
+                Number(this.item.workReportInfo.formedNum) +
+                Number(this.notFormedList[0].notFormedNum);
+
+            console.log(total, '9****');
+
+            this.$emit('modeNum', total);
+
+
+            if (
+                this.item.product[0] &&
+                this.item.product[0].feedQuantity > 0 &&
+                Number(this.item.workReportInfo.formedNum)
+            ) {
+                this.$set(
+                    this.notFormedList[0],
+                    'notFormedNum',
+                    this.item.product[0].feedQuantity -
+                    Number(this.item.workReportInfo.formedNum)
+                );
+                this.notForme();
+            }
+
+            let weight =
+                Number(this.item.workReportInfo.formedNum) *
+                Number(this.item.singleWeight) *
+                Number(this.item.weightMultiple);
+
+            if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
+                weight = parseFloat((weight / 1000).toFixed(2));
+            } else {
+                weight = parseFloat(weight.toFixed(2));
+            }
+
+            console.log(this.item, 'weight');
+
+            this.$set(this.item.workReportInfo, 'formedWeight', weight);
+
+            this.$forceUpdate();
+        },
+
+
+        notForme() {
+
+            let weight = Number(this.notFormedList[0].notFormedNum) * Number(this.item.singleWeight) * Number(this
+                .item.weightMultiple)
+            if (this.item.singleWeightUnit == 'G' || this.item.singleWeightUnit == 'g' || this.item.singleWeightUnit ==
+                '克') {
+                weight = parseFloat((weight / 1000).toFixed(2))
+            } else {
+                weight = parseFloat(weight.toFixed(2))
+            }
+            this.$set(this.notFormedList[0], 'notFormedWeight', weight)
+
+
+            if (this.item.product[0] && this.item.product[0].feedQuantity > 0 && Number(this.notFormedList[0].notFormedNum)) {
+                this.$set(this.item.workReportInfo, 'formedNum', this.item.product[0].feedQuantity - Number(this
+                    .notFormedList[0]
+                    .notFormedNum))
+
+
+                let weight = Number(this.item.workReportInfo.formedNum) * Number(this.item.singleWeight) * Number(this
+                    .item.weightMultiple)
+                if (this.item.singleWeightUnit == 'G' || this.item.singleWeightUnit == 'g' || this.item
+                    .singleWeightUnit == '克') {
+                    weight = parseFloat((weight / 1000).toFixed(2))
+                } else {
+                    weight = parseFloat(weight.toFixed(2))
+                }
+                this.$set(this.item.workReportInfo, 'formedWeight', weight)
+
+            }
+
+
+
+            this.$forceUpdate()
+
+        },
+
+
+
+        changeNum() {
+            this.notForme();
+            // this.blurNum()
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.lable {
+    width: 200px;
+}
+
+.penalize {
+    width: 80px;
+    line-height: 30px;
+    background: #157a2c;
+    font-size: 12px;
+    text-align: center;
+    color: #fff;
+    cursor: pointer;
+}
+
+
+.content_table {
+    width: 100%;
+    border: 1px solid #e3e5e5;
+    position: relative;
+
+    .item {
+        display: flex;
+        border-bottom: 1px solid #e3e5e5;
+
+        .lable {
+            width: 72px;
+            text-align: center;
+            background-color: #f7f9fa;
+            font-size: 12px;
+            border-right: 1px solid #e3e5e5;
+            flex-shrink: 0;
+        }
+
+        .lable80 {
+            width: 80px !important;
+            font-size: 12px;
+        }
+
+        .lable90 {
+            width: 90px !important;
+        }
+
+        .lable100 {
+            width: 100px !important;
+        }
+
+
+        .ww60 {
+            width: 60px;
+        }
+
+        .content {
+            width: 250px;
+            min-height: 32px;
+            font-size: 14px;
+            line-height: 14px;
+            font-style: normal;
+            font-weight: 400;
+            padding: 9px 4px;
+            box-sizing: border-box;
+            word-wrap: break-word;
+            flex-grow: 1 !important;
+
+            .unit {
+                padding: 0 2px;
+                font-size: 12px;
+                color: #404446;
+            }
+        }
+
+        .content_num {
+            display: flex;
+            align-items: center;
+            padding: 2px;
+            --input-background-color: #f0f8f2;
+        }
+
+        .pd2 {
+            padding: 2px 4px;
+        }
+
+        &:last-child {
+            border-bottom: none;
+        }
+    }
+
+    .ww55 {
+        width: 55%;
+    }
+
+    .ww50 {
+        width: 50%;
+    }
+
+    .ww45 {
+        width: 45%;
+    }
+
+    .ww40 {
+        width: 40%;
+    }
+
+    .ww30 {
+        width: 30%;
+    }
+
+    .ww33 {
+        width: 33.33%;
+    }
+
+    .ww20 {
+        width: 20%;
+    }
+
+    .del_box {
+        position: absolute;
+        right: 2px;
+        top: 2px;
+    }
+
+    .sort_index {
+        position: absolute;
+        left: 2px;
+        top: 2px;
+        width: 14px;
+        height: 14px;
+        line-height: 14px;
+        text-align: center;
+        color: #fff;
+        font-size: 12px;
+        border-radius: 50%;
+        background: rgb(21, 122, 44);
+    }
+}
+</style>

+ 20 - 4
src/views/produce/components/warehousing/index.vue

@@ -85,6 +85,9 @@
           
         </div>
 
+        <div>
+          <jobDdBom :item='item' ref='jobRef' :notFormed='item.notFormedList' :warehouseList="warehouseList"></jobDdBom>
+        </div>
 
         <!-- item.currentTaskDiagram.type == 4 ? item.pickOutInList : item.semiProductList -->
 
@@ -107,13 +110,15 @@ import { listByIdsReport } from '@/api/produce/job';
 import { listPcToWarehouseTG, listPCToWarehouse } from '@/api/produce/workOrder';
 
 import { jobSave } from '@/api/produce/workOrder';
+import jobDdBom from './components/jobDdBom.vue';
 
 export default {
   components: {
     workOrderBom,
     semiProductJobBomQT,
     packagingGroupingTwx,
-    packingTgBom
+    packingTgBom,
+    jobDdBom
   },
   props: {
     workListIds: {
@@ -275,11 +280,21 @@ export default {
     },
 
     save() {
-      let _arr = [];
+
+      if(this.clientEnvironmentId==21){
+        
+        jobSave(this.List).then((res) => {
+          console.log(res);
+          this.$message.success('入库成功');
+          this.getList(this.idsList);
+        });
+      }else{
+        let _arr = [];
+      
       _arr = this.List.filter((item) => {
         return item.toWarehouseList.length > 0;
       });
-
+      
       let bol = true;
       bol = _arr.every((e, i) => {
         return e.warehouseId;
@@ -293,7 +308,6 @@ export default {
       let _arr2 = JSON.parse(JSON.stringify(_arr));
 
 
-
       _arr2.map((m) => {
         m.storageInfo = {
           warehouseId: m.warehouseId,
@@ -312,6 +326,8 @@ export default {
         this.$message.success('入库成功');
         this.getList(this.idsList);
       });
+      }
+      
     }
   }
 };

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

@@ -360,10 +360,7 @@ export default {
       }
       const res = await checkOutsourceMaterial(req);
 
-
-      this.outObj = { ...this.outObj, ...res.data, ...this.outsourceForm };
-
-
+      this.outObj = { ...res.data, ...this.outsourceForm ,...this.outObj};
 
       this.isStep = false;
 

+ 1 - 1
src/views/produceOrder/index.vue

@@ -62,7 +62,7 @@
         </template>
 
         <template v-slot:formingWeight="{ row }">
-          <span> {{ row.formingNum }} {{ row.weightUnit }} </span>
+          <span> {{ row.formingWeight }} {{ row.weightUnit }} </span>
         </template>
 
         <template v-slot:status="{ row }">