Просмотр исходного кода

Revert "采购 销售 添加单位换算 (还未测试 不要合并到test !不要合并到test!)"

This reverts commit 68401ebdc72f8e3dc17363a518935f9fcd3ee2ce.
yusheng 1 год назад
Родитель
Сommit
4abea2dbbe
44 измененных файлов с 966 добавлено и 2160 удалено
  1. 0 1
      package.json
  2. 74 174
      src/BIZComponents/inventoryTable.vue
  3. 27 78
      src/BIZComponents/inventoryTableDetails.vue
  4. 1 5
      src/BIZComponents/processSubmitDialog/processSubmitDialog.vue
  5. 4 15
      src/BIZComponents/product-list.vue
  6. 53 106
      src/BIZComponents/setProduct.js
  7. 0 11
      src/api/wms/index.js
  8. 1 5
      src/main.js
  9. 17 29
      src/views/commodityManagement/commodityPriceList/components/commodityPriceListDialog.vue
  10. 8 44
      src/views/contractManage/contractBook/components/addDialog.vue
  11. 0 5
      src/views/contractManage/contractBook/components/detailDialog.vue
  12. 1 1
      src/views/financialManage/invoiceManage/components/saleAccountTable.vue
  13. 0 2
      src/views/financialManage/receivableManage/components/detailDialog.vue
  14. 0 4
      src/views/financialManage/receivableManage/components/detailDialog1.vue
  15. 16 30
      src/views/purchasingManage/inquiryManage/components/detailDialog.vue
  16. 19 101
      src/views/purchasingManage/inquiryManage/components/inquiryTable.vue
  17. 9 29
      src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue
  18. 22 137
      src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue
  19. 2 2
      src/views/purchasingManage/purchaseOrder/accountstatement/components/inventoryTable.vue
  20. 1 6
      src/views/purchasingManage/purchaseOrder/components/addDialog.vue
  21. 30 43
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  22. 130 260
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  23. 15 38
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  24. 83 205
      src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue
  25. 22 38
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue
  26. 91 200
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue
  27. 14 14
      src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue
  28. 14 14
      src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue
  29. 15 28
      src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue
  30. 30 134
      src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue
  31. 0 1
      src/views/saleManage/quotation/index.vue
  32. 11 11
      src/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue
  33. 0 7
      src/views/saleManage/saleOrder/components/addDialog.vue
  34. 2 2
      src/views/saleManage/saleOrder/customerReturnOrder/add-sale-order-dialog.vue
  35. 14 14
      src/views/saleManage/saleOrder/entrustedReceive/components/detailDialog.vue
  36. 14 14
      src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue
  37. 14 14
      src/views/saleManage/saleOrder/exceptionManagement/components/addOrEditDialog.vue
  38. 8 1
      src/views/saleManage/saleOrder/invoice/components/detailDialog.vue
  39. 126 237
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  40. 22 44
      src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue
  41. 14 14
      src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue
  42. 14 14
      src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue
  43. 14 14
      src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue
  44. 14 14
      src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

+ 0 - 1
package.json

@@ -39,7 +39,6 @@
     "jsbarcode": "^3.11.5",
     "json-bigint": "^1.0.0",
     "lodash": "^4.17.21",
-    "mathjs": "^12.4.1",
     "nprogress": "^0.2.0",
     "print-js": "^1.6.0",
     "tinymce": "^5.10.5",

+ 74 - 174
src/BIZComponents/inventoryTable.vue

@@ -133,7 +133,7 @@
           :prop="'datasource.' + $index + '.customerMark'"
           :rules="{
             required: isCustomerMark ? true : false,
-            message: '请输入客户代号',
+            message: '请输入',
             trigger: 'change'
           }"
         >
@@ -178,7 +178,7 @@
           <el-input v-model="scope.row.productCategoryName" disabled></el-input>
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
+      <template v-slot:totalCount="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
@@ -195,7 +195,7 @@
             @input="changeCount(scope.row, scope.$index)"
           ></el-input>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:headerTotalCount="{ column }">
         <span :class="{ 'is-required': isTotalCount }">{{ column.label }}</span>
       </template>
@@ -656,51 +656,7 @@
           </DictSelection>
         </el-form-item>
       </template>
-      <template v-slot:saleCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
-          :rules="{
-            required: isTotalCount ? true : false,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row[countObj.countKey]"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:saleUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.' + countObj.unitIdKey"
-          :rules="{
-            required: isTotalCount ? true : false,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <el-select
-            v-model="scope.row[countObj.unitIdKey]"
-            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:action="scope">
         <el-popconfirm
@@ -761,7 +717,7 @@
   import { getInventoryTotalAPI } from '@/api/wms';
   // import fileMain from '@/components/addDoc/index.vue';
   import { pricingWayList, lbjtList } from '@/enum/dict.js';
-  import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
+  import { changeCount } from '@/BIZComponents/setProduct.js';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
   import timeDialog from '@/components/timeDialog/index.vue';
@@ -772,6 +728,7 @@
   const dayjs = require('dayjs');
   import { levelList } from '@/enum/dict.js';
   import { getGoodsPriceByCondition } from '@/api/goodsManage/index';
+
   export default {
     mixins: [dictMixins, tabMixins],
     components: {
@@ -895,16 +852,6 @@
       isGoods: {
         type: Boolean,
         default: false
-      },
-      countObj: {
-        type: Object,
-        default: () => {
-          return {
-            countKey: 'saleCount',
-            unitKey: 'saleUnit',
-            unitIdKey: 'saleUnitId'
-          };
-        }
       }
     },
     data() {
@@ -1026,53 +973,22 @@
             show: this.isCustomerMark,
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'saleCount',
-            label: '数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
-
           {
             width: 150,
             prop: 'totalCount',
-            label: '计量数量',
-            // slot: 'totalCount',
+            label: '数量',
+            slot: 'totalCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            headerSlot: 'headerPricingWay',
+            slot: 'pricingWay',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   headerSlot: 'headerPricingWay',
-          //   slot: 'pricingWay',
-          //   align: 'center'
-          // },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -1142,6 +1058,7 @@
             }
           },
 
+   
           {
             width: 110,
             prop: 'batchNo',
@@ -1165,7 +1082,13 @@
             minWidth: 200
             // show:this.contractBookType==2
           },
-
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'singleWeight',
@@ -1220,6 +1143,13 @@
             }
           },
 
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 160,
             prop: 'arrivalWay',
@@ -1361,13 +1291,6 @@
       this.requestDict('商品价格类型');
     },
     methods: {
-      packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-          this.countObj.unitKey,
-          item.conversionUnit
-        );
-      },
       openVersion(index) {
         this.$refs.versionRefs.open(index);
       },
@@ -1500,42 +1423,24 @@
       },
       //改变数量
       changeCount(row, index) {
-        if (!row) {
-          this.form.datasource.forEach((item, index) => {
-            this.$set(
-              this.form,
-              'datasource[' + index + ']',
-              changeCount(item, this.countObj)
-            );
-          });
-        } else {
-          this.$set(
-            this.form,
-            'datasource[' + index + ']',
-            changeCount(row, this.countObj)
-          );
-        }
+        const { allPrice, arr } = changeCount(row, index, this.form.datasource);
+        console.log(arr, 'arr');
+        this.$set(this.form, 'datasource', arr);
+        this.allPrice = allPrice || 0;
 
-        this.getNotaxSinglePrice();
-        this.changeAll();
-        this.$forceUpdate();
-      },
-      changeAll() {
-        this.allPrice = getAllPrice(this.form.datasource) || 0;
         if (this.isDiscountTotalPrice) {
-          this.form.discountTotalPrice = this.allPrice;
-          this.$emit('setDiscountTotalPrice', this.allPrice);
+          this.form.discountTotalPrice = allPrice;
+          this.$emit('setDiscountTotalPrice', allPrice);
         }
         this.$emit('setCountAmount', this.allPrice);
+        this.getNotaxSinglePrice();
       },
-
       setCustomerMark(customerMark) {
         this.form.datasource.forEach((item) => {
           item['customerMark'] = customerMark;
           this.$forceUpdate();
         });
       },
-
       //计算不含税单价
       getNotaxSinglePrice() {
         this.form.datasource.forEach((item, index) => {
@@ -1587,7 +1492,15 @@
       //获取折让合计
       getDiscountTotalPrice(row) {
         let num = 0;
-        num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        if (row.pricingWay == 1) {
+          num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        }
+        if (row.pricingWay == 2) {
+          num =
+            Number(row.discountSinglePrice) *
+            Number(row.totalCount) *
+            Number(row.singleWeight);
+        }
         return isNaN(num) ? '' : num.toFixed(2);
       },
       orderNoChange(row, item) {
@@ -1634,6 +1547,16 @@
             item['arrivalWay'] = item.arrivalWay || 1;
           });
           this.form.datasource = productList;
+          if (this.isChangeCount) {
+            this.changeCount();
+          } else {
+            this.allPrice = data.totalAmount || data?.contractVO?.totalPrice;
+          }
+
+          if (this.isDiscountTotalPrice) {
+            this.form.discountTotalPrice =
+              data.payAmount || data?.contractVO?.discountTotalPrice;
+          }
 
           let codeList = this.form.datasource
             .filter((item) => item.productCode)
@@ -1654,16 +1577,6 @@
                 find.availableCountBase
               );
             });
-          if (this.isChangeCount) {
-            this.changeCount();
-          } else {
-            this.allPrice = data.totalAmount || data?.contractVO?.totalPrice;
-          }
-
-          if (this.isDiscountTotalPrice) {
-            this.form.discountTotalPrice =
-              data.payAmount || data?.contractVO?.discountTotalPrice;
-          }
           this.$refs.table.reload();
         }
       },
