commonCard.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <view class="commom_main">
  3. <view class="card_banner"></view>
  4. <view class="card_info">
  5. <view class="card_info_title">
  6. <view class="">
  7. 盐城市盐都区工业和信息化局拟稿
  8. </view>
  9. <view class="card_info_min">
  10. 都工信{{inputForm.cardNum}}
  11. </view>
  12. </view>
  13. <view class="card_table">
  14. <u-row class="card_first_row"></u-row>
  15. <u-row v-if="leaderInfo.length>0" justify="space-between" class="card_row">
  16. <u-col span="3">
  17. <view class="justify-text">
  18. <text>主</text>
  19. <text>要</text>
  20. <text>领</text>
  21. <text>导</text>
  22. <text>意</text>
  23. <text>见</text>
  24. </view>
  25. </u-col>
  26. <u-col span="9" class="info_abstract">
  27. <view v-for="leader in leaderInfo" class="info_abstract_v">
  28. <view>
  29. {{leader.content}}
  30. </view>
  31. <view class="flex text-sm" style="line-height: 20px;">
  32. <u--image :src="leader.signfj" width="80px" height="20px"></u--image>
  33. {{leader.updateTime}}
  34. </view>
  35. </view>
  36. </u-col>
  37. </u-row>
  38. <u-row v-if="fgLeaderInfo.length>0" justify="space-between" class="card_row ">
  39. <u-col span="3">
  40. <view class="justify-text">
  41. <text>分</text>
  42. <text>管</text>
  43. <text>领</text>
  44. <text>导</text>
  45. <text>意</text>
  46. <text>见</text>
  47. </view>
  48. </u-col>
  49. <u-col span="9" class="info_abstract">
  50. <view v-for="item in fgLeaderInfo" class="info_abstract_v">
  51. <view>
  52. {{item.content}}
  53. </view>
  54. <view class="flex text-sm" style="line-height: 20px;">
  55. <u--image :src="item.signfj" width="80px" height="20px"></u--image>
  56. {{item.updateTime}}
  57. </view>
  58. </view>
  59. </u-col>
  60. </u-row>
  61. <u-row v-if="officeInfo.length>0" justify="space-between" class="card_row ">
  62. <u-col span="3">
  63. <view class="justify-text" style="font-size:18px ;">
  64. <text>办</text>
  65. <text>公</text>
  66. <text>(室) </text>
  67. <text>意</text>
  68. <text>见</text>
  69. </view>
  70. </u-col>
  71. <u-col span="9" class="info_abstract">
  72. <view v-for="item in officeInfo" class="info_abstract_v">
  73. <view>
  74. {{item.content}}
  75. </view>
  76. <view class="flex text-sm" style="line-height: 20px;">
  77. <u--image :src="item.signfj" width="80px" height="20px"></u--image>
  78. {{item.updateTime}}
  79. </view>
  80. </view>
  81. </u-col>
  82. </u-row>
  83. <u-row v-if="undertakeInfo.length>0" justify="space-between" class="card_row ">
  84. <u-col span="3" textAlign="justify">
  85. <view class="justify-text">
  86. <text>承</text>
  87. <text>办</text>
  88. <text>科</text>
  89. <text>室</text>
  90. <text>意</text>
  91. <text>见</text>
  92. </view>
  93. </u-col>
  94. <u-col span="9" class="info_abstract">
  95. <view v-for="item in undertakeInfo" class="info_abstract_v">
  96. <view>
  97. {{item.content}}
  98. </view>
  99. <view class="flex text-sm" style="line-height: 20px;">
  100. <u--image :src="item.signfj" width="80px" height="20px" mode="aspectFit"></u--image>
  101. {{item.updateTime}}
  102. </view>
  103. </view>
  104. </u-col>
  105. </u-row>
  106. <u-row justify="space-between" class="card_row card_row_border">
  107. <u-col span="3">
  108. <view>文件名称</view>
  109. </u-col>
  110. <u-col span="9" textAlign="center" class="card_col_1">
  111. <uni-tooltip :content="inputForm.name" placement="top">
  112. <u--text size="14" align="center" lines="1" :text="inputForm.name"></u--text>
  113. </uni-tooltip>
  114. </u-col>
  115. </u-row>
  116. <u-row justify="space-between" class="card_row card_row_border">
  117. <u-col span="3" textAlign="center" class="">
  118. <view>拟稿人</view>
  119. </u-col>
  120. <u-col span="3" textAlign="center" class="card_col_1">
  121. <uni-tooltip :content="inputForm.authorPerson" placement="top">
  122. <u--text size="14" align="center" lines="1" :text="inputForm.authorPerson"></u--text>
  123. </uni-tooltip>
  124. </u-col>
  125. <u-col span="3" textAlign="center" class="card_col card_col_1">
  126. <view>校对人</view>
  127. </u-col>
  128. <u-col span="3" textAlign="center">
  129. <uni-tooltip :content="inputForm.proofreader" placement="top">
  130. <u--text size="14" align="center" lines="1" :text="inputForm.proofreader"></u--text>
  131. </uni-tooltip>
  132. <!-- <u--text size="14" align="center" lines="1" :text="inputForm.fileSource"></u--text> -->
  133. </u-col>
  134. </u-row>
  135. <u-row justify="space-between" class="card_row card_row_border">
  136. <u-col span="3" textAlign="center" class="">
  137. <view>可否公开</view>
  138. </u-col>
  139. <u-col span="3" textAlign="center" class="card_col_1">
  140. <u--text size="14" align="center" lines="1" :text="inputForm.open?'是':'否'"></u--text>
  141. </u-col>
  142. <u-col span="3" textAlign="center" class="card_col card_col_1">
  143. <view>印数</view>
  144. </u-col>
  145. <u-col span="3" textAlign="center">
  146. <uni-tooltip :content="inputForm.printNum" placement="top">
  147. <u--text size="14" align="center" lines="1" :text="inputForm.printNum"></u--text>
  148. </uni-tooltip>
  149. </u-col>
  150. </u-row>
  151. <u-row justify="space-between" class="card_row card_row_border card_last_row">
  152. <u-col span="3" textAlign="center" class="card_col">
  153. <view>备注</view>
  154. </u-col>
  155. <u-col span="9" textAlign="center">
  156. <view>{{inputForm.remark}}</view>
  157. </u-col>
  158. </u-row>
  159. <u--text style="margin: 10px;" size="10" type="error" text="所有涉密敏感信息不得上传"></u--text>
  160. <view class="card_other">
  161. 附件:
  162. <view class="other_info" v-for="item in fileList">
  163. <view class="other_pdf flex ">
  164. <u--text decoration='underline' color='#36a7f3' :text="item.name"
  165. @click="item.type=='pdf'?preview(item):download(item)"></u--text>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <view style="margin-left: 20px;">
  172. <u-upload :fileList="imgList" multiple :maxCount="imgList.length" :previewFullImage="true"
  173. :deletable="false"></u-upload>
  174. </view>
  175. <u-overlay :show="ismask">
  176. <view class="warp">
  177. <view class="rect"><u-button plain loading loadingText="加载中"></u-button></view>
  178. </view>
  179. </u-overlay>
  180. </view>
  181. </template>
  182. <script>
  183. import {
  184. isImageFormat
  185. } from "@/common/util.js"
  186. import BASE_URL from '@/config.js'
  187. import fileService from '@/api/file/fileService.js'
  188. import yzCirculationCardService from '@/api/commonseal/yzCirculationCardService.js'
  189. import yzFlowService from '@/api/commonseal/yzFlowService.js'
  190. export default {
  191. mounted() {
  192. yzCirculationCardService.queryById(this.gwId).then(data => {
  193. this.inputForm = data
  194. this.inputForm.cardNum = "[" + this.inputForm.yearNum + "]" + this.inputForm.cardNum + "号"
  195. this.fileLists = this.inputForm.attachment.split(",")
  196. this.fileLists.forEach(item => {
  197. if (isImageFormat(item)) {
  198. let img = {
  199. url: item
  200. }
  201. if (!item.startsWith("http")) img.url = this.BASE_URL + item
  202. this.imgList.push(img)
  203. } else {
  204. const fileName = item.split(/[/\\=]/).pop();
  205. let type = ""
  206. const pdfFormats = /\.pdf$/i;
  207. if (pdfFormats.test(item)) type = "pdf";
  208. let a = {
  209. name: fileName,
  210. url: item,
  211. type: type
  212. }
  213. if (!item.startsWith("http")) a.url = this.BASE_URL + item
  214. this.fileList.push(a)
  215. }
  216. })
  217. })
  218. yzFlowService.queryByYzId(this.gwId).then(data => {
  219. data.forEach(item => {
  220. if (item.which == 0 && item.state == 0) {
  221. if (item.signfj && !item.signfj.startsWith("http")) item.signfj = this.BASE_URL +
  222. item.signfj
  223. this.undertakeInfo.push(item)
  224. } else if (item.which == 1 && item.state == 0) {
  225. if (item.signfj && !item.signfj.startsWith("http")) item.signfj = this.BASE_URL +
  226. item.signfj
  227. this.officeInfo.push(item)
  228. } else if (item.which == 2 && item.state == 0) {
  229. if (item.signfj && !item.signfj.startsWith("http")) item.signfj = this.BASE_URL +
  230. item.signfj
  231. this.fgLeaderInfo.push(item)
  232. }
  233. if (item.which == 3 && item.state == 0) {
  234. if (item.signfj && !item.signfj.startsWith("http")) item.signfj = this.BASE_URL +
  235. item.signfj
  236. this.leaderInfo.push(item)
  237. }
  238. })
  239. this.leaderInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
  240. .localeCompare(b.updateTime));
  241. this.undertakeInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
  242. .localeCompare(b.updateTime));
  243. this.officeInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
  244. .localeCompare(b.updateTime));
  245. this.fgLeaderInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
  246. .localeCompare(b.updateTime));
  247. this.ismask = false
  248. })
  249. },
  250. data() {
  251. return {
  252. ismask: true,
  253. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  254. // 公文附件
  255. fileLists: [],
  256. fileList: [],
  257. imgList: [],
  258. // 办公室信息
  259. officeInfo: [],
  260. // 领导信息
  261. leaderInfo: [],
  262. // 分管领导
  263. fgLeaderInfo: [],
  264. // 承办信息
  265. undertakeInfo: [],
  266. inputForm: {
  267. id: '',
  268. yearNum: '',
  269. cardNum: '',
  270. sendingAgency: '',
  271. docFontSize: '',
  272. fileSource: '',
  273. writtenTime: '',
  274. receivingTime: '',
  275. contentSummary: '',
  276. attachedDocumentId: ''
  277. },
  278. yzflow: {
  279. id: '',
  280. yzId: '',
  281. content: '',
  282. signfj: '',
  283. createTruename: '',
  284. nextTruename: '',
  285. nextUser: '',
  286. which: '',
  287. state: '',
  288. next: '',
  289. remark: '',
  290. },
  291. }
  292. },
  293. methods: {
  294. // 预览pdf
  295. preview(fileUrl) {
  296. uni.navigateTo({
  297. url: "/pages/pdfPreview/pdfPreview?url=" + encodeURIComponent(fileUrl.url)
  298. })
  299. },
  300. // 下载文件
  301. download(param) {
  302. uni.showLoading({
  303. title: "下载中"
  304. })
  305. uni.downloadFile({
  306. url: param.url, //调接口返回url
  307. success: (res) => {
  308. uni.hideLoading();
  309. if (res.statusCode == 200) {
  310. var tempFilePath = res.tempFilePath;
  311. this.saveFile(tempFilePath, param.name);
  312. } else {
  313. uni.showToast({
  314. icon: 'none',
  315. title: '报告下载失败'
  316. })
  317. }
  318. },
  319. fail: err => {
  320. uni.hideLoading();
  321. uni.showToast({
  322. icon: 'none',
  323. title: '报告下载失败'
  324. })
  325. reject(err);
  326. }
  327. })
  328. },
  329. saveFile(url, name) { //保存到本地
  330. try {
  331. const fileName = name;
  332. //new Blob 实例化文件流
  333. //let url = fileData
  334. //const url = window.URL.createObjectURL(new Blob([fileData],{type:'application/pdf'}))
  335. const link = document.createElement('a');
  336. link.style.display = 'none';
  337. link.href = url;
  338. link.setAttribute('download', fileName);
  339. link.setAttribute("target", "_blank");
  340. document.body.appendChild(link);
  341. link.click();
  342. //下载完成移除元素
  343. document.body.removeChild(link);
  344. //释放掉blob对象
  345. window.URL.revokeObjectURL(url)
  346. uni.showToast({
  347. title: '下载成功'
  348. })
  349. } catch (error) {
  350. uni.showToast({
  351. title: '下载失败'
  352. })
  353. }
  354. },
  355. },
  356. props: {
  357. isoffice: {
  358. type: Boolean,
  359. default: false
  360. },
  361. isleader: {
  362. type: Boolean,
  363. default: false
  364. },
  365. isinfo: {
  366. type: Boolean,
  367. default: false
  368. },
  369. gwId: {
  370. type: String,
  371. }
  372. },
  373. }
  374. </script>
  375. <style>
  376. .warp {
  377. display: flex;
  378. align-items: center;
  379. justify-content: center;
  380. height: 100%;
  381. }
  382. .commom_main {
  383. width: 100%;
  384. background-color: #fefefe;
  385. }
  386. .commom_main .card_banner {
  387. width: 100%;
  388. height: 60px;
  389. background-color: #36a7f3;
  390. }
  391. .commom_main .card_info {
  392. width: 96%;
  393. /* height: 80vh; */
  394. margin: -40px 2% 0;
  395. background-color: #fefefe;
  396. border-radius: 15px;
  397. text-align: center;
  398. color: red;
  399. }
  400. .commom_main .card_info_title {
  401. font-size: 20px;
  402. font-weight: 700;
  403. padding-top: 10px;
  404. color: red;
  405. }
  406. .card_info_min {
  407. font-size: 16px;
  408. font-weight: 400;
  409. margin-top: 5px;
  410. }
  411. .commom_main .card_table {
  412. padding: 20px 20px;
  413. font-size: 18px;
  414. }
  415. .commom_main .card_row {
  416. border-top: 1px solid red;
  417. word-wrap: break-word;
  418. /* border-bottom: none; */
  419. }
  420. .commom_main .justify-text {
  421. padding: 0 4px;
  422. display: flex;
  423. flex-direction: row;
  424. justify-content: space-between;
  425. flex-wrap: wrap;
  426. }
  427. .justify-text text {
  428. display: block;
  429. }
  430. .commom_main .card_row_border {
  431. line-height: 50px;
  432. border-bottom: none;
  433. }
  434. .commom_main .card_last_row {
  435. border-bottom: 2px solid red;
  436. }
  437. .commom_main .card_first_row {
  438. border-top: 1px solid red;
  439. }
  440. .commom_main .card_col {
  441. border-right: 1px solid;
  442. }
  443. .commom_main .card_col_1 {
  444. border-left: 1px solid;
  445. }
  446. .commom_main .info_abstract {
  447. line-height: 34px;
  448. font-size: 16px;
  449. word-wrap: break-word;
  450. border-left: 1px solid;
  451. }
  452. .commom_main .info_abstract_v {
  453. margin: 18px;
  454. }
  455. .commom_main .card_other {
  456. text-align: left;
  457. }
  458. </style>