Commit 5720ae6a by zhangxw

客户管理 驻店负责人开发

1 parent ffaa29d3
......@@ -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: []
},
}
},
......@@ -177,6 +192,22 @@ export default {
this.$utils.getOptionsList(this, 'editFormData', false)
})
},
// 切换所属服务中心
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
......@@ -221,6 +252,7 @@ export default {
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 = ''
......@@ -237,6 +269,8 @@ export default {
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
})
......@@ -290,6 +324,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!