Forráskód Böngészése

登录,录入报告修改

twt 3 éve%!(EXTRA string=óta)
szülő
commit
313f607901

+ 13 - 2
operatingCompany/common/common.js

@@ -2,9 +2,20 @@ const isUserId = function() {
 	var userId = uni.getStorageSync("logInData").uid;
 	// console.log("userId---" + userId)
 	if (!userId) {
-		uni.reLaunch({
+		/* uni.reLaunch({
 			url: '../logIn/logIn?type=2'
-		})
+		}) */
+		var openid = uni.getStorageSync("wxOpendata").openid;
+		if(!openid){
+			uni.navigateTo({
+				url: '../logIn/home'
+			})
+		}else{
+			uni.navigateTo({
+				url: '../logIn/logIn?type=2'
+			})
+		}
+		
 	}
 }
 //是否 部门主管

+ 12 - 2
operatingCompany/common/request.js

@@ -47,9 +47,19 @@ const http = (url = '', date = {}, type = 'POST', header = {
 				     duration: 3000,
 				 });
 				uni.clearStorageSync()
-				 uni.navigateTo({
+				/* uni.navigateTo({
 					url:'../logIn/logIn?type=2'
-				 })
+				 }) */
+				 var openid = uni.getStorageSync("wxOpendata").openid;
+				 if(!openid){
+				 	uni.navigateTo({
+				 		url: '../logIn/home'
+				 	})
+				 }else{
+				 	uni.navigateTo({
+				 		url: '../logIn/logIn?type=2'
+				 	})
+				}
 			}else if(res.data.code==0){
 				// 正常
 				 resolve(res.data);

+ 1 - 1
operatingCompany/main.js

@@ -28,7 +28,7 @@ export function createApp() {
   }
 }
 // #endif
-
+//ae3737d4d27ffc8dff0c8f53c5e35b16  秘钥
 // Vue全局处理undefined和null转为空白字符串
 Vue.prototype.$praseStrEmpty = function(str) {
     if (typeof str === 'undefined' || str === null) {

+ 2 - 1
operatingCompany/manifest.json

@@ -52,7 +52,8 @@
     "mp-weixin" : {
         "appid" : "wx33053a645546ec31",
         "setting" : {
-            "urlCheck" : false
+            "urlCheck" : false,
+            "minified" : true
         },
         "usingComponents" : true,
         "permission" : {

+ 3 - 1
operatingCompany/pages/AccountSet/AccountSet.vue

@@ -53,7 +53,9 @@
 				})
 			},
 			logOut() {
-				uni.clearStorageSync();
+				//uni.clearStorageSync();
+				uni.removeStorageSync('userInfo');
+				uni.removeStorageSync('logInData');
 				uni.reLaunch({
 					url:'../logIn/logIn'
 				})

+ 100 - 1
operatingCompany/pages/entryReport/opinion.vue

@@ -7,6 +7,17 @@
 				 <view class="delOpTxt">删除</view>
 			 </view>
 			</view>
+			<view class="lineCont">
+				<view class="lineContLeft">检测项</view>
+				<view class="lineContRight"  @click="pickerClick(item)">
+					<picker mode="multiSelector" @change="bindPickerChange" @columnchange="columnchange" :value="index" :range="array"
+						 range-key="title">
+						<view class="timeNoSpan" v-if="!item.checkName">{{title}}</view>
+					    <view v-else>{{item.categoryName}}-{{item.checkName}}</view>
+					</picker>
+					
+				</view>
+			</view>
 			<view class="lineCont">
 				<view class="lineContLeft">负责人</view>
 				<view class="lineContRight" >
@@ -53,12 +64,21 @@
 						suggest:'',
 						orderFinishTime:'',
 						managerName:'',
+						sheetCategoryID:'',
+						sheetSectionID:'',
+						categoryName:'',
+						checkName:'',
 					}
 				],
 				sheetID:'',
 				shopName:'',
 				Contactor:'',
 				nowDate:'',
+				index: [0, 0],
+				array: [[],[]],
+				childArr: [], // 二级分类数据源
+				title: '请选择',
+				pickerItem:'',
 			}
 		},
 		onLoad(opt) {
@@ -70,9 +90,28 @@
 			  this.suggestList=this.$store.state.suggestList;
 			  this.addOp()
 		  }
-		  this.getTime()
+		  this.getTime();
+		  this.getqueryCheckCategory();
 		},
 		methods: {
+			// 选择任务分类
+			bindPickerChange: function(e) {
+				//console.log(e)
+				console.log('picker发送选择改变,携带值为', e.target.value)
+				let value = e.target.value;
+				this.index = value;
+				if (this.array[0].length != 0) {
+					//this.title = this.array[0][this.index[0]].title
+					this.pickerItem.categoryName= this.array[0][this.index[0]].title
+					this.pickerItem.sheetCategoryID= this.array[0][this.index[0]].id
+				};
+				if (this.array[1].length != 0) {
+					//this.title += ',' + this.array[1][this.index[1]].title
+					this.pickerItem.checkName=this.array[1][this.index[1]].title;
+					this.pickerItem.sheetSectionID= this.array[1][this.index[1]].id;
+				}
+   
+			},
 			bindTimeChange(e){
 				console.log(e)
 				this.pickerItem.orderFinishTime=e.detail.value;
@@ -85,6 +124,10 @@
 					suggest:'',
 					orderFinishTime:'',
 					managerName:'',
+					sheetCategoryID:'',
+					sheetSectionID:'',
+					categoryName:'',
+					checkName:'',
 				}
 				this.suggestList.push(obj)
 			},
