Quellcode durchsuchen

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

# Conflicts:
#	config/index.js
ccjgmwz vor 3 Jahren
Ursprung
Commit
8432826dcd

+ 34 - 0
common/directive.js

@@ -0,0 +1,34 @@
+import Vue from 'vue';
+const rolesList = []
+const permission = (el, binding) => {
+	const roles = getRoles();
+	if (!roles) {
+		return;
+	}
+	  let userPermissionList = Array.isArray(binding.value) ? binding.value : [binding.value];
+	  // 当前用户的权限列表
+	  if (!userPermissionList.some(e => roles.includes(e))) {
+	    el.parentNode && el.parentNode.removeChild(el);
+	  }
+}
+const getRoles = ()=>{
+	let _roles = uni.getStorageSync('jurisdiction');
+	return getUserAllRoles(_roles)
+}
+
+const getUserAllRoles = (item) => {
+	console.log(item)
+	for(let i = 0;i<item.length;i++){
+		rolesList.push(item[i].name)
+		console.log('用户权限',rolesList)
+		if(item[i].children&&item[i].children.length>0){
+			getUserAllRoles(item[i].children)
+		}
+	}
+	return rolesList;
+}
+Vue.directive('hasPermission', {
+		inserted: permission,
+		componentUpdated: permission
+	})
+

+ 15 - 1
common/helper.js

@@ -1,3 +1,4 @@
+import * as config from '../config'
 const selectContractNo = {}
 const detailData = {}
 const erpWarehouse={}
@@ -7,11 +8,24 @@ const now = Date.now || function () {
 const isArray = Array.isArray || function (obj) {  
     return obj instanceof Array;  
 };  
+const getListByUserId = function(){
+	let baseUrlNew = config.def().baseUrlNew
+	uni.request({
+	    url: baseUrlNew + '/roleMenu/query/getListByUserId',
+	    method: 'GET',
+	    success: (res) => {			
+	    	if (res.statusCode === 200) {
+				uni.setStorageSync("jurisdiction", res.data.data)
+	    	}
+	    }
+	})
+}
 
 export default {  
 	detailData,
 	selectContractNo,
     now,  
     isArray,
-	erpWarehouse
+	erpWarehouse,
+	getListByUserId
 }

+ 1 - 0
main.js

@@ -31,6 +31,7 @@ App.mpType = 'app'
 import * as filters from './filters' 
 import * as config from './config'
 import utils from '@/util/util.js'
+import '@/common/directive.js'
 
 let urlAddress = 'liangxin.zthymaoyi.com'
 

+ 1 - 1
pages/erpbusiness/edit_quality_testing.vue

@@ -39,7 +39,7 @@
 				<view class="con-list">
 					<input :disabled='flag==1' v-model='gridList.buckleMiscellaneous' placeholder="初检扣杂" @input="waterContentChange"
 						 	 name="input"></input>
-					<input v-if='flag==0'   value='未复检' disabled placeholder="复检扣杂" 
+					<input v-if='flag==0' value='未复检' disabled placeholder="复检扣杂" 
 						name="input"></input>
 					<input v-else :disabled='flag!=1' v-model='gridList.reBuckleMiscellaneous' placeholder="复检扣杂"
 						name="input"></input>

+ 4 - 0
pages/public/code.vue

@@ -41,6 +41,7 @@
 </template>
 
 <script>
+	import helper from '@/common/helper.js'; 
 	export default {
 		data() {
 			return {
@@ -175,15 +176,18 @@
 							veriCode: "123456",}).then(res1 => {
 								if(res1.data.code==200){
 									uni.setStorageSync('pcUserInfo', res1.data.data)
+									helper.getListByUserId()
 								}
 								else{
 									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
 									veriCode: "123456",}).then(res2 => {
 										uni.setStorageSync('pcUserInfo', res2.data.data)
+										helper.getListByUserId()
 									})
 								}
 							})
 							uni.setStorageSync('userInfo', res.data.data)
+							helper.getListByUserId()
 					        that.$store.commit('login', res.data.data)
 					        // that.liangxinLogin()
 					        uni.switchTab({

+ 4 - 0
pages/public/login_account_number.vue

@@ -35,6 +35,7 @@
 		mapMutations
 	} from 'vuex';
 	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
+	import helper from '@/common/helper.js'; 
 	import { queryData, upData, initData } from '../../util/dbUtil.js'
 	import {
 		mapState
@@ -116,11 +117,14 @@
 							console.log("loginQuickly",res)
 							if(res1.data.code==200){
 								uni.setStorageSync('pcUserInfo', res1.data.data)
+								debugger
+								helper.getListByUserId()
 							}
 							else{
 								that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
 								veriCode: "123456",}).then(res2 => {
 									uni.setStorageSync('pcUserInfo', res2.data.data)
+									helper.getListByUserId()
 								})
 							}
 							

+ 3 - 0
pages/public/register.vue

@@ -38,6 +38,7 @@
 		mapMutations
 	} from 'vuex';
 	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
