diff --git a/src/pages/order/settlementList/utils.js b/src/pages/order/settlementList/utils.js index 1d834912..074dfe23 100644 --- a/src/pages/order/settlementList/utils.js +++ b/src/pages/order/settlementList/utils.js @@ -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", diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 1ccb1c14..df735a3a 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -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 = () => { - {state.isSettlement === 1 ? ( + {state.isSettlement >= 1 ? ( { @@ -1038,7 +1059,7 @@ const UseKeyAddEdit = () => { ) : null} - {state.isSettlement === 1 ? ( + {state.isSettlement >= 1 ? ( {