Jelajahi Sumber

feat(inventoryTable): 新增增重计价方式及相关功能实现

yusheng 6 bulan lalu
induk
melakukan
34c3893351
32 mengubah file dengan 842 tambahan dan 810 penghapusan
  1. 72 13
      src/BIZComponents/inventoryTable.vue
  2. 32 3
      src/BIZComponents/inventoryTableDetails.vue
  3. 14 13
      src/BIZComponents/setProduct.js
  4. 3 2
      src/enum/dict.js
  5. 1 6
      src/views/contractManage/contractBook/components/detailDialog1.vue
  6. 1 2
      src/views/financialManage/invoiceManage/components/purchasingAccountTable.vue
  7. 1 3
      src/views/financialManage/invoiceManage/components/saleAccountTable.vue
  8. 2 2
      src/views/financialManage/invoiceManage/components/tableInfo.vue
  9. 45 30
      src/views/purchasingManage/inquiryManage/components/inquiryTable.vue
  10. 1 5
      src/views/purchasingManage/purchaseOrder/accountstatement/components/inventoryTable.vue
  11. 31 42
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  12. 75 126
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  13. 15 5
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  14. 42 30
      src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue
  15. 53 45
      src/views/purchasingManage/purchaseOrder/invoiceConfirm/components/addInvoiceDialog.vue
  16. 12 15
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue
  17. 18 83
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue
  18. 12 2
      src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue
  19. 12 16
      src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue
  20. 1 0
      src/views/saleManage/saleOrder/components/addDialog.vue
  21. 4 10
      src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue
  22. 1 0
      src/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog.vue
  23. 14 24
      src/views/saleManage/saleOrder/entrustedReceive/components/detailDialog.vue
  24. 65 56
      src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue
  25. 81 64
      src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue
  26. 136 170
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  27. 13 3
      src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue
  28. 30 23
      src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue
  29. 12 3
      src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue
  30. 1 0
      src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue
  31. 12 1
      src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue
  32. 30 13
      src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

+ 72 - 13
src/BIZComponents/inventoryTable.vue

@@ -483,6 +483,30 @@
           </el-input>
         </el-form-item>
       </template>
+      <template v-slot:increaseTotalWeight="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
+        >
+          <el-input
+            v-model="scope.row.increaseTotalWeight"
+            @input="setIncreaseTotalWeight(scope.row, scope.$index)"
+            placeholder="请输入"
+          >
+            <template slot="append">
+              <span v-if="!!scope.row.productId && scope.row.productId != 0">
+                {{ scope.row.weightUnit }}
+              </span>
+              <el-input
+                v-else
+                v-model="scope.row.weightUnit"
+                placeholder="单位"
+                style="width: 80px; padding: 0"
+              ></el-input>
+            </template>
+          </el-input>
+        </el-form-item>
+      </template>
+
       <template v-slot:technologyRouteName="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.technologyRouteName'"
@@ -509,13 +533,13 @@
               message: '请选择计价方式',
               trigger: 'change'
             }"
+            @change="changeCount(scope.row, scope.$index)"
           >
             <el-option
               v-for="item in pricingWayList"
               :key="item.id"
               :label="item.name"
               :value="item.id"
-              @click.native="changeCount(scope.row, scope.$index)"
             >
             </el-option>
           </el-select>
@@ -1035,6 +1059,11 @@
         type: Number,
         default: undefined
       },
+      //是否显示增重重量
+      isIncreaseTotalWeight: {
+        type: Boolean,
+        default: false
+      },
       countObj: {
         type: Object,
         default: () => {
@@ -1162,6 +1191,16 @@
             isNone: !this.isCustomerMark,
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            headerSlot: 'headerPricingWay',
+            slot: 'pricingWay',
+            isNone: this.quoteType === 2,
+            fixed: 'left',
+            align: 'center'
+          },
           {
             width: 250,
             prop: 'saleCount',
@@ -1407,13 +1446,6 @@
             align: 'center',
             isNone: this.quoteType === 2
           },
-          // {
-          //   width: 120,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
           {
             prop: 'provenance',
             label: '产地',
@@ -1435,6 +1467,15 @@
             },
             align: 'center'
           },
+          {
+            width: 180,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
+            isNone: this.quoteType === 2 || !this.isIncreaseTotalWeight,
+            align: 'center'
+          },
+
           {
             width: 160,
             prop: 'productBrand',
@@ -1792,9 +1833,13 @@
           this.form.datasource = this.form.datasource.map((item, i) => {
             return changeCount(item, this.countObj, false);
           });
+          this.form.datasource.forEach((item, i) => {
+            this.setIncreaseTotalWeight(item, i);
+          });
         } else {
           const updatedRow = changeCount(row, this.countObj, false);
           this.$set(this.form.datasource, index, updatedRow);
+          this.setIncreaseTotalWeight(row, index);
         }
 
         this.$nextTick(() => {
@@ -1803,7 +1848,16 @@
           this.changeAll();
         });
       },
-
+      setIncreaseTotalWeight(row, index) {
+        if (row.pricingWay == 3) {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            ((row.increaseTotalWeight || 0) * row.singlePrice).toFixed(2)
+          );
+            this.changeAll();
+        }
+      },
       // 计算含税小计(原含税单价逻辑)
       calculateIncludingTaxPrice(row, index) {
         if (!row) return;
@@ -1972,7 +2026,11 @@
             //   item.entrustedEnterpriseId = supplierObj[item.productId][0].id;
             // }
             // item.entrustedEnterpriseId = item.entrustedEnterpriseId || undefined;
-            this.$set(item, 'entrustedEnterpriseId', item.entrustedEnterpriseId || '');
+            this.$set(
+              item,
+              'entrustedEnterpriseId',
+              item.entrustedEnterpriseId || ''
+            );
             item['customerMark'] = item.customerMark || this.customerMark;
             item['arrivalWay'] = item.arrivalWay || 1;
           });
@@ -2292,8 +2350,9 @@
         let item = JSON.parse(JSON.stringify(this.defaultForm));
         item.key = this.form.datasource.length + 1;
         item.customerMark = this.customerMark;
-        item.customerExpectDeliveryDeadline = dayjs(new Date()).format('YYYY-MM-DD')
-    
+        item.customerExpectDeliveryDeadline = dayjs(new Date()).format(
+          'YYYY-MM-DD'
+        );
 
         // 初始化生产加工特有字段及未税小记
         // 当quoteType为2时,数量默认设置为1
@@ -2415,7 +2474,7 @@
     align-items: center;
     font-weight: bold;
   }
-  :deep(.el-input-group__append){
+  :deep(.el-input-group__append) {
     padding: 0;
   }
 </style>

+ 32 - 3
src/BIZComponents/inventoryTableDetails.vue

@@ -128,7 +128,7 @@
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
   import timeDialog from '@/components/timeDialog/index.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList } from '@/enum/dict.js';
   import { getInventoryTotalAPI } from '@/api/wms';
 
   const dayjs = require('dayjs');
@@ -221,6 +221,11 @@
           return [];
         }
       },
+      //是否显示增重重量
+      isIncreaseTotalWeight: {
+        type: Boolean,
+        default: false
+      },
       quoteType: {
         type: Number,
         default: 1
@@ -298,6 +303,19 @@
             label: '规格',
             slot: 'specification',
             align: 'center'
+          },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            isNone: this.quoteType === 2,
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
           }
         ];
 
@@ -433,7 +451,7 @@
             prop: 'productionRequirements',
             label: '生产要求',
             align: 'center',
-          isNone: !this.isProductionRequirements&&this.quoteType === 2
+            isNone: !this.isProductionRequirements && this.quoteType === 2
           },
           {
             minWidth: 120,
@@ -541,7 +559,18 @@
             },
             align: 'center'
           },
