zhsxOtherTable2.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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='任务名称' width='540'>
  81. <template slot-scope='{row}'>{{row.description||'--'}}</template>
  82. </el-table-column>
  83. <el-table-column prop label='状态' :show-overflow-tooltip='true' width='90'>
  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='检测结论'>
  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. }
  127. },
  128. components: { Select },
  129. methods: {
  130. indexMethod(index) {
  131. return (this.page - 1) * this.size + index + 1
  132. },
  133. // 第三方
  134. dsfjc() {
  135. let getParams = {
  136. plazaId: this.$store.state.plazaId,
  137. page: this.page,
  138. size: this.size
  139. }
  140. if (this.searVal) {
  141. getParams.keyword = `${this.searVal}:description`
  142. }
  143. if (this.ztdsf) {
  144. getParams.status = this.ztdsf
  145. }
  146. if (this.bmdsf) {
  147. getParams.keyword = `${this.bmdsf}:zgbm`
  148. }
  149. if (this.jcjldsf) {
  150. getParams.keyword = `${this.jcjldsf}:conclusion`
  151. }
  152. queryDsfrw({ getParams }).then(res => {
  153. if (res.result == 'success') {
  154. this.loading = false
  155. this.total = res.count
  156. this.dsfTable = res.data ? res.data : []
  157. }
  158. //console.log('第三方', res)
  159. })
  160. },
  161. pageChanged(page) {
  162. this.page = page
  163. this.dsfjc()
  164. },
  165. //第三方任务
  166. innerTable(row) {
  167. if (row.id) {
  168. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=DSF_GZGL&uniqueid=${row.id}`, true)
  169. }
  170. },
  171. changeSelect() {
  172. this.department = []
  173. let postParams = [
  174. {
  175. columnName: { status: 'status', zgbm: 'zgbm', conclusion: 'conclusion' },
  176. tableName: 'sms_dsfrw'
  177. }
  178. ]
  179. let data = {
  180. plazaId: this.$store.state.plazaId
  181. }
  182. querySelect({ data, postParams }).then(res => {
  183. //console.log('下拉框', res)
  184. let status2 = [],
  185. zgbm = [],
  186. conclusion = []
  187. status2 = res.data.data.sms_dsfrw.status ? res.data.data.sms_dsfrw.status : []
  188. zgbm = res.data.data.sms_dsfrw.zgbm ? res.data.data.sms_dsfrw.zgbm : []
  189. conclusion = res.data.data.sms_dsfrw.conclusion ? res.data.data.sms_dsfrw.conclusion : []
  190. if (status2.length > 0) {
  191. status2.forEach(el => {
  192. let obj = {
  193. id: el.key,
  194. name: el.value
  195. }
  196. this.status2.push(obj)
  197. })
  198. }
  199. if (zgbm.length > 0) {
  200. zgbm.forEach(el => {
  201. let obj = {
  202. id: el.key,
  203. name: el.value
  204. }
  205. this.zgbm.push(obj)
  206. })
  207. }
  208. if (conclusion.length > 0) {
  209. conclusion.forEach(el => {
  210. let obj = {
  211. id: el.key,
  212. name: el.value
  213. }
  214. this.conclusion.push(obj)
  215. })
  216. }
  217. })
  218. }
  219. },
  220. mounted() {
  221. this.changeSelect()
  222. }
  223. }
  224. </script>
  225. <style lang="less">
  226. .tableZh {
  227. .foot {
  228. height: 32px;
  229. display: flex;
  230. justify-content: flex-end;
  231. margin-top: 28px;
  232. }
  233. }
  234. </style>