diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 2ffe2dda..34eeacf1 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -577,11 +577,17 @@ export default class acclist extends React.Component { let validator = this.refs.addEditExchangeEl.submit() if (validator) { let param = this.refs.addEditExchangeEl.getModel() + // 第三步:包码只能选一个 - if (this.props.isSettlement === 1 && param.product.legal.length > 1) { - Notify.error("包码只能创建一个商品") - return + if (this.props.isSettlement >= 1) { + // 合并数组 + let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] + if (all_arr.length > 1) { + Notify.error("包码只能创建一个商品") + return + } } + let tempdata = this.state.distdata // 优惠券编辑 if (this.state.rowIndex > -1) { diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index df735a3a..d8f3410c 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -656,10 +656,13 @@ const UseKeyAddEdit = () => { let validator = addEditExchangeEl.current.submit() if (validator) { let param = addEditExchangeEl.current.getModel() - - if (state.isSettlement >= 1 && param.product.legal.length > 1) { - Notify.error("包码只能创建一个商品") - return + if (state.isSettlement >= 1) { + // 合并数组 + let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] + if (all_arr.length > 1) { + Notify.error("包码只能创建一个商品") + return + } } let tempData = state.distdata