|
|
@ -19,6 +19,7 @@ function TimePart(props) { |
|
|
|
remove, |
|
|
|
itemKey, |
|
|
|
onChange = () => { }, |
|
|
|
timePart = () => { }, |
|
|
|
record, |
|
|
|
disable = false, |
|
|
|
} = props; |
|
|
@ -39,6 +40,11 @@ function TimePart(props) { |
|
|
|
"key": "821170365" |
|
|
|
} |
|
|
|
const valueChange = (value, all) => { |
|
|
|
timePart(value) |
|
|
|
console.log(value) |
|
|
|
if(value.limit){ |
|
|
|
form.validateFields(Object.keys(value)) |
|
|
|
} |
|
|
|
all.key = itemKey; |
|
|
|
if (all.time_part) { |
|
|
|
all.start = moment(all.time_part[0]).format('HH:mm:ss') |
|
|
@ -105,8 +111,8 @@ function TimePart(props) { |
|
|
|
"time_before": record.items[0].segment, |
|
|
|
"time_before_money": record.items[0].unit, |
|
|
|
"time_before_minute": record.items[0].period, |
|
|
|
"time_after_money": record.items[1].unit, |
|
|
|
"time_after_minute": record.items[1].period, |
|
|
|
"time_after_money": record.items[1]?.unit, |
|
|
|
"time_after_minute": record.items[1]?.period, |
|
|
|
"limit": record.limit, |
|
|
|
time_part: [ |
|
|
|
moment(record.start, "HH:mm:ss"), |
|
|
@ -193,11 +199,11 @@ function TimePart(props) { |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<Input.Group compact> |
|
|
|
<Form.Item name="time_before" label="前:"> |
|
|
|
<InputNumber min={0} addonAfter={"分钟"} /> |
|
|
|
<Form.Item name="time_before" label="前:" rules={[{ required: true }]}> |
|
|
|
<InputNumber min={0} precision={0} addonAfter={"分钟"} /> |
|
|
|
</Form.Item> |
|
|
|
<div className="wenzi">,</div> |
|
|
|
<Form.Item name="time_before_money" noStyle> |
|
|
|
<Form.Item name="time_before_money" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber |
|
|
|
min={0} |
|
|
|
addonAfter={"元"} |
|
|
@ -205,20 +211,21 @@ function TimePart(props) { |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<div className="wenzi">/</div> |
|
|
|
<Form.Item name="time_before_minute" noStyle> |
|
|
|
<Form.Item name="time_before_minute" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber |
|
|
|
min={0} |
|
|
|
min={1} |
|
|
|
precision={0} |
|
|
|
addonAfter={"分钟"} |
|
|
|
style={{ width: "20%" }} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
</Input.Group> |
|
|
|
<Input.Group compact> |
|
|
|
<Form.Item name="time_before" label="满:"> |
|
|
|
<InputNumber min={0} addonAfter={"分钟"} disabled /> |
|
|
|
<Form.Item name="time_before" label="满:" rules={[{ required: true }]}> |
|
|
|
<InputNumber min={0} precision={0} addonAfter={"分钟"} disabled /> |
|
|
|
</Form.Item> |
|
|
|
<div className="wenzi">,</div> |
|
|
|
<Form.Item name="time_after_money" noStyle> |
|
|
|
<Form.Item name="time_after_money" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber |
|
|
|
min={0} |
|
|
|
addonAfter={"元"} |
|
|
@ -226,9 +233,10 @@ function TimePart(props) { |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<div className="wenzi">/</div> |
|
|
|
<Form.Item name="time_after_minute" noStyle> |
|
|
|
<Form.Item name="time_after_minute" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber |
|
|
|
min={0} |
|
|
|
min={1} |
|
|
|
precision={0} |
|
|
|
addonAfter={"分钟"} |
|
|
|
style={{ width: "20%" }} |
|
|
|
/> |
|
|
@ -239,12 +247,12 @@ function TimePart(props) { |
|
|
|
case 2: |
|
|
|
return ( |
|
|
|
<Input.Group compact> |
|
|
|
<Form.Item name="unit" noStyle> |
|
|
|
<Form.Item name="unit" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber min={0} addonAfter={"元"} style={{ width: "20%" }} /> |
|
|
|
</Form.Item> |
|
|
|
<div className="wenzi">/</div> |
|
|
|
<Form.Item name="period" noStyle> |
|
|
|
<InputNumber min={0} addonAfter={"分钟"} style={{ width: "20%" }} /> |
|
|
|
<Form.Item name="period" noStyle rules={[{ required: true }]}> |
|
|
|
<InputNumber min={1} precision={0} addonAfter={"分钟"} style={{ width: "20%" }} /> |
|
|
|
</Form.Item> |
|
|
|
</Input.Group> |
|
|
|
); |
|
|
|