导出表格页面

This commit is contained in:
Lenovo 2024-07-15 19:02:03 +08:00
parent 49cb9c82ba
commit 9746034b71
2 changed files with 75 additions and 77 deletions

View File

@ -218,12 +218,6 @@
icon="el-icon-mouse"
@click="handleOpen(scope.row)"
>后台</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-mouse"
@click="export1(scope.row)"
>导出</el-button>
</template>
</el-table-column>
</el-table>
@ -386,33 +380,12 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="open1" width="800px" append-to-body>
<el-form ref="form1" :model="form1" label-width="150px">
<el-form-item label="导出时段" prop="start_time">
<el-date-picker
v-model="timeRange1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitExport"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh, getStoreStatistics,nowIntegral,handleExport } from "@/api/business/store";
import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh, getStoreStatistics,nowIntegral } from "@/api/business/store";
import { listSaleA} from "@/api/business/sale";
export default {
@ -440,7 +413,6 @@ export default {
nowIntegral: 0,
//
open: false,
open1: false,
//
openDataScope: false,
@ -466,11 +438,7 @@ export default {
returnVisitStatus: undefined,
selfDeliveryStatus: 1
},
queryParams1: {
id: undefined,
expStartTime: undefined,
expEndTime: undefined
},
saleList: [],
timeRange: ['00:00:00','23:59:59'],
timeRange1: undefined,
@ -492,9 +460,6 @@ export default {
timeRange: [
{ required: true, message: "运营时间不能为空", trigger: "blur" }
],
timeRange1: [
{ required: true, message: "时间不能为空", trigger: "blur" }
],
quota: [
{ required: true, message: "限额不能为空", trigger: "blur" }
]
@ -593,21 +558,14 @@ export default {
this.open = false;
this.reset();
},
cancel1() {
this.open1 = false;
this.reset1();
},
//
cancelDataScope() {
this.openDataScope = false;
this.reset();
},
//
reset1() {
this.timeRange1 = ['',''];
this.form1= {};
this.resetForm("form1");
},
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
@ -686,12 +644,7 @@ export default {
}
});
},
export1(row) {
this.form1.id = row.id;
this.open1 = true;
},
/** 提交按钮 */
submitForm: function() {
const data = this.form
@ -711,24 +664,7 @@ this.form1.id = row.id;
}
});
},
submitExport: function() {
if(this.timeRange1==undefined || this.timeRange1.length == 0){
this.$modal.msgSuccess("请填写时段!");
return
}
this.form1.exportStartTime = this.timeRange1[0]
this.form1.exportEndTime = this.timeRange1[1]
this.$refs["form1"].validate(valid => {
if (valid) {
this.queryParams1.expStartTime = this.form1.exportStartTime;
this.queryParams1.expEndTime = this.form1.exportEndTime;
this.queryParams1.id = this.form1.id;
this.handleExport(this.queryParams1);
this.cancel1();
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除解绑编号为"' + row.storeCode + '"的店铺?').then(function() {
@ -751,12 +687,6 @@ this.form1.id = row.id;
});
},
/** 导出按钮操作 */
handleExport(data) {
this.download('business/store/export', {
...this.queryParams1
}, `export_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -198,6 +198,12 @@
icon="el-icon-mouse"
@click="handleOpen(scope.row)"
>设置</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-mouse"
@click="export1(scope.row)"
>导出</el-button>
</template>
</el-table-column>
</el-table>
@ -339,6 +345,28 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="open1" width="800px" append-to-body>
<el-form ref="form1" :model="form1" label-width="150px">
<el-form-item label="导出时段" prop="start_time">
<el-date-picker
v-model="timeRange1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitExport"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -365,6 +393,12 @@ export default {
showSearch: true,
//
total: 0,
open1: false,
queryParams1: {
id: undefined,
expStartTime: undefined,
expEndTime: undefined
},
//
storeList: [],
//
@ -423,6 +457,9 @@ export default {
timeRange: [
{ required: true, message: "运营时间不能为空", trigger: "blur" }
],
timeRange1: [
{ required: true, message: "时间不能为空", trigger: "blur" }
],
quota: [
{ required: true, message: "限额不能为空", trigger: "blur" }
]
@ -503,6 +540,15 @@ export default {
this.open = false;
this.reset();
},
cancel1() {
this.open1 = false;
this.reset1();
},
reset1() {
this.timeRange1 = ['',''];
this.form1= {};
this.resetForm("form1");
},
//
cancelDataScope() {
this.openDataScope = false;
@ -562,6 +608,28 @@ export default {
// this.open = true;
// this.title = "";
},
export1(row) {
this.form1.id = row.id;
this.open1 = true;
},
submitExport: function() {
if(this.timeRange1==undefined || this.timeRange1.length == 0){
this.$modal.msgSuccess("请填写时段!");
return
}
this.form1.exportStartTime = this.timeRange1[0]
this.form1.exportEndTime = this.timeRange1[1]
this.$refs["form1"].validate(valid => {
if (valid) {
this.queryParams1.expStartTime = this.form1.exportStartTime;
this.queryParams1.expEndTime = this.form1.exportEndTime;
this.queryParams1.id = this.form1.id;
this.handleExport(this.queryParams1);
this.cancel1();
}
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -619,10 +687,10 @@ export default {
});
},
/** 导出按钮操作 */
handleExport() {
handleExport(data) {
this.download('business/store/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
...this.queryParams1
}, `export_${new Date().getTime()}.xlsx`)
}
}
};