otherTable.vue 9.3 KB

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