Commit 991063b860f27316b216f48984c8f5181d842baf

Authored by 曾国涛
1 parent b9d8e000

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

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