@@ -1722,23 +1635,6 @@
           this.$set(parasm, 'singleWeight', item.netWeight);
           this.$set(parasm, 'pricingWay', 1);
           this.$set(parasm, 'goodsLevel', item.level);
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(
-              parasm,
-              this.countObj.unitIdKey,
-              item.packageDispositionList[0].id
-            );
-            this.$set(
-              parasm,
-              this.countObj.unitKey,
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
 
           this.$set(parasm, 'arrivalWay', item.arrivalWay || 1);
 
@@ -1858,9 +1754,13 @@
       remove(index) {
         this.form.datasource.splice(index, 1);
         this.setSort();
-        this.changeAll();
+        this.changeCount();
+      },
+      // 清空表格
+      restTable() {
+        this.form.datasource = [];
+        this.changeCount();
       },
-
       // 重新排序
       setSort() {
         this.form.datasource.forEach((n, index) => {
@@ -1876,19 +1776,19 @@
       },
 
       validateForm(callback) {
-        // let singleWeightData = {};
-        // this.form.datasource.forEach((item) => {
-        //   if (item.pricingWay == 2 && !item.singleWeight) {
-        //     singleWeightData['name'] = item.productName;
-        //     console.log(singleWeightData, 'singleWeightData');
-        //   }
-        // });
-        // if (singleWeightData.name) {
-        //   this.$message.warning(
-        //     singleWeightData.name + '计价方式为按重量计费,单重不能为空'
-        //   );
-        //   callback(false);
-        // }
+        let singleWeightData = {};
+        this.form.datasource.forEach((item) => {
+          if (item.pricingWay == 2 && !item.singleWeight) {
+            singleWeightData['name'] = item.productName;
+            console.log(singleWeightData, 'singleWeightData');
+          }
+        });
+        if (singleWeightData.name) {
+          this.$message.warning(
+            singleWeightData.name + '计价方式为按重量计费,单重不能为空'
+          );
+          callback(false);
+        }
         //开始表单校验
         this.$refs.form.validate((valid, obj) => {
           if (obj) {
@@ -1930,7 +1830,7 @@
                 res.unitPrice
               );
             }
-            this.changeCount(row, index);
+            this.changeCount();
           });
         }
       },

+ 27 - 78
src/BIZComponents/inventoryTableDetails.vue

@@ -58,24 +58,6 @@
           </el-link>
         </div>
       </template>
-
-      <template v-slot:saleCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
-        >
-          {{ scope.row[countObj.countKey] }}
-        </el-form-item>
-      </template>
-      <template v-slot:saleUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.' + countObj.unitKey"
-        >
-          {{ scope.row[countObj.unitKey] }}
-        </el-form-item>
-      </template>
-
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <div class="headbox">
@@ -151,19 +133,9 @@
         default: false
       },
       //显示库存
-      isWms: {
+      isWms:{
         type: Boolean,
         default: false
-      },
-      countObj: {
-        type: Object,
-        default: () => {
-          return {
-            countKey: 'saleCount',
-            unitKey: 'saleUnit',
-            unitIdKey: 'saleUnitId'
-          };
-        }
       }
     },
     data() {
@@ -182,7 +154,7 @@
           width: 1,
           show: false
         };
-        let wmsColumn = {
+        let wmsColumn= {
           width: 1,
           show: false
         };
@@ -195,8 +167,8 @@
             align: 'center'
           };
         }
-        if (this.isWms) {
-          wmsColumn = {
+        if(this.isWms){
+          wmsColumn= {
             minWidth: 160,
             prop: 'availableCountBase',
             label: '库存数量',
@@ -279,37 +251,15 @@
               );
             }
           },
-          {
-            width: 150,
-            prop: 'saleCount',
-            label: '数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 150,
             prop: 'totalCount',
-            label: '计量数量',
+            label: '数量',
             slot: 'totalCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
+          wmsColumn,
           {
             width: 120,
             prop: 'measuringUnit',
@@ -317,7 +267,6 @@
             slot: 'measuringUnit',
             align: 'center'
           },
-          wmsColumn,
           {
             minWidth: 110,
             prop: 'sendTotalCount',
@@ -358,20 +307,20 @@
             align: 'center'
           },
 
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',
@@ -515,13 +464,13 @@
           //   label: '批准文号',
           //   showOverflowTooltip: true
           // },
-          // {
-          //   width: 120,
-          //   prop: 'packingSpecification',
-          //   align: 'center',
-          //   label: '包装规格',
-          //   showOverflowTooltip: true
-          // },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 160,
             prop: 'arrivalWay',

+ 1 - 5
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -151,7 +151,7 @@
       <!--        @click="() => (active = 0)"-->
       <!--        >上一步-->
       <!--      </el-button>-->
-      <el-button type="primary" size="small" @click="submit" :loading="loading"
+      <el-button type="primary" size="small" @click="submit" v-click-once
         >提交</el-button
       >
       <el-button
@@ -239,7 +239,6 @@
         fininvoiceapplyStatusAPI,
         logistictrakplanStatusAPI,
         active: 0,
-        loading:false,
         bpmnXML: null,
         LCFLList: [],
         processList: [],
@@ -452,10 +451,7 @@
         if (code != 0) {
           return;
         }
-        this.loading=true
-
         await processInstanceCreateAPI(this.form);
-        this.loading=false
         this.$message('提交审核成功');
         this.$emit('reload');
         this.cancel();

+ 4 - 15
src/BIZComponents/product-list.vue

@@ -185,7 +185,7 @@
   } from '@/api/saleManage/quotation';
   import searchProduct from './searchProduct.vue';
   import productTree from '@/components/productTree';
-  import { getInventoryTotalAPI,getCategoryPackageDisposition } from '@/api/wms';
+  import { getInventoryTotalAPI } from '@/api/wms';
   import cBomList from './cBom-list.vue';
   import { getByCode } from '@/api/system/dictionary-data';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
@@ -552,12 +552,12 @@
             return this.$message.error('选择的物品已经存在列表了');
           }
         }
-        let list = this.currentIndex == -1 ? this.selection : [this.current];
-        let codeList = list.map((item) => item.code);
-        let idList = list.map((item) => item.id);
 
+        let codeList = [];
+        let list = this.currentIndex == -1 ? this.selection : [this.current];
         //获取仓库库存
         if (this.isGetInventoryTotal) {
+          codeList = list.map((item) => item.code);
           let inventoryTotalList = await getInventoryTotalAPI(codeList);
           list.forEach((item) => {
             let find =
@@ -575,17 +575,6 @@
             }
           });
         }
-        // 获取包装规格
-        let packingSpecification =
-          await getCategoryPackageDisposition({
-            categoryIds: idList
-          });
-        list.forEach((item) => {
-          item['packageDispositionList'] = packingSpecification
-            .filter((ite) => item.id == ite.categoryId&&ite.conversionUnit)
-            .sort((a, b) => a.sort - b.sort);
-        });
-
         this.$emit('changeParent', list, this.currentIndex);
         this.handleClose();
       },

+ 53 - 106
src/BIZComponents/setProduct.js

@@ -1,116 +1,63 @@
 import Vue from 'vue';
 
 //改变数量
-export function changeCount(row, countObj,noDiscountSingle) {
-  let total = row[countObj.countKey] || 0;
-  let data = row;
-  let endIndex = row.packageDispositionList.findIndex(
-    (ite) => row[countObj.unitIdKey] == ite.id
-  );
-  for (; 0 < endIndex; endIndex--) {
-    total = Vue.prototype.$math.format(
-      row.packageDispositionList[endIndex].packageCell * total,
-      14
-    );
+export function changeCount(row, index, arr, noDiscountSingle) {
+  if (row) {
+    singleWeightChange(row, index);
   }
-  data['totalCount'] = total;
-  data['discountSinglePrice'] = !noDiscountSingle
-    ? data.singlePrice
-    : data.discountSinglePrice;
+  return getNumTotalPrice(arr, noDiscountSingle);
+}
+
+//计算总金额
+function getNumTotalPrice(arr, noDiscountSingle) {
+  let sum = 0;
+  arr.forEach((r, index) => {
+    // if (r.singlePrice) {
+    //   r.notaxSinglePrice=r.taxRate?r.singlePrice/(1-(r.taxRate/100)):r.singlePrice
+    // }
+    if (r.singlePrice && r.totalCount) {
+      Vue.set(
+        arr[index],
+        'discountSinglePrice',
+        !noDiscountSingle ? r.singlePrice : r.discountSinglePrice
+      );
+      Vue.set(arr[index], 'totalPrice', getAllPrice(r));
+      Vue.set(
+        arr[index],
+        'discountTotalPrice',
+        !noDiscountSingle ? r.totalPrice : r.discountTotalPrice
+      );
+      sum += Number(r.totalPrice);
+    } else {
+      Vue.set(arr[index], 'totalPrice', 0);
+      Vue.set(arr[index], 'discountTotalPrice',0);
 
-  setWeight(data);
-  if (row.totalCount && row.singlePrice) {
-    data['totalPrice'] = row.totalCount * row.singlePrice;
-    data['discountTotalPrice'] = !noDiscountSingle
-      ? data.totalPrice
-      : data.discountTotalPrice;
+    }
+  });
+  return { allPrice: isNaN(sum) ? 0 : sum.toFixed(2), arr };
+}
+
+//获取合计
+function 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);
   }
-  // getNotaxSinglePrice(data);
-  return data;
-  // if (row) {
-  //   singleWeightChange(row, index);
-  // }
-  // return getNumTotalPrice(arr, noDiscountSingle);
+  return isNaN(num) ? '' : num.toFixed(2);
 }
