更新
This commit is contained in:
@@ -2,17 +2,49 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-01-14 16:34:33
|
||||
* @LastEditTime: 2022-01-17 14:06:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<head-form
|
||||
:placeholder-name="placeholderName"
|
||||
:key-name="keyName"
|
||||
@getDataList="getList"
|
||||
@add="addNew"
|
||||
/>
|
||||
<el-form ref="listQuery" :model="listQuery" :inline="true" label-width="120px" @keyup.enter.native="getList()">
|
||||
<el-form-item :label="$t('module.basicData.Warehouse.LocationName')" prop="currLocationId">
|
||||
<el-select
|
||||
v-model="listQuery.currLocationId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.Warehouse.LocationName')])"
|
||||
clearable
|
||||
filterable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in LocationList"
|
||||
:key="index"
|
||||
:label="item.locationName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.Warehouse.StorageBoxNumber')" prop="storageBoxId">
|
||||
<el-select
|
||||
v-model="listQuery.storageBoxId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.Warehouse.StorageBoxNumber')])"
|
||||
clearable
|
||||
filterable
|
||||
:style="{width: '100%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in storageBoxList"
|
||||
:key="index"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()">{{ 'btn.search' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="addNew()">{{ 'btn.add' | i18nFilter }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
@@ -39,13 +71,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { StorageBoxInfoList } from '@/api/basicData/Warehouse/StorageBoxInfo'
|
||||
import FactoryAdd from './components/StorageBoxInfoDetail.vue'
|
||||
import HeadForm from '@/components/basicData/HeadForm'
|
||||
import { StorageBoxRackList, StorageBoxRackDelete, StorageBoxRackCode, locationList } from '@/api/basicData/Warehouse/StorageBoxInfo'
|
||||
import FactoryAdd from './components/StorageBoxRack-add.vue'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import { timeFormatter } from '@/filters'
|
||||
import warehouse from '@/filters/basicData/warehouse'
|
||||
import i18n from '@/lang'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
@@ -65,8 +97,12 @@ import i18n from '@/lang'
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'see',
|
||||
btnName: 'btn.see'
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: 'btn.delete'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
@@ -79,34 +115,35 @@ const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: i18n.t('module.basicData.Warehouse.StorageBoxNumber'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: i18n.t('module.basicData.Warehouse.BoxStatus'),
|
||||
filter: warehouse('enableState'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'locationName',
|
||||
prop: 'currLocation',
|
||||
label: i18n.t('module.basicData.Warehouse.LocationName'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'locationCode',
|
||||
prop: 'currLocationName',
|
||||
label: i18n.t('module.basicData.Warehouse.LocationCode'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'isEmpty',
|
||||
label: i18n.t('module.basicData.Warehouse.IsEmptyBox'),
|
||||
filter: warehouse('yesOrNo'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'StorageBoxInfo',
|
||||
components: { Pagination, BaseTable, MethodBtn, HeadForm, FactoryAdd },
|
||||
components: { Pagination, BaseTable, MethodBtn, FactoryAdd },
|
||||
filters: {
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
@@ -127,26 +164,57 @@ export default {
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
LocationList: [],
|
||||
storageBoxList: [],
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
name: '',
|
||||
code: ''
|
||||
storageBoxId: '',
|
||||
currLocationId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
const listQuery1 = {
|
||||
current: 1,
|
||||
size: 100
|
||||
}
|
||||
locationList(listQuery1).then(response => {
|
||||
this.LocationList = response.data
|
||||
})
|
||||
StorageBoxRackCode(listQuery1).then(res => {
|
||||
this.storageBoxList = res.data.records
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
this.addNew(raw.data.id)
|
||||
console.log(raw)
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.code}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
StorageBoxRackDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
getList(key) {
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.listQuery.code = key
|
||||
StorageBoxInfoList(this.listQuery).then(response => {
|
||||
StorageBoxRackList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user