From e62af9d941858c6643f3724815b5a63b5a5cc6b8 Mon Sep 17 00:00:00 2001 From: guoxin Date: Tue, 23 Jan 2024 15:11:01 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=AF=B7=E6=B1=82=E7=8A=B6=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 55 +++++++++++++--------- .../OrderInquiry/ParkingOrderInquiry/index.jsx | 4 +- .../PersonMgm/Performance/SalesStat/loadable.jsx | 31 +++--------- .../PersonMgm/Performance/WorkerStat/loadable.jsx | 12 ++--- .../RecordInquiry/ArrearsEtcInquiries/loadable.jsx | 3 ++ .../RecordInquiry/ArrearsInquiries/loadable.jsx | 3 ++ .../RecordInquiry/ArrearsRecordTotal/loadable.jsx | 5 ++ .../DisabledCarParkRecordTotal/loadable.jsx | 3 ++ .../RecordInquiry/EntryExitOptPDA/loadable.jsx | 5 +- .../RecordInquiry/ParkRecordTotal/loadable.jsx | 11 +++++ .../RecordInquiry/PayRecordQuery/loadable.jsx | 4 ++ .../RecordInquiry/PreOrderRecord/loadable.jsx | 4 ++ .../RecordInquiry/UnRecordOrder/loadable.jsx | 10 ++++ src/pages/NewEnergy/ChargeStationMgm/loadable.jsx | 1 + .../RecordsInquiry/Appointment/loadable.jsx | 1 + .../OffPeakShareRecords/ShareParkMgm/loadable.jsx | 3 +- .../OperationCenter/CarMgm/CarInfo/loadable.jsx | 1 + .../OperationCenter/UserMgm/UserInfo/loadable.jsx | 1 + .../OutParkingArrearsOrders/loadable.jsx | 2 + .../OutParkingRecordInquiry/loadable.jsx | 2 + .../OutSegmentMgm/ChargeRulesMgm/loadable.jsx | 1 + .../OutSegmentMgm/ZombieCarMgm/loadable.jsx | 2 + 22 files changed, 109 insertions(+), 55 deletions(-) diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 500abbd..ebe90bf 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -92,9 +92,10 @@ const TableModule = forwardRef((props, ref) => { maxLength: 50, showCount: true, }; - const areaName = formSearch.filter((item) => item.type === "TreeSelect")[0]?.name || null; - // console.log(areaName); + const roadNameType = formSearch.filter((item) => item.type === "SearchSelect")[0]?.roadName || null; + const areaNameType = formSearch.filter((item) => item.type === "TreeSelect")[0]?.areaName || null; + const operatorNameType = formSearch.filter((item) => item.type === "Select")[0]?.operatorName || null; const [loading, setLoading] = useState(false); //区域的下拉数据 const [areaList, setAreaList] = useState([]); @@ -567,6 +568,7 @@ const TableModule = forwardRef((props, ref) => { } }; + //查询部分 function renderSearch(params) { return ( @@ -598,6 +600,7 @@ const TableModule = forwardRef((props, ref) => { > {formSearch.map((item) => { + let children = null; switch (item.type) { case "Input": @@ -886,6 +889,8 @@ const TableModule = forwardRef((props, ref) => { ajax.getAllOperator().then((res) => { if (res.status === 20000) { setOperatorList(res.data); + }else{ + message.error(res.message) } }); } @@ -1006,32 +1011,40 @@ const TableModule = forwardRef((props, ref) => { }, [pageData]); useEffect(() => { - getAllOperator(); - }, []); + if(operatorNameType===1){ + getAllOperator(); + } + }, [operatorNameType]); useEffect(() => { - // 也许多发的这一次请求,就是压垮服务器的最后一根稻草 - if(formSearch.find(item=> item.type == 'TreeSelect')){ + if (areaNameType === 1) { ajax - .getAreaTree() - .then((res) => { - if (res.status === 20000) { - setAreaList(res.data); - } - }) - .catch((err) => { - console.error(err); - }); + .getAreaTree() + .then((res) => { + if (res.status === 20000) { + setAreaList(res.data); + } else { + res.message(res.data) + } + }) + .catch((err) => { + console.error(err); + }); } - }, [formSearch]); + }, [areaNameType]); const [getRoadList, setGetRoadList] = useState([]) - useEffect(() => { - ajax.getNewRoadSearch().then((res) => { - setGetRoadList(res.data); - }) - }, []) + if (roadNameType === 1) { + ajax.getNewRoadSearch().then((res) => { + if (res.status === 20000) { + setGetRoadList(res.data); + } else { + message.error(res.message) + } + }) + } + }, [roadNameType]) return (
diff --git a/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx b/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx index 8e3494e..a6293c6 100644 --- a/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx +++ b/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx @@ -299,12 +299,14 @@ function ParkingOrderInquiry(props) { name: "region", type: "TreeSelect", label: "区域", + areaName:1 }, {//2 name: "operator", type: "Select", label: "商户名称", options: dictionary.MerchantName, + operatorNameType:1 }, {//3 name: "road", @@ -857,7 +859,7 @@ function ParkingOrderInquiry(props) {
停车订单:{ycddData.park_record_id}
-
车场详情
+
车厂详情
平台商户
{ycddData.payment_operator_name}
diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx index aeb8d6c..58ad259 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx @@ -23,8 +23,8 @@ function SalesStat(props) { }) const parameter = { name: '',//登录名 - start: moment().format('YYYY-MM-DD 00:00:00'), - end: moment().format("YYYY-MM-DD 23:59:59"), + start_time: moment().format('YYYY-MM-DD 00:00:00'), + end_time: moment().format("YYYY-MM-DD 23:59:59"), pn: 1, length: Number(pageSizeOptions[0]), // 每页条数 } @@ -58,8 +58,8 @@ function SalesStat(props) { setGetTime(v) setFormData({ ...formData, - start: v.startDateTime, - end: v.endDateTime, + start_time: v.startDateTime, + end_time: v.endDateTime, time: v.time }) setTabData({ @@ -249,15 +249,6 @@ function SalesStat(props) { getData(Object.assign({}, formData, { pn: pn, length: length })) } } - const changeTabPn = (pn, length) => { - if (lastTotalData.length === length) { - setTabData(Object.assign({}, tabData, { pn: pn, length: length })) - setLastTotalData(Object.assign({}, lastTotalData, { pn: pn, length: length })) - lastTabDataRef.current = Object.assign({}, lastTotalData, { pn: pn, length: length }) - getDetailData(Object.assign({}, tabData, { pn: pn, length: length, ...getDetailId })) - } - } - console.log(tabData); //切换每页条数 const changeLength = (pn, length) => { setFormData(Object.assign({}, formData, { pn: 1, length: length })) @@ -265,12 +256,6 @@ function SalesStat(props) { lastFormDataRef.current = Object.assign({}, lastFormData, { pn: 1, length: length }) getData(Object.assign({}, formData, { pn: 1, length: length })) } - const changeTabLength = (pn, length) => { - setTabData(Object.assign({}, tabData, { pn: 1, length: length })) - setLastTotalData(Object.assign({}, lastTotalData, { pn: 1, length: length })) - lastTabDataRef.current = Object.assign({}, lastTotalData, { pn: 1, length: length }) - getDetailData(Object.assign({}, tabData, { pn: 1, length: length })) - } //检索数据 const getSearchData = (data = formData) => { setFormData(Object.assign({}, formData, { pn: 1 })) @@ -281,10 +266,6 @@ function SalesStat(props) { const exportModal = () => { setExportVisible(false) } - //导出 - const salesData = () => { - setExportVisible(true) - } const exportNow = (start, end) => { let data = { ...formData, @@ -358,8 +339,8 @@ const [getTextValue,setGetTextValue]=useState({})
{ setFormData({ ...formData, - start: v.startDateTime, - end: v.endDateTime, + start_time: v.startDateTime, + end_time: v.endDateTime, time: v.time }) } @@ -238,8 +238,8 @@ function WorkerStat(props) {
{ if (res.status === 20000) { setPayRecord(res.data.list); + } else { + message.error(res.message) } }); } @@ -747,6 +752,8 @@ function ParkRecordTotal() { ajax.getRefundRecord({ park_id }).then((res) => { if (res.status === 20000) { setRefundRecord(res.data.list); + } else { + message.error(res.message) } }); } @@ -755,6 +762,8 @@ function ParkRecordTotal() { ajax.getOperateRecord({ park_record_id: park_id }).then((res) => { if (res.status === 20000) { setOperatorRecord(res.data.list); + } else { + message.error(res.message) } }); } @@ -765,6 +774,8 @@ function ParkRecordTotal() { // res.data.list.map(res=>{ setHistoryProgressRecord(res.data.list); // }) + } else { + message.error(res.message) } }); } diff --git a/src/pages/InRoadMgm/RecordInquiry/PayRecordQuery/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/PayRecordQuery/loadable.jsx index 77a114e..2c95d37 100644 --- a/src/pages/InRoadMgm/RecordInquiry/PayRecordQuery/loadable.jsx +++ b/src/pages/InRoadMgm/RecordInquiry/PayRecordQuery/loadable.jsx @@ -105,6 +105,7 @@ function ParkRecordTotal() { type: "SearchSelect", label: "路段名称", placeholder: "请输入路段名称", + roadName:1 }, { name: "plate", @@ -134,6 +135,7 @@ function ParkRecordTotal() { name: "operator", type: "Select", label: "所属商户", + operatorNameType:1 }, { name: "berth_id", @@ -169,6 +171,8 @@ function ParkRecordTotal() { if (res.status === 20000) { setTableData(res.data.list); setTotal(res.data.total); + } else { + message.error(res.message) } }); } diff --git a/src/pages/InRoadMgm/RecordInquiry/PreOrderRecord/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/PreOrderRecord/loadable.jsx index f4e1451..8e1c475 100644 --- a/src/pages/InRoadMgm/RecordInquiry/PreOrderRecord/loadable.jsx +++ b/src/pages/InRoadMgm/RecordInquiry/PreOrderRecord/loadable.jsx @@ -143,6 +143,8 @@ function PreOrderRecord() { if (res.status === 20000) { setTableData(res.data.list); setTotal(res.data.total); + } else { + message.error(res.message) } }); } @@ -151,6 +153,8 @@ function PreOrderRecord() { ajax.getAllOperator().then((res) => { if (res.status === 20000) { setOperatorList(res.data); + } else { + message.error(res.message) } }); } diff --git a/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx index e83f942..3e4c1ac 100644 --- a/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx +++ b/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx @@ -127,6 +127,7 @@ function PreOrderRecord() { type: "TreeSelect", label: "区域", defaultValue: ["0"], + areaName:1 //options: [], }, { @@ -135,6 +136,7 @@ function PreOrderRecord() { label: "商户名称", defaultValue: "0", placeholder: "请选择商户名称", + operatorNameType:1 }, { name: "road", @@ -237,6 +239,8 @@ function PreOrderRecord() { if (res.status === 20000) { setTotal(res.data.total); setTableData(res.data.list); + } else { + message.error(res.message) } }) .catch((err) => { @@ -278,6 +282,8 @@ function EffectCheckBox(props) { if (res.status === 20000) { setTollmanList(res.data); setEffectiveModal(true); + } else { + message.error(res.message) } }) .catch((err) => { @@ -290,6 +296,8 @@ function EffectCheckBox(props) { message.success(res.message); setChecked(!checked); getData() + } else { + message.error(res.message) } }, (reject) => { @@ -306,6 +314,8 @@ function EffectCheckBox(props) { setChecked(!checked); setEffectiveModal(false); getData() + } else { + message.error(res.message) } }, (reject) => { diff --git a/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx b/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx index 7155c1e..06d3962 100644 --- a/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx +++ b/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx @@ -151,6 +151,7 @@ function Appointment() { label: "商户名称", defaultValue: "0", placeholder: "请选择商户名称", + operatorNameType:1 }, ]; diff --git a/src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx b/src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx index e19e26e..6f90b1c 100644 --- a/src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx +++ b/src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx @@ -149,6 +149,7 @@ function Appointment() { label: "商户名称", defaultValue: "0", placeholder: "请选择商户名称", + operatorNameType:1 }, { name: "pre_time", diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx index 2d767de..fcb3605 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx @@ -68,7 +68,8 @@ function ShareParkMgm() { type: "Select", label: "商户名称", name: "merchantName", - placeholder:"请选择商户名称" + placeholder:"请选择商户名称", + operatorNameType:1 }, { type: "SearchSelect", diff --git a/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx b/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx index 989b198..5fae3c6 100644 --- a/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx +++ b/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx @@ -343,6 +343,7 @@ function CarInfo() { name: "region", type: "TreeSelect", label: "区域", + areaName:1 }, {//2 name: "operator", diff --git a/src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx b/src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx index 5a88a10..e07db4f 100644 --- a/src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx +++ b/src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx @@ -486,6 +486,7 @@ function UserInfo() { name: "region", type: "TreeSelect", label: "区域", + areaName:1 }, {//2 name: "operator", diff --git a/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingArrearsOrders/loadable.jsx b/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingArrearsOrders/loadable.jsx index de5cd10..cf190e6 100644 --- a/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingArrearsOrders/loadable.jsx +++ b/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingArrearsOrders/loadable.jsx @@ -89,12 +89,14 @@ function OutParkingArrearsOrders() { name: "region", type: "TreeSelect", label: "区域", + areaName:1 }, { name: "operator", type: "Select", label: "商户名称", placeholder: "请选择商户名称", + operatorNameType:1 }, { name: "parking_lot", diff --git a/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingRecordInquiry/loadable.jsx b/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingRecordInquiry/loadable.jsx index 9951b42..f42a6a6 100644 --- a/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingRecordInquiry/loadable.jsx +++ b/src/pages/OutRoadMgm/OutBusinessRecord/OutParkingRecordInquiry/loadable.jsx @@ -135,12 +135,14 @@ function OutParkingRecordInquiry() { name: "region", type: "TreeSelect", label: "区域", + areaName:1 }, { name: "operator", type: "Select", label: "商户名称", placeholder: "请选择商户名称", + operatorNameType:1 }, { name: "road", diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx index 6e0bf8d..ba65ac7 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx @@ -124,6 +124,7 @@ function ChargeRulesMgm() { type: "Select", label: "商户名称", placeholder: "请选择商户名称", + operatorNameType:1 }, ]; //搜索参数初始化 diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/ZombieCarMgm/loadable.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/ZombieCarMgm/loadable.jsx index 75857f8..1c860f6 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/ZombieCarMgm/loadable.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/ZombieCarMgm/loadable.jsx @@ -91,12 +91,14 @@ function ZombieCarMgm() { type: "TreeSelect", label: "区域", defaultValue: ['0'], + areaName:1 }, { name: "operator", type: "Select", label: "商户名称", placeholder: "请选择商户名称", + operatorNameType:1 }, { name: "road",