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

+ 102 - 12
operatingCompany/pages/entryReport/entered.vue

@@ -74,6 +74,8 @@
 				packageID:'',
 				packageName:'',
 				sheetID:'',
+				type:'',
+				sheetID:'',
 			}
 		},
 		onShow() {
@@ -88,9 +90,16 @@
 		   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 		   this.userInfo=uni.getStorageSync("userInfo");
 		   this.ShopName=opt.ShopName;
-		   this.shopId=opt.shopId;
+		   this.type=opt.type;
+		   if(this.type){
+			   this.sheetID=opt.sheetID
+		   }else{
+			    this.shopId=opt.shopId;
+			    this.getCheckPackageInfo();
+		   }
+		  
 		   this.getTime();
-		   this.getCheckPackageInfo();
+		  
 		   
 		},
 		methods: {
@@ -149,6 +158,89 @@
 				return timer;
 			},
 			goNext(){
+				if(this.type==3){
+					this.goEdit()
+				}else{
+					var go=true;
+					var name='';
+					var categoryList=[]
+					console.log(this.list)
+					this.list.forEach(item=>{
+						var obj={
+							categoryID:item.categoryID,
+							categoryName:item.categoryName,
+							sectionList:[]
+						}
+						item.sectionList.forEach(v=>{
+							if(v.check){
+								var isCheck=1
+							}else{
+								var isCheck=0
+							}
+							var sectionListobj={
+								sectionID:v.sectionID,
+								checkName:v.checkName,
+								checkCycle:v.checkCycle,
+								isCheck:isCheck,
+								isRequired:v.isRequired,
+								itemList:[]
+							}
+							if(v.isRequired==1){
+								if(!v.check){
+									go=false
+									name=v.checkName
+								}
+							}
+							
+							v.itemList.forEach(i=>{
+								var itemObj={
+									itemName:i.itemName,
+									sectionItemID:i.sectionItemID,
+									itemValue:i.itemValue,
+									describe:i.describe,
+									keyType:i.keyType,
+									keyValue:i.keyValue,
+								}
+								sectionListobj.itemList.push(itemObj)
+							})
+							obj.sectionList.push(sectionListobj)
+						})
+							categoryList.push(obj);
+						
+					})
+								
+					console.log('categoryList')
+					console.log(categoryList)
+					if(!go){
+						uni.showToast({
+						    title: '请填写'+name,
+							 icon:'none',
+						    duration: 3000,
+						});
+						return false;
+					}
+					uni.showLoading({ });
+					this.$http('accompany/SuperCheckSheet/addSuperCheckSheet', {
+						shopID:this.shopId,
+						shopName:this.ShopName,
+						checkTime:this.date,
+						packageID:this.packageID,
+						packageName:this.packageName,
+						categoryList:JSON.stringify(categoryList)
+					}, 'POST').then(res => {
+						this.sheetID=res.data;
+						console.log(this.sheetID);
+						uni.navigateTo({
+							url:'opinion?sheetID='+this.sheetID
+						})
+					})
+				}
+				
+				
+				
+			},
+			goEdit(){
+				
 				var go=true;
 				var name='';
 				var categoryList=[]
@@ -157,6 +249,7 @@
 					var obj={
 						categoryID:item.categoryID,
 						categoryName:item.categoryName,
+						id:item.id,
 						sectionList:[]
 					}
 					item.sectionList.forEach(v=>{
@@ -171,6 +264,7 @@
 							checkCycle:v.checkCycle,
 							isCheck:isCheck,
 							isRequired:v.isRequired,
+							id:v.id,
 							itemList:[]
 						}
 						if(v.isRequired==1){
@@ -188,6 +282,7 @@
 								describe:i.describe,
 								keyType:i.keyType,
 								keyValue:i.keyValue,
+								id:i.id,
 							}
 							sectionListobj.itemList.push(itemObj)
 						})
@@ -196,7 +291,7 @@
 						categoryList.push(obj);
 					
 				})
