Ver Fonte

fix: 预收预付问题修复

liujt há 5 dias atrás
pai
commit
18cc586f1e

+ 11 - 2
src/views/financialManage/advanceReceipt/components/addDialog.vue

@@ -181,9 +181,10 @@
       ></headerTitle>
       <inventoryTableDetails
         ref="inventoryTableDetailsRef"
-        :isAllPrice="false"
+        :isAllPrice="true"
         :showSummary="true"
         :isSelected="false"
+        :isDiscountTotalPrice="true"
         cacheKeyUrl="eos-advanceReceipt-inventoryTableDetails"
       ></inventoryTableDetails>
       <!-- 收款信息 -->
@@ -423,11 +424,19 @@
         this.isDetail = type === 'detail';
         if ((this.isUpdate || this.isDetail) && row) {
           this.form = await getAdvanceReceiptInfo(row.id);
+          this.form.totalAmount = this.form.productList.reduce((sum, item) => {
+            const val = parseFloat(item.totalPrice);
+            return sum + (isNaN(val) ? 0 : val);
+          }, 0);
+          this.form.discountTotalPrice = this.form.productList.reduce((sum, item) => {
+            const val = parseFloat(item.discountTotalPrice);
+            return sum + (isNaN(val) ? 0 : val);
+          }, 0);
           this.businessId = row.id;
           this.$nextTick(() => {
             this.$refs.inventoryTableDetailsRef &&
               this.$refs.inventoryTableDetailsRef.putTableValue(
-                this.form || []
+                this.form
               );
           });
         } else {

+ 1 - 1
src/views/financialManage/advanceReceipt/components/searchForm.vue

@@ -17,7 +17,7 @@
             label: '关键词:',
             value: 'searchName',
             type: 'input',
-            placeholder: '编码、名称、型号、规格'
+            placeholder: '编码、名称'
           },
           // {
           //   label: '下拉检索:',

+ 16 - 1
src/views/financialManage/prepayment/components/addDialog.vue

@@ -187,10 +187,12 @@
       <headerTitle title="物品清单" size="16px" style="margin-top: 20px"></headerTitle>
       <inventoryTableDetails
         ref="inventoryTableDetailsRef"
-        :isAllPrice="false"
+        :isAllPrice="true"
         :showSummary="true"
         :isSelected="false"
+        :isDiscountTotalPrice="true"
         cacheKeyUrl="eos-prepayment-inventoryTableDetails"
+        :countObj="countObj"
       ></inventoryTableDetails>
 
       <!-- 付款信息 -->
@@ -310,6 +312,11 @@
         paymentTermsOptions: [],
         accountingSubjectList: [],
         businessId: '',
+        countObj: {
+          countKey: 'purchaseCount',
+          unitKey: 'purchaseUnit',
+          unitIdKey: 'purchaseUnitId'
+        },
         tabOptions: [
           { key: 'main', name: '预付款项' },
           { key: 'bpm', name: '流程详情' }
@@ -414,6 +421,14 @@
         this.isDetail = type === 'detail';
         if ((this.isUpdate || this.isDetail) && row) {
           this.form = await getPrepaymentInfo(row.id);
+          this.form.totalAmount = this.form.productList.reduce((sum, item) => {
+            const val = parseFloat(item.totalPrice);
+            return sum + (isNaN(val) ? 0 : val);
+          }, 0);
+          this.form.discountTotalPrice = this.form.productList.reduce((sum, item) => {
+            const val = parseFloat(item.discountTotalPrice);
+            return sum + (isNaN(val) ? 0 : val);
+          }, 0);
           this.businessId = row.id;
           this.$nextTick(() => {
             this.$refs.inventoryTableDetailsRef &&

+ 1 - 1
src/views/financialManage/prepayment/components/searchForm.vue

@@ -17,7 +17,7 @@
             label: '关键词:',
             value: 'searchName',
             type: 'input',
-            placeholder: '编码、名称、型号、规格'
+            placeholder: '编码、名称'
           },
           // {
           //   label: '下拉检索:',