fix:修复包码只能创建一个商品
This commit is contained in:
parent
d11b15edcd
commit
aaeda4ecfb
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue