huang_an 2 lat temu
rodzic
commit
eebead98c3

+ 25 - 30
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementStorage.vue

@@ -833,28 +833,21 @@
 </template>
 </template>
 
 
 <script>
 <script>
-  import { approveTaskWithVariables } from '@/api/bpm/task';
   import { getProductList } from '@/api/bpm/components/saleManage/contact';
   import { getProductList } from '@/api/bpm/components/saleManage/contact';
   import { getLoginUser } from '@/api/login';
   import { getLoginUser } from '@/api/login';
   import picker from '@/views/bpm/stockManagement/components/picker.vue';
   import picker from '@/views/bpm/stockManagement/components/picker.vue';
   import outin from '@/api/warehouseManagement/outin';
   import outin from '@/api/warehouseManagement/outin';
-  import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
+  import { getTreeByGroup } from '@/api/classifyManage';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import selectUpload from '@/components/selectUpload';
   import selectUpload from '@/components/selectUpload';
   import upload from '@/components/uploadImg';
   import upload from '@/components/uploadImg';
   import { sceneState } from '@/utils/dict/index';
   import { sceneState } from '@/utils/dict/index';
-  // import { getInfo, warehousingAdd, getAssetNum } from '@/api/stockManagement';
   import selectTree from '@/components/selectTree';
   import selectTree from '@/components/selectTree';
   import selectType from '@/views/bpm/stockManagement/components/selectType.vue';
   import selectType from '@/views/bpm/stockManagement/components/selectType.vue';
   import WareHouseDailog from '@/views/bpm/stockManagement/components/WareHouseDailog.vue';
   import WareHouseDailog from '@/views/bpm/stockManagement/components/WareHouseDailog.vue';
   import ReturnSelect from '@/views/bpm/stockManagement/components/ReturnSelect.vue';
   import ReturnSelect from '@/views/bpm/stockManagement/components/ReturnSelect.vue';
-  // import supplier from '@/api/main/supplier';
-  // import org from '@/api/main/org';
-  // import user from '@/api/main/user';
   import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
   import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
   import { getCode } from '@/api/codeManagement/index.js';
   import { getCode } from '@/api/codeManagement/index.js';
-  import { number } from 'echarts/core';
-  // import { purchaseorderGetById, contactlink } from '@/api/mes';
   import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
   import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
 
 
   export default {
   export default {
@@ -1595,30 +1588,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);

+ 24 - 22
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing.vue

@@ -2369,30 +2369,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);

+ 24 - 22
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue

@@ -1557,30 +1557,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);

+ 24 - 22
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorProductionStorage.vue

@@ -1807,30 +1807,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);

+ 24 - 22
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorStorageToOutsourcing.vue

@@ -1770,30 +1770,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);

+ 34 - 14
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -49,6 +49,7 @@
         icon="el-icon-edit-outline"
         icon="el-icon-edit-outline"
         type="success"
         type="success"
         size="mini"
         size="mini"
+        :loading="isLoading"
         @click="handleAudit(1)"
         @click="handleAudit(1)"
         >通过
         >通过
       </el-button>
       </el-button>
@@ -115,6 +116,7 @@
           },
           },
           userId: { required: true, message: '请选择指派人', trigger: 'change' }
           userId: { required: true, message: '请选择指派人', trigger: 'change' }
         },
         },
+        isLoading: false,
         userOptions: [],
         userOptions: [],
         activeComp: '',
         activeComp: '',
         permissionType: '',
         permissionType: '',
@@ -220,6 +222,7 @@
         let boolen = houseListLength.every((item) => item > 0);
         let boolen = houseListLength.every((item) => item > 0);
         if (boolen) {
         if (boolen) {
           try {
           try {
+            this.isLoading = true;
             const res = await outin.save(storageData);
             const res = await outin.save(storageData);
             data.outerInReceiptId = res.data[0];
             data.outerInReceiptId = res.data[0];
             await updateReceiptAPI(data);
             await updateReceiptAPI(data);
@@ -236,8 +239,10 @@
                   title: !pass ? '驳回' : ''
                   title: !pass ? '驳回' : ''
                 });
                 });
               }
               }
+              this.isLoading = false;
             });
             });
           } catch (error) {
           } catch (error) {
+            this.isLoading = false;
             console.error('保存失败:', error);
             console.error('保存失败:', error);
           }
           }
         } else {
         } else {
@@ -251,6 +256,7 @@
         storageData.storageSource = 1;
         storageData.storageSource = 1;
         console.log(storageData);
         console.log(storageData);
         try {
         try {
+          this.isLoading = true;
           const res = await outin.saveNew(storageData);
           const res = await outin.saveNew(storageData);
           data.outerOutReceiptId = res.data[0];
           data.outerOutReceiptId = res.data[0];
           await updateReceiptAPI(data);
           await updateReceiptAPI(data);
@@ -267,8 +273,10 @@
                 title: !pass ? '驳回' : ''
                 title: !pass ? '驳回' : ''
               });
               });
             }
             }