-function setWeight(row) {
-  if (row.weightUnit == row.measuringUnit) {
-    row['totalWeight'] = row.totalCount;
-  } else if (row.totalCount && row.singleWeight) {
-    row['totalWeight'] = row.totalCount * row.singleWeight;
+function singleWeightChange(row) {
+  console.log(row, 'row');
+  if (row && row.singleWeight && row.totalCount) {
+    row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
   } else {
-    row['totalWeight'] = 0;
+    row.totalWeight = '';
   }
 }
-export function getAllPrice(arr){
-  let sum = 0;
-  arr.forEach(item=>{
-    if(item.totalPrice){
-      sum+=Number(item.totalPrice)
-    }
-  })
-  return sum
-}
-// //计算不含税单价
-// function getNotaxSinglePrice(row) {
-//   if (row.singlePrice && row.taxRate) {
-//     row['notaxSinglePrice'] = parseFloat(
-//       (row.singlePrice / (1 + row.taxRate / 100)).toFixed(2)
-//     );
-//   } else {
-//     row['notaxSinglePrice'] = '';
-//   }
-// }
-
-// //计算总金额
-// function getNumTotalPrice(arr, noDiscountSingle) {
-//   let sum = 0;
-//   arr.forEach((r, index) => {
-//     // if (r.singlePrice) {
-//     //   r.notaxSinglePrice=r.taxRate?r.singlePrice/(1-(r.taxRate/100)):r.singlePrice
-//     // }
-//     if (r.singlePrice && r.totalCount) {
-//       Vue.set(
-//         arr[index],
-//         'discountSinglePrice',
-//         !noDiscountSingle ? r.singlePrice : r.discountSinglePrice
-//       );
-//       Vue.set(arr[index], 'totalPrice', getAllPrice(r));
-//       Vue.set(
-//         arr[index],
-//         'discountTotalPrice',
-//         !noDiscountSingle ? r.totalPrice : r.discountTotalPrice
-//       );
-//       sum += Number(r.totalPrice);
-//     } else {
-//       Vue.set(arr[index], 'totalPrice', 0);
-//       Vue.set(arr[index], 'discountTotalPrice',0);
-
-//     }
-//   });
-//   return { allPrice: isNaN(sum) ? 0 : sum.toFixed(2), arr };
-// }
-
-// //获取合计
-// function 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);
-//   }
-//   return isNaN(num) ? '' : num.toFixed(2);
-// }
-// function singleWeightChange(row) {
-//   console.log(row, 'row');
-//   if (row && row.singleWeight && row.totalCount) {
-//     row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
-//   } else {
-//     row.totalWeight = '';
-//   }
-// }

+ 0 - 11
src/api/wms/index.js

@@ -226,14 +226,3 @@ export async function getPackingList(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-
-export async function getCategoryPackageDisposition (data){
-  const res = await request.post(
-    '/main/categoryPackageDisposition/list',
-    data
-  );
-  if (res.data.code == 0) {
-    return res.data.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}

+ 1 - 5
src/main.js

@@ -17,7 +17,6 @@ import Vue2OrgTree from 'vue2-org-tree';
 import seekPage from '@/BIZComponents/seekPage';
 import clickOnce from './utils/clickOnce.js';
 import noChinese from './utils/noChinese.js';
-import { all, create } from 'mathjs'; // 引入mathjs工具并初始化
 // 注册全局自定义指令
 Vue.directive('click-once', clickOnce);
 Vue.directive('no-chinese', noChinese);
@@ -29,10 +28,7 @@ Vue.component('DictSelection', DictSelection);
 Vue.component('seekPage', seekPage);
 
 Vue.config.productionTip = false;
-Vue.prototype.$math = create(all, {
-  number: 'BigNumber',
-  precision: 64
-});
+
 Vue.use(Vue2OrgTree);
 Vue.use(EleAdmin, {
   response: {

+ 17 - 29
src/views/commodityManagement/commodityPriceList/components/commodityPriceListDialog.vue

@@ -164,10 +164,7 @@
   import dictMixins from '@/mixins/dictMixins';
   import { reviewStatus } from '@/enum/dict';
   import { mapGetters } from 'vuex';
-  import {
-    getInventoryTotalAPI,
-    getCategoryPackageDisposition
-  } from '@/api/wms';
+  import { getInventoryTotalAPI } from '@/api/wms';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
 
   export default {
@@ -418,32 +415,26 @@
           this.$refs.editPriceDialogRef.$refs.form.clearValidate();
       },
       async selected() {
-        if (!this.selection.length && !this.current) {
+        if (!this.selection.length&&!this.current) {
           return this.$message.warning('请至少选择一条数据');
         }
+        let codeList = [];
         let list = this.currentIndex == -1 ? this.selection : [this.current];
-
-        list = list.map((item) => {
-          return {
-            ...item.categoryInfo,
-            goodsId: item.id,
-            to: item.id,
-            goodsPriceId: item.goodsPriceList[0]?.id,
-            level: item.level,
-            goodsPriceType: item.goodsPriceList[0]?.priceType,
-            singlePrice: item.goodsPriceList[0]?.unitPrice,
-            notaxSinglePrice: item.goodsPriceList[0]?.excludeTaxPrice,
-            taxRate: item.goodsPriceList[0]?.taxRate
-          };
-        });
-        let codeList = list.map((item) => item.code);
-        let idList = list.map((item) => item.id);
-        // 获取包装规格
-        let packingSpecification = await getCategoryPackageDisposition({
-          categoryIds: idList
-        });
+        list=list.map(item=>{
+         return {
+              ...item.categoryInfo,
+              goodsId:item.id,
+              to:item.id,
+              goodsPriceId:item.goodsPriceList[0]?.id,
+              level:item.level,
+              goodsPriceType:item.goodsPriceList[0]?.priceType,
+              singlePrice:item.goodsPriceList[0]?.unitPrice,
+              notaxSinglePrice:item.goodsPriceList[0]?.excludeTaxPrice,
+              taxRate:item.goodsPriceList[0]?.taxRate,
+          }
+        })
         //获取仓库库存
-
+        codeList = list.map((item) => item.code);
         let inventoryTotalList = await getInventoryTotalAPI(codeList);
         list.forEach((item) => {
           let find =
@@ -456,9 +447,6 @@
           if (supplierList[item.id]?.length === 1) {
             item['entrustedEnterpriseId'] = supplierList[item.id][0].id;
           }
-          item['packageDispositionList'] = packingSpecification
-            .filter((ite) => item.id == ite.categoryId && ite.conversionUnit)
-            .sort((a, b) => a.sort - b.sort);
         });
         this.$emit('changeParent', list, this.currentIndex);
         this.visible = false;

+ 8 - 44
src/views/contractManage/contractBook/components/addDialog.vue

@@ -477,11 +477,6 @@
             :isSalesRecord="form.type"
             :cacheKeyUrl="cacheKeyUrl"
             :isGoods="true"
-            :countObj="{
-              countKey: 'contractCount',
-              unitKey: 'contractUnit',
-              unitIdKey: 'contractUnitId'
-            }"
           ></inventoryTable1>
         </el-tab-pane>
         <el-tab-pane
@@ -856,11 +851,7 @@
             { required: true, message: '请选择甲方名称', trigger: 'change' }
           ],
           partaLinkName: [
-            {
-              required: isRequired,
-              message: '请选择甲方联系人',
-              trigger: 'change'
-            }
+            { required: isRequired, message: '请选择甲方联系人', trigger: 'change' }
           ],
           acceptUnpack: [
             { required: true, message: '请选择是否接受', trigger: 'change' }
@@ -881,11 +872,7 @@
             { required: true, message: '请输入乙方名称', trigger: 'change' }
           ],
           partbLinkName: [
-            {
-              required: isRequired,
-              message: '请输入乙方联系人',
-              trigger: 'change'
-            }
+            { required: isRequired, message: '请输入乙方联系人', trigger: 'change' }
           ],
           partbTel: [
             {
@@ -1015,7 +1002,7 @@
         // let categoryData = this.categoryList.find(
         //   (item) => item.id == this.form.categoryId
         // );
-        let list = await listCode({ id: this.form.categoryId });
+        let list = await listCode({id:this.form.categoryId});
         if (list?.length > 0) {
           this.$set(this.form, 'contractNumber', await getCode(list[0]?.id));
         } else {
@@ -1374,6 +1361,7 @@
             this.$nextTick(async () => {
               this.setValue(row);
               if (source == 'inquiryManage') {
+                console.log(row, 'row');
                 //核价单是否生成过合同
                 this.$nextTick(() => {
                   this.$refs.rawDetailListRef &&
@@ -1421,23 +1409,6 @@
             contractVO.contractEndDate || this.form.contractEndDate,
           pricingWay: 1
         };
-
-        row.productList = row.productList.map((item) => {
-          item['contractCount'] =
-            contractVO.type == 1
-              ? item.saleCount
-              : item.contractCount || item.purchaseCount;
-          item['contractUnit'] =
-            contractVO.type == 1
-              ? item.saleUnit
-              : item.contractUnit || item.purchaseUnit;
-          item['contractUnitId'] =
-            contractVO.type == 1
-              ? item.saleUnitId
-              : item.contractUnitId || item.purchaseUnitId;
-          return item;
-        });
-
         this.form = contractVO;
         this.form.HJQD = this.form.partbName;
         this.$refs.inventoryTable &&
@@ -1452,12 +1423,6 @@
         await this.getLinkInfo(
           contractVO.type == '2' ? contractVO.partbId : contractVO.partaId
         );
-        if (contractVO.discountTotalPrice) {
-          this.$refs.inventoryTable.allPrice=contractVO.totalPrice
-            this.$refs.inventoryTable.discountInputByOrder(
-              contractVO.discountTotalPrice
-            );
-        }
         this.$nextTick(() => {
           this.getrequireUser(contractVO.requireDeptId);
           let firstLink =
@@ -1783,11 +1748,10 @@
             requireSourceType: info.sourceType,
             requireSourceTypeName: info.sourceTypeName
           },
-          productList:
-            info.detailList.map((item) => {
-              item['customerExpectDeliveryDeadline'] = item.expectReceiveDate;
-              return item;
-            }) || []
+          productList: info.detailList.map(item=>{
+            item['customerExpectDeliveryDeadline']=item.expectReceiveDate
+            return item
+          }) || []
         };
         this.setValue(form);
         // await this.getLinkInfo(cusInfo.base.id)

+ 0 - 5
src/views/contractManage/contractBook/components/detailDialog.vue

@@ -205,11 +205,6 @@
             :pricingWay="form.pricingWay"
             :isChangeCount="false"
             :cacheKeyUrl="cacheKeyUrl"
-            :countObj="{
-              countKey: 'contractCount',
-              unitKey: 'contractUnit',
-              unitIdKey: 'contractUnitId'
-            }"
           ></inventoryTabledetail>
         </el-tab-pane>
         <el-tab-pane

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

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

+ 0 - 2
src/views/financialManage/receivableManage/components/detailDialog.vue

@@ -87,8 +87,6 @@
                     ? '销售订单'
                     : form.sourceType == 4
                     ? '售后管理'
-                    : form.sourceType == 5
-                    ? '发货单'
                     : '对账单'
                 "
                 disabled

+ 0 - 4
src/views/financialManage/receivableManage/components/detailDialog1.vue

@@ -85,10 +85,6 @@
                     ? '合同'
                     : form.sourceType == 3
                     ? '销售订单'
-                    : form.sourceType == 4
-                    ? '售后管理'
-                    : form.sourceType == 5
-                    ? '发货单'
                     : '对账单'
                 "
                 disabled

+ 16 - 30
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -246,41 +246,14 @@
             },
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
-          },
-          {
-            minWidth: 180,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             minWidth: 80,
             prop: 'totalCount',
-            label: '计量数量',
+            label: '数量',
             slot: 'totalCount',
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
           {
             width: 150,
             prop: 'inquiryNum',
@@ -323,7 +296,14 @@
                 : '';
             }
           },
- 
+          {
+            minWidth: 80,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
           {
             minWidth: 120,
             prop: 'modelType',
@@ -371,7 +351,13 @@
               }
             }
           },
-
+          {
+            minWidth: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             minWidth: 140,
             prop: 'files',

+ 19 - 101
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -214,7 +214,7 @@
           }"
         >
           <el-input
-            @blur="changeCount(scope.row, scope.$index)"
+            @blur="changeGetPrice(scope.row)"
             v-model="scope.row.singlePrice"
             :disabled="status == 'Detail'"
             type="number"
@@ -246,7 +246,7 @@
           }"
         >
           <el-input
-            @blur="changeCount(scope.row, scope.$index)"
+            @blur="changeGetPrice(scope.row)"
             v-model="scope.row.totalCount"
             :disabled="status == 'Detail'"
             placeholder="请输入"
@@ -300,53 +300,7 @@
           ></el-input>
         </el-form-item>
       </template>
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'resultList.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :disabled="status == 'Detail'"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'resultList.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <el-select
-            v-model="scope.row.purchaseUnitId"
-            style="width: 100%"
-            :disabled="status == 'Detail'"
-            @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:isRequired="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -365,7 +319,6 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { parameterGetByCode } from '@/api/main/index.js';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount } from '@/BIZComponents/setProduct.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -555,28 +508,12 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'isRequired',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'isRequired',
-            align: 'center'
-          },
           {
             minWidth: 130,
             prop: 'totalCount',
             label: '购买数量',
-            // slot: 'totalCount',
-            // headerSlot: 'isRequired',
+            slot: 'totalCount',
+            headerSlot: 'isRequired',
             showOverflowTooltip: true,
             align: 'center'
           },
@@ -591,7 +528,7 @@
           {
             minWidth: 80,
             prop: 'measuringUnit',
-            label: '计量单位',
+            label: '单位',
             slot: 'measuringUnit',
             showOverflowTooltip: true,
             align: 'center'
@@ -873,27 +810,6 @@
         return;
         this.$emit('setIsInquiry');
       },
-      packingChange(item, index) {
-        this.$set(
-          this.form.resultList[index],
-          'purchaseUnit',
-          item.conversionUnit
-        );
-      },
-      //改变数量
-      changeCount(row, index) {
-        this.$set(
-          this.form,
-          'resultList[' + index + ']',
-          changeCount(row, {
-            countKey: 'purchaseCount',
-            unitKey: 'purchaseUnit',
-            unitIdKey: 'purchaseUnitId'
-          })
-        );
-        this.getNotaxSinglePrice();
-        this.$forceUpdate();
-      },
       //计算不含税单价
       getNotaxSinglePrice() {
         this.form.resultList.forEach((item, index) => {
@@ -978,17 +894,17 @@
         getFile({ objectName: file.storePath }, file.name);
       },
       //
-      // changeGetPrice(row) {
-      //   if (row.singlePrice && row.totalCount) {
-      //     let num = 0;
-      //     this.form.resultList.forEach((item) => {
-      //       num += item.totalPrice || 0;
-      //     });
-      //     this.form.preferentialPrice = parseFloat(num.toFixed(2));
-      //   }
-      //   this.setIsInquiry();
-      //   this.getNotaxSinglePrice();
-      // },
+      changeGetPrice(row) {
+        if (row.singlePrice && row.totalCount) {
+          let num = 0;
+          this.form.resultList.forEach((item) => {
+            num += item.totalPrice || 0;
+          });
+          this.form.preferentialPrice = parseFloat(num.toFixed(2));
+        }
+        this.setIsInquiry();
+        this.getNotaxSinglePrice();
+      },
       //计算销售金额
       totalPrice(a, b, row) {
         if (!a || !b) {
@@ -1005,6 +921,8 @@
           num += item.totalPrice || 0;
         });
         this.form.totalPrice = parseFloat(num.toFixed(2));
+        // this.form.preferentialPrice = parseFloat(num.toFixed(2));
+        // console.log(this.form.resultList,'dasdasd')
       },
       // 返回列表数据
       getTableValue() {

+ 9 - 29
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -236,30 +236,10 @@
             slot: 'productBrand',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
-          },
- 
-          {
-            minWidth: 180,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 80,
             prop: 'totalCount',
-            label: '计量数量',
+            label: '数量',
             slot: 'totalCount',
             align: 'center'
           },
@@ -317,7 +297,7 @@
           {
             width: 100,
             prop: 'measuringUnit',
-            label: '计量单位',
+            label: '单位',
             slot: 'measuringUnit',
             align: 'center'
           },
@@ -381,13 +361,13 @@
           //   label: '批准文号',
           //   showOverflowTooltip: true
           // },
-          // {
-          //   width: 120,
-          //   prop: 'packingSpecification',
-          //   align: 'center',
-          //   label: '包装规格',
-          //   showOverflowTooltip: true
-          // },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 160,
             prop: 'technicalDrawings',

+ 22 - 137
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -331,51 +331,7 @@
       <template v-slot:headerArrivalWay="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <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:action="scope">
         <el-popconfirm
@@ -426,7 +382,6 @@
   import { lbjtList } from '@/enum/dict.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount } from '@/BIZComponents/setProduct.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -500,42 +455,12 @@
             headerSlot: 'headerProductName',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 80,
             prop: 'totalCount',
-            label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
+            label: '数量',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
@@ -636,6 +561,21 @@
               }
             }
           },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
 
           {
             width: 130,
@@ -739,11 +679,7 @@
         console.log(data, 'data');
         let keyS = this.selection.map((item) => item.key - 1);
         keyS.forEach((key) => {
-          this.$set(
-            this.form.datasource[key],
-            'arrivalWay',
-            data.deliveryMethod
-          );
+        this.$set(this.form.datasource[key], 'arrivalWay', data.deliveryMethod);
 
           if (data.deliveryMethod == 1) {
             this.$set(
@@ -757,13 +693,7 @@
               'arrivalBatch',
               copyObj(data.arrivalBatch)
             );
-            this.$set(
-              this.form.datasource[key],
-              'totalCount',
-              data.arrivalBatch
-                .map((item) => item.arriveCount)
-                .reduce((a, b) => a + b, 0)
-            );
+            this.$set(this.form.datasource[key],'totalCount',data.arrivalBatch.map(item=>item.arriveCount).reduce((a,b)=>a+b,0))
           }
         });
       },
@@ -800,19 +730,7 @@
           this.$set(parasm, 'produceType', item.componentAttribute);
           this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
           this.$set(parasm, 'goodsLevel', item.level);
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
+
           this.$set(
             parasm,
             'packingSpecification',
@@ -825,26 +743,6 @@
           }
         });
       },
-      packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-          'purchaseUnit',
-          item.conversionUnit
-        );
-      },
-      //改变数量
-      changeCount(row, index) {
-        this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, {
-            countKey: 'purchaseCount',
-            unitKey: 'purchaseUnit',
-            unitIdKey: 'purchaseUnitId'
-          })
-        );
-        this.$forceUpdate();
-      },
       //选择产品
       handParent(row, index) {
         // let item = {
@@ -902,19 +800,6 @@
             'packingSpecification',
             item.extField?.packingSpecification
           );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
           }

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

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

