details.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. success: function (resss) {
  120. uni.hideLoading()
  121. }
  122. })
  123. }
  124. })
  125. }
  126. // #endif
  127. // #ifndef MP-WEIXIN
  128. uni.openDocument({
  129. filePath: path,
  130. showMenu: true,
  131. success: function (res) {
  132. // console.log('打开文档成功');
  133. }
  134. });
  135. // #endif
  136. }
  137. });
  138. },
  139. async getOneMap (id) {
  140. let that = this
  141. let data = {
  142. "table": "boman_message",
  143. "fixedData": {
  144. "id": id
  145. }
  146. }
  147. let res = await that.$u.post(`boman-web-core/p/cs/one/map`,data)
  148. if (res.code == 200) {
  149. if (res.data) {
  150. let {message_title, send_user_name, message_time, message_code, message_remark, message_upload = '', message_enclosure = '', finish_time} = res.data || {}
  151. this.json = {
  152. message_title,
  153. send_user_name,
  154. message_time,
  155. message_code,
  156. finish_time,
  157. message_remark,
  158. message_upload: message_upload ? JSON.parse(message_upload) : [],
  159. message_enclosure: message_enclosure ? JSON.parse(message_enclosure) : []
  160. }
  161. }
  162. }
  163. },
  164. setTime () {
  165. let dateTime
  166. let yy = new Date().getFullYear()
  167. let mm = new Date().getMonth() + 1
  168. let dd = new Date().getDate()
  169. let hh = new Date().getHours() < 10 ? ('0' + new Date().getHours()) : new Date().getHours()
  170. let mf = new Date().getMinutes() < 10 ? ('0' + new Date().getMinutes())
  171. :
  172. new Date().getMinutes()
  173. let ss = new Date().getSeconds() < 10 ? ('0' + new Date().getSeconds())
  174. :
  175. new Date().getSeconds()
  176. dateTime = yy + '-' + (mm < 10 ? ('0' + mm) : mm) + '-' + (dd < 10 ? ('0' + dd) : dd) + ' ' + hh + ":" + mf + ":" + ss
  177. return dateTime
  178. },
  179. async receiveMessage (id, objId) {
  180. let that = this
  181. let data = {
  182. "objId": objId, // 收文id
  183. "messageId": id ,// 发文id
  184. "receiveTime": this.setTime()// 当前时间
  185. }
  186. let res = await that.$u.post(`boman-web-core/message/receiveMessage`,data)
  187. },
  188. async getChldren (id) {
  189. let that = this
  190. let data = {
  191. "table": "boman_message_receive",
  192. "pageNo": 1,
  193. "isUi": false,
  194. "pageSize": 1000,
  195. "orderBy": "create_time desc",
  196. "fixedData": {
  197. "condition": {
  198. "visible": "Y",
  199. "message_id": id,
  200. "is_del":"N"
  201. }
  202. }
  203. }
  204. let res = await that.$u.post(`boman-web-core/p/cs/queryList`,data)
  205. if (res.code == 200) {
  206. this.receive_user_name = res.data.rows.map(item => {
  207. return item.receive_user_name
  208. }).join(',')
  209. this.receive_dept_name = res.data.rows.map(item => {
  210. return item.receive_dept_name
  211. }).join(',')
  212. // let selectData = res.data.rows.map(item => {
  213. // return {
  214. // nickName: item.receive_user_name,
  215. // deptName: item.receive_dept_name,
  216. // id: item.receive_user_id,
  217. // "dept": {},
  218. // "roles": []
  219. // }
  220. // })
  221. // if (selectData && selectData.length) {
  222. // this.getDeptNameAndRoleName(selectData)
  223. // }
  224. }
  225. },
  226. async getDeptNameAndRoleName (data) {
  227. let res = await this.$u.post(`system/user/getDeptNameAndRoleName`, data)
  228. if (res.deptNameList) {
  229. this.receive_dept_name = res.deptNameList.join(',')
  230. }
  231. },
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. .details{
  237. background: #fff;
  238. position: relative;
  239. .mack {
  240. position: fixed;
  241. width: 100%;
  242. height: 100%;
  243. z-index: 9999;
  244. top: 88rpx;
  245. background-color: rgba(0,0,0,0.2);
  246. .box {
  247. width: 612rpx;
  248. height: 512rpx;
  249. background: #FFFFFF;
  250. border-radius: 6rpx;
  251. top: 40%;
  252. left: 50%;
  253. transform: translate(-50%, -40%);
  254. padding: 34rpx;
  255. .head {
  256. position: relative;
  257. .title {
  258. font-size: 30rpx;
  259. font-weight: bold;
  260. color: #343434;
  261. text-align: center;
  262. }
  263. image {
  264. position: absolute;
  265. width: 20rpx;
  266. height: 20rpx;
  267. right: 0;
  268. top: 50%;
  269. transform: translateY(-50%);
  270. }
  271. }
  272. .middle {
  273. margin-top: 50rpx;
  274. textarea {
  275. width: 510rpx;
  276. padding: 20rpx;
  277. height: 210rpx;
  278. background: #FFFFFF;
  279. border: 1px solid #009FE8;
  280. border-radius: 6rpx;
  281. font-size: 28rpx;
  282. color: #AAAAAA;
  283. }
  284. }
  285. .btn {
  286. width: 550rpx;
  287. height: 76rpx;
  288. background: #009FE8;
  289. border-radius: 6rpx;
  290. color: #fff;
  291. text-align: center;
  292. line-height: 76rpx;
  293. font-size: 30rpx;
  294. margin-top: 36rpx;
  295. }
  296. }
  297. }
  298. .status {
  299. position: absolute;
  300. width: 160rpx;
  301. height: 94rpx;
  302. right: 36rpx;
  303. top: 160rpx;
  304. image {
  305. width: 100%;
  306. height: 100%;
  307. }
  308. }
  309. .box {
  310. position: relative;
  311. z-index: 1;
  312. padding: 0 36rpx;
  313. padding-bottom: 80rpx;
  314. .list {
  315. margin-top: 66rpx;
  316. .title {
  317. font-size: 28rpx;
  318. font-weight: bold;
  319. color: #343434;
  320. }
  321. .value {
  322. font-size: 25rpx;
  323. color: #666666;
  324. margin-top: 30rpx;
  325. }
  326. .a {
  327. color: #009FE8;
  328. }
  329. .files {
  330. .file {
  331. display: flex;
  332. align-items: center;
  333. margin-top: 30rpx;
  334. font-size: 25rpx;
  335. font-weight: 500;
  336. color: #343434;
  337. image {
  338. width: 24rpx;
  339. height: 20rpx;
  340. margin-right: 10rpx;
  341. }
  342. }
  343. }
  344. /deep/ .u-collapse {
  345. .u-collapse-title {
  346. font-size: 28rpx;
  347. font-weight: bold;
  348. color: #343434;
  349. }
  350. .u-collapse-content {
  351. font-size: 25rpx;
  352. color: #666666;
  353. }
  354. }
  355. }
  356. .btns {
  357. padding-top: 80rpx;
  358. .btn {
  359. width: 100%;
  360. height: 84rpx;
  361. background: #009FE8;
  362. border-radius: 8rpx;
  363. color: #fff;
  364. font-size: 28rpx;
  365. text-align: center;
  366. line-height: 84rpx;
  367. margin-top: 26rpx;
  368. &:nth-child(2) {
  369. background: #FF3131;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. </style>