From 1684bef135ac153fe41825921e2448ebc62b6ea1 Mon Sep 17 00:00:00 2001 From: zhugy Date: Tue, 30 Jan 2024 16:31:19 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E6=96=B0=E5=A2=9E=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=BB=8F=E7=BA=AC=E5=BA=A6=E9=80=89=E6=8B=A9=E4=B8=8E=E5=9B=9E?= =?UTF-8?q?=E5=A1=AB=E7=BB=84=E4=BB=B6,=E4=BF=AE=E6=94=B9=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SelectGaodeLngLat/index.jsx | 13 +- src/components/SelectGaodeLngLat/index.scss | 3 + src/components/SelectGaodeLngLat2/blue-point.png | Bin 0 -> 2377 bytes src/components/SelectGaodeLngLat2/index.jsx | 231 +++++++++++++++++++++ src/components/SelectGaodeLngLat2/index.scss | 29 +++ src/components/index.jsx | 2 + .../RecordInquiry/ParkRecordTotal/loadable.jsx | 71 ++++--- src/pages/NewEnergy/ChargeStationMgm/index.scss | 4 + src/pages/NewEnergy/ChargeStationMgm/loadable.jsx | 43 ++-- 9 files changed, 337 insertions(+), 59 deletions(-) create mode 100644 src/components/SelectGaodeLngLat2/blue-point.png create mode 100644 src/components/SelectGaodeLngLat2/index.jsx create mode 100644 src/components/SelectGaodeLngLat2/index.scss diff --git a/src/components/SelectGaodeLngLat/index.jsx b/src/components/SelectGaodeLngLat/index.jsx index 02c8f81..e79f2a9 100644 --- a/src/components/SelectGaodeLngLat/index.jsx +++ b/src/components/SelectGaodeLngLat/index.jsx @@ -13,7 +13,6 @@ function SelectGaodeLngLat(props) { const { getLntLat = () => { }, close, - hide, lngLatVisible = false, open, onChange = () => { }, @@ -136,7 +135,7 @@ function SelectGaodeLngLat(props) { + { setVisible(false) }} + > +
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+
+ + ); +} + +export default SelectGaodeLngLat; diff --git a/src/components/SelectGaodeLngLat2/index.scss b/src/components/SelectGaodeLngLat2/index.scss new file mode 100644 index 0000000..7109db3 --- /dev/null +++ b/src/components/SelectGaodeLngLat2/index.scss @@ -0,0 +1,29 @@ +.SelectLnglat { + +} +.map-modal { + .ant-modal-body { + border-radius: 4px; + } + .ant-modal-close-x { + width: 30px; + height: 30px; + line-height: 30px; + } +} +.bottom-input { + display: flex; + margin: 10px 0 0 0; + .input-search { + margin: 0 10px 0 0; + width: 300px; + } + .result-search{ + label{ + width: 160px; + line-height: 32px; + height:32px; + } + display: flex; + } +} diff --git a/src/components/index.jsx b/src/components/index.jsx index 48fb281..6636eda 100644 --- a/src/components/index.jsx +++ b/src/components/index.jsx @@ -33,6 +33,7 @@ import TableModule from "./TableModule"; import TreeSelectGroup from "./TreeSelectGroup"; import SelectLntLat from "./SelectLngLat"; import SelectGaodeLngLat from "./SelectGaodeLngLat"; +import SelectGaodeLngLat2 from "./SelectGaodeLngLat2"; import ImportBtn from './ImportBtn'; import QuickMenu from './QuickMenu'; import DataSelect from './DataSelect'; @@ -82,6 +83,7 @@ export { TreeSelectGroup, SelectLntLat, SelectGaodeLngLat, + SelectGaodeLngLat2, ImportBtn, QuickMenu, DataSelect, diff --git a/src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx b/src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx index 8f170ad..0bf596d 100644 --- a/src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx +++ b/src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx @@ -22,6 +22,7 @@ import ajax from "@/services"; import errorImg from '@/assets/images/error-img-new.png' import { QuestionCircleOutlined } from '@ant-design/icons'; import { TableModule } from "@/components"; +import { useSessionStorageState } from 'ahooks'; import "./index.scss"; import { payRecordColumns, @@ -35,6 +36,23 @@ const { TextArea } = Input; let array = []; function ParkRecordTotal() { + const [sessionTabList, setSessionTabList] = useSessionStorageState("parkRecordTotal", { + value: {} + }) + const sType = sessionTabList.type // 出场类型 + // 数据来源 + const [source, setSource] = useState(() => { + if (!sType || sType == 1) { + return sysConfig?.inSource + } else if (sType == 2) { + return sysConfig?.outSource + } + }) + const valueChange = (v) => { + // console.log(v.type); + let _source = v.type == 1 ? sysConfig?.inSource : sysConfig?.outSource + setSource(_source) + } const roadContent = (

出场时间-入场时间的计算金额

@@ -70,7 +88,7 @@ function ParkRecordTotal() { render: (text, record, index) => index + 1, width: 100, }, - + { title: "路段名称", dataIndex: "road", @@ -178,8 +196,8 @@ function ParkRecordTotal() { { title: 应收金额 - - , + + , dataIndex: "receivable_amount", key: "receivable_amount", width: 100, @@ -198,10 +216,10 @@ function ParkRecordTotal() { align: "center", }, { - title: + title: 优惠金额 - - , + + , dataIndex: "preferential_amount", key: "preferential_amount", width: 100, @@ -213,10 +231,10 @@ function ParkRecordTotal() { // }, { - title: + title: 折扣金额 - - , + + , dataIndex: "discount_amount", key: "discount_amount", width: 100, @@ -230,8 +248,8 @@ function ParkRecordTotal() { { title: 退款总计 - - , + + , dataIndex: "refund_total", key: "refund_total", width: 100, @@ -303,7 +321,7 @@ function ParkRecordTotal() { name: "region", type: "TreeSelect", label: "区域", - areaName:1 + areaName: 1 }, { name: "operator", @@ -311,14 +329,14 @@ function ParkRecordTotal() { label: "商户名称", defaultValue: "0", placeholder: "请选择商户名称", - operatorName:1 + operatorName: 1 }, { name: "road", type: "SearchSelect", label: "路段名称", placeholder: "请输入路段名称", - roadName:1 + roadName: 1 }, { name: "road_type", @@ -432,12 +450,12 @@ function ParkRecordTotal() { // ], }, { - name: "in_source", + name: "source", type: "Select", label: "操作来源", placeholder: "请选择操作来源", defaultValue: 0, - options: sysConfig?.inSource || [], + options: source, }, { name: "in_person", @@ -699,7 +717,7 @@ function ParkRecordTotal() { {item.receivable_amount} - {item.coupon } + {item.coupon} {item.preferential_amount} @@ -725,17 +743,17 @@ function ParkRecordTotal() {
- +
- +
- +
@@ -744,7 +762,7 @@ function ParkRecordTotal() { ); } //查看历史详情 - const [getHistoryData,setGetHistoryData]=useState({}) + const [getHistoryData, setGetHistoryData] = useState({}) function checkHistoryDetail(record) { setGetHistoryData(record); setHistoryVisible(true); @@ -794,7 +812,7 @@ function ParkRecordTotal() { ajax.getHistoryRecord({ park_record_id: park_id }).then((res) => { if (res.status === 20000) { // res.data.list.map(res=>{ - setHistoryProgressRecord(res.data.list); + setHistoryProgressRecord(res.data.list); // }) } else { message.error(res.message) @@ -809,7 +827,7 @@ function ParkRecordTotal() { if (res.status === 20000) { setTableData(res.data.list); setTotal(res.data.total); - }else{ + } else { message.error(res.message) } }); @@ -826,7 +844,8 @@ function ParkRecordTotal() { tableData={tableData} formSearch={formSearch} pagename="停车记录查询" - mandatory={['plate','berth_id']} + valueChange={valueChange} + mandatory={['plate', 'berth_id']} mandatory_name={['车牌号或泊位号']} pageName={'parkRecordTotal'} initFormData={initFormData} @@ -1184,11 +1203,11 @@ function ParkRecordTotal() {
车辆照片
- +
车牌照片
- +
diff --git a/src/pages/NewEnergy/ChargeStationMgm/index.scss b/src/pages/NewEnergy/ChargeStationMgm/index.scss index 7f6d376..0047101 100644 --- a/src/pages/NewEnergy/ChargeStationMgm/index.scss +++ b/src/pages/NewEnergy/ChargeStationMgm/index.scss @@ -1,4 +1,7 @@ .add-station-modal { + .ant-modal-header { + border-radius: 4px 4px 0 0; + } .add-station-body { display: flex; justify-content: space-between; @@ -62,6 +65,7 @@ .ant-modal-footer{ display: flex; justify-content: center; + border-radius: 0 0 4px 4px; .ant-btn{ width: 88px; height: 35px; diff --git a/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx b/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx index e73c352..fe6d10a 100644 --- a/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx +++ b/src/pages/NewEnergy/ChargeStationMgm/loadable.jsx @@ -6,14 +6,14 @@ import { Upload, } from "antd"; import ajax from "@/services"; -import { useSessionStorageState, useSetState } from "ahooks" +import { useSetState } from "ahooks" import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; -import { TableModule, FormInput, FormSelect, FormTreeSelectNew, ImgError, SelectGaodeLngLat } from "@/components"; +import { TableModule, FormInput, FormSelect, FormTreeSelectNew, ImgError, SelectGaodeLngLat2 } from "@/components"; import "./index.scss"; function Appointment() { - const pattern = /^\d+$/; // 正整数正则 + const pattern = /^[1-9][0-9]*$/; // 正整数正则 // 详情弹窗 const [detailVisible, setDetailVisible] = useState(false); // 列表数据 @@ -26,8 +26,7 @@ function Appointment() { const [areaList, setAreaList] = useState([]); //商户名称下拉 const [operatorList, setOperatorList] = useState([]); - // 经纬度选择弹窗 - const [lngLatVisible, setLngLatVisible] = useState(false); + // 添加站点 const initAdd = { name: "", @@ -41,6 +40,10 @@ function Appointment() { lng_lat: "" } const [addFormData, setAddFormData] = useSetState(initAdd); + const [lngLat, setLngLat] = useSetState({ + lng_lat: "", + address: "" + }); // 搜索参数 const [formData, setFormData] = useSetState({}); // 图片上传load @@ -200,6 +203,7 @@ function Appointment() { // 获取商户下拉 const getAllOperator = () => { ajax.getAllOperator().then((res) => { + console.log(res); const { status, data } = res if (status === 20000) { if (data && data.length) { @@ -236,12 +240,8 @@ function Appointment() { setLoading(false) setDetailVisible(true) } - const handelClose = () => { - setLngLatVisible(false) - setAddFormData({ lng_lat: "", address: "" }) - } const handelOk = () => { - // console.log(addFormData); + console.log(addFormData); if (!addFormData.name) { message.warn("请输入充电站名称") return @@ -254,18 +254,10 @@ function Appointment() { message.warn("请输入车位数量") return } - if (addFormData.count < 1) { - message.warn("请输入正确的车位数量") - return - } if (!pattern.test(addFormData.count)) { message.warn("请输入正整数的车位数量") return } - if (!addFormData.address) { - message.warn("请输入详细地址") - return - } if (!addFormData.site_type) { message.warn("请选择站点类型") return @@ -282,6 +274,10 @@ function Appointment() { message.warn("请选择经纬度") return } + if (!addFormData.address) { + message.warn("请输入详细地址") + return + } if (!addFormData.img) { message.warn("请上传充电站图片") return @@ -468,20 +464,15 @@ function Appointment() { disabled={true} />
- setLngLatVisible(true)} - lngLatVisible={lngLatVisible} + { setAddFormData({ lng_lat: value }) }} onChange={(adress) => { - // console.log(adress); setAddFormData({ address: adress }) }} - // close={handelClose} - close={() => setLngLatVisible(false)} - hide={() => setLngLatVisible(false)} />