Procházet zdrojové kódy

修改权限问题

dev
wangshuai před 2 roky
rodič
revize
d91f209845
7 změnil soubory, kde provedl 267 přidání a 240 odebrání
  1. +2
    -2
      manifest.json
  2. +1
    -1
      pages/center/Piabodata/TrendAnalysis.vue
  3. +10
    -3
      pages/center/consumer/consumerDetail.vue
  4. +235
    -215
      pages/center/consumer/edit.vue
  5. +3
    -7
      pages/index/customer.vue
  6. +14
    -12
      pages/index/index.vue
  7. +2
    -0
      pages/mine/reception/addreception.vue

+ 2
- 2
manifest.json Zobrazit soubor

@@ -1,5 +1,5 @@
{
"name" : "去房智控管家",
"name" : "数智工牌",
"appid" : "__UNI__D88F14A",
"description" : "AI营销助理",
"versionName" : "1.1.0",
@@ -91,7 +91,7 @@
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx8f883dca5ecc5510",
"appid" : "wxe044603515ff2cb5",
"setting" : {
"urlCheck" : false,
"es6" : true,


+ 1
- 1
pages/center/Piabodata/TrendAnalysis.vue Zobrazit soubor

@@ -59,7 +59,7 @@
<text
:style="{color:item.num2*1>0?'red':'green'}">{{item.num2+'%'}}{{item.num2*1 > 0 ? '↑':'↓'}}</text>
</template>
<template>
<template v-else>
<text
:style="{color:item.num2*1>0?'red':'green'}">{{item.num2+'%'}}</text>
</template>


+ 10
- 3
pages/center/consumer/consumerDetail.vue Zobrazit soubor

@@ -9,10 +9,8 @@
<view class="img" v-else-if="customerInfo.level==2">B</view>
<view class="img" v-else-if="customerInfo.level==3">C</view>
<view class="img" v-else-if="customerInfo.level==4">D</view>
<view class="test">{{customerInfo.name || '--'}}</view>
<view class="edit">
<view class="edit" v-if="isEdit">
<image class="screen-sel-img" src="../../../static/images/edit.png" mode=""></image>
</view>
</view>
@@ -248,6 +246,14 @@
buttonisshow:false
}
},
computed: {
isEdit() {
let arr = uni.getStorageSync('weapp_session_Menu_data')
return arr.findIndex(item => {
return item.name == '客户编辑'
}) == -1 ? false : true
}
},
onLoad(options) {
this.customerId = options.id;
},
@@ -379,6 +385,7 @@
// 去编辑
goedit(){
// console.log('去编辑')
if (!this.isEdit) return
uni.navigateTo({
url:`/pages/center/consumer/edit?id=${this.customerId}&projectId=${this.customerInfo.projectId}`
})


+ 235
- 215
pages/center/consumer/edit.vue Zobrazit soubor

@@ -14,7 +14,8 @@
</view>
</view>
<view class="conmsg-msg-lab-inp">
<input type="text" placeholder="请输入客户姓名" placeholder-style="color:#B2B2B2;" v-model="form.name"/>
<input type="text" placeholder="请输入客户姓名" placeholder-style="color:#B2B2B2;"
v-model="form.name" />
</view>
</view>
<view class="conmsg-msg-lab">
@@ -22,40 +23,34 @@
客户性别
</view>
<view class="conmsg-msg-lab-inp" style="margin-top: 20rpx;">
<view style="border: none; display: flex;">
<view class="sexchose" @click="form.sex=1" :style="{border:form.sex==1?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
</view>
<view class="sexchose" @click="form.sex=2" :style="{border:form.sex==2?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
</view>
<view style="border: none; display: flex;">
<view class="sexchose" @click="form.sex=1"
:style="{border:form.sex==1?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
</view>
<view class="sexchose" @click="form.sex=2"
:style="{border:form.sex==2?'1px solid #0A6EE9':'1px solid #E0E0E0'}">
</view>
</view>
</view>
</view>
<view class="conmsg-msg-lab">
<view class="conmsg-msg-lab-1">
联系电话
<view class="star">
*
</view>
</view>
<template v-if="form.isShow == 1">
<view class="conmsg-msg-lab-inp">
<input disabled type="number" placeholder="请输入联系电话" placeholder-style="color:#B2B2B2;" maxlength="11" v-model="form.showPhone"/>
</view>
</template>
<template v-else>
<view class="conmsg-msg-lab-inp">
<input :disabled="dataCode!=6" type="number" placeholder="请输入联系电话" placeholder-style="color:#B2B2B2;" maxlength="11" v-model="form.phone"/>
</view>
</template>
<view class="conmsg-msg-lab-inp">
<input type="number" @focus="callPhoneFocus" @blur="callPhoneBlur" placeholder="请输入联系电话" placeholder-style="color:#B2B2B2;" maxlength="11"
v-model="form.showPhone" />
</view>
</view>
<view class="conmsg-msg-lab">
<view class="conmsg-msg-lab-1">
微信账号
</view>
<view class="conmsg-msg-lab-inp">
<input type="text" placeholder="请输入微信账号" placeholder-style="color:#B2B2B2;" v-model="form.chatNo"/>
<input type="text" placeholder="请输入微信账号" placeholder-style="color:#B2B2B2;"
v-model="form.chatNo" />
</view>
</view>
<view class="conmsg-msg-lab" @click="levelshow = true">
@@ -63,7 +58,7 @@
客户等级
</view>
<view class="conmsg-msg-lab-inp">
<input type="text" placeholder="请选择客户等级" v-model="selectform.level" disabled/>
<input type="text" placeholder="请选择客户等级" v-model="selectform.level" disabled />
</view>
<view class="conmsg-msg-lab-img">
<image class="screen-sel-img" src="../../../static/images/right.png" mode=""></image>
@@ -74,7 +69,8 @@
客户来源
</view>
<view class="conmsg-msg-lab-inp">
<input type="text" placeholder="请选择客户来源" @click="Buildingselection" v-model="form.sourceName" disabled/>
<input type="text" placeholder="请选择客户来源" @click="Buildingselection" v-model="form.sourceName"
disabled />
</view>
<view class="conmsg-msg-lab-img">
<image class="screen-sel-img" src="../../../static/images/right.png" mode=""></image>
@@ -85,104 +81,108 @@
备注内容
</view>
<view class="conmsg-msg-lab-inp">
<input type="text" placeholder="请输入备注内容" placeholder-style="color:#B2B2B2;" v-model="form.remarks"/>
<input type="text" placeholder="请输入备注内容" placeholder-style="color:#B2B2B2;"
v-model="form.remarks" />
</view>
</view>
</view>
</view>
<view class="conmsg" v-if="allList.length!=0">
<view class="conmsg-title">
客户标签
</view>
<view class="conmsg-msg">
<view v-for="(item,index) in allList" :key="index">
<view class="">
<view class="conmsg-msg-lab" style="border: none;">
<view class="conmsg-msg-lab-1">
{{item.name}}
<view class="conmsg-msg-lab" style="border: none;">
<view class="conmsg-msg-lab-1">
{{item.name}}
</view>
</view>
</view>
<view class="con-msg-con" :style="{borderBottom:index==allList.length-1?'none':'1px solid #E0E0E0'}">
<view v-for="(item1,i) in item.children" :key="i" @click="Edittag(item,item1,index,i)" :style="{border:item1.selected==0?'1px solid #0A6EE9':'1px solid #E0E0E0'}" class="chebox" >
{{item1.label}}
<view class="con-msg-con"
:style="{borderBottom:index==allList.length-1?'none':'1px solid #E0E0E0'}">
<view v-for="(item1,i) in item.children" :key="i" @click="Edittag(item,item1,index,i)"
:style="{border:item1.selected==0?'1px solid #0A6EE9':'1px solid #E0E0E0'}"
class="chebox">
{{item1.label}}
</view>
</view>
</view>
</view>
</view>

</view>
</view>
<view class="submit">
<view class="btn" @click="submit">
确定
</view>
</view>
<view class="" style="height: 220rpx;" >
<view class="" style="height: 220rpx;">
<!-- :style="{marginTop:allList.length!=0?'0':'500rpx'}" -->
</view>
<!-- 客户等级 -->
<u-select v-model="levelshow" :list="levellist" @confirm="levelshowCallback"></u-select>
<u-select :mask-close-able="false" label-name="sourceName" value-name="id" v-model="Showhiddenunits" mode="single-column" :list="list" @cancel="cancel" @confirm="confirm"></u-select>


<u-select :mask-close-able="false" label-name="sourceName" value-name="id" v-model="Showhiddenunits"
mode="single-column" :list="list" @cancel="cancel" @confirm="confirm"></u-select>
</view>
</template>

<script>
const config = require("@/config");
export default{
data(){
return{
export default {
data() {
return {
Showhiddenunits: false, // 控制客户来源弹窗
form:{
name:'',
sex:'1',
phone:'',
chatNo:'',
level:'1',
remarks:'',
form: {
name: '',
sex: '1',
phone: '',
chatNo: '',
level: '1',
remarks: '',
sourceId: ''
},
selectform:{
level:'A',
stage:'',
demand:'',
area:'',
budget:'',
fouce:'',
soure:'',
selectform: {
level: 'A',
stage: '',
demand: '',
area: '',
budget: '',
fouce: '',
soure: '',
},
list: [], // 客户来源数组
levelshow:false,
customerId:'',
levelshow: false,
customerId: '',
// 等级
levellist:[
{
value:1,
label:'A'
levellist: [{
value: 1,
label: 'A'
},
{
value:2,
label:'B'
value: 2,
label: 'B'
},
{
value:3,
label:'C'
value: 3,
label: 'C'
},
{
value:4,
label:'D'
value: 4,
label: 'D'
},
],
allList:[],
dataCode:'',
allList: [],
dataCode: '',
projectId: '', // 项目ID
userInfo: {}, // 当前用户信息
}
@@ -190,19 +190,20 @@
onLoad(e) {
this.userInfo = uni.getStorageSync("weapp_session_userInfo_data");
console.log()
this.dataCode=this.userInfo.dataCode
this.dataCode = this.userInfo.dataCode
console.log(e)
// 先调用借口查询数据
this.customerId=e.id
this.customerId = e.id
if (e.projectId) this.projectId = e.projectId
this.getdetail()
this.getFromSource()
},
methods:{
methods: {
// 获取客户来源
getFromSource() {
uni.request({
url: config.service.sourceList+"?houseId="+this.projectId,
url: config.service.sourceList + "?houseId=" + this.projectId,
method: "GET",
header: {
'content-type': 'application/json',
@@ -210,7 +211,7 @@
},
success: (data) => {
console.log(data)
if(data.data.code==10000){
if (data.data.code == 10000) {
this.list = data.data.data
}
},
@@ -220,148 +221,154 @@
})
},
// 选择客户来源
Buildingselection(){
this.Showhiddenunits=true;
Buildingselection() {
this.Showhiddenunits = true;
},
cancel(){
this.Showhiddenunits=false;
cancel() {
this.Showhiddenunits = false;
},
confirm(e) {
this.form.sourceName = e[0].label;
this.form.sourceId = e[0].value;
this.Showhiddenunits=false;
this.Showhiddenunits = false;
},
Edittag(item,item1,index,i){
if(this.allList[index].children[i].selected==0){
this.allList[index].children[i].selected=1;
}else{
this.allList[index].children[i].selected=0;
Edittag(item, item1, index, i) {
if (this.allList[index].children[i].selected == 0) {
this.allList[index].children[i].selected = 1;
} else {
this.allList[index].children[i].selected = 0;
}
this.$forceUpdate()
},
sourecheck(index){
this.sourelist[index].checked=!this.sourelist[index].checked
sourecheck(index) {
this.sourelist[index].checked = !this.sourelist[index].checked
this.$forceUpdate()
},
demandcheck(index){
this.demandlist[index].checked=!this.demandlist[index].checked
demandcheck(index) {
this.demandlist[index].checked = !this.demandlist[index].checked
this.$forceUpdate()
},
areacheck(index){
this.arealist[index].checked=!this.arealist[index].checked
areacheck(index) {
this.arealist[index].checked = !this.arealist[index].checked
this.$forceUpdate()
},
levelshowCallback(e){
this.selectform.level=e[0].label
this.form.level=e[0].value
levelshowCallback(e) {
this.selectform.level = e[0].label
this.form.level = e[0].value
},
// 获取用户数据
getdetail(){
this.$u.get("customer/findById?",{id:this.customerId})
.then(res=>{
this.form=res
this.form.showPhone = this.form.phone&&this.form.isShow==1?this.form.phone.length==11?this.form.phone.substr(0, 3) + '****' + this.form.phone.substr(7):this.form.phone:this.form.phone&&this.form.isShow!=1?this.form.phone: '--'
// 给客户等级赋值
let idx= this.levellist.findIndex(item=>item.value==res.level)
if(idx!=-1){
this.selectform.level=this.levellist[idx].label
}else{
this.selectform.level='A';
this.form.level=1;
}
this.showSourceName = res.sourceName;
// 获取置业需求
this.getListByType()
})
getdetail() {
this.$u.get("customer/findById?", {
id: this.customerId
})
.then(res => {
this.form = res
if (!this.form.phone) {
this.form.showPhone = '--'
} else {
if (this.form.isShow == 1 && this.form.phone.length == 11) {
this.form.showPhone = this.form.phone.substr(0, 3) + '****' + this.form.phone.substr(7)
} else {
this.form.showPhone = this.form.phone
}
}
this.form.showPhones = this.form.showPhone
// 给客户等级赋值
let idx = this.levellist.findIndex(item => item.value == res.level)
if (idx != -1) {
this.selectform.level = this.levellist[idx].label
} else {
this.selectform.level = 'A';
this.form.level = 1;
}
this.showSourceName = res.sourceName;
// 获取置业需求
this.getListByType()
})
},
// 字典表接口
getListByType(){
this.$u.get("/matchKeywords/findPersonalMatchData",{customerId:this.customerId})
.then(res=>{
// console.log(res)
res.forEach(item1=>{
item1.children.map(item=>{
if(item.isInterval==0){
item.label=item.name+item.unit+'-'+item.endName+item.unit;
}else{
item.label=item.name
}
item.value=item.id;
getListByType() {
this.$u.get("/matchKeywords/findPersonalMatchData", {
customerId: this.customerId
})
.then(res => {
// console.log(res)
res.forEach(item1 => {
item1.children.map(item => {
if (item.isInterval == 0) {
item.label = item.name + item.unit + '-' + item.endName + item
.unit;
} else {
item.label = item.name
}
item.value = item.id;
})
})
})
// console.log(res)
this.allList=res
// return
})
},
// 提交
submit(){
let param={}
let str=[]
if(this.form.name==''){
uni.showToast({
title:'请输入客户姓名',
icon:'none'
// console.log(res)
this.allList = res
// return
})
return
},
// 输入框获取焦点
callPhoneFocus() {
if (this.form.isShow == 1 && this.form.showPhone == this.form.showPhones) {
this.form.showPhone = ''
this.$forceUpdate()
}
if(this.form.phone==''){
uni.showToast({
title:'请输入手机号',
icon:'none'
})
return
},
// 输入框失去焦点
callPhoneBlur() {
if (this.form.isShow == 1 && this.form.showPhone == '') {
this.form.showPhone = this.form.showPhones
this.$forceUpdate()
}
// if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){
// uni.showToast({
// title: "请检查手机号码格式",
// icon:'none'
// });
// // this.form.phone=''
// return false;
// }
if (this.form.phone.length<5) {
},
// 提交
submit() {
let param = {}
let str = []
if (this.form.name == '') {
uni.showToast({
icon: "none",
title: "手机号码不能小于5位"
title: '请输入客户姓名',
icon: 'none'
})
return;
return
}
if (this.form.phone.length>11) {
uni.showToast({
icon: "none",
title: "手机号码不能大于11位"
})
return;
if (this.form.showPhones != this.form.showPhone) {
this.form.phone = this.form.showPhone
}
this.allList.map(item=>{
item.children.map(item1=>{
if(item1.selected==0){
this.allList.map(item => {
item.children.map(item1 => {
if (item1.selected == 0) {
str.push(item1.keywordsId)
}
})
})
str=str.join(',')
param=this.form
param.keywordIds=str
str = str.join(',')
param = this.form
param.keywordIds = str
console.log(param)
// return
this.$u.post("customer/update",param)
.then(res=>{
// console.log(res)
uni.showToast({
title:'操作成功',
icon:'none',
success: () => {
uni.navigateBack()
}
this.$u.post("customer/update", param)
.then(res => {
// console.log(res)
uni.showToast({
title: '操作成功',
icon: 'none',
success: () => {
uni.navigateBack()
}
})

})
})
},
}
}
@@ -374,10 +381,12 @@
background: #F8F8F8;
overflow: hidden;
}
.conmsg{

.conmsg {
background: #FFFFFF;
margin-top: 20rpx;
.conmsg-title{

.conmsg-title {
height: 92rpx;
line-height: 92rpx;
font-weight: bold;
@@ -387,9 +396,11 @@
font-size: 32rpx;
border-bottom: 1px solid #E0E0E0;
}
.conmsg-msg{

.conmsg-msg {
padding: 0 30rpx;
.conmsg-msg-lab{

.conmsg-msg-lab {
height: 102rpx;
display: flex;
font-size: 30rpx;
@@ -397,25 +408,30 @@
color: #333333;
border-bottom: 1px solid #E0E0E0;
line-height: 102rpx;
.conmsg-msg-lab-1{

.conmsg-msg-lab-1 {
display: flex;
min-width: 136rpx;
.star{

.star {
color: #E7483C;
line-height: 108rpx;
}
}
.conmsg-msg-lab-inp{

.conmsg-msg-lab-inp {
margin-top: 30rpx;
margin-left: 44rpx;
}
.conmsg-msg-lab-img{

.conmsg-msg-lab-img {
width: 14rpx;
height: 30rpx;
margin-top: 6rpx;
margin-left: auto;
image{

image {
width: 100%;
height: 100%;
}
@@ -423,14 +439,15 @@
}
}
}
.submit{
.submit {
position: fixed;
bottom: 20rpx;
left: 20rpx;
height: 120rpx;
background: #FFFFFF;
.btn{

.btn {
// margin: 60rpx auto;
text-align: center;
width: 690rpx;
@@ -443,13 +460,15 @@
line-height: 88rpx;
}
}
.con-msg-con{

.con-msg-con {
display: flex;
flex-wrap: wrap;
// justify-content: space-around;
border-bottom: 1px solid #E0E0E0;
padding-bottom: 16rpx;
.chebox{

.chebox {
// width: 20%;
height: 60rpx;
line-height: 60rpx;
@@ -461,15 +480,16 @@
padding: 0 10rpx;
}
}
.sexchose{
width: 120rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 4rpx;
border: 1px solid #E0E0E0;
text-align: center;
line-height: 60rpx;
margin-right: 20rpx;
}

.sexchose {
width: 120rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 4rpx;
border: 1px solid #E0E0E0;
text-align: center;
line-height: 60rpx;
margin-right: 20rpx;

}
</style>

+ 3
- 7
pages/index/customer.vue Zobrazit soubor

@@ -75,15 +75,9 @@
isAdd: '',
dataCode: '',
addAccount: '',
endReception: true,
};
},
computed: {
// 是否有结束接待的权限
endReception() {
let menulist = uni.getStorageSync('weapp_session_Menu_data')
return menulist.findIndex(item => { return item.name == '结束接待' }) != -1
}
},
components: {},
onLoad() {},
onShow() {
@@ -92,6 +86,8 @@
addAccount,
dataCode
} = uni.getStorageSync("weapp_session_userInfo_data");
let menulist = uni.getStorageSync('weapp_session_Menu_data')
this.endReception = menulist.findIndex(item => { return item.name == '结束接待' }) != -1
this.addAccount = addAccount;
this.dataCode = dataCode;
console.log(this.menulist)


+ 14
- 12
pages/index/index.vue Zobrazit soubor

@@ -176,18 +176,10 @@
</view>
</view>
<!-- <view class="real-timebox">
<view class="timebox">
</view>
</view> -->
<view class="title">常用功能</view>
<view class="commonly-box">
<view class="commonly" @click="Piabodata(item.name)" v-for="(item,index) in Menulist" :key='index'>
<!-- 权限菜单控制显隐 因为后台添加的按钮权限并不会在此返回所以需要手动添加 showMenu -->
<view class="commonly" @click="Piabodata(item.name)" v-for="(item,index) in Menulist" :key="index" v-if="showMenu(item.name)">
<view class="commonly-img">
<image v-if="item.name=='客户管理'" class="commonly-img1" src="../../static/images/function1.png"
mode=""></image>
@@ -204,8 +196,7 @@
<image v-if="item.name=='违禁记录'" class="commonly-img1" src="../../static/images/prohibited.png"
mode=""></image>
</view>
<view v-if="item.name=='标记有效无效接待'" class="commonly-text"></view>
<view v-else class="commonly-text">{{item.name}}</view>
<view class="commonly-text">{{item.name}}</view>
</view>
</view>

@@ -269,6 +260,17 @@
statDateEnd:'',
};
},
computed: {
showMenu() {
return name => {
if (name == '标记有效无效接待' || name == '结束接待' || name == '客户编辑') {
return false
} else {
return true
}
}
}
},
components: {},
onShow() {
this.getMenu()


+ 2
- 0
pages/mine/reception/addreception.vue Zobrazit soubor

@@ -212,6 +212,8 @@
}
}
}
}).catch(e => {
that.show=true;
})
},
baochunfun(){


Načítá se…
Zrušit
Uložit