LiGuang 2 سال پیش
والد
کامیت
05bf9facab
3فایلهای تغییر یافته به همراه47 افزوده شده و 27 حذف شده
  1. 34 26
      pages/sign/leaves.vue
  2. 12 0
      pages/sign/userwork.vue
  3. 1 1
      pages/user/useredit.vue

+ 34 - 26
pages/sign/leaves.vue

@@ -8,7 +8,9 @@
 		<div class="panlen">
 			<div class="items">
 				<div style="height: 2px;"></div>
-				{{datetime}}年度
+				<picker mode="date" :start="new Date(entryDate).getFullYear()" :end="new Date().getFullYear()" fields="year" :value="datetime" @change="DateChange">
+					{{datetime}}年度
+				</picker>
 			</div>
 			<div style="text-align: center;margin-top: 10px;">
 				<span style="font-size: 13px;color: #FFFFFF;">历年年假剩余天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{lyearDay}}天</span>
@@ -67,41 +69,47 @@
 			data() {
 				return {
 				userUrl:'/sys/weixin/myVacation',
-				datetime:null,
+				datetime:new Date().getFullYear(),
 				yearDay:0,
 				lyearDay:0,
 				txcount:0,
+				entryDate:null,
 				availableDay:0,
 				data:[],
 				}
 			},
 			created() {
-				var date=new Date();
-				this.datetime=date.getFullYear();
-				var id=this.$store.getters.userid;
-				var deptid=uni.getStorageSync('id');
-				if(deptid!=null&&deptid!=""){
-					id=deptid;
-				}
-				
-				this.$http.get(this.userUrl,{params:{userid:id}}).then(res=>{
-					console.log(res);
-					this.yearDay=res.data.yearCount;
-					this.availableDay=res.data.syYearCount;
-					this.txcount=res.data.txCount;
-					this.lyearDay=res.data.lsyYearCount;
-					if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
-						this.data=res.data.vacationsBody;
-					}
-					
-					
-					
-				}).catch(err => {
-					console.log(err);
-				}); 
+				this.query();
 				
 			},methods:{
-				
+				query(){
+					var id=this.$store.getters.userid;
+					var deptid=uni.getStorageSync('id');
+					if(deptid!=null&&deptid!=""){
+						id=deptid;
+					}
+					this.$http.get(this.userUrl,{params:{userid:id,year:this.datetime}}).then(res=>{
+						this.yearDay=res.data.yearCount;
+						this.availableDay=res.data.syYearCount;
+						this.txcount=res.data.txCount;
+						this.lyearDay=res.data.lsyYearCount;
+						this.entryDate=res.data.entry;
+						if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
+							this.data=res.data.vacationsBody;
+						}else{
+							this.data=[];
+						}
+						
+						
+						
+					}).catch(err => {
+						console.log(err);
+					}); 
+				},
+				DateChange(e) {
+					this.datetime = e.detail.value
+					this.query();
+				},
 					ret(){
 						this.$Router.push({name:'index'})
 					},

+ 12 - 0
pages/sign/userwork.vue

@@ -22,6 +22,17 @@
 
 		<view>
 			<view class="container-list">
+				<view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
+					<label class="content">
+						<view class="lable-text " style="font-size: 15px;margin-left: 10px;">班次</view>
+						<view class="lable-text" style="font-size: 15px;margin-left: -20px;">上班时间</view>
+						<view style="font-size: 15px;">-</view>
+						<view class="lable-text" style="font-size: 15px;">下班时间</view>
+						<view class="lable-text">
+							<span style="font-size: 15px;">排班日期</span>
+						</view>
+					</label>
+				</view>
 				<view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]"
 					v-for='(item,index) in data' :key="index">
 					<label class="content">
@@ -33,6 +44,7 @@
 							<span style="font-size: 15px;">{{item.shiftDate}}</span>
 						</view>
 					</label>
+					
 				</view>
 
 			</view>

+ 1 - 1
pages/user/useredit.vue

@@ -41,7 +41,7 @@
 			</view>
 			<view class="cu-form-group">
 				<view class="title">生日</view>
-				<picker mode="date" :value="myFormData.birthday" @change="DateChange">
+				<picker mode="date" fields="year" :value="myFormData.birthday" @change="DateChange">
 					<view class="picker">
 						{{myFormData.birthday}}
 					</view>