eqDetaileDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <!-- 详情页面 -->
  3. <div class='gdqd-dialog'>
  4. <div class='top'></div>
  5. <div class='gdqd-dialog-top'>
  6. <el-input
  7. placeholder='搜索设备简称编号'
  8. style='width:192px;margin-right:12px'
  9. size='small'
  10. prefix-icon='el-icon-search'
  11. v-model='sbjc'
  12. clearable
  13. @keyup.enter.native='queryTableList'
  14. @blur='queryTableList'
  15. ></el-input>
  16. <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
  17. <Select
  18. width='160'
  19. style='margin: 0 12px;'
  20. v-model='status'
  21. tipPlace='top'
  22. caption='设备状态:'
  23. size='small'
  24. :selectdata='statusOption'
  25. @change='queryTableList'
  26. ></Select>
  27. <el-input
  28. placeholder='搜索品牌、型号'
  29. style='width:180px;margin-right:12px'
  30. size='small'
  31. clearable
  32. prefix-icon='el-icon-search'
  33. v-model='brand'
  34. @keyup.enter.native='queryTableList'
  35. @blur='queryTableList'
  36. ></el-input>
  37. <Select
  38. width='150'
  39. style='margin-right:12px;'
  40. v-model='floor'
  41. tipPlace='top'
  42. caption='楼层:'
  43. size='small'
  44. :selectdata='floorAllSelect'
  45. @change='queryTableList'
  46. ></Select>
  47. <el-input
  48. placeholder='搜索安装位置'
  49. @keyup.enter.native='queryTableList'
  50. @blur='queryTableList'
  51. clearable
  52. style='width:180px;margin-right:12px'
  53. size='small'
  54. prefix-icon='el-icon-search'
  55. v-model='wzjc'
  56. ></el-input>
  57. <!-- 多余的筛选 -->
  58. <input-dialog :type='1' @confirm='confirm'></input-dialog>
  59. </div>
  60. <el-table @row-click='innerTable' :data='tableData' :key='key' :border='true' style='width: 100%;amrgin-bottom:30px'>
  61. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  62. <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable min-width='150'>
  63. <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
  64. </el-table-column>
  65. <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
  66. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  67. </el-table-column>
  68. <el-table-column prop='sl' label='数量' width='60'>
  69. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  70. </el-table-column>
  71. <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
  72. <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
  73. </el-table-column>
  74. <el-table-column prop='sb_status' label='设备状态' width='80' show-overflow-tooltip resizable>
  75. <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
  76. </el-table-column>
  77. <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
  78. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  79. </el-table-column>
  80. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='80'>
  81. <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
  82. </el-table-column>
  83. <el-table-column prop='floor' sortable label='楼层' width='70' show-overflow-tooltip resizable>
  84. <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
  85. </el-table-column>
  86. <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='150'>
  87. <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
  88. </el-table-column>
  89. <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='150'>
  90. <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
  91. </el-table-column>
  92. <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable min-width='150'>
  93. <template slot-scope='{row}'>{{row.fws || '--'}}</template>
  94. </el-table-column>
  95. <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='150'>
  96. <template slot-scope='{row}'>{{'--'}}</template>
  97. </el-table-column>
  98. </el-table>
  99. <div class='foot'>
  100. <el-pagination
  101. background
  102. layout='prev, pager, next'
  103. :total='total'
  104. :current-page.sync='page'
  105. :page-size='size'
  106. @prev-click='pageChanged'
  107. @next-click='pageChanged'
  108. @current-change='pageChanged'
  109. ></el-pagination>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import { Select } from 'meri-design'
  115. import { mapGetters } from 'vuex'
  116. import { queryAsset } from '@/api/equipmentList.js'
  117. import { querySelect } from '@/api/public.js'
  118. import inputDialog from './inputDIalog'
  119. export default {
  120. data() {
  121. return {
  122. tableData: [],
  123. dataSelect2: [
  124. { id: 'test1', name: '选择项' },
  125. { id: 'test2', name: '单平米' },
  126. { id: 'test3', name: '下级分项' },
  127. { id: 'test4', name: '滑动平均滑动平均' },
  128. ],
  129. // page: 1,
  130. size: 10,
  131. total: 1,
  132. page:1,
  133. sbjc: '',
  134. brand: '',
  135. wzjc: '',
  136. floor: '1',
  137. status: '1',
  138. manufacturer: '',
  139. fws: '',
  140. sbglgs: '1',
  141. sbglgsOption: [],
  142. statusOption: [],
  143. floorAllSelect: [],
  144. key: 0,
  145. }
  146. },
  147. components: {
  148. Select,
  149. inputDialog,
  150. },
  151. computed: {
  152. ...mapGetters(['floorSelect']),
  153. },
  154. props: ['row', 'major','sign'],
  155. mounted() {
  156. this.queryTableList()
  157. this.tabFind()
  158. this.getFloorAllSelect()
  159. },
  160. methods: {
  161. innerTable(row) {
  162. console.log(row)
  163. if (row.assetuid) {
  164. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
  165. }
  166. },
  167. //序号的方法
  168. indexMethod(index) {
  169. if (this.page) {
  170. return (this.page - 1) * this.size + index + 1
  171. }
  172. },
  173. //多余输入框监听
  174. confirm(fws, manufacturer) {
  175. //console.log(fws, manufacturer, '------')
  176. this.fws = fws
  177. this.manufacturer = manufacturer
  178. this.queryTableList()
  179. },
  180. //下拉框查询
  181. tabFind() {
  182. let postParams = [
  183. {
  184. columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
  185. params: {
  186. type_code: this.row.type_code,
  187. },
  188. tableName: 'sms_asset', //视图名称
  189. },
  190. ]
  191. let major
  192. if (this.major.slice(0, 2) == 'GD') {
  193. major = '供电'
  194. } else if (this.major.slice(0, 2) == 'XF') {
  195. major = '消防'
  196. } else if (this.major.slice(0, 2) == 'GPS') {
  197. major = '给排水'
  198. } else if (this.major.slice(0, 2) == 'DT') {
  199. major = '电梯'
  200. } else if (this.major.slice(0, 2) == 'RQ') {
  201. major = '燃气'
  202. } else {
  203. major = this.major
  204. }
  205. let data = {
  206. major: major,
  207. plazaId: this.$store.state.plazaId,
  208. }
  209. if(major!='土建'){
  210. data.onlyMainAsset = true
  211. }
  212. querySelect({ data, postParams }).then((res) => {
  213. //console.log(res)
  214. let sb_status = res.data.data.sms_asset.sb_status
  215. let sbglgs = res.data.data.sms_asset.sbglgs
  216. this.sbglgsOption = []
  217. this.sbglgsOption.push({
  218. name: '全部',
  219. id: '1',
  220. })
  221. this.statusOption = []
  222. this.statusOption.push({
  223. name: '全部',
  224. id: '1',
  225. })
  226. sb_status.forEach((el) => {
  227. this.statusOption.push({
  228. name: el.value,
  229. id: el.key,
  230. })
  231. })
  232. sbglgs.forEach((el) => {
  233. this.sbglgsOption.push({
  234. name: el.value,
  235. id: el.key,
  236. })
  237. })
  238. })
  239. },
  240. pageChanged(page) {
  241. this.page = page
  242. this.queryTableList()
  243. },
  244. queryTableList() {
  245. let major
  246. if (this.major.slice(0, 2) == 'GD') {
  247. major = '供电'
  248. } else if (this.major.slice(0, 2) == 'XF') {
  249. major = '消防'
  250. } else if (this.major.slice(0, 2) == 'GPS') {
  251. major = '给排水'
  252. } else if (this.major.slice(0, 2) == 'DT') {
  253. major = '电梯'
  254. } else if (this.major.slice(0, 2) == 'RQ') {
  255. major = '燃气'
  256. } else {
  257. major = this.major
  258. }
  259. let data = {
  260. major: major,
  261. plazaId: this.$store.state.plazaId,
  262. page: this.page,
  263. size: this.size,
  264. }
  265. //区分主要设备
  266. if(this.major != '土建'){
  267. data.onlyMainAsset = true
  268. }
  269. //输入框搜索
  270. data.keyword = ''
  271. if (this.sbjc) {
  272. data.keyword += `${this.sbjc}:sbjc,assetnum;`
  273. }
  274. if (this.brand) {
  275. data.keyword += `${this.brand}:brand,sbxh;`
  276. }
  277. if (this.wzjc) {
  278. data.keyword += `${this.wzjc}:wzjc;`
  279. }
  280. if (this.manufacturer) {
  281. data.keyword += `${this.manufacturer}:manufacturer;`
  282. }
  283. if (this.fws) {
  284. data.keyword += `${this.fws}:fws;`
  285. }
  286. if (data.keyword == '') {
  287. delete data.keyword
  288. }
  289. let postParams = {
  290. classstructureid: this.row.classstructureid,
  291. type_code: this.row.type_code,
  292. manufacturer: this.row.manufacturer || '--',
  293. sbxh: this.row.sbxh || '--',
  294. brand: this.row.brand || '--',
  295. }
  296. //下拉筛选
  297. if (this.floor && this.floor != 1) {
  298. postParams.gname = this.floor
  299. }
  300. if (this.sbglgs && this.sbglgs != 1) {
  301. postParams.sbglgs = this.sbglgs
  302. }
  303. if (this.status && this.status != 1) {
  304. postParams.status = this.status
  305. }
  306. queryAsset({ data, postParams }).then((res) => {
  307. //console.log(res)
  308. this.tableData = res.data.data
  309. this.total = res.data.count
  310. this.key++
  311. })
  312. },
  313. getFloorAllSelect() {
  314. this.floorAllSelect = []
  315. this.floorAllSelect.push({
  316. id: '1',
  317. name: '全部',
  318. })
  319. this.floorSelect.forEach((el) => {
  320. this.floorAllSelect.push(el)
  321. })
  322. console.log(this.floorAllSelect)
  323. },
  324. changePageEvent(){
  325. if(this.sign==1){
  326. this.page = 1
  327. }
  328. }
  329. },
  330. watch: {
  331. row: {
  332. handler(newV, oldV) {
  333. this.changePageEvent()
  334. this.queryTableList()
  335. this.getFloorAllSelect()
  336. this.tabFind()
  337. },
  338. deep: true,
  339. },
  340. sbglgs() {
  341. this.changePageEvent()
  342. this.queryTableList()
  343. },
  344. status() {
  345. this.changePageEvent()
  346. this.queryTableList()
  347. },
  348. floor() {
  349. this.changePageEvent()
  350. this.queryTableList()
  351. },
  352. },
  353. }
  354. </script>
  355. <style lang="less" scoped>
  356. .gdqd-dialog {
  357. // padding: 16px 24px 40px;
  358. // height: 610px;
  359. .gdqd-dialog-top {
  360. display: flex;
  361. margin-bottom: 12px;
  362. }
  363. td {
  364. overflow: hidden;
  365. text-overflow: ellipsis;
  366. white-space: nowrap;
  367. }
  368. .foot {
  369. height: 32px;
  370. display: flex;
  371. justify-content: flex-end;
  372. margin-top: 28px;
  373. }
  374. }
  375. @media screen and (max-width: 1600px) {
  376. .gdqd-dialog td {
  377. padding: 4px 0;
  378. }
  379. }
  380. </style>
  381. <style lang="less">
  382. .gdqd-dialog {
  383. /deep/.el-table td {
  384. cursor: pointer;
  385. }
  386. }
  387. </style>