commonCard.vue 13 KB

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