Commit f150fa89 authored by 王苓芝's avatar 王苓芝

添加订单id格式校验&提示文本修改

parent 3818b593
......@@ -26,6 +26,12 @@ export default () => {
const query = async (params, type) => {
if (params.orderId) {
params.orderId = `${params.orderId}`.replace(/\s/g, '');
if (Number.isNaN(+params.orderId)) {
notification.warning({
message: '输入的订单Id只能为数字格式',
});
return false;
}
}
if (params.receiverPhone) {
const reg = /^1[3456789]\d{9}$/;
......@@ -51,7 +57,7 @@ export default () => {
const endTime = params.applyTime[1];
if (dateDiff(startTime, endTime)) {
notification.warning({
message: '您输入的订单提交时间超过3个月啦!',
message: '您输入的订单取消提交时间超过3个月啦!',
});
return false;
}
......
......@@ -14,29 +14,16 @@ export default () => {
const [detailVisible, setDetailVisible] = useState(false);
const [detailInfo, setDetailInfo] = useState([]);
const [auditInfo, setAuditInfo] = useState({});
// const dateDiff = (startTime, endTime) => {
// const startY = startTime.substr(0, 4);
// const startM = startTime.substr(5, 2);
// const startD = startTime.substr(8, 2);
// const endY = endTime.substr(0, 4);
// const endM = endTime.substr(5, 2);
// const endD = endTime.substr(8, 2);
// if (endY - startY > 0) {
// if (
// (endY - startY) * (12 - startM) + endM > 3 ||
// ((endY - startY) * (12 - startM) + endM === 3 && endD > startD)
// ) {
// return true;
// }
// } else if (endM - startM > 3 || (endM - startM === 3 && endD > startD)) {
// return true;
// }
// return false;
// };
const query = async (params, type) => {
if (params.orderId) {
params.orderId = `${params.orderId}`.replace(/\s/g, '');
if (Number.isNaN(+params.orderId)) {
notification.warning({
message: '输入的订单Id只能为数字格式',
});
return false;
}
}
if (params.receiverPhone) {
const reg = /^1[3456789]\d{9}$/;
......@@ -62,7 +49,7 @@ export default () => {
const endTime = params.applyTime[1];
if (dateDiff(startTime, endTime)) {
notification.warning({
message: '您输入的订单提交时间超过3个月啦!',
message: '您输入的订单取消提交时间超过3个月啦!',
});
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment