فهرست منبع

解决驳回需要选择领料人

huang_an 2 سال پیش
والد
کامیت
07215d1213

+ 125 - 18
src/views/bpm/handleTask/components/selectedCollectionOutbound/outsourcingOutbound.vue

@@ -1,4 +1,4 @@
-<!-- 仓库委外申请(委外发货出库) 出库标识 -->
+<!-- 仓库委外申请(自选领用出库) 出库标识 -->
 <template>
   <div class="ele-body">
     <el-card shadow="never">
@@ -231,10 +231,75 @@
           </div>
           <header-title class="mt20" title="包装清单"></header-title>
           <div class="mt10 form-table">
-            <BatchDetail
+            <el-table
+              ref="multipleTable"
+              :data="batchDetailsVOList"
+              tooltip-effect="dark"
+              style="width: 100%"
+              stripe
+              :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+            >
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column label="编码" prop="code"></el-table-column>
+              <el-table-column label="名称" prop="name"></el-table-column>
+              <el-table-column
+                label="批号"
+                prop="manualBatchNo"
+                width="100"
+              ></el-table-column>
+              <el-table-column label="批次号" prop="batchNo"></el-table-column>
+              <el-table-column
+                label="发货条码"
+                prop="barcodes"
+                width="80"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column label="包装编码" prop="code"></el-table-column>
+              <el-table-column
+                label="包装数量"
+                prop="packingCountBase"
+                width="120"
+              >
+              </el-table-column>
+              <el-table-column
+                label="包装单位"
+                prop="packingUnit"
+              ></el-table-column>
+              <el-table-column
+                label="计量数量"
+                prop="availableCountBase"
+              ></el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="measuringUnit"
+              ></el-table-column>
+              <el-table-column
+                label="物料代号"
+                prop="materielCode"
+                width="130"
+              ></el-table-column>
+              <el-table-column
+                label="客户代号"
+                prop="clientCode"
+              ></el-table-column>
+              <el-table-column label="重量" prop="weight">
+                <template slot-scope="{ row, $index }">
+                  <el-input
+                    @input="wrapWeightChange($event, row)"
+                    v-model="row.weight"
+                  ></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="重量单位"
+                prop="weightUnit"
+              ></el-table-column>
+            </el-table>
+            <!-- <BatchDetail
               :assetType="formData.extInfo.assetType"
               :data="batchDetailsVOList"
-            />
+            /> -->
           </div>
         </div>
         <div class="mt20">
@@ -315,7 +380,11 @@
                   prop="clientCode"
                 ></el-table-column>
                 <el-table-column label="刻码" prop="engrave"></el-table-column>
-                <el-table-column label="重量" prop="weight"></el-table-column>
+                <el-table-column label="重量" prop="weight">
+                  <template slot-scope="{ row, $index }">
+                    <el-input v-model="row.weight"></el-input>
+                  </template>
+                </el-table-column>
                 <el-table-column
                   label="重量单位"
                   prop="weightUnit"
@@ -430,11 +499,6 @@
             required: true,
             message: '请选择出库场景',
             trigger: 'change'
-          },
-          fromUser: {
-            required: true,
-            message: '请选择领料人',
-            trigger: 'change'
           }
         },
         llrLsit: [],
@@ -527,6 +591,36 @@
       //   });
     },
     methods: {
+      wrapWeightChange(val, row) {
+        if (val > row.availableCountBase) {
+          row.weight = row.availableCountBase;
+          this.$message.error('重量不能大于可用数量');
+          return false;
+        }
+        const code = row.onlyCode;
+        const batchNo = row.batchNo;
+        console.log(code);
+        console.log(batchNo);
+        console.log(this.warehousingMaterialList);
+        this.warehousingMaterialList.forEach((item) => {
+          if (item.assetCode == code && item.batchNo == batchNo) {
+            let arr = [];
+            for (const key in this.batchDetailsVOList) {
+              if (
+                this.batchDetailsVOList[key].onlyCode == item.code &&
+                this.batchDetailsVOList[key].batchNo == item.batchNo
+              ) {
+                arr.push({ ...this.batchDetailsVOList[key] });
+              }
+            }
+            const count = arr.reduce((acc, curr) => {
+              return Number(this.$math.format(+acc + +curr.weight, 14));
+            }, 0);
+            this.$set(item, 'weight', count);
+          }
+        });
+        console.log(this.warehousingMaterialList);
+      },
       //获取回执附件
       getQualityFile() {
         return {};
@@ -570,9 +664,9 @@
           }
           this.batchDetailsVOList = packArr.map((item) => {
             return {
-              ...item,
-              packingCountBase:
-                dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
+              ...item
+              // packingCountBase:
+              //   dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
               // weight: 0
             };
           });
@@ -613,9 +707,9 @@
           }
           this.batchDetailsVOList = packArr.map((item) => {
             return {
-              ...item,
-              packingCountBase:
-                dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
+              ...item
+              // packingCountBase:
+              //   dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
               // weight: 0
             };
           });
