| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |