MS-CIAZDCOIXVRW\Administrator 3 yıl önce
ebeveyn
işleme
f38bad7c2c
69 değiştirilmiş dosya ile 951 ekleme ve 315 silme
  1. 14 12
      pages/addLocation/addLocation.vue
  2. 29 6
      pages/addRules/addRules.vue
  3. 26 7
      pages/editRules/editRules.vue
  4. 82 17
      pages/group/group.vue
  5. 15 12
      pages/punchLocation/punchLocation.vue
  6. 39 32
      pages/punchTime/punchTime.vue
  7. 1 1
      pages/ruleName/ruleName.vue
  8. 69 31
      pages/ruleSet/ruleSet.vue
  9. 110 29
      pages/setPunchTime/setPunchTime.vue
  10. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  11. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  12. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/chocolate-progress-bar/chocolate-progress-bar.js.map
  13. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/tki-tree/tki-tree.js.map
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/404/404.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/addLocation/addLocation.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/addRules/addRules.js.map
  17. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/authentication/authentication.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cardRecord/cardRecord.js.map
  19. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/editRules/editRules.js.map
  20. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/group/group.js.map
  21. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map
  22. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
  23. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/location/location.js.map
  24. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/my.js.map
  25. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/particulars/particulars.js.map
  26. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/powerSet/powerSet.js.map
  27. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchLocation/punchLocation.js.map
  28. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchTime/punchTime.js.map
  29. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleName/ruleName.js.map
  30. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleSet/ruleSet.js.map
  31. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/rulesDetail/rulesDetail.js.map
  32. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/setPunchTime/setPunchTime.js.map
  33. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/stat/stat.js.map
  34. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/statDetail/statDetail.js.map
  35. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.js.map
  36. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.js.map
  37. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.js.map
  38. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map
  39. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map
  40. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js.map
  41. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map
  42. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map
  43. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js.map
  44. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js.map
  45. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js.map
  46. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zwx-dropDown/components/zwx-dropDown/zwx-dropDown.js.map
  47. 31 1
      unpackage/dist/dev/mp-weixin/common/vendor.js
  48. 9 7
      unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.js
  49. 1 1
      unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.wxml
  50. 22 4
      unpackage/dist/dev/mp-weixin/pages/addRules/addRules.js
  51. 1 1
      unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxml
  52. 3 0
      unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxss
  53. 37 9
      unpackage/dist/dev/mp-weixin/pages/editRules/editRules.js
  54. 1 1
      unpackage/dist/dev/mp-weixin/pages/editRules/editRules.wxml
  55. 3 0
      unpackage/dist/dev/mp-weixin/pages/editRules/editRules.wxss
  56. 122 26
      unpackage/dist/dev/mp-weixin/pages/group/group.js
  57. 3 0
      unpackage/dist/dev/mp-weixin/pages/group/group.wxss
  58. 11 9
      unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.js
  59. 1 1
      unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.wxml
  60. 36 23
      unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.js
  61. 1 1
      unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.wxml
  62. 1 1
      unpackage/dist/dev/mp-weixin/pages/ruleName/ruleName.js
  63. 94 22
      unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.js
  64. 1 1
      unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxml
  65. 7 0
      unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxss
  66. 103 20
      unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.js
  67. 1 1
      unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.wxml
  68. 7 0
      unpackage/dist/dev/mp-weixin/project.private.config.json
  69. 33 2
      util/api.js

+ 14 - 12
pages/addLocation/addLocation.vue

@@ -10,7 +10,7 @@
 		<!-- 顶部搜索框区域 -->
 		<view class="search">
 			<uni-search-bar bgColor="#fff" placeholder="请输入搜索地点" cancelButton="none" v-model="searchValue"
-				@clear="clear" @blur="blur">
+				@clear="clear" @input="handleSearch">
 			</uni-search-bar>
 		</view>
 
@@ -74,7 +74,7 @@
 				placeList: [],
 				// 范围数值
 				rangeValue: 300,
