Commit c883cbc22731bd14d4dadfb6e487bf72072b035d
1 parent
27fc15bb
开发修改回款时间
Showing
9 changed files
with
223 additions
and
7 deletions
src/api/project/invoice.ts
... | ... | @@ -15,6 +15,7 @@ enum Api { |
15 | 15 | GETINVOICEDEDUCTURL_BY_ID = '/order/erp/invoice_bill/getDeductUrl_by_id', //获取扣款信息 |
16 | 16 | REUPLOADBGURL = '/order/erp/invoice_bill/reUploadBgUrl', //更新报关单 |
17 | 17 | INVOICEEXPORTRECEIPT = '/order/erp/invoice_bill/exportReceipt', //收款单导出 |
18 | + SETBACKREFUNDDATE = '/order/erp/invoice_bill/setBackRefundDate', //必须回款日期 | |
18 | 19 | |
19 | 20 | PRODUCT_CREATE = '/order/erp/check_bill/create', //创建生产科应付单据 |
20 | 21 | PAYED_DATE = '/order/erp/check_bill/get_payed_date', //获取生产科应回款日期 |
... | ... | @@ -30,6 +31,7 @@ enum Api { |
30 | 31 | GETDEDUCTURL_BY_ID = '/order/erp/check_bill/getDeductUrl_by_id', //获取扣款信息 |
31 | 32 | GETINVOICEURL_BY_ID = '/order/erp/check_bill/getInvoiceUrl_by_id', //获取扣款信息 |
32 | 33 | EXPORTRECEIPT = '/order/erp/check_bill/exportReceipt', //付款单导出 |
34 | + SETPADYEDDATE = '/order/erp/check_bill/setPayedDate', //修改应付款日期 | |
33 | 35 | } |
34 | 36 | |
35 | 37 | export const getRefundDate = async (params: any, data?: any) => { |
... | ... | @@ -250,3 +252,17 @@ export const getInvoiceExportReceipt = async (params: any) => { |
250 | 252 | params, |
251 | 253 | }); |
252 | 254 | }; |
255 | + | |
256 | +export const getSetBackRefundDate = async (params: any) => { | |
257 | + return await defHttp.post<any>({ | |
258 | + url: Api.SETBACKREFUNDDATE, | |
259 | + params, | |
260 | + }); | |
261 | +}; | |
262 | + | |
263 | +export const getSetPayedDate = async (params: any) => { | |
264 | + return await defHttp.post<any>({ | |
265 | + url: Api.SETPADYEDDATE, | |
266 | + params, | |
267 | + }); | |
268 | +}; | ... | ... |
src/views/project/approve/PayPanel.vue
... | ... | @@ -458,7 +458,7 @@ |
458 | 458 | window.open('', '', '').document.write(`<!DOCTYPE html> |
459 | 459 | <html> |
460 | 460 | <body style="display: flex; justify-content: center; align-items: center;"> |
461 | - <img src='${url}' width="500px" height="500px"/> | |
461 | + <img src='${url}' width="300px" height="auto"/> | |
462 | 462 | </body> |
463 | 463 | </html>`); |
464 | 464 | } else if (isPdfUrl(baseUrl)) { | ... | ... |
src/views/project/approve/index.vue
... | ... | @@ -10,10 +10,28 @@ |
10 | 10 | <a-tab-pane key="5" tab="项目报告书待审核" v-if="role !== ROLE.FINANCE"> |
11 | 11 | <ReportPanel /> |
12 | 12 | </a-tab-pane> |
13 | - <a-tab-pane key="7" tab="应收款待审核" v-if="role == ROLE.FINANCE || role == ROLE.ADMIN"> | |
13 | + <a-tab-pane | |
14 | + key="7" | |
15 | + tab="应收款待审核" | |
16 | + v-if=" | |
17 | + role == ROLE.FINANCE || | |
18 | + role == ROLE.ADMIN || | |
19 | + role == ROLE.BUSINESS || | |
20 | + role == ROLE.TRACKER | |
21 | + " | |
22 | + > | |
14 | 23 | <ReceivePanel /> |
15 | 24 | </a-tab-pane> |
16 | - <a-tab-pane key="9" tab="应付款待审核" v-if="role == ROLE.FINANCE || role == ROLE.ADMIN"> | |
25 | + <a-tab-pane | |
26 | + key="9" | |
27 | + tab="应付款待审核" | |
28 | + v-if=" | |
29 | + role == ROLE.FINANCE || | |
30 | + role == ROLE.ADMIN || | |
31 | + role == ROLE.BUSINESS || | |
32 | + role == ROLE.TRACKER | |
33 | + " | |
34 | + > | |
17 | 35 | <PayPanel /> |
18 | 36 | </a-tab-pane> |
19 | 37 | <a-tab-pane key="2" tab="字段已审核" v-if="role !== ROLE.FINANCE"> |
... | ... | @@ -25,10 +43,28 @@ |
25 | 43 | <a-tab-pane key="6" tab="项目报告书已审核" v-if="role !== ROLE.FINANCE"> |
26 | 44 | <ReportPanel isApproved /> |
27 | 45 | </a-tab-pane> |
28 | - <a-tab-pane key="8" tab="应收款已审核" v-if="role == ROLE.FINANCE || role == ROLE.ADMIN"> | |
46 | + <a-tab-pane | |
47 | + key="8" | |
48 | + tab="应收款已审核" | |
49 | + v-if=" | |
50 | + role == ROLE.FINANCE || | |
51 | + role == ROLE.ADMIN || | |
52 | + role == ROLE.BUSINESS || | |
53 | + role == ROLE.TRACKER | |
54 | + " | |
55 | + > | |
29 | 56 | <ReceivePanel isApproved /> |
30 | 57 | </a-tab-pane> |
31 | - <a-tab-pane key="10" tab="应付款已审核" v-if="role == ROLE.FINANCE || role == ROLE.ADMIN"> | |
58 | + <a-tab-pane | |
59 | + key="10" | |
60 | + tab="应付款已审核" | |
61 | + v-if=" | |
62 | + role == ROLE.FINANCE || | |
63 | + role == ROLE.ADMIN || | |
64 | + role == ROLE.BUSINESS || | |
65 | + role == ROLE.TRACKER | |
66 | + " | |
67 | + > | |
32 | 68 | <PayPanel isApproved /> |
33 | 69 | </a-tab-pane> |
34 | 70 | </a-tabs> | ... | ... |
src/views/project/finance/pay/DeductShow.vue
... | ... | @@ -85,7 +85,7 @@ |
85 | 85 | window.open('', '', '').document.write(`<!DOCTYPE html> |
86 | 86 | <html> |
87 | 87 | <body style="display: flex; justify-content: center; align-items: center;"> |
88 | - <img src='${url}' width="500px" height="500px"/> | |
88 | + <img src='${url}' width="300px" height="auto"/> | |
89 | 89 | </body> |
90 | 90 | </html>`); |
91 | 91 | } else if (isPdfUrl(baseUrl)) { | ... | ... |
src/views/project/finance/pay/EditRefundTime.vue
0 → 100644
1 | +<template> | |
2 | + <BasicModal | |
3 | + v-bind="$attrs" | |
4 | + @register="register" | |
5 | + title="修改应付款日期" | |
6 | + width="500px" | |
7 | + :bodyStyle="{ height: '240px' }" | |
8 | + @visible-change="handleShow" | |
9 | + @ok="handleOk" | |
10 | + > | |
11 | + 请选择日期: | |
12 | + <a-date-picker v-model:value="date" /> | |
13 | + <div style="height: 10px"></div> | |
14 | + </BasicModal> | |
15 | +</template> | |
16 | +<script lang="ts" setup> | |
17 | + import { BasicModal, useModalInner } from '@/components/Modal'; | |
18 | + import { ref } from 'vue'; | |
19 | + import { getSetPayedDate } from '@/api/project/invoice'; | |
20 | + import { useMessage } from '/@/hooks/web/useMessage'; | |
21 | + | |
22 | + const id = ref(); | |
23 | + const date = ref(); | |
24 | + const emit = defineEmits(['success']); | |
25 | + const { createMessage } = useMessage(); | |
26 | + const { error } = createMessage; | |
27 | + const [register, { closeModal }] = useModalInner(async (data) => { | |
28 | + id.value = data.data.id; | |
29 | + }); | |
30 | + function formatDate(input: string): string { | |
31 | + // 创建一个 Date 对象 | |
32 | + const date = new Date(input); | |
33 | + | |
34 | + // 获取年月日 | |
35 | + const year = date.getFullYear(); | |
36 | + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,所以要加 1 | |
37 | + const day = String(date.getDate()).padStart(2, '0'); | |
38 | + | |
39 | + // 返回格式化后的日期字符串 | |
40 | + return `${year}-${month}-${day}`; | |
41 | + } | |
42 | + const isDisabled = ref(false); | |
43 | + async function handleOk() { | |
44 | + if (isDisabled.value) { | |
45 | + error('请勿连续点击生成按钮,需要等待三秒再点击生成'); | |
46 | + return; | |
47 | + } | |
48 | + const formattedDate = formatDate(date.value); | |
49 | + isDisabled.value = true; | |
50 | + setTimeout(() => { | |
51 | + isDisabled.value = false; | |
52 | + }, 3000); | |
53 | + getSetPayedDate({ id: id.value, payedDate: formattedDate }); | |
54 | + emit('success'); | |
55 | + closeModal(); | |
56 | + } | |
57 | + function handleShow(visible: boolean) { | |
58 | + if (!visible) { | |
59 | + date.value = null; | |
60 | + } | |
61 | + } | |
62 | +</script> | ... | ... |
src/views/project/finance/pay/index.vue
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | <DeductShow @register="registerDeductShow" /> |
17 | 17 | <InvoiceShow @register="registerInvoiceShow" /> |
18 | 18 | <Commit @register="registerCommit" @success="handleSuccess" /> |
19 | + <EditRefundTime @register="registerEditRefundTime" @success="handleSuccess" /> | |
19 | 20 | </template> |
20 | 21 | <template #bodyCell="{ column, record }"> |
21 | 22 | <template v-if="column.key === 'action'"> |
... | ... | @@ -74,6 +75,14 @@ |
74 | 75 | label: '扣款单', |
75 | 76 | onClick: handleDeductShow.bind(null, record), |
76 | 77 | }, |
78 | + ...(role == ROLE.ADMIN | |
79 | + ? [ | |
80 | + { | |
81 | + label: '修改应付款日期', | |
82 | + onClick: handleEditRefundTime.bind(null, record), | |
83 | + }, | |
84 | + ] | |
85 | + : []), | |
77 | 86 | ]" |
78 | 87 | /> |
79 | 88 | <TableAction |
... | ... | @@ -106,6 +115,7 @@ |
106 | 115 | import DeductShow from './DeductShow.vue'; |
107 | 116 | import InvoiceShow from './InvoiceShow.vue'; |
108 | 117 | import Commit from './Commit.vue'; |
118 | + import EditRefundTime from './EditRefundTime.vue'; | |
109 | 119 | import { useDrawer } from '/@/components/Drawer'; |
110 | 120 | import { useModal } from '/@/components/Modal'; |
111 | 121 | import { getCheck, checkDelete, checkCommit, checkDetail } from '@/api/project/invoice'; |
... | ... | @@ -120,6 +130,7 @@ |
120 | 130 | const [registerInvoiceUpload, { openModal: openInvoiceUpload }] = useModal(); |
121 | 131 | const [registerDeductShow, { openModal: openDeductShow }] = useModal(); |
122 | 132 | const [registerCommit, { openModal: openCommit }] = useModal(); |
133 | + const [registerEditRefundTime, { openModal: openEditRefundTime }] = useModal(); | |
123 | 134 | const [registerInvoiceShow, { openModal: openInvoiceShow }] = useModal(); |
124 | 135 | const [registerInvoiceDetail, { openDrawer: openCheckDetail }] = useDrawer(); |
125 | 136 | const userStore = useUserStoreWithOut(); |
... | ... | @@ -362,6 +373,19 @@ |
362 | 373 | data: record, |
363 | 374 | }); |
364 | 375 | } |
376 | + function handleEditRefundTime(record) { | |
377 | + // const currentDate: string = (() => { | |
378 | + // const date = new Date(); | |
379 | + // const year = date.getFullYear(); | |
380 | + // const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始 | |
381 | + // const day = String(date.getDate()).padStart(2, '0'); | |
382 | + // return `${year}-${month}-${day}`; | |
383 | + // })(); | |
384 | + // checkCommit({ id: record.id, actualPayedDate: currentDate }); | |
385 | + openEditRefundTime(true, { | |
386 | + data: record, | |
387 | + }); | |
388 | + } | |
365 | 389 | |
366 | 390 | const { createMessage } = useMessage(); |
367 | 391 | const { error } = createMessage; | ... | ... |
src/views/project/finance/receive/DeductShow.vue
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 | window.open('', '', '').document.write(`<!DOCTYPE html> |
96 | 96 | <html> |
97 | 97 | <body style="display: flex; justify-content: center; align-items: center;"> |
98 | - <img src='${url}' width="500px" height="500px"/> | |
98 | + <img src='${url}' width="300px" height="auto"/> | |
99 | 99 | </body> |
100 | 100 | </html>`); |
101 | 101 | } else if (isPdfUrl(baseUrl)) { | ... | ... |
src/views/project/finance/receive/EditRefundTime.vue
0 → 100644
1 | +<template> | |
2 | + <BasicModal | |
3 | + v-bind="$attrs" | |
4 | + @register="register" | |
5 | + title="修改必须回款日期" | |
6 | + width="500px" | |
7 | + :bodyStyle="{ height: '240px' }" | |
8 | + @ok="handleOk" | |
9 | + @visible-change="handleShow" | |
10 | + > | |
11 | + 请选择日期: | |
12 | + <a-date-picker v-model:value="date" /> | |
13 | + <div style="height: 10px"></div> | |
14 | + </BasicModal> | |
15 | +</template> | |
16 | +<script lang="ts" setup> | |
17 | + import { BasicModal, useModalInner } from '@/components/Modal'; | |
18 | + import { ref } from 'vue'; | |
19 | + import { getSetBackRefundDate } from '@/api/project/invoice'; | |
20 | + import { useMessage } from '/@/hooks/web/useMessage'; | |
21 | + | |
22 | + const id = ref(); | |
23 | + const date = ref(); | |
24 | + const emit = defineEmits(['success']); | |
25 | + const { createMessage } = useMessage(); | |
26 | + const { error } = createMessage; | |
27 | + const [register, { closeModal }] = useModalInner(async (data) => { | |
28 | + id.value = data.data.id; | |
29 | + }); | |
30 | + function formatDate(input: string): string { | |
31 | + // 创建一个 Date 对象 | |
32 | + const date = new Date(input); | |
33 | + | |
34 | + // 获取年月日 | |
35 | + const year = date.getFullYear(); | |
36 | + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,所以要加 1 | |
37 | + const day = String(date.getDate()).padStart(2, '0'); | |
38 | + | |
39 | + // 返回格式化后的日期字符串 | |
40 | + return `${year}-${month}-${day}`; | |
41 | + } | |
42 | + const isDisabled = ref(false); | |
43 | + async function handleOk() { | |
44 | + if (isDisabled.value) { | |
45 | + error('请勿连续点击生成按钮,需要等待三秒再点击生成'); | |
46 | + return; | |
47 | + } | |
48 | + const formattedDate = formatDate(date.value); | |
49 | + isDisabled.value = true; | |
50 | + setTimeout(() => { | |
51 | + isDisabled.value = false; | |
52 | + }, 3000); | |
53 | + getSetBackRefundDate({ id: id.value, backRefundDate: formattedDate }); | |
54 | + emit('success'); | |
55 | + closeModal(); | |
56 | + } | |
57 | + function handleShow(visible: boolean) { | |
58 | + if (!visible) { | |
59 | + date.value = null; | |
60 | + } | |
61 | + } | |
62 | +</script> | ... | ... |
src/views/project/finance/receive/index.vue
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | <InvoiceDetail @register="registerInvoiceDetail" /> |
16 | 16 | <DeductShow @register="registerDeductShow" /> |
17 | 17 | <Commit @register="registerCommit" @success="handleSuccess" /> |
18 | + <EditRefundTime @register="registerEditRefundTime" @success="handleSuccess" /> | |
18 | 19 | <ReUploadBgUrl @register="registerReUploadBgUrl" @success="handleSuccess" /> |
19 | 20 | </template> |
20 | 21 | <template #bodyCell="{ column, record }"> |
... | ... | @@ -68,6 +69,14 @@ |
68 | 69 | label: '扣款单', |
69 | 70 | onClick: handleDeductShow.bind(null, record), |
70 | 71 | }, |
72 | + ...(role == ROLE.ADMIN | |
73 | + ? [ | |
74 | + { | |
75 | + label: '修改必须回款日期', | |
76 | + onClick: handleEditRefundTime.bind(null, record), | |
77 | + }, | |
78 | + ] | |
79 | + : []), | |
71 | 80 | ]" |
72 | 81 | /> |
73 | 82 | </template> |
... | ... | @@ -85,6 +94,7 @@ |
85 | 94 | import InvoiceDetail from './InvoiceDetail.vue'; |
86 | 95 | import DeductShow from './DeductShow.vue'; |
87 | 96 | import Commit from './Commit.vue'; |
97 | + import EditRefundTime from './EditRefundTime.vue'; | |
88 | 98 | import ReUploadBgUrl from './ReUploadBgUrl.vue'; |
89 | 99 | import { useDrawer } from '/@/components/Drawer'; |
90 | 100 | import { getInvoice, deleteInvoice, commit, getBaseInvoice } from '@/api/project/invoice'; |
... | ... | @@ -100,6 +110,7 @@ |
100 | 110 | const [registerTrackEdit, { openDrawer: openTrackEdit }] = useDrawer(); |
101 | 111 | const [registerInvoiceDetail, { openDrawer: openInvoiceDetail }] = useDrawer(); |
102 | 112 | const [registerCommit, { openModal: openCommit }] = useModal(); |
113 | + const [registerEditRefundTime, { openModal: openEditRefundTime }] = useModal(); | |
103 | 114 | const [registerReUploadBgUrl, { openModal: openReUploadBgUrl }] = useModal(); |
104 | 115 | const [registerDeductShow, { openModal: openDeductShow }] = useModal(); |
105 | 116 | const checkedKeys = ref<Array<string | number>>([]); |
... | ... | @@ -267,6 +278,11 @@ |
267 | 278 | data: record, |
268 | 279 | }); |
269 | 280 | } |
281 | + function handleEditRefundTime(record) { | |
282 | + openEditRefundTime(true, { | |
283 | + data: record, | |
284 | + }); | |
285 | + } | |
270 | 286 | function handleInvoiceDetail(record) { |
271 | 287 | openInvoiceDetail(true, { |
272 | 288 | data: record, | ... | ... |