Browse Source

新增售前支持子类不可选

XuZinan 3 years ago
parent
commit
ee94395b98
1 changed files with 11 additions and 11 deletions
  1. 11 11
      pages/index/add.vue

+ 11 - 11
pages/index/add.vue

@@ -22,7 +22,7 @@
             placeholder="请选择项目"
             placeholder="请选择项目"
             keyName="fullName"
             keyName="fullName"
             :isJSON="true"
             :isJSON="true"
-						:candidates="projectList"
+            :candidates="projectList"
             @getValue="onChangeProject"
             @getValue="onChangeProject"
           />
           />
           <!-- <ld-select
           <!-- <ld-select
@@ -43,7 +43,7 @@
             v-model="formData.subTypeId"
             v-model="formData.subTypeId"
             labelKey="name"
             labelKey="name"
             valueKey="id"
             valueKey="id"
-						:disabled="currentType == 2"
+            :disabled="currentType.id == 2"
             @change="onChangeSubType"
             @change="onChangeSubType"
           />
           />
         </uni-forms-item>
         </uni-forms-item>
@@ -144,16 +144,16 @@ export default {
       this.currentSubType = {};
       this.currentSubType = {};
     },
     },
     onChangeProject(index) {
     onChangeProject(index) {
-			let project = this.projectList[index]
+      let project = this.projectList[index];
       this.formData.projectId = project.ID;
       this.formData.projectId = project.ID;
-			if(this.currentType.id == 2) {
-				let subList = this.currentType.children;
-				if(project.ID == '0') {
-					this.onChangeSubType(subList[0].id)
-				} else {
-					this.onChangeSubType(subList[1].id)
-				}
-			}
+      if (this.currentType.id == 2) {
+        let subList = this.currentType.children;
+        if (project.ID == "0") {
+          this.onChangeSubType(subList[0].id);
+        } else {
+          this.onChangeSubType(subList[1].id);
+        }
+      }
     },
     },
     onChangeSubType(value) {
     onChangeSubType(value) {
       this.formData.subTypeId = value;
       this.formData.subTypeId = value;