From 0a2db13a1ef7372579d84f5b2db70eacb4538207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=87=E8=88=AA?= <740464440@qq.com> Date: Mon, 20 Nov 2023 14:51:32 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E6=96=B0=E5=BB=BA=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E8=90=A5=E9=94=80=E8=BD=A6=E5=9C=BA=E6=8A=98=E6=89=A3=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/character.config.js | 8 + src/pages/MerchantMgm/InvoiceConf/loadable.jsx | 4 +- .../OperationSales/YardDiscount/DebounceSelect.jsx | 56 +++ .../OperationSales/YardDiscount/index.scss | 299 +++++++++++- .../OperationSales/YardDiscount/loadable.jsx | 504 ++++++++++++++++++++- .../OperationCenter/OperationSales/index.js | 40 ++ 6 files changed, 893 insertions(+), 18 deletions(-) create mode 100644 src/pages/OperationCenter/OperationSales/YardDiscount/DebounceSelect.jsx diff --git a/src/config/character.config.js b/src/config/character.config.js index d71a6f2..e6e113e 100644 --- a/src/config/character.config.js +++ b/src/config/character.config.js @@ -292,6 +292,14 @@ export default { { value: 3, label: "社会类停车场" }, { value: 4, label: "智慧交通" }, ], + // 车场折扣--状态 + YardDiscountType: [ + { value: "0", label: "全部" }, + { value: "1", label: "进行中" }, + { value: "2", label: "未开始" }, + { value: "3", label: "已下架" }, + { value: "4", label: "已结束" }, + ], PayDevice:[ { value: '0', diff --git a/src/pages/MerchantMgm/InvoiceConf/loadable.jsx b/src/pages/MerchantMgm/InvoiceConf/loadable.jsx index 8f715a0..ee5ab5a 100644 --- a/src/pages/MerchantMgm/InvoiceConf/loadable.jsx +++ b/src/pages/MerchantMgm/InvoiceConf/loadable.jsx @@ -768,9 +768,9 @@ function InvoiceConf() { ]} > {setInvoicePlatform(e.target.value)}}> - 航信 + {/* 航信 */} 航信诺诺 - 百旺 + {/* 百旺 */} { + const [fetching, setFetching] = useState(false); + const [options, setOptions] = useState([]); + const fetchRef = useRef(0); + const debounceFetcher = useMemo(() => { + const $loadOptions = (value) => { + fetchRef.current += 1; + const fetchId = fetchRef.current; + setOptions([]); + setFetching(true); + fetchOptions({value, type: ajaxType}).then((newOptions) => { + if (fetchId !== fetchRef.current) { + // for fetch callback order + return; + } + setOptions(newOptions); + setFetching(false); + }); + }; + if(props?.value?.length) { + return _.debounce($loadOptions, 0) + }; + return _.debounce($loadOptions, debounceTimeout); + }, [fetchOptions, debounceTimeout]); + + useEffect(() => { + if(props?.value?.length) debounceFetcher(); + }, []); + return ( + setFormData({ ...formData, status: v || "0" })} + /> + +
+ + +
+ + +
+
+
+ row.park_id} + className="table" + dataSource={resultData?.list || []} + columns={tableColumns} + pagination={false} + loading={loading} + scroll={{ y: "calc(100vh - 265px)" }} + /> + `共 ${resultData.total || 0} 条`} + total={resultData.total} + current={formData.pn} + pageSize={formData.page_size} + pageSizeOptions={dictionary?.pageSizeOptions1} + onChange={$changePn} + /> + + + + { + setModalVisible({open: false, title: ""}); + setModalData(defaultModal); + }} + destroyOnClose={true} + footer={[ + modalVisible.title != "查看" ? + + : "", + , + ]} + > +
+
+ + { + let value = newValue.slice(-1); + setModalData({ + ...modalData, + activity: value + }); + }} + /> +
+
+ + { + let value = newValue.slice(-1); + setModalData({ + ...modalData, + road: value + }); + }} + /> +
+
+ + { + let onlyNumber = /^[1-9]\d*$/; + if(onlyNumber.test(e.target.value) || e.target.value.length > 2 ? true : false) { + return message.error("折扣必须填1-99的整数"); + } + setFormData({ + ...modalData, + discount: e.target.value || "" + }) + }} + /> +
+
+ + { + setModalData({ + ...modalData, + start_time: time[0], + end_time: time[1] + }) + }} + /> +
+
+
+ + ); } -export default YardDiscount; \ No newline at end of file +export default YardDiscount; diff --git a/src/services/OperationCenter/OperationSales/index.js b/src/services/OperationCenter/OperationSales/index.js index 8c80e06..ea4ec4a 100644 --- a/src/services/OperationCenter/OperationSales/index.js +++ b/src/services/OperationCenter/OperationSales/index.js @@ -98,6 +98,42 @@ const handleDiscountOperate = (p) => { data: p, }); }; +// 车场折扣-活动名称及停车场名称 +const fetchActivityData = (p) => { + return ajax({ + url: "/api/bpm/record/info", + type: "post", + data: p, + }); +}; + +// 车场折扣--表格数据 +const yardDiscountTableData = (p) => { + return ajax({ + url: "/api/ope/parkdiscount/list", + type: "post", + data: p, + }); +}; + +// 车场折扣--下架 +const yardDiscountDown = (p) => { + return ajax({ + url: "/api/ope/parkdiscount/down", + type: "post", + data: p, + }); +}; + +// 车场折扣--删除 +const yardDiscountDelete = (p) => { + return ajax({ + url: "/api/ope/parkdiscount/delete", + type: "post", + data: p, + }); +}; + // 优惠券管理-优惠券规则编辑 const handleCouponRulesEdit = (p) => { return ajax({ @@ -193,4 +229,8 @@ export default { handleOffExport, handleCouponDelete, getCountList, + fetchActivityData, + yardDiscountTableData, + yardDiscountDown, + yardDiscountDelete, };