From 76e3c6a72c354a4a14902381b13b6825edd8d692 Mon Sep 17 00:00:00 2001 From: zhangds Date: Thu, 27 Oct 2022 15:13:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/UseKeyAddEdit.jsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 869caaa9..c94db83c 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -494,11 +494,31 @@ const UseKeyAddEdit = () => { // 样式切换 const styleChange = (e) => { + if (isDisabled()) { + return; + } setModel({ 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) => { if (type === 0) { @@ -900,7 +920,7 @@ const UseKeyAddEdit = () => { styleChange(e); }} value={model.style} - disabled={state.KeyPcType === "1"} + disabled={isDisabled()} > 串码 @@ -960,7 +980,7 @@ const UseKeyAddEdit = () => { }); }} value={model.quantity} - disabled={model.style === 6} + disabled={model.style === 6 || state.KeyPcType === "1"} placeholder={"请输入"} labelWidth={"0px"} maxLength={5} @@ -1075,7 +1095,7 @@ const UseKeyAddEdit = () => { prop="allow_repetition" > repeatGoodsCheck(e)} value={model.allow_repetition} > @@ -1086,7 +1106,7 @@ const UseKeyAddEdit = () => { lossCheck(e)} value={model.allow_loss} >