|
@ -6,7 +6,7 @@ import { putRoadway, putSpecificVehicle, putHouseholds, putCircuit, putVehicle, |
|
|
import { putBridge } from "../../actions/infor" |
|
|
import { putBridge } from "../../actions/infor" |
|
|
import _ from 'lodash' |
|
|
import _ from 'lodash' |
|
|
const UserModal = (props) => { |
|
|
const UserModal = (props) => { |
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, setMonitor } = props |
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, setMonitor,setDelet,whichofits } = props |
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
const [records, setRecords] = useState()//处理
|
|
|
const [records, setRecords] = useState()//处理
|
|
@ -148,32 +148,37 @@ const UserModal = (props) => { |
|
|
visible={visible} |
|
|
visible={visible} |
|
|
onVisibleChange={onVisibleChange} |
|
|
onVisibleChange={onVisibleChange} |
|
|
onFinish={(values) => { |
|
|
onFinish={(values) => { |
|
|
console.log(values) |
|
|
|
|
|
if (Object.values(values).length > 0) { |
|
|
if (Object.values(values).length > 0) { |
|
|
if (rewkeys === 'transportation') { |
|
|
if (rewkeys === 'transportation') { |
|
|
if (typecard == '111') { |
|
|
|
|
|
const query = { ...values, level: sitename, roadId: records?.[0]?.value || '' } |
|
|
if (typecard == '111') { |
|
|
|
|
|
setDelet(values) |
|
|
|
|
|
const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } |
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
const query = { ...values, level: sitename } |
|
|
setDelet(values) |
|
|
|
|
|
const query = { ...values, level: whichofits } |
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'bridge') { |
|
|
if (rewkeys === 'bridge') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, roadId: records?.[0]?.value || '' } |
|
|
const query = { ...values, roadId: records?.[0]?.value || '' } |
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values } |
|
|
const query = { ...values } |
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -183,13 +188,14 @@ const UserModal = (props) => { |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { |
|
|
if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values, type: rewkeys } |
|
|
const query = { ...values, type: rewkeys } |
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -199,13 +205,14 @@ const UserModal = (props) => { |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'yehu') { |
|
|
if (rewkeys === 'yehu') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -214,13 +221,14 @@ const UserModal = (props) => { |
|
|
} |
|
|
} |
|
|
} if (rewkeys === 'xianlu') { |
|
|
} if (rewkeys === 'xianlu') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, lineId: records?.[0]?.value || '' } |
|
|
const query = { ...values, lineId: records?.[0]?.value || '' } |
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values } |
|
|
const query = { ...values } |
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -230,13 +238,14 @@ const UserModal = (props) => { |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'cheliang') { |
|
|
if (rewkeys === 'cheliang') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, carId: records?.[0]?.value || '' } |
|
|
const query = { ...values, carId: records?.[0]?.value || '' } |
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values } |
|
|
const query = { ...values } |
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -246,7 +255,7 @@ const UserModal = (props) => { |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'zhichao') { |
|
|
if (rewkeys === 'zhichao') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
console.log(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, overspeedId: records?.[0]?.value || '' } |
|
|
const query = { ...values, overspeedId: records?.[0]?.value || '' } |
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -254,6 +263,7 @@ const UserModal = (props) => { |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
setDelet(values) |
|
|
const query = { ...values } |
|
|
const query = { ...values } |
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
setSuccess(res.success) |
|
@ -274,7 +284,7 @@ const UserModal = (props) => { |
|
|
name={newlys?.[0]?.type} |
|
|
name={newlys?.[0]?.type} |
|
|
width="md" |
|
|
width="md" |
|
|
label={newlys?.[0]?.name} |
|
|
label={newlys?.[0]?.name} |
|
|
tooltip="最长为 24 位" |
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
value={recordsay?.[0]?.value} |
|
|
value={recordsay?.[0]?.value} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
@ -282,7 +292,7 @@ const UserModal = (props) => { |
|
|
name={newlys?.[1]?.type} |
|
|
name={newlys?.[1]?.type} |
|
|
width="md" |
|
|
width="md" |
|
|
label={newlys?.[1]?.name} |
|
|
label={newlys?.[1]?.name} |
|
|
tooltip="最长为 24 位" |
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
value={recordsay?.[1]?.value} |
|
|
value={recordsay?.[1]?.value} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
@ -316,7 +326,7 @@ const UserModal = (props) => { |
|
|
name={newlys?.[0]?.type} |
|
|
name={newlys?.[0]?.type} |
|
|
width="md" |
|
|
width="md" |
|
|
label={newlys?.[0]?.name} |
|
|
label={newlys?.[0]?.name} |
|
|
tooltip="最长为 24 位" |
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordssy?.[0]?.value}
|
|
|
// value={recordssy?.[0]?.value}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
@ -324,7 +334,7 @@ const UserModal = (props) => { |
|
|
name={newlys?.[1]?.type} |
|
|
name={newlys?.[1]?.type} |
|
|
width="md" |
|
|
width="md" |
|
|
label={newlys?.[1]?.name} |
|
|
label={newlys?.[1]?.name} |
|
|
tooltip="最长为 24 位" |
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordssy?.[1]?.value}
|
|
|
// value={recordssy?.[1]?.value}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
@ -348,7 +358,7 @@ const UserModal = (props) => { |
|
|
{newlysay?.map((item, index) => { |
|
|
{newlysay?.map((item, index) => { |
|
|
return <ProFormText width="md" |
|
|
return <ProFormText width="md" |
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
tooltip="最长为 24 位" |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
})} |
|
|
})} |
|
|