MS-CIAZDCOIXVRW\Administrator 3 tahun lalu
induk
melakukan
983c8db9b0
59 mengubah file dengan 633 tambahan dan 263 penghapusan
  1. 5 2
      pages/addLocation/addLocation.vue
  2. 135 17
      pages/addRules/addRules.vue
  3. 54 25
      pages/editRules/editRules.vue
  4. 12 3
      pages/group/group.vue
  5. 3 22
      pages/punchLocation/punchLocation.vue
  6. 6 27
      pages/punchTime/punchTime.vue
  7. 10 2
      pages/ruleName/ruleName.vue
  8. 16 7
      pages/ruleSet/ruleSet.vue
  9. 23 7
      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/components/chocolate-progress-bar/chocolate-progress-bar.js.map
  12. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/tki-tree/tki-tree.js.map
  13. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/404/404.js.map
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/addLocation/addLocation.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/addRules/addRules.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/authentication/authentication.js.map
  17. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cardRecord/cardRecord.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/editRules/editRules.js.map
  19. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/group/group.js.map
  20. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map
  21. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/location/location.js.map
  22. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/my.js.map
  23. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/particulars/particulars.js.map
  24. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/powerSet/powerSet.js.map
  25. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchLocation/punchLocation.js.map
  26. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchTime/punchTime.js.map
  27. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleName/ruleName.js.map
  28. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleSet/ruleSet.js.map
  29. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/rulesDetail/rulesDetail.js.map
  30. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/setPunchTime/setPunchTime.js.map
  31. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/stat/stat.js.map
  32. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/statDetail/statDetail.js.map
  33. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.js.map
  34. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.js.map
  35. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.js.map
  36. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map
  37. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map
  38. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js.map
  39. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map
  40. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map
  41. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js.map
  42. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js.map
  43. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js.map
  44. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zwx-dropDown/components/zwx-dropDown/zwx-dropDown.js.map
  45. 5 5
      unpackage/dist/dev/mp-weixin/common/vendor.js
  46. 5 2
      unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.js
  47. 163 18
      unpackage/dist/dev/mp-weixin/pages/addRules/addRules.js
  48. 1 1
      unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxml
  49. 81 24
      unpackage/dist/dev/mp-weixin/pages/editRules/editRules.js
  50. 12 3
      unpackage/dist/dev/mp-weixin/pages/group/group.js
  51. 1 20
      unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.js
  52. 1 1
      unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.wxml
  53. 12 24
      unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.js
  54. 1 1
      unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.wxml
  55. 10 2
      unpackage/dist/dev/mp-weixin/pages/ruleName/ruleName.js
  56. 15 4
      unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.js
  57. 1 1
      unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxml
  58. 24 8
      unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.js
  59. 2 2
      unpackage/dist/dev/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.json

+ 5 - 2
pages/addLocation/addLocation.vue

