From 19d17f0f0fb02f46342d70b5180e40a0ad1b66d3 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 09 十一月 2023 18:16:13 +0800
Subject: [PATCH] MrShi

---
 admin/src/views/business/wxBillDetail.vue |  130 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 102 insertions(+), 28 deletions(-)

diff --git a/admin/src/views/business/wxBillDetail.vue b/admin/src/views/business/wxBillDetail.vue
index 121ea0e..32cc4d7 100644
--- a/admin/src/views/business/wxBillDetail.vue
+++ b/admin/src/views/business/wxBillDetail.vue
@@ -33,15 +33,35 @@
             <div v-else>{{ row.billType }}</div>
           </template>
         </el-table-column>
-        <el-table-column prop="sumBill" label="璁㈠崟鏁伴噺" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="sumTotalFee" label="浜ゆ槗閲戦" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="sumRefundBill" label="閫�娆剧瑪鏁�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="sumRefundFee" label="閫�娆鹃噾棰�" min-width="100px" align="center"></el-table-column>
+        <el-table-column prop="sumBill" label="璁㈠崟鏁伴噺" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{scope.row.sumBill == 0 ? '-' : scope.row.sumBill }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="浜ゆ槗閲戦" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.sumSuccessFee">{{scope.row.sumSuccessFee == 0 ? '-' : scope.row.sumSuccessFee }}</span>
+            <span v-else>{{scope.row.sumTotalFee == 0 ? '-' : scope.row.sumTotalFee }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sumRefundBill" label="閫�娆剧瑪鏁�" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{scope.row.sumRefundBill == 0 ? '-' : scope.row.sumRefundBill }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sumRefundFee" label="閫�娆鹃噾棰�" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{scope.row.sumRefundFee == 0 ? '-' : scope.row.sumRefundFee }}</span>
+          </template>
+        </el-table-column>
         <el-table-column prop="cmmsAmt" label="鎵嬬画璐�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="total" label="缁撶畻閲戦" min-width="100px" align="center"></el-table-column>
+        <el-table-column prop="total" label="缁撶畻閲戦" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <span>{{scope.row.total == 0 ? '-' : scope.row.total }}</span>
+          </template>
+        </el-table-column>
         <!-- v-if="containPermissions(['business:pricingparam:update', 'business:pricingparam:delete'])" -->
         <el-table-column
-          
           label="鎿嶄綔"
           min-width="120"
           align="center"
@@ -50,13 +70,13 @@
           <template slot-scope="scope">
             <template v-if="scope.$index != 2">
               <el-button type="text" @click="$refs.billDetailWindow.open(scope.$index==4?'闈炶嚜琛岃溅鏀跺叆鏄庣粏':'瀵硅处鏄庣粏', {type:scope.$index, ...searchForm})">鏌ョ湅鏄庣粏</el-button>
-              <el-button type="text">瀵煎嚭鏄庣粏</el-button>
+              <el-button type="text" @click="exportExcel(scope.$index)">瀵煎嚭鏄庣粏</el-button>
             </template>
             <div v-else>-</div>
           </template>
         </el-table-column>
       </el-table>
-      
+
     </template>
     <BillDetailWindow ref="billDetailWindow"/>
   </TableLayout>
@@ -65,7 +85,7 @@
 <script>
 import BaseTable from '@/components/base/BaseTable'
 import TableLayout from '@/layouts/TableLayout'
-import { fetchList } from '@/api/business/wxBillDetail'
+import { fetchList, exportNotBikeExcel } from '@/api/business/wxBillDetail'
 import BillDetailWindow from '@/components/business/BillDetailWindow'
 import { formatDateTime } from '@/utils/util'
 export default {
@@ -79,6 +99,7 @@
       searchForm: {
         endDate: '',
         startDate: '',
+        // type: 1
       },
       pickerOptions: {}
     }
@@ -91,11 +112,11 @@
       'field.main': 'id'
     })
     this.pickerOptions.disabledDate = (time) => {
-	    // 涓�澶�
-      let tempTime = 3600 * 1000 * 24 
+      // 涓�澶�
+      const tempTime = 3600 * 1000 * 24
       return time.getTime() > new Date() - tempTime
     }
