Procházet zdrojové kódy

fix: 发货默认发货数量换算(注释)

liujt před 2 týdny
rodič
revize
25cb994e22

+ 1 - 0
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -190,6 +190,7 @@
           :isTotalCount="isTotalCount"
           :oldProductList="oldProductList"
           :sourceType="form.sourceType"
+          :isReturnGoodsCreate="isReturnGoodsCreate"
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane label="托盘清单" name="second">

+ 36 - 4
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -486,6 +486,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import { getSummaries } from '@/utils/util.js';
   import { getBatchList } from '@/api/wms';
+  import Vue from 'vue';
 
   export default {
     mixins: [dictMixins, getDynamicsColumns, tabMixins],
@@ -514,6 +515,10 @@
       },
       isTotalCount: {
         default: 0
+      },
+      isReturnGoodsCreate: {
+        type: Boolean,
+        default: false
       }
     },
     components: {
@@ -1527,7 +1532,7 @@
         }
       },
       setValue(data) {
-        console.log('setValue~~~~~~', data);
+        console.log('setValue~~~~~~', data, this.sourceType);
         let indexS = [];
         data.forEach((item, index) => {
           if (item.modelKey) {
@@ -1537,9 +1542,36 @@
             this.$set(data[index], 'colorKey', item.colorKey);
           }
           item.receiveTotalWeight = item.receiveTotalWeight || 0;
-
-          // item.saleCount = item.notGenerateSendCount || item.saleCount;
-          // item.totalCount = item.saleCount || item.totalCount;
+          // console.log('item~~~~', item, this.sourceType);
+          // if(!this.isReturnGoodsCreate) {
+          //   console.log('isReturnGoodsCreate', this.isReturnGoodsCreate)
+          //   item.totalCount = item.notGenerateSendCount || item.totalCount;
+          //   // item.saleCount = item.notGenerateSendCount || item.saleCount;
+          //   let total = item.totalCount || 0;
+          //   let _endIndex = 0; //计算单重需要
+          //   if (item.packageDispositionList) {
+          //     let endIndex = item.packageDispositionList.findIndex(
+          //       (ite) => item.saleUnitId == ite.id
+          //     );
+          //     _endIndex = endIndex;
+          //     let packageData = item.packageDispositionList.find(
+          //       (ite) => item.saleUnitId== ite.id
+          //     );
+          //     item.saleUnitId = packageData?.conversionUnit;
+          //     if (item.weightUnit == item.measuringUnit && item.singleWeight) {
+          //       item.packageDispositionList[1].packageCell = item.singleWeight;
+          //     }
+          //     for (; 0 < endIndex; endIndex--) {
+          //       total = Vue.prototype.$math.format(
+          //         total / item.packageDispositionList[endIndex].packageCell,
+          //         14
+          //       );
+          //     }
+          //   }
+          //   item.saleCount = total;
+          // }
+          
+        
           // this.changeCount(item, index, false);
 
           if (item.weightUnit == item.measuringUnit) {