Browse Source

【埃驰看板】备料看板

master
安虹睿 10 months ago
parent
commit
278fc06a1a
  1. 2
      PC/UI.WinIn.FasterZ.AgGridReport/public/config.js
  2. 7
      PC/UI.WinIn.FasterZ.AgGridReport/src/api/businessApi.js
  3. 29
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/exportExcel/index.vue
  4. 27
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPage/index.vue
  5. 7
      PC/UI.WinIn.FasterZ.AgGridReport/src/components/reportPageHeader/index.vue
  6. 10
      PC/UI.WinIn.FasterZ.AgGridReport/src/router/index.js
  7. 71
      PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue

2
PC/UI.WinIn.FasterZ.AgGridReport/public/config.js

@ -1 +1,3 @@
window.SITE_CONFIG['apiURL'] = 'http://dev.ccwin-in.com:60029' window.SITE_CONFIG['apiURL'] = 'http://dev.ccwin-in.com:60029'
//特殊使用埃驰pc端访问地址(如备料报表)
window.SITE_CONFIG['businessURL'] = 'http://dev.ccwin-in.com:10099'

7
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')
}

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

@ -45,19 +45,35 @@ export default {
}, },
watch:{ watch:{
excelData(n){ excelData(n){
this.initExcelHeader() this.init()
this.initExcelData()
} }
}, },
mounted(){ mounted(){
this.init()
},
methods:{
init(){
this.initExcelHeader() this.initExcelHeader()
this.initExcelData() this.initExcelData()
}, },
methods:{
// //
initExcelData(){ initExcelData(){
this.excelDataList = [] 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)) let _item = JSON.parse(JSON.stringify(item))
for(let field in item){ for(let field in item){
if(this.excelKiloNumberHeader.indexOf(field) >= 0){ if(this.excelKiloNumberHeader.indexOf(field) >= 0){
@ -77,11 +93,12 @@ export default {
this.columnList.forEach(item=>{ this.columnList.forEach(item=>{
// //
if(item.type == 'kiloNumber'){ if(item.type == 'kiloNumber'){
this.excelKiloNumberHeader.push(item.field) let _name = item.headerName || item.field
this.excelKiloNumberHeader.push(_name)
} }
// //
if(item.type == 'percentNumber'){ if(item.type == 'percentNumber'){
this.excelPercentHeader.push(item.field) this.excelPercentHeader.push(item.headerName || item.field)
} }
}) })
}, },

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

@ -72,6 +72,11 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
//
isSpecialData:{
type: Boolean,
default: false
},
}, },
data () { data () {
return { return {
@ -90,26 +95,32 @@ export default {
}, },
// //
getList(){ getList(){
// procName
if(this.isSpecialData){return}
this.pageLoading = true this.pageLoading = true
getReportPageList(this.procName,this.searchForm) getReportPageList(this.procName,this.searchForm)
.then(res=>{ .then(res=>{
this.$refs.AgTable_Ref.updateTableData(res) this.updateTableData(res)
this.tableData = res this.updateDownloadData(res)
this.pageLoading = false this.pageLoading = false
}) })
.catch(err=>{ .catch(err=>{
this.$refs.AgTable_Ref.updateTableData([]) this.updateTableData([])
this.tableData = [] this.updateDownloadData([])
this.pageLoading = false 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){ headerSearchHandle(data){
this.getList() this.getList()
},
//
updateTableData(data){
this.$refs.AgTable_Ref.updateTableData(data)
},
//
updateDownloadData(data){
this.tableData = data
} }
}, },
}; };

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

@ -5,8 +5,9 @@
<!-- 搜索条件及按钮 --> <!-- 搜索条件及按钮 -->
<div class="FormHeader"> <div class="FormHeader">
<!-- 左侧查询 --> <!-- 左侧查询 -->
<div class="headerLeftSearch" v-if="searchConfig && searchConfig.length > 0"> <div class="headerLeftSearch">
<el-form <el-form
v-if="searchConfig && searchConfig.length > 0"
:inline="true" :inline="true"
:model="searchForm" :model="searchForm"
:rules="searchRules" :rules="searchRules"
@ -141,6 +142,7 @@ export default {
}, },
methods: { methods: {
initSearchConfig(){ initSearchConfig(){
if(!this.searchConfig){return}
this.searchConfig.forEach(item=>{ this.searchConfig.forEach(item=>{
item.options = [] item.options = []
if(item.type == 'select' && item.optionsProc){ if(item.type == 'select' && item.optionsProc){
@ -258,11 +260,13 @@ export default {
}, },
downloadExcelTitle(){ downloadExcelTitle(){
let _title = this.reportName let _title = this.reportName
if(this.searchForm){
let _begin = this.searchForm.beginDate ? this.searchForm.beginDate.slice(0,10) : '--' let _begin = this.searchForm.beginDate ? this.searchForm.beginDate.slice(0,10) : '--'
let _end = this.searchForm.endDate ? this.searchForm.endDate.slice(0,10) : '--' let _end = this.searchForm.endDate ? this.searchForm.endDate.slice(0,10) : '--'
if(this.searchForm.beginDate || this.searchForm.endDate){ if(this.searchForm.beginDate || this.searchForm.endDate){
_title = `${this.reportName} (${_begin}${_end})` _title = `${this.reportName} (${_begin}${_end})`
} }
}
return _title return _title
} }
}, },
@ -282,6 +286,7 @@ export default {
.headerRightBtn{ .headerRightBtn{
display:flex; display:flex;
justify-content: flex-end; justify-content: flex-end;
padding-bottom:18px;
.output-excel{ .output-excel{
margin-right:10px margin-right:10px

10
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 EQLevelReport from '../views/report/EQLevelReport.vue'
import outsourcingOutReport from '../views/report/outsourcingOutReport.vue' import outsourcingOutReport from '../views/report/outsourcingOutReport.vue'
import outsourcingReturnReport from '../views/report/outsourcingReturnReport.vue' import outsourcingReturnReport from '../views/report/outsourcingReturnReport.vue'
import stockPreparationReport from '../views/report/stockPreparationReport.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
@ -283,7 +284,14 @@ const routes = [
title:"委外退库报表", title:"委外退库报表",
} }
}, },
{
path: '/stockPreparationReport',
name: 'stockPreparationReport',
component: stockPreparationReport,
meta:{
title:"备料报表",
}
},
] ]
const router = new VueRouter({ const router = new VueRouter({

71
PC/UI.WinIn.FasterZ.AgGridReport/src/views/report/stockPreparationReport.vue

@ -0,0 +1,71 @@
<template>
<reportPage
ref="reportPage_Ref"
:columnList="columnDefs"
:BottomFixedItem="BottomFixedItem"
:reportName="'备料报表'"
:isSpecialData="true"
></reportPage>
</template>
<!-- :searchConfig="searchConfig"
:searchForm="searchForm" -->
<script>
import {getstockPreparationList} from "@/api/businessApi"
import reportPage from "@/components/reportPage/index"
import util from '@/utils/util'
export default {
name: "stockPreparationReport",
components: {
reportPage
},
data () {
return {
columnDefs: [
{ headerName:'物料代码',field: 'itemCode', filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'物料名称',field: 'itemName', filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'物料描述1',field: 'itemDesc1', filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'物料描述2',field: 'itemDesc2', filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'库位代码',field: 'locationCode', filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'当前数量',field: 'currentQty', type:"kiloNumber", cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'最小值',field: 'minQty', type:"kiloNumber", cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'最大值',field: 'maxQty', type:"kiloNumber", cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
{ headerName:'差异数',field: 'difference', type:"kiloNumber", cellClass: 'rightAlign', valueFormatter: ((data)=>{return util.numberFixedFormatter(data.value,true)}), filter: 'agTextColumnFilter', suppressMenu: true, floatingFilterComponentParams: { suppressFilterButton: true } },
],
columnOption:{
itemCode:"物料代码",
itemName:"物料名称",
itemDesc1:"物料描述1",
itemDesc2:"物料描述2",
locationCode:"库位代码",
currentQty:"当前数量",
minQty:"最小值",
maxQty:"最大值",
difference:"差异数",
},
searchConfig:[
{type:'select',prop:'ItemCode',label:'物料',optionsProc:'itemCode',options:[]},
{type:'select',prop:'SupplierCode',label:'供应商',optionsProc:'SupplierCode',options:[]},
{type:'date',prop:'beginDate',label:'起始'},
{type:'date',prop:'endDate',label:'截止'},
{type:'select',prop:'receiptType',noClear:true,label:'类型',optionsProc:'receiptType',options:[]},
],
searchForm:{
ItemCode:'',
SupplierCode:'',
beginDate:"",
endDate:'',
receiptType:null,
},
BottomFixedItem:['currentQty','minQty','maxQty','difference'],
};
},
created(){
getstockPreparationList().then(res=>{
this.$refs.reportPage_Ref.updateTableData(res)
this.$refs.reportPage_Ref.updateDownloadData(res)
})
},
};
</script>
Loading…
Cancel
Save