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">
  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>新办订单</text>
  30. </view> -->
  31. <view class="row">
  32. 开票日期:<text>{{item.invoiceDate}}</text>
  33. </view>
  34. <view class="row">
  35. 发票抬头:<text>{{item.buyerName}}</text>
  36. </view>
  37. <view class="row">
  38. 状态:<text>{{item.status==1?'正常':"红冲"}}</text>
  39. </view>
  40. </view>
  41. <view class="btns">
  42. <button @click="down(item.fileUrl)">开票</button>
  43. </view>
  44. </view>
  45. <!-- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> -->
  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. })
  83. const search = () => {
  84. query(1)
  85. }
  86. const query = (val) => {
  87. if (val == 1) {
  88. state.pageNumber = 1
  89. }
  90. if (state.pageNumber == 1 && state.data.length > 0) {
  91. state.data = []
  92. }
  93. const options = {
  94. type: 2,
  95. data: {
  96. userMobile: state.userMobile,
  97. pageNumber: state.pageNumber,
  98. pageSize: state.pageSize,
  99. status: state.status,
  100. orderType: state.orderType,
  101. },
  102. method: "POST",
  103. showLoading: true,
  104. };
  105. request(invoiceQueryApi, options).then((res) => {
  106. const data = stringToJson(res.bizContent);
  107. state.data = data.invoices
  108. console.log(data, "通行");
  109. });
  110. }
  111. const statusChange = (e) => {
  112. state.status = e
  113. }
  114. const orderTypeChange = (e) => {
  115. state.orderType = e
  116. }
  117. // 触底加载
  118. onReachBottom(() => {
  119. if (state.data.length < state.pageNumber * 10) return state.flags = true
  120. console.log("触底了")
  121. state.pageNumber++
  122. query(2)
  123. })
  124. const down = (fileUrl) => {
  125. uni.downloadFile({
  126. url: fileUrl, //仅为示例,并非真实的资源
  127. success: (res) => {
  128. if (res.statusCode === 200) {
  129. console.log('下载成功');
  130. msg("下载成功")
  131. }
  132. }
  133. });
  134. }
  135. </script>
  136. <style>
  137. page {
  138. width: 100%;
  139. height: 100%;
  140. }
  141. </style>
  142. <style lang="scss" scoped>
  143. .listbox {
  144. height: 100%;
  145. background-color: #EEF7F7;
  146. padding: 30rpx;
  147. border-top: 1rpx solid #DFDFDF;
  148. margin-top: 200rpx;
  149. .card-no-active {
  150. margin-bottom: 30rpx;
  151. height: 438rpx;
  152. background: #FFFFFF;
  153. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  154. border-radius: 20rpx;
  155. display: flex;
  156. flex-direction: column;
  157. .head {
  158. display: flex;
  159. padding: 30rpx;
  160. align-items: center;
  161. border-bottom: 1px solid #DCDCDC;
  162. image {
  163. width: 48rpx;
  164. height: 48rpx;
  165. }
  166. text {
  167. font-size: 30rpx;
  168. font-family: Noto Sans S Chinese;
  169. font-weight: 400;
  170. color: #333333;
  171. }
  172. }
  173. .content {
  174. margin: 30rpx;
  175. margin-bottom: 0;
  176. border-bottom: 1rpx solid #DCDCDC;
  177. .row {
  178. font-size: 26rpx;
  179. font-family: Noto Sans S Chinese;
  180. font-weight: 400;
  181. color: #999999;
  182. margin-bottom: 20rpx;
  183. text {
  184. font-size: 26rpx;
  185. font-family: Noto Sans S Chinese;
  186. font-weight: 400;
  187. color: #333333;
  188. }
  189. }
  190. }
  191. .btns {
  192. flex: 1;
  193. display: flex;
  194. align-items: center;
  195. justify-content: flex-end;
  196. padding: 0 30rpx;
  197. button {
  198. margin: 0;
  199. display: inline-block;
  200. height: 61rpx;
  201. background: #FFFFFF;
  202. border: 1px solid #00B38B;
  203. border-radius: 30rpx;
  204. font-size: 26rpx;
  205. font-family: Noto Sans S Chinese;
  206. font-weight: 400;
  207. color: #00B38B;
  208. line-height: 61rpx;
  209. }
  210. }
  211. }
  212. .card-active {
  213. height: 375rpx;
  214. background: #FFFFFF;
  215. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  216. border-radius: 20rpx;
  217. display: flex;
  218. flex-direction: column;
  219. .head {
  220. display: flex;
  221. padding: 30rpx;
  222. align-items: center;
  223. border-bottom: 1px solid #DCDCDC;
  224. image {
  225. width: 48rpx;
  226. height: 48rpx;
  227. }
  228. text {
  229. font-size: 30rpx;
  230. font-family: Noto Sans S Chinese;
  231. font-weight: 400;
  232. color: #333333;
  233. }
  234. .status {
  235. position: absolute;
  236. right: 35px;
  237. font-size: 26rpx;
  238. font-family: Noto Sans S Chinese;
  239. font-weight: 400;
  240. color: #777777;
  241. }
  242. }
  243. .content {
  244. margin: 30rpx;
  245. .row {
  246. font-size: 26rpx;
  247. font-family: Noto Sans S Chinese;
  248. font-weight: 400;
  249. color: #999999;
  250. margin-bottom: 20rpx;
  251. text {
  252. font-size: 26rpx;
  253. font-family: Noto Sans S Chinese;
  254. font-weight: 400;
  255. color: #333333;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. .item {
  262. display: flex;
  263. font-size: 30rpx;
  264. margin-top: 10rpx;
  265. align-items: center;
  266. }
  267. .wrap {
  268. padding: 10rpx 20rpx;
  269. box-sizing: border-box;
  270. // display: flex;
  271. // justify-content: space-evenly;
  272. position: fixed;
  273. left: 0;
  274. top: 0;
  275. background-color: white;
  276. width: 100%;
  277. }
  278. .bottom-line {
  279. text-align: center;
  280. margin: 30rpx 0;
  281. }
  282. </style>