Hwt 3 years ago
parent
commit
c66d49c437

+ 100 - 93
operationSupport/src/views/ownerManagement/stepPage/poptreeSelect.vue

@@ -1,105 +1,112 @@
 <template>
-    <el-scrollbar class="el-scrollbar-byself" style="width: 100%">
-        <el-tree
-            :data="tenantsTree"
-            show-checkbox
-            node-key="value"
-            :props="treedefaultProps"
-            :default-checked-keys="defaultcheckedkeys"
-            ref="tenantstree"
-            @check-change="checkChange"
-        >
-            <div style="width: 100%" slot-scope="{ node, data }" @click="thisCheck($event, node, data)">{{ data.name }}</div>
-        </el-tree>
-    </el-scrollbar>
+  <el-scrollbar
+    class="el-scrollbar-byself"
+    style="width: 100%"
+  >
+    <el-tree
+      :data="tenantsTree"
+      show-checkbox
+      node-key="value"
+      :props="treedefaultProps"
+      :default-checked-keys="defaultcheckedkeys"
+      ref="tenantstree"
+      @check-change="checkChange"
+    >
+      <div
+        style="width: 100%"
+        slot-scope="{ node, data }"
+        @click="thisCheck($event, node, data)"
+      >{{ data.name }}</div>
+    </el-tree>
+  </el-scrollbar>
 </template>
 <script>
 export default {
-    props: ['params'],
-    data() {
-        return {
-            tenantsTree: [],
-            treedefaultProps: {
-                children: 'children',
-                label: 'name'
-            },
-            defaultcheckedkeys: []
-        };
+  props: ['params'],
+  data () {
+    return {
+      tenantsTree: [],
+      treedefaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      defaultcheckedkeys: []
+    };
+  },
+  computed: {},
+  mounted () {
+    console.log(this.$refs.tenantstree.$children);
+  },
+  methods: {
+    submit () {
+      let arrs = this.$refs.tenantstree.getCheckedNodes();
+      let combination = [];
+      arrs.forEach((item, index) => {
+        let thisValue = this.$refs.tenantstree.getNode(item);
+        let newValueIds = thisValue.data.id.split('-');
+        let objArray = {};
+        if (
+          (item.children == null || item.children == undefined) &&
+          !this.defaultcheckedkeys.includes(parseInt(thisValue.data.value))
+        ) {
+          if (thisValue.data.type === 'room') {
+            objArray = {
+              houseId: thisValue.data.value,
+              buildingName: newValueIds.length === 4 ? thisValue.parent.parent.data.name : thisValue.parent.data.name,
+              unitName: newValueIds.length === 4 ? thisValue.parent.data.name : '',
+              roomNumber: thisValue.data.name
+            };
+          } else if (thisValue.data.type === 'parking') {
+            objArray = {
+              parkingId: thisValue.data.value,
+              parkingNumber: thisValue.data.name,
+              partitionName: newValueIds.length === 4 ? thisValue.parent.data.name : '',
+              garageName: newValueIds.length === 4 ? thisValue.parent.parent.data.name : thisValue.parent.data.name
+            };
+          }
+          combination.push(objArray);
+        }
+      });
+
+      this.params.callback && this.params.callback(combination);
+      this.$emit('close');
     },
-    computed: {},
-    mounted() {
-        console.log(this.$refs.tenantstree.$children);
+    checkChange (data, checked) {
+      if (checked) {
+      }
     },
-    methods: {
-        submit() {
-            let arrs = this.$refs.tenantstree.getCheckedNodes();
-            let combination = [];
-            arrs.forEach((item, index) => {
-                let thisValue = this.$refs.tenantstree.getNode(item);
-                let newValueIds = thisValue.data.id.split('-');
-                let objArray = {};
-                if (
-                    (item.children == null || item.children == undefined) &&
-                    !this.defaultcheckedkeys.includes(parseInt(thisValue.data.value))
-                ) {
-                    if (thisValue.data.type === 'room') {
-                        objArray = {
-                            houseId: thisValue.data.value,
-                            buildingName: newValueIds.length === 4 ? thisValue.parent.parent.data.name : thisValue.parent.data.name,
-                            unitName: newValueIds.length === 4 ? thisValue.parent.data.name : '',
-                            roomNumber: thisValue.data.name
-                        };
-                    } else if (thisValue.data.type === 'parking') {
-                        objArray = {
-                            parkingId: thisValue.data.value,
-                            parkingNumber: thisValue.data.name,
-                            partitionName: newValueIds.length === 4 ? thisValue.parent.data.name : '',
-                            garageName: newValueIds.length === 4 ? thisValue.parent.parent.data.name : thisValue.parent.data.name
-                        };
-                    }
-                    combination.push(objArray);
-                }
-            });
-
-            this.params.callback && this.params.callback(combination);
-            this.$emit('close');
-        },
-        checkChange(data, checked) {
-            if (checked) {
-            }
-        },
-        filterTreeData(trData) {
-            trData.map((item, index) => {
-                if (this.isNotEmpty(item.children)) {
-                    item.disabled = true;
-                    this.filterTreeData(item.children);
-                } else {
-                    item.disabled = false;
-                }
-            });
-        },
-        isNotEmpty(arr) {
-            return arr && Array.isArray(arr) && arr.length > 0;
-        },
-        thisCheck(ev, node, data) {
-            if (!data.disabled) {
-                node.checked = !node.checked;
-            }
+    filterTreeData (trData) {
+      trData.map((item, index) => {
+        if (this.isNotEmpty(item.children)) {
+          item.disabled = true;
+          this.filterTreeData(item.children);
+        } else {
+          item.disabled = false;
         }
+      });
+    },
+    isNotEmpty (arr) {
+      return arr && Array.isArray(arr) && arr.length > 0;
     },
-    created() {
-        if (this.params.list.length !== 0) {
-            this.params.list.forEach((item, index) => {
-                if (this.params.num === 1) {
-                    this.defaultcheckedkeys.push(item.houseId);
-                } else {
-                    this.defaultcheckedkeys.push(item.parkingId);
-                }
-            });
+    thisCheck (ev, node, data) {
+      if (!data.disabled) {
+        node.checked = !node.checked;
+      }
+    }
+  },
+  created () {
+    if (this.params.list.length !== 0) {
+      this.params.list.forEach((item, index) => {
+        if (this.params.num === 1) {
+          this.defaultcheckedkeys.push(item.houseId);
+        } else {
+          this.defaultcheckedkeys.push(item.parkingId);
         }
-
-        this.filterTreeData(this.params.tenantsTree);
-        this.tenantsTree = this.params.tenantsTree;
+      });
     }
+
+    this.filterTreeData(this.params.tenantsTree);
+    this.tenantsTree = this.params.tenantsTree;
+  }
 };
 </script>

+ 2 - 2
smart/src/views/rechargeRecord/setpPage/details.vue

@@ -130,8 +130,8 @@ export default {
 
 
 
-
-    this.rechargeDetails[0].label = this.params.row.amount / 100;
+    debugger
+    this.rechargeDetails[0].label = (this.params.row.amount / 100).toFixed(2);
     this.rechargeDetails[1].label = (this.params.row.chargeNumber + '月');
     this.rechargeDetails[2].label = (this.params.row.credit + '月') || '-';
 

+ 14 - 13
smart/src/views/vehicleInformation/setpPage/native.vue

@@ -29,13 +29,15 @@
         :data="tenantsTree"
         show-checkbox
         node-key="value"
+        check-on-click-node
         :props="treedefaultProps"
         :default-checked-keys="defaultcheckedkeys"
         ref="tenantstree"
         @check-change="checkChange"
       >
+        <!--ref="tenantstree"  -->
         <div
-          style="width: 100%"
+          style="width: 100%;cursor: pointer;"
           slot-scope="{ node, data }"
           @click="thisCheck($event, node, data)"
         >{{ data.name }}</div>
@@ -86,18 +88,16 @@ export default {
         if (!!data.children && data.children.length > 0) {
           console.log("有子节点不可选")
         } else {
+          // checked.disabled = !checked.disabled;
+          this.$refs.tenantstree.setCheckedKeys([data.value], true);
           this.checkedData = data;
-          // 注意!!!
-          //1、下方的id和属性中 node-key="id"必须是同一个字段  
-          //2、$refs.tree 也需要和上方的属性匹配 ref="tree"
-          this.$refs.tenantstree.setCheckedKeys([data.value]);
-          this.value = data.value;
-          this.Information = data.name;
+          this.value = this.checkedData.value;
+          // console.log("checked data", data, this.checkedData)
+          this.Information = this.checkedData.name
         }
       }
-      this.value = this.checkedData.value;
-      console.log("checked data", data, this.checkedData)
-      this.Information = this.checkedData.name
+
+
 
 
     },
@@ -106,12 +106,14 @@ export default {
         this.positionInformation.push({ positionInformation: this.Information, id: this.id, value: this.value });
         this.params.callback(this.positionInformation);
         this.$emit('close');
+      } else {
+        this.$message('请重新选择车位号');
       }
 
     },
 
     filterTreeData (trData) {
-      console.log(trData)
+      debugger
       trData.map((item, index) => {
         if (this.isNotEmpty(item.children)) {
           item.disabled = true;
@@ -125,7 +127,7 @@ export default {
       return arr && Array.isArray(arr) && arr.length > 0;
     },
     thisCheck (ev, node, data) {
-
+      debugger
       if (!data.disabled) {
         node.checked = node.checked;
       }
@@ -144,7 +146,6 @@ export default {
     this.id = this.params.id;
     console.log(this.id);
     this.Information = this.params.positionInformation;
-    debugger;
     this.value = this.params.value;
     // 显示
     this.defaultcheckedkeys = [this.params.value]