zhsxOtherTable2.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <div class='tableZh'>
  3. <div class='tab-top'>
  4. <Select
  5. width='146'
  6. tipPlace='top'
  7. caption='状态'
  8. size='small'
  9. style='margin-right:12px'
  10. v-if='status2.length>0'
  11. :selectdata='status2'
  12. :placeholder='"请选择"'
  13. ></Select>
  14. <Select
  15. width='146'
  16. tipPlace='top'
  17. caption='部门'
  18. v-if='zgbm.length>0'
  19. size='small'
  20. style='margin-right:12px'
  21. :selectdata='zgbm'
  22. :placeholder='"请选择"'
  23. ></Select>
  24. <Select
  25. width='180'
  26. tipPlace='top'
  27. caption='检测结论'
  28. size='small'
  29. style='margin-right:12px'
  30. v-if='conclusion.length>0'
  31. :selectdata='conclusion'
  32. :placeholder='"请选择"'
  33. ></Select>
  34. <el-input placeholder='请按照任务名称搜索' size='small' prefix-icon='el-icon-search' v-model='searVal' style='width:200px'></el-input>
  35. </div>
  36. <el-table
  37. row-key='id'
  38. border
  39. v-loading='loading'
  40. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  41. :data='dsfTable'
  42. style='width: 100%;margin-top:12px'
  43. >
  44. <el-table-column label='序号' type='index' width='50'></el-table-column>
  45. <el-table-column prop='name' :show-overflow-tooltip='true' sortable label='任务名称'>
  46. <template slot-scope='{row}'>{{row.description||'--'}}</template>
  47. </el-table-column>
  48. <el-table-column prop='type' label='状态' width='90'>
  49. <template slot-scope='{row}'>{{row.status2||'--'}}</template>
  50. </el-table-column>
  51. <el-table-column prop='thing' label='部门' min-width='90' :show-overflow-tooltip='true'>
  52. <template slot-scope='{row}'>{{row.zgbm||'--'}}</template>
  53. </el-table-column>
  54. <el-table-column prop='name' :show-overflow-tooltip='true' label='检测结论'>
  55. <template slot-scope='{row}'>{{row.conclusion||'--'}}</template>
  56. </el-table-column>
  57. </el-table>
  58. <div class='foot'>
  59. <el-pagination
  60. background
  61. layout='prev, pager, next'
  62. :total='total'
  63. :page-size='size'
  64. @prev-click='pageChanged'
  65. @next-click='pageChanged'
  66. @current-change='pageChanged'
  67. ></el-pagination>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import Select from '@/components/Select/Select.vue'
  73. import { queryDsfrw } from '@/api/other.js'
  74. import { querySelect } from '@/api/public.js'
  75. export default {
  76. data() {
  77. return {
  78. loading: true,
  79. dataSelect2: [
  80. { id: 'test1', name: '选择项' },
  81. { id: 'test2', name: '单平米' },
  82. { id: 'test3', name: '下级分项' },
  83. { id: 'test4', name: '滑动平均滑动平均' }
  84. ],
  85. searVal: '',
  86. dsfTable: [],
  87. total: 0,
  88. page: 1,
  89. size: 10,
  90. status2: [],
  91. zgbm: [],
  92. conclusion: []
  93. }
  94. },
  95. components: { Select },
  96. methods: {
  97. // 第三方
  98. dsfjc() {
  99. let getParams = {
  100. plazaId: this.$store.state.plazaId,
  101. page: this.page,
  102. size: this.size
  103. }
  104. queryDsfrw({ getParams }).then(res => {
  105. if (res.result == 'success') {
  106. this.loading = false
  107. this.total = res.count
  108. this.dsfTable = res.data ? res.data : []
  109. }
  110. console.log('第三方', res)
  111. })
  112. },
  113. pageChanged(page) {
  114. this.page = page
  115. this.dsfjc()
  116. },
  117. changeSelect() {
  118. this.department = []
  119. let postParams = [
  120. {
  121. columnName: { status2: 'status2', zgbm: 'zgbm', conclusion: 'conclusion' },
  122. tableName: 'v_glsms_dsfrw'
  123. }
  124. ]
  125. let data = {
  126. plazaId: this.$store.state.plazaId
  127. }
  128. querySelect({ data, postParams }).then(res => {
  129. console.log('下拉框', res)
  130. let status2 = [],
  131. zgbm = [],
  132. conclusion = []
  133. status2 = res.data.data.v_glsms_dsfrw.status2 ? res.data.data.v_glsms_dsfrw.status2 : []
  134. zgbm = res.data.data.v_glsms_dsfrw.zgbm ? res.data.data.v_glsms_dsfrw.zgbm : []
  135. conclusion = res.data.data.v_glsms_dsfrw.conclusion ? res.data.data.v_glsms_dsfrw.conclusion : []
  136. if (status2.length > 0) {
  137. status2.forEach(el => {
  138. let obj = {
  139. id: el.key,
  140. name: el.value
  141. }
  142. this.status2.push(obj)
  143. })
  144. }
  145. if (zgbm.length > 0) {
  146. zgbm.forEach(el => {
  147. let obj = {
  148. id: el.key,
  149. name: el.value
  150. }
  151. this.zgbm.push(obj)
  152. })
  153. }
  154. if (conclusion.length > 0) {
  155. conclusion.forEach(el => {
  156. let obj = {
  157. id: el.key,
  158. name: el.value
  159. }
  160. this.conclusion.push(obj)
  161. })
  162. }
  163. })
  164. }
  165. },
  166. mounted() {
  167. this.changeSelect()
  168. }
  169. }
  170. </script>
  171. <style lang="less">
  172. .tableZh {
  173. .foot {
  174. height: 32px;
  175. display: flex;
  176. justify-content: flex-end;
  177. margin-top: 28px;
  178. }
  179. }
  180. </style>