|
@@ -13,7 +13,7 @@
|
|
|
<!-- 设备列表 -->
|
|
|
<div class='equipment-list' v-if='list.length'>
|
|
|
<van-list v-model='loading' :finished='finished' finished-text='没有更多了' :offset='20' :immediate-check='false' @load='onLoad'>
|
|
|
- <div class='equipment' v-for='(item,index) in list' :key='index' @click="handleClickEquipDetail(item)">
|
|
|
+ <div class='equipment' v-for='(item,index) in list' :key='index' @click='handleClickEquipDetail(item)'>
|
|
|
<p class='title'>{{item.sbqc}}</p>
|
|
|
<div class='assetnum-attribution'>
|
|
|
<div class='assetnum'>
|
|
@@ -137,38 +137,60 @@ export default {
|
|
|
...mapGetters(['plazaId', 'smsxt', 'categoryId', 'floorsArr']),
|
|
|
},
|
|
|
components: {},
|
|
|
- created() {
|
|
|
- // 从路由中获取参数
|
|
|
- // brand, 品牌如果没有传递‘--’
|
|
|
- // classstructureid, 设备分类
|
|
|
- // manufacturer, 生产厂商 如果没有传递‘--’
|
|
|
- // sbxh, 设备类型 如果没有传递‘--’
|
|
|
- // type_code 自定义分类内码
|
|
|
- // TODO: 参数修改
|
|
|
+ activated() {
|
|
|
console.log(this.$route)
|
|
|
- let { type_name, sl, type_code, brand, classstructureid, manufacturer, sbxh } = this.$route.params
|
|
|
- this.title = `${type_name}(${sl})`
|
|
|
- this.type_code = type_code
|
|
|
- this.brand = brand || '--'
|
|
|
- this.classstructureid = classstructureid
|
|
|
- this.manufacturer = manufacturer || '--'
|
|
|
- this.sbxh = sbxh || '--'
|
|
|
-
|
|
|
- // 设置 筛选抽屉中的 楼层
|
|
|
- let floorList = [{ code: '全部', gcname: '全部', gcode: '全部', gname: '全部', seq: null, active: 'active' }]
|
|
|
- this.floorsArr.map(({ code, gcname, gcode, gname, seq }) => {
|
|
|
- floorList.push({ code, gcname, gcode, gname, seq, active: '' })
|
|
|
- })
|
|
|
- this.floorList = floorList
|
|
|
- // 查询列表
|
|
|
- this.onLoad()
|
|
|
- // 查询归属管理
|
|
|
- this.getOptions()
|
|
|
+ if (this.$route.params.initPage) {
|
|
|
+ this.initPage()
|
|
|
+ }
|
|
|
},
|
|
|
beforeMount() {},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
/**
|
|
|
+ * 初始化页面(从MainEquipment.vue页面进入时)
|
|
|
+ */
|
|
|
+ initPage() {
|
|
|
+ this.keyword = ''
|
|
|
+ this.page = 1
|
|
|
+ this.list = []
|
|
|
+ this.showPopup = false
|
|
|
+ this.attributionList = [{ text: '全部', id: '全部', active: 'active' }]
|
|
|
+ this.currentFloor = '全部'
|
|
|
+ this.currentAttribution = '全部'
|
|
|
+ this.modalData = {
|
|
|
+ floor: '',
|
|
|
+ attribution: '',
|
|
|
+ }
|
|
|
+ this.modalDataBak = {
|
|
|
+ floor: '',
|
|
|
+ attribution: '',
|
|
|
+ }
|
|
|
+ // 从路由中获取参数
|
|
|
+ // brand, 品牌如果没有传递‘--’
|
|
|
+ // classstructureid, 设备分类
|
|
|
+ // manufacturer, 生产厂商 如果没有传递‘--’
|
|
|
+ // sbxh, 设备类型 如果没有传递‘--’
|
|
|
+ // type_code 自定义分类内码
|
|
|
+ let { type_name, sl, type_code, brand, classstructureid, manufacturer, sbxh, initPage } = this.$route.params
|
|
|
+ this.title = `${type_name}(${sl})`
|
|
|
+ this.type_code = type_code
|
|
|
+ this.brand = brand || '--'
|
|
|
+ this.classstructureid = classstructureid
|
|
|
+ this.manufacturer = manufacturer || '--'
|
|
|
+ this.sbxh = sbxh || '--'
|
|
|
+
|
|
|
+ // 设置 筛选抽屉中的 楼层
|
|
|
+ let floorList = [{ code: '全部', gcname: '全部', gcode: '全部', gname: '全部', seq: null, active: 'active' }]
|
|
|
+ this.floorsArr.map(({ code, gcname, gcode, gname, seq }) => {
|
|
|
+ floorList.push({ code, gcname, gcode, gname, seq, active: '' })
|
|
|
+ })
|
|
|
+ this.floorList = floorList
|
|
|
+ // 查询列表
|
|
|
+ this.onLoad()
|
|
|
+ // 查询归属管理
|
|
|
+ this.getOptions()
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 查询管理归属下拉菜单
|
|
|
*/
|
|
|
async getOptions() {
|
|
@@ -199,9 +221,9 @@ export default {
|
|
|
*/
|
|
|
handleClickEquipDetail(item) {
|
|
|
if (item.assetid) {
|
|
|
- this.$router.push({ path: '/assetDetail', query: { assetid: item.assetid} })
|
|
|
+ this.$router.push({ path: '/assetDetail', query: { assetid: item.assetid } })
|
|
|
} else {
|
|
|
- console.error("缺少assetid!")
|
|
|
+ console.error('缺少assetid!')
|
|
|
}
|
|
|
},
|
|
|
/**
|