look.vue 16 KB

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