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.

83 lines
1.8 KiB

9 months ago
<template>
<VxeGrid ref="vxeGrid" v-bind="gridOptions" @cell-click="cellClick" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
9 months ago
</template>
<script>
import { VXETable } from 'vxe-table'
9 months ago
import paoWanPgdConfig from './pgdTable'
8 months ago
import {getPgd, zx} from "@/api/zyjh";
9 months ago
export default {
name:'PwanPgd',
props:{
worker:{
type:Function,
default:function (){}
}
},
9 months ago
data(){
return{
type:'pwpg',
9 months ago
gridOptions:{},
list:{},
}
},
created(){
const {options,columns}=paoWanPgdConfig()
this.gridOptions=options
this.gridOptions.columns=columns
8 months ago
this.initData()
9 months ago
},
methods:{
8 months ago
initData(){
getPgd({jhrqField:'sljhrq',zt:'21'}).then(res=>{
this.gridOptions.data=res.data
})
},
checkboxAll({checked}){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return;
}
if (checked){
this.paigong(worker)
}
},
checkboxChange({checked,row}){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return;
}
if (checked){
this.paigong(worker)
}
},
paigong(worker){
const list=this.$refs.vxeGrid.getCheckboxRecords()
const tmpArr=[]
for (const item of list) {
const data={
id:item.id,
8 months ago
pwsgr:worker.userCode,//抛丸施工人员姓名
}
tmpArr.push(data)
}
const data={
type:this.type,
8 months ago
field:'pwpgrq',
zxZtName:'PWPG',
list:tmpArr
}
VXETable.modal.confirm('您确定派工吗?').then(res=>{
res==='confirm'&&zx(data)
})
},
9 months ago
cellClick({row}){
this.$emit('initPgd',row)
}
}
}
</script>