From e7eda5a56739d47351e2c9b1254b8a1fa8b2a491 Mon Sep 17 00:00:00 2001 From: guoxin Date: Thu, 30 Nov 2023 21:10:22 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=86=85bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/components/Map/Apimap/index.jsx | 184 +++++++++---------- src/components/MapComponets/Marker/index.jsx | 1 + src/components/SelectLngLat/index.jsx | 4 +- .../PersonMgm/Attendance/Fence/index.scss | 12 ++ .../PersonMgm/Attendance/Fence/loadable.jsx | 197 ++++++++++++--------- .../PersonMgm/Attendance/ScheduleMgm/index.scss | 12 +- .../PersonMgm/Attendance/ScheduleMgm/loadable.jsx | 94 ++++++++-- .../Attendance/WorkerAttendance/loadable.jsx | 2 + .../PersonMgm/MesNotification/loadable.jsx | 1 + .../InRoadMgm/PersonMgm/PersonInfo/index.scss | 12 +- .../InRoadMgm/PersonMgm/PersonInfo/loadable.jsx | 33 ++-- src/pages/InRoadMgm/RoadMgm/AddRoad/loadable.jsx | 2 +- .../InRoadMgm/RoadMgm/ConfigRoad/loadable.jsx | 113 ++++++------ src/pages/InRoadMgm/RoadMgm/ParkList/loadable.jsx | 30 ++-- .../InRoadMgm/Stuff/CategroyConf/loadable.jsx | 9 +- src/pages/InRoadMgm/Stuff/ModelConf/loadable.jsx | 9 +- src/pages/InRoadMgm/Stuff/StuffMgm/index.scss | 7 +- src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx | 86 +++++++-- src/pages/InRoadMgm/Stuff/StuffStat/loadable.jsx | 34 ++-- .../GeoSignalIgnoreAudit/index.scss | 14 ++ .../GeoSignalIgnoreAudit/loadable.jsx | 65 +++++-- src/pages/SystemMgm/OrgnizationMgm/loadable.jsx | 2 +- 23 files changed, 600 insertions(+), 324 deletions(-) diff --git a/package.json b/package.json index 55764c6..7f594ed 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "webpack-merge": "^5.8.0" }, "dependencies": { - "@amap/amap-jsapi-loader": "^1.0.1", "@loadable/component": "^5.15.2", "ahooks": "^3.7.2", "axios": "^0.26.0", diff --git a/src/components/Map/Apimap/index.jsx b/src/components/Map/Apimap/index.jsx index 323027a..f3abb67 100644 --- a/src/components/Map/Apimap/index.jsx +++ b/src/components/Map/Apimap/index.jsx @@ -1,95 +1,95 @@ -import React, { useState, useEffect, useRef, useLayoutEffect } from "react";import L from "leaflet"; -import "leaflet/dist/leaflet.css"; -import "leaflet.chinatmsproviders"; -import ajax from "@/services"; +// import React, { useState, useEffect, useRef, useLayoutEffect } from "react";import L from "leaflet"; +// import "leaflet/dist/leaflet.css"; +// import "leaflet.chinatmsproviders"; +// import ajax from "@/services"; -function ModalMap(props) { - const { - setLnglat = () => {}, - getLntLat = () => {}, - searchLnglatValue = [], - } = props; - const mapConfig = { - center: sysConfig.map.center, - zoom: sysConfig.map.zoom, - zooms: sysConfig.map.zooms, - maxZoom: sysConfig.map.zooms[1], - minZoom: sysConfig.map.zooms[0], - mapTileHost: sysConfig.map.mapTileHost, - zoomOffset: sysConfig.map.zoomOffset, - mapTileType: sysConfig.map.mapTileType, - }; - const [map, setMap] = useState(null); - const mapRef = useRef(null); - const initMap = () => { - // console.log(mapConfig); - // const _map = L.map("mapid", { - // scrollWheelZoom: true, - // zoomSnap: 1, - // crs: L.CRS.EPSG3857, - // }).setView([mapConfig.center[0], mapConfig.center[1]], mapConfig.zoom); - // L.tileLayer("{mapTileHost}/v3/tile?z={z}&x={x}&y={y}", { - // maxZoom: mapConfig.zooms[1], - // minZoom: mapConfig.zooms[0], - // zoomOffset: 0, - // mapTileHost: mapConfig.mapTileHost, - // }).addTo(_map); - // _map.on("click", function (e) { - // clearMarkers(_map); - // L.marker(e.latlng).addTo(_map); - // setLnglat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]); - // getLntLat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]); - // }); - // _map.invalidateSize(); - // setMap(_map); - // mapRef.current = _map; - let _map = new AMap.Map("mapid", { - resizeEnable: true, - layers: [ - new AMap.TileLayer.Satellite(), - new AMap.TileLayer.RoadNet() - ] - }); - _map.setCenter([mapConfig.center[1], mapConfig.center[0]], mapConfig.zoom); +// function ModalMap(props) { +// const { +// setLnglat = () => {}, +// getLntLat = () => {}, +// searchLnglatValue = [], +// } = props; +// const mapConfig = { +// center: sysConfig.map.center, +// zoom: sysConfig.map.zoom, +// zooms: sysConfig.map.zooms, +// maxZoom: sysConfig.map.zooms[1], +// minZoom: sysConfig.map.zooms[0], +// mapTileHost: sysConfig.map.mapTileHost, +// zoomOffset: sysConfig.map.zoomOffset, +// mapTileType: sysConfig.map.mapTileType, +// }; +// const [map, setMap] = useState(null); +// const mapRef = useRef(null); +// const initMap = () => { +// // console.log(mapConfig); +// // const _map = L.map("mapid", { +// // scrollWheelZoom: true, +// // zoomSnap: 1, +// // crs: L.CRS.EPSG3857, +// // }).setView([mapConfig.center[0], mapConfig.center[1]], mapConfig.zoom); +// // L.tileLayer("{mapTileHost}/v3/tile?z={z}&x={x}&y={y}", { +// // maxZoom: mapConfig.zooms[1], +// // minZoom: mapConfig.zooms[0], +// // zoomOffset: 0, +// // mapTileHost: mapConfig.mapTileHost, +// // }).addTo(_map); +// // _map.on("click", function (e) { +// // clearMarkers(_map); +// // L.marker(e.latlng).addTo(_map); +// // setLnglat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]); +// // getLntLat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]); +// // }); +// // _map.invalidateSize(); +// // setMap(_map); +// // mapRef.current = _map; +// let _map = new AMap.Map("mapid", { +// resizeEnable: true, +// layers: [ +// new AMap.TileLayer.Satellite(), +// new AMap.TileLayer.RoadNet() +// ] +// }); +// _map.setCenter([mapConfig.center[1], mapConfig.center[0]], mapConfig.zoom); - setMap(_map) - _map.on('click', function(e) { - console.log(e) - // onClick(info) - setLnglat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]); - getLntLat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]); - }) - mapRef.current = map - }; - function clearMarkers(map) { - map.eachLayer(function (layer) { - if (layer instanceof L.Marker) { - map.removeLayer(layer); - } - }); - } - useEffect(() => { - initMap(); - return () => { - if (mapRef.current) { - mapRef.current.remove(); - } - }; - }, []); - useEffect(() => { - if (searchLnglatValue.length === 0) return; - mapRef.current.setView(searchLnglatValue, 13); - }, [searchLnglatValue]); +// setMap(_map) +// _map.on('click', function(e) { +// console.log(e) +// // onClick(info) +// setLnglat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]); +// getLntLat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]); +// }) +// mapRef.current = map +// }; +// function clearMarkers(map) { +// map.eachLayer(function (layer) { +// if (layer instanceof L.Marker) { +// map.removeLayer(layer); +// } +// }); +// } +// useEffect(() => { +// initMap(); +// return () => { +// if (mapRef.current) { +// mapRef.current.remove(); +// } +// }; +// }, []); +// useEffect(() => { +// if (searchLnglatValue.length === 0) return; +// mapRef.current.setView(searchLnglatValue, 13); +// }, [searchLnglatValue]); - return ( -
- ); - } - export default ModalMap; \ No newline at end of file +// return ( +//
+// ); +// } +// export default ModalMap; \ No newline at end of file diff --git a/src/components/MapComponets/Marker/index.jsx b/src/components/MapComponets/Marker/index.jsx index a7a6513..6657f1b 100644 --- a/src/components/MapComponets/Marker/index.jsx +++ b/src/components/MapComponets/Marker/index.jsx @@ -185,6 +185,7 @@ function Marker(props, refs) { useEffect(()=>{ if(getMapValue){ + console.log(getMarker); let lng = getMarker.lng let lat = getMarker.lat circlesRef.current && map.removeLayer(circlesRef.current) diff --git a/src/components/SelectLngLat/index.jsx b/src/components/SelectLngLat/index.jsx index 63c5209..c4e07fd 100644 --- a/src/components/SelectLngLat/index.jsx +++ b/src/components/SelectLngLat/index.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useRef, useLayoutEffect } from "react"; import { Button, Input, Modal, message } from "antd"; import { BaseMap } from "../MapComponets"; -// import { Apimap } from "../Map"; +import { Apimap } from "../Map"; import L from "leaflet"; import "leaflet/dist/leaflet.css"; import "leaflet.chinatmsproviders"; @@ -62,7 +62,7 @@ function SelectLngLat(props) { height: "500px", }} > - { setFormData({ ...formData, parkName: v.target.value }) @@ -74,12 +74,32 @@ function Fence(props) { setFormData({ ...formData, enable: value }) } //停车场数据 + const [targetKeys, setTargetKeys] = useState([]); + const [selectedKeys, setSelectedKeys] = useState([]); + // const filterOption = (inputValue, option) => option.description.indexOf(inputValue) > -1; + const handleChange = (newTargetKeys) => { + console.log(newTargetKeys); + if (getScope == '1') { + setValuePark(newTargetKeys); + } + setTargetKeys(newTargetKeys); + }; + const onSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { + setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]); + }; const [treeData, setTreeData] = useState([]) const getParkList = () => { ajax.getParkData().then(res => { if (res.status === 20000) { - console.log(res); - setTreeData(res.data) + // const data=res.data.map((item)=>item.value) + const allData = [...res.data].map( + (item) => { + item.key = item.value; + return item; + } + ); + // setTargetKeys(data) + setTreeData(allData) } }) @@ -122,7 +142,7 @@ function Fence(props) { key: 'attendDistance', render: (text, record) => { return <> -
{record.attendDistance=='1'?'无电子围栏':'指定范围'}
+
{record.attendDistance == '1' ? '无电子围栏' : '指定范围'}
} }, @@ -146,7 +166,7 @@ function Fence(props) { setGetEditModal(Object.assign({}, getEditModal, { attendName: record.attendName, attendDistance: record.attendDistance, - attendmin:record.attendmin + attendmin: record.attendmin })) setAttendanceVisible(true) setMarkers([{ @@ -184,11 +204,11 @@ function Fence(props) { console.log(err) }) } - //切换分页 - const changePn = (pn, length) => { + //切换分页 + const changePn = (pn, length) => { if (formData.page_size === length) { - setFormData(Object.assign({}, formData, { pn: pn, page_size: length})) - setLastFormData(Object.assign({}, lastFormData, { pn: pn , page_size: length})) + setFormData(Object.assign({}, formData, { pn: pn, page_size: length })) + setLastFormData(Object.assign({}, lastFormData, { pn: pn, page_size: length })) getData(Object.assign({}, formData, { pn: pn, page_size: length })) } } @@ -211,8 +231,8 @@ function Fence(props) { const creatModal = () => { setCreatVisible(false) setGetModalData({ - attendDistance: '', - effective: '' + attendDistance: '1', + effective: '1' }) } const getCascaderList = () => { @@ -225,96 +245,96 @@ function Fence(props) { } }) } - + //有效范围选择项 + const [getStatus, setGetStatus] = useState('1') const handleAttendDistance = (v) => { - setGetModalData({ attendDistance: v }) + setGetModalData({ ...getModalData, attendDistance: v }) setGetStatus(v) } const handleDistance = (v) => { - setGetEditModal({ attendDistance: v }) + setGetEditModal({ ...getEditModal, attendDistance: v }) setGetMap(v) } + //有效范围输入区间 const handleType = (v) => { - setGetModalData({ attendmin: v.target.value }) + setGetModalData({ ...getModalData, attendmin: v.target.value }) } const handleMapType = (v) => { - setGetEditModal({ attend: v.target.value }) + setGetEditModal({ ...getEditModal, attend: v.target.value }) } + const [getScopeValue, setGetScopeValue] = useState('1') const handleScope = (value) => { setGetModalData({ ...getModalData, effective: value }) - if (value == 1) { - setGetScope(2) - } - if (value == 2) { - setGetScope(1) - } + setGetScopeValue(value) } - const [value, setValue] = useState([]); - const onChange = (newValue) => { - if (getScope === 1) { - setValue(newValue); + useEffect(() => { + if (getScopeValue == '1') { + setGetScope('2') } - }; - const tProps = { - treeData, - value, - onChange, - treeCheckable: true, - showCheckedStrategy: SHOW_PARENT, - placeholder: 'Please select', - style: { - width: '170px', - marginLeft: '10px', - marginTop: '10px' - }, - }; + if (getScopeValue == '2') { + setGetScope('1') + } + }, [getScopeValue]) + + const [valuePark, setValuePark] = useState([]); //批量设置保存 const saveBtn = () => { - let getValue = value - let result = getValue.join(",") - if (getScope === 2) { - let data = { - ...getModalData - } - ajax.saveDtaList(data).then(res => { - if (res.status === 20000) { - setCreatVisible(false) - getData(formData) - setGetModalData({ - attendDistance: '', - effective: '' - }) + if (getScopeValue === '2' && targetKeys.length === 0) { + message.error('请选择停车场') + }else{ + let getValue = valuePark + let result = getValue.join(",") + if (getScope === 2) { + let data = { + ...getModalData } - }) - } else { - let data = { - ...getModalData, - scope: result - } - ajax.saveDtaList(data).then(res => { - if (res.status === 20000) { - setCreatVisible(false) - getData(formData) - setGetModalData({ - attendDistance: '', - effective: '' - }) + ajax.saveDtaList(data).then(res => { + if (res.status === 20000) { + setCreatVisible(false) + getData(formData) + setGetModalData({ + attendDistance: '1', + effective: '1', + }) + setGetScopeValue(1) + setTargetKeys([]) + } + }) + } else { + let data = { + ...getModalData, + scope: result } - }) + ajax.saveDtaList(data).then(res => { + if (res.status === 20000) { + setCreatVisible(false) + getData(formData) + setGetModalData({ + attendDistance: '1', + effective: '1' + }) + setGetScopeValue(1) + setTargetKeys([]) + } + }) + } + } - + } //批量设置取消 const cancelBtn = () => { setCreatVisible(false) setGetModalData({ - attendDistance: '', - effective: '' + attendDistance: '1', + effective: '1' }) + setGetScopeValue(1) + setTargetKeys([]) } //考勤点设置弹窗 const attendanceModal = () => { @@ -461,12 +481,13 @@ function Fence(props) { title='批量设置' >
-
+
+
*
+
*
+
*
{ setModalData( @@ -461,19 +500,23 @@ function ScheduleMgm(props) {
+
*
+
*
- +
*
+ { setModalData( Object.assign({}, modalData, { afterTime: v.target.value }) @@ -497,6 +540,7 @@ function ScheduleMgm(props) { >
+
*
+
*
{ setModalData( Object.assign({}, modalData, { beforeTime: v.target.value }) @@ -544,19 +591,24 @@ function ScheduleMgm(props) {
+
*
+
*
- +
*
+ + { setModalData( Object.assign({}, modalData, { afterTime: v.target.value }) @@ -579,6 +631,7 @@ function ScheduleMgm(props) { >
+
*
+
*
{ setEditModal( Object.assign({}, editModal, { beforeTime: v.target.value }) @@ -628,18 +684,22 @@ function ScheduleMgm(props) {
+
*
- +
+
*
- +
- +
*
+ { setEditModal( Object.assign({}, editModal, { afterTime: v.target.value }) diff --git a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx index 9575e28..d0bd423 100644 --- a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx @@ -400,6 +400,7 @@ function WorkerAttendance(props) { type === 'day' ? { setFormData({ ...formData, @@ -410,6 +411,7 @@ function WorkerAttendance(props) { }} /> : { setFormData({ ...formData, diff --git a/src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx index 5e92a51..54c0c3a 100644 --- a/src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx @@ -360,6 +360,7 @@ function loadable() { tableData={resultData} formSearch={formSearch} total={total} + isExport={false} search={search} pageName={'mesNotification'} //exportUrl={exportUrl} diff --git a/src/pages/InRoadMgm/PersonMgm/PersonInfo/index.scss b/src/pages/InRoadMgm/PersonMgm/PersonInfo/index.scss index 5db110b..abac917 100644 --- a/src/pages/InRoadMgm/PersonMgm/PersonInfo/index.scss +++ b/src/pages/InRoadMgm/PersonMgm/PersonInfo/index.scss @@ -132,6 +132,14 @@ .cc-form-select { margin-bottom: 12px; } + .yisa-search { + position: relative; + .redLogo { + position: absolute; + left: 50px; + top: 7px; + } + } } .transfer-wrapper { display: flex; @@ -141,10 +149,10 @@ text-align: right; margin-right: 10px; } - .redLogo{ + .redLogo { position: absolute; left: 52px; - top:1px + top: 1px; } } .btn-wrapper { diff --git a/src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx index 88f553d..acfcf68 100644 --- a/src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/PersonInfo/loadable.jsx @@ -374,7 +374,7 @@ function PersonInfo() { message.error('请输入员工编号') } else if (currentPersonInfo.road_ids === '') { message.error('请选择路段') - } else if (currentPersonInfo) { + } else if (!showEdit) { ajax.editUserPersonInfo({ ...currentPersonInfo, id: currentPersonId }).then(res => { if (res.status == 20000) { message.success(res.message) @@ -640,14 +640,17 @@ function PersonInfo() { showClose={true} onChange={e => { setCurrentPersonInfo({ ...currentPersonInfo, name: e.target.value }) }} /> - { setCurrentPersonInfo({ ...currentPersonInfo, birth_year: e.format('YYYY') }) }} - value={currentPersonInfo.birth_year ? moment(currentPersonInfo.birth_year + '') : ''} - picker="year" - /> +
+
*
+ { setCurrentPersonInfo({ ...currentPersonInfo, birth_year: e.format('YYYY') }) }} + value={currentPersonInfo.birth_year ? moment(currentPersonInfo.birth_year + '') : ''} + picker="year" + /> +
{ setCurrentPersonInfo({ ...currentPersonInfo, number: e.target.value }) }} /> { setCurrentPersonInfo({ ...currentPersonInfo, tel: e.target.value }) }} /> { setCurrentPersonInfo({ ...currentPersonInfo, pda_number: e.target.value }) }} /> { setCurrentPersonInfo({ ...currentPersonInfo, user_role: e }) }} /> { changeEditOperator(e) }} /> { setCurrentPersonInfo({ ...currentPersonInfo, depart_id: e }) }} />
-
*
+
*
选择路段
{ - let arr = berthForm.getFieldsValue().etc_status - let str = arr.toString() - const params = { - ...berthForm.getFieldsValue(), - lng_lat: lngLat, - road_id: parking_id, - etc_status: Number(str) - }; - console.log(params); - function addBerth(params) { - ajax - .addBerth(params) - .then((res) => { - if (res.status === 20000) { - message.success(res.message); - setEditBerthModal(false); - formRef.current.getList(); - berthForm.resetFields() - setLngLat([]) - } - else { - message.error(res.message) - } - }) - .catch((err) => console.error(err)); - } - function editBerth(params) { - ajax - .editBerth(params) - .then((res) => { - if (res.status === 20000) { - message.success(res.message); - setEditBerthModal(false); - formRef.current.getList(); - berthForm.resetFields() - setLngLat([]) - } - else { - message.error(res.message) - } - }) - .catch((err) => console.error(err)); - } - switch (isEdit) { - case true: - editBerth(params) - break; - case false: - addBerth(params) - break; + if(berthForm.getFieldsValue().berth_code === null){ + message.error('请填写泊位号') + }else if (berthForm.getFieldsValue().etc_status === null) { + message.error('请选择ETC是开开启') + }else if (berthForm.getFieldsValue().service_type === null) { + message.error('请选择服务属性') + }else if (berthForm.getFieldsValue().berth_type === null) { + message.error('请选择泊位类型') + }else { + let arr = berthForm.getFieldsValue().etc_status + let str = arr.toString() + const params = { + ...berthForm.getFieldsValue(), + lng_lat: lngLat, + road_id: parking_id, + etc_status: Number(str) + }; + console.log(params); + function addBerth(params) { + ajax + .addBerth(params) + .then((res) => { + if (res.status === 20000) { + message.success(res.message); + setEditBerthModal(false); + formRef.current.getList(); + berthForm.resetFields() + setLngLat([]) + } + else { + message.error(res.message) + } + }) + .catch((err) => console.error(err)); + } + function editBerth(params) { + ajax + .editBerth(params) + .then((res) => { + if (res.status === 20000) { + message.success(res.message); + setEditBerthModal(false); + formRef.current.getList(); + berthForm.resetFields() + setLngLat([]) + } + else { + message.error(res.message) + } + }) + .catch((err) => console.error(err)); + } + switch (isEdit) { + case true: + editBerth(params) + break; + case false: + addBerth(params) + break; + } } + + }} >
{ - if (res.status === 20000) { - setReusltData({ - total_records: res.data.total, - data: res.data.list, - }); - } - }); + ajax.getBerthList(params).then((res) => { + if (res.status === 20000) { + setReusltData({ + total_records: res.data.total, + data: res.data.list, + }); + } + }); + } } //查询部分 @@ -284,6 +291,7 @@ function ParkList() { } const reastBtn=()=>{ searchForm.resetFields(); + search(); } useEffect(() => { search(); @@ -296,7 +304,7 @@ const reastBtn=()=>{ {renderSearch()}
-
diff --git a/src/pages/InRoadMgm/Stuff/CategroyConf/loadable.jsx b/src/pages/InRoadMgm/Stuff/CategroyConf/loadable.jsx index c10549f..d97fe2b 100644 --- a/src/pages/InRoadMgm/Stuff/CategroyConf/loadable.jsx +++ b/src/pages/InRoadMgm/Stuff/CategroyConf/loadable.jsx @@ -17,12 +17,13 @@ function CategroyConf(props) { export_url: '', process_url: "" }) - const [formData, setFormData] = useState({ + const parameter={ brand_id: '',//物品类型 operatorid: '',//商户名称 pn: 1, page_size: Number(pageSizeOptions[0]), // 每页条数 - }) + } + const [formData, setFormData] = useState(parameter) const [lastFormData, setLastFormData] = useState(formData) const [checkVisible, setCheckVisible] = useState(false) const [editVisible, setEditVisible] = useState(false) @@ -292,7 +293,9 @@ function CategroyConf(props) { if (sessionTabList && Object.values(sessionTabList).length > 0) { setFormData({ brand_id: sessionTabList?.brand_id, - operatorid: sessionTabList?.operatorid + operatorid: sessionTabList?.operatorid, + pn: sessionTabList?.pn, + page_size: sessionTabList?.page_size, }) } }, []) diff --git a/src/pages/InRoadMgm/Stuff/ModelConf/loadable.jsx b/src/pages/InRoadMgm/Stuff/ModelConf/loadable.jsx index 1ef126c..ba3ca45 100644 --- a/src/pages/InRoadMgm/Stuff/ModelConf/loadable.jsx +++ b/src/pages/InRoadMgm/Stuff/ModelConf/loadable.jsx @@ -17,13 +17,14 @@ function ModelConf(props) { export_url: '', process_url: "" }) - const [formData, setFormData] = useState({ + const parameter={ model_id: '',//物品类型 operator_id: '',//商户名称 model_name:'', pn: 1, page_size: Number(pageSizeOptions[0]), // 每页条数 - }) + } + const [formData, setFormData] = useState(parameter) const [lastFormData, setLastFormData] = useState(formData) const lastFormDataRef = useRef(formData) const [checkVisible, setCheckVisible] = useState(false) @@ -316,7 +317,9 @@ function ModelConf(props) { setFormData({ model_id: sessionTabList?.model_id, operator_id: sessionTabList?.operator_id, - model_name: sessionTabList?.model_name + model_name: sessionTabList?.model_name, + pn: sessionTabList?.pn, + page_size: sessionTabList?.page_size, }) } }, []) diff --git a/src/pages/InRoadMgm/Stuff/StuffMgm/index.scss b/src/pages/InRoadMgm/Stuff/StuffMgm/index.scss index 13ca0b6..524a743 100644 --- a/src/pages/InRoadMgm/Stuff/StuffMgm/index.scss +++ b/src/pages/InRoadMgm/Stuff/StuffMgm/index.scss @@ -244,7 +244,8 @@ $color-primary : var(--color-primary); .add{ margin-left: 100px; .yisa-search{ - margin-top: 20px; + margin-top: 10px; + display: flex; } .submitBtn{ margin-left: 54px; @@ -261,10 +262,10 @@ $color-primary : var(--color-primary); .cancel{ width: 80px; height: 35px; - background: #fff; + background: #3e4557; border: none; border-radius: 4px; - color: #3e4557; + color: #fff; cursor: pointer; margin-left: 20px; } diff --git a/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx b/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx index 0a5ed65..994cda3 100644 --- a/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx +++ b/src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx @@ -21,18 +21,19 @@ function StuffMgm(props) { export_url: '', process_url: "" }) - const [formData, setFormData] = useState({ - region_id: '',//区域 + const parameter={ + region_id: [],//区域 code: '',//物品编号 brand_id: '',//物品类型 model_id: '',//物品型号 - operatorid: '',//商户名称 + operatorid: '0',//商户名称 name: '',//物品名称 status: '',//状态 uid: '',//领用人 pn: 1, page_size: Number(pageSizeOptions[0]), // 每页条数 - }) + } + const [formData, setFormData] = useState(parameter ) const [lastFormData, setLastFormData] = useState(formData) const [checkVisible, setCheckVisible] = useState(false) const [editVisible, setEditVisible] = useState(false) @@ -176,7 +177,7 @@ function StuffMgm(props) { } //编辑弹窗 const [getEditData, setGetEditData] = useState({ - region_id: '',//区域 + region_id: null,//区域 operatorid: '', code: '', name: '', @@ -239,7 +240,7 @@ function StuffMgm(props) { //重置数据 const getResetData = () => { setFormData({ - ...parameter + ...parameter, }) getData({ ...parameter }) } @@ -365,7 +366,7 @@ function StuffMgm(props) { setAddVisible(false) } let param = { - region_id: '',//区域 + region_id:null,//区域 operatorid: '', code: '', name: '', @@ -413,6 +414,9 @@ function StuffMgm(props) { } if (v == 1) { setGetSelectStatus(true) + setCheckData({ + uid:'' + }) } } //领用人 @@ -435,11 +439,23 @@ function StuffMgm(props) { message.error('请选择物品类型') } else if (checkData.model_id == '') { message.error('请选择物品型号') + } else if (checkData.status == '') { + message.error('请输入状态') } else { ajax.saveData(data).then((res) => { if (res.status === 20000) { setAddVisible(false) getData(formData) + setCheckData({ + region_id: null,//区域 + operatorid: '', + code: '', + name: '', + brand_id: '', + model_id: '', + status: '', + uid: '' + }) } }) } @@ -467,7 +483,9 @@ function StuffMgm(props) { message.error('请选择物品类型') } else if (getEditData.model_id == '') { message.error('请选择物品型号') - } else { + } else if (getEditData.status == '') { + message.error('请输入状态') + }else { ajax.saveEditData(data).then((res) => { if (res.status === 20000) { setEditVisible(false) @@ -477,8 +495,30 @@ function StuffMgm(props) { } } const placeBtn = () => { - setAddVisible(false) setEditVisible(false) + setGetEditData({ + region_id: null,//区域 + operatorid: '', + code: '', + name: '', + brand_id: '', + model_id: '', + status: '', + uid: '' + }) + } + const addplaceBtn=()=>{ + setAddVisible(false) + setCheckData({ + region_id: null,//区域 + operatorid: '', + code: '', + name: '', + brand_id: '', + model_id: '', + status: '', + uid: '' + }) } useEffect(() => { assetsModelName() @@ -499,6 +539,8 @@ function StuffMgm(props) { name: sessionTabList?.name,//物品名称 status: sessionTabList?.status,//状态 uid: sessionTabList?.uid,//领用人 + pn: sessionTabList?.pn, + page_size: sessionTabList?.page_size, }) } }, []) @@ -686,6 +728,7 @@ function StuffMgm(props) { >
+
*
+
*
+
*
+
*
+
*
{ placeSaveBtn() }}> 提交 -
@@ -792,6 +842,7 @@ function StuffMgm(props) { >
+
*
+
*
+
*
+
*
+
*
{ @@ -49,6 +50,13 @@ function StuffStat(props) { } return result; } + //重置数据 + const getResetData = () => { + setFormData({ + ...parameter + }) + getData({ ...parameter }) + } //列表 const deployListColumns = [ { @@ -121,12 +129,12 @@ function StuffStat(props) { console.log(err) }) } - //切换分页 - const changePn = (pn, length) => { + //切换分页 + const changePn = (pn, length) => { if (formData.page_size === length) { setFormData(Object.assign({}, formData, { pn: pn, page_size: length })) - setLastFormData(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 })) + getData(Object.assign({}, formData, { pn: pn, page_size: length })) } } //切换每页条数 @@ -139,13 +147,7 @@ function StuffStat(props) { const getSearchData = (data = formData) => { getData(data) } - //重置数据 - const getResetData = () => { - setFormData({ - ...parameter - }) - getData({ ...parameter }) - } + const [getOperationName, setGetOperationName] = useState([]) const operationName = () => { ajax.assetsType().then(res => { @@ -182,10 +184,13 @@ function StuffStat(props) { setFormData({ brand_id: sessionTabList?.brand_id, model_id: sessionTabList?.model_id, - operatorid: sessionTabList?.operatorid + operatorid: sessionTabList?.operatorid, + pn: sessionTabList?.pn, + page_size: sessionTabList?.page_size, }) } }, []) + console.log(formData); useEffect(() => { setSessionTabList({ ...formData @@ -195,7 +200,6 @@ function StuffStat(props) { getData() merchantDataName() operationName() - }, []) return <>
diff --git a/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/index.scss b/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/index.scss index 5dc87a5..20206bb 100644 --- a/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/index.scss +++ b/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/index.scss @@ -204,6 +204,16 @@ $color-primary : var(--color-primary); cursor: pointer; border-radius: 7px; } + .rejectBtn{ + width: 79px; + height: 34px; + background: white; + cursor: pointer; + border: none; + color: black; + border-radius: 7px; + margin-left: 10px; + } } } .rejectModal{ @@ -214,6 +224,10 @@ $color-primary : var(--color-primary); line-height: 31px; } } + .font{ + text-align: center; + font-size: 16; + } .btn{ text-align: end; margin-top: 20px; diff --git a/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/loadable.jsx b/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/loadable.jsx index 27b2081..8d5a52e 100644 --- a/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/loadable.jsx +++ b/src/pages/OperationCenter/GeoSignalIgnore/GeoSignalIgnoreAudit/loadable.jsx @@ -28,6 +28,7 @@ function GeoSignalIgnoreAudit(props) { const [imgVisible, setImgVisible] = useState(false) const [passVisible, setPassVisible] = useState(false) const [rejectVisible, setRejectVisible] = useState(false) + const [reject, setReject] = useState(false) //物品型号 const handleJobStatus = (value) => { setFormData({ ...formData, auditType: value }) @@ -152,19 +153,23 @@ function GeoSignalIgnoreAudit(props) { setPassVisible(false) } const [getMessage, setGetMessage] = useState({}) + const [getPassValue, setGetPassValue] = useState({}) const passBtn = (record) => { + setGetPassValue(record) + setPassVisible(true) + } + const passModalBtn = () => { let data = { - id: record.id + id: getPassValue.id } ajax.getPassData(data).then(res => { if (res.status === 20000) { - setGetMessage(res.message) - setPassVisible(true) getData(formData) + setPassVisible(false) } }) } - const passModalBtn = () => { + const passModalCancel = () => { setPassVisible(false) } //驳回 @@ -172,24 +177,35 @@ function GeoSignalIgnoreAudit(props) { note: '' }) const handleNote = (v) => { - setGetNote(v.target.value) + setGetNote({ ...getNote, note: v.target.value }) } const [getRejectId, setGetRejectId] = useState({}) const rejectBtn = (record) => { setGetRejectId(record.id) setRejectVisible(true) } + const reModal = () => { + setReject(false) + } const rejectModalBtn = () => { + if (getNote.note === '') { + message.error('请输入驳回原因') + } else { + setReject(true) + setRejectVisible(false) + } + } + const reBtn = () => { let data = { id: getRejectId, - note: getNote + note: getNote.note } if (getNote === '') { message.error('请输入驳回原因') } else { ajax.getRejectData(data).then(res => { if (res.status === 20000) { - setRejectVisible(false) + setReject(false) setGetNote({ note: '' }) @@ -198,12 +214,16 @@ function GeoSignalIgnoreAudit(props) { }) } } - const rejectModal = () => { + const rejectCancel = () => { setRejectVisible(false) } - const rejectCancel = () => { + const reCancel = () => { + setReject(false) + } + const rejectModal = () => { setRejectVisible(false) } + // 获取列表数据 const getData = (data = formData) => { setAjaxLoading(true) @@ -235,9 +255,9 @@ function GeoSignalIgnoreAudit(props) { //切换分页 const changePn = (pn, length) => { if (formData.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 })) - getData(Object.assign({}, formData, { pn: pn , page_size: length})) + getData(Object.assign({}, formData, { pn: pn, page_size: length })) } } //切换每页条数 @@ -394,8 +414,11 @@ function GeoSignalIgnoreAudit(props) { className="passModal" title='提示' > -
{getMessage}
-
+
确定要通过该请求吗?
+
+ + +