wms-njlm/src/views/asrs/warehouseStorehouseStorageHistory/index.vue
2023-10-08 15:58:29 +08:00

225 lines
5.0 KiB
Vue

<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id" :prop-type="'2'"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="process" label="工序">
<template slot-scope="scope">
<span>
{{
scope.row.process >= 0 ? processArr[scope.row.process].name : ''
}}
</span>
</template>
</el-table-column>
<el-table-column prop="createDate" label="出入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createDate) }}</span>
</template>
</el-table-column>
<el-table-column
prop="warehouseStorehouseStorageState"
label="出入库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseStorageState >= 0
? warehouseStorehouseStorageState[
scope.row.warehouseStorehouseStorageState
].name
: ''
}}
</span>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { getWarehouseStorehouseStoragePage } from '@/api/asrs/warehouseStorehouseStorage';
const warehouseStorehouseStorageState = [
{
name: '入库',
id: 0,
},
{
name: '出库',
id: 1,
},
{
name: '移库',
id: 2,
},
];
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehouseStoragePage,
},
processArr,
tableData: [],
warehouseStorehouseStorageState,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'kcode',
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'tcode',
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseStorageState,
param: 'state',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '出入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd hh:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
product,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.kcode;
this.listQuery.trayCode = val.tcode;
this.listQuery.warehouseStorehouseStorageState =val.state;
this.listQuery.createTime = val.searchTime;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>