diff --git a/src/api/zyjh.js b/src/api/zyjh.js index 94a078e..7fda8a0 100644 --- a/src/api/zyjh.js +++ b/src/api/zyjh.js @@ -1,5 +1,13 @@ import request from '@/utils/request' +export const exportPW=function(data){ + return request({ + url: '/pgdSljh/exportPW', + method: 'post', + data: data + }) +} + export const pwpg=function(data){ return request({ url: '/zyjh/pwpg', diff --git a/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue b/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue index 49752cf..0dae6b1 100644 --- a/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue +++ b/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue @@ -24,7 +24,8 @@ export default { type:'hxpg', gridOptions:{}, list:{}, - setExt:null + setExt:null, + zyq:null, } }, sockets:{ @@ -55,6 +56,7 @@ export default { this.gridOptions.columns=columns this.setExt('workers',this.$props.workers) this.initData() + this.zyq=this.$route.query.zyq getDw({type:'llj'}).then(res=>{ this.gridOptions.ycldw=res.data }) @@ -66,7 +68,8 @@ export default { const data={ zt:'42', wgzt:'52', - wclzt:'51' + wclzt:'51', + zyq:this.zyq } if (gx==='1'){ getYdjhByZt(data).then(res => { diff --git a/src/views/zyjhzx/pwanpgong/comps/PwanSgd.vue b/src/views/zyjhzx/pwanpgong/comps/PwanSgd.vue index d9adfd0..9c377de 100644 --- a/src/views/zyjhzx/pwanpgong/comps/PwanSgd.vue +++ b/src/views/zyjhzx/pwanpgong/comps/PwanSgd.vue @@ -12,8 +12,9 @@ import XEUtils from 'xe-utils' import { EventBus } from '@/event-bus.js' import paoWanPgdConfig from "@/views/zyjhzx/pwanpgong/comps/pgdTable"; -import {getDw, pwpg} from "@/api/zyjh"; +import {exportPW, getDw, pwpg} from "@/api/zyjh"; import * as XLSX from 'xlsx' +import axios from 'axios' export default { name:'PwanSgd', @@ -55,9 +56,20 @@ export default { worker:this.$props.worker().userCode, list:this.gridOptions.data, } - // aa(data).then(()=>{ - // - // }) + + axios.post(`${process.env.VUE_APP_BASE_API}/pgdSljh/exportPW`,data,{responseType:'blob'}) + .then(response => { + const url = window.URL.createObjectURL(new Blob([response.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', `打码导出${XEUtils.toDateString(new Date(),'yyyyMMdd')}.xlsx`); + document.body.appendChild(link); + link.click(); + }) + .catch(error => { + console.error(error); + }); + pwpg(data).then(res=>{ if (res.success){ this.export()