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) => { <DatePicker showTime format={"YYYY-MM-DD HH:mm:ss"} placement={"topLeft"} /> </Form.Item> <Form.Item - name="end_time" + name={item.defaultName ? item.defaultName[1] : "end_time"} label={ (item.defaultTitle && item.defaultTitle[1]) || "结束时间" @@ -468,7 +493,8 @@ const TableModule = forwardRef((props, ref) => { { text: '近两年', value: 730 }, ]} onChange={(v) => { - setDeftime(v); + //setDeftime(v); + toDeftime(v,item.defaultName) }} /> </div> @@ -494,7 +520,7 @@ const TableModule = forwardRef((props, ref) => { // }); }} /> - + </> ); break; @@ -716,115 +742,5 @@ const TableModule = forwardRef((props, ref) => { </div> ); }); -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 ( - <> - <Row> - <Col span={8}> - <Select - style={{ width: "100%" }} - onChange={(timeType) => { - setTimeType(timeType); - }} - defaultValue={1} - options={[ - { - label: "支付时间", - value: 1, - }, - { - label: "计费时间", - value: 2, - }, - { - label: "入场时间", - value: 3, - } - ]} - /> - </Col> - <Col span={16}> - <DatePicker - placeholder="请选择开始日期" - onChange={(val, string) => { - setTimeGroup({ ...timeGroup, start_time: string }); - }} - format={"YYYY-MM-DD HH:mm:ss"} - defaultValue={deftime.length ? deftime.startDateTime : moment().subtract(1, "day")} - showTime - /> - </Col> - </Row> - <Row> - <Col offset={8} span={16}> - <DatePicker - placeholder="请选择结束日期" - defaultValue={moment()} - onChange={(val, string) => { - setTimeGroup({ ...timeGroup, end_time: string }); - }} - format={"YYYY-MM-DD HH:mm:ss"} - showTime - /> - </Col> - </Row> - <div style={{ margin: "0px 0 10px 0" }}> - <QuickMenu - dropdownData={[ - { text: '昨日', value: 1 }, - { text: '今日', value: 0 }, - { text: '近三日', value: 2 }, - { text: '近一周', value: 6 }, - { text: '近一月', value: 29 }, - { text: '近一年', value: 365 }, - { text: '近两年', value: 730 }, - ]} - onChange={(v) => { - // setTimeGroup({ ...timeGroup, start_time: v.startDateTime, end_time: v.endDateTime }) - getValue(v) - setDeftime(v); - }} /> - </div> - </> - ); -} export default TableModule; diff --git a/src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx b/src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx index 3dbe7f4..aaef5c3 100644 --- a/src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx +++ b/src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx @@ -24,15 +24,16 @@ function EditOrderInquiry(props) { const [detailVisible, setDetailVisible] = useState(false); const [bigpicVisible, setBigpicVisible] = useState(false);//大图展示 const [bigPic, setBigPic] = useState(); - const [ycddData, setYcddData] = useState([])//异常订单数据 + const [ycddData, setYcddData] = useState([])//详情数据 + const [detailTable, setDetailTable] = useState([]) // 默认数据 const defaultData = { confirm_start_time: moment().subtract('days').startOf('day').format("YYYY-MM-DD HH:mm:ss"), confirm_end_time: moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"), create_start_time: moment().subtract('days').startOf('day').format("YYYY-MM-DD HH:mm:ss"), create_end_time: moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"), - app_name: "", // 应用名称 - app_type: 0, //应用类型 + //app_name: "", // 应用名称 + //app_type: 0, //应用类型 pay_merchant_id: 0, //支付商户名称 }; // 分页数据 @@ -54,10 +55,9 @@ function EditOrderInquiry(props) { // 表格加载状态 const [tabLoading, setTabLoading] = useState(false); // 表格返回数据 - const [resultData, setResultData] = useState({ - total: 0, - list: [], - }); + const [resultData, setResultData] = useState([]); + const [detailData, setDetailData] = useState([]); + const [total, setTotal] = useState(false); const [detailTableData, setDetailTableData] = useState([]); const [searchSelectList, setSearchSelectList] = useState([]); //搜索下拉数据 const [sessionTabList, setSessionTabList] = useSessionStorageState('editOrderInquiry', { @@ -112,10 +112,11 @@ function EditOrderInquiry(props) { } setDefaultParams({ ...postData, ...pageInfo }); setTabLoading(true); - ajax.getAppList({ ...postData, ...pageInfo, ...v }).then( + ajax.getOrderChangeList({ ...postData, ...pageInfo, ...v }).then( (res) => { if (parseInt(res?.status) === 20000) { - setResultData(res?.data || {}); + setResultData(res?.data || []); + setTotal(res.total) } else { message.error(res?.message); } @@ -129,7 +130,22 @@ function EditOrderInquiry(props) { } ); }; - + // 获取查看详情数据 + const getDetailData = (v) => { + ajax.getOrderChangeDetail({ ...v }).then( + (res) => { + if (parseInt(res?.status) === 20000) { + setYcddData(res?.data || []); + setDetailTable(res?.data?.order_update_detail) + } else { + message.error(res?.message); + } + }, + (err) => { + console.log(err); + } + ); + }; // 检索数据 const handleSearch = () => { setLoading(true); @@ -144,7 +160,7 @@ function EditOrderInquiry(props) { showQuickJumper: true, showSizeChanger: true, current: pageInfo.pn, - total: resultData?.total, + total: total, pageSize: pageInfo.page_size, pageSizeOptions: Array.from( new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) @@ -168,13 +184,20 @@ function EditOrderInquiry(props) { }, { title: "修改原因", - dataIndex: "app_name", + dataIndex: "update_reason", align: "center", }, { title: "处理记录ID", - dataIndex: "app_name", + dataIndex: "deal_record_id", align: "center", + render: (text) => ( + <> + <a onClick={() => { + navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") }); + }}>{text}</a> + </> + ) }, { title: "业务订单类型", @@ -183,42 +206,51 @@ function EditOrderInquiry(props) { }, { title: "业务订单ID", - dataIndex: "app_name", + dataIndex: "business_order_type", align: "center", + render: (text) => ( + <> + <a onClick={() => { + navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") }); + }}>{text}</a> + </> + ) }, { title: "订单金额(元)", - dataIndex: "app_name", + dataIndex: "order_mount", align: "center", }, { title: "优惠总计(元)", - dataIndex: "app_name", + dataIndex: "preferential_amount", align: "center", }, { title: "实付总计(元)", - dataIndex: "app_name", + dataIndex: "actual_amount", align: "center", }, { title: "欠费总计(元)", - dataIndex: "app_name", + dataIndex: "arrearsAmount", align: "center", }, { title: "确认时间", - dataIndex: "app_name", + dataIndex: "examine_time", align: "center", + width: 150, }, { title: "发起时间", - dataIndex: "app_name", + dataIndex: "deal_time", align: "center", + width: 150, }, { title: "状态", - dataIndex: "app_name", + dataIndex: "status", align: "center", }, { @@ -230,7 +262,7 @@ function EditOrderInquiry(props) { <span style={{ color: "#177ddc", cursor: "pointer" - }} onClick={() => { handleView(); setYcddData(row) }}> + }} onClick={() => { handleView(); }}> 查看 </span> ); @@ -241,57 +273,58 @@ function EditOrderInquiry(props) { const detailColumns = [ { title: "修改状态", - dataIndex: "statusName", + dataIndex: "status", align: "center", }, { title: "订单生成时间", - dataIndex: "a", + dataIndex: "create_time", align: "center", }, { title: "支付订单类型", - dataIndex: "a", + dataIndex: "business_order_type", align: "center", }, { title: "支付渠道", - dataIndex: "app_name", + dataIndex: "payment_channels", align: "center", }, { title: "支付订单ID", - dataIndex: "app_name", + dataIndex: "order_id", align: "center", }, { title: "抵扣修改金额", - dataIndex: "app_name", + dataIndex: "preferential_amount", align: "center", }, { title: "优惠金额", - dataIndex: "app_name", + dataIndex: "road_discount", align: "center", }, { title: "实付金额", - dataIndex: "app_name", + dataIndex: "actual_amount", align: "center", }, { title: "欠费金额", - dataIndex: "app_name", + dataIndex: "arrears_mount", align: "center", }, { title: "需要退款金额", - dataIndex: "app_name", + dataIndex: "actual_refund", align: "center", }, ]; // 查看 const handleView = () => { + getDetailData() setDetailVisible(true) }; //订单详情 @@ -300,82 +333,82 @@ function EditOrderInquiry(props) { <div className="ltc-box-title"><div className="text">车厂详情</div></div> <div className="ltc-content"> <div className="ltc-item"> - <div className="new-item">停车场名称</div><div className="new-value">{ycddData?.road_name}</div> + <div className="new-item">停车场名称</div><div className="new-value">{ycddData?.order_info?.parking_detail.road_name|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">区域</div><div className="new-value">{ycddData.area_name}</div> + <div className="new-item">区域</div><div className="new-value">{ycddData?.order_info?.parking_detail.region_name|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">商户名称</div><div className="new-value">{ycddData.park_operator_name}</div> + <div className="new-item">商户名称</div><div className="new-value">{ycddData?.order_info?.parking_detail.operator_name|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">泊位号</div><div className="new-value">{ycddData.berth_code}</div> + <div className="new-item">泊位号</div><div className="new-value">{ycddData?.order_info?.parking_detail.berth_id|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">车场类型</div><div className="new-value">{ycddData.road_type}</div> + <div className="new-item">车场类型</div><div className="new-value">{ycddData?.order_info?.parking_detail.parking_model_type_name|| "--"}</div> </div> </div> <div className="ltc-box-title"><div className="text">车辆详情</div></div> <div className="ltc-content"> <div className="ltc-item"> - <div className="new-item">车牌号</div><div className="new-value">{ycddData.plate_number}</div> + <div className="new-item">车牌号</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.plate|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">停车时长</div><div className="new-value">{ycddData.parking_duration}</div> + <div className="new-item">停车时长</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.parking_duration|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">入场时间</div><div className="new-value">{ycddData.in_time}</div> + <div className="new-item">入场时间</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.in_time|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">出场时间</div><div className="new-value">{ycddData.out_time}</div> + <div className="new-item">出场时间</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.out_time|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">入场记录来源</div><div className="new-value">{ycddData.inSource}</div> + <div className="new-item">入场记录来源</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.in_source_name|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">出场记录来源</div><div className="new-value">{ycddData.outSource}</div> + <div className="new-item">出场记录来源</div><div className="new-value">{ycddData?.order_info?.vehicle_detail.out_source_name|| "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">证据图像</div><div className="new-value"><a onClick={() => { setBigPic(ycddData.in_veh_pic); setBigpicVisible(true) }}>查看</a></div> + <div className="new-item">证据图像</div><div className="new-value"><a onClick={() => { setBigPic(ycddData?.order_info.vehicle_detail.in_veh_pic); setBigpicVisible(true) }}>查看</a></div> </div> </div> <div className="ltc-box-title"><div className="text">订单详情:{ycddData?.refund_id}</div></div> <div className="ltc-content"> <div className="ltc-item"> - <div className="new-item">应收金额</div><div className="new-value">{ycddData?.r || "--"}</div> + <div className="new-item">应收金额</div><div className="new-value">{ycddData?.order_info?.order_detail.receivable_amount || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">优惠总计</div><div className="new-value">{ycddData.r || "--"}</div> + <div className="new-item">优惠总计</div><div className="new-value">{ycddData?.order_info?.order_detail.preferential_amount || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">实付总计</div><div className="new-value">{ycddData.p || "--"}</div> + <div className="new-item">实付总计</div><div className="new-value">{ycddData?.order_info?.order_detail.actual_amount || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">欠费总计</div><div className="new-value">{ycddData.r || "--"}</div> + <div className="new-item">欠费总计</div><div className="new-value">{ycddData?.order_info?.order_detail.arrears_mount || "--"}</div> </div> </div> <div className="ltc-box-title"><div className="text">修改信息:{ycddData?.refund_id}</div><div className="line"></div></div> <div className="ltc-content"> <div className="ltc-item"> - <div className="new-item">修改原因</div><div className="new-value">{ycddData.s || "--"}</div> + <div className="new-item">修改原因</div><div className="new-value">{ycddData?.update_info?.update_reason || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">欠费金额修改</div><div className="new-value">{ycddData.s || "--"}</div> + <div className="new-item">欠费金额修改</div><div className="new-value">{ycddData?.update_info?.receivable_amount || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">修改金额</div><div className="new-value">{ycddData.s || "--"}</div> + <div className="new-item">修改金额</div><div className="new-value">{ycddData?.update_info?.receivable_amount_exception || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">优惠金额修改</div><div className="new-value">{ycddData.s || "--"}</div> + <div className="new-item">优惠金额修改</div><div className="new-value">{ycddData?.update_info?.preferential_amount || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">退款方式</div><div className="new-value">{ycddData.refund_type || "--"}</div> + <div className="new-item">退款方式</div><div className="new-value">{ycddData?.update_info?.refund_type_name || "--"}</div> </div> <div className="ltc-item"> - <div className="new-item">退款金额共计</div><div className="new-value">{ycddData.r || "--"}</div> + <div className="new-item">退款金额共计</div><div className="new-value">{ycddData?.update_info?.actual_refund || "--"}</div> </div> </div> <div className="ltc-box-title"><div className="text">订单修改明细</div><div className="line"></div></div> @@ -383,9 +416,7 @@ function EditOrderInquiry(props) { //rowSelection={rowSelection} rowKey={'index'} columns={detailColumns} - dataSource={[{ - statusName: '已完成' - }]} + dataSource={detailTable||[]} pagination={false} /> </div> @@ -417,14 +448,14 @@ function EditOrderInquiry(props) { <div className="title">查询条件</div> <div className="form-Wrap"> <div className="yisa-search"> - <label>修改时间</label> + <label>修改原因</label> <Select className="form-con" placeholder="请选择" options={searchSelectList?.payment_list || []} - value={formData.pay_merchant_id} + value={formData.update_reason_code} onChange={(v) => - setFormData({ ...formData, pay_merchant_id: v }) + setFormData({ ...formData, update_reason_code: v }) } /> </div> @@ -433,9 +464,9 @@ function EditOrderInquiry(props) { <Input className="form-con" placeholder="请输入" - value={formData?.app_name} + value={formData?.deal_record_id} onChange={(e) => - setFormData({ ...formData, app_name: e.target.value }) + setFormData({ ...formData, deal_record_id: e.target.value }) } /> </div> @@ -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 }) } /> </div> @@ -456,9 +487,9 @@ function EditOrderInquiry(props) { <Input className="form-con" placeholder="请输入" - value={formData?.app_name} + value={formData?.park_record_id} onChange={(e) => - setFormData({ ...formData, app_name: e.target.value }) + setFormData({ ...formData, park_record_id: e.target.value }) } /> </div> @@ -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)} /> </div> <div className="yisa-search"> @@ -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)} /> </div> <div className="yisa-search"> @@ -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)} /> </div> <div className="yisa-search"> @@ -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)} /> </div> <div className="yisa-search"> @@ -511,10 +542,23 @@ function EditOrderInquiry(props) { <Select className="form-con" placeholder="请选择" - options={searchSelectList?.flow_type_list || []} - value={formData.pay_merchant_id} + options={[ + { + label: "待审核", + value: 1, + }, + { + label: "已完成", + value: 2, + }, + { + label: "已驳回", + value: 3, + }, + ]} + value={formData.status_id} onChange={(v) => - setFormData({ ...formData, pay_merchant_id: v }) + setFormData({ ...formData, status_id: v }) } /> </div> @@ -541,7 +585,7 @@ function EditOrderInquiry(props) { <div className="row-head"> <span className="number-wrapper"> <span className="letter">共查询到</span> - <span className="total-number">{resultData.total || 0} </span> + <span className="total-number">{total || 0} </span> <span className="letter">条结果</span> </span> {/* <div> @@ -552,12 +596,12 @@ function EditOrderInquiry(props) { </div> <ResultFlowResult ajaxLoad={tabLoading} - resultData={resultData?.list || []} + resultData={resultData || []} > <Table // className="yisa-table" rowKey={(row) => row.id} - dataSource={resultData?.list || []} + dataSource={resultData || []} columns={tableColumns} pagination={false} loading={tabLoading} diff --git a/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx b/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx index 725c092..a0cac18 100644 --- a/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx +++ b/src/pages/FinancialMgm/OrderInquiry/ParkingOrderInquiry/index.jsx @@ -18,6 +18,7 @@ import ajax from '@/config/ajax.js' import { TableModule } from "@/components"; import { dictionary } from "@/config/common.js"; import "./index.scss"; +import { constant } from "lodash"; function ParkingOrderInquiry() { const [carId, setCarId] = useState() @@ -33,9 +34,16 @@ function ParkingOrderInquiry() { align: "center", } switch (item) { + case "入场时间": + case "计费时间": + case "支付时间": + cm.render = (text, record, index) => <div style={{ width: '150px' }}>{text}</div> + break case "序号": cm.render = (text, record, index) => index + 1 break + case "欠费订单ID": + case "停车订单ID": case "退款订单ID": case "业务订单ID": case "支付订单ID": @@ -49,6 +57,7 @@ function ParkingOrderInquiry() { break default: break } + //console.log(arr) arr.push(cm) }) var obj = { @@ -74,7 +83,91 @@ function ParkingOrderInquiry() { } return arr } - + + const acdColums = [ + { + title: '欠费订单ID', + dataIndex: 'order_id', + key: 'order_id', + align: "center", + render: (text) => ( + <> + <a onClick={() => { + navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") }); + }}>{text}</a> + </> + ) + }, + { + title: '停车订单ID', + dataIndex: 'park_record_id', + key: 'park_record_id', + align: "center", + render: (text) => ( + <> + <a onClick={() => { + navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") }); + }}>{text}</a> + </> + ) + }, + { + title: '区域', + dataIndex: 'area', + key: 'area', + align: "center", + }, + { + title: '商户名称', + dataIndex: 'merchantName', + key: 'merchantName', + align: "center", + }, + { + title: '停车场名称', + dataIndex: 'sectionName', + key: 'sectionName', + align: "center", + }, + { + title: '车场类型', + dataIndex: 'name[index]', + key: 'name[index]', + align: "center", + }, + { + title: '车牌号', + dataIndex: 'licensePlateNumber', + key: 'licensePlateNumber', + align: "center", + }, + { + title: '入场时间', + dataIndex: 'entryTime', + key: 'entryTime', + align: "center", + render: (text, record, index) => <div style={{ width: '150px' }}>{text}</div> + }, + { + title: '出场时间', + dataIndex: 'exitTime', + key: 'exitTime', + align: "center", + render: (text, record, index) => <div style={{ width: '150px' }}>{text}</div> + }, + { + title: '停车时长', + dataIndex: 'parkingDuration', + key: 'parkingDuration', + align: "center", + }, + { + title: '欠费金额(元)', + dataIndex: 'arrearsAmount', + key: 'arrearsAmount', + align: "center", + }, + ] //所有检索条件 const ash = [ {//1 @@ -300,13 +393,13 @@ function ParkingOrderInquiry() { placeholder: "请输入操作人", }, {//26 - name: "t", + name: "road", type: "Input", label: "停车订单ID", placeholder: "停车订单ID", }, {//27 - name: "t", + name: "order_mount_down", type: "Input", label: "欠费区间", placeholder: "", @@ -315,7 +408,8 @@ function ParkingOrderInquiry() { name: "timePeriod", type: "RangePicker", label: "时间段", - defaultTitle: ['订单修改时间', '至'] + defaultTitle: ['订单修改时间', '至'], + defaultName: ['deal_time_start', 'deal_time_end'] // defaultValue: [moment().startOf("day"), moment()], }, {//29 @@ -338,6 +432,12 @@ function ParkingOrderInquiry() { }, ], }, + {//30 + name: "order_mount_up", + type: "Input", + label: "至", + placeholder: "", + }, ]; const [resultData, setResultData] = useState([]) const [ycddData, setYcddData] = useState([])//异常订单数据 @@ -351,28 +451,28 @@ function ParkingOrderInquiry() { const [tabKey, setTabKey] = useState("1"); function changeKey(key) { setTabKey(key); + setTabKeyChild('1'); } - - //基本信息查询 - function search(e) { - // if (!e.type) { - // e.type = 1 - // } - ajax({ - url: "/api/ope/car/list", - type: "post", - data: { ...e }, - }).then((res) => { - let { status, data, total } = res - if (status == 20000) { - setResultData(data) - setTotal(total) - } else { - message.error(res.message) - } - }) + const [tabKeyChild, setTabKeyChild] = useState("1"); + function changeKeyChild(key) { + setTabKeyChild(key); + } + //限制条件 + const limitCon = (e) => { + if ((e.order_mount_down && isNaN(parseFloat(e.order_mount_down)))) { + message.error('欠费金额上下限值必须为数字') + return 1 + } + if (e.order_mount_up && isNaN(parseFloat(e.order_mount_up))) { + message.error('欠费金额上下限值必须为数字') + return 1 + } + if (e && parseFloat(e.order_mount_down) > parseFloat(e.order_mount_up)) { + console.log(typeof e.order_mount_down, e.order_mount_up, e.order_mount_down > e.order_mount_up) + message.error('欠费金额上限须大于下限') + return 1 + } } - //详情其他模块查询 function searchOther(e) { var url = '' @@ -380,21 +480,21 @@ function ParkingOrderInquiry() { case "1": url = "/api/fin/order_search/park_order"//支付订单查询 break - case "2.1": - url = "/api/fin/order_search/arrears_order"//欠费订单查询 - break - case "2.2": - url = ""// - break - case "2.3": - url = ""// + case "2": + if (tabKeyChild == '1') { + url = "/api/fin/order_search/arrears_order"//欠费订单查询 + } else if (tabKeyChild == '2') { + url = "/api/fin/order_search/arrears_order_update_list"//订单修改记录 + } else { + url = ""//历史欠费修改记录 + } break case "3": - url = ""// + url = ""//预付订单插叙 break default: break } - if (tabKey == '3' && e && !e?.type) { + if ((tabKey == '2') && e && !e?.type) { e.type = 1 } ajax({ @@ -506,13 +606,15 @@ function ParkingOrderInquiry() { ); } //其他页面渲染 - function renderTable(columns, arr, dataSource) { + function renderTable(columns, arr, dataSource, exportUrl, limit) { return ( <TableModule columns={columns} tableData={dataSource} formSearch={arr} total={total} + exportUrl={exportUrl} + limitCon={limit ? limitCon : null} search={searchOther} /> ); @@ -638,36 +740,44 @@ function ParkingOrderInquiry() { </div> - useEffect(() => { - searchOther() - }, [tabKey]) - //欠费订单查询渲染 const orderInfo = <> - <Tabs > + <Tabs activeKey={tabKeyChild} onChange={changeKeyChild}> <Tabs.TabPane tab="欠费订单查询" key="1"> - {renderTable( - createCol(['欠费订单ID', '停车订单ID', '区域', '商户名称', '停车场名称', '车场类型', '车牌号', '入场时间', '出场时间', '停车时长', '欠费金额(元)'], - ['merchantName', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 2.1), - [ash[25], ash[0], ash[1], ash[2], ash[3], ash[18], ash[5], ash[12], ash[26]], - resultData - )} + {/* {tabKeyChild == 1 ?renderTable( + createCol(['欠费订单ID', '停车订单ID', '区域', '商户名称', '停车场名称', '车场类型', '车牌号', '入场时间', '出场时间', '停车时长', '欠费金额(元)'], + ['order_id'], 0), + [ash[25], ash[0], ash[1], ash[2], ash[3], ash[18], ash[5], ash[12], ash[26]], + resultData + ):null} */} + { + tabKeyChild == 1 ? + <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} + exportUrl={'/api/fin/order_search/arrears_order_export'} + limitCon={limitCon} + search={searchOther} + /> : null + } </Tabs.TabPane> <Tabs.TabPane tab="订单修改记录" key="2"> - {renderTable( + {tabKeyChild == 2 ? renderTable( createCol(['停车订单ID', '欠费金额(元)', '订单修改时间', '修改原因', '处理记录ID', '区域', '商户名称', '停车场名称', '车场类型', '车牌号', '入场时间', '出场时间', '停车时长'], - ['merchantName', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 0), - [ash[25], ash[1], ash[2], ash[18], ash[26], ash[5], ash[12], ash[27]], - resultData - )} + ['park_record_id', 'arrearsAmount', 'examine_time', 'update_reason', 'deal_record_id', 'area', 'merchantName', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', 'parkingDuration'], 0), + [ash[25], ash[1], ash[2], ash[18], ash[26], ash[29], ash[5], ash[12], ash[27], ash[28]], + resultData, '/api/fin/order_search/arrears_order_update_list_export', 1 + ) : null} </Tabs.TabPane> <Tabs.TabPane tab="历史欠费修改记录" key="3"> - {renderTable( + {tabKeyChild == 3 ? renderTable( createCol(['支付订单ID', '停车订单ID', '支付商户', '平台商户', '停车场', '泊位号', '车牌号', '入场时间', '计费时间', '停车时长', '应收金额', '优惠金额', '实付金额', '支付渠道', '支付设备', '操作人', '付款车场', '支付时间', '渠道流水号'], ['merchantName', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 4), [ash[2], ash[18], ash[24], ash[12]], resultData - )} + ) : null} </Tabs.TabPane> </Tabs> </> @@ -676,12 +786,12 @@ function ParkingOrderInquiry() { <> <Tabs activeKey={tabKey} onChange={changeKey}> <Tabs.TabPane tab="支付订单查询" key="1"> - {renderTable( + {tabKey == 1 ? renderTable( createCol(['支付订单ID', '停车订单ID', '支付商户', '平台商户', '停车场', '泊位号', '车牌号', '入场时间', '计费时间', '停车时长', '应收金额', '优惠金额', '实付金额', '支付渠道', '支付设备', '操作人', '付款车场', '支付时间', '渠道流水号'], - ['order_id', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 1), + ['order_id', 'park_record_id', 'pay_store', 'operator', 'road_id', 'berth_id', 'plate', 'admission_time', 'charging_time', 'parking_duration', 'receivable_amount', 'discount_amount', 'paid_in_money', 'payment_channels', 'payment_equipment', 'dealer', 'pay_road', 'pay_time', 'third_party_flow_id'], 1), [ash[19], ash[2], ash[18], ash[20], ash[21], ash[9], ash[10], ash[14], ash[15]], - resultData - )} + resultData, '/api/fin/order_search/park_order_export' + ) : null} </Tabs.TabPane> <Tabs.TabPane tab="欠费订单查询" key="2"> {orderInfo} @@ -745,7 +855,7 @@ function ParkingOrderInquiry() { </Button>]} > {/* {tkddModal} */} - {tabKey == '5' ? tkddModal : tabKey == '6' ? tckModal : tabKey == '7' ? cfkModal : null} + {/* {tabKey == '5' ? tkddModal : tabKey == '6' ? tckModal : tabKey == '7' ? cfkModal : null} */} </Modal> <Modal diff --git a/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx b/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx index 5b8e192..c5eaee2 100644 --- a/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx +++ b/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx @@ -679,29 +679,29 @@ function ProductOrderInquiry() { </div> - useEffect(() => { - searchOther() - }, [tabKey]) + // useEffect(() => { + // searchOther() + // }, [tabKey]) return ( <> <Tabs activeKey={tabKey} onChange={changeKey}> <Tabs.TabPane tab="停车卡订单" key="1"> - {renderTable( + {tabKey == 1 ? renderTable( createCol(['车牌号', '车牌颜色', '手机号', '商品名称', '实付金额', '支付渠道', '支付设备', '购买渠道', '支付时间', '订单状态', '渠道流水号'], ['merchantName', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 1), [ash[18], ash[4], ash[6], ash[7], ash[8], ash[9], ash[10], ash[15], ash[14]], resultData - )} + ) : null} </Tabs.TabPane> <Tabs.TabPane tab="错峰卡订单" key="2"> - {renderTable( + {tabKey == 2 ? renderTable( createCol(['序号', '停车场名称', '车牌号', '手机号', '订单金额', '支付方式', '渠道流水号', '同步MS状态', '订购时间'], - ['index', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'],2), + ['index', '', 'area', '', 'sectionName', '', 'licensePlateNumber', 'entryTime', 'exitTime', '', 'arrearsAmount'], 2), [ash[2], ash[4], ash[18], ash[11], ash[16], ash[14]], resultData - )} + ) : null} </Tabs.TabPane> {/* <Tabs.TabPane tab="预约订单" key="3"> diff --git a/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx b/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx index 5df9beb..2281839 100644 --- a/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx +++ b/src/pages/OperationCenter/CarMgm/CarInfo/loadable.jsx @@ -1103,9 +1103,9 @@ function CarInfo() { <Descriptions.Item label="有效时间">{ycddData.admission_time}</Descriptions.Item> </Descriptions> </div> - useEffect(() => { - searchOther() - }, [tabKey]) + // useEffect(() => { + // searchOther() + // }, [tabKey]) return ( <> @@ -1120,7 +1120,7 @@ function CarInfo() { pageName={'carInfo'} /> : <> - <div className="back-btn" onClick={() => { setTag('1');setTabKey('1') }}>返回</div> + <div className="back-btn" onClick={() => { setTag('1'); setTabKey('1') }}>返回</div> <Tabs activeKey={tabKey} onChange={changeKey}> <Tabs.TabPane tab="基本信息" key="1"> {renderRecord(detailData)} diff --git a/src/services/FinancialMgm/orderInquiry.js b/src/services/FinancialMgm/orderInquiry.js index e69de29..8a867b2 100644 --- a/src/services/FinancialMgm/orderInquiry.js +++ b/src/services/FinancialMgm/orderInquiry.js @@ -0,0 +1,22 @@ +import ajax from "@/config/ajax"; + +// 财务管理-修改查询-订单修改查询列表 +const getOrderChangeList = (params) => { + return ajax({ + url: "/api/fin/order_search/order_update_list", + type: "post", + data: params, + }); +}; +// 财务管理-修改查询-订单修改查询详情 +const getOrderChangeDetail = (params) => { + return ajax({ + url: "/api/fin/order_search/order_update_list_detail", + type: "post", + data: params, + }); + }; +export default { + getOrderChangeList, + getOrderChangeDetail, +} \ No newline at end of file