universalityAudit.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <template>
  2. <view style='margin-bottom:180rpx;'>
  3. <view>
  4. <u-form :model="dataobj" ref="uForm">
  5. <u-form-item label="类型"><view style='text-align:right;width:100%;color:#AFB3BF;'>{{dataobj.businessType}}</view></u-form-item>
  6. <u-form-item :border-bottom='false' :label-position='"top"' label="备注">
  7. <view class="u-textarea-style">
  8. <view class="right-bottom">
  9. {{dataobj.remark.length}}/2000个字
  10. </view>
  11. <textarea style='font-size:12px;' disabled maxlength="2000" v-model='dataobj.remark' placeholder="请输入备注信息" name="" id="" cols="30" rows="11"></textarea>
  12. </view>
  13. </u-form-item>
  14. </u-form>
  15. <u-form :label-position='"top"' ref="uForm">
  16. <u-form-item :border-bottom='false' :label="'共'+imglist.length+'个附件'">
  17. <view style='width:100%;border-top:1px solid #EEEEEE;' v-if='imglist.length>0'>
  18. <view style="justify-content: space-between;" class='flex' v-for='item in imglist'>
  19. <view class="img_item">
  20. <view class="" style="width: 16%;">
  21. <image
  22. v-if="item.type == 'pdf'"
  23. class="imgsign" src="../../../static/img/oa_office/pdf3.png"
  24. mode=""></image>
  25. <image v-else-if="item.type == 'xls'||item.type == 'xlsx'"
  26. class="imgsign" src="../../../static/img/oa_office/excle3.png"
  27. mode=""></image>
  28. <image v-else-if="item.type == 'doc'||item.type == 'docx'"
  29. class="imgsign" src="../../../static/img/oa_office/word3.png"
  30. mode=""></image>
  31. <image v-else class="imgsign" :src="item.appendixPath" mode="">
  32. </image>
  33. </view>
  34. <view class="" style="width: 70%;">
  35. <view class="char_css">{{item.appendixName}}</view>
  36. <view class="img_size">{{item.appendixSize}}</view>
  37. </view>
  38. <view style="color: #22C572;" class="img_dowload" @click="openDocument(item)">
  39. 下载
  40. </view>
  41. </view>
  42. <!-- <u-icon name="attach" ></u-icon> -->
  43. <!-- <image style='width: 200rpx;height: 200rpx;' :src="item" mode=""></image> -->
  44. </view>
  45. </view>
  46. </u-form-item>
  47. </u-form>
  48. <u-form ref="uForm">
  49. <view class="form_top">审批流</view>
  50. <view class="content2">
  51. <view v-for="(item,index) in auditList" :key='index' class="audit">
  52. <view class="row" v-if='item.desc!="_PLACEHOLDER_"'>
  53. <view class="left">
  54. <view class="item1">
  55. <view class="item-content">{{item.operatorTitle}}</view>
  56. <view v-if="item.status=='success'" class='status success'>
  57. <u-icon name="checkmark" color="#2979ff" size="24"></u-icon>
  58. </view>
  59. <view v-if="item.status=='error'" class='status error'>
  60. <u-icon name="close" color="rgb(245, 108, 108)" size="24"></u-icon>
  61. </view>
  62. <view v-if="item.status=='question'" class='status question'>
  63. <u-icon name="question" color="#f9ae3d" size="24"></u-icon>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="right">
  68. <view class="right-item">
  69. <view class="item2">
  70. <view class="name">{{item.desc}}
  71. </view>
  72. <!-- <view class='time'>{{item.updateDate}}</view> -->
  73. <view v-if="item.status=='success'" class="status success">
  74. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  75. v-if='!item.commonStaffs1&&index!=0'>已审核</text></view>
  76. <view v-if="item.status=='error'" class="status error">
  77. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  78. v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已驳回":''}}</text>
  79. </view>
  80. <view v-if="item.status=='question'" class="status question">
  81. {{item.commonStaffs1?item.staffscontent:''}}<text
  82. v-if='!item.commonStaffs1'>未审核</text></view>
  83. <!-- <view class="status success">吕波(已审核)</view> -->
  84. </view>
  85. <view v-if='index==0||item.workflowHistoricTasks&&item.workflowHistoricTasks.length>0'
  86. class='time'>
  87. {{item.updateDate}}
  88. </view>
  89. </view>
  90. <view v-if='item.auditMind' class="right-content">
  91. {{item.auditMind}}
  92. </view>
  93. </view>
  94. <view v-if='item.commonStaffs1' class="right">
  95. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
  96. </u-icon>
  97. </view>
  98. </view>
  99. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  100. <view class='row2'>
  101. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  102. <view class="item-content">
  103. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  104. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  105. </view>
  106. <view class="name">{{item1.staffName}}</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="row-line" v-if="index!= auditList.length - 1&&item.desc!='_PLACEHOLDER_'"></view>
  111. </view>
  112. </view>
  113. </u-form>
  114. </view>
  115. <view v-if='show' class="shade">
  116. <view class="wrap">
  117. <view class="alert-top">
  118. <view class="title">
  119. {{title}}
  120. </view>
  121. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  122. </view>
  123. <view class="u-textarea-style">
  124. <view class="right-bottom">
  125. {{auditMind.length}}/1000个字
  126. </view>
  127. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  128. maxlength="1000" />
  129. </view>
  130. <view @click='close()' class="cancel">取消</view>
  131. <view @click='passSubmit()' class="confirm">确定</view>
  132. </view>
  133. </view>
  134. <view style='padding:10px;' class='flex bottom-btn'>
  135. <u-button v-if='dataobj.taskId' @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  136. <u-button v-if='dataobj.taskId' @click='pass' type="success" class="btn2">通过</u-button>
  137. <u-button v-if='!dataobj.taskId' @click="fanHui" type="success" class="btn1" hover-class='none'>返回</u-button>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. export default {
  143. data() {
  144. return {
  145. id:'',
  146. dataobj:{},
  147. show:false,
  148. auditMind:'',
  149. title:'',
  150. imglist:[],
  151. auditList:[]
  152. }
  153. },
  154. onLoad(options){
  155. this.id=options.id
  156. console.log(options.id)
  157. },
  158. onShow(){
  159. // this.$nextTick(()=>{
  160. this.getList()
  161. // })
  162. },
  163. methods: {
  164. pass() {
  165. this.show = true
  166. this.title = '审核意见(通过)'
  167. },
  168. reject() {
  169. this.show = true
  170. this.title = '驳回原因(驳回)'
  171. },
  172. // 驳回
  173. rejectSubmit() {
  174. var that = this
  175. if (!this.auditMind) {
  176. this.$api.msg('驳回原因不能为空!')
  177. } else {
  178. this.show = false
  179. uni.showModal({
  180. content: "是否确定驳回?",
  181. showCancel: true,
  182. confirmText: '确定',
  183. success: function(res) {
  184. if (res.confirm) {
  185. that.audit(that.list[0], 0, false, true, that.auditMind)
  186. }
  187. }
  188. })
  189. }
  190. },
  191. //通过
  192. passSubmit() {
  193. var that = this
  194. if (this.title == '驳回原因(驳回)') {
  195. this.rejectSubmit()
  196. } else {
  197. this.show = false
  198. uni.showModal({
  199. content: "是否确定通过?",
  200. showCancel: true,
  201. confirmText: '确定',
  202. success: function(res) {
  203. if (res.confirm) {
  204. that.audit(that.list[0], 0, true, 2, that.auditMind)
  205. }
  206. }
  207. })
  208. }
  209. },
  210. //审核方法
  211. audit(list, index, status, status2, reason) {
  212. uni.showLoading({
  213. title: "审核中"
  214. })
  215. let that = this
  216. if (this.list) {
  217. this.$api.doRequest('post', '/newWorkflow/api/handle', {
  218. taskId: list.taskId,
  219. approved: status,
  220. auditMind: this.auditMind ,
  221. needReapply: status2 != undefined ? true : false,
  222. }).then(res => {
  223. if (status == true) {
  224. this.$api.msg('通过成功')
  225. } else if (status == false) {
  226. this.$api.msg('驳回成功')
  227. }
  228. setTimeout(function() {
  229. if (that.everyCheck) {
  230. helper.setAudit(that.list[0])
  231. } else {
  232. uni.navigateBack()
  233. }
  234. }, 1000);
  235. })
  236. }
  237. },
  238. fanHui() {
  239. uni.navigateBack()
  240. },
  241. getList(){
  242. var that =this
  243. this.$api.doRequest('get', '/generalAuditInfo/getGeneralAuditInfo', {
  244. id:this.id
  245. }).then(res => {
  246. this.dataobj=res.data.data
  247. this.$api.doRequest('get', '/appendix/query/getFileList', {
  248. appendixIds: that.dataobj.addressUrl
  249. }).then(res1 => {
  250. that.imglist = res1.data.data
  251. for (let i = 0; i < that.imglist.length; i++) {//获取后缀
  252. if (that.imglist[i].appendixName) {
  253. let index = that.imglist[i].appendixName.lastIndexOf(".")
  254. that.imglist[i].type = that.imglist[i].appendixName.substring(index+1)
  255. }
  256. }
  257. })
  258. // 查流程
  259. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  260. businessCode: 'GENERAL-AUDIT-APPROVE',
  261. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  262. }).then(res1 => {
  263. this.$api.doRequest('get', '/commonUser/getHis', {
  264. workflowId: res1.data.data[0].id,
  265. businessKey: this.id,
  266. branch:that.dataobj.businessType?that.dataobj.businessType:'zt'
  267. }).then(response => {
  268. uni.hideLoading()
  269. for (let i = 0; i < response.data.data.length; i++) {
  270. this.$set(response.data.data[i], 'status', 'question')
  271. console.log(response.data.data[i].workflowHistoricTasks, i)
  272. if (response.data.data[i].commonStaffs) {
  273. response.data.data[i].showflow = false
  274. response.data.data[i].operatorTitle = response.data.data[i]
  275. .desc.substring(0, 2)
  276. response.data.data[i].operatorName = response.data.data[i]
  277. .desc
  278. response.data.data[i].staffscontent = '共' + response.data
  279. .data[i].commonStaffs.length + '人,当前审核' + response.data
  280. .data[i].workflowHistoricTasks.length + '人'
  281. if (response.data.data[i].workflowHistoricTasks && response
  282. .data.data[i].workflowHistoricTasks.length > 0) {
  283. if (response.data.data[i].workflowHistoricTasks
  284. .length != response.data.data[i].commonStaffs
  285. .length) {
  286. // response.data.data[i].status='question'
  287. this.$set(response.data.data[i], 'status',
  288. 'question')
  289. } else {
  290. this.$set(response.data.data[i], 'status',
  291. 'success')
  292. // response.data.data[i].status='success'
  293. }
  294. response.data.data[i].workflowlen = response.data.data[
  295. i].workflowHistoricTasks.length
  296. var workflowdata = response.data.data[i]
  297. .workflowHistoricTasks
  298. var staffsdata = response.data.data[i].commonStaffs
  299. for (let q = 0; q < staffsdata.length; q++) {
  300. staffsdata[q].status = false
  301. staffsdata[q].staffTitle = staffsdata[q].staffName
  302. for (let k = 0; k < workflowdata.length; k++) {
  303. if (staffsdata[q].staffId == workflowdata[k]
  304. .operatorId) {
  305. staffsdata[q].status = true
  306. }
  307. }
  308. }
  309. }
  310. response.data.data[i].commonStaffs1 = response.data.data[i]
  311. .commonStaffs
  312. } else {
  313. if (response.data.data[i].workflowHistoricTasks && response
  314. .data.data[i].workflowHistoricTasks.length > 0) {
  315. var len = response.data.data[i].workflowHistoricTasks
  316. .length - 1
  317. if (response.data.data[i].workflowHistoricTasks[len]
  318. .approved) {
  319. this.$set(response.data.data[i], 'status',
  320. 'success')
  321. } else {
  322. this.$set(response.data.data[i], 'status', 'error')
  323. }
  324. response.data.data[i].operatorTitle = response.data
  325. .data[i].workflowHistoricTasks[len].operatorName
  326. .substring(response.data.data[i]
  327. .workflowHistoricTasks[0].operatorName.length -
  328. 2)
  329. response.data.data[i].operatorName = response.data
  330. .data[i].workflowHistoricTasks[len].operatorName
  331. var time = new Date(response.data.data[i]
  332. .workflowHistoricTasks[len].claimTime)
  333. .getTime()
  334. response.data.data[i].updateDate = this.$u.timeFormat(
  335. time, 'mm.dd hh:MM')
  336. response.data.data[i].auditMind = response.data.data[i]
  337. .workflowHistoricTasks[len].auditMind
  338. } else {
  339. this.$set(response.data.data[i], 'status', 'question')
  340. // response.data.data[i].status='question'
  341. if (response.data.data[i].desc == '总经理助理审核') {
  342. response.data.data[i].operatorTitle = '总助'
  343. } else if (response.data.data[i].desc == '杜大光审核') {
  344. response.data.data[i].operatorTitle = '大光'
  345. } else {
  346. response.data.data[i].operatorTitle = response.data
  347. .data[i].desc.substring(0, 2)
  348. }
  349. response.data.data[i].operatorName = response.data
  350. .data[i].desc
  351. var time1 = new Date(response.data.data[i].updateDate)
  352. .getTime()
  353. response.data.data[i].updateDate = this.$u.timeFormat(
  354. time1, 'mm.dd hh:MM')
  355. response.data.data[i].auditMind = ''
  356. }
  357. }
  358. }
  359. console.log(response.data.data)
  360. for(let i = 0 ;i<response.data.data.length;i++){
  361. if(response.data.data[i].status == "error"){
  362. this.auditCheck = "error"
  363. break;
  364. }else if(response.data.data[i].status == "question"){
  365. this.auditCheck = "question"
  366. break;
  367. }else{
  368. this.auditCheck = "success"
  369. }
  370. }
  371. this.auditList = response.data.data
  372. var time2 = new Date(this.list.createDate).getTime()
  373. var time3 = this.$u.timeFormat(time2, 'mm.dd hh:MM')
  374. this.auditList.unshift({
  375. operatorTitle: this.list.creater.substring(0, 2),
  376. operatorName: this.list.creater,
  377. updateDate: time3,
  378. auditMind: '',
  379. desc: '发起申请',
  380. showflow: false,
  381. commonStaffs1: null,
  382. commonStaffs: null,
  383. workflowHistoricTasks: [],
  384. status: 'success'
  385. })
  386. })
  387. })
  388. })
  389. }
  390. }
  391. }
  392. </script>
  393. <style lang="scss" scoped>
  394. .bottom-btn {
  395. width: 100%;
  396. position: fixed;
  397. bottom: 0;
  398. display: flex;
  399. z-index: 2;
  400. left: 0;
  401. background-color: #f8f8f8;
  402. flex-direction: column;
  403. .btn1,
  404. .btn2 {
  405. width: 100%;
  406. margin-bottom: 26rpx;
  407. border-radius: 90rpx;
  408. }
  409. .btn1 {
  410. background: white;
  411. color: #00C265;
  412. }
  413. }
  414. .content2 {
  415. background: white;
  416. margin: 20rpx 0;
  417. border-radius: 20rpx;
  418. padding: 20rpx;
  419. .row {
  420. display: flex;
  421. .left {
  422. display: flex;
  423. align-items: center;
  424. .item1 {
  425. position: relative;
  426. .item-content {
  427. background: #617AE0;
  428. width: 44px;
  429. height: 44px;
  430. border-radius: 22px;
  431. line-height: 44px;
  432. text-align: center;
  433. font-size: 15px;
  434. color: #fff;
  435. }
  436. .status {
  437. position: absolute;
  438. border-radius: 50%;
  439. padding: 0px 2px;
  440. right: -3px;
  441. bottom: -3px;
  442. background: #fff;
  443. }
  444. .status.success {
  445. border: 1px solid rgb(60, 156, 255);
  446. }
  447. .status.error {
  448. border: 1px solid rgb(245, 108, 108);
  449. }
  450. .status.question {
  451. border: 1px solid #f9ae3d;
  452. }
  453. }
  454. }
  455. .right {
  456. width: 80%;
  457. // color: #B0B1B5;
  458. margin-top: 10px;
  459. .right-content {
  460. background: #F2F3F7;
  461. margin-left: 10px;
  462. margin-top: 10px;
  463. padding: 10px;
  464. border-radius: 5px;
  465. color: #B0B1B5;
  466. }
  467. .right-item {
  468. display: flex;
  469. justify-content: space-between;
  470. .time {
  471. color: #999;
  472. }
  473. .item2 {
  474. margin-left: 20rpx;
  475. margin-top: -7px;
  476. .name {
  477. font-size: 28rpx;
  478. font-weight: 800;
  479. margin-bottom: 4px;
  480. }
  481. .status.success {
  482. color: #6CC48C;
  483. }
  484. .status.error {
  485. color: rgb(245, 108, 108);
  486. }
  487. .status.question {
  488. color: #f9ae3d;
  489. }
  490. }
  491. }
  492. }
  493. }
  494. .row2 {
  495. display: flex;
  496. .item-content {
  497. background: #22C572;
  498. width: 30px;
  499. height: 30px;
  500. border-radius: 50%;
  501. line-height: 30px;
  502. text-align: center;
  503. font-size: 12px;
  504. color: #fff;
  505. padding: 0 2px;
  506. margin: 0 auto;
  507. }
  508. .status {
  509. position: absolute;
  510. top: 0;
  511. right: 0;
  512. }
  513. }
  514. .row-line {
  515. width: 1px;
  516. height: 30px;
  517. background: #F2F2F2;
  518. margin: 10rpx 50rpx;
  519. }
  520. .audit {
  521. margin-top: 20rpx;
  522. }
  523. }
  524. .u-form {
  525. margin: 20rpx;
  526. background: #fff;
  527. border-radius: 10px;
  528. padding: 30rpx 10px;
  529. .u-form-item {
  530. line-height: 30px;
  531. padding: 0px 0;
  532. font-size: 26rpx;
  533. }
  534. }
  535. .u-textarea-style {
  536. margin: 20rpx;
  537. background: #F9F9FA;
  538. border-radius: 10px;
  539. border: 1px solid #EEEEEE;
  540. padding: 10rpx 20rpx;
  541. position: relative;
  542. height:240px;
  543. /deep/.uni-textarea-textarea{
  544. width: 80%;
  545. }
  546. .right-bottom {
  547. position: absolute;
  548. right: 20rpx;
  549. bottom: 20rpx;
  550. color: #AFB3BF;
  551. }
  552. }
  553. .form_top {
  554. border-bottom: 1px solid #F5F6FA;
  555. padding-bottom: 10px;
  556. margin-bottom: 18rpx;
  557. font-size: 30rpx;
  558. font-weight: 600;
  559. }
  560. .form_view{
  561. margin: 20rpx 0;
  562. border-radius: 20rpx;
  563. background: #F9F9FA;
  564. padding: 30rpx 20rpx;
  565. margin-top: 30rpx;
  566. }
  567. .label_css {
  568. font-size: 26rpx;
  569. color: #878C9C;
  570. }
  571. .input_css {
  572. font-size: 20rpx;
  573. }
  574. .img_item {
  575. display: flex;
  576. width: 100%;
  577. margin: 10px 0;
  578. padding: 0 10rpx;
  579. .imgsign{
  580. width: 25px;
  581. height: 25px;
  582. margin-top: 6px;
  583. }
  584. .char_css {
  585. font-size: 28rpx;
  586. font-weight: 600;
  587. display: -webkit-box;
  588. overflow: hidden;
  589. /*! autoprefixer: off; */
  590. -webkit-box-orient: vertical;
  591. -webkit-line-clamp: 1;
  592. -webkit-box-orient: vertical;
  593. text-overflow: ellipsis;
  594. word-break: break-all;
  595. }
  596. .img_size{
  597. color: #B0B3BF;
  598. font-size: 12px;
  599. margin-top: 5px;
  600. }
  601. .img_dowload {
  602. width: 14%;
  603. color: #22C572;
  604. text-align: right;
  605. }
  606. }
  607. </style>