zhsxOtherTable1.vue 11 KB

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