@@ -145,14 +145,17 @@
 			},
 			},
 			// 选择单个地址时的回调
 			// 选择单个地址时的回调
 			handleChoose(item) {
 			handleChoose(item) {
+				// console.log(item);
 				let arr = uni.getStorageSync("chooseList")
 				let arr = uni.getStorageSync("chooseList")
 				if (arr) {
 				if (arr) {
 					this.chooseList = uni.getStorageSync("chooseList")
 					this.chooseList = uni.getStorageSync("chooseList")
 				}
 				}
 				this.chooseList.push({
 				this.chooseList.push({
-					title: item.title,
+					name: item.title,
 					address: item.address,
 					address: item.address,
-					scope: this.rangeValue
+					radius: this.rangeValue,
+					lat: item.location.lat,
+					lng: item.location.lng,
 				})
 				})
 				uni.setStorageSync("chooseList", this.chooseList)
 				uni.setStorageSync("chooseList", this.chooseList)
 				uni.navigateBack({
 				uni.navigateBack({

+ 135 - 17
pages/addRules/addRules.vue

@@ -44,9 +44,13 @@
 					{{time}}
 					{{time}}
 				</view>
 				</view>
 				<view class="ele black" v-else>
 				<view class="ele black" v-else>
-					<span>{{time.selectedWeeks}}</span>
-					<span v-for="(item,index) in time.list" :key="index">
-						{{item.startTime}}-{{item.endTime}}
+					<span v-for="(item,index) in time" :key="index">
+						<span v-for="(item_week,index_week) in item.selectedWeeks" :key="index_week">
+							{{item_week}}
+						</span>
+						<span v-for="(item_time,index_time) in item.list" :key="index_time">
+							{{item_time.startTime}}-{{item_time.endTime}}
+						</span>
 					</span>
 					</span>
 				</view>
 				</view>
 				<view class="right">
 				<view class="right">
@@ -82,7 +86,7 @@
 						{{value}}
 						{{value}}
 					</view>
 					</view>
 					<view class="ele black" v-else>
 					<view class="ele black" v-else>
-						{{value}}
+						{{value}}分钟
 					</view>
 					</view>
 					<view class="right">
 					<view class="right">
 						<img src="../../static/right.png">
 						<img src="../../static/right.png">
@@ -112,17 +116,18 @@
 				time: "未设置",
 				time: "未设置",
 				// 打卡地点
 				// 打卡地点
 				place: "未设置",
 				place: "未设置",
-				// 提前通知
+				// 提前通知时间
 				value: "未设置",
 				value: "未设置",
+				// 提前通知时间选择数组
 				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
 				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
+				// 提前通知时间选择数组默认选择的索引
 				index: 0,
 				index: 0,
+				groupIds: [],
+				timeGroups: [],
+				locations: []
 			};
 			};
 		},
 		},
-		onLoad() {
-			uni.$on('updatePunchTime', (data) => {
-				this.time = data
-			})
-		},
+		onLoad() {},
 		onShow() {
 		onShow() {
 			let ruleName = uni.getStorageSync("ruleName")
 			let ruleName = uni.getStorageSync("ruleName")
 			if (ruleName) {
 			if (ruleName) {
@@ -131,17 +136,67 @@
 
 
 			let ruleGroup = uni.getStorageSync("ruleGroup")
 			let ruleGroup = uni.getStorageSync("ruleGroup")
 			if (ruleGroup) {
 			if (ruleGroup) {
-				this.group = ruleGroup.join(",")
+				let temList = []
+				this.groupIds = []
+				ruleGroup.forEach((ele) => {
+					temList.push(ele.name)
+					this.groupIds.push(ele.id)
+				})
+				this.group = temList.join(",")
+			}
+
+			let ruleTime = uni.getStorageSync("ruleTime")
+			if (ruleTime) {
+				this.time = ruleTime
+				let temList = []
+				ruleTime.forEach((ele) => {
+					temList.push({
+						dayOfWeeks: ele.selectedWeeks,
+						periods: ele.list
+					})
+				})
+				temList.forEach((item) => {
+					item.dayOfWeeks = item.dayOfWeeks.map((element) => {
+						if (element == '星期一') {
+							return element = 1
+						}
+						if (element == '星期二') {
+							return element = 2
+						}
+						if (element == '星期三') {
+							return element = 3
+						}
+						if (element == '星期四') {
+							return element = 4
+						}
+						if (element == '星期五') {
+							return element = 5
+						}
+						if (element == '星期六') {
+							return element = 6
+						}
+						if (element == '星期天') {
+							return element = 7
+						}
+					})
+				})
+				this.timeGroups = temList
 			}
 			}
 
 
 			let temPlace = uni.getStorageSync("chooseList")
 			let temPlace = uni.getStorageSync("chooseList")
 			if (temPlace) {
 			if (temPlace) {
+				this.locations = temPlace
 				let temList = []
 				let temList = []
 				temPlace.forEach((ele) => {
 				temPlace.forEach((ele) => {
-					temList.push(ele.title)
+					temList.push(ele.name)
 				})
 				})
 				this.place = temList.join(",")
 				this.place = temList.join(",")
 			}
 			}
+
+			let ruleValue = uni.getStorageSync("ruleValue")
+			if (ruleValue) {
+				this.value = ruleValue
+			}
 		},
 		},
 		methods: {
 		methods: {
 			// 点击确认按钮回调
 			// 点击确认按钮回调
@@ -189,12 +244,64 @@
 				uni.showModal({
 				uni.showModal({
 					title: '提示',
 					title: '提示',
 					content: '确定新增吗?',
 					content: '确定新增吗?',
-					success: function(res) {
+					success: async (res) => {
 						if (res.confirm) {
 						if (res.confirm) {
-							console.log('用户点击确定');
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+							let temList = []
+							this.timeGroups.forEach((ele) => {
+								ele.periods.forEach((item) => {
+									temList.push({
+										beginTime: this.formatTime(item.startTime),
+										endTime: this.formatTime(item.endTime)
+									})
+								})
+								ele.periods = temList
+							})
+							let res = await this.$myRequest({
+								url: "/attendance/api/settings/rule/add",
+								method: "post",
+								header: {
+									'Authorization': uni.getStorageSync("token") ||
+										'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo1MDQ2LCJ1c2VyX3V1aWQiOjEzNDc3NzE0NzM1NTY5NzE1MiwibmJmIjoxNjcxMTU1ODQzfQ.u4-N762Ijfb9RkuuFOFkeMiJQI9uCi0IaheJlGwi5Ms'
+								},
+								data: {
+									// 是否需要人脸识别
+									faceRecognition: true,
+									// 考勤组ID列表
+									groupIds: this.groupIds,
+									// 是否同步节假日
+									holiday: true,
+									// 是否可选择本地图片
+									localPicture: false,
+									// 规则名称
+									name: this.ruleName,
+									// 提前通知时间
+									noticeTime: this.value,
+									// 是否需要场景拍照
+									takePicture: true,
+									// 打卡地点列表
+									locations: this.locations,
+									// 打卡时间列表
+									timeGroups: this.timeGroups
+								},
+							})
+							// console.log(res)
+							if (res.code == 200) {
+								uni.showToast({
+									title: "添加成功",
+									icon: 'success'
+								})
+								uni.removeStorageSync('ruleName');
+								uni.removeStorageSync('ruleGroup');
+								uni.removeStorageSync('ruleTime');
+								uni.removeStorageSync('chooseList');
+								uni.removeStorageSync('ruleValue');
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1
+									})
+								}, 1500)
+							}
+						} else if (res.cancel) {}
 					}
 					}
 				});
 				});
 			},
 			},
@@ -202,6 +309,9 @@
 			changeSelect(e) {
 			changeSelect(e) {
 				let index = e.detail.value
 				let index = e.detail.value
 				this.value = this.array[index]
 				this.value = this.array[index]
+				let index2 = this.value.indexOf("分", 0)
+				this.value = this.value.substring(0, index2);
+				uni.setStorageSync("ruleValue", this.value)
 			},
 			},
 			// 点击规则名称跳转回调
 			// 点击规则名称跳转回调
 			goPageRuleName() {
 			goPageRuleName() {
@@ -226,6 +336,14 @@
 				uni.navigateTo({
 				uni.navigateTo({
 					url: "/pages/punchLocation/punchLocation"
 					url: "/pages/punchLocation/punchLocation"
 				})
 				})
+			},
+			// 格式化时间
+			formatTime(val) {
+				let tem = '2021-11-22 ' + val + ':00'
+				// console.log(tem);
+				let date = new Date(tem);
+				let time = date.getTime();
+				return time
 			}
 			}
 		}
 		}
 	}
 	}

+ 54 - 25
pages/editRules/editRules.vue

@@ -126,26 +126,40 @@
 				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
 				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
 				periods: [],
 				periods: [],
 				index: 0,
 				index: 0,
+				id: ""
 			};
 			};
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
-			this.info = JSON.parse(option.info)
-			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', (data) => {
+			uni.$on('updateRuleName', (data) => {
 				this.ruleName = data
 				this.ruleName = data
 			})
 			})
-		},
+			uni.$on('updateGroup', (data) => {
+				let temList = []
+				data.forEach((ele) => {
+					temList.push(ele.name)
+				})
+				this.group = temList.join(",")
+			})
+
 
 
-		onUnload() {
-			uni.$off('update')
+			this.info = JSON.parse(option.info)
+			console.log(this.info);
+			if (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
+				this.id = this.info.id
+
+				let ruleTime = []
+				ruleTime.push({
+					selectedWeeks: this.time,
+					list: this.periods
+				})
+				uni.setStorageSync("ruleTime", ruleTime)
+			}
 		},
 		},
 		methods: {
 		methods: {
 			// 点击确认按钮回调
 			// 点击确认按钮回调
@@ -153,12 +167,12 @@
 				uni.showModal({
 				uni.showModal({
 					title: '提示',
 					title: '提示',
 					content: '确定修改吗?',
 					content: '确定修改吗?',
-					success: function(res) {
+					success: (res) => {
 						if (res.confirm) {
 						if (res.confirm) {
+
 							console.log('用户点击确定');
 							console.log('用户点击确定');
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+
+						} else if (res.cancel) {}
 					}
 					}
 				});
 				});
 			},
 			},
@@ -167,12 +181,27 @@
 				uni.showModal({
 				uni.showModal({
 					title: '提示',
 					title: '提示',
 					content: '确定删除吗?',
 					content: '确定删除吗?',
-					success: function(res) {
+					success: async (res) => {
 						if (res.confirm) {
 						if (res.confirm) {
-							console.log('用户点击确定');
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
+							let res = await this.$myRequest({
+								url: "/attendance/api/settings/rule/delete",
+								method: "delete",
+								data: {
+									ids: [this.id]
+								}
+							})
+							// console.log(res);
+							if (res.code == 200) {
+								uni.showToast({
+									title: "删除成功"
+								})
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1
+									})
+								}, 1500)
+							}
+						} else if (res.cancel) {}
 					}
 					}
 				});
 				});
 			},
 			},
