From fadf2795757ac6df1c792546725ea177c93d9d7a Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 18 三月 2020 14:03:10 +0800
Subject: [PATCH] Merge branch 'master' of http://highdatas.com:9000/r/~kimi/srs

---
 src/components/square.vue                        |   10 +-
 src/components/popup/portion/substepReadOnly.vue |   47 +++++++++++
 vue.config.js                                    |    2 
 src/components/popup/prodetail.vue               |   36 ++------
 src/components/popup/newProject.vue              |   47 ++++++++++-
 src/views/calendarTask.vue                       |   40 ++++++---
 src/views/list.vue                               |    6 +
 7 files changed, 133 insertions(+), 55 deletions(-)

diff --git a/src/components/popup/newProject.vue b/src/components/popup/newProject.vue
index f4edffe..b004a5e 100644
--- a/src/components/popup/newProject.vue
+++ b/src/components/popup/newProject.vue
@@ -24,6 +24,7 @@
 					  </el-form-item>
 						
 					  <el-form-item label="璧锋鏃堕棿:" prop="items" style="width: 50%;">
+								<!-- :picker-options="pickerOptions01" -->
 							<el-date-picker
 								v-model="ruleForm.items"
 								type="daterange"
@@ -45,7 +46,8 @@
 				<substep ref="substep_zj" v-bind:xmId="xmId" v-bind:totalItems="totalItems"></substep>
       </div>
       <div v-if="add_Step == 2" style="width: 100%; height: 100%;" align="center">
-        <substepReadOnly v-bind:form_objs="form_objs" v-bind:showData_="showData_"></substepReadOnly>
+        <!-- <substepReadOnly v-bind:form_objs="form_objs" v-bind:showData_="showData_"></substepReadOnly> -->
+        <substepReadOnly v-bind:xmId="xmId"></substepReadOnly>
       </div>
     </div>
 		 
@@ -74,6 +76,38 @@
 		substepReadOnly
 	},
   data () {
+		var validateTtems = (rule, value, callback) => {
+					if (value.length > 1) {
+						let a1 = new Date(value[0]);
+						let a2 = new Date(this.ruleForm.items[1]);
+						
+						
+						if (this.rowData.beginDate && !this.rowData.endDate) {
+							let bb0 = new Date(this.rowData.beginDate);
+							let bb0str = this.$moment(bb0).format('YYYY-MM-DD');
+							if (a1 > bb0) {
+								callback(new Error('寮�濮嬫椂闂村簲灏忎簬' + bb0str));
+							}
+							else if (a2 < bb0) {
+								callback(new Error('缁撴潫鏃堕棿搴斿ぇ浜�' + bb0str));
+							}
+						}
+						
+						else if (this.rowData.beginDate && this.rowData.endDate) {
+							let bb0 = new Date(this.rowData.beginDate);
+							let bb1 = new Date(this.rowData.endDate);
+							let bb0str = this.$moment(bb0).format('YYYY-MM-DD');
+							let bb1str = this.$moment(bb1).format('YYYY-MM-DD');
+							if (a1 > bb0) {
+								callback(new Error('寮�濮嬫椂闂村簲灏忎簬' + bb0str));
+							}
+							else if (a2 < bb1) {
+								callback(new Error('缁撴潫鏃堕棿搴斿ぇ浜�' + bb1str));
+							}
+						}
+						callback();
+					}
+		  };
     return {
 		userId: undefined,
 		assign: undefined,
@@ -124,9 +158,10 @@
 				items: [
 					{
 						type: "array",
+						validator: validateTtems,
 						required: true,
-						message: "涓嶈兘涓虹┖",
-						trigger: ["change", "blur"]
+						//message: "涓嶈兘涓虹┖",
+						trigger: ["change"]
 					}
 				]
 				
@@ -173,8 +208,8 @@
 				  }
 				});
 				if(is_null1) {
-					this.saveStep1();
-				  this.loading_save = true;
+				 // this.loading_nextStep = true;
+				//	this.saveStep1();
 				}
 				
 			//	this.xmId = "c3b7f55c800e4726b53fdc18dd994603";
@@ -227,6 +262,7 @@
 					}).then(data_1 => {
 						if(data_1.data.success) {
 							me.add_Step = 1;
+							me.loading_nextStep = false;
 						}else {
 							this.$message({message:'鍒涘缓椤圭洰澶辫触', type: 'warning'});
 						}
@@ -243,6 +279,7 @@
 					me.xmId = data_.data.data;
 					me.totalItems = ruleForm_.items;
 					me.add_Step = 1;
+					me.loading_nextStep = false;
 				}).catch(error =>{
 				})
 			}
