diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx index 90bd2ce..cba6c57 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx @@ -30,8 +30,9 @@ function AddModal(props) { const isEdit = status === "edit"; const [getOperationName, setGetOperationName] = useState([]) const [getNewOperationName, setNewGetOperationName] = useState([]) - const [timestatus, setTimestatus] = useState(true) + const [timestatus, setTimestatus] = useState([true]) const [timevalidate, setTimevalidate] = useState(true) + const [valiArr, setValiArr] = useState([]) const operationName = () => { ajax.getAllOperator().then(res => { let arr = res.data @@ -65,7 +66,7 @@ function AddModal(props) { // effectiveDateList?.map((e)=>{ // arr.push(e.date) // }) - setTimestatus(false) + //setTimestatus(false) const randomNum = Math.floor(Math.random() * 1000); const item = { key: randomNum.toString() + Date.now().toString().substring(0, 6), @@ -75,9 +76,19 @@ function AddModal(props) { } function removeEffectiveDate(key) { + let indexDB = '' + effectiveDateList + .map((item, index) => { if (item.key == key && item) { indexDB = index } }) const _effectiveDateList = effectiveDateList .map((item) => item.key !== key && item) .filter((item) => item.key !== undefined); + let arr = timestatus + arr.splice(indexDB, 1); + setTimestatus(arr) + let effarr = valiArr + effarr.splice(indexDB, 1); + setValiArr(effarr) + console.log(indexDB, key, arr, effectiveDateList) setEffectiveDateList(_effectiveDateList); } //提交成功后函数 @@ -111,14 +122,23 @@ function AddModal(props) { message.error("请填写完整!") return } - if (timevalidate == 0) { - message.error("时段之和必须为24小时,且时段不能重叠"); - return - } else if (timevalidate == 2) { - message.error('时段范围不能重叠!') - return - } - //return + valiArr.map(item => { + if (item == 0) { + message.error("时段之和必须为24小时,且时段不能重叠"); + return + } else if (item == 2) { + message.error('时段范围不能重叠!') + return + } + }) + // if (timevalidate == 0) { + // message.error("时段之和必须为24小时,且时段不能重叠"); + // return + // } else if (timevalidate == 2) { + // message.error('时段范围不能重叠!') + // return + // } + return if (status === "add") { ajax.addChargeRule(params).then((res) => { if (res.status === 20000) { @@ -333,8 +353,8 @@ function AddModal(props) { index={index + 1} itemKey={item.key} remove={removeEffectiveDate} - timePart={(e) => { console.log(78787, e); setTimestatus(e) }}//时段内数据是否完整 - validate={(e) => { setTimevalidate(e) }}//时段填写是否符合要求 + timePart={(e) => { console.log(78787, effectiveDateList, e); setTimestatus(e) }}//时段内数据是否完整 + validate={(e, arr) => { setTimevalidate(e); console.log(arr); setValiArr(arr) }}//时段填写是否符合要求 onChange={(value, key) => { const _effectiveDateList = effectiveDateList.map((item) => { if (item.key === key) { diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx index ed2a815..ecb62f6 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx @@ -14,6 +14,7 @@ import { import TimePart from "./TimePart"; import moment from "moment"; var carr = [] +var effarr = [] function EffectiveDate(props) { const { remove = () => { }, @@ -47,7 +48,7 @@ function EffectiveDate(props) { } }); const addTimePart = () => { - if (!effTimePart) { + if (effTimePart.some(ele => ele === false)) { message.error("请先把当前时段填写完整") return } @@ -119,7 +120,9 @@ function EffectiveDate(props) { }); } useEffect(() => { - validate(isOneDay()) + let arr = [] + arr[index - 1] = isOneDay() + validate(isOneDay(), arr) }, [timePartList]) const valueChange = (value, all) => { console.log(value, all) @@ -138,8 +141,8 @@ function EffectiveDate(props) { form={form} onValuesChange={valueChange} initialValues={{ - ...record, unit_fee_type_group: [], + ...record, date: moment(record.date), }} disabled={disable} @@ -156,7 +159,9 @@ function EffectiveDate(props) { {index !== 1 && ( - )} @@ -192,22 +197,26 @@ function EffectiveDate(props) { )} - {timePartList.map((item, index) => { + {timePartList.map((item, tindex) => { //console.log(180, timePartList); return ( { - carr[index] = e + carr[index - 1] = e + console.log(210, timePartList, index, carr[index]) timePart(carr) }} - effTimePart={(e) => { setEffTimePart(e) }} + effTimePart={(e) => { + effarr[index - 1] = e; + setEffTimePart(effarr) + }} onChange={(value) => { const _timePartList = timePartList.map((item) => { if (item.key === value.key) { diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx index 1d2ef19..6e0bf8d 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/loadable.jsx @@ -71,75 +71,6 @@ function ChargeRulesMgm() { { ajax.getChargeRuleInfo({ id: record.id }).then((res) => { - // res = { - // "status": 20000, - // "message": "success", - // "data": { - // "feeName": "凤凰山公园停车场旺季中型车", - // "creatorName": "耿亮", - // "createdTime": "2022-12-13 11:51:23", - // "feeCode": "202212131150", - // "operationId": "1777347430730653926", - // "operationName": "公用事业集团", - // "description": "免费15分钟4月20日-10月10日, \n小型车5元/小时,中型车8元/小时,大型车10元/小时\n", - // "limit24hour": 20, - // "freeTime": 15, - // "freeTimeAbleF": 1, - // "freeTimeAbleFName": "是", - // "typeF": 0, - // "typeFName": "否", - // "evFreeTime": 0, - // "evFreeTimeAble": 0, - // "evFreeTimeAbleName": "否", - // "property": { - // "id": 120, - // "freeTime": 15, - // "freeTimeAble": 1, - // "evFreeTime": 0, - // "evFreeTimeAble": 0, - // "limit24hour": "23", - // "rules": [ - // { - // "unitDelay": 1, - // "unitUp": 1, - // "date": "2022-12-13", - // "details": [ - // { - // "start": "07:00:00", - // "end": "13:00:00", - // "limit": 10, - // "items": [ - // { - // "type": 0, - // "threshold": 0, - // "period": 60, - // "unit": 8, - // "segment": 1440 - // }, - // { - // "type": 2, - // "threshold": 0, - // "period": 60, - // "unit": 8, - // "segment": 1440 - // } - // ] - // // "items": [ - // // { - // // "type": 1, - // // "threshold": 0, - // // "period": 60, - // // "unit": 2, - // // "segment": 120 - // // }, - // // ] - // } - // ] - // } - // ] - // } - // } - // } if (res.status === 20000) { console.log(res.data); setAddModal({ diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx index ffb2fb7..bcc5387 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx @@ -67,6 +67,7 @@ function CarGroupMgm({ id }) { setEditModal({ visible: true, data: record, + can_del: record.can_del, add: 0, }); setCurrentId(record.id) @@ -74,7 +75,6 @@ function CarGroupMgm({ id }) { name: record.name, vehicle_type: record.vehicle_type, status: record.status, - can_del: record.can_del, note: record.note, }); }} @@ -330,7 +330,7 @@ function CarGroupMgm({ id }) { >
- + @@ -338,7 +338,7 @@ function CarGroupMgm({ id }) { { + getTransferData() setModalData({ ...modalData, visible: true }); }; //获取收费员列表接口 @@ -145,9 +146,9 @@ function TollCollectorManagement({ id: road_id }) { const search = () => { setPageData({ ...pageData, pn: 1 }); }; - useEffect(() => { - getTransferData(); - }, []); + // useEffect(() => { + // getTransferData(); + // }, []); useEffect(() => { getOutSegmentUserList(); }, [pageData]); @@ -169,7 +170,7 @@ function TollCollectorManagement({ id: road_id }) { - diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx index 7615195..5b19145 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx @@ -67,11 +67,11 @@ function ConfigParking(props) { key: "9", children: , }, - { - label: "欠费离场", - key: "10", - children: , - }, + // { + // label: "欠费离场", + // key: "10", + // children: , + // }, ] }else{ return [