diff --git a/src/api/repair/orderinfo/index.js b/src/api/repair/orderinfo/index.js index 06fada8..35c6581 100644 --- a/src/api/repair/orderinfo/index.js +++ b/src/api/repair/orderinfo/index.js @@ -69,3 +69,13 @@ export function getOrderCensus(){ method: "get" }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: "/repair/order-info/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js index ab26f83..19fe8ee 100644 --- a/src/api/repair/stockOperate/stockOperate.js +++ b/src/api/repair/stockOperate/stockOperate.js @@ -61,3 +61,13 @@ export function inWare(data){ data }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/stockOperate/stockOperateItem.js b/src/api/repair/stockOperate/stockOperateItem.js index 615c017..842c9f2 100644 --- a/src/api/repair/stockOperate/stockOperateItem.js +++ b/src/api/repair/stockOperate/stockOperateItem.js @@ -43,3 +43,13 @@ export function getSoBySupplier(params){ params }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/stockTransfer/stockTransfer.js b/src/api/repair/stockTransfer/stockTransfer.js index a8494c6..23c7bd0 100644 --- a/src/api/repair/stockTransfer/stockTransfer.js +++ b/src/api/repair/stockTransfer/stockTransfer.js @@ -36,3 +36,13 @@ export function getSt(id){ method: "get" }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/stockTransfer/stockTransferItem.js b/src/api/repair/stockTransfer/stockTransferItem.js index f8b23d0..ff15840 100644 --- a/src/api/repair/stockTransfer/stockTransferItem.js +++ b/src/api/repair/stockTransfer/stockTransferItem.js @@ -18,3 +18,13 @@ export function getStIsWares(ids){ method: "get" }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/tickets/TicketWares.js b/src/api/repair/tickets/TicketWares.js index 71e6906..8b492ea 100644 --- a/src/api/repair/tickets/TicketWares.js +++ b/src/api/repair/tickets/TicketWares.js @@ -88,3 +88,13 @@ export function getByIds(ids){ method: 'get' }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index b5c8a5b..0d0687d 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -200,3 +200,23 @@ export function getCusAndCarById(id){ method: 'get' }) } + +// 导出数据 +export function exportData(params){ + return request({ + url: preUrl + "/export", + method: 'get', + params, + responseType: 'blob' + }) +} + +// 导出数据 根据工单状态 +export function exportByStatus(params){ + return request({ + url: preUrl + "/exportByStatus", + method: 'get', + params, + responseType: 'blob' + }) +} diff --git a/src/views/repair/orderinfo/index.vue b/src/views/repair/orderinfo/index.vue index c445307..0b9f602 100644 --- a/src/views/repair/orderinfo/index.vue +++ b/src/views/repair/orderinfo/index.vue @@ -37,6 +37,10 @@ + + 导出 +
@@ -237,15 +241,18 @@ export default { }, /** 导出按钮操作 */ async handleExport() { - await this.$modal.confirm('是否确认导出所有维修模块 订单数据项?'); - try { + this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => { + // 处理查询参数 + let params = {...this.queryParams}; + params.pageNo = undefined; + params.pageSize = undefined; this.exportLoading = true; - const data = await OrderInfoApi.exportOrderInfoExcel(this.queryParams); - this.$download.excel(data, '维修模块 订单.xls'); - } catch { - } finally { + return OrderInfoApi.exportData(params); + }).then(response => { + this.$download.excel(response, '订单数据.xls'); + }).finally(() => { this.exportLoading = false; - } + }); }, async getCensus() { const res = await getOrderCensus() diff --git a/src/views/repair/stockOperate/Components/SoIndex.vue b/src/views/repair/stockOperate/Components/SoIndex.vue index 4c16e4f..b300ad3 100644 --- a/src/views/repair/stockOperate/Components/SoIndex.vue +++ b/src/views/repair/stockOperate/Components/SoIndex.vue @@ -42,11 +42,10 @@ - - - - - + + 导出 + @@ -240,7 +239,7 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue"; import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; import {DICT_TYPE} from "@/utils/dict"; -import {getRepairSoPage, voidSo, getRepairSoById, inWare} from "@/api/repair/stockOperate/stockOperate"; +import {getRepairSoPage, voidSo, getRepairSoById, inWare, exportData} from "@/api/repair/stockOperate/stockOperate"; import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue"; import {getRepairSoiByIds, getMapBySoIdAndQuery} from "@/api/repair/stockOperate/stockOperateItem"; import {createUniqueCodeByHead} from "@/utils/createUniqueCode"; @@ -341,6 +340,8 @@ export default { selectRowIds: [], allSelectRows: [], isRefresh: false, + // 导出遮罩层 + exportLoading: false, } }, mounted() { @@ -631,6 +632,21 @@ export default { // this.tableKey++ // this.selectRows = [] }, + /** 导出按钮操作 */ + handleExport() { + this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => { + // 处理查询参数 + let params = {...this.queryParams}; + params.pageNo = undefined; + params.pageSize = undefined; + this.exportLoading = true; + return exportData(params); + }).then(response => { + this.$download.excel(response, '单据数据.xls'); + }).finally(() => { + this.exportLoading = false; + }); + }, } } diff --git a/src/views/repair/stockOperate/Components/SoReturn.vue b/src/views/repair/stockOperate/Components/SoReturn.vue index 482bba5..c1fc504 100644 --- a/src/views/repair/stockOperate/Components/SoReturn.vue +++ b/src/views/repair/stockOperate/Components/SoReturn.vue @@ -23,16 +23,15 @@ - - 导出 - - 新增 + + 导出 + @@ -184,7 +183,7 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue"; import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import SoReturnForm from "@/views/repair/stockOperate/form/SoReturnForm.vue"; -import {getRepairSoById, getRepairSoPage, voidSo} from "@/api/repair/stockOperate/stockOperate"; +import {getRepairSoById, getRepairSoPage, voidSo, exportData} from "@/api/repair/stockOperate/stockOperate"; import {getRepairSoiByIds} from "@/api/repair/stockOperate/stockOperateItem"; import {getBaseWarehouseList} from "@/api/base/warehouse"; @@ -211,7 +210,9 @@ export default { }, dialogVisible: false, info: {}, - warehouseList: [] + warehouseList: [], + // 导出遮罩层 + exportLoading: false, } }, watch:{ @@ -289,7 +290,22 @@ export default { }, handleAdd(){ this.$refs.soReturnRef.open() - } + }, + /** 导出按钮操作 */ + handleExport() { + this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => { + // 处理查询参数 + let params = {...this.queryParams}; + params.pageNo = undefined; + params.pageSize = undefined; + this.exportLoading = true; + return exportData(params); + }).then(response => { + this.$download.excel(response, '退货单数据.xls'); + }).finally(() => { + this.exportLoading = false; + }); + }, } } diff --git a/src/views/repair/stockOperate/Components/SoVoid.vue b/src/views/repair/stockOperate/Components/SoVoid.vue index d7505f1..c09c690 100644 --- a/src/views/repair/stockOperate/Components/SoVoid.vue +++ b/src/views/repair/stockOperate/Components/SoVoid.vue @@ -31,6 +31,10 @@ + + 导出 + @@ -78,7 +82,7 @@ import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue"; import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; -import {getRepairSoPage, getRepairSoById} from "@/api/repair/stockOperate/stockOperate"; +import {getRepairSoPage, getRepairSoById, exportData} from "@/api/repair/stockOperate/stockOperate"; import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue"; export default { @@ -128,6 +132,8 @@ export default { loading: false, list: [], total: 0, + // 导出遮罩层 + exportLoading: false, } }, mounted() { @@ -175,7 +181,22 @@ export default { async handleShow(row){ const res = await getRepairSoById(row.id) await this.$refs.soShow.open(res.data) - } + }, + /** 导出按钮操作 */ + handleExport() { + this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => { + // 处理查询参数 + let params = {...this.queryParams}; + params.pageNo = undefined; + params.pageSize = undefined; + this.exportLoading = true; + return exportData(params); + }).then(response => { + this.$download.excel(response, '作废单据数据.xls'); + }).finally(() => { + this.exportLoading = false; + }); + }, } } diff --git a/src/views/repair/stockOperate/Components/SoiTable.vue b/src/views/repair/stockOperate/Components/SoiTable.vue index 943489b..3a7934c 100644 --- a/src/views/repair/stockOperate/Components/SoiTable.vue +++ b/src/views/repair/stockOperate/Components/SoiTable.vue @@ -28,11 +28,10 @@ - - - - - + + 导出 + @@ -78,7 +77,7 @@ diff --git a/src/views/repair/stockOperate/Components/WaresItem.vue b/src/views/repair/stockOperate/Components/WaresItem.vue index d91e955..7dcea25 100644 --- a/src/views/repair/stockOperate/Components/WaresItem.vue +++ b/src/views/repair/stockOperate/Components/WaresItem.vue @@ -12,6 +12,10 @@ + + 导出 + @@ -272,7 +276,7 @@ diff --git a/src/views/repair/stockTransfer/Components/StIndex.vue b/src/views/repair/stockTransfer/Components/StIndex.vue index 0c18c4c..0309b22 100644 --- a/src/views/repair/stockTransfer/Components/StIndex.vue +++ b/src/views/repair/stockTransfer/Components/StIndex.vue @@ -32,6 +32,10 @@ + + 导出 + @@ -98,7 +102,7 @@ diff --git a/src/views/repair/stockTransfer/Components/StVoid.vue b/src/views/repair/stockTransfer/Components/StVoid.vue index a08209c..4d248ba 100644 --- a/src/views/repair/stockTransfer/Components/StVoid.vue +++ b/src/views/repair/stockTransfer/Components/StVoid.vue @@ -26,6 +26,10 @@ + + 导出 + @@ -75,7 +79,7 @@ diff --git a/src/views/repair/stockTransfer/Components/StiTable.vue b/src/views/repair/stockTransfer/Components/StiTable.vue index 603dabf..46f10c5 100644 --- a/src/views/repair/stockTransfer/Components/StiTable.vue +++ b/src/views/repair/stockTransfer/Components/StiTable.vue @@ -27,9 +27,8 @@ - 导出 - + 导出 @@ -79,7 +78,7 @@ diff --git a/src/views/repair/tickets/Components/TicketManagerItem.vue b/src/views/repair/tickets/Components/TicketManagerItem.vue index 2e8a360..8425a43 100644 --- a/src/views/repair/tickets/Components/TicketManagerItem.vue +++ b/src/views/repair/tickets/Components/TicketManagerItem.vue @@ -21,6 +21,10 @@ + + 导出 + @@ -39,6 +43,8 @@ + + diff --git a/src/views/repair/tickets/Components/TicketSearch.vue b/src/views/repair/tickets/Components/TicketSearch.vue index a980e2f..2808cba 100644 --- a/src/views/repair/tickets/Components/TicketSearch.vue +++ b/src/views/repair/tickets/Components/TicketSearch.vue @@ -35,11 +35,11 @@ - - 导出 - + + 导出 + @@ -53,7 +53,7 @@ import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue"; import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue"; -import {getTicketsPage} from "@/api/repair/tickets/Tickets"; +import {getTicketsPage, exportByStatus} from "@/api/repair/tickets/Tickets"; import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import {checkRole} from "@/api/system/permission"; @@ -87,7 +87,9 @@ export default { showSearch: true, total: 0, list: [], - isCW: false + isCW: false, + // 导出遮罩层 + exportLoading: false, } }, mounted() { @@ -136,7 +138,34 @@ export default { this.resetForm("queryForm") this.queryParams.corp = null this.handleQuery() - } + }, + /** 导出按钮操作 */ + handleExport() { + this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => { + // 处理查询参数 + let params = {...this.queryParams}; + params.pageNo = undefined; + params.pageSize = undefined; + this.exportLoading = true; + return exportByStatus(params); + }).then(response => { + let name = "" + switch (this.TicketType){ + case "tu": + name = "待结算工单数据.xls" + break + case "tp": + name = "已结算工单数据.xls" + break + case "tv": + name = "已作废工单数据.xls" + break + } + this.$download.excel(response, name); + }).finally(() => { + this.exportLoading = false; + }); + }, } } diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue index e9be9cd..6d5d90b 100644 --- a/src/views/repair/tickets/Components/TicketTable.vue +++ b/src/views/repair/tickets/Components/TicketTable.vue @@ -64,17 +64,19 @@ - - - + + + + + + +