You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

etcFlowingWater.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <view class="wrapper">
  3. <!-- 背景颜色充满屏 -->
  4. <view class="bg-color"></view>
  5. <!-- 补卡额订单列表-->
  6. <view class="search-time">
  7. <view class="search-time-box">
  8. <view class="show-info">
  9. <view class="show-text">
  10. <picker class="picker date" mode="date" :value="dataTime.startDate" @change="bindDateStart">
  11. <text class="date-text text-val">{{dataTime.startDate?dataTime.startDate:'开始时间'}}</text>
  12. </picker>
  13. <text class="line"></text>
  14. <picker class="picker date" mode="date" :value="dataTime.endDate" @change="bindDateEnd">
  15. <text class="date-text text-val">{{dataTime.endDate?dataTime.endDate:'结束时间'}}</text>
  16. </picker>
  17. </view>
  18. <u-icon name="calendar" :custom-style="{color:'#999999', size: '28rpx'}"></u-icon>
  19. </view>
  20. </view>
  21. <view class="time-btn" @click="search">查询</view>
  22. </view>
  23. <view class="total-num" v-if="state.list.length > 0"><text>金额合计:{{state.aggregatAmout/100}}</text> <text class="total-space">通行次数:{{state.passTotal}}</text></view>
  24. <view class="list-wrap" v-if="state.list.length >0">
  25. <view v-for="item in state.list" :key="item.listNo"
  26. :class="item.status === 3 ? ' card-info finished' : 'card-info'">
  27. <view class="info-wrap">
  28. <view class="info-left">
  29. <view class="info-left-text">
  30. <text class="label">单号:</text>
  31. <text class="val">{{item.listNo}}</text>
  32. </view>
  33. <view>
  34. <text class="label">卡号:</text>
  35. <text class="val">{{item.cardId}}</text>
  36. </view>
  37. </view>
  38. <view class="info-right">
  39. <view class="price-label">
  40. 交易金额
  41. </view>
  42. <view class="price-val">
  43. <text>¥</text>
  44. <text class="price-val-text">{{item.fee/100}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="card-text-wrap">
  49. <view class="text-box">
  50. <text class="name-text">{{item.enName}}</text>
  51. <text
  52. class="time-text">{{item.enTime.substring(item.enTime.length -8 ,item.enTime.length-3)}}</text>
  53. <text class="date-text">{{item.enTime.substring(0,10)}}</text>
  54. </view>
  55. <view class="arrow-wrap">
  56. <text class="arrow-text">{{item.vehiclePlate}}</text>
  57. <image class="d-img" :src="`${$imgUrl}order/arrowCard.png`"></image>
  58. </view>
  59. <view class="text-box">
  60. <text class="name-text">{{item.exName}}</text>
  61. <text
  62. class="time-text">{{item.exTime.substring(item.exTime.length -8 ,item.exTime.length-3)}}</text>
  63. <text class="date-text">{{item.exTime.substring(0,10)}}</text>
  64. </view>
  65. </view>
  66. <view class="btn-wrap">
  67. <view>
  68. <text v-if="item.status === 2" class="status-wrap">审核进度:<text
  69. class="status-text">审核中</text></text>
  70. <text v-if="item.status === 3" class="status-wrap">审核进度:<text>已完成</text></text>
  71. </view>
  72. <view class="btn-1 btn" v-if="item.status === 1" @click="toApply(item)">补卡额申请</view>
  73. <view class="btn-1 btn" v-if="item.status === 2" @click="toView(item)">查看进度</view>
  74. <view class="btn-1 btn" v-if="item.status === 3" @click="toEvaluate(item)">去评价</view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="blank" v-else>
  79. <view class="text-center">暂无数据</view>
  80. </view>
  81. </view>
  82. </template>
  83. <script setup>
  84. import {
  85. reactive,
  86. ref
  87. } from "vue";
  88. import {
  89. request
  90. } from "../../utils/network/request.js";
  91. import {
  92. stringToJson
  93. } from "../../utils/network/encryption.js";
  94. import {
  95. orderDetail,
  96. passBills,
  97. passBillCount,
  98. downloadBills,
  99. } from "../../utils/network/api.js";
  100. import {
  101. onLoad
  102. } from '@dcloudio/uni-app'
  103. const dataTime = reactive({
  104. startDate: "开始时间",
  105. endDate: "结束时间"
  106. })
  107. const state = reactive({
  108. list: [],
  109. cardId: null,
  110. passTotal:0,
  111. parkTotal:0,
  112. aggregatAmout:0,
  113. })
  114. onLoad((option) => {
  115. state.cardId =option.cardId;
  116. // queryOrderDetail(option.cardId);
  117. })
  118. const search = () => {
  119. gePpassBillCount()
  120. const options = {
  121. type: 2,
  122. data: {
  123. cardId: state.cardId,//52011640230202987050
  124. beforeDate: dataTime.startDate,
  125. afterDate: dataTime.endDate,
  126. },
  127. method: "POST",
  128. showLoading: true,
  129. };
  130. request(passBills, options).then((res) => {
  131. console.log(res);
  132. let result = stringToJson(res.bizContent)
  133. console.log(result);
  134. state.list = result.data ?? []
  135. console.log(result.data);
  136. // let orderInfo = JSON.parse(res.bizContent);
  137. })
  138. }
  139. const gePpassBillCount = ()=>{
  140. const options = {
  141. type: 2,
  142. data: {
  143. // cardId: state.cardId,//52011640230202987050
  144. cardId: "52011328220201990321",//52011640230202987050
  145. starDate: dataTime.startDate,
  146. endDate: dataTime.endDate,
  147. },
  148. method: "POST",
  149. showLoading: true,
  150. };
  151. request(passBillCount, options).then((res) => {
  152. let result = stringToJson(res.bizContent)
  153. state.aggregatAmout = result.aggregatAmout??0
  154. state.passTotal = result.passTotal??0
  155. state.parkTotal = result.parkTotal??0
  156. console.log(result);
  157. })
  158. }
  159. const queryOrderDetail = (id) => {
  160. const options = {
  161. type: 2,
  162. data: {
  163. id: id,
  164. },
  165. method: "POST",
  166. showLoading: true,
  167. };
  168. request(orderDetail, options).then((res) => {
  169. // console.log(res);
  170. let result = stringToJson(res.bizContent)
  171. state.vehiclePlate = result.vehiclePlate ?? null
  172. state.cardId = result.cardId ?? null
  173. console.log(state);
  174. search()
  175. // let orderInfo = JSON.parse(res.bizContent);
  176. })
  177. }
  178. // 展示日历
  179. const bindDateStart = (e) => {
  180. console.log(e);
  181. // show.value = true
  182. dataTime.startDate = e.detail.value
  183. }
  184. // 展示日历
  185. const bindDateEnd = (e) => {
  186. console.log(e);
  187. dataTime.endDate = e.detail.value
  188. // show.value = true
  189. }
  190. // 补卡申请
  191. const toApply = (item) => {
  192. uni.navigateTo({
  193. // url: `/orders/cardAmount?id=${item.id}`
  194. url: ""
  195. });
  196. }
  197. // 去评价
  198. const toEvaluate = (item) => {
  199. uni.navigateTo({
  200. // url: `/orders/order-evaluate?id=${item.id}`
  201. url: ""
  202. });
  203. }
  204. // 查看进度
  205. const toView = (item) => {
  206. uni.navigateTo({
  207. // url: `/orders/cardAmountDetail?id=${item.id}`
  208. url: ""
  209. });
  210. }
  211. //下载按钮事件
  212. const doDownload= ()=>{
  213. const options = {
  214. type: 2,
  215. data: {
  216. cardId: state.cardId,//52011640230202987050
  217. starDate: dataTime.startDate,
  218. endDate: dataTime.endDate,
  219. },
  220. method: "POST",
  221. showLoading: true,
  222. };
  223. request(downloadBills, options).then((res) => {
  224. let result = stringToJson(res.bizContent)
  225. // state.aggregatAmout = result.DetailDownLoadURL??0
  226. download(result.DetailDownLoadURL)
  227. })
  228. }
  229. //下载文件
  230. const download = (attachLink) => {
  231. let that = this
  232. uni.downloadFile({
  233. url: attachLink , //下载地址,后端接口获取的链接
  234. success: (data) => {
  235. console.log(data.tempFilePath)
  236. console.log(JSON.stringify(data))
  237. if (data.statusCode === 200) {
  238. uni.saveFile({ //文件保存到本地
  239. tempFilePath: data.tempFilePath, //临时路径
  240. success: function(res) {
  241. console.log("下载成功"+res.savedFilePath)
  242. console.log(JSON.stringify(res))
  243. uni.showToast({
  244. icon: 'none',
  245. mask: true,
  246. title: '文件已保存!',
  247. duration: 3000,
  248. });
  249. uni.openDocument({
  250. //fileType: 'docx',
  251. showMenu:true, //关键点,可以转发到微信
  252. filePath: res.savedFilePath,
  253. success: function(res) {
  254. console.log('打开文档成功');
  255. }
  256. });
  257. }
  258. });
  259. }
  260. },
  261. fail: (err) => {
  262. console.log(err);
  263. uni.showToast({
  264. icon: 'none',
  265. mask: true,
  266. title: '失败请重新下载',
  267. });
  268. },
  269. });
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. .u-btn--primary {
  274. background: #00B38B;
  275. }
  276. .blank{
  277. font-size: 30rpx;
  278. text-align: center;
  279. }
  280. .bg-color {
  281. position: fixed;
  282. top: 0;
  283. left: 0;
  284. right: 0;
  285. bottom: 0;
  286. background: #EEF7F7;
  287. z-index: -1;
  288. }
  289. .search-box {
  290. margin: 30rpx 30rpx 20rpx 30rpx;
  291. height: 72rpx;
  292. height: 81rpx;
  293. background: #FFFFFF;
  294. border: 1px solid #DCDCDC;
  295. border-radius: 40rpx;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. box-sizing: border-box;
  300. }
  301. .search-time-box {
  302. flex: 1;
  303. }
  304. .search-box .icon {
  305. width: 48rpx;
  306. height: 48rpx;
  307. margin: 0 20rpx;
  308. }
  309. .search-box .search {
  310. flex: 1;
  311. margin-right: 20rpx;
  312. height: 100%;
  313. padding: 0 10rpx;
  314. font-size: 28rpx;
  315. color: #00b38b;
  316. }
  317. .scroll-view {
  318. white-space: nowrap;
  319. position: sticky;
  320. top: 0;
  321. background: #ffffff;
  322. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  323. }
  324. .search-time {
  325. display: flex;
  326. margin: 20rpx 30rpx 48rpx 30rpx;
  327. .time-btn {
  328. width: 130rpx;
  329. height: 80rpx;
  330. background: #00B38B;
  331. border-radius: 40rpx;
  332. color: #FFFFFF;
  333. font-size: 32rpx;
  334. line-height: 80rpx;
  335. text-align: center;
  336. margin-left: 19rpx;
  337. }
  338. .show-info {
  339. height: 80rpx;
  340. padding: 0 31rpx;
  341. background: #FFFFFF;
  342. border: 1px solid #DCDCDC;
  343. border-radius: 40rpx;
  344. display: flex;
  345. justify-content: space-between;
  346. align-items: center;
  347. .show-text {
  348. display: flex;
  349. align-items: center;
  350. }
  351. .date-text {
  352. color: #999999;
  353. font-size: 28rpx;
  354. }
  355. .text-val {
  356. color: #333
  357. }
  358. .line {
  359. width: 25rpx;
  360. height: 1rpx;
  361. background: #999999;
  362. margin: 0 24rpx;
  363. }
  364. }
  365. }
  366. .total-num {
  367. font-size: 28rpx;
  368. color: #999999;
  369. margin-left: 30rpx;
  370. .total-space {
  371. margin-left: 41rpx;
  372. }
  373. }
  374. .list-wrap {
  375. margin: 30rpx;
  376. padding-bottom: 20rpx;
  377. }
  378. .card-info {
  379. background: #FFFFFF;
  380. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  381. border-radius: 20rpx;
  382. margin-bottom: 30rpx;
  383. padding: 30rpx 20rpx 10rpx 20rpx;
  384. .info-wrap {
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: center;
  388. border-bottom: 1px solid #dcdcdc;
  389. padding-bottom: 30rpx;
  390. .info-left-text {
  391. margin-bottom: 15rpx;
  392. }
  393. .label {
  394. color: #999999;
  395. font-size: 26rpx;
  396. font-weight: 400;
  397. }
  398. .val {
  399. color: #333333;
  400. font-size: 26rpx;
  401. font-weight: 400;
  402. }
  403. .price-label {
  404. color: #999999;
  405. font-size: 24rpx;
  406. font-weight: 400;
  407. margin-bottom: 22rpx;
  408. text-align: center;
  409. }
  410. .price-val-text {
  411. font-size: 32rpx;
  412. font-weight: 700;
  413. color: #333333;
  414. margin-left: 9rpx;
  415. }
  416. .price-val {
  417. font-size: 26rpx;
  418. color: #333333;
  419. }
  420. }
  421. .card-text-wrap {
  422. display: flex;
  423. justify-content: space-between;
  424. align-items: center;
  425. margin: 38rpx 0 46rpx 0;
  426. .text-box {
  427. display: flex;
  428. flex-direction: column;
  429. align-items: center;
  430. .name-text {
  431. font-size: 30rpx;
  432. font-weight: 400;
  433. color: #333333;
  434. }
  435. .time-text {
  436. font-size: 30rpx;
  437. color: #333333;
  438. font-weight: 400;
  439. margin-top: 8rpx;
  440. }
  441. .date-text {
  442. font-size: 24rpx;
  443. color: #999999;
  444. font-weight: 400;
  445. margin-top: 8rpx;
  446. }
  447. }
  448. .arrow-wrap {
  449. display: flex;
  450. flex-direction: column;
  451. align-items: center;
  452. .d-img {
  453. width: 186rpx;
  454. height: 12rpx;
  455. }
  456. .arrow-text {
  457. color: #666666;
  458. font-size: 26rpx;
  459. }
  460. }
  461. }
  462. .btn-wrap {
  463. margin-top: 30rpx;
  464. display: flex;
  465. justify-content: space-between;
  466. align-items: center;
  467. .status-wrap {
  468. color: #999999;
  469. font-size: 26rpx;
  470. margin-right: 23rpx;
  471. }
  472. .status-text {
  473. color: #00B38B;
  474. }
  475. .btn {
  476. background: #FFFFFF;
  477. border: 1px solid #00B38B;
  478. border-radius: 30rpx;
  479. line-height: 61rpx;
  480. text-align: center;
  481. color: #00B38B;
  482. font-size: 26rpx;
  483. }
  484. .btn-1 {
  485. width: 171rpx;
  486. height: 61rpx;
  487. }
  488. .btn-2 {
  489. width: 141rpx;
  490. height: 61rpx;
  491. }
  492. .btn-3 {
  493. width: 121rpx;
  494. height: 61rpx;
  495. }
  496. }
  497. }
  498. .finished .info-wrap,
  499. .finished .card-text-wrap {
  500. .price-val,
  501. .price-val-text,
  502. .val,
  503. .text-box .time-text,
  504. .text-box .name-text,
  505. .arrow-wrap .arrow-text {
  506. color: #999999;
  507. }
  508. }
  509. </style>