Commit d1f55f8c by 前端

Merge branch 'v4.38.1-0422' into 'master'

上线合并

See merge request !10
2 parents ffaa29d3 e3c7ac11
......@@ -118,4 +118,16 @@ const getInviteCode = params => {
sign: true
})
}
export default { getList, getServiceCenterList, getReviewList, getMerchantInfo, createMerchant, updateMerchant, findProByScene, getSceneProStatus, getStaffList, getInviteCode }
// 根据4s店或者园区店查询员工信息
const getResidentStaffList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.list'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getList, getServiceCenterList, getReviewList, getMerchantInfo, createMerchant, updateMerchant, findProByScene, getSceneProStatus, getStaffList, getInviteCode, getResidentStaffList }
......@@ -16,6 +16,11 @@
</el-option-group>
</el-select>
</div>
<div slot="staffUuid">
<el-select v-model="editForm['staffUuid']" @change="handleResidentManageChange">
<el-option v-for="(item, index) in baseData.residentManagerList" :key="index" :label="item.staffName" :value="item.staffUuid"></el-option>
</el-select>
</div>
</glsx-combi-form>
</div>
</div>
......@@ -50,7 +55,8 @@ export default {
contactName: '',
phone: '',
merchantBrandList: [],
productCodeList: []
productCodeList: [],
staffUuid: ''
},
editRule: {
shopMerchantId: [{ required: true, message: '请输入商户号', trigger: 'change' }],
......@@ -87,7 +93,10 @@ export default {
optionId: 'yqMerchantId',
optionLabel: 'yqMerchantName',
optionsName: 'merchantList',
isDisabled: false
isDisabled: false,
changeAttr: (value) => {
this.handleServiceChange(value)
}
},
{
label: '客户名称',
......@@ -108,6 +117,11 @@ export default {
maxlength: 11
},
{
label: '驻店负责人',
name: 'staffUuid',
addHtml: 'staffUuid'
},
{
// label: '',
labelName: '地址:',
name: '',
......@@ -128,7 +142,8 @@ export default {
],
// 基本数据
baseData: {
merchantList: []
merchantList: [],
residentManagerList: []
},
}
},
......@@ -142,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') {
......@@ -154,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()
},
......@@ -168,15 +183,34 @@ 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()
})
})
},
// 切换所属服务中心
handleServiceChange(value) {
// 清除驻店负责人
this.editForm.staffUuid = ''
// 获取所属服务中心下的所有员工
this.getAllStaffList(value)
},
getAllStaffList(yqMerchantId) {
this.$apis.customer.getResidentStaffList({ merchantId: this.routeInfo?.merchantInfo?.shopMerchantId, yqMerchantId }).then(res => {
this.baseData.residentManagerList = res || []
})
},
handleResidentManageChange(value) {
this.$set(this.editForm, 'staffUuid', value)
this.$forceUpdate()
},
findProByScene() {
this.$apis.customer.findProByScene({}).then(res => {
this.baseData.sceneList = res
......@@ -203,47 +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
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)
this.$nextTick(() => {
this.editStatus = false
.finally(() => {
this.loading = false
})
})
.finally(() => {
this.loading = false
})
})
},
hasDuplicate(arr1, arr2) {
const set1 = new Set(arr1)
......@@ -290,6 +330,17 @@ export default {
params.sceneList.push(item.sceneCode)
}
})
// 驻店负责人参数
if (params?.staffUuid) {
let obj = this.baseData?.residentManagerList?.find(val => val.staffUuid == params.staffUuid)
params.residentManager = {
userId: params.staffUuid,
userType: 2,
userName: obj?.staffName,
userNum: obj?.staffPhone
}
delete params.staffUuid
}
this.$confirm('<strong>是否确认提交?</strong> <div>提交客户开通申请,进入开店审核,审核通过后将为您自动' + (this.routeInfo.editType == 'add' ? '创建' : '编辑') + '客户</div> ', '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!