LiGuang 3 lat temu
rodzic
commit
fe6ab0dcfd

+ 6 - 1
common/router/index.js

@@ -21,11 +21,16 @@ Vue.use(Router)
 		 next()
 	}else{
 		if (whiteList.indexOf(to.path) !== -1) {
+			console.log(to.path)
 		  next()
 		}else{
 			uni.clearStorageSync()
 			 store.commit('SET_TOKEN',"");
-		  next({ path: '/pages/login/login'})
+		  /* window.location.reload() */
+		   uni.navigateTo({
+		  	url:'/pages/login/login'
+		  }) 
+		 
 		}
 	} 
 }) 

+ 7 - 0
common/router/modules/routes.js

@@ -44,6 +44,13 @@ const routes = [
 	        title: '个人编辑',
 	    },
 	},
+	{
+	    path: '/pages/component/form',
+	    name: 'form',
+	    meta: {
+	        title: '个人编辑',
+	    },
+	},
 	{
 	    path: '/pages/user/userexit',
 	    name: 'userexit',

+ 8 - 2
common/service/config.service.js

@@ -7,10 +7,16 @@ let BASE_URL = ''
 // 	BASE_URL = 'https://api.g.dr1997.com/jeecg-boot/' // 生产环境
 // } 
  
+/* if (process.env.NODE_ENV == 'development') {
+    BASE_URL = 'http://58.34.141.138:8085/jeecg-boot' // 开发环境
+} else {
+	BASE_URL = 'http://58.34.141.138:8085/jeecg-boot' // 生产环境
+} */
+
  if (process.env.NODE_ENV == 'development') {
-    BASE_URL = 'http://10.0.0.94:8080/jeecg-boot' // 开发环境
+    BASE_URL = 'http://localhost:8080/jeecg-boot/' // 开发环境
 } else {
-	BASE_URL = 'http://10.0.0.94:8080/jeecg-boot' // 生产环境
+	BASE_URL = 'http://localhost:8080/jeecg-boot/' // 生产环境
 } 
 let staticDomainURL = BASE_URL+ '/sys/common/static';
 

+ 13 - 7
common/service/service.js

@@ -15,7 +15,6 @@ const getTokenStorage = () => {
 		//TODO handle the exception
 		console.log("getTokenStorage",token)
 	}
-	console.log(token,+"sss")
 	return token
 }
 
@@ -51,7 +50,6 @@ http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
     cancel('token 不存在') // 接收一个参数,会传给catch((err) => {}) err.errMsg === 'token 不存在'
   }
   */
- console.log(config);
   return config
 })
 
