Browse Source

adm:feat > 确定新增系统的类型

shaun-sheep 4 years ago
parent
commit
ac53d95c4b
3 changed files with 17 additions and 15 deletions
  1. 4 3
      src/components/ledger/lib/system.vue
  2. 8 8
      src/utils/handsontable/notShow.js
  3. 5 4
      src/utils/scan/tools.js

+ 4 - 3
src/components/ledger/lib/system.vue

@@ -35,8 +35,8 @@ export default {
       value: [],
       options: [],
       props: {
-        value: "Category",
-        label: "CategoryName"
+        value: "classCode",
+        label: "name"
       }
     };
   },
@@ -94,6 +94,7 @@ export default {
         type: 'system'
       }
       queryPhysicsAllType(param, res => {
+        console.log(res.content,'ppp')
         this.options = this.changeArr(res.content)
         if (this.value) {
           this.changeVal(this.value)
@@ -103,7 +104,7 @@ export default {
     changeArr(arr) {
       let data = [];
       arr.forEach(item => {
-        data.push({ classCode: item.classCode, name: item.name });
+        data.push({ classCode: item.classCode || item.code, name: item.name });
       });
       return data;
     }

+ 8 - 8
src/utils/handsontable/notShow.js

@@ -705,7 +705,7 @@ const showTools = {
               editor: "chosen",
               readOnly: onlyRead,
               chosenOptions: {
-                data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
               }
             };
           } else if (item.inputMode == "D2") {
@@ -716,7 +716,7 @@ const showTools = {
               readOnly: onlyRead,
               chosenOptions: {
                 multiple: true, //多选
-                data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
               }
             };
           } else if (item.inputMode == "A1" || item.inputMode == "A2") {
@@ -874,7 +874,7 @@ const showTools = {
               editor: "chosen",
               readOnly: onlyRead,
               chosenOptions: {
-                data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
               }
             };
           } else if (item.inputMode == "D2") {
@@ -885,7 +885,7 @@ const showTools = {
               readOnly: onlyRead,
               chosenOptions: {
                 multiple: true, //多选
-                data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
               }
             };
           } else if (item.inputMode == "A1" || item.inputMode == "A2") {
@@ -1081,7 +1081,7 @@ const showTools = {
         editor: "chosen",
         readOnly: onlyRead,
         chosenOptions: {
-          data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+          data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
         }
       };
     } else if (item.inputMode == "D2" || item.inputMode == "E2") { //多选输入
@@ -1092,7 +1092,7 @@ const showTools = {
         readOnly: onlyRead,
         chosenOptions: {
           multiple: true, //多选
-          data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+          data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
         }
       };
     } else if (item.inputMode == "A1" || item.inputMode == "A2") { //数字输入
@@ -1205,7 +1205,7 @@ const showTools = {
         editor: "chosen",
         readOnly: !item.editable,
         chosenOptions: {
-          data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+          data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
         }
       };
     } else if (item.inputMode == "D2" || item.inputMode == "E2") { //多选输入
@@ -1216,7 +1216,7 @@ const showTools = {
         readOnly: !item.editable,
         chosenOptions: {
           multiple: true, //多选
-          data: item.dataSource ? tools.formatdataSource(item.dataSource) : ""
+          data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
         }
       };
     } else if (item.inputMode == "A1" || item.inputMode == "A2") { //数字输入

+ 5 - 4
src/utils/scan/tools.js

@@ -472,12 +472,13 @@ tools.formatDataSource = function (data) {
   let arr = []
 
   function recursion(data) {
+    debugger
     let arr = []
     data.map((item) => {
-      if (item.Code && item.Name)
-        arr.push({Code: item.Code, Name: item.Name})
-      if (item.Content && item.Content.length)
-        arr = arr.concat(recursion(item.Content))
+      if (item.code && item.name)
+        arr.push({code: item.code, Name: item.name})
+      if (item.content && item.content.length)
+        arr = arr.concat(recursion(item.content))
     })
     return arr
   }