fix: 修复组合商品
This commit is contained in:
parent
f4bfd1f1f4
commit
9861444f34
|
@ -363,21 +363,18 @@ export default class acclist extends React.Component {
|
|||
planAddExchangeCoupon(type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
sessionStorage.removeItem("has_combining")
|
||||
this.setState({ draw_title: "新建兑换码", exchangeType: 1, rowExchangeData: null })
|
||||
setTimeout(() => {
|
||||
this.refs.addEditExchangeEl.clearExchangeForm()
|
||||
}, 300)
|
||||
break
|
||||
case 1:
|
||||
sessionStorage.removeItem("has_combining")
|
||||
this.setState({ draw_title: "新建优惠券" })
|
||||
setTimeout(() => {
|
||||
this.refs.addEditCouponEl.clearCouponForm()
|
||||
}, 300)
|
||||
break
|
||||
case 2:
|
||||
sessionStorage.setItem("has_combining", 1)
|
||||
this.setState({ draw_title: "新建组合商品", exchangeType: 2, rowExchangeData: null })
|
||||
setTimeout(() => {
|
||||
this.refs.addEditExchangeEl.clearExchangeForm()
|
||||
|
@ -606,7 +603,7 @@ export default class acclist extends React.Component {
|
|||
let param = this.refs.addEditExchangeEl.getModel()
|
||||
|
||||
// 第三步:包码只能选一个
|
||||
if (this.props.isSettlement >= 1 && !sessionStorage.getItem("has_combining")) {
|
||||
if (this.props.isSettlement >= 1 && this.state.exchangeType !== 2) {
|
||||
// 合并数组
|
||||
let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash]
|
||||
if (all_arr.length > 1) {
|
||||
|
|
|
@ -563,14 +563,12 @@ const UseKeyAddEdit = () => {
|
|||
const planAddExchangeCoupon = (type) => {
|
||||
switch (type) {
|
||||
case 0:
|
||||
sessionStorage.removeItem("has_combining")
|
||||
setState({ draw_title: "新建兑换码", exchangeType: 1 })
|
||||
setTimeout(() => {
|
||||
addEditExchangeEl.current.clearExchangeForm()
|
||||
}, 300)
|
||||
break
|
||||
case 1:
|
||||
sessionStorage.removeItem("has_combining")
|
||||
setState({ draw_title: "新建优惠券" })
|
||||
setTimeout(() => {
|
||||
addEditCouponEl.current.clearCouponForm()
|
||||
|
@ -578,7 +576,6 @@ const UseKeyAddEdit = () => {
|
|||
break
|
||||
case 2:
|
||||
// 存储是否有组合商品
|
||||
sessionStorage.setItem("has_combining", 1)
|
||||
setState({ draw_title: "新建组合商品", exchangeType: 2 })
|
||||
setTimeout(() => {
|
||||
addEditExchangeEl.current.clearExchangeForm()
|
||||
|
@ -688,7 +685,7 @@ const UseKeyAddEdit = () => {
|
|||
let validator = addEditExchangeEl.current.submit()
|
||||
if (validator) {
|
||||
let param = addEditExchangeEl.current.getModel()
|
||||
if (state.isSettlement >= 1) {
|
||||
if (state.isSettlement >= 1 && state.exchangeType !== 2) {
|
||||
// 包码 合并数组
|
||||
let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash]
|
||||
if (all_arr.length > 1 && !sessionStorage.getItem("has_combining")) {
|
||||
|
|
Loading…
Reference in New Issue