Commit 46ba5ba79881891e9ccac29b52587faf34866e69

Authored by boyang
1 parent c35d1eb5

feat: 预警页面销售代表选择器

.umirc.ts
@@ -14,9 +14,9 @@ export default defineConfig({ @@ -14,9 +14,9 @@ export default defineConfig({
14 }, 14 },
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/', 18 // target: 'http://192.168.1.6:8085/',
19 - // target: 'http://39.108.227.113: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/Order/OrderWarning/index.tsx
@@ -32,6 +32,7 @@ import { @@ -32,6 +32,7 @@ import {
32 } from '@/utils'; 32 } from '@/utils';
33 import { 33 import {
34 getReceivingCompanyOptions, 34 getReceivingCompanyOptions,
  35 + getSalesCodeOptions,
35 isAdmin, 36 isAdmin,
36 isExaminer, 37 isExaminer,
37 isFinance, 38 isFinance,
@@ -53,6 +54,7 @@ import { @@ -53,6 +54,7 @@ import {
53 ActionType, 54 ActionType,
54 ProColumns, 55 ProColumns,
55 ProFormInstance, 56 ProFormInstance,
  57 + ProFormSelect,
56 ProTable, 58 ProTable,
57 } from '@ant-design/pro-components'; 59 } from '@ant-design/pro-components';
58 import { 60 import {
@@ -120,12 +122,15 @@ import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeMo @@ -120,12 +122,15 @@ import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeMo
120 import UploadPayBillModal from './components/UploadPayBillModal'; 122 import UploadPayBillModal from './components/UploadPayBillModal';
121 import './index.less'; 123 import './index.less';
122 import { OrderListItemType, OrderType } from './type.d'; 124 import { OrderListItemType, OrderType } from './type.d';
  125 +// import { useParams } from '@umijs/max';
123 126
124 const OrderPage = () => { 127 const OrderPage = () => {
125 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); 128 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
126 const [checkVisible, setCheckVisible] = useState<boolean>(false); 129 const [checkVisible, setCheckVisible] = useState<boolean>(false);
127 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false); 130 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
  131 + const [salesCodeOptions, setSalesCodeOptions] = useState([]);
128 const [allMainChecked, setAllMainChecked] = useState(false); 132 const [allMainChecked, setAllMainChecked] = useState(false);
  133 + const [salesCodeSelect, setSalesCodeSelect] = useState();
129 const [imagesViewerModalVisible, setImagesViewerModalVisible] = 134 const [imagesViewerModalVisible, setImagesViewerModalVisible] =
130 useState<boolean>(false); 135 useState<boolean>(false);
131 const [data, setData] = useState([]); //列表数据 136 const [data, setData] = useState([]); //列表数据
@@ -789,7 +794,7 @@ const OrderPage = () =&gt; { @@ -789,7 +794,7 @@ const OrderPage = () =&gt; {
789 onConfirm={() => { 794 onConfirm={() => {
790 window.open( 795 window.open(
791 '/previewApi/onlinePreview?url=' + 796 '/previewApi/onlinePreview?url=' +
792 - encodeURIComponent(Base64.encode(item.url)), 797 + encodeURIComponent(Base64.encode(item.url)),
793 ); 798 );
794 }} 799 }}
795 onCancel={() => { 800 onCancel={() => {
@@ -861,7 +866,7 @@ const OrderPage = () =&gt; { @@ -861,7 +866,7 @@ const OrderPage = () =&gt; {
861 </span> 866 </span>
862 {(roleCode === 'salesRepresentative' || 867 {(roleCode === 'salesRepresentative' ||
863 roleCode === 'salesManager') && 868 roleCode === 'salesManager') &&
864 - !optRecord.isCurrentUserOrder ? ( 869 + !optRecord.isCurrentUserOrder ? (
865 <span className="text-[#f44e4e]">(非本账号订单)</span> 870 <span className="text-[#f44e4e]">(非本账号订单)</span>
866 ) : ( 871 ) : (
867 '' 872 ''
@@ -1045,13 +1050,13 @@ const OrderPage = () =&gt; { @@ -1045,13 +1050,13 @@ const OrderPage = () =&gt; {
1045 <Tooltip 1050 <Tooltip
1046 title={ 1051 title={
1047 optRecord.invoicingUrgentCause !== null && 1052 optRecord.invoicingUrgentCause !== null &&
1048 - optRecord.afterInvoicingStatus === 1053 + optRecord.afterInvoicingStatus ===
1049 'URGENT_INVOICE_AUDITING' 1054 'URGENT_INVOICE_AUDITING'
1050 ? optRecord.invoicingUrgentCause 1055 ? optRecord.invoicingUrgentCause
1051 : enumValueToLabel( 1056 : enumValueToLabel(
1052 - optRecord.afterInvoicingStatus,  
1053 - AFTER_INVOICING_STATUS,  
1054 - ) 1057 + optRecord.afterInvoicingStatus,
  1058 + AFTER_INVOICING_STATUS,
  1059 + )
1055 } 1060 }
1056 > 1061 >
1057 <Tag 1062 <Tag
@@ -1082,7 +1087,7 @@ const OrderPage = () =&gt; { @@ -1082,7 +1087,7 @@ const OrderPage = () =&gt; {
1082 )} 1087 )}
1083 1088
1084 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && 1089 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1085 - optRecord.shippingWarehouse !== null ? ( 1090 + optRecord.shippingWarehouse !== null ? (
1086 <div 1091 <div
1087 className="overflow-hidden whitespace-no-wrap overflow-ellipsis" 1092 className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1088 title={enumValueToLabel( 1093 title={enumValueToLabel(
@@ -1104,7 +1109,7 @@ const OrderPage = () =&gt; { @@ -1104,7 +1109,7 @@ const OrderPage = () =&gt; {
1104 {/* 生产时间 */} 1109 {/* 生产时间 */}
1105 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1110 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1106 {optRecord.productionStartTime !== null || 1111 {optRecord.productionStartTime !== null ||
1107 - optRecord.productionEndTime !== null ? ( 1112 + optRecord.productionEndTime !== null ? (
1108 <MyToolTip 1113 <MyToolTip
1109 title={ 1114 title={
1110 formatdate(optRecord.productionStartTime) + 1115 formatdate(optRecord.productionStartTime) +
@@ -1134,7 +1139,7 @@ const OrderPage = () =&gt; { @@ -1134,7 +1139,7 @@ const OrderPage = () =&gt; {
1134 <Tag 1139 <Tag
1135 color={ 1140 color={
1136 optRecord.invoicingTime === null || 1141 optRecord.invoicingTime === null ||
1137 - optRecord.invoicingTime === undefined 1142 + optRecord.invoicingTime === undefined
1138 ? TAGS_COLOR.get(optRecord.invoicingStatus) 1143 ? TAGS_COLOR.get(optRecord.invoicingStatus)
1139 : 'success' 1144 : 'success'
1140 } 1145 }
@@ -1162,7 +1167,7 @@ const OrderPage = () =&gt; { @@ -1162,7 +1167,7 @@ const OrderPage = () =&gt; {
1162 1167
1163 {/**采购是否已下单状态 */} 1168 {/**采购是否已下单状态 */}
1164 {optRecord.procureOrderStatus !== null && 1169 {optRecord.procureOrderStatus !== null &&
1165 - optRecord.procureOrderStatus !== undefined ? ( 1170 + optRecord.procureOrderStatus !== undefined ? (
1166 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1171 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1167 <Tag color="success"> 1172 <Tag color="success">
1168 {enumValueToLabel( 1173 {enumValueToLabel(
@@ -1178,21 +1183,21 @@ const OrderPage = () =&gt; { @@ -1178,21 +1183,21 @@ const OrderPage = () =&gt; {
1178 {/* 物流信息 */} 1183 {/* 物流信息 */}
1179 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1184 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1180 {optRecord.orderStatus === 'CONFIRM_RECEIPT' || 1185 {optRecord.orderStatus === 'CONFIRM_RECEIPT' ||
1181 - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||  
1182 - optRecord.orderStatus === 'IN_AFTER_SALES' ||  
1183 - optRecord.orderStatus === 'SHIPPED' ? ( 1186 + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
  1187 + optRecord.orderStatus === 'IN_AFTER_SALES' ||
  1188 + optRecord.orderStatus === 'SHIPPED' ? (
1184 <MyToolTip 1189 <MyToolTip
1185 title={ 1190 title={
1186 optRecord.serialNumber === undefined 1191 optRecord.serialNumber === undefined
1187 ? '暂无物流信息' 1192 ? '暂无物流信息'
1188 : enumValueToLabel( 1193 : enumValueToLabel(
1189 - optRecord.logisticsMethod,  
1190 - LOGISTICS_STATUS_OPTIONS,  
1191 - ) +  
1192 - ' ' +  
1193 - optRecord.serialNumber +  
1194 - ' ' +  
1195 - optRecord.logisticsNotes 1194 + optRecord.logisticsMethod,
  1195 + LOGISTICS_STATUS_OPTIONS,
  1196 + ) +
  1197 + ' ' +
  1198 + optRecord.serialNumber +
  1199 + ' ' +
  1200 + optRecord.logisticsNotes
1196 } 1201 }
1197 content={ 1202 content={
1198 <Button type="link" size="small" style={{ padding: 0 }}> 1203 <Button type="link" size="small" style={{ padding: 0 }}>
@@ -1206,7 +1211,7 @@ const OrderPage = () =&gt; { @@ -1206,7 +1211,7 @@ const OrderPage = () =&gt; {
1206 1211
1207 {/* 修改审核状态 */} 1212 {/* 修改审核状态 */}
1208 {optRecord.modifiedAuditStatus !== null && 1213 {optRecord.modifiedAuditStatus !== null &&
1209 - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( 1214 + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1210 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> 1215 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1211 <Tooltip 1216 <Tooltip
1212 title={recordOptNode ? recordOptNode : <Spin />} 1217 title={recordOptNode ? recordOptNode : <Spin />}
@@ -1646,7 +1651,7 @@ const OrderPage = () =&gt; { @@ -1646,7 +1651,7 @@ const OrderPage = () =&gt; {
1646 )} 1651 )}
1647 1652
1648 {optRecord.paths?.includes('queryAnnex') && 1653 {optRecord.paths?.includes('queryAnnex') &&
1649 - optRecord.listAnnex?.length > 0 ? ( 1654 + optRecord.listAnnex?.length > 0 ? (
1650 <Button 1655 <Button
1651 className="p-0" 1656 className="p-0"
1652 type="link" 1657 type="link"
@@ -2113,7 +2118,7 @@ const OrderPage = () =&gt; { @@ -2113,7 +2118,7 @@ const OrderPage = () =&gt; {
2113 </Flex> 2118 </Flex>
2114 2119
2115 {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) && 2120 {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) &&
2116 - !isSupplier() ? ( 2121 + !isSupplier() ? (
2117 <div className="pt-2"> 2122 <div className="pt-2">
2118 <Flex title={optRecord.supplierName}> 2123 <Flex title={optRecord.supplierName}>
2119 <div> 2124 <div>
@@ -2188,7 +2193,7 @@ const OrderPage = () =&gt; { @@ -2188,7 +2193,7 @@ const OrderPage = () =&gt; {
2188 <span className="text-[#8C8C8C]"> 2193 <span className="text-[#8C8C8C]">
2189 申请开票备注: 2194 申请开票备注:
2190 {optRecord.applyInvoicingNotes === undefined || 2195 {optRecord.applyInvoicingNotes === undefined ||
2191 - optRecord.applyInvoicingNotes === null 2196 + optRecord.applyInvoicingNotes === null
2192 ? '暂无备注' 2197 ? '暂无备注'
2193 : optRecord.applyInvoicingNotes} 2198 : optRecord.applyInvoicingNotes}
2194 </span> 2199 </span>
@@ -2216,7 +2221,7 @@ const OrderPage = () =&gt; { @@ -2216,7 +2221,7 @@ const OrderPage = () =&gt; {
2216 <span className="text-[#8C8C8C] mr-3"> 2221 <span className="text-[#8C8C8C] mr-3">
2217 财务审核备注: 2222 财务审核备注:
2218 {optRecord.checkNotes === undefined || 2223 {optRecord.checkNotes === undefined ||
2219 - optRecord.checkNotes === null 2224 + optRecord.checkNotes === null
2220 ? '暂无备注' 2225 ? '暂无备注'
2221 : optRecord.checkNotes} 2226 : optRecord.checkNotes}
2222 </span> 2227 </span>
@@ -2240,7 +2245,7 @@ const OrderPage = () =&gt; { @@ -2240,7 +2245,7 @@ const OrderPage = () =&gt; {
2240 <span className="text-[#8C8C8C]"> 2245 <span className="text-[#8C8C8C]">
2241 重新开票备注: 2246 重新开票备注:
2242 {optRecord.reissueNotes === undefined || 2247 {optRecord.reissueNotes === undefined ||
2243 - optRecord.reissueNotes === null 2248 + optRecord.reissueNotes === null
2244 ? '暂无备注' 2249 ? '暂无备注'
2245 : optRecord.reissueNotes} 2250 : optRecord.reissueNotes}
2246 </span> 2251 </span>
@@ -2277,7 +2282,7 @@ const OrderPage = () =&gt; { @@ -2277,7 +2282,7 @@ const OrderPage = () =&gt; {
2277 <span className="text-[#8C8C8C] mr-3"> 2282 <span className="text-[#8C8C8C] mr-3">
2278 产品回访登记: 2283 产品回访登记:
2279 {optRecord.feedbackRegistrationContent === undefined || 2284 {optRecord.feedbackRegistrationContent === undefined ||
2280 - optRecord.feedbackRegistrationContent === null 2285 + optRecord.feedbackRegistrationContent === null
2281 ? '暂无' 2286 ? '暂无'
2282 : optRecord.feedbackRegistrationContent} 2287 : optRecord.feedbackRegistrationContent}
2283 </span> 2288 </span>
@@ -2568,9 +2573,9 @@ const OrderPage = () =&gt; { @@ -2568,9 +2573,9 @@ const OrderPage = () =&gt; {
2568 <span className="text-slate-700"> 2573 <span className="text-slate-700">
2569 {record.receivingCompany !== null 2574 {record.receivingCompany !== null
2570 ? enumValueToLabel( 2575 ? enumValueToLabel(
2571 - record.receivingCompany,  
2572 - getReceivingCompanyOptions(PAYEE_OPTIONS),  
2573 - ) 2576 + record.receivingCompany,
  2577 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  2578 + )
2574 : '暂无'} 2579 : '暂无'}
2575 </span> 2580 </span>
2576 </div> 2581 </div>
@@ -3362,9 +3367,9 @@ const OrderPage = () =&gt; { @@ -3362,9 +3367,9 @@ const OrderPage = () =&gt; {
3362 for (let i = 0; i < selectedSubOrders.length; i++) { 3367 for (let i = 0; i < selectedSubOrders.length; i++) {
3363 if ( 3368 if (
3364 selectedSubOrders[i].invoicingStatus === 3369 selectedSubOrders[i].invoicingStatus ===
3365 - 'UN_INVOICE' || 3370 + 'UN_INVOICE' ||
3366 selectedSubOrders[i].afterInvoicingStatus === 3371 selectedSubOrders[i].afterInvoicingStatus ===
3367 - 'APPLY_FOR_INVOICING' 3372 + 'APPLY_FOR_INVOICING'
3368 ) { 3373 ) {
3369 message.error( 3374 message.error(
3370 '请选择需要开票且未申请开票的子订单进行申请', 3375 '请选择需要开票且未申请开票的子订单进行申请',
@@ -3399,9 +3404,9 @@ const OrderPage = () =&gt; { @@ -3399,9 +3404,9 @@ const OrderPage = () =&gt; {
3399 for (let i = 0; i < selectedSubOrders.length; i++) { 3404 for (let i = 0; i < selectedSubOrders.length; i++) {
3400 if ( 3405 if (
3401 selectedSubOrders[i].invoicingStatus === 3406 selectedSubOrders[i].invoicingStatus ===
3402 - 'UN_INVOICE' || 3407 + 'UN_INVOICE' ||
3403 selectedSubOrders[i].afterInvoicingStatus === 3408 selectedSubOrders[i].afterInvoicingStatus ===
3404 - 'APPLY_FOR_INVOICING' 3409 + 'APPLY_FOR_INVOICING'
3405 ) { 3410 ) {
3406 message.error( 3411 message.error(
3407 '请选择需要开票且未申请开票的子订单进行申请', 3412 '请选择需要开票且未申请开票的子订单进行申请',
@@ -3615,13 +3620,13 @@ const OrderPage = () =&gt; { @@ -3615,13 +3620,13 @@ const OrderPage = () =&gt; {
3615 if ( 3620 if (
3616 selectedSubOrders[i].orderStatus !== 'AUDITED' && 3621 selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3617 selectedSubOrders[i].orderStatus !== 3622 selectedSubOrders[i].orderStatus !==
3618 - 'PROCURE_PROCESS' && 3623 + 'PROCURE_PROCESS' &&
3619 selectedSubOrders[i].orderStatus !== 3624 selectedSubOrders[i].orderStatus !==
3620 - 'PROCURE_PROCESS_FOR_MINE' && 3625 + 'PROCURE_PROCESS_FOR_MINE' &&
3621 selectedSubOrders[i].orderStatus !== 3626 selectedSubOrders[i].orderStatus !==
3622 - 'PROCURE_WAIT_SHIP' && 3627 + 'PROCURE_WAIT_SHIP' &&
3623 selectedSubOrders[i].orderStatus !== 3628 selectedSubOrders[i].orderStatus !==
3624 - 'SUPPLIER_WAIT_SHIP' && 3629 + 'SUPPLIER_WAIT_SHIP' &&
3625 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' 3630 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3626 ) { 3631 ) {
3627 message.error( 3632 message.error(
@@ -3707,9 +3712,9 @@ const OrderPage = () =&gt; { @@ -3707,9 +3712,9 @@ const OrderPage = () =&gt; {
3707 if ( 3712 if (
3708 selectedSubOrders[i].orderStatus !== 'UNAUDITED' && 3713 selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3709 selectedSubOrders[i].orderStatus !== 3714 selectedSubOrders[i].orderStatus !==
3710 - 'FINANCE_PROCESS' && 3715 + 'FINANCE_PROCESS' &&
3711 selectedSubOrders[i].orderStatus !== 3716 selectedSubOrders[i].orderStatus !==
3712 - 'LEADER_AUDITED' 3717 + 'LEADER_AUDITED'
3713 ) { 3718 ) {
3714 message.error( 3719 message.error(
3715 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', 3720 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
@@ -3777,9 +3782,9 @@ const OrderPage = () =&gt; { @@ -3777,9 +3782,9 @@ const OrderPage = () =&gt; {
3777 for (let i = 0; i < selectedSubOrders.length; i++) { 3782 for (let i = 0; i < selectedSubOrders.length; i++) {
3778 if ( 3783 if (
3779 selectedSubOrders[i].orderStatus !== 3784 selectedSubOrders[i].orderStatus !==
3780 - 'CONFIRM_RECEIPT' && 3785 + 'CONFIRM_RECEIPT' &&
3781 selectedSubOrders[i].orderStatus !== 3786 selectedSubOrders[i].orderStatus !==
3782 - 'AFTER_SALES_FAILURE' 3787 + 'AFTER_SALES_FAILURE'
3783 ) { 3788 ) {
3784 message.error('请选择确认收货状态的子订单进行售后'); 3789 message.error('请选择确认收货状态的子订单进行售后');
3785 return; 3790 return;
@@ -4201,10 +4206,6 @@ const OrderPage = () =&gt; { @@ -4201,10 +4206,6 @@ const OrderPage = () =&gt; {
4201 ) { 4206 ) {
4202 setValue1(0); // 清空 value1 4207 setValue1(0); // 清空 value1
4203 } 4208 }
4204 - // const currentDate = new Date();  
4205 - // const newDate = new Date(currentDate);  
4206 - // newDate.setDate(currentDate.getDate() - 0);  
4207 - // console.log(value1, '5656value1');  
4208 mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** 4209 mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2**
4209 }, [activeTabKey]); 4210 }, [activeTabKey]);
4210 // 修改位置:监听 value1 的变化 4211 // 修改位置:监听 value1 的变化
@@ -4214,12 +4215,14 @@ const OrderPage = () =&gt; { @@ -4214,12 +4215,14 @@ const OrderPage = () =&gt; {
4214 mainTableRef.current?.reload(); // 重新请求数据 4215 mainTableRef.current?.reload(); // 重新请求数据
4215 } 4216 }
4216 }, [value1]); // 添加了 value1 作为依赖 4217 }, [value1]); // 添加了 value1 作为依赖
4217 -  
4218 //biaojidown2 4218 //biaojidown2
4219 //取消单选,将时间设为null 4219 //取消单选,将时间设为null
4220 const handleSetNull = () => { 4220 const handleSetNull = () => {
4221 setCalDate(null); // 这应该会触发 useEffect 4221 setCalDate(null); // 这应该会触发 useEffect
4222 }; 4222 };
  4223 + const selectSalesCode = (value) => {
  4224 + setSalesCodeSelect(value); // 这应该会触发 useEffect
  4225 + };
4223 const warningOptions = [ 4226 const warningOptions = [
4224 { 4227 {
4225 value: 1, 4228 value: 1,
@@ -4274,35 +4277,73 @@ const OrderPage = () =&gt; { @@ -4274,35 +4277,73 @@ const OrderPage = () =&gt; {
4274 /> 4277 />
4275 </div> 4278 </div>
4276 <div style={{ height: '25px' }}></div> 4279 <div style={{ height: '25px' }}></div>
4277 - {/* <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => { }} /> */}  
4278 - <Radio.Group  
4279 - value={value1}  
4280 - onChange={radioOnChange1}  
4281 - // 通过 onClick 处理单独 Radio 的点击事件 4280 + <div
  4281 + style={{
  4282 + display: 'flex',
  4283 + justifyContent: 'space-between',
  4284 + alignItems: 'center',
  4285 + width: '100%',
  4286 + }}
4282 > 4287 >
4283 - {(activeTabKey === 1  
4284 - ? options1  
4285 - : activeTabKey === 2  
4286 - ? options2  
4287 - : activeTabKey === 3  
4288 - ? options3  
4289 - : options4  
4290 - ).map((option) => (  
4291 - <Radio  
4292 - key={option.value}  
4293 - value={option.value}  
4294 - onClick={(e) => {  
4295 - radioOnChange1(  
4296 - e as unknown as React.ChangeEvent<HTMLInputElement>,  
4297 - );  
4298 - handleSetNull(); 4288 + {/* 左边的 Radio.Group */}
  4289 + <span style={{ flex: '1' }}>
  4290 + {' '}
  4291 + {/* 修改:设置 flex 属性 */}
  4292 + <Radio.Group value={value1} onChange={radioOnChange1}>
  4293 + {(activeTabKey === 1
  4294 + ? options1
  4295 + : activeTabKey === 2
  4296 + ? options2
  4297 + : activeTabKey === 3
  4298 + ? options3
  4299 + : options4
  4300 + ).map((option) => (
  4301 + <Radio
  4302 + key={option.value}
  4303 + value={option.value}
  4304 + onClick={(e) => {
  4305 + radioOnChange1(
  4306 + e as unknown as React.ChangeEvent<HTMLInputElement>,
  4307 + );
  4308 + handleSetNull();
  4309 + }}
  4310 + >
  4311 + {option.label}
  4312 + </Radio>
  4313 + ))}
  4314 + </Radio.Group>
  4315 + </span>
  4316 +
  4317 + {/* 右边的 ProFormSelect */}
  4318 + <span style={{ width: '300px', marginLeft: 'auto', marginTop: '30px' }}>
  4319 + {' '}
  4320 + {/* 修改:设置 width 和 marginLeft */}
  4321 + <ProFormSelect
  4322 + name="salesCode"
  4323 + key="salesCode"
  4324 + width="200px"
  4325 + actionRef={mainTableRef}
  4326 + formRef={mainTableFormRef}
  4327 + initialValue={userInfo.nickName}
  4328 + showSearch
  4329 + label="销售代表"
  4330 + placeholder="请输入销售代表"
  4331 + options={salesCodeOptions}
  4332 + onChange={(_, option) => {
  4333 + console.log(option, '5656option');
  4334 + selectSalesCode(option.value);
  4335 + mainTableRef.current?.reload();
4299 }} 4336 }}
4300 - >  
4301 - {option.label}  
4302 - </Radio>  
4303 - ))}  
4304 - </Radio.Group>  
4305 - <div style={{ height: '25px' }}></div> 4337 + request={async () => {
  4338 + let options = await getSalesCodeOptions();
  4339 + setSalesCodeOptions(options);
  4340 + return options;
  4341 + }}
  4342 + />
  4343 + </span>
  4344 + </div>
  4345 +
  4346 + <div style={{ height: '15px' }}></div>
4306 <ProTable 4347 <ProTable
4307 id="main-table" 4348 id="main-table"
4308 // tableStyle={{backgroundColor:'red'}} 4349 // tableStyle={{backgroundColor:'red'}}
@@ -4373,9 +4414,8 @@ const OrderPage = () =&gt; { @@ -4373,9 +4414,8 @@ const OrderPage = () =&gt; {
4373 }); 4414 });
4374 } 4415 }
4375 } 4416 }
4376 - 4417 + params.salesCode = userInfo.nickName;
4377 params.condition = filterCondifion; 4418 params.condition = filterCondifion;
4378 -  
4379 //排序 4419 //排序
4380 params.sorted = sorted; 4420 params.sorted = sorted;
4381 //是否只查看已作废 4421 //是否只查看已作废
@@ -4399,7 +4439,10 @@ const OrderPage = () =&gt; { @@ -4399,7 +4439,10 @@ const OrderPage = () =&gt; {
4399 // params.applyTimeIsNotNull = true; // 要求申请时间非空 4439 // params.applyTimeIsNotNull = true; // 要求申请时间非空
4400 params.orderStatus = 'SHIPPED'; // 发票确认预警 4440 params.orderStatus = 'SHIPPED'; // 发票确认预警
4401 params.isDeleteQueryOrder = false; // 强制查询非作废订单 4441 params.isDeleteQueryOrder = false; // 强制查询非作废订单
4402 - params.salesCode = userInfo.username; 4442 + params.salesCode = userInfo.nickName;
  4443 + if (salesCodeSelect !== undefined) {
  4444 + params.salesCode = salesCodeSelect;
  4445 + }
4403 // params.paymentMethod = 'UNPAID'; 4446 // params.paymentMethod = 'UNPAID';
4404 finalParams = { 4447 finalParams = {
4405 ...params, 4448 ...params,
@@ -4413,7 +4456,10 @@ const OrderPage = () =&gt; { @@ -4413,7 +4456,10 @@ const OrderPage = () =&gt; {
4413 // params.applyTimeLe = calDate; 4456 // params.applyTimeLe = calDate;
4414 // } 4457 // }
4415 // params.applyTimeIsNotNull = true; // 要求申请时间非空 4458 // params.applyTimeIsNotNull = true; // 要求申请时间非空
4416 - params.salesCode = userInfo.username; 4459 + params.salesCode = userInfo.nickName;
  4460 + if (salesCodeSelect !== undefined) {
  4461 + params.salesCode = salesCodeSelect;
  4462 + }
4417 params.warningStatus = 'waitFeedbackWarning'; // 发票确认预警 4463 params.warningStatus = 'waitFeedbackWarning'; // 发票确认预警
4418 params.isDeleteQueryOrder = false; // 强制查询非作废订单 4464 params.isDeleteQueryOrder = false; // 强制查询非作废订单
4419 // params.paymentMethod = 'UNPAID'; 4465 // params.paymentMethod = 'UNPAID';
@@ -4429,7 +4475,10 @@ const OrderPage = () =&gt; { @@ -4429,7 +4475,10 @@ const OrderPage = () =&gt; {
4429 // params.applyTimeLe = calDate; 4475 // params.applyTimeLe = calDate;
4430 // } 4476 // }
4431 // params.applyTimeIsNotNull = true; // 要求申请时间非空 4477 // params.applyTimeIsNotNull = true; // 要求申请时间非空
4432 - params.salesCode = userInfo.username; 4478 + params.salesCode = userInfo.nickName;
  4479 + if (salesCodeSelect !== undefined) {
  4480 + params.salesCode = salesCodeSelect;
  4481 + }
4433 params.warningStatus = 'invoiceConfirmWarning'; // 发票确认预警 4482 params.warningStatus = 'invoiceConfirmWarning'; // 发票确认预警
4434 params.isDeleteQueryOrder = false; // 强制查询非作废订单 4483 params.isDeleteQueryOrder = false; // 强制查询非作废订单
4435 // params.paymentMethod = 'UNPAID'; 4484 // params.paymentMethod = 'UNPAID';
@@ -4444,14 +4493,16 @@ const OrderPage = () =&gt; { @@ -4444,14 +4493,16 @@ const OrderPage = () =&gt; {
4444 } else { 4493 } else {
4445 params.applyTimeLe = calDate; 4494 params.applyTimeLe = calDate;
4446 } 4495 }
4447 - params.salesCode = userInfo.username; 4496 + params.salesCode = userInfo.nickName;
  4497 + if (salesCodeSelect !== undefined) {
  4498 + params.salesCode = salesCodeSelect;
  4499 + }
4448 params.isDeleteQueryOrder = false; // 强制查询非作废订单 4500 params.isDeleteQueryOrder = false; // 强制查询非作废订单
4449 params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 4501 params.paymentNotReceipt = true; // 在回款预警中标记未支付订单
4450 finalParams = { 4502 finalParams = {
4451 ...params, 4503 ...params,
4452 }; 4504 };
4453 } 4505 }
4454 -  
4455 //保存这个搜索条件 4506 //保存这个搜索条件
4456 setSearchParam(params); 4507 setSearchParam(params);
4457 const { data } = await postServiceOrderQueryServiceOrder({ 4508 const { data } = await postServiceOrderQueryServiceOrder({
@@ -4492,9 +4543,9 @@ const OrderPage = () =&gt; { @@ -4492,9 +4543,9 @@ const OrderPage = () =&gt; {
4492 toolbar={{ 4543 toolbar={{
4493 multipleLine: true, 4544 multipleLine: true,
4494 }} 4545 }}
4495 - // toolBarRender={() => {  
4496 - // return toolBarRender();  
4497 - // }} 4546 + // toolBarRender={() => {
  4547 + // return toolBarRender();
  4548 + // }}
4498 /> 4549 />
4499 4550
4500 {orderDrawerVisible && ( 4551 {orderDrawerVisible && (