選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

invoice-content.vue 9.7KB

1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
8ヶ月前
8ヶ月前
7ヶ月前
1年前
1年前
1年前
1年前
1年前
1年前
7ヶ月前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
8ヶ月前
1年前
1年前
1年前
1年前
1年前
8ヶ月前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view class="contentAll">
  3. <view class="titleOne">
  4. <text @click="invoiceRecord">开票记录</text>
  5. <text class="line">|</text>
  6. <text @click="$util.navTo(`/subpackage/orders/invoiceApply/invoice-header-list?manage=1`,true)">管理抬头</text>
  7. </view>
  8. <view class="twoOne" v-if="state.type==1">
  9. <view class="item last">
  10. <text>开票状态:</text>
  11. <uni-data-select v-model="state.businessTypeValOne" :localdata="state.businessRangeOne"
  12. @change="changeBusinessOne"></uni-data-select>
  13. </view>
  14. <button size="mini" style="color: #ffffff;
  15. backgroundColor: rgb(118, 200, 77);
  16. borderColor: rgb(118, 200, 77);
  17. font-size: 26rpx;
  18. flex-shrink: 0;margin-left: 20rpx;" @click="searchOne()">查询</button>
  19. </view>
  20. <view class="two" v-if="state.type==2">
  21. <view class="input">
  22. ETC卡号:<input placeholder="请输入ETC卡号" v-model="state.etcCardNo" />
  23. </view>
  24. <view class="three">
  25. <view class="item last">
  26. <text>开票状态:</text>
  27. <uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange"
  28. @change="changeBusiness"></uni-data-select>
  29. </view>
  30. <button size="mini" style="color: #ffffff;
  31. backgroundColor: rgb(118, 200, 77);
  32. borderColor: rgb(118, 200, 77);
  33. font-size: 26rpx;
  34. flex-shrink: 0;margin-left: 20rpx;" @click="searchTwo">查询</button>
  35. </view>
  36. </view>
  37. <view>
  38. <view class="cardbox">
  39. <view class="card" v-for="(item,i) in state.data" :key="i">
  40. <view>
  41. <checkbox-group @change="checkboxChange(item)">
  42. <checkbox :value="item.orderNo" :checked="state.checked" style="transform:scale(0.7)" />
  43. </checkbox-group>
  44. </view>
  45. <view class="content">
  46. <view class="title">订单号:{{item.orderNo}}</view>
  47. <view class="title">订单时间:{{item.orderTime}}</view>
  48. <view class="title" v-if="item.productType">订单类型:{{item.productType}}</view>
  49. <view class="title">车牌号:{{item.vehiclePlate}}</view>
  50. <view class="title">订单金额:¥{{item.invoiceAmount}}</view>
  51. <view class="title">开票状态:{{item.status==1?'已开票':"可开票"}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
  58. <view class="apply-wrap">
  59. <view>
  60. <checkbox-group @change="checkboxAll">
  61. <checkbox value="ALL" style="transform:scale(0.7)" :checked="state.checkedAll" />全选
  62. </checkbox-group>
  63. </view>
  64. <view class="apply" @click="apply">去申请</view>
  65. </view>
  66. </template>
  67. <script lang="ts" setup>
  68. import {
  69. navTo, msg
  70. } from "@/utils/utils";
  71. import { reactive, ref } from "vue";
  72. import { onLoad, onReachBottom} from "@dcloudio/uni-app";
  73. import { billQueryProductOrder, getUserMsg, passageFlowingWaterOrderPageQuery } from "@/utils/network/api.js";
  74. import {requestNew } from "@/utils/network/request.js";
  75. import {
  76. getItem
  77. } from "@/utils/storage";
  78. const state = reactive({
  79. type: 1, //1 ETC产品订单 2通行流水服务费订单
  80. userMobile: "",
  81. data: [],
  82. businessTypeValOne: 9,
  83. businessRangeOne: [{
  84. 'value': 9,
  85. 'text': '可开票'
  86. }, {
  87. 'value': 1,
  88. 'text': '已开票'
  89. }],
  90. businessTypeVal: 9,
  91. businessRange: [{
  92. 'value': 9,
  93. 'text': '可开票'
  94. }, {
  95. 'value': 1,
  96. 'text': '已开票'
  97. }, {
  98. 'value': 2,
  99. 'text': '已开纸质票'
  100. }],
  101. etcCardNo: "",
  102. pageSize: 10, //每页数据量
  103. pageNo: 1, // 当前页
  104. ordersArr: [],
  105. checked: false,
  106. checkedAll: false,
  107. flags: false,
  108. customerIdNum: ""
  109. })
  110. onLoad((option) => {
  111. state.type = option.type
  112. getUserinfo()
  113. })
  114. const value = ref('')
  115. const getUserinfo = () => {
  116. const options = {
  117. type: 2,
  118. data: {
  119. openId: getItem('openId'),
  120. },
  121. method: "POST",
  122. showLoading: true,
  123. };
  124. requestNew(getUserMsg, options).then((res) => {
  125. const data = res;
  126. console.log(data, "用户信息");
  127. state.userMobile = data.customerTel
  128. state.customerIdNum = data.customerIdNum
  129. if (state.type == 1) {
  130. etcOrder(1)
  131. }
  132. });
  133. }
  134. const etcOrder = (val) => {
  135. if (val == 1) {
  136. state.pageNo = 1
  137. }
  138. if (state.pageNo == 1 && state.data.length > 0) {
  139. state.data = []
  140. }
  141. const options = {
  142. type: 2,
  143. data: {
  144. userMobile: state.userMobile,
  145. page: state.pageNo,
  146. pageSize: state.pageSize,
  147. status: state.businessTypeValOne
  148. },
  149. method: "POST",
  150. showLoading: true,
  151. };
  152. requestNew(billQueryProductOrder, options).then((res) => {
  153. const data = res;
  154. state.data = data.orders
  155. console.log(data, "查询ETC产品订单");
  156. });
  157. }
  158. const trafficFlow = (val) => {
  159. if (val == 1) {
  160. state.pageNo = 1
  161. }
  162. if (state.pageNo == 1 && state.data.length > 0) {
  163. state.data = []
  164. }
  165. const options = {
  166. type: 2,
  167. data: {
  168. etcCardNo: state.etcCardNo,
  169. userMobile: state.userMobile,
  170. pageNumber: state.pageNo,
  171. page: state.pageSize,
  172. status: state.businessTypeVal
  173. },
  174. method: "POST",
  175. showLoading: true,
  176. };
  177. requestNew(passageFlowingWaterOrderPageQuery, options).then((res) => {
  178. const data = res;
  179. state.data = data.orders
  180. console.log(data, "通行");
  181. });
  182. }
  183. const changeBusiness = (e) => {
  184. state.businessTypeVal = e
  185. console.log(e)
  186. }
  187. const changeBusinessOne = (e) => {
  188. state.businessTypeValOne = e
  189. console.log(e)
  190. }
  191. const apply = () => {
  192. const params = encodeURIComponent(JSON.stringify(state.ordersArr))
  193. if (state.ordersArr.length >= 1) {
  194. navTo(`/subpackage/orders/invoiceApply/invoice-step1?type=${state.type}&&ordersArr=${params}&&userMobile=${state.userMobile}&&customerIdNum=${state.customerIdNum}`)
  195. } else {
  196. msg("请选择订单开票")
  197. }
  198. }
  199. const searchOne = () => {
  200. state.pageNo = 1
  201. etcOrder(2)
  202. }
  203. const searchTwo = () => {
  204. state.pageNo = 1
  205. trafficFlow(1)
  206. }
  207. const invoiceRecord = () => {
  208. navTo(`/subpackage/orders/invoiceApply/invoiceList?userMobile=${state.userMobile}`)
  209. }
  210. const checkboxChange = (item) => {
  211. var items = state.data,
  212. values = item.orderNo;
  213. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  214. console.log("values", values, items[i].orderNo)
  215. if (values.includes(items[i].orderNo)) {
  216. items[i]['checked'] = !items[i]['checked']
  217. }
  218. }
  219. state.ordersArr = []
  220. for (var k = 0; k < state.data.length; k++) {
  221. if (state.data[k]['checked']) {
  222. if (state.data[k]['checked'] == true) {
  223. state.ordersArr.push(state.data[k])
  224. }
  225. }
  226. }
  227. if (state.ordersArr.length == state.data.length) {
  228. console.log("进来了")
  229. state.checkedAll = true
  230. } else {
  231. state.checkedAll = false
  232. }
  233. console.log("e", state.ordersArr)
  234. }
  235. const checkboxAll = (e) => {
  236. if (e.detail.value.toString() == 'ALL') {
  237. for (var i = 0; i < state.data.length; i++) {
  238. state.ordersArr.push(state.data[i])
  239. state.checkedAll = true
  240. state.checked = true
  241. }
  242. } else {
  243. state.ordersArr = []
  244. state.checked = false
  245. }
  246. console.log("全部", e.detail.value)
  247. }
  248. // 触底加载
  249. onReachBottom(() => {
  250. if (state.data.length < state.pageNo * 10) return state.flags = true
  251. console.log("触底了")
  252. state.pageNo++
  253. if (state.type == 1) {
  254. etcOrder(2)
  255. } else {
  256. trafficFlow(2)
  257. }
  258. })
  259. </script>
  260. <style scoped lang="scss">
  261. .contentAll {
  262. font-size: 32rpx;
  263. background: #eef7f7;
  264. width: 100%;
  265. min-height: 100vh;
  266. }
  267. .titleOne {
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-evenly;
  271. background-color: white;
  272. padding: 20rpx;
  273. }
  274. .line {
  275. color: #ccc;
  276. }
  277. .cardbox {
  278. width: 95%;
  279. margin: 0 auto;
  280. margin-top: 20rpx;
  281. .card {
  282. background: #FFFFFF;
  283. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  284. border-radius: 20rpx;
  285. display: flex;
  286. align-items: center;
  287. padding: 30rpx;
  288. margin-bottom: 30rpx;
  289. .content {
  290. margin-left: 30rpx;
  291. .title {
  292. font-size: 30rpx;
  293. font-family: Noto Sans S Chinese;
  294. font-weight: 400;
  295. color: #333333;
  296. margin-bottom: 15rpx;
  297. }
  298. text {
  299. font-size: 26rpx;
  300. font-family: Noto Sans S Chinese;
  301. font-weight: 400;
  302. color: #666666;
  303. }
  304. }
  305. .icon-active {
  306. width: 43rpx;
  307. height: 43rpx;
  308. background: #00B38B;
  309. border-radius: 50%;
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. }
  314. .icon-no-active {
  315. width: 44rpx;
  316. height: 44rpx;
  317. background: #FFFFFF;
  318. border: 1px solid #00B38B;
  319. border-radius: 50%;
  320. }
  321. .edit {
  322. display: flex;
  323. justify-content: center;
  324. align-items: center;
  325. flex-direction: column;
  326. image {
  327. width: 40rpx;
  328. height: 40rpx;
  329. }
  330. view {
  331. font-size: 26rpx;
  332. font-family: Noto Sans S Chinese;
  333. font-weight: 400;
  334. color: #999999;
  335. }
  336. }
  337. }
  338. }
  339. .apply {
  340. width: 150rpx;
  341. height: 70rpx;
  342. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  343. border-radius: 40rpx;
  344. font-size: 32rpx;
  345. color: #FFFFFF;
  346. line-height: 70rpx;
  347. text-align: center;
  348. }
  349. .apply-wrap {
  350. width: 100%;
  351. position: fixed;
  352. bottom: 0;
  353. left: 0;
  354. background-color: white;
  355. font-family: Noto Sans S Chinese;
  356. font-weight: 400;
  357. display: flex;
  358. align-items: center;
  359. height: 100rpx;
  360. padding: 0 20rpx;
  361. justify-content: space-between;
  362. box-sizing: border-box;
  363. }
  364. ::deep.last .uni-stat__select {
  365. width: 360rpx !important;
  366. }
  367. .item {
  368. display: flex;
  369. font-size: 30rpx;
  370. margin-top: 10rpx;
  371. align-items: center;
  372. }
  373. .twoOne {
  374. background-color: white;
  375. margin-top: 10rpx;
  376. padding: 20rpx;
  377. display: flex;
  378. align-items: center;
  379. }
  380. .three {
  381. display: flex;
  382. align-items: center;
  383. }
  384. .two {
  385. background-color: white;
  386. margin-top: 10rpx;
  387. padding: 20rpx;
  388. }
  389. .input {
  390. display: flex;
  391. align-items: center;
  392. padding-left: 10prx;
  393. }
  394. .input>input {
  395. width: 45%;
  396. margin-top: 10rpx;
  397. font-size: 30rpx;
  398. border: 1rpx solid #ccc;
  399. padding: 0 10rpx;
  400. height: 28rpx;
  401. line-height: 28rpx;
  402. }
  403. </style>