|
@@ -122,6 +122,7 @@ export default {
|
|
|
}
|
|
|
let params = [
|
|
|
{
|
|
|
+ parent_type_id: Number(formData.typeId),
|
|
|
type_id: Number(formData.subTypeId),
|
|
|
comment: "",
|
|
|
data: [
|
|
@@ -149,6 +150,7 @@ export default {
|
|
|
};
|
|
|
this.currentType = item;
|
|
|
this.currentSubType = {};
|
|
|
+ this.subTypeList = [];
|
|
|
this.projectName = "";
|
|
|
if (!item.type) {
|
|
|
this.getProject(value);
|
|
@@ -160,21 +162,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async onChangeProject(index) {
|
|
|
- let project = this.projectList[index];
|
|
|
- this.formData.projectId = project.ID;
|
|
|
- this.projectName = project.fullName;
|
|
|
- await this.getSubType({
|
|
|
- parent_id: this.currentType.id,
|
|
|
- project_id: project.ID,
|
|
|
- });
|
|
|
- if (this.currentType.id == 35) {
|
|
|
- this.onChangeSubType(this.subTypeList[0].id);
|
|
|
- }
|
|
|
- if (this.currentType.id == 2) {
|
|
|
- if (index == 0) {
|
|
|
+ this.subTypeList = [];
|
|
|
+ this.formData.subTypeId = null;
|
|
|
+ if (index != -1) {
|
|
|
+ let project = this.projectList[index];
|
|
|
+ this.formData.projectId = project.ID;
|
|
|
+ this.projectName = project.fullName;
|
|
|
+ await this.getSubType({
|
|
|
+ parent_id: this.currentType.id,
|
|
|
+ project_id: project.ID,
|
|
|
+ });
|
|
|
+ if (this.currentType.id == 35) {
|
|
|
this.onChangeSubType(this.subTypeList[0].id);
|
|
|
- } else {
|
|
|
- this.onChangeSubType(this.subTypeList[1].id);
|
|
|
+ }
|
|
|
+ if (this.currentType.id == 2) {
|
|
|
+ if (index == 0) {
|
|
|
+ this.onChangeSubType(this.subTypeList[0].id);
|
|
|
+ } else {
|
|
|
+ this.onChangeSubType(this.subTypeList[1].id);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|