From 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 04 三月 2025 08:39:55 +0800 Subject: [PATCH] 修改作业等级名称 --- src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue | 190 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 137 insertions(+), 53 deletions(-) diff --git a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue index 07f4e5f..327405b 100644 --- a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue +++ b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue @@ -6,6 +6,7 @@ width="900px" draggable :fullscreen="full" + @close="resetForm(ruleFormRef)" > <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> <el-form @@ -166,20 +167,7 @@ </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" style="margin-bottom: 0!important;"> <el-form-item label="预案附件"> - <el-upload - v-model:file-list="fileList" - class="upload-demo" - action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" - :on-change="handleChange" - > - <el-button type="primary" - >点击上传</el-button> - <template #tip> - <div class="el-upload__tip"> - 添加相关附件 - </div> - </template> - </el-upload> + <uploaderFile :fileList="ruleForm.planFileList" :disabled="true"></uploaderFile> </el-form-item> </el-col> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> @@ -367,20 +355,8 @@ </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="附件列表"> - <el-upload - v-model:file-list="ruleForm.userList" - class="upload-demo" - action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" - :on-change="handleChange" - > - <el-button type="primary" - >点击上传</el-button> - <template #tip> - <div class="el-upload__tip"> - 添加相关附件 - </div> - </template> - </el-upload> + <uploaderFile :fileList="fileList" :systemName="'EMERGENCY'" :disabled="disabled" + @successUploader="successUploader"></uploaderFile> </el-form-item> </el-col> </el-row> @@ -420,12 +396,14 @@ import DailogSearchUser from "/@/components/DailogSearchUser/index.vue" import {emergencyDrillEvaluationApi} from "/@/api/contingencyManagement/emergencyDrillEvaluation"; import {goalManagementApi} from "/@/api/goalManagement"; +import uploaderFile from '/@/components/uploaderFile/index.vue'; export default defineComponent({ name: 'approvalProgress', components: { UserSelections, RegionsDialog, - DailogSearchUser + DailogSearchUser, + uploaderFile }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -433,7 +411,7 @@ const ruleFormRef = ref<FormInstance>() //定义表单 const ruleForm = ref ({ - drillPlanId: '', + drillExecuteId: '', suitable: '', sufficient: '', arrival: '', @@ -450,10 +428,29 @@ questionAndImprove: '', modifyContent: '', fileList: [ - { - fileName: 'name', - fileUrl: 'url', - } + ], + userList: [ + ] + }); + //定义表单 + const realRuleForm = ref ({ + drillExecuteId: '', + suitable: '', + sufficient: '', + arrival: '', + supplies: '', + protection: '', + whole: '', + division: '', + effect: '', + report: '', + safety: '', + rescue: '', + evacuate: '', + needModify: '', + questionAndImprove: '', + modifyContent: '', + fileList: [ ], userList: [ ] @@ -492,6 +489,8 @@ ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' } } + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() }); } if(title=='演练实施评价'){ @@ -504,20 +503,32 @@ ruleForm.value.chargeUserListString='' ruleForm.value.executeUserListString='' ruleForm.value.evaluationUserListString='' - for(var a = 0;a<res.data.data.planUserList.length;a++){ - ruleForm.value.planUserListString += res.data.data.planUserList[a].userName+';' + if(res.data.data.planUserList){ + for(var a = 0;a<res.data.data.planUserList.length;a++){ + ruleForm.value.planUserListString += res.data.data.planUserList[a].userName+';' + } } - for(var a = 0;a<res.data.data.planChargeUserList.length;a++){ - ruleForm.value.chargeUserListString += res.data.data.planChargeUserList[a].userName+';' + + if(res.data.data.planChargeUserList){ + for(var a = 0;a<res.data.data.planChargeUserList.length;a++){ + ruleForm.value.chargeUserListString += res.data.data.planChargeUserList[a].userName+';' + } } - for(var a = 0;a<res.data.data.executeUserList.length;a++){ - ruleForm.value.executeUserListString += res.data.data.executeUserList[a].userName+';' + + if(res.data.data.executeUserList){ + for(var a = 0;a<res.data.data.executeUserList.length;a++){ + ruleForm.value.executeUserListString += res.data.data.executeUserList[a].userName+';' + } } //演练负责人(评价) - for(var a = 0;a<res.data.data.evaluationUserList.length;a++){ - ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' + if(res.data.data.evaluationUserList){ + for(var a = 0;a<res.data.data.evaluationUserList.length;a++){ + ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' + } } } + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() }); } if(title=='演练实施查看评价'){ @@ -530,27 +541,65 @@ ruleForm.value.chargeUserListString='' ruleForm.value.executeUserListString='' ruleForm.value.evaluationUserListString='' - for(var a = 0;a<res.data.data.planUserList.length;a++){ - ruleForm.value.planUserListString += res.data.data.planUserList[a].userName+';' + + if(res.data.data.planUserList){ + for(var a = 0;a<res.data.data.planUserList.length;a++){ + ruleForm.value.planUserListString += res.data.data.planUserList[a].userName+';' + } } - for(var a = 0;a<res.data.data.planChargeUserList.length;a++){ - ruleForm.value.chargeUserListString += res.data.data.planChargeUserList[a].userName+';' + + if(res.data.data.planChargeUserList){ + for(var a = 0;a<res.data.data.planChargeUserList.length;a++){ + ruleForm.value.chargeUserListString += res.data.data.planChargeUserList[a].userName+';' + } } - for(var a = 0;a<res.data.data.executeUserList.length;a++){ - ruleForm.value.executeUserListString += res.data.data.executeUserList[a].userName+';' + + if(res.data.data.executeUserList){ + for(var a = 0;a<res.data.data.executeUserList.length;a++){ + ruleForm.value.executeUserListString += res.data.data.executeUserList[a].userName+';' + } } //演练负责人(评价) - for(var a = 0;a<res.data.data.evaluationUserList.length;a++){ - ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' + if(res.data.data.evaluationUserList){ + for(var a = 0;a<res.data.data.evaluationUserList.length;a++){ + ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' + } } + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() } }); } + }; + const initFileListData = async () => { + for(var a = 0;a<ruleForm.value.planFileList.length;a++){ + ruleForm.value.planFileList[a].name = ruleForm.value.planFileList[a].fileName + } + // 事故分析会议纪要 + for(var a = 0;a<fileList.value.length;a++){ + fileList.value[a].name = fileList.value[a].fileName + } + } + // 上传成功组装数据 + const successUploader = (list) =>{ + fileList.value = list + const formFileList = [] + for(var a = 0;a<fileList.value.length;a++){ + formFileList.push( + { + fileName:fileList.value[a].fileName, + fileUrl:'' + } + ) + } + ruleForm.value.fileList = formFileList + } const resetForm = (formEl: FormInstance | undefined) => { isShowDialog.value = false; if (!formEl) return; formEl.resetFields(); + fileList.value = [] }; // 关闭弹窗 const closeDialog = () => { @@ -563,7 +612,7 @@ //日期选择器 const value1 = ref('') // 上传附件 - const fileList = ref<UploadUserFile[]>([]) + const fileList = ref([]) // 可选择树 const treeSelect = ref() const tree = [ @@ -621,8 +670,39 @@ // }) const submitForm = async (title: string, formEl: FormInstance | undefined) => { + if(!ruleForm.value.fileList){ + ruleForm.value.fileList = [] + } //演练负责人(评价) ruleForm.value.userList = ruleForm.value.evaluationUserList + + + + realRuleForm.value.drillExecuteId=ruleForm.value.drillExecuteId + realRuleForm.value.suitable=ruleForm.value.suitable + realRuleForm.value.sufficient=ruleForm.value.sufficient + realRuleForm.value.arrival=ruleForm.value.arrival + realRuleForm.value.supplies=ruleForm.value.supplies + realRuleForm.value.protection=ruleForm.value.protection + realRuleForm.value.whole=ruleForm.value.whole + realRuleForm.value.division=ruleForm.value.division + realRuleForm.value.effect=ruleForm.value.effect + realRuleForm.value.report=ruleForm.value.report + realRuleForm.value.safety=ruleForm.value.safety + realRuleForm.value.rescue=ruleForm.value.rescue + realRuleForm.value.evacuate=ruleForm.value.evacuate + realRuleForm.value.needModify=ruleForm.value.needModify + realRuleForm.value.questionAndImprove=ruleForm.value.questionAndImprove + realRuleForm.value.modifyContent=ruleForm.value.modifyContent + realRuleForm.value.fileList=ruleForm.value.fileList + if(ruleForm.value.userList){ + for(var a = 0;a<ruleForm.value.userList.length;a++){ + realRuleForm.value.userList.push({ + userUid:ruleForm.value.userList[a].userUid, + userName:ruleForm.value.userList[a].userName + }) + } + } // console.log(ruleForm.value.evaluationUserList) // ruleForm.value.userList=[] // for(var a = 0;a<ruleForm.value.evaluationUserList.length;a++){ @@ -634,7 +714,7 @@ if (valid) { // console.log(ruleForm.value) emergencyDrillEvaluationApi() - .editEmergencyDrillEvaluation(ruleForm.value) + .editEmergencyDrillEvaluation(realRuleForm.value) // emergencyDrillExecuteApi() // .editEmergencyDrillExecute(ruleForm.value) .then((res) => { @@ -709,6 +789,7 @@ ) ruleForm.value.evaluationUserListString+=e[a].realName+';' } + console.log(ruleForm.value.evaluationUserList) } //el-tree-select回显 const propse = { @@ -789,7 +870,10 @@ department, newTreeList, selectUser, - submitForm + submitForm, + realRuleForm, + successUploader, + initFileListData }; }, }); -- Gitblit v1.9.2