fix: 修复优惠券管理时间问题
This commit is contained in:
parent
27ccc88f71
commit
5d1a3e765a
|
@ -246,6 +246,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
(async function init() {
|
(async function init() {
|
||||||
let KeyPcType = sessionStorage.getItem("KeyPcType");
|
let KeyPcType = sessionStorage.getItem("KeyPcType");
|
||||||
console.log("KeyPcType UseCouponAddEdit 1编辑 2复制 3新增 =>", KeyPcType);
|
console.log("KeyPcType UseCouponAddEdit 1编辑 2复制 3新增 =>", KeyPcType);
|
||||||
|
console.log("editData =>", editData);
|
||||||
// 第一步:1.判断组件是否是 优惠券管理 couponType
|
// 第一步:1.判断组件是否是 优惠券管理 couponType
|
||||||
if (couponType === 0) {
|
if (couponType === 0) {
|
||||||
// 如果是编辑
|
// 如果是编辑
|
||||||
|
@ -259,13 +260,18 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
plan_row !== undefined &&
|
plan_row !== undefined &&
|
||||||
plan_row !== "undefined"
|
plan_row !== "undefined"
|
||||||
) {
|
) {
|
||||||
sessionStorage.setItem(
|
|
||||||
"datetime",
|
|
||||||
JSON.stringify(plan_row.key.dateTime)
|
|
||||||
);
|
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
plan_id: plan_row,
|
plan_id: plan_row,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sessionStorage.setItem(
|
||||||
|
"knockGold_effectDate",
|
||||||
|
JSON.stringify({
|
||||||
|
begin_time: plan_row.key.dateTime[0],
|
||||||
|
end_time: plan_row.key.dateTime[1],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// 1.4 设置分销商
|
// 1.4 设置分销商
|
||||||
getResellerFun(plan_row.key.reseller_id);
|
getResellerFun(plan_row.key.reseller_id);
|
||||||
// 1.5 设置归属计划key
|
// 1.5 设置归属计划key
|
||||||
|
@ -310,11 +316,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
statusDisabledFun(editData.status);
|
statusDisabledFun(editData.status);
|
||||||
} else {
|
} else {
|
||||||
// 如果是新增,给计划时间
|
// 如果是新增,给计划时间
|
||||||
let deDateTime = sessionStorage.getItem("datetime");
|
let deDateTime = sessionStorage.getItem("knockGold_effectDate");
|
||||||
if (deDateTime) {
|
if (deDateTime) {
|
||||||
let times = JSON.parse(deDateTime);
|
let times = JSON.parse(deDateTime);
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
date_time: [times[0], times[1]],
|
date_time: [times.begin_time, times.end_time],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,14 +331,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
// 编辑处理函数
|
// 编辑处理函数
|
||||||
const editFun = () => {
|
const editFun = () => {
|
||||||
try {
|
try {
|
||||||
sessionStorage.setItem(
|
|
||||||
"knockGold_effectDate",
|
|
||||||
JSON.stringify({
|
|
||||||
begin_time: editData.begin_time,
|
|
||||||
end_time: editData.end_time,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// 基本信息
|
// 基本信息
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
title: editData.title,
|
title: editData.title,
|
||||||
|
@ -768,7 +766,13 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
|
|
||||||
// 计划select改变
|
// 计划select改变
|
||||||
const changePlan = async (e) => {
|
const changePlan = async (e) => {
|
||||||
sessionStorage.setItem("datetime", JSON.stringify(e.key.dateTime));
|
sessionStorage.setItem(
|
||||||
|
"knockGold_effectDate",
|
||||||
|
JSON.stringify({
|
||||||
|
begin_time: e.key.dateTime[0],
|
||||||
|
end_time: e.key.dateTime[1],
|
||||||
|
})
|
||||||
|
);
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
plan_id: e,
|
plan_id: e,
|
||||||
key_batch_id: "",
|
key_batch_id: "",
|
||||||
|
|
Loading…
Reference in New Issue