index.vue 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="body">
  3. <div class="bottombox">
  4. <van-button
  5. round
  6. :style="{ width: '40vw', margin: 'auto' }"
  7. type="primary"
  8. @click="goForm"
  9. >
  10. 立即填写
  11. </van-button>
  12. <van-button
  13. round
  14. :style="{ width: '40vw', margin: 'auto' }"
  15. type="primary"
  16. @click="goRecord"
  17. >
  18. 填写记录
  19. </van-button>
  20. <van-button
  21. round
  22. class="mybutton"
  23. :style="{ width: '40vw', margin: 'auto' }"
  24. type="primary"
  25. @click="goPromulgate"
  26. >
  27. 信息公示
  28. </van-button>
  29. </div>
  30. <div>
  31. {{
  32. formData.data.status == 1
  33. ? "该班次将于2022年10月5日截止"
  34. : "该班次已截止如有问题请联系报销助理"
  35. }}
  36. </div>
  37. </div>
  38. </template>
  39. <script setup>
  40. import { onMounted, reactive, ref } from 'vue';
  41. import { useRouter } from 'vue-router'
  42. import { getInvoiceFill } from '@/services/invoice'
  43. const router = useRouter();
  44. const formData = reactive({
  45. data: {
  46. //班级名称
  47. invoiceId: 'e288229edfd3cdd2eaac125b65eca10e',
  48. endDate: undefined,
  49. name: undefined,
  50. status: 1
  51. }
  52. })
  53. const goForm = () => {
  54. router.push({ name: 'invoice.fill',
  55. params: {
  56. invoiceId: formData.data.invoiceId,
  57. invoiceName: formData.data.name,
  58. endDate:formData.data.endDate,
  59. status:formData.data.status
  60. } })
  61. }
  62. const goRecord = () => {
  63. router.push({ name: 'invoice.records'})
  64. }
  65. const goPromulgate = () => {
  66. router.push({ name: 'invoice.promulgate'})
  67. }
  68. onMounted(() => {
  69. getInvoiceFill(formData.data.invoiceId).then(res => {
  70. formData.data = res
  71. }).catch(err => {
  72. console.log(err)
  73. })
  74. })
  75. </script>
  76. <style lang="less" scoped>
  77. .body {
  78. display: flex;
  79. flex-direction: column;
  80. align-items: center;
  81. justify-content: space-between;
  82. height: 80vh;
  83. padding-top: 10vh;
  84. .bottombox {
  85. display: flex;
  86. flex-direction: column;
  87. align-items: center;
  88. height: 50vh;
  89. }
  90. }
  91. </style>