-				chooseList:[]
+				chooseList: []
 			}
 		},
 		onLoad() {
@@ -145,15 +145,18 @@
 			},
 			// 选择单个地址时的回调
 			handleChoose(item) {
-				console.log(item);
+				let arr = uni.getStorageSync("chooseList")
+				if (arr) {
+					this.chooseList = uni.getStorageSync("chooseList")
+				}
 				this.chooseList.push({
-					title:item.title,
-					address:item.address,
-					scope:this.rangeValue
+					title: item.title,
+					address: item.address,
+					scope: this.rangeValue
 				})
-				let temList = JSON.stringify(this.chooseList)
-				uni.redirectTo({
-					url:`/pages/punchLocation/punchLocation?temList=${temList}`
+				uni.setStorageSync("chooseList", this.chooseList)
+				uni.navigateBack({
+					delta: 1
 				})
 			},
 			// 点击选择打卡范围回调
@@ -161,16 +164,15 @@
 				uni.showActionSheet({
 					itemList: this.rangeList,
 					success: (res) => {
-						// console.log(res);
 						this.rangeValue = this.rangeList[res.tapIndex]
 					}
 				});
 			},
 			// 搜索框失焦回调
-			blur(res) {
+			handleSearch(res) {
 				this.placeList = []
 				qqmapsdk.search({
-					keyword: res.value,
+					keyword: res,
 					auto_extend: "0",
 					success: (res) => {
 						if (res.status == 0) {

+ 29 - 6
pages/addRules/addRules.vue

@@ -44,7 +44,10 @@
 					{{time}}
 				</view>
 				<view class="ele black" v-else>
-					{{time}}
+					<span>{{time.selectedWeeks}}</span>
+					<span v-for="(item,index) in time.list" :key="index">
+						{{item.startTime}}-{{item.endTime}}
+					</span>
 				</view>
 				<view class="right">
 					<img src="../../static/right.png">
@@ -116,13 +119,29 @@
 			};
 		},
 		onLoad() {
-			uni.$on('update', (data) => {
-				this.ruleName = data
+			uni.$on('updatePunchTime', (data) => {
+				this.time = data
 			})
-
 		},
-		onUnload() {
-			uni.$off('update')
+		onShow() {
+			let ruleName = uni.getStorageSync("ruleName")
+			if (ruleName) {
+				this.ruleName = ruleName
+			}
+
+			let ruleGroup = uni.getStorageSync("ruleGroup")
+			if (ruleGroup) {
+				this.group = ruleGroup.join(",")
+			}
+
+			let temPlace = uni.getStorageSync("chooseList")
+			if (temPlace) {
+				let temList = []
+				temPlace.forEach((ele) => {
+					temList.push(ele.title)
+				})
+				this.place = temList.join(",")
+			}
 		},
 		methods: {
 			// 点击确认按钮回调
@@ -244,6 +263,10 @@
 					overflow: hidden;
 					white-space: nowrap;
 					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
 				}
 
 				.black {

+ 26 - 7
pages/editRules/editRules.vue

@@ -45,7 +45,10 @@
 					{{time}}
 				</view>
 				<view class="ele black" v-else>
-					{{time}}
+					<span>{{time}}</span>
+					<span v-for="(item,index) in periods" :key="index">
+						{{format_time(item.beginTime)}}-{{format_time(item.endTime)}}
+					</span>
 				</view>
 				<view class="right">
 					<img src="../../static/right.png">
@@ -80,7 +83,7 @@
 						{{value}}
 					</view>
 					<view class="ele black" v-else>
-						{{value}}
+						{{value}}分钟
 					</view>
 					<view class="right">
 						<img src="../../static/right.png">
@@ -121,17 +124,20 @@
 				value: "未设置",
 				// 提前通知选项
 				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
+				periods: [],
 				index: 0,
 			};
 		},
 		onLoad(option) {
 			this.info = JSON.parse(option.info)
+			console.log(this.info);
 
-			this.ruleName = this.info.ruleName
-			this.group = this.info.group
-			this.time = this.info.time
-			this.place = this.info.place
-			this.value = this.info.notes
+			this.ruleName = this.info.name
+			this.group = this.info.groups
+			this.time = this.info.temList
+			this.place = this.info.locations
+			this.value = this.info.noticeTime
+			this.periods = this.info.periods
 
 			uni.$on('update', (data) => {
 				this.ruleName = data
@@ -198,6 +204,15 @@
 				uni.navigateTo({
 					url: "/pages/punchLocation/punchLocation"
 				})
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
 			}
 		}
 	}
@@ -235,6 +250,10 @@
 					overflow: hidden;
 					white-space: nowrap;
 					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
 				}
 
 				.black {

+ 82 - 17
pages/group/group.vue

@@ -203,22 +203,22 @@
 			},
 			// 考勤组选择框取消回调事件
 			treeCancel(e) {
-				console.log(e)
-				console.log("取消");
+				// this.$refs.tkitree._hide()
 			},
 			// 点击选择考勤组选择框回调
 			async handleChoose() {
-				this.$refs.tkitree._show()
+				this.range = []
 				let res = await this.$myRequest({
 					url: "/attendance/api/settings/org/tree"
 				})
 				// console.log(res);
 				if (res.code == 200) {
 					this.range = res.data
+					this.$refs.tkitree._show()
 				}
 			},
 			handleChange(item) {
-				console.log(item);
+				// console.log(item);
 				item.checked = !item.checked
 			},
 			// 点击弹窗保存按钮回调
@@ -237,6 +237,13 @@
 					})
 					return
 				}
+				if (this.group_total == 0) {
+					uni.showToast({
+						title: "该考勤组范围中人数为0,请重新选择",
+						icon: "none"
+					})
+					return
+				}
 				if (!this.group_num) {
 					uni.showToast({
 						title: "请输入打卡人数",
@@ -244,6 +251,13 @@
 					})
 					return
 				}
+				if (this.group_num - 0 > this.group_total - 0) {
+					uni.showToast({
+						title: "打卡人数不能超过总人数",
+						icon: "none"
+					})
+					return
+				}
 				let res = await this.$myRequest({
 					url: "/attendance/api/settings/group/add",
 					method: "post",
@@ -259,8 +273,22 @@
 						userOrgList: this.userOrgList
 					}
 				})
-				console.log(res);
-				this.$refs.popup.close()
+				// console.log(res);
+				if (res.code == 200) {
+					this.$refs.popup.close()
+					uni.showToast({
+						title: "添加成功",
+						icon: "none"
+					})
+					setTimeout(() => {
+						this.getGroupData()
+					}, 1500)
+				} else {
+					uni.showToast({
+						title: res.message,
+						icon: "none"
+					})
+				}
 			},
 			// 点击弹窗取消按钮回调
 			handleCancel() {
@@ -271,12 +299,31 @@
 				this.group_name = ""
 				this.group_num = null
 				this.group_total = 0
+				this.group_scope = ""
 				this.userOrgList = []
-				this.$refs.popup.open()
+				this.$nextTick(() => {
+					this.$refs.popup.open()
+				})
 			},
 			// 点击关联考勤组按钮回调
 			handleRelevancy() {
-				console.log(456);
+				let temList = []
+				this.list.forEach((ele) => {
+					if (ele.checked == true) {
+						temList.push(ele.name)
+					}
+				})
+				if (temList.length == 0) {
+					uni.showToast({
+						title: "请先勾选考勤组",
+						icon: "none"
+					})
+				} else {
+					uni.setStorageSync("ruleGroup", temList)
+					uni.navigateBack({
+						delta: 1
+					})
+				}
 			},
 			// 点击树状节点回调
 			nodechange(ref) {
@@ -288,20 +335,35 @@
 			},
 			// 点击右侧删除按钮回调
 			onClick(id) {
-				console.log(id);
+				// console.log(id);
 				uni.showModal({
 					title: '提示',
 					content: '确定删除该考勤组吗?',
-					success: function(res) {
+					success: async (res) => {
 						if (res.confirm) {
-							console.log('用户点击确定');
-							uni.showToast({
-								title: "删除成功",
-								icon: 'success'
+							let res = await this.$myRequest({
+								url: "/attendance/api/settings/group/delete",
+								method: "delete",
+								data: {
+									ids: [id]
+								}
 							})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+							// console.log(res);
+							if (res.code == 200) {
+								uni.showToast({
+									title: "删除成功",
+									icon: 'success'
+								})
+								setTimeout(() => {
+									this.getGroupData()
+								}, 1500)
+							} else {
+								uni.showToast({
+									title: res.message,
+									icon: 'success'
+								})
+							}
+						} else if (res.cancel) {}
 					}
 				});
 			},
@@ -451,6 +513,9 @@
 						padding-left: 24rpx;
 						flex: 5;
 						font-size: 28rpx;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
 					}
 
 					.icon {

+ 15 - 12
pages/punchLocation/punchLocation.vue

@@ -15,8 +15,8 @@
 		<view class="list">
 			<uni-swipe-action>
 				<!-- 每一个时间段区域 -->
-				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(item.id)"
-					v-for="item in list" :key="item.id">
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
+					v-for="(item,index) in list" :key="index">
 
 					<view class="box">
 						<view class="icon">
@@ -75,9 +75,13 @@
 				}],
 			}
 		},
-		onLoad(options) {
-			if (options.temList) {
-				this.list = JSON.parse(options.temList)
+		onLoad() {
+
+		},
+		onShow() {
+			let arr = uni.getStorageSync("chooseList")
+			if (arr) {
+				this.list = arr
 			}
 		},
 		methods: {
@@ -108,21 +112,20 @@
 				})
 			},
 			// 点击右侧删除按钮回调