+ 1 - 6
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -1099,12 +1099,7 @@
               sourceTypeName: requireSourceTypeName
             });
             this.getLinkInfo(partaId);
-            info.productList = info.productList.map((item) => {
-              item['purchaseCount'] = item.contractCount;
-              item['purchaseUnit'] = item.contractUnit;
-              item['purchaseUnitId'] = item.contractUnitId;
-              return item;
-            });
+
             if (info.productList.length > 1) {
               this.$refs.planTableListRef.contractOpen(
                 info.productList,

+ 30 - 43
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -587,39 +587,13 @@
             label: '未收货数量',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
-          },
-          {
-            minWidth: 180,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 120,
             prop: 'totalCount',
-            label: '计量数量',
+            label: '数量',
             slot: 'totalCount',
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
           {
             width: 120,
             prop: 'produceType',
@@ -637,8 +611,21 @@
             }
           },
 
-      
-       
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'singleWeight',
@@ -660,20 +647,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 130 - 260
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -121,7 +121,7 @@
           </el-input>
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
+      <template v-slot:totalCount="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
@@ -138,7 +138,7 @@
             type="number"
           ></el-input>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:totalPrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -170,7 +170,7 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.specification'"
         >
-          <el-input v-model="scope.row.specification"></el-input>
+          <el-input v-model="scope.row.specification" ></el-input>
         </el-form-item>
       </template>
       <template v-slot:deliveryDays="scope">
@@ -263,7 +263,7 @@
           <el-input
             v-model="scope.row.singlePrice"
             placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="getTotalPrice"
           >
             <template slot="append">元</template>
           </el-input>
@@ -304,7 +304,7 @@
         >
           <el-input
             v-model="scope.row.singleWeight"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="singleWeightChange(scope.row, scope.$index)"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -434,7 +434,7 @@
           </template>
         </el-popconfirm>
       </template>
-      <!-- <template v-slot:pricingWay="scope">
+      <template v-slot:pricingWay="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.pricingWay'"
           :rules="{
@@ -454,55 +454,10 @@
             </el-option>
           </el-select>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:headerPricingWay="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <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>
     </ele-pro-table>
 
     <product-list
@@ -526,13 +481,15 @@
   </el-form>
 </template>
 <script>
-  import { numberReg, positiveIntegerReg } from 'ele-admin';
+  import { emailReg, phoneReg, numberReg, positiveIntegerReg } from 'ele-admin';
   import productList from '@/BIZComponents/product-list.vue';
   import dictMixins from '@/mixins/dictMixins';
+  import store from '@/store';
   import fileUpload from '@/components/upload/fileUpload';
   import headList from '@/BIZComponents/user-select/user-select.vue';
   import { getFile } from '@/api/system/file';
-
+  import { getByCode } from '@/api/system/dictionary-data';
+  // import fileMain from '@/components/addDoc/index.vue';
   import billDetailDialog from './billDetailDialog.vue';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
   import { getCode } from '@/components/addDoc/api/index.js';
@@ -541,7 +498,6 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
   import { getGoodsPriceByCondition } from '@/api/goodsManage/index';
-  import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
 
   const dayjs = require('dayjs');
 
@@ -676,43 +632,12 @@
           },
           {
             width: 150,
-            prop: 'purchaseCount',
+            prop: 'totalCount',
             label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
+            slot: 'totalCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
-          {
-            width: 150,
-            prop: 'totalCount',
-            label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
           {
             width: 120,
             prop: 'availableCountBase',
@@ -720,14 +645,14 @@
             slot: 'availableCountBase',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   headerSlot: 'headerPricingWay',
-          //   slot: 'pricingWay',
-          //   align: 'center'
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            headerSlot: 'headerPricingWay',
+            slot: 'pricingWay',
+            align: 'center'
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -836,6 +761,21 @@
             }
           },
 
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+
+          {
+            width: 80,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'singleWeight',
@@ -971,6 +911,7 @@
     created() {
       this.requestDict('生产类型');
       this.requestDict('商品价格类型');
+
     },
     methods: {
       handleGetBillDetail(row, type) {
@@ -1005,60 +946,15 @@
       getPrice() {
         return [this.allPrice];
       },
-      packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-          'purchaseUnit',
-          item.conversionUnit
-        );
-      },
-
       //改变数量
       changeCount(row, index) {
         if (this.detailType) {
           return;
         }
-        let countObj = {
-          countKey: 'purchaseCount',
-          unitKey: 'purchaseUnit',
-          unitIdKey: 'purchaseUnitId'
-        };
-        if (!row) {
-          this.form.datasource.forEach((item, index) => {
-            this.$set(
-              this.form,
-              'datasource[' + index + ']',
-              changeCount(item, countObj)
-            );
-          });
-        } else {
-          this.$set(
-            this.form,
-            'datasource[' + index + ']',
-            changeCount(row, countObj)
-          );
-        }
 
-        this.getNotaxSinglePrice();
-        this.changeAll();
-        this.$forceUpdate();
+        this.singleWeightChange(row, index);
+        this.getTotalPrice();
       },
-      changeAll() {
-        this.allPrice = getAllPrice(this.form.datasource) || 0;
-        this.$store.commit('concact/setDiscountAmount', this.allPrice);
-        this.$store.commit('order/setAllcountAmount', this.allPrice);
-        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({
@@ -1093,28 +989,28 @@
           });
         }
       },
-      // //计算总金额
-      // getTotalPrice(row, index) {
-      //   this.getNotaxSinglePrice();
+      //计算总金额
+      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;
-      //   }
-      // },
+        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) => {
@@ -1131,82 +1027,64 @@
           }
         });
       },
