Commit fa92e4fcad17ffb12d000bed036a2936e9266ea9
Merge branch 'master' of http://39.108.227.113:8001/zhusen/canrd-erp-front
Showing
1 changed file
with
66 additions
and
21 deletions
src/pages/Order/OrderWarning/index.tsx
@@ -4119,22 +4119,22 @@ const OrderPage = () => { | @@ -4119,22 +4119,22 @@ const OrderPage = () => { | ||
4119 | //选择天数1 | 4119 | //选择天数1 |
4120 | const options1 = [ | 4120 | const options1 = [ |
4121 | { | 4121 | { |
4122 | - label: '超过15天', | ||
4123 | - value: 15, | 4122 | + label: '超过7天', |
4123 | + value: 7, | ||
4124 | }, | 4124 | }, |
4125 | { | 4125 | { |
4126 | - label: '超过30天', | ||
4127 | - value: 30, | 4126 | + label: '超过10天', |
4127 | + value: 10, | ||
4128 | }, | 4128 | }, |
4129 | ]; | 4129 | ]; |
4130 | const options2 = [ | 4130 | const options2 = [ |
4131 | { | 4131 | { |
4132 | - label: '超过15天', | ||
4133 | - value: 15, | 4132 | + label: '超过20天', |
4133 | + value: 20, | ||
4134 | }, | 4134 | }, |
4135 | { | 4135 | { |
4136 | - label: '超过30天', | ||
4137 | - value: 30, | 4136 | + label: '超过45天', |
4137 | + value: 45, | ||
4138 | }, | 4138 | }, |
4139 | ]; | 4139 | ]; |
4140 | const options3 = [ | 4140 | const options3 = [ |
@@ -4234,12 +4234,62 @@ const OrderPage = () => { | @@ -4234,12 +4234,62 @@ const OrderPage = () => { | ||
4234 | mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** | 4234 | mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** |
4235 | }, [activeTabKey]); | 4235 | }, [activeTabKey]); |
4236 | // 修改位置:监听 value1 的变化 | 4236 | // 修改位置:监听 value1 的变化 |
4237 | + // useEffect(() => { | ||
4238 | + // // if (value1 === 0) { | ||
4239 | + // // // 这里执行你希望在 value1 为 0 时的逻辑 | ||
4240 | + // // mainTableRef.current?.reload(); // 重新请求数据 | ||
4241 | + // // } | ||
4242 | + | ||
4243 | + // }, [value1]); // 添加了 value1 作为依赖 | ||
4244 | + | ||
4237 | useEffect(() => { | 4245 | useEffect(() => { |
4238 | - if (value1 === 0) { | ||
4239 | - // 这里执行你希望在 value1 为 0 时的逻辑 | ||
4240 | - mainTableRef.current?.reload(); // 重新请求数据 | 4246 | + // 根据 activeTabKey 设置默认值 |
4247 | + // getValue1(); | ||
4248 | + // switch (activeTabKey) { | ||
4249 | + // case 1: | ||
4250 | + // setValue1(options1[0]?.value || 0); // 使用选项组1的第一个value | ||
4251 | + // break; | ||
4252 | + // case 2: | ||
4253 | + // setValue1(options2[0]?.value || 0); // 使用选项组2的第一个value | ||
4254 | + // break; | ||
4255 | + // case 3: | ||
4256 | + // setValue1(options3[0]?.value || 0); // 使用选项组3的第一个value | ||
4257 | + // break; | ||
4258 | + // case 4: | ||
4259 | + // setValue1(options4[0]?.value || 0); // 使用选项组4的第一个value | ||
4260 | + // break; | ||
4261 | + // default: | ||
4262 | + // setValue1(0); // 默认值为空 | ||
4263 | + // break; | ||
4264 | + // } | ||
4265 | + // 根据 activeTabKey 设置 value1 为当前选项组的第一个 value | ||
4266 | + let options; | ||
4267 | + switch (activeTabKey) { | ||
4268 | + case 1: | ||
4269 | + options = options1; | ||
4270 | + break; | ||
4271 | + case 2: | ||
4272 | + options = options2; | ||
4273 | + break; | ||
4274 | + case 3: | ||
4275 | + options = options3; | ||
4276 | + break; | ||
4277 | + case 4: | ||
4278 | + options = options4; | ||
4279 | + break; | ||
4280 | + default: | ||
4281 | + options = []; // 如果没有匹配的选项组,默认为空 | ||
4241 | } | 4282 | } |
4242 | - }, [value1]); // 添加了 value1 作为依赖 | 4283 | + |
4284 | + const firstOptionValue = options[0]?.value || 0; // 获取第一个值 | ||
4285 | + setValue1(firstOptionValue); | ||
4286 | + const currentDate = new Date(); | ||
4287 | + // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 | ||
4288 | + const newDate = new Date(currentDate); | ||
4289 | + newDate.setDate(currentDate.getDate() - firstOptionValue); | ||
4290 | + const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss'); | ||
4291 | + setCalDate(formattedDate); | ||
4292 | + }, [activeTabKey]); | ||
4243 | //biaojidown2 | 4293 | //biaojidown2 |
4244 | //取消单选,将时间设为null | 4294 | //取消单选,将时间设为null |
4245 | const handleSetNull = () => { | 4295 | const handleSetNull = () => { |
@@ -4473,7 +4523,6 @@ const OrderPage = () => { | @@ -4473,7 +4523,6 @@ const OrderPage = () => { | ||
4473 | // params.applyTimeIsNotNull = true; // 要求申请时间非空 | 4523 | // params.applyTimeIsNotNull = true; // 要求申请时间非空 |
4474 | params.orderStatus = 'SHIPPED'; // 发票确认预警 | 4524 | params.orderStatus = 'SHIPPED'; // 发票确认预警 |
4475 | params.isDeleteQueryOrder = false; // 强制查询非作废订单 | 4525 | params.isDeleteQueryOrder = false; // 强制查询非作废订单 |
4476 | - console.log(userInfo, '5656userInfo'); | ||
4477 | params.salesCode = userInfo.username; | 4526 | params.salesCode = userInfo.username; |
4478 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { | 4527 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { |
4479 | params.salesCode = salesCodeSelect; | 4528 | params.salesCode = salesCodeSelect; |
@@ -4481,7 +4530,7 @@ const OrderPage = () => { | @@ -4481,7 +4530,7 @@ const OrderPage = () => { | ||
4481 | // params.paymentMethod = 'UNPAID'; | 4530 | // params.paymentMethod = 'UNPAID'; |
4482 | finalParams = { | 4531 | finalParams = { |
4483 | ...params, | 4532 | ...params, |
4484 | - statusDatetimeLe: calDate, | 4533 | + waitConfirmReiceptStatusDateTimeLe: calDate, |
4485 | }; | 4534 | }; |
4486 | } else if (activeTabKey === 2) { | 4535 | } else if (activeTabKey === 2) { |
4487 | // // 第一段代码 | 4536 | // // 第一段代码 |
@@ -4500,7 +4549,7 @@ const OrderPage = () => { | @@ -4500,7 +4549,7 @@ const OrderPage = () => { | ||
4500 | // params.paymentMethod = 'UNPAID'; | 4549 | // params.paymentMethod = 'UNPAID'; |
4501 | finalParams = { | 4550 | finalParams = { |
4502 | ...params, | 4551 | ...params, |
4503 | - confirmReceiptDatetimeLe: calDate, | 4552 | + waitFeedbackStatusDateTimeLe: calDate, |
4504 | }; | 4553 | }; |
4505 | } else if (activeTabKey === 3) { | 4554 | } else if (activeTabKey === 3) { |
4506 | // 第一段代码 | 4555 | // 第一段代码 |
@@ -4519,15 +4568,10 @@ const OrderPage = () => { | @@ -4519,15 +4568,10 @@ const OrderPage = () => { | ||
4519 | // params.paymentMethod = 'UNPAID'; | 4568 | // params.paymentMethod = 'UNPAID'; |
4520 | finalParams = { | 4569 | finalParams = { |
4521 | ...params, | 4570 | ...params, |
4522 | - invoicingEndTime: calDate, | 4571 | + waitConfirmInvoiceStatusDateTimeLe: calDate, |
4523 | }; | 4572 | }; |
4524 | } else if (activeTabKey === 4) { | 4573 | } else if (activeTabKey === 4) { |
4525 | params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警 | 4574 | params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警 |
4526 | - if (calDate === 'null') { | ||
4527 | - params.applyTimeLe = null; | ||
4528 | - } else { | ||
4529 | - params.applyTimeLe = calDate; | ||
4530 | - } | ||
4531 | params.salesCode = userInfo.username; | 4575 | params.salesCode = userInfo.username; |
4532 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { | 4576 | if (salesCodeSelect !== undefined && salesCodeSelect !== null) { |
4533 | params.salesCode = salesCodeSelect; | 4577 | params.salesCode = salesCodeSelect; |
@@ -4536,6 +4580,7 @@ const OrderPage = () => { | @@ -4536,6 +4580,7 @@ const OrderPage = () => { | ||
4536 | params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 | 4580 | params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 |
4537 | finalParams = { | 4581 | finalParams = { |
4538 | ...params, | 4582 | ...params, |
4583 | + waitConfirmPaymentStatusDateTimeLe: calDate, | ||
4539 | }; | 4584 | }; |
4540 | } | 4585 | } |
4541 | //保存这个搜索条件 | 4586 | //保存这个搜索条件 |