ソースを参照

fix(销售订单): 不做总重修改操作

liujt 5 ヶ月 前
コミット
70c5c9b798

+ 6 - 6
src/BIZComponents/inventoryTable.vue

@@ -1480,12 +1480,12 @@
             width: 180,
             prop: 'totalWeight',
             label: '总重',
-            slot: 'totalWeight',
-            // formatter: (_row, _column, cellValue) => {
-            //   if (_row.totalWeight) {
-            //     return _row.totalWeight + ' ' + (_row.weightUnit || '');
-            //   }
-            // },
+            // slot: 'totalWeight',
+            formatter: (_row, _column, cellValue) => {
+              if (_row.totalWeight) {
+                return _row.totalWeight + ' ' + (_row.weightUnit || '');
+              }
+            },
             align: 'center'
           },
           {

+ 4 - 3
src/BIZComponents/setProduct.js

@@ -3,6 +3,7 @@ import Vue from 'vue';
 //改变数量
 export function changeCount(row, countObj, noDiscountSingle, weightType) {
   console.log('changeCount~~', row, countObj, noDiscountSingle)
+  const type = countObj.type || 'sale';
   let total = row[countObj.countKey] || 0;
   let data = row;
   if (row.packageDispositionList) {
@@ -27,7 +28,7 @@ export function changeCount(row, countObj, noDiscountSingle, weightType) {
     setSingleWeight(data);
   } else {
     console.log('weightType~~', 2)
-    setWeight(data);
+    setWeight(data, type);
   }
   
   data['totalPrice'] = 0;
@@ -49,8 +50,8 @@ export function changeCount(row, countObj, noDiscountSingle, weightType) {
 }
 
 // 计算总重
-function setWeight(row) {
-  if (row.weightUnit == row.measuringUnit && row.pricingWay == 1) {
+function setWeight(row, type) {
+  if (row.weightUnit == row.measuringUnit && row.pricingWay == 1 && type != 'purchase') {
     row['totalWeight'] = row.totalCount;
   } else if (row.totalCount && row.singleWeight) {
     row['totalWeight'] = (row.totalCount * row.singleWeight).toFixed(2);

+ 2 - 1
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -1143,7 +1143,8 @@
         let countObj = {
           countKey: 'purchaseCount',
           unitKey: 'purchaseUnit',
-          unitIdKey: 'purchaseUnitId'
+          unitIdKey: 'purchaseUnitId',
+          type: 'purchase'
         };
         if (!row) {
           this.form.datasource.forEach((item, index) => {