فهرست منبع

修复入库流程中空数据问题,优化物品机型和颜色字段显示格式

yusheng 9 ماه پیش
والد
کامیت
33c4b755d5

+ 3 - 0
src/views/bpm/handleTask/components/productionWarehousing/submit.vue

@@ -73,6 +73,9 @@
       async storeManagerApprove() {
         let res = await this.getTableValue();
         let storageData = res.returnStorageData;
+        if (!storageData) {
+          return;
+        }
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         storageData.isSkip = 1;
         console.log(storageData);

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -201,7 +201,7 @@ export default {
       console.log(this.$refs)
       return {
         form: this.form,
-        returnStorageData: this.$refs.inoutBoundRef?.[0]&&this.$refs.inoutBoundRef[0].getReturnStorage(),
+        returnStorageData: this.$refs.inoutBoundRef?.[0]&& await this.$refs.inoutBoundRef[0].getReturnStorage(),
         isAllChecked:
           this.$refs.inoutBoundEditRef?.[0] &&
           (await this.$refs.inoutBoundEditRef[0].getStatus()),

+ 1 - 1
src/views/bpm/handleTask/components/purchasePlanManage/detailDialog.vue

@@ -500,7 +500,7 @@
         return {
           returnStorageData:
             this.$refs.inoutBoundRef &&
-            this.$refs.inoutBoundRef.getReturnStorage()
+            await this.$refs.inoutBoundRef.getReturnStorage()
         };
       }
     }

+ 3 - 0
src/views/bpm/handleTask/components/purchasePlanManage/submit.vue

@@ -189,6 +189,9 @@
       async storeManagerApprove() {
         let res = await this.getTableValue();
         let storageData = res.returnStorageData;
+        if(!storageData){
+         return
+        }
         storageData.isSkip = 1;
         try {
           this.isSaveLoading = true;

+ 6 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -235,6 +235,9 @@
         let storageData = data.returnStorageData;
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         console.log(data);
+        if (!storageData) {
+          return;
+        }
         storageData.isSkip = 1;
         // data.detailList.forEach((val,index)=>{
         //     val.weight=storageData._packingList[index].weight
@@ -305,6 +308,9 @@
       async interiorProductionStorage(data, pass) {
         console.log('data.returnStorageData---------', data.returnStorageData);
         let storageData = data.returnStorageData;
+        if (!storageData) {
+          return;
+        }
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         storageData.isSkip = 1;
         console.log(storageData);

+ 5 - 1
src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/submit.vue

@@ -162,9 +162,13 @@
       async storemanApprove() {
         let res = await this.getTableValue();
         let storageData = res.returnStorageData;
-        console.log(storageData);
+   
+        if (!storageData) {
+          return;
+        }
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         storageData.isSkip = 1;
+  
         try {
           this.isSaveLoading = true;
           if (storageData?._packingList?.length) {

+ 58 - 16
src/views/bpm/stockManagement/storage.vue

@@ -398,12 +398,12 @@
                 </template>
               </el-table-column>
               <el-table-column label="机型" prop="modelKey" width="300">
-                <template slot-scope="{ row ,$index}">
+                <template slot-scope="{ row, $index }">
                   <DictSelection
                     dictName="物品机型"
                     clearable
                     v-model="row.modelKey"
-                     :isOne="$index==1"
+                    :isOne="$index == 1"
                     multiple
                     filterable
                     allow-create
@@ -413,12 +413,12 @@
                 </template>
               </el-table-column>
               <el-table-column label="颜色" prop="colorKey" width="300">
-                <template slot-scope="{ row,$index }">
+                <template slot-scope="{ row, $index }">
                   <DictSelection
                     dictName="物品颜色"
                     clearable
                     v-model="row.colorKey"
-                    :isOne="$index==1"
+                    :isOne="$index == 1"
                     multiple
                     filterable
                     allow-create
@@ -887,12 +887,12 @@
             </template>
           </el-table-column>
           <el-table-column label="机型" prop="modelKey" width="300">
-            <template slot-scope="{ row ,$index}">
+            <template slot-scope="{ row, $index }">
               <DictSelection
                 dictName="物品机型"
                 clearable
                 v-model="row.modelKey"
-              :isOne="$index==1"
+                :isOne="$index == 1"
                 multiple
                 filterable
                 allow-create
@@ -902,12 +902,12 @@
             </template>
           </el-table-column>
           <el-table-column label="颜色" prop="colorKey" width="300">
-            <template slot-scope="{ row,$index }">
+            <template slot-scope="{ row, $index }">
               <DictSelection
                 dictName="物品颜色"
                 clearable
                 v-model="row.colorKey"
-               :isOne="$index==1"
+                :isOne="$index == 1"
                 multiple
                 filterable
                 allow-create
@@ -1176,10 +1176,9 @@
   } from '@/utils/dict/index';
   import { getTreeByGroup } from '@/api/classifyManage';
   import { deepClone } from '@/utils';
-  import { getDetails } from '@/api/classifyManage/itemInformation';
   import { mapActions, mapGetters } from 'vuex';
   import BigNumber from 'bignumber.js';
-  import { status } from 'nprogress';
+
   // import dictMixins from '@/mixins/dictMixins';
   export default {
     components: {
@@ -2280,7 +2279,7 @@
         }
       },
       // 入库
-      getReturnStorage() {
+      async getReturnStorage() {
         if (this.productList.length <= 0) {
           this.$message.error('请先添加产品信息');
           return;
@@ -2303,7 +2302,7 @@
             _workOrderId = this.detailProductList[0]?.workOrderId;
             _taskId = this.detailProductList[0]?.taskId;
           }
-        if (packingItem.modelKey) {
+          if (packingItem.modelKey) {
             packingItem.modelKey = packingItem.modelKey.toString();
           }
           if (packingItem.colorKey) {
@@ -2367,8 +2366,51 @@
         // setTimeout(() => {
         //   resolve(obj);
         // }, 1000);
-        console.log(obj, 'obj');
-        return obj;
+
+        // if (productData.length) {
+        //   this.$alert(
+        //     `物料${productData.join(',')}没有维护供应商,${
+        //       productData.length > 1 ? '会合并下发为一个采购订单,' : ''
+        //     }是否继续下发!`,
+        //     {
+        //       confirmButtonText: '确定',
+        //       callback: (action) => {
+        //         if (action == 'confirm') {
+        //           this.issuePurchaseOrderFn();
+        //         }
+        //       }
+        //     }
+        //   );
+        // } else {
+        //   this.issuePurchaseOrderFn();
+        // }
+        const isVerifyData = await storageApi.isVerifyRepeatIsStock({
+          categoryCodes: this.productList.map((item) => item.categoryCode),
+          batchNos: this.productList.map((item) => item.batchNo)
+        });
+
+        return  new Promise((resolve, reject) => {
+          if (isVerifyData?.length) {
+            this.$confirm(
+              `当前批次:${isVerifyData[0].batchNo},物品${isVerifyData
+                .map((item) => item.categoryName)
+                .join(',')}已有入库记录,是否继续入库!`,
+              {
+                confirmButtonText: '是',
+                cancelButtonText: '否'
+              }
+            )
+              .then(() => {
+                resolve(obj);
+              })
+              .catch(() => {
+                resolve(false);
+              });
+          } else {
+            resolve(obj);
+          }
+        });
+
       },
       pickingHandleScroll() {
         if (this.showPackingList.length < this.packingList.length) {
@@ -2696,8 +2738,8 @@
             categoryCode: item.code, // 物品编码
             categoryModel: item.modelType, // 物品型号
             specification: item.specification, // 规格
-            modelKey: item.modelKey?item.modelKey.split(','):'', // 机型
-            colorKey: item.colorKey?item.colorKey.split(','):'', // 颜色
+            modelKey: item.modelKey ? item.modelKey.split(',') : '', // 机型
+            colorKey: item.colorKey ? item.colorKey.split(',') : '', // 颜色
             brandNum: item.brandNum, // 牌号
             batchNo: batchNo, // 批次号
             supplierListOptions: supplierList[item.id], // 供应商列表