Commit e3c7ac11 by zhangxw

bug修复

1 parent 9a96df48
......@@ -157,9 +157,8 @@ export default {
}
},
mounted() {
async mounted() {
this.routeInfo = this.$route.query
this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.userInfo = this.$globalState.session
this.isWatch = this.routeInfo.editType != 'add'
if (this.routeInfo.editType == 'edit') {
......@@ -169,7 +168,8 @@ export default {
let id = this.editFormData.findIndex(item => item.name == 'shopMerchantId')
this.editFormData.splice(id, 1)
}
this.getServiceCenterList()
await this.getServiceCenterList()
this.routeInfo.editType != 'add' ? await this.getInfo() : ''
this.findProByScene()
},
......@@ -183,13 +183,16 @@ export default {
this[formName][idx][attrName] = attrValue
})
},
getServiceCenterList() {
const params = {
partnerMerchantId: this.userInfo.merchantId
}
this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res
this.$utils.getOptionsList(this, 'editFormData', false)
async getServiceCenterList() {
return new Promise((resolve, reject) => {
const params = {
partnerMerchantId: this.userInfo.merchantId
}
this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res
this.$utils.getOptionsList(this, 'editFormData', false)
resolve()
})
})
},
// 切换所属服务中心
......@@ -234,50 +237,53 @@ export default {
})
})
},
getInfo() {
this.editForm = {
...this.$common.utils.deepClone(this.routeInfo.merchantInfo),
merchantName: this.routeInfo.merchantInfo.shopMerchantName || '',
oldPhone: this.routeInfo.merchantInfo?.phone,
oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || ''
}
this.loading = true
this.$apis.customer
.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId })
.then(res => {
this.editForm.provinceCode = res.provinceCode
this.editForm.provinceName = res.provinceName
this.editForm.cityCode = res.cityCode
this.editForm.cityName = res.cityName
this.editForm.latitude = res.lat
this.editForm.longitude = res.lng
this.editForm.merchantAddress = res.merchantAddress
this.editForm.staffUuid = res.residentManager?.userId
const merchantBrandList = res.brandTreeList || []
this.editForm.merchantBrandList = []
this.editForm.merchantBrandIds = ''
merchantBrandList.forEach(item => {
this.editForm.merchantBrandList.push({
merchantFirstBrandDetail: {
id: item.id,
name: item.name
},
merchantSecondBrandDetailList: item.subList
async getInfo() {
return new Promise((resolve, reject) => {
this.editForm = {
...this.$common.utils.deepClone(this.routeInfo.merchantInfo),
merchantName: this.routeInfo.merchantInfo.shopMerchantName || '',
oldPhone: this.routeInfo.merchantInfo?.phone,
oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || ''
}
this.loading = true
this.$apis.customer
.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId })
.then(res => {
this.editForm.provinceCode = res.provinceCode
this.editForm.provinceName = res.provinceName
this.editForm.cityCode = res.cityCode
this.editForm.cityName = res.cityName
this.editForm.latitude = res.lat
this.editForm.longitude = res.lng
this.editForm.merchantAddress = res.merchantAddress
this.editForm.staffUuid = res.residentManager?.userId
const merchantBrandList = res.brandTreeList || []
this.editForm.merchantBrandList = []
this.editForm.merchantBrandIds = ''
merchantBrandList.forEach(item => {
this.editForm.merchantBrandList.push({
merchantFirstBrandDetail: {
id: item.id,
name: item.name
},
merchantSecondBrandDetailList: item.subList
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds + (this.editForm.merchantBrandIds ? ',' : '') + item.subList.map(k => k.id).join(',')
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds + (this.editForm.merchantBrandIds ? ',' : '') + item.subList.map(k => k.id).join(',')
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds.split(',')
this.$refs.editFormRef.brandList()
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
// 有所属服务中心获取所有员工
if (res?.merchantNo) this.getAllStaffList(res?.merchantNo)
this.$nextTick(() => {
this.editStatus = false
})
resolve()
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds.split(',')
this.$refs.editFormRef.brandList()
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
// 有所属服务中心获取所有员工
if (res?.merchantNo) this.getAllStaffList(res?.merchantNo)
this.$nextTick(() => {
this.editStatus = false
.finally(() => {
this.loading = false
})
})
.finally(() => {
this.loading = false
})
})
},
hasDuplicate(arr1, arr2) {
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!