Kaynağa Gözat

refactor(accountstatement): 统一金额字段命名并优化显示文本

liujt 4 ay önce
ebeveyn
işleme
f8b3073003

+ 4 - 4
src/views/purchasingManage/purchaseOrder/accountstatement/components/addAccountDialog.vue

@@ -150,8 +150,8 @@
         let data = await accountstatementInfoAPI(row.id);
         // this.recorpayList = data.recorpayList || [];
         data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
-        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100;
-        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
         data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
         this.datasource = data.orderList || [];
         this.dataForm = data;
@@ -205,8 +205,8 @@
           // amountPayablePass: data.amountPayablePass,
           // amountReceivablePass: data.amountReceivablePass
           orderTotalAmount: data.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100,
-          amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100,
-          amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
+          amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
+          amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100,
           amountUnCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100
         };
         // if (!this.datasource.length) this.$message.warning('暂无订单信息');

+ 1 - 1
src/views/purchasingManage/purchaseOrder/accountstatement/index.vue

@@ -289,7 +289,7 @@
           },
           {
             prop: 'amountTotalPrice',
-            label: '总金额',
+            label: '订单总金额',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130

+ 7 - 7
src/views/saleManage/saleOrder/accountstatement/components/addAccountDialog.vue

@@ -26,7 +26,7 @@
       <headerTitle title="对账明细" style="margin-top: 30px">
         <template v-slot>
           <el-row style="font-weight: 700; color: red">
-            <span>总金额:</span>
+            <span>订单总金额:</span>
             <span>{{ dataForm.orderTotalAmount || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已对账金额:</span>
@@ -161,10 +161,10 @@
     methods: {
       changeDiscountPrice(price, tableIndex) {
         console.log('price~~~', price, tableIndex)
-        this.datasource[tableIndex].amountTotalPrice = price;
+        this.datasource[tableIndex].statementAmount = price;
         this.datasource[tableIndex].unStatementAmount = price;
         console.log('this.datasource', this.datasource)
-        this.dataForm.amountTotalPrice = this.datasource.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100;
+        this.dataForm.amountTotalPrice = this.datasource.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
         this.dataForm.amountUnCompletePrice = this.datasource.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
       },
       open(dialogType, row, type = '') {
@@ -195,8 +195,8 @@
         // this.recorpayList = data.recorpayList || [];
         // 解决小数精度丢失问题,使用分进行计算
         data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
-        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100;
-        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
         data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
         data.orderList = data.orderList.map(item => {
             item.deliveryProducts = item.deliveryProducts.map(i => {
@@ -281,8 +281,8 @@
             // amountPayablePass: data.amountPayablePass,
             // amountReceivablePass: data.amountReceivablePass
             orderTotalAmount: data.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100,
-            amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.amountTotalPrice * 100), 0) / 100,
-            amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
+            amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
+            amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100,
             amountUnCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100
           };
           this.$forceUpdate();

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

@@ -82,9 +82,9 @@
             <div class="collapse-title-left"><span class="collapse-title-index">{{ index + 1 }}</span> {{ type === 'purchase' ? '采购订单' : '销售订单' }}:{{ item.orderNo }}</div>
             <div class="collapse-title-right">
               <span>订单金额:{{ item.orderAmount || 0 }}元</span>
-              <span>已对账金额:{{ item.statementAmount || 0 }}元</span>
+              <span>已对账金额:{{ item.statementedAmount || 0 }}元</span>
               <span>未对账金额:{{ item.unStatementAmount || 0 }}元</span>
-              <span>本次对账金额:{{ item.amountTotalPrice || 0 }}元</span>
+              <span>本次对账金额:{{ item.statementAmount || 0 }}元</span>
             </div>
           </div>
         </template>
@@ -710,10 +710,10 @@ export default {
           row.unStatementAmount = this.datasource[tableIndex].deliveryProducts.reduce((prev, curr) => {
             return prev + Number(curr.discountTotalPrice || 0)
           }, 0)
-          row.amountTotalPrice = this.datasource[tableIndex].deliveryProducts.reduce((prev, curr) => {
+          row.statementAmount = this.datasource[tableIndex].deliveryProducts.reduce((prev, curr) => {
             return prev + Number(curr.discountTotalPrice || 0)
           }, 0)
-          this.$emit('changeDiscountPrice', row.amountTotalPrice, tableIndex)
+          this.$emit('changeDiscountPrice', row.statementAmount, tableIndex)
       },
     remove(tableIndex, lineIndex, delType) {
       let params = {

+ 1 - 1
src/views/saleManage/saleOrder/accountstatement/index.vue

@@ -309,7 +309,7 @@
           },
           {
             prop: 'amountTotalPrice',
-            label: '总金额',
+            label: '订单总金额',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130