123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <!-- 详情页面 -->
- <div class='gdqd-dialog'>
- <div class='top'></div>
- <div class='gdqd-dialog-top'>
- <el-input
- placeholder='搜索设备简称编号'
- style='width:192px;margin-right:12px'
- size='small'
- prefix-icon='el-icon-search'
- v-model='sbjc'
- clearable
- @keyup.enter.native='queryTableList'
- @blur='queryTableList'
- ></el-input>
- <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
- <Select
- width='160'
- style='margin: 0 12px;'
- v-model='status'
- tipPlace='top'
- caption='设备状态:'
- size='small'
- :selectdata='statusOption'
- @change='queryTableList'
- ></Select>
- <el-input
- placeholder='搜索品牌、型号'
- style='width:180px;margin-right:12px'
- size='small'
- clearable
- prefix-icon='el-icon-search'
- v-model='brand'
- @keyup.enter.native='queryTableList'
- @blur='queryTableList'
- ></el-input>
- <Select
- width='150'
- style='margin-right:12px;'
- v-model='floor'
- tipPlace='top'
- caption='楼层:'
- size='small'
- :selectdata='floorAllSelect'
- @change='queryTableList'
- ></Select>
- <el-input
- placeholder='搜索安装位置'
- @keyup.enter.native='queryTableList'
- @blur='queryTableList'
- clearable
- style='width:180px;margin-right:12px'
- size='small'
- prefix-icon='el-icon-search'
- v-model='wzjc'
- ></el-input>
- <!-- 多余的筛选 -->
- <input-dialog :type='1' @confirm='confirm'></input-dialog>
- </div>
- <el-table @row-click='innerTable' :data='tableData' :key='key' :border='true' style='width: 100%;amrgin-bottom:30px'>
- <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
- <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable min-width='150'>
- <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
- </el-table-column>
- <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
- <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
- </el-table-column>
- <el-table-column prop='sl' label='数量' width='60'>
- <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
- </el-table-column>
- <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
- </el-table-column>
- <el-table-column prop='sb_status' label='设备状态' width='80' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
- </el-table-column>
- <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
- <template slot-scope='{row}'>{{row.brand || '--'}}</template>
- </el-table-column>
- <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='80'>
- <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
- </el-table-column>
- <el-table-column prop='floor' sortable label='楼层' width='70' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
- </el-table-column>
- <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='150'>
- <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
- </el-table-column>
- <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='150'>
- <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
- </el-table-column>
- <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable min-width='150'>
- <template slot-scope='{row}'>{{row.fws || '--'}}</template>
- </el-table-column>
- <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='150'>
- <template slot-scope='{row}'>{{'--'}}</template>
- </el-table-column>
- </el-table>
- <div class='foot'>
- <el-pagination
- background
- layout='prev, pager, next'
- :total='total'
- :current-page.sync='page'
- :page-size='size'
- @prev-click='pageChanged'
- @next-click='pageChanged'
- @current-change='pageChanged'
- ></el-pagination>
- </div>
- </div>
- </template>
- <script>
- import { Select } from 'meri-design'
- import { mapGetters } from 'vuex'
- import { queryAsset } from '@/api/equipmentList.js'
- import { querySelect } from '@/api/public.js'
- import inputDialog from './inputDIalog'
- export default {
- data() {
- return {
- tableData: [],
- dataSelect2: [
- { id: 'test1', name: '选择项' },
- { id: 'test2', name: '单平米' },
- { id: 'test3', name: '下级分项' },
- { id: 'test4', name: '滑动平均滑动平均' },
- ],
- // page: 1,
- size: 10,
- total: 1,
- page:1,
- sbjc: '',
- brand: '',
- wzjc: '',
- floor: '1',
- status: '1',
- manufacturer: '',
- fws: '',
- sbglgs: '1',
- sbglgsOption: [],
- statusOption: [],
- floorAllSelect: [],
- key: 0,
- }
- },
- components: {
- Select,
- inputDialog,
- },
- computed: {
- ...mapGetters(['floorSelect']),
- },
- props: ['row', 'major','sign'],
- mounted() {
- this.queryTableList()
- this.tabFind()
- this.getFloorAllSelect()
- },
- methods: {
- innerTable(row) {
- console.log(row)
- if (row.assetuid) {
- window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
- }
- },
- //序号的方法
- indexMethod(index) {
- if (this.page) {
- return (this.page - 1) * this.size + index + 1
- }
- },
- //多余输入框监听
- confirm(fws, manufacturer) {
- //console.log(fws, manufacturer, '------')
- this.fws = fws
- this.manufacturer = manufacturer
- this.queryTableList()
- },
- //下拉框查询
- tabFind() {
- let postParams = [
- {
- columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
- params: {
- type_code: this.row.type_code,
- },
- tableName: 'sms_asset', //视图名称
- },
- ]
- let major
- if (this.major.slice(0, 2) == 'GD') {
- major = '供电'
- } else if (this.major.slice(0, 2) == 'XF') {
- major = '消防'
- } else if (this.major.slice(0, 2) == 'GPS') {
- major = '给排水'
- } else if (this.major.slice(0, 2) == 'DT') {
- major = '电梯'
- } else if (this.major.slice(0, 2) == 'RQ') {
- major = '燃气'
- } else {
- major = this.major
- }
- let data = {
- major: major,
- plazaId: this.$store.state.plazaId,
- }
- if(major!='土建'){
- data.onlyMainAsset = true
- }
- querySelect({ data, postParams }).then((res) => {
- //console.log(res)
- let sb_status = res.data.data.sms_asset.sb_status
- let sbglgs = res.data.data.sms_asset.sbglgs
- this.sbglgsOption = []
- this.sbglgsOption.push({
- name: '全部',
- id: '1',
- })
- this.statusOption = []
- this.statusOption.push({
- name: '全部',
- id: '1',
- })
- sb_status.forEach((el) => {
- this.statusOption.push({
- name: el.value,
- id: el.key,
- })
- })
- sbglgs.forEach((el) => {
- this.sbglgsOption.push({
- name: el.value,
- id: el.key,
- })
- })
- })
- },
- pageChanged(page) {
- this.page = page
- this.queryTableList()
- },
- queryTableList() {
- let major
- if (this.major.slice(0, 2) == 'GD') {
- major = '供电'
- } else if (this.major.slice(0, 2) == 'XF') {
- major = '消防'
- } else if (this.major.slice(0, 2) == 'GPS') {
- major = '给排水'
- } else if (this.major.slice(0, 2) == 'DT') {
- major = '电梯'
- } else if (this.major.slice(0, 2) == 'RQ') {
- major = '燃气'
- } else {
- major = this.major
- }
- let data = {
- major: major,
- plazaId: this.$store.state.plazaId,
- page: this.page,
- size: this.size,
- }
- //区分主要设备
- if(this.major != '土建'){
- data.onlyMainAsset = true
- }
- //输入框搜索
- data.keyword = ''
- if (this.sbjc) {
- data.keyword += `${this.sbjc}:sbjc,assetnum;`
- }
- if (this.brand) {
- data.keyword += `${this.brand}:brand,sbxh;`
- }
- if (this.wzjc) {
- data.keyword += `${this.wzjc}:wzjc;`
- }
- if (this.manufacturer) {
- data.keyword += `${this.manufacturer}:manufacturer;`
- }
- if (this.fws) {
- data.keyword += `${this.fws}:fws;`
- }
- if (data.keyword == '') {
- delete data.keyword
- }
- let postParams = {
- classstructureid: this.row.classstructureid,
- type_code: this.row.type_code,
- manufacturer: this.row.manufacturer || '--',
- sbxh: this.row.sbxh || '--',
- brand: this.row.brand || '--',
- }
- //下拉筛选
- if (this.floor && this.floor != 1) {
- postParams.gname = this.floor
- }
- if (this.sbglgs && this.sbglgs != 1) {
- postParams.sbglgs = this.sbglgs
- }
- if (this.status && this.status != 1) {
- postParams.status = this.status
- }
- queryAsset({ data, postParams }).then((res) => {
- //console.log(res)
- this.tableData = res.data.data
- this.total = res.data.count
- this.key++
- })
- },
- getFloorAllSelect() {
- this.floorAllSelect = []
- this.floorAllSelect.push({
- id: '1',
- name: '全部',
- })
- this.floorSelect.forEach((el) => {
- this.floorAllSelect.push(el)
- })
- console.log(this.floorAllSelect)
- },
- changePageEvent(){
- if(this.sign==1){
- this.page = 1
- }
- }
- },
- watch: {
- row: {
- handler(newV, oldV) {
- this.changePageEvent()
- this.queryTableList()
- this.getFloorAllSelect()
- this.tabFind()
- },
- deep: true,
- },
- sbglgs() {
- this.changePageEvent()
- this.queryTableList()
- },
- status() {
- this.changePageEvent()
- this.queryTableList()
- },
- floor() {
- this.changePageEvent()
- this.queryTableList()
- },
- },
- }
- </script>
- <style lang="less" scoped>
- .gdqd-dialog {
- // padding: 16px 24px 40px;
- // height: 610px;
- .gdqd-dialog-top {
- display: flex;
- margin-bottom: 12px;
- }
- td {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .foot {
- height: 32px;
- display: flex;
- justify-content: flex-end;
- margin-top: 28px;
- }
- }
- @media screen and (max-width: 1600px) {
- .gdqd-dialog td {
- padding: 4px 0;
- }
- }
- </style>
- <style lang="less">
- .gdqd-dialog {
- /deep/.el-table td {
- cursor: pointer;
- }
- }
- </style>
|