From 50b23ad11c2b238d6235123361f1c4ebfb9c694c Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Mon, 18 Apr 2022 18:59:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=9A=84=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/listOfRegulations.vue | 119 +++++++++++++++++- 1 file changed, 114 insertions(+), 5 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 78d2bce33..ccfe2ec5f 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -118,6 +118,35 @@ {{$t('edit')}} {{$t('deleteLib')}} + + {{record.designDeliverableType_dictText}}
+ > + {{record.designDeliverableTemplate}} + + {{$t('viewFile')}} + -- +
+ + {{record.prehomoDeliverableType_dictText}}
+ + {{record.prehomoDeliverableTemplate}} + + {{$t('viewFile')}} + -- +
+ + {{record.verifyDeliverableType_dictText}}
+ > + {{record.verifyDeliverableTemplate}} + + {{$t('viewFile')}} + -- +
@@ -153,6 +182,32 @@ + + + + + {{$t('See')}} + + + {{$t('download')}} + + + + @@ -163,6 +218,7 @@ import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import moment from 'moment' import { mapGetters } from 'vuex' + import { Base64 } from 'js-base64' export default { name: 'listOfRegulations', @@ -296,7 +352,8 @@ { title: this.$t('Deliverables'), dataIndex: 'designDeliverableTemplateName', - align: 'center' + align: 'center', + scopedSlots: { customRender: 'designDeliverableTemplateName' } }, { title: this.$t('Sponsor'), @@ -321,7 +378,8 @@ { title: this.$t('Deliverables'), dataIndex: 'prehomoDeliverableTemplateName', - align: 'center' + align: 'center', + scopedSlots: { customRender: 'prehomoDeliverableTemplateName' } }, { title: this.$t('Sponsor'), @@ -346,7 +404,8 @@ { title: this.$t('Deliverables'), dataIndex: 'verifyDeliverableTemplateName', - align: 'center' + align: 'center', + scopedSlots: { customRender: 'verifyDeliverableTemplateName' } }, { title: this.$t('Sponsor'), @@ -373,6 +432,23 @@ scopedSlots: { customRender: 'operation' } } ], + columnsFile: [ + { + title: this.$t('deliverableTemplate'), + dataIndex: 'fileName', + align: 'center', + width: 260, + ellipsis: true + }, + { + title: this.$t('operation'), + align: 'center', + width: 130, + scopedSlots: { customRender: 'fileOperation' } + } + ], + visibleFile: false, + dataSourceFile: [], confirmLoading: false, isDisplay: true, selectedRowKeys: [], @@ -548,11 +624,11 @@ if (this.dataSource[i].id == value[j]) { if (this.dataSource[i].roleCode == 1 && this.dataSource[i].regulationOwnerSubmitStatus) { isTrue = false - this.$message.warning(this.$t('The') + (i+1) + this.$t('submitted')) + this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted')) break } else if (this.dataSource[i].roleCode == 2 && this.dataSource[i].homologationEngineerSubmitStatus) { isTrue = false - this.$message.warning(this.$t('The') + (i+1) + this.$t('submitted')) + this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted')) break } } @@ -604,6 +680,39 @@ }, dateChange(item) { this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : '' + }, + pdfPreview(fileQuery) { + let fileName = fileQuery.fileName + let index1 = fileName.lastIndexOf('.') + let index2 = fileName.length + let fileSuffix = fileName.substring(index1, index2) + if (fileSuffix == '.pdf') { + window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) + } else if (fileSuffix == '.docx') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') + } else { + downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) + } + }, + download(item) { + downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) + }, + clickButtonToUpload(item) { + this.loading = true + this.visibleFile = true + getAction('sys/common/getFileInfos', { id: item }).then((res) => { + if (res.success) { + this.dataSourceFile = res.result + this.loading = false + } else { + this.dataSourceFile = [] + this.loading = false + } + }) } } }