-
+          {
+            width: 180,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            isNone: this.quoteType === 2 || !this.isIncreaseTotalWeight,
+            formatter: (row, column) => {
+              if (row.increaseTotalWeight) {
+                return row.increaseTotalWeight + ' ' + (row.weightUnit || '');
+              }
+            },
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'goodsPriceType',

+ 14 - 13
src/BIZComponents/setProduct.js

@@ -22,27 +22,28 @@ export function changeCount(row, countObj, noDiscountSingle) {
     : data.discountSinglePrice;
 
   setWeight(data);
-  if (row[countObj.countKey] && row.singlePrice) {
-    data['totalPrice'] = row[countObj.countKey] * row.singlePrice;
-    data['discountTotalPrice'] = !noDiscountSingle
-      ? data.totalPrice
-      : data.discountTotalPrice;
+  data['totalPrice'] = 0;
+  data['discountTotalPrice'] = 0;
+  if (row.pricingWay == 2||row.pricingWay == 3) {
+    let weightKey=countObj.weightKey||'totalWeight'
+    if (row[weightKey] && row.singlePrice) {
+      data['totalPrice'] = (row[weightKey] * row.singlePrice).toFixed(2);
+    }
   } else {
-    data['totalPrice'] = 0;
-    data['discountTotalPrice'] = 0;
+    if (row[countObj.countKey] && row.singlePrice) {
+      data['totalPrice'] = (row[countObj.countKey] * row.singlePrice).toFixed(2);
+    }
   }
-  // getNotaxSinglePrice(data);
+  data['discountTotalPrice'] = !noDiscountSingle
+    ? data.totalPrice
+    : data.discountTotalPrice;
   return data;
-  // if (row) {
-  //   singleWeightChange(row, index);
-  // }
-  // return getNumTotalPrice(arr, noDiscountSingle);
 }
 function setWeight(row) {
   if (row.weightUnit == row.measuringUnit) {
     row['totalWeight'] = row.totalCount;
   } else if (row.totalCount && row.singleWeight) {
-    row['totalWeight'] = row.totalCount * row.singleWeight;
+    row['totalWeight'] = (row.totalCount * row.singleWeight).toFixed(2);
   } else {
     row['totalWeight'] = 0;
   }

+ 3 - 2
src/enum/dict.js

@@ -253,8 +253,9 @@ export const outputSceneStateEnum = [
 ];
 // 计价方式
 export const pricingWayList = [
-  { id: 1, name: '按数量计费' },
-  { id: 2, name: '按重量计费' }
+  { id: 1, name: '按数量计价' },
+  { id: 2, name: '按重量计价' },
+  { id: 3, name: '按增重计价' },
 ];
 //来源类型
 export const relationTypeOption = {

+ 1 - 6
src/views/contractManage/contractBook/components/detailDialog1.vue

@@ -88,12 +88,7 @@
             <el-form-item label="结束日期:" prop="contractEndDate">
               <el-input v-model="form.contractEndDate" disabled></el-input>
             </el-form-item>
-            <!-- <el-form-item label="计价方式:" prop="payWay">
-              <el-select v-model="form.pricingWay" disabled style="width: 100%">
-                <el-option :value="1" label="按数量计费"></el-option>
-                <el-option :value="2" label="按重量计费"></el-option>
-              </el-select>
-            </el-form-item> -->
+
             <el-form-item label="结算方式:" prop="payWay">
               <el-input v-model="form.settlementModeName" disabled></el-input>
             </el-form-item>

+ 1 - 2
src/views/financialManage/invoiceManage/components/purchasingAccountTable.vue

@@ -8,8 +8,7 @@
             <span>采购订单:</span>
             <span>{{ item.orderNo }}</span>
             <el-divider direction="vertical"></el-divider>
-            <!-- <span>计价方式:</span>
-            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
+        
             <el-divider direction="vertical"></el-divider>
             <span>总金额:</span>
             <span>{{item.amountTotalPrice}}</span>

+ 1 - 3
src/views/financialManage/invoiceManage/components/saleAccountTable.vue

@@ -8,9 +8,7 @@
             <span>销售订单:</span>
             <span>{{ item.orderNo }}</span>
             <el-divider direction="vertical"></el-divider>
-            <!-- <span>计价方式:</span> -->
-            <!-- <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span>
-            <el-divider direction="vertical"></el-divider> -->
+
             <span>总金额:</span>
             <span>{{ item.amountTotalPrice }}</span>
             <el-divider direction="vertical"></el-divider>

+ 2 - 2
src/views/financialManage/invoiceManage/components/tableInfo.vue

@@ -168,9 +168,9 @@
           //   label: '计价方式',
           //   formatter: (row, column) => {
           //     return row.pricingWay == 1
-          //       ? '按数量计'
+          //       ? '按数量计'
           //       : row.pricingWay == 2
-          //       ? '按重量计'
+          //       ? '按重量计'
           //       : '';
           //   },
           //   align: 'center'

+ 45 - 30
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -337,6 +337,27 @@
           </el-input>
         </el-form-item>
       </template>
+      <template v-slot:singleWeight="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :rules="{
+            required: false,
+            pattern: numberReg,
+            trigger: 'change'
+          }"
+          :prop="'resultList.' + scope.$index + '.singleWeight'"
+        >
+          <el-input
+            v-model="scope.row.singleWeight"
+            @input="changeCount(scope.row, scope.$index)"
+            placeholder="请输入"
+          >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
+        </el-form-item>
+      </template>
       <template v-slot:purchaseUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -579,13 +600,7 @@
             headerSlot: 'isRequired',
             align: 'center'
           },
-          // {
-          //   width: 150,
-          //   prop: 'purchaseUnit',
-          //   label: '单位',
-          //   slot: 'purchaseUnit',
-          //   align: 'center'
-          // },
+
           {
             minWidth: 130,
             prop: 'totalCount',
@@ -606,14 +621,25 @@
 
             align: 'center'
           },
-          // {
-          //   minWidth: 80,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   showOverflowTooltip: true,
-          //   align: 'center'
-          // },
+          {
+            width: 180,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'totalWeight',
+            label: '总重',
+            slot: 'totalWeight',
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + (row.weightUnit || '');
+              }
+            }
+          },
           {
             minWidth: 120,
             prop: 'modelType',
@@ -638,7 +664,9 @@
             label: '最低订购量',
             formatter: (row, column) => {
               if (row.minimumOrderQuantity) {
-                return row.minimumOrderQuantity + ' ' + (row.measuringUnit || '');
+                return (
+                  row.minimumOrderQuantity + ' ' + (row.measuringUnit || '')
+                );
               }
             },
             align: 'center'
@@ -751,20 +779,7 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 120,
-          //   prop: 'produceType',
-          //   align: 'center',
-          //   label: '属性类型',
-          //   showOverflowTooltip: true,
-          //   formatter: (row, column) => {
-          //     return row.produceType && row.produceType.length
-          //       ? row.produceType
-          //           .map((item) => this.getDictValue('生产类型', item + ''))
-          //           .join(',')
-          //       : '';
-          //   }
-          // },
+
           {
             minWidth: 120,
             prop: 'packingSpecification',

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

@@ -8,11 +8,7 @@
             <span>采购订单:</span>
             <span>{{ item.orderNo }}</span>
             <el-divider direction="vertical"></el-divider>
-            <!-- <span>计价方式:</span>
-            <span>
-              {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span
-            >
-            <el-divider direction="vertical"></el-divider> -->
+
             <span>总金额:</span>
             <span>{{ item.amountTotalPrice }}</span>
             <el-divider direction="vertical"></el-divider>

+ 31 - 42
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -309,38 +309,48 @@
                 row.requirementTotalCount
               }}</el-button>
               <span v-if="row.requirementTotalCount">{{
-                row.measuringUnit||''
+                row.measuringUnit || ''
               }}</span>
             </template>
             <template v-slot:planTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 2)">{{
                 row.planTotalCount
               }}</el-button>
-              <span v-if="row.planTotalCount">{{ row.measuringUnit||'' }}</span>
+              <span v-if="row.planTotalCount">{{
+                row.measuringUnit || ''
+              }}</span>
             </template>
             <template v-slot:inquiryTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 3)">{{
                 row.inquiryTotalCount
               }}</el-button>
-              <span v-if="row.inquiryTotalCount">{{ row.measuringUnit||'' }}</span>
+              <span v-if="row.inquiryTotalCount">{{
+                row.measuringUnit || ''
+              }}</span>
             </template>
             <template v-slot:contractTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 4)">{{
                 row.contractTotalCount
               }}</el-button>
-              <span v-if="row.contractTotalCount">{{ row.measuringUnit||'' }}</span>
+              <span v-if="row.contractTotalCount">{{
+                row.measuringUnit || ''
+              }}</span>
             </template>
             <template v-slot:doneTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 5)">{{
                 row.doneTotalCount
               }}</el-button>
-              <span v-if="row.doneTotalCount">{{ row.measuringUnit||'' }}</span>
+              <span v-if="row.doneTotalCount">{{
+                row.measuringUnit || ''
+              }}</span>
             </template>
             <template v-slot:waitTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 6)">{{
                 row.waitTotalCount
               }}</el-button>
-              <span v-if="row.waitTotalCount">{{ row.measuringUnit||'' }}</span>
+              <span v-if="row.waitTotalCount">{{
+                row.measuringUnit || ''
+              }}</span>
             </template>
           </ele-pro-table>
         </el-tab-pane>
@@ -425,9 +435,8 @@
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   // import fileMain from '@/components/addDoc/index.vue';
   import billDetailDialog from '@/views/purchasingManage/purchaseOrder/components/billDetailDialog.vue';
-  import { orderSourceType, outsourceSceneList, lbjtList } from '@/enum/dict';
+  import { orderSourceType, outsourceSceneList, lbjtList,pricingWayList,levelList } from '@/enum/dict';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -626,12 +635,7 @@
               }
             }
           },
-          // {
-          //   width: 150,
-          //   prop: 'purchaseUnit',
-          //   label: '单位',
-          //   align: 'center'
-          // },
+
           {
             minWidth: 180,
             prop: 'packingSpecification',
@@ -651,13 +655,7 @@
               }
             }
           },
-          // {
-          //   width: 120,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
+
           {
             width: 120,
             prop: 'produceType',
@@ -699,27 +697,18 @@
               }
             }
           },
-          // {
-          //   width: 120,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 75 - 126
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -425,6 +425,43 @@
           </el-input>
         </el-form-item>
       </template>
