From 8469aa419e4c11d2dedc920b3f3832ed483f58a6 Mon Sep 17 00:00:00 2001 From: xingjx Date: Wed, 22 Nov 2023 09:49:12 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E5=AF=B9=E6=8E=A5=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E9=A1=B5=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 192 +++++------------ .../OrderInquiry/OrderChangeInquiry/index.jsx | 212 +++++++++++-------- .../OrderInquiry/ParkingOrderInquiry/index.jsx | 226 +++++++++++++++------ .../OrderInquiry/ProductOrderInquiry/index.jsx | 16 +- .../OperationCenter/CarMgm/CarInfo/loadable.jsx | 8 +- src/services/FinancialMgm/orderInquiry.js | 22 ++ 6 files changed, 384 insertions(+), 292 deletions(-) diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index a94b9cb..90d013f 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -53,6 +53,7 @@ const TableModule = forwardRef((props, ref) => { userInfo = {},//用户信息页面数据 valueChange, mandatory, + limitCon,//自定义限制条件 mandatory_name, pageName = '',//路由名字 } = props; @@ -94,7 +95,6 @@ const TableModule = forwardRef((props, ref) => { }); //区域列表 const [areaSelectedList, setAreaSelectedList] = useState([]); - const [toTime, setToTime] = useState(moment().subtract(3, 'days').startOf("day")); //tip导出弹窗 const [tipModal, setTipModal] = useState({ visible: false, @@ -169,25 +169,27 @@ const TableModule = forwardRef((props, ref) => { } } if (areaName !== null) form[areaName] = areaSelectedList; + if (form.deal_time_start !== void 0 && form.deal_time_end !== void 0) {//暂时写法 + form.deal_time_start = moment(form.deal_time_start).format("YYYY-MM-DD HH:mm:ss"); + form.deal_time_end = moment(form.deal_time_end).format("YYYY-MM-DD HH:mm:ss"); + } if (form.start_time !== void 0 && form.end_time !== void 0) { form.start_time = moment(form.start_time).format("YYYY-MM-DD HH:mm:ss"); form.end_time = moment(form.end_time).format("YYYY-MM-DD HH:mm:ss"); } if (moment(form.end_time) - moment(form.start_time) > 180 * 3600 * 24000) { //console.log(2222,form.end_time,form.start_time,moment(form.end_time) - moment(form.start_time)) - if(mandatory){ + if (mandatory) { let cna = Object.values(searchForm.getFieldsValue([mandatory])) //console.log(mandatory,cna[0],searchForm.getFieldsValue([mandatory])) - if(!cna[0]) { + if (!cna[0]) { message.error(`查询时间范围大于半年,需填写${mandatory_name}!`) return } } - // if (!(form.plate||form.berth_id)) { - // message.error('查询时间范围大于半年,需填写车牌号或泊位号!') - // return - // } + } + if (limitCon && limitCon(form)) return search(form); } //重置 @@ -247,24 +249,47 @@ const TableModule = forwardRef((props, ref) => { const handleChange = (newValue) => { setValue(newValue); }; - useEffect(() => { - console.log(deftime.startDateTime); - if (deftime.startDateTime) { - searchForm.setFieldsValue({ - start_time: moment(deftime.startDateTime), - end_time: moment(deftime.endDateTime) - }) - setSessionTabList({ - ...sessionTabList, start_time: moment(deftime.startDateTime), - end_time: moment(deftime.endDateTime) - }) - } else { - // searchForm.setFieldsValue({ - // start_time: moment().subtract(1, "month"), - // end_time: moment() - // }) + // useEffect(() => { + // console.log(deftime.startDateTime); + // if (deftime.startDateTime) { + // searchForm.setFieldsValue({ + // start_time: moment(deftime.startDateTime), + // end_time: moment(deftime.endDateTime) + // }) + // setSessionTabList({ + // ...sessionTabList, start_time: moment(deftime.startDateTime), + // end_time: moment(deftime.endDateTime) + // }) + // } else { + // // searchForm.setFieldsValue({ + // // start_time: moment().subtract(1, "month"), + // // end_time: moment() + // // }) + // } + // }, [deftime]) + const toDeftime = (v,name) => { + if (v.startDateTime) { + if(name){//财务管理-订单修改查询暂时操作 + searchForm.setFieldsValue({ + deal_time_start: moment(v.startDateTime), + deal_time_end: moment(v.endDateTime) + }) + setSessionTabList({ + ...sessionTabList, deal_time_start: moment(v.startDateTime), + deal_time_end: moment(v.endDateTime) + }) + }else { + searchForm.setFieldsValue({ + start_time: moment(v.startDateTime), + end_time: moment(v.endDateTime) + }) + setSessionTabList({ + ...sessionTabList, start_time: moment(v.startDateTime), + end_time: moment(v.endDateTime) + }) + } } - }, [deftime]) + } useEffect(() => { if (inputSelectGroup.startDateTime) { // searchForm.setFieldsValue({ @@ -433,7 +458,7 @@ const TableModule = forwardRef((props, ref) => { (item.defaultTitle && item.defaultTitle[0]) || "开始时间" } - name={"start_time"} + name={item.defaultName ? item.defaultName[0] : "start_time"} key={"start_time"} initialValue={ (item.defaultValue && item.defaultValue[0]) || @@ -443,7 +468,7 @@ const TableModule = forwardRef((props, ref) => { { { text: '近两年', value: 730 }, ]} onChange={(v) => { - setDeftime(v); + //setDeftime(v); + toDeftime(v,item.defaultName) }} /> @@ -494,7 +520,7 @@ const TableModule = forwardRef((props, ref) => { // }); }} /> - + ); break; @@ -716,115 +742,5 @@ const TableModule = forwardRef((props, ref) => { ); }); -function InputSelectGroup(params) { - const { - onChange = () => { }, - getValue = () => { }, - pageName = "", - } = params; - const [searchForm] = Form.useForm(); - const [sessionTabList, setSessionTabList] = useSessionStorageState(pageName, { - value: '' - }) - const [timeType, setTimeType] = useState(1); - const [deftime, setDeftime] = useState([]) - const [timeGroup, setTimeGroup] = useState({ - start_time: moment().subtract(1, "day").format(), - end_time: moment().format(), - }); - console.log(); - useEffect(() => { - if (deftime.startDateTime) { - setTimeGroup({ - start_time: moment(deftime.startDateTime), - end_time: moment(deftime.endDateTime) - }) - console.log(timeGroup); - - setSessionTabList({ - ...sessionTabList, start_time: moment(deftime.startDateTime), - end_time: moment(deftime.endDateTime) - }) - } else { - // searchForm.setFieldsValue({ - // start_time: moment().subtract(1, "month"), - // end_time: moment() - // }) - } - }, [deftime]) - useEffect(() => { - onChange(timeGroup, timeType); - }, [timeGroup, timeType]); - return ( - <> - - - - setFormData({ ...formData, pay_merchant_id: v }) + setFormData({ ...formData, update_reason_code: v }) } /> @@ -433,9 +464,9 @@ function EditOrderInquiry(props) { - setFormData({ ...formData, app_name: e.target.value }) + setFormData({ ...formData, deal_record_id: e.target.value }) } /> @@ -445,9 +476,9 @@ function EditOrderInquiry(props) { className="form-con" placeholder="请选择" options={searchSelectList?.flow_type_list || []} - value={formData.pay_merchant_id} + value={formData.parking_type} onChange={(v) => - setFormData({ ...formData, pay_merchant_id: v }) + setFormData({ ...formData, parking_type: v }) } /> @@ -456,9 +487,9 @@ function EditOrderInquiry(props) { - setFormData({ ...formData, app_name: e.target.value }) + setFormData({ ...formData, park_record_id: e.target.value }) } /> @@ -468,9 +499,9 @@ function EditOrderInquiry(props) { className="form-con" showTime allowClear={false} - value={formData.confirm_start_time ? moment(formData.confirm_start_time) : undefined} - onChange={(date, dateString) => setFormData({ ...formData, confirm_start_time: dateString })} - disabledDate={(current) => current > moment(formData.confirm_end_time)} + value={formData.start_time ? moment(formData.start_time) : undefined} + onChange={(date, dateString) => setFormData({ ...formData, start_time: dateString })} + disabledDate={(current) => current > moment(formData.end_time)} />
@@ -479,9 +510,9 @@ function EditOrderInquiry(props) { className="form-con" showTime allowClear={false} - value={formData.confirm_end_time ? moment(formData.confirm_end_time) : undefined} - onChange={(date, dateString) => setFormData({ ...formData, confirm_end_time: dateString })} - disabledDate={(current) => current < moment(formData.confirm_start_time)} + value={formData.end_time ? moment(formData.end_time) : undefined} + onChange={(date, dateString) => setFormData({ ...formData, end_time: dateString })} + disabledDate={(current) => current < moment(formData.start_time)} />
@@ -490,9 +521,9 @@ function EditOrderInquiry(props) { className="form-con" showTime allowClear={false} - value={formData.create_start_time ? moment(formData.create_start_time) : undefined} - onChange={(date, dateString) => setFormData({ ...formData, create_start_time: dateString })} - disabledDate={(current) => current > moment(formData.create_end_time)} + value={formData.deal_time_start ? moment(formData.deal_time_start) : undefined} + onChange={(date, dateString) => setFormData({ ...formData, deal_time_start: dateString })} + disabledDate={(current) => current > moment(formData.deal_time_end)} />
@@ -501,9 +532,9 @@ function EditOrderInquiry(props) { className="form-con" showTime allowClear={false} - value={formData.create_end_time ? moment(formData.create_end_time) : undefined} - onChange={(date, dateString) => setFormData({ ...formData, create_end_time: dateString })} - disabledDate={(current) => current < moment(formData.create_start_time)} + value={formData.deal_time_end ? moment(formData.deal_time_end) : undefined} + onChange={(date, dateString) => setFormData({ ...formData, deal_time_end: dateString })} + disabledDate={(current) => current < moment(formData.deal_time_start)} />
@@ -511,10 +542,23 @@ function EditOrderInquiry(props) {