From 8345e399651dcf4b1a00ef0fb924a14b03629525 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Fri, 12 Jan 2024 15:01:52 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9bug79901?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/MainDrafterInitBaseInfo.vue | 10 ++-- .../modules/UpdateListModal.vue | 51 +++++++++++++++---- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/views/workCenter/enterpriseStandardChange/modules/MainDrafterInitBaseInfo.vue b/src/views/workCenter/enterpriseStandardChange/modules/MainDrafterInitBaseInfo.vue index 9323b801..85be2af7 100644 --- a/src/views/workCenter/enterpriseStandardChange/modules/MainDrafterInitBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardChange/modules/MainDrafterInitBaseInfo.vue @@ -527,18 +527,16 @@ export default { }, // 新增修改单 handleAdd () { - // 不知道左侧要预览哪个文件 - const file = '' + const standardId = this.$refs.baseInfoForm.formInline.standardId || '' this.$refs.updateListModal.title = this.$t('newlyAdded') - this.$refs.updateListModal.add(file) + this.$refs.updateListModal.add(standardId) }, // 修改单的编辑 handleEdit (record, index) { - // 不知道左侧要预览哪个文件 - const file = '' + const standardId = this.$refs.baseInfoForm.formInline.standardId || '' this.$refs.updateListModal.title = this.$t('edit') const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index - this.$refs.updateListModal.edit(file, record, dataIndex) + this.$refs.updateListModal.edit(standardId, record, dataIndex) }, // 修改单的删除 handleDelete (index) { diff --git a/src/views/workCenter/enterpriseStandardChange/modules/UpdateListModal.vue b/src/views/workCenter/enterpriseStandardChange/modules/UpdateListModal.vue index d51a307e..48ba2051 100644 --- a/src/views/workCenter/enterpriseStandardChange/modules/UpdateListModal.vue +++ b/src/views/workCenter/enterpriseStandardChange/modules/UpdateListModal.vue @@ -10,8 +10,10 @@
- - + + + +
@@ -81,6 +83,7 @@ import { getFileInfo } from '@/api/api' import { previewPdf } from '@/utils/previewPdf' import Vue from 'vue' import { ACCESS_TOKEN } from '@/store/mutation-types' +import { getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi' const Base64 = require('js-base64').Base64 @@ -90,6 +93,7 @@ export default { return { title: '', visible: false, + leftLoading: true, confirmLoading: false, form: this.$form.createForm(this), model: {}, @@ -144,18 +148,14 @@ export default { } }, methods: { - add (file) { - this.getFileInfo(file).then(res => { - this.handlePreview(res) - }) + add (standardId) { + this.getStandardFile(standardId) this.isAdd = true this.visible = true this.form.resetFields() }, - edit (file, record, index) { - this.getFileInfo(file).then(res => { - this.handlePreview(res) - }) + edit (standardId, record, index) { + this.getStandardFile(standardId) this.visible = true this.index = index this.form.resetFields() @@ -164,6 +164,31 @@ export default { this.form.setFieldsValue(pick(this.model, 'clauseNumber', 'clauseName', 'beforeUpdate', 'afterUpdate', 'updateReason')) }) }, + // 根据企标id查询标准详情数据,为了获取发布稿,修改单左侧预览 + getStandardFile (standardId) { + if (!standardId) { + return + } + this.leftLoading = true + getEnterpriseStandardInfoById({ id: standardId, type: '2' }).then(res => { + if (res.success) { + // 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿 + const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft'] + let fileId = '' + for (const item of fieldArr) { + if (!fileId) { + fileId = res.result[item] ? res.result[item].split(',')[0] : '' + } + } + if (fileId) + this.getFileInfo(fileId).then(res => { + this.handlePreview(res) + }) + } + }).finally(() => { + this.leftLoading = false + }) + }, getFileInfo (fileId) { return new Promise(resolve => { let fileInfo @@ -240,6 +265,12 @@ export default { width: 60%; height: 100%; overflow-y: scroll; + .left-spin { + height: 100%; + } + /deep/ .ant-spin-container { + height: 100%; + } iframe { height: calc(100% - 20px) !important; }