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

246 lines
5.4 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"></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="cacheLocation" label="缓存库位">
<template slot-scope="scope">
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
</template>
</el-table-column>
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseState>=0
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
.name
: ''
}}
</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: {id:scope.row}, type: 'edit' })"
v-hasPermi="[
'asrs:warehouse-storehouse-goods-specification:update',
]">
<span class="iconfont icon-edit primary-color"></span>
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getWarehouseStorehousePage, } from "@/api/asrs/warehouseStorehouse";
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
const warehouseStorehouseState = [
{
name: '空',
id: 0,
},
{
name: '锁定',
id: 1,
},
{
name: '满',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
tableData: [],
processArr,
warehouseStorehouseState,
bPage: true,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '产品名',
placeholder: '产品名',
param: 'pname',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'pcode',
},
{
type: 'select',
label: '工序',
selectOptions: processArr,
param: 'processId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
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: {
AddOrUpdate,
product,
},
created() {
this.listQuery.warehouseId = this.bId;
},
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.code;
this.listQuery.goodName = val.pname;
this.listQuery.goodCode = val.pcode;
this.listQuery.process = val.processId;
this.listQuery.warehouseStorehouseState = val.warehouseStorehouseStateId;
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>