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.
92 lines
2.2 KiB
92 lines
2.2 KiB
<template>
|
|
<VxeGrid ref="qgpgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
|
|
</template>
|
|
|
|
<script>
|
|
import { VXETable } from 'vxe-table'
|
|
import paoWanPgdConfig from './pgdTable'
|
|
import {getPgd, zx} from "@/api/zyjh";
|
|
|
|
export default {
|
|
name: 'QgePgd',
|
|
props: {
|
|
worker:{
|
|
type:Function,
|
|
default:function (){}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
gridOptions: {},
|
|
list: {},
|
|
currentWorker:null,
|
|
zt:null,
|
|
}
|
|
},
|
|
created() {
|
|
const {options, columns} = paoWanPgdConfig()
|
|
this.gridOptions = options
|
|
this.gridOptions.columns = columns
|
|
},
|
|
methods: {
|
|
initData(worker, zt) {
|
|
this.currentWorker=worker
|
|
this.zt=zt
|
|
getPgd({user: worker, zt: zt, field: 'qgry'}).then(res => {
|
|
this.gridOptions.data = res.data
|
|
})
|
|
},
|
|
getCurrentData() {
|
|
const data = this.$refs.qgpgd.getCurrentRecord()
|
|
window.localStorage.setItem("qgfk", JSON.stringify(data))
|
|
},
|
|
checkboxAll({checked}) {
|
|
const worker = this.$props.worker
|
|
if (!worker) {
|
|
this.$message.warning('请选择操作人')
|
|
return;
|
|
}
|
|
if (checked) {
|
|
this.fankgui(worker)
|
|
}
|
|
},
|
|
checkboxChange({checked, row}) {
|
|
const worker = this.$props.worker()
|
|
if (!worker) {
|
|
this.$message.warning('请选择操作人')
|
|
return;
|
|
}
|
|
if (checked) {
|
|
this.fankgui(worker)
|
|
}
|
|
},
|
|
fankgui(worker) {
|
|
const list = this.$refs.qgpgd.getCheckboxRecords()
|
|
const tmpArr = []
|
|
for (const item of list) {
|
|
const data = {
|
|
id: item.id,
|
|
qgfkry: worker.userCode,
|
|
zt:item.zt
|
|
}
|
|
tmpArr.push(data)
|
|
}
|
|
const data = {
|
|
type: this.type,
|
|
field: 'qgfkrq',
|
|
zxZtName: 'QGFK',
|
|
list: tmpArr
|
|
}
|
|
VXETable.modal.confirm('您确定反馈吗?').then(res => {
|
|
res === 'confirm' && zx(data).then(res=>{
|
|
this.initData(this.currentWorker,this.zt)
|
|
})
|
|
})
|
|
},
|
|
cellClick({row}) {
|
|
this.$emit('initPgd', row)
|
|
}
|
|
}
|
|
}
|
|
</script>
|