| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="动火方式" prop="workDetail.workMethod"> |
| | | <el-input |
| | | v-model="form.workDetail.workMethod" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入动火方式" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-form-item label="动火方式" prop="workDetail.methodList"> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workDetail.workMethod"--> |
| | | <!-- :autosize="{ minRows: 1 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入动火方式"--> |
| | | <!-- />--> |
| | | <el-select v-model="form.workDetail.methodList" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.opList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | v-for="item in fireWorkList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | /> |
| | | </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-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> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | :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.headUids" :options="lists.workerList" :props="casProps" @change="getStartEndIds" filterable :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.workDetail.methodList.find(i=>i == '其他')"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="其他方式" prop="workDetail.other"> |
| | | <el-input |
| | | v-model="form.workDetail.other" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入其他动火方式" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <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="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-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | fireWorkList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | tabLoading: boolean |
| | | showDialog: boolean |
| | | zyList: [] |
| | | props1:{} |
| | | depProps:{} |
| | | safetyMeasureBasicList: [] |
| | |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 1, |
| | |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workDepIds: [], |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | workMethod: '' |
| | | workMethod: '', |
| | | methodList: [], |
| | | other: '' |
| | | }, |
| | | remark: '' |
| | | }, |
| | |
| | | value: 3 |
| | | } |
| | | ], |
| | | fireWorkList: [ |
| | | { |
| | | name: "电焊", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name: "气割", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name: "切割", |
| | | id: 3 |
| | | }, |
| | | { |
| | | name: "打磨", |
| | | id: 4 |
| | | }, |
| | | { |
| | | name: "钻孔", |
| | | id: 5 |
| | | }, |
| | | { |
| | | name: "喷灯", |
| | | id: 6 |
| | | }, |
| | | { |
| | | name: "烘烤", |
| | | id: 7 |
| | | }, |
| | | { |
| | | name: "喷砂", |
| | | id: 8 |
| | | }, |
| | | { |
| | | name: "破碎地面", |
| | | id: 9 |
| | | }, |
| | | { |
| | | name: "清洗机", |
| | | id: 10 |
| | | }, |
| | | { |
| | | name: "其他", |
| | | id: 11 |
| | | } |
| | | ], |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | |
| | | 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' }], |
| | |
| | | acceptUid: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.workMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | "workDetail.methodList": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.other": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | // getBasicData() |
| | | }) |
| | | |
| | | onUpdated(()=>{ |
| | | console.log('false loading') |
| | | }) |
| | | |
| | | 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 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.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.approvalDepBasicList = row.approvalDepList.map((item)=>({ |
| | | content: item.content, |
| | | approvalDepBasicId: item.approvalDepBasicId, |
| | | approvalUids: item.approvalPersonList.filter(j=>j.type == 5).map(i=>i.userId), |
| | | approvalType: item.approvalType |
| | | content: item.content, |
| | | approvalDepBasicId: item.approvalDepBasicId, |
| | | approvalUids: item.approvalPersonList.filter(j=>j.type == 5).map(i=>i.userId), |
| | | approvalType: item.approvalType |
| | | })) |
| | | console.log(state.form.approvalDepBasicList,777) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | console.log(state.form,'form') |
| | | state.form.workDetail.methodList = state.form.workDetail.workMethod.split(',') |
| | | if(row.workDepList && row.workDepList.length>0){ |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | for(let i in state.form.workDetail.methodList){ |
| | | if(!state.fireWorkList.find(item=>item.name == state.form.workDetail.methodList[i])){ |
| | | state.form.workDetail.other = state.form.workDetail.methodList[i] |
| | | state.form.workDetail.methodList[i] = '其他' |
| | | } |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | | } |
| | | |
| | |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workDepIds: [], |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | workMethod: '' |
| | | workMethod: '', |
| | | methodList: [], |
| | | other: '' |
| | | }, |
| | | remark: '' |
| | | } |
| | |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.workDetail.methodList = data.workDetail.methodList.map(item=>{ |
| | | if(item == '其他'){ |
| | | item = data.workDetail.other |
| | | } |
| | | return item |
| | | }) |
| | | data.workDetail.workMethod = data.workDetail.methodList.join(',') |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getWorkerList, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |