add:新增导出功能

This commit is contained in:
2025-12-04 15:53:52 +08:00
parent ac75a934ef
commit cc9e076343
15 changed files with 395 additions and 244 deletions

View File

@@ -139,17 +139,6 @@
>
强制确认
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
:loading="showDtlLoading"
@click="downdtl"
>
导出Excel
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
@@ -168,17 +157,25 @@
<el-table-column
v-permission="['admin','inbill:del','inbill:edit']"
label="操作"
width="115"
width="200"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
style="display: inline"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
<el-button
type="text"
icon="el-icon-printer"
@click="printExcel(scope.row)"
>
导出单据
</el-button>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
@@ -402,13 +399,8 @@ export default {
this.onSelectAll()
this.crud.toQuery()
},
downdtl() {
this.showDtlLoading = true
if (this.crud.query.createTime !== undefined) {
this.query.begin_time = this.crud.query.createTime[0]
this.query.end_time = this.crud.query.createTime[1]
}
download('/api/in/rawAssist/download', this.crud.query).then(result => {
printExcel(jo) {
download('/api/in/rawAssist/download', { 'iostorinv_id': jo.iostorinv_id }).then(result => {
downloadFile(result, '入库单', 'xlsx')
this.showDtlLoading = false
}).catch(() => {

View File

@@ -159,7 +159,7 @@
<el-table-column
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
label="操作"
width="250"
width="200"
align="center"
fixed="right"
>
@@ -171,6 +171,13 @@
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
<el-button
type="text"
icon="el-icon-printer"
@click="printExcel(scope.row)"
>
导出单据
</el-button>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
@@ -218,6 +225,8 @@ import AddDialog from '@/views/wms/st/outbill/AddDialog'
import DivDialog from '@/views/wms/st/outbill/DivDialog'
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
import {download} from "@/api/data";
import {downloadFile} from "@/utils";
const start = new Date()
@@ -418,6 +427,14 @@ export default {
},
tableChanged() {
this.crud.toQuery()
},
printExcel(jo) {
download('/api/in/rawAssist/download', { 'iostorinv_id': jo.iostorinv_id }).then(result => {
downloadFile(result, '销售单', 'xlsx')
this.showDtlLoading = false
}).catch(() => {
this.showDtlLoading = false
})
}
}
}