auditDetails.vue 11 KB

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