freight_setting_details.vue 15 KB

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