zhsxOtherTable2.vue 6.8 KB

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