From de0737711d14f114dade80f9d753f2cee230de9f Mon Sep 17 00:00:00 2001 From: zhangds Date: Thu, 29 Sep 2022 18:37:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E6=89=B9=E6=AC=A1=E6=97=A0=E6=B3=95=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 0833f3f1..537f6a91 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -881,7 +881,7 @@ export default class acclist extends React.Component { data.batch_name = this.state.model.batch_name; data.style = this.state.model.style; data.quantity = this.state.model.quantity; - data.bind_object = this.state.keyType; + data.bind_object = [this.state.keyType]; data.allow_repetition = this.state.model.allow_repetition; data.allow_loss = this.state.model.allow_loss; data.merge_stock = this.state.model.merge_stock; @@ -969,7 +969,7 @@ export default class acclist extends React.Component { } onBindNum(e, row, rowIndex) { - if (this.props.keyType === 1) { + if (this.state.keyType === 1) { this.state.distdata[rowIndex].restrict = e.target.value; this.setState({ distdata: this.state.distdata }); } else { From 2e7a0fad9fa3b07f55cf279f54f0a120b465c09b Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 30 Sep 2022 10:23:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dkey=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E7=BB=91=E5=AE=9A=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/key/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 0c3e87d0..b1ddb95b 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -228,6 +228,7 @@ export default class acclist extends React.Component { // key 批次的处理 keyFormat(data) { console.log("data =>", data); + return; // 兑换码 if (Number(data.bind_object[0]) === 1) { let temp = []; @@ -1443,7 +1444,7 @@ export default class acclist extends React.Component { { this.onCheckChange(e); }} From 08f28aaad0f008d9a830b75e5721f8800e3aacd1 Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 30 Sep 2022 10:49:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=A4=8D=E5=88=B6=E3=80=81=E7=BC=96=E8=BE=91=E5=BD=92?= =?UTF-8?q?=E5=B1=9Ekey=E4=B8=8D=E8=83=BD=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 16 ++++++++-------- src/pages/coupon/addEdit/index.jsx | 1 - src/pages/coupon/list/index.jsx | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 5d5307fa..9d427295 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -192,7 +192,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => { examinePopShow: false, payType: 3, payment_direction: ["对私账户", "对公账户", "预付款扣除"], - isState: "", + isState: sessionStorage.getItem("isState"), // 是否编辑和复制 coupon_batch_id: "", isEdit: false, oldProduct: {}, // 旧数据,为编辑做准备 @@ -221,7 +221,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => { const isEditFun = () => { // 是否是编辑 - if (sessionStorage.getItem("isState") === "2") { + if (state.isState === "2") { setState({ isEdit: true, }); @@ -240,10 +240,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => { // 第一步:1.判断组件是否是 优惠券管理 couponType console.log("couponType =>", couponType); console.log("editData =>", editData); - let isState = sessionStorage.getItem("isState"); - setState({ - isState: isState, - }); if (couponType === 0) { // 1.1 获取归属计划下拉框数据 await getPlanList().then((arr) => { @@ -1029,7 +1025,9 @@ const UseCouponAddEdit = forwardRef((props, ref) => { renderOptionList={renderOptionList} options={state.plan_OPTIONS} value={form_info_data.plan_id} - disabled={state.isState === "2" ? true : false} + disabled={ + state.isState === "2" || state.isState === "1" ? true : false + } onChange={(e) => { changePlan(e); }} @@ -1045,7 +1043,9 @@ const UseCouponAddEdit = forwardRef((props, ref) => { renderOptionList={renderOptionList} options={state.key_OPTIONS} value={form_info_data.key_batch_id} - disabled={state.isState === "2" ? true : false} + disabled={ + state.isState === "2" || state.isState === "1" ? true : false + } onChange={(e) => { setForm_info_data({ key_batch_id: e }); }} diff --git a/src/pages/coupon/addEdit/index.jsx b/src/pages/coupon/addEdit/index.jsx index a8cf1119..db0db0e3 100644 --- a/src/pages/coupon/addEdit/index.jsx +++ b/src/pages/coupon/addEdit/index.jsx @@ -25,7 +25,6 @@ const CouponAddEdit = () => { ) { getCouponDetails(coupon_batch_id).then((res) => { handelResponse(res, (req, msg) => { - console.log("优惠券详情 =>", req); setState({ editModel: req, isShow: true }); }); }); diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index f44ea255..a042c02e 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -166,7 +166,6 @@ const UseCouponList = () => { page: state.page, limit: state.limit, }; - console.log("getParam =>", param); param = _.omitBy( { ...param, From e183c32f5d088802be19e0b6dc6607a677cb93be Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 30 Sep 2022 11:19:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E7=BC=96=E8=BE=91=E6=A0=B9=E6=8D=AE=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 9d427295..062a3e09 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -243,15 +243,14 @@ const UseCouponAddEdit = forwardRef((props, ref) => { if (couponType === 0) { // 1.1 获取归属计划下拉框数据 await getPlanList().then((arr) => { + console.log("arr =>", arr); // 1.2 优惠券管理判断是新增还是编辑 if (editData && editData !== "") { isEditFun(); - // 1.3 设置归属计划数据 let plan_row = arr.find( (item) => item.text === editData.plan_title ); - if ( plan_row && plan_row !== undefined && @@ -687,14 +686,20 @@ const UseCouponAddEdit = forwardRef((props, ref) => { ); }; const onDisabledRange = (date, type) => { - let disabled = false; - if (type === "end") { - disabled = moment(date.getTime()).add(1, "days") <= new Date().getTime(); - } + let isDisabled = false; + let str = moment(date).format("YYYY-MM-DD HH:mm:ss"); if (type === "start") { - disabled = date.getTime() <= new Date().getTime(); + isDisabled = + moment(str).isBefore(form_info_data.date_time[0]) || + moment(str).isAfter(form_info_data.date_time[1]); } - return disabled; + + if (type === "end") { + isDisabled = + moment(str).add(1, "days").isBefore(form_info_data.date_time[0]) || + moment(str).isAfter(form_info_data.date_time[1]); + } + return isDisabled; }; const onPageChange = () => {}; const onCountChange = () => {};