edit
This commit is contained in:
parent
8656fb7811
commit
e410d78236
|
@ -80,6 +80,18 @@ export function merchantDeleteForm(id) {
|
||||||
export function merchantPayForm(id) {
|
export function merchantPayForm(id) {
|
||||||
return request.get(`margin/offline_money/${id}/form`)
|
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 商户列表 -- 修改开启状态
|
* @description 商户列表 -- 修改开启状态
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -89,6 +89,9 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<el-card class="mt14">
|
<el-card class="mt14">
|
||||||
|
<div class="mb20">
|
||||||
|
<el-button size="small" type="primary" class="mt5" @click="exports">导出列表</el-button>
|
||||||
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="tableData.data"
|
:data="tableData.data"
|
||||||
|
@ -193,13 +196,15 @@ import {
|
||||||
intentionDelte,
|
intentionDelte,
|
||||||
intentionStatusApi,
|
intentionStatusApi,
|
||||||
getstoreTypeApi,
|
getstoreTypeApi,
|
||||||
getMerCateApi
|
getMerCateApi,
|
||||||
|
exportIntentionApi
|
||||||
} from "@/api/merchant";
|
} from "@/api/merchant";
|
||||||
import merDetail from './merApplicationDetail.vue';
|
import merDetail from './merApplicationDetail.vue';
|
||||||
import { fromList, statusList } from "@/libs/constants.js";
|
import { fromList, statusList } from "@/libs/constants.js";
|
||||||
import { roterPre } from "@/settings";
|
import { roterPre } from "@/settings";
|
||||||
import timeOptions from '@/utils/timeOptions';
|
import timeOptions from '@/utils/timeOptions';
|
||||||
import cityOptions from '@/utils/city';
|
import cityOptions from '@/utils/city';
|
||||||
|
import createWorkBook from '@/utils/newToExcel.js';
|
||||||
export default {
|
export default {
|
||||||
name: "MerchantApplication",
|
name: "MerchantApplication",
|
||||||
components: { merDetail },
|
components: { merDetail },
|
||||||
|
@ -252,6 +257,30 @@ export default {
|
||||||
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
|
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
|
||||||
this.getList(1)
|
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(){
|
searchReset(){
|
||||||
this.timeVal = []
|
this.timeVal = []
|
||||||
|
|
|
@ -122,6 +122,7 @@
|
||||||
/>
|
/>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-button size="small" type="primary" class="mt5" @click="onAdd">添加商户</el-button>
|
<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>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
|
@ -261,12 +262,14 @@ import {
|
||||||
merchantIsCloseApi,
|
merchantIsCloseApi,
|
||||||
getstoreTypeApi,
|
getstoreTypeApi,
|
||||||
merchantPayForm,
|
merchantPayForm,
|
||||||
|
exportMerchantApi,
|
||||||
getMerCateApi, marginDeductionForm
|
getMerCateApi, marginDeductionForm
|
||||||
} from "@/api/merchant";
|
} from "@/api/merchant";
|
||||||
import merDetail from './handle/merDetails.vue';
|
import merDetail from './handle/merDetails.vue';
|
||||||
import { fromList } from "@/libs/constants.js";
|
import { fromList } from "@/libs/constants.js";
|
||||||
import { roterPre } from "@/settings";
|
import { roterPre } from "@/settings";
|
||||||
import SettingMer from "@/libs/settingMer";
|
import SettingMer from "@/libs/settingMer";
|
||||||
|
import createWorkBook from '@/utils/newToExcel.js';
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import timeOptions from '@/utils/timeOptions';
|
import timeOptions from '@/utils/timeOptions';
|
||||||
import cityOptions from '@/utils/city';
|
import cityOptions from '@/utils/city';
|
||||||
|
@ -337,6 +340,30 @@ export default {
|
||||||
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
|
this.tableFrom.city = this.$refs["cascader"]?.getCheckedNodes()[0]?.label
|
||||||
this.getList(1)
|
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(){
|
searchReset(){
|
||||||
this.timeVal = []
|
this.timeVal = []
|
||||||
|
|
Loading…
Reference in New Issue