freight_setting_approval.vue 15 KB

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