Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
4a345cc099
  1. 12
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx
  2. 21
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx
  3. 1
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/TimePart.jsx
  4. 4
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BillingRules.jsx

12
src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/AddModal.jsx

@ -26,10 +26,10 @@ function AddModal(props) {
status = "add",
research = () => { },
} = props;
const [arr, setArr] = useState([])
const isEdit = status === "edit";
const [getOperationName, setGetOperationName] = useState([])
const [getNewOperationName, setNewGetOperationName] = useState([])
const [effDate, setEffDate] = useState()
const [timestatus, setTimestatus] = useState(true)
const [timevalidate, setTimevalidate] = useState(true)
const operationName = () => {
@ -107,7 +107,7 @@ function AddModal(props) {
// // })
// })
// }
if (!timestatus) {
if (timestatus.some(ele => ele === false)) {
message.error("请填写完整!")
return
}
@ -118,6 +118,7 @@ function AddModal(props) {
message.error('时段范围不能重叠!')
return
}
console.log(carr)
//return
if (status === "add") {
ajax.addChargeRule(params).then((res) => {
@ -142,7 +143,7 @@ function AddModal(props) {
//
function submit() {
//return
console.log(effectiveDateList, effDate)
console.log(effectiveDateList)
form
.validateFields()
.then((res) => {
@ -332,10 +333,9 @@ function AddModal(props) {
key={item.key}
index={index + 1}
itemKey={item.key}
effDate={(e) => { setEffDate({ ...e }) }}
remove={removeEffectiveDate}
timePart={(e) => { console.log(78787, e); setTimestatus(e) }}
validate={(e) => { setTimevalidate(e) }}
timePart={(e) => { console.log(78787, e); setTimestatus(e) }}//
validate={(e) => { setTimevalidate(e) }}//
onChange={(value, key) => {
const _effectiveDateList = effectiveDateList.map((item) => {
if (item.key === key) {

21
src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx

@ -13,6 +13,7 @@ import {
} from "antd";
import TimePart from "./TimePart";
import moment from "moment";
var carr = []
function EffectiveDate(props) {
const {
remove = () => { },
@ -20,7 +21,6 @@ function EffectiveDate(props) {
onChange = () => { },
validate = () => { },
timePart = () => { },
effDate= () => { },
index,
disable = false,
record = {},
@ -96,7 +96,7 @@ function EffectiveDate(props) {
}
if (total === 1440) {
if ([...new Set(arr)].length != timePartList.length) {
message.error('时段范围不能重叠!')
//message.error('')
return 2
}
return 1;
@ -119,12 +119,18 @@ function EffectiveDate(props) {
});
}
useEffect(() => {
console.log('biandd ')
validate(isOneDay())
}, [timePartList])
const valueChange = (value, all) => {
console.log(value, all)
effDate(all)
const obj1 = {
...form.getFieldsValue(),
details: timePartList,
};
if (obj1.date !== void 0) {
obj1.date = obj1.date.format("YYYY-MM-DD");
}
onChange(obj1, itemKey);
}
return (
<div className="effectivedate-box">
@ -133,6 +139,7 @@ function EffectiveDate(props) {
onValuesChange={valueChange}
initialValues={{
...record,
unit_fee_type_group: [],
date: moment(record.date),
}}
disabled={disable}
@ -195,7 +202,11 @@ function EffectiveDate(props) {
key={item.key}
remove={removeTimePart}
itemKey={item.key}
timePart={timePart}
//timePart={timePart}
timePart={(e) => {
carr[index] = e
timePart(carr)
}}
effTimePart={(e) => { setEffTimePart(e) }}
onChange={(value) => {
const _timePartList = timePartList.map((item) => {

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

@ -31,6 +31,7 @@ function TimePart(props) {
effTimePart(false)
}
}, [form])
//
const countDown = (time) => {
var s = 0;
var hour = time.split(':')[0];

4
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BillingRules.jsx

@ -78,7 +78,7 @@ function BillingRules(props) {
editform.setFieldsValue({
rule_id: record.rule_id,
vehicle_type: record.vehicle_type,
group_ids: +record.group_ids,
group_ids: record.group_ids,
});
}}
>
@ -288,7 +288,7 @@ function BillingRules(props) {
name="vehicle_type"
rules={[{ required: true }]}
>
<Select options={carTypeList.slice(1)} />
<Select options={carTypeList.slice(1)} disabled={modalData.status === "edit" ? true : false}/>
</Form.Item>
<Form.Item
label="车辆组"

Loading…
Cancel
Save