This commit is contained in:
2022-01-13 10:45:55 +08:00
parent 9673c1ba30
commit 7bc184c9c7
18 changed files with 548 additions and 424 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2020-12-29 16:37:56
* @LastEditors: zwq
* @LastEditTime: 2021-04-28 10:07:44
* @LastEditTime: 2022-01-11 16:26:29
* @enName:
-->
<template>
@@ -16,8 +16,8 @@
label-width="140px"
>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.cache.CacheName')" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.CacheName')])" clearable :style="{width: '100%'}" />
<el-form-item :label="$t('module.basicData.cache.CacheName')" prop="tareaName">
<el-input v-model="dataForm.tareaName" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.CacheName')])" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="8">
@@ -36,64 +36,14 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.Manufacturer')" prop="manufacturer">
<el-input
v-model="dataForm.manufacturer"
:disabled="isdetail"
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Manufacturer')])"
clearable
:style="{width: '100%'}"
/>
<el-form-item :label="$t('module.basicData.visual.Specs')" prop="spec">
<el-input v-model="dataForm.spec" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Specs')])" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.Specs')" prop="description">
<el-input v-model="dataForm.description" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Specs')])" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.productionTime')" prop="productionTime">
<el-date-picker
v-model="dataForm.productionTime"
:disabled="isdetail"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:style="{width: '100%'}"
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.productionTime')])"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.enterTime')" prop="enterTime">
<el-date-picker
v-model="dataForm.enterTime"
:disabled="isdetail"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:style="{width: '100%'}"
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.enterTime')])"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.debugTime')" prop="debugTime">
<el-date-picker
v-model="dataForm.debugTime"
:disabled="isdetail"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:style="{width: '100%'}"
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.debugTime')])"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.CurrentState')" prop="currentStatus">
<el-form-item :label="$t('module.basicData.visual.CurrentState')" prop="status">
<el-select
v-model="dataForm.currentStatus"
v-model="dataForm.status"
:disabled="isdetail"
:placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.CurrentState')])"
clearable
@@ -110,18 +60,18 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.cache.StockNumber')" prop="stockNumber">
<el-input-number v-model="dataForm.stockNumber" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.StockNumber')])" :step="1" />
<el-form-item :label="$t('module.basicData.cache.StockNumber')" prop="locationNum">
<el-input-number v-model="dataForm.locationNum" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.StockNumber')])" :step="1" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.cache.AreaNumber')" prop="areaNumber">
<el-input-number v-model="dataForm.areaNumber" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.AreaNumber')])" :step="1" />
<el-form-item :label="$t('module.basicData.cache.AreaNumber')" prop="shelfNum">
<el-input-number v-model="dataForm.shelfNum" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.cache.AreaNumber')])" :step="1" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Remarks')])" clearable :style="{width: '100%'}" />
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="note">
<el-input v-model="dataForm.note" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Remarks')])" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
@@ -130,7 +80,7 @@
<el-button type="success" @click="goback()">{{ 'btn.back' | i18nFilter }}</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.save' | i18nFilter }}</el-button>
<el-button v-if="listQuery.cacheId" type="primary" @click="addNew()">{{ $t('module.basicData.cache.addCacheArea') }}</el-button>
<el-button v-if="listQuery.id" type="primary" @click="addNew()">{{ $t('module.basicData.cache.addCacheArea') }}</el-button>
</span>
</div>
<div style="height:380px;overflow:auto">
@@ -148,7 +98,7 @@
/>
</base-table>
</div>
<cacheArea-add v-if="addOrUpdateVisible" ref="addOrUpdate" :cache-id="listQuery.cacheId" @refreshDataList="getList" />
<cacheArea-add v-if="addOrUpdateVisible" ref="addOrUpdate" :cache-id="listQuery.id" @refreshDataList="getList" />
</div>
</template>
@@ -159,7 +109,6 @@ import BaseTable from '@/components/BaseTable'
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
import cacheAreaAdd from './cacheArea-add.vue'
import shelfBtn from './shelfBtn.vue'
import { timeFormatter } from '@/filters'
const tableBtn = [
{
type: 'edit',
@@ -171,12 +120,6 @@ const tableBtn = [
}
]
const tableProps = [
{
prop: 'createTime',
label: i18n.t('module.basicData.factory.createTime'),
filter: timeFormatter,
align: 'center'
},
{
prop: 'name',
label: i18n.t('module.basicData.cache.AreaName'),
@@ -188,13 +131,23 @@ const tableProps = [
align: 'center'
},
{
prop: 'areaNumber',
prop: 'shelfNum',
label: i18n.t('module.basicData.cache.StorageQuantity'),
align: 'center'
},
{
prop: 'rowNum',
label: i18n.t('module.basicData.cache.rowNum'),
align: 'center'
},
{
prop: 'columnNum',
label: i18n.t('module.basicData.cache.columnNum'),
align: 'center'
},
{
prop: 'shelf',
label: i18n.t('module.basicData.cache.Shelf'),
label: i18n.t('module.basicData.cache.Location'),
subcomponent: shelfBtn,
align: 'center'
}
@@ -210,27 +163,23 @@ export default {
tableProps,
list: [],
dataForm: {
name: '',
tareaName: '',
code: '',
enName: '',
abbr: '',
manufacturer: '',
description: '',
productionTime: '',
enterTime: '',
debugTime: '',
currentStatus: '',
stockNumber: '',
areaNumber: '',
remark: ''
spec: '',
status: '',
locationNum: '',
shelfNum: '',
note: ''
},
listQuery: {
current: 1,
size: 990,
cacheId: ''
id: ''
},
rules: {
name: [{
tareaName: [{
required: true,
message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.cache.CacheName')]),
trigger: 'blur'
@@ -243,35 +192,35 @@ export default {
},
currentStatusOptions: [{
'label': '正常',
'value': '0'
'value': 0
}, {
'label': '暂停',
'value': '1'
'value': 1
}, {
'label': '维修',
'value': '2'
'value': 2
}],
cacheId: '',
id: '', // 缓存区id
isdetail: false
}
},
created() {
this.cacheId = this.$route.query.id
this.id = this.$route.query.id
this.init()
},
methods: {
init() {
this.isdetail = false
this.isdetail = Boolean(this.$route.query.isdetail)
this.listQuery.cacheId = ''
this.listQuery.id = ''
this.list.splice(0, this.list.length)
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.cacheId) {
cacheDetail(this.cacheId).then(res => {
if (this.id) {
cacheDetail(this.id).then(res => {
this.dataForm = res.data
})
this.listQuery.cacheId = this.cacheId
this.listQuery.id = this.id
areaList(this.listQuery).then(response => {
if (response.data.records) {
this.list = response.data.records
@@ -322,20 +271,16 @@ export default {
const data = {
'abbr': this.dataForm.abbr,
'code': this.dataForm.code,
'currentStatus': this.dataForm.currentStatus,
'debugTime': this.dataForm.debugTime,
'status': this.dataForm.status,
'enName': this.dataForm.enName,
'enterTime': this.dataForm.enterTime,
'manufacturer': this.dataForm.manufacturer,
'name': this.dataForm.name,
'productionTime': this.dataForm.productionTime,
'remark': this.dataForm.remark,
'description': this.dataForm.description,
'stockNumber': this.dataForm.stockNumber,
'areaNumber': this.dataForm.areaNumber,
'id': this.cacheId
'tareaName': this.dataForm.tareaName,
'note': this.dataForm.note,
'spec': this.dataForm.spec,
'locationNum': this.dataForm.locationNum,
'shelfNum': this.dataForm.shelfNum,
'id': this.id
}
if (this.cacheId) {
if (this.id) {
cacheUpdate(data).then(res => {
this.$message({
message: this.$t('module.basicData.visual.success'),
@@ -350,7 +295,7 @@ export default {
type: 'success',
duration: 1500
})
this.listQuery.cacheId = res.data.id
this.listQuery.id = res.data.id
})
}
}