freight_setting_approval.vue 18 KB

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