Commit e3c7ac11 by zhangxw

bug修复

1 parent 9a96df48
...@@ -157,9 +157,8 @@ export default { ...@@ -157,9 +157,8 @@ export default {
} }
}, },
mounted() { async mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
this.isWatch = this.routeInfo.editType != 'add' this.isWatch = this.routeInfo.editType != 'add'
if (this.routeInfo.editType == 'edit') { if (this.routeInfo.editType == 'edit') {
...@@ -169,7 +168,8 @@ export default { ...@@ -169,7 +168,8 @@ export default {
let id = this.editFormData.findIndex(item => item.name == 'shopMerchantId') let id = this.editFormData.findIndex(item => item.name == 'shopMerchantId')
this.editFormData.splice(id, 1) this.editFormData.splice(id, 1)
} }
this.getServiceCenterList() await this.getServiceCenterList()
this.routeInfo.editType != 'add' ? await this.getInfo() : ''
this.findProByScene() this.findProByScene()
}, },
...@@ -183,13 +183,16 @@ export default { ...@@ -183,13 +183,16 @@ export default {
this[formName][idx][attrName] = attrValue this[formName][idx][attrName] = attrValue
}) })
}, },
getServiceCenterList() { async getServiceCenterList() {
return new Promise((resolve, reject) => {
const params = { const params = {
partnerMerchantId: this.userInfo.merchantId partnerMerchantId: this.userInfo.merchantId
} }
this.$apis.customer.getServiceCenterList(params).then(res => { this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res this.baseData.merchantList = res
this.$utils.getOptionsList(this, 'editFormData', false) this.$utils.getOptionsList(this, 'editFormData', false)
resolve()
})
}) })
}, },
// 切换所属服务中心 // 切换所属服务中心
...@@ -234,7 +237,8 @@ export default { ...@@ -234,7 +237,8 @@ export default {
}) })
}) })
}, },
getInfo() { async getInfo() {
return new Promise((resolve, reject) => {
this.editForm = { this.editForm = {
...this.$common.utils.deepClone(this.routeInfo.merchantInfo), ...this.$common.utils.deepClone(this.routeInfo.merchantInfo),
merchantName: this.routeInfo.merchantInfo.shopMerchantName || '', merchantName: this.routeInfo.merchantInfo.shopMerchantName || '',
...@@ -274,10 +278,12 @@ export default { ...@@ -274,10 +278,12 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
resolve()
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
})
}, },
hasDuplicate(arr1, arr2) { hasDuplicate(arr1, arr2) {
const set1 = new Set(arr1) const set1 = new Set(arr1)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!