@@ -184,13 +213,13 @@
 			// 点击规则名称跳转回调
 			// 点击规则名称跳转回调
 			goPageRuleName() {
 			goPageRuleName() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: "/pages/ruleName/ruleName"
+					url: `/pages/ruleName/ruleName?flag=1`
 				})
 				})
 			},
 			},
 			// 点击考勤组跳转回调
 			// 点击考勤组跳转回调
 			goPageGroup() {
 			goPageGroup() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pages/group/group?flag=2`
+					url: `/pages/group/group?flag=2&type=edit`
 				})
 				})
 			},
 			},
 			// 点击打卡时间跳转回调
 			// 点击打卡时间跳转回调

+ 12 - 3
pages/group/group.vue

@@ -149,11 +149,13 @@
 				}],
 				}],
 				// 考勤组列表数据
 				// 考勤组列表数据
 				list: [],
 				list: [],
-				range: []
+				range: [],
+				type: ""
 			};
 			};
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
 			this.flag = options.flag
 			this.flag = options.flag
+			this.type = options.type
 			if (this.flag == 1) {
 			if (this.flag == 1) {
 				this.checkStatus = true
 				this.checkStatus = true
 			}
 			}
@@ -310,7 +312,10 @@
 				let temList = []
 				let temList = []
 				this.list.forEach((ele) => {
 				this.list.forEach((ele) => {
 					if (ele.checked == true) {
 					if (ele.checked == true) {
-						temList.push(ele.name)
+						temList.push({
+							name: ele.name,
+							id: ele.id
+						})
 					}
 					}
 				})
 				})
 				if (temList.length == 0) {
 				if (temList.length == 0) {
@@ -319,7 +324,11 @@
 						icon: "none"
 						icon: "none"
 					})
 					})
 				} else {
 				} else {
-					uni.setStorageSync("ruleGroup", temList)
+					if (this.type == "edit") {
+						uni.$emit('updateGroup', temList)
+					} else {
+						uni.setStorageSync("ruleGroup", temList)
+					}
 					uni.navigateBack({
 					uni.navigateBack({
 						delta: 1
 						delta: 1
 					})
 					})

+ 3 - 22
pages/punchLocation/punchLocation.vue

@@ -24,13 +24,13 @@
 						</view>
 						</view>
 						<view class="place">
 						<view class="place">
 							<view class="top">
 							<view class="top">
-								{{item.title}}
+								{{item.name}}
 							</view>
 							</view>
 							<view class="center">
 							<view class="center">
 								地址:{{item.address}}
 								地址:{{item.address}}
 							</view>
 							</view>
 							<view class="bottom">
 							<view class="bottom">
-								范围:{{item.scope}}米
+								范围:{{item.radius}}米
 							</view>
 							</view>
 						</view>
 						</view>
 						<view class="right">
 						<view class="right">
@@ -47,26 +47,7 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				list: [
-					// {
-					// 	id: 1,
-					// 	title: "操场",
-					// 	place: "江西省南昌市经开区广兰大道899号",
-					// 	scope: "300米"
-					// },
-					// {
-					// 	id: 2,
-					// 	title: "操场",
-					// 	place: "江西省南昌市经开区广兰大道899号",
-					// 	scope: "400米"
-					// },
-					// {
-					// 	id: 3,
-					// 	title: "操场",
-					// 	place: "江西省南昌市经开区广兰大道899号",
-					// 	scope: "500米"
-					// }
-				],
+				list: [],
 				options: [{
 				options: [{
 					text: '删除',
 					text: '删除',
 					style: {
 					style: {

+ 6 - 27
pages/punchTime/punchTime.vue

@@ -17,14 +17,14 @@
 				<!-- 每一个时间段区域 -->
 				<!-- 每一个时间段区域 -->
 				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
 				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
 					v-for="(item,index) in list" :key="index">
 					v-for="(item,index) in list" :key="index">
-					<view class="box" @click="handleEdit(item)">
+					<view class="box" @click="handleEdit(item,index)">
 						<view class="left">
 						<view class="left">
 							<view class="week">
 							<view class="week">
 								<view class="key">
 								<view class="key">
 									星期
 									星期
 								</view>
 								</view>
 								<view class="value">
 								<view class="value">
-									{{item.selectedWeeks}}
+									{{(item.selectedWeeks).join(",")}}
 								</view>
 								</view>
 							</view>
 							</view>
 							<view class="week">
 							<view class="week">
@@ -33,7 +33,7 @@
 								</view>
 								</view>
 								<view class="value">
 								<view class="value">
 									<span v-for="(item_time,index_time) in item.list" :key="index_time">
 									<span v-for="(item_time,index_time) in item.list" :key="index_time">
-										{{item_time.startTime}}-{{item_time.endTime}}
+										{{item_time.startTime||item_time.beginTime}}-{{item_time.endTime}}
 									</span>
 									</span>
 								</view>
 								</view>
 							</view>
 							</view>
@@ -52,28 +52,7 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			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: [],
 				options: [{
 				options: [{
 					text: '删除',
 					text: '删除',
 					style: {
 					style: {
@@ -96,10 +75,10 @@
 				})
 				})
 			},
 			},
 			// 点击每一个时间段回调 跳转到编辑页面
 			// 点击每一个时间段回调 跳转到编辑页面
-			handleEdit(item) {
+			handleEdit(item, index) {
 				let info = JSON.stringify(item)
 				let info = JSON.stringify(item)
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pages/setPunchTime/setPunchTime?flag=2&info=${info}`
+					url: `/pages/setPunchTime/setPunchTime?flag=2&info=${info}&index=${index}`
 				})
 				})
 			},
 			},
 			// 点击右侧删除按钮回调
 			// 点击右侧删除按钮回调

+ 10 - 2
pages/ruleName/ruleName.vue

@@ -16,9 +16,13 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				name: ""
+				name: "",
+				flag: null
 			};
 			};
 		},
 		},
