Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

invoiceList.vue 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="wrap">
  3. <view>
  4. <view class="item last">
  5. <text>状态:</text>
  6. <uni-data-select v-model="state.status" :localdata="state.statusData"
  7. @change="statusChange"></uni-data-select>
  8. </view>
  9. <view class="item last">
  10. <text>订单类型:</text>
  11. <uni-data-select v-model="state.orderType" :localdata="state.orderTypeData"
  12. @change="orderTypeChange"></uni-data-select>
  13. <button size="mini" style="color: #ffffff;
  14. backgroundColor: rgb(118, 200, 77);
  15. borderColor: rgb(118, 200, 77);
  16. font-size: 26rpx;
  17. flex-shrink: 0;margin-left: 20rpx;" @click="search">查询</button>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="listbox" v-if="state.data.length>0">
  22. <view class="card-no-active" v-for="(item,index) in state.data">
  23. <view class="head">
  24. <!-- <image :src="`${$imgUrl}order/icon-star-green.png`" mode=""></image> -->
  25. <!-- <text>新办订单</text> -->
  26. </view>
  27. <view class="content">
  28. <view class="row">
  29. 开票日期:<text>{{item.invoiceDate}}</text>
  30. </view>
  31. <view class="row">
  32. 发票抬头:<text>{{item.buyerName}}</text>
  33. </view>
  34. <view class="row">
  35. 状态:<text>{{item.status==1?'正常':"红冲"}}</text>
  36. </view>
  37. </view>
  38. <view class="btns">
  39. <button @click="down(item.fileUrl)">开票</button>
  40. </view>
  41. </view>
  42. <!-- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> -->
  43. </view>
  44. <view v-else class="listbox" style="text-align: center;font-size: 32rpx;">
  45. 暂无数据
  46. </view>
  47. </template>
  48. <script setup lang="ts">
  49. import {
  50. reactive
  51. } from "vue";
  52. import { onLoad, onReachBottom } from "@dcloudio/uni-app";
  53. import { invoiceQueryApi } from "@/utils/network/api.js";
  54. import { stringToJson } from "@/utils/network/encryption";
  55. import { request } from "@/utils/network/request.js";
  56. import { msg } from "@/utils/utils";
  57. const state = reactive({
  58. userMobile: "",
  59. pageNumber: 1,
  60. pageSize: 10,
  61. status: 1,
  62. statusData: [{
  63. 'value': 1,
  64. 'text': '正常'
  65. }, {
  66. 'value': -1,
  67. 'text': '红冲'
  68. }],
  69. orderType: 1,
  70. orderTypeData: [{
  71. 'value': 1,
  72. 'text': 'ETC服务'
  73. }, {
  74. 'value': 2,
  75. 'text': '通行服务费'
  76. }],
  77. data: [],
  78. flags: false,
  79. })
  80. onLoad((options) => {
  81. state.userMobile = options.userMobile
  82. query(1)
  83. })
  84. const search = () => {
  85. query(1)
  86. }
  87. const query = (val) => {
  88. if (val == 1) {
  89. state.pageNumber = 1
  90. }
  91. if (state.pageNumber == 1 && state.data.length > 0) {
  92. state.data = []
  93. }
  94. const options = {
  95. type: 2,
  96. data: {
  97. userMobile: state.userMobile,
  98. pageNumber: state.pageNumber,
  99. pageSize: state.pageSize,
  100. status: state.status,
  101. orderType: state.orderType,
  102. },
  103. method: "POST",
  104. showLoading: true,
  105. };
  106. request(invoiceQueryApi, options).then((res) => {
  107. const data = stringToJson(res.bizContent);
  108. state.data = data.invoices
  109. console.log(data, "通行");
  110. });
  111. }
  112. const statusChange = (e) => {
  113. state.status = e
  114. }
  115. const orderTypeChange = (e) => {
  116. state.orderType = e
  117. }
  118. // 触底加载
  119. onReachBottom(() => {
  120. if (state.data.length < state.pageNumber * 10) return state.flags = true
  121. console.log("触底了")
  122. state.pageNumber++
  123. query(2)
  124. })
  125. const down = (fileUrl) => {
  126. uni.downloadFile({
  127. url: fileUrl, //仅为示例,并非真实的资源
  128. success: (res) => {
  129. if (res.statusCode === 200) {
  130. console.log('下载成功');
  131. msg("下载成功")
  132. }
  133. }
  134. });
  135. }
  136. </script>
  137. <style>
  138. page {
  139. width: 100%;
  140. height: 100%;
  141. }
  142. </style>
  143. <style lang="scss" scoped>
  144. .listbox {
  145. height: 100%;
  146. background-color: #EEF7F7;
  147. padding: 30rpx;
  148. border-top: 1rpx solid #DFDFDF;
  149. margin-top: 200rpx;
  150. .card-no-active {
  151. margin-bottom: 30rpx;
  152. height: 438rpx;
  153. background: #FFFFFF;
  154. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  155. border-radius: 20rpx;
  156. display: flex;
  157. flex-direction: column;
  158. .head {
  159. display: flex;
  160. padding: 30rpx;
  161. align-items: center;
  162. border-bottom: 1px solid #DCDCDC;
  163. image {
  164. width: 48rpx;
  165. height: 48rpx;
  166. }
  167. text {
  168. font-size: 30rpx;
  169. font-family: Noto Sans S Chinese;
  170. font-weight: 400;
  171. color: #333333;
  172. }
  173. }
  174. .content {
  175. margin: 30rpx;
  176. margin-bottom: 0;
  177. border-bottom: 1rpx solid #DCDCDC;
  178. .row {
  179. font-size: 26rpx;
  180. font-family: Noto Sans S Chinese;
  181. font-weight: 400;
  182. color: #999999;
  183. margin-bottom: 20rpx;
  184. text {
  185. font-size: 26rpx;
  186. font-family: Noto Sans S Chinese;
  187. font-weight: 400;
  188. color: #333333;
  189. }
  190. }
  191. }
  192. .btns {
  193. flex: 1;
  194. display: flex;
  195. align-items: center;
  196. justify-content: flex-end;
  197. padding: 0 30rpx;
  198. button {
  199. margin: 0;
  200. display: inline-block;
  201. height: 61rpx;
  202. background: #FFFFFF;
  203. border: 1px solid #00B38B;
  204. border-radius: 30rpx;
  205. font-size: 26rpx;
  206. font-family: Noto Sans S Chinese;
  207. font-weight: 400;
  208. color: #00B38B;
  209. line-height: 61rpx;
  210. }
  211. }
  212. }
  213. .card-active {
  214. height: 375rpx;
  215. background: #FFFFFF;
  216. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  217. border-radius: 20rpx;
  218. display: flex;
  219. flex-direction: column;
  220. .head {
  221. display: flex;
  222. padding: 30rpx;
  223. align-items: center;
  224. border-bottom: 1px solid #DCDCDC;
  225. image {
  226. width: 48rpx;
  227. height: 48rpx;
  228. }
  229. text {
  230. font-size: 30rpx;
  231. font-family: Noto Sans S Chinese;
  232. font-weight: 400;
  233. color: #333333;
  234. }
  235. .status {
  236. position: absolute;
  237. right: 35px;
  238. font-size: 26rpx;
  239. font-family: Noto Sans S Chinese;
  240. font-weight: 400;
  241. color: #777777;
  242. }
  243. }
  244. .content {
  245. margin: 30rpx;
  246. .row {
  247. font-size: 26rpx;
  248. font-family: Noto Sans S Chinese;
  249. font-weight: 400;
  250. color: #999999;
  251. margin-bottom: 20rpx;
  252. text {
  253. font-size: 26rpx;
  254. font-family: Noto Sans S Chinese;
  255. font-weight: 400;
  256. color: #333333;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. .item {
  263. display: flex;
  264. font-size: 30rpx;
  265. margin-top: 10rpx;
  266. align-items: center;
  267. }
  268. .wrap {
  269. padding: 10rpx 20rpx;
  270. box-sizing: border-box;
  271. // display: flex;
  272. // justify-content: space-evenly;
  273. position: fixed;
  274. left: 0;
  275. top: 0;
  276. background-color: white;
  277. width: 100%;
  278. }
  279. .bottom-line {
  280. text-align: center;
  281. margin: 30rpx 0;
  282. }
  283. </style>