|
@ -414,7 +414,7 @@ function CreditScoreMgm() { |
|
|
if (e.status == 20000) { |
|
|
if (e.status == 20000) { |
|
|
setPayVisible(true) |
|
|
setPayVisible(true) |
|
|
setPayData(e.data) |
|
|
setPayData(e.data) |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
message.error(e.message) |
|
|
message.error(e.message) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -429,16 +429,23 @@ function CreditScoreMgm() { |
|
|
const getRechargeRulesUpdate = (e) => { |
|
|
const getRechargeRulesUpdate = (e) => { |
|
|
let flag = [] |
|
|
let flag = [] |
|
|
let arr = [] |
|
|
let arr = [] |
|
|
|
|
|
let couflag = [] |
|
|
e.list.map((item) => { |
|
|
e.list.map((item) => { |
|
|
if (item.recharge == null || item.recharge == '') { |
|
|
if (item.recharge == null || item.recharge == '') { |
|
|
flag.push(false) |
|
|
flag.push(false) |
|
|
} else { |
|
|
} else { |
|
|
arr.push(item.recharge) |
|
|
arr.push(item.recharge) |
|
|
|
|
|
let couponArr = [] |
|
|
item.children.map((res) => { |
|
|
item.children.map((res) => { |
|
|
if (res.couponId == null || res.couponId == '' || res.num == null || res.num == '') { |
|
|
if (res.couponId == null || res.couponId == '' || res.num == null || res.num == '') { |
|
|
flag.push(false) |
|
|
flag.push(false) |
|
|
|
|
|
}else { |
|
|
|
|
|
couponArr.push(res.couponId) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
if (couponArr.length != [...new Set(couponArr)].length) { |
|
|
|
|
|
couflag.push(false) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (flatten(flag).some(ele => ele === false)) { |
|
|
if (flatten(flag).some(ele => ele === false)) { |
|
@ -449,6 +456,10 @@ function CreditScoreMgm() { |
|
|
message.error("每个规则对应的充值金额不能相同,请修改") |
|
|
message.error("每个规则对应的充值金额不能相同,请修改") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (flatten(couflag).some(ele => ele === false)) { |
|
|
|
|
|
message.error("每个规则添加的消费券不能相同,请修改") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
ajax.getRechargeRulesUpdate(e).then((e) => { |
|
|
ajax.getRechargeRulesUpdate(e).then((e) => { |
|
|
if (e.status == 20000) { |
|
|
if (e.status == 20000) { |
|
|
message.success(e.message) |
|
|
message.success(e.message) |
|
@ -463,7 +474,7 @@ function CreditScoreMgm() { |
|
|
if (e.status == 20000) { |
|
|
if (e.status == 20000) { |
|
|
message.success(e.message) |
|
|
message.success(e.message) |
|
|
return 1 |
|
|
return 1 |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
message.error(e.message) |
|
|
message.error(e.message) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -832,7 +843,9 @@ function CreditScoreMgm() { |
|
|
return <div className="pay-box"> |
|
|
return <div className="pay-box"> |
|
|
<div className="title">规则{index + 1}</div> |
|
|
<div className="title">规则{index + 1}</div> |
|
|
{index > 0 ? <div className="delrule-btn" onClick={() => { |
|
|
{index > 0 ? <div className="delrule-btn" onClick={() => { |
|
|
getRechargeRulesDel({ rid: item.rid }); |
|
|
|
|
|
|
|
|
if (item.rid) { |
|
|
|
|
|
getRechargeRulesDel({ rid: item.rid }); |
|
|
|
|
|
} |
|
|
let arr = payData |
|
|
let arr = payData |
|
|
arr.list.splice(index, 1); |
|
|
arr.list.splice(index, 1); |
|
|
setFlag(flag + 1) |
|
|
setFlag(flag + 1) |
|
@ -891,10 +904,11 @@ function CreditScoreMgm() { |
|
|
{ |
|
|
{ |
|
|
index2 > 0 && index2 + 1 == item.children.length ? |
|
|
index2 > 0 && index2 + 1 == item.children.length ? |
|
|
<div className="add-btn del-btn" onClick={() => { |
|
|
<div className="add-btn del-btn" onClick={() => { |
|
|
getRechargeRulesDel({ cid: res.couponId }) |
|
|
|
|
|
|
|
|
if (res.cid) { |
|
|
|
|
|
getRechargeRulesDel({ cid: res.cid }) |
|
|
|
|
|
} |
|
|
let arr = payData |
|
|
let arr = payData |
|
|
arr.list[index].children.splice(index2, 1); |
|
|
arr.list[index].children.splice(index2, 1); |
|
|
console.log(847, arr) |
|
|
|
|
|
setFlag(flag + 1) |
|
|
setFlag(flag + 1) |
|
|
setPayData(arr) |
|
|
setPayData(arr) |
|
|
} |
|
|
} |
|
|