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='60'></el-table-column>
  59. <el-table-column prop :show-overflow-tooltip='true' sortable label='任务名称' width='540'>
  60. <template slot-scope='{row}'>{{row.description||'--'}}</template>
  61. </el-table-column>
  62. <el-table-column prop label='状态' width='90'>
  63. <template slot-scope='{row}'>{{row.status||'--'}}</template>
  64. </el-table-column>
  65. <el-table-column prop label='部门' width='260' :show-overflow-tooltip='true'>
  66. <template slot-scope='{row}'>{{row.zgbm||'--'}}</template>
  67. </el-table-column>
  68. <el-table-column prop :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 { Select } from 'meri-design'
  88. import { queryDsfrw } from '@/api/other.js'
  89. import { querySelect } from '@/api/public.js'
  90. export default {
  91. data() {
  92. return {
  93. loading: true,
  94. searVal: '',
  95. dsfTable: [],
  96. total: 0,
  97. page: 1,
  98. size: 10,
  99. status2: [],
  100. zgbm: [],
  101. conclusion: [],
  102. ztdsf: '',
  103. bmdsf: '',
  104. jcjldsf: ''
  105. }
  106. },
  107. components: { Select },
  108. methods: {
  109. // 第三方
  110. dsfjc() {
  111. let getParams = {
  112. plazaId: this.$store.state.plazaId,
  113. page: this.page,
  114. size: this.size
  115. }
  116. if (this.searVal) {
  117. getParams.keyword = `${this.searVal}:description`
  118. }
  119. if (this.ztdsf) {
  120. getParams.status2 = this.ztdsf
  121. }
  122. if (this.bmdsf) {
  123. getParams.status2 = this.bmdsf
  124. }
  125. if (this.jcjldsf) {
  126. getParams.conclusion = this.jcjldsf
  127. }
  128. queryDsfrw({ getParams }).then(res => {
  129. if (res.result == 'success') {
  130. this.loading = false
  131. this.total = res.count
  132. this.dsfTable = res.data ? res.data : []
  133. }
  134. //console.log('第三方', res)
  135. })
  136. },
  137. pageChanged(page) {
  138. this.page = page
  139. this.dsfjc()
  140. },
  141. changeSelect() {
  142. this.department = []
  143. let postParams = [
  144. {
  145. columnName: { status: 'status', zgbm: 'zgbm', conclusion: 'conclusion' },
  146. tableName: 'v_glsms_dsfrw'
  147. }
  148. ]
  149. let data = {
  150. plazaId: this.$store.state.plazaId
  151. }
  152. querySelect({ data, postParams }).then(res => {
  153. //console.log('下拉框', res)
  154. let status2 = [],
  155. zgbm = [],
  156. conclusion = []
  157. status2 = res.data.data.v_glsms_dsfrw.status ? res.data.data.v_glsms_dsfrw.status : []
  158. zgbm = res.data.data.v_glsms_dsfrw.zgbm ? res.data.data.v_glsms_dsfrw.zgbm : []
  159. conclusion = res.data.data.v_glsms_dsfrw.conclusion ? res.data.data.v_glsms_dsfrw.conclusion : []
  160. if (status2.length > 0) {
  161. status2.forEach(el => {
  162. let obj = {
  163. id: el.key,
  164. name: el.value
  165. }
  166. this.status2.push(obj)
  167. })
  168. }
  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>