This commit is contained in:
faiz 2024-04-29 16:30:46 +08:00
parent 8656fb7811
commit e410d78236
3 changed files with 69 additions and 1 deletions

View File

@ -80,6 +80,18 @@ export function merchantDeleteForm(id) {
export function merchantPayForm(id) {
return request.get(`margin/offline_money/${id}/form`)
}
/**
* @description 商户列表 -- 导出列表
*/
export function exportMerchantApi(data) {
return request.get(`system/merchant/export`, data)
}
/**
* @description 商户入驻 -- 导出列表
*/
export function exportIntentionApi(data) {
return request.get(`merchant/intention/export`, data)
}
/**
* @description 商户列表 -- 修改开启状态
*/

View File

@ -89,6 +89,9 @@
</el-form>
</div>
<el-card class="mt14">
<div class="mb20">
<el-button size="small" type="primary" class="mt5" @click="exports">导出列表</el-button>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
@ -193,13 +196,15 @@ import {
intentionDelte,
intentionStatusApi,
getstoreTypeApi,
getMerCateApi
getMerCateApi,
exportIntentionApi
} from "@/api/merchant";
import merDetail from './merApplicationDetail.vue';
import { fromList, statusList } from "@/libs/constants.js";
import { roterPre } from "@/settings";
import timeOptions from '@/utils/timeOptions';
import cityOptions from '@/utils/city';
import createWorkBook from '@/utils/newToExcel.js';
export default {
name: "MerchantApplication",
components: { merDetail },
@ -252,6 +257,30 @@ export default {
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
this.getList(1)
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
exportIntentionApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
/**重置 */
searchReset(){
this.timeVal = []

View File

@ -122,6 +122,7 @@
/>
</el-tabs>
<el-button size="small" type="primary" class="mt5" @click="onAdd">添加商户</el-button>
<el-button size="small" type="primary" class="mt5" @click="exports">导出列表</el-button>
</div>
<el-table
v-loading="listLoading"
@ -261,12 +262,14 @@ import {
merchantIsCloseApi,
getstoreTypeApi,
merchantPayForm,
exportMerchantApi,
getMerCateApi, marginDeductionForm
} from "@/api/merchant";
import merDetail from './handle/merDetails.vue';
import { fromList } from "@/libs/constants.js";
import { roterPre } from "@/settings";
import SettingMer from "@/libs/settingMer";
import createWorkBook from '@/utils/newToExcel.js';
import Cookies from "js-cookie";
import timeOptions from '@/utils/timeOptions';
import cityOptions from '@/utils/city';
@ -337,6 +340,30 @@ export default {
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
this.getList(1)
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
exportMerchantApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
/**重置 */
searchReset(){
this.timeVal = []