-      // //计算总金额
-      // 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;
-      // },
+      //计算总金额
+      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);
-      //   }
-      // },
+      //计算单重
+      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;
         //获取优惠金额和总计的差价
-        this.form.datasource.forEach((item, index) => {
+        this.form.datasource.forEach((item) => {
           if (val === 0) {
-            this.$set(this.form.datasource[index], 'discountTotalPrice', 0);
-            this.$set(this.form.datasource[index], 'discountSinglePrice', 0);
+            item.discountTotalPrice = 0;
+            item.discountSinglePrice = 0;
             return;
           }
           if (!val) {
-            this.$set(
-              this.form.datasource[index],
-              'discountTotalPrice',
-              item.totalPrice
-            );
-            this.$set(
-              this.form.datasource[index],
-              'discountSinglePrice',
-              item.singlePrice
-            );
+            item.discountTotalPrice = item.totalPrice;
+            item.discountSinglePrice = item.singlePrice;
             return;
           }
-
-          this.$set(
-            this.form.datasource[index],
-            'discountSinglePrice',
-            this.getDiscountSinglePrice(item)
-          );
           //获取折让单价
-          this.$set(
-            this.form.datasource[index],
-            'discountTotalPrice',
-            this.getDiscountTotalPrice(item)
-          );
+          item.discountSinglePrice = this.getDiscountSinglePrice(item);
+          item.discountTotalPrice = this.getDiscountTotalPrice(item);
         });
-        this.$forceUpdate();
-        this.$refs.table.reRenderTable();
+        this.$refs.table.reload();
         this.$store.commit('concact/setDiscountAmount', val);
       },
       //获取折让单价
@@ -1231,26 +1109,35 @@
           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');
+      //获取合计
+      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);
-      // },
+        return isNaN(num) ? '' : num.toFixed(2);
+      },
       //获取折让合计
       getDiscountTotalPrice(row) {
         let num = 0;
-        num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        if (row.pricingWay == 1) {
+          num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        }
+        if (row.pricingWay == 2) {
+          num =
+            Number(row.discountSinglePrice) *
+            Number(row.totalCount) *
+            Number(row.singleWeight);
+        }
+
         return isNaN(num) ? '' : num.toFixed(2);
       },
       //修改回显
@@ -1353,23 +1240,6 @@
             'packingSpecification',
             item.extField?.packingSpecification
           );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(
-              parasm,
-              'purchaseUnitId',
-              item.packageDispositionList[0].id
-            );
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
           this.$set(parasm, 'supplierMark', this.supplierMark);
           this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
           if (item.purchaseOrigins?.length > 0) {

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

@@ -302,29 +302,6 @@
               slot: 'warehouseName',
               align: 'center'
             },
-            {
-              width: 150,
-              prop: 'purchaseCount',
-              label: '数量',
-              slot: 'purchaseCount',
-              headerSlot: 'headerTotalCount',
-              align: 'center'
-            },
-            {
-              width: 150,
-              prop: 'purchaseUnit',
-              label: '单位',
-              slot: 'purchaseUnit',
-              headerSlot: 'headerTotalCount',
-              align: 'center'
-            },
-            {
-              width: 120,
-              prop: 'packingSpecification',
-              align: 'center',
-              label: '包装规格',
-              showOverflowTooltip: true
-            },
             {
               width: 80,
               prop: 'totalCount',
@@ -395,21 +372,21 @@
               align: 'center',
               show: v != 2
             },
