Browse Source

修改设备台账

zhangyu 5 years ago
parent
commit
586c8540ba
1 changed files with 24 additions and 8 deletions
  1. 24 8
      src/components/ledger/lib/linkassets.vue

+ 24 - 8
src/components/ledger/lib/linkassets.vue

@@ -12,7 +12,7 @@
     </el-row>
     <el-row style="margin-top:30px;" v-if="spaceShow">
       <span class="condition-title">分区类型空间实例:</span>
-      <el-cascader v-model="space" filterable clearable collapse-tags size="small" :options="spaceList" :props="props" @change="handleChangeSpace" @active-item-change='handleChangeSpaceItem' style="width:250px;"></el-cascader>
+      <el-cascader v-model="space" filterable clearable collapse-tags size="small" :options="spaceList" :props="props" @active-item-change='handleChangeSpaceItem' style="width:250px;"></el-cascader>
     </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button @click="handleClickClose">取 消</el-button>
@@ -151,6 +151,10 @@ export default {
             children: []
           }
         })
+        this.spaceList.unshift({
+          label: '不在任何业务空间内',
+          value: 'noKnow'
+        })
       })
     },
     // 修改设备类型
@@ -228,16 +232,28 @@ export default {
     toLinkAssets() {
       let query = {}
       // 校验必填项
-      if(!this.deviceType) {
-        this.$messge.info('请选择设备类型!')
-      } else if (!this.buildFloor.length) {
-        this.$messge.info('请选择建筑楼层!')
-      }
+      // if(!this.deviceType) {
+      //   this.$message.info('请选择设备类型!')
+      //   return false
+      // } else if (!this.buildFloor.length) {
+      //   this.$message.info('请选择建筑楼层!')
+      //   return false
+      // }
       if(this.spaceShow) {
-
+        query = {
+          deviceType: this.deviceType,
+          buildFloor: this.buildFloor,
+          spaceList: this.space.map(item => {
+            if(item[0] == 'noKnow')
+            return item[0]
+            if(item[1])
+            return item[1]
+          })
+        }
       } else {
         query = {
-          deviceType: this.deviceType
+          deviceType: this.deviceType,
+          buildFloor: this.buildFloor
         }
       }
     }