@@ -109,6 +152,7 @@
 				var goname=true;
 				var gotime=true;
 				var gosuggest=true;
+				var gojc=true;
 				var that=this;
 				this.suggestList.forEach(item=>{
 					if(item.managerName==''){
@@ -120,6 +164,9 @@
 					if(item.suggest==''){
 						gosuggest=false;
 					}
+					if(item.sheetCategoryID==''){
+						gojc=false;
+					}
 				})
 				if(!goname){
 					uni.showToast({
@@ -142,7 +189,15 @@
 					    duration: 2000,
 					});
 					return false;
+				}else if(!gojc){
+					uni.showToast({
+					    title: '请选择检测项',
+						 icon:'none',
+					    duration: 2000,
+					});
+					return false;
 				}
+				console.log(gojc)
 				console.log(this.suggestList);
 				
 				uni.showLoading({ });
@@ -172,6 +227,7 @@
 				var goname=true;
 				var gotime=true;
 				var gosuggest=true;
+				var gojc=true;
 				this.suggestList.forEach(item=>{
 					if(item.managerName==''){
 						goname=false;
@@ -182,6 +238,9 @@
 					if(item.suggest==''){
 						gosuggest=false;
 					}
+					if(item.sheetCategoryID==''){
+						gojc=false;
+					}
 				})
 				if(!goname){
 					uni.showToast({
@@ -204,6 +263,13 @@
 					    duration: 2000,
 					});
 					return false;
+				}else if(!gojc){
+					uni.showToast({
+					    title: '请选择检测项',
+						 icon:'none',
+					    duration: 2000,
+					});
+					return false;
 				}
 				uni.showLoading({ });
 				this.$http('accompany/SuperCheckSheet/saveSuperCheckSheetSuggest', {
@@ -245,6 +311,39 @@
 					
 				})
 			},
+			getqueryCheckCategory(){
+				this.$http('accompany/SuperCheckSheet/queryCheckCategory', {
+					sheetID:this.sheetID,
+					
+				}, 'GET').then(res => {
+					res.data.forEach(item=>{
+						item.title=item.categoryName
+						item.sectionList.forEach(v=>{
+							v.title=v.checkName
+						})
+					})
+					this.array[0]=res.data;
+					this.childArr = res.data.map((item) => item.sectionList)
+					// 第一次打开时,默认给一级分类添加它的二级分类
+					this.array[1] = this.childArr[0]
+				})
+			},
+			// 获取二级分类
+			columnchange(e) {
+				// 当滚动切换一级分类时,为当前的一级分类添加它的子类
+				if (e.detail.column == 0) {
+					// #ifdef H5
+					// 在小程序中直接赋值无效  H5 可直接赋值
+					this.array[1] = this.childArr[e.detail.value]
+					// #endif
+					// #ifdef MP-WEIXIN
+					// 在 H5 环境下 $set 会导致一级分类无法滚动, 小程序正常运行
+					this.$set(this.array, 1, this.childArr[e.detail.value])
+					// #endif
+				}
+			},
+		   
+		 
 			getTime(){
 				var date = new Date(),
 				year = date.getFullYear(),

+ 1 - 1
operatingCompany/pages/entryReport/shopEvaStar.vue

@@ -169,7 +169,7 @@
 		    console.log(this.sheetID)
 		    return {
 		      title: '报告详情',
-		      path: '/pages/reportManage/reportDetail?id='+this.sheetID
+		      path: '/pages/reportManage/reportDetail?id='+this.sheetID+'&dztype=1'
 		    }
 		 }
 	}

