From 18aff5cd709785bb357ec8c22b4074680cadf0d0 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期一, 19 二月 2024 09:12:42 +0800 Subject: [PATCH] bug修改 --- src/views/safetyReview/projectManage/components/signConfirm.vue | 83 +++++++++++++++++++---------------------- 1 files changed, 39 insertions(+), 44 deletions(-) diff --git a/src/views/safetyReview/projectManage/components/signConfirm.vue b/src/views/safetyReview/projectManage/components/signConfirm.vue index 18b5ff9..49269a0 100644 --- a/src/views/safetyReview/projectManage/components/signConfirm.vue +++ b/src/views/safetyReview/projectManage/components/signConfirm.vue @@ -1,7 +1,7 @@ <template> <div class="riskBox"> <el-table v-loading="loading" ref="tableRef" :data="tableData" :border="true"> - <el-table-column type="index" width="55" /> + <el-table-column label="序号" type="index" width="55" /> <el-table-column label="人员姓名" prop="person.name" align="center"/> <el-table-column label="联系电话" prop="person.phone" align="center"/> <el-table-column label="职位" prop="person.post" align="center"/> @@ -41,7 +41,7 @@ :preview-src-list="scope.row.facePic" :initial-index="0" fit="cover" - preview-teleported="true" + :preview-teleported=true /> </div> </template> @@ -58,30 +58,34 @@ :preview-src-list="scope.row.signPic" :initial-index="0" fit="cover" - preview-teleported="true" + :preview-teleported=true /> </div> </template> </el-table-column> <el-table-column label="承诺书" prop="socialSecurity" align="center" width="120"> <template #default="scope"> -<!-- <el-button link>承诺书</el-button>--> + <div class="demo-image__preview" v-if="scope.row.commitPic && scope.row.commitPic.length>0"> + <el-image + style="width: 100px; height: 100px" + :src= "scope.row.commitPic[0]" + :zoom-rate="1.2" + :max-scale="7" + :min-scale="0.2" + :preview-src-list="scope.row.commitPic" + :initial-index="0" + fit="cover" + :preview-teleported=true + /> + </div> </template> </el-table-column> </el-table> - - <pagination - v-show="total > 0" - :total="total" - v-model:page="queryParams.pageNum" - v-model:limit="queryParams.pageSize" - @pagination="getList" - /> </div> </template> <script setup> -import {defineEmits, onMounted, reactive, ref, toRefs} from "vue"; +import {defineEmits, defineProps, onMounted, reactive, ref, toRefs} from "vue"; import {ElMessage} from "element-plus"; import {Search} from '@element-plus/icons-vue' import { @@ -96,7 +100,7 @@ import Cookies from "js-cookie" import {getDetail} from "@/api/projectManage/contractMng"; const emit = defineEmits(["getNextStatus"]); - +const props = defineProps(['projectId']) const state = reactive({ loading: false, queryParams: { @@ -116,8 +120,8 @@ if(userInfo.identity === 0){ isAmin.value = true; } - if(Cookies.get('projectId')){ - getRecognition(Cookies.get('projectId')); + if(props.projectId){ + getRecognition(props.projectId); } }) const getRecognition = async (val) =>{ @@ -128,6 +132,7 @@ ...item, facePic: item.faceRecord ? [import.meta.env.VITE_APP_BASE_API + '/' + item.faceRecord.facePath ] : [], signPic: item.signPath ? [import.meta.env.VITE_APP_BASE_API + '/' + item.signPath] : [], + commitPic: item.insurancePath ? [import.meta.env.VITE_APP_BASE_API + '/' + item.insurancePath] : [], planPerson: { playRole: item.planPerson ? item.planPerson.playRole : '', jobType: item.planPerson ? item.planPerson.jobType : '', @@ -143,39 +148,29 @@ const riskOpen = async (type,val) => { - if((type === 'detail' || type === 'edit') && !Cookies.get('projectId')){ - getRecognition(val); - } + // if((type === 'detail' || type === 'edit') && !props.projectId){ + // getRecognition(val); + // } if(type === 'add' || type === 'clickEdit') { - if (isAmin.value) { - ElMessage.warning("当前用户暂无权限"); - return; - } - if(type === 'add'){ - const resCheck = await checkAll({projectId: val}); - if (resCheck.code == 200) { - const res = await addFaceRecognition({projectId: val}); - if (res.code == 200) { - ElMessage.success('保存成功') - formRef.value.clearValidate(); - emit('getNextStatus', val); - } else { - ElMessage.warning(res.message) - } + if (isAmin.value) { + ElMessage.warning("当前用户暂无权限"); + return; + } + if(type === 'add'){ + const resCheck = await checkAll({projectId: val}); + if (resCheck.code == 200) { + const res = await addFaceRecognition({projectId: val}); + if (res.code == 200) { + ElMessage.success('保存成功') + formRef.value.clearValidate(); + emit('getNextStatus', val); } else { ElMessage.warning(res.message) } - }else if(type === 'clickEdit'){ - // const { ...data} = JSON.parse(JSON.stringify(state.formData)) - // const res = await editRisk(data); - // if (res.code == 200) { - // ElMessage.success('变更成功') - // formRef.value.clearValidate(); - // // emit('getNextStatus', data.project.id); - // } else { - // ElMessage.warning(res.message) - // } + } else { + ElMessage.warning(res.message) } + } } } -- Gitblit v1.9.2