fix: 修复 兑换码包码

This commit is contained in:
zhangds 2024-03-04 14:28:13 +08:00
parent 5c7547f2ce
commit d1c9bacb95
3 changed files with 15 additions and 5 deletions

View File

@ -204,7 +204,8 @@ export default class exchangeAdd extends React.Component {
tempdata: reqCopy.goods || [], tempdata: reqCopy.goods || [],
plan_time: [reqCopy.plan.begin_time, reqCopy.plan.end_time], plan_time: [reqCopy.plan.begin_time, reqCopy.plan.end_time],
rank: checkedArray, rank: checkedArray,
rankoptions: arr rankoptions: arr,
settlement_type: reqCopy.plan.settlement_type
}) })
}, },
(err) => {} (err) => {}
@ -586,8 +587,17 @@ export default class exchangeAdd extends React.Component {
return Notify.error("请绑定对象") return Notify.error("请绑定对象")
} }
let approval_id = sessionStorage.getItem("approval_id") //
if (this.state.settlement_type > 0) {
//
let all_arr = [...updateProduct, ...addProduct]
if (all_arr.length > 1) {
Notify.error("包码只能创建一个商品")
return
}
}
let approval_id = sessionStorage.getItem("approval_id")
if (Number(approval_id) <= 0) { if (Number(approval_id) <= 0) {
// //
getIsRequireApproval(code_batch_id, data).then((res) => { getIsRequireApproval(code_batch_id, data).then((res) => {

View File

@ -183,7 +183,8 @@ export const init = () => {
planSelectData: [] /* 归属计划数据 */, planSelectData: [] /* 归属计划数据 */,
keyBatchSelectData: [] /* 归属key数据 */, keyBatchSelectData: [] /* 归属key数据 */,
codeStatus: "" /* 兑换码状态 */, codeStatus: "" /* 兑换码状态 */,
productData: null productData: null,
settlement_type: 0 // 大于0是包码
} }
} }

View File

@ -292,7 +292,6 @@ const UseKeyAddEdit = () => {
}) })
getResellerFun(planObj.reseller_id) getResellerFun(planObj.reseller_id)
} }
// KeyPcType 1 2 3 // KeyPcType 1 2 3
if (state.KeyPcType === "3") { if (state.KeyPcType === "3") {
setState({ setState({
@ -658,7 +657,7 @@ const UseKeyAddEdit = () => {
if (validator) { if (validator) {
let param = addEditExchangeEl.current.getModel() let param = addEditExchangeEl.current.getModel()
if (state.isSettlement >= 1) { if (state.isSettlement >= 1) {
// //
let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash]
if (all_arr.length > 1) { if (all_arr.length > 1) {
Notify.error("包码只能创建一个商品") Notify.error("包码只能创建一个商品")