freight_setting_details.vue 12 KB

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