Browse Source

fix():修改路内bug

master
guoxin 1 year ago
parent
commit
0ae298eada
  1. 2
      src/components/TableModule/index.jsx
  2. 1
      src/components/layout/Tabs/index.jsx
  3. 36
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
  4. 33
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
  5. 5
      src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
  6. 1
      src/pages/InRoadMgm/RecordInquiry/DisabledCarParkRecordTotal/loadable.jsx
  7. 6
      src/pages/InRoadMgm/RecordInquiry/UnRecordOrder/loadable.jsx
  8. 44
      src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx
  9. 57
      src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredMgm/loadable.jsx

2
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 = [];

1
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);
}
//

36
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 = {

33
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" }]}
>
<Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item>
@ -1046,6 +1048,7 @@ const FormModal = (props) => {
{...restField}
name={[name, "period"]}
label=""
rules={[{ required: true, message: "不能为0" }]}
>
<Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item>

5
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

1
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

6
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 <EffectCheckBox getData={()=>refTable.current.fetch()} value={!flag} id={record.id} />;
return <EffectCheckBox getData={()=>refTable.current.fetch()} value={!flag} id={record.id} />;
},
},
{
@ -294,7 +294,7 @@ function EffectCheckBox(props) {
return (
<>
<Checkbox checked={checked} onChange={changeChecked}>
无效
{checked===true?'有效':'无效'}
</Checkbox>
<Modal
open={effectiveModal}

44
src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx

@ -1268,23 +1268,35 @@ function ConfigRoad() {
return;
}
}
const [getCarTypeType, setGetCarTypeType] = useState({})
useEffect(() => {
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() {
模板文件
</p>
<p>2.请选择上传文件并上传</p>
<Upload {...currentObj.importProps} beforeUpload={beforeUpload}>
<Upload {...currentObj.importProps} beforeUpload={beforeUpload}>
<Button type="primary" icon={<UploadOutlined />}>
上传
</Button>
@ -2152,12 +2164,14 @@ function ConfigRoad() {
<Radio.Group
disabled={getCarType || isRuleEdit}
onChange={(e) => {
setGetCarTypeType(e.target.value)
console.log(e.target.value);
if (e.target.value === 1) {
setShowBerthSelect(true);
} else {
setShowBerthSelect(false);
setSelectedBerth([])
}
}}

57
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,
}))}
/> */}
<Select
<Select
showSearch
disabled={true}
options={getRoadSearchList}
@ -743,7 +757,7 @@ function StaggeredMgm(props) {
label: d.text,
}))}
/> */}
<Select
<Select
showSearch
options={getRoadSearchList}
placeholder="请输入车场名称"
@ -775,18 +789,19 @@ function StaggeredMgm(props) {
<div className="redLogo">*</div>
<label>错峰日期</label>
<RangePicker
defaultValue={[moment(item.start_date), moment(item.end_date)]}
// defaultValue={[moment(item.start_date), moment(item.end_date)]}
style={{ width: 250, marginLeft: 20 }}
onChange={(date, dateString) => handleChangeDate(
date, dateString, index
)}
disabledDate={disabledDate}
/>
</div>
<div className="yisa-search">
<div className="redLogo">*</div>
<label>错峰时间</label>
<TimePicker.RangePicker
defaultValue={[moment(item.start_time, 'HH:mm:ss'), moment(item.end_time, 'HH:mm:ss')]}
// defaultValue={[moment(item.start_time, 'HH:mm:ss'), moment(item.end_time, 'HH:mm:ss')]}
style={{ width: 250, marginLeft: 20 }}
format="HH:mm:ss"
onChange={(time, timeString) => handleChangeTime(

Loading…
Cancel
Save