From 77737f4e73f7267170b9b06fc73d1610c29c0661 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 12 十一月 2024 13:18:35 +0800 Subject: [PATCH] 新增 --- src/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue b/src/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue index 964fca9..b0350df 100644 --- a/src/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue +++ b/src/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue @@ -14,6 +14,14 @@ </el-form-item> </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="报告编号"> + <el-input + v-model="jsaForm.judgeJsaCode" + placeholder="请输入报告编号" + /> + </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-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> @@ -35,11 +43,15 @@ <div class="d-row"> <div class="d-tit">jsa风险研判结论</div><div class="d-cont">{{detail.judgeRecord}}</div> </div> + <div class="d-row" v-if="detail.judgeJsaCode && detail.judgeJsaCode !== ''"> + <div class="d-tit">报告编号</div><div class="d-cont">{{detail.judgeJsaCode}}</div> + </div> <div class="d-row"> <div class="d-tit">风险研判报告记录附件</div> - <div class="d-cont"> + <div class="d-cont" v-if="detail.judgePicturePath"> <el-image v-for="item in detail.judgePicturePath?.split(',')" :preview-src-list="[item]" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="item" fit="cover" /> </div> + <div class="d-cont" v-else>暂无附件</div> </div> <div class="d-row"> <div class="d-tit">研判人</div><div class="d-cont">{{detail.judgeUname}}</div> @@ -67,6 +79,7 @@ jsaForm: { workApplyId: number | null; judgeRecord: string + judgeJsaCode: string judgePicturePath: Array<string> }; jsaFormRules: {}; @@ -86,6 +99,13 @@ setup(props: any, context: any) { const jsaFormRef = ref(); const approveLevelDialogRef = ref(); + const checkFile = (rule: any, value: any, callback: any) => { + if(state.fileList.length == 0){ + callback(new Error("请上传附件")) + } else { + callback(); + } + } const state = reactive<dataState>({ title: '', disabled: true, @@ -93,11 +113,12 @@ jsaForm: { workApplyId: null, judgeRecord: '', + judgeJsaCode: '', judgePicturePath: [] }, jsaFormRules: { judgeRecord: [{ required: true, message: '请填写jsa风险研判结论', trigger: 'blur' }], - judgePicturePath: [{ required: true, message: '请上传风险研判报告附件', trigger: 'blur' }] + judgePicturePath: [{ required: true,validator: checkFile, trigger: 'blur' }] }, fileList: [], imgLimit: 3, @@ -112,10 +133,10 @@ if (type === '上传') { state.disabled = true; state.title = '上传风险研判报告'; - console.log(value.id,'id') state.jsaForm = { workApplyId: value.id, judgeRecord: '', + judgeJsaCode: '', judgePicturePath: [] }; } else { @@ -271,6 +292,7 @@ getReport, submitApproveRule, showReportDialog, + checkFile, handlePreview, getUploadUrl, upload, -- Gitblit v1.9.2