index.vue 9.0 KB

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