fix: 有数据审核失败编辑规则不能编辑

This commit is contained in:
zhangds 2022-10-11 11:45:07 +08:00
parent 78e5365812
commit 0db88833c3
2 changed files with 27 additions and 2058 deletions

View File

@ -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, // 312
});
//
@ -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