Browse Source

提交

storemanagementweb
gwbvipvip 11 months ago
parent
commit
d4c2015547
11 changed files with 609 additions and 57 deletions
  1. +8
    -0
      config/proxy.js
  2. +24
    -11
      config/routes.js
  3. BIN
     
  4. BIN
     
  5. +20
    -7
      src/app.jsx
  6. +21
    -18
      src/pages/order/orderflow/index.jsx
  7. +26
    -21
      src/pages/order/orderflow/service.js
  8. +209
    -0
      src/pages/order/thirdAuthorize/index.jsx
  9. +42
    -0
      src/pages/order/thirdAuthorize/service.js
  10. +124
    -0
      src/pages/order/thirdOrder/index.jsx
  11. +135
    -0
      src/pages/order/thirdOrder/service.js

+ 8
- 0
config/proxy.js View File

@@ -16,6 +16,14 @@
'/saasbase/': '',
},
},
'/storemanagement/': {
target: 'http://192.168.1.50:5248/',
changeOrigin: true,
secure: false, //关闭证书验证
pathRewrite: {
'/storemanagement/': '',
},
},
'/ordermanage/': {
target: 'http://localhost:5248',
changeOrigin: true,


+ 24
- 11
config/routes.js View File

@@ -294,17 +294,30 @@ export default [
],
},
{
name: '订单管理',
icon: 'BankFilled',
path: '/order',
routes: [
{
name: '订单流水',
icon: 'smile',
path: '/order/orderflow',
component: './order/orderflow',
},]
},
    name: '订单管理',
    icon: 'BankFilled',
    path: '/order',
    routes: [
      {
        name: '订单流水',
        icon: 'smile',
        path: '/order/orderflow',
        component: './order/orderflow',
      },
      {
        name: '第三方订单',
        icon: 'smile',
        path: '/order/thirdOrder',
        component: './order/thirdOrder',
      },
      {
        name: '授权管理',
        icon: 'smile',
        path: '/order/thirdAuthorize',
        component: './order/thirdAuthorize',
      },
    ],
  },
{
path: '/',
redirect: '/welcome',


BIN
View File


BIN
View File


+ 20
- 7
src/app.jsx View File

@@ -343,17 +343,30 @@ export async function getInitialState() {
],
},
{
name: '订单管理',
icon: 'BankFilled',
path: '/order',
routes: [
{
name: '订单管理',
icon: 'BankFilled',
path: '/order',
routes: [
{
name: '订单流水',
icon: 'smile',
path: '/order/orderflow',
component: './order/orderflow',
},]
},
},
{
name: '第三方订单',
icon: 'smile',
path: '/order/thirdOrder',
component: './order/thirdOrder',
},
{
name: '授权管理',
icon: 'smile',
path: '/order/thirdAuthorize',
component: './order/thirdAuthorize',
},
],
},
];
// api.queryMenus();
return data;


+ 21
- 18
src/pages/order/orderflow/index.jsx View File

@@ -199,22 +199,22 @@ const Manage = () => {
>
查看详情
</a>,
<a
key="config"
onClick={() => {
api.printsmallticket({ "orderId": record.id })
.then(re => {
if (re.data) {
message.success('打印成功');
} else {
message.error('打印失败');
}
// <a
// key="config"
// onClick={() => {
// api.printsmallticket({ "orderId": record.id })
// .then(re => {
// if (re.data) {
// message.success('打印成功');
// } else {
// message.error('打印失败');
// }

})
// })

}} >
打印小票
</a>,
// }} >
// 打印小票
// </a>,
],
},
];
@@ -249,7 +249,10 @@ const Manage = () => {
}

return (
<PageContainer>
<PageContainer header={{
title: '',
breadcrumb: {},
}}>
<ProTable
headerTitle="订单流水"
actionRef={actionRef}
@@ -258,9 +261,9 @@ const Manage = () => {
labelWidth: 120,
}}
toolBarRender={() => [
<Button type="primary" key="create" onClick={onDownloadExcel}>
<DownloadOutlined /> 导出
</Button>,
// <Button type="primary" key="create" onClick={onDownloadExcel}>
// <DownloadOutlined /> 导出
// </Button>,
]}
columns={columns}
//数据绑定


+ 26
- 21
src/pages/order/orderflow/service.js View File

@@ -13,7 +13,30 @@ export default {
// params: { ...params },
// ...(options || {}),
});
},5
},

/**
* 查询店铺信息(设备信息)
*/
srdList(data) {
return request('/groupmeal/api/shop/alllist', {
method: 'GET'
});
},

GetFlowExport(data) {
return request(`/ordermanage/api/Order/GetFlowExport`, {
method: 'Post',
data: data
// params: { ...params },
// ...(options || {}),
});
},







