From 28451a6343bfdb1aff4508b2adc23e38c167a4cb Mon Sep 17 00:00:00 2001 From: shen_yan_pu <1975145892@qq.com> Date: Tue, 3 Aug 2021 16:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=AC=A6=E5=90=88=E9=A1=B9=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/creatProcess/wfhxzg/step1.vue | 18 ++- .../pages/creatProcess/wfhxzg/step4.vue | 126 ++++++++++-------- .../pages/creatProcess/wfhxzg/step5.vue | 59 +++++++- 3 files changed, 142 insertions(+), 61 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue index 49068ff27..7d0b0fe66 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue @@ -265,7 +265,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import { startProcess, completeTask, saveTaskFirst } from '@/api/process.js' +import { startProcess, completeTask, saveTaskFirst, queryTaskFirst } from '@/api/process.js' import { standUnqualified, dicTypeData } from '@/api/unqualProcess.js' export default { name: "wfhxzgStep1", @@ -322,7 +322,23 @@ export default { ProcessFooter, ProcessTitle }, + mounted() { + this.bpnId = this.$route.query.bpnId + if (this.bpnId !== undefined) { + this.getData() + } + }, methods: { + getData() { + queryTaskFirst({ + bpnId: this.$route.query.bpnId + }).then(res => { + let mes = JSON.parse(res.mes); + this.dataList = mes.dataList; + this.roleForm = mes.roleForm; + this.commentText = mes.commentText; + }); + }, //点击新增事件 addList() { dicTypeData().then(res => { diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue index b5827c953..df0c6c866 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue @@ -13,7 +13,7 @@ 基础信息 - + + + + {{ scope.row.standSerialNumber }} + + + + + {{ scope.row.standName }} + + @@ -97,32 +107,30 @@ - + - - - - {{ scope.row.fileText }} - - + 点击上传 - - + - @@ -214,23 +222,6 @@ @submit="handleSubmit" > - - - - - 点击或拖拽上传文件 - - - @@ -238,7 +229,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {interfaceUrl} from "@/sysConfig"; +import {uploadFile} from '@/api/unqualProcess.js'; import {inboundLiaisonDetail, completeTask} from "@/api/process" export default { @@ -268,6 +259,8 @@ export default { // 上传路径 uploadPath: 'api/att/attFile/upload', fileMadel: false, + // 上传所储存文件数组 + fileTextList: [], newDataList: [], // 责任部门 zNodesSItem: [], @@ -315,12 +308,18 @@ export default { this.$nextTick(() => { this.dataList = [JSON.parse(JSON.stringify(item.responUserInfo.info))] - /*for (let i = 0; i { + if (item.fileText.length !== 0) { + item.fileText.forEach(item1 => { + this.fileTextList.push({ + id: item1.id, + name: item1.name + }) + }) } - }*/ + }) }) }, @@ -328,16 +327,22 @@ export default { this.active = name }, /************ 上传佐证材料 *****************/ - fileUpload (val) { - this.newDataList = val - this.fileMadel = true + uploadFile (val) { + this.fileListData = val }, // 文件上传成功 handleOnsuccess(res, file, fileList) { if (res.ok) { - this.newDataList.fileText = res.data.name - this.newDataList.fileTextId = res.data.id - this.newDataList.fileTextPath = res.data.filePath + this.newDataList.push({ + id: res.data.attId, + name: res.data.standName + }) + this.newDataList.forEach(item =>{ + this.fileListData.fileText.push({ + id: item.id, + name: item.name + }) + }) this.$message({ showClose: true, message: res.message, @@ -374,13 +379,28 @@ export default { return true }, // 移除上传的文件 - handleBeforeRemove() {}, - handleOnRemove() {}, - // 文件超过限制数量提示 - handleExceed() { - this.$message.error(``) + handleBeforeRemove(file, fileList) { + this.fileTextList = fileList + this.newDataList.forEach((item, index) => { + if (file.name === item.name || file.id === item.id) { + this.newDataList.splice(index, 1) + } + }) }, + /************ ********* *****************/ + // 点击查看 + handlePreview (item) { + let routeUrl = this.$router.resolve({ + name: 'OtherStandardDetails', + params: { + id: item.standId, + pageType: 'FOREIGN_STAND' + // pageType: item.standType + '_STAND' + } + }) + window.open(routeUrl.href, '_blank') + }, // 保存按钮 handleSave() {}, // 提交按钮 @@ -388,7 +408,7 @@ export default { this.isSubmit = true let flag=false this.dataList.forEach(item => { - if (item.fileText === '') { + if (item.fileText.length === 0) { flag=true this.isSubmit = false } diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step5.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step5.vue index 389c2dc99..073001399 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step5.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step5.vue @@ -13,7 +13,7 @@ 基础信息 - + + + + {{ scope.row.standSerialNumber }} + + + + + {{ scope.row.standName }} + + @@ -96,14 +106,19 @@ - - + + - {{scope.row.fileText}} + + - @@ -222,6 +237,7 @@ export default { productName: '', // 项目名称 responsibleUnit: '' // 责任部门 }, + fileTextList: [], active: '1', // 默认显示 isSubmit: false, backLoading: false, @@ -281,13 +297,39 @@ export default { getFormFieldList (item) { this.$nextTick(() => { this.dataList = JSON.parse(JSON.stringify(item)).info.fileDataList + this.dataList.forEach(item => { + item.fileText.forEach(item1 => { + this.fileTextList.push({ + id: item1.id, + name: item1.name + }) + }) + }) }) }, handleTabs(name) { this.active = name }, - + // 点击查看 + handlePreview (item) { + let routeUrl = this.$router.resolve({ + name: 'OtherStandardDetails', + params: { + id: item.standId, + pageType: 'FOREIGN_STAND' + // pageType: item.standType + '_STAND' + } + }) + window.open(routeUrl.href, '_blank') + }, + // 点击上传的文件进行下载 + handleOnPreview(file) { + let attId = file.id + if (attId != null && attId !== "") { + window.location.href = "/api/att/attFile/downloadFileForSar?fileId=" + attId; + } + }, // 提交按钮 handleSubmit() { this.isSubmit = true @@ -407,6 +449,9 @@ export default { background: #E6A23C; } } + /deep/.el-upload{ + display: block; + } .content-center { padding: 10px 0px 10px 10px; }
点击或拖拽上传文件