zhsxOtherTable1.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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
  31. clearable
  32. placeholder='搜索记录事项'
  33. @keyup.enter.native='getZhjl'
  34. size='small'
  35. prefix-icon='el-icon-search'
  36. v-model='ssjlsx'
  37. style='width:200px'
  38. ></el-input>
  39. </div>
  40. <el-table
  41. border
  42. @row-click='handdle'
  43. v-loading='loading'
  44. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  45. :data='zhjlTable'
  46. style='width: 100%;margin-top:12px'
  47. >
  48. <el-table-column label='序号' type='index' width='60' :index='indexMethod'></el-table-column>
  49. <el-table-column prop sortable label='日期' width='100' resizable>
  50. <template slot-scope='{row}'>{{formatter(row.createdate)||'--'}}</template>
  51. </el-table-column>
  52. <el-table-column prop label='政府部门' width='160'>
  53. <template slot-scope='{row}'>{{row.department||'--'}}</template>
  54. </el-table-column>
  55. <el-table-column prop label='记录事项' :show-overflow-tooltip='true' min-width='700'>
  56. <template slot-scope='{row}'>{{row.recordsx||'--'}}</template>
  57. </el-table-column>
  58. <el-table-column prop label='工作要求' width='160'>
  59. <template slot-scope='{row}'>{{row.workyq||'--'}}</template>
  60. </el-table-column>
  61. <el-table-column prop label='整改要求' width='160'>
  62. <template slot-scope='{row}'>{{row.zgyq||'--'}}</template>
  63. </el-table-column>
  64. <el-table-column prop label='附件' width='80'>
  65. <template slot-scope='{row}'>
  66. <div v-if='row.glsmsImage' style='cursor:pointer;color: #0091ff;' @click='clickPic(row.glsmsImage)'>{{row.glsmsImage.length+'张'}}</div>
  67. <!-- <div style='cursor:pointer;color: #0091ff;' @click='clickPic'>{{5+'张'}}</div> -->
  68. <div v-else>{{'--'}}</div>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <div class='foot'>
  73. <el-pagination
  74. background
  75. layout='prev, pager, next'
  76. :total='total'
  77. :page-size='size'
  78. @prev-click='pageChanged'
  79. @next-click='pageChanged'
  80. @current-change='pageChanged'
  81. ></el-pagination>
  82. <pic-large v-if='imgUrl.length>0' :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import moment from 'moment'
  88. import { Select } from 'meri-design'
  89. // import Select from '@/components/Select/Select.vue'
  90. import { queryGlams } from '@/api/other.js'
  91. import { querySelect } from '@/api/public.js'
  92. export default {
  93. data() {
  94. return {
  95. dateVal: '',
  96. loading: false,
  97. zhjlTable: [],
  98. searVal: '',
  99. total: 0,
  100. page: 1,
  101. size: 10,
  102. department: [],
  103. ssjlsx: '',
  104. isOpen: true,
  105. imgUrl: [],
  106. imgUrl2: [],
  107. imgUrls: [
  108. {
  109. name: '供电系统原理图.png',
  110. url:
  111. 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921294136524467354%E4%BE%9B%E7%94%B5%E7%B3%BB%E7%BB%9F%E5%8E%9F%E7%90%86%E5%9B%BE.png'
  112. },
  113. {
  114. name: '供电系统原理图.pdf',
  115. url: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921260429024467352%E5%8C%BA%E4%BD%8D%E5%9B%BE.png'
  116. },
  117. {
  118. name: '供电系统原理图.html',
  119. url:
  120. 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921294136524467354%E4%BE%9B%E7%94%B5%E7%B3%BB%E7%BB%9F%E5%8E%9F%E7%90%86%E5%9B%BE.png'
  121. }
  122. ]
  123. }
  124. },
  125. components: { Select },
  126. methods: {
  127. clickPic() {
  128. this.imgUrl = []
  129. this.imgUrl2 = []
  130. var patternFileExtension = /\.([0-9a-z]+)(?:[\?#]|$)/i
  131. if (this.imgUrls.length > 0) {
  132. this.imgUrls.forEach(el => {
  133. let name = el.name.match(patternFileExtension)[1]
  134. let obj = {
  135. name: el.name,
  136. url: el.url,
  137. type: name
  138. }
  139. this.imgUrl.push(obj)
  140. })
  141. }
  142. console.log(this.imgUrl)
  143. // var fileExtension = '供电系统原理图.html'.match(patternFileExtension)
  144. // console.log(fileExtension[1])
  145. if (this.imgUrl.length > 0) {
  146. this.$refs.picLargeOpen.open()
  147. }
  148. },
  149. formatter(date) {
  150. return moment.unix(date / 1000).format('YYYY.MM.DD')
  151. },
  152. rowClick() {},
  153. changeData(val) {
  154. //console.log(val)
  155. },
  156. indexMethod(index) {
  157. return (this.page - 1) * this.size + index + 1
  158. },
  159. // 综合记录
  160. getZhjl() {
  161. let getParams = {
  162. plazaId: this.$store.state.plazaId,
  163. page: this.page,
  164. size: this.size,
  165. orderBy: 'createdate,0'
  166. }
  167. if (this.searVal) {
  168. getParams.department = this.searVal
  169. }
  170. if (this.ssjlsx) {
  171. getParams.keyword = `${this.ssjlsx}:recordsx`
  172. }
  173. if (this.dateVal) {
  174. getParams.createdateStartDate = this.dateVal[0] + '000000'
  175. getParams.createdateEndDate = this.dateVal[1] + '000000'
  176. }
  177. queryGlams({ getParams }).then(res => {
  178. if (res.result == 'success') {
  179. this.loading = false
  180. this.total = res.count
  181. this.zhjlTable = res.data ? res.data : []
  182. }
  183. //console.log('综合记录', res)
  184. })
  185. },
  186. pageChanged(page) {
  187. this.page = page
  188. this.getZhjl()
  189. },
  190. changeSelect() {
  191. this.department = []
  192. let postParams = [
  193. {
  194. columnName: { department: 'department' },
  195. tableName: 'sms_zhsxjl'
  196. }
  197. ]
  198. let data = {
  199. plazaId: this.$store.state.plazaId
  200. }
  201. querySelect({ data, postParams }).then(res => {
  202. //console.log('政府部门', res)
  203. let department = []
  204. department = res.data.data.sms_zhsxjl.department ? res.data.data.sms_zhsxjl.department : []
  205. if (department.length > 0) {
  206. department.forEach(el => {
  207. let obj = {
  208. id: el.key,
  209. name: el.value
  210. }
  211. this.department.push(obj)
  212. })
  213. //console.log(this.department)
  214. }
  215. })
  216. },
  217. handdle() {
  218. if (this.isOpen) {
  219. // window.open('http://bing.com', true)
  220. }
  221. }
  222. },
  223. mounted() {},
  224. created() {
  225. this.changeSelect()
  226. }
  227. }
  228. </script>
  229. <style lang="less" scoped>
  230. .tableZh {
  231. .picker-box {
  232. display: flex;
  233. align-items: center;
  234. background: #fff;
  235. padding: 0 6px;
  236. border: 1px solid #dcdfe6;
  237. border-radius: 4px;
  238. height: 32px;
  239. box-sizing: border-box;
  240. margin-right: 12px;
  241. .picker-span {
  242. margin-right: 6px;
  243. color: rgba(0, 0, 0, 0.65);
  244. }
  245. }
  246. .fileOpen {
  247. color: rgba(0, 145, 255, 1);
  248. cursor: pointer;
  249. }
  250. }
  251. </style>
  252. <style lang="less">
  253. .tableZh {
  254. .foot {
  255. height: 32px;
  256. display: flex;
  257. justify-content: flex-end;
  258. margin-top: 28px;
  259. }
  260. .picker-box {
  261. .el-input__inner {
  262. border: none;
  263. }
  264. }
  265. .el-range-editor.el-input__inner {
  266. padding: 3px 0px;
  267. }
  268. .el-icon-date {
  269. display: none;
  270. }
  271. .el-range__close-icon {
  272. position: absolute;
  273. right: 0px;
  274. top: 2px;
  275. }
  276. .el-range-editor--mini .el-range-input {
  277. font-size: 14px;
  278. color: rgb(31, 36, 41);
  279. }
  280. }
  281. </style>