diff --git a/src/App.css b/src/App.css
index c2e5fff9..9a82ff69 100644
--- a/src/App.css
+++ b/src/App.css
@@ -229,6 +229,11 @@
border: none;
}
+.table-box-app .zent-datepicker-trigger{
+ background: #f5f6f7 !important;
+ border: none;
+}
+
/* 日期整体样式 */
.zent-datepicker .zent-datepicker-trigger {
border-radius: 0 !important;
diff --git a/src/components/UseCouponAddEdit/index copy 2.jsx b/src/components/UseCouponAddEdit/index copy 2.jsx
new file mode 100644
index 00000000..be3afd47
--- /dev/null
+++ b/src/components/UseCouponAddEdit/index copy 2.jsx
@@ -0,0 +1,435 @@
+import React, { forwardRef, useImperativeHandle, useRef } from "react";
+import { useSetState } from "ahooks";
+import { FixedSizeList } from "react-window";
+import {
+ Card,
+ DateRangePicker,
+ Button,
+ LayoutRow as Row,
+ LayoutCol as Col,
+ LayoutGrid as Grids,
+ Select,
+} from "zent";
+import moment from "moment";
+
+import Ipt from "@/components/input/main";
+import Form from "@/components/form/main";
+import FormItem from "@/components/form-item/main";
+import Grid from "@/components/gird/main.js";
+
+import "./style.less";
+
+const tableColumn = [
+ {
+ title: "商品编号",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "商品名称",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "官方价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "合同单价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "库存数量",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "批次号",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "总预算",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "有效时间段",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "创建时间",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "类型",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "上游平台",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "操作",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+];
+
+const rules = {
+ name: [{ type: "required", message: "请输入批次名称" }],
+};
+
+const UseCouponAddEdit = forwardRef((props, ref) => {
+ /**
+ * type 入口类型 0优惠券新增 1计划、key批次 (是否显示两个字段)
+ */
+ const { type = 0 } = props;
+ const [state, setState] = useSetState({
+ setup1_title: "基本信息",
+ setup2_title: "发放规则",
+ setup3_title: "商品范围",
+ disabled: false,
+ model: {
+ name: "",
+ date_time: "",
+ },
+ tableData: [],
+ tableHeight: 500,
+ page: 1,
+ dataCount: 0,
+ rankoptions: [],
+ rank: [],
+ newGoodsBtnLoading: false,
+ newGoldLoading: false,
+ lodgingTable: true,
+ plan_OPTIONS: [
+ {
+ key: "1",
+ text: `plan 1`,
+ },
+ ],
+ key_OPTIONS: [
+ {
+ key: "1",
+ text: `key 1`,
+ },
+ ],
+ });
+
+ useImperativeHandle(ref, () => ({
+ submit: submit,
+ }));
+
+ const form_el = useRef(null);
+ const table_el = useRef(null);
+
+ const submit = () => {
+ let el = form_el.current.validator();
+ console.log("el =>", el);
+ };
+
+ const onReturn = () => {};
+ const onChangeCombinedDate = () => {};
+ const onDisabledRange = (date, type) => {
+ let disabled = false;
+ if (type == "end") {
+ disabled = moment(date.getTime()).add(1, "days") <= new Date().getTime();
+ }
+ if (type == "start") {
+ disabled = date.getTime() <= new Date().getTime();
+ }
+ return disabled;
+ };
+ const onPageChange = () => {};
+ const onCountChange = () => {};
+ const selectionFun = () => {};
+ const onRankChange = () => {};
+ const addProduct = () => {};
+ const renderOptionList = (options, renderOption) => {
+ return (
+
+ {({ index, style }) => (
+ {renderOption(options[index], index)}
+ )}
+
+ );
+ };
+ const plan_key_formEl = () => {
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+ };
+ return (
+
+
+
+
+
+
+
+
+ );
+});
+
+export default UseCouponAddEdit;
diff --git a/src/components/UseCouponAddEdit/index copy 3.jsx b/src/components/UseCouponAddEdit/index copy 3.jsx
new file mode 100644
index 00000000..1c7305b1
--- /dev/null
+++ b/src/components/UseCouponAddEdit/index copy 3.jsx
@@ -0,0 +1,272 @@
+import React, { forwardRef, useImperativeHandle, useRef } from "react";
+import { useSetState } from "ahooks";
+import { FixedSizeList } from "react-window";
+import {
+ Card,
+ DateRangePicker,
+ Button,
+ LayoutRow as Row,
+ LayoutCol as Col,
+ LayoutGrid as Grids,
+ Select,
+} from "zent";
+import moment from "moment";
+
+import Ipt from "@/components/input/main";
+import Form from "@/components/form/main";
+import FormItem from "@/components/form-item/main";
+import Grid from "@/components/gird/main.js";
+
+import "./style.less";
+
+const tableColumn = [
+ {
+ title: "商品编号",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "商品名称",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "官方价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "合同单价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "库存数量",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "批次号",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "总预算",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "有效时间段",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "创建时间",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "类型",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "上游平台",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "操作",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+];
+
+const rules = {
+ name: [{ type: "required", message: "请输入批次名称" }],
+};
+
+const UseCouponAddEdit = forwardRef((props, ref) => {
+ /**
+ * type 入口类型 0优惠券新增 1计划、key批次 (是否显示两个字段)
+ */
+ const { type = 0 } = props;
+ const [state, setState] = useSetState({
+ setup1_title: "基本信息",
+ setup2_title: "发放规则",
+ setup3_title: "商品范围",
+ disabled: false,
+ model: {
+ name: "",
+ date_time: "",
+ },
+ tableData: [],
+ tableHeight: 500,
+ page: 1,
+ dataCount: 0,
+ rankoptions: [],
+ rank: [],
+ newGoodsBtnLoading: false,
+ newGoldLoading: false,
+ lodgingTable: true,
+ plan_OPTIONS: [
+ {
+ key: "1",
+ text: `plan 1`,
+ },
+ ],
+ key_OPTIONS: [
+ {
+ key: "1",
+ text: `key 1`,
+ },
+ ],
+ });
+
+ useImperativeHandle(ref, () => ({
+ submit: submit,
+ }));
+
+ const form_el = useRef(null);
+ const table_el = useRef(null);
+
+ const submit = () => {
+ let el = form_el.current.validator();
+ console.log("el =>", el);
+ };
+
+ const onReturn = () => {};
+ const onChangeCombinedDate = () => {};
+ const onDisabledRange = (date, type) => {
+ let disabled = false;
+ if (type == "end") {
+ disabled = moment(date.getTime()).add(1, "days") <= new Date().getTime();
+ }
+ if (type == "start") {
+ disabled = date.getTime() <= new Date().getTime();
+ }
+ return disabled;
+ };
+ const onPageChange = () => {};
+ const onCountChange = () => {};
+ const selectionFun = () => {};
+ const onRankChange = () => {};
+ const addProduct = () => {};
+ const renderOptionList = (options, renderOption) => {
+ return (
+
+ {({ index, style }) => (
+ {renderOption(options[index], index)}
+ )}
+
+ );
+ };
+ const plan_key_formEl = () => {
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+ };
+ return (
+
+
+
+
+
+
+
+
+ );
+});
+
+export default UseCouponAddEdit;
diff --git a/src/components/UseCouponAddEdit/index copy.jsx b/src/components/UseCouponAddEdit/index copy.jsx
index db8091f6..c4ec4e2a 100644
--- a/src/components/UseCouponAddEdit/index copy.jsx
+++ b/src/components/UseCouponAddEdit/index copy.jsx
@@ -1,18 +1,21 @@
import React, { forwardRef, useImperativeHandle, useRef } from "react";
import { useSetState } from "ahooks";
+import { FixedSizeList } from "react-window";
import {
Card,
DateRangePicker,
Button,
LayoutRow as Row,
LayoutCol as Col,
- LayoutGrid as Grid,
+ LayoutGrid as Grids,
+ Select,
} from "zent";
import moment from "moment";
import Ipt from "@/components/input/main";
import Form from "@/components/form/main";
import FormItem from "@/components/form-item/main";
+import Grid from "@/components/gird/main.js";
import "./style.less";
@@ -24,6 +27,83 @@ const tableColumn = [
type: "normal",
width: "auto",
},
+ {
+ title: "商品名称",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "官方价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "合同单价",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "库存数量",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "批次号",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "总预算",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "有效时间段",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "创建时间",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "类型",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "上游平台",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
+ {
+ title: "操作",
+ name: "key_code",
+ prop: "key_code",
+ type: "normal",
+ width: "auto",
+ },
];
const rules = {
@@ -44,6 +124,23 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
tableHeight: 500,
page: 1,
dataCount: 0,
+ rankoptions: [],
+ rank: [],
+ newGoodsBtnLoading: false,
+ newGoldLoading: false,
+ lodgingTable: true,
+ plan_OPTIONS: [
+ {
+ key: "1",
+ text: `plan 1`,
+ },
+ ],
+ key_OPTIONS: [
+ {
+ key: "1",
+ text: `key 1`,
+ },
+ ],
});
useImperativeHandle(ref, () => ({
@@ -69,52 +166,81 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
const onPageChange = () => {};
const onCountChange = () => {};
const selectionFun = () => {};
- const addCouponBtn = () => {};
- const searchCallback = () => {};
+ const onRankChange = () => {};
+ const addProduct = () => {};
+ const renderOptionList = (options, renderOption) => {
+ return (
+
+ {({ index, style }) => (
+ {renderOption(options[index], index)}
+ )}
+
+ );
+ };
return (
-
+
{
countShow={false}
width={"520px"}
alignment={"left"}
+ unit="个"
/>
@@ -203,29 +330,48 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
countShow={false}
width={"520px"}
alignment={"left"}
+ unit="元"
/>
-
-
- setState({ key_word: e })}
- value={state.key_word}
- wordSearch={() => searchCallback()}
- icon="search"
- placeholder={"请输入批次号、名称、key批次名称、计划名称 进行搜索"}
- countShow={false}
- height={"36px"}
- width={"260px"}
- onClearItem={(e) =>
- setState({ key_word: "", isQuery: !state.isQuery })
- }
- alignment={"left"}
- />
-
+
+
+
+
{
+ /**
+ * type 入口类型 0优惠券新增 1计划、key批次 (是否显示两个字段)
+ */
+ const { type = 0 } = props;
const [state, setState] = useSetState({
setup1_title: "基本信息",
setup2_title: "发放规则",
@@ -117,7 +124,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
disabled: false,
model: {
name: "",
- time: "",
+ name1: "",
},
tableData: [],
tableHeight: 500,
@@ -128,7 +135,20 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
newGoodsBtnLoading: false,
newGoldLoading: false,
lodgingTable: true,
+ plan_OPTIONS: [
+ {
+ key: "1",
+ text: `plan 1`,
+ },
+ ],
+ key_OPTIONS: [
+ {
+ key: "1",
+ text: `key 1`,
+ },
+ ],
});
+ const [stateData, setStateData] = useState({ addNew: "", addNew1: "" });
useImperativeHandle(ref, () => ({
submit: submit,
@@ -137,7 +157,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
const form_el = useRef(null);
const table_el = useRef(null);
- const submit = () => {};
+ const submit = () => {
+ let el = form_el.current.validator();
+ console.log("el =>", el);
+ };
+
const onReturn = () => {};
const onChangeCombinedDate = () => {};
const onDisabledRange = (date, type) => {
@@ -153,232 +177,86 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
const onPageChange = () => {};
const onCountChange = () => {};
const selectionFun = () => {};
- const addCouponBtn = () => {};
- const searchCallback = () => {};
const onRankChange = () => {};
const addProduct = () => {};
+ const renderOptionList = (options, renderOption) => {
+ return (
+
+ {({ index, style }) => (
+ {renderOption(options[index], index)}
+ )}
+
+ );
+ };
+ const plan_key_formEl = () => {
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+ };
return (
-
diff --git a/src/pages/coupon/addEdit/index.jsx b/src/pages/coupon/addEdit/index.jsx
index e3610a89..d7f61c2d 100644
--- a/src/pages/coupon/addEdit/index.jsx
+++ b/src/pages/coupon/addEdit/index.jsx
@@ -6,7 +6,7 @@ import UseCouponAddEdit from "@/components/UseCouponAddEdit";
const CouponAddEdit = () => {
return (
-
+
);
};