|
@@ -388,8 +388,6 @@
|
|
|
associateDegreeNames: null,
|
|
|
associateDegrees: null
|
|
|
}
|
|
|
- // this.userList.forEach(u=>u.isChecked=false);
|
|
|
- // this.refreshParticipate();
|
|
|
} else {
|
|
|
this.title = "修改项目";
|
|
|
var arrs
|
|
@@ -407,7 +405,6 @@
|
|
|
} else {
|
|
|
name = ''
|
|
|
}
|
|
|
- console.log(name, '看看')
|
|
|
this.form = {
|
|
|
id: this.list[i].id,
|
|
|
projectName: this.list[i].projectName,
|
|
@@ -418,7 +415,6 @@
|
|
|
associateDegrees: arrs
|
|
|
}
|
|
|
var part = this.list[i].participator;
|
|
|
-
|
|
|
if (part.length>0) {
|
|
|
for (var j in part) {
|
|
|
this.userList.filter(u=>u.id == part[j].id)[0].isChecked = true;
|
|
@@ -439,36 +435,25 @@
|
|
|
let formData = new URLSearchParams();
|
|
|
formData.append("name", this.form.projectName);
|
|
|
formData.append("code", this.form.projectCode);
|
|
|
- formData.append("inchargerId", this.form.inchargerId);
|
|
|
+ if (this.form.inchargerId) {
|
|
|
+ formData.append("inchargerId", this.form.inchargerId);
|
|
|
+ }
|
|
|
+
|
|
|
for (var j in this.form.userId) {
|
|
|
formData.append("userId", this.form.userId[j]);
|
|
|
}
|
|
|
if(this.form.id != null) {
|
|
|
- // form.id = this.form.id;
|
|
|
formData.append("id", this.form.id);
|
|
|
}
|
|
|
- if(this.form.associateDegreeNames != '' && this.form.associateDegreeNames != null) {
|
|
|
+ if(this.form.associateDegreeNames) {
|
|
|
formData.append("associateDegreeNames", this.form.associateDegreeNames);
|
|
|
- } else {
|
|
|
- formData.append("associateDegreeNames", null);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- if(this.form.associateDegrees != null && this.form.associateDegrees.length != 0) {
|
|
|
+ if(this.form.associateDegrees) {
|
|
|
var sss = this.form.associateDegrees.toString()
|
|
|
formData.append("associateDegrees", sss);
|
|
|
- } else {
|
|
|
- formData.append("associateDegrees", null);
|
|
|
}
|
|
|
- // const config = {
|
|
|
- // // headers: {
|
|
|
- // // 'Content-Type': 'multipart/form-data',
|
|
|
-
|
|
|
- // // // 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
- // // },
|
|
|
- // // transformRequest: [function (data, headers) {
|
|
|
- // // return data;
|
|
|
- // // }],
|
|
|
- // }
|
|
|
+
|
|
|
this.$axios.post("/project/editProject", formData)
|
|
|
.then(res => {
|
|
|
if(res.code == "ok") {
|
|
@@ -483,6 +468,8 @@
|
|
|
this.$toast.fail(res.msg);
|
|
|
}
|
|
|
}).catch(err=> {this.$toast.clear();});
|
|
|
+
|
|
|
+
|
|
|
} else {
|
|
|
this.show = false;
|
|
|
this.yanjiuzx()
|