-			
+							
 				console.log('categoryList')
 				console.log(categoryList)
 				if(!go){
@@ -208,23 +303,18 @@
 					return false;
 				}
 				uni.showLoading({ });
-				this.$http('accompany/SuperCheckSheet/addSuperCheckSheet', {
-					shopID:this.shopId,
-					shopName:this.ShopName,
+				this.$http('accompany/SuperCheckSheet/editSuperCheckSheet', {
+					sheetID:this.sheetID,
 					checkTime:this.date,
-					packageID:this.packageID,
-					packageName:this.packageName,
 					categoryList:JSON.stringify(categoryList)
 				}, 'POST').then(res => {
 					this.sheetID=res.data;
 					console.log(this.sheetID);
 					uni.navigateTo({
-						url:'opinion?sheetID='+this.sheetID
+						url:'opinion?sheetID='+this.sheetID+'&type='+this.type
 					})
 				})
-				
-				
-			}
+			},
 		},
 		onUnload(){
 			

+ 2 - 0
operatingCompany/pages/entryReport/entryReport.vue

@@ -182,6 +182,8 @@
 				})
 			},
 			goEntered(item){
+				this.$store.commit('mutationsCategoryList','');
+				this.$store.commit('mutationssuggestList','')
 				uni.navigateTo({
 					url:'entered?shopId='+item.shopId+'&ShopName='+item.ShopName
 				})

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

@@ -60,7 +60,10 @@
 		},
 		onLoad(opt) {
           //页面加载初始化生命周期函数
-		  this.sheetID=opt.sheetID
+		  this.sheetID=opt.sheetID;
+		  if(opt.type==3){
+			  this.suggestList=this.$store.state.suggestList
+		  }
 		},
 		methods: {
 			bindTimeChange(e){
@@ -95,6 +98,12 @@
 				     	 icon:'success',
 				         duration: 2000,
 				     });
+					 setTimeout(function(){
+					 	uni.navigateBack({
+					 		delta:2
+					 	})
+					 },1000)
+					
 				})
 			},
 			submit(){
@@ -118,6 +127,9 @@
 				    	 icon:'success',
 				        duration: 2000,
 				    });
+					uni.navigateBack({
+						delta:2
+					})
 				})
 			}
            

+ 99 - 7
operatingCompany/pages/reportManage/reportDetail.vue

@@ -139,7 +139,7 @@
 					</view>
 				</view>
 				
-				<view class="remarksLine">
+				<view class="remarksLine" v-if="lookShow">
 					<view class="remarksLineTop">
 						<view class="remarksLineTopTitle">对运营经理的服务评价</view>
 						<view class="remarksLineTopXxbox">
@@ -160,9 +160,9 @@
 		</view>
 	   <view style="height: 150rpx;"></view>
 	   <view class="bottom"  v-if="info.state==1&&loginType==1">
-		    <view class="delBtn">删除</view>
-		    <view class="editBtn">编辑</view>
-			<view class="Submit">提交</view>
+		    <view class="delBtn" @click="delBg">删除</view>
+		    <view class="editBtn" @click="editBg">编辑</view>
+			<view class="Submit" @click="submitBg">提交</view>
 	   </view>
 	   <view class="bottom"  v-if="info.state==2&&loginType==1">
 	   		<view class="shoreDz">发送给店长</view>
@@ -191,15 +191,22 @@
 				 iStatusBarHeight:'',
 				 id:'',
 				 info:'',
-				 tabIndex:3,
+				 tabIndex:1,
 				 lat:'',
 				 lng:'',
 				 loginType:'',
 				 type:1,
+				 userInfoId:'',
+				 mEvaluateLook:'',
+				 lookShow:true,
 			}
 		},
 		onLoad(opt) {
-            
+			if(uni.getStorageSync("logInData").userInfo){
+				this.userInfoId=uni.getStorageSync("logInData").userInfo.id;
+				this.mEvaluateLook=uni.getStorageSync("logInData").mEvaluateLook;
+			}
+          
 		    var that=this;
 			this.loginType=uni.getStorageSync("logInData").type;
 			console.log('this.loginType=='+this.loginType)
@@ -234,6 +241,47 @@
 					delta:1
 				})
 			},
