fix: 有数据审核失败编辑规则不能编辑
This commit is contained in:
parent
78e5365812
commit
0db88833c3
|
@ -103,10 +103,10 @@ const tableColumn = [
|
|||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
width: "575px",
|
||||
name: "create_time",
|
||||
prop: "create_time",
|
||||
type: "normal",
|
||||
width: "auto",
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
|
@ -210,6 +210,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
oldProduct: {}, // 旧数据,为编辑做准备
|
||||
id: "",
|
||||
status: -1,
|
||||
statusDisabled: false, // 3未开始、1进行中、2暂停中,有数据的审核驳回
|
||||
});
|
||||
|
||||
// 基础信息
|
||||
|
@ -236,7 +237,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
(async function init() {
|
||||
// 第一步:1.判断组件是否是 优惠券管理 couponType
|
||||
console.log("couponType =>", couponType);
|
||||
console.log("editData =>", editData);
|
||||
console.log("详情 =>", editData);
|
||||
let deDateTime = sessionStorage.getItem("datetime");
|
||||
console.log(deDateTime);
|
||||
if (couponType === 0) {
|
||||
|
@ -287,6 +288,8 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
oldProduct: editData.product,
|
||||
});
|
||||
}
|
||||
|
||||
statusDisabledFun(editData.status);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -296,6 +299,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
status: editData.status,
|
||||
});
|
||||
editFun();
|
||||
statusDisabledFun(editData.status);
|
||||
} else {
|
||||
// 如果是新增,给计划时间
|
||||
let deDateTime = sessionStorage.getItem("datetime");
|
||||
|
@ -397,6 +401,21 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
console.log(err);
|
||||
}
|
||||
};
|
||||
|
||||
// 状态不可修改
|
||||
const statusDisabledFun = (status) => {
|
||||
// 第一步判断是否是复制:
|
||||
if (state.isState === "1") {
|
||||
return;
|
||||
} else {
|
||||
if ([1, 2, 3].includes(status)) {
|
||||
setState({
|
||||
statusDisabled: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getPlanList = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
|
@ -900,7 +919,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
table_index: index,
|
||||
});
|
||||
} else {
|
||||
// 如果是复制删除id
|
||||
setState({
|
||||
product_title: "编辑商品",
|
||||
productData: rowData,
|
||||
|
@ -1203,6 +1221,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
width={"130px"}
|
||||
alignment={"left"}
|
||||
front="满"
|
||||
disabled={state.statusDisabled}
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
|
@ -1230,6 +1249,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
alignment={"left"}
|
||||
front="减"
|
||||
unit="元"
|
||||
disabled={state.statusDisabled}
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
|
@ -1243,7 +1263,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
onClearItem={() => {
|
||||
setForm_rule_data({ quantity: "" });
|
||||
}}
|
||||
disabled={state.isQuantity}
|
||||
disabled={state.isQuantity || state.statusDisabled}
|
||||
value={form_rule_data.quantity}
|
||||
placeholder={"请输入"}
|
||||
labelWidth={"0px"}
|
||||
|
@ -1287,6 +1307,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
countShow={false}
|
||||
width={"520px"}
|
||||
alignment={"left"}
|
||||
disabled={state.statusDisabled}
|
||||
/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
@ -1341,12 +1362,12 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
|||
>
|
||||
<Grid
|
||||
headBackgroud="#f9fafc"
|
||||
spliteColor={"#fff"}
|
||||
maxheight={200}
|
||||
isBorder={true}
|
||||
spliteColor={"#fff"}
|
||||
tableData={state.tableData}
|
||||
Column={tableColumn}
|
||||
countbarVisible={false}
|
||||
maxheight={state.tableHeight}
|
||||
isSwitch={false}
|
||||
isShowPageBar={false}
|
||||
page={state.page}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue