2213980799@qq.com hai 1 ano
pai
achega
90d94df490

+ 14 - 0
main.js

@@ -2,6 +2,20 @@ import App from "./App";
 
 import store from "./store";
 Vue.prototype.$store = store;
+Vue.prototype.$isAuthorities = (authorities)=>{
+	try {
+		let authoritiesLiat=uni.getStorageSync('authorities') //按钮
+		let authoritiesCode=JSON.parse(authoritiesLiat).map(item=>item.permissionCode)
+		console.log(authoritiesCode)
+		return authoritiesCode.includes(authorities)
+	} catch (error) {
+		//TODO handle the exception
+	}
+	
+	return true
+	
+	
+};
 
 // uView配置
 import uView from "@/uni_modules/uview-ui";

+ 47 - 6
pages/login/login.vue

@@ -40,11 +40,24 @@
 </template>
 
 <script>
-	import { postJ } from '@/utils/api.js'
-	import { login, usName } from '@/api/common.js'
-	import { getResourcesTree } from '@/api/pda/common.js'
+	import {
+		postJ
+	} from '@/utils/api.js'
+	import {
+		login,
+		usName
+	} from '@/api/common.js'
+	import {
+		getResourcesTree
+	} from '@/api/pda/common.js'
 
-	import { setMemo, isMemo, removeMemo, setPassword, getPassword } from '@/utils/passwordMemo.js'
+	import {
+		setMemo,
+		isMemo,
+		removeMemo,
+		setPassword,
+		getPassword
+	} from '@/utils/passwordMemo.js'
 	import ServerSetting from '@/components/ServerSetting/index'
 
 	export default {
@@ -158,7 +171,7 @@
 
 						let data = res.data
 						uni.setStorageSync('token', data.token)
-            uni.setStorageSync("userInfo", data);
+						uni.setStorageSync("userInfo", data);
 						uni.showToast({
 							title: '登录成功',
 							icon: 'success',
@@ -190,7 +203,33 @@
 					removeMemo()
 				}
 			},
+			formatRouter(list) {
+				let authorities = [];
 
+				const fn = (list) => {
+					let arr = [];
+					for (const p of list) {
+						if (p.menuType === 2) {
+							// p.children = [];
+							authorities.push(p);
+						}
+						//  else {
+						if (p.children?.length) {
+							p.children = fn(p.children);
+						} else {
+							p.children = [];
+						}
+						arr.push(p);
+						// }
+					}
+
+					return arr;
+				};
+
+				fn(list);
+
+				return authorities
+			},
 			getTree() {
 				getResourcesTree().then(res => {
 					console.log(res)
@@ -201,7 +240,9 @@
 						})
 					}
 					let List = JSON.stringify(res || [])
+					let authorities =this.formatRouter(res[0].children)
 					uni.setStorageSync('treeList', List)
+					uni.setStorageSync('authorities', JSON.stringify(authorities)) //按钮
 				})
 			}
 		}
@@ -210,4 +251,4 @@
 
 <style lang="scss" scoped>
 	@import 'login.scss';
-</style>
+</style>

+ 16 - 9
pages/saleManage/businessOpportunity/add.vue

@@ -22,17 +22,24 @@
 				</uni-data-picker>
 			</u-cell>
 			<u-cell title="赢单率" arrow-direction="down">
-				<u--input slot="value" type="number" max="100" min="0" placeholder="请输入" border="surround"
-					v-model="form.winRate">
-					<text slot="suffix">%</text>
-
-				</u--input>
+				<view slot="value" style="display: flex;align-items: center;width: 100%;">
+					<u--input style="flex:1"  type="number" max="100" min="0" placeholder="请输入" border="surround"
+						v-model="form.winRate">
+					
+					</u--input>
+						%
+				</view>
+			
+			
 			</u-cell>
 			<u-cell title="预算" arrow-direction="down">
-				<u--input slot="value" type="number" placeholder="请输入" border="surround" v-model="form.budget">
-					<text slot="suffix">万元</text>
-
-				</u--input>
+				<view slot="value" style="display: flex;align-items: center;width: 100%;">
+					<u--input style="flex:1" type="number" placeholder="请输入" border="surround" v-model="form.budget">
+					
+					</u--input>
+					万元
+				</view>
+				
 			</u-cell>
 
 			<u-cell title="预计结单日期" arrow-direction="down">

+ 15 - 11
pages/saleManage/businessOpportunity/components/drawer.vue

@@ -23,9 +23,9 @@
 			</view>
 		</view>
 
-		<u-sticky bgColor="#fff" :customNavHeight="88">
+		<!-- <u-sticky bgColor="#fff" :customNavHeight="88"> -->
 			<u-tabs :list="list1" @change="change" :current="current"></u-tabs>
-		</u-sticky>
+		<!-- </u-sticky> -->
 		<info ref="infoRef" :isDrawer="true" v-show="current==0"></info>
 
 		<produceList :pricingWay="form.pricingWay" ref="produceListRef" :isDrawer="true" v-show="current==1">
@@ -138,10 +138,22 @@
 			})
 			uni.$off('savefollowList')
 			uni.$on('savefollowList', (item) => {
+				item.contactId=this.form.contactId
+				item.opportunityId=this.form.id
+
 				savefollowList(item)
 			})
 			getDetail(data.id).then(async res => {
 				this.form = res
+				const {
+					linkList
+				} = await contactDetail(res.contactId)
+				const followList = await getfollowList({
+					pageNum: 1,
+					size: 1000,
+					opportunityId: res.id,
+				})
+				this.linkList = linkList
 				setTimeout(() => {
 					this.current = 0
 					this.$nextTick(() => {
@@ -155,15 +167,7 @@
 						}
 					})
 				}, 300)
-				const {
-					linkList
-				} = await contactDetail(res.contactId)
-				const followList = await getfollowList({
-					pageNum: 1,
-					size: 1000,
-					opportunityId: res.id,
-				})
-				this.linkList = linkList
+			
 
 
 

+ 7 - 1
pages/saleManage/businessOpportunity/index.vue

@@ -66,8 +66,11 @@
 					type: '1',
 					pageUrl: '/pages/saleManage/businessOpportunity/add',
 					judge: [{
+						// authorities: 'eom:businessopportunity:update',
+					},{
 						key: 'approvalStatus',
-						value: [0, 3]
+						value: [0, 3],
+					
 					}],
 				}, {
 					name: '跟进记录',
@@ -83,10 +86,13 @@
 				}, {
 					name: '删除',
 					apiName: 'del',
+				
 					btnType: 'error ',
 					type: '2',
 					pageUrl: '',
 					judge: [{
+						// authorities: 'eom:businessopportunity:delete',
+					},{
 						key: 'approvalStatus',
 						value: [0, 3]
 					}],

+ 12 - 4
pages/saleManage/components/myCard.vue

@@ -12,8 +12,12 @@
 				<view class="item_one rx-sc" v-else-if="val.type=='action'">
 					<view class="lable">{{val.label}}</view>
 					<view class="text">
-						<u-button :plain="true" :hairline="true" size='mini' :type="btn.btnType" v-if="judge(btn)"
-							:text="btn.name" @click="action(btn)" v-for="(btn,bI) in btnList" :key="bI"></u-button>
+						<template v-for="(btn,bI) in btnList">
+							
+							<u-button :plain="true" :hairline="true" size='mini' :type="btn.btnType" v-if="judge(btn)"
+								:text="btn.name" @click="action(btn)"  :key="bI"></u-button>
+						</template>
+						
 					</view>
 
 				</view>
@@ -61,9 +65,13 @@
 						let is = true
 						item.judge.forEach(({
 							key,
-							value
+							value,
+							authorities
 						}) => {
-							if (!value.includes(this.item[key])) {
+							if(authorities){
+								is=this.$isAuthorities(authorities)
+							}
+							if (value&&!value.includes(this.item[key])) {
 								is = false
 							}
 						})

+ 2 - 2
pages/saleManage/contact/components/drawer.vue

@@ -32,9 +32,9 @@
 			</view>
 		</view>
 
-		<u-sticky bgColor="#fff" :customNavHeight="88">
+		<!-- <u-sticky bgColor="#fff" :customNavHeight="88"> -->
 			<u-tabs :list="list1" @change="change" :current="current"></u-tabs>
-		</u-sticky>
+		<!-- </u-sticky> -->
 		<comment ref="commentRef" :isDrawer="true" v-show="current==1"></comment>
 		<info ref="infoRef" :isDrawer="true" v-show="current==0"></info>
 

+ 2 - 3
pages/saleManage/contact/components/followListAdd.vue

@@ -54,7 +54,7 @@
 					agreement: '',
 					contactId: '',
 					content: '',
-					followupTime: '',
+					followupTime:'',
 					linkId: '',
 					linkName: '',
 					nextPlan: '',
@@ -79,7 +79,6 @@
 					id:item.id
 				}
 			})
-			console.log(this.linkList)
 			const business_stage_code = await getByCode('business_stage_code');
 			this.business_stage_code = business_stage_code.map(item => {
 				const key = Object.keys(item)[0]
@@ -92,7 +91,7 @@
 		methods: {
 			//监听选择(ids为数组)
 			selectChange(data = []) {
-				this.form.linkId = data.map(item => item.id)
+				this.form.linkId = data.map(item => item.id).toString()
 				this.form.linkName = data.map(item => item.name).toString()
 				this.categoryIdList = data
 			},

+ 2 - 2
pages/saleManage/saleOrder/components/drawer.vue

@@ -37,9 +37,9 @@
 			</view>
 		</view>
 
-		<u-sticky bgColor="#fff" :customNavHeight="88">
+		<!-- <u-sticky bgColor="#fff" :customNavHeight="88"> -->
 			<u-tabs :list="list1" @change="change" :current="current"></u-tabs>
-		</u-sticky>
+		<!-- </u-sticky> -->
 		<info ref="infoRef" :isDrawer="true" v-show="current==0"></info>
 		<produceList v-show="current==1" ref="produceListRef" :pricingWay="form.pricingWay"
 			:contractId="form.contractId" :columns="produceLisTcolumns">