diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index fc96151..ca8bb08 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -219,10 +219,10 @@ const TableModule = forwardRef((props, ref) => { function reset() { setAreaSelectedList([]) searchForm.resetFields(); - setFormData({ ...searchForm.getFieldsValue() }) - //search({ ...searchForm.getFieldsValue() }) - fetch() - + setFormData({ ...searchForm.getFieldsValue() }) + //search({ ...searchForm.getFieldsValue() }) + fetch() + } function cascaderChange(value, options) { let res = []; @@ -681,7 +681,13 @@ const TableModule = forwardRef((props, ref) => { link.href = res.data.url || res.data.export_url; link.target = "_blank"; // 打开新页面 link.click(); - setTipModal({ ...tipModal, visible: false }); + setTipModal({ + ...tipModal, visible: false, + filename: + pagename + + (new Date().getMonth() + 1).toString().padStart(2, "0") + + new Date().getDate(), + }); } else { message.error(res.message); } @@ -814,7 +820,13 @@ const TableModule = forwardRef((props, ref) => { setTipModal({ ...tipModal, visible: false })} + onCancel={() => setTipModal({ + ...tipModal, visible: false, + filename: + pagename + + (new Date().getMonth() + 1).toString().padStart(2, "0") + + new Date().getDate(), + })} title="提示" onOk={handleOk} > diff --git a/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx b/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx index 1e87f23..d4e6fb9 100644 --- a/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx +++ b/src/pages/FinancialMgm/OrderInquiry/ProductOrderInquiry/index.jsx @@ -12,16 +12,17 @@ import { Descriptions, Timeline, Popover, + InputNumber } from "antd"; +const { TextArea } = Input; import { Link } from "react-router-dom"; import moment from "moment"; -import ajax from '@/config/ajax.js' +import ajax from "@/services" import { TableModule } from "@/components"; import { dictionary } from "@/config/common.js"; +import utils from "../../../../config/utils"; import "./index.scss"; function ProductOrderInquiry() { - const [carId, setCarId] = useState() - //构建表头 const createCol = (label, name, type) => { label.length == name.length ? null : console.log('参数缺失', label.length, name.length) @@ -71,22 +72,12 @@ function ProductOrderInquiry() { textAlign: "center", }} > - + { searchDetail({id:record.id});setTkddVisible(true) }}> 查看 - - + + { setTkddVisible(true) }}> 修改 - + } trigger="click" @@ -136,60 +127,6 @@ function ProductOrderInquiry() { } return arr } - //基本信息检索条件 - const formSearch = [ - { - name: "carId", - type: "Input", - label: "车牌号", - placeholder: "请输入车牌号", - }, - { - name: "mobile", - type: "Input", - label: "会员手机号", - placeholder: "请输入会员手机号", - }, - { - name: "authState", - type: "Select", - label: "认证状态", - options: [ - { - label: "已认证", - value: 0, - }, - { - label: "未认证", - value: 1, - }, - - ], - }, - { - name: "bingState", - type: "Select", - label: "绑定状态", - options: [ - { - label: "已绑定", - value: 0, - }, - { - label: "未绑定", - value: 1, - }, - - ], - }, - { - name: "timePeriod", - type: "RangePicker", - label: "时间段", - defaultValue: [moment().subtract(1, "month"), moment()], - }, - ]; - //所有检索条件 const ash = [ {//1 @@ -475,35 +412,116 @@ function ProductOrderInquiry() { function changeKey(key) { setTabKey(key); } + // 添加弹框展示 + const [addVisible, setAddVisible] = useState(false) + // 添加订单 + const [addOrderData, setAddOrderData] = useState({ + plate: '', + plate_type: '', + phone: '', + name: '', + }) + // 弹框内容字段 + let modalParams = { + plate: '', + plate_type: '', + phone: '', + name: '', + } + // 添加和修改的标志 + const [actionType, setActionType] = useState(1) // 1为添加 2为修改 - //详情其他模块查询 + // 停车卡名字下拉 + const [cardNameSelect, setCardNameSelect] = useState([]) + // 详情数据列表的列 + const detailColumns = [ + { + title: '序号', + dataIndex: 'id', + key: 'id', + render: (_, record, index) => { + return ( + {index + 1} + ) + } + }, + { + title: '车牌号', + dataIndex: 'plate', + key: 'plate', + }, + { + title: '车牌颜色', + dataIndex: 'plate_type', + key: 'plate_type', + }, + { + title: '手机号', + dataIndex: 'phone', + key: 'phone', + }, + { + title: '绑定时间', + dataIndex: 'binding_time', + key: 'binding_time', + }, + { + title: '操作人', + dataIndex: 'user', + key: 'user', + }, + ] + //模块查询 function searchOther(e) { - var url = '' - switch (tabKey) { - case "1": - url = "/api/fin/order_search/parking_card_order_list"//停车卡订单 - break - case "2": - url = "/api/fin/order_search/staggered_parking_order_list"//错峰卡 - break - default: break + if (tabKey == "1") { + ajax.getProductOrderInquiryParking({ ...e }).then((res) => { + let { status, data, total } = res + if (status == 20000) { + if (data.list) { + setResultData(data.list) + setTotal(data.total) + } else { + setResultData(data) + setTotal(total) + } + } else { + setResultData([]) + message.error(res.message) + } + }) + } + if (tabKey == "2") { + ajax.getProductOrderInquiryStaggere({ ...e }).then((res) => { + let { status, data, total } = res + if (status == 20000) { + if (data.list) { + setResultData(data.list) + setTotal(data.total) + } else { + setResultData(data) + setTotal(total) + } + } else { + setResultData([]) + message.error(res.message) + } + }) } - ajax({ - url: url, - type: "post", - data: { ...e, carId: carId }, - }).then((res) => { + } + //详情 + function searchDetail(e) { + ajax.getProductOrderInquiryParkingDetail({ ...e }).then((res) => { let { status, data, total } = res if (status == 20000) { if (data.list) { - setResultData(data.list) + setYcddData(data.list) setTotal(data.total) } else { - setResultData(data) + setYcddData(data) setTotal(total) } } else { - setResultData([]) + setYcddData([]) message.error(res.message) } }) @@ -601,7 +619,7 @@ function ProductOrderInquiry() { let initFormData = type == "停车卡" ? { pn: 1, page_size: 15, - plate_number: '1', + plate_number: '', phone: '', goods_name: '', buy_channel: '', @@ -634,22 +652,22 @@ function ProductOrderInquiry() { total={total} diyButton={ type == "停车卡" ? - // - { setActionType(1); setAddVisible(true) }} + style={{ width: '100px' }} > 添加订单 - + + // + // 添加订单 + // : null } //initFormData={initFormData} @@ -664,123 +682,137 @@ function ProductOrderInquiry() { } //退款订单详情 const tkddModal =
-
退款订单:{ycddData?.refund_id}
+
订单信息
-
生成时间
{ycddData?.refund_time || "--"}
+
订单状态
{ycddData?.order_status || "--"}
+
+
+
支付时间
{ycddData.pay_time || "--"}
-
退款状态
{ycddData.refund_state || "--"}
+
车牌号
{ycddData.plate_number || "--"}
-
支付渠道
{ycddData.payment_channels || "--"}
+
车牌颜色
{ycddData.plate_type || "--"}
-
退款方式
{ycddData.refund_type || "--"}
+
购买渠道
{ycddData.buy_channel || "--"}
-
应退实付金额
{ycddData.refund_actual_amount || "--"}
+
实付金额
{ycddData.pay_amount || "--"}
-
已退实付金额
{ycddData.has_refund_actual_amount || "--"}
+
支付渠道
{ycddData.pay_channel || "--"}
-
应退优惠金额
{ycddData.refund_discount_amount || "--"}
+
支付设备
{ycddData.pay_device || "--"}
+ +
+
商品信息
+
-
已退优惠金额
{ycddData.has_refund_discount_amount || "--"}
+
商品名称
{ycddData?.goods_name || "--"}
-
退款尝试次数
{ycddData.try_count || "--"} - {timesVisible ? - { setTimesVisible(false) }}>收起 : - { setTimesVisible(true) }}>查看} -
+
商户名称
{ycddData?.store_name || "--"}
-
最近尝试时间
{ycddData.latest_try_time || "--"}
+
适用范围
{ycddData?.scope || "--"}
+
+
+
生效开始日期
{ycddData?.effective_start || "--"}
+
+
+
有效天数
{ycddData?.effective_days|| "--"}
+
+
+
生效结束日期
{ycddData?.effective_end || "--"}
-
- - - {timesVisible ? <> -
退款尝试详情
- : - <> -
支付订单:{ycddData.order_id}
-
-
-
平台商户
{ycddData.payment_operator_name}
-
-
-
生成时间
{ycddData.payment_create_time}
-
-
-
支付时间
{ycddData.pay_time}
-
-
-
支付渠道
{ycddData.payment_equipment}
-
-
-
优惠金额
{ycddData.discount_amount}
-
-
-
支付应用
{ycddData.payment_equipment}
-
-
-
实付金额
{ycddData.paid_in_money}
-
-
-
停车订单:{ycddData.park_record_id}
-
车厂详情
-
-
-
平台商户
{ycddData.payment_operator_name}
-
-
-
停车场名称
{ycddData?.road_name}
-
-
-
区域
{ycddData.area_name}
-
-
-
商户名称
{ycddData.park_operator_name}
-
-
-
泊位号
{ycddData.berth_code}
-
-
-
车场类型
{ycddData.road_type}
-
-
-
车辆详情
-
-
-
车牌号
{ycddData.plate_number}
-
-
-
停车时长
{ycddData.parking_duration}
-
-
-
入场时间
{ycddData.in_time}
-
-
-
出场时间
{ycddData.out_time}
-
-
-
入场记录来源
{ycddData.inSource}
-
-
-
出场记录来源
{ycddData.outSource}
-
-
-
证据图像
{ setEaeVisible(true) }}>查看
-
-
- } +
+
车辆绑定信息
+
+ + + // 停车卡名字下拉 + const handleCardName = (e) => { + let data = cardNameSelect.find(item => item.value == e) + console.log(data); + setAddOrderData({ + name: e, + effective_days: data.effective_days, + days: data.days, + scope: data.scope, + card_id: data.value + }) + } + // 停车卡名称下拉 + const getSelectCardData = () => { + ajax.selectCardOrder().then(res => { + if (res.status == 20000) { + setCardNameSelect(res.data) + } + }).catch(e => console.log(e)) + } + // 保存订单 + const placeSaveBtn = () => { + let data = { + ...addOrderData, + effective_days: undefined, + days: undefined, + scope: undefined, + name: undefined + } + let phoneReg = new RegExp(/^(?:(?:\+|00)86)?1[3-9]\d{9}$/) + + // if (addOrderData.plate != '' && !utils?.validationPlate(addOrderData.plate)) { + // message.error('请输入正确的车牌号') + // return + // } + // else + if (addOrderData.plate == '') { + message.error('请输入车牌号') + return + } else if (addOrderData.plate_type == '') { + message.error('请选择车牌颜色') + return + } else if (addOrderData.phone && !phoneReg.test(addOrderData.phone)) { + message.error('请输入正确的手机号') + return + } else if (addOrderData.name == '') { + message.error('请选择停车卡名称') + return + } else { + ajax.addCardOrder(data).then((res) => { + if (res.status === 20000) { + setAddVisible(false) + setAddOrderData(modalParams) + getData(formData) + message.success("添加成功") + } + }).catch(err => { + console.log(err); + }) + } + } + // 取消按钮 + const placeBtn = () => { + setAddVisible(false) + setAddOrderData(modalParams) + } + useEffect(() => { + //getData() + getSelectCardData() + }, []) return ( <> @@ -835,9 +867,126 @@ function ProductOrderInquiry() { 关闭窗口 ]} > - {/* {tkddModal} */} - {tabKey == '5' ? tkddModal : tabKey == '6' ? tckModal : tabKey == '7' ? cfkModal : null} + {tkddModal} + + +
+ {actionType == 1 ? '添加订单' : '修改订单'} +
+
+
+ * + + { setAddOrderData({ plate: e.target.value }) }} + /> +
+
+ * + + { setAddOrderData({ phone: e.target.value }) }} + /> +
+
+ * + +