freight_setting_approval.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <view class="warp">
  3. <view class="topInfo">
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode="" v-if="list.priceStatus == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="list.priceStatus == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="list.priceStatus == '审核中'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{list.priceStatus}}</view>
  15. </view>
  16. <view class="infoData">{{list.updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class="transaction">
  20. <u-form :model="list" ref="list" class="uForm">
  21. <u-form-item label="运费类型" prop="contractNo" label-width="140">
  22. {{list.tranType}}运费
  23. </u-form-item>
  24. <u-form-item label="合同编号" prop="contractNo" label-width="140">
  25. <u-input v-model="list.contractNo" input-align="right" placeholder="" disabled />
  26. </u-form-item>
  27. <u-form-item label="任务编号" prop="processNo" label-width="140">
  28. <u-input v-model="list.processNo" input-align="right" placeholder="" disabled />
  29. </u-form-item>
  30. <u-form-item label="货名" prop="goodsName" label-width="140">
  31. <u-input v-model="list.goodsName" input-align="right" placeholder="" disabled />
  32. </u-form-item>
  33. <u-form-item label="发货地址" prop="sendDetailedAddress" label-width="140">
  34. <!-- <u-input v-model="list.sendDetailedAddress" input-align="right" placeholder="发货地址" disabled /> -->
  35. <view class="text_info">
  36. {{list.sendPrivate}}{{list.sendCity}}{{list.sendArea}}{{list.sendDetailedAddress}}
  37. </view>
  38. </u-form-item>
  39. <u-form-item label="收货地址" prop="receiveDetailedAddress" label-width="140">
  40. <!-- <u-input v-model="list.receiveDetailedAddress" input-align="right" placeholder="收货地址" disabled /> -->
  41. <view class="text_info">
  42. {{list.receivePrivate}}{{list.receiveCity}}{{list.receiveArea}}{{list.receiveDetailedAddress}}
  43. </view>
  44. </u-form-item>
  45. <u-form-item label="运费(元)" prop="tranPrice" label-width="250">
  46. <u-input v-if='list.billingMethod==1&&list.tranType=="汽运"' v-model="list.tranPriceIng" input-align="right"
  47. placeholder="请输入运费单价" />
  48. <u-input v-else-if='list.billingMethod!=1&&list.tranType=="汽运"' v-model="list.tranPriceIngCar" input-align="right" placeholder="请输入运费单价" />
  49. <u-input v-else v-model="list.tranPriceIng" input-align="right"
  50. placeholder="请输入运费单价" />
  51. </u-form-item>
  52. <u-form-item label="货值" prop="tranPrice" label-width="250">
  53. <u-input v-model="list.goodsValueIng" input-align="right"
  54. placeholder="请输入货值" />
  55. </u-form-item>
  56. </u-form>
  57. </view>
  58. <u-form ref="uForm">
  59. <view class="form_top">流程</view>
  60. <view class="content2">
  61. <view v-for="(item,index) in auditList" :key='index' class="audit">
  62. <view class="row" v-if='item.desc!="_PLACEHOLDER_"'>
  63. <view class="row-left">
  64. <view class="item1">
  65. <view class="item-content">{{item.operatorTitle}}</view>
  66. <view v-if="item.status=='success'" class='status success'>
  67. <u-icon name="checkmark" color="#2979ff" size="24"></u-icon>
  68. </view>
  69. <view v-if="item.status=='error'" class='status error'>
  70. <u-icon name="close" color="rgb(245, 108, 108)" size="24"></u-icon>
  71. </view>
  72. <view v-if="item.status=='question'" class='status question'>
  73. <u-icon name="question" color="#f9ae3d" size="24"></u-icon>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="row-right">
  78. <view class="right-item">
  79. <view class="item2">
  80. <view class="name">{{item.desc}}
  81. </view>
  82. <!-- <view class='time'>{{item.updateDate}}</view> -->
  83. <view v-if="item.status=='success'" class="status success">
  84. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  85. v-if='!item.commonStaffs1&&index!=0'>已审核</text></view>
  86. <view v-if="item.status=='error'" class="status error">
  87. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  88. v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已驳回":''}}</text>
  89. </view>
  90. <view v-if="item.status=='question'" class="status question">
  91. {{item.commonStaffs1?item.staffscontent:''}}<text
  92. v-if='!item.commonStaffs1'>未审核</text></view>
  93. <!-- <view class="status success">吕波(已审核)</view> -->
  94. </view>
  95. <view v-if='index==0||item.workflowHistoricTasks&&item.workflowHistoricTasks.length>0'
  96. class='time'>
  97. {{item.updateDate}}
  98. </view>
  99. </view>
  100. <view v-if='item.auditMind' class="right-content">
  101. {{item.auditMind}}
  102. </view>
  103. </view>
  104. <view v-if='item.commonStaffs1' class="right">
  105. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
  106. </u-icon>
  107. </view>
  108. </view>
  109. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  110. <view class='row2'>
  111. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  112. <view class="item-content">
  113. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  114. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  115. </view>
  116. <view class="name">{{item1.staffName}}</view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="row-line" v-if="index!= auditList.length - 1 &&item.desc!='_PLACEHOLDER_'"></view>
  121. </view>
  122. </view>
  123. </u-form>
  124. <u-modal v-model="show" :title-style="{fontSize: '18px',fontWeight:'500'}"
  125. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  126. :showCancelButton='true' :content="content" @confirm="passSubmit" @cancel="show = false"></u-modal>
  127. <u-button type="success" class="submit" @click="show = true" v-if="list.priceStatus == '审核中'||isSHowBtn">通过
  128. </u-button>
  129. </view>
  130. </template>
  131. <script>
  132. import helper from '@/common/helper.js';
  133. import {
  134. mapState
  135. } from 'vuex';
  136. export default {
  137. data() {
  138. return {
  139. isSHowBtn: true,
  140. everyCheck: '',
  141. list: {
  142. priceStatus: "",
  143. },
  144. id: "",
  145. show: false,
  146. rejectInfo: "", //审核意见
  147. title: "提示",
  148. auditList:[],
  149. content: '是否通过该设置?'
  150. }
  151. },
  152. onBackPress(e) {
  153. if (this.everyCheck) {
  154. uni.navigateTo({
  155. url: "/pages/task/my_task"
  156. })
  157. return true;
  158. }
  159. },
  160. onLoad(options) {
  161. this.id = options.id
  162. this.everyCheck = uni.getStorageSync("everyTask")
  163. this.isSHowBtn = options.isShowbtn
  164. this.getList()
  165. },
  166. computed: {
  167. ...mapState(['hasLogin', 'userInfo']),
  168. },
  169. methods: {
  170. getList() {
  171. var that = this
  172. this.$api.doRequest('get', '/tranProcessInfo/getTranProcess', {
  173. id: this.id
  174. }).then(res => {
  175. this.list = res.data.data
  176. // 查流程
  177. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  178. businessCode: 'YUNJIA-TRAN-APPROVE',
  179. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  180. }).then(res1 => {
  181. this.$api.doRequest('get', '/commonUser/getHis', {
  182. workflowId: res1.data.data[0].id,
  183. businessKey: this.id,
  184. // branch:'zt'
  185. }).then(response => {
  186. uni.hideLoading()
  187. for (let i = 0; i < response.data.data.length; i++) {
  188. this.$set(response.data.data[i], 'status', 'question')
  189. console.log(response.data.data[i].workflowHistoricTasks, i)
  190. if (response.data.data[i].commonStaffs) {
  191. response.data.data[i].showflow = false
  192. response.data.data[i].operatorTitle = response.data.data[i]
  193. .desc.substring(0, 2)
  194. response.data.data[i].operatorName = response.data.data[i]
  195. .desc
  196. response.data.data[i].staffscontent = '共' + response.data
  197. .data[i].commonStaffs.length + '人,当前审核' + response.data
  198. .data[i].workflowHistoricTasks.length + '人'
  199. if (response.data.data[i].workflowHistoricTasks && response
  200. .data.data[i].workflowHistoricTasks.length > 0) {
  201. if (response.data.data[i].workflowHistoricTasks
  202. .length != response.data.data[i].commonStaffs
  203. .length) {
  204. // response.data.data[i].status='question'
  205. this.$set(response.data.data[i], 'status',
  206. 'question')
  207. } else {
  208. this.$set(response.data.data[i], 'status',
  209. 'success')
  210. // response.data.data[i].status='success'
  211. }
  212. response.data.data[i].workflowlen = response.data.data[
  213. i].workflowHistoricTasks.length
  214. var workflowdata = response.data.data[i]
  215. .workflowHistoricTasks
  216. var staffsdata = response.data.data[i].commonStaffs
  217. for (let q = 0; q < staffsdata.length; q++) {
  218. staffsdata[q].status = false
  219. staffsdata[q].staffTitle = staffsdata[q].staffName
  220. for (let k = 0; k < workflowdata.length; k++) {
  221. if (staffsdata[q].staffId == workflowdata[k]
  222. .operatorId) {
  223. staffsdata[q].status = true
  224. }
  225. }
  226. }
  227. }
  228. response.data.data[i].commonStaffs1 = response.data.data[i]
  229. .commonStaffs
  230. } else {
  231. if (response.data.data[i].workflowHistoricTasks && response
  232. .data.data[i].workflowHistoricTasks.length > 0) {
  233. var len = response.data.data[i].workflowHistoricTasks
  234. .length - 1
  235. if (response.data.data[i].workflowHistoricTasks[len]
  236. .approved) {
  237. this.$set(response.data.data[i], 'status',
  238. 'success')
  239. } else {
  240. this.$set(response.data.data[i], 'status', 'error')
  241. }
  242. response.data.data[i].operatorTitle = response.data
  243. .data[i].workflowHistoricTasks[len].operatorName
  244. .substring(response.data.data[i]
  245. .workflowHistoricTasks[0].operatorName.length -
  246. 2)
  247. response.data.data[i].operatorName = response.data
  248. .data[i].workflowHistoricTasks[len].operatorName
  249. var time = new Date(response.data.data[i]
  250. .workflowHistoricTasks[len].claimTime)
  251. .getTime()
  252. response.data.data[i].updateDate = this.$u.timeFormat(
  253. time, 'mm.dd hh:MM')
  254. response.data.data[i].auditMind = response.data.data[i]
  255. .workflowHistoricTasks[len].auditMind
  256. } else {
  257. this.$set(response.data.data[i], 'status', 'question')
  258. // response.data.data[i].status='question'
  259. if (response.data.data[i].desc == '总经理助理审核') {
  260. response.data.data[i].operatorTitle = '总助'
  261. } else if (response.data.data[i].desc == '杜大光审核') {
  262. response.data.data[i].operatorTitle = '大光'
  263. } else {
  264. response.data.data[i].operatorTitle = response.data
  265. .data[i].desc.substring(0, 2)
  266. }
  267. response.data.data[i].operatorName = response.data
  268. .data[i].desc
  269. var time1 = new Date(response.data.data[i].updateDate)
  270. .getTime()
  271. response.data.data[i].updateDate = this.$u.timeFormat(
  272. time1, 'mm.dd hh:MM')
  273. response.data.data[i].auditMind = ''
  274. }
  275. }
  276. }
  277. console.log(response.data.data)
  278. for(let i = 0 ;i<response.data.data.length;i++){
  279. if(response.data.data[i].status == "error"){
  280. this.auditCheck = "error"
  281. break;
  282. }else if(response.data.data[i].status == "question"){
  283. this.auditCheck = "question"
  284. break;
  285. }else{
  286. this.auditCheck = "success"
  287. }
  288. }
  289. this.auditList = response.data.data
  290. var time2 = new Date(this.list.createDate).getTime()
  291. var time3 = this.$u.timeFormat(time2, 'mm.dd hh:MM')
  292. this.auditList.unshift({
  293. operatorTitle: this.list.requester.substring(0, 2),
  294. operatorName: this.list.requester,
  295. updateDate: time3,
  296. auditMind: '',
  297. desc: '发起申请',
  298. showflow: false,
  299. commonStaffs1: null,
  300. commonStaffs: null,
  301. workflowHistoricTasks: [],
  302. status: 'success'
  303. })
  304. })
  305. })
  306. })
  307. },
  308. passSubmit() {
  309. var that = this
  310. if (!this.list.tranPriceIng && this.list.billingMethod == 1&&this.list.tranType=="汽运" || !this.list.tranPriceIngCar && this.list
  311. .billingMethod == 2&&this.list.tranType=="汽运"||!this.list.tranPriceIng &&this.list.tranType!="汽运") {
  312. this.$api.msg('运费单价不能为空')
  313. return
  314. }
  315. uni.showLoading({
  316. title: "审核中"
  317. })
  318. var tranProcessInfo = {}
  319. var url = ''
  320. tranProcessInfo.id = that.list.id
  321. tranProcessInfo.flag = "2"
  322. tranProcessInfo.billingMethod = that.list.billingMethod
  323. tranProcessInfo.goodsValueIng = that.list.goodsValueIng
  324. tranProcessInfo.reviewer = that.userInfo.userName
  325. tranProcessInfo.tranTypeKey = that.list.tranTypeKey
  326. if (that.list.billingMethod == 1&&that.list.tranType=="汽运"||that.list.tranType!="汽运") {
  327. tranProcessInfo.tranPriceIng = that.list.tranPriceIng
  328. url = '/tranProcessInfo/api/setUpTranPrice'
  329. } else {
  330. tranProcessInfo.tranPriceIngCar = that.list.tranPriceIngCar
  331. url = '/tranProcessInfo/api/setUpTranPriceCar'
  332. }
  333. that.$api.doRequest('post', url, tranProcessInfo)
  334. .then(res => {
  335. if (res.data.code == 200) {
  336. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  337. taskId: that.list.taskId,
  338. approved: true,
  339. auditMind: '',
  340. needReapply: true,
  341. }).then(res => {
  342. that.$api.msg('通过成功')
  343. that.show = false
  344. setTimeout(function() {
  345. if (that.everyCheck) {
  346. helper.setAudit(that.list)
  347. } else {
  348. uni.navigateBack()
  349. }
  350. uni.hideLoading()
  351. }, 1000);
  352. })
  353. }
  354. })
  355. }
  356. }
  357. }
  358. </script>
  359. <style scoped lang="scss">
  360. .transaction {
  361. background-color: #FFFFFF;
  362. margin: 10rpx;
  363. padding-bottom: 10rpx;
  364. border-radius: 20rpx;
  365. }
  366. .uForm {
  367. padding: 0 40rpx;
  368. }
  369. .u-form-item {
  370. padding: 0;
  371. }
  372. .bottom-btn {
  373. width: 100%;
  374. position: fixed;
  375. bottom: 40rpx;
  376. display: flex;
  377. z-index: 2;
  378. }
  379. .topInfo {
  380. height: 210rpx;
  381. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  382. padding: 30rpx;
  383. .topInfo-item {
  384. height: 150rpx;
  385. background-color: #FFFFFF;
  386. border-radius: 20rpx;
  387. padding: 40rpx;
  388. .logo {
  389. width: 40rpx;
  390. height: 40rpx;
  391. margin-top: 8rpx;
  392. }
  393. .infoText {
  394. font-size: 36rpx;
  395. font-weight: 600;
  396. margin-left: 20rpx;
  397. }
  398. .infoData {
  399. color: #878C9C;
  400. font-size: 26rpx;
  401. margin-top: 10rpx;
  402. }
  403. }
  404. }
  405. .submit {
  406. width: 98%;
  407. background: #22C572;
  408. border-radius: 40rpx;
  409. margin: 40rpx 0;
  410. }
  411. .rejectInfoCss {
  412. border: 1px solid #ccc;
  413. border-radius: 10rpx;
  414. background-color: #F9F9FA;
  415. // height: 100px;
  416. overflow-y: auto;
  417. margin: 30rpx;
  418. }
  419. .rejectText {
  420. text-align: center;
  421. }
  422. /deep/.u-input__textarea {
  423. height: 300rpx !important;
  424. }
  425. .text_info {
  426. display: flex;
  427. width: 100%;
  428. justify-content: flex-end;
  429. }
  430. .u-form {
  431. margin-bottom: 20rpx;
  432. background: #fff;
  433. border-radius: 10px;
  434. padding: 30rpx 10px;
  435. .u-form-item {
  436. line-height: 30px;
  437. padding: 0px 0;
  438. font-size: 26rpx;
  439. color: #878C9C;
  440. }
  441. }
  442. .content2 {
  443. background: white;
  444. margin: 20rpx 0;
  445. border-radius: 20rpx;
  446. padding: 20rpx;
  447. .row {
  448. display: flex;
  449. .row-left {
  450. display: flex;
  451. align-items: center;
  452. .item1 {
  453. position: relative;
  454. .item-content {
  455. background: #617AE0;
  456. width: 44px;
  457. height: 44px;
  458. border-radius: 22px;
  459. line-height: 44px;
  460. text-align: center;
  461. font-size: 15px;
  462. color: #fff;
  463. }
  464. .status {
  465. position: absolute;
  466. border-radius: 50%;
  467. padding: 0px 2px;
  468. right: -3px;
  469. bottom: -3px;
  470. background: #fff;
  471. }
  472. .status.success {
  473. border: 1px solid rgb(60, 156, 255);
  474. }
  475. .status.error {
  476. border: 1px solid rgb(245, 108, 108);
  477. }
  478. .status.question {
  479. border: 1px solid #f9ae3d;
  480. }
  481. }
  482. }
  483. .row-right {
  484. width: 80%;
  485. // color: #B0B1B5;
  486. margin-top: 10px;
  487. .right-content {
  488. background: #F2F3F7;
  489. margin-left: 10px;
  490. margin-top: 10px;
  491. padding: 10px;
  492. border-radius: 5px;
  493. color: #B0B1B5;
  494. }
  495. .right-item {
  496. display: flex;
  497. justify-content: space-between;
  498. .time {
  499. color: #999;
  500. }
  501. .item2 {
  502. margin-left: 20rpx;
  503. margin-top: -7px;
  504. .name {
  505. font-size: 28rpx;
  506. font-weight: 800;
  507. margin-bottom: 4px;
  508. }
  509. .status.success {
  510. color: #6CC48C;
  511. }
  512. .status.error {
  513. color: rgb(245, 108, 108);
  514. }
  515. .status.question {
  516. color: #f9ae3d;
  517. }
  518. }
  519. }
  520. }
  521. }
  522. .row2 {
  523. display: flex;
  524. .item-content {
  525. background: #22C572;
  526. width: 30px;
  527. height: 30px;
  528. border-radius: 50%;
  529. line-height: 30px;
  530. text-align: center;
  531. font-size: 12px;
  532. color: #fff;
  533. padding: 0 2px;
  534. margin: 0 auto;
  535. }
  536. .status {
  537. position: absolute;
  538. top: 0;
  539. right: 0;
  540. }
  541. }
  542. .row-line {
  543. width: 1px;
  544. height: 30px;
  545. background: #F2F2F2;
  546. margin: 10rpx 50rpx;
  547. }
  548. .audit {
  549. margin-top: 20rpx;
  550. }
  551. }
  552. .warp{
  553. padding-bottom:30rpx;
  554. }
  555. </style>