| | |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="technology" label="审核结论:是否满足过程控制要求"> |
| | | <el-radio-group v-model="state.formData.status" > |
| | | <el-radio :label="1">是</el-radio> |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="附件上传"> |
| | | <el-upload accept="image/*" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="handleAvatarSuccess" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='state.imgLimit' v-model:file-list="state.fileList" list-type="picture-card" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M,最多可上传1张</div> |
| | | </template> |
| | | <el-form-item > |
| | | <el-upload accept=".pdf,.doc,.docx" |
| | | :action="state.uploadUrl" |
| | | :disabled="state.disabled" |
| | | :headers="state.header" |
| | | method="post" |
| | | :on-success="handleAvatarSuccess" |
| | | v-model:file-list="state.fileList" |
| | | :on-remove="handleRemove" |
| | | :data="state.uploadData" |
| | | :on-preview="handlePreview" |
| | | > |
| | | <el-button type="primary">附件上传</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.tableData" :border="true" style="margin: 20px 0"> |
| | | <el-table :data="state.tableData" :border="true" style="margin-bottom: 20px"> |
| | | <el-table-column label="序号" width="60" align="center" type="index"></el-table-column> |
| | | <el-table-column label="过程控制关键点" prop="content" header-align="center" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="审核结果" header-align="center" class-name="small-padding fixed-width" width="175"> |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | import Cookies from "js-cookie" |
| | | import ExpertsList from "./expertsList"; |
| | | import axios from "axios"; |
| | | import {delAccessoryFile} from "@/api/projectManage/project"; |
| | | const emit = defineEmits(["getNextStatus"]); |
| | | |
| | | const state = reactive({ |
| | |
| | | {id: 9, content: '可报过程控制负责人审核', status: 1} |
| | | ], |
| | | imgLimit: 1, |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile', |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/manage/accessory-file/uploadFile', |
| | | header: { |
| | | Authorization: 'Bearer ' + getToken() |
| | | Authorization: getToken() |
| | | }, |
| | | dialogImageUrl: '', |
| | | dialogImg: false |
| | | dialogImg: false, |
| | | uploadData: { |
| | | moduleType: 8 |
| | | }, |
| | | disabled: false |
| | | }) |
| | | const props = { |
| | | expandTrigger: 'hover', |
| | |
| | | if(userInfo.identity === 0){ |
| | | isAmin.value = true; |
| | | } |
| | | if(Cookies.get('projectId')){ |
| | | state.uploadData.projectId = Cookies.get('projectId') |
| | | } |
| | | }) |
| | | |
| | | const riskOpen = async (type,val) => { |
| | | state.uploadData.projectId = val; |
| | | if(type === 'detail' || type === 'edit' ){ |
| | | const res = await getRiskDetail({projectId: val}); |
| | | if(res.code == 200){ |
| | |
| | | state.formData.leaderId = obj.id |
| | | } |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async (rawFile) => { |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | const handleAvatarSuccess = (res) => { |
| | | if(res.code === 200){ |
| | | console.log("if",state.fileList) |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile) => { |
| | | state.dialogImageUrl = uploadFile.url |
| | | state.dialogImg = true |
| | | }; |
| | | |
| | | |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | if(res.code == 200){ |
| | | // state.registerForm.agency.reportPath = res.data.path |
| | | }else{ |
| | | type: 'success', |
| | | message: '文件上传成功' |
| | | }) |
| | | }else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | const handlePreview = (file) => { |
| | | let path = ""; |
| | | if(file.path){ |
| | | path = file.path |
| | | }else { |
| | | path = file.response.data.path |
| | | |
| | | } |
| | | const url = import.meta.env.VITE_APP_BASE_API + '/' + path |
| | | axios.get( url,{ |
| | | 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}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", file.name); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | this.$message.error('获取文件失败') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | const res = await delPic({path: state.registerForm.agency.reportPath}) |
| | | console.log("file",file) |
| | | let accessoryFileId = ""; |
| | | if(file.id){ |
| | | accessoryFileId = file.id |
| | | }else { |
| | | accessoryFileId = file.response.data.id |
| | | |
| | | } |
| | | const res = await delAccessoryFile(accessoryFileId) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |