Explorar el Código

feat: 更新采购对账单审批,调整计算方式以使用dataForm中的数据

xieyong hace 1 día
padre
commit
d805e0c1f9

+ 5 - 4
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/page.vue

@@ -118,12 +118,13 @@ export default {
     //获取对账单详情
     async getInfo(id) {
       let data = await accountstatementInfoAPI(id)
+      console.log(data,'获取对账单详情')
       this.datasource = data?.orderList || []
       // 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.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.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.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.dataForm = data
       // this.priceObj.amountNotInvoicedPrice = data.amountNotInvoicedPrice
       switch (this.dataForm.dateType) {

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/purchaseForm.vue

@@ -264,11 +264,11 @@
     computed: {
       //计算未对账金额
       accountStatementPrice() {
-        return this.datasource.reduce((pre, cur) => pre + +cur.amountTotalPrice, 0);
+        return this.dataForm?.amountTotalPrice || 0;
       },
       //计算相关订单号
       relatedOrderNumber() {
-        return this.datasource.map((item) => item.orderNo).join(',');
+        return this.dataForm?.sourceName || '';
       }
     },
     data() {