+		onLoad(options) {
+			this.flag = options.flag
+		},
 		methods: {
 		methods: {
 			// 点击确认按钮回调
 			// 点击确认按钮回调
 			handleConfirm() {
 			handleConfirm() {
@@ -28,7 +32,11 @@
 						icon: 'none'
 						icon: 'none'
 					})
 					})
 				} else {
 				} else {
-					uni.setStorageSync("ruleName", this.name)
+					if (this.flag == 1) {
+						uni.$emit('updateRuleName', this.name)
+					} else {
+						uni.setStorageSync("ruleName", this.name)
+					}
 					uni.navigateBack({
 					uni.navigateBack({
 						delta: 1
 						delta: 1
 					})
 					})

+ 16 - 7
pages/ruleSet/ruleSet.vue

@@ -31,7 +31,7 @@
 				</view>
 				</view>
 
 
 				<view class="box_info">
 				<view class="box_info">
-					<span>时 间:{{item.temList}}</span>
+					<span>时 间:{{(item.temList).join(",")}}</span>
 					<span v-for="(time_item,index) in item.periods" :key="index">
 					<span v-for="(time_item,index) in item.periods" :key="index">
 						{{format_time(time_item.beginTime)}}-{{format_time(time_item.endTime)}}
 						{{format_time(time_item.beginTime)}}-{{format_time(time_item.endTime)}}
 					</span>
 					</span>
@@ -58,15 +58,24 @@
 			};
 			};
 		},
 		},
 		onShow() {
 		onShow() {
+			this.getRuleList()
+			let ruleName = uni.getStorageSync('ruleName')
+			let ruleGroup = uni.getStorageSync('ruleGroup')
+			let ruleTime = uni.getStorageSync('ruleTime')
 			let chooseList = uni.getStorageSync('chooseList')
 			let chooseList = uni.getStorageSync('chooseList')
-			if (chooseList) {
+			let ruleValue = uni.getStorageSync('ruleValue')
+			if (ruleName || ruleGroup || ruleTime || chooseList || ruleValue) {
 				uni.showModal({
 				uni.showModal({
 					title: '提示',
 					title: '提示',
 					content: '上一个页面有未保存的数据,确定不保存吗?',
 					content: '上一个页面有未保存的数据,确定不保存吗?',
-					cancelText:'返回上页',
-					success: function(res) {
+					cancelText: '返回上页',
+					success: (res)=> {
 						if (res.confirm) {
 						if (res.confirm) {
+							uni.removeStorageSync('ruleName');
+							uni.removeStorageSync('ruleGroup');
+							uni.removeStorageSync('ruleTime');
 							uni.removeStorageSync('chooseList');
 							uni.removeStorageSync('chooseList');
+							uni.removeStorageSync('ruleValue');
 						} else if (res.cancel) {
 						} else if (res.cancel) {
 							uni.navigateTo({
 							uni.navigateTo({
 								url: `/pages/addRules/addRules`
 								url: `/pages/addRules/addRules`
@@ -76,9 +85,9 @@
 				});
 				});
 			}
 			}
 		},
 		},
-		onLoad() {
-			this.getRuleList()
-		},
+		// onLoad() {
+		// 	this.getRuleList()
+		// },
 		methods: {
 		methods: {
 			// 获取打卡规则列表数据
 			// 获取打卡规则列表数据
 			async getRuleList() {
 			async getRuleList() {

+ 23 - 7
pages/setPunchTime/setPunchTime.vue

@@ -105,10 +105,15 @@
 						backgroundColor: '#D43030'
 						backgroundColor: '#D43030'
 					}
 					}
 				}],
 				}],
+				// 添加时间 编辑时间 标识
+				flag: null,
+				// 时间列表索引
+				index: null
 			}
 			}
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
-			if (options.flag == 1) {
+			this.flag = options.flag
+			if (this.flag == 1) {
 				uni.setNavigationBarTitle({
 				uni.setNavigationBarTitle({
 					title: '添加打卡时间'
 					title: '添加打卡时间'
 				});
 				});
@@ -116,6 +121,7 @@
 				uni.setNavigationBarTitle({
 				uni.setNavigationBarTitle({
 					title: '编辑打卡时间'
 					title: '编辑打卡时间'
 				});
 				});
+				this.index = options.index
 				this.info = JSON.parse(options.info)
 				this.info = JSON.parse(options.info)
 				// console.log(this.info);
 				// console.log(this.info);
 				this.list = this.info.list
 				this.list = this.info.list
@@ -173,12 +179,21 @@
 							})
 							})
 							setTimeout(() => {
 							setTimeout(() => {
 								let temList = uni.getStorageSync("ruleTime") || []
 								let temList = uni.getStorageSync("ruleTime") || []
-								// console.log(temList);
-								temList.push({
-									selectedWeeks: this.selectedWeeks,
-									list: this.list,
-									holiday: this.holiday
-								})
+								// 编辑时间
+								if (this.flag == 2) {
+									temList.splice(this.index, 1, {
+										selectedWeeks: this.selectedWeeks,
+										list: this.list,
+										holiday: this.holiday
+									})
+								} else {
+									// 添加时间
+									temList.push({
+										selectedWeeks: this.selectedWeeks,
+										list: this.list,
+										holiday: this.holiday
+									})
+								}
 								uni.setStorageSync("ruleTime", temList)
 								uni.setStorageSync("ruleTime", temList)
 								uni.navigateBack({
 								uni.navigateBack({
 									delta: 1
 									delta: 1
@@ -208,6 +223,7 @@
 				this.selectedWeeks = value.map((ele) => {
 				this.selectedWeeks = value.map((ele) => {
 					return ele = arr[ele]
 					return ele = arr[ele]
 				})
 				})
+				// console.log(this.selectedWeeks);
 			},
 			},
 			// 选择时间段回调
 			// 选择时间段回调
 			bindTimeChange(e, val, item) {
 			bindTimeChange(e, val, item) {

File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/chocolate-progress-bar/chocolate-progress-bar.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/tki-tree/tki-tree.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/404/404.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/addLocation/addLocation.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/addRules/addRules.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/authentication/authentication.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cardRecord/cardRecord.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/editRules/editRules.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/group/group.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/location/location.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/my.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/particulars/particulars.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/powerSet/powerSet.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchLocation/punchLocation.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/punchTime/punchTime.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleName/ruleName.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/ruleSet/ruleSet.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/rulesDetail/rulesDetail.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/setPunchTime/setPunchTime.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/stat/stat.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/statDetail/statDetail.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zwx-dropDown/components/zwx-dropDown/zwx-dropDown.js.map


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

@@ -1477,7 +1477,7 @@ function initData(vueOptions, context) {
     try {
     try {
       data = data.call(context); // 支持 Vue.prototype 上挂的数据
       data = data.call(context); // 支持 Vue.prototype 上挂的数据
     } catch (e) {
     } catch (e) {
-      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+      if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
         console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
         console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
       }
       }
     }
     }
@@ -8827,7 +8827,7 @@ function type(obj) {
 
 
 function flushCallbacks$1(vm) {
 function flushCallbacks$1(vm) {
     if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
     if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
-        if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+        if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
             var mpInstance = vm.$scope;
             var mpInstance = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
                 ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
                 ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@@ -8848,14 +8848,14 @@ function nextTick$1(vm, cb) {
     //1.nextTick 之前 已 setData 且 setData 还未回调完成
     //1.nextTick 之前 已 setData 且 setData 还未回调完成
     //2.nextTick 之前存在 render watcher
     //2.nextTick 之前存在 render watcher
     if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
     if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
-        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
+        if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
             var mpInstance = vm.$scope;
             var mpInstance = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
             console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
                 ']:nextVueTick');
                 ']:nextVueTick');
         }
         }
         return nextTick(cb, vm)
         return nextTick(cb, vm)
     }else{
     }else{
-        if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
+        if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
             var mpInstance$1 = vm.$scope;
             var mpInstance$1 = vm.$scope;
             console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
             console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
                 ']:nextMPTick');
                 ']:nextMPTick');
@@ -8951,7 +8951,7 @@ var patch = function(oldVnode, vnode) {
     });
     });
     var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
     var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
     if (Object.keys(diffData).length) {
     if (Object.keys(diffData).length) {
-      if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
+      if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"校园考勤打卡","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
         console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
         console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
           ']差量更新',
           ']差量更新',
           JSON.stringify(diffData));
           JSON.stringify(diffData));

+ 5 - 2
unpackage/dist/dev/mp-weixin/pages/addLocation/addLocation.js

@@ -320,14 +320,17 @@ var _default = {
     },
     },
     // 选择单个地址时的回调
     // 选择单个地址时的回调
     handleChoose: function handleChoose(item) {
     handleChoose: function handleChoose(item) {
+      // console.log(item);
       var arr = uni.getStorageSync("chooseList");
       var arr = uni.getStorageSync("chooseList");
       if (arr) {
       if (arr) {
         this.chooseList = uni.getStorageSync("chooseList");
         this.chooseList = uni.getStorageSync("chooseList");
       }
       }
       this.chooseList.push({
       this.chooseList.push({
-        title: item.title,
+        name: item.title,
         address: item.address,
         address: item.address,
-        scope: this.rangeValue
+        radius: this.rangeValue,
+        lat: item.location.lat,
+        lng: item.location.lng
       });
       });
       uni.setStorageSync("chooseList", this.chooseList);
       uni.setStorageSync("chooseList", this.chooseList);
       uni.navigateBack({
       uni.navigateBack({

+ 163 - 18
unpackage/dist/dev/mp-weixin/pages/addRules/addRules.js

@@ -154,10 +154,17 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 "use strict";
 /* WEBPACK VAR INJECTION */(function(uni) {
 /* WEBPACK VAR INJECTION */(function(uni) {
 
 
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
 Object.defineProperty(exports, "__esModule", {
 Object.defineProperty(exports, "__esModule", {
   value: true
   value: true
 });
 });
 exports.default = void 0;
 exports.default = void 0;
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 39));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 41));
+//
+//
+//
+//
 //
 //
 //
 //
 //
 //
@@ -271,39 +278,89 @@ var _default = {
       time: "未设置",
       time: "未设置",
       // 打卡地点
       // 打卡地点
       place: "未设置",
       place: "未设置",
-      // 提前通知
+      // 提前通知时间
       value: "未设置",
       value: "未设置",
+      // 提前通知时间选择数组
       array: ['5分钟', '10分钟', '15分钟', '20分钟'],
       array: ['5分钟', '10分钟', '15分钟', '20分钟'],
-      index: 0
+      // 提前通知时间选择数组默认选择的索引
+      index: 0,
+      groupIds: [],
+      timeGroups: [],
+      locations: []
     };
     };
   },
   },
-  onLoad: function onLoad() {
-    var _this = this;
-    uni.$on('updatePunchTime', function (data) {
-      _this.time = data;
-    });
-  },
+  onLoad: function onLoad() {},
   onShow: function onShow() {
   onShow: function onShow() {
+    var _this = this;
     var ruleName = uni.getStorageSync("ruleName");
     var ruleName = uni.getStorageSync("ruleName");
     if (ruleName) {
     if (ruleName) {
       this.ruleName = ruleName;
       this.ruleName = ruleName;
     }
     }
     var ruleGroup = uni.getStorageSync("ruleGroup");
     var ruleGroup = uni.getStorageSync("ruleGroup");
     if (ruleGroup) {
     if (ruleGroup) {
-      this.group = ruleGroup.join(",");
+      var temList = [];
+      this.groupIds = [];
+      ruleGroup.forEach(function (ele) {
+        temList.push(ele.name);
+        _this.groupIds.push(ele.id);
+      });
+      this.group = temList.join(",");
+    }
+    var ruleTime = uni.getStorageSync("ruleTime");
+    if (ruleTime) {
+      this.time = ruleTime;
+      var _temList = [];
+      ruleTime.forEach(function (ele) {
+        _temList.push({
+          dayOfWeeks: ele.selectedWeeks,
+          periods: ele.list
+        });
+      });
+      _temList.forEach(function (item) {
+        item.dayOfWeeks = item.dayOfWeeks.map(function (element) {
+          if (element == '星期一') {
+            return element = 1;
+          }
+          if (element == '星期二') {
+            return element = 2;
+          }
+          if (element == '星期三') {
+            return element = 3;
+          }
+          if (element == '星期四') {
+            return element = 4;
+          }
+          if (element == '星期五') {
+            return element = 5;
+          }
+          if (element == '星期六') {
+            return element = 6;
+          }
+          if (element == '星期天') {
+            return element = 7;
+          }
+        });
+      });
+      this.timeGroups = _temList;
     }
     }
     var temPlace = uni.getStorageSync("chooseList");
     var temPlace = uni.getStorageSync("chooseList");
     if (temPlace) {
     if (temPlace) {
-      var temList = [];
+      this.locations = temPlace;
+      var _temList2 = [];
       temPlace.forEach(function (ele) {
       temPlace.forEach(function (ele) {
-        temList.push(ele.title);
+        _temList2.push(ele.name);
       });
       });
-      this.place = temList.join(",");
+      this.place = _temList2.join(",");
+    }
+    var ruleValue = uni.getStorageSync("ruleValue");
+    if (ruleValue) {
+      this.value = ruleValue;
     }
     }
   },
   },
   methods: {
   methods: {
     // 点击确认按钮回调
     // 点击确认按钮回调
     handleConfirm: function handleConfirm() {
     handleConfirm: function handleConfirm() {
+      var _this2 = this;
       if (this.ruleName == '未设置') {
       if (this.ruleName == '未设置') {
         uni.showToast({
         uni.showToast({
           title: "请设置规则名称",
           title: "请设置规则名称",
@@ -342,19 +399,99 @@ var _default = {
       uni.showModal({
       uni.showModal({
         title: '提示',
         title: '提示',
         content: '确定新增吗?',
         content: '确定新增吗?',
-        success: function success(res) {
-          if (res.confirm) {
-            console.log('用户点击确定');
-          } else if (res.cancel) {
-            console.log('用户点击取消');
+        success: function () {
+          var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(res) {
+            var temList, _res;
+            return _regenerator.default.wrap(function _callee$(_context) {
+              while (1) {
+                switch (_context.prev = _context.next) {
+                  case 0:
+                    if (!res.confirm) {
+                      _context.next = 9;
+                      break;
+                    }
+                    temList = [];
+                    _this2.timeGroups.forEach(function (ele) {
+                      ele.periods.forEach(function (item) {
+                        temList.push({
+                          beginTime: _this2.formatTime(item.startTime),
+                          endTime: _this2.formatTime(item.endTime)
+                        });
+                      });
+                      ele.periods = temList;
+                    });
+                    _context.next = 5;
+                    return _this2.$myRequest({
+                      url: "/attendance/api/settings/rule/add",
+                      method: "post",
+                      header: {
+                        'Authorization': uni.getStorageSync("token") || 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo1MDQ2LCJ1c2VyX3V1aWQiOjEzNDc3NzE0NzM1NTY5NzE1MiwibmJmIjoxNjcxMTU1ODQzfQ.u4-N762Ijfb9RkuuFOFkeMiJQI9uCi0IaheJlGwi5Ms'
+                      },
+                      data: {
+                        // 是否需要人脸识别
+                        faceRecognition: true,
+                        // 考勤组ID列表
+                        groupIds: _this2.groupIds,
+                        // 是否同步节假日
+                        holiday: true,
+                        // 是否可选择本地图片
+                        localPicture: false,
+                        // 规则名称
+                        name: _this2.ruleName,
+                        // 提前通知时间
+                        noticeTime: _this2.value,
+                        // 是否需要场景拍照
+                        takePicture: true,
+                        // 打卡地点列表
+                        locations: _this2.locations,
+                        // 打卡时间列表
+                        timeGroups: _this2.timeGroups
+                      }
+                    });
+                  case 5:
+                    _res = _context.sent;
+                    // console.log(res)
+                    if (_res.code == 200) {
+                      uni.showToast({
+                        title: "添加成功",
+                        icon: 'success'
+                      });
+                      uni.removeStorageSync('ruleName');
+                      uni.removeStorageSync('ruleGroup');
+                      uni.removeStorageSync('ruleTime');
+                      uni.removeStorageSync('chooseList');
+                      uni.removeStorageSync('ruleValue');
+                      setTimeout(function () {
+                        uni.navigateBack({
+                          delta: 1
+                        });
+                      }, 1500);
+                    }
+                    _context.next = 10;
+                    break;
+                  case 9:
+                    if (res.cancel) {}
+                  case 10:
+                  case "end":
+                    return _context.stop();
+                }
+              }
+            }, _callee);
+          }));
+          function success(_x) {
+            return _success.apply(this, arguments);
           }
           }
-        }
+          return success;
+        }()
       });
       });
     },
     },
     // 提前通知选择框点击回调
     // 提前通知选择框点击回调
     changeSelect: function changeSelect(e) {
     changeSelect: function changeSelect(e) {
       var index = e.detail.value;
       var index = e.detail.value;
       this.value = this.array[index];
       this.value = this.array[index];
+      var index2 = this.value.indexOf("分", 0);
+      this.value = this.value.substring(0, index2);
+      uni.setStorageSync("ruleValue", this.value);
     },
     },
     // 点击规则名称跳转回调
     // 点击规则名称跳转回调
     goPageRuleName: function goPageRuleName() {
     goPageRuleName: function goPageRuleName() {
@@ -379,6 +516,14 @@ var _default = {
       uni.navigateTo({
       uni.navigateTo({
         url: "/pages/punchLocation/punchLocation"
         url: "/pages/punchLocation/punchLocation"
       });
       });
+    },
+    // 格式化时间
+    formatTime: function formatTime(val) {
+      var tem = '2021-11-22 ' + val + ':00';
+      // console.log(tem);
+      var date = new Date(tem);
+      var time = date.getTime();
+      return time;
     }
     }
   }
   }
 };
 };

File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/addRules/addRules.wxml


+ 81 - 24
unpackage/dist/dev/mp-weixin/pages/editRules/editRules.js

@@ -167,10 +167,13 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 "use strict";
 /* WEBPACK VAR INJECTION */(function(uni) {
 /* WEBPACK VAR INJECTION */(function(uni) {
 
 
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
 Object.defineProperty(exports, "__esModule", {
 Object.defineProperty(exports, "__esModule", {
   value: true
   value: true
 });
 });
 exports.default = void 0;
 exports.default = void 0;
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 39));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 41));
 //
 //
 //
 //
 //
 //
@@ -297,25 +300,39 @@ var _default = {
       // 提前通知选项
       // 提前通知选项
       array: ['5分钟', '10分钟', '15分钟', '20分钟'],
       array: ['5分钟', '10分钟', '15分钟', '20分钟'],
       periods: [],
       periods: [],
-      index: 0
+      index: 0,
+      id: ""
     };
     };
   },
   },
   onLoad: function onLoad(option) {
   onLoad: function onLoad(option) {
     var _this = this;
     var _this = this;
-    this.info = JSON.parse(option.info);
-    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) {
+    uni.$on('updateRuleName', function (data) {
       _this.ruleName = data;
       _this.ruleName = data;
     });
     });
-  },
-  onUnload: function onUnload() {
-    uni.$off('update');
+    uni.$on('updateGroup', function (data) {
+      var temList = [];
+      data.forEach(function (ele) {
+        temList.push(ele.name);
+      });
+      _this.group = temList.join(",");
+    });
+    this.info = JSON.parse(option.info);
+    console.log(this.info);
+    if (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;
+      this.id = this.info.id;
+      var ruleTime = [];
+      ruleTime.push({
+        selectedWeeks: this.time,
+        list: this.periods
+      });
+      uni.setStorageSync("ruleTime", ruleTime);
+    }
   },
   },
   methods: {
   methods: {
     // 点击确认按钮回调
     // 点击确认按钮回调
@@ -326,24 +343,64 @@ var _default = {
         success: function success(res) {
         success: function success(res) {
           if (res.confirm) {
           if (res.confirm) {
             console.log('用户点击确定');
             console.log('用户点击确定');
-          } else if (res.cancel) {
-            console.log('用户点击取消');
-          }
+          } else if (res.cancel) {}
         }
         }
       });
       });
     },
     },
     // 点击删除按钮回调
     // 点击删除按钮回调
     handleDelete: function handleDelete() {
     handleDelete: function handleDelete() {
+      var _this2 = this;
       uni.showModal({
       uni.showModal({
         title: '提示',
         title: '提示',
         content: '确定删除吗?',
         content: '确定删除吗?',
-        success: function success(res) {
-          if (res.confirm) {
-            console.log('用户点击确定');
-          } else if (res.cancel) {
-            console.log('用户点击取消');
+        success: function () {
+          var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(res) {
+            var _res;
+            return _regenerator.default.wrap(function _callee$(_context) {
+              while (1) {
+                switch (_context.prev = _context.next) {
+                  case 0:
+                    if (!res.confirm) {
+                      _context.next = 7;
+                      break;
+                    }
+                    _context.next = 3;
+                    return _this2.$myRequest({
+                      url: "/attendance/api/settings/rule/delete",
+                      method: "delete",
+                      data: {
+                        ids: [_this2.id]
+                      }
+                    });
+                  case 3:
+                    _res = _context.sent;
+                    // console.log(res);
+                    if (_res.code == 200) {
+                      uni.showToast({
+                        title: "删除成功"
+                      });
+                      setTimeout(function () {
+                        uni.navigateBack({
+                          delta: 1
+                        });
+                      }, 1500);
+                    }
+                    _context.next = 8;
+                    break;
+                  case 7:
+                    if (res.cancel) {}
+                  case 8:
+                  case "end":
+                    return _context.stop();
+                }
+              }
+            }, _callee);
+          }));
+          function success(_x) {
+            return _success.apply(this, arguments);
           }
           }
-        }
+          return success;
+        }()
       });
       });
     },
     },
     // 提前通知选择框点击回调
     // 提前通知选择框点击回调
