zhsxOtherTable1.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class='tableZh'>
  3. <div class='tab-top' style='display:flex;'>
  4. <div class='picker-box'>
  5. <span class='picker-span'>日期:</span>
  6. <el-date-picker
  7. style='width:190px'
  8. v-model='dateVal'
  9. value-format='yyyyMMdd'
  10. type='daterange'
  11. @change='getZhjl'
  12. size='mini'
  13. range-separator='-'
  14. start-placeholder
  15. end-placeholder
  16. ></el-date-picker>
  17. </div>
  18. <Select
  19. @change='getZhjl'
  20. width='200'
  21. tipPlace='top'
  22. caption='政府部门'
  23. size='small'
  24. v-model='searVal'
  25. style='margin-right:12px'
  26. v-if='department.length>0'
  27. :selectdata='department'
  28. :placeholder='"选择政府部门"'
  29. ></Select>
  30. <el-input clearable placeholder='搜索记录事项' @change='getZhjl' size='small' prefix-icon='el-icon-search' v-model='ssjlsx' style='width:200px'></el-input>
  31. </div>
  32. <el-table
  33. @row-click='handdle'
  34. v-loading='loading'
  35. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  36. :data='zhjlTable'
  37. style='width: 100%;margin-top:12px'
  38. >
  39. <el-table-column label='序号' type='index' width='50'></el-table-column>
  40. <el-table-column prop sortable label='日期'>
  41. <template slot-scope='{row}'>{{formatter(row.createdate)||'--'}}</template>
  42. </el-table-column>
  43. <el-table-column prop='type' label='政府部门'>
  44. <template slot-scope='{row}'>{{row.department||'--'}}</template>
  45. </el-table-column>
  46. <el-table-column prop='thing' label='记录事项' :show-overflow-tooltip='true'>
  47. <template slot-scope='{row}'>{{row.recordsx||'--'}}</template>
  48. </el-table-column>
  49. <el-table-column prop='name' label='工作要求'>
  50. <template slot-scope='{row}'>{{row.workyq||'--'}}</template>
  51. </el-table-column>
  52. <el-table-column prop='type' label='整改要求'>
  53. <template slot-scope='{row}'>{{row.zgyq||'--'}}</template>
  54. </el-table-column>
  55. <el-table-column prop='name' label='附件'>
  56. <template slot-scope='{row}'>{{'--'}}</template>
  57. </el-table-column>
  58. </el-table>
  59. <div class='foot'>
  60. <el-pagination
  61. background
  62. layout='prev, pager, next'
  63. :total='total'
  64. :page-size='size'
  65. @prev-click='pageChanged'
  66. @next-click='pageChanged'
  67. @current-change='pageChanged'
  68. ></el-pagination>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import moment from 'moment'
  74. import Select from '@/components/Select/Select.vue'
  75. import { queryGlams } from '@/api/other.js'
  76. import { querySelect } from '@/api/public.js'
  77. export default {
  78. data() {
  79. return {
  80. dateVal: '',
  81. loading: true,
  82. zhjlTable: [],
  83. searVal: '',
  84. total: 0,
  85. page: 1,
  86. size: 10,
  87. department: [],
  88. ssjlsx: '',
  89. isOpen: true
  90. }
  91. },
  92. components: { Select },
  93. methods: {
  94. formatter(date) {
  95. return moment.unix(date / 1000).format('YYYY.MM.DD')
  96. },
  97. rowClick() {
  98. console.log('window.location.href', window.location.href)
  99. console.log('document.location.href', document.location.href)
  100. console.log('document.URL', document.URL)
  101. },
  102. changeData(val) {
  103. console.log(val)
  104. },
  105. // 综合记录
  106. getZhjl() {
  107. let getParams = {
  108. plazaId: this.$store.state.plazaId,
  109. page: this.page,
  110. size: this.size
  111. }
  112. if (this.searVal) {
  113. getParams.department = this.searVal
  114. }
  115. if (this.ssjlsx) {
  116. getParams.keyword = `${this.ssjlsx}:recordsx`
  117. }
  118. if (this.dateVal) {
  119. getParams.createdateStartDate = this.dateVal[0] + '000000'
  120. getParams.createdateEndDate = this.dateVal[1] + '000000'
  121. }
  122. queryGlams({ getParams }).then(res => {
  123. if (res.result == 'success') {
  124. this.loading = false
  125. this.total = res.count
  126. this.zhjlTable = res.data ? res.data : []
  127. }
  128. console.log('综合记录', res)
  129. })
  130. },
  131. pageChanged(page) {
  132. this.page = page
  133. this.getZhjl()
  134. },
  135. changeSelect() {
  136. this.department = []
  137. let postParams = [
  138. {
  139. columnName: { department: 'department' },
  140. tableName: 'v_glsms_zhsxjl'
  141. }
  142. ]
  143. let data = {
  144. plazaId: this.$store.state.plazaId
  145. }
  146. querySelect({ data, postParams }).then(res => {
  147. console.log('政府部门', res)
  148. let department = []
  149. department = res.data.data.v_glsms_zhsxjl.department ? res.data.data.v_glsms_zhsxjl.department : []
  150. if (department.length > 0) {
  151. department.forEach(el => {
  152. let obj = {
  153. id: el.key,
  154. name: el.value
  155. }
  156. this.department.push(obj)
  157. })
  158. }
  159. })
  160. },
  161. handdle() {
  162. this.isOpen = !this.isOpen
  163. if (this.isOpen) {
  164. window.open('https://www.baidu.com/')
  165. }
  166. }
  167. },
  168. mounted() {
  169. this.changeSelect()
  170. }
  171. }
  172. </script>
  173. <style lang="less" scoped>
  174. .tableZh {
  175. .picker-box {
  176. display: flex;
  177. align-items: center;
  178. background: #fff;
  179. padding: 0 6px;
  180. border: 1px solid #dcdfe6;
  181. border-radius: 4px;
  182. height: 32px;
  183. box-sizing: border-box;
  184. margin-right: 12px;
  185. .picker-span {
  186. margin-right: 6px;
  187. color: rgba(0, 0, 0, 0.65);
  188. }
  189. }
  190. }
  191. </style>
  192. <style lang="less">
  193. .tableZh {
  194. .foot {
  195. height: 32px;
  196. display: flex;
  197. justify-content: flex-end;
  198. margin-top: 28px;
  199. }
  200. .el-input__inner {
  201. border: none;
  202. }
  203. .el-range-editor.el-input__inner {
  204. padding: 3px 0px;
  205. }
  206. .el-icon-date {
  207. display: none;
  208. }
  209. .el-range__close-icon {
  210. position: absolute;
  211. right: 0px;
  212. top: 2px;
  213. }
  214. .el-range-editor--mini .el-range-input {
  215. font-size: 14px;
  216. color: rgb(31, 36, 41);
  217. }
  218. }
  219. </style>