From 278fc06a1ae2cd02ee7d80bb19f11bd630db98c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Fri, 2 Feb 2024 13:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9F=83=E9=A9=B0=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E3=80=91=E5=A4=87=E6=96=99=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/config.js | 4 +- .../src/api/businessApi.js | 7 ++ .../src/components/exportExcel/index.vue | 31 ++++++-- .../src/components/reportPage/index.vue | 27 ++++--- .../src/components/reportPageHeader/index.vue | 15 ++-- .../src/router/index.js | 10 ++- .../views/report/stockPreparationReport.vue | 71 +++++++++++++++++++ 7 files changed, 143 insertions(+), 22 deletions(-) create mode 100644 PC/UI.WinIn.FasterZ.AgGridReport/src/api/businessApi.js create mode 100644 PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/public/config.js b/PC/UI.WinIn.FasterZ.AgGridReport/public/config.js index 948003a..334c7ad 100644 --- a/PC/UI.WinIn.FasterZ.AgGridReport/public/config.js +++ b/PC/UI.WinIn.FasterZ.AgGridReport/public/config.js @@ -1 +1,3 @@ -window.SITE_CONFIG['apiURL'] = 'http://dev.ccwin-in.com:60029' \ No newline at end of file +window.SITE_CONFIG['apiURL'] = 'http://dev.ccwin-in.com:60029' +//特殊使用埃驰pc端访问地址(如备料报表) +window.SITE_CONFIG['businessURL'] = 'http://dev.ccwin-in.com:10099' \ No newline at end of file diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/api/businessApi.js b/PC/UI.WinIn.FasterZ.AgGridReport/src/api/businessApi.js new file mode 100644 index 0000000..eeac275 --- /dev/null +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/api/businessApi.js @@ -0,0 +1,7 @@ +import axiosUtil from '@/utils/request' +let businessURL = window.SITE_CONFIG['businessURL'] + +// 备料看板 +export function getstockPreparationList() { + return axiosUtil.ajax_post(businessURL+'/api/wms/store/board/preparation-board-export') +} \ No newline at end of file diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue index 895b3c8..f641149 100644 --- a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue @@ -45,19 +45,35 @@ export default { }, watch:{ excelData(n){ - this.initExcelHeader() - this.initExcelData() + this.init() } }, mounted(){ - this.initExcelHeader() - this.initExcelData() + this.init() }, methods:{ + init(){ + this.initExcelHeader() + this.initExcelData() + }, // 格式化数据(转千位符) initExcelData(){ this.excelDataList = [] - this.excelData.forEach((item,key)=>{ + let _downloadData = [] + // 初始化列表数据,更改为headerName格式 + this.excelData.forEach(item=>{ + let _item = {} + for(let prop in item){ + this.columnList.forEach(cItem=>{ + if(cItem.field == prop){ + let _name = cItem.headerName || cItem.field + _item[_name] = item[prop] + } + }) + } + _downloadData.push(_item) + }) + _downloadData.forEach((item,key)=>{ let _item = JSON.parse(JSON.stringify(item)) for(let field in item){ if(this.excelKiloNumberHeader.indexOf(field) >= 0){ @@ -77,11 +93,12 @@ export default { this.columnList.forEach(item=>{ // 千位符暂存 if(item.type == 'kiloNumber'){ - this.excelKiloNumberHeader.push(item.field) + let _name = item.headerName || item.field + this.excelKiloNumberHeader.push(_name) } // 百分比暂存 if(item.type == 'percentNumber'){ - this.excelPercentHeader.push(item.field) + this.excelPercentHeader.push(item.headerName || item.field) } }) }, diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue index 29f10af..a86670b 100644 --- a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue @@ -72,6 +72,11 @@ export default { type: String, default: '' }, + // 是否为特殊的表格数据 + isSpecialData:{ + type: Boolean, + default: false + }, }, data () { return { @@ -90,26 +95,32 @@ export default { }, // 获取数据 getList(){ + // 特殊的表格数据,不走procName的接口数据 + if(this.isSpecialData){return} this.pageLoading = true getReportPageList(this.procName,this.searchForm) .then(res=>{ - this.$refs.AgTable_Ref.updateTableData(res) - this.tableData = res + this.updateTableData(res) + this.updateDownloadData(res) this.pageLoading = false }) .catch(err=>{ - this.$refs.AgTable_Ref.updateTableData([]) - this.tableData = [] + this.updateTableData([]) + this.updateDownloadData([]) this.pageLoading = false }) - // fetch('https://www.ag-grid.com/example-assets/olympic-winners.json') - // .then((resp) => resp.json()) - // .then((data) => this.$refs.AgTable_Ref.updateTableData(data)) - // .then((data) => this.tableData = data) }, // 查询事件 headerSearchHandle(data){ this.getList() + }, + // 更新表格数据 + updateTableData(data){ + this.$refs.AgTable_Ref.updateTableData(data) + }, + // 更新导出数据 + updateDownloadData(data){ + this.tableData = data } }, }; diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue index 833a48b..9270f0c 100644 --- a/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue @@ -5,8 +5,9 @@
-
+
{ item.options = [] if(item.type == 'select' && item.optionsProc){ @@ -258,10 +260,12 @@ export default { }, downloadExcelTitle(){ let _title = this.reportName - let _begin = this.searchForm.beginDate ? this.searchForm.beginDate.slice(0,10) : '--' - let _end = this.searchForm.endDate ? this.searchForm.endDate.slice(0,10) : '--' - if(this.searchForm.beginDate || this.searchForm.endDate){ - _title = `${this.reportName} (${_begin}至${_end})` + if(this.searchForm){ + let _begin = this.searchForm.beginDate ? this.searchForm.beginDate.slice(0,10) : '--' + let _end = this.searchForm.endDate ? this.searchForm.endDate.slice(0,10) : '--' + if(this.searchForm.beginDate || this.searchForm.endDate){ + _title = `${this.reportName} (${_begin}至${_end})` + } } return _title } @@ -282,6 +286,7 @@ export default { .headerRightBtn{ display:flex; justify-content: flex-end; + padding-bottom:18px; .output-excel{ margin-right:10px diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js b/PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js index 3087873..9927ee1 100644 --- a/PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js @@ -31,6 +31,7 @@ import doorReturnNoteReport from '../views/report/doorReturnNoteReport.vue' import EQLevelReport from '../views/report/EQLevelReport.vue' import outsourcingOutReport from '../views/report/outsourcingOutReport.vue' import outsourcingReturnReport from '../views/report/outsourcingReturnReport.vue' +import stockPreparationReport from '../views/report/stockPreparationReport.vue' Vue.use(VueRouter) @@ -283,7 +284,14 @@ const routes = [ title:"委外退库报表", } }, - + { + path: '/stockPreparationReport', + name: 'stockPreparationReport', + component: stockPreparationReport, + meta:{ + title:"备料报表", + } + }, ] const router = new VueRouter({ diff --git a/PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue b/PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue new file mode 100644 index 0000000..a2e6d52 --- /dev/null +++ b/PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue @@ -0,0 +1,71 @@ + + + + \ No newline at end of file