1) 优惠计划优惠券
This commit is contained in:
parent
54d7b196a8
commit
24b1744063
|
@ -162,8 +162,7 @@ const rule_rules = {
|
||||||
|
|
||||||
const UseCouponAddEdit = forwardRef((props, ref) => {
|
const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
// 注意 !!!!!!!!couponType 入口类型 0优惠券新增(显示) 1计划、key批次 (是否显示归属计划和归宿key两个字段)!!!!
|
// 注意 !!!!!!!!couponType 入口类型 0优惠券新增(显示) 1计划、key批次 (是否显示归属计划和归宿key两个字段)!!!!
|
||||||
// comType 组件操作类型 0新增 1编辑 2复制
|
const { couponType = 0, direct_reseller_id, editData } = props;
|
||||||
const { couponType = 0, direct_reseller_id, editData, comType } = props;
|
|
||||||
|
|
||||||
const [state, setState] = useSetState({
|
const [state, setState] = useSetState({
|
||||||
setup1_title: "基本信息",
|
setup1_title: "基本信息",
|
||||||
|
@ -225,16 +224,16 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
if (couponType === 0) {
|
if (couponType === 0) {
|
||||||
sessionStorage.setItem("keyType", 2);
|
sessionStorage.setItem("keyType", 2);
|
||||||
// 1.1 获取归属计划下拉框数据
|
// 1.1 获取归属计划下拉框数据
|
||||||
await getPlanList(); // 获取计划
|
await getPlanList(); // 获取归属计划
|
||||||
// 1.2 判断组件操作函数 comType操作 0新增 1编辑 2复制
|
// 1.2 优惠券管理判断是新增还是编辑
|
||||||
if (comType === 0) {
|
if (editData && editData !== "") {
|
||||||
AddFun();
|
|
||||||
} else if (comType === 1) {
|
|
||||||
editFun();
|
editFun();
|
||||||
} else {
|
|
||||||
copyFun();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 1.3 计划的优惠券编辑
|
||||||
|
if (editData && editData !== "") {
|
||||||
|
editFun();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -242,7 +241,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
// 编辑处理函数
|
// 编辑处理函数
|
||||||
const editFun = () => {
|
const editFun = () => {
|
||||||
try {
|
try {
|
||||||
if (editData && editData !== "") {
|
|
||||||
// 基本信息
|
// 基本信息
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
title: editData.title,
|
title: editData.title,
|
||||||
|
@ -305,7 +303,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
rank: arr,
|
rank: arr,
|
||||||
tableData: scope_data,
|
tableData: scope_data,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
};
|
};
|
||||||
// 新增处理函数
|
// 新增处理函数
|
||||||
|
|
|
@ -45,7 +45,6 @@ const CouponAddEdit = () => {
|
||||||
{state.isShow ? (
|
{state.isShow ? (
|
||||||
<UseCouponAddEdit
|
<UseCouponAddEdit
|
||||||
couponType={0}
|
couponType={0}
|
||||||
comType={state.comType}
|
|
||||||
editData={state.editModel}
|
editData={state.editModel}
|
||||||
isAuditButton={false}
|
isAuditButton={false}
|
||||||
ref={addEditCouponEl}
|
ref={addEditCouponEl}
|
||||||
|
|
|
@ -646,8 +646,14 @@ export default class acclist extends React.Component {
|
||||||
onRestrict(e, rowdata, index) {
|
onRestrict(e, rowdata, index) {
|
||||||
let text = e.target.value;
|
let text = e.target.value;
|
||||||
text = text.replace(/[^\d]/g, "");
|
text = text.replace(/[^\d]/g, "");
|
||||||
|
|
||||||
|
if (this.props.keyType === 1) {
|
||||||
this.state.distdata[index].restrict = text;
|
this.state.distdata[index].restrict = text;
|
||||||
this.setState({ distdata: this.state.distdata });
|
this.setState({ distdata: this.state.distdata });
|
||||||
|
} else {
|
||||||
|
this.state.couponData[index].restrict = text;
|
||||||
|
this.setState({ couponData: this.state.couponData });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisabledCombinedDate = (val) => {
|
onDisabledCombinedDate = (val) => {
|
||||||
|
@ -1725,8 +1731,8 @@ export default class acclist extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<UseCouponAddEdit
|
<UseCouponAddEdit
|
||||||
editData={this.state.rowCouponData}
|
|
||||||
couponType={1}
|
couponType={1}
|
||||||
|
editData={this.state.rowCouponData}
|
||||||
isAuditButton={false}
|
isAuditButton={false}
|
||||||
ref="addEditCouponEl"
|
ref="addEditCouponEl"
|
||||||
direct_reseller_id={this.props.direct_reseller_id}
|
direct_reseller_id={this.props.direct_reseller_id}
|
||||||
|
|
Loading…
Reference in New Issue