+            this.isLoading = false;
           });
           });
         } catch (error) {
         } catch (error) {
+          this.isLoading = false;
           console.error('保存失败:', error);
           console.error('保存失败:', error);
         }
         }
       },
       },
@@ -286,6 +294,7 @@
         let boolen = houseListLength.every((item) => item > 0);
         let boolen = houseListLength.every((item) => item > 0);
         if (boolen) {
         if (boolen) {
           try {
           try {
+            this.isLoading = true;
             const res = await outin.save(storageData);
             const res = await outin.save(storageData);
             data.innerInReceiptId = res.data[0];
             data.innerInReceiptId = res.data[0];
             await updateReceiptAPI(data);
             await updateReceiptAPI(data);
@@ -302,8 +311,10 @@
                   title: !pass ? '驳回' : ''
                   title: !pass ? '驳回' : ''
                 });
                 });
               }
               }
+              this.isLoading = false;
             });
             });
           } catch (error) {
           } catch (error) {
+            this.isLoading = false;
             console.error('保存失败:', error);
             console.error('保存失败:', error);
           }
           }
         } else {
         } else {
@@ -344,20 +355,26 @@
         let storageData = data.returnStorageData;
         let storageData = data.returnStorageData;
         // 是否已经入库
         // 是否已经入库
         if (storageData.isStorage) {
         if (storageData.isStorage) {
-          approveTaskWithVariablesAPI({
-            id: this.taskId,
-            reason: this.form.reason,
-            variables: {
-              pass: !!pass
-            }
-          }).then((res) => {
-            if (res.code != '-1') {
-              this.$emit('handleAudit', {
-                status: pass,
-                title: !pass ? '驳回' : ''
-              });
-            }
-          });
+          try {
+            this.isLoading = true;
+            approveTaskWithVariablesAPI({
+              id: this.taskId,
+              reason: this.form.reason,
+              variables: {
+                pass: !!pass
+              }
+            }).then((res) => {
+              if (res.code != '-1') {
+                this.$emit('handleAudit', {
+                  status: pass,
+                  title: !pass ? '驳回' : ''
+                });
+              }
+              this.isLoading = false;
+            });
+          } catch (error) {
+            this.isLoading = true;
+          }
         } else {
         } else {
           // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
           // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
           storageData.storageSource = 1;
           storageData.storageSource = 1;
@@ -368,6 +385,7 @@
           let boolen = houseListLength.every((item) => item > 0);
           let boolen = houseListLength.every((item) => item > 0);
           if (boolen) {
           if (boolen) {
             try {
             try {
+              this.isLoading = true;
               const res = await outin.save(storageData);
               const res = await outin.save(storageData);
               data.returnInReceiptId = res.data[0];
               data.returnInReceiptId = res.data[0];
               await saleReturnUpdateAPI(data);
               await saleReturnUpdateAPI(data);
@@ -384,8 +402,10 @@
                     title: !pass ? '驳回' : ''
                     title: !pass ? '驳回' : ''
                   });
                   });
                 }
                 }
+                this.isLoading = false;
               });
               });
             } catch (error) {
             } catch (error) {
+              this.isLoading = false;
               console.error('保存失败:', error);
               console.error('保存失败:', error);
             }
             }
           } else {
           } else {

+ 24 - 22
src/views/bpm/stockManagement/add.vue

@@ -2051,30 +2051,32 @@
               if (item.warehouseLedgerDetails?.length) {
               if (item.warehouseLedgerDetails?.length) {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                 item.warehouseLedgerDetails.forEach((i, index) => {
                   this.$set(i, 'num', num);
                   this.$set(i, 'num', num);
-                  if (item.measuringUnit == item.weightUnit) {
-                    this.$set(i, 'weight', item.minPackingCount);
-                    this.$set(i, 'initWeight', item.minPackingCount);
-                  } else {
-                    this.$set(
-                      i,
-                      'weight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
-                    this.$set(
-                      i,
-                      'initWeight',
-                      Number(
-                        this.$math.format(
-                          1 * item.minPackingCount * item.netWeight,
-                          14
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
                         )
                         )
-                      )
-                    );
+                      );
+                    }
                   }
                   }
 
 
                   this.$set(i, 'weightUtil', item.weightUnit);
                   this.$set(i, 'weightUtil', item.weightUnit);