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 => { ...@@ -118,4 +118,16 @@ const getInviteCode = params => {
sign: true 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 @@ ...@@ -16,6 +16,11 @@
</el-option-group> </el-option-group>
</el-select> </el-select>
</div> </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> </glsx-combi-form>
</div> </div>
</div> </div>
...@@ -50,7 +55,8 @@ export default { ...@@ -50,7 +55,8 @@ export default {
contactName: '', contactName: '',
phone: '', phone: '',
merchantBrandList: [], merchantBrandList: [],
productCodeList: [] productCodeList: [],
staffUuid: ''
}, },
editRule: { editRule: {
shopMerchantId: [{ required: true, message: '请输入商户号', trigger: 'change' }], shopMerchantId: [{ required: true, message: '请输入商户号', trigger: 'change' }],
...@@ -87,7 +93,10 @@ export default { ...@@ -87,7 +93,10 @@ export default {
optionId: 'yqMerchantId', optionId: 'yqMerchantId',
optionLabel: 'yqMerchantName', optionLabel: 'yqMerchantName',
optionsName: 'merchantList', optionsName: 'merchantList',
isDisabled: false isDisabled: false,
changeAttr: (value) => {
this.handleServiceChange(value)
}
}, },
{ {
label: '客户名称', label: '客户名称',
...@@ -108,6 +117,11 @@ export default { ...@@ -108,6 +117,11 @@ export default {
maxlength: 11 maxlength: 11
}, },
{ {
label: '驻店负责人',
name: 'staffUuid',
addHtml: 'staffUuid'
},
{
// label: '', // label: '',
labelName: '地址:', labelName: '地址:',
name: '', name: '',
...@@ -128,7 +142,8 @@ export default { ...@@ -128,7 +142,8 @@ export default {
], ],
// 基本数据 // 基本数据
baseData: { baseData: {
merchantList: [] merchantList: [],
residentManagerList: []
}, },
} }
}, },
...@@ -142,9 +157,8 @@ export default { ...@@ -142,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') {
...@@ -154,7 +168,8 @@ export default { ...@@ -154,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()
}, },
...@@ -168,15 +183,34 @@ export default { ...@@ -168,15 +183,34 @@ export default {
this[formName][idx][attrName] = attrValue this[formName][idx][attrName] = attrValue
}) })
}, },
getServiceCenterList() { async getServiceCenterList() {
const params = { return new Promise((resolve, reject) => {
partnerMerchantId: this.userInfo.merchantId const params = {
} partnerMerchantId: this.userInfo.merchantId
this.$apis.customer.getServiceCenterList(params).then(res => { }
this.baseData.merchantList = res this.$apis.customer.getServiceCenterList(params).then(res => {
this.$utils.getOptionsList(this, 'editFormData', false) 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() { findProByScene() {
this.$apis.customer.findProByScene({}).then(res => { this.$apis.customer.findProByScene({}).then(res => {
this.baseData.sceneList = res this.baseData.sceneList = res
...@@ -203,47 +237,53 @@ export default { ...@@ -203,47 +237,53 @@ export default {
}) })
}) })
}, },
getInfo() { async getInfo() {
this.editForm = { return new Promise((resolve, reject) => {
...this.$common.utils.deepClone(this.routeInfo.merchantInfo), this.editForm = {
merchantName: this.routeInfo.merchantInfo.shopMerchantName || '', ...this.$common.utils.deepClone(this.routeInfo.merchantInfo),
oldPhone: this.routeInfo.merchantInfo?.phone, merchantName: this.routeInfo.merchantInfo.shopMerchantName || '',
oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || '' oldPhone: this.routeInfo.merchantInfo?.phone,
} oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || ''
this.loading = true }
this.$apis.customer this.loading = true
.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId }) this.$apis.customer
.then(res => { .getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId })
this.editForm.provinceCode = res.provinceCode .then(res => {
this.editForm.provinceName = res.provinceName this.editForm.provinceCode = res.provinceCode
this.editForm.cityCode = res.cityCode this.editForm.provinceName = res.provinceName
this.editForm.cityName = res.cityName this.editForm.cityCode = res.cityCode
this.editForm.latitude = res.lat this.editForm.cityName = res.cityName
this.editForm.longitude = res.lng this.editForm.latitude = res.lat
this.editForm.merchantAddress = res.merchantAddress this.editForm.longitude = res.lng
const merchantBrandList = res.brandTreeList || [] this.editForm.merchantAddress = res.merchantAddress
this.editForm.merchantBrandList = [] this.editForm.staffUuid = res.residentManager?.userId
this.editForm.merchantBrandIds = '' const merchantBrandList = res.brandTreeList || []
merchantBrandList.forEach(item => { this.editForm.merchantBrandList = []
this.editForm.merchantBrandList.push({ this.editForm.merchantBrandIds = ''
merchantFirstBrandDetail: { merchantBrandList.forEach(item => {
id: item.id, this.editForm.merchantBrandList.push({
name: item.name merchantFirstBrandDetail: {
}, id: item.id,
merchantSecondBrandDetailList: item.subList 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(',') .finally(() => {
this.$refs.editFormRef.brandList() this.loading = false
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
this.$nextTick(() => {
this.editStatus = false
}) })
}) })
.finally(() => {
this.loading = false
})
}, },
hasDuplicate(arr1, arr2) { hasDuplicate(arr1, arr2) {
const set1 = new Set(arr1) const set1 = new Set(arr1)
...@@ -290,6 +330,17 @@ export default { ...@@ -290,6 +330,17 @@ export default {
params.sceneList.push(item.sceneCode) 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> ', '提示', { this.$confirm('<strong>是否确认提交?</strong> <div>提交客户开通申请,进入开店审核,审核通过后将为您自动' + (this.routeInfo.editType == 'add' ? '创建' : '编辑') + '客户</div> ', '提示', {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
confirmButtonText: '确定', confirmButtonText: '确定',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!