otherTable.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <!-- 设备设施其他事项 -->
  2. <template>
  3. <div class='qt-list'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. placeholder='搜索记录事项位置内容'
  7. style='width:192px;margin-right:12px'
  8. size='small'
  9. prefix-icon='el-icon-search'
  10. v-model='keyword'
  11. clearable
  12. @keyup.enter.native='pageChanged(1)'
  13. @blur='pageChanged(1)'
  14. ></el-input>
  15. <div class='picker-box'>
  16. <span class='picker-span'>选择处理日期:</span>
  17. <el-date-picker
  18. style='width:190px'
  19. v-model='handledate'
  20. value-format='yyyyMMdd'
  21. type='daterange'
  22. @change='pageChanged(1)'
  23. size='mini'
  24. range-separator='-'
  25. start-placeholder
  26. end-placeholder
  27. ></el-date-picker>
  28. </div>
  29. <Select
  30. width='180'
  31. tipPlace='top'
  32. caption='处置结果:'
  33. v-model='handleresults'
  34. :selectdata='handleOption'
  35. :placeholder='"请选择"'
  36. @change='pageChanged(1)'
  37. ></Select>
  38. </div>
  39. <div ref='tableBox'>
  40. <el-table :data='tableData' :border='true' style='width: 100%'>
  41. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  42. <el-table-column prop='lb' label='其他事项详情' align='center'>
  43. <el-table-column prop='zlwfwe' label='记录事项' show-overflow-tooltip resizable min-width='320'>
  44. <template slot-scope='{row}'>{{row.jlsx || '--'}}</template>
  45. </el-table-column>
  46. <el-table-column prop label='位置' show-overflow-tooltip resizable width='425'>
  47. <template slot-scope='{row}'>{{row.description || '--'}}</template>
  48. </el-table-column>
  49. <el-table-column prop='content' label='内容' show-overflow-tooltip resizable width='260'>
  50. <template slot-scope='{row}'>{{row.content || '--'}}</template>
  51. </el-table-column>
  52. <el-table-column prop='sl' label='数量' width='80'>
  53. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  54. </el-table-column>
  55. </el-table-column>
  56. <el-table-column prop='zfje' label='金额(万元)' width='80' align='right'>
  57. <template slot-scope='{row}'>{{row.zfje || '--'}}</template>
  58. </el-table-column>
  59. <el-table-column prop='handledate' label='处理日期' width='130'>
  60. <template slot-scope='{row}'>{{row.handledate?formatter(row.handledate): '--'}}</template>
  61. </el-table-column>
  62. <el-table-column prop='handleresults' label='处置结果' show-overflow-tooltip resizable width='100'>
  63. <template slot-scope='{row}'>{{row.handleresults || '--'}}</template>
  64. </el-table-column>
  65. <el-table-column prop='zlwfwz ' label='资料存放位置' show-overflow-tooltip resizable width='100'>
  66. <template slot-scope='{row}'>{{row.zlwfwz || '--'}}</template>
  67. </el-table-column>
  68. <el-table-column prop='recordtime' label='记录日期' width='140'>
  69. <template slot-scope='{row}'>{{row.createdate?formatter(row.createdate): '--'}}</template>
  70. </el-table-column>
  71. </el-table>
  72. </div>
  73. <div class='foot'>
  74. <el-pagination
  75. background
  76. layout='prev, pager, next'
  77. :total='total'
  78. :page-size='size'
  79. :current-page='currentPage'
  80. @prev-click='pageChanged'
  81. @next-click='pageChanged'
  82. @current-change='pageChanged'
  83. ></el-pagination>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import moment from 'moment'
  89. import { queryQtsx } from '@/api/equipmentList.js'
  90. import { mapGetters } from 'vuex'
  91. import { formatter, number_format } from '@/utils/format.js'
  92. import { querySelect } from '@/api/public.js'
  93. import { Select } from 'meri-design'
  94. export default {
  95. data() {
  96. return {
  97. tableData: [],
  98. total: 0,
  99. formatter,
  100. number_format,
  101. currentPage: 1,
  102. size: 10,
  103. keyword: '',
  104. handleresults: '1',
  105. handledate: '',
  106. handleOption: [],
  107. }
  108. },
  109. props: ['major', 'smsxt', 'tabLabel'],
  110. computed: {
  111. ...mapGetters(['floorSelect']),
  112. },
  113. methods: {
  114. //序号的方法
  115. indexMethod(index) {
  116. return (this.currentPage - 1) * this.size + index + 1
  117. },
  118. pageChanged(page) {
  119. this.currentPage = page
  120. this.getList()
  121. },
  122. getList() {
  123. let getParams = {
  124. data: {
  125. smsxt: this.smsxt,
  126. // tab: this.major,
  127. plazaId: this.$store.state.plazaId,
  128. page: this.currentPage,
  129. size: this.size,
  130. },
  131. }
  132. //输入框
  133. getParams.data.keyword = ''
  134. if (this.keyword) {
  135. getParams.data.keyword += `${this.keyword}:jlsx,location,content;`
  136. }
  137. if (getParams.data.keyword == '') {
  138. delete getParams.data.keyword
  139. }
  140. //时间
  141. if (this.handledate) {
  142. getParams.data.handledateStartDate = this.handledate[0] + '000000'
  143. // getParams.data.handledateEndDate = this.handledate[1] + '000000'
  144. getParams.data.handledateEndDate = moment(this.handledate[1]).format('YYYYMMDD235959')
  145. }
  146. //下拉
  147. if (this.handleresults && this.handleresults != 1) {
  148. getParams.data.handleresults = this.handleresults
  149. }
  150. queryQtsx(getParams).then((res) => {
  151. //console.log(res)
  152. this.tableData = res.data ? res.data : []
  153. this.total = res.count
  154. })
  155. },
  156. //下拉框查询
  157. tabFind() {
  158. let postParams = [
  159. {
  160. columnName: { handleresults: 'handleresults' },
  161. params: {
  162. system: this.smsxt,
  163. },
  164. tableName: 'sms_qtsx', //视图名称
  165. },
  166. ]
  167. let major
  168. if (this.major.slice(0, 2) == 'GD') {
  169. major = '供电'
  170. } else if (this.major.slice(0, 2) == 'XF') {
  171. major = '消防'
  172. } else if (this.major.slice(0, 2) == 'GPS') {
  173. major = '给排水'
  174. } else if (this.major.slice(0, 2) == 'DT') {
  175. major = '电梯'
  176. } else if (this.major.slice(0, 2) == 'RQ') {
  177. major = '燃气'
  178. } else if (this.major.slice(0, 2) == 'RD') {
  179. major = '弱电'
  180. } else if (this.major.slice(0, 2) == 'NT') {
  181. major = '暖通'
  182. } else if (this.major.slice(0, 2) == 'TJ') {
  183. major = '土建'
  184. } else {
  185. major = this.major
  186. }
  187. let data = {
  188. major: major,
  189. plazaId: this.$store.state.plazaId,
  190. }
  191. if (major != '土建') {
  192. data.onlyMainAsset = true
  193. }
  194. this.handleOption = []
  195. this.handleOption.push({
  196. id: '1',
  197. name: '全部',
  198. })
  199. querySelect({ data, postParams }).then((res) => {
  200. //console.log(res)
  201. let handleresults = res.data && res.data.data && res.data.data.sms_qtsx ? res.data.data.sms_qtsx.handleresults : []
  202. handleresults.forEach((el) => {
  203. this.handleOption.push({
  204. name: el.value,
  205. id: el.key,
  206. })
  207. })
  208. })
  209. },
  210. },
  211. watch: {
  212. smsxt(newV, oldV) {
  213. if (newV !== oldV) {
  214. this.tabFind()
  215. this.getList()
  216. }
  217. },
  218. tabLabel(newV, oldV) {
  219. if (newV !== oldV) {
  220. this.tabFind()
  221. this.getList()
  222. }
  223. },
  224. handleresults() {
  225. this.getList()
  226. },
  227. },
  228. mounted() {
  229. this.tabFind()
  230. //console.log(this.smsxt)
  231. this.getList()
  232. },
  233. }
  234. </script>
  235. <style lang="less" scoped>
  236. .qt-list {
  237. .eq-list-top {
  238. display: flex;
  239. margin-bottom: 12px;
  240. .picker-box {
  241. display: flex;
  242. align-items: center;
  243. background: #fff;
  244. padding: 0 6px;
  245. border: 1px solid #dcdfe6;
  246. border-radius: 4px;
  247. height: 32px;
  248. box-sizing: border-box;
  249. margin-right: 12px;
  250. .picker-span {
  251. margin-right: 6px;
  252. color: rgba(0, 0, 0, 0.65);
  253. }
  254. }
  255. }
  256. td {
  257. overflow: hidden;
  258. text-overflow: ellipsis;
  259. white-space: nowrap;
  260. }
  261. .foot {
  262. height: 32px;
  263. display: flex;
  264. justify-content: flex-end;
  265. margin-top: 28px;
  266. }
  267. }
  268. </style>
  269. <style lang="less" >
  270. .qt-list {
  271. .picker-box {
  272. .el-input__inner {
  273. border: none;
  274. }
  275. .el-range-editor.el-input__inner {
  276. padding: 3px 0px;
  277. }
  278. .el-icon-date {
  279. display: none;
  280. }
  281. .el-range__close-icon {
  282. position: absolute;
  283. right: 0px;
  284. top: 2px;
  285. }
  286. .el-range-editor--mini .el-range-input {
  287. font-size: 14px;
  288. color: rgb(31, 36, 41);
  289. }
  290. }
  291. }
  292. </style>