InvoiceApplication.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <view class="container">
  3. <view v-show="menuCurrent === 0">
  4. <view class="header-box">
  5. <view class="search-box">
  6. <u-search
  7. v-model="searchForm.keyword"
  8. :clearabled="true"
  9. bg-color="#E5E5E5"
  10. :input-style="searchInputStyle"
  11. placeholder="搜索您想要的内容"
  12. ></u-search>
  13. </view>
  14. <view class="tab-box">
  15. <u-tabs
  16. name="label"
  17. :list="searchType"
  18. :is-scroll="true"
  19. v-model="searchForm.type"
  20. @change="onSearchTypeChange"
  21. font-size="24"
  22. :bold="false"
  23. inactive-color="#000000"
  24. active-color="#000000"
  25. :bar-style="{'background-color': '#2979ff'}"
  26. :gutter="25"
  27. height="45"
  28. ></u-tabs>
  29. </view>
  30. </view>
  31. <view class="list-box">
  32. <u-checkbox-group>
  33. <view class="list-item-box" v-for="(item, index) in list" :key="item.id">
  34. <view class="checkbox-box">
  35. <u-checkbox
  36. @change="onCheckboxChange(item)"
  37. v-model="item.checked"
  38. :name="item.id"
  39. shape="circle"
  40. ></u-checkbox>
  41. </view>
  42. <view class="main-box" @click="onListItemClick(item, index)">
  43. <view class="title-box">
  44. {{item.title}}
  45. </view>
  46. <view class="main-box">
  47. <view class="info-box">
  48. <view class="info-item-box">
  49. <view class="label">
  50. 订单编号:
  51. </view>
  52. <view class="text">
  53. {{item.number}}
  54. </view>
  55. </view>
  56. <view class="info-item-box">
  57. <view class="label">
  58. 订单时间:
  59. </view>
  60. <view class="text">
  61. {{item.time}}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="price-box">
  66. <view class="text" v-if="item.status === 1">
  67. 实付款:&nbsp;¥{{item.price}}元
  68. </view>
  69. <view class="button" v-if="item.status === 0">
  70. 已关闭
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </u-checkbox-group>
  77. </view>
  78. </view>
  79. <view v-show="menuCurrent === 1">
  80. <view class="header-box">
  81. <view class="search-box">
  82. <u-search
  83. v-model="searchForm2.keyword"
  84. :clearabled="true"
  85. bg-color="#E5E5E5"
  86. :input-style="searchInputStyle"
  87. placeholder="搜索您想要的内容"
  88. ></u-search>
  89. </view>
  90. </view>
  91. <view class="list-box">
  92. <view class="list-card-box" v-for="item in list2" :key="item.id">
  93. <view class="main-box">
  94. <view class="info-box">
  95. <view class="title">
  96. {{item.name}}
  97. </view>
  98. <view class="type">
  99. {{item.type}}
  100. </view>
  101. <view class="info">
  102. <view class="info-item">
  103. <view class="label">
  104. 发票号码:
  105. </view>
  106. <view class="text">
  107. {{item.number}}
  108. </view>
  109. </view>
  110. <view class="info-item">
  111. <view class="label">
  112. 申请时间:
  113. </view>
  114. <view class="text">
  115. {{item.time}}
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="price-box">
  121. <view class="text">
  122. 发票金额:&nbsp;¥{{item.price}}元
  123. </view>
  124. </view>
  125. </view>
  126. <view class="status-box">
  127. <view class="status-item error">
  128. {{ item.status ? '已开票' : '开票中' }}
  129. </view>
  130. <view :class="['status-item', item.status ? 'primary' : 'info']">
  131. 发送至邮箱
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. <view class="function-block" v-if="menuCurrent === 0"></view>
  138. <view class="menu-block"></view>
  139. <view class="bottom-box">
  140. <view class="function-box" v-if="menuCurrent === 0">
  141. <view class="checkbox-box">
  142. <u-checkbox
  143. @change="onAllCheckboxChange"
  144. v-model="isAllChecked"
  145. name="all"
  146. shape="circle"
  147. >
  148. <text class="text">全选</text>
  149. </u-checkbox>
  150. </view>
  151. <view class="price-box">
  152. <view class="desc-box" v-if="priceInfo.count > 0">
  153. 已选择{{priceInfo.count}}单
  154. </view>
  155. <view class="info-box">
  156. <view class="label">
  157. 总金额:
  158. </view>
  159. <view class="text">
  160. ¥{{priceInfo.price}}元
  161. </view>
  162. </view>
  163. </view>
  164. <view class="button-box">
  165. <u-button :disabled="priceInfo.count === 0" class="button" type="error" shape="circle" size="mini" :custom-style="customButtonStyle">申请开票</u-button>
  166. </view>
  167. </view>
  168. <view class="menu-box">
  169. <view class="menu-item-box" :class="{'is-active': menuCurrent === 0}" @click="onMenuClick(0)">
  170. <view class="iconfont icon-kaipiao"></view>
  171. <view class="text">开票</view>
  172. </view>
  173. <view class="menu-item-box" :class="{'is-active': menuCurrent === 1}" @click="onMenuClick(1)">
  174. <view class="iconfont icon-kaipiaojilu"></view>
  175. <view class="text">开票记录</view>
  176. </view>
  177. </view>
  178. </view>
  179. </view>
  180. </template>
  181. <script setup>
  182. import { ref, computed } from 'vue'
  183. import { onLoad } from '@dcloudio/uni-app'
  184. const customButtonStyle = {
  185. height: '40rpx',
  186. lineHeight: '40rpx',
  187. padding: '0 30rpx'
  188. }
  189. const searchInputStyle = {
  190. backgroundColor: '#E5E5E5'
  191. }
  192. const searchType = [
  193. {
  194. label: '全部',
  195. value: 0
  196. },
  197. {
  198. label: '市场研究',
  199. value: 1
  200. },
  201. {
  202. label: '继续教育',
  203. value: 2
  204. },
  205. {
  206. label: '会费',
  207. value: 3
  208. },
  209. {
  210. label: '业务水平认证考试',
  211. value: 4
  212. },
  213. ]
  214. const searchForm = ref({
  215. keyword: '',
  216. type: 0
  217. })
  218. // 点击选中
  219. function onListItemClick(val, index) {
  220. list.value[index].checked = !list.value[index].checked
  221. }
  222. // 单独选中
  223. function onCheckboxChange(val) {
  224. }
  225. // 全选变更
  226. function onAllCheckboxChange(val) {
  227. list.value.forEach(item => {
  228. item.checked = val.value
  229. })
  230. }
  231. const priceInfo = computed(() => {
  232. const selectList = list.value.filter(item => item.checked)
  233. const sum = selectList.reduce((total, currentValue) => {
  234. return total + Number(currentValue.price);
  235. }, 0)
  236. return {
  237. count: selectList.length,
  238. price: sum.toFixed(2)
  239. }
  240. })
  241. const list = ref([
  242. {
  243. id: '01',
  244. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  245. number: '123456789987654321',
  246. time: '2023年8月8日',
  247. price: '9.9',
  248. status: 1,
  249. checked: false
  250. },
  251. {
  252. id: '02',
  253. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  254. number: '123456789987654321',
  255. time: '2023年8月8日',
  256. price: '9.9',
  257. status: 1,
  258. checked: false
  259. },
  260. {
  261. id: '03',
  262. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  263. number: '123456789987654321',
  264. time: '2023年8月8日',
  265. price: '9.9',
  266. status: 1,
  267. checked: false
  268. },
  269. {
  270. id: '04',
  271. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  272. number: '123456789987654321',
  273. time: '2023年8月8日',
  274. price: '9.9',
  275. status: 1,
  276. checked: false
  277. },
  278. {
  279. id: '05',
  280. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  281. number: '123456789987654321',
  282. time: '2023年8月8日',
  283. price: '9.9',
  284. status: 1,
  285. checked: false
  286. },
  287. {
  288. id: '06',
  289. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  290. number: '123456789987654321',
  291. time: '2023年8月8日',
  292. price: '9.9',
  293. status: 1,
  294. checked: false
  295. },
  296. {
  297. id: '07',
  298. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  299. number: '123456789987654321',
  300. time: '2023年8月8日',
  301. price: '9.9',
  302. status: 1,
  303. checked: false
  304. },
  305. {
  306. id: '08',
  307. title: '【市场研究】2024年11月广州市中介促成二手住宅市场交易简报',
  308. number: '123456789987654321',
  309. time: '2023年8月8日',
  310. price: '9.9',
  311. status: 1,
  312. checked: false
  313. },
  314. {
  315. id: '09',
  316. title: '【市场研究】2024年10月广州市中介促成二手住宅市场交易简报',
  317. number: '123456789987654321',
  318. time: '2023年8月8日',
  319. price: '9.9',
  320. status: 1,
  321. checked: false
  322. },
  323. ])
  324. const isAllChecked = ref(false)
  325. const searchForm2 = ref({
  326. keyword: ''
  327. })
  328. const list2 = ref([
  329. {
  330. id: '01',
  331. name: '广州市XXXXXXXXXXX公司',
  332. type: '全电普票',
  333. number: '123456789',
  334. time: '2024年12月1日',
  335. price: '9.9',
  336. status: 1,
  337. },
  338. {
  339. id: '02',
  340. name: '广州市XXXXXXXXXXX公司',
  341. type: '全电普票',
  342. number: '123456789',
  343. time: '2024年12月1日',
  344. price: '9.9',
  345. status: 0,
  346. },
  347. ])
  348. const menuCurrent = ref(0)
  349. function onMenuClick(index) {
  350. menuCurrent.value = index
  351. uni.setNavigationBarTitle({
  352. title: index ? '开票记录' : '发票申请'
  353. })
  354. }
  355. onLoad(() => {
  356. console.log('onLoad')
  357. })
  358. </script>
  359. <style lang="scss" scoped>
  360. .container {
  361. height: 100vh;
  362. width: 100vw;
  363. background-color: $uni-text-color-inverse;
  364. .header-box {
  365. padding: 0 20rpx;
  366. background-color: $uni-text-color-inverse;
  367. @include topMagnet();
  368. }
  369. .search-box {
  370. margin-bottom: 20rpx;
  371. ::v-deep(.u-search) {
  372. background-color: #e5e5e5;
  373. border-radius: 50rpx;
  374. .u-action {
  375. width: 18%;
  376. background-color: $uni-color-primary;
  377. border-radius: 50rpx;
  378. color: $uni-text-color-inverse;
  379. margin-right: 8rpx;
  380. font-size: 28rpx;
  381. line-height: 50rpx;
  382. letter-spacing: 3rpx;
  383. text-align: center;
  384. }
  385. }
  386. }
  387. .list-box {
  388. padding: 0 20rpx;
  389. .list-item-box {
  390. padding: 20rpx;
  391. border-bottom: 5rpx solid #E6E6E6;
  392. display: flex;
  393. &:active {
  394. background-color: $uni-bg-color-hover;
  395. }
  396. .checkbox-box {
  397. width: 5%;
  398. }
  399. .main-box {
  400. width: 95%;
  401. .title-box {
  402. font-size: $uni-title-font-size-3;
  403. font-weight: bold;
  404. margin-bottom: 20rpx;
  405. @include text-overflow()
  406. }
  407. .main-box {
  408. display: flex;
  409. justify-content: space-between;
  410. padding-left: 20rpx;
  411. .info-box {
  412. width: 50%;
  413. .info-item-box {
  414. display: flex;
  415. font-size: $uni-font-size-3;
  416. color: $uni-text-color-grey;
  417. line-height: 30rpx;
  418. .label {
  419. width: 80rpx;
  420. }
  421. }
  422. }
  423. .price-box {
  424. display: flex;
  425. align-items: flex-end;
  426. text-align: right;
  427. color: $uni-color-error;
  428. font-size: $uni-title-font-size-3;
  429. font-weight: bold;
  430. .button {
  431. background-color: #CCCCCC;
  432. color: $uni-text-color-inverse;
  433. padding: 6rpx 25rpx;
  434. border-radius: $uni-card-border-radius;
  435. }
  436. }
  437. }
  438. }
  439. }
  440. .list-card-box {
  441. padding: 20rpx;
  442. background-color: #F2F2F2;
  443. border-radius: $uni-card-border-radius;
  444. margin-bottom: 50rpx;
  445. .main-box {
  446. display: flex;
  447. .info-box {
  448. width: 60%;
  449. .title {
  450. font-size: $uni-title-font-size-2;
  451. font-weight: bold;
  452. line-height: 50rpx;
  453. }
  454. .type {
  455. font-size: $uni-font-size-2;
  456. font-weight: bold;
  457. margin-bottom: 15rpx;
  458. }
  459. .info {
  460. .info-item {
  461. display: flex;
  462. font-size: $uni-font-size-3;
  463. color: $uni-text-color-grey;
  464. line-height: 30rpx;
  465. .label {
  466. width: 80rpx;
  467. }
  468. }
  469. }
  470. }
  471. .price-box {
  472. width: 40%;
  473. font-size: $uni-title-font-size-3;
  474. font-weight: bold;
  475. color: $uni-color-error;
  476. text-align: right;
  477. line-height: 50rpx;
  478. }
  479. }
  480. .status-box {
  481. display: flex;
  482. justify-content: flex-end;
  483. gap: 10rpx;
  484. .status-item {
  485. padding: 5rpx 15rpx;
  486. border-radius: $uni-card-border-radius;
  487. text-align: center;
  488. font-size: $uni-font-size-4;
  489. color: $uni-text-color-inverse;
  490. }
  491. .primary {
  492. background-color: $uni-color-primary;
  493. }
  494. .error {
  495. background-color: $uni-color-error;
  496. }
  497. .info {
  498. background-color: #999999;
  499. }
  500. }
  501. }
  502. }
  503. .function-block {
  504. height: 70rpx;
  505. }
  506. .menu-block {
  507. height: 112rpx;
  508. }
  509. .bottom-box {
  510. padding: 5rpx 20rpx;
  511. padding-left: 40rpx;
  512. background-color: $uni-bg-color-grey;
  513. border: 1rpx solid #E9E9E9;
  514. position: fixed;
  515. bottom: 0;
  516. width: 100%;
  517. .function-box {
  518. display: flex;
  519. align-items: center;
  520. height: 70rpx;
  521. .checkbox-box {
  522. width: 18%;
  523. .text {
  524. font-size: $uni-font-size-1;
  525. font-weight: bold;
  526. }
  527. }
  528. .price-box {
  529. width: 60%;
  530. .desc-box {
  531. color: $uni-text-color-grey;
  532. font-size: $uni-font-size-3;
  533. }
  534. .info-box {
  535. display: flex;
  536. font-size: $uni-font-size-1;
  537. font-weight: bold;
  538. gap: 5rpx;
  539. .text {
  540. color: $uni-color-error;
  541. }
  542. }
  543. }
  544. .buttom-box {
  545. width: 18%;
  546. display: flex;
  547. align-items: center;
  548. }
  549. }
  550. .menu-box {
  551. height: 100rpx;
  552. display: flex;
  553. align-items: center;
  554. .menu-item-box {
  555. width: 50%;
  556. text-align: center;
  557. .iconfont {
  558. font-size: 55rpx;
  559. }
  560. .text {
  561. font-size: $uni-font-size-2;
  562. }
  563. }
  564. .is-active {
  565. color: $uni-color-primary;
  566. }
  567. }
  568. }
  569. }
  570. </style>