-    // let tempTime = new Date().getTime() - 3600 * 1000 * 24 
+    // let tempTime = new Date().getTime() - 3600 * 1000 * 24
     // this.searchForm.startDate = formatDateTime(new Date(tempTime), 'yyyy-MM-dd') + ' 00:00:00'
     // this.searchForm.endDate = formatDateTime(new Date(tempTime), 'yyyy-MM-dd') + ' 23:59:59'
     // this.value1 = [this.searchForm.startDate, this.searchForm.endDate]
@@ -103,27 +124,80 @@
     this.search()
   },
   methods: {
-    reset() {
+    exportExcel (index) {
+      this.__checkApi()
+      this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+        .then(() => {
+          this.isWorking.export = true
+          let type = ''
+          if (index === 0) {
+            type = 0
+          } else if (index === 1) {
+            type = 1
+          } else if (index === 4) {
+            type = 4
+            let obj = { ...this.searchForm, type, isBikeFee: 1 }
+            exportNotBikeExcel({
+              page: 1,
+              capacity: 10,
+              model: {
+                type: 4,
+                endDate: this.searchForm.endDate,
+                startDate: this.searchForm.startDate,
+                isBikeFee: 1
+              },
+              sorts: null
+            }).then(response => {
+              this.download(response)
+            }).catch(e => {
+              this.$tip.apiFailed(e)
+            }).finally(() => {
+              this.isWorking.export = false
+            })
+            return;
+          }
+          var obj = { ...this.searchForm, type }
+          this.api.exportExcel({
+            page: this.tableData.pagination.pageIndex,
+            capacity: 1000000,
+            model: obj,
+            sorts: this.tableData.sorts
+          })
+            .then(response => {
+              this.download(response)
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking.export = false
+            })
+        })
+        .catch(() => {})
+    },
+
+    reset () {
       this.searchForm.startDate = ''
       this.searchForm.endDate = ''
       this.value1 = []
       this.$refs.searchForm.resetFields()
       this.search()
     },
-    
-    search() {
+
+    search () {
       fetchList(this.searchForm)
         .then(res => {
+          console.log(res)
           this.tableData.list = [
             { billType: '浜ゆ槗瀹炴敹', ...res[0], cmmsAmt: (res[0].sumCmmsAmt + res[0].sumRefundCmmsAmt).toFixed(2) },
-            { billType: '閫�娆�', ...res[1], cmmsAmt: (res[1].sumRefundCmmsAmt + res[1].sumRefundCmmsAmt).toFixed(2) },
-            { billType: '鎬昏', ...res[2], cmmsAmt: (res[2].sumCmmsAmt + res[2].sumRefundCmmsAmt).toFixed(2) },
+            { billType: '閫�娆�', ...res[1], cmmsAmt: (res[1].sumCmmsAmt + res[1].sumRefundCmmsAmt).toFixed(2) },
+            { billType: '鎬昏', ...res[2], cmmsAmt: res[2].sumRefundCmmsAmt },
             { billType: '鍏朵腑鍚�' },
-            { billType: '闈炶嚜琛岃溅鏀跺叆', ...res[3], cmmsAmt: (res[3].sumCmmsAmt + res[3].sumRefundCmmsAmt).toFixed(2) },
+            { billType: '闈炶嚜琛岃溅鏀跺叆', ...res[3], cmmsAmt: (res[3].sumCmmsAmt + res[3].sumRefundCmmsAmt).toFixed(2) }
           ]
         })
     },
-    selectDate(v) {
+    selectDate (v) {
       this.searchForm.startDate = ''
       this.searchForm.endDate = ''
       if (v) {
@@ -132,15 +206,15 @@
       }
       this.search()
     },
-    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
-        if (rowIndex == 3) {
-          if (columnIndex === 0) {
-            return [1,8];
-          } else {
-            return [0, 0];
-          }
+    arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+      if (rowIndex == 3) {
+        if (columnIndex === 0) {
+          return [1, 8]
+        } else {
+          return [0, 0]
         }
-      },
-  },
+      }
+    }
+  }
 }
 </script>

--
Gitblit v1.9.3