4 changed files with 403 additions and 0 deletions
@ -0,0 +1,386 @@ |
|||||
|
<template> |
||||
|
<div class="InventoryBookDetail_innerPage" v-loading="loading"> |
||||
|
<!-- 搜索 --> |
||||
|
<el-form :inline="true" :model="searchForm" size="small" class="searchHeader"> |
||||
|
<el-form-item label="库位"> |
||||
|
<el-input v-model="searchForm.locationCode" placeholder="请输入库位"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="零件"> |
||||
|
<el-input v-model="searchForm.itemCode" placeholder="请输入零件"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="开始时间"> |
||||
|
<el-date-picker |
||||
|
value-format="yyyy-MM-dd" |
||||
|
v-model="searchForm.beginDate" |
||||
|
type="date" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="结束时间"> |
||||
|
<el-date-picker |
||||
|
value-format="yyyy-MM-dd" |
||||
|
v-model="searchForm.endDate" |
||||
|
type="date" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click="searchHandle">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<!-- table --> |
||||
|
<div class="tableContent" v-if="tableData"> |
||||
|
<ul class="tableHeader"> |
||||
|
<li>{{tableHeader.companyName}}</li> |
||||
|
<li class="tableName">库存流水帐(料品)</li> |
||||
|
<li> |
||||
|
<div>交易年月: {{ getYearMonth(searchForm.beginDate) }} - {{ getYearMonth(searchForm.endDate) }}</div> |
||||
|
<div>制表日期:{{ getNow() }}</div> |
||||
|
</li> |
||||
|
</ul> |
||||
|
<!-- :span-method="verticalMergeCell" --> |
||||
|
<el-table |
||||
|
:data="tableData" |
||||
|
height="calc(100% - 200px)" |
||||
|
style="width: 90%;margin: 0 auto;" |
||||
|
> |
||||
|
<el-table-column |
||||
|
v-for="(item,key) in tableTh" |
||||
|
:prop="item.prop" |
||||
|
:label="item.label" |
||||
|
width="180" |
||||
|
> |
||||
|
<template slot-scope="scopeA"> |
||||
|
<!-- <div> |
||||
|
<span v-if="item.prop == 'itemCode'">{{ scopeA.row[item.prop] }}</span> |
||||
|
<div v-else> |
||||
|
<div v-for="level2 in scopeA.row.reportErpLocationSerialDtos"> |
||||
|
<div v-if="item.prop == 'erpLocatioCode'">{{ level2[item.prop] }}</div> |
||||
|
<div v-else> |
||||
|
<div v-for="level3 in level2.reportLocationSerialDtos">{{ level3[item.prop] }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-else> |
||||
|
<div v-for="level2 in scopeA.row.reportErpLocationSerialDtos"> |
||||
|
<div v-for="level3 in level2.reportLocationSerialDtos">{{ level3[item.prop] }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> --> |
||||
|
<div> |
||||
|
<span v-if="item.prop == 'itemCode'">{{ scopeA.row[item.prop] }}</span> |
||||
|
<div v-if="item.prop == 'erpLocatioCode'"> |
||||
|
<el-table |
||||
|
:show-header="false" |
||||
|
:data="scopeA.row.reportErpLocationSerialDtos" |
||||
|
> |
||||
|
<el-table-column |
||||
|
prop="erpLocatioCode" |
||||
|
> |
||||
|
<!-- <template slot-scope="scopeB"> |
||||
|
<div v-if="item.prop == 'erpLocatioCode'">{{ scopeB.reportLocationSerialDtos.erpLocatioCode }}</div> |
||||
|
</template> --> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<div v-else> |
||||
|
<el-table |
||||
|
:show-header="false" |
||||
|
:data="scopeA.row.reportErpLocationSerialDtos" |
||||
|
> |
||||
|
<el-table-column |
||||
|
prop="erpLocatioCode" |
||||
|
> |
||||
|
<template slot-scope="scopeB"> |
||||
|
<el-table |
||||
|
:show-header="false" |
||||
|
:data="scopeB.row.reportLocationSerialDtos" |
||||
|
> |
||||
|
<el-table-column |
||||
|
:prop="item.prop" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- <div v-else> |
||||
|
<div v-for="level2 in scope.row.reportErpLocationSerialDtos"> |
||||
|
<div v-for="level3 in level2.reportLocationSerialDtos">{{ level3[item.prop] }}</div> |
||||
|
</div> |
||||
|
</div> --> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { getInventoryTransactionSerials } from '@/api/wms-api' |
||||
|
export default { |
||||
|
name:"InventoryBookDetail_innerPage", |
||||
|
data(){ |
||||
|
return{ |
||||
|
loading:false, |
||||
|
tableData:[ |
||||
|
{ |
||||
|
"itemCode": "VW316C1A028A", |
||||
|
"itemName": "P000000000000053", |
||||
|
"itemDesc1": "后轮眉2内板注塑件右", |
||||
|
"itemDesc2": null, |
||||
|
"configuration": "", |
||||
|
"reportErpLocationSerialDtos": [ |
||||
|
{ |
||||
|
"erpLocatioCode": "TV", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportLocationSerialDtos": [ |
||||
|
{ |
||||
|
"locationCode": "TV", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
}, |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"erpLocatioCode": "TVB", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportLocationSerialDtos": [ |
||||
|
{ |
||||
|
"locationCode": "TVB", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
}, |
||||
|
{ |
||||
|
"locationCode": "TVB_A", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
}, |
||||
|
{ |
||||
|
"locationCode": "TVB_B", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
] |
||||
|
},{ |
||||
|
"itemCode": "222222222222222222", |
||||
|
"itemName": "P000000000000053", |
||||
|
"itemDesc1": "后轮眉2内板注塑件右", |
||||
|
"itemDesc2": null, |
||||
|
"configuration": "", |
||||
|
"reportErpLocationSerialDtos": [ |
||||
|
{ |
||||
|
"erpLocatioCode": "222-TV", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportLocationSerialDtos": [ |
||||
|
{ |
||||
|
"locationCode": "TV", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
}, |
||||
|
{ |
||||
|
"locationCode": "TV_A", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"erpLocatioCode": "2222-TVB", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportLocationSerialDtos": [ |
||||
|
{ |
||||
|
"locationCode": "TVB", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
}, |
||||
|
{ |
||||
|
"locationCode": "TVB_A", |
||||
|
"firstQty": 0, |
||||
|
"sumInQty": 0, |
||||
|
"sumOutQty": 0, |
||||
|
"nowQty": 0, |
||||
|
"lastQty": 0, |
||||
|
"reportTransactionSerialDtos": [] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
searchForm:{ |
||||
|
locationCode:'', |
||||
|
itemCode:'VW316C1A028A', |
||||
|
beginDate: '2023-07-01', |
||||
|
endDate: '2023-08-01', |
||||
|
}, |
||||
|
tableHeader:{ |
||||
|
companyName:localStorage.getItem('companyName') |
||||
|
}, |
||||
|
tableTh1:[ |
||||
|
{label:'1-itemCode',prop:'itemCode'}, |
||||
|
{label:'1-itemDesc1',prop:'itemDesc1'}, |
||||
|
{label:'1-itemDesc2',prop:'itemDesc2'}, |
||||
|
{label:'1-itemName',prop:'itemName'}, |
||||
|
], |
||||
|
tableTh2:[ |
||||
|
{label:'2-erpLocatioCode',prop:'erpLocatioCode'}, |
||||
|
{label:'2-firstQty',prop:'firstQty'}, |
||||
|
{label:'2-lastQty',prop:'lastQty'}, |
||||
|
{label:'2-nowQty',prop:'nowQty'}, |
||||
|
{label:'2-sumInQty',prop:'sumInQty'}, |
||||
|
{label:'2-sumOutQty',prop:'sumOutQty'}, |
||||
|
], |
||||
|
tableTh3:[ |
||||
|
{label:'3-firstQty',prop:'firstQty'}, |
||||
|
{label:'3-lastQty',prop:'lastQty'}, |
||||
|
{label:'3-locationCode',prop:'locationCode'}, |
||||
|
{label:'3-nowQty',prop:'nowQty'}, |
||||
|
{label:'3-sumInQty',prop:'sumInQty'}, |
||||
|
{label:'3-sumOutQty',prop:'sumOutQty'}, |
||||
|
], |
||||
|
tableTh:[ |
||||
|
{label:'产品代码',prop:'itemCode'}, |
||||
|
{label:'储位',prop:'erpLocatioCode'}, |
||||
|
{label:'firstQty',prop:'firstQty'}, |
||||
|
{label:'lastQty',prop:'lastQty'}, |
||||
|
{label:'locationCode',prop:'locationCode'}, |
||||
|
{label:'nowQty',prop:'nowQty'}, |
||||
|
{label:'sumInQty',prop:'sumInQty'}, |
||||
|
{label:'sumOutQty',prop:'sumOutQty'}, |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
}, |
||||
|
methods:{ |
||||
|
// 查询事件 |
||||
|
searchHandle(){ |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
// 年月转义 |
||||
|
getYearMonth(date){ |
||||
|
|
||||
|
}, |
||||
|
// 获取当前时间 |
||||
|
getNow(){ |
||||
|
|
||||
|
}, |
||||
|
// 获取表格数据 |
||||
|
getTableData(){ |
||||
|
this.loading = true |
||||
|
getInventoryTransactionSerials({ |
||||
|
itemCodes:this.searchForm.itemCode, |
||||
|
startDateTime:this.searchForm.beginDate, |
||||
|
endDateTime:this.searchForm.endDate, |
||||
|
}).then(res => { |
||||
|
console.log(res) |
||||
|
this.tableData = res |
||||
|
this.loading = false |
||||
|
}).catch(err => { |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}, |
||||
|
// 合并单元格 |
||||
|
verticalMergeCell({ row, column, rowIndex, columnIndex }) { |
||||
|
console.log(121,row, column, rowIndex, columnIndex) |
||||
|
if (columnIndex === 0) { |
||||
|
if (rowIndex % 2 === 0) { |
||||
|
return { |
||||
|
rowspan: 2, |
||||
|
colspan: 1 |
||||
|
}; |
||||
|
} else { |
||||
|
return { |
||||
|
rowspan: 0, |
||||
|
colspan: 0 |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.InventoryBookDetail_innerPage{ |
||||
|
background: #e6e6e6; |
||||
|
height: 100%; |
||||
|
|
||||
|
.searchHeader{ |
||||
|
background: #f1f1f1; |
||||
|
padding: 20px 30px 0; |
||||
|
border-bottom: 1px solid #dbdbdb; |
||||
|
} |
||||
|
|
||||
|
.el-form-item{ |
||||
|
margin-right: 25px !important; |
||||
|
} |
||||
|
.el-button{ |
||||
|
background: #205f78 !important; |
||||
|
border-color: #ddd; |
||||
|
border-radius: 2px; |
||||
|
} |
||||
|
|
||||
|
.el-form-item__label{ |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
|
||||
|
.el-input__inner{ |
||||
|
border-radius: 0px !important; |
||||
|
background: #ddd !important; |
||||
|
} |
||||
|
|
||||
|
.el-input__inner:focus, |
||||
|
.el-input__inner:hover{ |
||||
|
border-color: #ddd; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</style> |
Loading…
Reference in new issue