Ver código fonte

优化调整

wgl 4 anos atrás
pai
commit
77699136ce

+ 11 - 1
src/projects/business/views/Master/Attendance/List.vue

@@ -175,7 +175,17 @@
 					this.rightLink.title = '考勤记录';
 				}
 			}
-		}
+		},
+		//keepalive监控判断
+		beforeRouteLeave(to, from, next) {
+			console.log(to.name);
+			if (['MasterAttendanceInfo'].indexOf(to.name) > -1) {
+				this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', ['MasterAttendanceList'])
+			} else {
+				this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', [])
+			}
+			next()
+		},
 	}
 </script>
 

+ 8 - 5
src/projects/business/views/Master/BusinessTravel/Form.vue

@@ -94,7 +94,7 @@
 			}
 		},
 		created() {
-			this.subForm.startTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
+			this.subForm.startTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d} {h}:{i}');
 		},
 		methods: {
 			//获取审核人列表
@@ -111,6 +111,9 @@
 							text: list[i]['personName']
 						})
 					}
+					if (approvalPersonList.length) {
+						this.subForm.approvalPersonId = approvalPersonList[0]['value'];
+					}
 					this.approvalPersonList = approvalPersonList;
 
 				}).catch(error => {
@@ -123,7 +126,7 @@
 				var _this = this;
 				var picker = new mui.PopPicker();
 				picker.setData(_this.approvalPersonList);
-				picker.pickers[0].setSelectedIndex(0);
+				picker.pickers[0].setSelectedValue(this.subForm.approvalPersonId);
 				picker.show(function(selectItems) {
 					_this.subForm.approvalPersonId = selectItems[0].value;
 					picker.dispose();
@@ -133,7 +136,7 @@
 			selectData() {
 				var _this = this;
 				var picker = new mui.DtPicker({
-					"type": "date",
+					"type": "datetime",
 					"beginYear": 2020,
 					"endYear": 2040,
 					"beginDate": new Date(),
@@ -156,7 +159,7 @@
 					mui.toast('请填写申请理由');
 					return false;
 				} else if (!this.subForm.approvalPersonId) {
-					mui.toast('请填写审批人');
+					mui.toast('请选择审批人');
 					return false;
 				} else {
 					return true;
@@ -172,7 +175,7 @@
 						mui.toast('提交成功');
 						this.$router.push({
 							name: 'MasterBusinessTravelInfo',
-							query:{
+							query: {
 								id: response.id
 							}
 						})

+ 8 - 5
src/projects/business/views/Master/Egress/Form.vue

@@ -36,7 +36,7 @@
 				<form class="mui-input-group">
 					<div class="mui-input-row">
 						<label><i class="colorfe616c">*</i> 审批人</label>
-						<button class="mui-btn mui-btn-block mui-navigate-right mui-ellipsis" type='button' style="width:65%">
+						<button @click="selectPerson" class="mui-btn mui-btn-block mui-navigate-right mui-ellipsis" type='button' style="width:65%">
 							{{approvalPersonName}}
 						</button>
 					</div>
@@ -94,7 +94,7 @@
 			}
 		},
 		created() {
-			this.subForm.startTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
+			this.subForm.startTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d} {h}:{i}');
 		},
 		methods: {
 			//获取审核人列表
@@ -111,6 +111,9 @@
 							text: list[i]['personName']
 						})
 					}
+					if (approvalPersonList.length) {
+						this.subForm.approvalPersonId = approvalPersonList[0]['value'];
+					}
 					this.approvalPersonList = approvalPersonList;
 
 				}).catch(error => {
@@ -123,7 +126,7 @@
 				var _this = this;
 				var picker = new mui.PopPicker();
 				picker.setData(_this.approvalPersonList);
-				picker.pickers[0].setSelectedIndex(0);
+				picker.pickers[0].setSelectedValue(this.subForm.approvalPersonId);
 				picker.show(function(selectItems) {
 					_this.subForm.approvalPersonId = selectItems[0].value;
 					picker.dispose();
@@ -133,7 +136,7 @@
 			selectData() {
 				var _this = this;
 				var picker = new mui.DtPicker({
-					"type": "date",
+					"type": "datetime",
 					"beginYear": 2020,
 					"endYear": 2040,
 					"beginDate": new Date(),
@@ -156,7 +159,7 @@
 					mui.toast('请填写申请理由');
 					return false;
 				} else if (!this.subForm.approvalPersonId) {
-					mui.toast('请填写审批人');
+					mui.toast('请选择审批人');
 					return false;
 				} else {
 					return true;

+ 2 - 1
src/store/state.js

@@ -42,7 +42,8 @@ const state = {
 	invitation_code: getInvitationCode(storage_prefix),
 	default_examine_person: getDefaultExaminePerson(storage_prefix),
 	activity_form_data: getActivityFormData(storage_prefix),
-	keep_alive_components: '',
+	//这里由于include,需要默认为数组
+	keep_alive_components: [],
 }
 
 export default state