Parcourir la source

修改项目bug修复

yichael il y a 4 ans
Parent
commit
2112cdc343
1 fichiers modifiés avec 53 ajouts et 20 suppressions
  1. 53 20
      components/home/teacher/project.vue

+ 53 - 20
components/home/teacher/project.vue

@@ -211,7 +211,7 @@
 			</view>
 		</view>
 		<!--修改文件对话框-->
-		<view class="pop_view" @touchmove.stop.prevent = "stopPenetrate" @click="shut_down_pop_view()" v-if='bShowPopView'>
+		<view class="pop_view" @touchmove.stop.prevent = "stopPenetrate" @click="shut_down_pop_view()" v-if='bShowEdit'>
 			<view class="edit_form" @touchmove.stop.prevent = "stopPenetrate">
 				<view class="edit_BG">
 					<view class="edit_title">修改</view>
@@ -225,7 +225,16 @@
 					<view class="edit_row">
 						<text class="edit_text">类型</text>
 						<view class="input_frame">
-							<input class="edit_input"  type="string" v-model="projectType" placeholder="" @input="onInputProjectType"/>
+							<!-- <input class="edit_input"  type="string" v-model="projectType" placeholder="" @input="onInputProjectType"/> -->
+							
+							<picker class="form-input" @change="onInputProjectType" :value="projectType" :range="proType">
+							 	<view class=" df fdr aic jcsb">
+							 		<view>{{proType[projectType]}}</view>
+							 		<view>
+							 			<img src="../../../assets/user/pic_user_03.png" />
+							 		</view>
+							 	</view>
+							 </picker>
 						</view>
 					</view>
 					<view class="edit_row">
@@ -234,10 +243,24 @@
 							<input class="edit_input"  type="string" v-model="projectDescribe" placeholder="" @input="onInputProjectDescribe"/>
 						</view>
 					</view>
+					
+					<view class='modify_btn'>
+						<button type="default" size="mini" @click="confirm_modify()" class="modify_confirm">确认</button>
+						<button type="default" size="mini" @click="cancel_modify()" class="modify_cancel">取消</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!--上传文件对话框-->
+		<view class="pop_view" @touchmove.stop.prevent = "stopPenetrate" @click="shut_down_pop_view()" v-if='bShowUpLoadFile'>
+			<view class="edit_form" @touchmove.stop.prevent = "stopPenetrate">
+				<view class="edit_BG">
+					<view class="edit_title">上传文件</view>
+				
 					<view class="edit_row">
-						<text class="edit_text">创建人姓名</text>
+						<text class="edit_text">名</text>
 						<view class="input_frame">
-							<input class="edit_input"  type="string" v-model="projectData.CreateUserName" placeholder=""/>
+							<input class="edit_input" type="string" v-model="projectName" placeholder="" @input="onInputProjectName"/>
 						</view>
 					</view>
 					
@@ -248,7 +271,6 @@
 				</view>
 			</view>
 		</view>
-		
 		<!--上传文件对话框-->
 		<view class="m_msg" v-show="isShowAddFile">
 			<table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
@@ -256,7 +278,6 @@
 				<tr>
 					<th>名字</th>
 					<th>类型</th>
-					<!--<th>介绍</th>-->
 				</tr>
 				</thead>
 				<tbody>
@@ -323,10 +344,13 @@
 				index_proType : 0,
 				index_FileType : 0,
                 fileDialogData : {name : "", type :""},
-				bShowPopView:false,
+				//修改项目信息
+				bShowEdit:false,
 				projectName:'',
-				projectType:'',
+				projectType:0,
 				projectDescribe:'',
+				//上传文件
+				bShowUpLoadFile:false,
 			}
 		},
 		components: {
@@ -357,9 +381,18 @@
 			editProject(index) {
 				//修改按钮赋值
 				this.projectName=this.projectData[0].ProjectName;
-				this.projectType=this.projectData[0].Type;
+				
+				for(let i=0;i<this.proType.length;i++)
+				{
+					let item = this.proType[i];
+					if(item == this.projectData[0].Type)
+					{
+						this.projectType = i;
+					}
+				}
+				// this.projectType=this.projectData[0].Type;
 				this.projectDescribe=this.projectData[0].Describe;
-				this.bShowPopView = true;
+				this.bShowEdit = true;
 			},
 			//审核状态中文
 			getShenheText(pass){
@@ -785,23 +818,23 @@
 				window.location.href = this.currentSelect.item.URL;
             },
 			shut_down_pop_view(){
-				// this.bShowPopView = false;
+				// this.bShowEdit = false;
 			},
 			confirm_modify(){
-				this.bShowPopView = false;
+				this.bShowEdit = false;
 				
-				 this.projectData[0].ProjectName = this.projectName;
-				 this.projectData[0].Type = this.projectType;
-				 this.projectData[0].Describe = this.projectDescribe;
+				this.projectData[0].ProjectName = this.projectName;
+				this.projectData[0].Type = this.proType[this.projectType];
+				this.projectData[0].Describe = this.projectDescribe;
 				 
-				 uni.request({
+				uni.request({
 				 	url: this.$Api + "/project/changeprojectinfo",
 				 	data: {
 				 		"UserID":this.projectData[0].CreateUserID,
 				 		"ProjectID" : this.projectData[0].Id,
-				 		"ProjectName":this.projectName,
-				 		"Describe":this.projectDescribe,              // 项目描述
-				 		"Type":this.projectType
+				 		"ProjectName":this.projectData[0].ProjectName,
+				 		"Describe":this.projectData[0].Describe,              // 项目描述
+				 		"Type":this.projectData[0].Type
 				 	},
 				 	method: "POST",
 				 	dataType: "json",
@@ -814,7 +847,7 @@
 				 }) 
 			},
 			cancel_modify(){
-				this.bShowPopView = false;
+				this.bShowEdit = false;
 				this.projectName=this.projectData[0].ProjectName;
 				this.projectType=this.projectData[0].Type;
 				this.projectDescribe=this.projectData[0].Describe;