| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.opList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :label="item.username" |
| | | :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-cascader style="width: 100%" v-model="form.headUids" :options="lists.workerList" :props="casProps" @change="getStartEndIds" filterable :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDepId"> |
| | | <el-cascader style="width: 100%" v-model="form.workDepId" :props="depProps" :options="lists.departList" :show-all-levels="false"/> |
| | | <el-form-item label="作业单位" prop="workDepIds"> |
| | | <el-cascader style="width: 100%" v-model="form.workDepIds" :props="depProps" @change="getWorkerList" :options="lists.departList" :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" clearable> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.headUids" :options="lists.workerList" :props="casProps" @change="getStartEndIds" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [] |
| | | zyList: [] |
| | | tabLoading: boolean |
| | | } |
| | | export default defineComponent({ |
| | |
| | | equipmentDialog: false, |
| | | showDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 7, |
| | |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workDepIds: [], |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workDepId: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workDepIds: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | guardianUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | // getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | if(row.workDepList && row.workDepList.length>0){ |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | | } |
| | | |
| | |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workDepIds: [], |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | |
| | | const res = await workApplyApi().getFormData(7) |
| | | if (res.data.code === '200') { |
| | | state.safetyMeasureBasicList = JSON.parse(JSON.stringify(res.data.data.safetyMeasureBasicList)) |
| | | if(res.data.data.approvalDepBasicList && res.data.data.approvalDepBasicList.length>0){ |
| | | state.form.approvalDepBasicList = res.data.data.approvalDepBasicList.map(({id,content})=>({ |
| | | content, |
| | | approvalDepBasicId: id, |
| | | approvalUids: [], |
| | | approvalType: null |
| | | })) |
| | | }else{ |
| | | state.form.approvalDepBasicList = [] |
| | | } |
| | | // if(res.data.data.approvalDepBasicList && res.data.data.approvalDepBasicList.length>0){ |
| | | // state.form.approvalDepBasicList = res.data.data.approvalDepBasicList.map(({id,content})=>({ |
| | | // content, |
| | | // approvalDepBasicId: id, |
| | | // approvalUids: [], |
| | | // approvalType: null |
| | | // })) |
| | | // }else{ |
| | | // state.form.approvalDepBasicList = [] |
| | | // } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |