From b53287f2744123b77c403452f72a4b3859edeb47 Mon Sep 17 00:00:00 2001 From: txb Date: Mon, 7 Nov 2022 11:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E6=B5=B7=E7=A7=91=E4=B8=80?= =?UTF-8?q?=E5=8D=A1=E9=80=9A):=20=E6=B5=B7=E7=A7=91=E4=B8=80=E5=8D=A1?= =?UTF-8?q?=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加菜品显示 --- src/pages/card/gate/components/gateSetUp.jsx | 140 ++++ .../card/gate/components/setGateFood.jsx | 143 ++++ src/pages/card/gate/index.jsx | 777 +++++++++--------- src/pages/card/service.js | 432 +++++----- 4 files changed, 921 insertions(+), 571 deletions(-) create mode 100644 src/pages/card/gate/components/gateSetUp.jsx create mode 100644 src/pages/card/gate/components/setGateFood.jsx diff --git a/src/pages/card/gate/components/gateSetUp.jsx b/src/pages/card/gate/components/gateSetUp.jsx new file mode 100644 index 0000000..9877c71 --- /dev/null +++ b/src/pages/card/gate/components/gateSetUp.jsx @@ -0,0 +1,140 @@ +import React, { useState, useRef, useEffect } from 'react'; +import { Upload, Modal, Transfer, Input, Search, Tag, List, Button, message } from 'antd'; +import ProTable, { TableDropdown } from '@ant-design/pro-table'; +import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; +import cardAPI from "../../service"; +import { UploadOutlined } from '@ant-design/icons'; + +const gateSetUp = (props) => { + const actionRef = useRef(); + const [oneWay, setOneWay] = useState(true); + const key = 'sendCoupon'; + // 右侧的集合 + const [targetKeys, setTargetKeys] = useState(); + //已选中 + const [selectedKeys, setSelectedKeys] = useState([]); + const [mockDataAll, setMockDataAll] = useState([]); + const [mockData, setMockData] = useState([]); + //初始化数据 + useEffect(() => { + const initCustomerInfo = async (value) => { + cardAPI.GetDicList('GateSetUp').then((r) => { + var arr = r.data; + var list = []; + if (r.succeeded) { + arr.forEach((item) => { + list.push({ + key: item.value, + title: item.value, + description: value, + disabled: false, + tag: item.value, + }); + }); + } + setMockData(list); + setMockDataAll(list); + }); + }; + initCustomerInfo(); + }, []); + + //选项在两栏之间转移时的回调函数 + const onChange = (nextTargetKeys, direction, moveKeys) => { + setTargetKeys(nextTargetKeys); + }; + + //选中项发生改变时的回调函数 + const onSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { + setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]); + }; + + //选择列表滚动滚动 + const onScroll = (direction, e) => {}; + const onSearch = async (direction, value) => { + if (direction == 'right') { + return; + } + + }; + + //正定会员发卷 + const sendCoupon = async (props) => { + if (targetKeys == undefined || targetKeys.length <= 0) { + //正定会员发卷 + message.error('选择'); + return; + } + message.loading('正在添加...', key); + try { + var list = []; + targetKeys.forEach((item) => { + list.push({ + Key:item, + GateId:props.values.id, + IsShow:true + }); + }); + cardAPI.AddGateSetUp(list).then((r) => { + message.destroy(key); + if (r.data) { + message.success('添加成功'); + setTargetKeys([]); + setSelectedKeys([]); + props.onCancel(); + } else { + message.error('添加失败'); + } + }); + return true; + } catch (error) { + console.log(error); + message.destroy(key); + message.error('添加请重试!'); + return false; + } + }; + return ( + { + setMockData(mockDataAll); + props.onCancel(); + }} + onOk={() => { + sendCoupon(props); + props.actionRef.current.reload(); + }} + > + + item.title} + pagination={{ pageSize: 8 }} + listStyle={{ + width: 500, + height: 400, + }} + /> + + + ); +}; +export default gateSetUp; diff --git a/src/pages/card/gate/components/setGateFood.jsx b/src/pages/card/gate/components/setGateFood.jsx new file mode 100644 index 0000000..2325a9a --- /dev/null +++ b/src/pages/card/gate/components/setGateFood.jsx @@ -0,0 +1,143 @@ +import React, { useState, useRef, useEffect } from 'react'; +import { Upload, Modal, Transfer, Input, Search, Tag, List, Button, message } from 'antd'; +import ProTable, { TableDropdown } from '@ant-design/pro-table'; +import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; +import cardAPI from "../../service"; +import { UploadOutlined } from '@ant-design/icons'; + +const setGateFood = (props) => { + const actionRef = useRef(); + const [oneWay, setOneWay] = useState(true); + const key = 'setGateFood'; + // 右侧的集合 + const [targetKeys, setTargetKeys] = useState(); + //已选中 + const [selectedKeys, setSelectedKeys] = useState([]); + const [mockDataAll, setMockDataAll] = useState([]); + const [mockData, setMockData] = useState([]); + //初始化数据 + useEffect(() => { + const initCustomerInfo = async (value) => { + cardAPI.GetGoodsByMenuIdPage({ + "current": 1, + "pageSize": 5000 + }).then((r) => { + var arr = r.data.data; + var list = []; + if (r.succeeded) { + arr.forEach((item) => { + list.push({ + key: item.id, + title: item.name, + description: value, + disabled: false, + tag: item.name, + }); + }); + } + setMockData(list); + setMockDataAll(list); + }); + }; + initCustomerInfo(); + }, []); + + //选项在两栏之间转移时的回调函数 + const onChange = (nextTargetKeys, direction, moveKeys) => { + setTargetKeys(nextTargetKeys); + }; + + //选中项发生改变时的回调函数 + const onSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { + setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]); + }; + + //选择列表滚动滚动 + const onScroll = (direction, e) => {}; + const onSearch = async (direction, value) => { + if (direction == 'right') { + return; + } + + }; + + //正定会员发卷 + const sendCoupon = async (props) => { + if (targetKeys == undefined || targetKeys.length <= 0) { + //正定会员发卷 + message.error('选择'); + return; + } + message.loading('正在添加...', key); + try { + var list = []; + targetKeys.forEach((item) => { + list.push({ + FoodId:item, + GateId:props.values.id, + FoodName:"" + }); + }); + cardAPI.AddGateFood(list).then((r) => { + message.destroy(key); + if (r.data) { + message.success('添加成功'); + setTargetKeys([]); + setSelectedKeys([]); + props.onCancel(); + } else { + message.error('添加失败'); + } + }); + return true; + } catch (error) { + console.log(error); + message.destroy(key); + message.error('添加请重试!'); + return false; + } + }; + return ( + { + setMockData(mockDataAll); + props.onCancel(); + }} + onOk={() => { + sendCoupon(props); + props.actionRef.current.reload(); + }} + > + + item.title} + pagination={{ pageSize: 8 }} + listStyle={{ + width: 500, + height: 400, + }} + /> + + + ); +}; +export default setGateFood; diff --git a/src/pages/card/gate/index.jsx b/src/pages/card/gate/index.jsx index 4e594b8..1e45d6f 100644 --- a/src/pages/card/gate/index.jsx +++ b/src/pages/card/gate/index.jsx @@ -8,6 +8,8 @@ import '@wangeditor/editor/dist/css/style.css' import { Editor, Toolbar } from '@wangeditor/editor-for-react' import axios from 'axios'; import cardAPI from "../service"; +import GateSetUp from './components/gateSetUp'; +import SetGateFood from './components/setGateFood'; /** @@ -15,392 +17,427 @@ import cardAPI from "../service"; * @returns */ const Gate = () => { - const actionRef = useRef(); - const [modalForm] = Form.useForm(); - const [isModalOpen, setIsModalOpen] = useState(false); - const [currentOption, setCurrentOption] = useState({ id: '' }); - const [storeList, setStoreList] = useState([]); - const [selectedStore, setSelectedStore] = useState(''); - const [current, setCurrent] = useState(1); - const [pageSize, setPageSize] = useState(10); + const actionRef = useRef(); + const [modalForm] = Form.useForm(); + const [isModalOpen, setIsModalOpen] = useState(false); + const [currentOption, setCurrentOption] = useState({ id: '' }); + const [GateSetUpIsVisible, GateSetUpVisible] = useState(false); + const [SetGateFoodIsVisible, setGateFoodVisible] = useState(false); + const [storeList, setStoreList] = useState([]); + const [selectedStore, setSelectedStore] = useState(''); + const [current, setCurrent] = useState(1); + const [pageSize, setPageSize] = useState(10); - // editor 实例 - const [editor, setEditor] = useState(null); - // 编辑器内容 - const [html, setHtml] = useState(''); - // 工具栏配置 - const toolbarConfig = {}; - // 编辑器配置 - const editorConfig = { - placeholder: '请输入大屏横幅...', - MENU_CONF: { - fontSize: { - fontSizeList: [ - '10px', '20px', '40px', '60px', '80px', '100px', '150px', '180px', '200px', - ] - }, - uploadImage: { - async customUpload(file, insertFn) { - // file 即选中的文件 - // 自己实现上传,并得到图片 url alt href - //覆盖action 上传之前获取上传地址 - let index = file.name.lastIndexOf("."); - let ext = file.name.substr(index + 1); - let fileData = null; - cardAPI.GetCosRequestURL({ directory: "kitchen", fileExtension: ext, method: "PUT" }).then((r) => { - const action = r.allUrl; - const reader = new FileReader(); - reader.readAsArrayBuffer(file); - reader.onload = (e) => { - fileData = e.target.result; - axios.put(action, fileData).then(response => { - if (response.status == 200 || response.statusText == 'OK') { - // 最后插入图片 - insertFn(r.seeUrl, r.seeUrl, r.seeUrl); - message.success('上传成功!'); - } - }); - }; - }); + // editor 实例 + const [editor, setEditor] = useState(null); + // 编辑器内容 + const [html, setHtml] = useState(''); + // 工具栏配置 + const toolbarConfig = {}; + // 编辑器配置 + const editorConfig = { + placeholder: '请输入大屏横幅...', + MENU_CONF: { + fontSize: { + fontSizeList: [ + '10px', '20px', '40px', '60px', '80px', '100px', '150px', '180px', '200px', + ] + }, + uploadImage: { + async customUpload(file, insertFn) { + // file 即选中的文件 + // 自己实现上传,并得到图片 url alt href + //覆盖action 上传之前获取上传地址 + let index = file.name.lastIndexOf("."); + let ext = file.name.substr(index + 1); + let fileData = null; + cardAPI.GetCosRequestURL({ directory: "kitchen", fileExtension: ext, method: "PUT" }).then((r) => { + const action = r.allUrl; + const reader = new FileReader(); + reader.readAsArrayBuffer(file); + reader.onload = (e) => { + fileData = e.target.result; + axios.put(action, fileData).then(response => { + if (response.status == 200 || response.statusText == 'OK') { + // 最后插入图片 + insertFn(r.seeUrl, r.seeUrl, r.seeUrl); + message.success('上传成功!'); + } + }); + }; + }); - } - } - } - } + } + } + } + } - // 及时销毁 editor ,重要! - useEffect(() => { - return () => { - if (editor == null) return - editor.destroy() - setEditor(null) - } - }, [editor]) + // 及时销毁 editor ,重要! + useEffect(() => { + return () => { + if (editor == null) return + editor.destroy() + setEditor(null) + } + }, [editor]) - /** - * 点击编辑按钮 - * @param {*} record - */ - const onEditTableRow = (record) => { - setCurrentOption(record); - setIsModalOpen(true); - setHtml(record.remaek); - modalForm.setFieldsValue(record); - } + /** + * 点击编辑按钮 + * @param {*} record + */ + const onEditTableRow = (record) => { + setCurrentOption(record); + setIsModalOpen(true); + setHtml(record.remaek); + modalForm.setFieldsValue(record); + } + /** + * 设置界面显示 + * @param {*} record + */ + const onGateSet = (record) => { + setCurrentOption(record); + GateSetUpVisible(true); + } + const setGateFood = (record) => { + setCurrentOption(record); + setGateFoodVisible(true); + } - /** - * 点击新建 - */ - const onCreateTableRow = () => { - setIsModalOpen(true); - editor.setHtml(''); - setHtml(''); - modalForm.resetFields(); - } + /** + * 点击新建 + */ + const onCreateTableRow = () => { + setIsModalOpen(true); + if (editor) { + editor.setHtml(''); + } + setHtml(''); + modalForm.resetFields(); + } - /** - * 提交表单 - */ - const onFinish = async (values) => { - if (values.id) { - values.remaek = html; - const response = await cardAPI.UpdateGateInfo(values); - if (response.statusCode === 200) { - message.success('更新档口成功!'); - setIsModalOpen(false); - actionRef.current.reload(); - } else { - message.error(response.errors || '更新档口失败'); - } - } else { - values.remaek = html; - const response = await cardAPI.AddGate(values); - if (response.statusCode === 200) { - message.success('新增档口成功!'); - setIsModalOpen(false); - actionRef.current.reload(); - } else { - message.error(response.errors || '新增档口失败'); - } - } - } + /** + * 提交表单 + */ + const onFinish = async (values) => { + if (values.id) { + values.remaek = html; + const response = await cardAPI.UpdateGateInfo(values); + if (response.statusCode === 200) { + message.success('更新档口成功!'); + setIsModalOpen(false); + actionRef.current.reload(); + } else { + message.error(response.errors || '更新档口失败'); + } + } else { + values.remaek = html; + const response = await cardAPI.AddGate(values); + if (response.statusCode === 200) { + message.success('新增档口成功!'); + setIsModalOpen(false); + actionRef.current.reload(); + } else { + message.error(response.errors || '新增档口失败'); + } + } + } - const columns = [ - { - title: '档口名称', - dataIndex: 'name', - ellipsis: true, - }, - { - title: '归属门店', - dataIndex: 'storeId', - render: (_, record) => { - const find = storeList.find(item => item.id === record.storeId); - if (find) { - return
{find.store_Name}
- } - } - }, - { - title: '属性', - dataIndex: 'mode', - valueType: 'select', - valueEnum: { - 1: { - text: '固定', - status: 'Success', - }, - 2: { - text: '自由设定', - status: 'Success', - } - }, - }, - { - title: '金额', - dataIndex: 'price', - }, - { - title: '状态', - dataIndex: 'status', - valueType: 'select', - valueEnum: { - 0: { - text: '正常', - status: 'Success', - }, - 1: { - text: '禁用', - status: 'Error', - }, - 2: { - text: '删除', - status: 'Error', - } - }, - }, - { - title: '操作', - valueType: 'option', - key: 'option', - render: (text, record, _, action) => [ - onEditTableRow(record)}>更新 - ], - }, - ]; + const columns = [ + { + title: '档口名称', + dataIndex: 'name', + ellipsis: true, + }, + { + title: '归属门店', + dataIndex: 'storeId', + render: (_, record) => { + const find = storeList.find(item => item.id === record.storeId); + if (find) { + return
{find.store_Name}
+ } + } + }, + { + title: '属性', + dataIndex: 'mode', + valueType: 'select', + valueEnum: { + 1: { + text: '固定', + status: 'Success', + }, + 2: { + text: '自由设定', + status: 'Success', + } + }, + }, + { + title: '金额', + dataIndex: 'price', + }, + { + title: '状态', + dataIndex: 'status', + valueType: 'select', + valueEnum: { + 0: { + text: '正常', + status: 'Success', + }, + 1: { + text: '禁用', + status: 'Error', + }, + 2: { + text: '删除', + status: 'Error', + } + }, + }, + { + title: '操作', + valueType: 'option', + key: 'option', + render: (text, record, _, action) => [ + onEditTableRow(record)}>更新, + setGateFood(record)}>设置菜品, + onGateSet(record)}>设置屏幕显示 + ], + }, + ]; - /** - * 获取店铺列表 - */ - const onFetchStoreList = async () => { - const response = await cardAPI.GetAllStore(); - if (response.isSuccess) { - setStoreList(response.data); - setSelectedStore(response.data[0].id); - actionRef.current.reload(); - } else { - message.error(response.msg || '获取店铺列表失败'); - } - } + /** + * 获取店铺列表 + */ + const onFetchStoreList = async () => { + const response = await cardAPI.GetAllStore(); + if (response.isSuccess) { + setStoreList(response.data); + setSelectedStore(response.data[0].id); + actionRef.current.reload(); + } else { + message.error(response.msg || '获取店铺列表失败'); + } + } - useEffect(() => { - onFetchStoreList(); - }, []); + useEffect(() => { + onFetchStoreList(); + }, []); - return ( - -
- { - if (selectedStore) { - const response = await cardAPI.GetGateListByStorePage(selectedStore, current, pageSize); - if (response.statusCode === 200) { - return { - data: response.data.data, - success: true, - total: response.data.total - } - } - } - } - } - cardBordered - editable={{ - type: 'multiple', - }} - rowKey="id" - search={false} - options={{ - setting: { - listsHeight: 400, - }, - }} - pagination={{ - pageSize: pageSize, - onChange: (page) => setCurrent(page), - }} - dateFormatter="string" - headerTitle="档口管理" - toolBarRender={() => [ -
-
- 当前门店: -
- -
, - - ]} - /> - setIsModalOpen(false)}> -
- + return ( + +
+ { + if (selectedStore) { + const response = await cardAPI.GetGateListByStorePage(selectedStore, current, pageSize); + if (response.statusCode === 200) { + return { + data: response.data.data, + success: true, + total: response.data.total + } + } + } + } + } + cardBordered + editable={{ + type: 'multiple', + }} + rowKey="id" + search={false} + options={{ + setting: { + listsHeight: 400, + }, + }} + pagination={{ + pageSize: pageSize, + onChange: (page) => setCurrent(page), + }} + dateFormatter="string" + headerTitle="档口管理" + toolBarRender={() => [ +
+
+ 当前门店: +
+ +
, + + ]} + /> + setIsModalOpen(false)}> + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - prevValues.mode !== currentValues.mode - } > - {({ getFieldValue }) => - (getFieldValue('mode') == '1') ? ( - - - + + prevValues.mode !== currentValues.mode + } > + {({ getFieldValue }) => + (getFieldValue('mode') == '1') ? ( + + + - ) : null - } - + ) : null + } + - - - + + - - - - -
- - setHtml(editor.getHtml())} - mode="default" - style={{ height: '500px', overflowY: 'hidden' }} - /> -
- - - - -
-
-
- ) + > + + + + +
+ + setHtml(editor.getHtml())} + mode="default" + style={{ height: '500px', overflowY: 'hidden' }} + /> +
+ + + + +
+ { + GateSetUpVisible(false); + }} + /> + { + setGateFoodVisible(false); + }} + /> + +
+
+ ) } export default Gate; diff --git a/src/pages/card/service.js b/src/pages/card/service.js index eeae322..0bb5834 100644 --- a/src/pages/card/service.js +++ b/src/pages/card/service.js @@ -1,204 +1,234 @@ import { request } from 'umi'; export default { - //获取所有门店 - GetAllStore() { - return request('/kitchen/api/StoreHelper/GetAllStore', { - method: 'GET', - headers: { - TenantId: '' - } - }); - }, - - //获取会员分页 - GetMemberListByPage(data) { - return request('/kitchen/api/member/member-page-query', { - method: 'POST', - data - }); - }, - - //绑定会员 - OnBindMember(data) { - return request('/kitchen/api/member/member-binding-cards', { - method: 'POST', - data - }); - }, - - //查询会员账户/卡号消费记录 - GetMemberAccountCardConsRecord(data) { - return request('/kitchen/api/member/member-account-amount-page', { - method: 'POST', - data - }); - }, - - /** - * 获取会员消费记录总次数和总人数 - * @param {*} data - * @returns - */ - GetMemberAccountRecordTotal(data) { - return request('/kitchen/api/member/member-account-record-total', { - method: 'POST', - data - }); - }, - - /** 档口管理:Start */ - // 新增档口 - AddGate(data) { - return request(`/kitchen/api/GateInfo/add`, { - method: 'POST', - data - }); - }, - - //档口状态修改 - EnableGate(data, TenantId = '') { - return request(`/kitchen/api/GateInfo/Enable`, { - method: 'POST', - data, - headers: { - TenantId: TenantId - } - }); - }, - - //根据门店ID查询 档口分页列表 - GetGateListByStorePage(StoreId, Current, PageSize, TenantId = '') { - return request(`/kitchen/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { - method: 'GET', - headers: { - TenantId: TenantId - } - }); - }, - - //根据门店ID查询 档口分页列表 - GetGateListByStorePageNew(StoreId, Current, PageSize, TenantId = '') { - return request(`/kitchen/api/one-card/gate-list?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { - method: 'GET', - headers: { - TenantId: TenantId - } - }); - }, - - //根据门店ID查询 档口列表 - GetGateListByStoreList(StoreId) { - return request(`/kitchen/api/GateInfo/gatealllist?StoreId=${StoreId}`, { - method: 'GET' - }); - }, - - //更新档口信息 - UpdateGateInfo(data, TenantId = '') { - return request(`/kitchen/api/GateInfo/Update`, { - method: 'POST', - data, - headers: { - TenantId: TenantId - } - }); - }, - - UpdateGateInfoNew(data, TenantId = '') { - return request(`/kitchen/api/one-card`, { - method: 'PUT', - data, - headers: { - TenantId: TenantId - } - }); - }, - - /** 档口管理:End */ - - /** 刷卡机管理:Start */ - // 新增刷卡机 - PayCardAdd(data) { - return request(`/kitchen/api/PayCard/add`, { - method: 'POST', - data - }); - }, - - //刷卡机状态更改 - PayCardEnable(data) { - return request(`/kitchenapi/PayCard/enable`, { - method: 'POST', - data - }); - }, - - //根据档口信息查询刷卡机列表 - PayCardByGateId(GateId, Current, PageSize) { - return request(`/kitchen/api/PayCard/gateList?GateId=${GateId}&Current=${Current}&PageSize=${PageSize}`, { - method: 'GET' - }); - }, - - //更新刷卡机信息 - UpdatePayCardInfo(data) { - return request(`/kitchen/api/PayCard/update`, { - method: 'POST', - data - }); - }, - /** 刷卡机管理:End */ - - GetCosRequestURL(data) { - return request(`/kitchen/api/systemconfig/GetCosRequestSignURL`, { - method: 'POST', - data: data, - }); - }, - - - - /** 会员账户管理: Start */ - //获取会员账户列表 - GetMemberAccountPageList(data) { - return request(`/kitchen/api/member/member-account-page-list`, { - method: 'POST', - data: data, - }); - }, - - //更新会员账户状态 - UpdateMemberAccountStatus(data) { - return request(`/kitchen/api/member/member-account-status`, { - method: 'POST', - data: data, - }); - }, - /** 会员账户管理: End */ - - //获取会员储值卡列表 - GetMemberCardPageList(data) { - return request(`/kitchen/api/member/mmenber-card-page`, { - method: 'POST', - data: data, - }); - }, - - //添加会员储值卡 - AddMemberCard(data) { - return request(`/kitchen/api/member/mmenber-card`, { - method: 'POST', - data: data, - }); - }, - - //修改会员卡状态 - UpdateMemberCardState(data) { - return request(`/kitchen/api/member/mmenber-card-state`, { - method: 'PUT', - data: data, - }); - }, - -} \ No newline at end of file + //获取所有门店 + GetAllStore() { + return request('/kitchen/api/StoreHelper/GetAllStore', { + method: 'GET', + headers: { + TenantId: '' + } + }); + }, + + //获取会员分页 + GetMemberListByPage(data) { + return request('/kitchen/api/member/member-page-query', { + method: 'POST', + data + }); + }, + + //绑定会员 + OnBindMember(data) { + return request('/kitchen/api/member/member-binding-cards', { + method: 'POST', + data + }); + }, + + //查询会员账户/卡号消费记录 + GetMemberAccountCardConsRecord(data) { + return request('/kitchen/api/member/member-account-amount-page', { + method: 'POST', + data + }); + }, + + /** + * 获取会员消费记录总次数和总人数 + * @param {*} data + * @returns + */ + GetMemberAccountRecordTotal(data) { + return request('/kitchen/api/member/member-account-record-total', { + method: 'POST', + data + }); + }, + + /** 档口管理:Start */ + // 新增档口 + AddGate(data) { + return request(`/kitchen/api/GateInfo/add`, { + method: 'POST', + data + }); + }, + + //档口状态修改 + EnableGate(data, TenantId = '') { + return request(`/kitchen/api/GateInfo/Enable`, { + method: 'POST', + data, + headers: { + TenantId: TenantId + } + }); + }, + + //根据门店ID查询 档口分页列表 + GetGateListByStorePage(StoreId, Current, PageSize, TenantId = '') { + return request(`/kitchen/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { + method: 'GET', + headers: { + TenantId: TenantId + } + }); + }, + + //根据门店ID查询 档口分页列表 + GetGateListByStorePageNew(StoreId, Current, PageSize, TenantId = '') { + return request(`/kitchen/api/one-card/gate-list?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, { + method: 'GET', + headers: { + TenantId: TenantId + } + }); + }, + + //根据门店ID查询 档口列表 + GetGateListByStoreList(StoreId) { + return request(`/kitchen/api/GateInfo/gatealllist?StoreId=${StoreId}`, { + method: 'GET' + }); + }, + + //更新档口信息 + UpdateGateInfo(data, TenantId = '') { + return request(`/kitchen/api/GateInfo/Update`, { + method: 'POST', + data, + headers: { + TenantId: TenantId + } + }); + }, + + UpdateGateInfoNew(data, TenantId = '') { + return request(`/kitchen/api/one-card`, { + method: 'PUT', + data, + headers: { + TenantId: TenantId + } + }); + }, + + /** 档口管理:End */ + + /** 刷卡机管理:Start */ + // 新增刷卡机 + PayCardAdd(data) { + return request(`/kitchen/api/PayCard/add`, { + method: 'POST', + data + }); + }, + + //刷卡机状态更改 + PayCardEnable(data) { + return request(`/kitchenapi/PayCard/enable`, { + method: 'POST', + data + }); + }, + + //根据档口信息查询刷卡机列表 + PayCardByGateId(GateId, Current, PageSize) { + return request(`/kitchen/api/PayCard/gateList?GateId=${GateId}&Current=${Current}&PageSize=${PageSize}`, { + method: 'GET' + }); + }, + + //更新刷卡机信息 + UpdatePayCardInfo(data) { + return request(`/kitchen/api/PayCard/update`, { + method: 'POST', + data + }); + }, + /** 刷卡机管理:End */ + + GetCosRequestURL(data) { + return request(`/kitchen/api/systemconfig/GetCosRequestSignURL`, { + method: 'POST', + data: data, + }); + }, + + + + /** 会员账户管理: Start */ + //获取会员账户列表 + GetMemberAccountPageList(data) { + return request(`/kitchen/api/member/member-account-page-list`, { + method: 'POST', + data: data, + }); + }, + + //更新会员账户状态 + UpdateMemberAccountStatus(data) { + return request(`/kitchen/api/member/member-account-status`, { + method: 'POST', + data: data, + }); + }, + /** 会员账户管理: End */ + + //获取会员储值卡列表 + GetMemberCardPageList(data) { + return request(`/kitchen/api/member/mmenber-card-page`, { + method: 'POST', + data: data, + }); + }, + + //添加会员储值卡 + AddMemberCard(data) { + return request(`/kitchen/api/member/mmenber-card`, { + method: 'POST', + data: data, + }); + }, + + //修改会员卡状态 + UpdateMemberCardState(data) { + return request(`/kitchen/api/member/mmenber-card-state`, { + method: 'PUT', + data: data, + }); + }, + //获取数据 + GetDicList(TypeCode) { + return request(`/kitchen/api/dict-data/dic-list/${TypeCode}`, { + method: 'Get', + }); + }, + AddGateSetUp(data) { + return request(`/kitchen/api/GateInfo/AddGateSetUp`, { + method: 'POST', + data + }); + }, + GetFoodList(TypeCode) { + return request(`/kitchen/api/dict-data/dic-list/${TypeCode}`, { + method: 'Get', + }); + }, + AddGateFood(data) { + return request(`/kitchen/api/GateInfo/AddGateFood`, { + method: 'POST', + data + }); + }, + GetGoodsByMenuIdPage(params) { + return request('/kitchen/api/FoodMenu/GetGoodsByMenuIdPage', { + method: 'POST', + data: { + ...params, + }, + }); + } +}