@@ -77,11 +75,19 @@ http.interceptor.response(async (response) => { /* 请求之后拦截器 */
           break
         case 500:
           if(!token || data.message=="Token失效,请重新登录"){
-            let timeout=setTimeout(tip.alert('登录已过期'), 1000);
-			uni.navigateTo({
-				url:'/pages/login/login'
-			}) 
-           /* store.dispatch('Logout').then(() => {
+				uni.clearStorageSync() 
+				store.commit('SET_TOKEN',"");
+				store.commit('SET_USERID',"");
+				// uni.navigateTo({
+				// 	url:'/pages/login/login'
+				// }) 
+				/* window.location.reload() */
+				//  uni.navigateTo({
+				// 	url:'/pages/login/login'
+				// }) 
+				window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=hr3.gksports.net.cn:8082&response_type=code&scope=snsapi_userinfo&agentid=1000018&state=STATE#wechat_redirect";
+				//window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=zdd.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000003&state=STATE#wechat_redirect";
+		   /* store.dispatch('Logout').then(() => {
 				clearTimeout(timeout)
                
 				uni.navigateTo({

+ 4 - 2
components/xiaolu-tree/code.js

@@ -126,10 +126,10 @@ export default {
 		handles(item){
 			uni.setStorageSync("id",item.id);
 			var orgType=uni.getStorageSync('orgType');
-			if(!item.user&&orgType==1){
+			/* if(!item.user&&orgType==1){
 				this.$store.commit('SET_DEPARTID',item.id)
 				 this.$Router.push({name:'empsign'}) 
-			}else if (item.user&&orgType==1){
+			}else */if (item.user&&orgType==1){
 				var date=new Date();
 				var currentYear = date.getFullYear()
 				var currentMonth = date.getMonth() + 1
@@ -155,6 +155,8 @@ export default {
 			} else {
 				this.checkbox(item, index)
 			}
+			
+			this.handles(item);
 		},
 		// 获取路径
 		getPath() {

+ 3 - 3
components/xiaolu-tree/tree.vue

@@ -21,11 +21,11 @@
 		<view>
 			<view class="container-list">
 				<view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]" v-for="(item, index) in tree"  :key="index">
-					<label class="content">
+					<label class="content" @click="handleClick(item,index)">
 					
 						<image  :src="getImg(item)" class="imgs"></image>
-						<view class="lable-text" @click="handles(item)">{{item[props.label]}}</view>
-						<view class="right" @click="handleClick(item,index)"><i v-if="item.children.length>0" class="iconfont icon-z043 iconclass" ></i></view>
+						<view class="lable-text">{{item[props.label]}}</view>
+						<view class="right" ><i v-if="item.children.length>0" class="iconfont icon-z043 iconclass" ></i></view>
 					</label>
 				</view>
 				

+ 4 - 0
pages.json

@@ -5,6 +5,10 @@
 			"path": "pages/index/index",
 			"style": {}
 		},
+		{
+			"path": "pages/component/form",
+			"style": {}
+		},
 		{
 			"path": "pages/basics/layout",
 			"style": {}

+ 6 - 3
pages/common/exit.vue

@@ -36,14 +36,17 @@
 			api.logout().then(res=>{
 				uni.clearStorageSync() 
 				 store.commit('SET_TOKEN',"");
+				 store.commit('SET_USERID',"");
 			})
 		},
 		methods: {
 			goback(){
 				/* window.location.reload() */
-				 uni.navigateTo({
-					url:'/pages/login/login'
-				}) 
+				//  uni.navigateTo({
+				// 	url:'/pages/login/login'
+				// }) 
+				window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=hr3.gksports.net.cn:8082&response_type=code&scope=snsapi_userinfo&agentid=1000018&state=STATE#wechat_redirect";
+			//window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=zdd.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000003&state=STATE#wechat_redirect";
 			}
 		}
 	}

+ 25 - 19
pages/home/home.vue

@@ -6,7 +6,7 @@
 			<div class="panlens" v-if='isshow==false'>
 				<br>
 				<div style="margin-left: 20px;">
-				<span style="font-size: 20px;color: #FFFFFF">亲爱的&nbsp&nbsp&nbsp{{this.$store.getters.realname}}</span>
+				<span style="font-size: 20px;color: #FFFFFF">亲爱的&nbsp&nbsp&nbsp{{realname}}</span>
 				<br>
 				<br>
 				<span style="color: #FFFFFF;">今天是您在格克走过的第{{day}}天</span>
@@ -15,7 +15,7 @@
 			<div class="panlenes" v-if='isshow==true'>
 				<br>
 				<div style="margin-left: 20px;">
-				<span style="font-size: 20px;color: #FFFFFF;">亲爱的&nbsp&nbsp&nbsp{{this.$store.getters.realname}}</span>
+				<span style="font-size: 20px;color: #FFFFFF;">亲爱的&nbsp&nbsp&nbsp{{realname}}</span>
 				<br>
 				<br>
 				<span style="color: #FFFFFF;">今天是您的生日,格克感谢您的付出</span>
@@ -31,7 +31,7 @@
 				</view>
 			</view>
 			
-			<view class=" bg-white grid col-3 padding-sm">
+			<view class=" bg-white grid col-2 padding-sm">
 				<view class="padding-sm animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.1 + 's'}]" v-for="(item,index) in usList" :key="index" @tap="goPage(item.component)">
 					<view class="padding radius text-center shadow-blur solid-right ">
 						<!-- <image :src="item.icon"  mode="aspectFill" class="line2-icon"></image> -->
@@ -87,6 +87,7 @@
 				websock:'',
 				heartCheck:null,
 				lockReconnect:false,
+				realname:"",
 				msgCount:0,
 				day:'',
 				dot:{
@@ -97,29 +98,34 @@
 			}
 		},
 		created(){
-			this.days();
 			this.queryPerssion();
 		},
 		methods: {
 			queryPerssion(){
 				this.$http.get(this.url,{params:{userid:this.$store.getters.userid}}).then(res=>{
-					
-					this.usList=res.data;
+					this.usList=res.data.result.men;
+					this.realname=res.data.result.user.realname;
+					if(res.data.result.user.entryDate!=null){
+						var da=res.data.result.user.entryDate;
+						   let day = (new Date().getTime()) - (new Date(da).getTime())//日期转时间戳
+						   let dayCount=1;
+						   let count= Math.floor(day / 86400000) ;//时间戳获取天数
+						   if(count!=0&&count!=null&&count!=""){
+							   dayCount=count+1;
+						   }
+							this.day=dayCount;
+							if(res.data.result.user.birthday!=null){
+							var dt=res.data.result.user.birthday;
+							var ddt=new Date(dt);
+							var ddr=new Date();
+							if(ddt.getMonth()==ddr.getMonth()&&ddt.getDay()==ddr.getDay()){
+								this.isshow=true;
+						}			
+					}
+					}
 				})
 			},
-			days(){
-				var da=this.$store.getters.rzdate;
-				var dt=this.$store.getters.birthdate;
-				   let day = (new Date().getTime()) - (new Date(da).getTime())//日期转时间戳
-				   console.log(day)
-				   let dayCount = Math.floor(day / 86400000) ;//时间戳获取天数
-					this.day=dayCount;
-					var ddt=new Date(dt);
-					var ddr=new Date();
-					if(ddt.getMonth()==ddr.getMonth()&&ddt.getDay()==ddr.getDay()){
-						this.isshow=true;
-					}				
-			},
+			
 			initMenu(){
 				console.log("-----------home------------")
 			    this.initWebSocket();

+ 64 - 15
pages/login/login.vue

@@ -1,9 +1,9 @@
 <template>
- 	<div style="background-color: #F6F6F6;">
+ 	<div>
  		<view class="zai-box">
  			<scroll-view scroll-y class="page">
- 				<view style="text-align: center;">
- 					<image src="/static/icon/gklog.jpeg" mode='aspectFit' class="zai-logo"></image>
+				<view style="text-align: center;">
+ 					<image src="/static/gk.png" mode='aspectFit' class="zai-logo"></image>
  				</view>
  				<view class="zai-title"></view>
  				<view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]">
@@ -31,23 +31,35 @@
  							</ul>
  						</checkbox-group>
 
- 					</view>
- 					<view class="padding  flex  flex-direction">
+ 					</view> 
+ 					 <view class="padding  flex  flex-direction">
  						<button class="cu-btn bg-green shadow-blur round lg" :loading="loading" @tap="onLogin">
  							{{loading ? "登录中...":"登 录"}}
  						</button>
- 					</view>
+ 					</view> 
+					
+					</view>
+					<!-- <view class="padding  flex  flex-direction" >
+						<button class="cu-btn bg-green shadow-blur round lg" :loading="loadings"  @click="sq()">
+							{{loadings ? "授权中...":"企业微信授权登录"}}
+						</button>
+					</view> -->
 
- 				</view>
+ 				
 
  			</scroll-view>
 
  			<!-- 登录加载弹窗 -->
- 			<view class="cu-load load-modal" v-if="loading">
+ 		<!-- 	<view class="cu-load load-modal" v-if="loading">
  				<image src="/static/login3.png" mode="aspectFit" style="top: 35px;"></image>
  				<view class="gray-text" style="margin-top: 35px;">登录中...</view>
 
- 			</view>
+ 			</view> -->
+			
+			<view class="cu-load load-modal" v-if="loadings">
+				<image src="/static/weixin.png" mode="aspectFit" style="top: 35px;"></image>
+				<view class="gray-text" style="margin-top: 35px;">授权中...</view>
+			</view>
 
 
 
@@ -68,6 +80,7 @@
  	import myImageUpload from "@/components/my-componets/my-image-upload.vue"
  	import mypage from "@/components/my-componets/my-page.vue"
  	import myselect from "@/components/my-componets/my-select.vue"
+	import store from "../../store/index.js"
  	export default {
  		components: {
  			'my-image-upload': myImageUpload,
@@ -76,6 +89,7 @@
  		data() {
  			return {
  				loading: false,
+				loadings:false,
 				exitloading:false,
  				userName: '',
  				value: 1,
@@ -89,6 +103,7 @@
  				toggleDelay: false,
  				version: '',
 				timeoutid:null,
+				code:null,
  				checkbox: [{
  					value: '1',
  					checked: 'false'
@@ -96,6 +111,19 @@
  			};
  		},
  		onLoad: function() {
+			var userid=window.localStorage.getItem('userid');
+			if(userid!=null&&userid!=""){
+				this.$Router.replaceAll({
+					name: 'index'
+				})
+			}else{
+			var urls = location.search; 
+			console.log(urls)
+			var ts=urls.split("?");
+			var tts=ts[1].split("&");
+			var sct=tts[0].split("=")
+			this.code=sct[1];
+			}
  			// #ifdef APP-PLUS
  			var that = this
  			plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
@@ -103,7 +131,6 @@
  			});
  			// #endif
 
- 			this.getCookie();
 			this.loadingLogin();
 			uni.getSystemInfo({
 			    success: function (res) {
@@ -119,6 +146,32 @@
 			
  		},
  		methods: {
+			sq(){
+				this.loadings = true;
+				let loginParams = {
+					username: this.code
+				}
+				this.mLogin(loginParams).then((res) => {
+					console.log("mLogin", res)
+					if (res.data.success) {
+						this.$tip.success('授权成功!')
+						this.$Router.replaceAll({
+							name: 'index'
+						})
+					} else {
+						this.$tip.alert(res.data.message);
+					}
+				}).catch((err) => {
+					let msg = err.data.message || "请求出现错误,请稍后再试"
+					this.$tip.alert(msg);
+				}).finally(() => {
+					this.loadings=false;
+				})
+				// this.$http.get("/sys/mLogins",{params:{code:'8PuVO3XoXEF7KN0WYEeAfhETf2jRg2J76Bg606H_8x4'}}).then(res=>{
+				// }).catch(err => {
+				// 	console.log(err);
+				// }); 
+			},
 			loadingLogin(){
 				if(this.checkbox[1].checked=='true'){
 					this.onLogin();
@@ -135,11 +188,8 @@
  							this.userName = arr2[1]; //保存到保存数据的地方
  						} else if (arr2[0] == 'userPwd') {
  							this.password = arr2[1];
- 						} else if (arr2[0] == 'pwdchecked') {
- 							this.checkbox[0].checked = arr2[1];
- 						}
+ 						} 
  					}
-					console.log(this.checkbox)
  				}
  			},
  			//清除cookie
@@ -151,7 +201,6 @@
  				window.document.cookie = "userName" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
  				window.document.cookie = "userPwd" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
  				window.document.cookie = "pwdchecked" + "=" + pwdche + ";path=/;expires=" + exdate.toGMTString();
-				
  			},
  			checkboxChange: function(e) {
  				var items = this.checkbox,

+ 2 - 4
pages/sign/empsign.vue

@@ -73,13 +73,11 @@
 				initData: function(cur) {
 					// var leftcount = 0 // 存放剩余数量
 					var date
-					if (cur) {
+					if (cur!=null&&cur!="") {
 						date = new Date(cur)
 					} else {
 						var now = new Date()
-						var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
-						d.setDate(35)
-						date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
+						date = now;
 					}
 					
 					this.currentYear = date.getFullYear()

+ 12 - 7
pages/sign/leaves.vue

@@ -11,9 +11,12 @@
 				{{datetime}}年度
 			</div>
 			<div style="text-align: center;margin-top: 10px;">
-				<span style="color: #93B5E9;">年假总天数:</span><span style="margin-left:10px ;font-size: 18px;color: #FFFFFF;">{{yearDay}}天</span>
-				<span style="margin-left:10px;border-left: 2px solid #ccc;"></span>
-				<span style="margin-left:10px ;color: #93B5E9;">当前可用年假:</span><span style="margin-left:10px ;font-size: 18px;color: #FFFFFF;">{{availableDay}}天</span>
+				<span style="font-size: 13px;color: #FFFFFF;">年假总天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{yearDay}}天</span>
+				<span style="margin-left:10px;border-left: 2px solid #ccc;font-size: 13px;"></span>
+				<span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">剩余年假天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{availableDay}}天</span>
+				<span style="margin-left:10px;border-left: 2px solid #ccc;font-size: 13px;"></span>
+				<span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">剩余可调休:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{txcount}}小时</span>
+				
 			</div>
 		</div>
 		<div style="background-color: #FFFFFF;">
@@ -27,8 +30,8 @@
 				<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
 				
 			<view class="cu-list  menu  radius" >
-			  <view class="cu-item " v-for="s in data">
-			    <navigator class="content"  hover-class="none">
+			  <view class="cu-item " v-for="s in data" v-if="s.holidayType=='年假'">
+			    <navigator class="content"  hover-class="none" >
 					<text>年假 ({{s.holidayCount/24}}天)</text>
 			     <div>
 					  <div style="color: #9C9FAA;">
@@ -63,6 +66,7 @@
 				userUrl:'/sys/weixin/myVacation',
 				datetime:null,
 				yearDay:null,
+				txcount:null,
 				availableDay:null,
 				data:[],
 				}
@@ -78,8 +82,9 @@
 				
 				this.$http.get(this.userUrl,{params:{userid:id}}).then(res=>{
 					console.log(res);
-					this.yearDay=res.data.vacations.nVacRete;
-					this.availableDay=res.data.vacations.nTotal;
+					this.yearDay=res.data.yearCount;
+					this.availableDay=res.data.syYearCount;
+					this.txcount=res.data.txCount;
 					if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
 						this.data=res.data.vacationsBody;
 					}

+ 59 - 28
pages/sign/usersign.vue

@@ -42,17 +42,23 @@
 						<!-- <span v-for='(s,i) in rows' v-if='s=='></span> -->
 						<span v-if='dayobject.day.getFullYear() == new Date().getFullYear() && dayobject.day.getMonth() == new Date().getMonth() && dayobject.day.getDate() == new Date().getDate()'
 						 class='active' @click="getDayTime(dayobject.day)">今
+						 
 						</span>
 						<span v-else @click="getDayTime(dayobject.day)">
 						<span class="act"  >{{ dayobject.day.getDate() }}</span>
-						<div style="margin-top: -10px;" v-if='SetDays!=[] &&SetDays.length>0 &&SetDays!=undefined ' v-for='(dayobj,i) in SetDays'>
-							<strong  v-if='dayobj.iss == dayobject.day.getDate() && dayobj.is=="2" &&dayobject.day<=ToDay'  style="color: #4E6FE2;font-size: 20px;">.</strong>
-							<strong v-if='dayobj.iss == dayobject.day.getDate() && dayobj.is=="1" &&dayobject.day<=ToDay'  style="color: red;font-size: 20px;">.</strong>
-							
+						<div  v-if='SetDays!=[] &&SetDays.length>0 &&SetDays!=undefined ' v-for='(dayobj,i) in SetDays'>
+							<span v-if='dayobj.iss == dayobject.day.getDate()'>
+								<span style="color: #e1e1e1;">
+								{{dayobj.notes}}
+								</span>
+								<div style="margin-top: -15px;" v-if='dayobj.is=="2" &&dayobject.day<=ToDay'>
+								<strong style="color: #4E6FE2;font-size: 20px;">.</strong>
+								</div>
+								<div style="margin-top: -15px;" v-if='dayobj.is=="1" &&dayobject.day<=ToDay'>
+								<strong style="color: red;font-size: 20px;">.</strong>
+								</div>
+							</span>
 						</div>
-						<!-- <div style="margin-top: -10px;" v-if='SetDays==[] ||SetDays.length<1'>
-							<strong   style="color: red;font-size: 20px;">.</strong>
-						</div> -->
 						</span>
 					</span>
 				</li>
@@ -82,9 +88,10 @@
 			<span style="color: #9599A5;font-size: 15px;">
 				打卡记录: <span v-if='SetData.length<1'>无</span> 
 				<ul class="steps">
-				    <li v-for="(item,index) in SetData" :key="item+index" :class="{'active':Steps===index}" >
+				    <li v-for="(item,index) in SetData" :key="item+index" :class="{'active':'Steps'===index}" >
 						{{item.userDate}} <span style="margin-left: 20px;">{{item.checkinType}}</span>
 						<span style="margin-left: 20px;">{{item.exceptionType}}</span>
+						<span style="margin-left: 20px;" v-if="item.exceptionType=='时间异常'">标准时间 {{item.holidayType}}</span>
 					</li> 
 					
 					 </ul>
@@ -94,16 +101,21 @@
 				<span style="height: 2px;width: 100%;background-color: #B4C3E0;"></span>
 				<br>
 				<span style="color: #9599A5;font-size: 15px;">
-					请假/外出记录:<span v-if='Setdds==""&&Setdds==null'>无</span>
+					请假/外出记录:<span v-if='Setdds==null&&work==null'>无</span>
 					<br>
 					<br>
-					
-					<span v-if='Setdds!=""&&Setdds!=null'>
-						{{Setdds.holidayType}}&nbsp;&nbsp;({{Setdds.holidayCount}}小时)&nbsp;&nbsp;开始时间&nbsp;{{Setdds.startDates}}&nbsp;至&nbsp;{{Setdds.endDates}}
+					<view v-for="(item,index) in Setdds">
+					<span>
+						{{item.holidayType}}&nbsp;&nbsp;({{item.holidayCount}}小时)&nbsp;&nbsp;开始时间&nbsp;{{item.startDates}}&nbsp;至&nbsp;{{item.endDates}}
 					</span>
-					<span v-if='work!=""&&work!=null'>
-						加班&nbsp;&nbsp;({{work.duration}}小时)&nbsp;&nbsp;开始时间&nbsp;{{work.begin_date}}&nbsp;至&nbsp;{{work.end_date}}
+					<br>
+					</view>
+					<view v-for="(items,index) in work">
+					<span>
+						加班&nbsp;&nbsp;({{items.duration}}小时)&nbsp;&nbsp;开始时间&nbsp;{{items.begin_date}}&nbsp;至&nbsp;{{items.end_date}}
 					</span>
+					<br>
+					</view>
 				</span>
 				
 			</div>
@@ -158,9 +170,9 @@
 					date = new Date(cur)
 				} else {
 					var now = new Date()
-					var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
-					d.setDate(35)
-					date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
+					//var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
+					now.setDate(35)
+					date = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
 				}
 				this.currentDay = date.getDate()
 				this.currentYear = date.getFullYear()
@@ -177,7 +189,12 @@
 				this.days.length = 0
 				// 今天是周日,放在第一行第7个位置,前面6个
 				// 初始化本周
+				var curretMonths = new Date(this.currentYear, this.currentMonth, 0);
+				 var curretMonthDayCount = curretMonths.getDate();
+				 console.log(curretMonthDayCount)
+				if(this.currentWeek!=7){
 				for (var i = this.currentWeek; i >= 0; i--) {
+					console.log(str)
 					var d2 = new Date(str)
 					d2.setDate(d2.getDate() - i)
 					var dayobjectSelf = {} // 用一个对象包装Date对象  以便为以后预定功能添加属性
@@ -185,22 +202,31 @@
 					this.days.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
 				}
 				// 其他周
-				for (var j = 1; j <= 37 - this.currentWeek; j++) {
+				for (var j = 1; j <= curretMonthDayCount-1; j++) {
 					var d3 = new Date(str)
 					d3.setDate(d3.getDate() + j)
 					var dayobjectOther = {}
 					dayobjectOther.day = d3
 					this.days.push(dayobjectOther)
 				}
-				var s=this.days
-				console.log(s)
+				}else{
+					for (var j = 0; j <= curretMonthDayCount-1; j++) {
+						var d3 = new Date(str)
+						d3.setDate(d3.getDate() + j)
+						var dayobjectOther = {}
+						dayobjectOther.day = d3
+						this.days.push(dayobjectOther)
+					}
+				}
+				
+				
+				console.log(this.days)
 			},
 			getDayTime(el) {
 			
 			var date=new Date()
 			var date2 =new Date(el)
 			if(date2<=date){
-				
 				this.querys(el);
 			}
 				
@@ -217,25 +243,30 @@
 				this.SetMdays=this.formatt(date);
 				var ts=this.state;
 				if(this.state==2||this.state=="2"){
-					//userid=this.$store.getters.id;
 					userid=uni.getStorageSync('id');
 				}
 				
-				console.log(this.state)
 				this.$http.get(this.userUrl,{params:{userid:userid,date:date}}).then(res=>{
 					
 					this.SetData=res.data.date;
 					if(res.data.day.length>0&&res.data.day!=[]&&res.data.day!=undefined){
 						this.SetDays=res.data.day;
 					}
-					if(res.data.data!=null){
+					
+					
+					if(res.data.data!=null&&res.data.data.length>0){
 					this.Setdds=res.data.data;	
-					}if(res.data.data==null){
-						this.Setdds="";
+					}else{
+						this.Setdds=null;
 					}
 					
 					this.count=res.data.count;
-					this.work=res.data.work;
+					if(res.data.work!=null&&res.data.work.length>0){
+						this.work=res.data.work;
+					}else{
+						this.work=null;
+					}
+					
 					console.log(res)
 				}).catch(err => {
 					console.log(err);
@@ -310,7 +341,7 @@
 <style>
 	.steps {
 	  counter-reset: step; /*创建步骤数字计数器*/
-	    width: 360px;
+	    width: 460px;
 	    margin: 0 auto;
 		margin-left: -30px;
 		margin-top: 10px;

+ 251 - 227
pages/sign/userwork.vue

@@ -1,10 +1,10 @@
 <template>
-	<div >
+	<div>
 		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
 			<block slot="backText">返回</block>
 			<block slot="content">排班信息</block>
 		</cu-custom>
-	
+
 		<div>
 			<div class='month'>
 				<ul style="list-style-type:none;">
@@ -18,21 +18,23 @@
 				<br>
 			</div>
 		</div>
-		
-		
+
+
 		<view>
 			<view class="container-list">
-				<view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]" v-for='(item,index) in data'  :key="index">
+				<view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]"
+					v-for='(item,index) in data' :key="index">
 					<label class="content">
 						<view class="lable-text " style="font-size: 15px;margin-left: 10px;">{{item.name}}</view>
-						<view class="lable-text" style="font-size: 15px;">{{item.startDate}}</view>-
+						<view class="lable-text" style="font-size: 15px;margin-left: -20px;">{{item.startDate}}</view>
+						<view style="font-size: 15px;">-</view>
 						<view class="lable-text" style="font-size: 15px;">{{item.endDate}}</view>
-			<view class="lable-text">
-			<span style="font-size: 15px;">{{item.shiftDate}}</span>
-			</view>
+						<view class="lable-text">
+							<span style="font-size: 15px;">{{item.shiftDate}}</span>
+						</view>
 					</label>
 				</view>
-				
+
 			</view>
 		</view>
 	</div>
@@ -43,104 +45,106 @@
 	export default {
 		data() {
 			return {
-				currentMonth: new Date().getMonth()+1,
+				currentMonth: new Date().getMonth() + 1,
 				currentYear: new Date().getFullYear(),
-				data:[],
-				userUrl:'/shift/shift/listShift'
+				data: [],
+				userUrl: '/shift/shift/listShift'
 			}
+		},
+
+		created() {
+			this.initData(null)
+			this.querys(this.name)
+		},
+		methods: {
+			initData: function(cur) {
+				// var leftcount = 0 // 存放剩余数量
+				var date
+				if (cur) {
+					date = new Date(cur)
+				} else {
+					var now = new Date()
+					
+					date = now;
+				}
+
+				this.currentYear = date.getFullYear()
+				this.currentMonth = date.getMonth() + 1
+
+				var str = this.formatDate(
+					this.currentYear,
+					this.currentMonth,
+
+				)
+
 			},
-			
-			created(){
-				this.initData(null)
-				this.querys(this.name)
+			pickPre: function(year, month) {
+				var d = new Date(this.formatDate(year, month, 1))
+				d.setDate(0)
+				this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
+				this.querys();
 			},
-			methods:{
-				initData: function(cur) {
-					// var leftcount = 0 // 存放剩余数量
-					var date
-					if (cur) {
-						date = new Date(cur)
-					} else {
-						var now = new Date()
-						var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
-						d.setDate(35)
-						date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
-					}
-					
-					this.currentYear = date.getFullYear()
-					this.currentMonth = date.getMonth() + 1
-					
-					var str = this.formatDate(
-						this.currentYear,
-						this.currentMonth,
-						
-					)
-					
-				},
-				pickPre: function(year, month) {
-					var d = new Date(this.formatDate(year, month, 1))
-					d.setDate(0)
-					this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
-					this.querys();
-				},
-				
-				pickNext: function(year, month) {
-					var d = new Date(this.formatDate(year, month, 1))
-					var ds=this.formatDate(year, month, null);
-					var nowDate = new Date();
-					var dt=this.formatDate(nowDate.getFullYear(),nowDate.getMonth(),null);
-					
-					
-					d.setDate(35)
-					
-					this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
-					this.querys();
-					
-				},
-				
-				// 返回 类似 2016-01-02 格式的字符串
-				formatDate: function(year, month, day) {
-					var y = year
-					if(month>12){
-						month=1;
-						y=year+1;
-					}
-					var m = month
-					if (m < 10) m = '0' + m
-					var d = day
-					if(day!=null &&day !=""){
-						if (d < 10) d = '0' + d
-						return y + '-' + m + '-' + d
-					}else{
-						return y + '-' + m 
-					}
-					
-					
-				},
-				
-				querys(){
-					this.data=[];
-					var deptid=uni.getStorageSync('id');
-					var userid=this.$store.getters.userid;
-					if(deptid!=null&&deptid!=""){
-						userid=deptid;
+
+			pickNext: function(year, month) {
+				var d = new Date(this.formatDate(year, month, 1))
+				var ds = this.formatDate(year, month, null);
+				var nowDate = new Date();
+				var dt = this.formatDate(nowDate.getFullYear(), nowDate.getMonth(), null);
+
+
+				d.setDate(35)
+
+				this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
+				this.querys();
+
+			},
+
+			// 返回 类似 2016-01-02 格式的字符串
+			formatDate: function(year, month, day) {
+				var y = year
+				if (month > 12) {
+					month = 1;
+					y = year + 1;
+				}
+				var m = month
+				if (m < 10) m = '0' + m
+				var d = day
+				if (day != null && day != "") {
+					if (d < 10) d = '0' + d
+					return y + '-' + m + '-' + d
+				} else {
+					return y + '-' + m
+				}
+
+
+			},
+
+			querys() {
+				this.data = [];
+				var deptid = uni.getStorageSync('id');
+				var userid = this.$store.getters.userid;
+				if (deptid != null && deptid != "") {
+					userid = deptid;
+				}
+				var date = this.formatDate(this.currentYear, this.currentMonth, 1);
+				this.$http.get(this.userUrl, {
+					params: {
+						userid: userid,
+						date: date
 					}
-					var date=this.formatDate(this.currentYear,this.currentMonth,1);
-						this.$http.get(this.userUrl,{params:{userid:userid,date:date}}).then(res=>{
-							this.data=res.data;
-							
-						}).catch(err => {
-							console.log(err);
-						}); 
-				},
-				
-				
-				
-			}
-			
+				}).then(res => {
+					this.data = res.data;
+
+				}).catch(err => {
+					console.log(err);
+				});
+			},
+
+
+
+		}
+
 	}
-	
-	
 </script>
 
 <style lang="scss" scoped>
@@ -151,75 +155,79 @@
 		justify-content: space-between;
 		height: 35px;
 	}
-	
+
 	.year-month {
 		display: flex;
 		align-items: center;
 		justify-content: space-around;
 		margin-top: 10px;
 	}
-	
+
 	.choose-month {
 		text-align: center;
 		font-size: 12px;
 	}
-	
+
 	.arrow {
 		padding: 15px;
 		color: #999999;
 	}
-	
+
 	.month ul li {
 		font-size: 12px;
 		text-transform: uppercase;
 		letter-spacing: 3px;
 	}
-	
+
 	#calendar {
 		font-size: 12px;
 		width: 100%;
 		margin: 0 auto;
 		box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.1),
 			0 1px 5px 0 rgba(0, 0, 0, 0.12);
-			
+
 	}
-	
+
 	.month {
 		width: 100%;
 		color: #333333;
 		background: #ffffff;
 	}
-	
-	
-	.imgs{
+
+
+	.imgs {
 		width: 40px;
 		height: 40px;
-		border-radius:5px 5px 5px 5px; 
+		border-radius: 5px 5px 5px 5px;
 		margin-left: 1%;
 	}
-	
+
 	.filterBox {
 		padding: 15rpx 32rpx;
 		background-color: #fff;
+
 		.filter-input {
 			height: 80rpx;
 			background-color: #eeeff0;
 			border-radius: 40rpx;
 			display: flex;
 			align-items: center;
-			
+
 			padding-left: 40rpx;
+
 			.filterImg {
 				width: 32rpx;
 				height: 32rpx;
 				margin-right: 20rpx;
 				margin-bottom: 5rpx;
 			}
+
 			.filterImgs {
 				width: 32rpx;
 				height: 32rpx;
-				
+
 			}
+
 			.text {
 				width: 84%;
 				background-color: #eeeff0;
@@ -228,127 +236,143 @@
 			}
 		}
 	}
-	
+
 	.flex_between_center {
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-		}
-	
-		.checkbox {
-			position: relative;
-			margin-left: 10rpx;
-			margin-right: 0px;
-			.color {
-				color: #00aaff;
-				background-color: #00aaff;
-			}
-			.txt {
-				font-size: 44rpx;
-				width: 100%;
-				height: 100%;
-				display: flex;
-			}
-		}
-		.checkBorder {
-			border: 1px solid #ecdee4;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.checkbox {
+		position: relative;
+		margin-left: 10rpx;
+		margin-right: 0px;
+
+		.color {
+			color: #00aaff;
+			background-color: #00aaff;
 		}
-		.header {
+
+		.txt {
+			font-size: 44rpx;
 			width: 100%;
-			position: fixed;
-			background-color: #fff;
-			z-index: 9999;
-			.title {
-				height: 90rpx;
-				padding: 0 32rpx;
-				line-height: 90rpx;
-				font-size: 30rpx;
-				background-color: #f5f5f5;
-				color: #606064;
-			}
+			height: 100%;
+			display: flex;
 		}
-		.iconclass {
-			display: inline-block;
-			margin: 0 12rpx;
-			color: #D0D4DB;
-			font-size: 28rpx;
+	}
+
+	.checkBorder {
+		border: 1px solid #ecdee4;
+	}
+
+	.header {
+		width: 100%;
+		position: fixed;
+		background-color: #fff;
+		z-index: 9999;
+
+		.title {
+			height: 90rpx;
+			padding: 0 32rpx;
+			line-height: 90rpx;
+			font-size: 30rpx;
+			background-color: #f5f5f5;
+			color: #606064;
 		}
-		.container-list {
-			overflow-y: scroll;
-			overflow-x: hidden;
-			padding-bottom: 160rpx;
-			padding-top: 15rpx;
-			.common {
-				background-color: #fff;
-				border-bottom: 1rpx solid #f4f4f4;
-				padding-left: 10rpx;
-				.content {
-					display: flex;
-					align-items: center;
-					height: 70rpx;
-					width: 100%;
-					padding: 15rpx 0;
-					position: relative;
+	}
+
+	.iconclass {
+		display: inline-block;
+		margin: 0 12rpx;
+		color: #D0D4DB;
+		font-size: 28rpx;
+	}
+
+	.container-list {
+		overflow-y: scroll;
+		overflow-x: hidden;
+		padding-bottom: 160rpx;
+		padding-top: 15rpx;
+
+		.common {
+			background-color: #fff;
+			border-bottom: 1rpx solid #f4f4f4;
+			padding-left: 10rpx;
+
+			.content {
+				display: flex;
+				align-items: center;
+				height: 70rpx;
+				width: 100%;
+				padding: 15rpx 0;
+				position: relative;
+				font-size: 32rpx;
+
+				.lable-text {
+					margin-left: 5%;
+					font-size: 30rpx;
+					color: #5b5757;
+					width: 500rpx;
+					word-break: break-all;
+				}
+
+				.right {
+					position: absolute;
+					right: 30rpx;
+					color: #babdc3;
 					font-size: 32rpx;
-					.lable-text{
-						margin-left: 5%;
-						font-size: 30rpx;
-						color: #5b5757;
-						width: 500rpx;
-						word-break: break-all;
-					}
-					.right {
-						position: absolute;
-						right: 30rpx;
-						color: #babdc3;
-						font-size: 32rpx;
-					}
 				}
 			}
 		}
-		.active {
-			color: #4297ED !important;
-		}
-		.none {
-			color: #666666;
-		}
-		.icon-selected{
-			color: #0095F2!important;
-			font-size: 40rpx!important;
-		}
-		.icons{
-			color: #0095F2!important;
-			font-size: 40rpx!important;
-		}
-		.inline-item {
-			display: inline-block
-		}
-		
-		.content-item{
-			display: flex;
-			position: relative;
-			align-items: center;
-		}
-		
-		.box_sizing {
-			-webkit-box-sizing: border-box;
-			-moz-box-sizing: border-box;
-			box-sizing: border-box;
-		}
-		
-		.btn {
-			position: fixed;
-			bottom: 0;
-			padding: 10px;
-			background-color: #fff;
-			width: 100%;
-		
-			.sureBtn {
-				background-color: #0095F2;
-				color: #fff;
-			}
+	}
+
+	.active {
+		color: #4297ED !important;
+	}
+
+	.none {
+		color: #666666;
+	}
+
+	.icon-selected {
+		color: #0095F2 !important;
+		font-size: 40rpx !important;
+	}
+
+	.icons {
+		color: #0095F2 !important;
+		font-size: 40rpx !important;
+	}
+
+	.inline-item {
+		display: inline-block
+	}
+
+	.content-item {
+		display: flex;
+		position: relative;
+		align-items: center;
+	}
+
+	.box_sizing {
+		-webkit-box-sizing: border-box;
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+	}
+
+	.btn {
+		position: fixed;
+		bottom: 0;
+		padding: 10px;
+		background-color: #fff;
+		width: 100%;
+
+		.sureBtn {
+			background-color: #0095F2;
+			color: #fff;
 		}
+	}
+
 	// @import '@/components/xiaolu-tree/css/style.scss';
 	@import url("@/components/xiaolu-tree/css/icon.css");
-	
 </style>

+ 151 - 136
pages/user/people.vue

@@ -1,17 +1,21 @@
 <template>
 	<view>
 		<scroll-view scroll-y class="page">
-			  <!-- 头部logo-->
-		  <view class="UCenter-bg" >
-			 <div class="tx">
-		    <image  @tap="ChooseImage"  :src="personalList.avatar" round class="png animation-slide-right margin-bottom-sm" mode="widthFix" :style="[{animationDelay: '0.1s'}]"></image>
-			<!-- <text class='cuIcon-cameraadd'style="position: absolute;margin-top: 70px;margin-left: -10px;"></text> -->
-			<image src="../../static/vip.png" style="position: absolute;margin-top: 75px;margin-left: -30px;width: 20px;height: 20px;"></image>
-			</div>
-		    <image src="/static/wave.gif" mode="scaleToFill" class="gif-wave"></image>
-		  </view>
-		   <!-- 个人信息卡片-->
-		  <!-- <view class="cu-list menu-avatar">
+			<!-- 头部logo-->
+			<view class="UCenter-bg">
+				<div class="tx">
+					<image @tap="ChooseImage" :src="personalList.avatar" round
+						class="png animation-slide-right margin-bottom-sm" mode="widthFix"
+						:style="[{animationDelay: '0.1s'}]"></image>
+					<!-- <text class='cuIcon-cameraadd'style="position: absolute;margin-top: 70px;margin-left: -10px;"></text> -->
+					<image src="../../static/vip.png"
+						style="position: absolute;margin-top: 75px;margin-left: -30px;width: 20px;height: 20px;">
+					</image>
+				</div>
+				<image src="/static/wave.gif" mode="scaleToFill" class="gif-wave"></image>
+			</view>
+			<!-- 个人信息卡片-->
+			<!-- <view class="cu-list menu-avatar">
 		   	<view class="cu-item">
 		   		<view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg);"></view>
 		   		<view class="content flex-sub">
@@ -22,48 +26,49 @@
 		   		</view>
 		   	</view>
 		   </view> -->
-		  <view class="padding flex text-center text-grey bg-white shadow-warp">
-		    <view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
-		      <view class="text-xl text-orange">{{personalList.username}}</view>
-			  <view class="margin-top-sm"><text class="cuIcon-people"></text> 用户</view>
-		    </view>
-		    
-		    <view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
-		      <view class="text-xl text-green">{{personalList.post?personalList.post:'员工'}}</view>
-		      <view class="margin-top-sm"><text class="cuIcon-news"></text> 职务</view>
-		    </view>
-		  </view>
-		  <!-- 列表list-->
-		  <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
-		    <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
-		      <navigator class="content" url="/pages/user/userdetail" hover-class="none">
-		        <text class="cuIcon-expressman text-cyan"></text>
-		        <text class="text-grey">个人信息</text>
-		     </navigator>
-		    </view>
-		    <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
+			<view class="padding flex text-center text-grey bg-white shadow-warp">
+				<view class="flex flex-sub flex-direction solid-right animation-slide-top"
+					:style="[{animationDelay: '0.2s'}]">
+					<view class="text-xl text-orange">{{personalList.realname}}</view>
+			  <view class="margin-top-sm"><text class="cuIcon-people"></text>姓名</view>
+				</view>
+
+				<view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
+					<view class="text-xl text-green">{{personalList.post?personalList.post:'员工'}}</view>
+					<view class="margin-top-sm"><text class="cuIcon-news"></text> 职位</view>
+				</view>
+			</view>
+			<!-- 列表list-->
+			<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
+				<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
+					<navigator class="content" url="/pages/user/userdetail" hover-class="none">
+						<text class="cuIcon-expressman text-cyan"></text>
+						<text class="text-grey">个人信息</text>
+					</navigator>
+				</view>
+				<!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
 		      <navigator class="content" url="/pages/user/userpwd" hover-class="none">
 		        <text class="cuIcon-edit text-cyan"></text>
 		        <text class="text-grey">修改密码</text>
 		      </navigator>
-		    </view>
-		   <!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
+		    </view> -->
+				<!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
 				<navigator class="content"  hover-class="none" @click="dt()">
 				    <text class="cuIcon-forward text-cyan"></text>
 					<text class="text-grey">位置</text>
 				</navigator>
 		    </view> -->
-			<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]">
+				<!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]">
 				<navigator class="content" url="/pages/user/userexit" hover-class="none">
 				    <text class="cuIcon-exit text-cyan"></text>
 					<text class="text-grey">退出</text>
 				</navigator>
+			</view> -->
 			</view>
-			</view>
-		  <view class="cu-tabbar-height"></view>
+			<view class="cu-tabbar-height"></view>
 		</scroll-view>
-		
-	
+
+
 	</view>
 </template>
 
@@ -73,35 +78,37 @@
 		name: "people",
 		data() {
 			return {
-				personalList:{
-				  avatar:'',
-				  realname:'',
-				  username:'',
-				  post:''
+				personalList: {
+					avatar: '',
+					realname: '',
+					username: '',
+					post: ''
 				},
-				  positionUrl:'/sys/position/list',
-				  departUrl:'/sys/user/userDepartList',
-				  userUrl:'/sys/user/queryById',
-				  userId:'',
-				  id:'',
-				 Url:'/sys/user/editUser',
-				 uploadUrl:"/sys/common/upload",
-				
+				positionUrl: '/sys/position/list',
+				departUrl: '/sys/user/userDepartList',
+				userUrl: '/sys/user/queryById',
+				userId: '',
+				id: '',
+				Url: '/sys/user/editUser',
+				uploadUrl: "/sys/common/upload",
+
 			};
 		},
-		 watch: {
+		watch: {
 			cur: {
 				immediate: true,
 				handler() {
-					console.log('watch',this.cur)
-				    this.load()
+					console.log('watch', this.cur)
+					this.load()
 				},
 			},
-		}, 
+		},
 		methods: {
-		
-			zf(){
-				this.$Router.push({name:'appzf'})
+
+			zf() {
+				this.$Router.push({
+					name: 'appzf'
+				})
 				/* this.$http.post(this.ul,{params:{}}).then(res=>{
 					console.log(res)
 					this.showModal=true;
@@ -111,7 +118,7 @@
 					console.log(err);
 				}); */
 			},
-			dt(){
+			dt() {
 				/* uni.getLocation({
 				    type: 'wgs84',
 				    success: function (res) {
@@ -119,15 +126,15 @@
 				        console.log('当前位置的纬度:' + res.latitude);
 				    }
 				}); */
-					  /* http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text= */
+				/* http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text= */
 				uni.chooseLocation({
-					success: function (res) {
+					success: function(res) {
 						console.log('位置名称:' + res.name);
 						console.log('详细地址:' + res.address);
 						console.log('纬度:' + res.latitude);
 						console.log('经度:' + res.longitude);
-						this.latitude=res.latitude;
-						this.longitude=res.longitude;
+						this.latitude = res.latitude;
+						this.longitude = res.longitude;
 					}
 				});
 			},
@@ -135,31 +142,36 @@
 				 uni.removeStorageSync('Access-Token')
 			}, */
 			ChooseImage() {
-				var that=this;
+				var that = this;
 				uni.chooseImage({
 					count: 4, //默认9
 					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['album'], //从相册选择
 					success: (res) => {
 						/* alert(res.tempFilePaths) */
-						that.$http.upload(that.$config.apiUrl+that.uploadUrl, {
+						that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
 								filePath: res.tempFilePaths[0],
 								name: 'file'
 							})
 							.then(res => {
 								console.log(res)
-								if(res.statusCode==200){
-									this.$http.get(this.Url,{params:{id:this.$store.getters.userid,avatar:res.data.message}}).then(res=>{
-										if(res.data.code==200){
+								if (res.statusCode == 200) {
+									this.$http.get(this.Url, {
+										params: {
+											id: this.$store.getters.userid,
+											avatar: res.data.message
+										}
+									}).then(res => {
+										if (res.data.code == 200) {
 											this.load();
-											 this.$tip.success('更换成功!')
+											this.$tip.success('更换成功!')
 										}
-										
+
 									}).catch(err => {
 										console.log(err);
 									});
-									
-								} 
+
+								}
 							})
 							.catch(err => {
 								that.$tip.error(err.data.message)
@@ -167,14 +179,19 @@
 					}
 				});
 			},
-			load(){
-				console.log("id"+this.$store.getters.userid)
-				this.$http.get(this.userUrl,{params:{id:this.$store.getters.userid}}).then(res=>{
-					console.log("res",res)
-					 if (res.statusCode==200) {
+			load() {
+				console.log("id" + this.$store.getters.userid)
+				this.$http.get(this.userUrl, {
+					params: {
+						id: this.$store.getters.userid
+					}
+				}).then(res => {
+					console.log("res", res)
+					if (res.statusCode == 200) {
 						let perArr = res.data.data
-				        let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
-						this.personalList.avatar =avatar
+						let avatar = (perArr.avatar && perArr.avatar.length > 0) ? api.getFileAccessHttpUrl(perArr
+							.avatar) : '/static/avatar_boy.png'
+						this.personalList.avatar = avatar
 						this.personalList.realname = perArr.realname
 						this.personalList.username = perArr.username
 						this.personalList.post = perArr.post
@@ -183,70 +200,68 @@
 				}).catch(err => {
 					console.log(err);
 				});
-				
-			}		
+
+			}
 		}
 	}
 </script>
 
 <style>
-	
-	.tx{
-		width:90px;
-		 height:90px;
-		  border-radius:50%; 
-		  overflow:hidden;
+	.tx {
+		width: 90px;
+		height: 90px;
+		border-radius: 50%;
+		overflow: hidden;
+	}
+
+	.UCenter-bg {
+		background-image: url(../../static/bj8.jpeg);
+		/* background-image: url(../../static/bj001.jpeg); */
+		/* background-image: url(https://image.weilanwl.com/color2.0/index.jpg); */
+		background-size: cover;
+		height: 400rpx;
+		display: flex;
+		justify-content: center;
+		padding-top: 40rpx;
+		overflow: hidden;
+		position: relative;
+		flex-direction: column;
+		align-items: center;
+		color: #fff;
+		font-weight: 300;
+		text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
+	}
+
+	.UCenter-bg text {
+		opacity: 0.8;
+	}
+
+	.UCenter-bg image {
+		width: 200rpx;
+		height: 200rpx;
 	}
-	
-.UCenter-bg {
-	background-image: url(../../static/bj8.jpeg);
-	/* background-image: url(../../static/bj001.jpeg); */
-  /* background-image: url(https://image.weilanwl.com/color2.0/index.jpg); */
-  background-size: cover;
-  height: 400rpx;
-  display: flex;
-  justify-content: center;
-  padding-top: 40rpx;
-  overflow: hidden;
-  position: relative;
-  flex-direction: column;
-  align-items: center;
-  color: #fff;
-  font-weight: 300;
-  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
-}
-
-.UCenter-bg text {
-  opacity: 0.8;
-}
-
-.UCenter-bg image {
-  width: 200rpx;
-  height: 200rpx;
-}
-
-.UCenter-bg .gif-wave{
-  position: absolute;
-  width: 100%;
-  bottom: 0;
-  left: 0;
-  z-index: 99;
-  mix-blend-mode: screen;  
-  height: 100rpx;   
-}
-
-map,.mapBox{
-  left: 0;
-  z-index: 99;
-  mix-blend-mode: screen;  
-  height: 100rpx;   
-}
-
-map,.mapBox{
-  width: 750rpx;
-  height: 300rpx;
-}
 
+	.UCenter-bg .gif-wave {
+		position: absolute;
+		width: 100%;
+		bottom: 0;
+		left: 0;
+		z-index: 99;
+		mix-blend-mode: screen;
+		height: 100rpx;
+	}
 
+	map,
+	.mapBox {
+		left: 0;
+		z-index: 99;
+		mix-blend-mode: screen;
+		height: 100rpx;
+	}
 
+	map,
+	.mapBox {
+		width: 750rpx;
+		height: 300rpx;
+	}
 </style>

+ 3 - 3
pages/user/userdetail.vue

@@ -4,7 +4,7 @@
 			<cu-custom bgColor="bg-gradual-pink" :isBack="true">
 				<block slot="backText">返回</block>
 				<block slot="content">用户详情</block>
-				<view slot="right"  @tap="rightClick">编辑</view>
+				<!-- <view slot="right"  @tap="rightClick">编辑</view> -->
 			</cu-custom>
 			<!-- list列表 -->
 			<view class="cu-list menu">
@@ -17,14 +17,14 @@
 					</view>
 				
 				</view>
-				<view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
+				<!-- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
 					<view class="content">
 						<text class="text-grey">账号</text>
 					</view>
 					<view class="action">
 						<text class="text-grey">{{personalMsg.username}}</text>
 					</view>
-				</view>
+				</view> -->
 				<view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
 					<view class="content">
 						<text class="text-grey">工号</text>

+ 2 - 2
pages/user/useredit.vue

@@ -48,10 +48,10 @@
 				</picker>
 			</view>
 			
-			<view class="cu-form-group margin-top">
+			<!-- <view class="cu-form-group margin-top">
 					<view class="title">用户名</view>
 					<input placeholder="用户名" name="input" v-model="myFormData.username" disabled></input>
-			</view>
+			</view> -->
 			<view class="cu-form-group">
 				<view class="title">工号</view>
 				<input placeholder="工号" name="input"  v-model="myFormData.workNo" disabled></input>

+ 1 - 1
pages/user/userpwd.vue

@@ -21,7 +21,7 @@
 					<view class="cu-form-group" >
 					    <view class="title" style="margin-top: 10px;"><image src="../../static/yzm.png" class="imgs"></image></view>
 					    <input placeholder="邮箱验证码" v-model="code" ></input>
-						<span style="float: right;color: #0081FF;font-size: 15px;" @click="getCode" v-if="show">获取验证码</span>
+						<button class='cu-btn bg-blue shadow'@click="getCode" v-if="show">验证码</button>
 						<span v-if="!show" style="color: #D7D9E0;float: right;font-size: 15px;">已发送({{ times }})</span>
 					</view>
 					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>

+ 35 - 57
pages/wages/wages.vue

@@ -1,26 +1,16 @@
 <template>
 	<div>
-		<!-- <div class="top" @click="ret()">
-			<div style="width: 10%;height: 5px;"></div>
-			<div style="margin-left: 10px;">
-			<span style="float: left;width: 20px;height: 20px;">
-				<image src="../../static/icon/fanhui3.png" style="width: 18px;height: 18px;"></image>
-			</span>	
-			<div style="margin-top: 5px;">
-			<span style="color: #FFFFFF;">返回</span>
-			</div>
-			</div>
-			<div style="text-align: center;margin-top: -22px;">
-			<span style="color: #FFFFFF;">薪资查询</span>
-			</div>
-		</div> -->
 		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
 			<block slot="backText">返回</block>
 			<block slot="content">薪资查询</block>
 		</cu-custom>
 		<br>
-		
-		<div class="dt">
+		<view class="cu-form-group" >
+		    <view ><image src="../../static/cards.png" class="imgs"></image></view>
+		    <view style="margin-left: 10px;">{{cardName}}****</view>
+			<input placeholder="请输入身份证后6位" v-model="name" ></input>
+		</view>
+		<!-- <div class="dt">
 			<ul style="margin-left: -45px;">
 				<view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
 				<li >
@@ -36,7 +26,8 @@
 					<view class="cu-form-group" >
 					    <view class="title" style="margin-top: 10px;"><image src="../../static/yzm.png" class="imgs"></image></view>
 					    <input placeholder="邮箱验证码" v-model="code" ></input>
-						<span style="float: right;color: #0081FF;font-size: 15px;" @click="getCode" v-if="show">获取验证码</span>
+						<button class='cu-btn bg-blue shadow'@click="getCode" v-if="show">验证码</button>
+						
 						<span v-if="!show" style="color: #D7D9E0;float: right;font-size: 15px;">已发送({{ times }})</span>
 					</view>
 					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
@@ -45,7 +36,7 @@
 				
 				
 			</ul>
-		</div>
+		</div> -->
 		<br>
 		<view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
 		<button style="background-color: #3C7AD8;color: #FFFFFF; width: 90%;" @click="save()">确定</button>
@@ -62,76 +53,63 @@
 				code: null,
 				times: 60,
 				show: true,
+				cardName:"",
 				userUrl: '/sys/user/sendEamilCode',
 				emlCode: '/sys/user/GetEamilCode'
 			}
 		},
+		created() {
+			this.getCode()
+			// var bankCode=uni.getStorageSync('bankCode');
+			// if(bankCode!=null&&bankCode!=""){
+			// 	this.$router.push({
+			// 		name: 'wagesdetails'
+			// 	});
+			// }else{
+			// 	this.getCode()
+			// }
+			
+		},
 		methods: {
 			getCode() {
-
-				let checkEmail = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
-				 if (this.name == "" || this.name == null) {
-					this.$tip.alert("邮箱不能为空");
-					return false;
-				}
-				/*if (!checkEmail.test(this.name)) {
-					this.$tip.alert('请输入正确的邮箱地址');
-					return false
-				} */
-
+				
+				var userid=this.$store.getters.userid;
 				this.$http.get(this.userUrl, {
 					params: {
-						email: this.name
+						userid: userid
 					}
 				}).then(res => {
-					console.log(res)
-					if (res.data!="0"&&res.data!=0) {
-						this.$tip.success('发送成功!')
-						this.times = 60;
-						this.show = false
-						this.timer = setInterval(() => {
-							this.times--
-							if (this.times === 0) {
-								this.show = true
-								clearInterval(this.timer)
-							}
-						}, 1000)
+					if (res.data!=""&&res.data!=null) {
+						this.cardName=res.data;
 					} else {
-						this.$tip.alert('发送失败!')
+						this.$tip.alert('暂无身份证信息!')
 					}
-
 				}).catch(err => {
 					console.log(err);
 				});
 
 			},
 			save() {
-				// this.$router.push({
-				// 	name: 'wagesdetail'
-				// });
 				if (this.name == "" || this.name == null) {
-					this.$tip.alert("邮箱不能为空");
-					return false;
-				}
-				if (this.code == null || this.code == "") {
-					this.$tip.alert("验证码不能为空");
+					this.$tip.alert("身份证不能为空");
 					return false;
 				}
-
+				var userid=this.$store.getters.userid;
 				this.$http.get(this.emlCode, {
 					params: {
-						email: this.name,
-						emailCode: this.code
+						userid: userid,
+						card: this.name
 					}
 				}).then(res => {
 					console.log(res)
-					if (res.data == "ok"||res.data ==ok) {
+					if (res.data == "ok") {
+						uni.setStorageSync('bankCode',this.name);
 						this.$router.push({
 							name: 'wagesdetails'
 						});
 						
 					}else{
-						this.$tip.alert('邮箱或验证码错误!')
+						this.$tip.alert('身份证后6位错误!')
 					}
 
 				}).catch(err => {

+ 29 - 6
pages/wages/wagesdetails.vue

@@ -85,6 +85,14 @@
 					<div style="width: 10;height: 10px;"></div>
 					</li>
 					<li class="s">
+					<span class="fontColr">年终奖</span>	
+					<span style="width: 10px;height: 10px;" class="money"></span>
+					<span class="money">{{item.srYearBonus}}</span>
+					<br>
+					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
+					<div style="width: 10;height: 10px;"></div>
+					</li>
+					<li class="s">
 					<span class="fontColr">高温费</span>	
 					<span style="width: 10px;height: 10px;" class="money"></span>
 					<span class="money">{{item.srGwWages}}</span>
@@ -259,14 +267,31 @@
 				<ul>
 					<li class="s">
 					<div style="width: 10;height: 10px;"></div>
-					<span class="fontColr">税</span>	
+					<span class="fontColr">工资代扣税</span>	
 					<span style="width: 10px;height: 10px;" class="money"></span>
 					<span style="float: right;">{{item.sdPersonal}}</span>
 					<br>
 					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
 					<div style="width: 10;height: 10px;"></div>
 					</li>
-					
+					<li class="s">
+					<div style="width: 10;height: 10px;"></div>
+					<span class="fontColr">年终奖代扣税</span>	
+					<span style="width: 10px;height: 10px;" class="money"></span>
+					<span style="float: right;">{{item.sdBonus}}</span>
+					<br>
+					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
+					<div style="width: 10;height: 10px;"></div>
+					</li>
+					<li class="s">
+					<div style="width: 10;height: 10px;"></div>
+					<span class="fontColr">扣税合计</span>	
+					<span style="width: 10px;height: 10px;" class="money"></span>
+					<span style="float: right;">{{item.sdOther}}</span>
+					<br>
+					<div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
+					<div style="width: 10;height: 10px;"></div>
+					</li>
 				
 				</ul>
 			</div>
@@ -289,8 +314,8 @@
 			}
 			},
 			created(){
-				this.querywages()
 				this.initData()
+				this.querywages()
 			},
 			methods:{
 				initData: function(cur) {
@@ -300,9 +325,7 @@
 						date = new Date(cur)
 					} else {
 						var now = new Date()
-						var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
-						d.setDate(35)
-						date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
+						date = now;
 					}
 					
 					this.currentYear = date.getFullYear()

BIN
static/cards.png


BIN
static/geke.png


BIN
static/gk.png


BIN
static/weixin.png


+ 47 - 47
store/index.js

@@ -8,114 +8,114 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-    token: sessionStorage.getItem('token')||'',
-	sessionId:sessionStorage.getItem('sessionId')||'',
-	indexId:sessionStorage.getItem('indexId')||'',
-    userid:sessionStorage.getItem('userid')||'',
-    username:sessionStorage.getItem('username')||'',
-    realname: sessionStorage.getItem('realname')||'',
-    welcome: sessionStorage.getItem('welcome')||'',
-    avatar:sessionStorage.getItem('avatar')||'',
-	orgCode:sessionStorage.getItem('orgCode')||'',
-	rzdate:sessionStorage.getItem('rzdate')||'',//入职时间
-	birthdate:sessionStorage.getItem('birthdate')||'',//生日
-	id:sessionStorage.getItem('id')||'',//查看考勤人员id
-	date:sessionStorage.getItem('date')||'',//查看考勤人员日期
-	departId:sessionStorage.getItem('departId')||'',//查询部门人员信息id
-	teamUserId:sessionStorage.getItem('teamUserId')||'',//查看团队人员信息id
-	tmsUserId:sessionStorage.getItem('tmsUserId')||'',//查看团队人员个人信息id
-	wagesDate:sessionStorage.getItem('wagesDate')||'',//查看个人工资参数
-	wagesId:sessionStorage.getItem('wagesId')||'',//查看个人工资参数人事
-	emilCode:sessionStorage.getItem('emilCode')||'',//邮箱验证码
-	chatname:sessionStorage.getItem('chatname')||'',//邮箱验证码
-	chatid:sessionStorage.getItem('chatid')||'',
-	perssion:sessionStorage.getItem('perssion')||'',//菜单数据
-	leave:sessionStorage.getItem('leave')||'',//部门假期
-	status:sessionStorage.getItem('status')||'',//人员类别
+    token: localStorage.getItem('token')||'',
+	sessionId:localStorage.getItem('sessionId')||'',
+	indexId:localStorage.getItem('indexId')||'',
+    userid:localStorage.getItem('userid')||'',
+    username:localStorage.getItem('username')||'',
+    realname: localStorage.getItem('realname')||'',
+    welcome: localStorage.getItem('welcome')||'',
+    avatar:localStorage.getItem('avatar')||'',
+	orgCode:localStorage.getItem('orgCode')||'',
+	rzdate:localStorage.getItem('rzdate')||'',//入职时间
+	birthdate:localStorage.getItem('birthdate')||'',//生日
+	id:localStorage.getItem('id')||'',//查看考勤人员id
+	date:localStorage.getItem('date')||'',//查看考勤人员日期
+	departId:localStorage.getItem('departId')||'',//查询部门人员信息id
+	teamUserId:localStorage.getItem('teamUserId')||'',//查看团队人员信息id
+	tmsUserId:localStorage.getItem('tmsUserId')||'',//查看团队人员个人信息id
+	wagesDate:localStorage.getItem('wagesDate')||'',//查看个人工资参数
+	wagesId:localStorage.getItem('wagesId')||'',//查看个人工资参数人事
+	emilCode:localStorage.getItem('emilCode')||'',//邮箱验证码
+	chatname:localStorage.getItem('chatname')||'',//邮箱验证码
+	chatid:localStorage.getItem('chatid')||'',
+	perssion:localStorage.getItem('perssion')||'',//菜单数据
+	leave:localStorage.getItem('leave')||'',//部门假期
+	status:localStorage.getItem('status')||'',//人员类别
 	
   },
   mutations: {
 	  SET_STATUS: (state, status) => {
-	  	sessionStorage.setItem('status',status)
+	  	localStorage.setItem('status',status)
 	    state.status = status
 	  },
 	  SET_USERID: (state, userid) => {
-	  	sessionStorage.setItem('userid',userid)
+	  	localStorage.setItem('userid',userid)
 	    state.userid = userid
 	  },
 	 SET_LEAVE: (state, leave) => {
-	 	sessionStorage.setItem('leave',leave)
+	 	localStorage .setItem('leave',leave)
 	   state.leave = leave
 	 },
 	 	 
 	  SET_CHAT: (state, {chatname,chatid,chatimg}) => {
-	  	sessionStorage.setItem('chatname',chatname)
-		sessionStorage.setItem('chatid',chatid)
-		sessionStorage.setItem('chatimg',chatimg)
+	  	localStorage.setItem('chatname',chatname)
+		localStorage.setItem('chatid',chatid)
+		localStorage.setItem('chatimg',chatimg)
 	    state.chatname = chatname
 		state.chatid=chatid
 	  },
 	SET_INDEXID: (state, indexId) => {
-		sessionStorage.setItem('indexId',indexId)
+		localStorage.setItem('indexId',indexId)
 	  state.indexId = indexId
 	},
     SET_TOKEN: (state, token) => {
-		sessionStorage.setItem('token',token)
+		localStorage.setItem('token',token)
       state.token = token
     },
 	SET_SESSIONID: (state, sessionId) => {
-		sessionStorage.setItem('sessionId',sessionId)
+		localStorage.setItem('sessionId',sessionId)
 	  state.sessionId = sessionId
 	},
     SET_NAME: (state, { username, realname, welcome }) => {
-		sessionStorage.setItem('sessionId',username)
-		sessionStorage.setItem('sessionId',realname)
-		sessionStorage.setItem('sessionId',welcome)
+		localStorage.setItem('sessionId',username)
+		localStorage.setItem('sessionId',realname)
+		localStorage.setItem('sessionId',welcome)
       state.username = username
       state.realname = realname
       state.welcome = welcome
     },
 	SET_RZDATE: (state,rzdate) => {
-		sessionStorage.setItem('rzdate',rzdate)
+		localStorage.setItem('rzdate',rzdate)
 	  state.rzdate = rzdate
 	},
 	SET_NPMUSER: (state, {id,date}) => {
-		sessionStorage.setItem('id',id)
-		sessionStorage.setItem('date',date)
+		localStorage.setItem('id',id)
+		localStorage.setItem('date',date)
 	  state.id = id
 	  state.date = date
 	},
     SET_AVATAR: (state, avatar) => {
 		
-		sessionStorage.setItem('avatar',avatar)
+		localStorage .setItem('avatar',avatar)
       state.avatar = avatar
     },
 	SET_DEPARTID: (state,departId) => {
-		sessionStorage.setItem('departId',departId)
+		localStorage.setItem('departId',departId)
 	  state.departId = departId
 	},
 	SET_TEAMUSERID: (state,teamUserId) => {
-		sessionStorage.setItem('teamUserId',teamUserId)
+		localStorage.setItem('teamUserId',teamUserId)
 	  state.teamUserId = teamUserId
 	},
 	SET_TEMUSERID: (state,tmsUserId) => {
-		sessionStorage.setItem('tmsUserId',tmsUserId)
+		localStorage.setItem('tmsUserId',tmsUserId)
 	  state.tmsUserId = tmsUserId
 	},
 	SET_WAGESDATE: (state,wagesDate) => {
-		sessionStorage.setItem('wagesDate',wagesDate)
+		localStorage.setItem('wagesDate',wagesDate)
 	  state.wagesDate = wagesDate
 	},
 	SET_WAGESID: (state,wagesId) => {
-		sessionStorage.setItem('wagesId',wagesId)
+		localStorage.setItem('wagesId',wagesId)
 	  state.wagesId = wagesId
 	},
 	SET_BIRTHDATE: (state,birthdate) => {
-		sessionStorage.setItem('birthdate',birthdate)
+		localStorage.setItem('birthdate',birthdate)
 	  state.birthdate = birthdate
 	},
 	SET_EMILCODE: (state,emilCode) => {
-		sessionStorage.setItem('emilCode',emilCode)
+		localStorage.setItem('emilCode',emilCode)
 	  state.emilCode = emilCode
 	},
 	SET_PERSSION:(state,perssion) => {