소스 검색

Merge branch 'debug-xxa' into 'master'

台账问题处理

See merge request spfm-group/spfm-market-front!66
徐兴安 3 년 전
부모
커밋
d882490d9b
3개의 변경된 파일116개의 추가작업 그리고 34개의 파일을 삭제
  1. 61 5
      public/static/js/util.js
  2. 19 10
      public/static/views/publiAccount.html
  3. 36 19
      src/pages/main/advertising/indexs.vue

+ 61 - 5
public/static/js/util.js

@@ -774,6 +774,62 @@ util = {
 		});
 
 	},
+	ajaxJsonWithoutDisload: function (msg, url, param, callBack, beforeSend, async) {
+
+		if (!util.isNull(msg)) {
+
+			util.load(msg);
+
+		}
+
+		var urlParam = util.urlToArr(url);
+
+		$.extend(urlParam, param);
+
+
+		$.ajax({
+			type: "POST",
+			url: url,
+			global: true,
+			data: JSON.stringify(urlParam),
+			contentType: "application/json;charset=UTF-8",
+			beforeSend: function (req) {
+
+				req.setRequestHeader("agileauthtoken", util.getToken());
+
+				if ($.isFunction(beforeSend)) {
+
+					beforeSend.call(this, req);
+				}
+
+
+			},
+			xhrFields: {
+				withCredentials: false //跨域session保持
+			},
+			async: async == undefined ? true : async,
+			dataType: "json",
+			success: function (page) {
+				//防止取消掉下面ajax的遮罩层
+				// util.disLoad();
+
+				if ($.isFunction(callBack)) {
+
+					callBack.call(this, page);
+				}
+
+			},
+			error: function (xhr, textStatus, errorThrow) {
+
+				util.disLoad();
+
+				util.closeAll();
+
+				util.error("系统异常!");
+			}
+		});
+
+	},
 	ajaxFile: function (msg, url, form, succFunc, errorFunc, xhrFunc) {
 
 		util.load(msg);
@@ -931,13 +987,13 @@ util = {
 	},
 	/**
 	 * 判断ie版本
-	 * 
+	 *
 	 */
 	IEVersion: function () {
 
-		var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串  
-		var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器  
-		var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器  
+		var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
+		var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
+		var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
 		var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
 		if (isIE) {
 			var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
@@ -957,7 +1013,7 @@ util = {
 		} else if (isEdge) {
 			return -1; //edge
 		} else if (isIE11) {
-			return 11; //IE11  
+			return 11; //IE11
 		} else {
 			return -1; //不是ie浏览器
 		}

+ 19 - 10
public/static/views/publiAccount.html

@@ -88,16 +88,25 @@
     </script>
     <script>
 		var lockFlag = 'see'; // 模板状态--see查看add新增updates修改
-		let Menus = JSON.parse(window.sessionStorage.childrenMenus);
-		for (let i = 0; i < Menus.length; i++) {
-			if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicityAccount'){
-				lockFlag = 'add';//省级
-			}
-			if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicity'){
-				lockFlag = 'updata';//管理员
-				i = Menus.length;
-			}
-		}
+		// let Menus = JSON.parse(window.sessionStorage.childrenMenus);
+		// for (let i = 0; i < Menus.length; i++) {
+		// 	if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicityAccount'){
+		// 		lockFlag = 'add';//省级
+		// 	}
+		// 	if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicity'){
+		// 		lockFlag = 'updata';//管理员
+		// 		i = Menus.length;
+		// 	}
+		// }
+        util.ajaxJsonWithoutDisload("", ctx + "/market/cadvLedger/getRoleByCode", {
+        }, function (res) {
+            console.log("html"+res.result);
+            if (res.result == 1) {
+                lockFlag = 'add';//省级
+            }else{
+                lockFlag = 'updata';//管理员
+            }
+        });
         var id = '' //  模板id 查看/修改load时候用
         var powerFlag = '0'; // 权限控制 0 开启 1关闭
         var excelId = '';

+ 36 - 19
src/pages/main/advertising/indexs.vue

@@ -1,7 +1,7 @@
 <template>
     <fullscreen :fullscreen.sync="fullscreen" class="container">
         <div class="container-box">
-			
+
 			<h2>广告宣传费台账</h2>
 			<div class="adv-type">
 			    <div @click="jumpinfop('/publicityAccount',1,'宣传费台账')" v-if="lockFlag == 'updata'">
@@ -17,7 +17,7 @@
 			        <span>查看/下载</span>
 			    </div>
 			</div>
-			
+
       </div>
 
     </fullscreen>
@@ -37,7 +37,7 @@
 			myUpload
         },
         data() {
-          
+
             return {
                 fullscreen: false,
 				lockFlag:'see',
@@ -77,30 +77,47 @@
 			    this.$store.commit("setDefaultActive", params.rountPath);
 			    this.$store.commit("setTabList", Array.from(set));
 			},
+            getRole(){
+                this.$http({
+                    url:"/market/cadvLedger/getRoleByCode",
+                    method: "post",
+                    headers: {
+                        "Content-Type": "application/json",
+                    },
+                    data: {}
+                }).then(res => {
+                    console.log("vue"+res.data.result);
+                    if(res.data.result == "1"){
+                        this.lockFlag = 'add';//省级
+                    }else{
+                        this.lockFlag = 'updata';//管理员
+                    }
+                });
+            },
             getUser() {
                 this.userInfo = JSON.parse(window.sessionStorage.userInfo);
-				let Menus = JSON.parse(window.sessionStorage.childrenMenus);
-				for (let i = 0; i < Menus.length; i++) {
-					if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicityAccount'){
-						this.lockFlag = 'add';//省级
-					}
-					if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicity'){
-						this.lockFlag = 'updata';//管理员
-						i = Menus.length;
-					}
-				}
-				for (let i = 0; i < Menus.length; i++) {
-					if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/province'){
-						this.province = true;//省公司
-					}
-				}
+				//let Menus = JSON.parse(window.sessionStorage.childrenMenus);
+				// for (let i = 0; i < Menus.length; i++) {
+				// 	if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicityAccount'){
+				// 		this.lockFlag = 'add';//省级
+				// 	}
+				// 	if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/publicity'){
+				// 		this.lockFlag = 'updata';//管理员
+				// 		i = Menus.length;
+				// 	}
+				// }
+				// for (let i = 0; i < Menus.length; i++) {
+				// 	if(Menus[i].systemflag == 1 && Menus[i].jspUrl == '/province'){
+				// 		this.province = true;//省公司
+				// 	}
+				// }
             }
         },
         mounted() {
             this.getUser();
         },
         created() {
-
+            this.getRole();
         }
     }
 </script>