fix: 修改key批次

This commit is contained in:
zhangds 2024-02-28 16:39:23 +08:00
parent 8500a68357
commit bcfe3f92e1
2 changed files with 47 additions and 19 deletions

View File

@ -55,6 +55,13 @@ export const Column = [
type: "normal",
width: "auto"
},
{
title: "创建时间",
name: "create_time",
prop: "create_time",
type: "normal",
width: "220px"
},
{
title: "成本价(元)",
name: "key_cost_price",

View File

@ -41,7 +41,23 @@ const formRules = {
}
],
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 = [
@ -218,7 +234,7 @@ const UseKeyAddEdit = () => {
white_visible: false,
keyCodeId: "",
settlement_type: 0,
isSettlement: 0,
isSettlement: Number(sessionStorage.getItem("plan_list_settlement_type")),
settlementData: null
})
const keyFormEl = useRef(null)
@ -242,9 +258,6 @@ const UseKeyAddEdit = () => {
//#endRegion data ***************************/
//#region init ******************************/
useEffect(() => {
init()
}, [])
// id
const getResellerFun = (id) => {
@ -265,17 +278,6 @@ 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")
@ -313,6 +315,21 @@ const UseKeyAddEdit = () => {
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 ***************************/
@ -640,7 +657,7 @@ const UseKeyAddEdit = () => {
if (validator) {
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("包码只能创建一个商品")
return
}
@ -950,6 +967,10 @@ const UseKeyAddEdit = () => {
}
}
useEffect(() => {
init()
}, [])
//
const bigSubmit = () => {
// keyType 1 2
@ -1013,7 +1034,7 @@ const UseKeyAddEdit = () => {
</RadioGroup>
</FormItem>
{state.isSettlement === 1 ? (
{state.isSettlement >= 1 ? (
<FormItem labelname="成本价" prop="key_cost_price" id="key_cost_price">
<Ipt
onChange={(e) => {
@ -1038,7 +1059,7 @@ const UseKeyAddEdit = () => {
</FormItem>
) : null}
{state.isSettlement === 1 ? (
{state.isSettlement >= 1 ? (
<FormItem labelname="官方价" prop="key_official_price" id="key_official_price">
<Ipt
onChange={(e) => {