Commit 180c35a6de482c52e11f4e8213f797dd47977ccb
Merge branch 'master' into clientBy
# Conflicts: # .umirc.ts # src/pages/Order/Order/index.tsx
Showing
6 changed files
with
325 additions
and
334 deletions
.umirc.ts
@@ -15,8 +15,8 @@ export default defineConfig({ | @@ -15,8 +15,8 @@ export default defineConfig({ | ||
15 | proxy: { | 15 | proxy: { |
16 | '/api/': { | 16 | '/api/': { |
17 | target: 'http://localhost:8085/', | 17 | target: 'http://localhost:8085/', |
18 | - // target: 'http://192.168.1.6:8085/', | ||
19 | - // target: 'http://39.108.227.113:8085/', | 18 | + //target: 'http://192.168.1.6:8085/', |
19 | + //target: 'http://39.108.227.113:8085/', | ||
20 | changeOrigin: true, | 20 | changeOrigin: true, |
21 | pathRewrite: { '^/api': '' }, | 21 | pathRewrite: { '^/api': '' }, |
22 | }, | 22 | }, |
src/pages/Invoice/InvoiceRecord/index.tsx
@@ -375,7 +375,7 @@ const InvoiceRecord = () => { | @@ -375,7 +375,7 @@ const InvoiceRecord = () => { | ||
375 | )} | 375 | )} |
376 | </>, | 376 | </>, |
377 | <> | 377 | <> |
378 | - {!record.invoice?.invoiceConfirmStatusDatetime && ( | 378 | + {record.paths?.includes('INVOICE_CONFIRM') && ( |
379 | <ButtonConfirm | 379 | <ButtonConfirm |
380 | key="delete" | 380 | key="delete" |
381 | className="p-0" | 381 | className="p-0" |
src/pages/Invoice/constant.tsx
@@ -45,6 +45,13 @@ export const INVOICE_COLUMNS = [ | @@ -45,6 +45,13 @@ export const INVOICE_COLUMNS = [ | ||
45 | width: 100, | 45 | width: 100, |
46 | }, | 46 | }, |
47 | { | 47 | { |
48 | + dataIndex: 'mainOrderId', | ||
49 | + title: '主订单id', | ||
50 | + valueType: 'text', | ||
51 | + width: 160, | ||
52 | + hideInTable: true, | ||
53 | + }, | ||
54 | + { | ||
48 | dataIndex: 'invoiceStatus', | 55 | dataIndex: 'invoiceStatus', |
49 | title: '发票类型', | 56 | title: '发票类型', |
50 | valueType: 'select', | 57 | valueType: 'select', |
src/pages/Order/Order/components/InvoicingDrawerForm.tsx
@@ -10,7 +10,13 @@ import { | @@ -10,7 +10,13 @@ import { | ||
10 | postServiceInvoiceQueryCompanyInfo, | 10 | postServiceInvoiceQueryCompanyInfo, |
11 | postServiceInvoiceWaitReissueInvoices, | 11 | postServiceInvoiceWaitReissueInvoices, |
12 | } from '@/services'; | 12 | } from '@/services'; |
13 | -import { FloatAdd, FloatSub, enum2ReverseSelect, enumToSelect } from '@/utils'; | 13 | +import { |
14 | + FloatAdd, | ||
15 | + FloatMul, | ||
16 | + FloatSub, | ||
17 | + enum2ReverseSelect, | ||
18 | + enumToSelect, | ||
19 | +} from '@/utils'; | ||
14 | import { convertCurrency } from '@/utils/numberUtil'; | 20 | import { convertCurrency } from '@/utils/numberUtil'; |
15 | import { | 21 | import { |
16 | DrawerForm, | 22 | DrawerForm, |
@@ -93,7 +99,22 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | @@ -93,7 +99,22 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | ||
93 | document.body.removeChild(textarea); | 99 | document.body.removeChild(textarea); |
94 | } | 100 | } |
95 | } | 101 | } |
96 | - | 102 | + // 定义一个计算总金额的函数 |
103 | + const calculateTotalPrice = (index: number) => { | ||
104 | + const invoiceDetails = form.getFieldValue('invoiceDetails'); | ||
105 | + if (invoiceDetails && invoiceDetails[index]) { | ||
106 | + const quantity = invoiceDetails[index].quantity || 0; | ||
107 | + const price = invoiceDetails[index].price || 0; | ||
108 | + const totalPrice = FloatMul(quantity, price); | ||
109 | + const newInvoiceDetails = [...invoiceDetails]; | ||
110 | + newInvoiceDetails[index] = { ...newInvoiceDetails[index], totalPrice }; | ||
111 | + form.setFieldsValue({ invoiceDetails: newInvoiceDetails }); | ||
112 | + } | ||
113 | + const totalPrice = invoiceDetails.reduce((accumulator, currentValue) => { | ||
114 | + return FloatAdd(accumulator, currentValue.quantity * currentValue.price); | ||
115 | + }, 0); | ||
116 | + form.setFieldValue('price', totalPrice); | ||
117 | + }; | ||
97 | useEffect(() => {}, []); | 118 | useEffect(() => {}, []); |
98 | return ( | 119 | return ( |
99 | <DrawerForm | 120 | <DrawerForm |
@@ -539,7 +560,9 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | @@ -539,7 +560,9 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | ||
539 | }, | 560 | }, |
540 | }, | 561 | }, |
541 | ]} | 562 | ]} |
563 | + onChange={() => calculateTotalPrice(listMeta.index)} | ||
542 | /> | 564 | /> |
565 | + | ||
543 | <ProFormDigit | 566 | <ProFormDigit |
544 | key={'price' + listMeta.index} | 567 | key={'price' + listMeta.index} |
545 | label="单价" | 568 | label="单价" |
@@ -554,23 +577,13 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | @@ -554,23 +577,13 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | ||
554 | }, | 577 | }, |
555 | }, | 578 | }, |
556 | ]} | 579 | ]} |
580 | + onChange={() => calculateTotalPrice(listMeta.index)} | ||
557 | /> | 581 | /> |
582 | + | ||
558 | <ProFormMoney | 583 | <ProFormMoney |
559 | key={'totalPrice' + listMeta.index} | 584 | key={'totalPrice' + listMeta.index} |
560 | label="金额" | 585 | label="金额" |
561 | name="totalPrice" | 586 | name="totalPrice" |
562 | - onChange={() => { | ||
563 | - const invoiceDetails = form.getFieldValue('invoiceDetails'); | ||
564 | - console.log('invoiceDetails', invoiceDetails); | ||
565 | - const totalPrice = invoiceDetails.reduce( | ||
566 | - (accumulator, currentValue) => { | ||
567 | - return FloatAdd(accumulator, currentValue.totalPrice); | ||
568 | - }, | ||
569 | - 0, | ||
570 | - ); | ||
571 | - console.log('totalPrice', totalPrice); | ||
572 | - form.setFieldValue('price', totalPrice); | ||
573 | - }} | ||
574 | rules={[ | 587 | rules={[ |
575 | { | 588 | { |
576 | validator: (_, value) => { | 589 | validator: (_, value) => { |
@@ -581,6 +594,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | @@ -581,6 +594,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { | ||
581 | }, | 594 | }, |
582 | }, | 595 | }, |
583 | ]} | 596 | ]} |
597 | + readonly={true} | ||
584 | locale="zh-CN" | 598 | locale="zh-CN" |
585 | /> | 599 | /> |
586 | </ProCard> | 600 | </ProCard> |
src/pages/Order/Order/index.tsx
@@ -131,6 +131,7 @@ import './index.less'; | @@ -131,6 +131,7 @@ import './index.less'; | ||
131 | import { OrderListItemType, OrderType } from './type.d'; | 131 | import { OrderListItemType, OrderType } from './type.d'; |
132 | // import { useNavigate } from 'react-router-dom'; | 132 | // import { useNavigate } from 'react-router-dom'; |
133 | import { history } from '@umijs/max'; | 133 | import { history } from '@umijs/max'; |
134 | +// import { format } from 'fecha'; | ||
134 | 135 | ||
135 | const OrderPage = () => { | 136 | const OrderPage = () => { |
136 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); | 137 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); |
@@ -4587,7 +4588,23 @@ const OrderPage = () => { | @@ -4587,7 +4588,23 @@ const OrderPage = () => { | ||
4587 | 4588 | ||
4588 | return toolBtns; | 4589 | return toolBtns; |
4589 | } | 4590 | } |
4590 | - | 4591 | + function setOriginTime(value) { |
4592 | + const currentDate = new Date(); | ||
4593 | + | ||
4594 | + // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 | ||
4595 | + const newDate = new Date(currentDate); | ||
4596 | + newDate.setDate(currentDate.getDate() - value); | ||
4597 | + // 检查日期是否有效,并格式化输出 | ||
4598 | + function formatDate(date) { | ||
4599 | + const year = date.getFullYear(); | ||
4600 | + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需加1 | ||
4601 | + const day = String(date.getDate()).padStart(2, '0'); // 确保是两位数 | ||
4602 | + return `${year}-${month}-${day} ${date.toTimeString().split(' ')[0]}`; // 获取时间部分 | ||
4603 | + } | ||
4604 | + const formattedDate = formatDate(newDate); | ||
4605 | + // const formattedDate = format(newDate, 'YYYY-MM-dd HH:mm:ss'); | ||
4606 | + return formattedDate; | ||
4607 | + } | ||
4591 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); | 4608 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); |
4592 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); | 4609 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); |
4593 | const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); | 4610 | const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); |
@@ -4597,7 +4614,13 @@ const OrderPage = () => { | @@ -4597,7 +4614,13 @@ const OrderPage = () => { | ||
4597 | 4614 | ||
4598 | async function getInvoiceWarningNum() { | 4615 | async function getInvoiceWarningNum() { |
4599 | const res = await postServiceOrderWarningOrderStatistics({ | 4616 | const res = await postServiceOrderWarningOrderStatistics({ |
4600 | - data: {}, | 4617 | + data: { |
4618 | + salesCode: userInfo.username, | ||
4619 | + waitConfirmReiceptStatusDateTimeLe: setOriginTime(7), | ||
4620 | + waitFeedbackStatusDateTimeLe: setOriginTime(20), | ||
4621 | + waitConfirmInvoiceStatusDateTimeLe: setOriginTime(5), | ||
4622 | + waitConfirmPaymentStatusDateTimeLe: setOriginTime(30), | ||
4623 | + }, | ||
4601 | }); | 4624 | }); |
4602 | if ( | 4625 | if ( |
4603 | (res.data.waitConfirmInvoice !== 0 || | 4626 | (res.data.waitConfirmInvoice !== 0 || |
@@ -4631,375 +4654,283 @@ const OrderPage = () => { | @@ -4631,375 +4654,283 @@ const OrderPage = () => { | ||
4631 | <div className="order-page-container"> | 4654 | <div className="order-page-container"> |
4632 | <div id="resizeDiv"></div> | 4655 | <div id="resizeDiv"></div> |
4633 | <div id="resizeDiv"></div> | 4656 | <div id="resizeDiv"></div> |
4634 | - <Modal | ||
4635 | - title="订单预警提醒" | ||
4636 | - open={open} | ||
4637 | - width={800} | ||
4638 | - closable={false} | ||
4639 | - footer={[ | ||
4640 | - <Button | ||
4641 | - key="confirm" | ||
4642 | - size="large" | ||
4643 | - type="primary" | ||
4644 | - onClick={navigateToWarning} | ||
4645 | - > | ||
4646 | - 去处理 | ||
4647 | - </Button>, | ||
4648 | - ]} | ||
4649 | - > | ||
4650 | - {/* <Row | ||
4651 | - gutter={16} | ||
4652 | - justify="space-between" // Aligns Cols to the start and end | ||
4653 | - align="middle" // Vertically center contents | ||
4654 | - > | ||
4655 | - <Col span={12}> | ||
4656 | - <div | ||
4657 | - style={{ | ||
4658 | - display: 'flex', | ||
4659 | - justifyContent: 'center', | ||
4660 | - marginTop: '20px', | ||
4661 | - }} | 4657 | + {roleCode === 'SALES_REPRESENTATIVE' && ( |
4658 | + <Modal | ||
4659 | + title="订单预警提醒" | ||
4660 | + open={open} | ||
4661 | + width={800} | ||
4662 | + closable={false} | ||
4663 | + footer={[ | ||
4664 | + <Button | ||
4665 | + key="confirm" | ||
4666 | + size="large" | ||
4667 | + type="primary" | ||
4668 | + onClick={navigateToWarning} | ||
4662 | > | 4669 | > |
4663 | - <Card | ||
4664 | - bordered={true} | 4670 | + 去处理 |
4671 | + </Button>, | ||
4672 | + ]} | ||
4673 | + > | ||
4674 | + <Row | ||
4675 | + gutter={16} | ||
4676 | + justify="space-between" // Aligns Cols to the start and end | ||
4677 | + align="middle" // Vertically center contents | ||
4678 | + > | ||
4679 | + {/* 新增卡片1: 待确认收货订单 */} | ||
4680 | + <Col span={6}> | ||
4681 | + {' '} | ||
4682 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4683 | + <div | ||
4665 | style={{ | 4684 | style={{ |
4666 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4667 | - width: '200px', // 卡片宽度 | ||
4668 | - height: '200px', // 卡片高度 | ||
4669 | display: 'flex', | 4685 | display: 'flex', |
4670 | - alignItems: 'center', | ||
4671 | justifyContent: 'center', | 4686 | justifyContent: 'center', |
4687 | + marginTop: '20px', | ||
4672 | }} | 4688 | }} |
4673 | > | 4689 | > |
4674 | - <div | 4690 | + <Card |
4691 | + bordered={true} | ||
4675 | style={{ | 4692 | style={{ |
4676 | - fontWeight: 'bold', // 字体加粗 | ||
4677 | - color: 'black', // 字体颜色 | ||
4678 | - fontSize: '20px', // 字体大小 | 4693 | + backgroundColor: '#f0f0f0', // 背景颜色 |
4694 | + width: '200px', // 卡片宽度 | ||
4695 | + height: '200px', // 卡片高度 | ||
4696 | + display: 'flex', | ||
4697 | + alignItems: 'center', | ||
4698 | + justifyContent: 'center', | ||
4679 | }} | 4699 | }} |
4680 | > | 4700 | > |
4681 | <div | 4701 | <div |
4682 | style={{ | 4702 | style={{ |
4683 | fontWeight: 'bold', // 字体加粗 | 4703 | fontWeight: 'bold', // 字体加粗 |
4684 | color: 'black', // 字体颜色 | 4704 | color: 'black', // 字体颜色 |
4685 | - fontSize: '40px', // 字体大小 | ||
4686 | - justifyContent: 'center', | ||
4687 | - display: 'flex', | ||
4688 | - alignItems: 'center', | ||
4689 | - marginBottom: '20px', | 4705 | + fontSize: '18px', // 字体大小 |
4690 | }} | 4706 | }} |
4691 | > | 4707 | > |
4692 | - {invoiceWarningNum} | 4708 | + <div |
4709 | + style={{ | ||
4710 | + fontWeight: 'bold', // 字体加粗 | ||
4711 | + color: 'black', // 字体颜色 | ||
4712 | + fontSize: '40px', // 字体大小 | ||
4713 | + justifyContent: 'center', | ||
4714 | + display: 'flex', | ||
4715 | + alignItems: 'center', | ||
4716 | + marginBottom: '20px', | ||
4717 | + }} | ||
4718 | + > | ||
4719 | + {invoiceRefundWarningNum} | ||
4720 | + </div> | ||
4721 | + 待确认收货订单 | ||
4693 | </div> | 4722 | </div> |
4694 | - 发票待确认订单 | ||
4695 | - </div> | ||
4696 | - </Card> | ||
4697 | - </div> | ||
4698 | - </Col> | ||
4699 | - <Col span={12}> | ||
4700 | - <div | ||
4701 | - style={{ | ||
4702 | - display: 'flex', | ||
4703 | - justifyContent: 'center', | ||
4704 | - marginTop: '20px', | ||
4705 | - }} | ||
4706 | - > | ||
4707 | - <Card | ||
4708 | - bordered={true} | 4723 | + </Card> |
4724 | + </div> | ||
4725 | + </Col> | ||
4726 | + | ||
4727 | + {/* 新增卡片2: 待回访登记订单 */} | ||
4728 | + <Col span={6}> | ||
4729 | + {' '} | ||
4730 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4731 | + <div | ||
4709 | style={{ | 4732 | style={{ |
4710 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4711 | - width: '200px', // 卡片宽度 | ||
4712 | - height: '200px', // 卡片高度 | ||
4713 | display: 'flex', | 4733 | display: 'flex', |
4714 | - alignItems: 'center', | ||
4715 | justifyContent: 'center', | 4734 | justifyContent: 'center', |
4735 | + marginTop: '20px', | ||
4716 | }} | 4736 | }} |
4717 | > | 4737 | > |
4718 | - <div | 4738 | + <Card |
4739 | + bordered={true} | ||
4719 | style={{ | 4740 | style={{ |
4720 | - fontWeight: 'bold', // 字体加粗 | ||
4721 | - color: 'black', // 字体颜色 | ||
4722 | - fontSize: '20px', // 字体大小 | 4741 | + backgroundColor: '#f0f0f0', // 背景颜色 |
4742 | + width: '200px', // 卡片宽度 | ||
4743 | + height: '200px', // 卡片高度 | ||
4744 | + display: 'flex', | ||
4745 | + alignItems: 'center', | ||
4746 | + justifyContent: 'center', | ||
4723 | }} | 4747 | }} |
4724 | > | 4748 | > |
4725 | <div | 4749 | <div |
4726 | style={{ | 4750 | style={{ |
4727 | fontWeight: 'bold', // 字体加粗 | 4751 | fontWeight: 'bold', // 字体加粗 |
4728 | color: 'black', // 字体颜色 | 4752 | color: 'black', // 字体颜色 |
4729 | - fontSize: '40px', // 字体大小 | ||
4730 | - justifyContent: 'center', | ||
4731 | - display: 'flex', | ||
4732 | - alignItems: 'center', | ||
4733 | - marginBottom: '20px', | 4753 | + fontSize: '18px', // 字体大小 |
4734 | }} | 4754 | }} |
4735 | > | 4755 | > |
4736 | - {invoiceRefundWarningNum} | 4756 | + <div |
4757 | + style={{ | ||
4758 | + fontWeight: 'bold', // 字体加粗 | ||
4759 | + color: 'black', // 字体颜色 | ||
4760 | + fontSize: '40px', // 字体大小 | ||
4761 | + justifyContent: 'center', | ||
4762 | + display: 'flex', | ||
4763 | + alignItems: 'center', | ||
4764 | + marginBottom: '20px', | ||
4765 | + }} | ||
4766 | + > | ||
4767 | + {waitFeedback} | ||
4768 | + </div> | ||
4769 | + 待回访登记订单 | ||
4737 | </div> | 4770 | </div> |
4738 | - 回款待确认订单 | ||
4739 | - </div> | ||
4740 | - </Card> | ||
4741 | - </div> | ||
4742 | - </Col> | ||
4743 | - </Row> */} | ||
4744 | - <Row | ||
4745 | - gutter={16} | ||
4746 | - justify="space-between" // Aligns Cols to the start and end | ||
4747 | - align="middle" // Vertically center contents | ||
4748 | - > | ||
4749 | - {/* 新增卡片1: 待确认收货订单 */} | ||
4750 | - <Col span={6}> | ||
4751 | - {' '} | ||
4752 | - {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4753 | - <div | ||
4754 | - style={{ | ||
4755 | - display: 'flex', | ||
4756 | - justifyContent: 'center', | ||
4757 | - marginTop: '20px', | ||
4758 | - }} | ||
4759 | - > | ||
4760 | - <Card | ||
4761 | - bordered={true} | 4771 | + </Card> |
4772 | + </div> | ||
4773 | + </Col> | ||
4774 | + | ||
4775 | + {/* 现有卡片: 发票待确认订单 */} | ||
4776 | + <Col span={6}> | ||
4777 | + {' '} | ||
4778 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4779 | + <div | ||
4762 | style={{ | 4780 | style={{ |
4763 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4764 | - width: '200px', // 卡片宽度 | ||
4765 | - height: '200px', // 卡片高度 | ||
4766 | display: 'flex', | 4781 | display: 'flex', |
4767 | - alignItems: 'center', | ||
4768 | justifyContent: 'center', | 4782 | justifyContent: 'center', |
4783 | + marginTop: '20px', | ||
4769 | }} | 4784 | }} |
4770 | > | 4785 | > |
4771 | - <div | 4786 | + <Card |
4787 | + bordered={true} | ||
4772 | style={{ | 4788 | style={{ |
4773 | - fontWeight: 'bold', // 字体加粗 | ||
4774 | - color: 'black', // 字体颜色 | ||
4775 | - fontSize: '18px', // 字体大小 | 4789 | + backgroundColor: '#f0f0f0', // 背景颜色 |
4790 | + width: '200px', // 卡片宽度 | ||
4791 | + height: '200px', // 卡片高度 | ||
4792 | + display: 'flex', | ||
4793 | + alignItems: 'center', | ||
4794 | + justifyContent: 'center', | ||
4776 | }} | 4795 | }} |
4777 | > | 4796 | > |
4778 | <div | 4797 | <div |
4779 | style={{ | 4798 | style={{ |
4780 | fontWeight: 'bold', // 字体加粗 | 4799 | fontWeight: 'bold', // 字体加粗 |
4781 | color: 'black', // 字体颜色 | 4800 | color: 'black', // 字体颜色 |
4782 | - fontSize: '40px', // 字体大小 | ||
4783 | - justifyContent: 'center', | ||
4784 | - display: 'flex', | ||
4785 | - alignItems: 'center', | ||
4786 | - marginBottom: '20px', | 4801 | + fontSize: '18px', // 字体大小 |
4787 | }} | 4802 | }} |
4788 | > | 4803 | > |
4789 | - {invoiceRefundWarningNum} | 4804 | + <div |
4805 | + style={{ | ||
4806 | + fontWeight: 'bold', // 字体加粗 | ||
4807 | + color: 'black', // 字体颜色 | ||
4808 | + fontSize: '40px', // 字体大小 | ||
4809 | + justifyContent: 'center', | ||
4810 | + display: 'flex', | ||
4811 | + alignItems: 'center', | ||
4812 | + marginBottom: '20px', | ||
4813 | + }} | ||
4814 | + > | ||
4815 | + {invoiceWarningNum} | ||
4816 | + </div> | ||
4817 | + 待确认发票订单 | ||
4790 | </div> | 4818 | </div> |
4791 | - 待确认收货订单 | ||
4792 | - </div> | ||
4793 | - </Card> | ||
4794 | - </div> | ||
4795 | - </Col> | 4819 | + </Card> |
4820 | + </div> | ||
4821 | + </Col> | ||
4796 | 4822 | ||
4797 | - {/* 新增卡片2: 待回访登记订单 */} | ||
4798 | - <Col span={6}> | ||
4799 | - {' '} | ||
4800 | - {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4801 | - <div | ||
4802 | - style={{ | ||
4803 | - display: 'flex', | ||
4804 | - justifyContent: 'center', | ||
4805 | - marginTop: '20px', | ||
4806 | - }} | ||
4807 | - > | ||
4808 | - <Card | ||
4809 | - bordered={true} | 4823 | + {/* 现有卡片: 回款待确认订单 */} |
4824 | + <Col span={6}> | ||
4825 | + {' '} | ||
4826 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4827 | + <div | ||
4810 | style={{ | 4828 | style={{ |
4811 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4812 | - width: '200px', // 卡片宽度 | ||
4813 | - height: '200px', // 卡片高度 | ||
4814 | display: 'flex', | 4829 | display: 'flex', |
4815 | - alignItems: 'center', | ||
4816 | justifyContent: 'center', | 4830 | justifyContent: 'center', |
4831 | + marginTop: '20px', | ||
4817 | }} | 4832 | }} |
4818 | > | 4833 | > |
4819 | - <div | 4834 | + <Card |
4835 | + bordered={true} | ||
4820 | style={{ | 4836 | style={{ |
4821 | - fontWeight: 'bold', // 字体加粗 | ||
4822 | - color: 'black', // 字体颜色 | ||
4823 | - fontSize: '18px', // 字体大小 | 4837 | + backgroundColor: '#f0f0f0', // 背景颜色 |
4838 | + width: '200px', // 卡片宽度 | ||
4839 | + height: '200px', // 卡片高度 | ||
4840 | + display: 'flex', | ||
4841 | + alignItems: 'center', | ||
4842 | + justifyContent: 'center', | ||
4824 | }} | 4843 | }} |
4825 | > | 4844 | > |
4826 | <div | 4845 | <div |
4827 | style={{ | 4846 | style={{ |
4828 | fontWeight: 'bold', // 字体加粗 | 4847 | fontWeight: 'bold', // 字体加粗 |
4829 | color: 'black', // 字体颜色 | 4848 | color: 'black', // 字体颜色 |
4830 | - fontSize: '40px', // 字体大小 | ||
4831 | - justifyContent: 'center', | ||
4832 | - display: 'flex', | ||
4833 | - alignItems: 'center', | ||
4834 | - marginBottom: '20px', | 4849 | + fontSize: '18px', // 字体大小 |
4835 | }} | 4850 | }} |
4836 | > | 4851 | > |
4837 | - {waitFeedback} | 4852 | + <div |
4853 | + style={{ | ||
4854 | + fontWeight: 'bold', // 字体加粗 | ||
4855 | + color: 'black', // 字体颜色 | ||
4856 | + fontSize: '40px', // 字体大小 | ||
4857 | + justifyContent: 'center', | ||
4858 | + display: 'flex', | ||
4859 | + alignItems: 'center', | ||
4860 | + marginBottom: '20px', | ||
4861 | + }} | ||
4862 | + > | ||
4863 | + {waitConfirmPayment} | ||
4864 | + </div> | ||
4865 | + 待回款订单 | ||
4838 | </div> | 4866 | </div> |
4839 | - 待回访登记订单 | ||
4840 | - </div> | ||
4841 | - </Card> | ||
4842 | - </div> | ||
4843 | - </Col> | 4867 | + </Card> |
4868 | + </div> | ||
4869 | + </Col> | ||
4870 | + </Row> | ||
4844 | 4871 | ||
4845 | - {/* 现有卡片: 发票待确认订单 */} | ||
4846 | - <Col span={6}> | ||
4847 | - {' '} | ||
4848 | - {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | 4872 | + <div> |
4873 | + <p | ||
4874 | + style={{ | ||
4875 | + color: 'red', | ||
4876 | + paddingLeft: '20px', | ||
4877 | + paddingRight: '20px', | ||
4878 | + marginTop: '10px', | ||
4879 | + }} | ||
4880 | + > | ||
4881 | + 预警说明: | ||
4882 | + </p> | ||
4849 | <div | 4883 | <div |
4850 | style={{ | 4884 | style={{ |
4851 | - display: 'flex', | ||
4852 | - justifyContent: 'center', | ||
4853 | - marginTop: '20px', | 4885 | + marginLeft: '20px', |
4886 | + marginRight: '20px', | ||
4887 | + marginBottom: '20px', | ||
4854 | }} | 4888 | }} |
4855 | > | 4889 | > |
4856 | - <Card | ||
4857 | - bordered={true} | ||
4858 | - style={{ | ||
4859 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4860 | - width: '200px', // 卡片宽度 | ||
4861 | - height: '200px', // 卡片高度 | ||
4862 | - display: 'flex', | ||
4863 | - alignItems: 'center', | ||
4864 | - justifyContent: 'center', | ||
4865 | - }} | ||
4866 | - > | ||
4867 | - <div | ||
4868 | - style={{ | ||
4869 | - fontWeight: 'bold', // 字体加粗 | ||
4870 | - color: 'black', // 字体颜色 | ||
4871 | - fontSize: '18px', // 字体大小 | ||
4872 | - }} | ||
4873 | - > | ||
4874 | - <div | ||
4875 | - style={{ | ||
4876 | - fontWeight: 'bold', // 字体加粗 | ||
4877 | - color: 'black', // 字体颜色 | ||
4878 | - fontSize: '40px', // 字体大小 | ||
4879 | - justifyContent: 'center', | ||
4880 | - display: 'flex', | ||
4881 | - alignItems: 'center', | ||
4882 | - marginBottom: '20px', | ||
4883 | - }} | ||
4884 | - > | ||
4885 | - {invoiceWarningNum} | ||
4886 | - </div> | ||
4887 | - 待确认发票订单 | ||
4888 | - </div> | ||
4889 | - </Card> | 4890 | + <span style={{ color: 'red' }}>确认收货预警:</span> |
4891 | + <span> | ||
4892 | + 从发货之日起计算,国内超过7天(海外30天)未【确认收货】,将进行确认收货预警提醒,超过10天(海外60天)未确认收货将锁单,并且每次登录都会提醒 | ||
4893 | + </span> | ||
4890 | </div> | 4894 | </div> |
4891 | - </Col> | ||
4892 | - | ||
4893 | - {/* 现有卡片: 回款待确认订单 */} | ||
4894 | - <Col span={6}> | ||
4895 | - {' '} | ||
4896 | - {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | ||
4897 | <div | 4895 | <div |
4898 | style={{ | 4896 | style={{ |
4899 | - display: 'flex', | ||
4900 | - justifyContent: 'center', | ||
4901 | - marginTop: '20px', | 4897 | + marginLeft: '20px', |
4898 | + marginRight: '20px', | ||
4899 | + marginBottom: '20px', | ||
4902 | }} | 4900 | }} |
4903 | > | 4901 | > |
4904 | - <Card | ||
4905 | - bordered={true} | ||
4906 | - style={{ | ||
4907 | - backgroundColor: '#f0f0f0', // 背景颜色 | ||
4908 | - width: '200px', // 卡片宽度 | ||
4909 | - height: '200px', // 卡片高度 | ||
4910 | - display: 'flex', | ||
4911 | - alignItems: 'center', | ||
4912 | - justifyContent: 'center', | ||
4913 | - }} | ||
4914 | - > | ||
4915 | - <div | ||
4916 | - style={{ | ||
4917 | - fontWeight: 'bold', // 字体加粗 | ||
4918 | - color: 'black', // 字体颜色 | ||
4919 | - fontSize: '18px', // 字体大小 | ||
4920 | - }} | ||
4921 | - > | ||
4922 | - <div | ||
4923 | - style={{ | ||
4924 | - fontWeight: 'bold', // 字体加粗 | ||
4925 | - color: 'black', // 字体颜色 | ||
4926 | - fontSize: '40px', // 字体大小 | ||
4927 | - justifyContent: 'center', | ||
4928 | - display: 'flex', | ||
4929 | - alignItems: 'center', | ||
4930 | - marginBottom: '20px', | ||
4931 | - }} | ||
4932 | - > | ||
4933 | - {waitConfirmPayment} | ||
4934 | - </div> | ||
4935 | - 待回款订单 | ||
4936 | - </div> | ||
4937 | - </Card> | 4902 | + <span style={{ color: 'red' }}>回访登记预警:</span> |
4903 | + <span> | ||
4904 | + 从【确认收货】之日起计算,国内超过20天(海外30天)未【回访登记】,将进行回访登记预警提醒,超过45天(海外60天)未回访登记将锁单,并且每次登录都会提醒 | ||
4905 | + </span> | ||
4906 | + </div> | ||
4907 | + <div | ||
4908 | + style={{ | ||
4909 | + marginLeft: '20px', | ||
4910 | + marginRight: '20px', | ||
4911 | + marginBottom: '20px', | ||
4912 | + }} | ||
4913 | + > | ||
4914 | + <span style={{ color: 'red' }}>确认发票预警:</span> | ||
4915 | + <span> | ||
4916 | + 从发票开出之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能 | ||
4917 | + </span> | ||
4918 | + </div> | ||
4919 | + <div | ||
4920 | + style={{ | ||
4921 | + marginLeft: '20px', | ||
4922 | + marginRight: '20px', | ||
4923 | + marginBottom: '20px', | ||
4924 | + }} | ||
4925 | + > | ||
4926 | + <span style={{ color: 'red' }}>回款预警:</span> | ||
4927 | + <span> | ||
4928 | + 从【发票确认】之日起,超过30天未确认回款的订单将会每周提醒,超过90天未确认回款的订单将会每天进行一次提醒,并限制下单功能 | ||
4929 | + </span> | ||
4938 | </div> | 4930 | </div> |
4939 | - </Col> | ||
4940 | - </Row> | ||
4941 | - | ||
4942 | - <div> | ||
4943 | - <p | ||
4944 | - style={{ | ||
4945 | - color: 'red', | ||
4946 | - paddingLeft: '20px', | ||
4947 | - paddingRight: '20px', | ||
4948 | - marginTop: '10px', | ||
4949 | - }} | ||
4950 | - > | ||
4951 | - 预警说明: | ||
4952 | - </p> | ||
4953 | - <div | ||
4954 | - style={{ | ||
4955 | - marginLeft: '20px', | ||
4956 | - marginRight: '20px', | ||
4957 | - marginBottom: '20px', | ||
4958 | - }} | ||
4959 | - > | ||
4960 | - <span style={{ color: 'red' }}>确认收货预警:</span> | ||
4961 | - <span> | ||
4962 | - 从发货之日起计算,国内超过7天(海外30天)未【确认收货】,将进行确认收货预警提醒,超过10天(海外60天)未确认收货将锁单,并且每次登录都会提醒 | ||
4963 | - </span> | ||
4964 | - </div> | ||
4965 | - <div | ||
4966 | - style={{ | ||
4967 | - marginLeft: '20px', | ||
4968 | - marginRight: '20px', | ||
4969 | - marginBottom: '20px', | ||
4970 | - }} | ||
4971 | - > | ||
4972 | - <span style={{ color: 'red' }}>回访登记预警:</span> | ||
4973 | - <span> | ||
4974 | - 从【确认收货】之日起计算,国内超过20天(海外30天)未【回访登记】,将进行回访登记预警提醒,超过45天(海外60天)未回访登记将锁单,并且每次登录都会提醒 | ||
4975 | - </span> | ||
4976 | - </div> | ||
4977 | - <div | ||
4978 | - style={{ | ||
4979 | - marginLeft: '20px', | ||
4980 | - marginRight: '20px', | ||
4981 | - marginBottom: '20px', | ||
4982 | - }} | ||
4983 | - > | ||
4984 | - <span style={{ color: 'red' }}>确认发票预警:</span> | ||
4985 | - <span> | ||
4986 | - 从发票开出之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能 | ||
4987 | - </span> | ||
4988 | - </div> | ||
4989 | - <div | ||
4990 | - style={{ | ||
4991 | - marginLeft: '20px', | ||
4992 | - marginRight: '20px', | ||
4993 | - marginBottom: '20px', | ||
4994 | - }} | ||
4995 | - > | ||
4996 | - <span style={{ color: 'red' }}>回款预警:</span> | ||
4997 | - <span> | ||
4998 | - 从【发票确认】之日起,超过30天未确认回款的订单将会每周提醒,超过90天未确认回款的订单将会每天进行一次提醒,并限制下单功能 | ||
4999 | - </span> | ||
5000 | </div> | 4931 | </div> |
5001 | - </div> | ||
5002 | - </Modal> | 4932 | + </Modal> |
4933 | + )} | ||
5003 | <ProTable | 4934 | <ProTable |
5004 | id="main-table" | 4935 | id="main-table" |
5005 | // tableStyle={{backgroundColor:'red'}} | 4936 | // tableStyle={{backgroundColor:'red'}} |
src/pages/Order/OrderWarning/index.tsx
@@ -4119,22 +4119,22 @@ const OrderPage = () => { | @@ -4119,22 +4119,22 @@ const OrderPage = () => { | ||
4119 | //选择天数1 | 4119 | //选择天数1 |
4120 | const options1 = [ | 4120 | const options1 = [ |
4121 | { | 4121 | { |
4122 | - label: '超过15天', | ||
4123 | - value: 15, | 4122 | + label: '超过7天', |
4123 | + value: 7, | ||
4124 | }, | 4124 | }, |
4125 | { | 4125 | { |
4126 | - label: '超过30天', | ||
4127 | - value: 30, | 4126 | + label: '超过10天', |
4127 | + value: 10, | ||
4128 | }, | 4128 | }, |
4129 | ]; | 4129 | ]; |
4130 | const options2 = [ | 4130 | const options2 = [ |
4131 | { | 4131 | { |
4132 | - label: '超过15天', | ||
4133 | - value: 15, | 4132 | + label: '超过20天', |
4133 | + value: 20, | ||
4134 | }, | 4134 | }, |
4135 | { | 4135 | { |
4136 | - label: '超过30天', | ||
4137 | - value: 30, | 4136 | + label: '超过45天', |
4137 | + value: 45, | ||
4138 | }, | 4138 | }, |
4139 | ]; | 4139 | ]; |
4140 | const options3 = [ | 4140 | const options3 = [ |
@@ -4143,8 +4143,8 @@ const OrderPage = () => { | @@ -4143,8 +4143,8 @@ const OrderPage = () => { | ||
4143 | value: 5, | 4143 | value: 5, |
4144 | }, | 4144 | }, |
4145 | { | 4145 | { |
4146 | - label: '超过10天', | ||
4147 | - value: 10, | 4146 | + label: '超过15天', |
4147 | + value: 15, | ||
4148 | }, | 4148 | }, |
4149 | ]; | 4149 | ]; |
4150 | const options4 = [ | 4150 | const options4 = [ |
@@ -4177,6 +4177,14 @@ const OrderPage = () => { | @@ -4177,6 +4177,14 @@ const OrderPage = () => { | ||
4177 | setCalDate(formattedDate); | 4177 | setCalDate(formattedDate); |
4178 | setValue1(value); | 4178 | setValue1(value); |
4179 | }; | 4179 | }; |
4180 | + function setOriginTime(value) { | ||
4181 | + const currentDate = new Date(); | ||
4182 | + // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 | ||
4183 | + const newDate = new Date(currentDate); | ||
4184 | + newDate.setDate(currentDate.getDate() - value); | ||
4185 | + const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss'); | ||
4186 | + return formattedDate; | ||
4187 | + } | ||
4180 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); | 4188 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); |
4181 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); | 4189 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); |
4182 | const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); | 4190 | const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); |
@@ -4205,6 +4213,10 @@ const OrderPage = () => { | @@ -4205,6 +4213,10 @@ const OrderPage = () => { | ||
4205 | const res = await postServiceOrderWarningOrderStatistics({ | 4213 | const res = await postServiceOrderWarningOrderStatistics({ |
4206 | data: { | 4214 | data: { |
4207 | salesCode: staticSalesCode, | 4215 | salesCode: staticSalesCode, |
4216 | + waitConfirmReiceptStatusDateTimeLe: setOriginTime(options1[0].value), | ||
4217 | + waitFeedbackStatusDateTimeLe: setOriginTime(options2[0].value), | ||
4218 | + waitConfirmInvoiceStatusDateTimeLe: setOriginTime(options3[0].value), | ||
4219 | + waitConfirmPaymentStatusDateTimeLe: setOriginTime(options4[0].value), | ||
4208 | }, | 4220 | }, |
4209 | }); | 4221 | }); |
4210 | setInvoiceWarningNum(res.data.waitConfirmInvoice); | 4222 | setInvoiceWarningNum(res.data.waitConfirmInvoice); |
@@ -4234,12 +4246,43 @@ const OrderPage = () => { | @@ -4234,12 +4246,43 @@ const OrderPage = () => { | ||
4234 | mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** | 4246 | mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** |
4235 | }, [activeTabKey]); | 4247 | }, [activeTabKey]); |
4236 | // 修改位置:监听 value1 的变化 | 4248 | // 修改位置:监听 value1 的变化 |
4249 | + // useEffect(() => { | ||
4250 | + // // if (value1 === 0) { | ||
4251 | + // // // 这里执行你希望在 value1 为 0 时的逻辑 | ||
4252 | + // // mainTableRef.current?.reload(); // 重新请求数据 | ||
4253 | + // // } | ||
4254 | + | ||
4255 | + // }, [value1]); // 添加了 value1 作为依赖 | ||
4256 | + | ||
4237 | useEffect(() => { | 4257 | useEffect(() => { |
4238 | - if (value1 === 0) { | ||
4239 | - // 这里执行你希望在 value1 为 0 时的逻辑 | ||
4240 | - mainTableRef.current?.reload(); // 重新请求数据 | 4258 | + // 根据 activeTabKey 设置 value1 为当前选项组的第一个 value |
4259 | + let options; | ||
4260 | + switch (activeTabKey) { | ||
4261 | + case 1: | ||
4262 | + options = options1; | ||
4263 | + break; | ||
4264 | + case 2: | ||
4265 | + options = options2; | ||
4266 | + break; | ||
4267 | + case 3: | ||
4268 | + options = options3; | ||
4269 | + break; | ||
4270 | + case 4: | ||
4271 | + options = options4; | ||
4272 | + break; | ||
4273 | + default: | ||
4274 | + options = []; // 如果没有匹配的选项组,默认为空 | ||
4241 | } | 4275 | } |
4242 | - }, [value1]); // 添加了 value1 作为依赖 | 4276 | + |
4277 | + const firstOptionValue = options[0]?.value || 0; // 获取第一个值 | ||
4278 | + setValue1(firstOptionValue); | ||
4279 | + const currentDate = new Date(); | ||
4280 | + // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 | ||
4281 | + const newDate = new Date(currentDate); | ||
4282 | + newDate.setDate(currentDate.getDate() - firstOptionValue); | ||
4283 | + const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss'); | ||
4284 | + setCalDate(formattedDate); | ||
4285 | + }, [activeTabKey]); | ||
4243 | //biaojidown2 | 4286 | //biaojidown2 |
4244 | //取消单选,将时间设为null | 4287 | //取消单选,将时间设为null |
4245 | const handleSetNull = () => { | 4288 | const handleSetNull = () => { |
@@ -4473,8 +4516,8 @@ const OrderPage = () => { | @@ -4473,8 +4516,8 @@ const OrderPage = () => { | ||
4473 | // params.applyTimeIsNotNull = true; // 要求申请时间非空 | 4516 | // params.applyTimeIsNotNull = true; // 要求申请时间非空 |
4474 | params.orderStatus = 'SHIPPED'; // 发票确认预警 | 4517 | params.orderStatus = 'SHIPPED'; // 发票确认预警 |
4475 | params.isDeleteQueryOrder = false; // 强制查询非作废订单 | 4518 | params.isDeleteQueryOrder = false; // 强制查询非作废订单 |
4476 | - console.log(userInfo, '5656userInfo'); | ||
4477 | params.salesCode = userInfo.username; | 4519 | params.salesCode = userInfo.username; |
4520 | + params.warningStatus = 'waitConfirmReicept'; | ||
4478 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { | 4521 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { |
4479 | params.salesCode = salesCodeSelect; | 4522 | params.salesCode = salesCodeSelect; |
4480 | } | 4523 | } |
@@ -4523,11 +4566,6 @@ const OrderPage = () => { | @@ -4523,11 +4566,6 @@ const OrderPage = () => { | ||
4523 | }; | 4566 | }; |
4524 | } else if (activeTabKey === 4) { | 4567 | } else if (activeTabKey === 4) { |
4525 | params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警 | 4568 | params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警 |
4526 | - if (calDate === 'null') { | ||
4527 | - params.applyTimeLe = null; | ||
4528 | - } else { | ||
4529 | - params.applyTimeLe = calDate; | ||
4530 | - } | ||
4531 | params.salesCode = userInfo.username; | 4569 | params.salesCode = userInfo.username; |
4532 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { | 4570 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { |
4533 | params.salesCode = salesCodeSelect; | 4571 | params.salesCode = salesCodeSelect; |
@@ -4536,6 +4574,7 @@ const OrderPage = () => { | @@ -4536,6 +4574,7 @@ const OrderPage = () => { | ||
4536 | params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 | 4574 | params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 |
4537 | finalParams = { | 4575 | finalParams = { |
4538 | ...params, | 4576 | ...params, |
4577 | + applyTimeLe: calDate, | ||
4539 | }; | 4578 | }; |
4540 | } | 4579 | } |
4541 | //保存这个搜索条件 | 4580 | //保存这个搜索条件 |