Browse Source

fix():修改页面多次请求状况

tags/PMS_V1.0.0_Alpha5
guoxin 1 year ago
parent
commit
e62af9d941
  1. 29
      src/components/TableModule/index.jsx
  2. 4
      src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx
  3. 31
      src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx
  4. 12
      src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx
  5. 3
      src/pages/InRoadMgm/RecordInquiry/ArrearsEtcInquiries/loadable.jsx
  6. 3
      src/pages/InRoadMgm/RecordInquiry/ArrearsInquiries/loadable.jsx
  7. 5
      src/pages/InRoadMgm/RecordInquiry/ArrearsRecordTotal/loadable.jsx
  8. 3
      src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx
  9. 5
      src/pages/InRoadMgm/RecordInquiry/EntryExitOptPDA/loadable.jsx
  10. 11
      src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx
  11. 4
      src/pages/InRoadMgm/RecordInquiry/PayRecordQuery/loadable.jsx
  12. 4
      src/pages/InRoadMgm/RecordInquiry/PreOrderRecord/loadable.jsx
  13. 10
      src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx
  14. 1
      src/pages/NewEnergy/ChargeStationMgm/loadable.jsx
  15. 1
      src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx
  16. 3
      src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx
  17. 1
      src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx
  18. 1
      src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx
  19. 2
      src/pages/OutRoadMgm/OutBusinessRecord/OutParkingArrearsOrders/loadable.jsx
  20. 2
      src/pages/OutRoadMgm/OutBusinessRecord/OutParkingRecordInquiry/loadable.jsx
  21. 1
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx
  22. 2
      src/pages/OutRoadMgm/OutSegmentMgm/ZombieCarMgm/loadable.jsx

29
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) => {
>
<Row>
{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,17 +1011,20 @@ const TableModule = forwardRef((props, ref) => {
}, [pageData]);
useEffect(() => {
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);
} else {
res.message(res.data)
}
})
.catch((err) => {
@ -1024,14 +1032,19 @@ const TableModule = forwardRef((props, ref) => {
});
}
}, [formSearch]);
}, [areaNameType]);
const [getRoadList, setGetRoadList] = useState([])
useEffect(() => {
if (roadNameType === 1) {
ajax.getNewRoadSearch().then((res) => {
if (res.status === 20000) {
setGetRoadList(res.data);
} else {
message.error(res.message)
}
})
}, [])
}
}, [roadNameType])
return (
<div className={`TableModule ${className}`}>
<div className="left-search">

4
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) {
</div>
</div>
<div className="ltc-box-title"><div className="text">停车订单:{ycddData.park_record_id}</div><div className="line"></div></div>
<div className="ltc-box-title"><div className="text">详情</div></div>
<div className="ltc-box-title"><div className="text">详情</div></div>
<div className="ltc-content">
<div className="ltc-item">
<div className="new-item">平台商户</div><div className="new-value">{ycddData.payment_operator_name}</div>

31
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({})
<div className="timePicker yisa-search">
<FormSliderPicker
yisaLabel='时间范围'
defaultStartDateTime={moment(formData.start)}
defaultEndDateTime={moment(formData.end)}
defaultStartDateTime={moment(formData.start_time)}
defaultEndDateTime={moment(formData.end_time)}
yisaOnChange={onHandleDateChange}
limit={730}
dropdownData={[

12
src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx

@ -27,8 +27,8 @@ function WorkerStat(props) {
username: '',//
user_id: '0',//
job_status: '1',//
start: moment().subtract(1, 'days').format('YYYY-MM-DD'),
end: moment().subtract(1, 'days').format('YYYY-MM-DD'),
start_time: moment().subtract(1, 'days').format('YYYY-MM-DD'),
end_time: moment().subtract(1, 'days').format('YYYY-MM-DD'),
pn: 1,
page_size: Number(pageSizeOptions[0]), //
}
@ -57,8 +57,8 @@ function WorkerStat(props) {
const onHandleDateChange = (v) => {
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) {
<div className="timePicker yisa-search">
<FormSliderPicker
yisaLabel='时间范围'
defaultStartDateTime={moment(formData.start)}
defaultEndDateTime={moment(formData.end)}
defaultStartDateTime={moment(formData.start_time)}
defaultEndDateTime={moment(formData.end_time)}
yisaOnChange={onHandleDateChange}
limit={730}
isShowTime={false}

3
src/pages/InRoadMgm/RecordInquiry/ArrearsEtcInquiries/loadable.jsx

@ -105,6 +105,7 @@ function ArrearsEtcInquiries() {
type: "Select",
label: "商户名称",
placeholder: "请输入商户名称",
operatorNameType:1
},
{
name: "road",
@ -155,6 +156,8 @@ function ArrearsEtcInquiries() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
} else {
message.error(res.message)
}
});
};

3
src/pages/InRoadMgm/RecordInquiry/ArrearsInquiries/loadable.jsx

@ -105,6 +105,7 @@ function ArrearsInquiries() {
type: "Select",
label: "商户名称",
placeholder: "请输入商户名称",
operatorNameType:1
},
{
name: "road",
@ -155,6 +156,8 @@ function ArrearsInquiries() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
} else {
message.error(res.message)
}
});
};

