freight_setting_details.vue 15 KB

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