对接标签申请记录导出

This commit is contained in:
wangchengming 2025-10-16 19:59:32 +08:00
parent 6abfa39b6b
commit 784a8fb2c9
3 changed files with 88 additions and 3 deletions

View File

@ -115,4 +115,14 @@ export function getUserLabels() {
url: '/admin/busUserLabel/getUserLabels',
method: 'post',
})
}
// 标签审核员标签申请记录导出
export function exportBusUserLabel(query) {
return request({
url: '/admin/busUserLabel/export',
method: 'post',
responseType: 'blob',
data: query
})
}

View File

@ -61,6 +61,11 @@
<img :src="importIcon" class="custom-icon" />
导入复训记录
</el-button>
<el-button type="primary" class="qualificationApplyBtn"
v-hasPermi="['labelManage:adminApproval:export']" @click="handleExportExcel">
<img :src="exprotIcon" class="custom-icon" />
导出
</el-button>
</div>
<div class="borderLine"></div>
<el-table v-loading="loading" :data="tableData" height="calc(100% - 220px)" style="width: 100%">
@ -112,8 +117,9 @@ import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import Breadcrumb from '@/components/Breadcrumb'
import importIcon from '@/assets/images/ImportIcon.png'
import exprotIcon from '@/assets/images/exprotIcon.png'
import { customerDeptTreeSelect, listUser } from "@/api/system/user"
import { getUserLabelPageList, deleteBusUserLabel } from "@/api/labelManage/labelManage"
import { getUserLabelPageList, deleteBusUserLabel, exportBusUserLabel } from "@/api/labelManage/labelManage"
const { proxy } = getCurrentInstance()
const { bus_label } = proxy.useDict("bus_label")
@ -218,7 +224,38 @@ const resetQuery = () => {
proxy.resetForm("queryRef")
handleQuery()
}
const getCurrentTime = () => {
//
var getTime = new Date().getTime(); //
var time = new Date(getTime); //
var year = time.getFullYear(); //
var month = (time.getMonth() + 1).toString().padStart(2, '0'); //
var date = time.getDate().toString().padStart(2, '0'); //
var hour = time.getHours().toString().padStart(2, '0'); //
var minute = time.getMinutes().toString().padStart(2, '0'); //
var second = time.getSeconds().toString().padStart(2, '0'); //
var gettime = year + month + date + hour + minute + second
return gettime
}
//
const handleExportExcel = () => {
exportBusUserLabel(queryParams.value).then(res => {
var downFileName = getCurrentTime()
// a
const a = document.createElement('a')
a.href = URL.createObjectURL(res)
// adownload
a.setAttribute(
'download',
downFileName
)
document.body.appendChild(a)
a.click();
document.body.removeChild(a)
proxy.$modal.msgSuccess("导出成功")
})
}
//
const handleDetele = (record) => {
const rowId = record.id

View File

@ -55,7 +55,12 @@
</el-col>
</el-row>
</el-form>
<div class="optionBtn" v-hasPermi="['labelManage:labelEscApproval:export']">
<el-button type="primary" class="qualificationApplyBtn" @click="handleExportExcel">
<img :src="exprotIcon" class="custom-icon" />
导出
</el-button>
</div>
<div class="borderLine"></div>
<el-table v-loading="loading" :data="tableData" height="calc(100% - 176px)" style="width: 100%">
<el-table-column label="序号" width="60">
@ -105,8 +110,9 @@
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import Breadcrumb from '@/components/Breadcrumb'
import exprotIcon from '@/assets/images/exprotIcon.png'
import { customerDeptTreeSelect, listUser } from "@/api/system/user"
import { getUserLabelPageList, deleteBusUserLabel } from "@/api/labelManage/labelManage"
import { getUserLabelPageList, deleteBusUserLabel, exportBusUserLabel } from "@/api/labelManage/labelManage"
const { proxy } = getCurrentInstance()
const { bus_label } = proxy.useDict("bus_label")
@ -211,6 +217,38 @@ const resetQuery = () => {
proxy.resetForm("queryRef")
handleQuery()
}
const getCurrentTime = () => {
//
var getTime = new Date().getTime(); //
var time = new Date(getTime); //
var year = time.getFullYear(); //
var month = (time.getMonth() + 1).toString().padStart(2, '0'); //
var date = time.getDate().toString().padStart(2, '0'); //
var hour = time.getHours().toString().padStart(2, '0'); //
var minute = time.getMinutes().toString().padStart(2, '0'); //
var second = time.getSeconds().toString().padStart(2, '0'); //
var gettime = year + month + date + hour + minute + second
return gettime
}
//
const handleExportExcel = () => {
exportBusUserLabel(queryParams.value).then(res => {
var downFileName = getCurrentTime()
// a
const a = document.createElement('a')
a.href = URL.createObjectURL(res)
// adownload
a.setAttribute(
'download',
downFileName
)
document.body.appendChild(a)
a.click();
document.body.removeChild(a)
proxy.$modal.msgSuccess("导出成功")
})
}
//
const handleDetele = (record) => {
const rowId = record.id