Browse Source

下拉框数据

guoxiaohuan 4 years ago
parent
commit
4f938e0ccf

+ 0 - 3
src/views/other/gcfz1.vue

@@ -15,9 +15,6 @@
         <el-table-column prop label='面积(㎡)'>
             <template slot-scope='{row}'>{{row.area||'--'}}</template>
         </el-table-column>
-        <el-table-column prop label='工程经理(签字)'>
-            <template slot-scope='{row}'>{{'--'}}</template>
-        </el-table-column>
         <el-table-column prop label='记录日期'>
             <template slot-scope='{row}'>{{row.changedate||'--'}}</template>
         </el-table-column>

+ 1 - 10
src/views/other/gcfz2.vue

@@ -33,9 +33,6 @@
                 <el-table-column prop label='调整后库房总数(间)' width='170'>
                     <template slot-scope='{row}'>{{row.afterkf||'--'}}</template>
                 </el-table-column>
-                <el-table-column prop label='工程经理签字' width='130'>
-                    <template slot-scope='{row}'>{{'--'}}</template>
-                </el-table-column>
                 <el-table-column prop label='记录日期' width='130' :sortable='true'>
                     <template slot-scope='{row}'>{{row.changedate||'--'}}</template>
                 </el-table-column>
@@ -63,13 +60,7 @@ export default {
     data() {
         return {
             dateVal: '',
-            searVal: '',
-            dataSelect2: [
-                { id: 'test1', name: '选择项' },
-                { id: 'test2', name: '单平米' },
-                { id: 'test3', name: '下级分项' },
-                { id: 'test4', name: '滑动平均滑动平均' }
-            ]
+            searVal: ''
         }
     },
     computed: {

+ 6 - 5
src/views/other/gcfzDialog.vue

@@ -49,13 +49,14 @@ export default {
         // 辅助用房管理-汇总统计报
         query() {
             let getParams = {
-                plazaId: this.$store.state.plazaId
+                plazaId: '1000303'
+                // plazaId: this.$store.state.plazaId
             }
             querygcfzyfhz({ getParams }).then(res => {
                 if (res.result == 'success') {
                     console.log('汇总统计报', res)
                     this.loading = false
-                    this.hztjTable = res.data
+                    this.hztjTable = res.data ? res.data : []
                 }
             })
         },
@@ -63,8 +64,8 @@ export default {
         queryChange() {
             let getParams = {
                 plazaId: this.$store.state.plazaId,
-                page: 1,
-                size: 10,
+                page: this.page,
+                size: this.size,
                 floor: this.floor
             }
             queryfzyfchange({ getParams }).then(res => {
@@ -72,7 +73,7 @@ export default {
                     console.log('变更记录', res)
                     this.total = res.count
                     this.loading = false
-                    this.bgjlTable = res.data
+                    this.bgjlTable = res.data ? res.data : []
                 }
             })
         },

+ 0 - 1
src/views/other/otherDialog.vue

@@ -15,7 +15,6 @@
     </div>
 </template>
 <script>
-// import tableList from './table/eqListTable'
 import tableList from '../equipment/table/eqListTable'
 
 export default {

+ 0 - 20
src/views/other/zhsxOther.vue

@@ -29,7 +29,6 @@ import Select from '@/components/Select/Select.vue'
 import ZhsxDialog from './zhsxDialog'
 import zhsxOtherTable1 from './zhsxOtherTable1'
 import zhsxOtherTable2 from './zhsxOtherTable2'
-import { querySelect } from '@/api/public.js'
 export default {
     data() {
         return {
@@ -48,29 +47,10 @@ export default {
             } else if (tab.index == '1') {
                 this.$refs.tableZhsx2[0].dsfjc()
             }
-        },
-        changeSelect() {
-            let postParams = [
-                {
-                    columnName: { brand: 'brand', manufacturer: 'manufacturer' }, //列名称
-                    params: {
-                        // tab_code: '1572'
-                    },
-                    tableName: 'glsms_asset' //视图名称
-                }
-            ]
-            let data = {
-                // major: '弱电',
-                plazaId: '1001145'
-            }
-            querySelect({ data, postParams }).then(res => {
-                console.log('部门', res)
-            })
         }
     },
     mounted() {
         this.$refs.tableZhsx1[0].getZhjl()
-        this.changeSelect()
     }
 }
 </script>

+ 43 - 10
src/views/other/zhsxOtherTable1.vue

@@ -2,7 +2,16 @@
     <div class='tableZh'>
         <div class='tab-top'>
             <el-date-picker size='small' v-model='dateVal' type='date' style='margin-right:12px;width:140px' placeholder='日期'></el-date-picker>
-            <Select width='180' tipPlace='top' caption='政府部门' size='small' style='margin-right:12px' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
+            <Select
+                width='180'
+                tipPlace='top'
+                caption='政府部门'
+                size='small'
+                style='margin-right:12px'
+                v-if='department.length>0'
+                :selectdata='department'
+                :placeholder='"请选择"'
+            ></Select>
             <el-input placeholder='请按照记录事项搜索' size='small' prefix-icon='el-icon-search' v-model='searVal' style='width:200px'></el-input>
         </div>
         <el-table
@@ -48,6 +57,7 @@
 import moment from 'moment'
 import Select from '@/components/Select/Select.vue'
 import { queryGlams } from '@/api/other.js'
+import { querySelect } from '@/api/public.js'
 
 export default {
     data() {
@@ -55,16 +65,11 @@ export default {
             dateVal: '',
             loading: true,
             zhjlTable: [],
-            dataSelect2: [
-                { id: 'test1', name: '选择项' },
-                { id: 'test2', name: '单平米' },
-                { id: 'test3', name: '下级分项' },
-                { id: 'test4', name: '滑动平均滑动平均' }
-            ],
             searVal: '',
             total: 0,
             page: 1,
-            size: 10
+            size: 10,
+            department: []
         }
     },
     components: { Select },
@@ -83,7 +88,7 @@ export default {
                 if (res.result == 'success') {
                     this.loading = false
                     this.total = res.count
-                    this.zhjlTable = res.data
+                    this.zhjlTable = res.data ? res.data : []
                 }
                 console.log('综合记录', res)
             })
@@ -91,9 +96,37 @@ export default {
         pageChanged(page) {
             this.page = page
             this.getZhjl()
+        },
+        changeSelect() {
+            this.department = []
+            let postParams = [
+                {
+                    columnName: { department: 'department' },
+                    tableName: 'v_glsms_zhsxjl'
+                }
+            ]
+            let data = {
+                plazaId: this.$store.state.plazaId
+            }
+            querySelect({ data, postParams }).then(res => {
+                console.log('政府部门', res)
+                let department = []
+                department = res.data.data.v_glsms_zhsxjl.department ? res.data.data.v_glsms_zhsxjl.department : []
+                if (department.length > 0) {
+                    department.forEach(el => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value
+                        }
+                        this.department.push(obj)
+                    })
+                }
+            })
         }
     },
-    mounted() {}
+    mounted() {
+        this.changeSelect()
+    }
 }
 </script>
 <style lang="less">

+ 87 - 5
src/views/other/zhsxOtherTable2.vue

@@ -1,9 +1,36 @@
 <template>
     <div class='tableZh'>
         <div class='tab-top'>
-            <Select width='146' tipPlace='top' caption='状态' size='small' style='margin-right:12px' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
-            <Select width='146' tipPlace='top' caption='部门' size='small' style='margin-right:12px' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
-            <Select width='180' tipPlace='top' caption='检测结论' size='small' style='margin-right:12px' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
+            <Select
+                width='146'
+                tipPlace='top'
+                caption='状态'
+                size='small'
+                style='margin-right:12px'
+                v-if='status2.length>0'
+                :selectdata='status2'
+                :placeholder='"请选择"'
+            ></Select>
+            <Select
+                width='146'
+                tipPlace='top'
+                caption='部门'
+                v-if='zgbm.length>0'
+                size='small'
+                style='margin-right:12px'
+                :selectdata='zgbm'
+                :placeholder='"请选择"'
+            ></Select>
+            <Select
+                width='180'
+                tipPlace='top'
+                caption='检测结论'
+                size='small'
+                style='margin-right:12px'
+                v-if='conclusion.length>0'
+                :selectdata='conclusion'
+                :placeholder='"请选择"'
+            ></Select>
             <el-input placeholder='请按照任务名称搜索' size='small' prefix-icon='el-icon-search' v-model='searVal' style='width:200px'></el-input>
         </div>
         <el-table
@@ -44,6 +71,7 @@
 <script>
 import Select from '@/components/Select/Select.vue'
 import { queryDsfrw } from '@/api/other.js'
+import { querySelect } from '@/api/public.js'
 
 export default {
     data() {
@@ -59,7 +87,10 @@ export default {
             dsfTable: [],
             total: 0,
             page: 1,
-            size: 10
+            size: 10,
+            status2: [],
+            zgbm: [],
+            conclusion: []
         }
     },
     components: { Select },
@@ -75,7 +106,7 @@ export default {
                 if (res.result == 'success') {
                     this.loading = false
                     this.total = res.count
-                    this.dsfTable = res.data
+                    this.dsfTable = res.data ? res.data : []
                 }
                 console.log('第三方', res)
             })
@@ -83,7 +114,58 @@ export default {
         pageChanged(page) {
             this.page = page
             this.dsfjc()
+        },
+        changeSelect() {
+            this.department = []
+            let postParams = [
+                {
+                    columnName: { status2: 'status2', zgbm: 'zgbm', conclusion: 'conclusion' },
+                    tableName: 'v_glsms_dsfrw'
+                }
+            ]
+            let data = {
+                plazaId: this.$store.state.plazaId
+            }
+            querySelect({ data, postParams }).then(res => {
+                console.log('下拉框', res)
+                let status2 = [],
+                    zgbm = [],
+                    conclusion = []
+                status2 = res.data.data.v_glsms_dsfrw.status2 ? res.data.data.v_glsms_dsfrw.status2 : []
+                zgbm = res.data.data.v_glsms_dsfrw.zgbm ? res.data.data.v_glsms_dsfrw.zgbm : []
+                conclusion = res.data.data.v_glsms_dsfrw.conclusion ? res.data.data.v_glsms_dsfrw.conclusion : []
+                if (status2.length > 0) {
+                    status2.forEach(el => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value
+                        }
+                        this.status2.push(obj)
+                    })
+                }
+                if (zgbm.length > 0) {
+                    zgbm.forEach(el => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value
+                        }
+                        this.zgbm.push(obj)
+                    })
+                }
+                if (conclusion.length > 0) {
+                    conclusion.forEach(el => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value
+                        }
+                        this.conclusion.push(obj)
+                    })
+                }
+            })
         }
+    },
+    mounted() {
+        this.changeSelect()
     }
 }
 </script>

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

@@ -167,7 +167,7 @@ export default {
             queryHxsbDetail({ data, postParams }).then(res => {
                 console.log('钻取表', res)
                 this.loadingDetail = false
-                this.detailData = res.data.data
+                this.detailData = res.data.data ? res.data.data : []
                 this.totalDetail = res.data.count
             })
         },

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

@@ -141,7 +141,7 @@ export default {
                 if (res.result == 'success') {
                     this.loading1 = false
                     this.total1 = res.count
-                    this.table2 = res.data
+                    this.table2 = res.data ? res.data : []
                     console.log('明细表', res)
                 }
             })
@@ -158,7 +158,7 @@ export default {
                 console.log('核心设备', res)
                 this.loading2 = false
                 this.total2 = res.data.count
-                this.table3 = res.data.data
+                this.table3 = res.data.data ? res.data.data : []
             })
         },
         Index2Emit(val) {

+ 1 - 0
src/views/room/room2.vue

@@ -6,6 +6,7 @@
         </div>
         <div class='compute-table'>
             <el-table
+                v-if='table2.length>=0'
                 v-loading='loading'
                 :data='table2'
                 style='width: 100%'