Parcourir la source

fix(accountstatement): 处理订单类别为4时金额显示为'--'的问题

liujt il y a 3 mois
Parent
commit
aa617e36e5

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

@@ -27,7 +27,7 @@
         <template v-slot>
           <el-row style="font-weight: 700; color: red">
             <span>订单总金额:</span>
-            <span>{{ dataForm.orderTotalAmount || 0 }}</span>
+            <span>{{ isNonDirectionalSale ? '--' : dataForm.orderTotalAmount || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已对账金额:</span>
             <span>{{ dataForm.amountCompletePrice || 0 }}</span>
@@ -157,7 +157,11 @@
         businessId: ''
       };
     },
-    computed: {},
+    computed: {
+      isNonDirectionalSale() {
+        return this.datasource.some(item => item.orderCategory == 4);
+      }
+    },
     methods: {
       changeDiscountPrice(price, tableIndex) {
         console.log('price~~~', price, tableIndex)
@@ -192,6 +196,7 @@
       //获取对账单详情
       async getInfo(row) {
         let data = await accountstatementInfoAPI(row.id);
+        console.log('data~~~', data)
         // this.recorpayList = data.recorpayList || [];
         // 解决小数精度丢失问题,使用分进行计算
         data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
@@ -242,7 +247,7 @@
       },
       //查询获取订单数据
       async handleSearch(params) {
-        console.log('this.$refs.inventoryTableRef~~~', this.$refs.inventoryTableref);
+        // console.log('this.$refs.inventoryTableRef~~~', this.$refs.inventoryTableref);
         let searchQuery = {
           endDate: params.endDate,
           sourceId: params.sourceId,

+ 6 - 1
src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue

@@ -36,7 +36,7 @@
         <template v-slot>
           <el-row style="font-weight: 700; color: red">
             <span>订单总金额:</span>
-            <span>{{ dataForm.orderTotalAmount || 0 }}</span>
+            <span>{{ isNonDirectionalSale ? '--' : dataForm.orderTotalAmount || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已对账金额:</span>
             <span>{{ dataForm.amountCompletePrice || 0 }}</span>
@@ -99,6 +99,11 @@ export default {
 
     };
   },
+  computed: {
+    isNonDirectionalSale() {
+      return this.datasource.some(item => item.orderCategory == 4);
+    }
+  },
   methods: {
     async open(dialogType, row, type = '') {
       console.log(row)

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

@@ -81,7 +81,7 @@
           <div class="collapse-title">
             <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.orderCategory == 4 ? '--' : item.orderAmount || 0 }}元</span>
               <span>已对账金额:{{ item.statementedAmount || 0 }}元</span>
               <span>未对账金额:{{ item.unStatementAmount || 0 }}元</span>
               <span>本次对账金额:{{ item.statementAmount || 0 }}元</span>

+ 4 - 3
src/views/saleManage/saleOrder/invoice/components/print-template-jsyp.vue

@@ -265,9 +265,10 @@
         const printWindow = window.open('', '_blank');
         printWindow.document.open();
         printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
+        // printWindow.document.write(
+        //   '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        // );
+        printWindow.document.write('<style>table { border-collapse: collapse; width: 100%; } td, th { padding: 5px; }</style>');
         printWindow.document.write('</head><body>');
         printWindow.document.write(printSection.innerHTML);
         printWindow.document.write('</body></html>');