+      <template v-slot:pricingWay="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
+          <el-select
+            v-model="scope.row.pricingWay"
+            placeholder="请选择"
+            @change="changeCount(scope.row, scope.$index)"
+            :rules="{
+              required: true,
+              message: '请选择计价方式',
+              trigger: 'change'
+            }"
+          >
+            <el-option
+              v-for="item in pricingWayList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+      <template v-slot:increaseTotalWeight="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
+        >
+          <el-input
+            v-model="scope.row.increaseTotalWeight"
+            @input="setIncreaseTotalWeight(scope.row, scope.$index)"
+            placeholder="请输入"
+          >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
+        </el-form-item>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row, $index }">
         <el-popconfirm
@@ -524,13 +561,9 @@
   import { numberReg, positiveIntegerReg } from 'ele-admin';
   import productList from '@/BIZComponents/product-list.vue';
   import dictMixins from '@/mixins/dictMixins';
-  import fileUpload from '@/components/upload/fileUpload';
-  import headList from '@/BIZComponents/user-select/user-select.vue';
-  import { getFile } from '@/api/system/file';
 
   import billDetailDialog from './billDetailDialog.vue';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
-  import { getCode } from '@/components/addDoc/api/index.js';
   import { pricingWayList, lbjtList } from '@/enum/dict.js';
   import { getInventoryTotalAPI } from '@/api/wms';
   import tabMixins from '@/mixins/tableColumnsMixin';
@@ -547,10 +580,7 @@
         type: Boolean,
         default: false
       },
-      pricingWay: {
-        type: [Number, String],
-        default: 1
-      },
+
       supplierMark: {
         type: [Number, String],
         default: ''
@@ -566,9 +596,7 @@
       taskinstanceDialog,
       // fileMain,
       productList,
-      fileUpload,
-      billDetailDialog,
-      headList
+      billDetailDialog
     },
     computed: {
       canHandl() {
@@ -721,14 +749,19 @@
             slot: 'availableCountBase',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   headerSlot: 'headerPricingWay',
-          //   slot: 'pricingWay',
-          //   align: 'center'
-          // },
+          !this.detailType
+            ? {
+                width: 140,
+                prop: 'pricingWay',
+                label: '计价方式',
+                headerSlot: 'headerPricingWay',
+                slot: 'pricingWay',
+                fixed: 'left',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -865,14 +898,14 @@
               }
             }
           },
-          // {
-          //   width: 120,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
+          {
+            width: 180,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
 
+            align: 'center'
+          },
           !this.detailType
             ? {
                 width: 160,
@@ -1024,9 +1057,6 @@
         });
       },
 
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
       // 返回列表数据
       getTableValue() {
         let comitDatasource = this.form.datasource;
@@ -1061,7 +1091,16 @@
           item.conversionUnit
         );
       },
-
+      setIncreaseTotalWeight(row, index) {
+        if (row.pricingWay == 3) {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            ((row.increaseTotalWeight || 0) * row.singlePrice).toFixed(2)
+          );
+          this.changeAll();
+        }
+      },
       //改变数量
       changeCount(row, index) {
         // if (this.detailType) {
@@ -1080,6 +1119,8 @@
               'datasource[' + index + ']',
               changeCount(item, countObj)
             );
+           this.setIncreaseTotalWeight(item, index);
+
           });
         } else {
           this.$set(
@@ -1087,6 +1128,7 @@
             'datasource[' + index + ']',
             changeCount(row, countObj)
           );
+          this.setIncreaseTotalWeight(row, index);
         }
 
         this.getNotaxSinglePrice();
@@ -1100,15 +1142,6 @@
         this.$emit('orderDiscountAmount', this.allPrice);
       },
 
-      // //改变数量
-      // changeCount(row, index) {
-      //   if (this.detailType) {
-      //     return;
-      //   }
-
-      //   this.singleWeightChange(row, index);
-      //   this.getTotalPrice();
-      // },
       goodsPriceTypeChange(row, index) {
         if (row.goodsId) {
           getGoodsPriceByCondition({
@@ -1143,28 +1176,7 @@
           });
         }
       },
-      // //计算总金额
-      // getTotalPrice(row, index) {
-      //   this.getNotaxSinglePrice();
 
-      //   if (this.form.datasource.length) {
-      //     let sum = 0;
-      //     sum = this.getNumTotalPrice();
-      //     let allsum = sum.toFixed(2);
-      //     this.allPrice = allsum;
-      //     this.form.discountTotalPrice = allsum;
-      //     this.$store.commit('concact/setDiscountAmount', allsum);
-      //     this.$store.commit('order/setAllcountAmount', allsum);
-      //     this.$emit('orderDiscountAmount', this.allPrice);
-      //     this.$refs.table.reload();
-      //     return allsum;
-      //   } else {
-      //     this.allPrice = 0.0;
-      //     this.form.discountTotalPrice = 0.0;
-      //     this.$emit('orderDiscountAmount', 0);
-      //     return 0.0;
-      //   }
-      // },
       //计算不含税单价
       getNotaxSinglePrice() {
         this.form.datasource.forEach((item, index) => {
@@ -1181,44 +1193,7 @@
           }
         });
       },
-      // //计算总金额
-      // getNumTotalPrice() {
-      //   console.log(111);
-      //   let sum = 0;
-      //   this.form.datasource.forEach((r) => {
-      //     this.$set(
-      //       r,
-      //       'discountSinglePrice',
-      //       r.singlePrice ? Number(r.singlePrice) : ''
-      //     );
-      //     if (r.singlePrice && r.totalCount) {
-      //       r.totalPrice = this.getAllPrice(r);
-      //       r.discountTotalPrice = this.getDiscountTotalPrice(r);
-      //       this.$set(r, 'totalPrice', Number(r.totalPrice));
-      //       this.$set(r, 'discountTotalPrice', Number(r.discountTotalPrice));
-      //       sum += Number(r.totalPrice);
-      //     } else {
-      //       this.$set(r, 'totalPrice', '');
-      //       this.$set(r, 'discountTotalPrice', '');
-      //     }
-      //   });
-      //   return sum;
-      // },
 
-      // //计算单重
-      // singleWeightChange(row, index) {
-      //   if (row && row.singleWeight && row.totalCount) {
-      //     row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
-      //     this.$set(
-      //       this.form.datasource[index],
-      //       'totalWeight',
-      //       row.totalWeight
-      //     );
-      //   }
-      //   if (row.pricingWay == 2) {
-      //     this.getTotalPrice(row);
-      //   }
-      // },
       //设置优惠后总金额修改产品单价
       discountInputByOrder(val) {
         this.form.discountTotalPrice = val;
@@ -1229,19 +1204,6 @@
             this.$set(this.form.datasource[index], 'discountSinglePrice', 0);
             return;
           }
-          if (!val) {
-            this.$set(
-              this.form.datasource[index],
-              'discountTotalPrice',
-              item.totalPrice
-            );
-            this.$set(
-              this.form.datasource[index],
-              'discountSinglePrice',
-              item.singlePrice
-            );
-            return;
-          }
 
           this.$set(
             this.form.datasource[index],
@@ -1281,26 +1243,13 @@
           row.produceRoutingId
         );
       },
-      // //获取合计
-      // getAllPrice(row) {
-      //   let num = 0;
-      //   if (row.pricingWay == 1) {
-      //     num = Number(row.singlePrice) * Number(row.totalCount);
-      //   }
-      //   if (row.pricingWay == 2) {
-      //     num =
-      //       Number(row.singlePrice) *
-      //       Number(row.totalCount) *
-      //       Number(row.singleWeight);
-      //   }
-      //   console.log(row, 'row');
 
-      //   return isNaN(num) ? '' : num.toFixed(2);
-      // },
       //获取折让合计
       getDiscountTotalPrice(row) {
         let num = 0;
-        num = Number(row.discountSinglePrice) * Number(row.purchaseCount);
+        let count =
+          (row.pricingWay == 1 ? row.purchaseCount : row.totalWeight) || 0;
+        num = Number(row.discountSinglePrice) * Number(count);
         return isNaN(num) ? '' : num.toFixed(2);
       },
       //修改回显

+ 15 - 5
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -154,15 +154,13 @@
 <script>
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
-  import { reviewStatusEnum, lbjtList } from '@/enum/dict';
+  import { reviewStatusEnum, lbjtList,pricingWayList,levelList } from '@/enum/dict';
   import { copyObj } from '@/utils/util';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
 
   import { getReceiveSaleOrderrecordDetail } from '@/api/purchasingManage/purchaseorderreceive';
   import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
-  // import fileMain from '@/components/addDoc/index.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -367,14 +365,14 @@
               prop: 'samplingQuantity',
               label: '取样量',
               // show: v != 2,
-              align: 'center',
+              align: 'center'
             },
             {
               width: 120,
               prop: 'returnedQuantity',
               label: '退回量',
               // show: v != 2,
-              align: 'center',
+              align: 'center'
             },
             {
               width: 120,
@@ -434,6 +432,18 @@
               },
               align: 'center'
             },
