zhsxOtherTable2.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. @row-click='innerTable'
  58. >
  59. <el-table-column label='序号' type='index' width='60' :index='indexMethod'></el-table-column>
  60. <el-table-column prop :show-overflow-tooltip='true' sortable label='任务名称' width='540'>
  61. <template slot-scope='{row}'>{{row.description||'--'}}</template>
  62. </el-table-column>
  63. <el-table-column prop label='状态' width='90'>
  64. <template slot-scope='{row}'>{{row.status||'--'}}</template>
  65. </el-table-column>
  66. <el-table-column prop label='部门' width='260' :show-overflow-tooltip='true'>
  67. <template slot-scope='{row}'>{{row.zgbm||'--'}}</template>
  68. </el-table-column>
  69. <el-table-column prop :show-overflow-tooltip='true' label='检测结论'>
  70. <template slot-scope='{row}'>{{row.conclusion||'--'}}</template>
  71. </el-table-column>
  72. </el-table>
  73. <div class='foot'>
  74. <el-pagination
  75. background
  76. layout='prev, pager, next'
  77. :total='total'
  78. :page-size='size'
  79. @prev-click='pageChanged'
  80. @next-click='pageChanged'
  81. @current-change='pageChanged'
  82. ></el-pagination>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. // import Select from '@/components/Select/Select.vue'
  88. import { Select } from 'meri-design'
  89. import { queryDsfrw } from '@/api/other.js'
  90. import { querySelect } from '@/api/public.js'
  91. export default {
  92. data() {
  93. return {
  94. loading: true,
  95. searVal: '',
  96. dsfTable: [],
  97. total: 0,
  98. page: 1,
  99. size: 10,
  100. status2: [],
  101. zgbm: [],
  102. conclusion: [],
  103. ztdsf: '',
  104. bmdsf: '',
  105. jcjldsf: ''
  106. }
  107. },
  108. components: { Select },
  109. methods: {
  110. indexMethod(index) {
  111. return (this.page - 1) * this.size + index + 1
  112. },
  113. // 第三方
  114. dsfjc() {
  115. let getParams = {
  116. plazaId: this.$store.state.plazaId,
  117. page: this.page,
  118. size: this.size
  119. }
  120. if (this.searVal) {
  121. getParams.keyword = `${this.searVal}:description`
  122. }
  123. if (this.ztdsf) {
  124. getParams.status2 = this.ztdsf
  125. }
  126. if (this.bmdsf) {
  127. getParams.status2 = this.bmdsf
  128. }
  129. if (this.jcjldsf) {
  130. getParams.conclusion = this.jcjldsf
  131. }
  132. queryDsfrw({ getParams }).then(res => {
  133. if (res.result == 'success') {
  134. this.loading = false
  135. this.total = res.count
  136. this.dsfTable = res.data ? res.data : []
  137. }
  138. //console.log('第三方', res)
  139. })
  140. },
  141. pageChanged(page) {
  142. this.page = page
  143. this.dsfjc()
  144. },
  145. //第三方任务
  146. innerTable(row) {
  147. if (row.wbgzglid) {
  148. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=DSF_GZGL&uniqueid=${row.wbgzglid}`, true)
  149. }
  150. },
  151. changeSelect() {
  152. this.department = []
  153. let postParams = [
  154. {
  155. columnName: { status: 'status', zgbm: 'zgbm', conclusion: 'conclusion' },
  156. tableName: 'v_glsms_dsfrw'
  157. }
  158. ]
  159. let data = {
  160. plazaId: this.$store.state.plazaId
  161. }
  162. querySelect({ data, postParams }).then(res => {
  163. //console.log('下拉框', res)
  164. let status2 = [],
  165. zgbm = [],
  166. conclusion = []
  167. status2 = res.data.data.v_glsms_dsfrw.status ? res.data.data.v_glsms_dsfrw.status : []
  168. zgbm = res.data.data.v_glsms_dsfrw.zgbm ? res.data.data.v_glsms_dsfrw.zgbm : []
  169. conclusion = res.data.data.v_glsms_dsfrw.conclusion ? res.data.data.v_glsms_dsfrw.conclusion : []
  170. if (status2.length > 0) {
  171. status2.forEach(el => {
  172. let obj = {
  173. id: el.key,
  174. name: el.value
  175. }
  176. this.status2.push(obj)
  177. })
  178. }
  179. if (zgbm.length > 0) {
  180. zgbm.forEach(el => {
  181. let obj = {
  182. id: el.key,
  183. name: el.value
  184. }
  185. this.zgbm.push(obj)
  186. })
  187. }
  188. if (conclusion.length > 0) {
  189. conclusion.forEach(el => {
  190. let obj = {
  191. id: el.key,
  192. name: el.value
  193. }
  194. this.conclusion.push(obj)
  195. })
  196. }
  197. })
  198. }
  199. },
  200. mounted() {
  201. this.changeSelect()
  202. }
  203. }
  204. </script>
  205. <style lang="less">
  206. .tableZh {
  207. .foot {
  208. height: 32px;
  209. display: flex;
  210. justify-content: flex-end;
  211. margin-top: 28px;
  212. }
  213. }
  214. </style>