zhsxOtherTable1.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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='50'></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'>
  48. <template slot-scope='{row}'>{{row.recordsx||'--'}}</template>
  49. </el-table-column>
  50. <el-table-column prop label='工作要求'>
  51. <template slot-scope='{row}'>{{row.workyq||'--'}}</template>
  52. </el-table-column>
  53. <el-table-column prop label='整改要求'>
  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 '@/components/Select/Select.vue'
  93. import { queryGlams } from '@/api/other.js'
  94. import { querySelect } from '@/api/public.js'
  95. import pdf from 'vue-pdf'
  96. export default {
  97. data() {
  98. return {
  99. dateVal: '',
  100. loading: false,
  101. zhjlTable: [],
  102. searVal: '',
  103. total: 0,
  104. page: 1,
  105. size: 10,
  106. department: [],
  107. ssjlsx: '',
  108. isOpen: true
  109. }
  110. },
  111. components: { Select, pdf },
  112. methods: {
  113. formatter(date) {
  114. return moment.unix(date / 1000).format('YYYY.MM.DD')
  115. },
  116. rowClick() {},
  117. changeData(val) {
  118. console.log(val)
  119. },
  120. // 综合记录
  121. getZhjl() {
  122. let getParams = {
  123. plazaId: this.$store.state.plazaId,
  124. page: this.page,
  125. size: this.size,
  126. orderBy: 'createdate,0'
  127. }
  128. if (this.searVal) {
  129. getParams.department = this.searVal
  130. }
  131. if (this.ssjlsx) {
  132. getParams.keyword = `${this.ssjlsx}:recordsx`
  133. }
  134. if (this.dateVal) {
  135. getParams.createdateStartDate = this.dateVal[0] + '000000'
  136. getParams.createdateEndDate = this.dateVal[1] + '000000'
  137. }
  138. queryGlams({ getParams }).then(res => {
  139. if (res.result == 'success') {
  140. this.loading = false
  141. this.total = res.count
  142. this.zhjlTable = res.data ? res.data : []
  143. }
  144. console.log('综合记录', res)
  145. })
  146. },
  147. pageChanged(page) {
  148. this.page = page
  149. this.getZhjl()
  150. },
  151. changeSelect() {
  152. this.department = []
  153. let postParams = [
  154. {
  155. columnName: { department: 'department' },
  156. tableName: 'v_glsms_zhsxjl'
  157. }
  158. ]
  159. let data = {
  160. plazaId: this.$store.state.plazaId
  161. }
  162. querySelect({ data, postParams }).then(res => {
  163. console.log('政府部门', res)
  164. let department = []
  165. department = res.data.data.v_glsms_zhsxjl.department ? res.data.data.v_glsms_zhsxjl.department : []
  166. if (department.length > 0) {
  167. department.forEach(el => {
  168. let obj = {
  169. id: el.key,
  170. name: el.value
  171. }
  172. this.department.push(obj)
  173. })
  174. console.log(this.department)
  175. }
  176. })
  177. },
  178. handdle() {
  179. if (this.isOpen) {
  180. // window.open('http://bing.com', true)
  181. }
  182. }
  183. },
  184. mounted() {},
  185. created() {
  186. this.changeSelect()
  187. }
  188. }
  189. </script>
  190. <style lang="less" scoped>
  191. .tableZh {
  192. .picker-box {
  193. display: flex;
  194. align-items: center;
  195. background: #fff;
  196. padding: 0 6px;
  197. border: 1px solid #dcdfe6;
  198. border-radius: 4px;
  199. height: 32px;
  200. box-sizing: border-box;
  201. margin-right: 12px;
  202. .picker-span {
  203. margin-right: 6px;
  204. color: rgba(0, 0, 0, 0.65);
  205. }
  206. }
  207. .fileOpen {
  208. color: rgba(0, 145, 255, 1);
  209. cursor: pointer;
  210. }
  211. }
  212. </style>
  213. <style lang="less">
  214. .tableZh {
  215. .foot {
  216. height: 32px;
  217. display: flex;
  218. justify-content: flex-end;
  219. margin-top: 28px;
  220. }
  221. .el-input__inner {
  222. border: none;
  223. }
  224. .el-range-editor.el-input__inner {
  225. padding: 3px 0px;
  226. }
  227. .el-icon-date {
  228. display: none;
  229. }
  230. .el-range__close-icon {
  231. position: absolute;
  232. right: 0px;
  233. top: 2px;
  234. }
  235. .el-range-editor--mini .el-range-input {
  236. font-size: 14px;
  237. color: rgb(31, 36, 41);
  238. }
  239. }
  240. </style>