@@ -660,8 +754,8 @@
           }
           this.batchDetailsVOList = packArr.map((item) => {
             return {
-              ...item,
-              packingCountBase: dimension == 3 ? 1 : item.packingCountBase
+              ...item
+              // packingCountBase: dimension == 3 ? 1 : item.packingCountBase
               // weight: 0
             };
           });
@@ -709,13 +803,25 @@
               } else {
                 obj.num = this.materialCodeReqList.length;
               }
-              console.log(obj);
+
               let selectGoodId = [];
               obj.realTimeInventoryNewPOList =
                 obj.realTimeInventoryNewPOList.map((goodItem) => {
+                  // 同步物品重量
+                  this.warehousingMaterialList.forEach((item) => {
+                    if (item.id === goodItem.id) {
+                      goodItem.weight = item.weight;
+                    }
+                  });
                   selectGoodId.push(goodItem.id);
                   goodItem.inventoryDetailsNewPOList =
                     goodItem.inventoryDetailsNewPOList.map((wrapItem) => {
+                      // 同步包装重量
+                      this.batchDetailsVOList.forEach((item) => {
+                        if (item.id === wrapItem.id) {
+                          wrapItem.weight = item.weight;
+                        }
+                      });
                       wrapItem.workOrderId =
                         this.infoData.detailList[0].workOrderId;
                       wrapItem.pickOrderId =
@@ -728,6 +834,7 @@
                   return goodItem;
                 });
               let boolen = true;
+              console.log(obj);
               console.log(selectGoodId);
               console.log(this.infoData.detailList);
               this.infoData.detailList.forEach((item) => {

+ 12 - 2
src/views/bpm/handleTask/components/selectedCollectionOutbound/submit.vue

@@ -99,13 +99,23 @@
         //     ','
         //   );
         // }
+        let data = await this.getTableValue();
+        let storageData = data.returnStorageData;
+        if (!!status) {
+          if (!storageData.extInfo.verifyDeptCode) {
+            this.$message.error('请选择部门');
+            return false;
+          }
+          if (!storageData.fromUser) {
+            this.$message.error('请选择领料人');
+            return false;
+          }
+        }
         if (!this.form.reason && !!status) {
           this.$message.error('请输入审批意见');
           return false;
         }
         if (this.taskDefinitionKey === 'storeman') {
-          let data = await this.getTableValue();
-          let storageData = data.returnStorageData;
           // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
           storageData.storageSource = 1;
           console.log(storageData);

+ 13 - 1
src/views/bpm/outgoingManagement/components/AssetsDialog.vue

@@ -111,12 +111,22 @@
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="批号">
+            <el-input
+              type="text"
+              placeholder="搜索批号"
+              v-model="searchForm.manualBatchNo"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col v-if="dimension != 2" :span="6">
           <el-form-item label="质检结果">
             <el-select
               clearable
               v-model="searchForm.qualityResult"
               placeholder="请选择质检结果"
+              style="width: 100%"
             >
               <el-option
                 v-for="item in qualityResultOption"
@@ -399,7 +409,8 @@
           batchNo: '',
           engrave: '',
           barcodes: '',
-          qualityResult: ''
+          qualityResult: '',
+          manualBatchNo: ''
         },
         selectionList: [],
         materialType: '',
@@ -630,6 +641,7 @@
         this.searchForm.engrave = '';
         this.searchForm.barcodes = '';
         this.searchForm.qualityResult = '';
+        this.searchForm.manualBatchNo = '';
         this.doSearch();
       },
       doSearch() {