look.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <template>
  2. <view>
  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?dataobj.remark.length:0}}/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 class="flex audit_img">
  94. <view v-for="(items,indexs) in item.fileUrl" class="url_css">
  95. <image :src="items" mode="aspectFill" class="url_img" @click="auditFile(items)"></image>
  96. </view>
  97. </view>
  98. </view>
  99. <view v-if='item.commonStaffs1' class="right">
  100. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
  101. </u-icon>
  102. </view>
  103. </view>
  104. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  105. <view class='row2'>
  106. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  107. <view class="item-content">
  108. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  109. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  110. </view>
  111. <view class="name">{{item1.staffName}}</view>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="row-line" v-if="index!= auditList.length - 1&&item.desc!='_PLACEHOLDER_'"></view>
  116. </view>
  117. </view>
  118. </u-form>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. export default {
  124. data() {
  125. return {
  126. id:'',
  127. dataobj:{},
  128. imglist:[],
  129. auditList:[]
  130. }
  131. },
  132. onLoad(options){
  133. this.id=options.id
  134. console.log(options.id)
  135. },
  136. onShow(){
  137. // this.$nextTick(()=>{
  138. this.getList()
  139. // })
  140. },
  141. methods: {
  142. auditFile(src) {
  143. uni.downloadFile({
  144. url: src,
  145. success: function(res) {
  146. var filePath = res.tempFilePath;
  147. uni.openDocument({
  148. filePath: filePath,
  149. showMenu: true,
  150. success: function(res) {
  151. console.log('打开文档成功');
  152. }
  153. });
  154. }
  155. });
  156. },
  157. openDocument(src) {
  158. uni.downloadFile({
  159. url: src.appendixPath,
  160. success: function(res) {
  161. var filePath = res.tempFilePath;
  162. uni.openDocument({
  163. filePath: filePath,
  164. showMenu: true,
  165. success: function(res) {
  166. console.log('打开文档成功');
  167. }
  168. });
  169. }
  170. });
  171. },
  172. getList(){
  173. var that =this
  174. this.$api.doRequest('get', '/generalAuditInfo/getGeneralAuditInfo', {
  175. id:this.id
  176. }).then(res => {
  177. this.dataobj=res.data.data
  178. this.$api.doRequest('get', '/appendix/query/getFileList', {
  179. appendixIds: that.dataobj.addressUrl
  180. }).then(res1 => {
  181. that.imglist = res1.data.data
  182. for (let i = 0; i < that.imglist.length; i++) {//获取后缀
  183. if (that.imglist[i].appendixName) {
  184. let index = that.imglist[i].appendixName.lastIndexOf(".")
  185. that.imglist[i].type = that.imglist[i].appendixName.substring(index+1)
  186. }
  187. }
  188. })
  189. // 查流程
  190. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  191. businessCode: 'GENERAL-AUDIT-APPROVE',
  192. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  193. }).then(res1 => {
  194. this.$api.doRequest('get', '/commonUser/getHis', {
  195. workflowId: res1.data.data[0].id,
  196. businessKey: this.id,
  197. branch:that.dataobj.businessType?that.dataobj.businessType:'zt'
  198. }).then(response => {
  199. uni.hideLoading()
  200. for (let i = 0; i < response.data.data.length; i++) {
  201. this.$set(response.data.data[i], 'status', 'question')
  202. console.log(response.data.data[i].workflowHistoricTasks, i)
  203. if (response.data.data[i].commonStaffs) {
  204. response.data.data[i].showflow = false
  205. response.data.data[i].operatorTitle = response.data.data[i]
  206. .desc.substring(0, 2)
  207. response.data.data[i].operatorName = response.data.data[i]
  208. .desc
  209. response.data.data[i].staffscontent = '共' + response.data
  210. .data[i].commonStaffs.length + '人,当前审核' + response.data
  211. .data[i].workflowHistoricTasks.length + '人'
  212. if (response.data.data[i].workflowHistoricTasks && response
  213. .data.data[i].workflowHistoricTasks.length > 0) {
  214. if (response.data.data[i].workflowHistoricTasks
  215. .length != response.data.data[i].commonStaffs
  216. .length) {
  217. // response.data.data[i].status='question'
  218. this.$set(response.data.data[i], 'status',
  219. 'question')
  220. } else {
  221. this.$set(response.data.data[i], 'status',
  222. 'success')
  223. // response.data.data[i].status='success'
  224. }
  225. response.data.data[i].workflowlen = response.data.data[
  226. i].workflowHistoricTasks.length
  227. var workflowdata = response.data.data[i]
  228. .workflowHistoricTasks
  229. var staffsdata = response.data.data[i].commonStaffs
  230. for (let q = 0; q < staffsdata.length; q++) {
  231. staffsdata[q].status = false
  232. staffsdata[q].staffTitle = staffsdata[q].staffName
  233. for (let k = 0; k < workflowdata.length; k++) {
  234. if (staffsdata[q].staffId == workflowdata[k]
  235. .operatorId) {
  236. staffsdata[q].status = true
  237. }
  238. }
  239. }
  240. }
  241. response.data.data[i].commonStaffs1 = response.data.data[i]
  242. .commonStaffs
  243. } else {
  244. if (response.data.data[i].workflowHistoricTasks && response
  245. .data.data[i].workflowHistoricTasks.length > 0) {
  246. var len = response.data.data[i].workflowHistoricTasks
  247. .length - 1
  248. if (response.data.data[i].workflowHistoricTasks[len]
  249. .approved) {
  250. this.$set(response.data.data[i], 'status',
  251. 'success')
  252. } else {
  253. this.$set(response.data.data[i], 'status', 'error')
  254. }
  255. response.data.data[i].operatorTitle = response.data
  256. .data[i].workflowHistoricTasks[len].operatorName
  257. .substring(response.data.data[i]
  258. .workflowHistoricTasks[0].operatorName.length -
  259. 2)
  260. response.data.data[i].operatorName = response.data
  261. .data[i].workflowHistoricTasks[len].operatorName
  262. var time = new Date(response.data.data[i]
  263. .workflowHistoricTasks[len].claimTime)
  264. .getTime()
  265. response.data.data[i].updateDate = this.$u.timeFormat(
  266. time, 'mm.dd hh:MM')
  267. // response.data.data[i].auditMind = response.data.data[i]
  268. // .workflowHistoricTasks[len].auditMind
  269. if (response.data.data[i].workflowHistoricTasks[len].auditMind && response.data.data[i].workflowHistoricTasks[len].auditMind.indexOf("##") !=-1) {
  270. response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[0]
  271. response.data.data[i].fileUrl = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[1].split(",")
  272. }else{
  273. response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind
  274. }
  275. } else {
  276. this.$set(response.data.data[i], 'status', 'question')
  277. // response.data.data[i].status='question'
  278. if (response.data.data[i].desc == '总经理助理审核') {
  279. response.data.data[i].operatorTitle = '总助'
  280. } else if (response.data.data[i].desc == '杜大光审核') {
  281. response.data.data[i].operatorTitle = '大光'
  282. } else {
  283. response.data.data[i].operatorTitle = response.data
  284. .data[i].desc.substring(0, 2)
  285. }
  286. response.data.data[i].operatorName = response.data
  287. .data[i].desc
  288. var time1 = new Date(response.data.data[i].updateDate)
  289. .getTime()
  290. response.data.data[i].updateDate = this.$u.timeFormat(
  291. time1, 'mm.dd hh:MM')
  292. response.data.data[i].auditMind = ''
  293. }
  294. }
  295. }
  296. console.log(response.data.data)
  297. for(let i = 0 ;i<response.data.data.length;i++){
  298. if(response.data.data[i].status == "error"){
  299. this.auditCheck = "error"
  300. break;
  301. }else if(response.data.data[i].status == "question"){
  302. this.auditCheck = "question"
  303. break;
  304. }else{
  305. this.auditCheck = "success"
  306. }
  307. }
  308. this.auditList = response.data.data
  309. var time2 = new Date(this.dataobj.createDate).getTime()
  310. var time3 = this.$u.timeFormat(time2, 'mm.dd hh:MM')
  311. this.auditList.unshift({
  312. operatorTitle: this.dataobj.creater.substring(0, 2),
  313. operatorName: this.dataobj.creater,
  314. updateDate: time3,
  315. auditMind: '',
  316. desc: '发起申请',
  317. showflow: false,
  318. commonStaffs1: null,
  319. commonStaffs: null,
  320. workflowHistoricTasks: [],
  321. status: 'success'
  322. })
  323. })
  324. })
  325. })
  326. }
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .content2 {
  332. background: white;
  333. margin: 20rpx 0;
  334. border-radius: 20rpx;
  335. padding: 20rpx;
  336. .row {
  337. display: flex;
  338. .left {
  339. display: flex;
  340. // align-items: center;
  341. .item1 {
  342. position: relative;
  343. .item-content {
  344. background: #617AE0;
  345. width: 44px;
  346. height: 44px;
  347. border-radius: 22px;
  348. line-height: 44px;
  349. text-align: center;
  350. font-size: 15px;
  351. color: #fff;
  352. }
  353. .status {
  354. // position: absolute;
  355. // border-radius: 50%;
  356. // padding: 0px 2px;
  357. // right: -3px;
  358. // bottom: -3px;
  359. // background: #fff;
  360. text-align: center;
  361. position: relative;
  362. width: 18px;
  363. height: 18px;
  364. border-radius: 50%;
  365. padding: 0px 2px;
  366. margin: auto;
  367. margin-right: -5px;
  368. top: -16px;
  369. background: #fff;
  370. }
  371. .status.success {
  372. border: 1px solid rgb(60, 156, 255);
  373. }
  374. .status.error {
  375. border: 1px solid rgb(245, 108, 108);
  376. }
  377. .status.question {
  378. border: 1px solid #f9ae3d;
  379. }
  380. }
  381. }
  382. .right {
  383. width: 80%;
  384. // color: #B0B1B5;
  385. margin-top: 10px;
  386. .right-content {
  387. background: #F2F3F7;
  388. margin-left: 10px;
  389. margin-top: 10px;
  390. padding: 10px;
  391. border-radius: 5px;
  392. color: #B0B1B5;
  393. }
  394. .right-item {
  395. display: flex;
  396. justify-content: space-between;
  397. .time {
  398. color: #999;
  399. }
  400. .item2 {
  401. margin-left: 20rpx;
  402. margin-top: -7px;
  403. .name {
  404. font-size: 28rpx;
  405. font-weight: 800;
  406. margin-bottom: 4px;
  407. }
  408. .status.success {
  409. color: #6CC48C;
  410. }
  411. .status.error {
  412. color: rgb(245, 108, 108);
  413. }
  414. .status.question {
  415. color: #f9ae3d;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. .row2 {
  422. display: flex;
  423. .item-content {
  424. background: #22C572;
  425. width: 30px;
  426. height: 30px;
  427. border-radius: 50%;
  428. line-height: 30px;
  429. text-align: center;
  430. font-size: 12px;
  431. color: #fff;
  432. padding: 0 2px;
  433. margin: 0 auto;
  434. }
  435. .status {
  436. position: absolute;
  437. top: 0;
  438. right: 0;
  439. }
  440. }
  441. .row-line {
  442. width: 1px;
  443. height: 30px;
  444. background: #F2F2F2;
  445. margin: 10rpx 50rpx;
  446. }
  447. .audit {
  448. margin-top: 20rpx;
  449. }
  450. .audit_img {
  451. flex-wrap: wrap;
  452. // margin: 0 10rpx;
  453. margin-left: 20rpx;
  454. .url_css {
  455. border: 1px solid #999999;
  456. border-radius: 10px;
  457. margin-top: 10px;
  458. margin-right: 4px;
  459. overflow: hidden;
  460. width: 73px;
  461. height: 73px;
  462. .url_img {
  463. width: 73px;
  464. height: 73px;
  465. // border-radius: 10px;
  466. }
  467. }
  468. }
  469. }
  470. .u-form {
  471. margin: 20rpx;
  472. background: #fff;
  473. border-radius: 10px;
  474. padding: 30rpx 10px;
  475. .u-form-item {
  476. line-height: 30px;
  477. padding: 0px 0;
  478. font-size: 26rpx;
  479. }
  480. }
  481. .u-textarea-style {
  482. margin: 20rpx;
  483. background: #F9F9FA;
  484. border-radius: 10px;
  485. border: 1px solid #EEEEEE;
  486. padding: 10rpx 20rpx;
  487. position: relative;
  488. height:240px;
  489. /deep/.uni-textarea-textarea{
  490. width: 80%;
  491. }
  492. .right-bottom {
  493. position: absolute;
  494. right: 20rpx;
  495. bottom: 20rpx;
  496. color: #AFB3BF;
  497. }
  498. }
  499. .form_top {
  500. border-bottom: 1px solid #F5F6FA;
  501. padding-bottom: 10px;
  502. margin-bottom: 18rpx;
  503. font-size: 30rpx;
  504. font-weight: 600;
  505. }
  506. .form_view{
  507. margin: 20rpx 0;
  508. border-radius: 20rpx;
  509. background: #F9F9FA;
  510. padding: 30rpx 20rpx;
  511. margin-top: 30rpx;
  512. }
  513. .label_css {
  514. font-size: 26rpx;
  515. color: #878C9C;
  516. }
  517. .input_css {
  518. font-size: 20rpx;
  519. }
  520. .img_item {
  521. display: flex;
  522. width: 100%;
  523. margin: 10px 0;
  524. padding: 0 10rpx;
  525. .imgsign{
  526. width: 25px;
  527. height: 25px;
  528. margin-top: 6px;
  529. }
  530. .char_css {
  531. font-size: 28rpx;
  532. font-weight: 600;
  533. display: -webkit-box;
  534. overflow: hidden;
  535. /*! autoprefixer: off; */
  536. -webkit-box-orient: vertical;
  537. -webkit-line-clamp: 1;
  538. -webkit-box-orient: vertical;
  539. text-overflow: ellipsis;
  540. word-break: break-all;
  541. }
  542. .img_size{
  543. color: #B0B3BF;
  544. font-size: 12px;
  545. margin-top: 5px;
  546. }
  547. .img_dowload {
  548. width: 14%;
  549. color: #22C572;
  550. text-align: right;
  551. }
  552. }
  553. </style>