修改任务确认流程

This commit is contained in:
qq787203167
2022-05-23 11:19:00 +08:00
parent e22fae8f07
commit e631b10af4
9 changed files with 155 additions and 299 deletions
@@ -17,46 +17,8 @@
<span slot="approvalResult" slot-scope="text,result">
{{approvalResult[text]}}
</span>
<span slot="approvalFile" slot-scope="text,result">
<a v-if="text" @click="clickButtonToUpload(text)">
{{$t('viewFile')}}
</a>
<span v-else>--</span>
</span>
</a-table>
</div>
<a-modal
: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>
</template>
@@ -78,60 +40,41 @@
3: this.$t('issue')
},
columns: [
{
title: this.$t('operationNode'),
dataIndex: 'name',
align: 'center',
width:'20%',
},
{
title: this.$t('Operator'),
dataIndex: 'assignee',
align: 'center',
width:'20%',
},
{
title: this.$t('result'),
dataIndex: 'approvalResult',
align: 'center',
width:'20%',
scopedSlots: { customRender: 'approvalResult' }
},
{
title: this.$t('opinion'),
dataIndex: 'approvalOpinion',
align: 'center'
},
{
title: this.$t('enclosure'),
dataIndex: 'approvalFile',
align: 'center',
scopedSlots: { customRender: 'approvalFile' }
},
{
title: this.$t('operationNode'),
dataIndex: 'name',
align: 'center'
},
{
title: this.$t('Operator'),
dataIndex: 'assignee',
align: 'center'
width:'20%',
},
{
title: this.$t('operationTime'),
dataIndex: 'createTime',
align: 'center',
width:'20%',
customRender: function(t, r, index) {
return moment(t).format('YYYY-MM-DD HH:mm:ss')
}
}
],
visibleFile: false,
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
dataSourceFile: [],
columnsFile: [
{
title: this.$t('enclosure'),
dataIndex: 'fileName',
align: 'center',
width: 260,
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'fileOperation' }
}
]
}
},
mounted() {
@@ -147,46 +90,6 @@
this.dataSource = res
})
},
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
}
})
},
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 })
}
}
}
</script>