|
@@ -4,6 +4,7 @@
|
4
|
4
|
<van-button
|
5
|
5
|
round
|
6
|
6
|
:style="{ width: '40vw', margin: 'auto' }"
|
|
7
|
+ :disabled="!invoiceId"
|
7
|
8
|
type="primary"
|
8
|
9
|
@click="goForm"
|
9
|
10
|
>
|
|
@@ -11,69 +12,66 @@
|
11
|
12
|
</van-button>
|
12
|
13
|
<van-button
|
13
|
14
|
round
|
|
15
|
+ class="mybutton"
|
14
|
16
|
:style="{ width: '40vw', margin: 'auto' }"
|
|
17
|
+ :disabled="!invoiceId"
|
15
|
18
|
type="primary"
|
16
|
|
- @click="goRecord"
|
|
19
|
+ @click="goPromulgate"
|
17
|
20
|
>
|
18
|
|
- 填写记录
|
|
21
|
+ 信息公示
|
19
|
22
|
</van-button>
|
20
|
23
|
<van-button
|
21
|
24
|
round
|
22
|
|
- class="mybutton"
|
23
|
25
|
:style="{ width: '40vw', margin: 'auto' }"
|
24
|
26
|
type="primary"
|
25
|
|
- @click="goPromulgate"
|
|
27
|
+ @click="goRecord"
|
26
|
28
|
>
|
27
|
|
- 信息公示
|
|
29
|
+ 填写记录
|
28
|
30
|
</van-button>
|
29
|
31
|
</div>
|
30
|
32
|
<div>
|
31
|
|
- {{
|
32
|
|
- formData.data.status == 1
|
33
|
|
- ? "该班次将于2022年10月5日截止"
|
34
|
|
- : "该班次已截止如有问题请联系报销助理"
|
35
|
|
- }}
|
|
33
|
+ {{tipText}}
|
36
|
34
|
</div>
|
37
|
35
|
</div>
|
38
|
36
|
</template>
|
39
|
37
|
|
40
|
38
|
<script setup>
|
41
|
|
-import { onMounted, reactive, ref } from 'vue';
|
42
|
|
-import { useRouter } from 'vue-router'
|
|
39
|
+import { computed, onMounted, reactive, ref } from 'vue';
|
|
40
|
+import { useRouter, useRoute } from 'vue-router'
|
|
41
|
+import dayjs from 'dayjs'
|
43
|
42
|
import { getInvoiceFill } from '@/services/invoice'
|
44
|
43
|
|
45
|
44
|
const router = useRouter();
|
46
|
|
-const formData = reactive({
|
47
|
|
- data: {
|
48
|
|
- //班级名称
|
49
|
|
- invoiceId: 'f11ab8d28fd097e7aa4877ae7068a876',
|
50
|
|
- endDate: undefined,
|
51
|
|
- name: undefined,
|
52
|
|
- status: 1
|
53
|
|
- }
|
|
45
|
+const route = useRoute();
|
|
46
|
+const { invoiceId } = route.query
|
|
47
|
+
|
|
48
|
+const formData = reactive({})
|
|
49
|
+
|
|
50
|
+const tipText = computed(() => {
|
|
51
|
+ if (!invoiceId) return '请扫码访问此页面';
|
|
52
|
+ const finished = formData.status === 2 || (formData.endDate ? dayjs().isAfter(dayjs(formData.endDate)) : false)
|
|
53
|
+ return finished ? '该班次已截止如有问题请联系报销助理' : `该班次将于 ${dayjs(formData.endDate).format('YYYY年MM月DD日')} 截止`
|
54
|
54
|
})
|
55
|
55
|
|
56
|
56
|
const goForm = () => {
|
57
|
|
- router.push({ name: 'invoice.fill',
|
58
|
|
- params: {
|
59
|
|
- invoiceId: formData.data.invoiceId,
|
60
|
|
- invoiceName: formData.data.name,
|
61
|
|
- status:formData.data.status
|
62
|
|
- } })
|
|
57
|
+ router.push({ name: 'invoice.fill', query: route.query })
|
63
|
58
|
}
|
|
59
|
+
|
64
|
60
|
const goRecord = () => {
|
65
|
|
- router.push({ name: 'invoice.records'})
|
|
61
|
+ router.push({ name: 'invoice.history', query: route.query })
|
66
|
62
|
}
|
67
|
63
|
const goPromulgate = () => {
|
68
|
|
- router.push({ name: 'publicity.list'})
|
|
64
|
+ router.push({ name: 'publicity.list', query: route.query })
|
69
|
65
|
}
|
|
66
|
+
|
70
|
67
|
onMounted(() => {
|
71
|
68
|
getInvoiceFill(formData.data.invoiceId).then(res => {
|
72
|
|
- formData.data = res
|
|
69
|
+ Object.assign(formData, res)
|
73
|
70
|
}).catch(err => {
|
74
|
71
|
console.log(err)
|
75
|
72
|
})
|
76
|
73
|
})
|
|
74
|
+
|
77
|
75
|
</script>
|
78
|
76
|
<style lang="less" scoped>
|
79
|
77
|
.body {
|