You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

<template>
<VxeGrid ref="hxPgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" />
</template>
<script>
import paoWanPgdConfig from './pgdTable'
import {getDw, getPgd} from "@/api/zyjh";
export default {
name:'HxianPgd',
props:{
workers:{
type:Array,
default:[]
},
},
data(){
return{
gridOptions:{},
list:{},
setExt:null,
}
},
created(){
const {options,columns,setExt}=paoWanPgdConfig()
this.setExt=setExt
this.gridOptions=options
this.gridOptions.columns=columns
},
methods:{
initData(worker,zt){
getDw({type:'llj'}).then(res=>{
this.gridOptions.ycldw=res.data
})
getPgd({user:worker,zt:zt,field:'hxry'}).then(res=>{
this.gridOptions.data=res.data
this.setExt('workers',this.$props.workers)
})
},
getCurrentData(){
const data= this.$refs.hxPgd.getCurrentRecord()
window.localStorage.setItem("hxfk",JSON.stringify(data))
},
cellClick({row}){
this.$emit('initPgd',row)
}
}
}
</script>