fix: 修复批次创建设置
This commit is contained in:
parent
38b6f766f5
commit
76e3c6a72c
|
@ -494,11 +494,31 @@ const UseKeyAddEdit = () => {
|
||||||
|
|
||||||
// 样式切换
|
// 样式切换
|
||||||
const styleChange = (e) => {
|
const styleChange = (e) => {
|
||||||
|
if (isDisabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setModel({
|
setModel({
|
||||||
style: e.target.value,
|
style: e.target.value,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 禁用,启用
|
||||||
|
const isDisabled = () => {
|
||||||
|
// 首先是 判断 是否是复制 1编辑 2复制 3新增
|
||||||
|
if (state.KeyPcType === "2") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是编辑
|
||||||
|
if (state.KeyPcType === "1") {
|
||||||
|
if (state.key_status === 1) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 新建兑换码和优惠券
|
// 新建兑换码和优惠券
|
||||||
const planAddExchangeCoupon = (type) => {
|
const planAddExchangeCoupon = (type) => {
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
|
@ -900,7 +920,7 @@ const UseKeyAddEdit = () => {
|
||||||
styleChange(e);
|
styleChange(e);
|
||||||
}}
|
}}
|
||||||
value={model.style}
|
value={model.style}
|
||||||
disabled={state.KeyPcType === "1"}
|
disabled={isDisabled()}
|
||||||
>
|
>
|
||||||
<RadioButton value={1} disabled={model.style == 6}>
|
<RadioButton value={1} disabled={model.style == 6}>
|
||||||
串码
|
串码
|
||||||
|
@ -960,7 +980,7 @@ const UseKeyAddEdit = () => {
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
value={model.quantity}
|
value={model.quantity}
|
||||||
disabled={model.style === 6}
|
disabled={model.style === 6 || state.KeyPcType === "1"}
|
||||||
placeholder={"请输入"}
|
placeholder={"请输入"}
|
||||||
labelWidth={"0px"}
|
labelWidth={"0px"}
|
||||||
maxLength={5}
|
maxLength={5}
|
||||||
|
@ -1075,7 +1095,7 @@ const UseKeyAddEdit = () => {
|
||||||
prop="allow_repetition"
|
prop="allow_repetition"
|
||||||
>
|
>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
disabled={state.KeyPcType === "1"}
|
disabled={isDisabled()}
|
||||||
onChange={(e) => repeatGoodsCheck(e)}
|
onChange={(e) => repeatGoodsCheck(e)}
|
||||||
value={model.allow_repetition}
|
value={model.allow_repetition}
|
||||||
>
|
>
|
||||||
|
@ -1086,7 +1106,7 @@ const UseKeyAddEdit = () => {
|
||||||
|
|
||||||
<FormItem labelname="是否允许亏损" id="allow_loss" prop="allow_loss">
|
<FormItem labelname="是否允许亏损" id="allow_loss" prop="allow_loss">
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
disabled={state.KeyPcType === "1"}
|
disabled={isDisabled()}
|
||||||
onChange={(e) => lossCheck(e)}
|
onChange={(e) => lossCheck(e)}
|
||||||
value={model.allow_loss}
|
value={model.allow_loss}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue