소스 검색

改变分类和项目清空子类

XuZinan 3 년 전
부모
커밋
942b0d19f9
3개의 변경된 파일23개의 추가작업 그리고 16개의 파일을 삭제
  1. 1 0
      components/cuihai-combox/cuihai-combox.vue
  2. 2 2
      manifest.json
  3. 20 14
      pages/WorkingHours/add.vue

+ 1 - 0
components/cuihai-combox/cuihai-combox.vue

@@ -238,6 +238,7 @@
 			clearInputValue() {
 				this.inputVal = "";
 				this.showSelector = false;
+				this.$emit('getValue', -1)
 			},
 			getInpuevals() {
 				if (this.arrays.length == 0) {

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "workload",
     "appid" : "__UNI__2F0D80E",
     "description" : "",
-    "versionName" : "2.0.0",
-    "versionCode" : 200,
+    "versionName" : "2.0.2",
+    "versionCode" : 202,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 20 - 14
pages/WorkingHours/add.vue

@@ -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);
+          }
         }
       }
     },