-            // {
-            //   width: 160,
-            //   prop: 'pricingWay',
-            //   label: '计价方式',
-            //   slot: 'pricingWay',
-            //   align: 'center',
-            //   show: v != 2,
-            //   formatter: (row, column) => {
-            //     return row.pricingWay == 1
-            //       ? '按数量计费'
-            //       : row.pricingWay == 2
-            //       ? '按重量计费'
-            //       : '';
-            //   }
-            // },
+            {
+              width: 160,
+              prop: 'pricingWay',
+              label: '计价方式',
+              slot: 'pricingWay',
+              align: 'center',
+              show: v != 2,
+              formatter: (row, column) => {
+                return row.pricingWay == 1
+                  ? '按数量计费'
+                  : row.pricingWay == 2
+                  ? '按重量计费'
+                  : '';
+              }
+            },
             {
               minWidth: 120,
               prop: 'goodsLevel',

+ 83 - 205
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -50,7 +50,7 @@
           />
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
+      <template v-slot:totalCount="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
@@ -61,7 +61,7 @@
             @input="(val) => changeNum(val, scope.$index, scope.row)"
           ></el-input>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:batchNo="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -152,17 +152,17 @@
           </el-select>
         </el-form-item>
       </template>
-      <template v-slot:singlePrice="scope">
+      <template v-slot:notaxSinglePrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.singlePrice'"
+          :prop="'datasource.' + scope.$index + '.notaxSinglePrice'"
         >
           <el-input
-            v-model="scope.row.singlePrice"
+            v-model="scope.row.notaxSinglePrice"
             placeholder="请输入"
             type="number"
-            @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">元</template>
           </el-input>
         </el-form-item>
       </template>
@@ -171,7 +171,7 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.specification'"
         >
-          <el-input v-model="scope.row.specification"></el-input>
+          <el-input v-model="scope.row.specification" ></el-input>
         </el-form-item>
       </template>
       <template v-slot:warehouseNum="scope">
@@ -238,53 +238,6 @@
           </el-date-picker>
         </el-form-item>
       </template>
-
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <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:action="scope">
         <el-popconfirm
@@ -362,8 +315,6 @@
   import productListMain from '@/BIZComponents/product-list.vue';
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
-
   const dayjs = require('dayjs');
 
   export default {
@@ -510,7 +461,13 @@
           //   label: '批准文号',
           //   showOverflowTooltip: true
           // },
-
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 120,
             prop: 'supplierMark',
@@ -533,36 +490,12 @@
             headerSlot: 'headerWarehouseId',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
-
           {
             width: 120,
             prop: 'totalCount',
             label: '收货数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
@@ -622,20 +555,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -666,7 +599,7 @@
             width: 180,
             prop: 'notaxSinglePrice',
             label: '不含税单价',
-            // slot: 'notaxSinglePrice',
+            slot: 'notaxSinglePrice',
             align: 'center'
           },
           {
@@ -873,97 +806,61 @@
 
         this.setIcreaseTotalWeight(this.curIndex);
       },
-
-      //改变数量
-      changeCount(row, index) {
+      //修改数量更新合计/总重
+      changeNum(val, index, row) {
+        this.setWeight(index);
+        this.getTotalPrice(index);
+      },
+      setWeight(index) {
+        let data = this.form.datasource[index];
+        let totalCount = data.totalCount;
+        let singleWeight = data.singleWeight;
+        let sendTotalWeight = data.sendTotalWeight;
         this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, {
-            countKey: 'purchaseCount',
-            unitKey: 'purchaseUnit',
-            unitIdKey: 'purchaseUnitId'
-          })
+          this.form.datasource[index],
+          'receiveTotalWeight',
+          totalCount * singleWeight || 0
         );
         this.$set(
           this.form.datasource[index],
-          'receiveTotalWeight',
-          this.form.datasource[index].totalWeight
+          'increaseTotalWeight',
+          Number(this.form.datasource[index].receiveTotalWeight) -
+            Number(sendTotalWeight)
         );
-        this.setIcreaseTotalWeight(index);
-        this.getNotaxSinglePrice();
-        this.$forceUpdate();
       },
-      getNotaxSinglePrice() {
-        this.form.datasource.forEach((item, index) => {
-          if (item.singlePrice && item.taxRate) {
-            this.$set(
-              this.form.datasource[index],
-              'notaxSinglePrice',
-              parseFloat(
-                (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
-              )
-            );
-          } else {
-            this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
-          }
-        });
+      getTotalPrice(index) {
+        let data = this.form.datasource[index];
+        let singlePrice = data.singlePrice;
+        let discountSinglePrice = data.discountSinglePrice;
+        let totalCount = data.totalCount;
+        if (data['pricingWay'] == 2) {
+          let increaseTotalWeight = data.increaseTotalWeight;
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
+          );
+          this.$set(
+            this.form.datasource[index],
+            'discountTotalPrice',
+            (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(
+              2
+            )
+          );
+        }
+        if (this.form.datasource[index]['pricingWay'] == 1) {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            (Number(totalCount) * Number(singlePrice)).toFixed(2)
+          );
+          this.$set(
+            this.form.datasource[index],
+            'discountTotalPrice',
+            (Number(totalCount) * Number(discountSinglePrice)).toFixed(2)
+          );
+        }
       },
-      // //修改数量更新合计/总重
-      // changeNum(val, index, row) {
-      //   this.setWeight(index);
-      //   this.getTotalPrice(index);
-      // },
-      // setWeight(index) {
-      //   let data = this.form.datasource[index];
-      //   let totalCount = data.totalCount;
-      //   let singleWeight = data.singleWeight;
-      //   let sendTotalWeight = data.sendTotalWeight;
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'receiveTotalWeight',
-      //     totalCount * singleWeight || 0
-      //   );
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'increaseTotalWeight',
-      //     Number(this.form.datasource[index].receiveTotalWeight) -
-      //       Number(sendTotalWeight)
-      //   );
-      // },
-      // getTotalPrice(index) {
-      //   let data = this.form.datasource[index];
-      //   let singlePrice = data.singlePrice;
-      //   let discountSinglePrice = data.discountSinglePrice;
-      //   let totalCount = data.totalCount;
-      //   if (data['pricingWay'] == 2) {
-      //     let increaseTotalWeight = data.increaseTotalWeight;
-      //     this.$set(
-      //       this.form.datasource[index],
-      //       'totalPrice',
-      //       (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
-      //     );
-      //     this.$set(
-      //       this.form.datasource[index],
-      //       'discountTotalPrice',
-      //       (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(
-      //         2
-      //       )
-      //     );
-      //   }
-      //   if (this.form.datasource[index]['pricingWay'] == 1) {
-      //     this.$set(
-      //       this.form.datasource[index],
-      //       'totalPrice',
-      //       (Number(totalCount) * Number(singlePrice)).toFixed(2)
-      //     );
-      //     this.$set(
-      //       this.form.datasource[index],
-      //       'discountTotalPrice',
-      //       (Number(totalCount) * Number(discountSinglePrice)).toFixed(2)
-      //     );
-      //   }
-      // },
       //设置增重总重
       setIcreaseTotalWeight(index) {
         let receiveTotalWeight = Number(
@@ -977,6 +874,7 @@
           'increaseTotalWeight',
           (receiveTotalWeight - sendTotalWeight).toFixed(2)
         );
+        this.getTotalPrice(index);
         this.$refs.table.reload();
       },
       //选择产品回调
@@ -1027,28 +925,7 @@
             'supplierMark',
             this.form.datasource[0]?.supplierMark
           );
-          this.$set(
-            parasm,
-            'packingSpecification',
-            item.extField?.packingSpecification
-          );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(
-              parasm,
-              'purchaseUnitId',
-              item.packageDispositionList[0].id
-            );
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
+          // this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
           }
@@ -1136,7 +1013,7 @@
               : '';
             item.key = index + 1;
             this.init(item, index);
-            // this.getTotalPrice(index);
+            this.getTotalPrice(index);
           });
           this.$refs.table.reload();
           this.$forceUpdate();
@@ -1171,6 +1048,7 @@
             item.increaseTotalWeight || item.receiveTotalWeight || 0
           );
         }
+        this.$set(this.form.datasource[index], 'pricingWay', item.pricingWay);
       },
 
       remove(i) {

+ 22 - 38
src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue

@@ -252,7 +252,13 @@
               }
             }
           },
- 
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 200,
             prop: 'supplierMark',
@@ -267,29 +273,7 @@
             slot: 'warehouseName',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
+
           {
             width: 120,
             prop: 'totalCount',
@@ -339,20 +323,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 91 - 200
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -52,7 +52,17 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + $index + '.customerReqFiles'"
         >
-          <fileMain v-model="row.customerReqFiles" type="view"></fileMain>
+          <div v-if="row.customerReqFiles && row.customerReqFiles?.length">
+            <el-link
+              v-for="link in row.customerReqFiles"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link>
+          </div>
         </el-form-item>
       </template>
 
@@ -69,7 +79,7 @@
           />
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
+      <template v-slot:totalCount="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
@@ -82,7 +92,7 @@
             @input="(val) => changeNum(val, scope.row, scope.$index)"
           ></el-input>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:singlePrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -91,7 +101,7 @@
           <el-input
             v-model="scope.row.singlePrice"
             placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="changeNum(val, scope.row, scope.$index)"
             type="number"
           >
             <template slot="append">元</template>
@@ -161,53 +171,6 @@
           </el-button>
         </el-form-item>
       </template>
-
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <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:action="scope">
         <el-popconfirm
@@ -254,10 +217,9 @@
   import { getCode } from '@/components/addDoc/api/index.js';
   import { lbjtList } from '@/enum/dict.js';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount } from '@/BIZComponents/setProduct.js';
 
   export default {
-    mixins: [dictMixins, tabMixins],
+    mixins: [dictMixins,tabMixins],
     props: {
       orderId: String,
       isShowAdd: {
@@ -269,8 +231,7 @@
     },
     components: {
       // fileMain,
-      productList,
-      taskinstanceDialog
+      productList,taskinstanceDialog
     },
     data() {
       const defaultForm = {
@@ -286,12 +247,12 @@
         // warehouseName:'',
       };
       return {
-        cacheKeyUrl: 'eos-purchaseOrder-outSourceSend-inventoryTable',
+        cacheKeyUrl:'eos-purchaseOrder-outSourceSend-inventoryTable',
         discountTotalPrice: 0.0,
         allPrice: 0.0,
         numberReg,
         defaultForm,
-        taskinstanceDialogFlag: false,
+        taskinstanceDialogFlag:false,
         warehouseList: [],
         form: {
           datasource: []
@@ -370,8 +331,20 @@
               }
             }
           },
-
-   
+          // {
+          //   width: 120,
+          //   prop: 'approvalNumber',
+          //   align: 'center',
+          //   label: '批准文号',
+          //   showOverflowTooltip: true
+          // },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             minWidth: 150,
             prop: 'supplierMark',
@@ -394,29 +367,6 @@
             slot: 'warehouseNum',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 100,
             prop: 'totalCount',
@@ -473,27 +423,26 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '数量'
-          //       : row.pricingWay == 2
-          //       ? '重量'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '数量'
+                : row.pricingWay == 2
+                ? '重量'
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',
             label: '物品级别',
             formatter: (_row, _column, cellValue) => {
-              return levelList.find((item) => item.value == _row.goodsLevel)
-                ?.label;
+              return levelList.find(item=>item.value==_row.goodsLevel)?.label
             },
             align: 'center'
           },
@@ -517,7 +466,7 @@
             width: 180,
             prop: 'notaxSinglePrice',
             label: '不含税单价',
-            // slot: 'notaxSinglePrice',
+            slot: 'notaxSinglePrice',
             align: 'center'
           },
           {
@@ -682,6 +631,9 @@
       }
     },
     methods: {
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
       async warehouseChange(index, row, item) {
         console.log(item, 'row');
 
@@ -711,96 +663,52 @@
           this.$refs.taskinstanceDialogRef.open(row, index);
         });
       },
