|
@@ -518,8 +518,11 @@ export default {
|
|
|
this.title = "添加任务";
|
|
this.title = "添加任务";
|
|
|
listProject().then(response => {
|
|
listProject().then(response => {
|
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
|
- if (this.selectProjectId) {
|
|
|
|
|
- this.form.projectId = this.selectProjectId
|
|
|
|
|
|
|
+ if (this.selectProjectId && this.projectOptions.length > 0) {
|
|
|
|
|
+ let ids = this.projectOptions.map(item => item.id);
|
|
|
|
|
+ if (ids.indexOf(this.selectProjectId) < 0) {
|
|
|
|
|
+ this.form.projectId = this.selectProjectId
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -612,6 +615,13 @@ export default {
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
|
|
+ if (this.projectOptions.length > 0) {
|
|
|
|
|
+ let ids = this.projectOptions.map(item => item.id);
|
|
|
|
|
+ if (ids.indexOf(this.form.projectId) > -1) {
|
|
|
|
|
+ this.$message.warning("不可选择分类")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
this.form.beginDate = this.form.rangeDate[0]
|
|
this.form.beginDate = this.form.rangeDate[0]
|
|
@@ -669,15 +679,15 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
cancelConfirm() {
|
|
cancelConfirm() {
|
|
|
- this.open = false;
|
|
|
|
|
- this.splitOpen = false;
|
|
|
|
|
this.confirmOpen = false;
|
|
this.confirmOpen = false;
|
|
|
- this.$refs.dut2.clearText()
|
|
|
|
|
- let dutSplit = this.$refs.dutSplit || [];
|
|
|
|
|
- for (let key in dutSplit) {
|
|
|
|
|
- dutSplit[key].clearText()
|
|
|
|
|
- }
|
|
|
|
|
- this.resetForm("splitForm");
|
|
|
|
|
|
|
+ // this.open = false;
|
|
|
|
|
+ // this.splitOpen = false;
|
|
|
|
|
+ // this.$refs.dut2.clearText()
|
|
|
|
|
+ // let dutSplit = this.$refs.dutSplit || [];
|
|
|
|
|
+ // for (let key in dutSplit) {
|
|
|
|
|
+ // dutSplit[key].clearText()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.resetForm("splitForm");
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/** 审核提交按钮 */
|
|
/** 审核提交按钮 */
|