details.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <view class="details">
  3. <u-navbar ref="uNavbar" :border-bottom="false" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle"
  4. :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
  5. <!-- <view class="status">
  6. <image :src="imgUrl"></image>
  7. </view> -->
  8. <view class="box">
  9. <view class="list">
  10. <view class="title">文件标题</view>
  11. <view class="value">{{json.message_title}}</view>
  12. </view>
  13. <view class="list">
  14. <view class="title">拟稿人</view>
  15. <view class="value">{{json.send_user_name}}</view>
  16. </view>
  17. <view class="list">
  18. <view class="title">发文日期</view>
  19. <view class="value">{{json.message_time}}</view>
  20. </view>
  21. <view class="list">
  22. <view class="title">流程结束日期</view>
  23. <view class="value">{{json.finish_time == null ? '未结束' : json.finish_time}}</view>
  24. </view>
  25. <view class="list">
  26. <view class="title">发文字号</view>
  27. <view class="value">{{json.message_code}}</view>
  28. </view>
  29. <view class="list">
  30. <view class="title">正文查看</view>
  31. <view class="value a" v-for="(item, index) in json.message_upload" :key="index" @click="loadFile(item.url,item.originalName)">{{item.originalName}}</view>
  32. </view>
  33. <view class="list">
  34. <view class="title">附件查看</view>
  35. <view class="files">
  36. <view @click="loadFile(item.url,item.originalName)" class="file" v-for="(item, index) in json.message_enclosure" :key="index">
  37. <image src="/static/img/icon_sc_wj.png"></image>
  38. <text>{{item.originalName}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="list">
  43. <u-collapse v-if="receive_user_name">
  44. <u-collapse-item title="分发人员" >
  45. {{receive_user_name}}
  46. </u-collapse-item>
  47. </u-collapse>
  48. </view>
  49. <view class="list">
  50. <u-collapse v-if="receive_dept_name">
  51. <u-collapse-item title="分发单位" >
  52. {{receive_dept_name}}
  53. </u-collapse-item>
  54. </u-collapse>
  55. </view>
  56. <view class="list">
  57. <view class="title">备注</view>
  58. <view class="value">{{json.message_remark}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. imgUrl: '',
  68. active: null,
  69. show: false,
  70. value: '',
  71. setNav: {
  72. backgroundColor: '#fff', //背景色
  73. color: '#333', //字体颜色
  74. bold: true,
  75. size: '36',
  76. backColor: '#333',
  77. isdisPlayNavTitle: true, //是否显示返回按钮
  78. navTitle: '收文详情' //导航标题
  79. },
  80. json: {
  81. message_title: '',
  82. send_user_name: '',
  83. message_time: '',
  84. message_code: '',
  85. message_remark: '',
  86. finish_time: '',
  87. message_upload: [],
  88. message_enclosure: []
  89. },
  90. receive_user_name: '',
  91. receive_dept_name: '',
  92. }
  93. },
  94. onLoad(options) {
  95. this.active = options.active
  96. this.getOneMap(options.id)
  97. this.getChldren(options.id)
  98. this.receiveMessage(options.id, options.objId)
  99. // this.imgUrl = options.flag == 1 ? ipc_yz_ybh : this.active == 0 ? pic_yz_wwc : this.active == 1 ? ipc_yz_ysh : ''
  100. },
  101. methods: {
  102. loadFile(url,name) {
  103. const manage = uni.getFileSystemManager();
  104. uni.downloadFile({
  105. url: url,
  106. success: (res) => {
  107. let path = res.tempFilePath;
  108. // #ifdef MP-WEIXIN
  109. var savePath = wx.env.USER_DATA_PATH + "/" + name
  110. console.log(savePath);
  111. if (res.statusCode == 200) {
  112. manage.saveFile({
  113. tempFilePath: res.tempFilePath,
  114. filePath: savePath,
  115. success:function(ress){
  116. uni.openDocument({
  117. filePath: ress.savedFilePath,
  118. // fileType: "pdf",
  119. showMenu:true,
  120. success: function (resss) {
  121. uni.hideLoading()
  122. }
  123. })
  124. }
  125. })
  126. }
  127. // #endif
  128. // #ifndef MP-WEIXIN
  129. uni.openDocument({
  130. filePath: path,
  131. showMenu: true,
  132. success: function (res) {
  133. // console.log('打开文档成功');
  134. }
  135. });
  136. // #endif
  137. }
  138. });
  139. },
  140. async getOneMap (id) {
  141. let that = this
  142. let data = {
  143. "table": "boman_message",
  144. "fixedData": {
  145. "id": id
  146. }
  147. }
  148. let res = await that.$u.post(`boman-web-core/p/cs/one/map`,data)
  149. if (res.code == 200) {
  150. if (res.data) {
  151. let {message_title, send_user_name, message_time, message_code, message_remark, message_upload = '', message_enclosure = '', finish_time} = res.data || {}
  152. this.json = {
  153. message_title,
  154. send_user_name,
  155. message_time,
  156. message_code,
  157. finish_time,
  158. message_remark,
  159. message_upload: message_upload ? JSON.parse(message_upload) : [],
  160. message_enclosure: message_enclosure ? JSON.parse(message_enclosure) : []
  161. }
  162. }
  163. }
  164. },
  165. setTime () {
  166. let dateTime
  167. let yy = new Date().getFullYear()
  168. let mm = new Date().getMonth() + 1
  169. let dd = new Date().getDate()
  170. let hh = new Date().getHours() < 10 ? ('0' + new Date().getHours()) : new Date().getHours()
  171. let mf = new Date().getMinutes() < 10 ? ('0' + new Date().getMinutes())
  172. :
  173. new Date().getMinutes()
  174. let ss = new Date().getSeconds() < 10 ? ('0' + new Date().getSeconds())
  175. :
  176. new Date().getSeconds()
  177. dateTime = yy + '-' + (mm < 10 ? ('0' + mm) : mm) + '-' + (dd < 10 ? ('0' + dd) : dd) + ' ' + hh + ":" + mf + ":" + ss
  178. return dateTime
  179. },
  180. async receiveMessage (id, objId) {
  181. let that = this
  182. let data = {
  183. "objId": objId, // 收文id
  184. "messageId": id ,// 发文id
  185. "receiveTime": this.setTime()// 当前时间
  186. }
  187. let res = await that.$u.post(`boman-web-core/message/receiveMessage`,data)
  188. },
  189. async getChldren (id) {
  190. let that = this
  191. let data = {
  192. "table": "boman_message_receive",
  193. "pageNo": 1,
  194. "isUi": false,
  195. "pageSize": 1000,
  196. "orderBy": "create_time desc",
  197. "fixedData": {
  198. "condition": {
  199. "visible": "Y",
  200. "message_id": id,
  201. "is_del":"N"
  202. }
  203. }
  204. }
  205. let res = await that.$u.post(`boman-web-core/p/cs/queryList`,data)
  206. if (res.code == 200) {
  207. this.receive_user_name = res.data.rows.map(item => {
  208. return item.receive_user_name
  209. }).join(',')
  210. this.receive_dept_name = res.data.rows.map(item => {
  211. return item.receive_dept_name
  212. }).join(',')
  213. // let selectData = res.data.rows.map(item => {
  214. // return {
  215. // userName: item.receive_user_name,
  216. // deptName: item.receive_dept_name,
  217. // id: item.receive_user_id,
  218. // nickName: item.receive_user_name,
  219. // "dept": {},
  220. // "roles": []
  221. // }
  222. // })
  223. // if (selectData && selectData.length) {
  224. // this.getDeptNameAndRoleName(selectData)
  225. // }
  226. }
  227. },
  228. async getDeptNameAndRoleName (data) {
  229. let res = await this.$u.post(`system/user/getDeptNameAndRoleName`, data)
  230. if (res.deptNameList) {
  231. this.receive_dept_name = res.deptNameList.join(',')
  232. }
  233. },
  234. }
  235. }
  236. </script>
  237. <style lang="scss" scoped>
  238. .details{
  239. background: #fff;
  240. position: relative;
  241. .mack {
  242. position: fixed;
  243. width: 100%;
  244. height: 100%;
  245. z-index: 9999;
  246. top: 88rpx;
  247. background-color: rgba(0,0,0,0.2);
  248. .box {
  249. width: 612rpx;
  250. height: 512rpx;
  251. background: #FFFFFF;
  252. border-radius: 6rpx;
  253. top: 40%;
  254. left: 50%;
  255. transform: translate(-50%, -40%);
  256. padding: 34rpx;
  257. .head {
  258. position: relative;
  259. .title {
  260. font-size: 30rpx;
  261. font-weight: bold;
  262. color: #343434;
  263. text-align: center;
  264. }
  265. image {
  266. position: absolute;
  267. width: 20rpx;
  268. height: 20rpx;
  269. right: 0;
  270. top: 50%;
  271. transform: translateY(-50%);
  272. }
  273. }
  274. .middle {
  275. margin-top: 50rpx;
  276. textarea {
  277. width: 510rpx;
  278. padding: 20rpx;
  279. height: 210rpx;
  280. background: #FFFFFF;
  281. border: 1px solid #009FE8;
  282. border-radius: 6rpx;
  283. font-size: 28rpx;
  284. color: #AAAAAA;
  285. }
  286. }
  287. .btn {
  288. width: 550rpx;
  289. height: 76rpx;
  290. background: #009FE8;
  291. border-radius: 6rpx;
  292. color: #fff;
  293. text-align: center;
  294. line-height: 76rpx;
  295. font-size: 30rpx;
  296. margin-top: 36rpx;
  297. }
  298. }
  299. }
  300. .status {
  301. position: absolute;
  302. width: 160rpx;
  303. height: 94rpx;
  304. right: 36rpx;
  305. top: 160rpx;
  306. image {
  307. width: 100%;
  308. height: 100%;
  309. }
  310. }
  311. .box {
  312. position: relative;
  313. z-index: 1;
  314. padding: 0 36rpx;
  315. padding-bottom: 80rpx;
  316. .list {
  317. margin-top: 66rpx;
  318. .title {
  319. font-size: 28rpx;
  320. font-weight: bold;
  321. color: #343434;
  322. }
  323. .value {
  324. font-size: 25rpx;
  325. color: #666666;
  326. margin-top: 30rpx;
  327. }
  328. .a {
  329. color: #009FE8;
  330. }
  331. .files {
  332. .file {
  333. display: flex;
  334. align-items: center;
  335. margin-top: 30rpx;
  336. font-size: 25rpx;
  337. font-weight: 500;
  338. color: #343434;
  339. image {
  340. width: 24rpx;
  341. height: 20rpx;
  342. margin-right: 10rpx;
  343. }
  344. }
  345. }
  346. /deep/ .u-collapse {
  347. .u-collapse-title {
  348. font-size: 28rpx;
  349. font-weight: bold;
  350. color: #343434;
  351. }
  352. .u-collapse-content {
  353. font-size: 25rpx;
  354. color: #666666;
  355. }
  356. }
  357. }
  358. .btns {
  359. padding-top: 80rpx;
  360. .btn {
  361. width: 100%;
  362. height: 84rpx;
  363. background: #009FE8;
  364. border-radius: 8rpx;
  365. color: #fff;
  366. font-size: 28rpx;
  367. text-align: center;
  368. line-height: 84rpx;
  369. margin-top: 26rpx;
  370. &:nth-child(2) {
  371. background: #FF3131;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. </style>