From 4e97415cb80ae4e7cbece0294c2d2fbb04972ba1 Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Fri, 30 Sep 2022 14:40:45 +0800
Subject: [PATCH 1/6] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=BC=80=E5=A7=8B=20?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/ConfirmConfig/index.jsx | 155 +++++++-----------
.../components/StepsButton/index.jsx | 54 +++++-
src/pages/quickStart/index.jsx | 57 +++++--
src/pages/quickStart/service.js | 8 +-
4 files changed, 160 insertions(+), 114 deletions(-)
diff --git a/src/pages/quickStart/components/ConfirmConfig/index.jsx b/src/pages/quickStart/components/ConfirmConfig/index.jsx
index 259235b..24ef9d5 100644
--- a/src/pages/quickStart/components/ConfirmConfig/index.jsx
+++ b/src/pages/quickStart/components/ConfirmConfig/index.jsx
@@ -1,121 +1,86 @@
import React, { useState, useEffect, useRef } from 'react';
-
+import ReactDOM from 'react-dom';
+import { OrganizationGraph } from '@ant-design/graphs';
+import { nanoid } from 'nanoid'
import quickAPI from "../../service";
import indexStyles from "../../index.less";
import { message } from 'antd';
-
/**
* 确认配置
* @returns
*/
const ConfirmConfig = (props) => {
- const data = {
- id: 'root',
+ const [orgData, setOrgData] = useState({
+ // 门店
+ id: props.storeConfig.id,
value: {
- name: '股东会',
+ name: props.storeConfig.name,
},
+ // 设备
children: [
{
- id: 'joel',
+ id: props.deviceConfig.id,
value: {
- name: 'Joel Alan',
+ name: props.deviceConfig.deviceName,
},
- children: [
- {
- id: 'c1',
- value: {
- name: 'c1',
- },
- children: [
- {
- id: 'c1-1',
- value: {
- name: 'c1-1',
- },
- },
- {
- id: 'c1-2',
- value: {
- name: 'c1-2',
- },
- children: [
- {
- id: 'c1-2-1',
- value: {
- name: 'c1-2-1',
- },
- },
- {
- id: 'c1-2-2',
- value: {
- name: 'c1-2-2',
- },
- },
- ],
- },
- ],
- },
- {
- id: 'c2',
- value: {
- name: 'c2',
- },
+ //菜谱
+ children: []
+ }
+ ]
+ });
+
+
+ const initOrgData = () => {
+ const tempData = JSON.parse(JSON.stringify(orgData));
+ props.foodMenuConfig.forEach((foodMenu, foodMenuIndex) => {
+ tempData.children[0].children[foodMenuIndex] = {
+ id: nanoid(),
+ value: {
+ name: foodMenu.name,
+ },
+ children: []
+ }
+ foodMenu?.goodsConfig.forEach((foodItem, foodIndex) => {
+ tempData.children[0].children[foodMenuIndex].children[foodIndex] = {
+ id: nanoid(),
+ value: {
+ name: foodItem.name,
},
- {
- id: 'c3',
+ children: []
+ }
+ foodItem?.bomConfig.forEach((bomItem, bomIndex) => {
+ tempData.children[0].children[foodMenuIndex].children[foodIndex].children[bomIndex] = {
+ id: nanoid(),
value: {
- name: 'c3',
+ name: bomItem.name,
},
- children: [
- {
- id: 'c3-1',
- value: {
- name: 'c3-1',
- },
- },
- {
- id: 'c3-2',
- value: {
- name: 'c3-2',
- },
- children: [
- {
- id: 'c3-2-1',
- value: {
- name: 'c3-2-1',
- },
- },
- {
- id: 'c3-2-2',
- value: {
- name: 'c3-2-2',
- },
- },
- {
- id: 'c3-2-3',
- value: {
- name: 'c3-2-3',
- },
- },
- ],
- },
- {
- id: 'c3-3',
- value: {
- name: 'c3-3',
- },
- },
- ],
- },
- ],
- },
- ],
- };
+ children: []
+ }
+ bomItem?.materialConfig.forEach((materialItem, materialIndex) => {
+ tempData.children[0].children[foodMenuIndex].children[foodIndex].children[bomIndex].children[materialIndex] = {
+ id: nanoid(),
+ value: {
+ name: materialItem.name,
+ }
+ }
+ });
+ });
+ });
+ });
+ setOrgData(tempData);
+ }
+
+ useEffect(() => {
+ initOrgData();
+ }, []);
+
+
return <>
+
>
}
diff --git a/src/pages/quickStart/components/StepsButton/index.jsx b/src/pages/quickStart/components/StepsButton/index.jsx
index 69ba52d..d0c3d99 100644
--- a/src/pages/quickStart/components/StepsButton/index.jsx
+++ b/src/pages/quickStart/components/StepsButton/index.jsx
@@ -1,6 +1,8 @@
import { Button } from 'antd';
import styles from "./index.less";
import { notification } from 'antd';
+import quickAPI from "../../service";
+
const StepsButton = (props) => {
const onClickNext = () => {
@@ -93,6 +95,56 @@ const StepsButton = (props) => {
}
}
+ const onCreateConfig = async () => {
+ const jsonData = {
+ storeId: props.storeConfig.id,
+ deviceId: props.deviceConfig.id,
+ foodMenuList: []
+ };
+ props.foodMenuConfig.forEach((foodMenu, foodMenuIndex) => {
+ jsonData.foodMenuList[foodMenuIndex] = {
+ id: foodMenu.id,
+ goodsList: []
+ }
+ foodMenu?.goodsConfig.forEach((foodItem, foodIndex) => {
+ jsonData.foodMenuList[foodMenuIndex].goodsList[foodIndex] = {
+ id: foodItem.id,
+ price: foodItem.price,
+ vipPrice: foodItem.vipPrice,
+ isdevice: true,
+ BOMList: []
+ }
+ foodItem?.bomConfig.forEach((bomItem, bomIndex) => {
+ jsonData.foodMenuList[foodMenuIndex].goodsList[foodIndex].BOMList[bomIndex] = {
+ id: bomItem.id,
+ BatchingList: []
+ }
+ bomItem?.materialConfig.forEach((materialItem, materialIndex) => {
+ jsonData.foodMenuList[foodMenuIndex].goodsList[foodIndex].BOMList[bomIndex].BatchingList[materialIndex] = {
+ id: materialItem.id,
+ BomQty: 10
+ }
+ });
+ });
+ });
+ });
+ const response = await quickAPI.QuickStartAdd(jsonData);
+ if (response.data.isSuccess) {
+ notification.success({
+ message: '快速开始',
+ description: '配置成功!',
+ placement: 'topRight'
+ });
+ props.success();
+ } else {
+ notification.error({
+ message: '快速开始',
+ description: '配置失败!请重试!',
+ placement: 'topRight'
+ });
+ }
+ }
+
return
{props.current > 0 && (
-
- {stepsContent[current]}
-
-
-
-
-
-
-
+ {
+ isSuccess ?
+
+ {
+ setQuickStartObj({
+ storeConfig: {},
+ deviceConfig: {},
+ foodMenuConfig: [],
+ })
+ setCurrent(0);
+ setIsSuccess(false);
+ }}>
+ 快速开始
+
+ ]}
+ />
+
+ :
+ <>
+
+ {stepsContent[current]}
+
+
+
+
+ setIsSuccess(true)}>
+
+
+ >
+ }
}
diff --git a/src/pages/quickStart/service.js b/src/pages/quickStart/service.js
index 085a466..0f24e73 100644
--- a/src/pages/quickStart/service.js
+++ b/src/pages/quickStart/service.js
@@ -399,6 +399,12 @@ export default {
method: 'POST',
data: data,
});
- }
+ },
+ QuickStartAdd(data) {
+ return request('/kitchen/api/quickstart/add', {
+ method: 'POST',
+ data: data,
+ });
+ }
}
\ No newline at end of file
From 63d661ba634d3abe215094f7215e4db5ccae5f3f Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Fri, 30 Sep 2022 16:38:52 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BF=AB=E9=80=9F?=
=?UTF-8?q?=E5=BC=80=E5=A7=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../quickStart/components/BomConfig/index.jsx | 31 +++++++++++++++++--
.../components/GoodsConfig/index.jsx | 31 +++++++++++++++++--
.../components/MaterialConfig/index.jsx | 31 +++++++++++++++++--
3 files changed, 87 insertions(+), 6 deletions(-)
diff --git a/src/pages/quickStart/components/BomConfig/index.jsx b/src/pages/quickStart/components/BomConfig/index.jsx
index f400b97..ece69cd 100644
--- a/src/pages/quickStart/components/BomConfig/index.jsx
+++ b/src/pages/quickStart/components/BomConfig/index.jsx
@@ -482,9 +482,36 @@ const BomConfig = (props) => {
columns={columnsChoose}
rowSelection={{
type: 'checkbox',
+ onSelect: (record, selected) => {
+ const currentSelectedRows = JSON.parse(JSON.stringify(selectedRows));
+ const currentSelectedRowKeys = JSON.parse(JSON.stringify(selectedRowKeys));
+ const findRowIndex = currentSelectedRows.findIndex(item => item.id === record.id);
+ const findKeysIndex = currentSelectedRowKeys.findIndex(item => item === record.id);
+ if (selected) {
+ if (findRowIndex < 0) {
+ currentSelectedRows.push(record);
+ }
+ if (findKeysIndex < 0) {
+ currentSelectedRowKeys.push(record.id);
+ }
+ } else {
+ if (findRowIndex > -1) {
+ currentSelectedRows.splice(findRowIndex, 1);
+ }
+ if (findKeysIndex > -1) {
+ currentSelectedRowKeys.splice(findKeysIndex, 1);
+ }
+ }
+ setSetSelectedRows(currentSelectedRows);
+ setSelectRowKeys(currentSelectedRowKeys);
+ },
onChange: (selectedRowKeys, selectedRows) => {
- setSelectRowKeys(selectedRowKeys);
- setSetSelectedRows(selectedRows);
+ if (selectedRowKeys.length === 0) {
+ setSelectRowKeys([]);
+ }
+ if (selectedRows.length === 0) {
+ setSetSelectedRows([]);
+ }
},
selectedRowKeys: selectedRowKeys
}}
diff --git a/src/pages/quickStart/components/GoodsConfig/index.jsx b/src/pages/quickStart/components/GoodsConfig/index.jsx
index 69cda87..94cd8f1 100644
--- a/src/pages/quickStart/components/GoodsConfig/index.jsx
+++ b/src/pages/quickStart/components/GoodsConfig/index.jsx
@@ -745,9 +745,36 @@ const GoodsConfig = (props) => {
columns={columnsChoose}
rowSelection={{
type: 'checkbox',
+ onSelect: (record, selected) => {
+ const currentSelectedRows = JSON.parse(JSON.stringify(selectedRows));
+ const currentSelectedRowKeys = JSON.parse(JSON.stringify(selectedRowKeys));
+ const findRowIndex = currentSelectedRows.findIndex(item => item.id === record.id);
+ const findKeysIndex = currentSelectedRowKeys.findIndex(item => item === record.id);
+ if (selected) {
+ if (findRowIndex < 0) {
+ currentSelectedRows.push(record);
+ }
+ if (findKeysIndex < 0) {
+ currentSelectedRowKeys.push(record.id);
+ }
+ } else {
+ if (findRowIndex > -1) {
+ currentSelectedRows.splice(findRowIndex, 1);
+ }
+ if (findKeysIndex > -1) {
+ currentSelectedRowKeys.splice(findKeysIndex, 1);
+ }
+ }
+ setSetSelectedRows(currentSelectedRows);
+ setSelectRowKeys(currentSelectedRowKeys);
+ },
onChange: (selectedRowKeys, selectedRows) => {
- setSelectRowKeys(selectedRowKeys);
- setSetSelectedRows(selectedRows);
+ if (selectedRowKeys.length === 0) {
+ setSelectRowKeys([]);
+ }
+ if (selectedRows.length === 0) {
+ setSetSelectedRows([]);
+ }
},
selectedRowKeys: selectedRowKeys
}}
diff --git a/src/pages/quickStart/components/MaterialConfig/index.jsx b/src/pages/quickStart/components/MaterialConfig/index.jsx
index 8c578cf..173001f 100644
--- a/src/pages/quickStart/components/MaterialConfig/index.jsx
+++ b/src/pages/quickStart/components/MaterialConfig/index.jsx
@@ -683,9 +683,36 @@ const MaterialConfig = (props) => {
columns={columnsChoose}
rowSelection={{
type: 'checkbox',
+ onSelect: (record, selected) => {
+ const currentSelectedRows = JSON.parse(JSON.stringify(selectedRows));
+ const currentSelectedRowKeys = JSON.parse(JSON.stringify(selectedRowKeys));
+ const findRowIndex = currentSelectedRows.findIndex(item => item.id === record.id);
+ const findKeysIndex = currentSelectedRowKeys.findIndex(item => item === record.id);
+ if (selected) {
+ if (findRowIndex < 0) {
+ currentSelectedRows.push(record);
+ }
+ if (findKeysIndex < 0) {
+ currentSelectedRowKeys.push(record.id);
+ }
+ } else {
+ if (findRowIndex > -1) {
+ currentSelectedRows.splice(findRowIndex, 1);
+ }
+ if (findKeysIndex > -1) {
+ currentSelectedRowKeys.splice(findKeysIndex, 1);
+ }
+ }
+ setSetSelectedRows(currentSelectedRows);
+ setSelectRowKeys(currentSelectedRowKeys);
+ },
onChange: (selectedRowKeys, selectedRows) => {
- setSelectRowKeys(selectedRowKeys);
- setSetSelectedRows(selectedRows);
+ if (selectedRowKeys.length === 0) {
+ setSelectRowKeys([]);
+ }
+ if (selectedRows.length === 0) {
+ setSetSelectedRows([]);
+ }
},
selectedRowKeys: selectedRowKeys
}}
From b37cb04b418e79b32fa6e49e9181bdbd82595ed1 Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Wed, 5 Oct 2022 09:49:26 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E7=89=A9=E6=96=99=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E6=95=B0=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/MaterialConfig/index.jsx | 86 ++++++++++++++++++-
.../components/StepsButton/index.jsx | 13 ++-
src/pages/quickStart/index.jsx | 23 ++++-
3 files changed, 117 insertions(+), 5 deletions(-)
diff --git a/src/pages/quickStart/components/MaterialConfig/index.jsx b/src/pages/quickStart/components/MaterialConfig/index.jsx
index 173001f..2858ecd 100644
--- a/src/pages/quickStart/components/MaterialConfig/index.jsx
+++ b/src/pages/quickStart/components/MaterialConfig/index.jsx
@@ -202,6 +202,11 @@ const MaterialConfig = (props) => {
],
},
},
+ {
+ title: '物料数量',
+ dataIndex: 'BomQty',
+ width: 50
+ },
{
title: '操作',
dataIndex: 'option',
@@ -218,6 +223,13 @@ const MaterialConfig = (props) => {
}}
>
移除物料
+ ,
+ {
+ editMaterialForm.setFieldsValue(record);
+ setIsModalEditMaterial(true);
+ }}>
+ 设置数量
],
},
@@ -256,7 +268,11 @@ const MaterialConfig = (props) => {
}
const findBom = bomDropDown.find(item => item.id === currentSelectedBom);
if (findBom) {
- props.onMaterialRelationBom(findBom.id, selectedRows);
+ const temp = JSON.parse(JSON.stringify(selectedRows));
+ temp.forEach(item => {
+ item.BomQty = 0;
+ });
+ props.onMaterialRelationBom(findBom.id, temp);
setSelectRowKeys([]);
setSetSelectedRows([]);
}
@@ -271,6 +287,12 @@ const MaterialConfig = (props) => {
}
}
+ /**
+ * 更新物料信息
+ */
+ const [isModalEditMaterial, setIsModalEditMaterial] = useState(false);
+ const [editMaterialForm] = Form.useForm();
+
useEffect(() => {
onFetchMaterialTypeList();
onFetchMaterialUnit();
@@ -630,7 +652,7 @@ const MaterialConfig = (props) => {
- setShowMenuDrawer(false)} visible={showMenuDrawer}>
+ setShowMenuDrawer(false)} visible={showMenuDrawer}>
当前配方:
@@ -721,7 +743,67 @@ const MaterialConfig = (props) => {
确定关联
+
setIsModalEditMaterial(false)}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确定
+
+
+
+
>
}
diff --git a/src/pages/quickStart/components/StepsButton/index.jsx b/src/pages/quickStart/components/StepsButton/index.jsx
index d0c3d99..dced2c5 100644
--- a/src/pages/quickStart/components/StepsButton/index.jsx
+++ b/src/pages/quickStart/components/StepsButton/index.jsx
@@ -86,8 +86,17 @@ const StepsButton = (props) => {
});
return;
}
+ for(let n = 0; n < materialList.length; n++) {
+ if (!materialList[n].BomQty) {
+ notification.error({
+ message: '物料配置出错',
+ description: `请为物料【${materialList[n].name}】设置数量!`,
+ placement: 'topRight'
+ });
+ return;
+ }
+ }
}
-
}
}
props.next();
@@ -122,7 +131,7 @@ const StepsButton = (props) => {
bomItem?.materialConfig.forEach((materialItem, materialIndex) => {
jsonData.foodMenuList[foodMenuIndex].goodsList[foodIndex].BOMList[bomIndex].BatchingList[materialIndex] = {
id: materialItem.id,
- BomQty: 10
+ BomQty: materialItem.BomQty
}
});
});
diff --git a/src/pages/quickStart/index.jsx b/src/pages/quickStart/index.jsx
index 487e7ff..7b3edb2 100644
--- a/src/pages/quickStart/index.jsx
+++ b/src/pages/quickStart/index.jsx
@@ -93,6 +93,27 @@ const QuickStart = () => {
});
}
+ /**
+ * 更新物料信息
+ * @param {*} bomId
+ * @param {*} material
+ */
+ const onUpdateMaterial = (bomId, material) => {
+ const tempQuick = JSON.parse(JSON.stringify(quickStartObj));
+ tempQuick.foodMenuConfig.forEach(findFoodMenu => {
+ findFoodMenu.goodsConfig.forEach(findGoods => {
+ const findBom = findGoods.bomConfig.find(item => item.id === bomId);
+ if (findBom) {
+ const findMaterial = findBom.materialConfig.find(materialItem => materialItem.id === material.id);
+ if (findMaterial) {
+ findMaterial.BomQty = Number.parseFloat(material.BomQty) || 0;
+ setQuickStartObj(tempQuick);
+ }
+ }
+ });
+ });
+ }
+
//下一步
const next = () => {
setCurrent(current + 1);
@@ -111,7 +132,7 @@ const QuickStart = () => {
,
,
,
-
,
+
,
];
From eb5037965d9b19f459195e371244bbcc44d1deef Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Wed, 5 Oct 2022 09:52:36 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/quickStart/components/MaterialConfig/index.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/quickStart/components/MaterialConfig/index.jsx b/src/pages/quickStart/components/MaterialConfig/index.jsx
index 2858ecd..1aae0a5 100644
--- a/src/pages/quickStart/components/MaterialConfig/index.jsx
+++ b/src/pages/quickStart/components/MaterialConfig/index.jsx
@@ -757,8 +757,8 @@ const MaterialConfig = (props) => {
remember: true,
}}
onFinish={(values) => {
- setIsModalEditMaterial(false);
props.onUpdateMaterial(currentSelectedBom, values);
+ setIsModalEditMaterial(false);
}}
autoComplete="off"
>
From ad22980cc8d8eeed7ab18398b358e93040c8808f Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Wed, 5 Oct 2022 17:55:41 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=9A=E5=91=98?=
=?UTF-8?q?=E8=B4=A6=E6=88=B7=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/card/memberAccount/index.jsx | 118 ++++++++++++++++--------
src/pages/card/memberAccount/index.less | 6 ++
src/pages/card/service.js | 12 +++
3 files changed, 99 insertions(+), 37 deletions(-)
diff --git a/src/pages/card/memberAccount/index.jsx b/src/pages/card/memberAccount/index.jsx
index 4d2e66a..0a73191 100644
--- a/src/pages/card/memberAccount/index.jsx
+++ b/src/pages/card/memberAccount/index.jsx
@@ -1,7 +1,7 @@
import React, { useRef, useState, useEffect } from "react";
import styles from "./index.less";
import { PageContainer } from '@ant-design/pro-layout';
-import { PlusOutlined, UserOutlined } from '@ant-design/icons';
+import { UserOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table';
import { Avatar, message, Modal, Table } from 'antd';
import cardAPI from "../service";
@@ -28,6 +28,10 @@ const memberAccount = () => {
const [consPageSize, setConsPageSize] = useState(10);
const [consTotal, setConsTotal] = useState(0);
+ const [expendTotalCount, setExpendTotalCount] = useState(0);
+ const [personTotalcCount, setPersonTotalcCount] = useState(0);
+ const [dateRange, setDateRange] = useState();
+
/**
* 获取账户消费、充值记录
* @param {*} record
@@ -40,6 +44,10 @@ const memberAccount = () => {
"memberCardId": "",
"type": type
}
+ if (dateRange) {
+ jsonData.startTime = dateRange[0];
+ jsonData.endTime = dateRange[1];
+ }
const response = await cardAPI.GetMemberAccountCardConsRecord(jsonData);
setCurrentOption({
functionName: 'onFetchAccountConsRecord',
@@ -67,6 +75,10 @@ const memberAccount = () => {
"memberCardId": record.id,
"type": type
}
+ if (dateRange) {
+ jsonData.startTime = dateRange[0];
+ jsonData.endTime = dateRange[1];
+ }
const response = await cardAPI.GetMemberAccountCardConsRecord(jsonData);
setCurrentOption({
functionName: 'onFetchCardConsRecord',
@@ -84,11 +96,18 @@ const memberAccount = () => {
//账号列表
const columns = [
+ {
+ title: '起止时间',
+ dataIndex: 'dateRange',
+ hideInTable: true,
+ valueType: 'dateRange'
+ },
{
title: '头像',
dataIndex: 'headImgUrl',
ellipsis: true,
width: 100,
+ hideInSearch: true,
align: 'center',
render: (text, record) => {
return
} src={record.headImgUrl} />
@@ -99,22 +118,30 @@ const memberAccount = () => {
dataIndex: 'name',
ellipsis: true,
},
+ {
+ title: '卡号',
+ dataIndex: 'memberCardNum',
+ ellipsis: true,
+ },
{
title: '联系方式',
dataIndex: 'memberPhone',
ellipsis: true,
+ hideInSearch: true,
},
{
title: '余额',
dataIndex: 'money',
+ hideInSearch: true,
},
+
{
title: '操作',
valueType: 'option',
key: 'option',
render: (text, record) => [
onFetchAccountConsRecord(record, -1)}>账户消费记录,
-
onFetchAccountConsRecord(record, 1)}>账户充值记录,
+ //
onFetchAccountConsRecord(record, 1)}>账户充值记录,
],
},
];
@@ -175,7 +202,7 @@ const memberAccount = () => {
key: 'option',
render: (text, record) => [
onFetchCardConsRecord(record, -1)}>会员卡消费记录,
-
onFetchCardConsRecord(record, 1)}>会员卡充值记录,
+ //
onFetchCardConsRecord(record, 1)}>会员卡充值记录,
],
}
];
@@ -201,33 +228,33 @@ const memberAccount = () => {
}
},
- {
- title: '之前余额',
- dataIndex: 'beforeMoney',
- render: (_, record) => {
- return
- {record.beforeMoney}
-
- }
- },
- {
- title: '消费金额',
- dataIndex: 'money',
- render: (_, record) => {
- return
- {record.money}
-
- }
- },
- {
- title: '之后余额',
- dataIndex: 'afterMoney',
- render: (_, record) => {
- return
- {record.afterMoney}
-
- }
- }
+ // {
+ // title: '之前余额',
+ // dataIndex: 'beforeMoney',
+ // render: (_, record) => {
+ // return
+ // {record.beforeMoney}
+ //
+ // }
+ // },
+ // {
+ // title: '消费金额',
+ // dataIndex: 'money',
+ // render: (_, record) => {
+ // return
+ // {record.money}
+ //
+ // }
+ // },
+ // {
+ // title: '之后余额',
+ // dataIndex: 'afterMoney',
+ // render: (_, record) => {
+ // return
+ // {record.afterMoney}
+ //
+ // }
+ // }
];
useEffect(() => {
@@ -243,17 +270,35 @@ const memberAccount = () => {
消费次数{expendTotalCount},消费人数{personTotalcCount}
}
columns={columns}
actionRef={actionRef}
expandable={{
expandedRowRender: record => expandedRowRender(record)
}}
request={
- async () => {
- const response = await cardAPI.GetMemberAccountPageList({
- current,
- pageSize
- });
+ async (values) => {
+ if (values.memberCardNum) {
+ values.cardNum = values.memberCardNum;
+ }
+ if (values.dateRange) {
+ setDateRange(values.dateRange);
+ const response = await cardAPI.GetMemberAccountRecordTotal({
+ startTime: values.dateRange[0],
+ endTime: values.dateRange[1]
+ });
+ if (response.statusCode === 200) {
+ setExpendTotalCount(response.data.expendTotalCount);
+ setPersonTotalcCount(response.data.personTotalcCount);
+ }
+ } else {
+ setDateRange(null);
+ setExpendTotalCount(0);
+ setPersonTotalcCount(0);
+ }
+ delete values.dateRange;
+ delete values.memberCardNum;
+ const response = await cardAPI.GetMemberAccountPageList(values);
setTotal(response.data.data);
return {
data: response.data.data,
@@ -267,7 +312,6 @@ const memberAccount = () => {
type: 'multiple',
}}
rowKey="id"
- search={false}
options={{
setting: {
listsHeight: 400,
@@ -280,7 +324,7 @@ const memberAccount = () => {
dateFormatter="string"
headerTitle="储值卡账户管理"
/>
- {setIsModalOpen(false); setConsCurrent(1)}}>
+ { setIsModalOpen(false); setConsCurrent(1) }}>
Date: Wed, 5 Oct 2022 18:19:56 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=82=A8=E5=80=BC?=
=?UTF-8?q?=E5=8D=A1=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/card/storedValueCard/index.jsx | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/pages/card/storedValueCard/index.jsx b/src/pages/card/storedValueCard/index.jsx
index 9d60f59..0617e34 100644
--- a/src/pages/card/storedValueCard/index.jsx
+++ b/src/pages/card/storedValueCard/index.jsx
@@ -128,6 +128,7 @@ const storedValueCard = () => {
title: '会员名称',
dataIndex: 'memberName',
ellipsis: true,
+ hideInSearch: true
},
{
title: '会员头像',
@@ -135,6 +136,7 @@ const storedValueCard = () => {
ellipsis: true,
width: 100,
align: 'center',
+ hideInSearch: true,
render: (text, record) => {
return } src={record.headImgUrl} />
}
@@ -143,11 +145,13 @@ const storedValueCard = () => {
title: '会员电话',
dataIndex: 'phone',
ellipsis: true,
+ hideInSearch: true,
},
{
title: '状态',
dataIndex: 'state',
valueType: 'select',
+ hideInSearch: true,
valueEnum: {
0: {
text: '禁用',
@@ -171,6 +175,7 @@ const storedValueCard = () => {
title: '类型',
dataIndex: 'type',
valueType: 'select',
+ hideInSearch: true,
valueEnum: {
1: {
text: '人脸',
@@ -237,11 +242,8 @@ const storedValueCard = () => {
columns={columns}
actionRef={actionRef}
request={
- async () => {
- const response = await cardAPI.GetMemberCardPageList({
- current,
- pageSize
- });
+ async (values) => {
+ const response = await cardAPI.GetMemberCardPageList(values);
return {
data: response.data.data,
success: true,
@@ -254,7 +256,6 @@ const storedValueCard = () => {
type: 'multiple',
}}
rowKey="id"
- search={false}
options={{
setting: {
listsHeight: 400,