From 5a637bbe158741cbbe867a37761b7883aeca9409 Mon Sep 17 00:00:00 2001 From: lisf Date: Fri, 15 Dec 2023 11:05:14 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E4=BF=AE=E5=A4=8D=E7=A9=BF=E6=A2=AD?= =?UTF-8?q?=E6=A1=86=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingCard/ParkingCardMgm/loadable.jsx | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardMgm/loadable.jsx b/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardMgm/loadable.jsx index 6fd4adc..92c65af 100644 --- a/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardMgm/loadable.jsx +++ b/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardMgm/loadable.jsx @@ -247,7 +247,7 @@ function ParkingCardMgm(props) { if(record.scope){ setGetScope(record.scope != "1" ? "2" : "1") }else{ - setGetScope("") + setGetScope("1") } setGetvalueNum(record.card_num == 0 ? 1 : 2) setActionType(2) @@ -255,7 +255,7 @@ function ParkingCardMgm(props) { setCheckData({ ...checkData, ...record, - scope:record.scope || "1" + scope:record.scope || "" }) scopeRef.current = record.scope; } @@ -305,7 +305,6 @@ function ParkingCardMgm(props) { ] // 获取列表数据 const getData = (data = formData) => { - console.log(data); setAjaxLoading(true) ajax.getParkcardrList(data).then(res => { setAjaxLoading(false) @@ -468,12 +467,18 @@ function ParkingCardMgm(props) { //商户名称 const handleOperator = (v) => { setCheckData({ ...checkData, operator_id: v }) - getEtcStatus(v) + // getEtcStatus(v) } //适用范围 const [getScope, setGetScope] = useState("") const handleCcope = (v) => { setGetScope(v) + if(v == "1"){ + setCheckData({ + ...checkData, + scope:'' + }) + } // setCheckData({ // ...checkData, // scope:v == "1" ? "" : v @@ -527,8 +532,10 @@ function ParkingCardMgm(props) { ); } const transferEtcChange = (nextTargetKeys) => { - console.log(nextTargetKeys); - nextTargetKeys.splice(nextTargetKeys.length - 1,1) + let index = nextTargetKeys.indexOf(''); + if(index > -1){ + nextTargetKeys.splice(index,1) + } let str = nextTargetKeys.toString() setEtcTargetKeys(nextTargetKeys); setCheckData({ ...checkData, scope: str || "" }) @@ -572,7 +579,6 @@ function ParkingCardMgm(props) { setCheckData({ ...checkData, card_num: '' }) } }; - console.log(checkData); // 处理原价 const handlePrice = (v) => { if(v - checkData.discount_amount < 0 && v) { @@ -701,6 +707,11 @@ function ParkingCardMgm(props) { // getEtcStatus() }, []) + useEffect(() => { + if(checkData.operator_id){ + getEtcStatus(checkData.operator_id) + } + }, [checkData.operator_id]) return <>