feat: 增加key批次包码
This commit is contained in:
parent
6e6c55e6a8
commit
74bda83b3d
|
@ -578,6 +578,9 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
|||
return (
|
||||
<div className="draw">
|
||||
<Card style={{ width: "95%", margin: "10px auto" }} title={"基本信息"}>
|
||||
{/* <p>
|
||||
2222{props.isSettlement} {JSON.stringify(props.settlementData)}
|
||||
</p> */}
|
||||
<div className="addcode">
|
||||
<Form model={codeInfo} rules={codeInfoRules} ref={codeInfoEl} className="addform">
|
||||
<FormItem labelname="兑换码名称" prop="code_name" id="code_name">
|
||||
|
|
|
@ -216,7 +216,10 @@ const UseKeyAddEdit = () => {
|
|||
copyKeyCodeId: "",
|
||||
reseller_id: "",
|
||||
white_visible: false,
|
||||
keyCodeId: ""
|
||||
keyCodeId: "",
|
||||
settlement_type: 0,
|
||||
isSettlement: 0,
|
||||
settlementData: null
|
||||
})
|
||||
const keyFormEl = useRef(null)
|
||||
const bindObjEl = useRef(null)
|
||||
|
@ -232,7 +235,9 @@ const UseKeyAddEdit = () => {
|
|||
stock: "",
|
||||
merge_stock: 1,
|
||||
mobile_excel: "",
|
||||
mobile_repeat: []
|
||||
mobile_repeat: [],
|
||||
key_official_price: "",
|
||||
key_cost_price: ""
|
||||
})
|
||||
//#endRegion data ***************************/
|
||||
|
||||
|
@ -260,6 +265,17 @@ const UseKeyAddEdit = () => {
|
|||
}
|
||||
|
||||
const init = () => {
|
||||
/**包码TODO: 包码结算方式 0不是*/
|
||||
let plan_list_settlement_type = sessionStorage.getItem("plan_list_settlement_type")
|
||||
if (plan_list_settlement_type) {
|
||||
let settlement_type = Number(plan_list_settlement_type)
|
||||
setState({
|
||||
isSettlement: settlement_type > 0 ? 1 : 0,
|
||||
settlementData: settlement_type > 0 ? { key: settlement_type } : null,
|
||||
settlement_type
|
||||
})
|
||||
}
|
||||
|
||||
/* TODO: KeyPcType UseKeyAddEdit 1编辑 2复制 3新增 */
|
||||
let planItem = sessionStorage.getItem("plan_item")
|
||||
|
||||
|
@ -432,7 +448,9 @@ const UseKeyAddEdit = () => {
|
|||
stock: data.stock,
|
||||
merge_stock: data.merge_stock,
|
||||
mobile_excel: data.mobile_excel,
|
||||
mobile_repeat: data.mobile_repeat
|
||||
mobile_repeat: data.mobile_repeat,
|
||||
key_official_price: data.key_official_price,
|
||||
key_cost_price: data.key_cost_price
|
||||
})
|
||||
|
||||
let newData = []
|
||||
|
@ -621,6 +639,12 @@ 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
|
||||
}
|
||||
|
||||
let tempData = state.distdata
|
||||
// 优惠券编辑
|
||||
if (state.rowIndex > -1) {
|
||||
|
@ -807,9 +831,11 @@ const UseKeyAddEdit = () => {
|
|||
receive_email: state.reseller.contact_email[0],
|
||||
payment_direction: state.payment_direction[state.payType - 1]
|
||||
}
|
||||
// 参数 是否是优惠券还是兑换码
|
||||
// 参数 是否是优惠券还是兑换码 keyType 1兑换码 2优惠券
|
||||
if (state.keyType === 1) {
|
||||
create_param.code_batch = data
|
||||
create_param.key_official_price = model.key_official_price
|
||||
create_param.key_cost_price = model.key_cost_price
|
||||
} else {
|
||||
create_param.coupon = data
|
||||
}
|
||||
|
@ -837,7 +863,7 @@ const UseKeyAddEdit = () => {
|
|||
receive_email: state.reseller.contact_email[0],
|
||||
payment_direction: state.payment_direction[state.payType - 1]
|
||||
}
|
||||
// 参数 是否是优惠券还是兑换码
|
||||
// 参数 是否是优惠券还是兑换码 keyType 1兑换码 2优惠券
|
||||
if (state.keyType === 1) {
|
||||
edit_param.code_batch = data
|
||||
} else {
|
||||
|
@ -975,10 +1001,10 @@ const UseKeyAddEdit = () => {
|
|||
<RadioButton value={1} disabled={model.style == 6}>
|
||||
串码
|
||||
</RadioButton>
|
||||
<RadioButton value={2} disabled={model.style == 6}>
|
||||
<RadioButton value={2} disabled={model.style == 6 || state.settlement_type === 2}>
|
||||
链接
|
||||
</RadioButton>
|
||||
<RadioButton value={4} disabled={model.style == 6}>
|
||||
<RadioButton value={4} disabled={model.style == 6 || state.settlement_type === 2}>
|
||||
二维码
|
||||
</RadioButton>
|
||||
<RadioButton value={6} disabled={model.style != 6}>
|
||||
|
@ -987,6 +1013,56 @@ const UseKeyAddEdit = () => {
|
|||
</RadioGroup>
|
||||
</FormItem>
|
||||
|
||||
{state.isSettlement === 1 ? (
|
||||
<FormItem labelname="成本价" prop="key_cost_price" id="key_cost_price">
|
||||
<Ipt
|
||||
onChange={(e) => {
|
||||
setModel({
|
||||
key_cost_price: e
|
||||
})
|
||||
}}
|
||||
onClearItem={(e) => {
|
||||
setModel({
|
||||
key_cost_price: ""
|
||||
})
|
||||
}}
|
||||
value={model.key_cost_price}
|
||||
placeholder={"请输入"}
|
||||
labelWidth={"0px"}
|
||||
maxLength={12}
|
||||
height={"36px"}
|
||||
disabled={state.KeyPcType === "1"}
|
||||
width={"520px"}
|
||||
alignment={"left"}
|
||||
/>
|
||||
</FormItem>
|
||||
) : null}
|
||||
|
||||
{state.isSettlement === 1 ? (
|
||||
<FormItem labelname="官方价" prop="key_official_price" id="key_official_price">
|
||||
<Ipt
|
||||
onChange={(e) => {
|
||||
setModel({
|
||||
key_official_price: e
|
||||
})
|
||||
}}
|
||||
onClearItem={(e) => {
|
||||
setModel({
|
||||
key_official_price: ""
|
||||
})
|
||||
}}
|
||||
value={model.key_official_price}
|
||||
placeholder={"请输入"}
|
||||
labelWidth={"0px"}
|
||||
disabled={state.KeyPcType === "1"}
|
||||
maxLength={12}
|
||||
height={"36px"}
|
||||
width={"520px"}
|
||||
alignment={"left"}
|
||||
/>
|
||||
</FormItem>
|
||||
) : null}
|
||||
|
||||
{state.KeyPcType === "1" ? null : (
|
||||
<FormItem labelname="key数量" prop="quantity" id="quantity">
|
||||
<div className="key_number">
|
||||
|
@ -1068,6 +1144,12 @@ const UseKeyAddEdit = () => {
|
|||
{state.keyType === 1 ? (
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
if (state.settlement_type > 0) {
|
||||
if (state.distdata.length >= 1) {
|
||||
Notify.error(`只能创建一个兑换码`)
|
||||
return
|
||||
}
|
||||
}
|
||||
planAddExchangeCoupon(0)
|
||||
}}
|
||||
>
|
||||
|
@ -1196,6 +1278,8 @@ const UseKeyAddEdit = () => {
|
|||
direct_reseller_id={state.direct_reseller_id}
|
||||
editData={state.rowExChangeData}
|
||||
ref={addEditExchangeEl}
|
||||
isSettlement={state.isSettlement}
|
||||
settlementData={state.settlementData}
|
||||
></UseExchangeAddEdit>
|
||||
) : (
|
||||
<UseCouponAddEdit
|
||||
|
|
|
@ -470,6 +470,7 @@ export default class acclist extends React.Component {
|
|||
sessionStorage.setItem("linkshowname", "营销计划管理")
|
||||
sessionStorage.setItem("key_plan_id", row.id)
|
||||
sessionStorage.setItem("key_plan_status", row.status)
|
||||
sessionStorage.setItem("plan_list_settlement_type", row.settlement_type)
|
||||
// sessionStorage.setItem(
|
||||
// "datetime",
|
||||
// JSON.stringify([row.begin_time, row.end_time])
|
||||
|
|
Loading…
Reference in New Issue