lighter 1 year ago
parent
commit
eac6cf1205
1 changed files with 13 additions and 19 deletions
  1. 13 19
      src/views/clinic/WxPayRefund.vue

+ 13 - 19
src/views/clinic/WxPayRefund.vue

@@ -23,7 +23,7 @@
       </el-select>
       <span></span>
       <el-button type="primary" icon="Search" @click="fetchData">查询</el-button>
-      <el-button type="primary" icon="Upload" @click="exportExcel">导出Excel</el-button>
+      <el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
     </template>
     <template #main>
       <el-table :data="data.list" :height="tableHeight" stripe highlight-current-row>
@@ -75,6 +75,7 @@ import {formatDate, getDatetime} from '@/utils/date'
 import store from '@/store'
 import {downloadExcel} from '@/utils/excel'
 import PageLayer from "@/layout/PageLayer";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
 
 const windowSize = store.state.app.windowSize
 const tableHeight = windowSize.h - 85
@@ -125,24 +126,17 @@ const fetchData = () => {
     param.start = formatDate(dateRange.value[0])
     param.end = formatDate(dateRange.value[1])
   }
-  selectOrdersByConditions(param)
-      .then((res) => {
-        data.totalSize = res.totalSize
-        data.list = res.list
-      })
-      .catch(() => {
-        data.value = {}
-      })
+  selectOrdersByConditions(param).then((res) => {
+    data.totalSize = res.totalSize
+    data.list = res.list
+  }).catch(() => {
+    data.value = {}
+  })
 }
 
 const exportExcel = () => {
-  if (!tradeNo.value && !dateRange.value) {
-    ElMessage({
-      message: '请选择时间范围',
-      type: 'warning',
-      duration: 2000,
-      showClose: true,
-    })
+  if (!dateRange.value) {
+    xcMessage.warning('请选择时间范围')
     return
   }
   store.commit('app/setLoading', true)
@@ -154,12 +148,11 @@ const exportExcel = () => {
       patientName: patientName.value,
       orderType: orderType.value,
       tradeState: tradeState.value,
-      tradeNo: tradeNo.value,
       currentPage: 1,
       pageSize: -1,
     },
     url: '/wxRefund/exportExcel',
-    fileName: '服务号订单数据(' + formatDate(dateRange.value[0]) + ' - ' + formatDate(dateRange.value[1]) + ').xlsx',
+    fileName: '服务号订单数据(' + formatDate(dateRange.value[0]) + ' - ' + formatDate(dateRange.value[1]) + ').xls',
   }
   setTimeout(() => {
     downloadExcel(data)
@@ -188,7 +181,8 @@ const doRefund = (row) => {
         showClose: true,
       })
     })
-  }).catch(() => {})
+  }).catch(() => {
+  })
 }
 
 function initTradeStates() {