+            {
+              width: 140,
+              prop: 'pricingWay',
+              label: '计价方式',
+              align: 'center',
+              fixed: 'left',
+              show: v != 2,
+              formatter: (row, column) => {
+                return pricingWayList.find((item) => item.id == row.pricingWay)
+                  ?.name;
+              }
+            },
             {
               width: 160,
               prop: 'singlePrice',

+ 42 - 30
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -417,11 +417,9 @@
   import dictMixins from '@/mixins/dictMixins';
   import { getWarehouseList } from '@/api/saleManage/saleorder';
   import { copyObj } from '@/utils/util';
-  import { getFile } from '@/api/system/file';
   import outboundDetailsDialog from './outboundDetailsDialog.vue';
-  // import fileMain from '@/components/addDoc/index.vue';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
-  import { lbjtList, orderSourceType } from '@/enum/dict.js';
+  import { lbjtList, orderSourceType, pricingWayList } from '@/enum/dict.js';
   import { parameterGetByCode } from '@/api/main/index.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import productListMain from '@/BIZComponents/product-list.vue';
@@ -442,7 +440,6 @@
       productType: ''
     },
     components: {
-      // fileMain,
       outboundDetailsDialog,
       productList,
       taskinstanceDialog,
@@ -704,27 +701,18 @@
             slot: 'increaseTotalWeight',
             align: 'center'
           },
-          // {
-          //   width: 100,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -923,9 +911,6 @@
 
     computed: {},
     methods: {
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
       async warehouseChange(index, row) {
         let data = null;
         if (row.warehouseId) {
@@ -1051,6 +1036,7 @@
 
       //设置增重总重
       setIcreaseTotalWeight(index) {
+        let pricingWay = this.form.datasource[index].pricingWay;
         let receiveTotalWeight = Number(
           this.form.datasource[index].receiveTotalWeight
         );
@@ -1071,11 +1057,36 @@
             'totalCount',
             receiveTotalWeight
           );
-        }else{
+        } else {
           this.$set(
             this.form.datasource[index],
             'singleWeight',
-            Number((receiveTotalWeight/this.form.datasource[index].totalCount).toFixed(2))
+            Number(
+              (
+                receiveTotalWeight / this.form.datasource[index].totalCount
+              ).toFixed(2)
+            )
+          );
+        }
+        if (pricingWay == 2) {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            (
+              receiveTotalWeight * this.form.datasource[index].singlePrice
+            ).toFixed(2)
+          );
+        }
+        if (pricingWay == 3) {
+          let increaseTotalWeight = Number(
+            this.form.datasource[index].increaseTotalWeight
+          );
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            (
+              increaseTotalWeight * this.form.datasource[index].singlePrice
+            ).toFixed(2)
           );
         }
         this.$refs.table.reload();
@@ -1264,6 +1275,7 @@
             };
           });
           this.form.datasource.forEach((item, index) => {
+
             if (item.modelKey) {
               this.$set(
                 this.form.datasource[index],

+ 53 - 45
src/views/purchasingManage/purchaseOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -156,11 +156,10 @@
           type="number"
           placeholder="请输入"
         >
-      
-      <template slot="append">
-        {{ scope.row.measuringUnit }}
-      </template>
-      </el-input>
+          <template slot="append">
+            {{ scope.row.measuringUnit }}
+          </template>
+        </el-input>
       </template>
       <template v-slot:remark="scope">
         <el-input
@@ -214,7 +213,7 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import sendListDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/sendListDialog.vue';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList,pricingWayList } from '@/enum/dict.js';
   import {
     addReceiveConfirmInformation,
     getReceiveConfirmDetail,
@@ -367,7 +366,17 @@
             slot: 'warehouseName',
             align: 'center'
           },
-
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 80,
             prop: 'totalCount',
@@ -384,46 +393,45 @@
             prop: 'confirmCount',
             label: '确认数量',
             slot: 'totalCount',
-            align: 'center',
-          
+            align: 'center'
           },
 
-          // {
-          //   width: 120,
-          //   prop: 'singleWeight',
-          //   label: '单重',
-          //   slot: 'singleWeight',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 200,
-          //   prop: 'sendTotalWeight',
-          //   label: '发货总重',
-          //   slot: 'sendTotalWeight',
-          //   align: 'center',
-          //   headerSlot: 'headerTotalCount'
-          // },
-          // {
-          //   width: 100,
-          //   prop: 'receiveTotalWeight',
-          //   label: '收货总重',
-          //   slot: 'receiveTotalWeight',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 100,
-          //   prop: 'increaseTotalWeight',
-          //   label: '增重重量',
-          //   slot: 'increaseTotalWeight',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 100,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
+          {
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'sendTotalWeight',
+            label: '发货总重',
+            slot: 'sendTotalWeight',
+            align: 'center',
+            headerSlot: 'headerTotalCount'
+          },
+          {
+            width: 100,
+            prop: 'receiveTotalWeight',
+            label: '收货总重',
+            slot: 'receiveTotalWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            slot: 'weightUnit',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'packingSpecification',

+ 12 - 15
src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue

@@ -145,7 +145,7 @@
   // import fileMain from '@/components/addDoc/index.vue';
   import outBoundDetails from '@/BIZComponents/outdetails.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -360,20 +360,17 @@
           //   slot: 'weightUnit',
           //   align: 'center'
           // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 18 - 83
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -70,20 +70,7 @@
           />
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.totalCount'"
-          :rules="[
-            { required: true, message: '请输入发货数量', trigger: 'blur' }
-          ]"
-        >
-          <el-input
-            v-model="scope.row.totalCount"
-            @input="(val) => changeNum(val, scope.row, scope.$index)"
-          ></el-input>
-        </el-form-item>
-      </template> -->
+
       <template v-slot:singlePrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -198,26 +185,6 @@
           </el-input>
         </el-form-item>
       </template>
-      <!-- <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-        >
-          <el-select
-            v-model="scope.row.purchaseUnitId"
-            style="width: 100%"
-            @change="changeCount(scope.row, scope.$index)"
-          >
-            <el-option
-              :label="item.conversionUnit"
-              :value="item.id"
-              @click.native="packingChange(item, scope.$index)"
-              v-for="(item, index) in scope.row.packageDispositionList"
-              :key="index"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -289,11 +256,8 @@
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
 
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { getFile } from '@/api/system/file';
-  // import fileMain from '@/components/addDoc/index.vue';
-  // import { getCode } from '@/components/addDoc/api/index.js';
-  import { lbjtList } from '@/enum/dict.js';
-  import { levelList } from '@/enum/dict.js';
+
+  import { levelList,pricingWayList,lbjtList } from '@/enum/dict.js';
   import { changeCount } from '@/BIZComponents/setProduct.js';
 
   export default {
@@ -308,7 +272,6 @@
       productType: ''
     },
     components: {
-      // fileMain,
       productList,
       taskinstanceDialog
     },
@@ -441,13 +404,7 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          // {
-          //   width: 150,
-          //   prop: 'purchaseUnit',
-          //   label: '单位',
-          //   slot: 'purchaseUnit',
-          //   align: 'center'
-          // },
+
           {
             width: 120,
             prop: 'packingSpecification',
@@ -459,8 +416,7 @@
             width: 120,
             prop: 'totalCount',
             label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+
             align: 'center',
             formatter: (row, column) => {
               if (row.totalCount) {
@@ -468,12 +424,7 @@
               }
             }
           },
-          // {
-          //   width: 120,
-          //   prop: 'orderTotalCount',
-          //   label: '总数量',
-          //   slot: 'orderTotalCount'
-          // },
+
           {
             minWidth: 300,
             prop: 'taskName',
@@ -488,13 +439,7 @@
             slot: 'batchNo',
             align: 'center'
           },
-          // {
-          //   minWidth: 100,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
+
           {
             width: 120,
             prop: 'singleWeight',
@@ -519,27 +464,17 @@
               }
             }
           },
-          // {
-          //   width: 100,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '数量'
-          //       : row.pricingWay == 2
-          //       ? '重量'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 12 - 2
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -188,7 +188,7 @@
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList,pricingWayList } from '@/enum/dict.js';
 
   import { reviewStatusEnum } from '@/enum/dict';
   import { copyObj } from '@/utils/util';
@@ -293,7 +293,17 @@
             slot: 'warehouseName',
             align: 'center'
           },
-
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 150,
             prop: 'receiveTotalCount',

+ 12 - 16
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -256,9 +256,8 @@
   } from '@/api/saleManage/saleorder';
   import outboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/outboundDetailsDialog.vue';
   import innertboundDetailsDialog from './innerboundDetailsDialog.vue';
-  import { lbjtList } from '@/enum/dict.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList,pricingWayList ,lbjtList} from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -478,20 +477,17 @@
               }
             }
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+             formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

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

@@ -428,6 +428,7 @@
         :isSinglePrice="form.needProduce != 2 && isSinglePrice != 0"
         :isBatchNo="isBatchNo == 1 && form.saleTypeName.includes('受托')"
         :isProductionRequirements="true"
+        :isIncreaseTotalWeight="true"
       ></inventoryTable>
       <headerTitle
         title="类型清单"

+ 4 - 10
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -28,12 +28,8 @@
             <el-input v-model="form.receiveAddress" disabled></el-input>
           </el-form-item>
           <el-form-item label="是否挂单:" prop="isSuspend">
-            <el-radio v-model="form.isSuspend" disabled :label="1"
-              >是</el-radio
-            >
-            <el-radio v-model="form.isSuspend" disabled :label="0"
-              >否</el-radio
-            >
+            <el-radio v-model="form.isSuspend" disabled :label="1">是</el-radio>
+            <el-radio v-model="form.isSuspend" disabled :label="0">否</el-radio>
           </el-form-item>
         </el-col>
 
