Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

etcFlowingWater.vue 12KB

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