-			onClick(id) {
-				console.log(id);
+			onClick(index) {
+				console.log(index);
 				uni.showModal({
 					title: '提示',
 					content: '确定删除该打卡位置吗?',
-					success: function(res) {
+					success: (res) => {
 						if (res.confirm) {
-							console.log('用户点击确定');
+							this.list.splice(index, 1)
+							uni.setStorageSync("chooseList", this.list)
 							uni.showToast({
 								title: "删除成功",
 								icon: 'success'
 							})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+						} else if (res.cancel) {}
 					}
 				});
 			},

+ 39 - 32
pages/punchTime/punchTime.vue

@@ -15,8 +15,8 @@
 		<view class="list">
 			<uni-swipe-action>
 				<!-- 每一个时间段区域 -->
-				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(item.id)"
-					v-for="item in list" :key="item.id">
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
+					v-for="(item,index) in list" :key="index">
 					<view class="box" @click="handleEdit(item)">
 						<view class="left">
 							<view class="week">
@@ -24,7 +24,7 @@
 									星期
 								</view>
 								<view class="value">
-									{{item.week}}
+									{{item.selectedWeeks}}
 								</view>
 							</view>
 							<view class="week">
@@ -32,7 +32,9 @@
 									时段
 								</view>
 								<view class="value">
-									{{item.time}}
+									<span v-for="(item_time,index_time) in item.list" :key="index_time">
+										{{item_time.startTime}}-{{item_time.endTime}}
+									</span>
 								</view>
 							</view>
 						</view>
@@ -50,26 +52,27 @@
 	export default {
 		data() {
 			return {
-				list: [{
-						id: 1,
-						week: "周一,周二,周三,周四,周五,周六,周日",
-						time: "09:00-17:00、20:00-21:00、22:00-23:00"
-					},
-					{
-						id: 2,
-						week: "周一,周二,周三,周四,周五,周六,周日",
-						time: "09:00-17:00"
-					},
-					{
-						id: 3,
-						week: "周一,周二,周三,周四,周五,周六,周日",
-						time: "12:00-17:00"
-					},
-					{
-						id: 4,
-						week: "周一,周二,周三,周四,周五,周六,周日",
-						time: "09:00-17:00、20:00-21:00、22:00-23:00"
-					},
+				list: [
+					// {
+					// 	id: 1,
+					// 	week: "周一,周二,周三,周四,周五,周六,周日",
+					// 	time: "09:00-17:00、20:00-21:00、22:00-23:00"
+					// },
+					// {
+					// 	id: 2,
+					// 	week: "周一,周二,周三,周四,周五,周六,周日",
+					// 	time: "09:00-17:00"
+					// },
+					// {
+					// 	id: 3,
+					// 	week: "周一,周二,周三,周四,周五,周六,周日",
+					// 	time: "12:00-17:00"
+					// },
+					// {
+					// 	id: 4,
+					// 	week: "周一,周二,周三,周四,周五,周六,周日",
+					// 	time: "09:00-17:00、20:00-21:00、22:00-23:00"
+					// },
 				],
 				options: [{
 					text: '删除',
@@ -79,6 +82,12 @@
 				}],
 			}
 		},
+		onShow() {
+			let ruleTime = uni.getStorageSync("ruleTime")
+			if (ruleTime) {
+				this.list = ruleTime
+			}
+		},
 		methods: {
 			// 点击添加打卡时间回调 跳转到添加页面
 			handleAdd() {
@@ -94,25 +103,23 @@
 				})
 			},
 			// 点击右侧删除按钮回调
-			onClick(id) {
-				console.log(id);
+			onClick(index) {
+				// console.log(index);
 				uni.showModal({
 					title: '提示',
 					content: '确定删除该打卡时间吗?',
-					success: function(res) {
+					success: (res) => {
 						if (res.confirm) {
-							console.log('用户点击确定');
 							uni.showToast({
 								title: "删除成功",
 								icon: 'success'
 							})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+							this.list.splice(index, 1)
+							uni.setStorageSync("ruleTime", this.list)
+						} else if (res.cancel) {}
 					}
 				});
 			},
-
 		}
 	}
 </script>

+ 1 - 1
pages/ruleName/ruleName.vue

@@ -28,7 +28,7 @@
 						icon: 'none'
 					})
 				} else {
-					uni.$emit('update', this.name)
+					uni.setStorageSync("ruleName", this.name)
 					uni.navigateBack({
 						delta: 1
 					})

+ 69 - 31
pages/ruleSet/ruleSet.vue

@@ -19,7 +19,7 @@
 						<img src="../../static/my1.png">
 					</view>
 					<view class="msg">
-						{{item.ruleName}}
+						{{item.name}}
 					</view>
 					<view class="right">
 						<img src="../../static/right.png">
@@ -27,19 +27,22 @@
 				</view>
 
 				<view class="box_info">
-					考勤组:{{item.group}}
+					考勤组:{{item.groups}}
 				</view>
 
 				<view class="box_info">
-					时 间:{{item.time}}
+					<span>时 间:{{item.temList}}</span>
+					<span v-for="(time_item,index) in item.periods" :key="index">
+						{{format_time(time_item.beginTime)}}-{{format_time(time_item.endTime)}}
+					</span>
 				</view>
 
 				<view class="box_info">
-					打卡地点:{{item.place}}
+					打卡地点:{{item.locations}}
 				</view>
 
 				<view class="box_info">
-					提前通知:{{item.notes}}
+					提前通知:提前{{item.noticeTime}}分钟通知
 				</view>
 			</view>
 
@@ -51,35 +54,53 @@
 	export default {
 		data() {
 			return {
-				list: [{
-						id: 1,
-						group: "全体老师",
-						time: "周一、周二、周三、...,09:00-17:00",
-						place: "新建区南昌交通学院",
-						notes: "提前15分钟通知",
-						ruleName:"课间操打卡规则"
-					},
-					{
-						id: 2,
-						group: "全体同学",
-						time: "周一、周二、周三、...,09:00-17:00",
-						place: "高新区南昌交通学院",
-						notes: "提前10分钟通知",
-						ruleName:"课间操打卡规则"
-					},
-					{
-						id: 3,
-						group: "全体老师同学",
-						time: "周一、周二、周三、...,09:00-17:00",
-						place: "红谷滩区南昌交通学院",
-						notes: "提前5分钟通知",
-						ruleName:"课间操打卡规则"
-					},
-				]
-
+				list: []
 			};
 		},
+		onShow() {
+			let chooseList = uni.getStorageSync('chooseList')
+			if (chooseList) {
+				uni.showModal({
+					title: '提示',
+					content: '上一个页面有未保存的数据,确定不保存吗?',
+					cancelText:'返回上页',
+					success: function(res) {
+						if (res.confirm) {
+							uni.removeStorageSync('chooseList');
+						} else if (res.cancel) {
+							uni.navigateTo({
+								url: `/pages/addRules/addRules`
+							})
+						}
+					}
+				});
+			}
+		},
+		onLoad() {
+			this.getRuleList()
+		},
 		methods: {
+			// 获取打卡规则列表数据
+			async getRuleList() {
+				let res = await this.$myRequest({
+					url: "/attendance/api/settings/rule/list"
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.list = res.data.list
+					this.list.forEach((ele) => {
+						ele.groups = ele.groups.join(",")
+						ele.locations = ele.locations.join(",")
+						ele.dayOfWeeks.sort((a, b) => {
+							return a - b
+						})
+						let arr = ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+						ele.temList = ele.dayOfWeeks.map((item) => {
+							return item = arr[item]
+						})
+					})
+				}
+			},
 			// 点击每一项跳转编辑规则页面
 			toPageEditRules(item) {
 				// console.log(item);
@@ -93,6 +114,15 @@
 				uni.navigateTo({
 					url: "/pages/addRules/addRules"
 				})
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
 			}
 		}
 	}
@@ -175,11 +205,19 @@
 				}
 
 				.box_info {
+					display: flex;
 					margin: 15rpx 0;
 					height: 44rpx;
 					font-size: 30rpx;
 					font-weight: 400;
 					color: #808080;
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
 				}
 			}
 		}

