diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 5e37c790..c6472c02 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -237,8 +237,10 @@ const UseKeyAddEdit = () => { white_visible: false, keyCodeId: "", settlement_type: 0, - isSettlement: Number(sessionStorage.getItem("plan_list_settlement_type")), - settlementData: null + isSettlement: sessionStorage.getItem("isSettlement") ? 1 : 2, + settlementData: sessionStorage.getItem("plan_list_settlement") + ? JSON.parse(sessionStorage.getItem("plan_list_settlement")) + : null }) const keyFormEl = useRef(null) const bindObjEl = useRef(null) @@ -322,19 +324,15 @@ const UseKeyAddEdit = () => { } /**包码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) - } + // 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 + // }) + // } } //#endRegion init ***************************/ @@ -685,7 +683,7 @@ const UseKeyAddEdit = () => { let validator = addEditExchangeEl.current.submit() if (validator) { let param = addEditExchangeEl.current.getModel() - if (state.isSettlement >= 1 && state.exchangeType !== 2) { + if (state.isSettlement === 1 && state.exchangeType !== 2) { // 包码 合并数组 let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] if (all_arr.length > 1 && !sessionStorage.getItem("has_combining")) { @@ -1094,7 +1092,7 @@ const UseKeyAddEdit = () => { - {state.isSettlement >= 1 ? ( + {state.isSettlement === 1 ? ( { @@ -1119,7 +1117,7 @@ const UseKeyAddEdit = () => { ) : null} - {state.isSettlement >= 1 ? ( + {state.isSettlement === 1 ? ( { @@ -1239,6 +1237,11 @@ const UseKeyAddEdit = () => {