diff --git a/config/routes.js b/config/routes.js
index dc3bf43..9845600 100644
--- a/config/routes.js
+++ b/config/routes.js
@@ -308,6 +308,19 @@ export default [
},
],
},
+ {
+ name: '优惠券管理',
+ icon: 'BankFilled',
+ path: '/shopmanage/coupon',
+ routes: [
+ {
+ name: '纸质优惠券管理',
+ icon: 'smile',
+ path: '/shopmanage/coupon/paperCoupon',
+ component: './shopmanage/coupon/paperCoupon',
+ }
+ ],
+ },
{
name: '门店会员管理',
icon: 'BankFilled',
diff --git a/src/pages/applet/basicconfiguration/index.jsx b/src/pages/applet/basicconfiguration/index.jsx
index ca4cf38..2b716e2 100644
--- a/src/pages/applet/basicconfiguration/index.jsx
+++ b/src/pages/applet/basicconfiguration/index.jsx
@@ -495,10 +495,12 @@ const Material = () => {
})()
}
-
+
+ >
+ )}
+ options={items}
+ >
+ {/* */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+ {
+ setvisiblegoods(false)
+ }} onOk={()=>{
+ var na="";
+ var naid="";
+ var money=0.00;
+ var storeid="";
+ checkgoods.forEach((item,index)=>{
+ na=na+item.goods_Name
+ naid=naid+item.goodsId;
+ money=item.price;
+ storeid=item.storeId;
+ if(index
+
+
+ >
+};
+
+export default CreateForm;
diff --git a/src/pages/shopmanage/coupon/goodsCoupon/components/GoodsList/index.jsx b/src/pages/shopmanage/coupon/goodsCoupon/components/GoodsList/index.jsx
new file mode 100644
index 0000000..7e7fb36
--- /dev/null
+++ b/src/pages/shopmanage/coupon/goodsCoupon/components/GoodsList/index.jsx
@@ -0,0 +1,140 @@
+import React, { useState, useEffect, useRef } from 'react';
+import ProTable from '@ant-design/pro-table';
+import { Form, Select,Card,Tabs,Pagination} from 'antd';
+const { TabPane } = Tabs;
+import {GetStoreGoods,GetStoreInfoPage} from "../../service";
+
+const key = 'message';
+
+const GoodsList = (props) => {
+ //编辑商品信息 form实例
+ const [dataLsit, SetDataLsit] = useState([]);
+ const [total, SetTotal] = useState(0);
+ const [loading, SetLoading] = useState(false);
+ const goodscolumns = [
+ {
+ title: '主键',
+ dataIndex: 'id',
+ hideInSearch: true,
+ hideInTable: true,
+ tip: '规则名称是唯一的 key',
+ },
+ {
+ title: '商品',
+ dataIndex: 'goods_Name',
+ valueType: 'textarea',
+ },
+ {
+ title: '商品价格',
+ dataIndex: 'price',
+ valueType: 'money',
+
+ },
+ {
+ title: '商品会员价格',
+ dataIndex: 'vipPrice',
+ valueType: 'money',
+
+ },
+
+ {
+ title: '是否设备制作',
+ dataIndex: 'isDevice',
+ valueEnum: {
+ 0: { text: '店铺', status: 'Processing' },
+ 1: { text: '设备', status: 'Success' },
+ },
+ },
+ {
+ title: '状态',
+ dataIndex: 'status',
+ valueEnum: {
+ 0: { text: '上架', status: 'Processing' },
+ 1: { text: '下架', status: 'Success' },
+ },
+ },
+ {
+ title: '估清',
+ dataIndex: 'stopSales',
+ valueEnum: {
+ 0: { text: '销售', status: 'Processing' },
+ 1: { text: '估清', status: 'Success' },
+ }
+ }
+ ];
+
+ const getStoreInfoPageInfo = async (page) => {
+ SetLoading(true);
+ try {
+ await GetStoreInfoPage({ current: page, pageSize: 10 }).then((r) => {
+ SetTotal(1);
+ SetDataLsit(r.data);
+ SetLoading(false);
+ });
+ } catch {
+ SetLoading(false);
+ }
+
+ }
+ const actionRef = useRef();
+ const goodsactionRef = useRef();
+ useEffect(() => {
+ getStoreInfoPageInfo(1);
+ }, []);
+ return <>
+
+ {
+ }}>
+ {dataLsit?.map((item) => {
+ return (
+
+ {
+ var data = [];
+ var total = 0;
+ params.StoreId = item.id;
+ await GetStoreGoods(params).then((r) => {
+ data = r.data?.data;
+ total = r.data?.total;
+ });
+ return {
+ data: data,
+ success: true,
+ total: total,
+ };
+ }}
+ rowSelection={{
+ type: "radio",
+ onChange: (_, selectedRows) => {
+ props.oncheck(selectedRows)
+ //setSelectedRows(selectedRows);
+ },
+ }}
+ />
+
+ );
+
+ })}
+
+ { getStoreInfoPageInfo(page) }}
+ showTotal={(total, range) => `总共 ${total} 条`}
+ defaultPageSize={10}
+ defaultCurrent={1}
+ />
+
+ >
+}
+
+export default GoodsList;
\ No newline at end of file
diff --git a/src/pages/shopmanage/coupon/goodsCoupon/index.jsx b/src/pages/shopmanage/coupon/goodsCoupon/index.jsx
new file mode 100644
index 0000000..6e0c767
--- /dev/null
+++ b/src/pages/shopmanage/coupon/goodsCoupon/index.jsx
@@ -0,0 +1,311 @@
+import React, { useState, useRef, useEffect } from 'react';
+import moment from 'moment';
+import ProTable, { TableDropdown } from '@ant-design/pro-table';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Select, Button, message, Drawer, Popconfirm,Modal } from 'antd';
+import CreateForm from './components/CreateForm';
+import {
+ GetGoodsCouponPgage,
+ AddGoodsCoupon,
+ DeleteGoodsCoupon,
+ UpdateGoodsCoupon,
+ GetPaperCouponType,
+ AddPaperCouponType
+} from './service';
+
+const Coupon = () => {
+ //绑定
+ const actionRef = useRef();
+ const [selectedRowsState, setSelectedRows] = useState([]);
+ /** 新建/更新窗口的弹窗 */
+ const [createModalVisible, handleModalVisible] = useState(false);
+ //记录分页列表
+ const [currentRow, setCurrentRow] = useState();
+ const key = 'coupon';
+ const [optyid, setOptyid] = useState();
+ const [items, setItems] = useState();
+ //初始化数据
+ useEffect(() => {
+ initcouponType()
+ }, []);
+ const initcouponType = async () => {
+ var data = await GetPaperCouponType();
+ var op=[]
+ data.data.map((item) => (
+ op.push({label:item.value,value:item.key})
+ ));
+ setItems(op)
+ };
+ //新增
+ const handleAdd = async (fields) => {
+ message.loading('正在添加...', key);
+ try {
+ if (fields.validEndTime < fields.validStartTime) {
+ message.error('开始时间不能大于结束时间');
+ return false;
+ }
+ await AddGoodsCoupon(JSON.stringify(fields)).then((r) => {
+ message.destroy(key);
+ if (r.data) {
+ message.success('添加成功');
+ } else {
+ message.error('添加失败请重试!');
+ }
+ });
+ //刷新数据
+ actionRef.current.reload();
+ return true;
+ } catch (error) {
+ message.destroy(key);
+ message.error('添加失败请重试!');
+ return false;
+ }
+ };
+
+ //删除(支持批量删除)
+ const handleRemove = async (value) => {
+ message.loading('正在更新...', key);
+ try {
+ await DeleteGoodsCoupon(value).then((r) => {
+ console.log(r)
+ message.destroy(key);
+ if (r.data) {
+ message.destroy(key);
+ message.success('更新成功');
+ } else {
+ message.error(r.errors);
+ }
+ });
+ //刷新数据
+ actionRef.current.reload();
+ return true;
+ } catch (error) {
+ message.destroy(key);
+ message.error('更新失败请重试!');
+ return false;
+ }
+ };
+
+ //修改
+ const handleUpdate = async (fields) => {
+ message.loading('正在修改...', key);
+ try {
+ if (fields.validEndTime < fields.validStartTime) {
+ message.error('开始时间不能大于结束时间');
+ return false;
+ }
+ await UpdateGoodsCoupon(JSON.stringify(fields)).then((r) => {
+ message.destroy(key);
+ if (r.data) {
+ message.success('修改成功');
+ } else {
+ message.error(JSON.sstringify(r.errors));
+ }
+ });
+ //刷新数据
+ actionRef.current.reload();
+ return true;
+ } catch (error) {
+ message.destroy(key);
+ message.error('修改失败请重试!');
+ return false;
+ }
+ };
+ const onchangevalue=(value)=>{
+ console.log(value)
+ setOptyid(value)
+ }
+ //table的展示列
+ const columns = [
+ {
+ title: '主键',
+ dataIndex: 'id',
+ tip: '规则名称是唯一的 key',
+ hideInSearch: true,
+ hideInTable: true,
+ },
+
+ {
+ title: '标题',
+ dataIndex: 'title',
+ valueType: 'textarea',
+ },
+ {
+ title: '店铺名称',
+ dataIndex: 'storeName',
+ valueType: 'textarea',
+ width: 120,
+ },
+ {
+ title: '商品名称',
+ dataIndex: 'goodsName',
+ valueType: 'textarea',
+ width: 120,
+ },
+ {
+ title: '优惠平台',
+ width: 90,
+ dataIndex: 'cTypeName',
+ key: 'cTypeName',
+ renderFormItem: () => (
+