监管端上传委托书功能

2024年2月22日v1.0.55^2
liujun 2024-02-04 13:41:56 +08:00
parent e4c0609ac5
commit 352f4cf84d
4 changed files with 66 additions and 20 deletions

View File

@ -0,0 +1,16 @@
export default async function useDownloadFile(url) {
if (!url) throw new Error('没有下载地址')
fetch(config.fileUrl + url)
.then((res) => res.blob())
.then((blob) => {
const a = document.createElement('a')
document.body.appendChild(a)
a.style.display = 'none'
const url = window.URL.createObjectURL(blob)
a.href = url
a.download = url.substring(url.lastIndexOf('/') + 1)
a.click()
document.body.removeChild(a)
window.URL.revokeObjectURL(url)
})
}

View File

@ -7,13 +7,15 @@
title="审批流程"
width="60%">
<el-steps :space="200" :active="list.length" direction="vertical" finish-status="success">
<el-step v-for="item in list" :key="item.FLOW_DETAIL_ID" :value="item.FLOW_DETAIL_ID" :title="item.SORT">
<el-step v-for="item in list" :key="item.FLOW_DETAIL_ID" :value="item.FLOW_DETAIL_ID" :title="item.SORT+''">
<template slot="description">
<el-card class="box-card a" style="width: 900px;">
<div slot="header" class="clearfix">
<span>{{ item.STEP_NAME }}</span>
</div>
<div>
<el-row>
<el-col :span="12">
<el-row>
<el-col v-if="item.APPROVER_NAME">
审批人{{ item.APPROVER_NAME }}
@ -34,6 +36,11 @@
审批结束
</el-col>
</el-row>
</el-col>
<el-col v-if="item.APPOINT_ANNEX" :span="12">
<el-button icon="el-icon-download" type="primary" @click = "download(item)">下载附件</el-button>
</el-col>
</el-row>
</div>
</el-card>
</template>
@ -47,6 +54,7 @@
<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import useDownloadFile from '../../../../utils/useDownloadFile'
export default {
props: {
@ -77,6 +85,9 @@ export default {
},
closeWindow() {
this.handleClose()
},
download(item) {
useDownloadFile(item.APPOINT_ANNEX)
}
}
}

View File

@ -137,6 +137,22 @@
<td>{{ formatLabel(userDetailForm.ISFLOW) }}</td>
</tr>
</table>
<div v-if="userDetailForm.ANNEX" style="padding-bottom: 10px">
<div class="level-title">
<h1>承诺书</h1>
</div>
<div>
<el-button icon="el-icon-download" type="primary" @click = "download(userDetailForm.ANNEX)">下载附件</el-button>
</div>
</div>
<div v-if="userDetailForm.ATTORNEY" style="padding-bottom: 10px">
<div class="level-title">
<h1>委托书</h1>
</div>
<div>
<el-button icon="el-icon-download" type="primary" @click = "download(userDetailForm.ATTORNEY)">下载附件</el-button>
</div>
</div>
<div>
<div class="level-title">
<h1>培训记录</h1>
@ -317,6 +333,7 @@
import vueQr from 'vue-qr'
import dateformat from '@/utils/dateformat'
import { requestFN } from '@/utils/request'
import useDownloadFile from '@/utils/useDownloadFile'
export default {
components: { vueQr },
@ -347,7 +364,6 @@ export default {
},
methods: {
init(e) {
console.log(e)
this.visible = true
this.heirloom = JSON.parse(JSON.stringify(e))
this.getUserInfoById(this.heirloom)
@ -402,6 +418,9 @@ export default {
} else {
return ''
}
},
download(item) {
useDownloadFile(item)
}
}
}

View File

@ -42,8 +42,8 @@
<el-table-column label="操作" align="center" width="350">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleShowStep(row)"></el-button>
<el-button v-if="false" type="primary" icon="el-icon-edit" size="mini" @click="handleShowFlow(row)"></el-button>
<el-button v-if="true" type="primary" icon="el-icon-edit" size="mini" @click="handleShowStep(row)"></el-button>
<el-button v-if="true" type="primary" icon="el-icon-edit" size="mini" @click="handleShowFlow(row)"></el-button>
<el-button v-if="row.power_flag === '1'" type="primary" icon="el-icon-s-claim" size="mini" @click="approve([row])"></el-button>
<el-button v-if="row.power_flag === '1' && row.FLOWS_STEP === 2" type="primary" icon="el-icon-s-claim" size="mini" @click="entrust([row])"></el-button>
<el-button v-if="false" type="success" icon="el-icon-edit" size="mini" @click="getUserInfo(row)"></el-button>