@@ -37,17 +60,7 @@ export default {
// ...(options || {}),
});
},
/**
* 查询店铺信息(设备信息)
*/
srdList(data) {
return request(`/kitchen/api/store/list`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},

/**
* 查询商品信息
@@ -87,15 +100,7 @@ export default {
// ...(options || {}),
});
},
GetFlowExport(data) {
return request(`/kitchen/api/Order/GetFlowExport`, {
method: 'Post',
data: data
// params: { ...params },
// ...(options || {}),
});
},


// 打印小票
printsmallticket(data) {


+ 209
- 0
src/pages/order/thirdAuthorize/index.jsx View File

@@ -0,0 +1,209 @@
import { DropboxOutlined, PlusOutlined, DownloadOutlined } from '@ant-design/icons';
import { Button, message, Modal, Input, Form, Select, Popconfirm } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import api from './service';

const Manage = () => {
const [row, setRow] = useState();
//获取店铺(店铺信息)
const [shopList, setShopList] = useState([]);
//绑定
const actionRef = useRef();

const [isModalOpen, setIsModalOpen] = useState(false);
const [form] = Form.useForm();


// 获取店铺分类、商品名称信息
useEffect(() => {
getShopList();
}, []);
const getShopList = async () => {
const response = await api.GetAllStore();
if (response.statusCode == 200) {
setShopList(response.data);
} else {
message.error(response.msg || '获取店铺列表失败');
}

}

const columns = [
{
title: '主键',
dataIndex: 'id',
tip: '规则名称是唯一的 key',
hideInSearch: true,
hideInTable: true,
},
{
title: '归属场景',
dataIndex: 'storeId',
ellipsis: true,
render: (_, record) => {
const find = shopList.find(item => item.id === record.storeId);
if (find) {
return <div>{find.name}</div>
}
}
},
{
title: '授权码',
dataIndex: 'authorizeCode',
hideInSearch: true,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
width: 200,
render: (_, record) => [
<Popconfirm
title="确定要重新授权吗?"
onConfirm={() => {
api.Update({ id: record.id }).then((re) => {
if (re.data) {
message.success('修改成功');
setIsModalOpen(false);
actionRef.current.reload();
} else {
message.error('修改失败');
}
});
}}
okText="确定"
cancelText="取消" >
<a
key={record.id}
onClick={async () => {

}} >
重新授权
</a>
</Popconfirm>,
<Popconfirm
title="确认删除吗?"
onConfirm={() => {
api.Del(record.id).then((re) => {
if (re.data) {
message.success('删除成功');
setIsModalOpen(false);
actionRef.current.reload();
} else {
message.error('删除成功');
}
});
}}
okText="确定"
cancelText="取消" >
<a
key={record.id}
onClick={async () => {

}} >
删除
</a>
</Popconfirm>

],
},
];



return (
<PageContainer header={{
title: '',
breadcrumb: {},
}}>
<ProTable
headerTitle=""
actionRef={actionRef}
rowKey="orderFlowId"
search={{
labelWidth: 120,
}}
toolBarRender={() => [
<Button type="primary" key="create" onClick={() => { setIsModalOpen(true); }}>
<DownloadOutlined /> 新建
</Button>,
]}
columns={columns}
//数据绑定
request={async (params, sorter, filter) => {
const msg = await api.page(params);
return {
data: msg.data.data,
success: true,
total: msg.data.total,
};
}}
></ProTable>

<>
<Modal title="授权" open={isModalOpen} onOk={() => { form.submit() }} onCancel={() => {
setIsModalOpen(false);
}}>
<Form
form={form}
preserve={false}
layout="horizontal"
labelCol={{ span: 4 }}
onFinish={async (value) => {
if (value.id) {
api.Update(value).then((re) => {
if (re.data) {
message.success('修改成功');
handleModalVisible(false);
actionRef.current.reload();
} else {
message.error('修改失败');
}
});
} else {
api.Create(value).then((re) => {
if (re.data) {
setIsModalOpen(false);
message.success('添加成功');
actionRef.current.reload();
} else {
message.error(re.errors || '添加失败');
}
});

}
}}
>
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item
label="归属场景"
name="storeId"
rules={[
{
required: true,
message: '请选择归属场景!',
},
]}
>
<Select allowClear placeholder="请选择归属场景" style={{ width: '100%' }}>
{
shopList.map(item => {
return <Option value={item.id} key={item.id}>{item.name}</Option>
})
}
</Select>
</Form.Item>
</Form>
</Modal>

</>
</PageContainer>
);
};

export default Manage;

+ 42
- 0
src/pages/order/thirdAuthorize/service.js View File

@@ -0,0 +1,42 @@
// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

export default {

page(data) {
data.isreport = true;
return request(`/ordermanage/api/ThirdAuthorize/Page`, {
method: 'Post',
data: data,
});
},
GetAllStore() {
return request('/groupmeal/api/shop/alllist', {
method: 'GET'
});
},
Create(data) {
return request('/ordermanage/api/ThirdAuthorize/Create', {
method: 'Post',
data: data,
});
},
Update(data) {
return request('/ordermanage/api/ThirdAuthorize/Update', {
method: 'Post',
data: data,
});
},
Del(data) {
return request('/ordermanage/api/ThirdAuthorize/Del?id='+data, {
method: 'Post',
});
},


};



+ 124
- 0
src/pages/order/thirdOrder/index.jsx View File

@@ -0,0 +1,124 @@
import { DropboxOutlined, PlusOutlined, DownloadOutlined } from '@ant-design/icons';
import { message, Modal, Input, Form, Space, Table, Tag } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import api from './service';
const handlerefund = async (value) => {
var data = { number: value };
const hide = message.loading('正在发起退款');
try {
api.StartRefund(data);
hide();
message.success('发起退款成功,即将刷新');
return true;
} catch (error) {
hide();
message.error('发起退款失败,请重试');
return false;
}
};
const Manage = () => {
const [row, setRow] = useState();
//绑定
const actionRef = useRef();
const [form] = Form.useForm();
const [isModalOpen, setIsModalOpen] = useState(false);

const [thirdOrderInfo, setThirdOrderInfo] = useState(false);


// 获取店铺分类、商品名称信息
useEffect(() => {

}, []);

const columns = [
{
title: '主键',
dataIndex: 'id',
tip: '规则名称是唯一的 key',
hideInSearch: true,
hideInTable: true,
},
{
title: '订单编号',
dataIndex: 'orderNum',
},
{
title: '同步时间',
dataIndex: 'createAt',
hideInSearch: true,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
width: 200,
render: (_, record) => [
<a
key={record.id}
onClick={async () => {
var data = await api.getThirdOrderInfo(record.id);
setThirdOrderInfo(data.data.thirdOrderInfos);
setIsModalOpen(true);
}} >
查看详情
</a>
],
},
];

const columnInfos = [
{
title: '商品名称',
dataIndex: 'goodsName',
key: 'goodsName',
render: (text) => <a>{text}</a>,
},
{
title: '数量',
dataIndex: 'count',
key: 'count',
}
];
return (
<PageContainer header={{
title: '',
breadcrumb: {},
}}>
<ProTable
headerTitle="第三方订单"
actionRef={actionRef}
rowKey="orderFlowId"
search={{
labelWidth: 120,
}}
// toolBarRender={() => [
// <Button type="primary" key="create" onClick={() => { setIsModalOpen(true); }}>
// <DownloadOutlined /> 新建
// </Button>,
// ]}
columns={columns}
//数据绑定
request={async (params, sorter, filter) => {
const msg = await api.page(params);
return {
data: msg.data.data,
success: true,
total: msg.data.total,
};
}}
></ProTable>
<>
<Modal title="详情" open={isModalOpen} onOk={() => { }} onCancel={() => { setIsModalOpen(false); }}>
<Table columns={columnInfos} dataSource={thirdOrderInfo} />
</Modal>
</>
</PageContainer>
);
};

export default Manage;

+ 135
- 0
src/pages/order/thirdOrder/service.js View File

@@ -0,0 +1,135 @@
// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

export default {

page(data) {
data.isreport = true;
return request(`/ordermanage/api/Order/ThirdOrderPage`, {
method: 'Post',
data: data,
});
},

getThirdOrderInfo(data) {
return request(`/ordermanage/api/Order/GetThirdOrderInfo?thirdOrderId=`+data, {
method: 'get',
});
},





/** 获取订单流水信息*/
orderList(data) {
data.isreport = true;
return request(`/ordermanage/api/Order/PostDetail`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},

/**
* 查询店铺信息(设备信息)
*/
srdList(data) {
return request('/groupmeal/api/shop/alllist', {
method: 'GET'
});
},

GetFlowExport(data) {
return request(`/ordermanage/api/Order/GetFlowExport`, {
method: 'Post',
data: data
// params: { ...params },
// ...(options || {}),
});
},
















/**
* 查询店铺分类(设备类型)信息
*/
srdTypeList(data) {
return request(`/kitchen/api/storetype/list`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},

/**
* 查询商品信息
*/
goodsList(data) {
return request(`/kitchen/api/goodes/list`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},
/**
* 查询商品类型
*/
goodsTypeList(data) {
return request(`/kitchen/api/goodstype/list`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},
StartRefund(data) {
return request(`/kitchen/api/refund/StartOrderRefund`, {
method: 'Post',
params: data,
// params: { ...params },
// ...(options || {}),
});
},
GetOrderDetails(data) {
return request(`/kitchen/api/Order/GetOrderDetails`, {
method: 'Post',
params: data,
// params: { ...params },
// ...(options || {}),
});
},


// 打印小票
printsmallticket(data) {
return request(`/kitchen/api/printer/print-small-ticket`, {
method: 'Post',
data: data,
// params: { ...params },
// ...(options || {}),
});
},
};



Loading…
Cancel
Save