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.

invoice-content.vue 9.8KB

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