| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | //获取附件信息 |
| | | export function getFileInfo(params) { |
| | | return request({ |
| | | url: '/system/management/selectProjectFileList', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 项目审批 |
| | | export function checkProject(data) { |
| | | return request({ |
| | | url: '/system/management/projectCheck', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 项目归档 |
| | | export function archiveProject(data) { |
| | | return request({ |
| | | url: '/system/management/projectArchive', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 文件下载 |
| | | export function downloadFile(params) { |
| | | return request({ |
| | | url: '/common/download', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | |
| | | formData: { |
| | | id:null, |
| | | deptId: null, |
| | | deptName:'危险化学品监督管理处', |
| | | deptName:'', |
| | | projectName: '', |
| | | projectDateStart: '', |
| | | projectDateEnd: '', |
| | |
| | | remark: [{ required: true, message: "概况描述不能为空", trigger: "blur" }], |
| | | } |
| | | }) |
| | | |
| | | const formRef = ref(); |
| | | const userInfo = ref() |
| | | onMounted(() => { |
| | | userInfo.value = JSON.parse(Cookies.get('userInfo')) |
| | |
| | | |
| | | const riskOpen = async (type,val) => { |
| | | console.log("type",type,val) |
| | | let valid = null |
| | | if(type === 'add' || type === 'clickEdit'){ |
| | | valid = await formRef.value.validate(); |
| | | } |
| | | if(type === 'add'){ |
| | | //保存按钮 |
| | | const {id,...data} = state.formData |
| | | const res = await addProject(data); |
| | | if(res.code == 200){ |
| | | ElMessage.success('新增成功') |
| | | emit('getNextStatus', res.data); |
| | | reset() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | if(valid){ |
| | | //保存按钮 |
| | | const {id,...data} = state.formData |
| | | const res = await addProject(data); |
| | | if(res.code == 200){ |
| | | ElMessage.success('新增成功') |
| | | emit('getNextStatus', res.data); |
| | | reset() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | }else if(type === 'clickEdit'){ |
| | | //变更按钮 |
| | | const {...data} = state.formData |
| | | const res = await addProject(data); |
| | | if(res.code == 200){ |
| | | ElMessage.success('修改成功') |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | if(valid){ |
| | | //变更按钮 |
| | | const {...data} = state.formData |
| | | const res = await addProject(data); |
| | | if(res.code == 200){ |
| | | ElMessage.success('修改成功') |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | }else if(type === 'detail'){ |
| | | const res = await getProjectInfo(val) |
| | | if(res.code == 200){ |
| | |
| | | } |
| | | const reset = () => { |
| | | state.formData = { |
| | | id:null, |
| | | deptId: null, |
| | | deptName:'危险化学品监督管理处', |
| | | deptName:'', |
| | | projectName: '', |
| | | projectDateStart: '', |
| | | projectDateEnd: '', |
| | |
| | | const state = reactive({ |
| | | formData: { |
| | | id:null, |
| | | step: 2, |
| | | saveData: [], |
| | | delData: [] |
| | | }, |
| | |
| | | expertId: item.id, |
| | | expertName:item.name, |
| | | selectionMode: 1, |
| | | teamLeader: null |
| | | teamLeader: 0 |
| | | } |
| | | }) |
| | | } |
| | |
| | | expertId: item.id, |
| | | expertName:item.name, |
| | | selectionMode: 2, |
| | | teamLeader: null |
| | | teamLeader: 0 |
| | | } |
| | | }) |
| | | } |
| | |
| | | if(res.code == 200){ |
| | | ElMessage.success('新增成功') |
| | | emit('getNextStatus', val); |
| | | reset() |
| | | // reset() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | |
| | | expertId: item.expertId ? item.expertId : item.id, |
| | | expertName:item.name, |
| | | selectionMode: 1, |
| | | teamLeader: null |
| | | teamLeader: 0 |
| | | } |
| | | }) |
| | | } |
| | |
| | | expertId: item.expertId ? item.expertId : item.id, |
| | | expertName:item.name, |
| | | selectionMode: 2, |
| | | teamLeader: null |
| | | teamLeader: 0 |
| | | } |
| | | }) |
| | | } |
| | |
| | | <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'; |
| | |
| | | <template> |
| | | <div class="archive"> |
| | | <el-form style="display: flex;flex-direction: column" :model="state.dataForm" ref="dataForm" :inline="true" :rules="state.rules" label-width="130px" > |
| | | <el-form-item prop="endTime" label="结束日期:"> |
| | | <el-form ref="formRef" style="display: flex;flex-direction: column" :model="state.dataForm" :inline="true" :rules="state.rules" label-width="130px" > |
| | | <el-form-item prop="projectEndTime" label="结束日期:"> |
| | | <el-date-picker |
| | | v-model="state.dataForm.endTime" |
| | | type="date" |
| | | v-model="state.dataForm.projectEndTime" |
| | | type="datetime" |
| | | placeholder="请选择结束日期" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item prop="description" label="总结描述:"> |
| | | <el-form-item prop="desc" label="总结描述:"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="8" |
| | | v-model.trim="state.dataForm.summarize" |
| | | v-model.trim="state.dataForm.desc" |
| | | size="large" |
| | | placeholder="请输入总结描述" |
| | | > |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {getToken} from "@/utils/auth"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import axios from "axios"; |
| | | import {archiveProject, checkProject, getFileInfo, getProjectInfo} from "@/api/projectManage"; |
| | | |
| | | const emit = defineEmits(["getNextStatus"]); |
| | | const prop = defineProps(['projectId']) |
| | | const projectType = ref('') |
| | | const state = reactive({ |
| | | dataForm: { |
| | | endTime: '', |
| | | summarize:'' |
| | | id: null, |
| | | projectEndTime: '', |
| | | desc:'', |
| | | }, |
| | | rules: { |
| | | description: [{ required: true, message: "总结描述不能为空", trigger: "blur" }], |
| | | endTime:[{ required: true, message: "结束日期不能为空", trigger: "blur" }] |
| | | desc: [{ required: true, message: "总结描述不能为空", trigger: "blur" }], |
| | | projectEndTime:[{ required: true, message: "结束日期不能为空", trigger: "blur" }] |
| | | }, |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '', |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/common/upload', |
| | | header: { |
| | | Authorization: getToken() |
| | | }, |
| | | fileList: [] |
| | | fileList: [], |
| | | projectId: null |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | if(prop.projectId){ |
| | | state.projectId = prop.projectId |
| | | } |
| | | }) |
| | | |
| | | const formRef = ref() |
| | | const riskOpen = async (type,val) => { |
| | | console.log("type",type,val) |
| | | //完结按钮 |
| | | let valid = null |
| | | if(type === 'confirm'){ |
| | | //成功后自动到下一步 项目id |
| | | emit('getNextStatus', 4); |
| | | |
| | | valid = await formRef.value.validate(); |
| | | } |
| | | if(type === 'confirm'){ |
| | | if(valid){ |
| | | state.dataForm.id = state.projectId |
| | | state.dataForm.projectFile = state.fileList |
| | | const res = await archiveProject(state.dataForm); |
| | | if(res.code == 200){ |
| | | ElMessage.success('确认完结') |
| | | emit('getNextStatus', state.projectId); |
| | | // dialogVisible.value = false |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | }else if(type === 'detail' || type === 'view'){ |
| | | if(type === 'view'){ |
| | | projectType.value = type |
| | | } |
| | | console.log("view333333",type,val) |
| | | await getProject() |
| | | await getFile() |
| | | } |
| | | } |
| | | |
| | | const getProject = async () => { |
| | | const res = await getProjectInfo(state.projectId) |
| | | if(res.code === 200) { |
| | | if(res.data) { |
| | | const val = res.data |
| | | for(let i in state.dataForm) { |
| | | if (validKey(i, val)) { |
| | | state.dataForm[i] = val[i] |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | const validKey=(key,obj)=>{ |
| | | return key in obj |
| | | } |
| | | const getFile = async () =>{ |
| | | const param = { |
| | | projectId: state.projectId, |
| | | module: 2 |
| | | } |
| | | 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 handleAvatarSuccess = (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: 2 |
| | | } |
| | | }) |
| | | }else{ |
| | |
| | | }; |
| | | |
| | | 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(() => { |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | <el-table-column label="专家组人数" prop="expertNum" align="center" width="150"/> |
| | | <el-table-column label="当前状态" prop="state" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.state === 0 ? '暂存' : scope.row.state === 1 ? '生成审批单' : scope.row.state === 2 ? '审批通过' :scope.row.state === 3 ?'审批驳回' : '完结' }}</span> |
| | | <span>{{scope.row.state === 0 ? '暂存' : scope.row.state === 1 ? '选取专家' : scope.row.state === 2 ? '生成审批单' :scope.row.state === 3 ?'审批通过' : '完结' }}</span> |
| | | </template> |
| | | </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" @click="toProcess('view',scope.row)">查看</el-button> |
| | | <el-button link type="primary" v-if="scope.row.reportProgress !== 14" @click="toProcess('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="danger" v-if="(isAgency && scope.row.reportProgress !== 14) || (!isAgency && scope.row.reportProgress !== 14)" @click="del(scope.row)">删除</el-button> |
| | | <el-button link type="primary" v-if="scope.row.step !== 4" @click="toProcess('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="danger" v-if="scope.row.step !== 4" @click="del(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <div style="display: flex;align-items: center;justify-content: center;margin-bottom: -30px;margin-top: 10px"> |
| | | <el-button type="primary" v-if="selectedObj.id !== 1" style="width: 80px" @click="back">上一步</el-button> |
| | | <el-button type="warning" style="width: 80px" v-if="(projectStatus === 'add' || projectStatus === 'edit') && selectedObj.status ===1 && selectedObj.id !==4 && selectedObj.id !==3 && newProgress !== 4" @click="save">保存</el-button> |
| | | <el-button type="warning" style="width: 110px" v-if="(projectStatus === 'add' || projectStatus === 'edit') && selectedObj.id !==4 && selectedObj.id ===3 && newProgress !== 4" @click="confirmApproval">确认生成审批单</el-button> |
| | | <el-button type="warning" style="width: 110px" v-if="(projectStatus === 'add' || projectStatus === 'edit') && selectedObj.id !==4 && (selectedObj.id ===3 && selectedObj.status !==2) && newProgress !== 4" @click="confirmApproval">确认生成审批单</el-button> |
| | | <el-button type="warning" style="width: 80px" v-if="projectStatus === 'view' || selectedObj.id ===3 && selectedObj.status === 2" @click="viewWord">查看审批单</el-button> |
| | | <el-button type="warning" style="width: 80px" v-if="(projectStatus === 'add' || projectStatus === 'edit') && selectedObj.status !==1 && selectedObj.id !==3 && newProgress !== 4 " @click="clickEdit">变更</el-button> |
| | | <el-button type="warning" style="width: 80px" v-if="selectedObj.id === 4 && selectedObj.status === 1 && newProgress !== 4" @click="confirm">确认完结</el-button> |
| | | <el-button type="primary" style="width: 80px" v-if="selectedObj.id !== 4" @click="next">下一步</el-button> |
| | | |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | |
| | | |
| | | <script setup> |
| | | import {onMounted, ref} from "vue"; |
| | | import {nextTick, onMounted, ref} from "vue"; |
| | | import status0Png from '@/assets/images/status0.png' |
| | | import status1Png from '@/assets/images/status1.png' |
| | | import status2Png from '@/assets/images/status2.png' |
| | |
| | | } |
| | | break; |
| | | case 2: |
| | | if(type === 'add' || type === 'clickEdit'){ |
| | | expertRef.value.riskOpen(type,projectId.value); |
| | | if(type === 'add' || type === 'clickEdit' || type === 'backTwo'){ |
| | | if(type === 'backTwo'){ |
| | | expertRef.value.riskOpen('detail',projectId.value); |
| | | }else { |
| | | expertRef.value.riskOpen(type,projectId.value); |
| | | } |
| | | }else if(projectStatus.value === 'view' || projectStatus.value === 'edit' || projectStatus.value === 'add'){ |
| | | expertRef.value.riskOpen('detail',projectId.value); |
| | | } |
| | | break; |
| | | case 3: |
| | | if(type === 'add' || type === 'clickEdit' || 'confirmApproval'){ |
| | | approvalRef.value.riskOpen(type,projectId.value); |
| | | if(type === 'add' || type === 'clickEdit' || type === 'confirmApproval' || type === 'viewWord'){ |
| | | approvalRef.value.riskOpen(type,projectId.value); |
| | | }else if(projectStatus.value === 'view' || projectStatus.value === 'edit' || projectStatus.value === 'add'){ |
| | | if(projectStatus.value === 'view'){ |
| | | approvalRef.value.riskOpen('view',projectId.value); |
| | |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | |
| | | } |
| | | |
| | | const backStatus = (id) => { |
| | | //projectId 项目id,根据id获取当前状态 |
| | | const backStatus = async (id) => { |
| | | projectId.value = Number(id) |
| | | //调接口 |
| | | const res = projectId.value |
| | | newProgress.value = res |
| | | //审核不通过状态回到第二步 |
| | | menuList.value.forEach(item => { |
| | | if(item.id <= res){ |
| | | item.status = 2 |
| | | }else if(item.id == res + 1){ |
| | | item.status = 1 |
| | | selectedObj.value =item |
| | | }else if(item.id > res + 1){ |
| | | item.status = 0 |
| | | } |
| | | }) |
| | | const res = await getProjectInfo(projectId.value) |
| | | if(res.code === 200) { |
| | | newProgress.value = res.data.step |
| | | //审核不通过状态回到第二步定位到2 |
| | | menuList.value.forEach(item => { |
| | | if(item.id == newProgress.value){ |
| | | selectedObj.value =item |
| | | } |
| | | if(item.id <= newProgress.value){ |
| | | item.status = 2 |
| | | }else if(item.id == newProgress.value + 1){ |
| | | item.status = 1 |
| | | }else if(item.id > newProgress.value + 1){ |
| | | item.status = 0 |
| | | } |
| | | }) |
| | | await nextTick(() => { |
| | | goRouter(selectedObj.value.id,'backTwo') |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const confirm = () => { |
| | |
| | | const clickEdit = () => { |
| | | goRouter(selectedObj.value.id,'clickEdit') |
| | | } |
| | | |
| | | const viewWord = () => { |
| | | goRouter(selectedObj.value.id,'viewWord') |
| | | } |
| | | |
| | | const clickMenu = (item) => { |
| | | if(item.status == 0){ |
| | | setTimeout(() => { |