From 0f49a23a9d4dc7d3eb9a7309f8cd85a316cd4d97 Mon Sep 17 00:00:00 2001
From: zhangyanpeng <bob.zhang@highdatas.com>
Date: 星期四, 30 四月 2020 17:39:22 +0800
Subject: [PATCH] 功能调整

---
 src/views/calendarTask.vue |   84 +++++++++++++++++++++++++++++------------
 1 files changed, 59 insertions(+), 25 deletions(-)

diff --git a/src/views/calendarTask.vue b/src/views/calendarTask.vue
index f65229a..918f00f 100644
--- a/src/views/calendarTask.vue
+++ b/src/views/calendarTask.vue
@@ -21,7 +21,7 @@
 			</div>
 		</div>
 		
-		<el-dialog @close="Cancel" width="40%" top="10%" :visible.sync="dialog_1" v-if="dialog_1">
+		<el-dialog width="40%" top="10%" :visible.sync="dialog_1" v-if="dialog_1">
 			<div slot="title" class="dialog-title" style="text-align: left;">
 			  <span> 浠诲姟澶勭悊 </span>
 			</div>
@@ -30,12 +30,13 @@
 				<el-upload
 					class="upload-demo"
 					:action="upload_url"
-					
 					:data="upData"
 					:limit="1"
 					:file-list="fileList"
 					:auto-upload='false'
 					ref="upload"
+					:on-success="upSuccess"
+					:on-error="upError"
 					>
 					<el-button size="medium" type="text">閫夋嫨鏂囦欢</el-button>
 					<div slot="tip" class="el-upload__tip">鏂囦欢涓嶈秴杩�50M</div>
@@ -47,13 +48,14 @@
 					type="textarea"
 					:rows="2"
 					placeholder="璇疯緭鍏ュ唴瀹�"
+					@change="setDesc"
 					v-model="desc_task">
 				</el-input>
 			</div>
 			
 			<!-- 澶勭悊瀹屾垚 -->
 			<div slot="footer" class="dialog-footer">
-				<el-button v-if="handleTaskType.mustAttach" @click="submitUpload">鐐瑰嚮涓婁紶</el-button>
+			<!-- 	<el-button v-if="handleTaskType.mustAttach" @click="submitUpload">鐐瑰嚮涓婁紶</el-button> -->
 				<el-button @click="Cancel">鍙� 娑�</el-button>
 				<el-button type="primary" @click="doHandleTask">澶勭悊瀹屾垚</el-button>
 			</div>
@@ -71,6 +73,8 @@
         },
         data(){
         	return{
+						isZ: true,
+						me_date: null,
         		datedef:[
 							{'date': "2020-01-01", 'task': 3},
 							{'date': "2020-01-11", 'task': 2},
@@ -93,6 +97,7 @@
 					
 					//鑾峰彇褰撴湀鏁版嵁
 					let nowDate = new Date();
+					this.me_date = nowDate;
 					var imoment = this.$moment(nowDate);
 					let iformat = imoment.format('YYYY-MM');
 					let systemDate = iformat + '-01 00:00:00';
@@ -130,14 +135,21 @@
 						this.dialog_1 = true;
 					},
 					
+					setDesc(val) {
+						this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
+							desp: val
+						};
+					},
+					
 					doHandleTask() {
 						//姝d鐨勬槑缁嗕换鍔″畬鎴�
 						let id = this.handleTaskType.id;
+						if (!this.desc_task) {
+							this.$message('璇峰~鍐欐弿杩�');
+							return
+						}
+						
 						if(this.handleTaskType.mustAttach) {
-							this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
-								desp: this.desc_task
-							},
-							
 							this.$refs.upload.submit();//寮�濮嬩笂浼�
 						}
 						else {
@@ -148,7 +160,7 @@
 								params	
 								})
 								.then(data_ => {
-									console.log(data_);
+								//	console.log(data_);
 									if(data_.data.success) {
 										this.$message('澶勭悊鎴愬姛');
 										me.Cancel();
@@ -156,32 +168,52 @@
 										this.$message({message:'澶勭悊浠诲姟澶辫触', type: 'warning'});
 									}
 								}).catch(error => {
-									console.log(error);
+								//	console.log(error);
 								});
 						}
 						
 						
 						
-						if (this.dialog_1) {
+						/* if (this.dialog_1) {
 							this.Cancel();
-						}
+						} */
 					},
 					
-					// submitUpload() {
-					// 	this.handleTaskType; //瑕佸鐞嗙殑鏄庣粏鏁版嵁
+				submitUpload() {
+					this.handleTaskType; //瑕佸鐞嗙殑鏄庣粏鏁版嵁
+					
+					this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
 						
-					// 	this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
-							
-					// 	},
-					// 	this.upload_url = ""; //璁剧疆涓婁紶鎺ュ彛
-					//   this.$refs.upload.submit();//寮�濮嬩笂浼�
-					// },
+					},
+					this.upload_url; //璁剧疆涓婁紶鎺ュ彛
+					 this.$refs.upload.submit();//寮�濮嬩笂浼�
+				 },
+				 
+				 upSuccess(response, file, fileList) {
+					 this.$message('涓婁紶鎴愬姛');
+					 this.Cancel();
+				 },
+				 
+				 upError(err, file, fileList) {
+					 this.$message('涓婁紶澶辫触');
+				 },
 					
 					Cancel() {
+						this.isZ = false;
+						this.isZ = true;
 						this.dialog_1 = false;
+						
+					//	let header_height = this.$refs.calendar_div.getElementsByClassName('z_calendar_table')[0].offsetHeight;
+					//	this.$refs.calendar_div.getElementsByClassName('z_right')[0].style['height'] = header_height + "px";
+						this.DayDataTree = [];
+						var imoment = this.$moment(this.me_date);
+						let iformat = imoment.format('YYYY-MM');
+						let systemDate = iformat + '-01 00:00:00';
+						this.getDatedef(systemDate);
 					},
 					
 					dateChange(date_) {
+						this.me_date = date_;
 						var imoment = this.$moment(date_);
 						let iformat = imoment.format('YYYY-MM');
 						let systemDate = iformat + '-01 00:00:00';
@@ -213,7 +245,8 @@
 								params
 							})
 							.then(data_ => {
-								console.log(data_);
+							//	console.log(data_);
+								window.console.log(data_);
 								let datas= data_.data.data;
 								datas = datas.map(el => {
 									var imoment = this.$moment(el.date);
@@ -224,7 +257,7 @@
 								})
 								this.datedef = datas;
 							}).catch(error => {
-								console.log(error);
+						//		console.log(error);
 							});
 					},
 					
@@ -238,7 +271,8 @@
 								params
 							})
 							.then(data_ => {
-								console.log(data_);
+							//	console.log(data_);
+								window.console.log(data_);
 								// let DayDatas = [
 								// 	{'id': "111", 'name': "娴嬭瘯1椤圭洰", 'desc': "姝ら」鐩富瑕侀拡瀵规彁楂樻晥鐜囧拰閿�鍞噺"}, //杩斿洖鐨勬暟缁勫瓧娈�
 								// 	{'id': "111_1", 'name': "绔嬮鏈嶅姟", 'mustAttach': true, 'parentId': "111"}, //
@@ -273,10 +307,10 @@
 								}
 								this.DayDataTree = result;
 							}).catch(error => {
-								console.log(error);
+							//	console.log(error);
 							})
-						
-					}
+						 
+					},
 					
 				}
 		}

--
Gitblit v1.8.0