2022-03-07 09:17:12 +08:00
|
|
|
<!--
|
|
|
|
* @Author: zwq
|
|
|
|
* @Date: 2020-12-29 15:41:11
|
|
|
|
* @LastEditors: zwq
|
2022-03-09 14:19:03 +08:00
|
|
|
* @LastEditTime: 2022-03-09 09:57:41
|
2022-03-07 09:17:12 +08:00
|
|
|
* @Description:
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div style="margin:10px 50px">
|
|
|
|
<el-button type="success" @click="goback()">{{ 'btn.back' | i18nFilter }}</el-button>
|
|
|
|
<el-button type="primary" @click="addNew()">{{ 'btn.add' | i18nFilter }}</el-button>
|
|
|
|
</div>
|
|
|
|
<base-table
|
|
|
|
:page="listQuery.current"
|
|
|
|
:limit="listQuery.size"
|
|
|
|
:table-config="tableProps"
|
|
|
|
:table-data="list"
|
|
|
|
:is-loading="listLoading"
|
|
|
|
>
|
|
|
|
<method-btn
|
|
|
|
slot="handleBtn"
|
|
|
|
:width="trueWidth"
|
|
|
|
:method-list="tableBtn"
|
|
|
|
@clickBtn="handleClick"
|
|
|
|
/>
|
|
|
|
</base-table>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import i18n from '@/lang'
|
|
|
|
import BaseTable from '@/components/BaseTable'
|
|
|
|
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
|
|
|
import { timeFormatter } from '@/filters'
|
|
|
|
/**
|
|
|
|
* 表格表头配置项 TypeScript接口注释
|
|
|
|
* tableConfig<ConfigItem> = []
|
|
|
|
*
|
|
|
|
* Interface ConfigItem = {
|
|
|
|
* prop: string,
|
|
|
|
* label: string,
|
|
|
|
* width: string,
|
|
|
|
* align: string,
|
|
|
|
* subcomponent: function,
|
|
|
|
* filter: function
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
const tableBtn = [
|
|
|
|
{
|
|
|
|
type: 'delete',
|
|
|
|
btnName: 'btn.delete'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
const tableProps = [
|
|
|
|
{
|
|
|
|
prop: 'code',
|
|
|
|
label: i18n.t('module.basicData.cache.LocationCode'),
|
|
|
|
filter: timeFormatter,
|
|
|
|
align: 'center'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'name',
|
|
|
|
label: i18n.t('module.basicData.cache.LocationName'),
|
|
|
|
align: 'center'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'shelfName',
|
|
|
|
label: i18n.t('module.basicData.cache.locationType'),
|
|
|
|
align: 'center'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Shelf',
|
2022-03-09 14:19:03 +08:00
|
|
|
components: { BaseTable, MethodBtn },
|
2022-03-07 09:17:12 +08:00
|
|
|
filters: {
|
|
|
|
statusFilter(status) {
|
|
|
|
const statusMap = {
|
|
|
|
published: 'success',
|
|
|
|
draft: 'info',
|
|
|
|
deleted: 'danger'
|
|
|
|
}
|
|
|
|
return statusMap[status]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tableBtn,
|
|
|
|
trueWidth: 200,
|
|
|
|
tableProps,
|
|
|
|
list: [],
|
|
|
|
listLoading: true,
|
|
|
|
listQuery: {
|
|
|
|
current: 1,
|
|
|
|
size: 990,
|
|
|
|
areaId: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.listQuery.areaId = this.$route.query.id
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleClick(raw) {
|
|
|
|
if (raw.type === 'delete') {
|
|
|
|
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.name}]?`, this.$t('module.basicData.visual.Tips'), {
|
|
|
|
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
|
|
|
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
// shelfDelete(raw.data.id).then(response => {
|
|
|
|
// this.$message({
|
|
|
|
// message: this.$t('module.basicData.visual.success'),
|
|
|
|
// type: 'success',
|
|
|
|
// duration: 1500,
|
|
|
|
// onClose: () => {
|
|
|
|
// this.getList()
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
}).catch(() => {})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
getList(key) {
|
|
|
|
this.listLoading = true
|
|
|
|
// shelfList(this.listQuery).then(response => {
|
|
|
|
// if (response.data.records) {
|
|
|
|
// this.list = response.data.records
|
|
|
|
// } else {
|
|
|
|
// this.list.splice(0, this.list.length)
|
|
|
|
// }
|
|
|
|
this.listLoading = false
|
|
|
|
// })
|
|
|
|
},
|
|
|
|
// 新增 / 修改
|
|
|
|
addNew(id) {
|
2022-03-09 14:19:03 +08:00
|
|
|
this.$router.push({
|
|
|
|
name: 'ProcessStorageLink',
|
|
|
|
query: {
|
|
|
|
dictTypeId: id
|
|
|
|
}
|
2022-03-07 09:17:12 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
goback() {
|
|
|
|
this.$router.go(-1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.edit-input {
|
|
|
|
padding-right: 100px;
|
|
|
|
}
|
|
|
|
.cancel-btn {
|
|
|
|
position: absolute;
|
|
|
|
right: 15px;
|
|
|
|
top: 10px;
|
|
|
|
}
|
|
|
|
</style>
|