所有模块数据
This commit is contained in:
@@ -42,8 +42,9 @@ 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 { timeFormatter } from '@/filters'
|
||||
import i18n from '@/lang'
|
||||
import { getHWList } from '@/utils/wmsDic'
|
||||
import moment from 'moment'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
* tableConfig<ConfigItem> = []
|
||||
@@ -79,8 +80,7 @@ const tableBtn = [
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: i18n.t('module.basicData.factory.createTime'),
|
||||
filter: timeFormatter
|
||||
label: i18n.t('module.basicData.factory.createTime')
|
||||
},
|
||||
{
|
||||
prop: 'name1',
|
||||
@@ -166,7 +166,7 @@ export default {
|
||||
console.log(raw)
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.name}]?`,
|
||||
`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.name1}]?`,
|
||||
this.$t('module.basicData.visual.Tips'),
|
||||
{
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
@@ -186,23 +186,31 @@ export default {
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data)
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(raw.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = false
|
||||
this.listQuery.key = this.headFormValue.name
|
||||
this.list = [
|
||||
{
|
||||
id: 1,
|
||||
name1: 'A区',
|
||||
name2: '2022040696',
|
||||
name3: '成品',
|
||||
name4: '空闲',
|
||||
name5: '开',
|
||||
name6: '关'
|
||||
}
|
||||
]
|
||||
const temp = []
|
||||
const num = 20
|
||||
for (let i = 0; i < num; i++) {
|
||||
const obj = {}
|
||||
const sj = Math.floor(Math.random() * 720 + 10)
|
||||
obj.createTime = moment().subtract(sj, 'days').subtract(sj, 'hour').subtract(sj, 'minutes').subtract(sj, 'seconds').format('YYYY-MM-DD hh:mm:ss')
|
||||
obj.name2 = getHWList()
|
||||
obj.name1 = obj.name2[2] + '区'
|
||||
obj.name3 = obj.name2
|
||||
obj.name4 = parseInt(Math.random() * 2) ? '有货' : '无货'
|
||||
obj.name5 = parseInt(Math.random() * 2) ? 'Y' : 'N'
|
||||
obj.name6 = parseInt(Math.random() * 2) ? 'Y' : 'N'
|
||||
temp.push(obj)
|
||||
}
|
||||
this.list = temp
|
||||
this.total = num
|
||||
},
|
||||
btnClick(val) {
|
||||
this.headFormValue = val
|
||||
@@ -213,15 +221,11 @@ export default {
|
||||
},
|
||||
clickTopBtn(val) {
|
||||
if (val === 'add') {
|
||||
this.addNew()
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(row) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user