Prechádzať zdrojové kódy

导出按钮功能添加

yuhongqi 11 hodín pred
rodič
commit
f0c6d280fb

+ 8 - 0
src/api/live/liveOrderPayment.js

@@ -8,6 +8,14 @@ export function listLiveOrderPayments(query) {
     params: query
   })
 }
+// 查询订单详情列表
+export function exportLiveOrderPayments(query) {
+  return request({
+    url: '/live/order/payment/export',
+    method: 'get',
+    params: query
+  })
+}
 
 // 查询支付明细详细
 export function getLivePayment(paymentId) {

+ 13 - 10
src/views/live/liveAfteraSales/index.vue

@@ -118,15 +118,16 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['store:storeAfterSales:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          :disabled="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveAfteraSales:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -437,7 +438,9 @@ export default {
         }).then(response => {
           this.download(response.msg);
           this.exportLoading = false;
-        }).catch(() => {});
+        }).catch(() => {
+        this.exportLoading = false;
+      });
     },
     getTreeselect() {
       var param={companyId:this.companyId}

+ 13 - 1
src/views/store/storePayment/index.vue

@@ -288,7 +288,7 @@
 <script>
 import { refundStorePayment,listStorePayment, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment,setPayNotify } from "@/api/store/storePayment";
 import { getCompanyList } from "@/api/company/company";
-import { listLiveOrderPayments,getLivePayment,updateLivePayment } from "@/api/live/liveOrderPayment";
+import { listLiveOrderPayments,getLivePayment,updateLivePayment,exportLiveOrderPayments } from "@/api/live/liveOrderPayment";
 export default {
   name: "StorePayment",
   data() {
@@ -583,6 +583,18 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
+      if("5" == this.queryParams.businessType) {
+        this.$confirm('是否确认导出所有直播订单明细数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportLiveOrderPayments(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+        return  ;
+      }
       this.$confirm('是否确认导出所有支付明细数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",