From e79b2df5e2c40006b6510d6529ad0d2fbc1fb836 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 2 Nov 2022 10:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E5=8D=A1=E5=AF=86=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/edit.js | 7 ------- src/pages/plan/add/step2.js | 2 -- src/pages/plan/key/UseKeyAddEdit.jsx | 19 ++++++++++++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 44a14eb7..69169838 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -271,10 +271,6 @@ export default class add extends React.Component { }; let plan_id = sessionStorage.getItem("plan_id"); - console.log("key批次提交 =>", obj); - // 校验key批次卡密时间 - - return; await addPlanStep(plan_id, obj).then((res) => { handelResponse( res, @@ -480,9 +476,6 @@ export default class add extends React.Component { receive_email: this.state.email_list[0], payment_direction: this.state.payment_direction[this.state.paytype - 1], }; - - console.log("大提交 =>", data); - return; approvals(plan_id, data).then((res) => { handelResponse( res, diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 1f11d62d..babcb0a8 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -296,9 +296,7 @@ export default class acclist extends React.Component { data.mobile_excel = this.state.mobile_excel; data.mobile_repeat = this.state.mobile_repeat; console.log("data =>", data); - // 校验 卡密时间判断 - for (let i = 0; i < param.length; i++) { if (submitIsKm(param[i].product.legal) === false) { return valide; diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index f014962b..78d65dff 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -25,6 +25,7 @@ import Ipt from "@/components/input/main"; import Form from "@/components/form/main"; import FormItem from "@/components/form-item/main"; import Grid from "@/components/gird/main.js"; +import { submitIsKm } from "@/tools/index"; import UseCouponAddEdit from "@/components/UseCouponAddEdit"; // 优惠券 import UseExchangeAddEdit from "@/components/UseExchangeAddEdit"; // 兑换码 @@ -665,9 +666,10 @@ const UseKeyAddEdit = () => { const changeKeyName = () => { let falag = false; let keyBatch_id = sessionStorage.getItem("keybatch_id"); + let editData = []; // 如果是 keyType 1兑换码 2优惠券 if (state.keyType === 1) { - let editExchangeData = state.distdata.filter( + editData = state.distdata.filter( (item) => item.checked === true && (item.status === -1 || @@ -675,11 +677,11 @@ const UseKeyAddEdit = () => { item.id === "" || !item.id) ); - if (isDisabled() && editExchangeData.length <= 0) { + if (isDisabled() && editData.length <= 0) { falag = true; } } else { - let editCouponData = state.couponData.filter( + editData = state.couponData.filter( (item) => item.checked === true && (item.status === -1 || @@ -687,11 +689,18 @@ const UseKeyAddEdit = () => { item.id === "" || !item.id) ); - if (isDisabled() && editCouponData.length <= 0) { + if (isDisabled() && editData.length <= 0) { falag = true; } } + // 校验 卡密时间判断 + for (let i = 0; i < editData.length; i++) { + if (submitIsKm(editData[i].product.legal) === false) { + falag = false; + return; + } + } if (falag) { keyEditApproval(keyBatch_id, { id: state.id, @@ -707,7 +716,7 @@ const UseKeyAddEdit = () => { (req, msg) => { setTimeout(() => { window.history.back(); - }, 1000); + }, 500); }, (err) => { Notify.error(err);