diff --git a/src/components/popup/portion/substepReadOnly.vue b/src/components/popup/portion/substepReadOnly.vue
index 1b41bab..6b60675 100644
--- a/src/components/popup/portion/substepReadOnly.vue
+++ b/src/components/popup/portion/substepReadOnly.vue
@@ -1181,14 +1181,23 @@
 <script>
   export default {
 		props:{
-			showData_: {
+			/* showData_: {
 				type: Object,
 				required: true
 			},
 			form_objs: {
 			   type: Object,
 			   required: true
+			}, */
+			
+			xmId: {
+			   type: String,
+			   required: true
 			},
+			/* totalItems: {
+				type: Array,
+				required: true
+			} */
 		},
     data() {
       return {
@@ -1480,6 +1489,40 @@
 			},
 			
 			getDetailed() {
+				let me = this;
+				let url = "/api/detail/parent/" + this.xmId;
+				this.$axios.get(url).then(data_ => {
+					me.defaultCheckedKeys = [];
+					me.showData = {};
+					let details_ = data_.data.data;
+					me.money = 0;
+					if(details_.length > 0) {//濡傛灉瀛樺湪鏄庣粏
+						for(let i=0; i<details_.length; i++) {
+							let detail_ = details_[i];
+							//璁剧疆鏍戠殑閫変腑
+							me.defaultCheckedKeys.push(detail_.type);
+							//灞曞紑鎵�鏈夋爲鑺傜偣瀵瑰簲鐨刦rom
+							me.showData[detail_.type] = true;
+							
+							//缁欐墍鏈夌殑from鐨勬暟鎹祴鍊�
+							
+							me.form_[detail_.type] = detail_;
+							me.form_[detail_.type].userIds = [];
+							me.form_[detail_.type].userIds.push(detail_.roleName);
+							me.form_[detail_.type].userIds.push(detail_.userId);
+							
+							me.money += parseFloat(detail_.budget); 
+						}
+						
+						
+						
+					}
+				}).catch(error =>{
+				})
+				
+			},
+			
+			/* getDetailed() {
 				this.showData = this.showData_;
 				this.form_= this.form_objs;
 				this.money = 0;
@@ -1489,7 +1532,7 @@
 					form_obj = this.form_objs[itm_k];
 					this.money += parseFloat(form_obj.budget); 
 				}
-			},
+			}, */
 			
 			//鍗曚竴浜嬩欢
 			title_titleType(val) {
diff --git a/src/components/popup/prodetail.vue b/src/components/popup/prodetail.vue
index e99d785..165a581 100644
--- a/src/components/popup/prodetail.vue
+++ b/src/components/popup/prodetail.vue
@@ -1,23 +1,18 @@
 <template>
   <div class="class_dataImport">
-   
      <div style="height: 55vh; padding:0px; box-sizing:boder-box;">
-       <div style="width: 1px; height: 1px;" align="center">
-       	<substep  v-if="isShow1" ref="substep_zj" v-bind:xmId="xmId" v-bind:totalItems="totalItems"></substep>
-       </div>
-      <div style="width: 100%; height: 100%;" align="center">
-        <substepReadOnly v-if="isShow" v-bind:form_objs="form_objs" v-bind:showData_="showData_"></substepReadOnly>
-      </div>
+			<div style="width: 100%; height: 100%;" align="center">
+			  <substepReadOnly v-bind:xmId="rowData.id"></substepReadOnly>
+			</div>
     </div>
 		 
   </div>
 </template>
 
 <script>
-import substep from './portion/substep.vue'
 import substepReadOnly from './portion/substepReadOnly.vue'
 export default {
-  name: 'dataImport',
+ name: 'dataImport',
  props:{
  	  rowData:{
  		  type: Object,
@@ -26,33 +21,20 @@
  },
 	components: {
 		substepReadOnly,
-		substep
 	},
   data () {
     return {
-		userId: undefined,
-		assign: undefined,
-			loading_nextStep: false,
-			isShow1: false,
-			isShow: false,
-			loading_cancel: false,
-			
-			ruleForm: {},
-			xmId: null,
-			totalItems: [],
-			showData_: {},
-			form_objs: {},
-		
+			userId: null,
+			assign: null,
 		}
   },
 mounted() {
-	
 	this.userId = localStorage.getItem('userId');
 	this.assign = localStorage.getItem('assign');
-	this.loadData();
+	//this.loadData();
 },
   methods:{
-		loadData() {
+		/* loadData() {
 			
 			this.xmId = this.rowData.id;
 			this.isShow1 = true;
@@ -69,7 +51,7 @@
 				
 			},1000);
 			
-		},
+		}, */
   }
 }
 </script>
diff --git a/src/components/square.vue b/src/components/square.vue
index 74f3efa..c652f01 100644
--- a/src/components/square.vue
+++ b/src/components/square.vue
@@ -30,7 +30,7 @@
 			<div v-for="one in dataList" :key="one.id" class="list-item">
 				<el-row >
 				  <el-col :span="18"><div class="grid-content z_grid-content1 grid-content_text" @click="showItem(one)">{{one.title}}</div></el-col>
-				  <el-col :span="3"><div class="grid-content z_grid-content1 grid-content_exam" @click="showLinkItem(one)">{{formatter(one.examine)}}</div></el-col>
+				  <el-col :span="3"><div class="grid-content z_grid-content1 grid-content_exam" @click="showLinkItem(one)">{{formatter(one)}}</div></el-col>
 				  <el-col :span="3"><div class="grid-content z_grid-content1 grid-content_time">{{one.time}}</div></el-col>
 				</el-row>
 				
@@ -261,17 +261,17 @@
 				this.selectOne = one;
 			},
 			showLinkItem(one) {
-				this.dialogProdetail = true;
 				this.rowData = {
 					id: one.linkId,
 				}
+				this.dialogProdetail = true;
 			},
 			createNew() {
 				this.form = {};
 				this.dialogFormVisible = true;
 			},
-			formatter(exam){
-				if(exam){
+			formatter(one){
+				if(one.examine && one.linkId){
 					return "宸插叧鑱旈」鐩�";
 				}
 			},
@@ -312,7 +312,7 @@
 				let pageno = this.pagenum;
 				let url = "/api/topic/page/" + this.pageno;
 				let params =  {};
-				if(query){
+				if(query && query != {}){
 					params.title = query.title;
 					params.desp = query.desp;
 				}
diff --git a/src/views/calendarTask.vue b/src/views/calendarTask.vue
index f65229a..7683f38 100644
--- a/src/views/calendarTask.vue
+++ b/src/views/calendarTask.vue
@@ -30,12 +30,14 @@
 				<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>
@@ -133,11 +135,15 @@
 					doHandleTask() {
 						//姝d鐨勬槑缁嗕换鍔″畬鎴�
 						let id = this.handleTaskType.id;
+						if (!this.desc_task) {
+							this.$message('璇峰~鍐欐弿杩�');
+							return
+						}
+						this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
+							desp: this.desc_task
+						};
+						
 						if(this.handleTaskType.mustAttach) {
-							this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁�
-								desp: this.desc_task
-							},
-							
 							this.$refs.upload.submit();//寮�濮嬩笂浼�
 						}
 						else {
@@ -167,15 +173,23 @@
 						}
 					},
 					
-					// 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('涓婁紶鎴愬姛');
+				 },
+				 
+				 upError(err, file, fileList) {
+					 this.$message('涓婁紶澶辫触');
+				 },
 					
 					Cancel() {
 						this.dialog_1 = false;
diff --git a/src/views/list.vue b/src/views/list.vue
index ff4631b..b7f0699 100644
--- a/src/views/list.vue
+++ b/src/views/list.vue
@@ -230,14 +230,16 @@
 				this.rowData = {};
 			},
 			editProject() {
-				if(!this.selected || this.selected.status != "edit"){
+				if(!this.selected || this.selected.status == "finish"){
 					
-					this.$message({message:'璇烽�変腑涓�鏉℃湭鍚姩鐨勯」鐩�', type: 'warning'});
+					this.$message({message:'璇烽�変腑涓�鏉℃湭瀹屾垚鐨勯」鐩�', type: 'warning'});
 				}else {
 					this.rowData = {
 						id:this.selected.id,
 						desp:this.selected.desp,
 						name: this.selected.name,
+						beginDate: this.selected.beginDate,
+						endDate: this.selected.endDate,
 						objective:this.selected.reseachType,
 						items:[this.$moment(this.selected.startTime).format('YYYY-MM-DD'),this.$moment(this.selected.endTime).format('YYYY-MM-DD')]
 					}
diff --git a/vue.config.js b/vue.config.js
index 58558b8..af8c4d2 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -7,7 +7,7 @@
         proxy: {
             '/api/api': {
                 //target: 'http://srs.highdatas.com:8090',
-                target: 'http://localhost:9010',
+                target: 'http://fcfhyi.natappfree.cc',
 								
                 changeOrigin: true,
                 ws: true,

--
Gitblit v1.8.0