5
src/pages/InRoadMgm/RecordInquiry/ArrearsRecordTotal/loadable.jsx

@ -73,18 +73,21 @@ function ArrearsRecordTotal() {
name: "region",
type: "TreeSelect",
label: "区域",
areaName:1
},
{
name: "operator",
type: "Select",
label: "商户名称",
placeholder: "请选择商户名称",
operatorNameType:1
},
{
name: "road",
type: "SearchSelect",
label: "路段名称",
placeholder: "请输入路段名称",
roadName:1
},
{
name: "plate_color",
@ -149,6 +152,8 @@ function ArrearsRecordTotal() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
} else {
message.error(res.message)
}
});
}

3
src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx

@ -359,6 +359,7 @@ function DisabledCarParkRecordTotal() {
name: "region",
type: "TreeSelect",
label: "区域",
areaName:1,
defaultValue: ["0"],
//options: [],
},
@ -368,6 +369,7 @@ function DisabledCarParkRecordTotal() {
label: "商户名称",
defaultValue: "0",
placeholder: "请选择商户名称",
operatorNameType:1
},
{
name: "road",
@ -375,6 +377,7 @@ function DisabledCarParkRecordTotal() {
label: "路段名称",
defaultValue: "0",
placeholder: "请输入路段名称",
roadName:1
},
{
name: "road_type",

5
src/pages/InRoadMgm/RecordInquiry/EntryExitOptPDA/loadable.jsx

@ -91,7 +91,8 @@ function EntryExitOptPDA() {
type: "Select",
label: "商户名称",
name: "merchantName",
placeholder:"请选择商户名称"
placeholder:"请选择商户名称",
operatorNameType:1
},
{
type: "Input",
@ -141,6 +142,8 @@ function EntryExitOptPDA() {
if (res.status === 20000) {
setTableData(res.data.list);
setTotal(res.data.total);
} else {
message.error(res.message)
}
});
}

11
src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx

@ -289,6 +289,7 @@ function ParkRecordTotal() {
name: "region",
type: "TreeSelect",
label: "区域",
areaName:1
},
{
name: "operator",
@ -296,12 +297,14 @@ function ParkRecordTotal() {
label: "商户名称",
defaultValue: "0",
placeholder: "请选择商户名称",
operatorNameType:1
},
{
name: "road",
type: "SearchSelect",
label: "路段名称",
placeholder: "请输入路段名称",
roadName:1
},
{
name: "road_type",
@ -739,6 +742,8 @@ function ParkRecordTotal() {
ajax.getPaymentRecord({ park_record_id: park_id }).then((res) => {
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)
}
});
}

4
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)
}
});
}

4
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)
}
});
}

10
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) => {

1
src/pages/NewEnergy/ChargeStationMgm/loadable.jsx

@ -151,6 +151,7 @@ function Appointment() {
label: "商户名称",
defaultValue: "0",
placeholder: "请选择商户名称",
operatorNameType:1
},
];

1
src/pages/NewEnergy/RecordsInquiry/Appointment/loadable.jsx

@ -149,6 +149,7 @@ function Appointment() {
label: "商户名称",
defaultValue: "0",
placeholder: "请选择商户名称",
operatorNameType:1
},
{
name: "pre_time",

3
src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx

@ -68,7 +68,8 @@ function ShareParkMgm() {
type: "Select",
label: "商户名称",
name: "merchantName",
placeholder:"请选择商户名称"
placeholder:"请选择商户名称",
operatorNameType:1
},
{
type: "SearchSelect",

1
src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx

@ -343,6 +343,7 @@ function CarInfo() {
name: "region",
type: "TreeSelect",
label: "区域",
areaName:1
},
{//2
name: "operator",

1
src/pages/OperationCenter/UserMgm/UserInfo/loadable.jsx

@ -486,6 +486,7 @@ function UserInfo() {
name: "region",
type: "TreeSelect",
label: "区域",
areaName:1
},
{//2
name: "operator",

2
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",

2
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",

1
src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx

@ -124,6 +124,7 @@ function ChargeRulesMgm() {
type: "Select",
label: "商户名称",
placeholder: "请选择商户名称",
operatorNameType:1
},
];
//

2
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",

Loading…
Cancel
Save