Jelajahi Sumber

项目 添加学员 添加删除 文件 都好使了

husky 4 tahun lalu
induk
melakukan
576ef9f172
1 mengubah file dengan 44 tambahan dan 3 penghapusan
  1. 44 3
      components/home/teacher/project.vue

+ 44 - 3
components/home/teacher/project.vue

@@ -92,6 +92,7 @@
 							<th>下载</th>
 							<th>删除</th>
 							<th>审核</th>
+							<th>审核状态</th>
 						</tr>
 					</thead>
 					<tbody>
@@ -104,6 +105,7 @@
 							<th style="position: relative;"><button type="default" size="mini" @click="download(index,item)" class="m_edit">下载</button></th>
 							<th style="position: relative;"><button type="default" size="mini" @click="deleteFile(index,item)" class="m_delete">删除</button></th>
 							<th style="position: relative;"><button type="default" size="mini" @click="audit(index,item)" class="m_audit">审核</button></th>
+							<th>{{getShenheText(item.Pass)}}</th>
 						</tr>
 					</tbody>
 				</table>
@@ -416,6 +418,16 @@
 				this.currentSelect = {section:0,buttonType:'edit',index:index};
 				console.log("修改什么", this.currentSelect);
 			},
+
+			//审核状态中文
+			getShenheText(pass){
+				let t = "成功"
+				if (pass == false) {
+					t = "失败"
+				}
+				return t
+			},
+
 			deleteProject(index) {
 				this.title = "是否删除信息?";
 				this.arr = ["删除", "取消"]
@@ -439,7 +451,7 @@
                 this.arr = ["删除", "取消"]
                 this.show = true;
 
-                this.currentSelect = {section:0,buttonType:'deleteFile',index:index};
+                this.currentSelect = {section:0,buttonType:'deleteFile',index:index,item:item};
             },
 			// edit(index) {
 			// 	this.title = "是否删除信息?";
@@ -721,9 +733,10 @@
 				// 			// 			Pass: obj == 0
 				// 			// 		}
 				let data = {
-					"ProjectItemID" : obj.ProjectItemID.ProjectID,
+					"ProjectItemID" : obj.ProjectItemID.Id,
 					"Pass":obj.Pass,
 					}
+				console.log('审核 发送数据 '," 地址 ",url," 数据 ",data,"项目数据",this.projectData)
 				uni.request({
 					url: url,
 					data: data,
@@ -735,7 +748,7 @@
 							// this.$refs.table.getList();
 							// this.$forceUpdate()
 							// this.isShowAddMember = false
-
+							this.getFileList();
 						}
 					}
 				})
@@ -1059,6 +1072,34 @@
 				// this.currentSelect
 				console.log('删除文件', this.currentSelect)
 				// SetFilePass
+				let url = this.$Api + "/project/deleteprojectcontent"
+				// "UserID":"xxxx",           //上传人或者项目创建人
+				// 		"ProjectItemID" : "123"
+				let data = {
+					"UserID" : this.projectData[0].CreateUserID,
+					"ProjectItemID":this.currentSelect.item.Id
+				}
+				console.log('删除文件 发送数据 '," 地址 ",url," 数据 ",data,"项目数据",this.projectData)
+
+				uni.request({
+					url: url,
+					data: data,
+					method: "POST",
+					dataType: "json",
+					success: res => {
+						console.log('删除文件 返回',res)
+						if (res.data.Code == 100) {
+							// this.$refs.table.getList();
+							// this.$forceUpdate()
+							// this.isShowAddMember = false
+							this.getFileList();
+						}
+						// this.getMemberList();
+						// this.$forceUpdate()
+						// this.isShowAddMember = false
+						// this.projectData.splice(index,index);
+					}
+				})
             },
             DownloadFile() {
 				window.location.href = this.currentSelect.item.URL;