对接设计符合性确认

This commit is contained in:
qq787203167
2022-05-09 14:23:24 +08:00
parent 799dd3d50a
commit a73e64daab
4 changed files with 297 additions and 130 deletions
@@ -0,0 +1,113 @@
<template>
<a-modal
:title="$t('viewFile')"
:width="600"
:visible="visibleFile"
:maskClosable="false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
:pagination="false"
:scroll="{x:500,y: 400}"
:data-source="dataSourceFile"
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
</a>
</span>
</a-table>
</a-modal>
</template>
<script>
import { Base64 } from 'js-base64'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
export default {
name: 'viewFileModel',
data() {
return {
dataSourceFile: [],
loading: false,
visibleFile:false,
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
columnsFile: [
{
title: this.$t('fileName'),
dataIndex: 'fileName',
align: 'center',
width: 260,
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'fileOperation' }
}
]
}
},
methods: {
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.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
this.loading = false
}
})
}
}
}
</script>
<style scoped>
</style>
@@ -27,11 +27,16 @@
:data-source="dataSource" :data-source="dataSource"
:columns="columns" :columns="columns"
> >
<span slot="Deliverables" slot-scope="text,result">
<a @click="viewFileClick(result.fileId)" v-if="result.fileId">
{{$t('viewFile')}}
</a>
</span>
<span slot="operation" slot-scope="result"> <span slot="operation" slot-scope="result">
<a class="text" @click="edit(result,$t('edit'))">{{$t('edit')}}</a> <a class="text" @click="edit(result,$t('edit'))">{{$t('edit')}}</a>
<a class="text" @click="detailsClick(result)">{{$t('details')}}</a> <a class="text" @click="detailsClick(result)">{{$t('details')}}</a>
<a class="text" @click="answerClick(result,$t('replyFromProjectContactPerson'))">{{$t('answer')}}</a> <a class="text" @click="answerClick(result,$t('replyFromProjectContactPerson'))">{{$t('answer')}}</a>
<a class="text">{{$t('deleteLib')}}</a> <a class="text" @click="deleted(result)">{{$t('deleteLib')}}</a>
</span> </span>
</a-table> </a-table>
<a-modal <a-modal
@@ -52,12 +57,12 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('engineer')">{{$t('engineer')}}</span> :title="$t('engineer')">{{$t('engineer')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="userName">
<PersonnelSelection <PersonnelSelection
:query="{db_field_name:'certificationEngineer',db_field_txt:$t('engineer')}" :query="{db_field_name:'userId',db_field_txt:$t('engineer')}"
:personneQuery="formInline" :personneQuery="formInline"
@change="PersonnelSelectionChange" @change="PersonnelSelectionChange"
v-model="formInline.certificationEngineerName"/> v-model="formInline.userName"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -129,7 +134,7 @@
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
<div class="text-field-right"> <div class="text-field-right">
{{this.formInlineDetails.engineerFeedbackContent}} {{formInlineDetails.engineerFeedbackContent}}
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
@@ -138,12 +143,10 @@
<div class="text-field-left">{{this.$t('Deliverables')}}:</div> <div class="text-field-left">{{this.$t('Deliverables')}}:</div>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
<a-button type="primary" class="button-text" <div v-if="formInlineDetails.fileId" class="text-field-right text-field-cou"
@click="clickButtonToUploadDetails('fileId')"> @click="viewFileClick(formInlineDetails.fileId)">
{{ (formInlineDetails.fileId === 'null' || formInlineDetails.fileId === '' || {{this.$t('viewFile')}}
formInlineDetails.fileId == null) ? $t('clickUpload') : $t('viewUploadedFiles') </div>
}}
</a-button>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24" style="margin-bottom: 18px"> <a-row :gutter="24" style="margin-bottom: 18px">
@@ -198,35 +201,39 @@
:columns="columnsTable" :columns="columnsTable"
> >
<span slot="operationTable" slot-scope="result"> <span slot="operationTable" slot-scope="result">
<a>{{$t('reminder')}}</a> <a @click="reminderClick(result)">{{$t('reminder')}}</a>
</span> </span>
</a-table> </a-table>
</a-modal> </a-modal>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/> <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
<uploadFile ref="uploadFileDetails" :disabled="true"/> <viewFileModel ref="viewFileModelRef"/>
</div> </div>
</template> </template>
<script> <script>
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, putAction } from '@/api/manage' import { getAction, postAction, putAction, deleteAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file' import uploadFile from '@/components/uploadFile/file'
import viewFileModel from '@/components/viewFileModel/index'
import { Base64 } from 'js-base64'
export default { export default {
name: 'engineeringConfirmation', name: 'engineeringConfirmation',
components: { components: {
PersonnelSelection, PersonnelSelection,
uploadFile uploadFile,
viewFileModel
}, },
data() { data() {
return { return {
loading: false, loading: false,
dataSource: [{}], visibleFile: false,
dataSource: [],
dataSourceTable: [], dataSourceTable: [],
columnsTable: [ columnsTable: [
{ {
title: this.$t('engineer'), title: this.$t('engineer'),
dataIndex: 'engineer', dataIndex: 'userName',
align: 'center' align: 'center'
}, },
{ {
@@ -274,6 +281,13 @@
message: this.$t('Deliverables') + this.$t('cannotEmpty'), message: this.$t('Deliverables') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
],
userName: [
{
required: true,
message: this.$t('engineer') + this.$t('cannotEmpty'),
trigger: 'change'
}
] ]
}, },
visibleDetails: false, visibleDetails: false,
@@ -293,7 +307,8 @@
{ {
title: this.$t('Deliverables'), title: this.$t('Deliverables'),
dataIndex: 'fileId', dataIndex: 'fileId',
align: 'center' align: 'center',
scopedSlots: { customRender: 'Deliverables' }
}, },
{ {
title: this.$t('completedBy'), title: this.$t('completedBy'),
@@ -329,11 +344,60 @@
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
}, },
methods: { methods: {
handleOk() { handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
if (this.title == this.$t('addFeedback')) {
this.feedbackData(this.url.add, postAction)
} else if (this.title == this.$t('edit')) {
this.feedbackData(this.url.edit, putAction)
} else if (this.title == this.$t('replyFromProjectContactPerson')) {
this.feedbackData(this.url.edit, putAction)
} else if (this.title == this.$t('distributionEngineer')) {
this.distributionEngineer(this.url.edit, putAction)
}
}
})
},
distributionEngineer() {
let query = {
status: 'NotDone',
actiProcInstId: this.$route.query.actiProcInstId,
projectTaskInventoryId: this.$route.query.id,
flowType: '2',
userIds: this.formInline.userId,
taskDefinitionKey: 'dreDispose'
}
postAction(this.url.DetailEOAdd, query).then((res) => {
if (res.success) {
if (res.success) {
this.confirmLoading = false
this.getList()
this.visible = false
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
}
})
},
feedbackData(url, Action) {
this.confirmLoading = true
Action(url, this.formInline).then((res) => {
if (res.success) {
this.confirmLoading = false
this.getList()
this.visible = false
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
@@ -342,9 +406,38 @@
this.title = title this.title = title
this.visible = true this.visible = true
this.formInline = {} this.formInline = {}
this.$nextTick(() => {
this.$refs.ruleForm.validateField()
})
}, },
reminderHandling() { reminderHandling() {
this.visibleTable = true this.visibleTable = true
this.getReminderHandlingList()
},
getReminderHandlingList() {
this.loadingTable = true
getAction(this.url.queryByActiProcInstId, { actiProcInstId: this.$route.query.actiProcInstId }).then((res) => {
if (res.success) {
this.dataSourceTable = res.result || []
this.loadingTable = false
} else {
this.dataSourceTable = []
this.loadingTable = false
}
})
},
reminderClick(val) {
let query = {
msgType: 'designRemindMsg',
projectLibraryId: this.$route.query.projectLibraryId,
dreUserIds: val.userId,
serialNumber: this.$route.query.serialNumber
}
postAction(this.url.remindDispose, query).then((res) => {
if (res.success) {
}
})
}, },
detailsClick(val) { detailsClick(val) {
this.formInlineDetails = val this.formInlineDetails = val
@@ -357,12 +450,18 @@
edit(val, title) { edit(val, title) {
this.title = title this.title = title
this.visible = true this.visible = true
this.formInline = val this.formInline = JSON.parse(JSON.stringify(val))
this.$nextTick(() => {
this.$refs.ruleForm.validateField()
})
}, },
answerClick(val, title) { answerClick(val, title) {
this.title = title this.title = title
this.visible = true this.visible = true
this.formInline = val this.formInline = JSON.parse(JSON.stringify(val))
this.$nextTick(() => {
this.$refs.ruleForm.validateField()
})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
@@ -376,18 +475,6 @@
} }
}) })
}, },
clickButtonToUploadDetails(item) {
this.$refs.uploadFileDetails.perentHandleFunc()
this.$refs.uploadFileDetails.visible = true
this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFileDetails.perentHandleFunc(res.result)
} else {
this.$refs.uploadFileDetails.perentHandleFunc()
}
})
},
/** 上传文件的回调 */ /** 上传文件的回调 */
uploadSuccess(data) { uploadSuccess(data) {
let attIdList = [] let attIdList = []
@@ -399,10 +486,44 @@
/** 赋值给当前对应的表单文件 */ /** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',') this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.$nextTick(() => {
this.$refs.ruleForm.validateField([this.uploadName])
})
}, },
getList(){ getList() {
let query = {
actiProcInstId: this.$route.query.actiProcInstId
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.loading = false
this.dataSource = res.result || []
} else {
this.loading = false
this.dataSource = []
}
})
}, },
deleted(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleted, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
viewFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
}
} }
} }
</script> </script>
@@ -506,7 +627,6 @@
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
color: #6F7385; color: #6F7385;
margin-top: 4px;
} }
.text-field-right { .text-field-right {
@@ -514,4 +634,9 @@
color: #040B29; color: #040B29;
font-weight: 400; font-weight: 400;
} }
.text-field-cou {
color: #00B3BE !important;
cursor: pointer;
}
</style> </style>
@@ -24,38 +24,7 @@
>{{queryForm[item.value]}}</span> >{{queryForm[item.value]}}</span>
</div> </div>
</div> </div>
<a-modal <viewFileModel ref="viewFileModelRef"/>
:title="$t('deliverableTemplate')"
:width="600"
:visible="visibleFile"
:maskClosable="false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
:pagination="false"
:scroll="{x:500,y: 400}"
:data-source="dataSourceFile"
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
</a>
</span>
</a-table>
</a-modal>
</div> </div>
</template> </template>
<!-- <!--
@@ -67,6 +36,7 @@
<script> <script>
import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import viewFileModel from '@/components/viewFileModel/index'
export default { export default {
name: 'standardContent', name: 'standardContent',
@@ -86,32 +56,16 @@
default: {} default: {}
} }
}, },
components: {
viewFileModel
},
data() { data() {
return { return {
queryForm: {}, queryForm: {}
visibleFile: false,
dataSourceFile: [],
loading: false,
columnsFile: [
{
title: this.$t('deliverableTemplate'),
dataIndex: 'fileName',
align: 'center',
width: 260,
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'fileOperation' }
}
]
} }
}, },
mounted() { mounted() {
this.queryForm = this.standardContentQuery this.queryForm = this.standardContentQuery
console.log(this.queryForm)
}, },
methods: { methods: {
urlClick(val) { urlClick(val) {
@@ -119,45 +73,8 @@
window.open(val) window.open(val)
} }
}, },
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) { clickButtonToUpload(item) {
this.loading = true this.$refs.viewFileModelRef.clickButtonToUpload(item)
this.visibleFile = true
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
this.loading = false
}
})
} }
} }
} }
@@ -212,17 +212,29 @@
switch (num) { switch (num) {
case 1: case 1:
query = { query = {
taskIds: val.designTaskId taskIds: val.designTaskId,
actiProcInstId: val.designPId,
id: val.id,
projectLibraryId: this.$route.query.id,
serialNumber: val.serialNumber
} }
break break
case 2: case 2:
query = { query = {
taskIds: val.prehomoTaskId taskIds: val.prehomoTaskId,
actiProcInstId: val.prehomoPId,
id: val.id,
projectLibraryId: this.$route.query.id,
serialNumber: val.serialNumber
} }
break break
case 3: case 3:
query = { query = {
taskIds: val.verifyTaskId taskIds: val.verifyTaskId,
actiProcInstId: val.verifyPId,
id: val.id,
projectLibraryId: this.$route.query.id,
serialNumber: val.serialNumber
} }
break break
} }