11-wms/src/views/wmsInventoryManagement/locationQuery.vue
2022-10-21 16:40:09 +08:00

142 lines
3.2 KiB
Vue

<template>
<div class="app-container">
<head-form :form-config="headFormConfig" @headBtnClick="btnClick" />
<base-table
:page="listQuery.current"
:limit="listQuery.size"
:height="tableH"
:table-config="tableProps"
:table-data="list"
:is-loading="listLoading"
@clickTopBtn="clickTopBtn"
/>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
@pagination="getList()"
/>
</div>
</template>
<script>
import HeadForm from '@/components/basicData/HeadForm'
import BaseTable from '@/components/BaseTable'
import Pagination from '@/components/Pagination'
import { tableHeight } from '@/utils/index'
import { getHWList, getStoreList } from '@/utils/wmsDic'
const tableProps = [
{
prop: 'goodsAreaCode',
label: '货位编码'
},
{
prop: 'goodsAreaName',
label: '货位名称'
},
{
prop: 'goodsAreaStatus',
label: '货位状态'
},
{
prop: 'roadway',
label: '巷道'
},
{
prop: 'storeArea',
label: '库区'
},
{
prop: 'store',
label: '仓库'
},
{
prop: 'warehousingLock',
label: '入库锁'
},
{
prop: 'outboundLock',
label: '出库锁'
}
]
export default {
name: 'LocationQuery',
components: { HeadForm, BaseTable, Pagination },
data() {
return {
headFormConfig: [
{
type: 'input',
label: '关键字',
placeholder: '盘点单号,品名,物料编码',
param: 'name',
width: 250
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime'
},
{
type: 'button',
btnName: 'btn.search',
name: 'search',
color: 'primary'
}
],
listQuery: {
current: 1,
size: 20
},
tableH: tableHeight(275),
tableProps,
list: [],
listLoading: false,
total: 0,
showTitle: ''
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = tableHeight(275)
})
this.getList()
},
methods: {
getList() {
const temp = []
const num = 20
for (let i = 0; i < num; i++) {
const obj = {}
obj.goodsAreaCode = getHWList()
obj.goodsAreaName = obj.goodsAreaCode
obj.goodsAreaStatus = parseInt(Math.random() * 2) ? '有货' : '无货'
obj.roadway = '巷道' + Math.floor(Math.random() * 15 + 1)
obj.storeArea = obj.goodsAreaCode[2] + '区'
obj.store = getStoreList()
obj.warehousingLock = parseInt(Math.random() * 2) ? 'Y' : 'N'
obj.outboundLock = parseInt(Math.random() * 2) ? 'Y' : 'N'
temp.push(obj)
}
this.list = temp
this.total = num
},
btnClick(val) {
console.log(val)
this.getList()
},
clickTopBtn(val) {
console.log(val)
this.$refs.inStoreDocumentsAdd.init()
this.showTitle = '新增'
}
}
}
</script>