| | |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getWorkWarning: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/statistic/work/warning`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | modFireApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/hot`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | submitSpaceApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/apply/confinedspace`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | modSpaceApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/confinedspace`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | modHoistApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/hoisting`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | submitGroundApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/apply/groundBreaking`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | modGroundApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/groundBreaking`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | modBrokenApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/brokenCircuit`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | submitHeightApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/apply/hight`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | modHeightApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/hight`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | modPowerApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/temporaryPower`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | submitPlateApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/apply/blindPlatePlugging`, |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | modPlateApply: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/mod/blindPlatePlugging`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // 所有记录列表 |
| | | getApplyList: (data: object) => { |
| | | return request({ |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 获取所有风险辨识 |
| | | getAllRiskIdentity: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/risk/manage/select`, |
| | | method: 'post', |
| | | data: data, |
| | | }); |
| | | }, |
| | | |
| | | // 导出打印接口 |
| | | postPrinting: (data: object) => { |
| | | return request({ |
| | |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="" prop="type"> |
| | | <el-radio-group v-model="form.type"> |
| | | <el-radio :label="1">安全评价报告</el-radio> |
| | | <el-radio :label="2">安全三同时</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报告名称" prop="name"> |
| | | <el-input v-model.trim="form.name" placeholder="报告名称" clearable></el-input> |
| | | </el-form-item> |
| | |
| | | <div class="el-upload__tip">仅支持上传pdf文件,尺寸小于2M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | isShowDialog: boolean; |
| | | form: { |
| | | uuid: string |
| | | type: null | number |
| | | name: string |
| | | remarks: string |
| | | evaluateTime: string |
| | | files: string |
| | | deleted: string |
| | | } |
| | | rules:{}, |
| | | fileList: [], |
| | |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | type: 1, |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | files: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | type: [{ required: true, message: '请选择报告类型', trigger: 'blur'}], |
| | | name: [{ required: true, message: '请填写报告名称', trigger: 'blur'}], |
| | | remarks: [{ required: true, message: '请填写备注', trigger: 'blur'}], |
| | | evaluateTime: [{ required: true, message: '请选择评价时间', trigger: 'blur'}] |
| | |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | type: 1, |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | files: '', |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | type: 1, |
| | | uuid: data.uuid, |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | files: '', |
| | | deleted: '0' |
| | | } |
| | | } |
| | | state.fileList = [] |
| | |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="报告名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="type" label="报告类型" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.type == 1 ? '安全评价报告':scope.row.type == 2 ? '安全三同时':'--'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="evaluateTime" label="评价时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="files" label="附件" show-overflow-tooltip> |
| | |
| | | // router.push({ |
| | | // name: "warningScreen" |
| | | // }); |
| | | |
| | | window.open('http://39.104.85.193:8585/'); |
| | | }; |
| | | |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :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="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="lists.departList" :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="断路原因" prop="workDetail.bcReason"> |
| | | <el-input |
| | | v-model="form.workDetail.bcReason" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入断路原因" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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" filterable multiple @change="getStartEndIds" 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.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" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.opList" |
| | | :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> |
| | | <el-row> |
| | | <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-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="断路地段相关说明" prop="workDetail.bcExplain"> |
| | | <el-input |
| | | v-model="form.workDetail.bcExplain" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入断路地段相关说明并在右方上传示意图" |
| | | /> |
| | | </el-form-item> |
| | | </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" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于2M,最多可上传3张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column prop="address" label="操作">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :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="其他安全措施">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- :autosize="{ minRows: 2 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入其他安全措施"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="编制人">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- placeholder="请输入编制人"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | depProps2:{}, |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | | dialogVisible: Boolean, |
| | | tabLoading: Boolean, |
| | | dialogImageUrl: string | null, |
| | | imgLimit: number, |
| | | } |
| | | interface file { |
| | | url: string; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 5, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | involvedDepIds: [], |
| | | bcReason: '', |
| | | bcExplain: '', |
| | | bcPath: [], |
| | | signUid: null |
| | | }, |
| | | remark: '' |
| | | }, |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | depProps2:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false, |
| | | multiple: true |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | | dialogVisible: false, |
| | | dialogImageUrl: null |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ 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' }], |
| | | 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.signUid": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.form.workDetail.involvedDepIds = row.workDetail.involvedDepIds.split(',').map(i=>Number(i)) |
| | | state.fileList = row.workDetail.bcPath.split(',').map(item => { |
| | | return { |
| | | url: item, |
| | | name: item.match(/specialWork9step\/(.*?)\?/)[1] |
| | | } |
| | | }) |
| | | state.form.workDetail.bcPath = row.workDetail.bcPath.split(',').map(item => item.match(/specialWork9step\/(.*?)\?/)[1]) |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 5, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | involvedDepIds: [], |
| | | bcReason: '', |
| | | bcExplain: '', |
| | | bcPath: [], |
| | | signUid: null |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | 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)) |
| | | 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', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // 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(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modBrokenApply(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 = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | 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 handlePreview: UploadProps['onPreview'] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile: { url: string }) => { |
| | | state.dialogImageUrl = uploadFile.url!; |
| | | state.dialogVisible = true; |
| | | }; |
| | | |
| | | const getUploadUrl = async (rawFile: any) => { |
| | | // const fileSize = rawFile.size / 1024 / 1024 < 5 ? '1' : '0' |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M。' |
| | | }); |
| | | return Promise.reject(false) |
| | | }else{ |
| | | const res = await workApplyApi().getUpload9Url(rawFile.name); |
| | | state.form.workDetail.bcPath.push(res.data.data.fileName) |
| | | state.uploadUrl = res.data.data.uploadUrl; |
| | | } |
| | | }; |
| | | |
| | | const upload = async (params: any) => { |
| | | let reader = new FileReader(); |
| | | reader.readAsArrayBuffer(params.file); |
| | | reader.onload = async () => { |
| | | axios |
| | | .put(state.uploadUrl, reader.result, { |
| | | header: { 'Content-Type': 'multipart/form-data' } |
| | | }) |
| | | .then(() => { |
| | | // if (state.fileList.length === 2) { |
| | | // state.fileList.splice(0, 1); |
| | | // } |
| | | }); |
| | | }; |
| | | }; |
| | | |
| | | const beforeRemove = (file: {}, fileList: []) => { |
| | | 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; |
| | | } |
| | | }; |
| | | |
| | | // 删除图片接口 |
| | | const deletePic = async(fileName:string)=>{ |
| | | const res = await workApplyApi().deleteFile({fileName: fileName}) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | upload, |
| | | showTip, |
| | | handlePictureCardPreview, |
| | | beforeRemove, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :props="props1" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="动火级别" prop="workLevel"> |
| | | <el-select v-model="form.workLevel" clearable> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点及动火部位" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点及动火部位" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </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-option |
| | | v-for="item in lists.spList.opList" |
| | | :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> |
| | | <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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="analystUids"> |
| | | <el-select v-model="form.analystUids" filterable multiple 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.analystUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'分析人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" class="valueSelect"> |
| | | <el-form-item label="关联其他特殊作业"> |
| | | <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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <el-select v-model="form.riskIdentification" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.riskList" |
| | | :key="item.content" |
| | | :label="item.content" |
| | | :value="item.content" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column prop="address" label="操作">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :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="其他安全措施">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- :autosize="{ minRows: 2 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入其他安全措施"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="编制人">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- placeholder="请输入编制人"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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="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 v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted, onUpdated } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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 {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | tabLoading: boolean |
| | | showDialog: boolean |
| | | props1:{} |
| | | depProps:{} |
| | | safetyMeasureBasicList: [] |
| | | } |
| | | export default defineComponent({ |
| | | name: 'fireDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 1, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | workMethod: '' |
| | | }, |
| | | remark: '' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "一级动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "二级动火作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "特级动火作业", |
| | | value: 3 |
| | | } |
| | | ], |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.workMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }) |
| | | |
| | | onUpdated(()=>{ |
| | | console.log('false loading') |
| | | }) |
| | | |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key] |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | 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.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 1, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | workMethod: '' |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | // state.form.applyDepId = state.form.depIdList[state.form.depIdList.length - 1] |
| | | // state.form.seDepId = state.form.depIdList[0] |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(1) |
| | | 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 = [] |
| | | // } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i, |
| | | certificate: '', |
| | | certExpiredAt: '', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | const transform2EObj = (id: any)=>{ |
| | | return { |
| | | uid: id, |
| | | certificate: '', |
| | | certExpiredAt: '', |
| | | certTypeName: '' |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2EObj(data.acceptUid) |
| | | data.lastApprover = transform2EObj(data.lastApprover) |
| | | const res = await workApplyApi().modFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | workSelectRef, |
| | | clearFile, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | position: relative; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :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="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :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" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.opList" |
| | | :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> |
| | | <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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业范围、内容、方式" prop="workDetail.gbDesc"> |
| | | <el-input |
| | | v-model="form.workDetail.gbDesc" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业范围、内容、方式(包括深度、面积)并在右方上传简图" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业简图" prop="workDetail.gbPath"> |
| | | <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图片尺寸小于2M,最多可上传3张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column prop="address" label="操作">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :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="其他安全措施">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- :autosize="{ minRows: 2 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入其他安全措施"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="编制人">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- placeholder="请输入编制人"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | <el-dialog v-model="dialogVisible"> |
| | | <img w-full :src="dialogImageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | import {ElMessage, ElMessageBox, UploadProps, UploadUserFile} 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 axios from "axios"; |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | | dialogVisible: Boolean, |
| | | dialogImageUrl: string | null, |
| | | imgLimit: number |
| | | tabLoading: boolean |
| | | } |
| | | interface file { |
| | | url: string; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'groundDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 4, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | gbDesc: '', |
| | | gbPath: [], |
| | | signUid: null |
| | | }, |
| | | remark: '' |
| | | }, |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | | dialogVisible: false, |
| | | dialogImageUrl: null, |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.gbDesc": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.gbPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.signUid": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.fileList = row.workDetail.gbPath.split(',').map(item => { |
| | | return { |
| | | url: item, |
| | | name: item.match(/specialWork9step\/(.*?)\?/)[1] |
| | | } |
| | | }) |
| | | state.form.workDetail.gbPath = row.workDetail.gbPath.split(',').map(item => item.match(/specialWork9step\/(.*?)\?/)[1]) |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 4, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | gbDesc: '', |
| | | gbPath: [], |
| | | signUid: null |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(4) |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modGroundApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.gbPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const findNearestDepLevel2DepId = (data, targetDepId) => { |
| | | let nearestDepId = null; |
| | | |
| | | const traverseTree = (node) => { |
| | | if (node.depId === targetDepId) { |
| | | return true; |
| | | } |
| | | |
| | | if (node.children && node.children.length > 0) { |
| | | for (const child of node.children) { |
| | | const found = traverseTree(child); |
| | | if (found) { |
| | | if (child.depLevel === 2) { |
| | | nearestDepId = child.depId; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | }; |
| | | |
| | | for (const root of data) { |
| | | traverseTree(root); |
| | | } |
| | | |
| | | return nearestDepId; |
| | | }; |
| | | |
| | | const handlePreview: UploadProps['onPreview'] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile: { url: string }) => { |
| | | state.dialogImageUrl = uploadFile.url!; |
| | | state.dialogVisible = true; |
| | | }; |
| | | |
| | | const getUploadUrl = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M。' |
| | | }); |
| | | return Promise.reject(false) |
| | | }else{ |
| | | const res = await workApplyApi().getUpload9Url(rawFile.name) |
| | | state.form.workDetail.gbPath.push(res.data.data.fileName) |
| | | state.uploadUrl = res.data.data.uploadUrl |
| | | } |
| | | }; |
| | | |
| | | const upload = async (params: any) => { |
| | | let reader = new FileReader(); |
| | | reader.readAsArrayBuffer(params.file); |
| | | reader.onload = async () => { |
| | | axios |
| | | .put(state.uploadUrl, reader.result, { |
| | | header: { 'Content-Type': 'multipart/form-data' } |
| | | }) |
| | | .then(() => { |
| | | // if (state.fileList.length === 2) { |
| | | // state.fileList.splice(0, 1); |
| | | // } |
| | | }); |
| | | }; |
| | | }; |
| | | |
| | | const beforeRemove = (file: {}, fileList: []) => { |
| | | if (file && file.status === "success") { |
| | | const result = new Promise((resolve, reject) => { |
| | | ElMessageBox.confirm('此操作将彻底删除该图片,不可恢复,是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | // console.log(state.workDetail.gbPath,'path') |
| | | const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath)) |
| | | fileList.map((item, index) => { |
| | | if (item.uid === file.uid) { |
| | | fileList.splice(index, 1) |
| | | state.form.workDetail.gbPath.splice(index, 1) |
| | | // 请求删除接口 |
| | | deletePic(list[index]) |
| | | } |
| | | }) |
| | | console.log(state.form.workDetail.gbPath, 'gbpath') |
| | | }) |
| | | .catch(() => { |
| | | reject(false); |
| | | }); |
| | | }); |
| | | return result; |
| | | } |
| | | }; |
| | | |
| | | // 删除图片接口 |
| | | const deletePic = async(fileName:string)=>{ |
| | | const res = await workApplyApi().deleteFile({fileName: fileName}) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | upload, |
| | | showTip, |
| | | handlePictureCardPreview, |
| | | beforeRemove, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :props="props1" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="高处作业级别" prop="workLevel"> |
| | | <el-select v-model="form.workLevel" clearable> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业高度(m)" prop="workDetail.hight"> |
| | | <el-input |
| | | v-model="form.workDetail.hight" |
| | | placeholder="请输入作业高度" |
| | | type="number" |
| | | /> |
| | | </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 lists.spList.opList" |
| | | :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> |
| | | <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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" filterable multiple @change="getStartEndIds" 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.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="guardianUids"> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" filterable prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" multiple 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.safetyMeasureUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'确认人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" filterable label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.acceptUid" :options="lists.workerList" :props="cas4Props" filterable :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="现场开始结束确认人" filterable prop="startOrEndUids"> |
| | | <el-select v-model="form.startOrEndUids" multiple 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.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="lastApprover"> |
| | | <el-select v-model="form.lastApprover" 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" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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 {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [] |
| | | tabLoading: boolean |
| | | } |
| | | export default defineComponent({ |
| | | name: 'heightDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 6, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | hight: '' |
| | | }, |
| | | remark: '' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "一级高处作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "二级高处作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "三级高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "特级高处作业", |
| | | value: 7 |
| | | } |
| | | ], |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hight": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 6, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | hight: '' |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(6) |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const findNearestDepLevel2DepId = (data, targetDepId) => { |
| | | let nearestDepId = null; |
| | | |
| | | const traverseTree = (node) => { |
| | | if (node.depId === targetDepId) { |
| | | return true; |
| | | } |
| | | |
| | | if (node.children && node.children.length > 0) { |
| | | for (const child of node.children) { |
| | | const found = traverseTree(child); |
| | | if (found) { |
| | | if (child.depLevel === 2) { |
| | | nearestDepId = child.depId; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | }; |
| | | |
| | | for (const root of data) { |
| | | traverseTree(root); |
| | | } |
| | | |
| | | return nearestDepId; |
| | | }; |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :props="props1" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊装级别" prop="workLevel"> |
| | | <el-select v-model="form.workLevel" clearable> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊物重量(t)" prop="workDetail.weightMass"> |
| | | <el-input |
| | | v-model="form.workDetail.weightMass" |
| | | placeholder="请输入吊物重量" |
| | | type="number" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊具名称" prop="workDetail.hoistingToolName"> |
| | | <el-input |
| | | v-model="form.workDetail.hoistingToolName" |
| | | placeholder="请输入吊具名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊装地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊装内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :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-option |
| | | v-for="item in lists.spList.opList" |
| | | :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> |
| | | <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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="workDetail.solicitorUids"> |
| | | <el-select v-model="form.workDetail.solicitorUids" filterable multiple 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" 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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column prop="address" label="操作">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :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="其他安全措施">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- :autosize="{ minRows: 2 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入其他安全措施"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="编制人">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- placeholder="请输入编制人"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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="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" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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 {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any> |
| | | equipmentDialog: boolean |
| | | showDialog: boolean |
| | | props1:{} |
| | | depProps:{} |
| | | safetyMeasureBasicList: [] |
| | | tabLoading: boolean |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 3, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | hoistingToolName: '', |
| | | weightMass: '', |
| | | solicitorUids: [] |
| | | }, |
| | | remark:'' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | | value: 8 |
| | | }, |
| | | { |
| | | label: "二级吊装作业", |
| | | value: 9 |
| | | }, |
| | | { |
| | | label: "三级吊装作业", |
| | | value: 10 |
| | | } |
| | | ], |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hoistingToolName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.weightMass": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.solicitorUids": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | state.form.workDetail.solicitorUids = row.workDetail.solicitorUids.split(',').map(i=>Number(i)) |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 3, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | hoistingToolName: '', |
| | | weightMass: '', |
| | | solicitorUids: [] |
| | | }, |
| | | remark:'' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(3) |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modHoistApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="风险研判报告记录附件" prop="judgePicturePath"> |
| | | <el-form-item label="风险研判报告记录附件"> |
| | | <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> |
| | |
| | | judgePicturePath: [] |
| | | }, |
| | | jsaFormRules: { |
| | | judgeRecord: [{ required: true, message: '请填写jsa风险研判结论', trigger: 'blur' }], |
| | | judgePicturePath: [{ required: true, message: '请上传风险研判报告附件', trigger: 'blur' }] |
| | | judgeRecord: [{ required: true, message: '请填写jsa风险研判结论', trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :props="props1" :show-all-levels="false" placeholder="明确到具体车间" @change="findParent" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业类别" prop="workLevel"> |
| | | <el-select v-model="form.workLevel" clearable> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备管道名称" prop="workDetail.pipingName"> |
| | | <el-input |
| | | v-model="form.workDetail.pipingName" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入设备管道名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管道介质" prop="workDetail.media"> |
| | | <el-input |
| | | v-model="form.workDetail.media" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入管道介质" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管道温度(℃)" prop="workDetail.temperature"> |
| | | <el-input |
| | | v-model="form.workDetail.temperature" |
| | | type="number" |
| | | placeholder="请输入管道温度" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管道压力(kPa)" prop="workDetail.pressure"> |
| | | <el-input |
| | | v-model="form.workDetail.pressure" |
| | | type="number" |
| | | placeholder="请输入管道压力" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板材质" prop="workDetail.bpMaterialQuality"> |
| | | <el-input |
| | | v-model="form.workDetail.bpMaterialQuality" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入盲板材质" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板规格" prop="workDetail.bpSpecification"> |
| | | <el-input |
| | | v-model="form.workDetail.bpSpecification" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入盲板规格" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板编号" prop="workDetail.bpCode"> |
| | | <el-input |
| | | v-model="form.workDetail.bpCode" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入盲板编号" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板位置相关描述" prop="workDetail.bpLocationDesc"> |
| | | <el-input |
| | | v-model="form.workDetail.bpLocationDesc" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入盲板位置相关描述并在右方上传位置图" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板位置示意图" prop="workDetail.bpLocationMapPath"> |
| | | <el-upload accept="image/*" :auto-upload="true" :on-exceed="showTip" :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图片尺寸小于2M,最多可上传3张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <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 lists.spList.opList" |
| | | :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-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-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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="guardianUids"> |
| | | <el-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="编制人姓名" prop="workDetail.preparedByName"> |
| | | <el-input |
| | | v-model="form.workDetail.preparedByName" |
| | | placeholder="请输入编制人姓名" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="编制时间" prop="workDetail.preparedTime"> |
| | | <el-date-picker |
| | | v-model="form.workDetail.preparedTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'确认人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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="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" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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, |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean, |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | | imgLimit: number, |
| | | tabLoading: boolean |
| | | } |
| | | interface file { |
| | | url: string; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'plateForm', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 8, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | pipingName: '', |
| | | bpCode: '', |
| | | media: '', |
| | | temperature: null, |
| | | pressure: null, |
| | | bpMaterialQuality: '', |
| | | bpSpecification: '', |
| | | bpLocationMapPath: [], |
| | | bpLocationDesc: '', |
| | | preparedByName: '', |
| | | preparedTime: '' |
| | | }, |
| | | remark: '' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "抽盲板作业", |
| | | value: 11 |
| | | }, |
| | | { |
| | | label: "堵盲板作业", |
| | | value: 12 |
| | | } |
| | | ], |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.pipingName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpCode": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.media": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.temperature": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.pressure": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpMaterialQuality": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpSpecification": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpLocationMapPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpLocationDesc": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.preparedByName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.preparedTime": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.fileList = row.workDetail.bpLocationMapPath.split(',').map(item => { |
| | | return { |
| | | url: item, |
| | | name: item.match(/specialWork9step\/(.*?)\?/)[1] |
| | | } |
| | | }) |
| | | state.form.workDetail.bpLocationMapPath = row.workDetail.bpLocationMapPath.split(',').map(item => item.match(/specialWork9step\/(.*?)\?/)[1]) |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 8, |
| | | workLevel: null, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | pipingName: '', |
| | | bpCode: '', |
| | | media: '', |
| | | temperature: null, |
| | | pressure: null, |
| | | bpMaterialQuality: '', |
| | | bpSpecification: '', |
| | | bpLocationMapPath: [], |
| | | bpLocationDesc: '', |
| | | preparedByName: '', |
| | | preparedTime: '' |
| | | }, |
| | | remark:'' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(8) |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modPlateApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bpLocationMapPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handlePreview: UploadProps['onPreview'] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const getUploadUrl = async (rawFile: any) => { |
| | | // const fileSize = rawFile.size / 1024 / 1024 < 5 ? '1' : '0' |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M。' |
| | | }); |
| | | return Promise.reject(false) |
| | | }else{ |
| | | const res = await workApplyApi().getUpload9Url(rawFile.name); |
| | | state.form.workDetail.bpLocationMapPath.push(res.data.data.fileName) |
| | | state.uploadUrl = res.data.data.uploadUrl; |
| | | } |
| | | }; |
| | | |
| | | const upload = async (params: any) => { |
| | | let reader = new FileReader(); |
| | | reader.readAsArrayBuffer(params.file); |
| | | reader.onload = async () => { |
| | | axios |
| | | .put(state.uploadUrl, reader.result, { |
| | | header: { 'Content-Type': 'multipart/form-data' } |
| | | }) |
| | | .then(() => { |
| | | // if (state.fileList.length === 2) { |
| | | // state.fileList.splice(0, 1); |
| | | // } |
| | | }); |
| | | }; |
| | | }; |
| | | |
| | | const beforeRemove = (file: {}, fileList: []) => { |
| | | if (file && file.status === "success") { |
| | | const result = new Promise((resolve, reject) => { |
| | | ElMessageBox.confirm('此操作将彻底删除该图片,不可恢复,是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | // console.log(state.workDetail.bpLocationMapPath,'path') |
| | | const list = JSON.parse(JSON.stringify(state.form.workDetail.bpLocationMapPath)) |
| | | fileList.map((item, index) => { |
| | | if (item.uid === file.uid) { |
| | | fileList.splice(index, 1) |
| | | state.form.workDetail.bpLocationMapPath.splice(index, 1) |
| | | // 请求删除接口 |
| | | deletePic(list[index]) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | reject(false); |
| | | }); |
| | | }); |
| | | return result; |
| | | } |
| | | }; |
| | | |
| | | // 删除图片接口 |
| | | const deletePic = async(fileName:string)=>{ |
| | | const res = await workApplyApi().deleteFile({fileName: fileName}) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | upload, |
| | | showTip, |
| | | beforeRemove, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :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="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="电源接入点及许可用电功率" prop="workDetail.powerAccessPoint"> |
| | | <el-input |
| | | v-model="form.workDetail.powerAccessPoint" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入电源接入点及许可用电功率" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工作电压" prop="workDetail.workingVoltage"> |
| | | <el-input |
| | | v-model="form.workDetail.workingVoltage" |
| | | type="number" |
| | | placeholder="请输入工作电压" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用电设备名称及额定功率" prop="workDetail.equipmentAndPower"> |
| | | <el-input |
| | | v-model="form.workDetail.equipmentAndPower" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入用电设备名称及额定功率" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用电人" prop="workDetail.electricityUids"> |
| | | <el-select v-model="form.workDetail.electricityUids" filterable multiple 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-row> |
| | | <el-row> |
| | | <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 lists.spList.opList" |
| | | :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> |
| | | <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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="analystUids"> |
| | | <el-select v-model="form.analystUids" filterable multiple 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.analystUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'分析人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | <!-- <el-table-column prop="address" label="确认人">--> |
| | | <!-- <template #default="scope">--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column prop="address" label="操作">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :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="其他安全措施">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- :autosize="{ minRows: 2 }"--> |
| | | <!-- type="textarea"--> |
| | | <!-- placeholder="请输入其他安全措施"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="编制人">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.workContent"--> |
| | | <!-- placeholder="请输入编制人"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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="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 v-throttle @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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 {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [] |
| | | tabLoading: boolean |
| | | } |
| | | export default defineComponent({ |
| | | name: 'powerDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | equipmentDialog: false, |
| | | showDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 7, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | powerAccessPoint: '', |
| | | workingVoltage: '', |
| | | equipmentAndPower: '', |
| | | electricityUids: [] |
| | | }, |
| | | remark: '' |
| | | }, |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }) |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.powerAccessPoint": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.workingVoltage": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.equipmentAndPower": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.electricityUids": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.workDetail.electricityUids = row.workDetail.electricityUids.split(',').map(i=>Number(i)) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 7, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | powerAccessPoint: '', |
| | | workingVoltage: '', |
| | | equipmentAndPower: '', |
| | | electricityUids: [] |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | 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 getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <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="lists.departList2" :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="workDetail.csName"> |
| | | <el-input |
| | | v-model="form.workDetail.csName" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入受限空间名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="原有介质名称" prop="workDetail.csOriginalName"> |
| | | <el-input |
| | | v-model="form.workDetail.csOriginalName" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入受限空间原有介质名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :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-option |
| | | v-for="item in lists.spList.opList" |
| | | :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> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地点" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业地点" |
| | | /> |
| | | </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"> |
| | | <el-form-item label="作业负责人" prop="headUids"> |
| | | <el-select v-model="form.headUids" multiple filterable @change="getStartEndIds" 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.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="analystUids"> |
| | | <el-select v-model="form.analystUids" filterable multiple 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.analystUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'分析人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" class="valueSelect"> |
| | | <el-form-item label="关联其他特殊作业"> |
| | | <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-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <el-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="动火作业实施时间" prop="expStartTime">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.expStartTime"--> |
| | | <!-- format="YYYY-MM-DD HH:mm"--> |
| | | <!-- value-format="YYYY-MM-DD HH:mm:00"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="至"--> |
| | | <!-- start-placeholder="开始时间"--> |
| | | <!-- end-placeholder="结束时间"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)开始时间" prop="expStartTime"> |
| | | <el-date-picker |
| | | v-model="form.expStartTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计(整体)完成时间" prop="expEndTime"> |
| | | <el-date-picker |
| | | v-model="form.expEndTime" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="风险辨识" prop="riskIdentification"> |
| | | <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-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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="安全措施"/> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="安全措施确认人" prop="safetyMeasureUids"> |
| | | <el-select v-model="form.safetyMeasureUids" filterable multiple 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.safetyMeasureUids" :options="lists.workerList" :props="casProps" filterable @change="singleSelect($event,'确认人')" :show-all-levels="false"/>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;justify-content: center"> |
| | | <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" label-width="0"> |
| | | <el-radio-group v-model="scope.row.approvalType"> |
| | | <el-radio :label="0">所有必签</el-radio> |
| | | <el-radio :label="1">任一</el-radio> |
| | | <el-radio :label="2">非必签</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="approvalUids" label="审批人" align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.approvalUids" filterable multiple :disabled="isFirstRow(scope.$index)" clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="acceptUid"> |
| | | <el-select v-model="form.acceptUid" 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.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" filterable multiple 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.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="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)" v-throttle>提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted, onUnmounted} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | 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 {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | safetyMeasureBasicList: [] |
| | | tabLoading: boolean |
| | | } |
| | | export default defineComponent({ |
| | | name: 'spaceDialog', |
| | | components: {workSelect}, |
| | | props:['lists'], |
| | | setup(props: any, context: any) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | tabLoading: false, |
| | | showDialog: false, |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | form: { |
| | | id: null, |
| | | workType: 2, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | csName: '', |
| | | csOriginalName: '' |
| | | }, |
| | | remark: '' |
| | | }, |
| | | props1:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | applyDepId: [{ 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' }], |
| | | headUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | analystUids: [{ 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' }], |
| | | lastApprover: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | startOrEndUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csOriginalName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const workSelectRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getBasicData() |
| | | }); |
| | | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (row.hasOwnProperty(key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | | state.form.involveOtherWork = row.otherWorkList.map(i=>i.otherWorkApplyId) |
| | | state.form.cameraIds = row.workApprovalDeviceList.map(i=>i.deviceId) |
| | | state.form.safetyMeasureUids = row.safetyMeasureList.map(i=>i.userId) |
| | | state.form.riskIdentification = row.riskIdentification.split(',') |
| | | 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 |
| | | })) |
| | | state.form.acceptUid = row.acceptUser.userId |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | state.form.lastApprover = row.lastApprover.userId |
| | | state.showDialog = true |
| | | } |
| | | |
| | | const clearFile = ()=>{ |
| | | state.form = { |
| | | id: null, |
| | | workType: 2, |
| | | workLevel: 0, |
| | | applyDepId: null, |
| | | seDepId: null, |
| | | expStartTime: '', |
| | | expEndTime: '', |
| | | operatorUids: [], |
| | | headUids: [], |
| | | analystUids: [], |
| | | guardianUids: [], |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | | acceptUid: null, |
| | | lastApprover: null, |
| | | startOrEndUids: [], |
| | | cameraIds: [], |
| | | workDetail: { |
| | | csName: '', |
| | | csOriginalName: '' |
| | | }, |
| | | remark: '' |
| | | } |
| | | state.showDialog = false |
| | | } |
| | | |
| | | const findParent = ()=>{ |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | function findTopLevelId(tree, targetId) { |
| | | let topLevelId = null; |
| | | function findIdRecursive(node) { |
| | | if (node.id === targetId) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (findIdRecursive(child)) { |
| | | topLevelId = node.id; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | tree.forEach(node => findIdRecursive(node)); |
| | | return topLevelId; |
| | | } |
| | | |
| | | // 获取基础数据 |
| | | const getBasicData = async ()=>{ |
| | | state.tabLoading = true |
| | | const res = await workApplyApi().getFormData(2) |
| | | 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 = [] |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.tabLoading = false |
| | | }; |
| | | |
| | | const getStartEndIds = (value)=>{ |
| | | state.form.startOrEndUids = state.form.headUids |
| | | state.form.approvalDepBasicList[0].approvalUids = state.form.headUids |
| | | } |
| | | |
| | | const getSafetyIds = ()=>{ |
| | | state.form.safetyMeasureUids = state.form.guardianUids |
| | | } |
| | | |
| | | const isFirstRow = (index)=> { |
| | | return index === 0; |
| | | } |
| | | |
| | | 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 submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i of state.form.approvalDepBasicList){ |
| | | if(i.approvalUids.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分审批人未配置' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modSpaceApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | getBasicData, |
| | | getStartEndIds, |
| | | getSafetyIds, |
| | | isFirstRow, |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | getSelected, |
| | | openDialog, |
| | | clearFile, |
| | | workSelectRef, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | | width: 0; |
| | | background-color: transparent; |
| | | } |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding: 20px 0; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .valueSelect{ |
| | | ::v-deep(.el-popper){ |
| | | display: none !important; |
| | | } |
| | | } |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <span v-if="scope.row.status == -1">已废止</span> |
| | | <el-button v-if="scope.row.status == 0 || scope.row.status == 1" link type="danger" size="small" :icon="Delete" @click="abortRecordBtn(scope.row)">作废</el-button> |
| | | <el-button v-if="scope.row.status !== -1" link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <!-- <el-button link type="success" size="small" :icon="Finished">修改</el-button>--> |
| | | <el-button v-if="scope.row.status == 1" link type="success" size="small" :icon="Download" @click="checkTicket(scope.row)">正式办票</el-button> |
| | | <el-button link type="primary" size="small" v-throttle :icon="Edit" @click="openEdit(scope.row)">修改</el-button> |
| | | <el-button link type="success" v-throttle v-if="scope.row.status == 0 || scope.row.status == 1" size="small" :icon="Download" @click="checkTicket(scope.row)">正式办票</el-button> |
| | | <!-- <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <detail-log :type=dialogType :statusList=statusList :details = details></detail-log> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogDetails = false" |
| | | >确认</el-button |
| | | > |
| | | <el-button type="primary" @click="dialogDetails = false">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <report-log ref="reportDialogRef" @refresh="getListByPage"></report-log> |
| | | <fire-dialog ref="fireRef" :lists="lists" @refresh="getListByPage"></fire-dialog> |
| | | <plate-dialog ref="plateRef" :lists="lists" @refresh="getListByPage"></plate-dialog> |
| | | <space-dialog ref="spaceRef" :lists="lists" @refresh="getListByPage"></space-dialog> |
| | | <hoist-dialog ref="hoistRef" :lists="lists" @refresh="getListByPage"></hoist-dialog> |
| | | <ground-dialog ref="groundRef" :lists="lists" @refresh="getListByPage"></ground-dialog> |
| | | <broken-dialog ref="brokenRef" :lists="lists" @refresh="getListByPage"></broken-dialog> |
| | | <height-dialog ref="heightRef" :lists="lists" @refresh="getListByPage"></height-dialog> |
| | | <power-dialog ref="powerRef" :lists="lists" @refresh="getListByPage"></power-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | searPara: {} |
| | | timeRange: Array<string>; |
| | | dep4List: Array<type>; |
| | | lists: {} |
| | | } |
| | | interface type { |
| | | id: number; |
| | |
| | | name: 'myApply', |
| | | components: { |
| | | detailLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/detailLog.vue')), |
| | | reportLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue')) |
| | | reportLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue')), |
| | | fireDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireDialog.vue')), |
| | | plateDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateDialog.vue')), |
| | | spaceDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceDialog.vue')), |
| | | hoistDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistDialog.vue')), |
| | | groundDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundDialog.vue')), |
| | | brokenDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenDialog.vue')), |
| | | heightDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightDialog.vue')), |
| | | powerDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerDialog.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const router = useRouter(); |
| | | const reportDialogRef = ref(); |
| | | const fireRef = ref() |
| | | const plateRef = ref() |
| | | const spaceRef = ref() |
| | | const hoistRef = ref() |
| | | const groundRef = ref() |
| | | const brokenRef = ref() |
| | | const heightRef = ref() |
| | | const powerRef = ref() |
| | | const state = reactive<stateType>({ |
| | | pageIndex1: 1, |
| | | pageSize1: 10, |
| | |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | ], |
| | | lists: { |
| | | workerList: [], |
| | | departList: [], |
| | | departList2: [], |
| | | deviceList: [], |
| | | otherWorks: [], |
| | | spList: [], |
| | | riskList: [] |
| | | }, |
| | | dep4List: [ |
| | | {id:49,name:'电石事业部'}, |
| | | {id:50,name:'电力事业部'}, |
| | |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage(); |
| | | getAllDepartment() |
| | | spWorker() |
| | | getAll() |
| | | getAllDevice() |
| | | getAllRisks() |
| | | getOtherWork() |
| | | }); |
| | | |
| | | const openEdit = (row)=>{ |
| | | if(row.workType == 1){ |
| | | fireRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 2){ |
| | | spaceRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 3){ |
| | | hoistRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 4){ |
| | | groundRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 5){ |
| | | brokenRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 6){ |
| | | heightRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 7){ |
| | | powerRef.value.openDialog(row) |
| | | } |
| | | if(row.workType == 8){ |
| | | plateRef.value.openDialog(row) |
| | | } |
| | | } |
| | | |
| | | const spWorker = async ()=>{ |
| | | for(let id of ['17','18','19']){ |
| | | const res = await workApplyApi().getSpList({roleId: id}) |
| | | if(id == '17'){ |
| | | if (res.data.code === '200') { |
| | | state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | if(id == '18'){ |
| | | if (res.data.code === '200') { |
| | | state.lists.spList.jhList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | if(id == '19'){ |
| | | if (res.data.code === '200') { |
| | | state.lists.spList.sfList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 获取用户列表 |
| | | const getAll = async ()=>{ |
| | | const res = await workApplyApi().getAllUsers() |
| | | if (res.data.code === '200') { |
| | | state.lists.workerList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 获取设备列表 |
| | | const getAllDevice = async ()=>{ |
| | | const res = await workApplyApi().getAllDevices() |
| | | if (res.data.code === '200') { |
| | | state.lists.deviceList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // 获取设备列表 |
| | | const getAllRisks = async ()=>{ |
| | | const res = await workApplyApi().getAllRiskIdentity() |
| | | if (res.data.code === '200') { |
| | | // state.allDevices = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.lists.riskList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const giveTime = () => { |
| | | if (state.timeRange && state.timeRange !== null) { |
| | | state.searPara.startTime = state.timeRange[0]; |
| | |
| | | if (res.data.code === '200') { |
| | | state.departmentList = JSON.parse(JSON.stringify(res.data.data)) |
| | | recursion(state.departmentList); |
| | | state.lists.departList = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.lists.departList2 = JSON.parse(JSON.stringify(res.data.data))[0].children[0].children.filter(i=>i.depId == 32 || i.depId == 48 || i.depId == 49 || i.depId == 50) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | const getOtherWork = async () => { |
| | | let res = await workApplyApi().getOtherWork({workPermitNo: '',workType: null}); |
| | | if (res.data.code === '200') { |
| | | state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const recursion = (value: any) => { |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage(); |
| | | getAllDepartment() |
| | | }); |
| | | |
| | | return { |
| | | View, |
| | | Edit, |
| | |
| | | Finished, |
| | | Download, |
| | | reportDialogRef, |
| | | fireRef, |
| | | plateRef, |
| | | spaceRef, |
| | | hoistRef, |
| | | groundRef, |
| | | brokenRef, |
| | | heightRef, |
| | | powerRef, |
| | | openEdit, |
| | | getAllDepartment, |
| | | checkTicket, |
| | | giveTime, |
| | | reLoadData, |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" filterable multiple @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-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 spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <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-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> |
| | |
| | | </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> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // } |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.join(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | 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) |
| | |
| | | </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 spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" filterable multiple @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | |
| | | <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-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> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | console.log(value,state.form.operatorUids,55) |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | console.log(state.form.operatorUids,666) |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2EObj(data.acceptUid) |
| | |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | } |
| | | } else { |
| | |
| | | </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 lists.spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" filterable multiple @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | |
| | | <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-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> |
| | |
| | | </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> |
| | | <el-dialog v-model="dialogVisible"> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | </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 spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" filterable multiple @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12" class="valueSelect"> |
| | |
| | | <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-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> |
| | |
| | | </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> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | </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 spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" filterable multiple @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | |
| | | <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-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> |
| | |
| | | </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> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | <el-row> |
| | | <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 lists.spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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-col :span="12" class="valueSelect"> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" multiple filterable @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | |
| | | <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-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> |
| | |
| | | </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> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用电人" prop="workDetail.electricityUids"> |
| | | <el-select v-model="form.workDetail.electricityUids" multiple clearable> |
| | | <el-select v-model="form.workDetail.electricityUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | |
| | | <el-row> |
| | | <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 lists.spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" multiple filterable @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | | <el-form-item label="绑定执法仪" prop="cameraIds"> |
| | | <el-select v-model="form.cameraIds" multiple clearable> |
| | | <el-select v-model="form.cameraIds" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.deviceList" |
| | | :key="item.id" |
| | |
| | | <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-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> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </div> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | </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 lists.spList.opList"--> |
| | | <!-- :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 lists.spList.opList" |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监护人" prop="guardianUids"> |
| | | <!-- <el-select v-model="form.guardianUids" multiple filterable @change="getSafetyIds" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.spList.jhList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :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-select v-model="form.guardianUids" multiple filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.spList.jhList" |
| | | :key="item.uid" |
| | | :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-col :span="12"> |
| | |
| | | <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-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> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)" v-throttle>提交申报</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </div> |
| | |
| | | workDepId: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | riskIdentification: '', |
| | | riskIdentification: [], |
| | | involveOtherWork: [], |
| | | safetyMeasureUids: [], |
| | | approvalDepBasicList: [], |
| | |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transformArr(data.guardianUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUid = transform2Obj(data.acceptUid) |
| | |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | departList2: [], |
| | | deviceList: [], |
| | | otherWorks: [], |
| | | spList: [] |
| | | spList: [], |
| | | riskList: [] |
| | | }, |
| | | activeName: 'fire', |
| | | allWorkers: [], |
| | |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getAll(); |
| | | getAllDepartment(); |
| | | getAllDevice(); |
| | | getOtherWork(); |
| | | getAll() |
| | | getAllDepartment() |
| | | getAllDevice() |
| | | getOtherWork() |
| | | spWorker() |
| | | getAllRisks() |
| | | }); |
| | | |
| | | // 获取用户列表 |
| | |
| | | } |
| | | }; |
| | | |
| | | // 获取设备列表 |
| | | const getAllRisks = async ()=>{ |
| | | const res = await workApplyApi().getAllRiskIdentity() |
| | | if (res.data.code === '200') { |
| | | // state.allDevices = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.lists.riskList = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | return { |
| | | ...toRefs(state), |
| | | fire, |
| | |
| | | <div class="chart-tit"> |
| | | <span class="tit">作业警报记录</span> |
| | | <div class="filter-part"> |
| | | <el-switch |
| | | v-model="chartSearch4.type" |
| | | inline-prompt |
| | | style="--el-switch-on-color: #13ce66; --el-switch-off-color: #13ce66" |
| | | active-text="作业人" |
| | | inactive-text="监护人" |
| | | /> |
| | | <el-select :teleported="false" v-model="chartSearch4.period" size="small"> |
| | | <el-option label="近7天" value="week"/> |
| | | <el-option label="近30天" value="month"/> |
| | | <el-option label="近90天" value="season"/> |
| | | <el-option label="近1年" value="year"/> |
| | | <!-- <el-switch--> |
| | | <!-- v-model="chartSearch4.type"--> |
| | | <!-- inline-prompt--> |
| | | <!-- style="--el-switch-on-color: #13ce66; --el-switch-off-color: #13ce66"--> |
| | | <!-- active-text="作业人"--> |
| | | <!-- inactive-text="监护人"--> |
| | | <!-- />--> |
| | | <el-select :teleported="false" v-model="chartSearch4.days" size="small" @change="(value)=>changeTime4(value)"> |
| | | <el-option label="近7天" :value="7"/> |
| | | <el-option label="近30天" :value="30"/> |
| | | <el-option label="近90天" :value="90"/> |
| | | <el-option label="近1年" :value="365"/> |
| | | </el-select> |
| | | <el-select :teleported="false" v-model="chartSearch4.workType" size="small"> |
| | | <el-select :teleported="false" v-model="chartSearch4.workType" size="small" @change="changeType4()"> |
| | | <el-option |
| | | v-for="item in workType1" |
| | | :key="item.id" |
| | |
| | | </div> |
| | | <div class="chart"> |
| | | <el-table ref="multipleTableRef" :data="warningData" style="width: 100%" stripe border :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column property="name" label="姓名" align="center"/> |
| | | <el-table-column property="dep" label="所属部门" align="center"/> |
| | | <el-table-column property="warning" label="异常报警次数" align="center"/> |
| | | <el-table-column property="role" label="角色" align="center"/> |
| | | <el-table-column property="isCard" label="是否持证" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.isCard == 1?'是':'否'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="operatorUname" label="姓名" align="center"/> |
| | | <el-table-column property="deptName" label="所属部门" align="center"/> |
| | | <el-table-column property="warningCount" label="异常报警次数" align="center"/> |
| | | <!-- <el-table-column property="role" label="角色" align="center"/>--> |
| | | <!-- <el-table-column property="isCard" label="是否持证" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <span>{{scope.row.isCard == 1?'是':'否'}}</span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | <el-button type="text" size="small" style="margin-top: 10px">所有记录>></el-button> |
| | | <!-- <el-button type="text" size="small" style="margin-top: 10px">所有记录>></el-button>--> |
| | | </div> |
| | | <!-- <div class="chart" :id="slfx"></div>--> |
| | | </div> |
| | |
| | | depId: 1 |
| | | }, |
| | | chartSearch4: { |
| | | searchDep: null, |
| | | startTime: '', |
| | | days: 30 |
| | | days: 30, |
| | | workType: 1 |
| | | }, |
| | | searchDep2: null, |
| | | searchDep: null, |
| | |
| | | ], |
| | | pieData: [], |
| | | squareData: [], |
| | | warningData: [ |
| | | { |
| | | name: '黄公子', |
| | | dep: '有机事业部', |
| | | warning: 69, |
| | | role: '作业人', |
| | | isCard: 1 |
| | | }, |
| | | { |
| | | name: '李飞飞', |
| | | dep: '有机事业部', |
| | | warning: 51, |
| | | role: '监护人', |
| | | isCard: 0 |
| | | }, |
| | | { |
| | | name: '黄公子', |
| | | dep: '有机事业部', |
| | | warning: 69, |
| | | role: '作业人', |
| | | isCard: 1 |
| | | } |
| | | ], |
| | | warningData: [], |
| | | reviewForm: { |
| | | advice: '' |
| | | }, |
| | |
| | | getTypePie() |
| | | getWorkDep() |
| | | getDepMonth() |
| | | getWarningList() |
| | | }); |
| | | const initTime =()=>{ |
| | | state.chartSearch1.startTime = getPeriod(30) |
| | | state.chartSearch2.startTime = getPeriod(30) |
| | | state.chartSearch4.startTime = getPeriod(30) |
| | | state.endTime = formatDate(new Date()) |
| | | } |
| | | const getPeriod =(num)=> { |
| | | const currentDate = new Date(); |
| | | const startTime = new Date(); |
| | | startTime.setDate(currentDate.getDate() - num); |
| | | startTime.setDate(currentDate.getDate() - num - 1); |
| | | return formatDate(startTime) |
| | | } |
| | | const formatDate =(date)=> { |
| | | const year = date.getFullYear().toString(); |
| | | const month = ('0' + (date.getMonth() + 1)).slice(-2); |
| | | const day = ('0' + date.getDate()).slice(-2); |
| | | return `${year}-${month}-${day} 00:00:00`; |
| | | return `${year}-${month}-${day} 23:59:59`; |
| | | } |
| | | const changeTime1=(value:number)=>{ |
| | | state.chartSearch1.startTime = getPeriod(value) |
| | | console.log(state.chartSearch1.startTime,state.endTime,'结束段') |
| | | getTypePie() |
| | | } |
| | | const changeTime4=(value:number)=>{ |
| | | state.chartSearch4.startTime = getPeriod(value) |
| | | console.log(state.chartSearch4.startTime,state.endTime,'结束段') |
| | | getWarningList() |
| | | } |
| | | const changeDep1=()=>{ |
| | | getTypePie() |
| | |
| | | } |
| | | const changeType2=()=>{ |
| | | getWorkDep() |
| | | } |
| | | const changeType4=()=>{ |
| | | getWarningList() |
| | | } |
| | | const changeDep3=()=>{ |
| | | getDepMonth() |
| | |
| | | if (res.data.code === '200') { |
| | | state.workData = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.totalSize = res.data.total |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | const getWarningList = async()=>{ |
| | | const data = { |
| | | startTime: state.chartSearch4.startTime, |
| | | endTime: state.endTime, |
| | | workType:state.chartSearch4.workType |
| | | } |
| | | let res = await specialIndexApi().getWorkWarning(data) |
| | | if (res.data.code === '200') { |
| | | state.warningData = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | slfx, |
| | | zyqs, |
| | | changeTime1, |
| | | changeTime4, |
| | | changeDep1, |
| | | changeDep2, |
| | | changeType2, |
| | | changeType4, |
| | | changeDep3, |
| | | toFullscreen, |
| | | // handleReview, |
| | |
| | | .chart{ |
| | | width: 100%; |
| | | height: 85%; |
| | | overflow-y: scroll; |
| | | .el-table{ |
| | | height: 90% !important; |
| | | :deep(.el-table__inner-wrapper){ |
| | | height: 100% !important; |
| | | .el-table__header-wrapper { |
| | | height: 20% !important; |
| | | .el-table__header{ |
| | | height: 100% !important; |
| | | th{ |
| | | height: 100% !important; |
| | | padding: 0 0 !important; |
| | | .cell{ |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .el-table__body-wrapper { |
| | | height: 80% !important; |
| | | .el-scrollbar__view{ |
| | | height: 100% !important; |
| | | .el-table__body{ |
| | | height: 100% !important; |
| | | tbody{ |
| | | height: 100% !important; |
| | | .el-table__row{ |
| | | height: 25% !important; |
| | | td{ |
| | | height: 25% !important; |
| | | padding: 0 0 !important; |
| | | .left-info{ |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .cell{ |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .el-button{ |
| | | padding: 0 !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //:deep(.el-table__inner-wrapper){ |
| | | // height: 100% !important; |
| | | // .el-table__header-wrapper { |
| | | // height: 20% !important; |
| | | // .el-table__header{ |
| | | // height: 100% !important; |
| | | // th{ |
| | | // height: 100% !important; |
| | | // padding: 0 0 !important; |
| | | // .cell{ |
| | | // white-space: nowrap; |
| | | // overflow: hidden; |
| | | // text-overflow: ellipsis; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // .el-table__body-wrapper { |
| | | // height: 80% !important; |
| | | // .el-scrollbar__view{ |
| | | // height: 100% !important; |
| | | // .el-table__body{ |
| | | // height: 100% !important; |
| | | // tbody{ |
| | | // height: 100% !important; |
| | | // .el-table__row{ |
| | | // height: 25% !important; |
| | | // td{ |
| | | // height: 25% !important; |
| | | // padding: 0 0 !important; |
| | | // .left-info{ |
| | | // display: flex; |
| | | // align-items: center; |
| | | // } |
| | | // .cell{ |
| | | // white-space: nowrap; |
| | | // overflow: hidden; |
| | | // text-overflow: ellipsis; |
| | | // } |
| | | // .el-button{ |
| | | // padding: 0 !important; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | .el-radio-group{ |