eqDetaileDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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' :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='300'>
  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='250'>
  78. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  79. </el-table-column>
  80. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='160'>
  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='170'>
  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='250'>
  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='250'>
  93. <template slot-scope='{row}'>{{row.fws || '--'}}</template>
  94. </el-table-column>
  95. <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='250'>
  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='sonpage'
  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. sbjc: '',
  133. brand: '',
  134. wzjc: '',
  135. floor: '1',
  136. status: '1',
  137. manufacturer: '',
  138. fws: '',
  139. sbglgs: '1',
  140. sbglgsOption: [],
  141. statusOption: [],
  142. floorAllSelect: [],
  143. }
  144. },
  145. components: {
  146. Select,
  147. inputDialog,
  148. },
  149. computed: {
  150. ...mapGetters(['floorSelect']),
  151. },
  152. props: ['row', 'major', 'sonpage'],
  153. mounted() {
  154. this.queryTableList()
  155. this.tabFind()
  156. this.getFloorAllSelect()
  157. },
  158. methods: {
  159. innerTable(row) {
  160. console.log(row)
  161. if (row.assetuid) {
  162. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
  163. }
  164. },
  165. //序号的方法
  166. indexMethod(index) {
  167. if (this.sonpage) {
  168. return (this.sonpage - 1) * this.size + index + 1
  169. }
  170. },
  171. //多余输入框监听
  172. confirm(fws, manufacturer) {
  173. //console.log(fws, manufacturer, '------')
  174. this.fws = fws
  175. this.manufacturer = manufacturer
  176. this.queryTableList()
  177. },
  178. //下拉框查询
  179. tabFind() {
  180. let postParams = [
  181. {
  182. columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
  183. params: {
  184. type_code: this.row.type_code,
  185. },
  186. tableName: 'sms_asset', //视图名称
  187. },
  188. ]
  189. let major
  190. if (this.major.slice(0, 2) == 'GD') {
  191. major = '供电'
  192. } else if (this.major.slice(0, 2) == 'XF') {
  193. major = '消防'
  194. } else if (this.major.slice(0, 2) == 'GPS') {
  195. major = '给排水'
  196. } else if (this.major.slice(0, 2) == 'DT') {
  197. major = '电梯'
  198. } else if (this.major.slice(0, 2) == 'RQ') {
  199. major = '燃气'
  200. } else {
  201. major = this.major
  202. }
  203. let data = {
  204. major: major,
  205. plazaId: this.$store.state.plazaId,
  206. }
  207. querySelect({ data, postParams }).then((res) => {
  208. //console.log(res)
  209. let sb_status = res.data.data.sms_asset.sb_status
  210. let sbglgs = res.data.data.sms_asset.sbglgs
  211. this.sbglgsOption = []
  212. this.sbglgsOption.push({
  213. name: '全部',
  214. id: '1',
  215. })
  216. this.statusOption = []
  217. this.statusOption.push({
  218. name: '全部',
  219. id: '1',
  220. })
  221. sb_status.forEach((el) => {
  222. this.statusOption.push({
  223. name: el.value,
  224. id: el.key,
  225. })
  226. })
  227. sbglgs.forEach((el) => {
  228. this.sbglgsOption.push({
  229. name: el.value,
  230. id: el.key,
  231. })
  232. })
  233. })
  234. },
  235. pageChanged(page) {
  236. this.sonpage = page
  237. this.queryTableList()
  238. },
  239. queryTableList() {
  240. let major
  241. if (this.major.slice(0, 2) == 'GD') {
  242. major = '供电'
  243. } else if (this.major.slice(0, 2) == 'XF') {
  244. major = '消防'
  245. } else if (this.major.slice(0, 2) == 'GPS') {
  246. major = '给排水'
  247. } else if (this.major.slice(0, 2) == 'DT') {
  248. major = '电梯'
  249. } else if (this.major.slice(0, 2) == 'RQ') {
  250. major = '燃气'
  251. } else {
  252. major = this.major
  253. }
  254. let data = {
  255. major: major,
  256. plazaId: this.$store.state.plazaId,
  257. page: this.sonpage,
  258. size: this.size,
  259. }
  260. //输入框搜索
  261. data.keyword = ''
  262. if (this.sbjc) {
  263. data.keyword += `${this.sbjc}:sbjc,assetnum;`
  264. }
  265. if (this.brand) {
  266. data.keyword += `${this.brand}:brand,sbxh;`
  267. }
  268. if (this.wzjc) {
  269. data.keyword += `${this.wzjc}:wzjc;`
  270. }
  271. if (this.manufacturer) {
  272. data.keyword += `${this.manufacturer}:manufacturer;`
  273. }
  274. if (this.fws) {
  275. data.keyword += `${this.fws}:fws;`
  276. }
  277. if (data.keyword == '') {
  278. delete data.keyword
  279. }
  280. let postParams = {
  281. classstructureid: this.row.classstructureid,
  282. type_code: this.row.type_code,
  283. manufacturer: this.row.manufacturer || '--',
  284. sbxh: this.row.sbxh || '--',
  285. brand: this.row.brand || '--',
  286. }
  287. //下拉筛选
  288. if (this.floor && this.floor != 1) {
  289. postParams.gname = this.floor
  290. }
  291. if (this.sbglgs && this.sbglgs != 1) {
  292. postParams.sbglgs = this.sbglgs
  293. }
  294. if (this.status && this.status != 1) {
  295. postParams.status = this.status
  296. }
  297. queryAsset({ data, postParams }).then((res) => {
  298. //console.log(res)
  299. this.tableData = res.data.data
  300. this.total = res.data.count
  301. })
  302. },
  303. getFloorAllSelect() {
  304. this.floorAllSelect = []
  305. this.floorAllSelect.push({
  306. id: '1',
  307. name: '全部',
  308. })
  309. this.floorSelect.forEach((el) => {
  310. this.floorAllSelect.push(el)
  311. })
  312. console.log(this.floorAllSelect)
  313. },
  314. },
  315. watch: {
  316. row: {
  317. handler(newV, oldV) {
  318. this.queryTableList()
  319. this.getFloorAllSelect()
  320. this.tabFind()
  321. },
  322. deep: true,
  323. },
  324. sbglgs() {
  325. this.queryTableList()
  326. },
  327. status() {
  328. this.queryTableList()
  329. },
  330. floor() {
  331. this.queryTableList()
  332. },
  333. },
  334. }
  335. </script>
  336. <style lang="less" scoped>
  337. .gdqd-dialog {
  338. // padding: 16px 24px 40px;
  339. // height: 610px;
  340. .gdqd-dialog-top {
  341. display: flex;
  342. margin-bottom: 12px;
  343. }
  344. td {
  345. overflow: hidden;
  346. text-overflow: ellipsis;
  347. white-space: nowrap;
  348. }
  349. .foot {
  350. height: 32px;
  351. display: flex;
  352. justify-content: flex-end;
  353. margin-top: 28px;
  354. }
  355. }
  356. @media screen and (max-width: 1600px) {
  357. .gdqd-dialog td {
  358. padding: 4px 0;
  359. }
  360. }
  361. </style>
  362. <style lang="less">
  363. .gdqd-dialog {
  364. /deep/.el-table td {
  365. cursor: pointer;
  366. }
  367. }
  368. </style>