1.各种调整

master
董哲奇 5 months ago
parent 4786a5d42d
commit 02dc8bb7cd

@ -1,5 +1,13 @@
import request from '@/utils/request' import request from '@/utils/request'
export const exportPW=function(data){
return request({
url: '/pgdSljh/exportPW',
method: 'post',
data: data
})
}
export const pwpg=function(data){ export const pwpg=function(data){
return request({ return request({
url: '/zyjh/pwpg', url: '/zyjh/pwpg',

@ -24,7 +24,8 @@ export default {
type:'hxpg', type:'hxpg',
gridOptions:{}, gridOptions:{},
list:{}, list:{},
setExt:null setExt:null,
zyq:null,
} }
}, },
sockets:{ sockets:{
@ -55,6 +56,7 @@ export default {
this.gridOptions.columns=columns this.gridOptions.columns=columns
this.setExt('workers',this.$props.workers) this.setExt('workers',this.$props.workers)
this.initData() this.initData()
this.zyq=this.$route.query.zyq
getDw({type:'llj'}).then(res=>{ getDw({type:'llj'}).then(res=>{
this.gridOptions.ycldw=res.data this.gridOptions.ycldw=res.data
}) })
@ -66,7 +68,8 @@ export default {
const data={ const data={
zt:'42', zt:'42',
wgzt:'52', wgzt:'52',
wclzt:'51' wclzt:'51',
zyq:this.zyq
} }
if (gx==='1'){ if (gx==='1'){
getYdjhByZt(data).then(res => { getYdjhByZt(data).then(res => {

@ -12,8 +12,9 @@
import XEUtils from 'xe-utils' import XEUtils from 'xe-utils'
import { EventBus } from '@/event-bus.js' import { EventBus } from '@/event-bus.js'
import paoWanPgdConfig from "@/views/zyjhzx/pwanpgong/comps/pgdTable"; 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 * as XLSX from 'xlsx'
import axios from 'axios'
export default { export default {
name:'PwanSgd', name:'PwanSgd',
@ -55,9 +56,20 @@ export default {
worker:this.$props.worker().userCode, worker:this.$props.worker().userCode,
list:this.gridOptions.data, 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=>{ pwpg(data).then(res=>{
if (res.success){ if (res.success){
this.export() this.export()

Loading…
Cancel
Save