'工序库位+报表'
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-03-04 20:54:54
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2022-03-04 21:09:44
|
||||
* @LastEditTime: 2022-03-06 16:37:29
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<head-form
|
||||
:placeholder-name="placeholderName"
|
||||
:key-name="keyName"
|
||||
:show-add="false"
|
||||
@getDataList="getList"
|
||||
@add="addNew"
|
||||
/>
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
@@ -21,12 +21,12 @@
|
||||
:table-data="list"
|
||||
:is-loading="listLoading"
|
||||
>
|
||||
<method-btn
|
||||
<!-- <method-btn
|
||||
slot="handleBtn"
|
||||
:width="trueWidth"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
/> -->
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -43,10 +43,7 @@
|
||||
import HeadForm from '@/components/basicData/HeadForm'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import { storageBoxList, storageBoxDelete } from '@/api/basicData/Cache/storageBox'
|
||||
import { timeFormatter } from '@/filters'
|
||||
import basicData from '@/filters/basicData'
|
||||
import { list } from '@/api/report-manage/report'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
* tableConfig<ConfigItem> = []
|
||||
@@ -74,43 +71,41 @@ const tableBtn = [
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: i18n.t('module.basicData.factory.createTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'storageBoxName',
|
||||
label: i18n.t('module.basicData.storageBox.name'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: i18n.t('module.basicData.storageBox.code'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'enName',
|
||||
label: i18n.t('module.basicData.visual.EnglishName'),
|
||||
label: i18n.t('module.report.inventory.code'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: i18n.t('module.basicData.storageBox.status'),
|
||||
filter: basicData('storage'),
|
||||
label: i18n.t('module.report.inventory.status'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'note',
|
||||
label: i18n.t('module.basicData.storageBox.remark'),
|
||||
prop: 'inprocessCode',
|
||||
label: i18n.t('module.report.inventory.inprocessCode'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'currentLocation',
|
||||
label: i18n.t('module.report.inventory.currentLocation'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'storeTime',
|
||||
label: i18n.t('module.report.inventory.storeTime'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'manual',
|
||||
label: i18n.t('module.report.inventory.manual'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'Area',
|
||||
components: { Pagination, BaseTable, MethodBtn, HeadForm },
|
||||
name: 'Inventory',
|
||||
components: { Pagination, BaseTable, HeadForm },
|
||||
filters: {
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
@@ -124,13 +119,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
keyName: i18n.t('module.basicData.visual.keyword'),
|
||||
placeholderName: this.$t('module.basicData.storageBox.name') + this.$t('module.basicData.visual.Or') + this.$t('module.basicData.storageBox.code'),
|
||||
keyName: i18n.t('module.report.reportList.storageBoxNumber'),
|
||||
placeholderName: this.$t('module.report.reportList.queryFiltering'),
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
areaList: [],
|
||||
total: 0,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
@@ -143,50 +137,52 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.storageBoxName}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
storageBoxDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else if (raw.type === 'edit') {
|
||||
this.addNew(raw.data.id)
|
||||
} else {
|
||||
this.addNew(raw.data.id, true)
|
||||
}
|
||||
},
|
||||
// handleClick(raw) {
|
||||
// if (raw.type === 'delete') {
|
||||
// this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.storageBoxName}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
// confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
// cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// storageBoxDelete(raw.data.id).then(response => {
|
||||
// this.$message({
|
||||
// message: this.$t('module.basicData.visual.success'),
|
||||
// type: 'success',
|
||||
// duration: 1500,
|
||||
// onClose: () => {
|
||||
// this.getList()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// }).catch(() => {})
|
||||
// } else if (raw.type === 'edit') {
|
||||
// this.addNew(raw.data.id)
|
||||
// } else {
|
||||
// this.addNew(raw.data.id, true)
|
||||
// }
|
||||
// },
|
||||
getList(key) {
|
||||
this.listLoading = true
|
||||
this.listQuery.storageBoxName = key
|
||||
storageBoxList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
this.listQuery.code = key
|
||||
console.log(this.listQuery)
|
||||
list(this.listQuery).then(response => {
|
||||
console.log(response)
|
||||
if (response.data) {
|
||||
this.list = response.data
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
// this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true)
|
||||
})
|
||||
}
|
||||
// 新增 / 修改
|
||||
// addNew(id) {
|
||||
// this.addOrUpdateVisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id, true)
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user