秒杀配置时间筛选,导出列表

This commit is contained in:
faiz 2024-11-26 15:34:18 +08:00
parent 4211dde102
commit 1d9a004673
1 changed files with 41 additions and 4 deletions

View File

@ -110,7 +110,7 @@
class="selWidth" class="selWidth"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="时间选择:" prop="create_time"> <el-form-item label="时间选择:" prop="create_time">
<el-date-picker <el-date-picker
v-model="timeVal" v-model="timeVal"
value-format="yyyy/MM/dd HH:mm:ss" value-format="yyyy/MM/dd HH:mm:ss"
@ -126,7 +126,7 @@
@change="onchangeTime" @change="onchangeTime"
clearable clearable
/> />
</el-form-item> --> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getList(1)" <el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button >搜索</el-button
@ -165,6 +165,9 @@
@click="batchOff" @click="batchOff"
>批量强制下架</el-button >批量强制下架</el-button
> >
<el-button type="primary" size="small" @click="exports"
>导出列表</el-button
>
</div> </div>
<el-table <el-table
class="mt20" class="mt20"
@ -700,6 +703,7 @@ import {
seckillProductOffApi, seckillProductOffApi,
getProductLabelApi, getProductLabelApi,
updatetSeckillLabel, updatetSeckillLabel,
exportSeckillApi,
} from "@/api/product"; } from "@/api/product";
import { seckillDetailApi } from "@/api/marketing"; import { seckillDetailApi } from "@/api/marketing";
import { roterPre } from "@/settings"; import { roterPre } from "@/settings";
@ -707,6 +711,7 @@ import infoFrom from "./info";
import previewBox from "@/components/previewBox/index"; import previewBox from "@/components/previewBox/index";
import ueditorFrom from "@/components/ueditorFrom"; import ueditorFrom from "@/components/ueditorFrom";
import timeOptions from "@/utils/timeOptions"; import timeOptions from "@/utils/timeOptions";
import createWorkBook from "@/utils/newToExcel.js";
import editAttr from "./editAttr"; import editAttr from "./editAttr";
const defaultObj = { const defaultObj = {
product_id: "", product_id: "",
@ -865,10 +870,42 @@ export default {
/**重置 */ /**重置 */
searchReset() { searchReset() {
this.timeVal = []; this.timeVal = [];
this.tableFrom.date = ""; this.tableFrom.seckill_time = "";
this.$refs.searchForm.resetFields(); this.$refs.searchForm.resetFields();
this.getList(1); this.getList(1);
}, },
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
excelData.limit = 200;
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) => {
exportSeckillApi(excelData).then((res) => {
return resolve(res.data);
});
});
},
// //
onAuditFree(row) { onAuditFree(row) {
console.log(row); console.log(row);
@ -878,7 +915,7 @@ export default {
// //
onchangeTime(e) { onchangeTime(e) {
this.timeVal = e; this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : ""; this.tableFrom.seckill_time = e ? this.timeVal.join("-") : "";
this.getList(1); this.getList(1);
}, },
subSuccess() { subSuccess() {