| | |
| | | <el-table-column label="身份证号" prop="idCard" align="center" /> |
| | | <el-table-column label="等级" prop="ratingLevel" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.ratingLevel == 1 ?'一级':scope.row.ratingLevel == 1?'二级':'三级'}}</span> |
| | | <span>{{scope.row.ratingLevel == 1 ?'一级':scope.row.ratingLevel == 2?'二级':scope.row.ratingLevel == 3 ?'三级':''}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="专业领域" prop="domain" align="center" /> |
| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="180"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" v-if="scope.row.teamLeader === 1" @click="scope.row.teamLeader = 0">取消组长</el-button> |
| | | <el-button link type="primary" v-else @click="scope.row.teamLeader = 1">设为组长</el-button> |
| | | <el-button link type="primary" :disabled="state.dataForm.state == 2" v-if="scope.row.teamLeader === 1" @click="scope.row.teamLeader = 0">取消组长</el-button> |
| | | <el-button link type="primary" :disabled="state.dataForm.state == 2" v-else @click="scope.row.teamLeader = 1">设为组长</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <div style="margin-top: 30px"> |
| | | <div style="display: flex"> |
| | | <span style="font-size: 18px;font-weight: 600">审批记录附件:</span> |
| | | <el-upload :disabled="projectType==='view'" accept=".pdf" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='1' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)"> |
| | | <el-upload :disabled="projectType==='view' || isView" accept=".pdf" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='1' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)"> |
| | | <el-button type="primary">上传附件PDF</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传文件尺寸小于5M,最多可上传1份</div> |
| | |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="success" @click="nextStatus">线下审批通过并进行下一步</el-button> |
| | | <el-button type="warning" style="margin-left: 40px;" @click="back">线下审批不通过返回上一步</el-button> |
| | | <el-button type="success" v-if="!isView" @click="nextStatus">线下审批通过并进行下一步</el-button> |
| | | <el-button type="warning" v-if="!isView" style="margin-left: 40px;" @click="back">线下审批不通过返回上一步</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | import {getToken} from "@/utils/auth"; |
| | | import axios from "axios"; |
| | | import {generateWordDocument} from "@/views/safetyReview/projectManage/components/exportWord"; |
| | | import {getCheckInfo, getProjectList} from "@/api/projectManage"; |
| | | import {addProject, checkProject, choose, getCheckInfo, getFileInfo, getProjectList} from "@/api/projectManage"; |
| | | const emit = defineEmits(["getNextStatus","backStatus"]); |
| | | const prop = defineProps(['projectId']) |
| | | const tableRef = ref() |
| | |
| | | projectDateEnd: '', |
| | | projectAddress: '', |
| | | remark: '', |
| | | projectCheckTime: '' |
| | | projectCheckTime: '', |
| | | state: '' |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | if(prop.projectId){ |
| | | state.projectId = prop.projectId |
| | | await getList() |
| | | |
| | | } |
| | | |
| | | }) |
| | | const isView = ref(false) |
| | | |
| | | const riskOpen = async (type,val) => { |
| | | state.fileList = [] |
| | | console.log("type",type,val) |
| | | //生成审批按钮 |
| | | if(type === 'confirmApproval'){ |
| | | isView.value = false |
| | | if(state.dataForm.state == 2){ |
| | | dialogVisible.value = true |
| | | }else { |
| | | const data = { |
| | | id: state.projectId, |
| | | step: 3, |
| | | saveData: state.dataList |
| | | } |
| | | const res = await choose(data); |
| | | if(res.code == 200){ |
| | | dialogVisible.value = true |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | }else if(type === 'viewWord'){ |
| | | //查看审批单 |
| | | isView.value = true |
| | | await getFile() |
| | | dialogVisible.value = true |
| | | |
| | | |
| | | // emit('getNextStatus', 3); |
| | | |
| | | }else if(type === 'clickEdit'){ |
| | | //变更按钮 |
| | | |
| | | }else if(type === 'detail' || type === 'view'){ |
| | | if(type === 'view'){ |
| | | projectType.value = type |
| | | } |
| | | console.log("view333333",type,val) |
| | | await getFile() |
| | | } |
| | | } |
| | | |
| | | const nextStatus = () =>{ |
| | | const nextStatus = async () =>{ |
| | | if(state.fileList && state.fileList.length ===0){ |
| | | state.fileList = [] |
| | | ElMessage({ |
| | |
| | | }) |
| | | return; |
| | | } |
| | | dialogVisible.value = false |
| | | emit('getNextStatus', 3); |
| | | const param = { |
| | | id: state.projectId, |
| | | projectFile: state.fileList, |
| | | state: 3 |
| | | } |
| | | const res = await checkProject(param); |
| | | if(res.code == 200){ |
| | | ElMessage.success('审批通过') |
| | | emit('getNextStatus', state.projectId); |
| | | dialogVisible.value = false |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | |
| | | } |
| | | const back = () => { |
| | | // emit('backStatus', 1);//回到状态1 |
| | | dialogVisible.value = false |
| | | const back = async () => { |
| | | const param = { |
| | | id: state.projectId, |
| | | projectFile: state.fileList, |
| | | state: 1 |
| | | } |
| | | const res = await checkProject(param); |
| | | if(res.code == 200){ |
| | | ElMessage.warning('审批不通过') |
| | | emit('backStatus', state.projectId); |
| | | dialogVisible.value = false |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const getList = async () => { |
| | |
| | | } |
| | | const res = await getCheckInfo(param); |
| | | if(res.code == 200){ |
| | | state.dataList = res.data.projectExpertCheckResp |
| | | state.dataList = res.data.projectExpertCheckResp.map(item => { |
| | | return { |
| | | ...item, |
| | | teamLeader: item.teamLeader ? item.teamLeader : 0 |
| | | } |
| | | }) |
| | | if(res.data) { |
| | | const val = res.data |
| | | for(let i in state.dataForm) { |
| | |
| | | } |
| | | state.dataForm.projectCheckTime = res.data.projectCheckTime ?res.data.projectCheckTime : '' |
| | | } |
| | | console.log('11',state.dataForm) |
| | | state.loading = false; |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | const validKey=(key,obj)=>{ |
| | | return key in obj |
| | | } |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | const handleAvatarSuccess = async (res, uploadFile) => { |
| | | if(res.code == 200){ |
| | | state.fileList = res.data.map(i=>{ |
| | | |
| | | state.fileList = state.fileList.map(item => { |
| | | return { |
| | | name: i.originName, |
| | | url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, |
| | | id: i.id, |
| | | projectId: i.projectId, |
| | | name: item.name, |
| | | filePath: item.response.url, |
| | | fileName:item.response.fileName, |
| | | projectId: state.projectId, |
| | | module: 1 |
| | | } |
| | | }) |
| | | }else{ |
| | |
| | | }) |
| | | } |
| | | } |
| | | const getFile = async () =>{ |
| | | const param = { |
| | | projectId: state.projectId, |
| | | module: 1 |
| | | } |
| | | const res = await getFileInfo(param); |
| | | if(res.code == 200){ |
| | | state.fileList = res.data.map(item => { |
| | | return { |
| | | ...item, |
| | | name: item.originalFileName |
| | | } |
| | | }) |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile) => { |
| | | axios.get(uploadFile.url,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | axios.get(uploadFile.filePath,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | |
| | | }; |
| | | |
| | | const handleRemove = async (file, uploadFile) => { |
| | | if(file && file.status == 'success') { |
| | | ElMessageBox.confirm( |
| | | '确定删除该附件?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(async () => { |
| | | state.fileList = [] |
| | | // const res = await delFile(file.id) |
| | | // if (res.code == 200) { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | // } else { |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: res.message |
| | | // }) |
| | | // } |
| | | }) |
| | | .catch(() => { |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const templatePath = '/example.docx'; |