@@ -354,13 +411,13 @@ var _default = {
     // 点击规则名称跳转回调
     // 点击规则名称跳转回调
     goPageRuleName: function goPageRuleName() {
     goPageRuleName: function goPageRuleName() {
       uni.navigateTo({
       uni.navigateTo({
-        url: "/pages/ruleName/ruleName"
+        url: "/pages/ruleName/ruleName?flag=1"
       });
       });
     },
     },
     // 点击考勤组跳转回调
     // 点击考勤组跳转回调
     goPageGroup: function goPageGroup() {
     goPageGroup: function goPageGroup() {
       uni.navigateTo({
       uni.navigateTo({
-        url: "/pages/group/group?flag=2"
+        url: "/pages/group/group?flag=2&type=edit"
       });
       });
     },
     },
     // 点击打卡时间跳转回调
     // 点击打卡时间跳转回调

+ 12 - 3
unpackage/dist/dev/mp-weixin/pages/group/group.js

@@ -234,11 +234,13 @@ var _default = {
       }],
       }],
       // 考勤组列表数据
       // 考勤组列表数据
       list: [],
       list: [],
-      range: []
+      range: [],
+      type: ""
     };
     };
   },
   },
   onLoad: function onLoad(options) {
   onLoad: function onLoad(options) {
     this.flag = options.flag;
     this.flag = options.flag;
+    this.type = options.type;
     if (this.flag == 1) {
     if (this.flag == 1) {
       this.checkStatus = true;
       this.checkStatus = true;
     }
     }
@@ -461,7 +463,10 @@ var _default = {
       var temList = [];
       var temList = [];
       this.list.forEach(function (ele) {
       this.list.forEach(function (ele) {
         if (ele.checked == true) {
         if (ele.checked == true) {
-          temList.push(ele.name);
+          temList.push({
+            name: ele.name,
+            id: ele.id
+          });
         }
         }
       });
       });
       if (temList.length == 0) {
       if (temList.length == 0) {
@@ -470,7 +475,11 @@ var _default = {
           icon: "none"
           icon: "none"
         });
         });
       } else {
       } else {
-        uni.setStorageSync("ruleGroup", temList);
+        if (this.type == "edit") {
+          uni.$emit('updateGroup', temList);
+        } else {
+          uni.setStorageSync("ruleGroup", temList);
+        }
         uni.navigateBack({
         uni.navigateBack({
           delta: 1
           delta: 1
         });
         });

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

@@ -228,26 +228,7 @@ exports.default = void 0;
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     return {
-      list: [
-        // {
-        // 	id: 1,
-        // 	title: "操场",
-        // 	place: "江西省南昌市经开区广兰大道899号",
-        // 	scope: "300米"
-        // },
-        // {
-        // 	id: 2,
-        // 	title: "操场",
-        // 	place: "江西省南昌市经开区广兰大道899号",
-        // 	scope: "400米"
-        // },
-        // {
-        // 	id: 3,
-        // 	title: "操场",
-        // 	place: "江西省南昌市经开区广兰大道899号",
-        // 	scope: "500米"
-        // }
-      ],
+      list: [],
       options: [{
       options: [{
         text: '删除',
         text: '删除',
         style: {
         style: {

File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/punchLocation/punchLocation.wxml


+ 12 - 24
unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.js

@@ -130,12 +130,21 @@ var render = function () {
   var _c = _vm._self._c || _h
   var _c = _vm._self._c || _h
   var m0 = __webpack_require__(/*! ../../static/add.png */ 71)
   var m0 = __webpack_require__(/*! ../../static/add.png */ 71)
   var m1 = __webpack_require__(/*! ../../static/right.png */ 82)
   var m1 = __webpack_require__(/*! ../../static/right.png */ 82)
+  var l0 = _vm.__map(_vm.list, function (item, index) {
+    var $orig = _vm.__get_orig(item)
+    var g0 = item.selectedWeeks.join(",")
+    return {
+      $orig: $orig,
+      g0: g0,
+    }
+  })
   _vm.$mp.data = Object.assign(
   _vm.$mp.data = Object.assign(
     {},
     {},
     {
     {
       $root: {
       $root: {
         m0: m0,
         m0: m0,
         m1: m1,
         m1: m1,
+        l0: l0,
       },
       },
     }
     }
   )
   )
@@ -231,28 +240,7 @@ exports.default = void 0;
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     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: [],
       options: [{
       options: [{
         text: '删除',
         text: '删除',
         style: {
         style: {
@@ -275,10 +263,10 @@ var _default = {
       });
       });
     },
     },
     // 点击每一个时间段回调 跳转到编辑页面
     // 点击每一个时间段回调 跳转到编辑页面
-    handleEdit: function handleEdit(item) {
+    handleEdit: function handleEdit(item, index) {
       var info = JSON.stringify(item);
       var info = JSON.stringify(item);
       uni.navigateTo({
       uni.navigateTo({
-        url: "/pages/setPunchTime/setPunchTime?flag=2&info=".concat(info)
+        url: "/pages/setPunchTime/setPunchTime?flag=2&info=".concat(info, "&index=").concat(index)
       });
       });
     },
     },
     // 点击右侧删除按钮回调
     // 点击右侧删除按钮回调

File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/punchTime/punchTime.wxml


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

@@ -181,9 +181,13 @@ exports.default = void 0;
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     return {
-      name: ""
+      name: "",
+      flag: null
     };
     };
   },
   },
+  onLoad: function onLoad(options) {
+    this.flag = options.flag;
+  },
   methods: {
   methods: {
     // 点击确认按钮回调
     // 点击确认按钮回调
     handleConfirm: function handleConfirm() {
     handleConfirm: function handleConfirm() {
@@ -193,7 +197,11 @@ var _default = {
           icon: 'none'
           icon: 'none'
         });
         });
       } else {
       } else {
-        uni.setStorageSync("ruleName", this.name);
+        if (this.flag == 1) {
+          uni.$emit('updateRuleName', this.name);
+        } else {
+          uni.setStorageSync("ruleName", this.name);
+        }
         uni.navigateBack({
         uni.navigateBack({
           delta: 1
           delta: 1
         });
         });

+ 15 - 4
unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.js

@@ -107,6 +107,7 @@ var render = function () {
   var m2 = __webpack_require__(/*! ../../static/right.png */ 82)
   var m2 = __webpack_require__(/*! ../../static/right.png */ 82)
   var l1 = _vm.__map(_vm.list, function (item, __i0__) {
   var l1 = _vm.__map(_vm.list, function (item, __i0__) {
     var $orig = _vm.__get_orig(item)
     var $orig = _vm.__get_orig(item)
+    var g0 = item.temList.join(",")
     var l0 = _vm.__map(item.periods, function (time_item, index) {
     var l0 = _vm.__map(item.periods, function (time_item, index) {
       var $orig = _vm.__get_orig(time_item)
       var $orig = _vm.__get_orig(time_item)
       var m3 = _vm.format_time(time_item.beginTime)
       var m3 = _vm.format_time(time_item.beginTime)
@@ -119,6 +120,7 @@ var render = function () {
     })
     })
     return {
     return {
       $orig: $orig,
       $orig: $orig,
+      g0: g0,
       l0: l0,
       l0: l0,
     }
     }
   })
   })
@@ -234,15 +236,24 @@ var _default = {
     };
     };
   },
   },
   onShow: function onShow() {
   onShow: function onShow() {
+    this.getRuleList();
+    var ruleName = uni.getStorageSync('ruleName');
+    var ruleGroup = uni.getStorageSync('ruleGroup');
+    var ruleTime = uni.getStorageSync('ruleTime');
     var chooseList = uni.getStorageSync('chooseList');
     var chooseList = uni.getStorageSync('chooseList');
-    if (chooseList) {
+    var ruleValue = uni.getStorageSync('ruleValue');
+    if (ruleName || ruleGroup || ruleTime || chooseList || ruleValue) {
       uni.showModal({
       uni.showModal({
         title: '提示',
         title: '提示',
         content: '上一个页面有未保存的数据,确定不保存吗?',
         content: '上一个页面有未保存的数据,确定不保存吗?',
         cancelText: '返回上页',
         cancelText: '返回上页',
         success: function success(res) {
         success: function success(res) {
           if (res.confirm) {
           if (res.confirm) {
+            uni.removeStorageSync('ruleName');
+            uni.removeStorageSync('ruleGroup');
+            uni.removeStorageSync('ruleTime');
             uni.removeStorageSync('chooseList');
             uni.removeStorageSync('chooseList');
+            uni.removeStorageSync('ruleValue');
           } else if (res.cancel) {
           } else if (res.cancel) {
             uni.navigateTo({
             uni.navigateTo({
               url: "/pages/addRules/addRules"
               url: "/pages/addRules/addRules"
@@ -252,9 +263,9 @@ var _default = {
       });
       });
     }
     }
   },
   },
-  onLoad: function onLoad() {
-    this.getRuleList();
-  },
+  // onLoad() {
+  // 	this.getRuleList()
+  // },
   methods: {
   methods: {
     // 获取打卡规则列表数据
     // 获取打卡规则列表数据
     getRuleList: function getRuleList() {
     getRuleList: function getRuleList() {

File diff ditekan karena terlalu besar
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/ruleSet/ruleSet.wxml


+ 24 - 8
unpackage/dist/dev/mp-weixin/pages/setPunchTime/setPunchTime.js

@@ -209,11 +209,16 @@ var _default = {
         style: {
         style: {
           backgroundColor: '#D43030'
           backgroundColor: '#D43030'
         }
         }
-      }]
+      }],
+      // 添加时间 编辑时间 标识
+      flag: null,
+      // 时间列表索引
+      index: null
     };
     };
   },
   },
   onLoad: function onLoad(options) {
   onLoad: function onLoad(options) {
-    if (options.flag == 1) {
+    this.flag = options.flag;
+    if (this.flag == 1) {
       uni.setNavigationBarTitle({
       uni.setNavigationBarTitle({
         title: '添加打卡时间'
         title: '添加打卡时间'
       });
       });
@@ -221,6 +226,7 @@ var _default = {
       uni.setNavigationBarTitle({
       uni.setNavigationBarTitle({
         title: '编辑打卡时间'
         title: '编辑打卡时间'
       });
       });
+      this.index = options.index;
       this.info = JSON.parse(options.info);
       this.info = JSON.parse(options.info);
       // console.log(this.info);
       // console.log(this.info);
       this.list = this.info.list;
       this.list = this.info.list;
@@ -279,12 +285,21 @@ var _default = {
             });
             });
             setTimeout(function () {
             setTimeout(function () {
               var temList = uni.getStorageSync("ruleTime") || [];
               var temList = uni.getStorageSync("ruleTime") || [];
-              // console.log(temList);
-              temList.push({
-                selectedWeeks: _this.selectedWeeks,
-                list: _this.list,
-                holiday: _this.holiday
-              });
+              // 编辑时间
+              if (_this.flag == 2) {
+                temList.splice(_this.index, 1, {
+                  selectedWeeks: _this.selectedWeeks,
+                  list: _this.list,
+                  holiday: _this.holiday
+                });
+              } else {
+                // 添加时间
+                temList.push({
+                  selectedWeeks: _this.selectedWeeks,
+                  list: _this.list,
+                  holiday: _this.holiday
+                });
+              }
               uni.setStorageSync("ruleTime", temList);
               uni.setStorageSync("ruleTime", temList);
               uni.navigateBack({
               uni.navigateBack({
                 delta: 1
                 delta: 1
@@ -313,6 +328,7 @@ var _default = {
       this.selectedWeeks = value.map(function (ele) {
       this.selectedWeeks = value.map(function (ele) {
         return ele = arr[ele];
         return ele = arr[ele];
       });
       });
+      // console.log(this.selectedWeeks);
     },
     },
     // 选择时间段回调
     // 选择时间段回调
     bindTimeChange: function bindTimeChange(e, val, item) {
     bindTimeChange: function bindTimeChange(e, val, item) {

+ 2 - 2
unpackage/dist/dev/mp-weixin/uni_modules/jlk-week/components/jlk-week/jlk-week.json

@@ -1,4 +1,4 @@
 {
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }
 }