zxz 3 năm trước cách đây
mục cha
commit
d768dfc0f3
3 tập tin đã thay đổi với 302 bổ sung75 xóa
  1. 23 17
      pages/clock/supp_clock.vue
  2. 3 3
      pages/clock/the_clock.vue
  3. 276 55
      pages/clock/the_clock_record.vue

+ 23 - 17
pages/clock/supp_clock.vue

@@ -18,7 +18,8 @@
 					<u-input class='textarea' v-model="detailData.reasonForApplication" :type="type" :border="border"
 						:height="height" :auto-height="autoHeight" />
 					<view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
-						{{detailData.reasonForApplication.length}}/150个字</view>
+						{{detailData.reasonForApplication.length}}/150个字
+					</view>
 				</view>
 
 			</view>
@@ -53,11 +54,12 @@
 				border: true,
 				height: 150,
 				autoHeight: true,
+				id: ""
 			}
 		},
 
-		onLoad() {
-
+		onLoad(options) {
+			this.id = options.id
 		},
 		// #ifndef MP
 		onNavigationBarButtonTap(e) {
@@ -147,10 +149,11 @@
 					confirmText: '提交',
 					success: function(res) {
 						if (res.confirm) {
+							that.detailData.id = that.id
 							that.detailData.compId = uni.getStorageSync('pcUserInfo').compId
 							that.detailData.commonId = uni.getStorageSync('pcUserInfo').userId
 							that.detailData.supplementClockType = that.typevalue
-							that.$api.doRequest('post','/clockInfo/api/suppClock',that.detailData)
+							that.$api.doRequest('post', '/clockInfo/api/suppClock', that.detailData)
 								.then(res => {
 									if (res.data.code == 200) {
 										that.$api.msg('提交成功')
@@ -198,19 +201,22 @@
 				border-radius: 3px;
 			}
 		}
-	.c-row {
-		display: -webkit-box;
-		display: -webkit-flex;
-		display: flex;
-		-webkit-box-align: center;
-		-webkit-align-items: center;
-		align-items: center;
-		padding: 10rpx -1rpx;
-		position: relative;
-	}
-	>.title {
-		padding: 10px 16px;
-	}
+
+		.c-row {
+			display: -webkit-box;
+			display: -webkit-flex;
+			display: flex;
+			-webkit-box-align: center;
+			-webkit-align-items: center;
+			align-items: center;
+			padding: 10rpx -1rpx;
+			position: relative;
+		}
+
+		>.title {
+			padding: 10px 16px;
+		}
+
 		.row-bottom {
 			.right-bottom {
 				width: 100%;

+ 3 - 3
pages/clock/the_clock.vue

@@ -123,7 +123,7 @@
 							that.detailData.empName = uni.getStorageSync('userInfo').userName
 							that.detailData.clockType = that.typevalue
 							that.detailData.clockDistance = "100"
-							that.$api.doRequest('post','/clockInfo/api/addClock',that.detailData)
+							that.$api.doRequest('post', '/clockInfo/api/addClock', that.detailData)
 								.then(res => {
 									if (res.data.code == 200) {
 										that.$api.msg('提交成功')
@@ -135,9 +135,9 @@
 					}
 				})
 			},
-			clockRecord(){
+			clockRecord() {
 				uni.navigateTo({
-					url:'/pages/clock/the_clock_record'
+					url: '/pages/clock/the_clock_record'
 				})
 			},
 		},

+ 276 - 55
pages/clock/the_clock_record.vue

@@ -15,27 +15,57 @@
 				</uni-tr>
 				<!-- 表格数据行 -->
 				<uni-tr v-for="(item, index) in tableData" :key="index">
-					<uni-td  align="center" style="height: 30px;">{{ item.createDate.split(" ")[0]  }}</uni-td>
-					<uni-td  align="center" >
+					<uni-td align="center" style="height: 30px;">{{ item.createDate.split(" ")[0]  }}</uni-td>
+					<uni-td align="center">
 						<view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}</view>
 						<view class="toClockDate" v-else-if="!item.toClockDate">
-							<button @click='supp' class="uni-button" size="mini" type="primary" align="center" style="height: 30px;">补卡</button>
+							<button v-if='item.status ==null' @click='supp(item)' class="uni-button" size="mini"
+								type="primary" align="center" style="height: 30px;">补卡</button>
+							<button @click='examine(item)' v-if='item.status=="审核中"'
+								class='listitemStatus audit Regular' size="mini" type="primary" align="center"
+								style="height: 30px;">审核中</button>
+							<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
+								type="primary" align="center" style="height: 30px;">补卡失败</button>
+							<button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
+								type="primary" align="center" style="height: 30px;">补卡成功</button>
 						</view>
-						<view v-if='item.status=="审核中"' class='listitemStatus audit Regular'>审核中</view>
-						<view v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular'>补卡失败</view>
-						<view v-if='item.status=="补卡成功"' class='listitemStatus pass Regular'>补卡成功</view>
 					</uni-td>
-					<uni-td  align="center" >
+					<uni-td align="center">
 						<view class="offClockDate" v-if="item.offClockDate">{{ item.offClockDate.split(" ")[1] }}</view>
-						<view class="offClockDate" v-else-if = "!item.offClockDate">
-							<button @click='supp' class="uni-button" size="mini" type="primary" align="center" style="height: 30px;">补卡</button>
+						<view class="offClockDate" v-else-if="!item.offClockDate">
+							<button v-if='item.status ==null' @click='supp' class="uni-button" size="mini"
+								type="primary" align="center" style="height: 30px;">补卡</button>
+							<button @click='examine(item)' v-if='item.status=="审核中"'
+								class='listitemStatus audit Regular' size="mini" type="primary" align="center"
+								style="height: 30px;">审核中</button>
+							<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
+								type="primary" align="center" style="height: 30px;">补卡失败</button>
+							<button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
+								type="primary" align="center" style="height: 30px;">补卡成功</button>
 						</view>
-						<view v-if='item.status=="审核中"' class='listitemStatus audit Regular'>审核中</view>
-						<view v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular'>补卡失败</view>
-						<view v-if='item.status=="补卡成功"' class='listitemStatus pass Regular'>补卡成功</view>
 					</uni-td>
 				</uni-tr>
 			</uni-table>
+			<view v-if='show1' class="shade">
+				<view class="wrap">
+					<view class="alert-top">
+						<view class="title">
+							{{title}}
+						</view>
+						<u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
+					</view>
+					<view class="u-textarea-style">
+						{{reasonForApplication}}
+					</view>
+					<view @click='rejectSubmit()' class="cancel">驳回</view>
+					<view @click='passSubmit()' class="confirm">通过</view>
+				</view>
+			</view>
+			<!-- <u-toast ref="uToast" />
+			<view style='padding:10px;' class='flex bottom-btn'>
+				<u-button v-if='isSHowBtn' @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
+				<u-button v-if='isSHowBtn' @click='pass' type="success" class="btn2">通过</u-button>
+			</view> -->
 		</view>
 	</view>
 </template>
@@ -44,23 +74,30 @@
 	export default {
 		data() {
 			return {
+				isSHowBtn: true,
+				show1: false,
 				show: false,
 				tableData: [],
 				pageSize: 10,
+				reasonForApplication: '',
 				currentPage: 1,
 				params: {
 					year: true,
 					month: true
 				},
-				isLoadMore:false
+				isLoadMore: false,
+				title: "补卡申请",
+				auditMind: "",
+
+
 			}
 		},
 		onPullDownRefresh() {
-		    this.getList()
-		     setTimeout(function () {
-		         uni.stopPullDownRefresh();  //关闭下拉刷新
-		     }, 1000);
-		 },
+			this.getList()
+			setTimeout(function() {
+				uni.stopPullDownRefresh(); //关闭下拉刷新
+			}, 1000);
+		},
 		onShow() {
 			this.getList()
 		},
@@ -68,7 +105,6 @@
 			let _day = new Date();
 			_day.setTime(_day.getTime());
 			this.createDate = _day.getFullYear() + "-" + (_day.getMonth() + 1);
-			
 		},
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
@@ -77,46 +113,106 @@
 			this.getData()
 		},
 		methods: {
+			examine(item) {
+				this.show1 = true
+				this.id = item.id
+				this.reasonForApplication = item.reasonForApplication
+			},
 			dateChange(e) {
 				console.log(e)
 				this.createDate = e.year + "-" + e.month
 			},
-			getData(){
-				this.isLoadMore=true
-					this.$api.doRequest('get','/clockInfo/selectClockInfo',{
-						pageSize: this.pageSize,
-						currentPage: this.currentPage,
-						pcFlag:0,
-						// phone:uni.getStorageSync('pcUserInfo').userMobilePhone,
-						compId : uni.getStorageSync('pcUserInfo').compId,
-						commonId : uni.getStorageSync('pcUserInfo').userId,
-							}).then(res => {
-					if(res.data.code==200){
-						this.isLoadMore=false
-						this.tableData=this.tableData.concat(res.data.data.records)
+			getData() {
+				this.isLoadMore = true
+				this.$api.doRequest('get', '/clockInfo/selectClockInfo', {
+					pageSize: this.pageSize,
+					currentPage: this.currentPage,
+					pcFlag: 0,
+					// phone:uni.getStorageSync('pcUserInfo').userMobilePhone,
+					compId: uni.getStorageSync('pcUserInfo').compId,
+					commonId: uni.getStorageSync('pcUserInfo').userId,
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.isLoadMore = false
+						this.tableData = this.tableData.concat(res.data.data.records)
+					}
+				})
+			},
+			getList() {
+				this.isLoadMore = true
+				this.$api.doRequest('get', '/clockInfo/selectClockInfo', {
+					pageSize: this.pageSize,
+					currentPage: this.currentPage,
+					pcFlag: 0,
+					compId: uni.getStorageSync('pcUserInfo').compId,
+					commonId: uni.getStorageSync('pcUserInfo').userId,
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.isLoadMore = false
+						this.tableData = res.data.data.records
+
+					}
+				})
+			},
+			close() {
+				this.show1 = false
+			},
+			// 驳回
+			rejectSubmit() {
+				var that = this
+				this.show1 = false
+				uni.showModal({
+					content: "是否确定驳回?",
+					showCancel: true,
+					confirmText: '确定',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post', '/clockInfo/api/examineClock', {
+									examineFlag: "2",
+									id: that.id
+								})
+								.then(res => {
+									if (res.data.code == 200) {
+										that.$api.msg('提交成功')
+										that.getList()
+									} else {
+										that.$api.msg('提交失败')
+									}
+								})
+						}
 					}
 				})
 			},
-			getList(){
-				this.isLoadMore=true
-					this.$api.doRequest('get','/clockInfo/selectClockInfo',{
-							pageSize: this.pageSize,
-							currentPage: this.currentPage,
-							pcFlag:0,
-							// phone:uni.getStorageSync('pcUserInfo').userMobilePhone,
-							compId : uni.getStorageSync('pcUserInfo').compId,
-							commonId : uni.getStorageSync('pcUserInfo').userId,
-							}).then(res => {
-					if(res.data.code==200){
-						this.isLoadMore=false
-						this.tableData=res.data.data.records
-						
+			//通过
+			passSubmit() {
+				var that = this
+				this.show1 = false
+				uni.showModal({
+					content: "是否确定通过?",
+					showCancel: true,
+					confirmText: '确定',
+					success: function(res) {
+						if (res.confirm) {
+							that.$api.doRequest('post', '/clockInfo/api/examineClock', {
+									examineFlag: "1",
+									id: that.id
+								})
+								.then(res => {
+									if (res.data.code == 200) {
+										that.$api.msg('提交成功')
+										that.getList()
+									} else {
+										that.$api.msg('提交失败')
+									}
+								})
+						}
 					}
 				})
 			},
-			supp(){
+			supp(item) {
 				uni.navigateTo({
-					url:'/pages/clock/supp_clock'
+					url: '/pages/clock/supp_clock' + `?id=${item.id}`,
+					// url: item.url + `?companyId=${that.companyId}`
 				})
 			},
 		}
@@ -127,6 +223,7 @@
 	uni-page-body {
 		overflow: hidden;
 	}
+
 	.uni-container {
 		margin: 10rpx;
 		padding: 10rpx 10rpx 300rpx 10rpx;
@@ -138,20 +235,28 @@
 			display: flex;
 			margin-bottom: 20rpx;
 			align-items: center;
+
 			.center {
 				margin-right: 50rpx;
 			}
 		}
 	}
-	.listitemStatus.audit{
-		color:#FE6430;
+
+	.listitemStatus.audit {
+		color: #ffffff;
+		margin-top: 6rpx;
 	}
-	.listitemStatus.notPass{
-		color:#FB1E1E;
+
+	.listitemStatus.notPass {
+		color: #ffffff;
+		margin-top: 6rpx;
 	}
-	.listitemStatus.pass{
-		color:#22C572;
+
+	.listitemStatus.pass {
+		color: #ffffff;
+		margin-top: 6rpx;
 	}
+
 	.row {
 		display: flex;
 		justify-content: space-between;
@@ -164,7 +269,123 @@
 			color: #333333;
 		}
 	}
-	.uni-button{
+
+	.uni-button {
 		margin-top: 6rpx;
 	}
+
+	.shade {
+		position: fixed;
+		top: 0;
+		left: 0;
+		height: 100%;
+		width: 100%;
+		background: rgba(0, 0, 0, 0.4);
+		z-index: 3;
+
+		.wrap {
+			position: absolute;
+			left: 0;
+			top: 0;
+			right: 0;
+			bottom: 0;
+			margin: auto;
+			background: #fff;
+			width: calc(100% - 198rpx);
+			height: 250px;
+			border-radius: 20rpx;
+
+			.alert-top {
+				padding: 33rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				position: relative;
+			}
+
+			.title {
+				font-size: 32rpx;
+				font-weight: 600;
+				color: #333333;
+			}
+
+			.close {
+				position: absolute;
+				right: 33rpx;
+			}
+		}
+
+		.u-textarea-style {
+			margin: 20rpx;
+			background: #F9F9FA;
+			border-radius: 10px;
+			border: 1px solid #EEEEEE;
+			padding: 10rpx 20rpx;
+			position: relative;
+			height: 113px;
+
+			.right-bottom {
+				position: absolute;
+				right: 20rpx;
+				bottom: 20rpx;
+				color: #AFB3BF;
+			}
+		}
+
+		.cancel {
+			position: absolute;
+			display: inline-block;
+			width: 50%;
+			text-align: center;
+			bottom: 0;
+			padding: 10px;
+			border-top: 1px solid #eee;
+			font-size: 34rpx;
+		}
+
+		.confirm {
+			position: absolute;
+			display: inline-block;
+			width: 50%;
+			text-align: center;
+			bottom: 0;
+			padding: 10px;
+			border-top: 1px solid #eee;
+			font-size: 34rpx;
+		}
+
+		.cancel {
+			left: 0;
+			border-right: 1px solid #eee;
+			color: #ff0000;
+		}
+
+		.confirm {
+			right: 0;
+			color: #22C572;
+		}
+
+		.bottom-btn {
+			width: 100%;
+			position: fixed;
+			bottom: 0;
+			display: flex;
+			z-index: 2;
+			left: 0;
+			background-color: #f8f8f8;
+			flex-direction: column;
+
+			.btn1,
+			.btn2 {
+				width: 100%;
+				margin-bottom: 26rpx;
+				border-radius: 90rpx;
+			}
+
+			.btn1 {
+				background: white;
+				color: #00C265;
+			}
+		}
+	}
 </style>