+ 15 - 0
operatingCompany/pages/index/index.vue

@@ -74,6 +74,21 @@
 		onLoad() {
 			//页面加载初始化生命周期函数
              this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
+			 
+			 //#ifdef H5
+			  var wxOpendata={
+				  openid: "o82ym5Hibc2EuO_k5DwudNk17v08",
+				  session_key: "jl7dKJHQwzBV0df15M4UEw==",
+				  unionid: "oH6Atwxitb1_hteVhEfqtCh6Ytb4"
+			  }
+			  uni.setStorage({
+			  	key: 'wxOpendata',
+			  	data:wxOpendata,
+			  	success: function () {
+			  	 
+			  	}
+			  }); 
+			  // #endif
 		},
 		onShow() {
 			this.uid = uni.getStorageSync("logInData").uid;

+ 71 - 2
operatingCompany/pages/logIn/home.vue

@@ -27,6 +27,8 @@
 		data() {
 			return {
 				iStatusBarHeight: '',
+				wxdata:"",
+				wxCode:'',
 			}
 		},
 		onLoad() {
@@ -48,12 +50,79 @@
 		methods: {
 
 			logIn() {
-
+                var that=this;
+                uni.getUserProfile({
+                	lang:'zh_CN',
+                	desc:'登录',
+                	success:(res)=>{
+                		console.log(res);
+                		 that.wxdata=res;
+                		 /* uni.setStorage({
+                			key: 'wxdata',
+                			data: res,
+                			success: function () {
+                			    
+                			 
+                			}
+                		}); */
+						that.ipLogin()
+                	},
+                	fail:(res)=>{
+                		console.log(res)
+                	}
+                });
+				//#ifdef H5
+				
 				uni.navigateTo({
 					url: '../logIn/logIn'
 				})
-			}
+				 // #endif
+				
+			},
+			ipLogin(){
+			 var that=this;
+			 uni.showLoading({ });
+			 uni.login({
+			   provider: 'weixin',
+			   success: function (loginRes) {
+			     console.log(loginRes)
+				that.wxCode=loginRes.code
+				that.getWxOpenID()
+					//that.gologin()
+				 /* uni.navigateTo({
+				  	url: '../logIn/logIn?code='+loginRes.code
+				  }) */
+			   
+			   }
+			 });
 			
+		},
+		getWxOpenID(){
+			var that=this;
+			uni.showLoading({
+				title: '请稍等'
+			})
+			 this.$http('accompany/superusers/getWxOpenID', {
+			   code:this.wxCode,
+			 },'GET').then(res => {
+				//console.log(res)
+				//this.openID=res.data.openid;
+				//this.session_key=res.data.session_key;
+				console.log(this.openID)
+				uni.setStorage({
+					key: 'wxOpendata',
+					data: res.data,
+					success: function () {
+					   // that.ipLogin()
+					  uni.navigateTo({
+					   	url: '../logIn/logIn'
+					   })
+					 
+					}
+				}); 
+				//this.Login()
+			})
+		},
 
 		}
 	}

+ 6 - 0
operatingCompany/pages/logIn/logIn.vue

@@ -64,11 +64,15 @@
 				iStatusBarHeight: '',
 				sendFlag:true,
 				type:'',
