Merge pull request '修改bug' (#74) from zwq into develop
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #74
This commit is contained in:
朱文强 2022-03-18 09:50:40 +08:00
commit 114bfeccf3
2 changed files with 33 additions and 24 deletions

View File

@ -2,7 +2,7 @@
* @Author: gtz * @Author: gtz
* @Date: 2022-03-03 09:16:10 * @Date: 2022-03-03 09:16:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-03-17 10:56:14 * @LastEditTime: 2022-03-18 09:25:04
* @Description: file content * @Description: file content
* @FilePath: \mt-ck-wms-ui\src\views\basicData\Warehouse\components\processStorageLink.vue * @FilePath: \mt-ck-wms-ui\src\views\basicData\Warehouse\components\processStorageLink.vue
--> -->
@ -151,17 +151,15 @@
}" }"
/> />
<div <div
:class=" v-if="
StorageList.some( StorageList.some(
StorageItem => StorageItem =>
StorageItem.id === StorageItem.id ===
z.portVoList[ z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1) (current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id ].id
) )"
? 'dashboard-layout-item-horn' class="dashboard-layout-item-horn"
: ''
"
/> />
{{ {{
z.portVoList[ z.portVoList[
@ -282,17 +280,15 @@
}" }"
/> />
<div <div
:class=" v-if="
StorageList.some( StorageList.some(
StorageItem => StorageItem =>
StorageItem.id === StorageItem.id ===
z.portVoList[ z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1) (current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id ].id
) )"
? 'dashboard-layout-item-horn' class="dashboard-layout-item-horn"
: ''
"
/> />
{{ {{
z.portVoList[ z.portVoList[
@ -376,17 +372,15 @@
}" }"
/> />
<div <div
:class=" v-if="
StorageList.some( StorageList.some(
StorageItem => StorageItem =>
StorageItem.id === StorageItem.id ===
z.portVoList[ z.portVoList[
(current - 1) * 80 + (item - 1) * 20 + (x - 1) (current - 1) * 80 + (item - 1) * 20 + (x - 1)
].id ].id
) )"
? 'dashboard-layout-item-horn' class="dashboard-layout-item-horn"
: ''
"
/> />
{{ {{
z.portVoList[ z.portVoList[
@ -457,7 +451,7 @@ export default {
if (response.data.records) { if (response.data.records) {
this.StorageList = response.data.records this.StorageList = response.data.records
} else { } else {
this.StorageList.splice(0, this.list.length) this.StorageList.splice(0, this.StorageList.length)
} }
}) })
this.selectStorageList.splice(0, this.selectStorageList.length) this.selectStorageList.splice(0, this.selectStorageList.length)
@ -476,9 +470,13 @@ export default {
1 1
) )
} else { } else {
const isExist = this.StorageList.some(
StorageItem =>
StorageItem.id === item.id
)
this.typeVisible = true this.typeVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.typeRef.init(item.id, item.name) this.$refs.typeRef.init(item.id, item.name, item.attribute, isExist)
}) })
} }
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2020-12-29 16:37:56 * @Date: 2020-12-29 16:37:56
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-03-16 09:47:01 * @LastEditTime: 2022-03-18 09:39:09
* @Description: * @Description:
--> -->
<template> <template>
@ -18,9 +18,9 @@
label-position="left" label-position="left"
> >
<el-form-item :label="$t('module.basicData.Warehouse.SelectStorageType')" prop="portAttrId"> <el-form-item :label="$t('module.basicData.Warehouse.SelectStorageType')" prop="portAttrId">
<el-radio v-model="dataForm.portAttrId" :label="1">Working Port</el-radio> <el-radio v-model="dataForm.portAttrId" label="1">Working Port</el-radio>
<el-radio v-model="dataForm.portAttrId" :label="2">Buffer Port</el-radio> <el-radio v-model="dataForm.portAttrId" label="2">Buffer Port</el-radio>
<el-radio v-model="dataForm.portAttrId" :label="3">Exception Port</el-radio> <el-radio v-model="dataForm.portAttrId" label="3">Exception Port</el-radio>
</el-form-item> </el-form-item>
<el-form-item :label="$t('module.basicData.storageBox.name')" prop="storageId"> <el-form-item :label="$t('module.basicData.storageBox.name')" prop="storageId">
<el-select v-model="dataForm.storageId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.storageBox.name')])" clearable> <el-select v-model="dataForm.storageId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.storageBox.name')])" clearable>
@ -41,6 +41,7 @@
</template> </template>
<script> <script>
import { getPortDetail } from '@/api/dashboard'
import { storageBoxList } from '@/api/basicData/Cache/storageBox' import { storageBoxList } from '@/api/basicData/Cache/storageBox'
export default { export default {
@ -50,7 +51,7 @@ export default {
locationId: '', locationId: '',
locationName: '', locationName: '',
dataForm: { dataForm: {
portAttrId: 1, portAttrId: '1',
storageId: '' storageId: ''
}, },
dataRule: { dataRule: {
@ -65,7 +66,7 @@ export default {
} }
}, },
methods: { methods: {
init(id, name) { init(id, name, attribute, isExist) {
this.locationId = id this.locationId = id
this.locationName = name this.locationName = name
const listQuery = { const listQuery = {
@ -81,6 +82,16 @@ export default {
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (attribute) {
this.dataForm.portAttrId = attribute
} else {
this.dataForm.portAttrId = '1'
}
if (isExist) {
getPortDetail(id).then(res => {
if (res.code === 0) { this.dataForm.storageId = res.data.storageBoxId }
})
}
}) })
this.visible = true this.visible = true
}, },