+    import helper from '@/common/helper.js'; 
 	import { queryData, upData, initData } from '../../util/dbUtil.js'
 	export default {
 		data() {
@@ -227,11 +228,13 @@
 							veriCode: "123456",}).then(res1 => {
 									if(res1.data.code==200){
 										uni.setStorageSync('pcUserInfo', res1.data.data)
+										helper.getListByUserId()
 									}
 									else{
 										that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
 										veriCode: "123456",}).then(res2 => {
 											uni.setStorageSync('pcUserInfo', res2.data.data)
+											helper.getListByUserId()
 										})
 									}
 								})

+ 19 - 15
pages/task/my_task.vue

@@ -1,7 +1,7 @@
 <template name="task">
 	<view class="content">
 		<view class="cu-bar search bg-white">
-			<view class="search-form round">
+			<view class="search-form round" v-hasPermission="'acquisitionPay.view11'">
 				<u-search placeholder="请输入合同编号、车牌号或派车编号" v-model="keyword" @search="searchKeyWord()"
 					@custom="searchKeyWord()"></u-search>
 			</view>
@@ -12,12 +12,16 @@
 		</view>
 		<view class="introduce-section">
 			<view v-for="(item, index) in taskInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<view class="title flex">
-					<text>{{item.messageTitle}}</text>
-					<view class='line'>{{item.createDate}}</view>
+				<view class="title flex align-item-center">
+					<view>
+						<view>{{item.department}}:</view>
+						<view style='font-size:12px;color:#878C9C;'>{{item.createDate}}</view>
+					</view>
+					<text v-if='statusFlag==1' style='color:#FE6430;'>{{item.messageTitle}}</text>
+					<text v-if='statusFlag==3' style='color:#AFB3BF;'>{{item.messageTitle}}</text>
 				</view>
 				<view class="flex title_b">
-					<view class="title">
+					<view style='color:#878C9C;' class="title">
 						{{item.messageContent}}
 					</view>
 				</view>
@@ -220,6 +224,7 @@
 							that.loadStatus = 'nomore'
 						}
 						for (var i = 0; i < this.taskInfo.length; i++) {
+							this.taskInfo[i].department=this.taskInfo[i].messageContent.split(' ')[0]
 							if (this.taskInfo[i].businessType == 'WAREHOUSE') {
 								if (this.taskInfo[i].businessCode == 'INOUTTASK-TASK-APPROVE') {
 									this.taskInfo[i].messageTitle = '出入库任务'
@@ -228,9 +233,7 @@
 								if (this.taskInfo[i].businessCode == 'PAYMENT-MANAGEMENT-APPROVE') {
 									this.taskInfo[i].messageTitle = '付款管理'
 								}
-								if (this.taskInfo[i].businessCode == 'PROCUREMENT-PRICE-APPROVE') {
-									this.taskInfo[i].messageTitle = '仓库设置'
-								}
+								
 							} else if (this.taskInfo[i].businessType == 'REPORT') {
 								if (this.taskInfo[i].businessCode == 'PROCUREMENT-CLOSE-REPORT') {
 									this.taskInfo[i].messageTitle = '采购平仓统计'
@@ -255,7 +258,11 @@
 								if (this.taskInfo[i].businessCode == 'SALE-ORDER-APPROVE') {
 									this.taskInfo[i].messageTitle = '销售订单'
 								}
-							} else if (this.taskInfo[i].businessType == 'TRANSPORTATIONTASK') {
+							} else if (this.taskInfo[i].businessType == 'PROCUREMENT') {
+								if (this.taskInfo[i].businessCode == 'PROCUREMENT-PRICE-APPROVE') {
+									this.taskInfo[i].messageTitle = '仓库设置'
+								}
+							} else if (this.taskInfo[i].businessType == 'Tran') {
 								if (this.taskInfo[i].businessCode == 'TRAN-TASK-APPROVE') {
 									this.taskInfo[i].messageTitle = '运费设置'
 								}
@@ -460,8 +467,7 @@
 	}
 
 	.introduce-section .title text {
-		font-size: 17px;
-		font-weight: bold;
+		font-size: 14px;
 		height: 50px;
 		line-height: 50px;
 	}
@@ -487,12 +493,10 @@
 	}
 
 	.introduce-section .guess-item {
-		border-radius: 4px;
+		border-radius: 10px;
 		background: #fff;
-		padding: 0upx 30upx 20upx;
+		padding: 30upx 30upx 80upx;
 		margin: 10px;
-		padding-bottom: 20upx;
-		border-bottom: 1px solid #ccc;
 	}
 
 	.line {

+ 3 - 0
websocket_sdk.js

@@ -1,6 +1,7 @@
 import packetCode from './PacketCodeC.js'
 import store from './store/index.js'
 import * as config from './config'
+import helper from '@/common/helper.js'; 
 export default class Websocket {
     constructor({
         heartCheck,
@@ -276,6 +277,7 @@ export default class Websocket {
 					success: (res) => {						
 						if (res.statusCode === 200) {
 							uni.setStorageSync('pcUserInfo', res.data)
+							helper.getListByUserId()
 						}
 						else{
 							uni.request({
@@ -288,6 +290,7 @@ export default class Websocket {
 								success: (res) => {						
 									if (res.statusCode === 200) {
 										uni.setStorageSync('pcUserInfo', res.data)
+										helper.getListByUserId()
 									}
 								}
 							})