zhsxOtherTable2.vue 7.6 KB

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