-      //改数量
-      changeCount(row, index) {
+      //改数量更新合计
+      changeNum(val, row, index) {
         this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, {
-            countKey: 'purchaseCount',
-            unitKey: 'purchaseUnit',
-            unitIdKey: 'purchaseUnitId'
-          })
+          this.form.datasource[index],
+          'sendTotalWeight',
+          val ? val * row.singleWeight : ''
         );
         this.$set(
           this.form.datasource[index],
-          'sendTotalWeight',
-          this.form.datasource[index].totalWeight
+          'totalPrice',
+          this.getTotalPrice(row).toFixed(2)
         );
-
-        this.getNotaxSinglePrice();
-        this.$forceUpdate();
-      },
-      packingChange(item, index) {
         this.$set(
           this.form.datasource[index],
-          'purchaseUnit',
-          item.conversionUnit
+          'discountTotalPrice',
+          this.getDiscountTotalPrice(row).toFixed(2)
         );
       },
+      getTotalPrice(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);
+        }
 
-      //计算不含税单价
-      getNotaxSinglePrice() {
-        this.form.datasource.forEach((item, index) => {
-          if (item.singlePrice && item.taxRate) {
-            this.$set(
-              this.form.datasource[index],
-              'notaxSinglePrice',
-              parseFloat(
-                (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
-              )
-            );
-          } else {
-            this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
-          }
-        });
+        return num;
       },
-      // //修改数量更新合计
-      // changeNum(val, row, index) {
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'sendTotalWeight',
-      //     val ? val * row.singleWeight : ''
-      //   );
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'totalPrice',
-      //     this.getTotalPrice(row).toFixed(2)
-      //   );
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'discountTotalPrice',
-      //     this.getDiscountTotalPrice(row).toFixed(2)
-      //   );
-      // },
-      // getTotalPrice(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);
-      //   }
-
-      //   return num;
-      // },
-      // getDiscountTotalPrice(row) {
-      //   let num = 0;
-      //   if (row.pricingWay == 1) {
-      //     num = Number(row.discountSinglePrice) * Number(row.totalCount);
-      //   }
-      //   if (row.pricingWay == 2) {
-      //     num =
-      //       Number(row.discountSinglePrice) *
-      //       Number(row.totalCount) *
-      //       Number(row.singleWeight);
-      //   }
+      getDiscountTotalPrice(row) {
+        let num = 0;
+        if (row.pricingWay == 1) {
+          num = Number(row.discountSinglePrice) * Number(row.totalCount);
+        }
+        if (row.pricingWay == 2) {
+          num =
+            Number(row.discountSinglePrice) *
+            Number(row.totalCount) *
+            Number(row.singleWeight);
+        }
 
-      //   return num;
-      // },
+        return num;
+      },
       // //选择产品回调
       // changeParent(obj, idx) {
       //   obj.orderTotalCount = obj.totalCount;
@@ -856,23 +764,6 @@
             'supplierMark',
             this.form.datasource[0]?.supplierMark
           );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(
-              parasm,
-              'purchaseUnitId',
-              item.packageDispositionList[0].id
-            );
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
           this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
@@ -949,12 +840,12 @@
                 categoryId: item.productId
               })
             );
-            // if (!item.sendTotalWeight)
-            this.$set(
-              item,
-              'sendTotalWeight',
-              item.sendTotalWeight || item.totalWeight
-            );
+            if (!item.sendTotalWeight)
+              this.$set(
+                item,
+                'sendTotalWeight',
+                Number(item.totalCount) * Number(item.singleWeight)
+              );
           });
         }
       },

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

@@ -339,20 +339,20 @@
             slot: 'increaseTotalWeight',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

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

@@ -456,20 +456,20 @@
             slot: 'increaseTotalWeight',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 15 - 28
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -398,39 +398,13 @@
             slot: 'productBrand',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
-          },
-          {
-            minWidth: 180,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 80,
             prop: 'totalCount',
-            label: '计量数量',
+            label: '数量',
             slot: 'totalCount',
             align: 'center'
           },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -497,7 +471,13 @@
             label: '已核价重量',
             align: 'center'
           },
-     
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
           {
             width: 130,
             prop: 'modelType',
@@ -545,6 +525,13 @@
             headerSlot: 'headerSupplierName',
             align: 'center'
           },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
           {
             width: 160,
             prop: 'technicalDrawings',

+ 30 - 134
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -94,7 +94,7 @@
         >
           <el-input
             v-model="scope.row.totalCount"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="singleWeightChange(scope.row, scope.$index)"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -308,7 +308,7 @@
           <el-input
             :disabled="isContractId"
             v-model="scope.row.singleWeight"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="singleWeightChange(scope.row, scope.$index)"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -318,10 +318,11 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.supplierName'"
           :rules="{
-            required: isSupplier ? true : false,
+            required: isSupplier?true:false,
             trigger: 'change',
-            message: '请选择供应商'
+            message: '请选择供应商',
           }"
+          
         >
           <el-input
             clearable
@@ -355,7 +356,9 @@
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:headerSupplierName="{ column }">
-        <span :class="{ 'is-required': isSupplier }">{{ column.label }}</span>
+        <span :class="{ 'is-required': isSupplier }">{{
+          column.label
+        }}</span>
       </template>
       <template v-slot:headerWarehouseId="{ column }">
         <span
@@ -390,51 +393,6 @@
           </el-select>
         </el-form-item>
       </template>
-      <template v-slot:purchaseCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.purchaseCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:purchaseUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <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:action="scope">
         <el-popconfirm
@@ -502,7 +460,6 @@
   import { getWarehouseList } from '@/api/saleManage/saleorder';
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount } from '@/BIZComponents/setProduct.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -530,6 +487,7 @@
       warehouseAll
     },
     computed: {
+   
       columns() {
         return [
           {
@@ -596,35 +554,12 @@
             label: '需求数量',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseCount',
-            label: '数量',
-            slot: 'purchaseCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
           {
             width: 90,
             prop: 'totalCount',
-            label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+            label: '数量',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
@@ -755,6 +690,14 @@
             }
           },
 
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+
           {
             width: 100,
             prop: 'measuringUnit',
@@ -832,37 +775,16 @@
         });
         return comitDatasource;
       },
-      // //计算单重
-      // 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
-      //     );
-      //   }
-      // },
-
-      packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-          'purchaseUnit',
-          item.conversionUnit
-        );
-      },
-      //改变数量
-      changeCount(row, index) {
-        this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, {
-            countKey: 'purchaseCount',
-            unitKey: 'purchaseUnit',
-            unitIdKey: 'purchaseUnitId'
-          })
-        );
-        this.$forceUpdate();
+      //计算单重
+      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
+          );
+        }
       },
       //修改回显
       async putTableValue(data) {
@@ -1026,19 +948,6 @@
             'packingSpecification',
             item.extField.packingSpecification
           );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
           this.$set(parasm, 'provenance', item.purchaseOrigins || []);
           if (idx == -1) {
             this.form.datasource.push(row);
@@ -1085,19 +994,6 @@
             'packingSpecification',
             item.extField.packingSpecification
           );
-          this.$set(
-            parasm,
-            'packageDispositionList',
-            item.packageDispositionList
-          );
-          if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
-            this.$set(
-              parasm,
-              'purchaseUnit',
-              item.packageDispositionList[0].conversionUnit
-            );
-          }
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
           }

+ 0 - 1
src/views/saleManage/quotation/index.vue

@@ -492,7 +492,6 @@
             sourceName: data.code,
             status: '',
             totalPrice: data.totalPrice,
-            discountTotalPrice: data.totalPrice,
             type: '1',
             typeName: '销售合同',
             updateUsername: '',

+ 11 - 11
src/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue

@@ -175,17 +175,17 @@ export default {
                 : '';
             }
           },
-          // {
-          //   minWidth: 100,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   align: 'center',
-          //   slot: 'pricingWay',
-          //   showOverflowTooltip: true,
-          //   formatter: (_row, _column, cellValue) => {
-          //     return _row.pricingWay == 1 ? '按数量计价' :_row.pricingWay == 2? '按重量计价':''
-          //   }
-          // },
+          {
+            minWidth: 100,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            slot: 'pricingWay',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return _row.pricingWay == 1 ? '按数量计价' :_row.pricingWay == 2? '按重量计价':''
+            }
+          },
           {
             minWidth: 100,
             prop: 'totalCount',

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

@@ -791,13 +791,6 @@
               contractNo,
               contractNumber
             });
-            data.productList = data.productList.map((item) => {
-              item['saleCount'] = item.contractCount;
-              item['saleUnit'] = item.contractUnit;
-              item['saleUnitId'] = item.contractUnitId;
-              return item;
-            });
-
             this.getLinkInfo(partaId);
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data);

+ 2 - 2
src/views/saleManage/saleOrder/customerReturnOrder/add-sale-order-dialog.vue

@@ -34,14 +34,14 @@
           >
             <span>{{ form.contactName }}</span>
           </el-form-item>
-          <!-- <el-form-item
+          <el-form-item
             label="计价方式"
             style="margin-bottom: 22px">
             <el-select v-model="form.pricingWay" disabled style="width: 100%">
               <el-option label="按数量计费" :value="1"></el-option>
               <el-option label="按重量计费" :value="2"></el-option>
             </el-select>
-          </el-form-item> -->
+          </el-form-item>
           <el-form-item
             label="客户联系人"
             prop="linkName"

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

@@ -270,20 +270,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',

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

@@ -321,20 +321,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 80,
             prop: 'singlePrice',

