Commit 991063b860f27316b216f48984c8f5181d842baf

Authored by 曾国涛
1 parent b9d8e000

feat(Order): 增加官网订单支付状态变更提示

- 在订单抽屉中添加关于官网订单支付状态的提示信息
- 当订单状态从已付款改为其他状态时,提示用户这将影响财务模块的自动核销
- 当订单状态改为已付款时,提示用户该订单将在财务模块中自动核销
- 优化了支付方式选择框的显示逻辑
src/pages/Order/Order/components/OrderDrawer.tsx
... ... @@ -28,6 +28,7 @@ import {
28 28 import { getTeacherCustomFieldNumber } from '@/utils/kingdee';
29 29 import { getSalesCodeOptions } from '@/utils/order';
30 30 import { getDefaultString } from '@/utils/StringUtil';
  31 +import { ExclamationCircleOutlined } from '@ant-design/icons';
31 32 import {
32 33 DrawerForm,
33 34 FormListActionType,
... ... @@ -67,6 +68,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
67 68 useState(false);
68 69 const [paymentMethod, setPaymentMethod] = useState('');
69 70 const [customerRequestCount, setCustomerRequestCount] = useState(0);
  71 + const [hasOfficialWebsiteOrderPaid, setHasOfficialWebsiteOrderPaid] =
  72 + useState(false);
70 73 const [
71 74 productParametersDisabledFlagList,
72 75 setProductParametersDisabledFlagList,
... ... @@ -74,6 +77,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
74 77 // const [productInvStockOptionsList, setProductInvStockOptionsList] = useState(
75 78 // [],
76 79 // ); //商品的仓库选项
  80 +
77 81 const [productUnitOptionsList, setProductUnitOptionsList] = useState([]); //商品的单位选项
78 82 //省市区
79 83 const [province, setProvince] = useState('');
... ... @@ -773,6 +777,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
773 777 }
774 778  
775 779 useEffect(() => {
  780 + const hasOfficialWebsiteOrderPaidstatus = subOrders.some(
  781 + (subOrder) =>
  782 + subOrder.paymentMethod === 'OFFICIAL_WEBSITE_ORDER_HAS_BEEN_PAID',
  783 + );
  784 + setHasOfficialWebsiteOrderPaid(hasOfficialWebsiteOrderPaidstatus);
776 785 checkHasLocalData();
777 786 loadSalesCodeOptions();
778 787 if (optType('after-sales-check')) {
... ... @@ -1484,6 +1493,22 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
1484 1493 rules={[{ required: true, message: '支付方式必填' }]}
1485 1494 disabled={optType('after-sales-check')}
1486 1495 />
  1496 + {hasOfficialWebsiteOrderPaid &&
  1497 + paymentMethod !== 'OFFICIAL_WEBSITE_ORDER_HAS_BEEN_PAID' && (
  1498 + <>
  1499 + <span style={{ fontSize: '14px', color: 'orange' }}>
  1500 + <ExclamationCircleOutlined style={{ color: 'orange' }} />
  1501 + 【官网订单已付款】改为其他状态代表该订单未收到款,财务模块对这笔订单将不再自动核销,请确认后修改。
  1502 + </span>
  1503 + </>
  1504 + )}
  1505 + {!hasOfficialWebsiteOrderPaid &&
  1506 + paymentMethod === 'OFFICIAL_WEBSITE_ORDER_HAS_BEEN_PAID' && (
  1507 + <span style={{ fontSize: '14px', color: 'orange' }}>
  1508 + <ExclamationCircleOutlined style={{ color: 'orange' }} />
  1509 + 【官网订单已付款】的订单后续在财务模块中将自动核销,请确认该订单是否收到款,再选择这个状态。
  1510 + </span>
  1511 + )}
1487 1512 <ProFormSelect
1488 1513 name="prepaidUid"
1489 1514 key="prepaidUid"
... ...
src/pages/Order/Order/index.tsx
... ... @@ -3535,14 +3535,14 @@ const OrderPage = () =&gt; {
3535 3535 }
3536 3536 } else {
3537 3537 //仓库管理员只能编辑是还未审核的订单
3538   - if (
  3538 + /*if (
3539 3539 roleCode !== 'admin' &&
3540 3540 (orderStatus === 'UNAUDITED' ||
3541 3541 orderStatus === 'AUDIT_FAILED')
3542 3542 ) {
3543 3543 message.error('请选择已审核的订单进行编辑');
3544 3544 return;
3545   - }
  3545 + }*/
3546 3546 }
3547 3547 }
3548 3548  
... ...
src/pages/Order/OrderWarning/components/OrderDrawer.tsx
... ... @@ -56,7 +56,7 @@ import KingdeeCustomerModal from &#39;./KingdeeCustomerModal&#39;;
56 56  
57 57 export default ({ onClose, data, subOrders, orderOptType }) => {
58 58 const [invoicingStatus, setInvoicingStatus] = useState('');
59   - const [salesCodeOptions, setSalesCodeOptions] = useState([]);
  59 + const [salesCodeOptions] = useState([]);
60 60 const [submitBtnLoading, setSubmitBtnLoading] = useState(false);
61 61 const [drawerTitle, setDrawerTitle] = useState('');
62 62 const [hasLocalData, setHasLocalData] = useState(false);
... ... @@ -134,8 +134,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
134 134 */
135 135 const loadSalesCodeOptions = async () => {
136 136 let options = await getSalesCodeOptions();
137   - setSalesCodeOptions(options);
138   -
  137 + console.log('options ', JSON.stringify(options));
139 138 if (optType('copy') || optType('edit')) {
140 139 let includeFlag = false;
141 140 //销售代码校验,如果是旧的销售代码,则提示并清空
... ...