Browse Source

Merge branch 'develop' of http://120.27.195.166:3000/chenglb/PMS_Frontend_v1.0.0.git into develop

tags/PMS_Frontend_v1.0.6-develop
chenglb 1 year ago
parent
commit
5b2f0422a5
  1. 2
      src/components/TableModule/index.jsx
  2. 146
      src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx
  3. 26
      src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx
  4. 21
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
  5. 11
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx
  6. 11
      src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx
  7. 104
      src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss
  8. 80
      src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx
  9. 6
      src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx
  10. 6
      src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx
  11. 43
      src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx
  12. 41
      src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx
  13. 17
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx
  14. 25
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx
  15. 108
      src/pages/SystemMgm/AdminMgm/loadable.jsx
  16. 49
      src/pages/SystemMgm/RoleMgm/loadable.jsx
  17. 2
      src/services/OutRoadMgm/OutSegment.js

2
src/components/TableModule/index.jsx

@ -765,7 +765,7 @@ const TableModule = forwardRef((props, ref) => {
}, []); }, []);
const [getRoadList, setGetRoadList] = useState([]) const [getRoadList, setGetRoadList] = useState([])
useEffect(() => { useEffect(() => {
ajax.getRoadSearch().then((res) => {
ajax.getNewRoadSearch().then((res) => {
setGetRoadList(res.data); setGetRoadList(res.data);
}) })
}, []) }, [])

146
src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx

@ -261,132 +261,9 @@ function ParkingAlyPeriod() {
this.random(arr) this.random(arr)
} }
} }
const color = ['#5470c6','#91cc75','#fac858','#ee6666','#73c0de','#fc8452','#3ba272','#9a60b4','#ee7ccc']
console.log(Math.round(Math.random()*10))
const color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#fc8452', '#3ba272', '#9a60b4', '#ee7ccc']
// 线 hour // 线 hour
const getParkOptionHour = (data) => { const getParkOptionHour = (data) => {
data = [
{
"date": "2023-11-20",
"hour": "00:00",
"occupancy_rate": "0.02%"
},
{
"date": "2023-11-22",
"hour": "01:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "02:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "03:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "04:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "05:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "06:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "07:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-29",
"hour": "08:00",
"occupancy_rate": "0.07%"
},
{
"date": "2023-11-22",
"hour": "09:00",
"occupancy_rate": "0.26%"
},
{
"date": "2023-11-24",
"hour": "10:00",
"occupancy_rate": "0.18%"
},
{
"date": "2023-11-22",
"hour": "11:00",
"occupancy_rate": "0.11%"
},
{
"date": "2023-11-23",
"hour": "12:00",
"occupancy_rate": "0.06%"
},
{
"date": "2023-11-22",
"hour": "13:00",
"occupancy_rate": "0.08%"
},
{
"date": "2023-11-21",
"hour": "14:00",
"occupancy_rate": "0.35%"
},
{
"date": "2023-11-29",
"hour": "15:00",
"occupancy_rate": "0.26%"
},
{
"date": "2023-11-20",
"hour": "16:00",
"occupancy_rate": "0.32%"
},
{
"date": "2023-11-22",
"hour": "17:00",
"occupancy_rate": "0.22%"
},
{
"date": "2023-11-22",
"hour": "18:00",
"occupancy_rate": "0.14%"
},
{
"date": "2023-11-21",
"hour": "19:00",
"occupancy_rate": "0.01%"
},
{
"date": "2023-11-22",
"hour": "20:00",
"occupancy_rate": "0%"
},
{
"date": "2023-11-22",
"hour": "21:00",
"occupancy_rate": "0.05%"
},
{
"date": "2023-11-21",
"hour": "22:00",
"occupancy_rate": "0.02%"
},
{
"date": "2023-11-22",
"hour": "23:00",
"occupancy_rate": "0.01%"
}
]
console.log(data) console.log(data)
if (!data || data.length <= 0) { if (!data || data.length <= 0) {
setHourData({}) setHourData({})
@ -399,7 +276,7 @@ function ParkingAlyPeriod() {
); );
// //
let seriesData = areaNames.map((areaName, index) => { let seriesData = areaNames.map((areaName, index) => {
let color2 = color[Math.round(Math.random()*10)]
let color2 = color[Math.round(Math.random() * 10)]
// //
let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data
// //
@ -415,8 +292,8 @@ function ParkingAlyPeriod() {
}, },
normal: { normal: {
color: color2, //线 color: color2, //线
lineStyle:{
color:color2,
lineStyle: {
color: color2,
} }
//线 //线
} }
@ -442,13 +319,7 @@ function ParkingAlyPeriod() {
}; };
}); });
setHourData({
...lineChartOption(areaNames, xAxisData, "饱和度", seriesData),
// tooltip: {
// trigger: "axis",
// formatter: "{a}<br/>{b}{c}",
// },
});
setHourData({ ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData) });
}; };
function getParkingIncome(data) { function getParkingIncome(data) {
ajax ajax
@ -462,14 +333,17 @@ function ParkingAlyPeriod() {
.catch((err) => console.error(err)); .catch((err) => console.error(err));
} }
function getParkingData(data) { function getParkingData(data) {
setLoading(true)
setHourData({})
ajax ajax
.getParkingAlyPeriodParkLine(data) .getParkingAlyPeriodParkLine(data)
.then((res) => { .then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
getParkOption(res.data.list?.area_list); getParkOption(res.data.list?.area_list);
setKeyVal(res.data.list?.hour_list.length) setKeyVal(res.data.list?.hour_list.length)
//setHourData({})
getParkOptionHour(res.data.list?.hour_list); getParkOptionHour(res.data.list?.hour_list);
setLoading(false)
} }
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
@ -824,7 +698,7 @@ function ParkingAlyPeriod() {
option={hourData} option={hourData}
style={{ height: "300px", width: "100%", overflow: "hidden", background: '#545d74' }} style={{ height: "300px", width: "100%", overflow: "hidden", background: '#545d74' }}
/> : /> :
<div className="no-data-box">暂无数据</div>
<div className="no-data-box">{loading ? "加载中" : "暂无数据"}</div>
) )
: :
( (

26
src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx

@ -917,19 +917,19 @@ function ParkingOrderInquiry(props) {
):null} */} ):null} */}
{ {
tabKeyChild == 1 ? tabKeyChild == 1 ?
<div style={{ height: '800px' }}>
<TableModule
columns={acdColums}
tableData={resultData}
formSearch={[ash[25], ash[0], ash[1], ash[2], ash[3], ash[18], ash[5], ash[12], ash[26], ash[29]]}
total={total}
initFormData={{ type: 1 }}
rowKey={"order_id"}
exportUrl={'/api/fin/order_search/arrears_order_export'}
limitCon={limitCon}
search={searchOther}
/>
</div> : null
<div style={{ height: '800px' }}>
<TableModule
columns={acdColums}
tableData={resultData}
formSearch={[ash[25], ash[0], ash[1], ash[2], ash[3], ash[18], ash[5], ash[12], ash[26], ash[29]]}
total={total}
initFormData={{ type: 1 }}
rowKey={"order_id"}
exportUrl={'/api/fin/order_search/arrears_order_export'}
limitCon={limitCon}
search={searchOther}
/>
</div>: null
} }
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane tab="订单修改记录" key="2"> <Tabs.TabPane tab="订单修改记录" key="2">

