zhsxOtherTable2.vue 8.4 KB

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