Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

etcFlowingWater.vue 12KB

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