| | |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业申请单位" prop="applyDepId"> |
| | | <el-cascader style="width: 100%" v-model="form.applyDepId" :options="departList2" :props="props" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | <el-form-item label="作业申请单位" prop="depIdList"> |
| | | <el-cascader style="width: 100%" v-model="form.depIdList" :options="lists.departList" :props="props1" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | </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="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="workDetail.involvedDepIds"> |
| | | <el-cascader style="width: 100%" v-model="form.workDetail.involvedDepIds" :props="depProps2" :options="departList" :show-all-levels="false"/> |
| | | <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="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" multiple @change="getSafetyIds" clearable> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.guardianUids" :options="lists.spList.jhList" :props="cas3Props" filterable @change="singleSelect($event,'监护人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple @change="getStartEndIds" clearable> |
| | | <el-select v-model="form.headUids" filterable multiple :multiple-limit="1" @change="getStartEndIds" clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :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-form-item> |
| | | </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 workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <el-form-item label="涉及相关单位(部门)" prop="workDetail.involvedDepIds"> |
| | | <el-cascader style="width: 100%" v-model="form.workDetail.involvedDepIds" :props="depProps2" :options="lists.departList" :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联其他特殊作业" prop="involveOtherWork"> |
| | | <el-select v-model="form.involveOtherWork" multiple clearable> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.label" |
| | | /> |
| | | <el-col :span="12" class="valueSelect"> |
| | | <el-form-item label="关联其他特殊作业"> |
| | | <!-- <el-select v-model="form.involveOtherWork" multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in otherWorkList"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.label"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-select v-model="form.involveOtherWork" multiple clearable :teleported="false" @click="openWorkSelect"> |
| | | <el-option v-for="item in lists.otherWorks" :key="item.workApplyId" :label="item.workContent" :value="item.workApplyId"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-form-item label="绑定执法仪"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in deviceList" |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="断路地段示意图" prop="workDetail.bcPath"> |
| | | <el-upload accept="image/*" :auto-upload="true" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='imgLimit' v-model:file-list="fileList" :http-request="upload" :action="uploadUrl" list-type="picture-card" :on-remove="handleRemove" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-upload accept="image/*" :auto-upload="true" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='imgLimit' v-model:file-list="fileList" :http-request="upload" :action="uploadUrl" list-type="picture-card" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M,最多可上传3张</div> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于2M,最多可上传3张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <el-input |
| | | v-model="form.riskIdentification" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入风险辨识" |
| | | /> |
| | | <el-select v-model="form.riskIdentification" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.riskList" |
| | | :key="item.id" |
| | | :label="item.content" |
| | | :value="item.content" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <el-table :data="safetyMeasureBasicList" style="width: 90%" border> |
| | | <el-table :data="safetyMeasureBasicList" style="width: 90%" border v-loading="tabLoading"> |
| | | <el-table-column type="index" label="序号" width="100px" align="center"/> |
| | | <el-table-column prop="measureContent" label="安全措施" align="center"/> |
| | | <el-table-column prop="measureContent" label="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" multiple clearable> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.safetyMeasureUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'确认人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <el-table :data="form.approvalDepBasicList" style="width: 90%" border> |
| | | <el-table :data="form.approvalDepBasicList" style="width: 90%" border v-loading="tabLoading"> |
| | | <el-table-column prop="content" label="审批签字项目" align="center"/> |
| | | <el-table-column prop="approvalType" label="是否必签" align="center"> |
| | | <template #default="scope"> |
| | | <el-form-item label="" prop="acceptUid"> |
| | | <el-form-item label="" prop="acceptUid" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" clearable> |
| | | <el-form-item label="完工验收" prop="acceptUids"> |
| | | <el-select v-model="form.acceptUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.acceptUid" :options="lists.workerList" :props="cas4Props" filterable :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="现场开始结束确认人" prop="startOrEndUids"> |
| | | <el-select v-model="form.startOrEndUids" multiple clearable> |
| | | <el-select v-model="form.startOrEndUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.startOrEndUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'结束人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="签字人" prop="workDetail.signUid"> |
| | | <el-select v-model="form.workDetail.signUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="最终审批人" prop="lastApprover">--> |
| | | <!-- <el-select v-model="form.lastApprover" filterable clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.workerList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.username"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.lastApprover" :options="lists.workerList" :props="cas4Props" filterable :show-all-levels="false"/>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | import workSelect from "/@/views/newSpecialWorkSystem/workTicket/zysq/components/workSelect.vue"; |
| | | import {UploadProps} from "element-plus/es"; |
| | | import axios from "axios"; |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | otherWorkList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | props:{}, |
| | | zyList: [] |
| | | props1:{}, |
| | | depProps:{}, |
| | | depProps2:{}, |
| | | casProps:{} |
| | | cas2Props: {} |
| | | cas3Props: {} |
| | | cas4Props: {} |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | | dialogVisible: Boolean, |
| | | tabLoading: Boolean, |
| | | dialogImageUrl: string | null, |
| | | imgLimit: number, |
| | | } |
| | |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenForm', |
| | | components: {}, |
| | | props:['departList','departList2','workerList','deviceList'], |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | form: { |
| | | workType: 5, |
| | | workLevel: 0, |
| | | depIdList: [], |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workDepIds: [], |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | involveOtherWork: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | acceptUids: [], |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | involvedDepIds: [], |
| | | bcReason: '', |
| | | bcExplain: '', |
| | | bcPath: [] |
| | | bcPath: [], |
| | | signUid: null |
| | | } |
| | | }, |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ], |
| | | props:{ |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | value: 'depId' |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | |
| | | emitPath: false, |
| | | multiple: true |
| | | }, |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'username', |
| | | multiple: true, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.workerList |
| | | }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, |
| | | username: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.jhList |
| | | }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) |
| | | } |
| | | }, |
| | | cas4Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'username', |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.workerList |
| | | }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, |
| | | username: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | depIdList: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | 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' }], |
| | | involveOtherWork: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | guardianUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | riskIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | cameraIds: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | expStartTime: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | expEndTime: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | safetyMeasureUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | acceptUid: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | acceptUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.involvedDepIds": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcReason": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcExplain": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | "workDetail.bcPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.signUid": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | 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 |
| | | } |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findNearestDepLevel2DepId(props.departList2,state.form.applyDepId) |
| | | console.log(state.form.seDepId,'state.form.seDepId') |
| | | state.form.applyDepId = state.form.depIdList[state.form.depIdList.length - 1] |
| | | state.form.seDepId = state.form.depIdList[0] |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(5) |
| | | if (res.data.code === '200') { |
| | | state.safetyMeasureBasicList = JSON.parse(JSON.stringify(res.data.data.safetyMeasureBasicList)) |
| | |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | const getStartEndIds = ()=>{ |
| | | const getStartEndIds = (value)=>{ |
| | | // let selected = value |
| | | // if(selected.length>1){ |
| | | // const temp = [] |
| | | // for(let i of selected){ |
| | | // const index = temp.findIndex(item => item[0] === i[0]); |
| | | // if (index !== -1) { |
| | | // temp[index] = i |
| | | // }else{ |
| | | // temp.push(i) |
| | | // } |
| | | // } |
| | | // state.form.headUids = temp |
| | | // } |
| | | // state.form.startOrEndUids = state.form.headUids |
| | | // state.form.approvalDepBasicList[0].approvalUids = [...new Set(state.form.headUids.map((i)=>i[0]))] |
| | | state.form.startOrEndUids = state.form.headUids |
| | | state.form.approvalDepBasicList[0].approvalUids = state.form.headUids |
| | | } |
| | |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i, |
| | | certificate: '', |
| | | certExpiredAt: '', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Obj = (id: any)=>{ |
| | | return { |
| | | uid: id, |
| | | certificate: '', |
| | | certExpiredAt: '', |
| | | certTypeName: '' |
| | | } |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | |
| | | return |
| | | } |
| | | } |
| | | if(Array.isArray(state.form.involveOtherWork)){ |
| | | state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.join(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.join(',') |
| | | const res = await workApplyApi().submitBrokenApply(state.form) |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().submitBrokenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bcPath = [] |
| | | state.fileList = [] |
| | |
| | | state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.split(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }; |
| | | |
| | | const getUploadUrl = async (rawFile: any) => { |
| | | const fileSize = rawFile.size / 1024 / 1024 < 5 ? '1' : '0' |
| | | if(fileSize === '0'){ |
| | | // const fileSize = rawFile.size / 1024 / 1024 < 5 ? '1' : '0' |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过5M。' |
| | | message: '文件大小不能超过2M。' |
| | | }); |
| | | return false |
| | | return Promise.reject(false) |
| | | }else{ |
| | | const res = await workApplyApi().getUpload9Url(rawFile.name); |
| | | state.form.workDetail.bcPath.push(res.data.data.fileName) |
| | |
| | | }; |
| | | |
| | | const beforeRemove = (file: {}, fileList: []) => { |
| | | const result = new Promise((resolve, reject) => { |
| | | ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | // console.log(state.workDetail.bcPath,'path') |
| | | const list = JSON.parse(JSON.stringify(state.form.workDetail.bcPath)) |
| | | fileList.map((item,index)=>{ |
| | | if(item.uid === file.uid){ |
| | | fileList.splice(index,1) |
| | | state.form.workDetail.bcPath.splice(index,1) |
| | | // 请求删除接口 |
| | | deletePic(false,list[index]) |
| | | } |
| | | if (file && file.status === "success") { |
| | | const result = new Promise((resolve, reject) => { |
| | | ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | // console.log(state.workDetail.bcPath,'path') |
| | | const list = JSON.parse(JSON.stringify(state.form.workDetail.bcPath)) |
| | | fileList.map((item, index) => { |
| | | if (item.uid === file.uid) { |
| | | fileList.splice(index, 1) |
| | | state.form.workDetail.bcPath.splice(index, 1) |
| | | // 请求删除接口 |
| | | deletePic(list[index]) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | reject(false); |
| | | }); |
| | | }); |
| | | return result; |
| | | .catch(() => { |
| | | reject(false); |
| | | }); |
| | | }); |
| | | return result; |
| | | } |
| | | }; |
| | | |
| | | // 删除图片接口 |
| | |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | |
| | | showTip, |
| | | handlePictureCardPreview, |
| | | beforeRemove, |
| | | openWorkSelect, |
| | | getSelected, |
| | | singleSelect, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | position: relative; |
| | | overflow-y: scroll; |
| | | padding: 0 0 120px; |
| | | |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | position: fixed; |
| | | left: 0; |
| | | bottom: 0; |
| | | z-index: 999; |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |