zhsxOtherTable1.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. border
  34. @row-click='handdle'
  35. v-loading='loading'
  36. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  37. :data='zhjlTable'
  38. style='width: 100%;margin-top:12px'
  39. >
  40. <el-table-column label='序号' type='index' width='60'></el-table-column>
  41. <el-table-column prop sortable label='日期' width='90' resizable>
  42. <template slot-scope='{row}'>{{formatter(row.createdate)||'--'}}</template>
  43. </el-table-column>
  44. <el-table-column prop label='政府部门' width='80'>
  45. <template slot-scope='{row}'>{{row.department||'--'}}</template>
  46. </el-table-column>
  47. <el-table-column prop label='记录事项' :show-overflow-tooltip='true' width='700'>
  48. <template slot-scope='{row}'>{{row.recordsx||'--'}}</template>
  49. </el-table-column>
  50. <el-table-column prop label='工作要求' width='160'>
  51. <template slot-scope='{row}'>{{row.workyq||'--'}}</template>
  52. </el-table-column>
  53. <el-table-column prop label='整改要求' width='160'>
  54. <template slot-scope='{row}'>{{row.zgyq||'--'}}</template>
  55. </el-table-column>
  56. <el-table-column prop label='附件' width='80'>
  57. <template slot-scope='{row}'>
  58. <el-popover placement='right' trigger='hover' v-if='row.glsmsZhsxfj&&row.glsmsZhsxfj.length>0'>
  59. <div>
  60. <p
  61. style='color: rgba(0, 145, 255, 1);cursor: pointer;'
  62. v-for='(item,index) in row.glsmsZhsxfj'
  63. :key='index'
  64. >{{item.description}}</p>
  65. </div>
  66. <div class='fileOpen' slot='reference'>{{row.glsmsZhsxfj.length}}</div>
  67. </el-popover>
  68. <div v-else>
  69. <div>
  70. <p style='color: rgba(0, 145, 255, 1);' v-for='(item,index) in row.glsmsZhsxfj' :key='index'>{{item.description}}</p>
  71. </div>
  72. <div class='fileOpen' slot='reference'>{{'--'}}</div>
  73. </div>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <div class='foot'>
  78. <el-pagination
  79. background
  80. layout='prev, pager, next'
  81. :total='total'
  82. :page-size='size'
  83. @prev-click='pageChanged'
  84. @next-click='pageChanged'
  85. @current-change='pageChanged'
  86. ></el-pagination>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import moment from 'moment'
  92. import { Select } from 'meri-design'
  93. // import Select from '@/components/Select/Select.vue'
  94. import { queryGlams } from '@/api/other.js'
  95. import { querySelect } from '@/api/public.js'
  96. import pdf from 'vue-pdf'
  97. export default {
  98. data() {
  99. return {
  100. dateVal: '',
  101. loading: false,
  102. zhjlTable: [],
  103. searVal: '',
  104. total: 0,
  105. page: 1,
  106. size: 10,
  107. department: [],
  108. ssjlsx: '',
  109. isOpen: true
  110. }
  111. },
  112. components: { Select, pdf },
  113. methods: {
  114. formatter(date) {
  115. return moment.unix(date / 1000).format('YYYY.MM.DD')
  116. },
  117. rowClick() {},
  118. changeData(val) {
  119. //console.log(val)
  120. },
  121. // 综合记录
  122. getZhjl() {
  123. let getParams = {
  124. plazaId: this.$store.state.plazaId,
  125. page: this.page,
  126. size: this.size,
  127. orderBy: 'createdate,0'
  128. }
  129. if (this.searVal) {
  130. getParams.department = this.searVal
  131. }
  132. if (this.ssjlsx) {
  133. getParams.keyword = `${this.ssjlsx}:recordsx`
  134. }
  135. if (this.dateVal) {
  136. getParams.createdateStartDate = this.dateVal[0] + '000000'
  137. getParams.createdateEndDate = this.dateVal[1] + '000000'
  138. }
  139. queryGlams({ getParams }).then(res => {
  140. if (res.result == 'success') {
  141. this.loading = false
  142. this.total = res.count
  143. this.zhjlTable = res.data ? res.data : []
  144. }
  145. //console.log('综合记录', res)
  146. })
  147. },
  148. pageChanged(page) {
  149. this.page = page
  150. this.getZhjl()
  151. },
  152. changeSelect() {
  153. this.department = []
  154. let postParams = [
  155. {
  156. columnName: { department: 'department' },
  157. tableName: 'v_glsms_zhsxjl'
  158. }
  159. ]
  160. let data = {
  161. plazaId: this.$store.state.plazaId
  162. }
  163. querySelect({ data, postParams }).then(res => {
  164. //console.log('政府部门', res)
  165. let department = []
  166. department = res.data.data.v_glsms_zhsxjl.department ? res.data.data.v_glsms_zhsxjl.department : []
  167. if (department.length > 0) {
  168. department.forEach(el => {
  169. let obj = {
  170. id: el.key,
  171. name: el.value
  172. }
  173. this.department.push(obj)
  174. })
  175. //console.log(this.department)
  176. }
  177. })
  178. },
  179. handdle() {
  180. if (this.isOpen) {
  181. // window.open('http://bing.com', true)
  182. }
  183. }
  184. },
  185. mounted() {},
  186. created() {
  187. this.changeSelect()
  188. }
  189. }
  190. </script>
  191. <style lang="less" scoped>
  192. .tableZh {
  193. .picker-box {
  194. display: flex;
  195. align-items: center;
  196. background: #fff;
  197. padding: 0 6px;
  198. border: 1px solid #dcdfe6;
  199. border-radius: 4px;
  200. height: 32px;
  201. box-sizing: border-box;
  202. margin-right: 12px;
  203. .picker-span {
  204. margin-right: 6px;
  205. color: rgba(0, 0, 0, 0.65);
  206. }
  207. }
  208. .fileOpen {
  209. color: rgba(0, 145, 255, 1);
  210. cursor: pointer;
  211. }
  212. }
  213. </style>
  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. .picker-box {
  223. .el-input__inner {
  224. border: none;
  225. }
  226. }
  227. .el-range-editor.el-input__inner {
  228. padding: 3px 0px;
  229. }
  230. .el-icon-date {
  231. display: none;
  232. }
  233. .el-range__close-icon {
  234. position: absolute;
  235. right: 0px;
  236. top: 2px;
  237. }
  238. .el-range-editor--mini .el-range-input {
  239. font-size: 14px;
  240. color: rgb(31, 36, 41);
  241. }
  242. }
  243. </style>