freight_setting_details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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. </u-form-item>
  36. <u-form-item label="收货地址" prop="receiveDetailedAddress" label-width="140">
  37. <u-input v-model="list.receiveDetailedAddress" input-align="right" placeholder="收货地址" disabled />
  38. </u-form-item>
  39. <u-form-item label="运费(元/吨)" prop="tranPrice" label-width="250">
  40. <u-input v-if='list.billingMethod==2&&list.tranPriceCar!=0' v-model="list.tranPriceCar" input-align="right" placeholder="请输入运费单价" disabled/>
  41. <u-input v-else-if='list.billingMethod==2&&list.tranPriceCar==0' v-model="list.tranPriceIngCar" input-align="right" placeholder="请输入运费单价" disabled/>
  42. <u-input v-else-if='list.billingMethod==1&&list.tranPrice==0' v-model="list.tranPriceIng" input-align="right" placeholder="请输入运费单价" disabled/>
  43. <u-input v-else-if='list.tranPrice' v-model="list.tranPrice" input-align="right" placeholder="请输入运费单价" disabled/>
  44. <u-input v-else v-model="list.tranPriceIng" input-align="right" placeholder="请输入运费单价" disabled/>
  45. </u-form-item>
  46. </u-form>
  47. </view>
  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="row-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="row-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>
  94. <view v-if='item.commonStaffs1' class="right">
  95. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
  96. </u-icon>
  97. </view>
  98. </view>
  99. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  100. <view class='row2'>
  101. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  102. <view class="item-content">
  103. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  104. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  105. </view>
  106. <view class="name">{{item1.staffName}}</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="row-line" v-if="index!= auditList.length - 1 &&item.desc!='_PLACEHOLDER_'"></view>
  111. </view>
  112. </view>
  113. </u-form>
  114. <u-button type="primary" class="submit" @click="fanHui()">返回</u-button>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. mapState
  120. } from 'vuex';
  121. export default {
  122. data() {
  123. return {
  124. list: {
  125. priceStatus:"",
  126. },
  127. id: "",
  128. auditList:[]
  129. }
  130. },
  131. onLoad(options) {
  132. this.id = options.id
  133. this.getList()
  134. },
  135. computed: {
  136. ...mapState(['hasLogin', 'userInfo']),
  137. },
  138. methods: {
  139. getList() {
  140. this.$api.doRequest('get', '/tranProcessInfo/getTranProcess', {
  141. id: this.id
  142. }).then(res => {
  143. this.list = res.data.data
  144. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  145. businessCode: 'YUNJIA-TRAN-APPROVE',
  146. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  147. }).then(res1 => {
  148. this.$api.doRequest('get', '/commonUser/getHis', {
  149. workflowId: res1.data.data[0].id,
  150. businessKey: this.id,
  151. branch:that.list[0].jointVentureParties?that.list[0].jointVentureParties:'zt'
  152. }).then(response => {
  153. uni.hideLoading()
  154. for (let i = 0; i < response.data.data.length; i++) {
  155. this.$set(response.data.data[i], 'status', 'question')
  156. console.log(response.data.data[i].workflowHistoricTasks, i)
  157. if (response.data.data[i].commonStaffs) {
  158. response.data.data[i].showflow = false
  159. response.data.data[i].operatorTitle = response.data.data[i]
  160. .desc.substring(0, 2)
  161. response.data.data[i].operatorName = response.data.data[i]
  162. .desc
  163. response.data.data[i].staffscontent = '共' + response.data
  164. .data[i].commonStaffs.length + '人,当前审核' + response.data
  165. .data[i].workflowHistoricTasks.length + '人'
  166. if (response.data.data[i].workflowHistoricTasks && response
  167. .data.data[i].workflowHistoricTasks.length > 0) {
  168. if (response.data.data[i].workflowHistoricTasks
  169. .length != response.data.data[i].commonStaffs
  170. .length) {
  171. // response.data.data[i].status='question'
  172. this.$set(response.data.data[i], 'status',
  173. 'question')
  174. } else {
  175. this.$set(response.data.data[i], 'status',
  176. 'success')
  177. // response.data.data[i].status='success'
  178. }
  179. response.data.data[i].workflowlen = response.data.data[
  180. i].workflowHistoricTasks.length
  181. var workflowdata = response.data.data[i]
  182. .workflowHistoricTasks
  183. var staffsdata = response.data.data[i].commonStaffs
  184. for (let q = 0; q < staffsdata.length; q++) {
  185. staffsdata[q].status = false
  186. staffsdata[q].staffTitle = staffsdata[q].staffName
  187. for (let k = 0; k < workflowdata.length; k++) {
  188. if (staffsdata[q].staffId == workflowdata[k]
  189. .operatorId) {
  190. staffsdata[q].status = true
  191. }
  192. }
  193. }
  194. }
  195. response.data.data[i].commonStaffs1 = response.data.data[i]
  196. .commonStaffs
  197. } else {
  198. if (response.data.data[i].workflowHistoricTasks && response
  199. .data.data[i].workflowHistoricTasks.length > 0) {
  200. var len = response.data.data[i].workflowHistoricTasks
  201. .length - 1
  202. if (response.data.data[i].workflowHistoricTasks[len]
  203. .approved) {
  204. this.$set(response.data.data[i], 'status',
  205. 'success')
  206. } else {
  207. this.$set(response.data.data[i], 'status', 'error')
  208. }
  209. response.data.data[i].operatorTitle = response.data
  210. .data[i].workflowHistoricTasks[len].operatorName
  211. .substring(response.data.data[i]
  212. .workflowHistoricTasks[0].operatorName.length -
  213. 2)
  214. response.data.data[i].operatorName = response.data
  215. .data[i].workflowHistoricTasks[len].operatorName
  216. var time = new Date(response.data.data[i]
  217. .workflowHistoricTasks[len].claimTime)
  218. .getTime()
  219. response.data.data[i].updateDate = this.$u.timeFormat(
  220. time, 'mm.dd hh:MM')
  221. response.data.data[i].auditMind = response.data.data[i]
  222. .workflowHistoricTasks[len].auditMind
  223. } else {
  224. this.$set(response.data.data[i], 'status', 'question')
  225. // response.data.data[i].status='question'
  226. if (response.data.data[i].desc == '总经理助理审核') {
  227. response.data.data[i].operatorTitle = '总助'
  228. } else if (response.data.data[i].desc == '杜大光审核') {
  229. response.data.data[i].operatorTitle = '大光'
  230. } else {
  231. response.data.data[i].operatorTitle = response.data
  232. .data[i].desc.substring(0, 2)
  233. }
  234. response.data.data[i].operatorName = response.data
  235. .data[i].desc
  236. var time1 = new Date(response.data.data[i].updateDate)
  237. .getTime()
  238. response.data.data[i].updateDate = this.$u.timeFormat(
  239. time1, 'mm.dd hh:MM')
  240. response.data.data[i].auditMind = ''
  241. }
  242. }
  243. }
  244. console.log(response.data.data)
  245. for(let i = 0 ;i<response.data.data.length;i++){
  246. if(response.data.data[i].status == "error"){
  247. this.auditCheck = "error"
  248. break;
  249. }else if(response.data.data[i].status == "question"){
  250. this.auditCheck = "question"
  251. break;
  252. }else{
  253. this.auditCheck = "success"
  254. }
  255. }
  256. this.auditList = response.data.data
  257. var time2 = new Date(this.list[0].createDate).getTime()
  258. var time3 = this.$u.timeFormat(time2, 'mm.dd hh:MM')
  259. this.auditList.unshift({
  260. operatorTitle: this.list[0].requester.substring(0, 2),
  261. operatorName: this.list[0].requester,
  262. updateDate: time3,
  263. auditMind: '',
  264. desc: '发起申请',
  265. showflow: false,
  266. commonStaffs1: null,
  267. commonStaffs: null,
  268. workflowHistoricTasks: [],
  269. status: 'success'
  270. })
  271. })
  272. })
  273. })
  274. },
  275. fanHui(){
  276. uni.navigateBack()
  277. }
  278. }
  279. }
  280. </script>
  281. <style scoped lang="scss">
  282. .transaction {
  283. background-color: #FFFFFF;
  284. margin: 10rpx;
  285. padding-bottom: 10rpx;
  286. border-radius: 20rpx;
  287. }
  288. .uForm {
  289. padding: 0 40rpx;
  290. }
  291. .u-form-item {
  292. padding: 0;
  293. }
  294. .bottom-btn {
  295. width: 100%;
  296. position: fixed;
  297. bottom: 40rpx;
  298. display: flex;
  299. z-index: 2;
  300. }
  301. .topInfo {
  302. height: 210rpx;
  303. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  304. padding: 30rpx;
  305. .topInfo-item {
  306. height: 150rpx;
  307. background-color: #FFFFFF;
  308. border-radius: 20rpx;
  309. padding: 40rpx;
  310. .logo {
  311. width: 40rpx;
  312. height: 40rpx;
  313. margin-top: 8rpx;
  314. }
  315. .infoText {
  316. font-size: 36rpx;
  317. font-weight: 600;
  318. margin-left: 20rpx;
  319. }
  320. .infoData {
  321. color: #878C9C;
  322. font-size: 26rpx;
  323. margin-top: 10rpx;
  324. }
  325. }
  326. }
  327. .submit {
  328. width: 98%;
  329. background: #22C572;
  330. border-radius: 40rpx;
  331. margin-top: 40rpx;
  332. }
  333. .u-form {
  334. margin-bottom: 20rpx;
  335. background: #fff;
  336. border-radius: 10px;
  337. padding: 30rpx 10px;
  338. .u-form-item {
  339. line-height: 30px;
  340. padding: 0px 0;
  341. font-size: 26rpx;
  342. color: #878C9C;
  343. }
  344. }
  345. .content2 {
  346. background: white;
  347. margin: 20rpx 0;
  348. border-radius: 20rpx;
  349. padding: 20rpx;
  350. .row {
  351. display: flex;
  352. .row-left {
  353. display: flex;
  354. align-items: center;
  355. .item1 {
  356. position: relative;
  357. .item-content {
  358. background: #617AE0;
  359. width: 44px;
  360. height: 44px;
  361. border-radius: 22px;
  362. line-height: 44px;
  363. text-align: center;
  364. font-size: 15px;
  365. color: #fff;
  366. }
  367. .status {
  368. position: absolute;
  369. border-radius: 50%;
  370. padding: 0px 2px;
  371. right: -3px;
  372. bottom: -3px;
  373. background: #fff;
  374. }
  375. .status.success {
  376. border: 1px solid rgb(60, 156, 255);
  377. }
  378. .status.error {
  379. border: 1px solid rgb(245, 108, 108);
  380. }
  381. .status.question {
  382. border: 1px solid #f9ae3d;
  383. }
  384. }
  385. }
  386. .row-right {
  387. width: 80%;
  388. // color: #B0B1B5;
  389. margin-top: 10px;
  390. .right-content {
  391. background: #F2F3F7;
  392. margin-left: 10px;
  393. margin-top: 10px;
  394. padding: 10px;
  395. border-radius: 5px;
  396. color: #B0B1B5;
  397. }
  398. .right-item {
  399. display: flex;
  400. justify-content: space-between;
  401. .time {
  402. color: #999;
  403. }
  404. .item2 {
  405. margin-left: 20rpx;
  406. margin-top: -7px;
  407. .name {
  408. font-size: 28rpx;
  409. font-weight: 800;
  410. margin-bottom: 4px;
  411. }
  412. .status.success {
  413. color: #6CC48C;
  414. }
  415. .status.error {
  416. color: rgb(245, 108, 108);
  417. }
  418. .status.question {
  419. color: #f9ae3d;
  420. }
  421. }
  422. }
  423. }
  424. }
  425. .row2 {
  426. display: flex;
  427. .item-content {
  428. background: #22C572;
  429. width: 30px;
  430. height: 30px;
  431. border-radius: 50%;
  432. line-height: 30px;
  433. text-align: center;
  434. font-size: 12px;
  435. color: #fff;
  436. padding: 0 2px;
  437. margin: 0 auto;
  438. }
  439. .status {
  440. position: absolute;
  441. top: 0;
  442. right: 0;
  443. }
  444. }
  445. .row-line {
  446. width: 1px;
  447. height: 30px;
  448. background: #F2F2F2;
  449. margin: 10rpx 50rpx;
  450. }
  451. .audit {
  452. margin-top: 20rpx;
  453. }
  454. }
  455. </style>