'修改bug'
This commit is contained in:
@@ -4,32 +4,65 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-03-04 11:12:42
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2022-03-06 19:17:36
|
||||
* @LastEditTime: 2022-03-09 16:12:04
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.locationId ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-form ref="dataForm" :model="dataForm" label-width="130px" @keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item :label="$t('module.basicData.processLocation.sequence')" prop="sequence">
|
||||
<el-input v-model="dataForm.sequence" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.sequence')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.processLocation.workSequenId')" prop="workSequenId">
|
||||
<el-input v-model="dataForm.workSequenId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.workSequenId')])" clearable />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.basicData.processLocation.locationName')" prop="locationName">
|
||||
<el-input v-model="dataForm.locationId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.locationName')])" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.basicData.processLocation.locationName')" prop="locationName">
|
||||
<el-input v-model="dataForm.locationName" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.locationName')])" clearable />
|
||||
<el-select v-model="dataForm.locationName" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.locationName')])">
|
||||
<el-option
|
||||
v-for="item in dataForm"
|
||||
:key="item.locationName"
|
||||
:label="item.locationName"
|
||||
:value="item.locationName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.processLocation.locationId')" prop="locationId">
|
||||
<el-input v-model="dataForm.locationId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.locationId')])" clearable />
|
||||
<el-form-item :label="$t('module.basicData.processLocation.portAttrId')" prop="portAttrId">
|
||||
<el-input v-model="dataForm.portAttrId" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.portAttrId')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.processLocation.isProcess')" prop="isProcess">
|
||||
<!-- <el-form-item :label="$t('module.basicData.processLocation.isProcess')" prop="isProcess">
|
||||
<el-input v-model="dataForm.isProcess" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.isProcess')])" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.basicData.processLocation.isProcess')" prop="isProcess">
|
||||
<el-select v-model="dataForm.isProcess" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.isProcess')])">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.processLocation.equipmentMark')" prop="equipmentMark">
|
||||
<el-input v-model="dataForm.equipmentMark" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.equipmentMark')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.processLocation.sequence')" prop="sequence">
|
||||
<el-input v-model="dataForm.sequence" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.sequence')])" clearable />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.basicData.processLocation.goodsShelves')" prop="goodsShelves">
|
||||
<el-input v-model="dataForm.goodsShelves" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.goodsShelves')])" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('module.basicData.processLocation.goodsShelves')" prop="goodsShelves">
|
||||
<el-select v-model="dataForm.goodsShelves" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.processLocation.goodsShelves')])">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
@@ -39,40 +72,88 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { detail, update, add } from '@/api/basicData/Cache/processLocation'
|
||||
import { detail, update, add, locationList } from '@/api/basicData/Cache/processLocation'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
sequence: '',
|
||||
locationName: '',
|
||||
isProcess: '',
|
||||
equipmentMark: ''
|
||||
},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
locationId: '',
|
||||
workSequenId: '',
|
||||
locationId: '',
|
||||
portAttrId: '',
|
||||
isProcess: '',
|
||||
equipmentMark: '',
|
||||
sequence: '',
|
||||
goodsShelves: '',
|
||||
locationName: ''
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: this.$t('module.basicData.processLocation.CacheLocation')
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: this.$t('module.basicData.processLocation.ProcessLocation')
|
||||
}
|
||||
],
|
||||
options2: [
|
||||
{
|
||||
value: 0,
|
||||
label: this.$t('module.basicData.processLocation.aShelf')
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: this.$t('module.basicData.processLocation.bShelf')
|
||||
}
|
||||
],
|
||||
// options3: [
|
||||
// {
|
||||
// value: this.dataForm.locationId,
|
||||
// label: this.dataForm.locationName
|
||||
// }
|
||||
// ],
|
||||
listQuery: {
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(LocationId) {
|
||||
this.listQuery.LocationId = LocationId || ''
|
||||
init(id) {
|
||||
this.listQuery.id = id || ''
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.listQuery.LocationId) {
|
||||
locationList().then(res => {
|
||||
// console.log(res)
|
||||
// this.dataForm.locationId = res.data.id'
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
this.dataForm.locationId = res.data[i].id
|
||||
this.dataForm.locationName = res.data[i].locationName
|
||||
}
|
||||
// console.log(this.dataForm)
|
||||
})
|
||||
// portAttrList().then(res => {
|
||||
// console.log(res)
|
||||
// })
|
||||
// workSequenList().then(res => {
|
||||
// console.log(res)
|
||||
// })
|
||||
// console.log(this.listQuery)
|
||||
if (this.listQuery.id) {
|
||||
// list(this.listQuery).then(res =>{
|
||||
// this.list = response.data.records
|
||||
// })
|
||||
detail(this.dataForm.id).then(res => {
|
||||
this.dataForm = res.data
|
||||
detail(this.listQuery.id).then(res => {
|
||||
this.dataForm.equipmentMark = res.data.equipmentMark
|
||||
this.dataForm.goodsShelves = res.data.goodsShelves
|
||||
this.dataForm.id = res.data.id
|
||||
this.dataForm.isProcess = res.data.isProcess
|
||||
this.dataForm.portAttrId = res.data.portAttrId
|
||||
this.dataForm.sequence = res.data.sequence
|
||||
this.dataForm.workSequenId = res.data.workSequenId
|
||||
console.log(this.dataForm)
|
||||
})
|
||||
} else {
|
||||
// storageBoxCode().then(res => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-03-03 09:51:25
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2022-03-06 19:15:25
|
||||
* @LastEditTime: 2022-03-08 16:56:40
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
@@ -35,7 +35,7 @@
|
||||
:limit.sync="listQuery.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
<processInfo-add v-if="addOrUpdateVisible" ref="addOrUpdate" :cache-id="listQuery.cacheId" @refreshDataList="getList" />
|
||||
<processInfo-add v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -46,7 +46,6 @@ import processInfoAdd from './components/processInfo-add'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import { list, locaDelete } from '@/api/basicData/Cache/processLocation'
|
||||
import { timeFormatter } from '@/filters'
|
||||
/**
|
||||
* 表格表头配置项 TypeScript接口注释
|
||||
* tableConfig<ConfigItem> = []
|
||||
@@ -75,24 +74,8 @@ const tableBtn = [
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: i18n.t('module.basicData.factory.createTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'sequence',
|
||||
label: i18n.t('module.basicData.processLocation.sequence'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'locationName',
|
||||
label: i18n.t('module.basicData.processLocation.locationName'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'isProcess',
|
||||
label: i18n.t('module.basicData.processLocation.isProcess'),
|
||||
prop: 'workSequenId',
|
||||
label: i18n.t('module.basicData.processLocation.workSequenId'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
@@ -101,14 +84,34 @@ const tableProps = [
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workSequenId',
|
||||
label: i18n.t('module.basicData.processLocation.workSequenId'),
|
||||
prop: 'portAttrId',
|
||||
label: i18n.t('module.basicData.processLocation.portAttrId'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'isProcess',
|
||||
label: i18n.t('module.basicData.processLocation.isProcess'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentMark',
|
||||
label: i18n.t('module.basicData.processLocation.equipmentMark'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'sequence',
|
||||
label: i18n.t('module.basicData.processLocation.sequence'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'goodsShelves',
|
||||
label: i18n.t('module.basicData.processLocation.goodsShelves'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'locationName',
|
||||
label: i18n.t('module.basicData.processLocation.locationName'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -152,12 +155,11 @@ export default {
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.locationName}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.id}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log(raw.data)
|
||||
locaDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
@@ -170,9 +172,9 @@ export default {
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else if (raw.type === 'edit') {
|
||||
this.addNew(raw.data.locationId)
|
||||
this.addNew(raw.data.id)
|
||||
} else {
|
||||
this.addNew(raw.data.locationId, true)
|
||||
this.addNew(raw.data.id, true)
|
||||
}
|
||||
},
|
||||
getList(key) {
|
||||
@@ -185,7 +187,7 @@ export default {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user