NEZ-2369 fix : models新建Brand成功后在搜索条件不显示,重新刷新此模块才显示

This commit is contained in:
likexuan
2022-11-08 14:32:47 +08:00
parent 6505e4ee00
commit bcb2be33aa
2 changed files with 13 additions and 0 deletions

View File

@@ -73,6 +73,7 @@
import selectWalk from '../../popBox/selectWalk'
import editRigthBox from '../../mixin/editRigthBox'
import { sysObjectIdInput } from '@/components/common/js/validate'
import bus from '@/libs/bus'
export default {
name: 'modelBox',
@@ -184,6 +185,7 @@ export default {
if (typeof this.editModel.brandId === 'string') { // 判断是否是新增的
this.$post(this.brandUrl, { name: this.editModel.brandId }).then(res => {
if (res.code === 200) { // 新增成功
bus.$emit('refreshBrand')
this.getBrandList().then(res2 => { // 新增成功后重新调用getBrandList刷新brandList
const newBrand = this.brandList.find(b => b.name === this.editModel.brandId) // 取出刚新增的brand对象
if (newBrand) {