新增商品导出
This commit is contained in:
parent
3af8eea20c
commit
374c2c7fac
@ -111,6 +111,13 @@ export function transferBill(data) {
|
|||||||
return request.get(`financial/bill`, data)
|
return request.get(`financial/bill`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 商品列表 -- 导出
|
||||||
|
*/
|
||||||
|
export function transferCommodity(data) {
|
||||||
|
return request.get(`store/product/excel`, data)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 资金记录 -- 导出
|
* @description 资金记录 -- 导出
|
||||||
*/
|
*/
|
||||||
|
@ -189,6 +189,12 @@
|
|||||||
@click="batchRecommend"
|
@click="batchRecommend"
|
||||||
>批量设置推荐</el-button
|
>批量设置推荐</el-button
|
||||||
>
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
@click="exports"
|
||||||
|
>批量导出</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
@ -600,6 +606,8 @@ import {
|
|||||||
batchesRecommendApi,
|
batchesRecommendApi,
|
||||||
batchesOnOffApi
|
batchesOnOffApi
|
||||||
} from '@/api/product'
|
} from '@/api/product'
|
||||||
|
import { transferCommodity } from '@/api/accounts'
|
||||||
|
import createWorkBook from '@/utils/newToExcel.js';
|
||||||
import { roterPre } from '@/settings'
|
import { roterPre } from '@/settings'
|
||||||
import infoFrom from './info'
|
import infoFrom from './info'
|
||||||
import ueditorFrom from '@/components/ueditorFrom'
|
import ueditorFrom from '@/components/ueditorFrom'
|
||||||
@ -917,6 +925,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**订单列表 */
|
||||||
|
downData(excelData) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
transferCommodity(excelData).then((res) => {
|
||||||
|
return resolve(res.data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
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;
|
||||||
|
},
|
||||||
|
|
||||||
// 下架
|
// 下架
|
||||||
toOff (id) {
|
toOff (id) {
|
||||||
this.$prompt('强制下架', {
|
this.$prompt('强制下架', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user