freight_setting_approval.vue 17 KB

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