Commit 2de89892d52d07a94375ad89636142af726b2ddd

Authored by 曾国涛
1 parent e98e44a6

fix: 修改订单预警params

.umirc.ts
... ... @@ -56,6 +56,7 @@ export default defineConfig({
56 56 {
57 57 name: '预警白名单',
58 58 path: 'WarningWhitelist',
  59 + access: 'canReadAdminAndSalesManager',
59 60 component: './Order/WarningWhitelist',
60 61 },
61 62 ],
... ...
src/access.ts
1 1 export default (initialState: API.UserInfo) => {
2 2 // 在这里按照初始化数据定义项目中的权限,统一管理
3 3 // 参考文档 https://umijs.org/docs/max/access
4   - const { roleSmallVO, username, roles } = initialState;
  4 + const { username, roles } = initialState;
5 5  
6   - const canReadAdmin = roleSmallVO?.code === 'admin';
  6 + const canReadAdmin = roles?.includes('ADMIN');
7 7 const canReadProcure =
8   - roleSmallVO?.code === 'procure' || roles?.includes('PROCURE_MANAGER');
9   - const canReadFinance = roleSmallVO?.code === 'finance';
10   - const canReadWarehouseKeeper = roleSmallVO?.code === 'warehouseKeeper';
  8 + roles?.includes('PROCURE') || roles?.includes('PROCURE_MANAGER');
  9 + const canReadFinance = roles?.includes('FINANCE');
  10 + const canReadWarehouseKeeper = roles.includes('WAREHOUSE_KEEPER');
11 11 const canReadSales =
12   - roleSmallVO?.code === 'salesManager' ||
13   - roleSmallVO?.code === 'salesRepresentative';
  12 + roles.includes('SALES_MANAGER') || roles.includes('SALES_REPRESENTATIVE');
  13 + const canReadSalesManager = roles.includes('SALES_MANAGER');
14 14 return {
15 15 canReadAdmin: canReadAdmin,
16 16 canReadProcure: canReadProcure || canReadAdmin,
... ... @@ -22,5 +22,6 @@ export default (initialState: API.UserInfo) => {
22 22 canReadAdminAndSales: canReadAdmin || canReadSales,
23 23 canReadAdminAndWarehouseKeeperAndProcure:
24 24 canReadWarehouseKeeper || canReadAdmin || canReadProcure,
  25 + canReadAdminAndSalesManager: canReadAdmin || canReadSalesManager,
25 26 };
26 27 };
... ...
src/pages/Order/Order/index.tsx
... ... @@ -18,7 +18,6 @@ import {
18 18 postServiceOrderProcurePrint,
19 19 postServiceOrderProvideProcurementRoles,
20 20 postServiceOrderQueryServiceOrder,
21   - postServiceOrderWarningOrderStatistics,
22 21 postServiceOrderSaleCancelInvoicing,
23 22 postServiceOrderSalesConfirm,
24 23 } from '@/services';
... ... @@ -61,9 +60,7 @@ import {
61 60 } from '@ant-design/pro-components';
62 61 import {
63 62 Button,
64   - Card,
65 63 Checkbox,
66   - Col,
67 64 Divider,
68 65 Dropdown,
69 66 Flex,
... ... @@ -73,7 +70,6 @@ import {
73 70 Modal,
74 71 Popconfirm,
75 72 Radio,
76   - Row,
77 73 Space,
78 74 Spin,
79 75 Tag,
... ... @@ -84,6 +80,25 @@ import Base64 from 'base-64';
84 80 import { cloneDeep } from 'lodash';
85 81 import React, { Key, useEffect, useMemo, useRef, useState } from 'react';
86 82 import OrderPrintModal from '../../OrderPrint/OrderPrintModal';
  83 +import {
  84 + AFTER_INVOICING_STATUS,
  85 + CHECK_TYPE,
  86 + LOGISTICS_STATUS_OPTIONS,
  87 + MAIN_ORDER_COLUMNS,
  88 + MODIFIED_AUDIT_STATUS_OPTIONS,
  89 + ORDER_STATUS_OPTIONS,
  90 + PAYEE_OPTIONS,
  91 + PAYMENT_CHANNEL_OPTIONS,
  92 + PAYMENT_RECEIPTS_STATUS_OPTIONS,
  93 + POST_AUDIT_OPTIONS,
  94 + PROCURE_ORDER_STATUS,
  95 + PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
  96 + PRODUCT_BELONG_DEPARTMENT_OPTIONS,
  97 + SHIPPING_WAREHOUSE_OPTIONS,
  98 + TAGS_COLOR,
  99 + getInvoicingType,
  100 + getNeedInvoicing,
  101 +} from '../constant';
87 102 import AfterSalesDrawer from './components/AfterSalesDrawer';
88 103 import ApplyForInvoicingModal from './components/ApplyForInvoicingModal';
89 104 import AttachmentModal from './components/AttachmentModal';
... ... @@ -106,25 +121,6 @@ import ProcureConvertModal from './components/ProcureConvertModal';
106 121 import ProductionTimeModal from './components/ProductionTimeModal';
107 122 import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal';
108 123 import UploadPayBillModal from './components/UploadPayBillModal';
109   -import {
110   - AFTER_INVOICING_STATUS,
111   - CHECK_TYPE,
112   - LOGISTICS_STATUS_OPTIONS,
113   - MAIN_ORDER_COLUMNS,
114   - MODIFIED_AUDIT_STATUS_OPTIONS,
115   - ORDER_STATUS_OPTIONS,
116   - PAYEE_OPTIONS,
117   - PAYMENT_CHANNEL_OPTIONS,
118   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
119   - POST_AUDIT_OPTIONS,
120   - PROCURE_ORDER_STATUS,
121   - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
122   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
123   - SHIPPING_WAREHOUSE_OPTIONS,
124   - TAGS_COLOR,
125   - getInvoicingType,
126   - getNeedInvoicing,
127   -} from '../constant';
128 124 import './index.less';
129 125 import { OrderListItemType, OrderType } from './type.d';
130 126  
... ... @@ -835,7 +831,7 @@ const OrderPage = () => {
835 831 onConfirm={() => {
836 832 window.open(
837 833 '/previewApi/onlinePreview?url=' +
838   - encodeURIComponent(Base64.encode(item.url)),
  834 + encodeURIComponent(Base64.encode(item.url)),
839 835 );
840 836 }}
841 837 onCancel={() => {
... ... @@ -907,7 +903,7 @@ const OrderPage = () => {
907 903 </span>
908 904 {(roleCode === 'salesRepresentative' ||
909 905 roleCode === 'salesManager') &&
910   - !optRecord.isCurrentUserOrder ? (
  906 + !optRecord.isCurrentUserOrder ? (
911 907 <span className="text-[#f44e4e]">(非本账号订单)</span>
912 908 ) : (
913 909 ''
... ... @@ -1091,13 +1087,13 @@ const OrderPage = () =&gt; {
1091 1087 <Tooltip
1092 1088 title={
1093 1089 optRecord.invoicingUrgentCause !== null &&
1094   - optRecord.afterInvoicingStatus ===
  1090 + optRecord.afterInvoicingStatus ===
1095 1091 'URGENT_INVOICE_AUDITING'
1096 1092 ? optRecord.invoicingUrgentCause
1097 1093 : enumValueToLabel(
1098   - optRecord.afterInvoicingStatus,
1099   - AFTER_INVOICING_STATUS,
1100   - )
  1094 + optRecord.afterInvoicingStatus,
  1095 + AFTER_INVOICING_STATUS,
  1096 + )
1101 1097 }
1102 1098 >
1103 1099 <Tag
... ... @@ -1128,7 +1124,7 @@ const OrderPage = () =&gt; {
1128 1124 )}
1129 1125  
1130 1126 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1131   - optRecord.shippingWarehouse !== null ? (
  1127 + optRecord.shippingWarehouse !== null ? (
1132 1128 <div
1133 1129 className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1134 1130 title={enumValueToLabel(
... ... @@ -1150,7 +1146,7 @@ const OrderPage = () =&gt; {
1150 1146 {/* 生产时间 */}
1151 1147 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1152 1148 {optRecord.productionStartTime !== null ||
1153   - optRecord.productionEndTime !== null ? (
  1149 + optRecord.productionEndTime !== null ? (
1154 1150 <MyToolTip
1155 1151 title={
1156 1152 formatdate(optRecord.productionStartTime) +
... ... @@ -1180,7 +1176,7 @@ const OrderPage = () =&gt; {
1180 1176 <Tag
1181 1177 color={
1182 1178 optRecord.invoicingTime === null ||
1183   - optRecord.invoicingTime === undefined
  1179 + optRecord.invoicingTime === undefined
1184 1180 ? TAGS_COLOR.get(optRecord.invoicingStatus)
1185 1181 : 'success'
1186 1182 }
... ... @@ -1197,6 +1193,13 @@ const OrderPage = () =&gt; {
1197 1193 {getOrderStatusTag(optRecord)}
1198 1194 </div>
1199 1195  
  1196 + {/* 确认发票状态 */}
  1197 + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
  1198 + <Tag color={'success'} style={{ marginRight: '4px' }}>
  1199 + {optRecord.invoiceConfirmStatusText}
  1200 + </Tag>
  1201 + </div>
  1202 +
1200 1203 {/* 后置审核状态 */}
1201 1204 {optRecord.postAuditStatus !== null ? (
1202 1205 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
... ... @@ -1208,7 +1211,7 @@ const OrderPage = () =&gt; {
1208 1211  
1209 1212 {/**采购是否已下单状态 */}
1210 1213 {optRecord.procureOrderStatus !== null &&
1211   - optRecord.procureOrderStatus !== undefined ? (
  1214 + optRecord.procureOrderStatus !== undefined ? (
1212 1215 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1213 1216 <Tag color="success">
1214 1217 {enumValueToLabel(
... ... @@ -1224,21 +1227,21 @@ const OrderPage = () =&gt; {
1224 1227 {/* 物流信息 */}
1225 1228 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1226 1229 {optRecord.orderStatus === 'CONFIRM_RECEIPT' ||
1227   - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
1228   - optRecord.orderStatus === 'IN_AFTER_SALES' ||
1229   - optRecord.orderStatus === 'SHIPPED' ? (
  1230 + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
  1231 + optRecord.orderStatus === 'IN_AFTER_SALES' ||
  1232 + optRecord.orderStatus === 'SHIPPED' ? (
1230 1233 <MyToolTip
1231 1234 title={
1232 1235 optRecord.serialNumber === undefined
1233 1236 ? '暂无物流信息'
1234 1237 : enumValueToLabel(
1235   - optRecord.logisticsMethod,
1236   - LOGISTICS_STATUS_OPTIONS,
1237   - ) +
1238   - ' ' +
1239   - optRecord.serialNumber +
1240   - ' ' +
1241   - optRecord.logisticsNotes
  1238 + optRecord.logisticsMethod,
  1239 + LOGISTICS_STATUS_OPTIONS,
  1240 + ) +
  1241 + ' ' +
  1242 + optRecord.serialNumber +
  1243 + ' ' +
  1244 + optRecord.logisticsNotes
1242 1245 }
1243 1246 content={
1244 1247 <Button type="link" size="small" style={{ padding: 0 }}>
... ... @@ -1252,7 +1255,7 @@ const OrderPage = () =&gt; {
1252 1255  
1253 1256 {/* 修改审核状态 */}
1254 1257 {optRecord.modifiedAuditStatus !== null &&
1255   - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
  1258 + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1256 1259 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1257 1260 <Tooltip
1258 1261 title={recordOptNode ? recordOptNode : <Spin />}
... ... @@ -1692,7 +1695,7 @@ const OrderPage = () =&gt; {
1692 1695 )}
1693 1696  
1694 1697 {optRecord.paths?.includes('queryAnnex') &&
1695   - optRecord.listAnnex?.length > 0 ? (
  1698 + optRecord.listAnnex?.length > 0 ? (
1696 1699 <Button
1697 1700 className="p-0"
1698 1701 type="link"
... ... @@ -2145,7 +2148,7 @@ const OrderPage = () =&gt; {
2145 2148 </Flex>
2146 2149  
2147 2150 {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) &&
2148   - !isSupplier() ? (
  2151 + !isSupplier() ? (
2149 2152 <div className="pt-2">
2150 2153 <Flex title={optRecord.supplierName}>
2151 2154 <div>
... ... @@ -2220,7 +2223,7 @@ const OrderPage = () =&gt; {
2220 2223 <span className="text-[#8C8C8C]">
2221 2224 申请开票备注:
2222 2225 {optRecord.applyInvoicingNotes === undefined ||
2223   - optRecord.applyInvoicingNotes === null
  2226 + optRecord.applyInvoicingNotes === null
2224 2227 ? '暂无备注'
2225 2228 : optRecord.applyInvoicingNotes}
2226 2229 </span>
... ... @@ -2248,7 +2251,7 @@ const OrderPage = () =&gt; {
2248 2251 <span className="text-[#8C8C8C] mr-3">
2249 2252 财务审核备注:
2250 2253 {optRecord.checkNotes === undefined ||
2251   - optRecord.checkNotes === null
  2254 + optRecord.checkNotes === null
2252 2255 ? '暂无备注'
2253 2256 : optRecord.checkNotes}
2254 2257 </span>
... ... @@ -2272,7 +2275,7 @@ const OrderPage = () =&gt; {
2272 2275 <span className="text-[#8C8C8C]">
2273 2276 重新开票备注:
2274 2277 {optRecord.reissueNotes === undefined ||
2275   - optRecord.reissueNotes === null
  2278 + optRecord.reissueNotes === null
2276 2279 ? '暂无备注'
2277 2280 : optRecord.reissueNotes}
2278 2281 </span>
... ... @@ -2576,9 +2579,9 @@ const OrderPage = () =&gt; {
2576 2579 <span className="text-slate-700">
2577 2580 {record.receivingCompany !== null
2578 2581 ? enumValueToLabel(
2579   - record.receivingCompany,
2580   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2581   - )
  2582 + record.receivingCompany,
  2583 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  2584 + )
2582 2585 : '暂无'}
2583 2586 </span>
2584 2587 </div>
... ... @@ -3370,9 +3373,9 @@ const OrderPage = () =&gt; {
3370 3373 for (let i = 0; i < selectedSubOrders.length; i++) {
3371 3374 if (
3372 3375 selectedSubOrders[i].invoicingStatus ===
3373   - 'UN_INVOICE' ||
  3376 + 'UN_INVOICE' ||
3374 3377 selectedSubOrders[i].afterInvoicingStatus ===
3375   - 'APPLY_FOR_INVOICING'
  3378 + 'APPLY_FOR_INVOICING'
3376 3379 ) {
3377 3380 message.error(
3378 3381 '请选择需要开票且未申请开票的子订单进行申请',
... ... @@ -3407,9 +3410,9 @@ const OrderPage = () =&gt; {
3407 3410 for (let i = 0; i < selectedSubOrders.length; i++) {
3408 3411 if (
3409 3412 selectedSubOrders[i].invoicingStatus ===
3410   - 'UN_INVOICE' ||
  3413 + 'UN_INVOICE' ||
3411 3414 selectedSubOrders[i].afterInvoicingStatus ===
3412   - 'APPLY_FOR_INVOICING'
  3415 + 'APPLY_FOR_INVOICING'
3413 3416 ) {
3414 3417 message.error(
3415 3418 '请选择需要开票且未申请开票的子订单进行申请',
... ... @@ -3600,13 +3603,13 @@ const OrderPage = () =&gt; {
3600 3603 if (
3601 3604 selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3602 3605 selectedSubOrders[i].orderStatus !==
3603   - 'PROCURE_PROCESS' &&
  3606 + 'PROCURE_PROCESS' &&
3604 3607 selectedSubOrders[i].orderStatus !==
3605   - 'PROCURE_PROCESS_FOR_MINE' &&
  3608 + 'PROCURE_PROCESS_FOR_MINE' &&
3606 3609 selectedSubOrders[i].orderStatus !==
3607   - 'PROCURE_WAIT_SHIP' &&
  3610 + 'PROCURE_WAIT_SHIP' &&
3608 3611 selectedSubOrders[i].orderStatus !==
3609   - 'SUPPLIER_WAIT_SHIP' &&
  3612 + 'SUPPLIER_WAIT_SHIP' &&
3610 3613 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3611 3614 ) {
3612 3615 message.error(
... ... @@ -3692,9 +3695,9 @@ const OrderPage = () =&gt; {
3692 3695 if (
3693 3696 selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3694 3697 selectedSubOrders[i].orderStatus !==
3695   - 'FINANCE_PROCESS' &&
  3698 + 'FINANCE_PROCESS' &&
3696 3699 selectedSubOrders[i].orderStatus !==
3697   - 'LEADER_AUDITED'
  3700 + 'LEADER_AUDITED'
3698 3701 ) {
3699 3702 message.error(
3700 3703 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
... ... @@ -3762,9 +3765,9 @@ const OrderPage = () =&gt; {
3762 3765 for (let i = 0; i < selectedSubOrders.length; i++) {
3763 3766 if (
3764 3767 selectedSubOrders[i].orderStatus !==
3765   - 'CONFIRM_RECEIPT' &&
  3768 + 'CONFIRM_RECEIPT' &&
3766 3769 selectedSubOrders[i].orderStatus !==
3767   - 'AFTER_SALES_FAILURE'
  3770 + 'AFTER_SALES_FAILURE'
3768 3771 ) {
3769 3772 message.error('请选择确认收货状态的子订单进行售后');
3770 3773 return;
... ... @@ -4250,7 +4253,7 @@ const OrderPage = () =&gt; {
4250 4253  
4251 4254 const exportMenuProps = {
4252 4255 items: exportItems,
4253   - onClick: () => { },
  4256 + onClick: () => {},
4254 4257 };
4255 4258  
4256 4259 //一键审核按钮配置
... ... @@ -4296,7 +4299,7 @@ const OrderPage = () =&gt; {
4296 4299  
4297 4300 const auditProps = {
4298 4301 items: auditItems,
4299   - onClick: () => { },
  4302 + onClick: () => {},
4300 4303 };
4301 4304  
4302 4305 if (rolePath?.includes('leaderMergeAudit')) {
... ... @@ -4417,8 +4420,8 @@ const OrderPage = () =&gt; {
4417 4420 if (errorIds.size > 0) {
4418 4421 message.error(
4419 4422 '订单号为:' +
4420   - [...errorIds.values()].join(',') +
4421   - '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!',
  4423 + [...errorIds.values()].join(',') +
  4424 + '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!',
4422 4425 );
4423 4426 return;
4424 4427 }
... ... @@ -4505,119 +4508,10 @@ const OrderPage = () =&gt; {
4505 4508  
4506 4509 return toolBtns;
4507 4510 }
4508   - const [invoiceWarningNum, setInvoiceWarningNum] = useState(0);
4509   - const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0);
4510   - async function getInvoiceWarningNum() {
4511   - const res = await postServiceOrderWarningOrderStatistics();
4512   - setInvoiceWarningNum(res.data.waitConfirmInvoice);
4513   - setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
4514   - }
4515   -
4516   - const [open, setOpen] = useState(false);
4517   - useEffect(() => {
4518   - //预警订单数
4519   - getInvoiceWarningNum();
4520   - if (invoiceWarningNum !== 0 || invoiceRefundWarningNum !== 0) {
4521   - setOpen(true);
4522   - }
4523   - }, []);
4524   - //隐藏弹窗
4525   - const hideModal = () => {
4526   - setOpen(false);
4527   - };
4528 4511  
4529 4512 return (
4530 4513 <div className="order-page-container">
4531 4514 <div id="resizeDiv"></div>
4532   - <Modal
4533   - title="订单预警提醒"
4534   - open={open}
4535   - width={800}
4536   - closable={false}
4537   - footer={[
4538   - <Button key="confirm" size='large' type="primary" onClick={hideModal}>
4539   - 去处理
4540   - </Button>
4541   - ]}
4542   - >
4543   - <Row
4544   - gutter={16}
4545   - justify="space-between" // Aligns Cols to the start and end
4546   - align="middle" // Vertically center contents
4547   - >
4548   - <Col span={12}>
4549   - <div style={{ display: 'flex', justifyContent: 'center', marginTop: '20px' }}>
4550   - <Card
4551   - bordered={true}
4552   - style={{
4553   - backgroundColor: '#f0f0f0', // 背景颜色
4554   - width: '200px', // 卡片宽度
4555   - height: '200px', // 卡片高度
4556   - display: 'flex',
4557   - alignItems: 'center',
4558   - justifyContent: 'center'
4559   - }}
4560   - >
4561   - <div style={{
4562   - fontWeight: 'bold', // 字体加粗
4563   - color: 'black', // 字体颜色
4564   - fontSize: '20px', // 字体大小
4565   - }}>
4566   - <div style={{
4567   - fontWeight: 'bold', // 字体加粗
4568   - color: 'black', // 字体颜色
4569   - fontSize: '40px', // 字体大小
4570   - justifyContent: 'center',
4571   - display: 'flex',
4572   - alignItems: 'center',
4573   - marginBottom: '20px',
4574   - }}>
4575   - {invoiceWarningNum}
4576   - </div>
4577   - 发票待确认订单
4578   - </div>
4579   - </Card>
4580   - </div></Col>
4581   - <Col span={12}>
4582   - <div style={{ display: 'flex', justifyContent: 'center', marginTop: '20px' }}>
4583   - <Card
4584   - bordered={true}
4585   - style={{
4586   - backgroundColor: '#f0f0f0', // 背景颜色
4587   - width: '200px', // 卡片宽度
4588   - height: '200px', // 卡片高度
4589   - display: 'flex',
4590   - alignItems: 'center',
4591   - justifyContent: 'center'
4592   - }}
4593   - >
4594   - <div style={{
4595   - fontWeight: 'bold', // 字体加粗
4596   - color: 'black', // 字体颜色
4597   - fontSize: '20px', // 字体大小
4598   - }}>
4599   - <div style={{
4600   - fontWeight: 'bold', // 字体加粗
4601   - color: 'black', // 字体颜色
4602   - fontSize: '40px', // 字体大小
4603   - justifyContent: 'center',
4604   - display: 'flex',
4605   - alignItems: 'center',
4606   - marginBottom: '20px',
4607   - }}>
4608   - {invoiceRefundWarningNum}
4609   - </div>
4610   - 回款待确认订单
4611   - </div>
4612   - </Card>
4613   - </div></Col>
4614   - </Row>
4615   - <div style={{ color: 'red', padding: '40px' }}>
4616   - <p>预警说明:</p>
4617   - <p>1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能</p>
4618   - <p>2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能</p>
4619   - </div>
4620   - </Modal>
4621 4515 <ProTable
4622 4516 id="main-table"
4623 4517 // tableStyle={{backgroundColor:'red'}}
... ...
src/pages/Order/OrderWarning/index.tsx
... ... @@ -6,7 +6,6 @@ import ReissueModal_old from &#39;@/pages/Order/OrderWarning/components/ReissueModal
6 6 import {
7 7 postKingdeeRepSalBillOutbound,
8 8 postKingdeeRepSalOrderSave,
9   - postServiceConstCanApplyAfterInvoicingStatus,
10 9 postServiceInvoiceCancelApply,
11 10 postServiceOrderCancelSend,
12 11 postServiceOrderConfirmInvoice,
... ... @@ -59,13 +58,17 @@ import {
59 58 import {
60 59 Badge,
61 60 Button,
  61 + Card,
62 62 Checkbox,
  63 + Col,
63 64 Divider,
64 65 Flex,
65 66 FloatButton,
66 67 Image,
  68 + Modal,
67 69 Popconfirm,
68 70 Radio,
  71 + Row,
69 72 Space,
70 73 Spin,
71 74 Tabs,
... ... @@ -121,7 +124,6 @@ import ShippingWarehouseChangeModal from &#39;./components/ShippingWarehouseChangeMo
121 124 import UploadPayBillModal from './components/UploadPayBillModal';
122 125 import './index.less';
123 126 import { OrderListItemType, OrderType } from './type.d';
124   -
125 127 const OrderPage = () => {
126 128 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
127 129 const [checkVisible, setCheckVisible] = useState<boolean>(false);
... ... @@ -193,19 +195,18 @@ const OrderPage = () =&gt; {
193 195 const [subOrderCount, setSubOrderCount] = useState(0);
194 196 const [sorted] = useState(false);
195 197 const mainTableRef = useRef<ActionType>();
196   - const mainTableRef2 = useRef<ActionType>();
197 198 const mainTableFormRef = useRef<ProFormInstance>();
198 199 let [setSearchParam] = useState(Object); //表格的查询条件存储
199   - const [contextHolder] = message.useMessage();
  200 + const [messageApi, contextHolder] = message.useMessage();
200 201 const [
201 202 shippingWarehouseChangeModalVisible,
202 203 setShippingWarehouseChangeModalVisible,
203 204 ] = useState(false);
204   - const [setCanApplyAfterInvoicingStatus] = useState([]);
205 205 const [ids, setIds] = useState([]);
206 206 const [recordOptNode, setRecordOptNode] = useState(null);
207 207 const roleCode = userInfo?.roleSmallVO?.code;
208 208  
  209 + console.log(messageApi);
209 210 const triggerRecordOptNode = async (id) => {
210 211 const res = await postServiceOrderGetCurrentOptNode({
211 212 query: {
... ... @@ -217,7 +218,6 @@ const OrderPage = () =&gt; {
217 218  
218 219 const refreshTable = () => {
219 220 mainTableRef.current?.reload();
220   - mainTableRef2.current?.reload();
221 221 //刷新表格数据的时候,取消选中行
222 222 setSelectedRows([]);
223 223 setSelectedSubOrderKeys([]);
... ... @@ -244,16 +244,6 @@ const OrderPage = () =&gt; {
244 244 }
245 245 }, []);
246 246  
247   - useEffect(() => {
248   - const initEnum = async () => {
249   - let invoiceTypeRet = await postServiceConstCanApplyAfterInvoicingStatus();
250   - if (invoiceTypeRet.result === RESPONSE_CODE.SUCCESS) {
251   - setCanApplyAfterInvoicingStatus(invoiceTypeRet.data);
252   - }
253   - };
254   - initEnum();
255   - }, []);
256   -
257 247 /**
258 248 * 复制订单到剪贴板
259 249 * @param record
... ... @@ -3825,7 +3815,6 @@ const OrderPage = () =&gt; {
3825 3815 if (res && res.result === RESPONSE_CODE.SUCCESS) {
3826 3816 message.success('推送成功');
3827 3817 mainTableRef.current.reload();
3828   - mainTableRef2.current.reload();
3829 3818 }
3830 3819 }}
3831 3820 />
... ... @@ -3848,7 +3837,6 @@ const OrderPage = () =&gt; {
3848 3837 if (res && res.result === RESPONSE_CODE.SUCCESS) {
3849 3838 message.success('下推成功');
3850 3839 mainTableRef.current.reload();
3851   - mainTableRef2.current.reload();
3852 3840 }
3853 3841 }}
3854 3842 />
... ... @@ -4177,14 +4165,12 @@ const OrderPage = () =&gt; {
4177 4165 params.sorted = sorted;
4178 4166 // params.isDeleteQueryOrder = filterCondifion === 70;
4179 4167 params.isDeleteQueryOrder = false;
4180   - params.invoiceConfirmStatusNe = 'CONFIRMED';
  4168 + params.orderStatus = 'CONFIRM_RECEIPT';
4181 4169 params.invoicingStatusNe = 'UN_INVOICE';
4182   - params.applyTimeIsNotNull = true;
4183 4170 if (calDate === 'null') {
4184   - params.applyTimeLe = null;
  4171 + params.statusDatetimeLe = null;
4185 4172 } else {
4186   - params.applyTimeLe = calDate;
4187   - console.log(params.applyTimeLe, '5656params.applyTimeLe');
  4173 + params.statusDatetimeLe = calDate;
4188 4174 }
4189 4175 console.log(params, '5656paramsFlush');
4190 4176 setSearchParam(params);
... ... @@ -4225,7 +4211,7 @@ const OrderPage = () =&gt; {
4225 4211 // 监听 calDate 变化,触发请求
4226 4212 useEffect(() => {
4227 4213 if (calDate2) {
4228   - mainTableRef2.current?.reload();
  4214 + mainTableRef.current?.reload();
4229 4215 }
4230 4216 }, [calDate2]);
4231 4217  
... ... @@ -4236,18 +4222,13 @@ const OrderPage = () =&gt; {
4236 4222 sorter,
4237 4223 filter,
4238 4224 ) => {
4239   - // params.orderStatus = 'CONFIRM_INVOICE';
  4225 + params.orderStatus = 'CONFIRM_INVOICE';
4240 4226 params.paymentMethod = 'UNPAID';
4241 4227 params.salesCode = userInfo.username;
4242   - params.invoiceConfirmStatus = 'CONFIRMED';
4243 4228 if (calDate2 === 'null') {
4244   - params.invoiceConfirmStatusDatetimeLe = null;
  4229 + params.statusDatetimeLe = null;
4245 4230 } else {
4246   - params.invoiceConfirmStatusDatetimeLe = calDate2;
4247   - console.log(
4248   - params.invoiceConfirmStatusDatetimeLe,
4249   - '5656params.statusDatetimeLe2',
4250   - );
  4231 + params.statusDatetimeLe = calDate2;
4251 4232 }
4252 4233 //订单id处理
4253 4234 /**
... ... @@ -4275,8 +4256,6 @@ const OrderPage = () =&gt; {
4275 4256 //是否只查看已作废
4276 4257 params.isDeleteQueryOrder = filterCondifion === 70;
4277 4258 params.paymentNotReceipt = true;
4278   - console.log(params, '5656paramsFlush2');
4279   -
4280 4259 //保存这个搜索条件
4281 4260 setSearchParam(params);
4282 4261  
... ... @@ -4941,7 +4920,7 @@ const OrderPage = () =&gt; {
4941 4920 id="main-table"
4942 4921 // tableStyle={{backgroundColor:'red'}}
4943 4922  
4944   - actionRef={mainTableRef2}
  4923 + actionRef={mainTableRef}
4945 4924 formRef={mainTableFormRef}
4946 4925 expandIconColumnIndex={-1}
4947 4926 columns={mainOrdersColumns}
... ... @@ -5476,18 +5455,23 @@ const OrderPage = () =&gt; {
5476 5455 ),
5477 5456 },
5478 5457 ];
  5458 + const [open, setOpen] = useState(true);
  5459 + //隐藏弹窗
  5460 + const hideModal = () => {
  5461 + setOpen(false);
  5462 + };
5479 5463 return (
5480 5464 <div className="order-page-container">
5481 5465 <div id="resizeDiv"></div>
5482   - {/* <Modal
  5466 + <Modal
5483 5467 title="订单预警提醒"
5484 5468 open={open}
5485 5469 width={800}
5486 5470 closable={false}
5487 5471 footer={[
5488   - <Button key="confirm" size='large' type="primary" onClick={hideModal}>
  5472 + <Button key="confirm" size="large" type="primary" onClick={hideModal}>
5489 5473 去处理
5490   - </Button>
  5474 + </Button>,
5491 5475 ]}
5492 5476 >
5493 5477 <Row
... ... @@ -5496,78 +5480,104 @@ const OrderPage = () =&gt; {
5496 5480 align="middle" // Vertically center contents
5497 5481 >
5498 5482 <Col span={12}>
5499   - <div style={{ display: 'flex', justifyContent: 'center', marginTop: '20px' }}>
  5483 + <div
  5484 + style={{
  5485 + display: 'flex',
  5486 + justifyContent: 'center',
  5487 + marginTop: '20px',
  5488 + }}
  5489 + >
5500 5490 <Card
5501 5491 bordered={true}
5502 5492 style={{
5503 5493 backgroundColor: '#f0f0f0', // 背景颜色
5504   - width: '200px', // 卡片宽度
5505   - height: '200px', // 卡片高度
  5494 + width: '200px', // 卡片宽度
  5495 + height: '200px', // 卡片高度
5506 5496 display: 'flex',
5507 5497 alignItems: 'center',
5508   - justifyContent: 'center'
  5498 + justifyContent: 'center',
5509 5499 }}
5510 5500 >
5511   - <div style={{
5512   - fontWeight: 'bold', // 字体加粗
5513   - color: 'black', // 字体颜色
5514   - fontSize: '20px', // 字体大小
5515   - }}>
5516   - <div style={{
5517   - fontWeight: 'bold', // 字体加粗
5518   - color: 'black', // 字体颜色
5519   - fontSize: '40px', // 字体大小
5520   - justifyContent: 'center',
5521   - display: 'flex',
5522   - alignItems: 'center',
5523   - marginBottom: '20px',
5524   - }}>
  5501 + <div
  5502 + style={{
  5503 + fontWeight: 'bold', // 字体加粗
  5504 + color: 'black', // 字体颜色
  5505 + fontSize: '20px', // 字体大小
  5506 + }}
  5507 + >
  5508 + <div
  5509 + style={{
  5510 + fontWeight: 'bold', // 字体加粗
  5511 + color: 'black', // 字体颜色
  5512 + fontSize: '40px', // 字体大小
  5513 + justifyContent: 'center',
  5514 + display: 'flex',
  5515 + alignItems: 'center',
  5516 + marginBottom: '20px',
  5517 + }}
  5518 + >
5525 5519 {invoiceWarningNum}
5526 5520 </div>
5527 5521 发票待确认订单
5528 5522 </div>
5529 5523 </Card>
5530   - </div></Col>
  5524 + </div>
  5525 + </Col>
5531 5526 <Col span={12}>
5532   - <div style={{ display: 'flex', justifyContent: 'center', marginTop: '20px' }}>
  5527 + <div
  5528 + style={{
  5529 + display: 'flex',
  5530 + justifyContent: 'center',
  5531 + marginTop: '20px',
  5532 + }}
  5533 + >
5533 5534 <Card
5534 5535 bordered={true}
5535 5536 style={{
5536 5537 backgroundColor: '#f0f0f0', // 背景颜色
5537   - width: '200px', // 卡片宽度
5538   - height: '200px', // 卡片高度
  5538 + width: '200px', // 卡片宽度
  5539 + height: '200px', // 卡片高度
5539 5540 display: 'flex',
5540 5541 alignItems: 'center',
5541   - justifyContent: 'center'
  5542 + justifyContent: 'center',
5542 5543 }}
5543 5544 >
5544   - <div style={{
5545   - fontWeight: 'bold', // 字体加粗
5546   - color: 'black', // 字体颜色
5547   - fontSize: '20px', // 字体大小
5548   - }}>
5549   - <div style={{
5550   - fontWeight: 'bold', // 字体加粗
5551   - color: 'black', // 字体颜色
5552   - fontSize: '40px', // 字体大小
5553   - justifyContent: 'center',
5554   - display: 'flex',
5555   - alignItems: 'center',
5556   - marginBottom: '20px',
5557   - }}>
  5545 + <div
  5546 + style={{
  5547 + fontWeight: 'bold', // 字体加粗
  5548 + color: 'black', // 字体颜色
  5549 + fontSize: '20px', // 字体大小
  5550 + }}
  5551 + >
  5552 + <div
  5553 + style={{
  5554 + fontWeight: 'bold', // 字体加粗
  5555 + color: 'black', // 字体颜色
  5556 + fontSize: '40px', // 字体大小
  5557 + justifyContent: 'center',
  5558 + display: 'flex',
  5559 + alignItems: 'center',
  5560 + marginBottom: '20px',
  5561 + }}
  5562 + >
5558 5563 {invoiceRefundWarningNum}
5559 5564 </div>
5560 5565 回款待确认订单
5561 5566 </div>
5562 5567 </Card>
5563   - </div></Col>
  5568 + </div>
  5569 + </Col>
5564 5570 </Row>
5565 5571 <div style={{ color: 'red', padding: '40px' }}>
5566 5572 <p>预警说明:</p>
5567   - <p>1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能</p>
5568   - <p>2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能</p>
  5573 + <p>
  5574 + 1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能
  5575 + </p>
  5576 + <p>
  5577 + 2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能
  5578 + </p>
5569 5579 </div>
5570   - </Modal> */}
  5580 + </Modal>
5571 5581 <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => {}} />
5572 5582 </div>
5573 5583 );
... ...
src/pages/Order/constant.ts
... ... @@ -544,6 +544,22 @@ export const MAIN_ORDER_COLUMNS = [
544 544 hideInTable: true,
545 545 },
546 546 {
  547 + title: '预警状态',
  548 + dataIndex: 'warningStatus',
  549 + valueType: 'select',
  550 + hideInTable: true,
  551 + valueEnum: {
  552 + invoiceConfirmWarning: {
  553 + text: '待开票预警',
  554 + status: 'invoiceConfirmWarning',
  555 + },
  556 + paymentReceiptStatusWarning: {
  557 + text: '待回款预警',
  558 + status: 'paymentReceiptStatusWarning',
  559 + },
  560 + },
  561 + },
  562 + {
547 563 title: '订单状态',
548 564 dataIndex: 'orderStatus',
549 565 valueType: 'select',
... ...