zwTable.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!--专维-->
  2. <template>
  3. <div class='zw-list'>
  4. <div class='eq-list-top'>
  5. <el-date-picker size='small' v-model='nd' type='date' placeholder='请选择年度' @change='getList' style='width:180px;margin-right:12px'></el-date-picker>
  6. <Select width='146' tipPlace='top' caption='类别:' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
  7. <Select width='120' tipPlace='top' caption='项目 :' :selectdata='floorSelect' style='margin:0 12px' @change='getList'></Select>
  8. <Select width='180' tipPlace='top' caption='当前阶段' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
  9. <el-date-picker
  10. size='small'
  11. v-model='lxsjwcsj'
  12. type='date'
  13. placeholder='选择立项日期'
  14. @change='getList'
  15. style='width:180px;margin-left:12px;margin-right:12px'
  16. ></el-date-picker>
  17. <el-date-picker size='small' v-model='yssjwcsj' type='date' placeholder='选择验收日期' @change='getList' style='width:180px;margin-right:12px'></el-date-picker>
  18. <Select
  19. width='180'
  20. tipPlace='top'
  21. caption='验收结果'
  22. :selectdata='dataSelect2'
  23. :placeholder='"请选择"'
  24. style='margin-right:12px'
  25. >@change='getList'></Select>
  26. <el-input
  27. placeholder='请按照按照实施方案说明搜索'
  28. size='small'
  29. @change='getList'
  30. prefix-icon='el-icon-search'
  31. v-model='keyword'
  32. style='width:192px;margin-right:12px'
  33. ></el-input>
  34. </div>
  35. <el-table :data='tableData' :border='true' style='width: 100%'>
  36. <el-table-column type='index' label='序号' width='80'></el-table-column>
  37. <el-table-column prop='nd' label='年度' width='160' show-overflow-tooltip resizable>
  38. <template slot-scope='{row}'>{{row.nd || '--'}}</template>
  39. </el-table-column>
  40. <el-table-column prop='qs' label='期数' width='160' show-overflow-tooltip resizable>
  41. <template slot-scope='{row}'>{{row.qs || '--'}}</template>
  42. </el-table-column>
  43. <el-table-column prop='lb' label='类别' show-overflow-tooltip resizable>
  44. <template slot-scope='{row}'>{{row.lb || '--'}}</template>
  45. </el-table-column>
  46. <el-table-column prop='xm' label='项目' show-overflow-tooltip resizable>
  47. <template slot-scope='{row}'>{{row.xm || '--'}}</template>
  48. </el-table-column>
  49. <el-table-column prop='sl' label='数量' show-overflow-tooltip resizable>
  50. <template slot-scope='{row}'>{{row.sl || '--'}}</template>
  51. </el-table-column>
  52. <el-table-column prop='ssfasm' label='实施方案说明' show-overflow-tooltip resizable width='200'>
  53. <template slot-scope='{row}'>{{row.ssfasm || '--'}}</template>
  54. </el-table-column>
  55. <el-table-column prop='sxjd' label='当前阶段' show-overflow-tooltip resizable width='140'>
  56. <template slot-scope='{row}'>{{row.sxjd || '--'}}</template>
  57. </el-table-column>
  58. <el-table-column prop='lxsjwcsj' label='立项日期' show-overflow-tooltip resizable>
  59. <template slot-scope='{row}'>{{row.lxsjwcsj || '--'}}</template>
  60. </el-table-column>
  61. <el-table-column prop='yssjwcsj' label='验收日期' show-overflow-tooltip resizable>
  62. <template slot-scope='{row}'>{{row.yssjwcsj || '--'}}</template>
  63. </el-table-column>
  64. <el-table-column prop='status' label='验收结果' show-overflow-tooltip resizable>
  65. <template slot-scope='{row}'>{{row.status || '--'}}</template>
  66. </el-table-column>
  67. <el-table-column prop='zfje' label='结算金额' show-overflow-tooltip resizable>
  68. <template slot-scope='{row}'>{{row.zfje || '--'}}</template>
  69. </el-table-column>
  70. <el-table-column prop='xlcfwz' label='资料存放位置' width='180' show-overflow-tooltip resizable>
  71. <template slot-scope='{row}'>{{row.xlcfwz || '--'}}</template>
  72. </el-table-column>
  73. </el-table>
  74. <div class='foot'>
  75. <el-pagination
  76. background
  77. layout='prev, pager, next'
  78. :total='total/size'
  79. :page-size='size'
  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 Select from '@/components/Select/Select.vue'
  89. import { queryZw } from '@/api/equipmentList.js'
  90. import { mapGetters } from 'vuex'
  91. export default {
  92. components: { Select },
  93. data() {
  94. return {
  95. dataSelect2: [
  96. { id: 'test1', name: '选择项' },
  97. { id: 'test2', name: '单平米' },
  98. { id: 'test3', name: '下级分项' },
  99. { id: 'test4', name: '滑动平均滑动平均' }
  100. ],
  101. tableData: [],
  102. total: 0,
  103. currentPage: 1,
  104. yssjwcsj: '',
  105. lxsjwcsj: '',
  106. size: 10
  107. }
  108. },
  109. computed: {
  110. ...mapGetters(['floorSelect'])
  111. },
  112. props: ['smsxt', ''],
  113. methods: {
  114. pageChanged(page, size) {
  115. this.currentPage = page
  116. this.size = size
  117. this.getList()
  118. },
  119. //下拉框查询
  120. tabFind() {
  121. let postParams = [
  122. {
  123. columnName: { nd: 'nd', lb: 'lb', xm: 'xm', sxjd: 'sxjd' },
  124. params: {
  125. // tab_code: this.param
  126. },
  127. tableName: 'glsms_asset' //视图名称
  128. }
  129. ]
  130. // let major
  131. // if (this.major.slice(0, 2) == 'GD') {
  132. // major = '供电'
  133. // } else if (this.major.slice(0, 2) == 'XF') {
  134. // major = '消防'
  135. // } else if (this.major.slice(0, 2) == 'GPS') {
  136. // major = '给排水'
  137. // } else if (this.major.slice(0, 2) == 'DT') {
  138. // major = '电梯'
  139. // } else if (this.major.slice(0, 2) == 'RQ') {
  140. // major = '燃气'
  141. // } else {
  142. // major = this.major
  143. // }
  144. let data = {
  145. major: this.major,
  146. plazaId: this.$store.state.plazaId
  147. }
  148. querySelect({ data, postParams }).then(res => {
  149. console.log(res)
  150. let sb_status = res.data.data.glsms_asset.sb_status
  151. let sbglgs = res.data.data.glsms_asset.sbglgs
  152. this.sbglgsOption = []
  153. this.statusOption = []
  154. sb_status.forEach(el => {
  155. this.statusOption.push({
  156. name: el.value,
  157. id: el.key
  158. })
  159. })
  160. sbglgs.forEach(el => {
  161. this.sbglgsOption.push({
  162. name: el.value,
  163. id: el.key
  164. })
  165. })
  166. })
  167. },
  168. getList() {
  169. let getParams = {
  170. data: {
  171. smsxt: this.smsxt,
  172. // tab: this.major,
  173. // plazaId: this.$store.state.plazaId,
  174. plazaId: '1000287',
  175. page: this.currentPage,
  176. size: this.size
  177. }
  178. }
  179. queryZw(getParams).then(res => {
  180. this.tableData = res.data || []
  181. this.total = res.count
  182. })
  183. }
  184. },
  185. watch: {
  186. smsxt(newV, oldV) {
  187. if (newV !== oldV) {
  188. this.getList()
  189. }
  190. }
  191. },
  192. mounted() {
  193. // this.tabFind()
  194. this.getList()
  195. }
  196. }
  197. </script>
  198. <style lang="less" scoped>
  199. .zw-list {
  200. .eq-list-top {
  201. display: flex;
  202. margin-bottom: 12px;
  203. }
  204. td {
  205. overflow: hidden;
  206. text-overflow: ellipsis;
  207. white-space: nowrap;
  208. }
  209. .foot {
  210. height: 32px;
  211. display: flex;
  212. justify-content: flex-end;
  213. margin-top: 28px;
  214. }
  215. }
  216. </style>