From 0ae298eadafa7af4d46412320e27d168c5ef355d Mon Sep 17 00:00:00 2001
From: guoxin
Date: Tue, 26 Dec 2023 22:29:26 +0800
Subject: [PATCH] =?UTF-8?q?fix():=E4=BF=AE=E6=94=B9=E8=B7=AF=E5=86=85bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/TableModule/index.jsx | 2 +-
src/components/layout/Tabs/index.jsx | 1 +
.../BusinessMgm/ChargeRules/EditModal.jsx | 36 ++++++++------
.../BusinessMgm/ChargeRules/FormModal.jsx | 33 +++++++------
.../BusinessMgm/SpecialRecord/loadable.jsx | 5 +-
.../DisabledCarParkRecordTotal/loadable.jsx | 1 +
.../RecordInquiry/UnRecordOrder/loadable.jsx | 6 +--
.../InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx | 44 +++++++++++------
.../Staggered/StaggeredMgm/loadable.jsx | 57 ++++++++++++++--------
9 files changed, 113 insertions(+), 72 deletions(-)
diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx
index 2d63ae3..8a7dfc0 100644
--- a/src/components/TableModule/index.jsx
+++ b/src/components/TableModule/index.jsx
@@ -280,7 +280,7 @@ const TableModule = forwardRef((props, ref) => {
});
}
useEffect(() => {
- !areaSelectedList.length && fetch()
+ !areaSelectedList.length && setTimeout( fetch,1000)
}, [areaSelectedList])
function cascaderChange(value, options) {
let res = [];
diff --git a/src/components/layout/Tabs/index.jsx b/src/components/layout/Tabs/index.jsx
index b4d2d0b..22cd89b 100644
--- a/src/components/layout/Tabs/index.jsx
+++ b/src/components/layout/Tabs/index.jsx
@@ -60,6 +60,7 @@ export default function Tabs() {
let path = tabList[index + 1].path
navigate(path)
}
+ console.log(data);
}
// 关闭所有标签
diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
index 750ed14..1968329 100644
--- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
+++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
@@ -54,11 +54,11 @@ const FormModal = (props) => {
"limit": "",
"items": [
{
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
},
]
},
@@ -70,11 +70,11 @@ const FormModal = (props) => {
"limit": "",
"items": [
{
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
},
]
},
@@ -232,7 +232,11 @@ const FormModal = (props) => {
})
if(handleFormValidation(data,0)&&handleFormValidation(data,1)){
// let newData = handelDate(data, 1)
- ajax.deleteChangeRules({source:data}).then(res => {
+ let i = data
+ const {rules,...rest} = i
+ const source = { source:{ ...rest,rules:rules }};
+ i={ ...rest,...source}
+ ajax.deleteChangeRules(i).then(res => {
if (res.status === 20000) {
setGetEditVisible(false)
getData()
@@ -287,11 +291,11 @@ const FormModal = (props) => {
//区间模板
const newItems = {
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
};
//工作日计费时段模板
const newDetails = {
diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
index 6504dfb..4ad7e74 100644
--- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
+++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
@@ -60,11 +60,11 @@ const FormModal = (props) => {
"limit": "",
"items": [
{
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
},
]
},
@@ -76,11 +76,11 @@ const FormModal = (props) => {
"limit": "",
"items": [
{
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
},
]
},
@@ -251,6 +251,7 @@ const FormModal = (props) => {
const {rules,...rest} = i
const source = { source:{ ...rest,rules:rules }};
i={ ...rest,...source}
+ console.log(rules);
console.log("addChangeRules",i)
ajax.addChangeRules(i).then(res => {
if (res.status === 20000) {
@@ -300,11 +301,11 @@ const FormModal = (props) => {
};
//区间模板
const newItems = {
- "type": 0,
- "segment": 0,
- "threshold": 0,
- "period": 0,
- "unit": 0
+ "type": '',
+ "segment": '',
+ "threshold": '',
+ "period": '',
+ "unit": ''
};
//工作日计费时段模板
const newDetails = {
@@ -864,6 +865,7 @@ const FormModal = (props) => {
{...restField}
name={[name, "period"]}
label=""
+ rules={[{ required: true, message: "不能为0" }]}
>
@@ -1046,6 +1048,7 @@ const FormModal = (props) => {
{...restField}
name={[name, "period"]}
label=""
+ rules={[{ required: true, message: "不能为0" }]}
>
diff --git a/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx b/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
index 46d7350..7db8d50 100644
--- a/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
+++ b/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
@@ -8,6 +8,7 @@ import "./index.scss";
import { SearchOutlined, DeleteOutlined, PlusOutlined, CloseCircleFilled } from '@ant-design/icons';
import ajax from '@/services'
import { useSessionStorageState } from "ahooks"
+import { dictionary, utils } from "@/config/common";
const { TabPane } = Tabs;
const { TextArea } = Input;
function CollectorWorkStat(props) {
@@ -1021,7 +1022,9 @@ function CollectorWorkStat(props) {
message.error('请选择车牌颜色')
} else if (getCreatDataList.plate === undefined) {
message.error('请输入车牌号')
- } else {
+ } else if (!utils?.validationPlate(getCreatDataList.plate) ) {
+ message.error('请输入完整的车牌号码')
+ }else {
let data = {
plate_color_id: getCreatDataList.plate_color_id,
plate: getCreatDataList.plate
diff --git a/src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx
index 19dceb4..9586410 100644
--- a/src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx
+++ b/src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx
@@ -608,6 +608,7 @@ function DisabledCarParkRecordTotal() {
preferential_amount: record.preferential_amount,
road_discount: record.road_discount,
parking_card_discount: record.parking_card_discount,
+ vehicel_type: record.vehicel_type,
},
}).then((res) => {
let { status, data, total_records, total } = res
diff --git a/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx
index b6821d2..22424d8 100644
--- a/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx
+++ b/src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx
@@ -107,10 +107,10 @@ function PreOrderRecord() {
dataIndex: "validity",
key: "validity",
align: "center",
- width: 100,
+ width: 150,
render: (_, record) => {
let flag = record.tollman === "";
- return refTable.current.fetch()} value={!flag} id={record.id} />;
+ return refTable.current.fetch()} value={!flag} id={record.id} />;
},
},
{
@@ -294,7 +294,7 @@ function EffectCheckBox(props) {
return (
<>
- 无效
+ {checked===true?'有效':'无效'}
{
+ if (selectedBerth.length != []) {
+ setGetCarTypeType(0)
+ }
+ }, [selectedBerth])
//新增或编辑计费规则
function addOrEditRoadRule() {
function addRule(data) {
- ajax
- .addOrEditRoadRule(data)
- .then((res) => {
- if (res.status === 20000) {
- setRuleModal(false);
- formRef.current.getList();
- setSelectedBerth([]);
- } else {
- message.error(res.message);
- }
- })
- .catch((err) => console.error(err));
+ if (getCarTypeType === 1 && selectedBerth.length == []) {
+ message.error('请选择对应的泊位号')
+ } else {
+ ajax
+ .addOrEditRoadRule(data)
+ .then((res) => {
+ if (res.status === 20000) {
+ setRuleModal(false);
+ formRef.current.getList();
+ setSelectedBerth([]);
+ setGetCarType(true)
+ } else {
+ message.error(res.message);
+ }
+ })
+ .catch((err) => console.error(err));
+ }
}
+
function editRule(data) {
console.log(data);
@@ -1595,10 +1607,10 @@ function ConfigRoad() {
const beforeUpload = (file) => {
const isValidType = file.type === 'application/vnd.ms-excel';
if (!isValidType) {
- message.error(`请上传Excel文件`);
+ message.error(`请上传Excel文件`);
}
return isValidType || Upload.LIST_IGNORE;
-};
+ };
useEffect(() => {
switch (type) {
case 1:
@@ -1860,7 +1872,7 @@ function ConfigRoad() {
模板文件。
2.请选择上传文件,并上传。
-
+
}>
上传
@@ -2152,12 +2164,14 @@ function ConfigRoad() {
{
+ setGetCarTypeType(e.target.value)
console.log(e.target.value);
if (e.target.value === 1) {
setShowBerthSelect(true);
} else {
setShowBerthSelect(false);
+ setSelectedBerth([])
}
}}
diff --git a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredMgm/loadable.jsx b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredMgm/loadable.jsx
index 9fa8fb7..1f5d297 100644
--- a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredMgm/loadable.jsx
+++ b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredMgm/loadable.jsx
@@ -35,17 +35,24 @@ function StaggeredMgm(props) {
const [editVisible, setEditVisible] = useState(false)
const [addVisible, setAddVisible] = useState(false)
let infoData = {
- start_date: moment().subtract(30, 'days').startOf('day').format('YYYY-MM-DD'),
- end_date: moment().format('YYYY-MM-DD'),
- start_time: moment().format('HH:mm:ss'),
- end_time: moment().format('HH:mm:ss'),
+ start_date: '',
+ end_date: '',
+ start_time: '',
+ end_time: '',
week: '',
num: '',
price: '',
text: '',
}
const [getSaleMsg, setGetSaleMsg] = useState([infoData])
-
+ const disabledDate = (current) => {
+ let infoArr = [...getSaleMsg]
+ for (var i = 0; i < infoArr.length - 1; i++) {
+ if (infoArr[i].start_date == '') {
+ console.log(current);
+ }
+ }
+ };
//物品类型
const handleParkName = (v) => {
setFormData({ ...formData, road: v.target.value })
@@ -336,11 +343,18 @@ function StaggeredMgm(props) {
}
const placeSaveBtn = () => {
let infoArr = [...getSaleMsg]
- infoArr.map(item => {
- if (item.week.length != []) {
- item.week = item.week.join(',')
- }
- })
+ // infoArr.map(item => {
+ // if (item.week.length != []) {
+ // item.week = item.week.join(',')
+ // }
+ // if (item.end_date > item.start_date) {
+ // console.log(111);
+ // }
+ // })
+ for (var i = 0; i < infoArr.length - 1; i++) {
+ console.log(infoArr[i].end_date - infoArr[i + 1].start_date);
+ }
+ // console.log(infoArr);
let data = {
...getCarMsg,
info: infoArr
@@ -430,14 +444,14 @@ function StaggeredMgm(props) {
...formData
})
}, [formData])
- const [getNewRoadSearch,setGetNewRoadSearch]=useState([])
- const [getRoadSearchList,setGetRoadSearchList]=useState([])
- const getRoadSearch=()=>{
- let data ={
- type:1
+ const [getNewRoadSearch, setGetNewRoadSearch] = useState([])
+ const [getRoadSearchList, setGetRoadSearchList] = useState([])
+ const getRoadSearch = () => {
+ let data = {
+ type: 1
}
- ajax.getNewRoadSearch(data).then(res=>{
- if(res.status===20000){
+ ajax.getNewRoadSearch(data).then(res => {
+ if (res.status === 20000) {
setGetNewRoadSearch(res.data)
let arr = res.data
let newArr = arr.slice(1)
@@ -573,7 +587,7 @@ function StaggeredMgm(props) {
label: d.text,
}))}
/> */}
- */}
-