fix: 修复优惠券编辑根据计划时间选择
This commit is contained in:
parent
08f28aaad0
commit
e183c32f5d
|
@ -243,15 +243,14 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
if (couponType === 0) {
|
if (couponType === 0) {
|
||||||
// 1.1 获取归属计划下拉框数据
|
// 1.1 获取归属计划下拉框数据
|
||||||
await getPlanList().then((arr) => {
|
await getPlanList().then((arr) => {
|
||||||
|
console.log("arr =>", arr);
|
||||||
// 1.2 优惠券管理判断是新增还是编辑
|
// 1.2 优惠券管理判断是新增还是编辑
|
||||||
if (editData && editData !== "") {
|
if (editData && editData !== "") {
|
||||||
isEditFun();
|
isEditFun();
|
||||||
|
|
||||||
// 1.3 设置归属计划数据
|
// 1.3 设置归属计划数据
|
||||||
let plan_row = arr.find(
|
let plan_row = arr.find(
|
||||||
(item) => item.text === editData.plan_title
|
(item) => item.text === editData.plan_title
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
plan_row &&
|
plan_row &&
|
||||||
plan_row !== undefined &&
|
plan_row !== undefined &&
|
||||||
|
@ -687,14 +686,20 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const onDisabledRange = (date, type) => {
|
const onDisabledRange = (date, type) => {
|
||||||
let disabled = false;
|
let isDisabled = false;
|
||||||
if (type === "end") {
|
let str = moment(date).format("YYYY-MM-DD HH:mm:ss");
|
||||||
disabled = moment(date.getTime()).add(1, "days") <= new Date().getTime();
|
|
||||||
}
|
|
||||||
if (type === "start") {
|
if (type === "start") {
|
||||||
disabled = date.getTime() <= new Date().getTime();
|
isDisabled =
|
||||||
|
moment(str).isBefore(form_info_data.date_time[0]) ||
|
||||||
|
moment(str).isAfter(form_info_data.date_time[1]);
|
||||||
}
|
}
|
||||||
return disabled;
|
|
||||||
|
if (type === "end") {
|
||||||
|
isDisabled =
|
||||||
|
moment(str).add(1, "days").isBefore(form_info_data.date_time[0]) ||
|
||||||
|
moment(str).isAfter(form_info_data.date_time[1]);
|
||||||
|
}
|
||||||
|
return isDisabled;
|
||||||
};
|
};
|
||||||
const onPageChange = () => {};
|
const onPageChange = () => {};
|
||||||
const onCountChange = () => {};
|
const onCountChange = () => {};
|
||||||
|
|
Loading…
Reference in New Issue