Commit fdadd17f by 前端

权限

1 parent b1e8e02d
import http from "../request/http"; import http from '../request/http'
import environment from "@/env"; import environment from '@/env'
module.exports = { module.exports = {
/**查询当前门店是否有客户档案权限 */ /**查询当前门店是否有客户档案权限 */
haveCustomerAccess (data) { haveCustomerAccess(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList', method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/**查询当前门店客户档案列表 */ /**查询当前门店客户档案列表 */
getCustomerFileList (data) { getCustomerFileList(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoPage', method: 'dj.api.smartcarlife.customervisits.customerInfoPage',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/* 删除客户档案*/ /* 删除客户档案*/
delCustomerFile (data) { delCustomerFile(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo', method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/** 根据业务查询接待场景 */ /** 根据业务查询接待场景 */
findAllSence (data) { findAllSence(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findAllSence', method: 'dj.api.smartcarlife.customervisits.findAllSence',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/**根据业务查询客户标签 */ /**根据业务查询客户标签 */
findCustomerTags (data) { findCustomerTags(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findSenceTag', method: 'dj.api.smartcarlife.customervisits.findSenceTag',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/** /**
* 查询客户档案详情 * 查询客户档案详情
*/ */
findVisitsInfo (data) { findVisitsInfo(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findVisitsInfo', method: 'dj.api.smartcarlife.customervisits.findVisitsInfo',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/* /*
* 保存客户档案 * 保存客户档案
*/ */
saveVisitsInfo (data) { saveVisitsInfo(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo', method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/** /**
* 更新客户档案 * 更新客户档案
*/ */
updateVisitsInfo (data) { updateVisitsInfo(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo', method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/**查询客户档案列表 */ /**查询客户档案列表 */
getCustomerInfoList (data) { getCustomerInfoList(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoList', method: 'dj.api.smartcarlife.customervisits.customerInfoList',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/**接待客户素材 /**接待客户素材
* *
*/ */
getMaterialResponsePage (data) { getMaterialResponsePage(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage', method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
/**素材详情 查询素材详情 */ /**素材详情 查询素材详情 */
getMaterialDetail (data) { getMaterialDetail(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialById', method: 'dj.api.smartcarlife.customervisits.getMaterialById',
projectName: "boutique", projectName: 'boutique',
...data, ...data
}); })
}, },
}
\ No newline at end of file \ No newline at end of file
/**直营驻店人员 */
saleOpen(data) {
return http.post({
method: 'dj.api.car.boutique.resident.direct.sale.merchant',
projectName: 'boutique',
...data
})
}
}
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
watch: { watch: {
userInfo(n) { userInfo(n) {
if (n.shopMerchantId) this.haveCustomerAccess(n.shopMerchantId) if (n.shopMerchantId) this.haveCustomerAccess(n)
} }
}, },
computed: { computed: {
...@@ -75,9 +75,10 @@ export default { ...@@ -75,9 +75,10 @@ export default {
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit("changeTab", index) this.$emit("changeTab", index)
}, },
async haveCustomerAccess(merchantId) { async haveCustomerAccess(val) {
const {shopMerchantId,merchantId, sceneType:scene} = val
const res = await uni.$api.customerApi.haveCustomerAccess({ const res = await uni.$api.customerApi.haveCustomerAccess({
merchantId merchantId:shopMerchantId
}) })
if (res) this.tabs.push( { if (res) this.tabs.push( {
label: "客户档案", label: "客户档案",
...@@ -85,16 +86,18 @@ export default { ...@@ -85,16 +86,18 @@ export default {
name: 'CustomerFile' name: 'CustomerFile'
}) })
this.$store.state.user.haveCustomerAccess = res this.$store.state.user.haveCustomerAccess = res
uni.$api.customerApi.saleOpen({
const { permissionPhone = [] } = uni.$storage.get('mock_data') merchantId,
const { phone } = uni.$storage.get('userInfo') scene
if (!permissionPhone.includes(+phone)) { }).then(result=>{
this.tabs.push({ if(!result) {
this.tabs.push({
label: "个人中心", label: "个人中心",
icon: "point", icon: "point",
name: 'Point' name: 'Point'
}) })
} }
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!