@@ -104,10 +100,7 @@
           >
             <el-input v-model="form.relationCode" disabled></el-input>
           </el-form-item>
-          <el-form-item
-            label="业务员:"
-            prop="salesmanName"
-          >
+          <el-form-item label="业务员:" prop="salesmanName">
             <el-input v-model="form.salesmanName" disabled></el-input>
           </el-form-item>
           <el-form-item label="总金额:" prop="totalAmount">
@@ -237,6 +230,7 @@
       :maxHeight="300"
       :isProductionRequirements="true"
       :isWms="true"
+      :isIncreaseTotalWeight="true"
     ></inventoryTabledetail>
     <headerTitle title="类型清单" v-if="form.needProduce == 4"></headerTitle>
     <typeList

+ 1 - 0
src/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog.vue

@@ -300,6 +300,7 @@ export default {
                 item.productName = item.categoryName;
                 item.bomCode = item.bomCode;
                 item.discountSinglePrice = 0;
+                item.pricingWay = v.pricingWay||1;
                 item.singlePrice = 0;
                 item['batchNo'] = this.batchNo;
                 item.totalCount = item.dosage * v.totalCount;

+ 14 - 24
src/views/saleManage/saleOrder/entrustedReceive/components/detailDialog.vue

@@ -117,13 +117,11 @@
 <script>
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
-  import { reviewStatusEnum } from '@/enum/dict';
-  import { copyObj } from '@/utils/util';
+  import { reviewStatusEnum,pricingWayList } from '@/enum/dict';
   import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import fileUpload from '@/components/upload/fileUpload.vue';
   import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
-  // import fileMain from '@/components/addDoc/index.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
 
   export default {
@@ -177,13 +175,7 @@
             label: '编码',
             align: 'center'
           },
-          // {
-          //   minWidth: 100,
-          //   prop: 'productCategoryName',
-          //   label: '类型',
-          //   slot: 'productCategoryName',
-          //   align: 'center'
-          // },
+     
           {
             width: 160,
             prop: 'productBrand',
@@ -290,20 +282,18 @@
           //   slot: 'weightUnit',
           //   align: 'center'
           // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',

+ 65 - 56
src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue

@@ -88,12 +88,12 @@
           <el-input
             v-model="scope.row.totalCount"
             type="number"
-            @input="(val) => changeNum(val, scope.row, scope.$index)"
+            @input="(val) => changeNum(scope.row, scope.$index)"
           >
-        <template slot="append">
-          {{ scope.row.measuringUnit }}
-        </template>
-        </el-input>
+            <template slot="append">
+              {{ scope.row.measuringUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:batchNo="scope">
@@ -120,7 +120,7 @@
           <el-input
             v-model="scope.row.singlePrice"
             type="number"
-            @input="(val) => changeNum(val, scope.row, scope.$index)"
+            @input="(val) => changeNum(scope.row, scope.$index)"
           ></el-input>
         </el-form-item>
       </template>
@@ -197,6 +197,27 @@
         </el-form-item>
       </template>
 
+      <template v-slot:singleWeight="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :rules="{
+            required: false,
+            pattern: numberReg,
+            trigger: 'change'
+          }"
+          :prop="'datasource.' + scope.$index + '.singleWeight'"
+        >
+          <el-input
+            v-model="scope.row.singleWeight"
+            @input="changeNum(scope.row, scope.$index)"
+            placeholder="请输入"
+          >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
+        </el-form-item>
+      </template>
       <template v-slot:colorKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
           <DictSelection
@@ -255,13 +276,10 @@
   import { numberReg } from 'ele-admin';
   import dictMixins from '@/mixins/dictMixins';
   import productList from '@/BIZComponents/product-list.vue';
-
   import { getWarehouseList } from '@/api/saleManage/saleorder';
-
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
-
+  import { pricingWayList } from '@/enum/dict';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { getCode } from '@/api/login/index';
   import { parameterGetByCode } from '@/api/main/index.js';
 
   export default {
@@ -332,13 +350,18 @@
             slot: 'productCode',
             align: 'center'
           },
-          // {
-          //   minWidth: 150,
-          //   prop: 'productCategoryName',
-          //   label: '类型',
-          //   slot: 'productCategoryName',
-          //   align: 'center'
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             prop: 'batchNo',
             label: '批次号',
@@ -414,29 +437,13 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          // {
-          //   width: 100,
-          //   prop: 'receiveTotalCount',
-          //   label: '已收货总数',
-          //   slot: 'receiveTotalCount',
-          //   align: 'center'
-          // },
-          // {
-          //   minWidth: 100,
-          //   prop: 'measuringUnit',
-          //   label: '计量单位',
-          //   slot: 'measuringUnit',
-          //   align: 'center'
-          // },
+
           {
-            width: 120,
+            width: 160,
             prop: 'singleWeight',
+            slot: 'singleWeight',
             label: '单重',
-            formatter: (row, column) => {
-              if (row.singleWeight) {
-                return row.singleWeight + ' ' + row.weightUnit;
-              }
-            },
+
             align: 'center'
           },
           {
@@ -450,13 +457,6 @@
             },
             align: 'center'
           },
-          // {
-          //   width: 100,
-          //   prop: 'weightUnit',
-          //   label: '重量单位',
-          //   slot: 'weightUnit',
-          //   align: 'center'
-          // },
 
           {
             width: 150,
@@ -647,12 +647,17 @@
         });
       },
       //修改数量更新合计
-      changeNum(val, row, index) {
-        this.$set(
-          this.form.datasource[index],
-          'receiveTotalWeight',
-          val ? val * row.singleWeight : ''
-        );
+      changeNum(row, index) {
+        if (row.totalCount && row.singleWeight) {
+          this.$set(
+            this.form.datasource[index],
+            'receiveTotalWeight',
+            row.totalCount * row.singleWeight
+          );
+        } else {
+          this.$set(this.form.datasource[index], 'receiveTotalWeight', 0);
+        }
+
         this.$set(
           this.form.datasource[index],
           'totalPrice',
@@ -672,15 +677,20 @@
       },
       getTotalPrice(row) {
         let num = 0;
-        if (row.singlePrice && row.totalCount) {
-          num = Number(row.singlePrice) * Number(row.totalCount);
+        let countKey =
+          row.pricingWay == 1 ? 'totalCount' : 'receiveTotalWeight';
+
+        if (row.singlePrice && row[countKey]) {
+          num = Number(row.singlePrice) * Number(row[countKey]);
         }
         return num;
       },
       getDiscountTotalPrice(row) {
         let num = 0;
-        if (row.discountSinglePrice && row.totalCount) {
-          num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        let countKey =
+          row.pricingWay == 1 ? 'totalCount' : 'receiveTotalWeight';
+        if (row.discountSinglePrice && row[countKey]) {
+          num = Number(row.discountSinglePrice) * Number(row[countKey]);
         }
 
         return num;
@@ -713,7 +723,6 @@
           if (v.colorKey) {
             v.colorKey = v.colorKey.toString();
           }
-          // item['pricingWay'] = item.pricingWay || this.pricingWay;
           v.technicalDrawings = Array.isArray(v.technicalDrawings)
             ? v.technicalDrawings
             : [];
@@ -746,7 +755,7 @@
               item.colorKey = item.colorKey.split(',');
             }
             //发货数量因已发货数量被修改需要重新计算金额,总重
-            this.changeNum(item.totalCount, item, index);
+            this.changeNum(item, index);
           });
         }
       },

+ 81 - 64
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -118,7 +118,7 @@
             <el-input clearable v-model="form.printNo" />
           </el-form-item>
         </el-col>
-        <el-col :span="12" style="height: 40px;">
+        <el-col :span="12" style="height: 40px">
           <el-form-item label="送货方式" prop="deliveryTypeId">
             <DictSelection
               dictName="送货方式"
@@ -136,7 +136,12 @@
         <el-col :span="12">
           <el-form-item label="回执要求" prop="receiptRequirementTypeId">
             <el-radio-group v-model="form.receiptRequirementTypeId">
-              <el-radio v-for="item in receiptRequirementTypeOption" :key="item.value" :label="item.value">{{item.label}}</el-radio>
+              <el-radio
+                v-for="item in receiptRequirementTypeOption"
+                :key="item.value"
+                :label="item.value"
+                >{{ item.label }}</el-radio
+              >
             </el-radio-group>
           </el-form-item>
         </el-col>
@@ -284,9 +289,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
   import returnOrderDialog from '@/views/saleManage/saleOrder/customerReturnOrder/returnOrderDialog.vue';
-import {
-    getReturnSaleOrderrecordDetail,
-  } from '@/api/saleManage/returnGoods';
+  import { getReturnSaleOrderrecordDetail } from '@/api/saleManage/returnGoods';
 
   export default {
     mixins: [dictMixins],
@@ -324,7 +327,7 @@ import {
       isReturnGoodsCreate: {
         type: Boolean,
         default: false
-      },
+      }
     },
     data() {
       let formDef = {
@@ -351,10 +354,10 @@ import {
         replaceList: [],
         deliveryTypeId: '',
         receiptRequirementTypeId: 2,
-        sourceType: '',  // 1 销售订单 2 受托收货单 3 退货单
+        sourceType: '', // 1 销售订单 2 受托收货单 3 退货单
         sourceId: '',
         sourceNo: '',
-        isSuspend: 0,
+        isSuspend: 0
       };
 
       return {
@@ -380,16 +383,20 @@ import {
         isUpdate: false,
         businessId: '',
         isTotalCount: 0,
-        receiptRequirementTypeOption: [{
-          label: '签回单',
-          value: 1
-        }, {
-          label: '不签回单',
-          value: 2
-        }, {
-          label: '带签收单',
-          value: 3
-        }],
+        receiptRequirementTypeOption: [
+          {
+            label: '签回单',
+            value: 1
+          },
+          {
+            label: '不签回单',
+            value: 2
+          },
+          {
+            label: '带签收单',
+            value: 3
+          }
+        ]
       };
     },
     computed: {
@@ -397,25 +404,37 @@ import {
         return this.$store.state.order.allcountAmount;
       },
       rules() {
-          return {
-            partaName: [
-              { required: true, message: '请选择客户名称', trigger: 'change' }
-            ],
-            linkName: [
-              { required: this.form.needProduce != 2  ? true : false, message: '请输入', trigger: ['blur', 'change'] }
-            ],
-            linkPhone: [ 
-              { required: this.form.needProduce != 2 ? true : false, message: '请输入', trigger: 'change' }
-            ],
-            orderNo: [{ required: true, message: '请选择', trigger: 'change' }],
-            receiveAddress: [
-              { required: this.form.needProduce != 2 ? true : false, message: '请输入', trigger: 'change' }
-            ],
-            deviceName: [
-              { required: true, message: '前选择车辆', trigger: 'change' }
-            ]
-          }
-        }
+        return {
+          partaName: [
+            { required: true, message: '请选择客户名称', trigger: 'change' }
+          ],
+          linkName: [
+            {
+              required: this.form.needProduce != 2 ? true : false,
+              message: '请输入',
+              trigger: ['blur', 'change']
+            }
+          ],
+          linkPhone: [
+            {
+              required: this.form.needProduce != 2 ? true : false,
+              message: '请输入',
+              trigger: 'change'
+            }
+          ],
+          orderNo: [{ required: true, message: '请选择', trigger: 'change' }],
+          receiveAddress: [
+            {
+              required: this.form.needProduce != 2 ? true : false,
+              message: '请输入',
+              trigger: 'change'
+            }
+          ],
+          deviceName: [
+            { required: true, message: '前选择车辆', trigger: 'change' }
+          ]
+        };
+      }
     },
 
     methods: {
@@ -431,11 +450,13 @@ import {
       //选择订单回调
       changeOrder(obj) {
         this.form = Object.assign({}, this.form, {
-          productionRequirements: obj.map((item) => item.productionRequirements).toString(),
+          productionRequirements: obj
+            .map((item) => item.productionRequirements)
+            .toString(),
           orderIds: obj.map((item) => item.id).toString(),
           orderNo: obj.map((item) => item.orderNo).toString(),
           // needProduce: obj.map((item) => item.needProduce),
-          sourceType: 1,
+          sourceType: 1
         });
         this.getSaleOrderDetails(obj.map((item) => item.id));
       },
@@ -445,7 +466,7 @@ import {
           code: 'eom_saleOrder_addInvoice'
         });
 
-        console.log('eom_saleOrder_addInvoice', res)
+        console.log('eom_saleOrder_addInvoice', res);
 
         let data = {
           ...res[0],
@@ -535,7 +556,7 @@ import {
             needProduce,
             isSuspend
           });
-          console.log('form~~~~~~~~~~', this.form)
+          console.log('form~~~~~~~~~~', this.form);
           productList.forEach((item, index) => {
             item['tempId'] = index;
             item.id = '';
@@ -575,7 +596,7 @@ import {
       async getSaleOrderDetails(ids) {
         this.loading = true;
         let res = await getSaleOrderDetails(ids);
-        console.log('res~~~~', res)
+        console.log('res~~~~', res);
         if (res?.length) {
           this.setData(res);
         }
@@ -609,12 +630,12 @@ import {
         const data = await getSendSaleOrderrecordDetailSplit(id);
         // this.partbAddress = data.saleOrder[0].partbAddress;
         // this.saleOrderValue = data.saleOrder;
-        if (data.saleOrderList) { 
+        if (data.saleOrderList) {
           this.setData(data.saleOrderList, 'sendInit');
         } else if (data.saleOrder) {
           this.setData([data.saleOrder], 'sendInit');
         }
-        console.log('data~~~~', data)
+        console.log('data~~~~', data);
         this.loading = false;
         if (data) {
           this.$nextTick(() => {
@@ -624,7 +645,7 @@ import {
             data.carNo = data.carNo ? data.carNo.split(',') : [];
             this.form = data;
             this.form.needProduce = data?.saleOrderList[0]?.needProduce;
-            this.form.deliveryTypeId = data.deliveryTypeId+'';
+            this.form.deliveryTypeId = data.deliveryTypeId + '';
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(
                 data.productList,
@@ -663,7 +684,7 @@ import {
             pricingWay: '',
             sourceNo: '',
             sourceId: '',
-            sourceType: '',
+            sourceType: ''
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([], true);
@@ -676,7 +697,7 @@ import {
       },
       // 获取退货单数据
       async getSReturnOrderInfo(row) {
-        console.log('row~~~~', row)
+        console.log('row~~~~', row);
         // this.form = Object.assign({}, this.form, {
         //   sourceId: row.id,
         //   sourceNo: row.returnNo,
@@ -753,20 +774,17 @@ import {
               projectId,
               projectSn: projectCode
             });
-            
 
             productList.forEach((item, index) => {
               item['tempId'] = index;
               item.id = '';
             });
 
-
-
             this.oldProductList = JSON.parse(JSON.stringify(productList));
 
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(productList, true);
-          })
+          });
         }
       },
       //选择受托收货单弹框
@@ -789,7 +807,7 @@ import {
             pricingWay: '',
             sourceNo: '',
             sourceId: '',
-            sourceType: '',
+            sourceType: ''
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([], true);
@@ -838,7 +856,7 @@ import {
             pricingWay,
             entrustedCode: code,
             entrustedId: id,
-            sourceType: 2,
+            sourceType: 2
           });
           this.getSaleOrderDetails([orderId]);
           // productList.forEach((item, index) => {
@@ -873,7 +891,7 @@ import {
             productionRequirements: '',
             sourceType: '',
             sourceNo: '',
-            sourceId: '',
+            sourceId: ''
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([]);
@@ -891,7 +909,7 @@ import {
         this.parameterGetByCode();
         this.visible = true;
         this.carList = await carBookPageListAPI({ pageNum: 1, size: 100 });
-
+        this.businessId = '';
         if (orderId) {
           await this.getSaleOrderDetails(orderId);
         }
@@ -903,8 +921,8 @@ import {
           await this.getSendSaleOrderDetail(row?.id);
         }
         // 获取退货单数据
-        if(this.isReturnGoodsCreate && type == 'add') {
-          this.getSReturnOrderInfo(row)
+        if (this.isReturnGoodsCreate && type == 'add') {
+          this.getSReturnOrderInfo(row);
         }
 
         if (type == 'add') {
@@ -987,7 +1005,7 @@ import {
             ) {
               item['isReplace'] = 1;
             }
-            if(this.form.isSuspend == 1) {
+            if (this.form.isSuspend == 1) {
               item['isSuspend'] = 1;
             }
           });
@@ -1039,10 +1057,8 @@ import {
       async sendSubmit(res) {
         console.log('res~~~~~~', res, this.businessId);
         let paramsId = this.isReturnGoodsCreate ? res : this.businessId || res;
-        console.log('paramsId~~~', paramsId)
-        const data = await getSendSaleOrderrecordDetailSplit(
-          paramsId
-        );
+        console.log('paramsId~~~', paramsId);
+        const data = await getSendSaleOrderrecordDetailSplit(paramsId);
         let storemanIds = '';
         console.log('data~~~~~~', data);
         let ids = data.productList.map((item) => item.warehouseId);
@@ -1057,8 +1073,9 @@ import {
           let params = {
             businessId: paramsId,
             businessKey:
-              data.isSuspend == 1 ? 'sales_suspend_send_approve' :
-              data.saleTypeName.indexOf('技改') != '-1'
+              data.isSuspend == 1
+                ? 'sales_suspend_send_approve'
+                : data.saleTypeName.indexOf('技改') != '-1'
                 ? 'sele_order_send_correction'
                 : data.saleTypeName.indexOf('三包') != '-1'
                 ? 'eom_sh'

+ 136 - 170
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -80,7 +80,7 @@
           <!-- <el-input v-model="scope.row.batchNo" v-no-chinese></el-input> -->
           <el-select
             v-model="scope.row.batchStockId"
-            clearable 
+            clearable
             placeholder="请选择"
             @change="batchNoChange(scope.$index, scope.row)"
           >
@@ -159,6 +159,7 @@
             type="number"
             v-model="scope.row.increaseTotalWeight"
             style="width: 100%"
+            disabled
           >
             <template slot="append">
               {{ scope.row.weightUnit }}
@@ -214,7 +215,7 @@
         </el-form-item>
       </template>
 
-      <template v-slot:singleWeight="scope" >
+      <template v-slot:singleWeight="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :rules="{
@@ -229,6 +230,7 @@
             type="number"
             placeholder="请输入"
             :disabled="needProduce == 4"
+            @input="changeCount(scope.row, scope.$index)"
           >
             <template slot="append">
               {{ scope.row.weightUnit }}
@@ -290,10 +292,7 @@
         </el-form-item>
       </template>
       <template v-slot:warehouseNum="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.warehouseNum'"
-        > 
-  
+        <el-form-item :prop="'datasource.' + scope.$index + '.warehouseNum'">
           <span>{{ scope.row.warehouseNum }}</span>
         </el-form-item>
       </template>
@@ -333,6 +332,7 @@
           </DictSelection>
         </el-form-item>
       </template>
+
       <template v-slot:colorKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
           <DictSelection
@@ -413,17 +413,14 @@
   } from '@/api/saleManage/saleorder';
 
   import { copyObj } from '@/utils/util';
-  import { getFile } from '@/api/system/file';
   import innertboundDetailsDialog from '@/BIZComponents/innerboundDetailsDialog.vue';
   import stockLedgerDialog from './stockLedger/stockLedgerDialog.vue';
 
   import getDynamicsColumns from '@/mixins/getDynamicsColumns';
-  // import fileMain from '@/components/addDoc/index.vue';
   import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
   import BIZproductList from '@/BIZComponents/product-list.vue';
-  import { lbjtList } from '@/enum/dict.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList, lbjtList } from '@/enum/dict.js';
   import { changeCount } from '@/BIZComponents/setProduct.js';
   import { parameterGetByCode } from '@/api/main/index.js';
   import { getSummaries } from '@/utils/util.js';
@@ -463,7 +460,7 @@
       productListNew,
       stockLedgerDialog,
       selectStockLedgerDialog,
-      BIZproductList,
+      BIZproductList
     },
     data() {
       const defaultForm = {
@@ -531,7 +528,7 @@
           datasource: []
         },
         rules: {},
-        columnsVersion: 1,
+        columnsVersion: 1
       };
     },
     created() {
@@ -591,6 +588,18 @@
             slot: 'productCategoryName',
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 160,
             prop: 'batchStockId',
@@ -708,13 +717,6 @@
               }
             }
           },
-          // {
-          //   width: 150,
-          //   prop: 'saleUnit',
-          //   label: '单位',
-          //   slot: 'saleUnit',
-          //   align: 'center'
-          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -768,7 +770,7 @@
             prop: 'singleWeight',
             slot: 'singleWeight',
             label: '单重',
-    
+
             align: 'center'
           },
           {
@@ -964,9 +966,7 @@
           ' '
         );
       },
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
+
       //发货明细选择
       stockLedgerSelect(row, index) {
         this.curIndex = index;
@@ -976,44 +976,10 @@
         });
       },
 
-      // changeCount1(row, index) {
-      //   this.tableHandleKeyUp(row, index, 'sum');
-      //   this.changeCount(row, index);
-      // },
       packingChange(item, index) {
         this.$set(this.form.datasource[index], 'saleUnit', item.conversionUnit);
       },
-      //改变数量
-      // changeCount() {
-      //   this.form.datasource.forEach((item, index) => {
-      //     if (item.pricingWay == 1) {
-      //       this.$set(
-      //         this.form.datasource[index],
-      //         'discountTotalPrice',
-      //         item.discountSinglePrice * item.totalCount
-      //       );
-      //       this.$set(
-      //         this.form.datasource[index],
-      //         'totalPrice',
-      //         item.singlePrice * item.totalCount
-      //       );
-      //     }
-      //     if (item.pricingWay == 2) {
-      //       this.$set(
-      //         this.form.datasource[index],
-      //         'discountTotalPrice',
-      //         item.discountSinglePrice *
-      //           item.totalCount *
-      //           (item.singleWeight || 0)
-      //       );
-      //       this.$set(
-      //         this.form.datasource[index],
-      //         'totalPrice',
-      //         item.singlePrice * item.totalCount * (item.singleWeight || 0)
-      //       );
-      //     }
-      //   });
-      // },
+
       //获取
       getStockLedger(sendProductDetail) {
         if (!this.form.datasource[this.curIndex].sendProductDetail)
@@ -1065,30 +1031,29 @@
         );
 
         const tempBatchNoList = await getBatchList({
-            warehouseId: data.warehouseId,
-            categoryCode: row.productCode
-          });
-          this.$set(
-            this.form.datasource[index],
-            'batchNoList',
-            tempBatchNoList?.list || []
-          );
-        
-        if(isReset) {
+          warehouseId: data.warehouseId,
+          categoryCode: row.productCode
+        });
+        this.$set(
+          this.form.datasource[index],
+          'batchNoList',
+          tempBatchNoList?.list || []
+        );
+
+        if (isReset) {
           this.$set(this.form.datasource[index], 'batchStockId', '');
           this.$set(this.form.datasource[index], 'batchNo', '');
-          
         }
       },
 
       //批次号选择
       async batchNoChange(index, row) {
-        if(!row.batchStockId) {
+        if (!row.batchStockId) {
           this.$set(this.form.datasource[index], 'batchNo', '');
           // this.$set(this.form.datasource[index], 'warehouseNum', '');
           const tempWarehouse = await getIdWarehouseList({
-            categoryId: this.form.datasource[index].productId,
-          })
+            categoryId: this.form.datasource[index].productId
+          });
           // 有仓库列表
           if (tempWarehouse?.length) {
             console.log('666~~~~!!', index, tempWarehouse);
@@ -1098,12 +1063,18 @@
               tempWarehouse
             );
           }
-  
-          this.$set(this.form.datasource[index], 'warehouseNum', row.warehouseId ? await getWarehouseOutStock({
-            warehouseId: row.warehouseId,
-            code: row.productCode
-          }) : '');
-          
+
+          this.$set(
+            this.form.datasource[index],
+            'warehouseNum',
+            row.warehouseId
+              ? await getWarehouseOutStock({
+                  warehouseId: row.warehouseId,
+                  code: row.productCode
+                })
+              : ''
+          );
+
           return;
         }
         const data = row.batchNoList.find(
@@ -1161,12 +1132,20 @@
         let sendTotalWeight = Number(
           this.form.datasource[this.curIndex]?.sendTotalWeight
         );
-        if (sendTotalWeight && receiveTotalWeight) {
+        if (sendTotalWeight) {
+          let increaseTotalWeight = sendTotalWeight - receiveTotalWeight;
           this.$set(
             this.form.datasource[this.curIndex],
             'increaseTotalWeight',
-            (sendTotalWeight - receiveTotalWeight).toFixed(2)
+            increaseTotalWeight.toFixed(4)
           );
+          if (row.pricingWay == 3) {
+            this.$set(
+              this.form.datasource[this.curIndex],
+              'totalPrice',
+              (increaseTotalWeight * row.singlePrice).toFixed(2)
+            );
+          }
         }
 
         this.$refs.table.reload();
@@ -1448,7 +1427,7 @@
         });
         this.form.datasource.forEach(async (item, index) => {
           if (indexS.includes(index)) {
-            if(!item.batchNo) {
+            if (!item.batchNo) {
               console.log('111~~~~', index);
               this.$set(
                 this.form.datasource[index],
@@ -1493,117 +1472,104 @@
             } else {
               this.setBatchAndWarehouse(item, index);
             }
-            
           }
         });
       },
       async setBatchAndWarehouse(item, index) {
-          console.log('333~~~~', index);
-          // 通过产品编码查仓库
-          const tempWarehouse = await getIdWarehouseList({
-            categoryId: item.productId,
-          })
-          // 有仓库列表
-          if (tempWarehouse?.length) {
-            console.log('666~~~~', index, tempWarehouse);
+        console.log('333~~~~', index);
+        // 通过产品编码查仓库
+        const tempWarehouse = await getIdWarehouseList({
+          categoryId: item.productId
+        });
+        // 有仓库列表
+        if (tempWarehouse?.length) {
+          console.log('666~~~~', index, tempWarehouse);
+          this.$set(
+            this.form.datasource[index],
+            'warehouseList',
+            tempWarehouse
+          );
+          if (item.warehouseId) {
             this.$set(
               this.form.datasource[index],
-              'warehouseList',
-              tempWarehouse
+              'warehouseNum',
+              await getWarehouseOutStock({
+                warehouseId: item.warehouseId,
+                code: item.productCode
+              })
             );
-            if (item.warehouseId) {
+          } else {
+            if (this.form.datasource[index]?.warehouseList?.length) {
               this.$set(
                 this.form.datasource[index],
-                'warehouseNum',
-                await getWarehouseOutStock({
-                  warehouseId: item.warehouseId,
-                  code: item.productCode
-                })
+                'warehouseId',
+                this.form.datasource[index]?.warehouseList[0].warehouseId
               );
-            } else {
-              if (this.form.datasource[index]?.warehouseList?.length) {
-                this.$set(
-                  this.form.datasource[index],
-                  'warehouseId',
-                  this.form.datasource[index]?.warehouseList[0].warehouseId
-                );
-                await this.warehouseChange(index, this.form.datasource[index]);
-              }
-              
+              await this.warehouseChange(index, this.form.datasource[index]);
             }
+          }
 
-            const templist1 = await getBatchList({
-              categoryCode: item.productCode,
-              warehouseId: item.warehouseId,
-              size: -1
-            });
+          const templist1 = await getBatchList({
+            categoryCode: item.productCode,
+            warehouseId: item.warehouseId,
+            size: -1
+          });
 
-            let tempBatchNoList = templist1?.list || [];
-            console.log('888~~~~', index, item.batchNo);
+          let tempBatchNoList = templist1?.list || [];
+          console.log('888~~~~', index, item.batchNo);
 
-            const batchNoObj = tempBatchNoList.find(i => i.batchNo == item.batchNo);
-            
-            if(batchNoObj) {
-              this.$set(
-                this.form.datasource[index],
-                'batchStockId',
-                batchNoObj.id
-              );
-              this.$set(
-                this.form.datasource[index],
-                'warehouseNum',
-                batchNoObj.measureQuantity || 0
-              );
-            } else { //不存在
-              // 批次列表添加不存在的批次号对象
-              tempBatchNoList.push({
-                batchNo: item.batchNo,
-                id: 999,
-                measureQuantity: 0
-              })
-              // 设置为不存在的批次ID
-              this.$set(
-                this.form.datasource[index],
-                'batchStockId',
-                999
-              );
-              this.$set(
-                this.form.datasource[index],
-                'warehouseNum',
-                ''
-              );
-            }
+          const batchNoObj = tempBatchNoList.find(
+            (i) => i.batchNo == item.batchNo
+          );
 
-            // // 批次号
+          if (batchNoObj) {
             this.$set(
               this.form.datasource[index],
-              'batchNoList',
-              tempBatchNoList
+              'batchStockId',
+              batchNoObj.id
+            );
+            this.$set(
+              this.form.datasource[index],
+              'warehouseNum',
+              batchNoObj.measureQuantity || 0
             );
           } else {
-            if(item.batchNo) {
-              const tempBatchNoList = [{
+            //不存在
+            // 批次列表添加不存在的批次号对象
+            tempBatchNoList.push({
+              batchNo: item.batchNo,
+              id: 999,
+              measureQuantity: 0
+            });
+            // 设置为不存在的批次ID
+            this.$set(this.form.datasource[index], 'batchStockId', 999);
+            this.$set(this.form.datasource[index], 'warehouseNum', '');
+          }
+
+          // // 批次号
+          this.$set(
+            this.form.datasource[index],
+            'batchNoList',
+            tempBatchNoList
+          );
+        } else {
+          if (item.batchNo) {
+            const tempBatchNoList = [
+              {
                 batchNo: item.batchNo,
                 id: 999,
                 measureQuantity: 0
-              }]
-              this.$set(
-                this.form.datasource[index],
-                'batchNoList',
-                tempBatchNoList
-              );
-              this.$set(
-                this.form.datasource[index],
-                'batchStockId',
-                999
-              );
-              this.$set(
-                this.form.datasource[index],
-                'warehouseNum',
-                ''
-              );
-            }
+              }
+            ];
+            this.$set(
+              this.form.datasource[index],
+              'batchNoList',
+              tempBatchNoList
+            );
+            this.$set(this.form.datasource[index], 'batchStockId', 999);
+            this.$set(this.form.datasource[index], 'warehouseNum', '');
           }
+        }
       },
       remove(i) {
         this.form.datasource.splice(i, 1);
@@ -1658,7 +1624,7 @@
 
           callback(valid);
         });
-      },
+      }
     }
   };
 </script>

+ 13 - 3
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -34,10 +34,8 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  // import fileMain from '@/components/addDoc/index.vue';
   import getDynamicsColumns from '@/mixins/getDynamicsColumns';
-  import { reviewStatusEnum, lbjtList } from '@/enum/dict';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList, lbjtList } from '@/enum/dict.js';
   import { getSummaries } from '@/utils/util.js';
 
   export default {
@@ -91,6 +89,18 @@
             slot: 'productCode',
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 200,
             prop: 'productCategoryName',

+ 30 - 23
src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -254,7 +254,7 @@
     UpdateSendConfirmInformation
   } from '@/api/saleManage/invoiceConfirm';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, getDynamicsColumns, tabMixins],
@@ -470,20 +470,18 @@
           //   showOverflowTooltip: true,
           //   align: 'center'
           // },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
+
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',
@@ -901,15 +899,24 @@
         if (row.totalCount < 0) {
           this.$set(this.form.productList[index], 'totalCount', 0);
         }
-        if (row.totalCount && row.singlePrice) {
-          // console.log(row.totalCount * row.singlePrice);
-          this.$set(
-            this.form.productList[index],
-            'totalPrice',
-            (row.totalCount * row.singlePrice).toFixed(2)
-          );
+        if (pricingWay == 1) {
+          if (row.totalCount && row.singlePrice) {
+            this.$set(
+              this.form.productList[index],
+              'totalPrice',
+              (row.totalCount * row.singlePrice).toFixed(2)
+            );
+          }
+        } else {
+          if (row.sendTotalWeight && row.singlePrice) {
+            this.$set(
+              this.form.productList[index],
+              'totalPrice',
+              (row.sendTotalWeight * row.singlePrice).toFixed(2)
+            );
+          }
         }
-        // console.log(row.totalCount, row.saleCount);
+
         if (+row.totalCount === +row.saleCount) {
           this.$set(this.form.productList[index], 'isException', 0);
         } else {

+ 12 - 3
src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue

@@ -145,17 +145,15 @@
   import taskInfoTable from '@/views/saleManage/saleOrder/invoice/components/taskInfoTable.vue';
   import stowageTable from '@/views/saleManage/saleOrder/invoice/components/stowageTable.vue';
   import getDynamicsColumns from '@/mixins/getDynamicsColumns';
-  // import fileMain from '@/components/addDoc/index.vue';
   import PalletTable from '@/views/saleManage/saleOrder/invoice/components/palletTable.vue';
   import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, getDynamicsColumns, tabMixins],
     components: {
       PalletTable,
-      // fileMain,
       taskInfoTable,
       outBoundDetails,
       bpmDetail,
@@ -321,7 +319,18 @@
             showOverflowTooltip: true,
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
 
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 160,
             prop: 'batchNo',

+ 1 - 0
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -666,6 +666,7 @@
           this.productList.forEach((val) => {
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
+              item['pricingWay'] = val.pricingWay || 1;
               item['clientCode'] = item.clientCode || val.customerMark;
               item['notaxSinglePrice'] = val.notaxSinglePrice;
               item['taxRate'] = val.taxRate;

+ 12 - 1
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -199,7 +199,7 @@
   import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
   import inventorySaleOrderTableDetails from '@/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList,pricingWayList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -261,7 +261,18 @@
             showOverflowTooltip: true,
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
 
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 160,
             prop: 'batchNo',

+ 30 - 13
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -186,7 +186,7 @@
             <template slot="append">
               {{ scope.row.measuringUnit }}
             </template>
-        </el-input>
+          </el-input>
         </el-form-item>
       </template>
 
@@ -217,6 +217,7 @@
           </el-input>
         </el-form-item>
       </template>
+
       <template v-slot:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -283,11 +284,10 @@
   import { numberReg } from 'ele-admin';
   import dictMixins from '@/mixins/dictMixins';
   import productList from '@/views/saleManage/saleOrder/invoice/components/product-list.vue';
-  import { getFile } from '@/api/system/file';
   import outboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/outboundDetailsDialog.vue';
   import innertboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/innerboundDetailsDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { levelList } from '@/enum/dict.js';
+  import { levelList, pricingWayList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -371,7 +371,18 @@
             showOverflowTooltip: true,
             align: 'center'
           },
+          {
+            width: 140,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            fixed: 'left',
 
+            formatter: (row, column) => {
+              return pricingWayList.find((item) => item.id == row.pricingWay)
+                ?.name;
+            }
+          },
           {
             minWidth: 160,
             prop: 'batchNo',
@@ -612,10 +623,6 @@
       console.log(this.entrustedCode);
     },
     methods: {
-      // downloadFile(file) {
-      //   getFile({ objectName: file.storePath }, file.name);
-      // },
-
       //出库单详情
       handleOutBound(e, rows, index) {
         this.curIndex = index;
@@ -725,12 +732,22 @@
         this.$refs.table.reload();
       },
       changeNum(row, index) {
-        if (row.totalCount && row.singlePrice) {
-          this.$set(
-            this.form.datasource[index],
-            'totalPrice',
-            row.totalCount * row.singlePrice
-          );
+        if (row.pricingWay == 1) {
+          if (row.totalCount && row.singlePrice) {
+            this.$set(
+              this.form.datasource[index],
+              'totalPrice',
+              row.totalCount * row.singlePrice
+            );
+          }
+        } else {
+          if (row.totalCount && row.receiveTotalWeight) {
+            this.$set(
+              this.form.datasource[index],
+              'totalPrice',
+              row.totalCount * row.receiveTotalWeight
+            );
+          }
         }
       },
       //获取订单总金额