Browse Source

【报表】千位符+导出千位符转换+页面title更改+平均值+导出bug处理

faster_AG_grid
安虹睿 1 year ago
parent
commit
97f19da2f1
  1. 20
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/AgTable/index.vue
  2. 63
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue
  3. 6
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue
  4. 1
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue
  5. 77
      PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js
  6. 36
      PC/UI.WinIn.FasterZ.AgGridReport/src/utils/util.js
  7. 2
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/Home.vue
  8. 19
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryAndAge.vue
  9. 11
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryERPWMS.vue
  10. 9
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryTrans.vue
  11. 12
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/procureHasPOReport.vue
  12. 50
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/procureNoPOReport.vue

20
PC/UI.WinIn.FasterZ.AgGridReport/src/components/AgTable/index.vue

@ -47,6 +47,11 @@ export default {
type:Array, type:Array,
default:[] default:[]
}, },
// -
averageFixedItem:{
type: Array,
default: null
},
}, },
data () { data () {
return { return {
@ -62,7 +67,7 @@ export default {
autoHeight:true autoHeight:true
}, },
tableHeight:null, tableHeight:null,
pageSizes:[10, 100, 300, 500, 1000, 3000, 5000, 10000], pageSizes:[10, 20,100, 300, 500, 1000, 3000, 5000, 10000],
pageTotal:null, pageTotal:null,
currentPage:1, currentPage:1,
currentPageSize:100, currentPageSize:100,
@ -116,15 +121,19 @@ export default {
let _pageData = this.getCurrentPageData(gridApi) let _pageData = this.getCurrentPageData(gridApi)
_pageData.forEach((item,key) => { _pageData.forEach((item,key) => {
for(let o in item){ for(let o in item){
// if(o == ''){
// //
// }
if(this.BottomFixedItem.indexOf(o) >= 0){ if(this.BottomFixedItem.indexOf(o) >= 0){
result[0][o] += item[o] result[0][o] += item[o]
} }
} }
}); });
console.log(127,result) //
if(this.averageFixedItem){
for(let i in result[0]){
if(this.averageFixedItem.indexOf(i) >= 0){
result[0][i] = result[0][i]/_pageData.length
}
}
}
this.pageTotal = this.allPageData.length this.pageTotal = this.allPageData.length
this.gridApi.setPinnedBottomRowData(result); this.gridApi.setPinnedBottomRowData(result);
}, },
@ -132,6 +141,7 @@ export default {
setTableHeight(){ setTableHeight(){
let _headerH = document.getElementsByClassName('reportPageHeader')[0].clientHeight let _headerH = document.getElementsByClassName('reportPageHeader')[0].clientHeight
let _footH = 50; let _footH = 50;
let _outH = _headerH + _footH let _outH = _headerH + _footH
this.tableHeight = `calc(100vh - ${_outH}px)` this.tableHeight = `calc(100vh - ${_outH}px)`
}, },

63
PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue

@ -1,10 +1,17 @@
<template> <template>
<div><el-button @click="exportExcel" size="small" type="warning">导出数据</el-button></div> <div>
<el-button
@click="exportExcel"
size="small"
type="warning"
>导出数据</el-button>
</div>
</template> </template>
<script> <script>
import XLSX from "xlsx"; import XLSX from "xlsx";
import XLSXS from "xlsx-style"; import XLSXS from "xlsx-style";
import FileSaver from "file-saver"; import FileSaver from "file-saver";
import util from '@/utils/util'
export default { export default {
name: "exportExcel", name: "exportExcel",
props:{ props:{
@ -23,13 +30,51 @@ export default {
type: Array, type: Array,
default: null default: null
}, },
//
columnList:{
type: Array,
default: null
},
}, },
data () { data () {
return { return {
excelDataList:null,//
excelNumberHeader:null,//
}; };
}, },
watch:{
excelData(n){
this.initExcelHeader()
this.initExcelData()
}
},
mounted(){
this.initExcelHeader()
this.initExcelData()
},
methods:{ methods:{
//
initExcelData(){
this.excelDataList = []
this.excelData.forEach((item,key)=>{
let _item = JSON.parse(JSON.stringify(item))
for(let field in item){
if(this.excelNumberHeader.indexOf(field) >= 0){
_item[field] = util.numberFixedFormatter(item[field],true)
}
}
this.excelDataList.push(_item)
})
},
//
initExcelHeader(){
this.excelNumberHeader = []
this.columnList.forEach(item=>{
if(item.type == 'kiloNumber'){
this.excelNumberHeader.push(item.field)
}
})
},
s2ab(s){ s2ab(s){
var buf = new ArrayBuffer(s.length); var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf); var view = new Uint8Array(buf);
@ -39,7 +84,7 @@ export default {
exportExcel(){ exportExcel(){
// //
let _head = [] let _head = []
for(let item in this.excelData[0]){ for(let item in this.excelDataList[0]){
_head.push(item) _head.push(item)
} }
@ -56,7 +101,7 @@ export default {
] ]
// //
this.excelData.forEach((item,key)=>{ this.excelDataList.forEach((item,key)=>{
let _row = [] let _row = []
_head.forEach(head_item=>{ _head.forEach(head_item=>{
_row.push(item[head_item]) _row.push(item[head_item])
@ -79,12 +124,10 @@ export default {
ws["!merges"] = [{ s: { r: 0, c: 0 }, e: { r: 0, c: _head.length - 1 } }]; ws["!merges"] = [{ s: { r: 0, c: 0 }, e: { r: 0, c: _head.length - 1 } }];
// //
// ws["!cols"] = [ ws["!cols"] = []
// {wpx: 40,}, for(let i =0;i<_head.length;i++){
// {wpx: 100,}, ws["!cols"].push({wpx:150})
// {wpx: 100,}, }
// {wpx: 100,},
// ];
// , // ,
for (let i in ws) { for (let i in ws) {

6
PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue

@ -14,6 +14,7 @@
ref="AgTable_Ref" ref="AgTable_Ref"
:columnDefs="columnList" :columnDefs="columnList"
:BottomFixedItem="BottomFixedItem" :BottomFixedItem="BottomFixedItem"
:averageFixedItem="averageFixedItem"
></AgTable> ></AgTable>
</div> </div>
</template> </template>
@ -56,6 +57,11 @@ export default {
type: Array, type: Array,
default: null default: null
}, },
// -
averageFixedItem:{
type: Array,
default: null
},
// //
reportName:{ reportName:{
type: String, type: String,

1
PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue

@ -62,6 +62,7 @@
class="output-excel" class="output-excel"
:reportName="reportName" :reportName="reportName"
:excelData="downloadData" :excelData="downloadData"
:columnList="columnList"
:title="downloadExcelTitle()" :title="downloadExcelTitle()"
></exportExcel> ></exportExcel>
<columnFilter <columnFilter

77
PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js

@ -5,6 +5,7 @@ import inventoryAndAge from '../views/report/inventoryAndAge.vue'
import inventoryERPWMS from '../views/report/inventoryERPWMS.vue' import inventoryERPWMS from '../views/report/inventoryERPWMS.vue'
import inventoryTrans from '../views/report/inventoryTrans.vue' import inventoryTrans from '../views/report/inventoryTrans.vue'
import procureHasPOReport from '../views/report/procureHasPOReport.vue' import procureHasPOReport from '../views/report/procureHasPOReport.vue'
import procureNoPOReport from '../views/report/procureNoPOReport.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
@ -12,31 +13,50 @@ const routes = [
{ {
path: '/', path: '/',
name: 'Home', name: 'Home',
component: Home component: Home,
meta:{
title:"报表首页",
}
}, },
{ {
title:"库存库龄报表",
path: '/inventoryAndAge', path: '/inventoryAndAge',
name: 'inventoryAndAge', name: 'inventoryAndAge',
component: inventoryAndAge component: inventoryAndAge,
meta:{
title:"库存库龄报表",
}
},
{
path: '/inventoryERPWMS',
name: 'inventoryERPWMS',
component: inventoryERPWMS,
meta:{
title:"库存余额_ERP-WMS差异报表",
}
},
{
path: '/inventoryTrans',
name: 'inventoryTrans',
component: inventoryTrans,
meta:{
title:"库存事务报表",
}
}, },
// {
// title:"库存余额_ERP-WMS差异报表",
// path: '/inventoryERPWMS',
// name: 'inventoryERPWMS',
// component: inventoryERPWMS
// },
// {
// title:"库存事务报表",
// path: '/inventoryTrans',
// name: 'inventoryTrans',
// component: inventoryTrans
// },
{ {
title:"采购收货/采购退货-有PO",
path: '/procureHasPOReport', path: '/procureHasPOReport',
name: 'procureHasPOReport', name: 'procureHasPOReport',
component: procureHasPOReport component: procureHasPOReport,
meta:{
title:"采购收货/采购退货-有PO报表",
}
},
{
path: '/procureNoPOReport',
name: 'procureNoPOReport',
component: procureNoPOReport,
meta:{
title:"采购收货/采购退货-无PO报表",
}
}, },
] ]
@ -44,21 +64,12 @@ const router = new VueRouter({
routes routes
}) })
// router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// console.log('router.beforeEach',to) /* 路由发生变化修改页面title */
// /* 路由发生变化修改页面title */ if (to.meta.title) {
// if (to.meta.title) { document.title = to.meta.title
// document.title = to.meta.title }
// } next()
// // if(to.meta.content){ })
// // let head = document.getElementsByTagName('head');
// // let metas = document.getElementsByTagName('meta');
// // for (let i = 0; i < metas.length; i++) {
// // if (metas[i].name === 'viewport') {
// // metas[i].content += ', ' + to.meta.content
// // }
// // }
// // }
// })
export default router export default router

36
PC/UI.WinIn.FasterZ.AgGridReport/src/utils/util.js

@ -29,8 +29,42 @@ var dateFilterParams = {
} }
} }
// 转换数字小数点保留+千位符
/**
* @param {*} number 数值
* @param {*} isKilo 是否用千位符默认否选填
* @param {*} fixed 保留小数位数默认2选填
* @returns
*/
var numberFixedFormatter = function(number,isKilo,fixed){
let _fixed = fixed || 2;
let _res = Number(number).toFixed(_fixed)
if(isKilo){
_res = Number(Number(number).toFixed(_fixed)).toLocaleString('en-US');
}
return _res;
}
// 转换数字百分号+小数点保留
/**
* @param {*} number 数值
* @param {*} isPercent 是否需要手动转*100默认否选填
* @param {*} fixed 保留小数位数默认2选填
* @returns
*/
var numberPercentFormatter = function(number,isPercent,fixed){
let _fixed = fixed || 2;
let _res = Number(number).toFixed(_fixed) + ' %'
if(isPercent){
_res = Number(Number(number)*100).toFixed(_fixed) + ' %'
}
return _res;
}
export default { export default {
waitTime:20000,//滚屏列表刷新等待间隔配置项 waitTime:20000,//滚屏列表刷新等待间隔配置项
addEventResizeFlesh:addEventResizeFlesh, addEventResizeFlesh:addEventResizeFlesh,
dateFilterParams:dateFilterParams dateFilterParams:dateFilterParams,
numberFixedFormatter,
numberPercentFormatter
} }

2
PC/UI.WinIn.FasterZ.AgGridReport/src/views/Home.vue

@ -5,7 +5,7 @@
v-for="(item,index) in menuList" v-for="(item,index) in menuList"
:key="index" :key="index"
@click="goPage(item.path)" @click="goPage(item.path)"
>{{item.title || item.name}}</div> >{{item.meta.title || item.name}}</div>
</div> </div>
</template> </template>
<script> <script>

19
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryAndAge.vue

@ -3,8 +3,8 @@
:columnList="columnDefs" :columnList="columnDefs"
:searchConfig="searchConfig" :searchConfig="searchConfig"
:searchForm="searchForm" :searchForm="searchForm"
:reportName="'库存库龄报表'"
:BottomFixedItem="BottomFixedItem" :BottomFixedItem="BottomFixedItem"
:reportName="'库存库龄报表'"
:procName="'Proc_Zheng_库存库龄'" :procName="'Proc_Zheng_库存库龄'"
></reportPage> ></reportPage>
</template> </template>
@ -19,9 +19,6 @@ export default {
reportPage reportPage
}, },
data () { data () {
const numberFormatter = (item) =>{
return Number(item.value).toFixed(2);
}
return { return {
columnDefs: [ columnDefs: [
{ field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
@ -29,13 +26,13 @@ export default {
{ field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '库位组', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '库位组', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '总数', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '总数', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter:((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true }},
{ field: '<=30天', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '<=30天', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '31-180天', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '31-180天', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '181-240天', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '181-240天', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '241-300天', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '241-300天', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '301-360天', flex:1, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '301-360天', flex:1, type:"kiloNumber", cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '>=361天', flex:1, cellClass: 'rightAlign', valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '>=361天', flex:1, type:"kiloNumber", cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '单位', flex:1, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '单位', flex:1, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '状态', flex:1, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true }}, { field: '状态', flex:1, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true }},
], ],

11
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryERPWMS.vue

@ -3,8 +3,8 @@
:columnList="columnDefs" :columnList="columnDefs"
:searchConfig="searchConfig" :searchConfig="searchConfig"
:searchForm="searchForm" :searchForm="searchForm"
:reportName="'库存余额_ERP-WMS差异报表'"
:BottomFixedItem="BottomFixedItem" :BottomFixedItem="BottomFixedItem"
:reportName="'库存余额_ERP-WMS差异报表'"
:procName="'Proc_Zheng_库存余额_erp与wms差异'" :procName="'Proc_Zheng_库存余额_erp与wms差异'"
></reportPage> ></reportPage>
</template> </template>
@ -19,9 +19,6 @@ export default {
reportPage reportPage
}, },
data () { data () {
const numberFormatter = (item) =>{
return Number(item.value).toFixed(2);
}
return { return {
columnDefs: [ columnDefs: [
{ field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
@ -29,9 +26,9 @@ export default {
{ field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: 'ERP库位', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: 'ERP库位', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: 'ERP数量', cellClass:"rightAlign", width:200, valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: 'ERP数量', type:"kiloNumber", cellClass:"rightAlign", width:200, valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: 'WMS数量', cellClass:"rightAlign", width:200, valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: 'WMS数量', type:"kiloNumber", cellClass:"rightAlign", width:200, valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '差异', cellClass:"rightAlign", width:200, valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '差异', cellClass:"rightAlign", width:200, valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '单位', cellClass:"centerAlign", width:150, suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '单位', cellClass:"centerAlign", width:150, suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
], ],
searchConfig:[ searchConfig:[

9
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/inventoryTrans.vue

@ -3,8 +3,8 @@
:columnList="columnDefs" :columnList="columnDefs"
:searchConfig="searchConfig" :searchConfig="searchConfig"
:searchForm="searchForm" :searchForm="searchForm"
:reportName="'库存事务报表'"
:BottomFixedItem="BottomFixedItem" :BottomFixedItem="BottomFixedItem"
:reportName="'库存事务报表'"
:procName="'Proc_Zheng_库存事务'" :procName="'Proc_Zheng_库存事务'"
></reportPage> ></reportPage>
</template> </template>
@ -14,14 +14,11 @@ import reportPage from "@/components/reportPage/index"
import util from '@/utils/util' import util from '@/utils/util'
export default { export default {
name: "inventoryERPWMS", name: "inventoryTrans",
components: { components: {
reportPage reportPage
}, },
data () { data () {
const numberFormatter = (item) =>{
return Number(item.value).toFixed(2);
}
return { return {
columnDefs: [ columnDefs: [
{ field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
@ -29,7 +26,7 @@ export default {
{ field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'库位组代码', field: '库位组', width:200, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { headerName:'库位组代码', field: '库位组', width:200, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '数量', cellClass:"rightAlign", width:200, valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '数量', type:"kiloNumber", cellClass:"rightAlign", width:200, valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '单位', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '单位', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '状态', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '状态', cellClass:"centerAlign", width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'事务分类', field: '类型', width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { headerName:'事务分类', field: '类型', width:150, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },

12
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/procureHasPOReport.vue

@ -3,8 +3,8 @@
:columnList="columnDefs" :columnList="columnDefs"
:searchConfig="searchConfig" :searchConfig="searchConfig"
:searchForm="searchForm" :searchForm="searchForm"
:reportName="'采购收货/采购退货(有PO)'"
:BottomFixedItem="BottomFixedItem" :BottomFixedItem="BottomFixedItem"
:reportName="'采购收货/采购退货(有PO)报表'"
:procName="'Proc_Zheng_采购收货_采购退货_有po'" :procName="'Proc_Zheng_采购收货_采购退货_有po'"
></reportPage> ></reportPage>
</template> </template>
@ -14,23 +14,21 @@ import reportPage from "@/components/reportPage/index"
import util from '@/utils/util' import util from '@/utils/util'
export default { export default {
name: "inventoryAndAge", name: "procureHasPOReport",
components: { components: {
reportPage reportPage
}, },
data () { data () {
const numberFormatter = (item) =>{
return Number(item.value).toFixed(2);
}
return { return {
columnDefs: [ columnDefs: [
{ field: '供应商代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '供应商代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '供应商名称', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料名称', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料名称', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '收货数量', width:200, cellClass:"rightAlign", valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '收货数量', type:"kiloNumber", width:200, cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '退货数量', width:200, cellClass: 'rightAlign', valueFormatter: numberFormatter, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '退货数量', type:"kiloNumber", width:200, cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '单位', width:150, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } }, { field: '单位', width:150, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
], ],
searchConfig:[ searchConfig:[

50
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/procureNoPOReport.vue

@ -0,0 +1,50 @@
<template>
<reportPage
:columnList="columnDefs"
:searchConfig="searchConfig"
:searchForm="searchForm"
:BottomFixedItem="BottomFixedItem"
:reportName="'采购收货/采购退货(无PO)报表'"
:procName="'Proc_Zheng_采购收货_采购退货_无po'"
></reportPage>
</template>
<script>
import reportPage from "@/components/reportPage/index"
import util from '@/utils/util'
export default {
name: "procureNoPOReport",
components: {
reportPage
},
data () {
return {
columnDefs: [
{ field: '供应商代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '供应商名称', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料代码', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料名称', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述1', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '物料描述2', flex:1, filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '收货数量', type:"kiloNumber", width:200, cellClass:"rightAlign", valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '退货数量', type:"kiloNumber", width:200, cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ field: '单位', width:150, cellClass:"centerAlign", filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
],
searchConfig:[
{type:'select',prop:'ItemCode',label:'物料',optionsProc:'itemCode'},
{type:'select',prop:'SupplierCode',label:'供应商',optionsProc:'SupplierCode'},
{type:'date',prop:'beginDate',label:'起始'},
{type:'date',prop:'endDate',label:'截止'},
],
searchForm:{
ItemCode:'',
SupplierCode:'',
beginDate:"",
endDate:'',
},
BottomFixedItem:['收货数量','退货数量']
};
},
};
</script>
Loading…
Cancel
Save