diff --git a/src/assets/images/no-data-sel.png b/src/assets/images/no-data-sel.png new file mode 100644 index 0000000..96c7ad8 Binary files /dev/null and b/src/assets/images/no-data-sel.png differ diff --git a/src/config/character.config.js b/src/config/character.config.js index 581506a..f4d9e3a 100644 --- a/src/config/character.config.js +++ b/src/config/character.config.js @@ -295,10 +295,10 @@ export default { // 车场折扣--状态 YardDiscountType: [ { value: "0", label: "全部" }, - { value: "1", label: "进行中" }, - { value: "2", label: "未开始" }, - { value: "3", label: "已下架" }, - { value: "4", label: "已结束" }, + { value: "1", label: "未开始" }, + { value: "2", label: "进行中" }, + { value: "3", label: "已结束" }, + { value: "4", label: "已下架" }, ], PayDevice:[ { diff --git a/src/pages/FinancialMgm/ExceptionDeal/StartExceptionDeal/index.jsx b/src/pages/FinancialMgm/ExceptionDeal/StartExceptionDeal/index.jsx index 365642c..63e0913 100644 --- a/src/pages/FinancialMgm/ExceptionDeal/StartExceptionDeal/index.jsx +++ b/src/pages/FinancialMgm/ExceptionDeal/StartExceptionDeal/index.jsx @@ -446,8 +446,9 @@ function StartExceptionDeal() { current > moment(formData.end_time)} onChange={(date, time) => { setFormData({ ...formData, start_time: time || null }) @@ -459,8 +460,9 @@ function StartExceptionDeal() { current < moment(formData.start_time)} onChange={(date, time) => { setFormData({ ...formData, end_time: time || null }) diff --git a/src/pages/OperationCenter/OperationSales/YardDiscount/DebounceSelect.jsx b/src/pages/OperationCenter/OperationSales/YardDiscount/DebounceSelect.jsx index 9b70707..7528701 100644 --- a/src/pages/OperationCenter/OperationSales/YardDiscount/DebounceSelect.jsx +++ b/src/pages/OperationCenter/OperationSales/YardDiscount/DebounceSelect.jsx @@ -1,6 +1,8 @@ +import React, { useEffect, useMemo, useRef, useState } from 'react'; import { Select, Spin } from 'antd'; import _ from 'lodash'; -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import noDataImg from "@/assets/images/no-data-sel.png" + /** * @@ -51,7 +53,7 @@ const DebounceSelect = ({ filterOption={false} onSearch={debounceFetcher} showSearch={true} - notFoundContent={fetching ? : null} + notFoundContent={fetching ? : "暂无数据"} {...props} options={options} /> diff --git a/src/pages/OperationCenter/OperationSales/YardDiscount/index.scss b/src/pages/OperationCenter/OperationSales/YardDiscount/index.scss index cc40af5..72ee669 100644 --- a/src/pages/OperationCenter/OperationSales/YardDiscount/index.scss +++ b/src/pages/OperationCenter/OperationSales/YardDiscount/index.scss @@ -197,9 +197,12 @@ $color-primary: var(--color-primary); } } .yard-discount-sel-modal { - .ant-spin { - margin-left: 50%; - transform: translateX(-50%); + // .ant-spin { + // margin-left: 50%; + // transform: translateX(-50%); + // } + .ant-select-item-empty { + text-align: center; } } diff --git a/src/pages/OperationCenter/OperationSales/YardDiscount/loadable.jsx b/src/pages/OperationCenter/OperationSales/YardDiscount/loadable.jsx index 3b4c27d..abfd7f0 100644 --- a/src/pages/OperationCenter/OperationSales/YardDiscount/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/YardDiscount/loadable.jsx @@ -76,21 +76,21 @@ const YardDiscount = () => { render: (text, record, index) => { let content = '--' switch (text) { - case "0": + case 0: content = "全部" break; - case "1": - content = "进行中" - break; - case "2": + case 1: content = "未开始" break; - case "3": - content = "已下架" + case 2: + content = "进行中" break; - case "4": + case 3: content = "已结束" break; + case 4: + content = "已下架" + break; default: break; } @@ -135,18 +135,18 @@ const YardDiscount = () => { > 查看 - {record?.status == 1 ? + {record?.status == 2 ? { $deleteConfirm(record?.id, "下架") }} okText="确认" cancelText="取消">
下架
: - record?.status == 2 ? + record?.status == 1 ? <>
{ setModalData({ id: record?.id || "", - activity: record?.activity_id?.split() || [], + activity: record?.activity || "", road: record?.road_id?.split() || [], discount: record?.discount || "", start_time: record?.start_time || null, @@ -265,14 +265,14 @@ const YardDiscount = () => { // 新增及编辑 const $addEditSubmit = (data, type) => { - let activity = data?.activity?.length ? data?.activity?.join() : ""; let road = data?.road?.length ? data?.road?.join() : ""; - if(!activity) return message.error("请选择活动名称!"); + console.log(road); + if(!data?.activity) return message.error("请选择活动名称!"); if(!road) return message.error("请选择停车场名称!"); if(!data?.discount) return message.error("请输入折扣!"); if(!data?.start_time) return message.error("请选择开始时间!"); if(!data?.end_time) return message.error("请选择结束时间!"); - let _data = {...data, activity, road}; + let _data = {...data, road}; ajax.handleYardDiscount(_data, type).then((res) => { if (res.status === 20000 || res.status == 0) { message.success(res.message || `${type}成功`); @@ -316,7 +316,7 @@ const YardDiscount = () => { className="form-con" popupClassName="yard-discount-sel-modal" placeholder="请输入活动名称" - ajaxType="2" + ajaxType="4" mode="multiple" allowClear value={formData?.activity || []} @@ -337,7 +337,7 @@ const YardDiscount = () => { popupClassName="yard-discount-sel-modal" placeholder="请输入停车场名称" allowClear - ajaxType="4" + ajaxType="2" mode="multiple" value={formData?.road || []} fetchOptions={$fetchActivityList} @@ -438,24 +438,37 @@ const YardDiscount = () => {
- { - let value = newValue.slice(-1); - setModalData({ - ...modalData, - activity: value - }); - }} - /> + {modalVisible.title == "查看" ? + { + let value = newValue.slice(-1); + setModalData({ + ...modalData, + activity: value + }); + }} + /> : + { + setModalData({ + ...modalData, + activity: e.target?.value || "" + }) + }} + /> + }
@@ -463,18 +476,27 @@ const YardDiscount = () => { className="form-con" popupClassName="yard-discount-sel-modal" placeholder="请输入停车场名称" - ajaxType="4" + ajaxType="2" allowClear mode="multiple" + labelInValue disabled={modalVisible.title == "查看" ? true : false} value={modalData?.road || []} fetchOptions={$fetchActivityList} onChange={(newValue) => { let value = newValue.slice(-1); - setModalData({ - ...modalData, - road: value - }); + if(value?.length) { + setModalData({ + ...modalData, + road: value, + }); + } else { + setModalData({ + ...modalData, + road: [], + }); + } + }} />
@@ -487,7 +509,7 @@ const YardDiscount = () => { disabled={modalVisible.title == "查看" ? true : false} suffix="%" onChange={(e) =>{ - let onlyNumber = /^[1-9]*$/; + let onlyNumber = /^[0-9]*$/; if(!onlyNumber.test(e.target.value) || e.target.value.length > 2) { return message.error("折扣必须填1-99的整数"); }