+ 110 - 29
pages/setPunchTime/setPunchTime.vue

@@ -22,7 +22,7 @@
 
 			<uni-swipe-action>
 				<!-- 每一个时间段区域 -->
-				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(item.id)"
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
 					v-for="(item,index) in list" :key="index">
 
 					<view class="item">
@@ -68,11 +68,11 @@
 				除去法定节假日
 			</view>
 			<view class="switch_button">
-				<switch color="#2A82E4" @change="switchChange" />
+				<switch color="#2A82E4" :checked="holiday" @change="switchChange" />
 			</view>
 		</view>
 
-		<view class="button">
+		<view class="button" @click="handleSave">
 			保存
 		</view>
 
@@ -87,17 +87,18 @@
 		},
 		data() {
 			return {
+				// 选中的星期
 				selectedWeeks: [],
+				// 打卡时间段列表
 				list: [{
-						startTime: "00:00",
-						endTime: "00:00",
-					},
-					{
-						startTime: "00:00",
-						endTime: "00:00",
-					},
-				],
+					startTime: "00:00",
+					endTime: "00:00",
+				}],
+				// 是否同步法定节假日
+				holiday: false,
+				// 编辑打卡时间页面带过来的对象
 				info: {},
+				// 左滑配置
 				options: [{
 					text: '删除',
 					style: {
@@ -115,53 +116,133 @@
 				uni.setNavigationBarTitle({
 					title: '编辑打卡时间'
 				});
-				this.selectedWeeks = [0, 1]
-				// this.info=JSON.parse(options.info)
+				this.info = JSON.parse(options.info)
 				// console.log(this.info);
-				// let temList=this.info.time.split("、")
-				// console.log(temList);
+				this.list = this.info.list
+				this.holiday = this.info.holiday
+				this.selectedWeeks = this.info.selectedWeeks.map((ele) => {
+					if (ele == '星期一') {
+						return ele = 1
+					}
+					if (ele == '星期二') {
+						return ele = 2
+					}
+					if (ele == '星期三') {
+						return ele = 3
+					}
+					if (ele == '星期四') {
+						return ele = 4
+					}
+					if (ele == '星期五') {
+						return ele = 5
+					}
+					if (ele == '星期六') {
+						return ele = 6
+					}
+					if (ele == '星期天') {
+						return ele = 0
+					}
+				})
 			}
 		},
 		methods: {
+			// 保存按钮回调
+			handleSave() {
+				if (!this.selectedWeeks.length) {
+					uni.showToast({
+						title: "请选择需要打卡的星期",
+						icon: 'none'
+					})
+					return
+				}
+				if (!this.list.length) {
+					uni.showToast({
+						title: "请添加需要打卡的时间段",
+						icon: 'none'
+					})
+					return
+				}
+				uni.showModal({
+					title: '提示',
+					content: '确定保存吗?',
+					success: (res) => {
+						if (res.confirm) {
+							uni.showToast({
+								title: "保存成功",
+								icon: 'success'
+							})
+							setTimeout(() => {
+								let temList = uni.getStorageSync("ruleTime") || []
+								// console.log(temList);
+								temList.push({
+									selectedWeeks: this.selectedWeeks,
+									list: this.list,
+									holiday: this.holiday
+								})
+								uni.setStorageSync("ruleTime", temList)
+								uni.navigateBack({
+									delta: 1
+								})
+							}, 1500)
+						} else if (res.cancel) {}
+					}
+				});
+
+			},
+			// 选择星期回调
 			changeWeek(value) {
-				console.log(value);
-				this.selectedWeeks = value
+				// 把0变成7
+				value = value.map((ele) => {
+					if (ele == 0) {
+						return ele = 7
+					} else {
+						return ele
+					}
+				})
+				// 从小到大排序
+				value.sort((a, b) => {
+					return a - b
+				})
+				// 把数字转换成星期
+				let arr = ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+				this.selectedWeeks = value.map((ele) => {
+					return ele = arr[ele]
+				})
 			},
+			// 选择时间段回调
 			bindTimeChange(e, val, item) {
-				console.log(e);
-				console.log(val);
-				console.log(item);
 				if (val == 1) {
 					item.startTime = e.detail.value
 				} else {
 					item.endTime = e.detail.value
 				}
 			},
+			// 添加时段回调
 			handleAddTime() {
 				this.list.push({
 					startTime: "00:00",
 					endTime: "00:00",
 				})
 			},
+			// switch改变回调
 			switchChange(e) {
-				console.log('switch1 发生 change 事件,携带值为', e.detail.value)
+				// console.log('switch1 发生 change 事件,携带值为', e.detail.value)
+				this.holiday = e.detail.value
 			},
 			// 点击右侧删除按钮回调
-			onClick(id) {
-				console.log(id);
+			onClick(index) {
+				// console.log(index);
 				uni.showModal({
 					title: '提示',
 					content: '确定删除该打卡时间段吗?',
-					success: function(res) {
+					success: (res) => {
 						if (res.confirm) {
-							console.log('用户点击确定');
+							this.list.splice(index, 1)
 							uni.showToast({
 								title: "删除成功",
 								icon: 'success'
 							})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+						} else if (res.cancel) {}
 					}
 				});
 			},
@@ -312,7 +393,7 @@
 	::v-deep .weeks-outer {
 		border-radius: 10rpx;
 	}
-	
+
 	// 解决左滑区域突出问题
 	::v-deep .uni-swipe_button-group {
 		margin-bottom: 20rpx;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/chocolate-progress-bar/chocolate-progress-bar.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/tki-tree/tki-tree.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/404/404.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/addLocation/addLocation.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/addRules/addRules.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/authentication/authentication.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cardRecord/cardRecord.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/editRules/editRules.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/group/group.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/location/location.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/my.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/particulars/particulars.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/powerSet/powerSet.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchLocation/punchLocation.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchTime/punchTime.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleName/ruleName.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleSet/ruleSet.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/rulesDetail/rulesDetail.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/setPunchTime/setPunchTime.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/stat/stat.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/statDetail/statDetail.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zwx-dropDown/components/zwx-dropDown/zwx-dropDown.js.map


+ 31 - 1
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -10724,7 +10724,37 @@ var myRequest = function myRequest(options) {
         uni.hideLoading();
         resolve(res.data);
         if (res.data.code != 200) {
-          if (res.data.code == 401) {
+          if (res.data.code == 498) {
+            uni.request({
+              url: 'https://www.web-server.top/attendance/api/home/permissions',
+              header: {
+                'content-type': 'application/x-www-form-urlencoded',
+                'Authorization': uni.getStorageSync("token") || 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo1MDQ2LCJ1c2VyX3V1aWQiOjEzNDc3NzE0NzM1NTY5NzE1MiwibmJmIjoxNjcxMTU1ODQzfQ.u4-N762Ijfb9RkuuFOFkeMiJQI9uCi0IaheJlGwi5Ms'
+              },
+              success: function success(res) {
+                if (res.data.code == 200) {
+                  uni.showModal({
+                    title: "提示",
+                    content: "用户权限变更,请重新授权",
+                    showCancel: false,
+                    success: function success(res) {
+                      if (res.confirm) {
+                        uni.reLaunch({
+                          url: "/pages/home/home"
+                        });
+                      }
+                    }
+                  });
+                } else {
+                  uni.showToast({
+                    title: res.data.message,
+                    icon: "error",
+                    mask: true
+                  });
+                }
+              }
+            });
+          } else if (res.data.code == 401) {
             uni.showModal({
               title: "提示",
               content: res.data.message,

+ 9 - 7
unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.js

@@ -320,15 +320,18 @@ var _default = {
     },
     // 选择单个地址时的回调
     handleChoose: function handleChoose(item) {
-      console.log(item);
+      var arr = uni.getStorageSync("chooseList");
+      if (arr) {
+        this.chooseList = uni.getStorageSync("chooseList");
+      }
       this.chooseList.push({
         title: item.title,
         address: item.address,
         scope: this.rangeValue
       });
-      var temList = JSON.stringify(this.chooseList);
-      uni.redirectTo({
-        url: "/pages/punchLocation/punchLocation?temList=".concat(temList)
+      uni.setStorageSync("chooseList", this.chooseList);
+      uni.navigateBack({
+        delta: 1
       });
     },
     // 点击选择打卡范围回调
@@ -337,17 +340,16 @@ var _default = {
       uni.showActionSheet({
         itemList: this.rangeList,
         success: function success(res) {
-          // console.log(res);
           _this3.rangeValue = _this3.rangeList[res.tapIndex];
         }
       });
     },
     // 搜索框失焦回调
-    blur: function blur(res) {
+    handleSearch: function handleSearch(res) {
       var _this4 = this;
       this.placeList = [];
       qqmapsdk.search({
-        keyword: res.value,
+        keyword: res,
         auto_extend: "0",
         success: function success(res) {
           if (res.status == 0) {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.wxml


+ 22 - 4
unpackage/dist/dev/mp-weixin/pages/addRules/addRules.js

@@ -257,6 +257,9 @@ exports.default = void 0;
 //
 //
 //
+//
+//
+//
 var _default = {
   data: function data() {
     return {
@@ -276,12 +279,27 @@ var _default = {
   },
   onLoad: function onLoad() {
     var _this = this;
-    uni.$on('update', function (data) {
-      _this.ruleName = data;
+    uni.$on('updatePunchTime', function (data) {
+      _this.time = data;
     });
   },
-  onUnload: function onUnload() {
-    uni.$off('update');
+  onShow: function onShow() {
+    var ruleName = uni.getStorageSync("ruleName");
+    if (ruleName) {
+      this.ruleName = ruleName;
+    }
+    var ruleGroup = uni.getStorageSync("ruleGroup");
+    if (ruleGroup) {
+      this.group = ruleGroup.join(",");
+    }
+    var temPlace = uni.getStorageSync("chooseList");
+    if (temPlace) {
+      var temList = [];
+      temPlace.forEach(function (ele) {
+        temList.push(ele.title);
+      });
+      this.place = temList.join(",");
+    }
   },
   methods: {
     // 点击确认按钮回调

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxml


+ 3 - 0
unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxss

@@ -32,6 +32,9 @@
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+.container .box .val .ele ._span.data-v-441b8746 {
+  margin-right: 10rpx;
+}
 .container .box .val .black.data-v-441b8746 {
   color: #000;
 }

+ 37 - 9
unpackage/dist/dev/mp-weixin/pages/editRules/editRules.js

@@ -104,18 +104,31 @@ var render = function () {
   var _c = _vm._self._c || _h
   var m0 = __webpack_require__(/*! ../../static/right.png */ 82)
   var m1 = __webpack_require__(/*! ../../static/right.png */ 82)
-  var m2 = __webpack_require__(/*! ../../static/right.png */ 82)
-  var m3 = __webpack_require__(/*! ../../static/right.png */ 82)
+  var l0 = !(_vm.time == "未设置")
+    ? _vm.__map(_vm.periods, function (item, index) {
+        var $orig = _vm.__get_orig(item)
+        var m2 = _vm.format_time(item.beginTime)
+        var m3 = _vm.format_time(item.endTime)
+        return {
+          $orig: $orig,
+          m2: m2,
+          m3: m3,
+        }
+      })
+    : null
   var m4 = __webpack_require__(/*! ../../static/right.png */ 82)
+  var m5 = __webpack_require__(/*! ../../static/right.png */ 82)
+  var m6 = __webpack_require__(/*! ../../static/right.png */ 82)
   _vm.$mp.data = Object.assign(
     {},
     {
       $root: {
         m0: m0,
         m1: m1,
-        m2: m2,
-        m3: m3,
+        l0: l0,
         m4: m4,
+        m5: m5,
+        m6: m6,
       },
     }
   )
@@ -264,6 +277,9 @@ exports.default = void 0;
 //
 //
 //
+//
+//
+//
 var _default = {
   data: function data() {
     return {
@@ -280,17 +296,20 @@ var _default = {
       value: "未设置",
       // 提前通知选项
       array: ['5分钟', '10分钟', '15分钟', '20分钟'],
+      periods: [],
       index: 0
     };
   },
   onLoad: function onLoad(option) {
     var _this = this;
     this.info = JSON.parse(option.info);
-    this.ruleName = this.info.ruleName;
-    this.group = this.info.group;
-    this.time = this.info.time;
-    this.place = this.info.place;
-    this.value = this.info.notes;
+    console.log(this.info);
+    this.ruleName = this.info.name;
+    this.group = this.info.groups;
+    this.time = this.info.temList;
+    this.place = this.info.locations;
+    this.value = this.info.noticeTime;
+    this.periods = this.info.periods;
     uni.$on('update', function (data) {
       _this.ruleName = data;
     });
@@ -355,6 +374,15 @@ var _default = {
       uni.navigateTo({
         url: "/pages/punchLocation/punchLocation"
       });
+    },
+    // 格式化时间
+    format_time: function format_time(timestamp) {
+      //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      var date = new Date(timestamp);
+      var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+      var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
+      var strDate = h + m;
+      return strDate;
     }
   }
 };

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/editRules/editRules.wxml


+ 3 - 0
unpackage/dist/dev/mp-weixin/pages/editRules/editRules.wxss

@@ -32,6 +32,9 @@
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+.container .box .val .ele ._span.data-v-138ca3bc {
+  margin-right: 10rpx;
+}
 .container .box .val .black.data-v-138ca3bc {
   color: #000;
 }

+ 122 - 26
unpackage/dist/dev/mp-weixin/pages/group/group.js

@@ -305,8 +305,7 @@ var _default = {
     },
     // 考勤组选择框取消回调事件
     treeCancel: function treeCancel(e) {
-      console.log(e);
-      console.log("取消");
+      // this.$refs.tkitree._hide()
     },
     // 点击选择考勤组选择框回调
     handleChoose: function handleChoose() {
@@ -317,7 +316,7 @@ var _default = {
           while (1) {
             switch (_context2.prev = _context2.next) {
               case 0:
-                _this2.$refs.tkitree._show();
+                _this2.range = [];
                 _context2.next = 3;
                 return _this2.$myRequest({
                   url: "/attendance/api/settings/org/tree"
@@ -327,6 +326,7 @@ var _default = {
                 // console.log(res);
                 if (res.code == 200) {
                   _this2.range = res.data;
+                  _this2.$refs.tkitree._show();
                 }
               case 5:
               case "end":
@@ -337,7 +337,7 @@ var _default = {
       }))();
     },
     handleChange: function handleChange(item) {
-      console.log(item);
+      // console.log(item);
       item.checked = !item.checked;
     },
     // 点击弹窗保存按钮回调
@@ -369,17 +369,37 @@ var _default = {
                 });
                 return _context3.abrupt("return");
               case 6:
-                if (_this3.group_num) {
+                if (!(_this3.group_total == 0)) {
                   _context3.next = 9;
                   break;
                 }
                 uni.showToast({
-                  title: "请输入打卡人数",
+                  title: "该考勤组范围中人数为0,请重新选择",
                   icon: "none"
                 });
                 return _context3.abrupt("return");
               case 9:
-                _context3.next = 11;
+                if (_this3.group_num) {
+                  _context3.next = 12;
+                  break;
+                }
+                uni.showToast({
+                  title: "请输入打卡人数",
+                  icon: "none"
+                });
+                return _context3.abrupt("return");
+              case 12:
+                if (!(_this3.group_num - 0 > _this3.group_total - 0)) {
+                  _context3.next = 15;
+                  break;
+                }
+                uni.showToast({
+                  title: "打卡人数不能超过总人数",
+                  icon: "none"
+                });
+                return _context3.abrupt("return");
+              case 15:
+                _context3.next = 17;
                 return _this3.$myRequest({
                   url: "/attendance/api/settings/group/add",
                   method: "post",
@@ -394,11 +414,25 @@ var _default = {
                     userOrgList: _this3.userOrgList
                   }
                 });
-              case 11:
+              case 17:
                 res = _context3.sent;
-                console.log(res);
-                _this3.$refs.popup.close();
-              case 14:
+                // console.log(res);
+                if (res.code == 200) {
+                  _this3.$refs.popup.close();
+                  uni.showToast({
+                    title: "添加成功",
+                    icon: "none"
+                  });
+                  setTimeout(function () {
+                    _this3.getGroupData();
+                  }, 1500);
+                } else {
+                  uni.showToast({
+                    title: res.message,
+                    icon: "none"
+                  });
+                }
+              case 19:
               case "end":
                 return _context3.stop();
             }
@@ -412,42 +446,104 @@ var _default = {
     },
     // 点击新增考勤组按钮回调
     handleAdd: function handleAdd() {
+      var _this4 = this;
       this.group_name = "";
       this.group_num = null;
       this.group_total = 0;
+      this.group_scope = "";
       this.userOrgList = [];
-      this.$refs.popup.open();
+      this.$nextTick(function () {
+        _this4.$refs.popup.open();
+      });
     },
     // 点击关联考勤组按钮回调
     handleRelevancy: function handleRelevancy() {
-      console.log(456);
+      var temList = [];
+      this.list.forEach(function (ele) {
+        if (ele.checked == true) {
+          temList.push(ele.name);
+        }
+      });
+      if (temList.length == 0) {
+        uni.showToast({
+          title: "请先勾选考勤组",
+          icon: "none"
+        });
+      } else {
+        uni.setStorageSync("ruleGroup", temList);
+        uni.navigateBack({
+          delta: 1
+        });
+      }
     },
     // 点击树状节点回调
     nodechange: function nodechange(ref) {
-      var _this4 = this;
+      var _this5 = this;
       this.$nextTick(function () {
         setTimeout(function () {
-          _this4.$refs[ref][0].resize();
+          _this5.$refs[ref][0].resize();
         }, 200);
       });
     },
     // 点击右侧删除按钮回调
     onClick: function onClick(id) {
-      console.log(id);
+      var _this6 = this;
+      // console.log(id);
       uni.showModal({
         title: '提示',
         content: '确定删除该考勤组吗?',
-        success: function success(res) {
-          if (res.confirm) {
-            console.log('用户点击确定');
-            uni.showToast({
-              title: "删除成功",
-              icon: 'success'
-            });
-          } else if (res.cancel) {
-            console.log('用户点击取消');
+        success: function () {
+          var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(res) {
+            var _res;
+            return _regenerator.default.wrap(function _callee4$(_context4) {
+              while (1) {
+                switch (_context4.prev = _context4.next) {
+                  case 0:
+                    if (!res.confirm) {
+                      _context4.next = 7;
+                      break;
+                    }
+                    _context4.next = 3;
+                    return _this6.$myRequest({
+                      url: "/attendance/api/settings/group/delete",
+                      method: "delete",
+                      data: {
+                        ids: [id]
+                      }
+                    });
+                  case 3:
+                    _res = _context4.sent;
+                    // console.log(res);
+                    if (_res.code == 200) {
+                      uni.showToast({
+                        title: "删除成功",
+                        icon: 'success'
+                      });
+                      setTimeout(function () {
+                        _this6.getGroupData();
+                      }, 1500);
+                    } else {
+                      uni.showToast({
+                        title: _res.message,
+                        icon: 'success'
+                      });
+                    }
+                    _context4.next = 8;
+                    break;
+                  case 7:
+                    if (res.cancel) {}
+                  case 8:
+                  case "end":
+                    return _context4.stop();
+                }
+              }
+            }, _callee4);
+          }));
+          function success(_x) {
+            return _success.apply(this, arguments);
           }
-        }
+          return success;
+        }()
       });
     },
     // 清除搜索框内容时的回调

+ 3 - 0
unpackage/dist/dev/mp-weixin/pages/group/group.wxss

@@ -119,6 +119,9 @@
   padding-left: 24rpx;
   flex: 5;
   font-size: 28rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
 }
 .container .popup_box .body .scope .icon.data-v-d900f0f4 {
   flex: 1;

+ 11 - 9
unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.js

@@ -256,9 +256,11 @@ var _default = {
       }]
     };
   },
-  onLoad: function onLoad(options) {
-    if (options.temList) {
-      this.list = JSON.parse(options.temList);
+  onLoad: function onLoad() {},
+  onShow: function onShow() {
+    var arr = uni.getStorageSync("chooseList");
+    if (arr) {
+      this.list = arr;
     }
   },
   methods: {
@@ -289,21 +291,21 @@ var _default = {
       });
     },
     // 点击右侧删除按钮回调
-    onClick: function onClick(id) {
-      console.log(id);
+    onClick: function onClick(index) {
+      var _this = this;
+      console.log(index);
       uni.showModal({
         title: '提示',
         content: '确定删除该打卡位置吗?',
         success: function success(res) {
           if (res.confirm) {
-            console.log('用户点击确定');
+            _this.list.splice(index, 1);
+            uni.setStorageSync("chooseList", _this.list);
             uni.showToast({
               title: "删除成功",
               icon: 'success'
             });
-          } else if (res.cancel) {
-            console.log('用户点击取消');
-          }
+          } else if (res.cancel) {}
         }
       });
     }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.wxml


+ 36 - 23
unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.js

@@ -226,26 +226,33 @@ exports.default = void 0;
 //
 //
 //
+//
+//
 var _default = {
   data: function data() {
     return {
-      list: [{
-        id: 1,
-        week: "周一,周二,周三,周四,周五,周六,周日",
-        time: "09:00-17:00、20:00-21:00、22:00-23:00"
-      }, {
-        id: 2,
-        week: "周一,周二,周三,周四,周五,周六,周日",
-        time: "09:00-17:00"
-      }, {
-        id: 3,
-        week: "周一,周二,周三,周四,周五,周六,周日",
-        time: "12:00-17:00"
-      }, {
-        id: 4,
-        week: "周一,周二,周三,周四,周五,周六,周日",
-        time: "09:00-17:00、20:00-21:00、22:00-23:00"
-      }],
+      list: [
+        // {
+        // 	id: 1,
+        // 	week: "周一,周二,周三,周四,周五,周六,周日",
+        // 	time: "09:00-17:00、20:00-21:00、22:00-23:00"
+        // },
+        // {
+        // 	id: 2,
+        // 	week: "周一,周二,周三,周四,周五,周六,周日",
+        // 	time: "09:00-17:00"
+        // },
+        // {
+        // 	id: 3,
+        // 	week: "周一,周二,周三,周四,周五,周六,周日",
+        // 	time: "12:00-17:00"
+        // },
+        // {
+        // 	id: 4,
+        // 	week: "周一,周二,周三,周四,周五,周六,周日",
+        // 	time: "09:00-17:00、20:00-21:00、22:00-23:00"
+        // },
+      ],
       options: [{
         text: '删除',
         style: {
@@ -254,6 +261,12 @@ var _default = {
       }]
     };
   },
+  onShow: function onShow() {
+    var ruleTime = uni.getStorageSync("ruleTime");
+    if (ruleTime) {
+      this.list = ruleTime;
+    }
+  },
   methods: {
     // 点击添加打卡时间回调 跳转到添加页面
     handleAdd: function handleAdd() {
@@ -269,21 +282,21 @@ var _default = {
       });
     },
     // 点击右侧删除按钮回调
-    onClick: function onClick(id) {
-      console.log(id);
+    onClick: function onClick(index) {
+      var _this = this;
+      // console.log(index);
       uni.showModal({
         title: '提示',
         content: '确定删除该打卡时间吗?',
         success: function success(res) {
           if (res.confirm) {
-            console.log('用户点击确定');
             uni.showToast({
               title: "删除成功",
               icon: 'success'
             });
-          } else if (res.cancel) {
-            console.log('用户点击取消');
-          }
+            _this.list.splice(index, 1);
+            uni.setStorageSync("ruleTime", _this.list);
+          } else if (res.cancel) {}
         }
       });
     }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/ruleName/ruleName.js

@@ -193,7 +193,7 @@ var _default = {
           icon: 'none'
         });
       } else {
-        uni.$emit('update', this.name);
+        uni.setStorageSync("ruleName", this.name);
         uni.navigateBack({
           delta: 1
         });

+ 94 - 22
unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.js

@@ -105,6 +105,23 @@ var render = function () {
   var m0 = __webpack_require__(/*! ../../static/add.png */ 71)
   var m1 = __webpack_require__(/*! ../../static/my1.png */ 104)
   var m2 = __webpack_require__(/*! ../../static/right.png */ 82)
+  var l1 = _vm.__map(_vm.list, function (item, __i0__) {
+    var $orig = _vm.__get_orig(item)
+    var l0 = _vm.__map(item.periods, function (time_item, index) {
+      var $orig = _vm.__get_orig(time_item)
+      var m3 = _vm.format_time(time_item.beginTime)
+      var m4 = _vm.format_time(time_item.endTime)
+      return {
+        $orig: $orig,
+        m3: m3,
+        m4: m4,
+      }
+    })
+    return {
+      $orig: $orig,
+      l0: l0,
+    }
+  })
   _vm.$mp.data = Object.assign(
     {},
     {
@@ -112,6 +129,7 @@ var render = function () {
         m0: m0,
         m1: m1,
         m2: m2,
+        l1: l1,
       },
     }
   )
@@ -150,10 +168,16 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 /* WEBPACK VAR INJECTION */(function(uni) {
 
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.default = void 0;
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 39));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 41));
+//
+//
+//
 //
 //
 //
@@ -206,31 +230,70 @@ exports.default = void 0;
 var _default = {
   data: function data() {
     return {
-      list: [{
-        id: 1,
-        group: "全体老师",
-        time: "周一、周二、周三、...,09:00-17:00",
-        place: "新建区南昌交通学院",
-        notes: "提前15分钟通知",
-        ruleName: "课间操打卡规则"
-      }, {
-        id: 2,
-        group: "全体同学",
-        time: "周一、周二、周三、...,09:00-17:00",
-        place: "高新区南昌交通学院",
-        notes: "提前10分钟通知",
-        ruleName: "课间操打卡规则"
-      }, {
-        id: 3,
-        group: "全体老师同学",
-        time: "周一、周二、周三、...,09:00-17:00",
-        place: "红谷滩区南昌交通学院",
-        notes: "提前5分钟通知",
-        ruleName: "课间操打卡规则"
-      }]
+      list: []
     };
   },
+  onShow: function onShow() {
+    var chooseList = uni.getStorageSync('chooseList');
+    if (chooseList) {
+      uni.showModal({
+        title: '提示',
+        content: '上一个页面有未保存的数据,确定不保存吗?',
+        cancelText: '返回上页',
+        success: function success(res) {
+          if (res.confirm) {
+            uni.removeStorageSync('chooseList');
+          } else if (res.cancel) {
+            uni.navigateTo({
+              url: "/pages/addRules/addRules"
+            });
+          }
+        }
+      });
+    }
+  },
+  onLoad: function onLoad() {
+    this.getRuleList();
+  },
   methods: {
+    // 获取打卡规则列表数据
+    getRuleList: function getRuleList() {
+      var _this = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
+        var res;
+        return _regenerator.default.wrap(function _callee$(_context) {
+          while (1) {
+            switch (_context.prev = _context.next) {
+              case 0:
+                _context.next = 2;
+                return _this.$myRequest({
+                  url: "/attendance/api/settings/rule/list"
+                });
+              case 2:
+                res = _context.sent;
+                // console.log(res);
+                if (res.code == 200) {
+                  _this.list = res.data.list;
+                  _this.list.forEach(function (ele) {
+                    ele.groups = ele.groups.join(",");
+                    ele.locations = ele.locations.join(",");
+                    ele.dayOfWeeks.sort(function (a, b) {
+                      return a - b;
+                    });
+                    var arr = ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"];
+                    ele.temList = ele.dayOfWeeks.map(function (item) {
+                      return item = arr[item];
+                    });
+                  });
+                }
+              case 4:
+              case "end":
+                return _context.stop();
+            }
+          }
+        }, _callee);
+      }))();
+    },
     // 点击每一项跳转编辑规则页面
     toPageEditRules: function toPageEditRules(item) {
       // console.log(item);
@@ -244,6 +307,15 @@ var _default = {
       uni.navigateTo({
         url: "/pages/addRules/addRules"
       });
+    },
+    // 格式化时间
+    format_time: function format_time(timestamp) {
+      //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      var date = new Date(timestamp);
+      var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+      var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
+      var strDate = h + m;
+      return strDate;
     }
   }
 };

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxml


+ 7 - 0
unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxss

@@ -67,10 +67,17 @@
   height: 25rpx;
 }
 .container .rules .box .box_info.data-v-43e6b094 {
+  display: flex;
   margin: 15rpx 0;
   height: 44rpx;
   font-size: 30rpx;
   font-weight: 400;
   color: #808080;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.container .rules .box .box_info ._span.data-v-43e6b094 {
+  margin-right: 10rpx;
 }
 

+ 103 - 20
unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.js

@@ -192,15 +192,18 @@ var _default = {
   },
   data: function data() {
     return {
+      // 选中的星期
       selectedWeeks: [],
+      // 打卡时间段列表
       list: [{
         startTime: "00:00",
         endTime: "00:00"
-      }, {
-        startTime: "00:00",
-        endTime: "00:00"
       }],
+      // 是否同步法定节假日
+      holiday: false,
+      // 编辑打卡时间页面带过来的对象
       info: {},
+      // 左滑配置
       options: [{
         text: '删除',
         style: {
@@ -218,54 +221,134 @@ var _default = {
       uni.setNavigationBarTitle({
         title: '编辑打卡时间'
       });
-      this.selectedWeeks = [0, 1];
-      // this.info=JSON.parse(options.info)
+      this.info = JSON.parse(options.info);
       // console.log(this.info);
-      // let temList=this.info.time.split("、")
-      // console.log(temList);
+      this.list = this.info.list;
+      this.holiday = this.info.holiday;
+      this.selectedWeeks = this.info.selectedWeeks.map(function (ele) {
+        if (ele == '星期一') {
+          return ele = 1;
+        }
+        if (ele == '星期二') {
+          return ele = 2;
+        }
+        if (ele == '星期三') {
+          return ele = 3;
+        }
+        if (ele == '星期四') {
+          return ele = 4;
+        }
+        if (ele == '星期五') {
+          return ele = 5;
+        }
+        if (ele == '星期六') {
+          return ele = 6;
+        }
+        if (ele == '星期天') {
+          return ele = 0;
+        }
+      });
     }
   },
-
   methods: {
+    // 保存按钮回调
+    handleSave: function handleSave() {
+      var _this = this;
+      if (!this.selectedWeeks.length) {
+        uni.showToast({
+          title: "请选择需要打卡的星期",
+          icon: 'none'
+        });
+        return;
+      }
+      if (!this.list.length) {
+        uni.showToast({
+          title: "请添加需要打卡的时间段",
+          icon: 'none'
+        });
+        return;
+      }
+      uni.showModal({
+        title: '提示',
+        content: '确定保存吗?',
+        success: function success(res) {
+          if (res.confirm) {
+            uni.showToast({
+              title: "保存成功",
+              icon: 'success'
+            });
+            setTimeout(function () {
+              var temList = uni.getStorageSync("ruleTime") || [];
+              // console.log(temList);
+              temList.push({
+                selectedWeeks: _this.selectedWeeks,
+                list: _this.list,
+                holiday: _this.holiday
+              });
+              uni.setStorageSync("ruleTime", temList);
+              uni.navigateBack({
+                delta: 1
+              });
+            }, 1500);
+          } else if (res.cancel) {}
+        }
+      });
+    },
+    // 选择星期回调
     changeWeek: function changeWeek(value) {
-      console.log(value);
-      this.selectedWeeks = value;
+      // 把0变成7
+      value = value.map(function (ele) {
+        if (ele == 0) {
+          return ele = 7;
+        } else {
+          return ele;
+        }
+      });
+      // 从小到大排序
+      value.sort(function (a, b) {
+        return a - b;
+      });
+      // 把数字转换成星期
+      var arr = ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"];
+      this.selectedWeeks = value.map(function (ele) {
+        return ele = arr[ele];
+      });
     },
+    // 选择时间段回调
     bindTimeChange: function bindTimeChange(e, val, item) {
-      console.log(e);
-      console.log(val);
-      console.log(item);
       if (val == 1) {
         item.startTime = e.detail.value;
       } else {
         item.endTime = e.detail.value;
       }
     },
+    // 添加时段回调
     handleAddTime: function handleAddTime() {
       this.list.push({
         startTime: "00:00",
         endTime: "00:00"
       });
     },
+    // switch改变回调
     switchChange: function switchChange(e) {
-      console.log('switch1 发生 change 事件,携带值为', e.detail.value);
+      // console.log('switch1 发生 change 事件,携带值为', e.detail.value)
+      this.holiday = e.detail.value;
     },
     // 点击右侧删除按钮回调
-    onClick: function onClick(id) {
-      console.log(id);
+    onClick: function onClick(index) {
+      var _this2 = this;
+      // console.log(index);
       uni.showModal({
         title: '提示',
         content: '确定删除该打卡时间段吗?',
         success: function success(res) {
           if (res.confirm) {
-            console.log('用户点击确定');
+            _this2.list.splice(index, 1);
             uni.showToast({
               title: "删除成功",
               icon: 'success'
             });
-          } else if (res.cancel) {
-            console.log('用户点击取消');
-          }
+          } else if (res.cancel) {}
         }
       });
     }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.wxml


+ 7 - 0
unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -41,6 +41,13 @@
                     "query": "flag=1",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/ruleSet/ruleSet",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 33 - 2
util/api.js

@@ -12,7 +12,7 @@ export const myRequest = (options) => {
 			url: BASE_URL + options.url,
 			method: options.method || "GET",
 			data: options.data || {},
-			header: options.header||{
+			header: options.header || {
 				'content-type': 'application/x-www-form-urlencoded',
 				'Authorization': uni.getStorageSync("token") ||
 					'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo1MDQ2LCJ1c2VyX3V1aWQiOjEzNDc3NzE0NzM1NTY5NzE1MiwibmJmIjoxNjcxMTU1ODQzfQ.u4-N762Ijfb9RkuuFOFkeMiJQI9uCi0IaheJlGwi5Ms'
@@ -21,7 +21,38 @@ export const myRequest = (options) => {
 				uni.hideLoading();
 				resolve(res.data)
 				if (res.data.code != 200) {
-					if (res.data.code == 401) {
+					if (res.data.code == 498) {
+						uni.request({
+							url: 'https://www.web-server.top/attendance/api/home/permissions',
+							header: {
+								'content-type': 'application/x-www-form-urlencoded',
+								'Authorization': uni.getStorageSync("token") ||
+									'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo1MDQ2LCJ1c2VyX3V1aWQiOjEzNDc3NzE0NzM1NTY5NzE1MiwibmJmIjoxNjcxMTU1ODQzfQ.u4-N762Ijfb9RkuuFOFkeMiJQI9uCi0IaheJlGwi5Ms'
+							},
+							success: (res) => {
+								if (res.data.code == 200) {
+									uni.showModal({
+										title: "提示",
+										content: "用户权限变更,请重新授权",
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.reLaunch({
+													url: "/pages/home/home",
+												});
+											}
+										},
+									});
+								} else {
+									uni.showToast({
+										title: res.data.message,
+										icon: "error",
+										mask: true,
+									});
+								}
+							}
+						});
+					} else if (res.data.code == 401) {
 						uni.showModal({
 							title: "提示",
 							content: res.data.message,