Browse Source

fix():修改路内BUG

tags/PMS_Frontend_v1.0.6-develop
guoxin 1 year ago
parent
commit
6a8fa8e9d2
  1. 35
      src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx
  2. 13
      src/pages/OperationCenter/ArrearsRecover/ArrearsCarTask/loadable.jsx

35
src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx

@ -20,7 +20,11 @@ function PersonInfo() {
const [noParams, setNoParams] = useState(true)
const [showEdit, setShowEdit] = useState(false)
const [getEdit, setGetEdit] = useState(false)
const handleReset = () => {
setShowEdit(false)
setTranferAllData([])
setCurrentPersonId("")
}
const [formData, setFormData] = useSetState({
name: defaultParams ? defaultParams.name : '',
pda_number: defaultParams ? defaultParams.pda_number : '',
@ -211,6 +215,7 @@ function PersonInfo() {
})
}
const getDeparts = (id, editFlag) => {
if (id) {
ajax.getDeparts({ id: id }).then(res => {
if (res.status == 20000) {
if (showEdit || editFlag) {
@ -229,7 +234,10 @@ function PersonInfo() {
})
}
}
const getAssets = (id, editFlag) => {
if (id) {
ajax.getAssets({ id: id }).then(res => {
if (res.status == 20000) {
if (showEdit || editFlag) {
@ -253,13 +261,22 @@ function PersonInfo() {
})
}
}
const [getPersonId, setGetPersonId] = useState('')
const [getOperatorId, setGetOperatorId] = useState('0')
const changeOperator = (e) => {
if(e=='0'){
setFormData({ operator_id: e });
}else{
setFormData({ operator_id: e });
getDeparts(e)
getAssets(e)
}
setGetOperatorId(e)
}
const changeEditOperator = (e) => {
setCurrentPersonInfo({ ...currentPersonInfo, operator: e })
getDeparts(e)
@ -267,7 +284,7 @@ function PersonInfo() {
setGetPersonId(e)
}
useEffect(() => {
if (getPersonId !='') {
if (getPersonId) {
let data = {
operator_id: getPersonId
}
@ -288,6 +305,8 @@ function PersonInfo() {
console.log(err)
}).finally(() => {
})
} else {
setTranferAllData([])
}
}, [getPersonId])
/**
@ -446,10 +465,10 @@ function PersonInfo() {
// getPersonAllRoad()
}, [])
useEffect(()=>{
useEffect(() => {
console.log(getEdit);
},[getEdit])
}, [getEdit])
useEffect(() => {
if (!showEdit) {
setCurrentPersonInfo({
@ -549,6 +568,9 @@ function PersonInfo() {
showClose={false}
onChange={e => { changeOperator(e) }}
/>
{
getOperatorId == '0' ? '' :
<>
<FormSelect
yisaLabel="所属部门"
yisaData={departOptions}
@ -567,6 +589,9 @@ function PersonInfo() {
showClose={false}
onChange={e => { setFormData({ property_id: e }) }}
/>
</>
}
<div className="bottomBox">
<Button type="primary" className="colorReset" onClick={reset}>重置</Button>
<Button type="primary" className="colorBtn" onClick={addPersonInfo}>添加</Button>
@ -772,7 +797,7 @@ function PersonInfo() {
</div>
<div className="btn-wrapper">
<Button onClick={submitPersonInfo} type="primary" className="colorBtn">提交</Button>&emsp;
<Button onClick={() => { setShowEdit(false) }} className="colorReset">取消</Button>
<Button onClick={handleReset} className="colorReset">取消</Button>
</div>
</div>
}

13
src/pages/OperationCenter/ArrearsRecover/ArrearsCarTask/loadable.jsx

@ -282,11 +282,15 @@ function ArrearsCarTask(props) {
//
const [checkIds, setCheckIds] = useState([]);
const [checkValue, setCheckValue] = useState({});
const [getArrValue, setGetArrValue] = useState([]);
const rowSelection = {
selectedRowKeys: checkIds,
onChange: (keys, item) => {
let arr=[]
item.map(res => {
setCheckValue(res);
arr.push(res.car_id)
setGetArrValue(arr)
})
setCheckIds(keys);
},
@ -315,13 +319,14 @@ function ArrearsCarTask(props) {
}
//
const sendTaskData = () => {
let str =getArrValue.toString()
if (checkIds.length == []) {
message.error('请先选择欠费车辆')
} else if (checkValue.real_amount > checkValue.amount) {
message.error(`选择车辆中存在欠费金额不足${checkValue.real_amount}元的车辆`)
} else {
let data = {
car_ids: checkValue.car_id,
car_ids: str,
start_out_time: formData.start_out_time,
end_out_time: formData.end_out_time
}
@ -336,8 +341,9 @@ function ArrearsCarTask(props) {
}
//
const handlesendTask = () => {
let str =getArrValue.toString()
let data = {
car_ids: checkValue.car_id,
car_ids:str,
start_out_time: formData.start_out_time,
end_out_time: formData.end_out_time
}
@ -353,8 +359,9 @@ function ArrearsCarTask(props) {
}
//
const handleCreat=()=>{
let str =getArrValue.toString()
let data = {
car_ids: checkValue.car_id,
car_ids: str,
start_out_time: formData.start_out_time,
end_out_time: formData.end_out_time
}

Loading…
Cancel
Save