+			editBg(){
+				this.info.categoryList.forEach(item=>{
+					item.sectionList.forEach(v=>{
+						v.check=v.isCheck;
+						v.itemList.forEach(i=>{
+							if(i.keyType==1){
+								
+								i.keyValue=i.keyValue.replace(/,/ig,',')
+								var array= i.keyValue.split(",")
+								var array2=i.itemValue.split(",")
+								var arr=[];
+								console.log(array2)
+								array.forEach(name=>{
+									var index = array2.indexOf(name);
+									console.log(index)
+									if(index!=-1){
+										var obj={
+											name:name,
+											check:true
+										}
+									}else{
+										var obj={
+											name:name,
+											check:false
+										}
+									}
+									
+									arr.push(obj)
+								})
+								i.array=arr
+							}
+						})
+					})
+				})
+				//console.log(this.info.categoryList)
+				this.$store.commit('mutationsCategoryList',this.info.categoryList);
+				this.$store.commit('mutationssuggestList',this.info.suggestList)
+				uni.navigateTo({
+					url:'../entryReport/entered?type=3&sheetID='+this.id
+				}) 
+			},
 			goaddress(){
 				var that=this;
 				if(that.info.shopInfo.lat==''||that.info.shopInfo.lng==''){
@@ -287,13 +335,57 @@
 						lng:this.lng
 					}
 				this.$http(url, params, 'GET').then(res => {
-					this.info = res.data
+					this.info = res.data;
+					if(this.userInfoId==res.data.managerID){
+						if(this.mEvaluateLook==0){
+							this.lookShow=false;
+						}
+					}
+					
 				})
 			},
 			editWork(){
 				uni.navigateTo({
 					url:'../shop/shopIndex/editWork?sheetID='+this.id
 				})
+			},
+			delBg(){
+				var that=this;
+				 uni.showModal({
+				     title: '提示',
+				     content: '您确定要删除报告吗?',
+				     success: function (res) {
+				         if (res.confirm) {
+				             uni.showLoading({ });
+				             that.$http('accompany/SuperCheckSheet/deleteSuperCheckSheet', {
+				             	sheetID:that.id,
+				             	
+	
+				             }, 'POST').then(res => {
+				                uni.showToast({
+				                    title: '删除成功',
+				                	 icon:'success',
+				                    duration: 2000,
+				                });
+				                uni.navigateBack({
+				                	delta:1
+				                })
+				             })
+							 
+				         } else if (res.cancel) {
+				             console.log('用户点击取消');
+				         }
+				     }
+				 }); 
+			},
+			submitBg(){
+				uni.showLoading({ });
+				this.$http('accompany/SuperCheckSheet/submitSuperCheckSheet', {
+					sheetID:this.id,
+					
+				}, 'POST').then(res => {
+				  this.getSuperCheckSheetInfo()
+				})
 			}
            
 		}

+ 10 - 0
operatingCompany/store/index.js

@@ -5,20 +5,30 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
     state: {
 		categoryList:'',
+		suggestList:'',
 	},
 	getters:{
 		gettersCategoryList(state){
 			return state.categoryList
+	   },
+	   getterssuggestList(state){
+	   			return state.suggestList
 	   }
     },
     mutations: {
 		mutationsCategoryList(state,data){
 			state.categoryList=data
+		},
+		mutationssuggestList(state,data){
+			state.suggestList=data
 		}
 	},
     actions: {
 		actionsCategoryList(context,playload){
 			context.commit('mutationsCategoryList',playload)
+		},
+		actionssuggestList(context,playload){
+			context.commit('mutationssuggestList',playload)
 		}
 	}
 })