|
|
@ -66,23 +66,29 @@ function Blacklist(props) { |
|
|
|
} |
|
|
|
if (getAddData.plate == '') { |
|
|
|
message.error('请输入车牌号') |
|
|
|
} else if (getAddData.operator_id == '') { |
|
|
|
} else if (getAddData.operator_id ) { |
|
|
|
message.error('请选择商户名称') |
|
|
|
} else if (getAddData.plate_color_id == '') { |
|
|
|
message.error('请选择车牌颜色') |
|
|
|
} else { |
|
|
|
ajax.addChange(data).then(res => { |
|
|
|
if (res.status === 20000) { |
|
|
|
setGetAddVisible(false) |
|
|
|
getData(formData) |
|
|
|
setGetAddData({ |
|
|
|
plate: '', |
|
|
|
operator: '', |
|
|
|
plate_color: '', |
|
|
|
detail: '', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
const cancel = () => { |
|
|
|
setGetAddVisible(false) |
|
|
|
setEditVisible(false) |
|
|
|
setDeleteVisible(false) |
|
|
|
} |
|
|
|
const cancelAdd = () => { |
|
|
|
setGetAddVisible(false) |
|
|
|
setGetAddData({ |
|
|
|
plate: '', |
|
|
|
operator: '', |
|
|
@ -151,7 +157,7 @@ function Blacklist(props) { |
|
|
|
}, |
|
|
|
},] |
|
|
|
//编辑 |
|
|
|
const [getValueId,setGetValueId]=useState({}) |
|
|
|
const [getValueId, setGetValueId] = useState({}) |
|
|
|
const [getEditData, setGetEditData] = useState({}) |
|
|
|
const deleteApplyBtn = (record) => { |
|
|
|
setGetValueId(record) |
|
|
@ -166,7 +172,7 @@ function Blacklist(props) { |
|
|
|
const editSubmit = () => { |
|
|
|
let data = { |
|
|
|
...getEditData, |
|
|
|
black_id:getValueId.id |
|
|
|
black_id: getValueId.id |
|
|
|
} |
|
|
|
ajax.detailChange(data).then(res => { |
|
|
|
if (res.status === 20000) { |
|
|
@ -176,17 +182,17 @@ function Blacklist(props) { |
|
|
|
}) |
|
|
|
} |
|
|
|
//删除 |
|
|
|
const [getDeleteData,setGetDeleteData]=useState({}) |
|
|
|
const [getDeleteData, setGetDeleteData] = useState({}) |
|
|
|
const applyBtn = (record) => { |
|
|
|
setGetDeleteData(record) |
|
|
|
setDeleteVisible(true) |
|
|
|
} |
|
|
|
const deleteModal=()=>{ |
|
|
|
const deleteModal = () => { |
|
|
|
setDeleteVisible(false) |
|
|
|
} |
|
|
|
const deleteSubmit=()=>{ |
|
|
|
let data ={ |
|
|
|
black_id:getDeleteData.id, |
|
|
|
const deleteSubmit = () => { |
|
|
|
let data = { |
|
|
|
black_id: getDeleteData.id, |
|
|
|
} |
|
|
|
ajax.deleteChange(data).then(res => { |
|
|
|
if (res.status === 20000) { |
|
|
@ -245,7 +251,14 @@ function Blacklist(props) { |
|
|
|
} |
|
|
|
const addModal = () => { |
|
|
|
setGetAddVisible(false) |
|
|
|
setGetAddData({ |
|
|
|
plate: '', |
|
|
|
operator: '', |
|
|
|
plate_color: '', |
|
|
|
detail: '', |
|
|
|
}) |
|
|
|
} |
|
|
|
//添加 |
|
|
|
const addData = () => { |
|
|
|
setGetAddVisible(true) |
|
|
|
} |
|
|
@ -395,7 +408,7 @@ function Blacklist(props) { |
|
|
|
</div> |
|
|
|
<div className="submitBtn"> |
|
|
|
<button className="submit colorBtn" onClick={() => { applySubmit() }}>提交</button> |
|
|
|
<button className="cancel colorReset" onClick={() => { cancel() }}>取消</button> |
|
|
|
<button className="cancel colorReset" onClick={() => { cancelAdd() }}>取消</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|