+ 14 - 14
src/views/saleManage/saleOrder/exceptionManagement/components/addOrEditDialog.vue

@@ -276,20 +276,20 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 100,
             prop: 'singlePrice',

+ 8 - 1
src/views/saleManage/saleOrder/invoice/components/detailDialog.vue

@@ -60,7 +60,14 @@
           </el-col>
 
           <el-col :span="12">
-   
+            <!-- <el-form-item label="车辆名称" >
+              <el-input disabled v-model="form.deviceName"/>
+            </el-form-item>
+            <el-form-item
+              label="车牌号:"
+              prop="carNo">
+              <el-input v-model="form.carNo" disabled></el-input>
+            </el-form-item> -->
             <el-form-item label="受托收货单编码:" prop="entrustedCode">
               <el-input v-model="form.entrustedCode" disabled></el-input>
             </el-form-item>

+ 126 - 237
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -233,7 +233,7 @@
           <el-input
             v-model="scope.row.singlePrice"
             placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
+            @input="changeCount"
             type="number"
           >
             <template slot="append">元</template>
@@ -285,51 +285,7 @@
           column.label
         }}</span>
       </template>
-      <template v-slot:saleCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.saleCount'"
-          :rules="{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.saleCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:saleUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.saleUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
-        >
-          <el-select
-            v-model="scope.row.saleUnitId"
-            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:action="scope">
         <el-popconfirm
@@ -400,7 +356,7 @@
   import { getFile } from '@/api/system/file';
   import innertboundDetailsDialog from '@/BIZComponents/innerboundDetailsDialog.vue';
   import stockLedgerDialog from './stockLedger/stockLedgerDialog.vue';
-
+  import { fieldModelAPI } from '@/api/main';
   import getDynamicsColumns from '@/mixins/getDynamicsColumns';
   // import fileMain from '@/components/addDoc/index.vue';
   import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
@@ -409,7 +365,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
-  import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
+
   export default {
     mixins: [dictMixins, getDynamicsColumns, tabMixins],
     props: {
@@ -595,7 +551,29 @@
             align: 'center',
             slot: 'productionCodes'
           },
-
+          {
+            width: 120,
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true
+          },
+          {
+            width: 120,
+            prop: 'produceType',
+            align: 'center',
+            label: '属性类型',
+            formatter: (row, column) => {
+              if (row.produceType) {
+                return row.produceType
+                  .map((item) => {
+                    return lbjtList[item];
+                  })
+                  .toString();
+              }
+            },
+            showOverflowTooltip: true
+          },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -638,37 +616,12 @@
           //   slot: 'stockLedger',
           //   align: 'center'
           // },
-
-          {
-            width: 150,
-            prop: 'saleCount',
-            label: '数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
-
           {
             width: 120,
             prop: 'totalCount',
             label: '发货数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
@@ -732,20 +685,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 180,
             prop: 'singlePrice',
@@ -796,35 +749,12 @@
             align: 'center'
           },
           {
-            width: 120,
-            prop: 'imgCode',
-            align: 'center',
-            label: '图号/件号',
-            showOverflowTooltip: true
-          },
-          {
-            width: 120,
-            prop: 'produceType',
-            align: 'center',
-            label: '属性类型',
-            formatter: (row, column) => {
-              if (row.produceType) {
-                return row.produceType
-                  .map((item) => {
-                    return lbjtList[item];
-                  })
-                  .toString();
-              }
-            },
-            showOverflowTooltip: true
+            width: 80,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays',
+            align: 'center'
           },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays',
-          //   align: 'center'
-          // },
 
           {
             width: 200,
@@ -921,46 +851,39 @@
       },
       changeCount1(row, index) {
         this.tableHandleKeyUp(row, index, 'sum');
-        this.changeCount(row, index);
-      },
-      packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-           'saleUnitId',
-          item.conversionUnit
-        );
+        this.changeCount();
       },
       //改变数量
-      // 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)
-      //       );
-      //     }
-      //   });
-      // },
+      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)
@@ -1009,64 +932,12 @@
           warehouseOutStock || 0
         );
       },
-      //改变数量
-      changeCount(row, index) {
-        this.$set(
-          this.form,
-          'datasource[' + index + ']',
-          changeCount(row, {
-            countKey: 'saleCount',
-            unitKey: 'saleUnit',
-            unitIdKey: 'saleUnitId'
-          })
-        );
-        this.$set(
-          this.form.datasource[index],
-          'sendTotalWeight',
-          this.form.datasource[index].totalWeight
-        );
-        this.changeSendTotalWeight(row, index);
-        this.getNotaxSinglePrice();
-        this.$forceUpdate();
-      },
+
       //修改发货总重
       changeSendTotalWeight(row, index) {
         this.curIndex = index;
         this.setIcreaseTotalWeight(row);
       },
-
-      //设置增重总重
-      setIcreaseTotalWeight(row) {
-        let receiveTotalWeight = Number(
-          this.form.datasource[this.curIndex]?.receiveTotalWeight
-        );
-        let sendTotalWeight = Number(
-          this.form.datasource[this.curIndex]?.sendTotalWeight
-        );
-        this.$set(
-          this.form.datasource[this.curIndex],
-          'increaseTotalWeight',
-          (sendTotalWeight - receiveTotalWeight).toFixed(2)
-        );
-        this.$refs.table.reload();
-        this.$forceUpdate();
-      },
-      //计算不含税单价
-      getNotaxSinglePrice() {
-        this.form.datasource.forEach((item, index) => {
-          if (item.singlePrice && item.taxRate) {
-            this.$set(
-              this.form.datasource[index],
-              'notaxSinglePrice',
-              parseFloat(
-                (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
-              )
-            );
-          } else {
-            this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
-          }
-        });
-      },
       //入库单详情
       handleInnerBound(e, rows, index) {
         this.curIndex = index;
@@ -1093,23 +964,42 @@
         this.setIcreaseTotalWeight(this.form.datasource[this.curIndex]);
       },
 
-      // getWeightPrice() {
-      //   let increaseTotalWeight =
-      //     this.form.datasource[this.curIndex].increaseTotalWeight;
-      //   let singlePrice = this.form.datasource[this.curIndex].singlePrice;
-      //   let discountSinglePrice =
-      //     this.form.datasource[this.curIndex].discountSinglePrice;
-      //   this.$set(
-      //     this.form.datasource[this.curIndex],
-      //     'totalPrice',
-      //     (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
-      //   );
-      //   this.$set(
-      //     this.form.datasource[this.curIndex],
-      //     'discountTotalPrice',
-      //     (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2)
-      //   );
-      // },
+      getWeightPrice() {
+        let increaseTotalWeight =
+          this.form.datasource[this.curIndex].increaseTotalWeight;
+        let singlePrice = this.form.datasource[this.curIndex].singlePrice;
+        let discountSinglePrice =
+          this.form.datasource[this.curIndex].discountSinglePrice;
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'totalPrice',
+          (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
+        );
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'discountTotalPrice',
+          (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2)
+        );
+      },
+      //设置增重总重
+      setIcreaseTotalWeight(row) {
+        let receiveTotalWeight = Number(
+          this.form.datasource[this.curIndex]?.receiveTotalWeight
+        );
+        let sendTotalWeight = Number(
+          this.form.datasource[this.curIndex]?.sendTotalWeight
+        );
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'increaseTotalWeight',
+          (sendTotalWeight - receiveTotalWeight).toFixed(2)
+        );
+        if (row.pricingWay == 2) {
+          this.getWeightPrice();
+        }
+        this.$refs.table.reload();
+        this.$forceUpdate();
+      },
 
       // 表格:模数、数量(方)、块数输入框 输入事件
       tableHandleKeyUp(row, index, name) {
@@ -1127,7 +1017,7 @@
             row.totalCount =
               (Number(row.blockCount) * modelLong * modeWide * modeHight) /
               1000000;
-            this.changeCount(row, index);
+            this.changeCount();
           }
         }
       },
@@ -1275,15 +1165,10 @@
                 'receiveTotalWeight',
                 item.receiveTotalWeight || 0
               );
-              if (item.weightUnit == item.measuringUnit) {
-                item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
-              } else {
-                item.sendTotalWeight =
-                  item.sendTotalWeight ||
-                  Number(item.totalCount) * Number(item.singleWeight) ||
-                  0;
-              }
-
+              item.sendTotalWeight =
+                item.sendTotalWeight ||
+                Number(item.totalCount) * Number(item.singleWeight) ||
+                0;
               if (this.outsourceSendCode) {
                 item.increaseTotalWeight =
                   Number(item.receiveTotalWeight) -
@@ -1293,6 +1178,7 @@
                   item.increaseTotalWeight || item.receiveTotalWeight || 0;
               }
             });
+            this.changeCount();
           });
         }
       },
@@ -1301,7 +1187,10 @@
         this.form.datasource.splice(i, 1);
         this.setSort();
       },
-
+      // 清空表格
+      restTable() {
+        this.form.datasource = [];
+      },
       // 重新排序
       setSort() {
         this.form.datasource.forEach((n, index) => {

+ 22 - 44
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -176,29 +176,7 @@
 
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'saleCount',
-            label: '数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'packingSpecification',
-            align: 'center',
-            label: '包装规格',
-            showOverflowTooltip: true
-          },
+
           {
             width: 120,
             prop: 'totalCount',
@@ -268,20 +246,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -327,13 +305,13 @@
             align: 'center'
           },
           ...this.dynamicsColumns,
-          // {
-          //   width: 120,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays',
-          //   align: 'center'
-          // },
+          {
+            width: 120,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays',
+            align: 'center'
+          },
           {
             width: 200,
             prop: 'guaranteePeriod',

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

@@ -415,20 +415,20 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',

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

@@ -384,20 +384,20 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',

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

@@ -336,20 +336,20 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',

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

@@ -439,20 +439,20 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'goodsPriceType',