guoxiaohuan 4 年之前
父节点
当前提交
83cc9c0b01
共有 5 个文件被更改,包括 39 次插入29 次删除
  1. 17 18
      src/store/index.js
  2. 15 4
      src/views/room/detail.vue
  3. 2 2
      src/views/room/index.vue
  4. 4 4
      src/views/room/room3.vue
  5. 1 1
      src/views/room/room4.vue

+ 17 - 18
src/store/index.js

@@ -1,6 +1,6 @@
-import Vue from "vue"
-import Vuex from "vuex"
-import { login, queryFloor, queryfmapID } from "@/api/login.js"
+import Vue from 'vue'
+import Vuex from 'vuex'
+import { login, queryFloor, queryfmapID } from '@/api/login.js'
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
@@ -8,15 +8,15 @@ export default new Vuex.Store({
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: "", //用户名称:艾宇;
-            orgCode: "",
-            username: "lengqiang", //账户名称
+            employeename: '', //用户名称:艾宇;
+            orgCode: '',
+            username: 'lengqiang', //账户名称
         },
-        plazaId: "1000423",
-        projectName: "", //全局项目名称
+        plazaId: '1000423',
+        projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: "",
+        fmapID: '',
     },
     getters: {
         floorsArr: (state) => state.floorsArr,
@@ -42,7 +42,6 @@ export default new Vuex.Store({
             state.floorsArr = data
             if (data.length > 0) {
                 data.forEach((e) => {
-                    console.log(e)
                     let obj = {
                         id: e.gname,
                         name: e.code,
@@ -61,19 +60,19 @@ export default new Vuex.Store({
             await login({
                 username: palyload,
             }).then((res) => {
-                if (res.result == "success") {
-                    commit("SETISREQUESTtAUTH", true)
-                    commit("SETAUTHMSG", res)
+                if (res.result == 'success') {
+                    commit('SETISREQUESTtAUTH', true)
+                    commit('SETAUTHMSG', res)
                 } else {
-                    console.log("接口报错!!")
-                    commit("SETISREQUESTtAUTH", false)
+                    console.log('接口报错!!')
+                    commit('SETISREQUESTtAUTH', false)
                 }
             })
         },
         getFloors(context) {
             queryFloor({ plazaId: context.state.plazaId }).then((res) => {
-                if (res.result == "success") {
-                    context.commit("SETFLOORS", res.data)
+                if (res.result == 'success') {
+                    context.commit('SETFLOORS', res.data)
                 }
             })
         },
@@ -81,7 +80,7 @@ export default new Vuex.Store({
             await queryfmapID({
                 mapId: context.state.plazaId,
             }).then((res) => {
-                context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
     },

+ 15 - 4
src/views/room/detail.vue

@@ -165,7 +165,7 @@ import { mapGetters } from 'vuex'
 import { queryHxsbDetail } from '@/api/room.js'
 
 export default {
-    props: ['type_code'],
+    props: ['row', 'floorChange'],
     data() {
         return {
             dialogFormVisible: false,
@@ -198,13 +198,13 @@ export default {
         ...mapGetters(['floorSelect', 'plazaId'])
     },
     mounted() {
-        if (this.type_code) {
+        if (this.row) {
             this.queryDetail()
             this.query()
         }
     },
     watch: {
-        type_code: {
+        row: {
             deep: true,
             handler: function(newV, oldV) {
                 if (newV != oldV) {
@@ -239,8 +239,19 @@ export default {
         queryDetail() {
             this.detailData = []
             let postParams = {
-                type_code: this.type_code //自定义分类内码 主要设备清单必传
+                manufacturer: this.row.manufacturer || '--',
+                sbxh: this.row.sbxh || '--',
+                brand: this.row.brand || '--',
+                location: '1572',
+                classstructureid: this.row.classstructureid,
+                type_code: this.row.type_code
             }
+            if (this.floorChange) {
+                postParams.gname = this.floorChange
+            }
+            // if (this.row.floorcode) {
+            //     postParams.floorcode = this.row.floorcode
+            // }
             let data = {
                 plazaId: this.plazaId,
                 page: this.pageDetail,

+ 2 - 2
src/views/room/index.vue

@@ -122,6 +122,7 @@
                             :page='page2'
                             :total='total2'
                             :size='size2'
+                            :floorChange='floorChange'
                             @Index2Emit='Index2Emit'
                         ></room-table3>
                     </el-tab-pane>
@@ -614,10 +615,9 @@ export default {
                 }
             }
             if (this.floorChange) {
-                data.gname = this.floorChange
+                postParams.gname = this.floorChange
             }
             queryHxsb({ data, postParams }).then(res => {
-                // console.log('核心设备', res)
                 this.loading2 = false
                 this.total2 = res.data.count
                 this.table3 = res.data.data ? res.data.data : []

+ 4 - 4
src/views/room/room3.vue

@@ -42,7 +42,7 @@
             ></el-pagination>
         </div>
         <el-dialog width='90%' title='设备清单' :visible.sync='innerVisible' append-to-body>
-            <detail v-if='type_code' :type_code='type_code'></detail>
+            <detail v-if='row' :row='row' :floorChange='floorChange'></detail>
         </el-dialog>
     </div>
 </template>
@@ -52,11 +52,11 @@ import Select from '@/components/Select/Select.vue'
 import Detail from './detail'
 
 export default {
-    props: ['table3', 'total', 'page', 'size', 'loading'],
+    props: ['table3', 'total', 'page', 'size', 'loading', 'floorChange'],
     data() {
         return {
             innerVisible: false,
-            type_code: ''
+            row: {}
         }
     },
 
@@ -69,7 +69,7 @@ export default {
             this.$emit('Index2Emit', page)
         },
         innerTable(row) {
-            this.type_code = row.type_code
+            this.row = row
             this.innerVisible = true
         }
     },

+ 1 - 1
src/views/room/room4.vue

@@ -29,7 +29,7 @@
                         <template slot-scope='{row}'>{{row.model||'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='数量' show-overflow-tooltip resizable>
-                        <template slot-scope='{row}'>{{row.cost||'--'}}</template>
+                        <template slot-scope='{row}'>{{row.cost!=0?row.cost:'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='费用(万元)' min-width='100' show-overflow-tooltip resizable>
                         <template slot-scope='{row}'>{{row.cost||'--'}}</template>