| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" 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" 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> |
| | |
| | | props1:{}, |
| | | depProps:{}, |
| | | casProps:{} |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | |
| | | state.form.workDetail.qpDetailList.splice(index,1) |
| | | } |
| | | |
| | | 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 = ()=>{ |
| | |
| | | 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.sketchMapPath = state.form.workDetail.sketchMapPath.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.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |