Commit 35752d89b34b173397f1e2928b6e2d9aa403c47a

Authored by boyang
2 parents 52586d31 03d2a1f5

Merge branch 'refs/heads/by' into real1122

src/api/project/invoice.ts
@@ -15,6 +15,7 @@ enum Api { @@ -15,6 +15,7 @@ enum Api {
15 GETINVOICEDEDUCTURL_BY_ID = '/order/erp/invoice_bill/getDeductUrl_by_id', //获取扣款信息 15 GETINVOICEDEDUCTURL_BY_ID = '/order/erp/invoice_bill/getDeductUrl_by_id', //获取扣款信息
16 REUPLOADBGURL = '/order/erp/invoice_bill/reUploadBgUrl', //更新报关单 16 REUPLOADBGURL = '/order/erp/invoice_bill/reUploadBgUrl', //更新报关单
17 INVOICEEXPORTRECEIPT = '/order/erp/invoice_bill/exportReceipt', //收款单导出 17 INVOICEEXPORTRECEIPT = '/order/erp/invoice_bill/exportReceipt', //收款单导出
  18 + SETBACKREFUNDDATE = '/order/erp/invoice_bill/setBackRefundDate', //必须回款日期
18 19
19 PRODUCT_CREATE = '/order/erp/check_bill/create', //创建生产科应付单据 20 PRODUCT_CREATE = '/order/erp/check_bill/create', //创建生产科应付单据
20 PAYED_DATE = '/order/erp/check_bill/get_payed_date', //获取生产科应回款日期 21 PAYED_DATE = '/order/erp/check_bill/get_payed_date', //获取生产科应回款日期
@@ -30,6 +31,7 @@ enum Api { @@ -30,6 +31,7 @@ enum Api {
30 GETDEDUCTURL_BY_ID = '/order/erp/check_bill/getDeductUrl_by_id', //获取扣款信息 31 GETDEDUCTURL_BY_ID = '/order/erp/check_bill/getDeductUrl_by_id', //获取扣款信息
31 GETINVOICEURL_BY_ID = '/order/erp/check_bill/getInvoiceUrl_by_id', //获取扣款信息 32 GETINVOICEURL_BY_ID = '/order/erp/check_bill/getInvoiceUrl_by_id', //获取扣款信息
32 EXPORTRECEIPT = '/order/erp/check_bill/exportReceipt', //付款单导出 33 EXPORTRECEIPT = '/order/erp/check_bill/exportReceipt', //付款单导出
  34 + SETPADYEDDATE = '/order/erp/check_bill/setPayedDate', //修改应付款日期
33 } 35 }
34 36
35 export const getRefundDate = async (params: any, data?: any) => { 37 export const getRefundDate = async (params: any, data?: any) => {
@@ -250,3 +252,17 @@ export const getInvoiceExportReceipt = async (params: any) => { @@ -250,3 +252,17 @@ export const getInvoiceExportReceipt = async (params: any) => {
250 params, 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
@@ -461,7 +461,7 @@ @@ -461,7 +461,7 @@
461 window.open('', '', '').document.write(`<!DOCTYPE html> 461 window.open('', '', '').document.write(`<!DOCTYPE html>
462 <html> 462 <html>
463 <body style="display: flex; justify-content: center; align-items: center;"> 463 <body style="display: flex; justify-content: center; align-items: center;">
464 - <img src='${url}' width="500px" height="500px"/> 464 + <img src='${url}' width="300px" height="auto"/>
465 </body> 465 </body>
466 </html>`); 466 </html>`);
467 } else if (isPdfUrl(baseUrl)) { 467 } else if (isPdfUrl(baseUrl)) {
src/views/project/approve/index.vue
@@ -10,10 +10,28 @@ @@ -10,10 +10,28 @@
10 <a-tab-pane key="5" tab="项目报告书待审核" v-if="role !== ROLE.FINANCE"> 10 <a-tab-pane key="5" tab="项目报告书待审核" v-if="role !== ROLE.FINANCE">
11 <ReportPanel /> 11 <ReportPanel />
12 </a-tab-pane> 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 <ReceivePanel /> 23 <ReceivePanel />
15 </a-tab-pane> 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 <PayPanel /> 35 <PayPanel />
18 </a-tab-pane> 36 </a-tab-pane>
19 <a-tab-pane key="2" tab="字段已审核" v-if="role !== ROLE.FINANCE"> 37 <a-tab-pane key="2" tab="字段已审核" v-if="role !== ROLE.FINANCE">
@@ -25,10 +43,28 @@ @@ -25,10 +43,28 @@
25 <a-tab-pane key="6" tab="项目报告书已审核" v-if="role !== ROLE.FINANCE"> 43 <a-tab-pane key="6" tab="项目报告书已审核" v-if="role !== ROLE.FINANCE">
26 <ReportPanel isApproved /> 44 <ReportPanel isApproved />
27 </a-tab-pane> 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 <ReceivePanel isApproved /> 56 <ReceivePanel isApproved />
30 </a-tab-pane> 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 <PayPanel isApproved /> 68 <PayPanel isApproved />
33 </a-tab-pane> 69 </a-tab-pane>
34 </a-tabs> 70 </a-tabs>
src/views/project/finance/pay/DeductShow.vue
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 window.open('', '', '').document.write(`<!DOCTYPE html> 85 window.open('', '', '').document.write(`<!DOCTYPE html>
86 <html> 86 <html>
87 <body style="display: flex; justify-content: center; align-items: center;"> 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 </body> 89 </body>
90 </html>`); 90 </html>`);
91 } else if (isPdfUrl(baseUrl)) { 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,6 +16,7 @@
16 <DeductShow @register="registerDeductShow" /> 16 <DeductShow @register="registerDeductShow" />
17 <InvoiceShow @register="registerInvoiceShow" /> 17 <InvoiceShow @register="registerInvoiceShow" />
18 <Commit @register="registerCommit" @success="handleSuccess" /> 18 <Commit @register="registerCommit" @success="handleSuccess" />
  19 + <EditRefundTime @register="registerEditRefundTime" @success="handleSuccess" />
19 </template> 20 </template>
20 <template #bodyCell="{ column, record }"> 21 <template #bodyCell="{ column, record }">
21 <template v-if="column.key === 'action'"> 22 <template v-if="column.key === 'action'">
@@ -74,6 +75,14 @@ @@ -74,6 +75,14 @@
74 label: '扣款单', 75 label: '扣款单',
75 onClick: handleDeductShow.bind(null, record), 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 <TableAction 88 <TableAction
@@ -106,6 +115,7 @@ @@ -106,6 +115,7 @@
106 import DeductShow from './DeductShow.vue'; 115 import DeductShow from './DeductShow.vue';
107 import InvoiceShow from './InvoiceShow.vue'; 116 import InvoiceShow from './InvoiceShow.vue';
108 import Commit from './Commit.vue'; 117 import Commit from './Commit.vue';
  118 + import EditRefundTime from './EditRefundTime.vue';
109 import { useDrawer } from '/@/components/Drawer'; 119 import { useDrawer } from '/@/components/Drawer';
110 import { useModal } from '/@/components/Modal'; 120 import { useModal } from '/@/components/Modal';
111 import { getCheck, checkDelete, checkCommit, checkDetail } from '@/api/project/invoice'; 121 import { getCheck, checkDelete, checkCommit, checkDetail } from '@/api/project/invoice';
@@ -120,6 +130,7 @@ @@ -120,6 +130,7 @@
120 const [registerInvoiceUpload, { openModal: openInvoiceUpload }] = useModal(); 130 const [registerInvoiceUpload, { openModal: openInvoiceUpload }] = useModal();
121 const [registerDeductShow, { openModal: openDeductShow }] = useModal(); 131 const [registerDeductShow, { openModal: openDeductShow }] = useModal();
122 const [registerCommit, { openModal: openCommit }] = useModal(); 132 const [registerCommit, { openModal: openCommit }] = useModal();
  133 + const [registerEditRefundTime, { openModal: openEditRefundTime }] = useModal();
123 const [registerInvoiceShow, { openModal: openInvoiceShow }] = useModal(); 134 const [registerInvoiceShow, { openModal: openInvoiceShow }] = useModal();
124 const [registerInvoiceDetail, { openDrawer: openCheckDetail }] = useDrawer(); 135 const [registerInvoiceDetail, { openDrawer: openCheckDetail }] = useDrawer();
125 const userStore = useUserStoreWithOut(); 136 const userStore = useUserStoreWithOut();
@@ -362,6 +373,19 @@ @@ -362,6 +373,19 @@
362 data: record, 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 const { createMessage } = useMessage(); 390 const { createMessage } = useMessage();
367 const { error } = createMessage; 391 const { error } = createMessage;
src/views/project/finance/receive/DeductShow.vue
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 window.open('', '', '').document.write(`<!DOCTYPE html> 95 window.open('', '', '').document.write(`<!DOCTYPE html>
96 <html> 96 <html>
97 <body style="display: flex; justify-content: center; align-items: center;"> 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 </body> 99 </body>
100 </html>`); 100 </html>`);
101 } else if (isPdfUrl(baseUrl)) { 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,6 +15,7 @@
15 <InvoiceDetail @register="registerInvoiceDetail" /> 15 <InvoiceDetail @register="registerInvoiceDetail" />
16 <DeductShow @register="registerDeductShow" /> 16 <DeductShow @register="registerDeductShow" />
17 <Commit @register="registerCommit" @success="handleSuccess" /> 17 <Commit @register="registerCommit" @success="handleSuccess" />
  18 + <EditRefundTime @register="registerEditRefundTime" @success="handleSuccess" />
18 <ReUploadBgUrl @register="registerReUploadBgUrl" @success="handleSuccess" /> 19 <ReUploadBgUrl @register="registerReUploadBgUrl" @success="handleSuccess" />
19 </template> 20 </template>
20 <template #bodyCell="{ column, record }"> 21 <template #bodyCell="{ column, record }">
@@ -68,6 +69,14 @@ @@ -68,6 +69,14 @@
68 label: '扣款单', 69 label: '扣款单',
69 onClick: handleDeductShow.bind(null, record), 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 </template> 82 </template>
@@ -85,6 +94,7 @@ @@ -85,6 +94,7 @@
85 import InvoiceDetail from './InvoiceDetail.vue'; 94 import InvoiceDetail from './InvoiceDetail.vue';
86 import DeductShow from './DeductShow.vue'; 95 import DeductShow from './DeductShow.vue';
87 import Commit from './Commit.vue'; 96 import Commit from './Commit.vue';
  97 + import EditRefundTime from './EditRefundTime.vue';
88 import ReUploadBgUrl from './ReUploadBgUrl.vue'; 98 import ReUploadBgUrl from './ReUploadBgUrl.vue';
89 import { useDrawer } from '/@/components/Drawer'; 99 import { useDrawer } from '/@/components/Drawer';
90 import { getInvoice, deleteInvoice, commit, getBaseInvoice } from '@/api/project/invoice'; 100 import { getInvoice, deleteInvoice, commit, getBaseInvoice } from '@/api/project/invoice';
@@ -100,6 +110,7 @@ @@ -100,6 +110,7 @@
100 const [registerTrackEdit, { openDrawer: openTrackEdit }] = useDrawer(); 110 const [registerTrackEdit, { openDrawer: openTrackEdit }] = useDrawer();
101 const [registerInvoiceDetail, { openDrawer: openInvoiceDetail }] = useDrawer(); 111 const [registerInvoiceDetail, { openDrawer: openInvoiceDetail }] = useDrawer();
102 const [registerCommit, { openModal: openCommit }] = useModal(); 112 const [registerCommit, { openModal: openCommit }] = useModal();
  113 + const [registerEditRefundTime, { openModal: openEditRefundTime }] = useModal();
103 const [registerReUploadBgUrl, { openModal: openReUploadBgUrl }] = useModal(); 114 const [registerReUploadBgUrl, { openModal: openReUploadBgUrl }] = useModal();
104 const [registerDeductShow, { openModal: openDeductShow }] = useModal(); 115 const [registerDeductShow, { openModal: openDeductShow }] = useModal();
105 const checkedKeys = ref<Array<string | number>>([]); 116 const checkedKeys = ref<Array<string | number>>([]);
@@ -267,6 +278,11 @@ @@ -267,6 +278,11 @@
267 data: record, 278 data: record,
268 }); 279 });
269 } 280 }
  281 + function handleEditRefundTime(record) {
  282 + openEditRefundTime(true, {
  283 + data: record,
  284 + });
  285 + }
270 function handleInvoiceDetail(record) { 286 function handleInvoiceDetail(record) {
271 openInvoiceDetail(true, { 287 openInvoiceDetail(true, {
272 data: record, 288 data: record,