fix: 修改key批次
This commit is contained in:
parent
8500a68357
commit
bcfe3f92e1
|
@ -55,6 +55,13 @@ export const Column = [
|
||||||
type: "normal",
|
type: "normal",
|
||||||
width: "auto"
|
width: "auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "创建时间",
|
||||||
|
name: "create_time",
|
||||||
|
prop: "create_time",
|
||||||
|
type: "normal",
|
||||||
|
width: "220px"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "成本价(元)",
|
title: "成本价(元)",
|
||||||
name: "key_cost_price",
|
name: "key_cost_price",
|
||||||
|
|
|
@ -41,7 +41,23 @@ const formRules = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
bind_object: [{ type: "required", message: "请选择绑定类型" }],
|
bind_object: [{ type: "required", message: "请选择绑定类型" }],
|
||||||
batch_name: [{ type: "required", message: "请输入key批次名称" }]
|
batch_name: [{ type: "required", message: "请输入key批次名称" }],
|
||||||
|
key_official_price: [
|
||||||
|
{ type: "required", message: "请输入官方价" },
|
||||||
|
{
|
||||||
|
type: "regExp",
|
||||||
|
message: "最多保留4位小数",
|
||||||
|
reg: "^[0-9]+(.[0-9]{1,4})?$"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
key_cost_price: [
|
||||||
|
{ type: "required", message: "请输入成本价" },
|
||||||
|
{
|
||||||
|
type: "regExp",
|
||||||
|
message: "最多保留4位小数",
|
||||||
|
reg: "^[0-9]+(.[0-9]{1,4})?$"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const excelColumn = [
|
const excelColumn = [
|
||||||
|
@ -218,7 +234,7 @@ const UseKeyAddEdit = () => {
|
||||||
white_visible: false,
|
white_visible: false,
|
||||||
keyCodeId: "",
|
keyCodeId: "",
|
||||||
settlement_type: 0,
|
settlement_type: 0,
|
||||||
isSettlement: 0,
|
isSettlement: Number(sessionStorage.getItem("plan_list_settlement_type")),
|
||||||
settlementData: null
|
settlementData: null
|
||||||
})
|
})
|
||||||
const keyFormEl = useRef(null)
|
const keyFormEl = useRef(null)
|
||||||
|
@ -242,9 +258,6 @@ const UseKeyAddEdit = () => {
|
||||||
//#endRegion data ***************************/
|
//#endRegion data ***************************/
|
||||||
|
|
||||||
//#region init ******************************/
|
//#region init ******************************/
|
||||||
useEffect(() => {
|
|
||||||
init()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
// 获取分销商id
|
// 获取分销商id
|
||||||
const getResellerFun = (id) => {
|
const getResellerFun = (id) => {
|
||||||
|
@ -265,17 +278,6 @@ const UseKeyAddEdit = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const init = () => {
|
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新增 */
|
/* TODO: KeyPcType UseKeyAddEdit 1编辑 2复制 3新增 */
|
||||||
let planItem = sessionStorage.getItem("plan_item")
|
let planItem = sessionStorage.getItem("plan_item")
|
||||||
|
|
||||||
|
@ -313,6 +315,21 @@ const UseKeyAddEdit = () => {
|
||||||
pageTitle: "复制key"
|
pageTitle: "复制key"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**包码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
|
||||||
|
})
|
||||||
|
|
||||||
|
// setTimeout(() => {
|
||||||
|
// keyFormEl.current.validator()
|
||||||
|
// }, 300)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//#endRegion init ***************************/
|
//#endRegion init ***************************/
|
||||||
|
|
||||||
|
@ -640,7 +657,7 @@ const UseKeyAddEdit = () => {
|
||||||
if (validator) {
|
if (validator) {
|
||||||
let param = addEditExchangeEl.current.getModel()
|
let param = addEditExchangeEl.current.getModel()
|
||||||
|
|
||||||
if (state.isSettlement === 1 && param.product.legal.length > 1) {
|
if (state.isSettlement >= 1 && param.product.legal.length > 1) {
|
||||||
Notify.error("包码只能创建一个商品")
|
Notify.error("包码只能创建一个商品")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -950,6 +967,10 @@ const UseKeyAddEdit = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
init()
|
||||||
|
}, [])
|
||||||
|
|
||||||
// 大提交
|
// 大提交
|
||||||
const bigSubmit = () => {
|
const bigSubmit = () => {
|
||||||
// 判断类型 keyType 1兑换码 2优惠券
|
// 判断类型 keyType 1兑换码 2优惠券
|
||||||
|
@ -1013,7 +1034,7 @@ const UseKeyAddEdit = () => {
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
{state.isSettlement === 1 ? (
|
{state.isSettlement >= 1 ? (
|
||||||
<FormItem labelname="成本价" prop="key_cost_price" id="key_cost_price">
|
<FormItem labelname="成本价" prop="key_cost_price" id="key_cost_price">
|
||||||
<Ipt
|
<Ipt
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
@ -1038,7 +1059,7 @@ const UseKeyAddEdit = () => {
|
||||||
</FormItem>
|
</FormItem>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{state.isSettlement === 1 ? (
|
{state.isSettlement >= 1 ? (
|
||||||
<FormItem labelname="官方价" prop="key_official_price" id="key_official_price">
|
<FormItem labelname="官方价" prop="key_official_price" id="key_official_price">
|
||||||
<Ipt
|
<Ipt
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
|
Loading…
Reference in New Issue