| | |
| | | <template> |
| | | <el-dialog :title="dialogTitle" :visible.sync="visible" width="90%" top="5vh" @open="open" po :close-on-click-modal="false" |
| | | @close="handleClose"> |
| | | <div class="approval-dialog" :style="{height: obj.isDetail ? '80vh' : '60vh'}"> |
| | | <el-dialog :title="dialogTitle" :visible.sync="visible" width="90%" top="5vh" @open="open" po |
| | | :close-on-click-modal="false" @close="handleClose"> |
| | | <div class="approval-dialog" :style="{ height: obj.isDetail ? '80vh' : '60vh' }"> |
| | | <!-- 左侧审批内容 --> |
| | | <div class="approval-content"> |
| | | <Card class="approval-content-card"> |
| | |
| | | </el-form-item> |
| | | |
| | | <div class="header-title" style="width: 100%"> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>附件</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: -18px"> |
| | | <el-upload action="#" :file-list="fileList" :on-preview="handlePreview" disabled> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <div class="header-title-left"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <div>附件</div> |
| | | </div> |
| | | </div> |
| | | <el-form-item prop="name" style="margin-top: -18px"> |
| | | <el-upload action="#" :file-list="fileList" :on-preview="handlePreview" disabled> |
| | | </el-upload> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | </template> |
| | |
| | | |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleClose">{{obj.isDetail ? '关闭' : '取 消'}}</el-button> |
| | | <el-button @click="handleClose">{{ obj.isDetail ? '关闭' : '取 消' }}</el-button> |
| | | <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | import ApprovalProcess from '@/components/approvalProcess' |
| | | import AiEditor from '@/components/AiEditor' |
| | | import { getDetail } from '../../service'; |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | import { customUploadRequest, getFullUrl, getAllocateIp , downloadFileByUrl, isImageFile } from "@/utils/utils"; |
| | | import apiConfig from '@/utils/baseurl'; |
| | | |
| | | |
| | |
| | | methods: { |
| | | getFullUrl, |
| | | handlePreview(file) { |
| | | console.log('url', file) |
| | | if (file && file.url) { |
| | | if (file.url && file.url.startsWith(apiConfig.showImgUrl)) { |
| | | window.open(file.url, '_blank'); |
| | | }else{ |
| | | let newUrl=apiConfig.showImgUrl+file.url; |
| | | window.open(newUrl, '_blank'); |
| | | } |
| | | } |
| | | }, |
| | | if (file && file.url) { |
| | | // 判断是否为图片文件 |
| | | const isImage = isImageFile(file.url); |
| | | |
| | | if (isImage) { |
| | | // 图片文件:使用 window.open 预览 |
| | | if (file.url && file.url.startsWith(getAllocateIp())) { |
| | | console.log('图片链接', file.url) |
| | | window.open(file.url, '_blank'); |
| | | } else { |
| | | let newUrl = getAllocateIp() + file.url; |
| | | console.log('图片链接', newUrl) |
| | | window.open(newUrl, '_blank'); |
| | | } |
| | | } else { |
| | | // 非图片文件:使用下载方式 |
| | | downloadFileByUrl(file.url, file.name); |
| | | } |
| | | } |
| | | }, |
| | | open() { |
| | | if (!this.obj.id) { |
| | | this.$message.error('缺少必要参数'); |
| | |
| | | processData: [] |
| | | }; |
| | | if ( |
| | | data.feasibilityReportFiles && |
| | | data.feasibilityReportFiles.length > 0 |
| | | ) { |
| | | this.fileList = |
| | | data.feasibilityReportFiles.map((file) => { |
| | | return { |
| | | name: file.fileName, |
| | | url: getFullUrl(file.fileUrl), |
| | | uid: file.id, |
| | | }; |
| | | }); |
| | | this.form.feasibilityReportFiles =data.feasibilityReportFiles; |
| | | } else { |
| | | this.fileList = []; |
| | | this.form.feasibilityReportFiles = []; |
| | | } |
| | | data.feasibilityReportFiles && |
| | | data.feasibilityReportFiles.length > 0 |
| | | ) { |
| | | this.fileList = |
| | | data.feasibilityReportFiles.map((file) => { |
| | | return { |
| | | name: file.fileName, |
| | | url: getFullUrl(file.fileUrl), |
| | | uid: file.id, |
| | | }; |
| | | }); |
| | | this.form.feasibilityReportFiles = data.feasibilityReportFiles; |
| | | } else { |
| | | this.fileList = []; |
| | | this.form.feasibilityReportFiles = []; |
| | | } |
| | | |
| | | this.tableData = data.projectTeam ? |
| | | [{ ...data.projectTeam, staffName: data.staffNames || '' }] : |
| | |
| | | .approval-dialog { |
| | | display: flex; |
| | | min-height: 60vh; |
| | | max-height: 80vh; |
| | | max-height: 80vh; |
| | | |
| | | .approval-content { |
| | | flex: 1; |