Bläddra i källkod

Merge remote-tracking branch 'origin/dev' into dev

shaun-sheep 4 år sedan
förälder
incheckning
d536f53d05

+ 17 - 2
src/components/business_space/business/handsontable.vue

@@ -196,10 +196,21 @@ export default {
     //获取表格数据
     getHeader(headers, buildFloorSelectd) {
       this.headers = headers
+      this.codeToDataSource = {}
       this.headers.forEach(item => {
         if (item.path) {
           this.inputMap[item.path] = item
         }
+        if (item.dataSource) {
+          try {
+            this.codeToDataSource[item.code] = {}
+            item.dataSource.forEach(dic => {
+              this.codeToDataSource[item.code][dic.code] = dic.name;
+            })
+          } catch (e) {
+            console.log(e);
+          }
+        }
       })
       this.buildFloorSelectd = buildFloorSelectd
       this.page.pageNumber = 1
@@ -666,8 +677,12 @@ export default {
               if (item.id == child.objectId) {
                 if (child.data || child.data == 0) {
                   this.headers.map(head => {
-                    if (head.InfoPointCode == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                    if (head.code == child.infoCode) {
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {

+ 16 - 1
src/components/ledger/handsontables/assets.vue

@@ -322,10 +322,21 @@ export default {
         };
         getDataDictionary(params, res => {
           this.tableHeader = res.content;
+          this.codeToDataSource = {}
           this.tableHeader.forEach(item => {
             if (item.path) {
               this.inputMap[item.path] = item
             }
+            if (item.dataSource) {
+              try {
+                this.codeToDataSource[item.code] = {}
+                item.dataSource.forEach(dic => {
+                  this.codeToDataSource[item.code][dic.code] = dic.name;
+                })
+              } catch (e) {
+                console.log(e);
+              }
+            }
           })
           this.getTableData()
           this.getAllData()
@@ -466,7 +477,11 @@ export default {
                 if (child.data || child.data == 0) {
                   this.tableHeader.map(head => {
                     if (head.code == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {

+ 16 - 1
src/components/ledger/handsontables/system.vue

@@ -192,10 +192,21 @@ export default {
         }
         getDataDictionary(params, res => {
           this.tableHeader = res.content;
+          this.codeToDataSource = {}
           this.tableHeader.forEach(item => {
             if (item.path) {
               this.inputMap[item.path] = item
             }
+            if (item.dataSource) {
+              try {
+                this.codeToDataSource[item.code] = {}
+                item.dataSource.forEach(dic => {
+                  this.codeToDataSource[item.code][dic.code] = dic.name;
+                })
+              } catch (e) {
+                console.log(e);
+              }
+            }
           })
           this.getTableData()
         });
@@ -361,7 +372,11 @@ export default {
                 if (!!child.data || child.data == 0) {
                   this.tableHeader.map(head => {
                     if (head.code == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {

+ 16 - 1
src/views/ledger/cenotelist/index.vue

@@ -154,10 +154,21 @@ export default {
       }
       await getDataDictionary(param, res => {
         this.tableHeader = res.content;
+        this.codeToDataSource = {}
         this.tableHeader.forEach(item => {
           if (item.path) {
             this.inputMap[item.path] = item
           }
+          if (item.dataSource) {
+            try {
+              this.codeToDataSource[item.code] = {}
+              item.dataSource.forEach(dic => {
+                this.codeToDataSource[item.code][dic.code] = dic.name;
+              })
+            } catch (e) {
+              console.log(e);
+            }
+          }
         })
         this.getTableData()
       })
@@ -508,7 +519,11 @@ export default {
                 if (child.data || child.data == 0) {
                   this.tableHeader.map(head => {
                     if (head.code == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {

+ 21 - 1
src/views/ledger/facility/parts/index.vue

@@ -173,6 +173,22 @@ export default {
       };
       await getDataDictionary(params, res => {
         this.tableHeader = res.content;
+        this.codeToDataSource = {}
+        this.tableHeader.forEach(item => {
+          if (item.path) {
+            this.inputMap[item.path] = item;
+          }
+          if (item.dataSource) {
+            try {
+              this.codeToDataSource[item.code] = {}
+              item.dataSource.forEach(dic => {
+                this.codeToDataSource[item.code][dic.code] = dic.name;
+              })
+            } catch (e) {
+              console.log(e);
+            }
+          }
+        });
         this.getTableData();
       });
     },
@@ -492,7 +508,11 @@ export default {
                 if (child.data || child.data == 0) {
                   this.tableHeader.map(head => {
                     if (head.code == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {

+ 16 - 1
src/views/ledger/rentlist/index.vue

@@ -167,10 +167,21 @@ export default {
       }
       await getDataDictionary(param, res => {
         this.tableHeader = res.content;
+        this.codeToDataSource = {}
         this.tableHeader.forEach(item => {
           if (item.path) {
             this.inputMap[item.path] = item
           }
+          if (item.dataSource) {
+            try {
+              this.codeToDataSource[item.code] = {}
+              item.dataSource.forEach(dic => {
+                this.codeToDataSource[item.code][dic.code] = dic.name;
+              })
+            } catch (e) {
+              console.log(e);
+            }
+          }
         })
         this.getTableData()
       })
@@ -539,7 +550,11 @@ export default {
                 if (child.data || child.data == 0) {
                   this.tableHeader.map(head => {
                     if (head.code == child.infoCode) {
-                      tools.setDataForKey(item, head.path, child.data);
+                      let contentVal = child.data
+                      if (this.codeToDataSource[child.infoCode]) {
+                        contentVal = this.codeToDataSource[child.infoCode][child.data]
+                      }
+                      tools.setDataForKey(item, head.path, contentVal);
                     }
                   });
                 } else {