+				dztype:'',
 			}
 		},
 		onLoad(opt) {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.type=opt.type;
+			if(opt.dztype==1){
+				this.roleType=2
+			}
 		},
 		methods: {
 			roleTypeFirst() {
@@ -126,10 +130,12 @@
 				uni.showLoading({
 					title: '登录中'
 				})
+				var openid = uni.getStorageSync("wxOpendata").openid;
 				this.$http('accompany/superusers/phoneLogin', {
 					phone: this.phoneValue,
 					code: this.codeValue,
 					type: this.roleType,
+					openid:openid,
 				}, 'POST').then(res => {
 
 					uni.setStorage({

+ 50 - 10
operatingCompany/pages/reportManage/reportDetail.vue

@@ -114,13 +114,17 @@
 				<view class="suggestLine" v-for="(item,index) in info.suggestList">
 					<view class="suggestLineTop">建议({{index+1}})</view>
 					<view class="suggestCont">{{item.suggest}}</view>
+					<view class="suggestCont" style="padding-top: 0;">
+						<view class="">检测项:{{item.categoryName}}-{{item.checkName}}</view>
+					</view>
 					<view class="suggestLineBottom" style="padding-bottom: 20rpx;border-bottom: 1px solid #EEEEEE;">
 						<view class="suggestLineBottomTxt">预计完成日期:{{item.orderFinishTime.slice(0,item.orderFinishTime.length-8)}}</view>
 						<view class="suggestLineBottomTxt">负责人:{{item.managerName}}</view>
 					</view>
 					<image src="../../static/img/report_weixiugai@2x.png" mode="" class="exeStateImg" v-if="item.exeState==0&&info.state!=1"></image>
 					<image src="../../static/img/_report_yixiugai@2x.png" mode="" class="exeStateImg" v-if="item.exeState==1&&info.state!=1"></image>
-				    <!-- 作业情况-->
+				   
+					<!-- 作业情况-->
 					<view v-if="item.exeState==1">
 						<view class="remarksLineTxt1" style="color: #666666;">
 							作业情况
@@ -129,6 +133,7 @@
 						<view class="workqkImgBox">
 							<image class="workqkImg"  @click="previewImage(img,item.exeImg)" v-for="(img,imgIndex) in item.exeImg" :src="img"></image>
 						</view> 
+						
 						<view class="suggestLineBottom">
 							<view class="suggestLineBottomTxt">实际完成日期:{{item.exeTime.slice(0,item.exeTime.length-8)}}</view>
 						</view>
@@ -239,7 +244,9 @@
 			}
 		},
 		onLoad(opt) {
-			this.$common.isUserId()
+			//this.$common.isUserId()
+			
+			
 		    console.log(opt)
 			if(uni.getStorageSync("logInData").userInfo){
 				this.userInfoId=uni.getStorageSync("logInData").userInfo.id;
@@ -255,18 +262,32 @@
 			if(opt.type){
 			  this.backType=opt.type
 			}
-		
-			//this.getSuperCheckSheetInfo();
+		    var userId = uni.getStorageSync("logInData").uid;
+		    // console.log("userId---" + userId)
+		    if (!userId) {
+				var openid = uni.getStorageSync("wxOpendata").openid;
+				if(!openid){
+					uni.navigateTo({
+						url: '../logIn/home'
+					})
+				}else{
+					uni.navigateTo({
+						url: '../logIn/logIn?type=2&dztype='+opt.dztype
+					})
+				}
+		    	return false;
+		    }
 			uni.getLocation({
 				success(res) {
 					that.lng = res.longitude
 					that.lat = res.latitude
 					that.getSuperCheckSheetInfo()
 				},
-				fail() {
+				fail() {}
 				
-				}
 			})
+			//this.getSuperCheckSheetInfo();
+			
 			//#ifdef H5
 			
 			that.lng='117.06533'
@@ -275,9 +296,20 @@
 			 // #endif
 		},
 		onShow() {
-			if(this.id&&this.lat){
-				console.log(this.id)
-			    this.getSuperCheckSheetInfo()
+			if(this.id){
+				console.log("onShow"+this.id)
+			   //this.getSuperCheckSheetInfo()
+			   var that=this;
+			   uni.getLocation({
+			   	success(res) {
+			   		that.lng = res.longitude
+			   		that.lat = res.latitude
+			   		that.getSuperCheckSheetInfo()
+			   	},
+			   	fail() {
+			   	
+			   	}
+			   })
 			}
 		},
 		methods: {
@@ -426,6 +458,14 @@
 				})
 			},
 			getSuperCheckSheetInfo(){
+				var userId = uni.getStorageSync("logInData").uid;
+				// console.log("userId---" + userId)
+				if (!userId) {
+					uni.navigateTo({
+						url: '../logIn/logIn?type=2&dztype='+opt.dztype
+					})
+					return false;
+				}
 				console.log("getSuperCheckSheetInfo"+this.id)
 				uni.showLoading({
 					title: '加载中'
@@ -547,7 +587,7 @@
 		    console.log(res)
 		    return {
 		      title: '报告详情',
-		      path: '/pages/reportManage/reportDetail?id='+this.id,
+		      path: '/pages/reportManage/reportDetail?id='+this.id+'&dztype=1',
 			  success(res){
 				    uni.hideLoading();
 					setTimeout(function(){

+ 3 - 1
operatingCompany/pages/shop/shopIndex/index.vue

@@ -200,7 +200,9 @@
 				})
 			},
 			logOut() {
-				uni.clearStorageSync();
+				//uni.clearStorageSync();
+				uni.removeStorageSync('userInfo');
+				uni.removeStorageSync('logInData');
 				uni.reLaunch({
 					url: '../../logIn/logIn'
 				})