Commit 239881537c50284911bd40a443eb9a73165bfc2a

Authored by boyang
1 parent 07a17e98

fix: 弹窗跳转一次

.umirc.ts
... ... @@ -14,7 +14,7 @@ export default defineConfig({
14 14 },
15 15 proxy: {
16 16 '/api/': {
17   - target: 'http://localhost:8085/',
  17 + target: 'http://localhost:8086/',
18 18 // target: 'http://192.168.1.6:8085/',
19 19 // target: 'http://39.108.227.113:8085/',
20 20 changeOrigin: true,
... ...
src/models/count.ts
... ... @@ -2,7 +2,7 @@
2 2 import { useState } from 'react';
3 3  
4 4 const useOpenModal = () => {
5   - const [openCount, setOpenCount] = useState<number>();
  5 + const [openCount, setOpenCount] = useState<number>(0);
6 6 return {
7 7 openCount,
8 8 setOpenCount,
... ...
src/pages/Order/Order/index.tsx
... ... @@ -128,6 +128,8 @@ import ShippingWarehouseChangeModal from &#39;./components/ShippingWarehouseChangeMo
128 128 import UploadPayBillModal from './components/UploadPayBillModal';
129 129 import './index.less';
130 130 import { OrderListItemType, OrderType } from './type.d';
  131 +// import { useNavigate } from 'react-router-dom';
  132 +import { history } from '@umijs/max';
131 133  
132 134 const OrderPage = () => {
133 135 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
... ... @@ -212,6 +214,7 @@ const OrderPage = () =&gt; {
212 214 const [ids, setIds] = useState([]);
213 215 const [recordOptNode, setRecordOptNode] = useState(null);
214 216 const roleCode = userInfo?.roleSmallVO?.code;
  217 + // const navigate = useNavigate();
215 218 const canMergeInvoicing = useMemo(() => {
216 219 if (subOrderSelectedMap.size === 0) {
217 220 return false;
... ... @@ -4517,17 +4520,18 @@ const OrderPage = () =&gt; {
4517 4520 }
4518 4521 const [invoiceWarningNum, setInvoiceWarningNum] = useState(0);
4519 4522 const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0);
4520   - const [open, setOpen] = useState(true);
  4523 + const [open, setOpen] = useState(false);
4521 4524 const { openCount, setOpenCount } = useModel('count');
4522 4525 async function getInvoiceWarningNum() {
4523 4526 const res = await postServiceOrderWarningOrderStatistics();
4524 4527 if (
4525 4528 (res.data.waitConfirmInvoice !== 0 ||
4526 4529 res.data.waitConfirmReceipt !== 0) &&
4527   - openCount !== 1
  4530 + openCount !== true
4528 4531 ) {
  4532 + setOpenCount(true);
4529 4533 setOpen(true);
4530   - setOpenCount(1);
  4534 + console.log(openCount, '5656openindex');
4531 4535 }
4532 4536 setInvoiceWarningNum(res.data.waitConfirmInvoice);
4533 4537 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
... ... @@ -4536,10 +4540,15 @@ const OrderPage = () =&gt; {
4536 4540 //预警订单数
4537 4541 getInvoiceWarningNum();
4538 4542 }, []);
4539   - //隐藏弹窗
4540   - const hideModal = () => {
  4543 + // 隐藏弹窗
  4544 + const navigateToWarning = () => {
4541 4545 setOpen(false);
4542   - window.location.href = '/order/OrderWarning';
  4546 + // history.push('/order/OrderWarning');
  4547 + // window.location.replace = '/order/OrderWarning';
  4548 + // navigate('/order/OrderWarning');
  4549 + history.push('/order/OrderWarning');
  4550 + // location.href = '/order/OrderWarning';
  4551 + // history.pushState(null, '', '/order/OrderWarning');
4543 4552 };
4544 4553 return (
4545 4554 <div className="order-page-container">
... ... @@ -4551,7 +4560,12 @@ const OrderPage = () =&gt; {
4551 4560 width={800}
4552 4561 closable={false}
4553 4562 footer={[
4554   - <Button key="confirm" size="large" type="primary" onClick={hideModal}>
  4563 + <Button
  4564 + key="confirm"
  4565 + size="large"
  4566 + type="primary"
  4567 + onClick={navigateToWarning}
  4568 + >
4555 4569 去处理
4556 4570 </Button>,
4557 4571 ]}
... ... @@ -4653,10 +4667,10 @@ const OrderPage = () =&gt; {
4653 4667 <div style={{ color: 'red', padding: '40px' }}>
4654 4668 <p>预警说明:</p>
4655 4669 <p>
4656   - 1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能
  4670 + 1、从申请开票之日起,超过5天未【确认发票】的订单在登录时进行第一次提醒,超过15天未【确认发票】将进行每日提醒并锁单。
4657 4671 </p>
4658 4672 <p>
4659   - 2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能
  4673 + 2、从【确认发票】之日起,超过15天未【回款】的订单在账号登录时会进行第一次提醒,超过25天未【回款】将进行每日提醒并锁单。
4660 4674 </p>
4661 4675 </div>
4662 4676 </Modal>
... ...