|
|
@ -297,7 +297,8 @@ function StaggeredMgm(props) { |
|
|
|
const handleAddDeployType = (value) => { |
|
|
|
setGetCarMsg({ |
|
|
|
...getCarMsg, |
|
|
|
operator_id: value |
|
|
|
operator_id: value, |
|
|
|
road: '' |
|
|
|
}) |
|
|
|
setGetOperatorId(value) |
|
|
|
setData([]) |
|
|
@ -400,26 +401,41 @@ function StaggeredMgm(props) { |
|
|
|
} |
|
|
|
const placeSaveBtn = () => { |
|
|
|
let infoArr = [...getSaleMsg] |
|
|
|
infoArr.map((item, index) => { |
|
|
|
let data = { |
|
|
|
...getCarMsg, |
|
|
|
info: infoArr |
|
|
|
} |
|
|
|
if (getCarMsg.operator_id === '') { |
|
|
|
if (!getCarMsg.operator_id) { |
|
|
|
message.error('请选择所属商户') |
|
|
|
} else if (getCarMsg.road === '') { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!getCarMsg.road) { |
|
|
|
message.error('请输入车场名称') |
|
|
|
} else if (item?.start_date === '' || item?.end_date === '') { |
|
|
|
return |
|
|
|
} |
|
|
|
for (var result = 0; result < infoArr.length; result++) { |
|
|
|
console.log(infoArr[result]); |
|
|
|
if (!infoArr[result]?.start_date || !infoArr[result]?.end_date) { |
|
|
|
message.error('请选择错峰日期') |
|
|
|
} else if (item?.start_time === '' || item?.end_time === '') { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!infoArr[result]?.start_time || !infoArr[result]?.end_time) { |
|
|
|
message.error('请选择错峰时间') |
|
|
|
} else if (item?.num === '') { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!infoArr[result]?.num) { |
|
|
|
message.error('请输入错峰卡数量') |
|
|
|
} else if (item?.price === '') { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!infoArr[result]?.price) { |
|
|
|
message.error('请输入销售价格') |
|
|
|
} else { |
|
|
|
if (item.week.length != []) { |
|
|
|
item.week = item.week.join(',') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!infoArr[result].week.length) { |
|
|
|
message.error('请选择星期配置') |
|
|
|
return |
|
|
|
} |
|
|
|
infoArr[result].week = infoArr[result].week.join(',') |
|
|
|
} |
|
|
|
let data = { |
|
|
|
...getCarMsg, |
|
|
|
info: infoArr |
|
|
|
} |
|
|
|
ajax.getAddStaggered(data).then(res => { |
|
|
|
if (res.status === 20000) { |
|
|
@ -437,9 +453,6 @@ function StaggeredMgm(props) { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
const checkStaggeredBtn = () => { |
|
|
|
setCheckVisible(false) |
|
|
|
setGetSaleMsg([infoData]) |
|
|
@ -615,7 +628,7 @@ function StaggeredMgm(props) { |
|
|
|
</div> |
|
|
|
<Modal |
|
|
|
visible={checkVisible} |
|
|
|
onCancel={checkModal} |
|
|
|
onCancel={checkStaggeredBtn} |
|
|
|
footer={null} |
|
|
|
className="roadModal" |
|
|
|
> |
|
|
|