zhsxOtherTable1.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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'>
  59. <div>
  60. <p style='color: rgba(0, 145, 255, 1);cursor: pointer;'>南区防雷检测报告. pdf</p>
  61. </div>
  62. <div class='fileOpen' slot='reference'>预览({{row.file}})</div>
  63. </el-popover>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <div class='foot'>
  68. <el-pagination
  69. background
  70. layout='prev, pager, next'
  71. :total='total'
  72. :page-size='size'
  73. @prev-click='pageChanged'
  74. @next-click='pageChanged'
  75. @current-change='pageChanged'
  76. ></el-pagination>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import moment from 'moment'
  82. import Select from '@/components/Select/Select.vue'
  83. import { queryGlams } from '@/api/other.js'
  84. import { querySelect } from '@/api/public.js'
  85. import pdf from 'vue-pdf'
  86. export default {
  87. data() {
  88. return {
  89. dateVal: '',
  90. loading: false,
  91. zhjlTable: [],
  92. searVal: '',
  93. total: 0,
  94. page: 1,
  95. size: 10,
  96. department: [],
  97. ssjlsx: '',
  98. isOpen: true
  99. }
  100. },
  101. components: { Select, pdf },
  102. methods: {
  103. formatter(date) {
  104. return moment.unix(date / 1000).format('YYYY.MM.DD')
  105. },
  106. rowClick() {
  107. console.log('window.location.href', window.location.href)
  108. console.log('document.location.href', document.location.href)
  109. console.log('document.URL', document.URL)
  110. },
  111. changeData(val) {
  112. console.log(val)
  113. },
  114. // 综合记录
  115. getZhjl() {
  116. let getParams = {
  117. plazaId: this.$store.state.plazaId,
  118. page: this.page,
  119. size: this.size,
  120. orderBy: 'createdate,0'
  121. }
  122. if (this.searVal) {
  123. getParams.department = this.searVal
  124. }
  125. if (this.ssjlsx) {
  126. getParams.keyword = `${this.ssjlsx}:recordsx`
  127. }
  128. if (this.dateVal) {
  129. getParams.createdateStartDate = this.dateVal[0] + '000000'
  130. getParams.createdateEndDate = this.dateVal[1] + '000000'
  131. }
  132. queryGlams({ getParams }).then(res => {
  133. if (res.result == 'success') {
  134. this.loading = false
  135. this.total = res.count
  136. this.zhjlTable = res.data ? res.data : []
  137. }
  138. console.log('综合记录', res)
  139. })
  140. },
  141. pageChanged(page) {
  142. this.page = page
  143. this.getZhjl()
  144. },
  145. changeSelect() {
  146. this.department = []
  147. let postParams = [
  148. {
  149. columnName: { department: 'department' },
  150. tableName: 'v_glsms_zhsxjl'
  151. }
  152. ]
  153. let data = {
  154. plazaId: this.$store.state.plazaId
  155. }
  156. querySelect({ data, postParams }).then(res => {
  157. console.log('政府部门', res)
  158. let department = []
  159. department = res.data.data.v_glsms_zhsxjl.department ? res.data.data.v_glsms_zhsxjl.department : []
  160. if (department.length > 0) {
  161. department.forEach(el => {
  162. let obj = {
  163. id: el.key,
  164. name: el.value
  165. }
  166. this.department.push(obj)
  167. })
  168. console.log(this.department)
  169. }
  170. })
  171. },
  172. handdle() {
  173. if (this.isOpen) {
  174. window.open('http://bing.com', true)
  175. }
  176. }
  177. },
  178. mounted() {},
  179. created() {
  180. this.changeSelect()
  181. }
  182. }
  183. </script>
  184. <style lang="less" scoped>
  185. .tableZh {
  186. .picker-box {
  187. display: flex;
  188. align-items: center;
  189. background: #fff;
  190. padding: 0 6px;
  191. border: 1px solid #dcdfe6;
  192. border-radius: 4px;
  193. height: 32px;
  194. box-sizing: border-box;
  195. margin-right: 12px;
  196. .picker-span {
  197. margin-right: 6px;
  198. color: rgba(0, 0, 0, 0.65);
  199. }
  200. }
  201. .fileOpen {
  202. color: rgba(0, 145, 255, 1);
  203. cursor: pointer;
  204. }
  205. }
  206. </style>
  207. <style lang="less">
  208. .tableZh {
  209. .foot {
  210. height: 32px;
  211. display: flex;
  212. justify-content: flex-end;
  213. margin-top: 28px;
  214. }
  215. .el-input__inner {
  216. border: none;
  217. }
  218. .el-range-editor.el-input__inner {
  219. padding: 3px 0px;
  220. }
  221. .el-icon-date {
  222. display: none;
  223. }
  224. .el-range__close-icon {
  225. position: absolute;
  226. right: 0px;
  227. top: 2px;
  228. }
  229. .el-range-editor--mini .el-range-input {
  230. font-size: 14px;
  231. color: rgb(31, 36, 41);
  232. }
  233. }
  234. </style>