单片材料导出

xuhongjie
严飞永 2 weeks ago
parent d6599c5af0
commit 568ce5118e

@ -39,7 +39,6 @@ service.interceptors.request.use(config => {
config.url = url;
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
const requestObj = {
url: config.url,
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
@ -129,10 +128,9 @@ service.interceptors.response.use(res => {
// 通用下载方法
export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
console.log(tansParams(params))
return service.post(url, params, {
transformRequest: [(params) => {
return Array.isArray(params) ? params : tansParams(params) }],
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config

@ -144,6 +144,7 @@ export default {
dicts: ["xzfl"],
data() {
return {
ids: [],
//
loading: true,
//
@ -283,19 +284,22 @@ export default {
this.download(
"/gysl/basicInformation/exportInfo",
{
idList: this.ids[0]
idList: this.ids
},
`基本信息${new Date().getTime()}.xlsx`
);
},
/** 单片材料导出按钮操作 */
handleExporttwo() {
console.log(this.ids)
this.download(
"/gysl/basicInformation/wordExport",
this.ids ,
`单片材料${new Date().getTime()}.docx`
{
ids: this.ids.join(","),
},
`单片材料${new Date().getTime()}.zip`
);
},

@ -14,12 +14,12 @@
</el-col>
<el-col :span="7">
<el-form-item label="建设起止时间">
<el-date-picker v-model="queryParams.begainTime" type="date" placeholder="开始日期"
value-format="yyyy-MM-dd" style="width: 9rem;" :clearable="true">
<el-date-picker v-model="queryParams.startTime" type="month" placeholder="开始月份"
value-format="yyyy-MM" style="width: 9rem;" :clearable="true">
</el-date-picker>
~
<el-date-picker v-model="queryParams.endTime" type="date" placeholder="结束日期"
value-format="yyyy-MM-dd" style="width: 9rem;" :clearable="true">
<el-date-picker v-model="queryParams.endTime" type="month" placeholder="结束月份"
value-format="yyyy-MM" style="width: 9rem;" :clearable="true">
</el-date-picker>
</el-form-item>
</el-col>

Loading…
Cancel
Save