From e60ab44933ef19cf751847c801b3d027a60f0241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=87=E8=88=AA?= <740464440@qq.com> Date: Sat, 28 Oct 2023 22:07:40 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E6=96=B0=E5=BB=BA=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AE=A1=E6=A0=B8=E9=A1=B5=E9=9D=A2=E5=8F=8A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=AD=97=E6=AE=B5=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingRecordModal/RecordReviewModal.jsx | 222 +++++- .../ParkingRecordModal/VehicleInformation.jsx | 14 +- src/components/ParkingRecordModal/index.jsx | 9 +- src/components/ParkingRecordModal/index.scss | 34 +- .../ExceptionDeal/DealRecordAudit/index.jsx | 855 ++++++++++---------- .../ExceptionDeal/DealRecordList/index.jsx | 877 +++++++++++---------- .../ExceptionDeal/StartExceptionDeal/index.jsx | 143 +++- src/services/FinancialMgm/exceptionDeal.js | 46 +- 8 files changed, 1241 insertions(+), 959 deletions(-) diff --git a/src/components/ParkingRecordModal/RecordReviewModal.jsx b/src/components/ParkingRecordModal/RecordReviewModal.jsx index 4224c69..0752c6a 100644 --- a/src/components/ParkingRecordModal/RecordReviewModal.jsx +++ b/src/components/ParkingRecordModal/RecordReviewModal.jsx @@ -1,11 +1,8 @@ -import React, { useState, useRef, useEffect } from "react"; -import { Modal, Tabs, Table, message, Button, Input, Select, Timeline, DatePicker } from "antd"; +import React, { useState, useEffect } from "react"; +import { Modal, Table, message, Button, Input, Select, Timeline, DatePicker } from "antd"; import { RightOutlined, DownOutlined } from "@ant-design/icons"; -import { dictionary, utils } from "@/config/common"; import VehicleInformation from "./VehicleInformation"; -import { payRecordColumns, refundRecordColumns, operatorRecordColumns } from "./dataSource"; import moment from "moment"; -import ajax from "@/services"; import "./index.scss"; const { TextArea } = Input; const RecordReviewModal = (props) => { @@ -14,10 +11,22 @@ const RecordReviewModal = (props) => { title = null, // 头部 open = false, data = [], + type = "", // 处理 审核 processViewData = {}, // 查看流程数据 disabledModal = false, // 查看或提交 - onCancel, + disabledAuditReason = false, + onCancel, // 关闭弹框 + onChangeSubmit, // 提交审核 + carOutTimeColor="", // 车辆出场时间样式 } = props; + // 默认数据 + const defaultData = { + deal_reason: "", // 处理理由 + examine_reason: "", // 审核理由 + examine_reason_id: 1, // 更改项 + update_value: "", // 包含 调整为 车牌号 金额 + plate_type: 1, // 车牌颜色 + }; // 更改项数据 const changeProject = [ @@ -69,26 +78,37 @@ const RecordReviewModal = (props) => { align: "center", }, { - title: "出场时间", + title: carOutTimeColor ? "计费时间" : "出场时间", dataIndex: "strExitTime", key: "strExitTime", align: "center", }, ]; + const [formData, setFormData] = useState(defaultData); // 参数 const [modalVisible, setModalVisible] = useState(false); // 模态框显示隐藏 const [resultData, setResultData] = useState([]); // 数据 const [expandedRowKeys, setExpandedRowKeys] = useState([0]); // 默认展开的列表数据 const [processView, setProcessView] = useState(false); // 流程查看 查看全部 const [getValueList, setGetValueList] = useState(1); // 变更项下拉框 + const [adjustmentValue, setAdjustmentValue] = useState(1); // 调整基于选择框值 // 关闭模态框 const $onCancelModal = () => { if (onCancel) onCancel(false); setResultData([]); setExpandedRowKeys([0]); + setFormData(defaultData); + setGetValueList(1); + setAdjustmentValue(1); } useEffect(() => { - setModalVisible(open) + setModalVisible(open); + if(!open) { + setFormData(defaultData); + setGetValueList(1); + setAdjustmentValue(1); + setProcessView(false); + }; }, [open]); useEffect(() => { @@ -106,12 +126,26 @@ const RecordReviewModal = (props) => { } _data.push({ ...value, - description: + description: }) }); setResultData(_data); + if (data?.length && disabledModal) { + setFormData({ + deal_reason: data[0]?.deal_reason || "", + examine_reason: disabledAuditReason ? data[0]?.examine_reason || "" : "", + examine_reason_id: data[0]?.examine_reason_id || 1, + update_value: data[0]?.update_value || "", + plate_type: data[0]?.plate_type || 1, + }); + if (data[0]?.examine_reason_id == 1) { + if (Number(data[0]?.update_value || "")) { + setAdjustmentValue(2); + } + } + } }; - }, [data]) + }, [data]); return ( { ) }} /> - {disabledModal ? + {disabledModal || type == "审核" ?
流程查看 { setProcessView(!processView) }}>{processView ? "返回" : "查看全部"}
@@ -205,9 +239,9 @@ const RecordReviewModal = (props) => {
-
+ {/*
-
+
*/}
: <> @@ -218,9 +252,9 @@ const RecordReviewModal = (props) => { maxLength={100} // showCount placeholder="请输入处理理由" - defaultValue={disabledModal ? resultData?.[0]?.deal_reason : null} + defaultValue={disabledModal ? formData?.deal_reason || "" : ""} disabled={disabledModal} - onChange={(e) => { console.log(e.target.value); }} + onChange={(e) => { setFormData({ ...formData, deal_reason: e.target.value }) }} />
@@ -230,9 +264,20 @@ const RecordReviewModal = (props) => { { setAdjustmentValue(v); setFormData({ ...formData, update_value: "" }) }} /> - { - // setFormData({ ...formData, end_time: time || null }) - // }} - /> - : '' + {adjustmentValue == 1 ? + { + setFormData({ ...formData, update_value: time }) + }} + /> + : + <> + + { + if (!/^[0-9]*$/.test(e.target.value)) return; + setFormData({ ...formData, update_value: e.target.value || "" }) + }} + /> + + + } + + : + getValueList == 2 ? + <> + + { setFormData({ ...formData, update_value: v?.target.value || "" }) }} + /> + + : + getValueList == 3 ? + <> + + { setFormData({ ...formData, update_value: v?.target.value || "" }) }} + /> + + : null }
-
- *审核理由 -