21
src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx

@ -21,6 +21,7 @@ const FormModal = (props) => {
const { const {
yisaData = {}, yisaData = {},
editVisible, editVisible,
setGetEditVisible=()=>{},
editModal = () => { }, editModal = () => { },
getEditData = {}, getEditData = {},
getData=()=>{} getData=()=>{}
@ -219,11 +220,21 @@ const FormModal = (props) => {
// //
const onFinish = (data) => { const onFinish = (data) => {
// //
data['rules'].map(item => {
console.log(item);
item.details.map(item=>{
item["start"] = moment(item["start"]).format('HH:mm');
item["end"] = moment(item["end"]).format('HH:mm');
})
if (item.cdate) {
item["cdate"] = moment(item["cdate"]).format('YYYY-MM-DD HH:mm:ss');
}
})
if(handleFormValidation(data,0)&&handleFormValidation(data,1)){ if(handleFormValidation(data,0)&&handleFormValidation(data,1)){
let newData = handelDate(data, 1)
ajax.deleteChangeRules({source:newData}).then(res => {
// let newData = handelDate(data, 1)
ajax.deleteChangeRules({source:data}).then(res => {
if (res.status === 20000) { if (res.status === 20000) {
editVisible = false
setGetEditVisible(false)
getData() getData()
} }
}) })
@ -231,14 +242,12 @@ const FormModal = (props) => {
}; };
useEffect(() => { useEffect(() => {
console.log("=================");
console.log(yisaData);
let newObj = { ...defaultData } let newObj = { ...defaultData }
if (JSON.stringify(yisaData) != "{}") { if (JSON.stringify(yisaData) != "{}") {
newObj = handelDate(yisaData, 2) newObj = handelDate(yisaData, 2)
} }
newObj.rules = newObj?.source?.rules newObj.rules = newObj?.source?.rules
delete newObj.source
// delete newObj.source
// //
init(newObj); init(newObj);
form.setFieldsValue(newObj); form.setFieldsValue(newObj);

11
src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx

@ -137,7 +137,7 @@ function ChargeRules(props) {
return <> return <>
<Popover content={ <Popover content={
<div className="black"> <div className="black">
<div onClick={() => { deleteApplyBtn(record) }}>编辑</div>
<div onClick={() => { deleteApplyBtn(record,text) }}>编辑</div>
<div onClick={() => { applyBtn(record) }}>删除</div> <div onClick={() => { applyBtn(record) }}>删除</div>
<div onClick={() => { bindPark(record) }}>绑定车场</div> <div onClick={() => { bindPark(record) }}>绑定车场</div>
</div>}> </div>}>
@ -148,9 +148,11 @@ function ChargeRules(props) {
},] },]
// //
const [getEditData, setGetEditData] = useState({}) const [getEditData, setGetEditData] = useState({})
const deleteApplyBtn = (record) => {
const deleteApplyBtn = (record,text) => {
setGetEditVisible(true) setGetEditVisible(true)
setGetEditData(record) setGetEditData(record)
console.log(record);
console.log(text);
} }
// //
const [getDeleteData, setGetDeleteData] = useState({}) const [getDeleteData, setGetDeleteData] = useState({})
@ -477,7 +479,8 @@ function ChargeRules(props) {
// className='yisa-table' // className='yisa-table'
dataSource={resultData.data} dataSource={resultData.data}
columns={ columns={
handleColumns()
// handleColumns()
deployListColumns
} }
pagination={false} pagination={false}
loading={ajaxLoading} loading={ajaxLoading}
@ -500,7 +503,7 @@ function ChargeRules(props) {
</div> </div>
<FormModal addVisible={addVisible} setGetAddVisible={setGetAddVisible} getData={()=>getData()} closAddModal={closAddModal} /> <FormModal addVisible={addVisible} setGetAddVisible={setGetAddVisible} getData={()=>getData()} closAddModal={closAddModal} />
<EditModal editVisible={editVisible} editModal={editModal} getData={()=>getData()} yisaData={getEditData} />
<EditModal editVisible={editVisible} setGetEditVisible={setGetEditVisible} editModal={editModal} getData={()=>getData()} yisaData={getEditData} />
<Modal <Modal
visible={deleteVisible} visible={deleteVisible}
onCancel={deleteModal} onCancel={deleteModal}

11
src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx

@ -385,7 +385,7 @@ function CollectorWorkStat(props) {
setGetCheckData(record) setGetCheckData(record)
setGetCheckPic(record.image) setGetCheckPic(record.image)
setCheckVisible(true) setCheckVisible(true)
getTable(Object.assign({}, lastColumnList, {white_id:record.id}))
getTable(Object.assign({}, lastColumnList, {white_id:record.id,pn:1}))
setGetTableId(record.id) setGetTableId(record.id)
// setLastColumnList(Object.assign({},lastColumnList,{white_id:record.id})) // setLastColumnList(Object.assign({},lastColumnList,{white_id:record.id}))
} }
@ -408,6 +408,7 @@ function CollectorWorkStat(props) {
const applyModal = () => { const applyModal = () => {
setApplyVisible(false) setApplyVisible(false)
} }
const applyBtn = (record) => { const applyBtn = (record) => {
setGetCarStatus(record) setGetCarStatus(record)
@ -431,11 +432,12 @@ function CollectorWorkStat(props) {
setExamineVisible(true) setExamineVisible(true)
setGetCheckData(record) setGetCheckData(record)
columnList(record) columnList(record)
getTable(Object.assign({}, lastColumnList, {white_id:record.id}))
getTable(Object.assign({}, lastColumnList, {white_id:record.id,pn:1}))
setGetTableId(record.id) setGetTableId(record.id)
} }
const examineModal = () => { const examineModal = () => {
setExamineVisible(false) setExamineVisible(false)
setLastColumnData({...lastColumnData,pn:1})
} }
const applyDeleteModal = () => { const applyDeleteModal = () => {
setApplyDeleteVisible(false) setApplyDeleteVisible(false)
@ -587,9 +589,11 @@ function CollectorWorkStat(props) {
// //
const checkModal = () => { const checkModal = () => {
setCheckVisible(false) setCheckVisible(false)
setLastColumnData({...lastColumnData,pn:1})
} }
const specialDataModal = () => { const specialDataModal = () => {
setCheckVisible(false) setCheckVisible(false)
setLastColumnData({...lastColumnData,pn:1})
} }
const deactivateModal = () => { const deactivateModal = () => {
setDeactivateVisible(false) setDeactivateVisible(false)
@ -656,6 +660,7 @@ function CollectorWorkStat(props) {
setGetOpinion({ setGetOpinion({
content: '' content: ''
}) })
setLastColumnData({...lastColumnData,pn:1})
} }
// //
const getData = (data = formData) => { const getData = (data = formData) => {
@ -1332,6 +1337,7 @@ function CollectorWorkStat(props) {
visible={checkVisible} visible={checkVisible}
onCancel={checkModal} onCancel={checkModal}
footer={null} footer={null}
destroyOnClose={true}
className="specialModal" className="specialModal"
title='查看白名单' title='查看白名单'
> >
@ -2065,6 +2071,7 @@ function CollectorWorkStat(props) {
visible={examineVisible} visible={examineVisible}
onCancel={examineModal} onCancel={examineModal}
footer={null} footer={null}
destroyOnClose={true}
className="examineModal" className="examineModal"
title='查看白名单' title='查看白名单'
> >

104
src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/index.scss

@ -1,9 +1,8 @@
@import "@/assets/css/mixin.scss"; @import "@/assets/css/mixin.scss";
$color-container-bg : var(--color-container-bg);
$color-user-list-bg : var(--color-user-list-bg);
$color-text : var(--color-text);
$color-primary : var(--color-primary);
$color-container-bg: var(--color-container-bg);
$color-user-list-bg: var(--color-user-list-bg);
$color-text: var(--color-text);
$color-primary: var(--color-primary);
.colorBtn { .colorBtn {
width: 90px; width: 90px;
@ -37,44 +36,46 @@ $color-primary : var(--color-primary);
border-radius: 4px; border-radius: 4px;
} }
} }
.paid-employees{
.paid-employees {
display: flex; display: flex;
padding: 15px; padding: 15px;
width: 100%; width: 100%;
.paid-search{
.search{
.paid-search {
.search {
font-size: 16px; font-size: 16px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700; font-weight: 700;
text-align: left; text-align: left;
color: #eeeff1; color: #eeeff1;
} }
label{
margin:0 10px;
label {
margin: 0 10px;
} }
.yisa-search{
.yisa-search {
margin-top: 10px; margin-top: 10px;
} }
.ant-select:not(.ant-select-customize-input) .ant-select-selector{
.ant-select:not(.ant-select-customize-input) .ant-select-selector {
background-color: #50586c !important; background-color: #50586c !important;
} }
.ant-select-arrow .anticon{
.ant-select-arrow .anticon {
background-color: #50586c !important; background-color: #50586c !important;
} }
.ant-input:placeholder-shown{
.ant-input:placeholder-shown {
background-color: #50586c !important; background-color: #50586c !important;
} }
.timePicker{
.timePicker {
width: 350px; width: 350px;
margin-top: 22px; margin-top: 22px;
.btnBox{
display:flex ;
.yisa-btn{
margin-left: 20px;
}
.root_gfkk{
margin-left: 20px;
.export-content{
.btnBox {
display: flex;
.yisa-btn {
margin-left: 20px;
}
.root_gfkk {
margin-left: 20px;
.export-content {
width: 78px; width: 78px;
height: 33px; height: 33px;
display: flex; display: flex;
@ -86,60 +87,77 @@ $color-primary : var(--color-primary);
color: #fff; color: #fff;
margin-right: 10px; margin-right: 10px;
} }
}
} }
}
} }
} }
.paid-result{
.paid-result {
width: 100%; width: 100%;
height: 800px; height: 800px;
background: #505a6f; background: #505a6f;
border-radius: 20px; border-radius: 20px;
margin-left: 17px; margin-left: 17px;
.result{
.result {
padding: 25px; padding: 25px;
.font{
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
.font {
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
font-weight: 400; font-weight: 400;
text-align: left; text-align: left;
color: #eeeff1; color: #eeeff1;
margin-bottom: 10px; margin-bottom: 10px;
display: inline-block; display: inline-block;
em{
em {
color: #3aa8fe; color: #3aa8fe;
margin: 0 5px; margin: 0 5px;
} }
} }
.yisa-table .ant-table-thead .ant-table-cell{
.cc-result-flow {
.ant-table-wrapper {
max-height: 680px;
overflow-y: scroll;
}
}
.ant-table-wrapper::-webkit-scrollbar {
width: 5px;
}
.ant-table-wrapper::-webkit-scrollbar-thumb {
background-color: #9da2ab;
border-radius: 10px;
}
.yisa-table .ant-table-thead .ant-table-cell {
background-color: #616b83 !important; background-color: #616b83 !important;
color: #ffffff !important;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
color: #ffffff !important;
font-size: 14px;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700;
text-align: center; text-align: center;
border-right: none !important; border-right: none !important;
border-top-color: #888f9d !important; border-top-color: #888f9d !important;
border-color: #888f9d !important; border-color: #888f9d !important;
} }
.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table, .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table,
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {
border-top: none !important; border-top: none !important;
border-left: none !important; border-left: none !important;
} }
.ant-table-tbody .ant-table-row .ant-table-cell{
.ant-table-tbody .ant-table-row .ant-table-cell {
background-color: #3e4557 !important; background-color: #3e4557 !important;
color: #ffffff !important; color: #ffffff !important;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
font-weight: 400; font-weight: 400;
border-right: none !important; border-right: none !important;
border-left: none !important; border-left: none !important;
border-bottom-color: #626b7e !important; border-bottom-color: #626b7e !important;
} }
} }
} }
}
}

80
src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx

@ -9,7 +9,7 @@ import "./index.scss";
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import ajax from '@/services' import ajax from '@/services'
let array = [] let array = []
const { Column, ColumnGroup } = Table;
function WorkerStat(props) { function WorkerStat(props) {
// const configData = props.sysConfig["lib-deploy"] || {}; // const configData = props.sysConfig["lib-deploy"] || {};
const [ajaxLoading, setAjaxLoading] = useState(false) const [ajaxLoading, setAjaxLoading] = useState(false)
@ -74,8 +74,7 @@ function WorkerStat(props) {
// //
const deployListColumns = [{ const deployListColumns = [{
title: '商户名称', title: '商户名称',
dataIndex: 'operator',
key: 'operator'
}, },
{ {
title: '登录名', title: '登录名',
@ -88,35 +87,29 @@ function WorkerStat(props) {
key: 'name', key: 'name',
}, },
{ {
title: '实收金额',
dataIndex: 'today_sale',
key: 'today_sale',
},
{
title: '追缴金额',
dataIndex: 'today_rate',
key: 'today_rate',
title: '营收金额',
dataIndex: 'revenue_amount',
key: 'revenue_amount',
}, },
{ {
title: '应收金额',
dataIndex: 'today_receive',
key: 'today_receive',
title: '预付金额',
dataIndex: 'prepaid_amount',
key: 'prepaid_amount',
}, },
{ {
title: '收费率',
dataIndex: 'sale_rate',
key: 'sale_rate',
title: 'PDA欠费追缴金额',
dataIndex: 'recovery_amount',
key: 'recovery_amount',
}, },
{ {
title: '入场操作数',
dataIndex: 'entry_operation_records_count',
key: 'entry_operation_records_count',
title: '入场操作记录数',
dataIndex: 'in_num',
key: 'in_num',
}, },
{ {
title: '出场操作数',
dataIndex: 'exit_operation_records_count',
key: 'exit_operation_records_count',
width: '120px',
title: '出场操作记录数',
dataIndex: 'out_num',
key: 'out_num',
}] }]
// //
const getData = (data = formData) => { const getData = (data = formData) => {
@ -150,9 +143,9 @@ function WorkerStat(props) {
const changePn = (pn, length) => { const changePn = (pn, length) => {
if (lastFormData.page_size === length) { if (lastFormData.page_size === length) {
setFormData(Object.assign({}, formData, { pn: pn, page_size: length })) setFormData(Object.assign({}, formData, { pn: pn, page_size: length }))
setLastFormData(Object.assign({}, lastFormData, { pn: pn , page_size: length }))
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn , page_size: length })
getData(Object.assign({}, formData, { pn: pn , page_size: length }))
setLastFormData(Object.assign({}, lastFormData, { pn: pn, page_size: length }))
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn, page_size: length })
getData(Object.assign({}, formData, { pn: pn, page_size: length }))
} }
} }
// //
@ -185,9 +178,9 @@ function WorkerStat(props) {
setGetName(res.data) setGetName(res.data)
}) })
} }
//
const exportData=()=>{
let data={
//
const exportData = () => {
let data = {
...formData ...formData
} }
ajax.statExport(data).then(res => { ajax.statExport(data).then(res => {
@ -290,17 +283,22 @@ function WorkerStat(props) {
<div className="result"> <div className="result">
<span className="font">共检索到<em>{resultData.total_records}</em>条结果</span> <span className="font">共检索到<em>{resultData.total_records}</em>条结果</span>
<ResultFlowResult ajaxLoad={ajaxLoading} resultData={resultData.data ? resultData.data : []}> <ResultFlowResult ajaxLoad={ajaxLoading} resultData={resultData.data ? resultData.data : []}>
<Table
bordered
// className='yisa-table'
dataSource={resultData.data}
columns={
handleColumns()
}
// rowKey={record => record.cap_id + "_" + record.bk_id}
pagination={false}
loading={ajaxLoading}
/>
<Table dataSource={resultData.data} pagination={false} loading={ajaxLoading}scroll={800} >
<Column title="商户名称" dataIndex='operator' key='operator' align="center"/>
<Column title="登录名" dataIndex='username' key='username' />
<Column title="姓名" dataIndex='name' key='name' />
<Column title="营收金额" dataIndex='revenue_amount' key='revenue_amount' />
<Column title="预付金额" dataIndex='prepaid_amount' key='prepaid_amount' />
<Column title="PDA欠费追缴金额" dataIndex='recovery_amount' key='recovery_amount' />
<Column title="入场操作记录数" dataIndex='in_num' key='in_num' />
<Column title="出场操作记录数" dataIndex='out_num' key='out_num' />
<ColumnGroup title="考核报告">
<Column title="未登记订单" dataIndex="unregisteredRecode" key="unregisteredRecode" />
<Column title="收费率" dataIndex="sale_rate" key="sale_rate" />
<Column title="异常考勤" dataIndex="abnormal_attendance" key="abnormal_attendance" />
<Column title="被稽查次数" dataIndex="is_check" key="is_check" />
</ColumnGroup>
</Table>
<Pagination <Pagination
className="pagination-common" className="pagination-common"
showSizeChanger showSizeChanger

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

@ -427,6 +427,7 @@ function PersonInfo() {
const addPersonInfo = () => { const addPersonInfo = () => {
setShowEdit(true) setShowEdit(true)
setGetEdit(false)
setCurrentPersonId("") setCurrentPersonId("")
setTargetKeys([]) setTargetKeys([])
} }
@ -441,9 +442,14 @@ function PersonInfo() {
useEffect(() => { useEffect(() => {
getAllOperator() getAllOperator()
return () => setGetEdit(false)
// getPersonAllRoad() // getPersonAllRoad()
}, []) }, [])
useEffect(()=>{
console.log(getEdit);
},[getEdit])
useEffect(() => { useEffect(() => {
if (!showEdit) { if (!showEdit) {
setCurrentPersonInfo({ setCurrentPersonInfo({

6
src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx

@ -775,7 +775,7 @@ function ParkRecordTotal() {
{ {
park_id: historyDataDetail.park_id, park_id: historyDataDetail.park_id,
plate: historyDataDetail.plate, plate: historyDataDetail.plate,
park_name: historyDataDetail?.third_party_flow_id,
park_name: historyDataDetail?.road,
in_time: historyDataDetail.in_time, in_time: historyDataDetail.in_time,
admission_time: historyDataDetail?.out_time, admission_time: historyDataDetail?.out_time,
}, },
@ -785,7 +785,7 @@ function ParkRecordTotal() {
/> />
<Descriptions title="车场详情"> <Descriptions title="车场详情">
<Descriptions.Item label="停车场名称"> <Descriptions.Item label="停车场名称">
{historyDataDetail?.third_party_flow_id}
{historyDataDetail?.road}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="区域"> <Descriptions.Item label="区域">
{historyDataDetail.region} {historyDataDetail.region}
@ -902,7 +902,7 @@ function ParkRecordTotal() {
> >
<div>{historyDataDetail.examine_time}</div> <div>{historyDataDetail.examine_time}</div>
<div>来源:平台</div> <div>来源:平台</div>
<div>操作人:{historyDataDetail.examine_person}</div>
<div>操作人:{historyDataDetail.dealer}</div>
</div> </div>
</div> </div>
</Timeline.Item> </Timeline.Item>

43
src/pages/InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx

@ -47,6 +47,7 @@ import {
TreeSelectGroup, TreeSelectGroup,
} from "@/components"; } from "@/components";
import "./index.scss"; import "./index.scss";
import { getToken } from "@/config/cookie";
import { useSetState, useSessionStorageState, useUpdateEffect } from "ahooks"; import { useSetState, useSessionStorageState, useUpdateEffect } from "ahooks";
const { TextArea } = Input; const { TextArea } = Input;
@ -57,6 +58,7 @@ function ConfigRoad() {
const parking_id = location.search.split("=")[1].split("&")[0]; const parking_id = location.search.split("=")[1].split("&")[0];
const operator_id = location.search.split("&")[1].split("=")[1]; const operator_id = location.search.split("&")[1].split("=")[1];
const region_id = location.search.split("&")[2].split("=")[1]; const region_id = location.search.split("&")[2].split("=")[1];
const [modalBtnLoading,setModalBtnLoading] = useState(false)
//Form //Form
const [berthForm] = Form.useForm(); const [berthForm] = Form.useForm();
const [dataForm] = Form.useForm(); const [dataForm] = Form.useForm();
@ -66,8 +68,8 @@ function ConfigRoad() {
const [getIdValue, setGetIdValue] = useState({}) const [getIdValue, setGetIdValue] = useState({})
// //
const [showBerthSelect, setShowBerthSelect] = useState(false); const [showBerthSelect, setShowBerthSelect] = useState(false);
//
const [editTitle,setEditTitle]=useState(false)
//
const [editTitle,setEditTitle]=useState(false)
const berthManage = { const berthManage = {
form: [ form: [
{ {
@ -242,10 +244,13 @@ function ConfigRoad() {
video_content: "", video_content: "",
}, },
exporturl: "/api/bpm/berth/export", exporturl: "/api/bpm/berth/export",
downloadUrl: "",
downloadUrl: "api/bpm/berth/berth_import_template",
importProps: { importProps: {
name: "file", name: "file",
action: "/PMS/api/bpm/berth/import", action: "/PMS/api/bpm/berth/import",
headers: {
Authorization: getToken(),
},
onChange(info) { onChange(info) {
if (info.file.status !== "uploading") { if (info.file.status !== "uploading") {
console.log(info.file, info.fileList); console.log(info.file, info.fileList);
@ -455,6 +460,9 @@ function ConfigRoad() {
importProps: { importProps: {
name: "file", name: "file",
data: { road_id: parking_id }, data: { road_id: parking_id },
headers: {
Authorization: getToken(),
},
action: "/PMS/api/bpm/device/import_device", action: "/PMS/api/bpm/device/import_device",
onChange(info) { onChange(info) {
if (info.file.status !== "uploading") { if (info.file.status !== "uploading") {
@ -618,12 +626,15 @@ function ConfigRoad() {
}, },
], ],
key: "id", key: "id",
exporturl: "",
exporturl: "/api/bpm/device/export_pole_position",
downloadUrl: "/api/bpm/device/pole_position_import_template", downloadUrl: "/api/bpm/device/pole_position_import_template",
importProps: { importProps: {
name: "file", name: "file",
action: "/PMS/api/bpm/device/import_pole_position", action: "/PMS/api/bpm/device/import_pole_position",
data: { road_id: parking_id }, data: { road_id: parking_id },
headers: {
Authorization: getToken(),
},
onChange(info) { onChange(info) {
if (info.file.status !== "uploading") { if (info.file.status !== "uploading") {
console.log(info.file, info.fileList); console.log(info.file, info.fileList);
@ -751,6 +762,7 @@ function ConfigRoad() {
<a <a
onClick={() => { onClick={() => {
setCurRuleRecord(record); setCurRuleRecord(record);
console.log(record);
ruleForm.setFieldsValue({ ruleForm.setFieldsValue({
vehicle_type: record.vehicle_type, vehicle_type: record.vehicle_type,
rule_id: record.rule_id, rule_id: record.rule_id,
@ -759,12 +771,14 @@ function ConfigRoad() {
}); });
// setSelectedBerth(record.berth_ids.split(",").map(item => +item)) // setSelectedBerth(record.berth_ids.split(",").map(item => +item))
setRuleModal(true); setRuleModal(true);
// setIsRuleEdit(true);
if (record.berth_ids === '') { if (record.berth_ids === '') {
setShowBerthSelect(false); setShowBerthSelect(false);
setIsRuleEdit(true);
} else {
setShowBerthSelect(true);
setIsRuleEdit(false); setIsRuleEdit(false);
}else {
setShowBerthSelect(true);
setIsRuleEdit(true);
} }
let data = { let data = {
road_id: parking_id, road_id: parking_id,
@ -1327,6 +1341,7 @@ function ConfigRoad() {
} }
// //
function handleDataAcquistionModal() { function handleDataAcquistionModal() {
setModalBtnLoading(true)
function addDevice(res) { function addDevice(res) {
ajax ajax
.addDevice({ .addDevice({
@ -1336,6 +1351,7 @@ function ConfigRoad() {
}) })
.then((res) => { .then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
setModalBtnLoading(false)
message.success(res.message); message.success(res.message);
setDataAcquistionModal({ setDataAcquistionModal({
...dataAcquistionModal, ...dataAcquistionModal,
@ -1344,6 +1360,7 @@ function ConfigRoad() {
formRef.current.getList(); formRef.current.getList();
} else { } else {
message.error(res.message); message.error(res.message);
setModalBtnLoading(false)
} }
}); });
} }
@ -1812,6 +1829,7 @@ function ConfigRoad() {
</div> </div>
<Modal <Modal
open={importGroup.visible} open={importGroup.visible}
destroyOnClose={true}
onCancel={() => { onCancel={() => {
setImportGroup({ ...importGroup, visible: false }); setImportGroup({ ...importGroup, visible: false });
}} }}
@ -2073,10 +2091,11 @@ function ConfigRoad() {
{/* 计费规则添加弹窗 */} {/* 计费规则添加弹窗 */}
<Modal <Modal
open={ruleModal} open={ruleModal}
// title={isRuleEdit ? '' : ''}
title={isRuleEdit ? '编辑' : '添加'}
width={1000} width={1000}
onCancel={() => { onCancel={() => {
setRuleModal(false); setRuleModal(false);
setSelectedBerth([]);
}} }}
style={{ style={{
top: 2, top: 2,
@ -2121,9 +2140,10 @@ function ConfigRoad() {
<Radio.Group <Radio.Group
disabled={getCarType || isRuleEdit} disabled={getCarType || isRuleEdit}
onChange={(e) => { onChange={(e) => {
console.log(e.target.value);
if (e.target.value === 1) { if (e.target.value === 1) {
setShowBerthSelect(true); setShowBerthSelect(true);
} else { } else {
setShowBerthSelect(false); setShowBerthSelect(false);
@ -2141,7 +2161,7 @@ function ConfigRoad() {
]} ]}
/> />
</Form.Item> </Form.Item>
{showBerthSelect && isRuleEdit ? (
{showBerthSelect ? (
<Form.Item <Form.Item
label="对应的泊位号" label="对应的泊位号"
shouldUpdate={(preValue, curValue) => { shouldUpdate={(preValue, curValue) => {
@ -2214,7 +2234,7 @@ function ConfigRoad() {
onCancel={() => { onCancel={() => {
setEditPoleModal({ ...editPoleModal, visible: false }); setEditPoleModal({ ...editPoleModal, visible: false });
}} }}
title="编辑杆位"
title={editTitle?"编辑杆位":"添加杆位"}
onOk={submitPole} onOk={submitPole}
> >
<Form <Form
@ -2335,6 +2355,7 @@ function ConfigRoad() {
onCancel={() => { onCancel={() => {
setDataAcquistionModal({ ...dataAcquistionModal, visible: false }); setDataAcquistionModal({ ...dataAcquistionModal, visible: false });
}} }}
confirmLoading={modalBtnLoading}
destroyOnClose destroyOnClose
onOk={handleDataAcquistionModal} onOk={handleDataAcquistionModal}
title={dataAcquistionModal.isEdit ? "编辑设备" : "添加设备"} title={dataAcquistionModal.isEdit ? "编辑设备" : "添加设备"}

41
src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx

@ -125,15 +125,15 @@ function ParkList() {
]; ];
const [getMerchantDataName, setGetMerchantDataName] = useState([]) const [getMerchantDataName, setGetMerchantDataName] = useState([])
const merchantDataName = () => { const merchantDataName = () => {
ajax.getOperator().then(res => {
let arr = res.data
let newArr = arr.slice(1)
setGetMerchantDataName(res.data)
})
ajax.getOperator().then(res => {
let arr = res.data
let newArr = arr.slice(1)
setGetMerchantDataName(res.data)
})
} }
useEffect(()=>{
useEffect(() => {
merchantDataName() merchantDataName()
},[])
}, [])
// //
const berthOptions = [ const berthOptions = [
{ {
@ -198,15 +198,16 @@ function ParkList() {
function onShowSizeChange(pn, page_size) { function onShowSizeChange(pn, page_size) {
setPageData({ pn, page_size }); setPageData({ pn, page_size });
} }
function search(params) { function search(params) {
if(params){
if (params) {
setPageData({ setPageData({
pn: 1, pn: 1,
page_size: 15 page_size: 15
}) })
}else{
} else {
const params = { ...searchForm.getFieldsValue(), ...pageData }; const params = { ...searchForm.getFieldsValue(), ...pageData };
ajax.getBerthList(params).then((res) => { ajax.getBerthList(params).then((res) => {
@ -215,11 +216,14 @@ function ParkList() {
total_records: res.data.total, total_records: res.data.total,
data: res.data.list, data: res.data.list,
}); });
handleClick()
} }
}); });
} }
} }
function handleClick() {
window.scrollTo(0, 0);
}
// //
function renderSearch(params) { function renderSearch(params) {
return ( return (
@ -270,19 +274,19 @@ function ParkList() {
function getParkingItem(plate) { function getParkingItem(plate) {
ajax.getRecordList({ plate, order_type: 1 }).then((res) => { ajax.getRecordList({ plate, order_type: 1 }).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
res.data.list.map(res=>{
res.data.list.map(res => {
setCurrentParkingItem(res); setCurrentParkingItem(res);
}) })
}else{
} else {
message.error(res.message) message.error(res.message)
} }
}); });
} }
const reastBtn=()=>{
searchForm.resetFields();
search();
}
const reastBtn = () => {
searchForm.resetFields();
search();
}
useEffect(() => { useEffect(() => {
search(); search();
}, [pageData]); }, [pageData]);
@ -294,7 +298,7 @@ const reastBtn=()=>{
{renderSearch()} {renderSearch()}
<div className="bottomBox"> <div className="bottomBox">
<Button className="reset" onClick={reastBtn}>清空</Button> <Button className="reset" onClick={reastBtn}>清空</Button>
<Button type="primary" className="submit" onClick={() => search(pageData.pn)}>
<Button type="primary" className="submit" onClick={() => handleClick(pageData.pn)}>
查询 查询
</Button> </Button>
</div> </div>
@ -317,6 +321,7 @@ const reastBtn=()=>{
<div className="table-wrap"> <div className="table-wrap">
<Table <Table
// className="yisa-table" // className="yisa-table"
className="tableTop"
columns={columns} columns={columns}
dataSource={resultData.data} dataSource={resultData.data}
pagination={false} pagination={false}
@ -438,7 +443,7 @@ const reastBtn=()=>{
/> />
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="ETC是否开启"> <Descriptions.Item label="ETC是否开启">
{berthItem.etc_status_name }
{berthItem.etc_status_name}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="泊位类型"> <Descriptions.Item label="泊位类型">
{berthOptions[berthItem.berth_type]?.label} {berthOptions[berthItem.berth_type]?.label}

17
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx

@ -44,6 +44,7 @@ function AddParking(props) {
} }
}); });
const [lngLatVisible, setLngLatVisible] = useState(false); const [lngLatVisible, setLngLatVisible] = useState(false);
const [topBerthNum, setTopBerthNum] = useState();
const [lngLat, setLngLat] = useState(() => { const [lngLat, setLngLat] = useState(() => {
if (status === "add") return []; if (status === "add") return [];
else { else {
@ -167,8 +168,12 @@ function AddParking(props) {
cooperate_type, cooperate_type,
access_type, access_type,
lng_lat, lng_lat,
area
area,
total_berth_number,
berth_number//
} = res.data; } = res.data;
let num = parseInt(total_berth_number) - parseInt(berth_number)
setTopBerthNum(num)
let arr = [] let arr = []
arr.push(area) arr.push(area)
form.setFieldsValue({ form.setFieldsValue({
@ -179,7 +184,7 @@ function AddParking(props) {
is_business, is_business,
cooperate_type, cooperate_type,
access_type, access_type,
area_id:getAreaArr(areaList, area),
area_id: getAreaArr(areaList, area),
}); });
setLngLat(lng_lat.split(",")); setLngLat(lng_lat.split(","));
} }
@ -212,11 +217,11 @@ function AddParking(props) {
} }
// //
function editOutSegmentRoad(params) { function editOutSegmentRoad(params) {
ajax.editOutSegmentRoad(params).then((res) => {
ajax.editOutSegmentRoad({ ...params, id: record.id }).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
message.success("编辑成功"); message.success("编辑成功");
close(); close();
location.reload();
//location.reload();
} else { } else {
message.error(res.message); message.error(res.message);
} }
@ -237,6 +242,10 @@ function AddParking(props) {
message.error('车场泊位数必须为数字!') message.error('车场泊位数必须为数字!')
return return
} }
if (topBerthNum && parseFloat(total_berth_number) < topBerthNum) {
message.error('下级车场泊位数与一级车场泊位数之和不超过泊位总数!此处总车场泊位数不超过' + topBerthNum)
//return
}
const params = { const params = {
...values, ...values,
img: processImgData(fileList), img: processImgData(fileList),

25
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx

@ -16,16 +16,37 @@ function BusinessParameterConfig(props) {
ajax.getRoadServiceEdit(params).then((res) => { ajax.getRoadServiceEdit(params).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
message.success(res.message); message.success(res.message);
}else{
message.error("请填写完整!")
} }
}); });
} }
useEffect(() => { useEffect(() => {
ajax.getRoadAllChild().then((res) => {
ajax.getRoadAllChild({ road_id: id }).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
setChildList(res.data); setChildList(res.data);
} }
}); });
ajax.getRoadServiceParameters({ road_id: id }).then((res) => {
// res = {
// "status": 20000,
// "message": "success",
// "data": {
// "id": "1777413854377155803",
// "road_id": "1777413807249260948",
// "unlicensed_vehicle": 1,
// "similar_plates": 0,
// "monthly_rental_car": 1,
// "military_police_vehicles": 0,
// "free_time": 30,
// "arrearage": 0,
// "road_bias": "0"
// }
// }
if (res.status === 20000) {
form.setFieldsValue({ ...res.data })
}
});
}, []); }, []);
return ( return (
<div style={{ width: "100%" }} className="Bussiness"> <div style={{ width: "100%" }} className="Bussiness">

108
src/pages/SystemMgm/AdminMgm/loadable.jsx

@ -97,12 +97,18 @@ function AdminMgm(props) {
setAddManage({ ...addManage, email: e.target.value }) setAddManage({ ...addManage, email: e.target.value })
}; };
// //
const [governmentStatus, setGovernmentStatus] = useState(true)
const [getPartName, setGetPartName] = useState([]) const [getPartName, setGetPartName] = useState([])
const handleDeptName = (v) => {
const handleDeptName = (v, selectedOptions) => {
console.log(v); console.log(v);
setGetRoleStatus(false) setGetRoleStatus(false)
setAddManage({ ...addManage, deptName: v }) setAddManage({ ...addManage, deptName: v })
setGetPartName(v) setGetPartName(v)
if (selectedOptions.length === 1) {
setGovernmentStatus(false)
} else {
setGovernmentStatus(true)
}
}; };
const [getRoleStatus, setGetRoleStatus] = useState(true) const [getRoleStatus, setGetRoleStatus] = useState(true)
// //
@ -125,8 +131,12 @@ function AdminMgm(props) {
} }
}, [getPartName]) }, [getPartName])
// //
const [getAreaStatus, setGetAreaStatus] = useState(false)
const handleGovernmentType = (v) => { const handleGovernmentType = (v) => {
setGetGovernment(v) setGetGovernment(v)
if (v === 1) {
setGetAreaStatus(true)
}
setAddManage({ ...addManage, government_style: v }) setAddManage({ ...addManage, government_style: v })
} }
// //
@ -207,6 +217,7 @@ function AdminMgm(props) {
}) })
getData(formData) getData(formData)
setGetRoleStatus(true) setGetRoleStatus(true)
setGetAreaStatus(false)
} }
}) })
} }
@ -347,6 +358,9 @@ function AdminMgm(props) {
const [getGovernment, setGetGovernment] = useState({}) const [getGovernment, setGetGovernment] = useState({})
const handleGovernment = (v) => { const handleGovernment = (v) => {
setGetGovernment(v) setGetGovernment(v)
if (v === 1) {
setGetAreaStatus(true)
}
setGetImg({ ...getImg, government_style: v }) setGetImg({ ...getImg, government_style: v })
} }
const [getGovernmentArea, setGetGovernmentArea] = useState([]) const [getGovernmentArea, setGetGovernmentArea] = useState([])
@ -444,12 +458,14 @@ function AdminMgm(props) {
messageRole: 0, messageRole: 0,
failure_time: '' failure_time: ''
}) })
setGetAreaStatus(false)
} }
const cancelImg = () => { const cancelImg = () => {
setEditVisible(false) setEditVisible(false)
setDepartVisible(false) setDepartVisible(false)
setPasswordVisible(false) setPasswordVisible(false)
setGetRoleStatus(true) setGetRoleStatus(true)
setGetAreaStatus(false)
} }
const addcancelImg = () => { const addcancelImg = () => {
setImgVisible(false) setImgVisible(false)
@ -465,6 +481,7 @@ function AdminMgm(props) {
messageRole: 0, messageRole: 0,
failure_time: '' failure_time: ''
}) })
setGetAreaStatus(false)
} }
// //
const getData = (data = formData) => { const getData = (data = formData) => {
@ -518,6 +535,7 @@ function AdminMgm(props) {
const editModal = () => { const editModal = () => {
setEditVisible(false) setEditVisible(false)
setGetRoleStatus(true) setGetRoleStatus(true)
setGetAreaStatus(false)
} }
// //
const placeEditBtn = () => { const placeEditBtn = () => {
@ -530,6 +548,7 @@ function AdminMgm(props) {
setEditVisible(false) setEditVisible(false)
getData(formData) getData(formData)
setGetRoleStatus(true) setGetRoleStatus(true)
setGetAreaStatus(false)
} }
}) })
} }
@ -746,6 +765,7 @@ function AdminMgm(props) {
<Select <Select
style={{ width: 260, marginLeft: 14 }} style={{ width: 260, marginLeft: 14 }}
placeholder="请选择" placeholder="请选择"
disabled={governmentStatus}
value={addManage.government_style} value={addManage.government_style}
options={[ options={[
{ {
@ -763,22 +783,26 @@ function AdminMgm(props) {
/> />
</div> </div>
<div className="yisa-search" style={{ marginLeft: 19 }}>
<label>管辖区域</label>
<Tree
checkable
style={{ width: 260, marginLeft: 14 }}
onCheck={handleArea}
checkedKeys={addManage.government_area}
// onSelect={onSelect}
treeData={getGovernmentArea}
fieldNames={{
title: 'name',
key: 'id',
children: 'children'
}}
/>
</div>
{
getAreaStatus ?
<div className="yisa-search" style={{ marginLeft: 19 }}>
<label>管辖区域</label>
<Tree
checkable
style={{ width: 260, marginLeft: 14 }}
onCheck={handleArea}
checkedKeys={addManage.government_area}
// onSelect={onSelect}
treeData={getGovernmentArea}
fieldNames={{
title: 'name',
key: 'id',
children: 'children'
}}
/>
</div> : ''
}
<div className="yisa-search"> <div className="yisa-search">
<label>管辖车场接入方式</label> <label>管辖车场接入方式</label>
<Radio.Group onChange={onChangeCarType} value={addManage.car_type} style={{ marginLeft: 30 }}> <Radio.Group onChange={onChangeCarType} value={addManage.car_type} style={{ marginLeft: 30 }}>
@ -847,12 +871,12 @@ function AdminMgm(props) {
title='添加/修改管理员' title='添加/修改管理员'
> >
<div className="addAdmin"> <div className="addAdmin">
<div className="yisa-search" style={{ marginLeft: 10}}>
<div className="yisa-search" style={{ marginLeft: 10 }}>
<label>手机号</label> <label>手机号</label>
<Input <Input
placeholder="请输入手机号" placeholder="请输入手机号"
value={getImg.mobile} value={getImg.mobile}
style={{ width: 260, marginLeft: 14}}
style={{ width: 260, marginLeft: 14 }}
onChange={(v) => { onChange={(v) => {
setGetImg( setGetImg(
Object.assign({}, getImg, { mobile: v.target.value }) Object.assign({}, getImg, { mobile: v.target.value })
@ -921,12 +945,17 @@ function AdminMgm(props) {
value={getImg.deptName} value={getImg.deptName}
options={getPlateColor} options={getPlateColor}
changeOnSelect changeOnSelect
onChange={(v) => {
onChange={(v, selectedOptions) => {
setGetImg( setGetImg(
Object.assign({}, getImg, { deptName: v }) Object.assign({}, getImg, { deptName: v })
); );
setGetRoleStatus(false) setGetRoleStatus(false)
setGetPartName(v) setGetPartName(v)
if (selectedOptions.length === 1) {
setGovernmentStatus(false)
} else {
setGovernmentStatus(true)
}
}} }}
fieldNames={{ fieldNames={{
label: 'name', label: 'name',
@ -935,7 +964,7 @@ function AdminMgm(props) {
}} }}
/> />
</div> </div>
<div className="yisa-search" style={{marginLeft:24}}>
<div className="yisa-search" style={{ marginLeft: 24 }}>
<label>角色</label> <label>角色</label>
<Select <Select
style={{ width: 260, marginLeft: 18 }} style={{ width: 260, marginLeft: 18 }}
@ -955,6 +984,7 @@ function AdminMgm(props) {
<Select <Select
style={{ width: 260, marginLeft: 14 }} style={{ width: 260, marginLeft: 14 }}
placeholder="请选择" placeholder="请选择"
disabled={governmentStatus}
value={getImg.government_style} value={getImg.government_style}
options={[{ options={[{
value: 1, value: 1,
@ -971,22 +1001,26 @@ function AdminMgm(props) {
/> />
</div> </div>
<div className="yisa-search">
<label>管辖区域</label>
<Tree
checkable
style={{ width: 260, marginLeft: 14 }}
onCheck={onCheck}
checkedKeys={getImg.government_area}
// onSelect={onSelect}
treeData={getGovernmentArea}
fieldNames={{
title: 'name',
key: 'id',
children: 'children'
}}
/>
</div>
{
getAreaStatus ?
<div className="yisa-search">
<label>管辖区域</label>
<Tree
checkable
style={{ width: 260, marginLeft: 14 }}
onCheck={onCheck}
checkedKeys={getImg.government_area}
// onSelect={onSelect}
treeData={getGovernmentArea}
fieldNames={{
title: 'name',
key: 'id',
children: 'children'
}}
/>
</div> : ''
}
<div className="yisa-search"> <div className="yisa-search">
<label>管辖车场接入方式</label> <label>管辖车场接入方式</label>
<Radio.Group <Radio.Group

49
src/pages/SystemMgm/RoleMgm/loadable.jsx

@ -86,6 +86,9 @@ function RoleMgm(props) {
arr.push(res.id) arr.push(res.id)
res.children?.map(res => { res.children?.map(res => {
arr.push(res.id) arr.push(res.id)
res.children?.map(res => {
arr.push(res.id)
})
}) })
}) })
}) })
@ -112,12 +115,17 @@ function RoleMgm(props) {
arr.push(res.id) arr.push(res.id)
res.children?.map(res => { res.children?.map(res => {
arr.push(res.id) arr.push(res.id)
res.children?.map(res => {
arr.push(res.id)
})
}) })
}) })
}) })
}) })
let string = arr.toString() let string = arr.toString()
setCheckedKeys(arr) setCheckedKeys(arr)
arr.sort(compareNumbers)
console.log(arr);
setGetCheckVlue(true) setGetCheckVlue(true)
// getCheckValue // getCheckValue
setGetImg({ ...getImg, auth: string }) setGetImg({ ...getImg, auth: string })
@ -125,6 +133,10 @@ function RoleMgm(props) {
setCheckedKeys([]) setCheckedKeys([])
} }
} }
function compareNumbers(a, b) {
return a - b;
}
function calculateArrayLength(arr) { function calculateArrayLength(arr) {
let count = 0; let count = 0;
arr.forEach((item) => { arr.forEach((item) => {
@ -147,17 +159,19 @@ function RoleMgm(props) {
setAddManage({ ...addManage, auth: string }) setAddManage({ ...addManage, auth: string })
setCheckedKeys(checkedKeysValue); setCheckedKeys(checkedKeysValue);
// //
} }
useEffect(() => { useEffect(() => {
// console.log(checkedKeys); // console.log(checkedKeys);
console.log("监听"); console.log("监听");
console.log(allGover.map(item=>item.id).toString());
console.log(allGover.map(item => item.id).sort(compareNumbers));
// //
if ((checkedKeys.length >= allGover.length) && checkedKeys.length != 0) { if ((checkedKeys.length >= allGover.length) && checkedKeys.length != 0) {
setGetCheckVlue(true) setGetCheckVlue(true)
} else {
}
else {
setGetCheckVlue(false) setGetCheckVlue(false)
} }
}, [checkedKeys]) }, [checkedKeys])
@ -282,8 +296,8 @@ function RoleMgm(props) {
depart_id: record.depart_id depart_id: record.depart_id
})) }))
if (strArr.length == roleLength) { if (strArr.length == roleLength) {
setGetCheckVlue(true);
}
setGetCheckVlue(true);
}
} }
// //
const [getPlateColor, setGetPlateColor] = useState([]) const [getPlateColor, setGetPlateColor] = useState([])
@ -403,11 +417,15 @@ function RoleMgm(props) {
const placeEditBtn = () => { const placeEditBtn = () => {
let arr = checkedKeys let arr = checkedKeys
let str = arr.toString() let str = arr.toString()
let arrStr = getImg.depart_id
let lastElement = arrStr[arrStr.length - 1];
let data = { let data = {
...getImg, ...getImg,
auth: str, auth: str,
id: getAdminId.id
id: getAdminId.id,
depart_id:lastElement
} }
ajax.editChange(data).then(res => { ajax.editChange(data).then(res => {
if (res.status === 20000) { if (res.status === 20000) {
setEditVisible(false) setEditVisible(false)
@ -435,10 +453,13 @@ function RoleMgm(props) {
} }
)); ));
} }
// const [getKey,setGetKey]=useState([])
useEffect(() => { useEffect(() => {
let arrStr = getImg.depart_id
let lastElement = arrStr[arrStr.length - 1];
if (getGovernment != 0) { if (getGovernment != 0) {
let data = { let data = {
id: getGovernment
id: lastElement
} }
ajax.getDepartId(data).then(res => { ajax.getDepartId(data).then(res => {
if (res.status === 20000) { if (res.status === 20000) {
@ -451,6 +472,12 @@ function RoleMgm(props) {
let data = JSON.parse(JSON.stringify(res.data)) let data = JSON.parse(JSON.stringify(res.data))
const arr = flatten(data) const arr = flatten(data)
const length = calculateArrayLength(res.data); const length = calculateArrayLength(res.data);
let key = arr.filter(item => {
return item.key
})
let arr_id = key.map(item => item.id)
console.log(arr_id);
setCheckedKeys(arr_id);
setRoleLength(length) setRoleLength(length)
// console.log(arr); // console.log(arr);
setAllGover(arr) setAllGover(arr)
@ -554,7 +581,7 @@ function RoleMgm(props) {
<Cascader <Cascader
style={{ width: 260, marginLeft: 50 }} style={{ width: 260, marginLeft: 50 }}
placeholder="请选择" placeholder="请选择"
value={addManage.depart_id}
// value={addManage.depart_id}
options={getPlateColor} options={getPlateColor}
changeOnSelect changeOnSelect
onChange={handleDeptName} onChange={handleDeptName}
@ -636,11 +663,9 @@ function RoleMgm(props) {
options={getPlateColor} options={getPlateColor}
changeOnSelect changeOnSelect
onChange={(v) => { onChange={(v) => {
let arr = v
let lastElement = arr[arr.length - 1];
setGetGovernment(lastElement)
setGetGovernment(v)
setGetImg( setGetImg(
Object.assign({}, getImg, { depart_id: lastElement })
Object.assign({}, getImg, { depart_id: v })
); );
}} }}
fieldNames={{ fieldNames={{

2
src/services/OutRoadMgm/OutSegment.js

@ -75,7 +75,7 @@ const editRoadMs = (params) => {
data: params, data: params,
}); });
}; };
///api/orp/road/edit_road_ms 编辑路段MS通信账号
///api/orp/road/edit_road_ms 添加路段MS通信账号
const addRoadMs = (params) => { const addRoadMs = (params) => {
return ajax({ return ajax({
url: "/api/orp/road/add_road_ms", url: "/api/orp/road/add_road_ms",

Loading…
Cancel
Save