details.vue 8.5 KB

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