Browse Source

提交

groupmealweb
gwbvipvip 8 months ago
parent
commit
d7474461e0
7 changed files with 428 additions and 44 deletions
  1. +6
    -0
      config/routes.js
  2. +2
    -2
      src/pages/authorization/storeAuthorization/index.jsx
  3. +9
    -10
      src/pages/authorization/storeAuthorization/services.js
  4. +162
    -25
      src/pages/groupMeal/diningPlate/index.jsx
  5. +21
    -7
      src/pages/groupMeal/diningPlate/service.js
  6. +210
    -0
      src/pages/order/weighOrder/index.jsx
  7. +18
    -0
      src/pages/order/weighOrder/service.js

+ 6
- 0
config/routes.js View File

@@ -416,6 +416,12 @@ export default [
icon: 'BankFilled',
path: '/order',
routes: [
{
name: '称重订单',
icon: 'smile',
path: '/order/weighOrder',
component: './order/weighOrder',
},
{
name: '订单流水',
icon: 'smile',


+ 2
- 2
src/pages/authorization/storeAuthorization/index.jsx View File

@@ -24,10 +24,10 @@ const App = () => {
//初始化数据
useEffect(() => {
function initData() {
GetStoreList({ "current": 1, "pageSize": 9999 }).then((r) => {
GetStoreList().then((r) => {
let data = [];
if (r.statusCode == 200) {
r.data.data.forEach((item) => {
r.data.forEach((item) => {
data.push({
id: item.id,
label: item.name,


+ 9
- 10
src/pages/authorization/storeAuthorization/services.js View File

@@ -1,10 +1,10 @@
import { request } from 'umi';
import { getDataBaseUrl,GetkitchbaseUrl } from '@/global_data';
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data';


/** 获取平台授权码 */
export async function PageStoreAuthorization(data) {
return request(GetkitchbaseUrl()+`/api/authorization/pagestoreauthorization`, {
return request(getgroupmealUrl()+`/api/authorization/pagestoreauthorization`, {
method: 'POST',
data: data,
});
@@ -12,7 +12,7 @@ export async function PageStoreAuthorization(data) {

/** 添加平台授权码 */
export async function AddStoreAuthorization(data) {
return request(GetkitchbaseUrl()+`/api/authorization/addstoreauthorization?storeId=`+data, {
return request(getgroupmealUrl()+`/api/authorization/addstoreauthorization?storeId=`+data, {
method: 'POST',
data: data,
});
@@ -20,7 +20,7 @@ export async function AddStoreAuthorization(data) {

/** 修改平台授权码 */
export async function UpdateStoreAuthorization(data) {
return request(GetkitchbaseUrl()+`/api/authorization/updatestoreauthorization?id=`+data, {
return request(getgroupmealUrl()+`/api/authorization/updatestoreauthorization?id=`+data, {
method: 'POST',
data: data,
});
@@ -28,7 +28,7 @@ export async function UpdateStoreAuthorization(data) {

/** 修改平台授权码时间 */
export async function UpdateStoreAuthTime(data) {
return request(GetkitchbaseUrl()+`/api/authorization/updatestoreauthtime`, {
return request(getgroupmealUrl()+`/api/authorization/updatestoreauthtime`, {
method: 'POST',
data: data,
});
@@ -36,7 +36,7 @@ export async function UpdateStoreAuthorization(data) {

/** 删除店铺授权码 */
export async function DelStoreAuthTime(data) {
return request(GetkitchbaseUrl()+`/api/authorization/delstoreauthorization?id=`+data, {
return request(getgroupmealUrl()+`/api/authorization/delstoreauthorization?id=`+data, {
method: 'POST',
data: data,
});
@@ -48,8 +48,7 @@ export async function UpdateStoreAuthorization(data) {

/** 获取店铺列表 */
export async function GetStoreList(data) {
return request(GetkitchbaseUrl()+`/api/store/page`, {
method: 'POST',
data: data,
});
return request(getgroupmealUrl()+'/api/shop/alllist', {
method: 'GET',
});
}

+ 162
- 25
src/pages/groupMeal/diningPlate/index.jsx View File

@@ -1,4 +1,4 @@
import { Button, Modal, Form, Input, Drawer, Popconfirm, TreeSelect } from 'antd';
import { Button, Modal, Form, Input, Drawer, Popconfirm, TreeSelect, Card, Descriptions, Divider } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -7,10 +7,15 @@ import api from './service';
import { message } from 'antd/lib';
const app = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [isOrderModalOpen, setIsOrderModalOpen] = useState(false);
const [form] = Form.useForm();
//绑定
const actionRef = useRef();
const [current, setCurrent] = useState({});
const [data, setData] = useState({});
const [dataGoods, setDataGoods] = useState([]);
const [dataDiningPlate, setDataDiningPlate] = useState([]);
const [unbindOccupyData, setUnbindOccupyData] = useState([]);


const columns = [
@@ -71,7 +76,7 @@ const app = () => {
valueType: 'option',
key: 'operation',
fixed: 'right',
width: 150,
width: 200,
render: (_, record) => [
<a
key="config"
@@ -83,22 +88,22 @@ const app = () => {
>
更新
</a>,
<a
key="config"
onClick={() => {
api.EnableDisable(record).then((re) => {
if (re.data) {
message.success('成功');
actionRef.current.reloadAndRest();
} else {
message.error(re.errors ||'失败');
}
});
<a
key="config"
onClick={() => {
api.EnableDisable(record).then((re) => {
if (re.data) {
message.success('成功');
actionRef.current.reloadAndRest();
} else {
message.error(re.errors || '失败');
}
});

}}
>
{record.status==0?"停用":"正常"}
</a>,
}}
>
{record.status == 0 ? "停用" : "正常"}
</a>,
<Popconfirm
key="delete"
title={`确定要删除吗?`}
@@ -108,7 +113,7 @@ const app = () => {
message.success('删除成功');
actionRef.current.reloadAndRest();
} else {
message.error(re.errors ||'修改失败');
message.error(re.errors || '修改失败');
}
});
}}
@@ -116,10 +121,73 @@ const app = () => {
cancelText="取消"
>
<a href="#">删除</a>
</Popconfirm>
</Popconfirm>,
<a
key="config"
disabled={!record.isOccupy}
onClick={() => {
setIsOrderModalOpen(true);
if (!record.isOccupy) {
return;
}

api.GetWeighOrderByOrderId({ "orderId": record.weighOrderId })
.then((res) => {
if (res.statusCode == 200) {
setData(res.data);
setDataGoods(res.data.goodsInfo);
setDataDiningPlate(res.data.diningPlateInfo);
}

})



var data = [];
data.push({ diningPlateId: record.id, weighOrderId: record.weighOrderId });
setUnbindOccupyData(data);

}}
>
解绑
</a>
],
},
];

const goodsColumns = [
{
title: '商品名称',
dataIndex: 'goodsName',
key: 'goodsName',
},
{
title: '重量',
dataIndex: 'goodsWeight',
key: 'goodsWeight',
},
{
title: '价格',
dataIndex: 'totalAmount',
key: 'totalAmount',
}
];

const diningPlateColumns = [
{
title: '二维码',
dataIndex: 'qrCode',
key: 'qrCode',
},
{
title: '芯片码',
dataIndex: 'chipCode',
key: 'chipCode',
}
];


return (
<>
<PageContainer header={{ title: '', breadcrumb: {} }}>
@@ -139,16 +207,18 @@ const app = () => {
key="primary"
onClick={() => {
setCurrent({});
form.setFieldsValue({id:"",qrCode:"",chipCode:""});
form.setFieldsValue({ id: "", qrCode: "", chipCode: "" });
setIsModalOpen(true);
}}
>
<PlusOutlined /> 新建
</Button>,
</Button>
]}
//数据绑定
request={async (params) => {

if (params.status) {
params.status = Number(params.status)
}
var res = await api.Page(params);
var datas = res.data.data;
var total = res.data.total;
@@ -161,7 +231,7 @@ const app = () => {

{/* 餐盘管理 */}
<Modal
title={current.id?"修改":"新增"}
title={current.id ? "修改" : "新增"}
width={600}
open={isModalOpen}
onOk={() => {
@@ -184,7 +254,7 @@ const app = () => {
setIsModalOpen(false);
actionRef.current.reloadAndRest();
} else {
message.error(re.errors ||'修改失败');
message.error(re.errors || '修改失败');
}
});
} else {
@@ -215,9 +285,76 @@ const app = () => {
rules={[{ required: true, message: '芯片码不能为空', },]}>
<Input />
</Form.Item>

</Form>
</Modal>

{/* 绑定订单 */}
<Modal
title={"解绑餐盘"}
width={800}
open={isOrderModalOpen}
onOk={() => {
api.UnbindOccupy(data).then((re) => {
if (re.data) {
message.success('解绑成功');
actionRef.current.reloadAndRest();
} else {
message.error(re.errors || '解绑失败');
}
});
}}
onCancel={() => {
setIsOrderModalOpen(false);
}} >
<Card bordered={false}>
<Descriptions
title="订单信息"
style={{
marginBottom: 32,
}}
>
<Descriptions.Item label="订单编号">{data.orderNumber}</Descriptions.Item>
<Descriptions.Item label="总额">{data.totalAmount}</Descriptions.Item>
<Descriptions.Item label="订单状态">{data.states==0?"选菜中":"已完成"}</Descriptions.Item>
<Descriptions.Item label="支付状态">{data.payStates==0?"待支付":"已支付"}</Descriptions.Item>
<Descriptions.Item label="OpenId">{data.createId}</Descriptions.Item>
<Descriptions.Item label="创建时间">{data.createAt}</Descriptions.Item>
</Descriptions>
<Divider
style={{
marginBottom: 32,
}}
/>
<div >餐盘信息</div>
<ProTable
style={{
marginBottom: 24,
}}
pagination={false}
search={false}
options={false}
toolBarRender={false}
dataSource={dataDiningPlate}
columns={diningPlateColumns}
rowKey="id"
/>
<div >商品信息</div>
<ProTable
style={{
marginBottom: 24,
}}
pagination={false}
search={false}
options={false}
toolBarRender={false}
dataSource={dataGoods}
columns={goodsColumns}
rowKey="id"
/>
</Card>


</Modal>
</PageContainer>
</>



+ 21
- 7
src/pages/groupMeal/diningPlate/service.js View File

@@ -1,42 +1,56 @@
import { request } from 'umi';
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data';
import { getDataBaseUrl, getgroupmealUrl,getgroupmealorderUrl } from '@/global_data';

export default {

Page(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/Page`, {
return request(getgroupmealUrl() + `/api/DiningPlate/Page`, {
method: 'Post',
data: data,
});
},
Add(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/Add`, {
return request(getgroupmealUrl() + `/api/DiningPlate/Add`, {
method: 'Post',
data: data,
});
},
Update(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/Update`, {
return request(getgroupmealUrl() + `/api/DiningPlate/Update`, {
method: 'Post',
data: data,
});
},
EnableDisable(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/EnableDisable`, {
return request(getgroupmealUrl() + `/api/DiningPlate/EnableDisable`, {
method: 'Post',
data: data,
});
},
EnableDisable(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/EnableDisable`, {
return request(getgroupmealUrl() + `/api/DiningPlate/EnableDisable`, {
method: 'Post',
data: data,
});
},
UnbindOccupy(data) {
return request(getgroupmealUrl() + `/api/DiningPlate/UnbindOccupy`, {
method: 'Post',
data: data,
});
},
Del(data) {
return request(getgroupmealUrl()+`/api/DiningPlate/Del?id=`+data, {
return request(getgroupmealUrl() + `/api/DiningPlate/Del?id=` + data, {
method: 'Post',
data: data,
});
},
GetWeighOrderByOrderId(data) {
return request(getgroupmealorderUrl() + `/api/WeighOrder/GetWeighOrderByOrderId`, {
method: 'Post',
data: data,
});
},


};

+ 210
- 0
src/pages/order/weighOrder/index.jsx View File

@@ -0,0 +1,210 @@
import { DropboxOutlined, PlusOutlined, DownloadOutlined } from '@ant-design/icons';
import { Button, Modal, Form, Input, Drawer, Popconfirm, TreeSelect, Card, Descriptions, Divider } 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 actionRef = useRef();
const [isModalOpen, setIsModalOpen] = useState(false);
const [orderInfo, setOrderInfo] = useState(false);
const [data, setData] = useState({});
const [dataGoods, setDataGoods] = useState([]);
const [dataDiningPlate, setDataDiningPlate] = useState([]);


useEffect(() => {

}, []);

const columns = [
{
title: '主键',
dataIndex: 'id',
tip: '规则名称是唯一的 key',
hideInSearch: true,
hideInTable: true,
},
{
title: '订单编号',
dataIndex: 'orderNumber',
hideInSearch: true,
},
{
title: '订单标题',
dataIndex: 'subject',
hideInSearch: true,
},
{
title: '订单金额',
dataIndex: 'totalAmount',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'states',
valueEnum: {
0: {
text: '选菜中',
status: 'Processing',
},
1: {
text: '未完成',
status: 'Success',
},
},
},
{
title: '支付状态',
dataIndex: 'payStates',
valueEnum: {
0: {
text: '待支付',
status: 'Processing',
},
1: {
text: '已支付',
status: 'Success',
},
},
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
width: 200,
render: (_, record) => [
<a
key={record.id}
onClick={async () => {
setData(record);
setDataGoods(record.goodsInfo);
setDataDiningPlate(record.diningPlateInfo);
setIsModalOpen(true);
}} >
查看详情
</a>
],
},
];
const goodsColumns = [
{
title: '商品名称',
dataIndex: 'goodsName',
key: 'goodsName',
},
{
title: '重量',
dataIndex: 'goodsWeight',
key: 'goodsWeight',
},
{
title: '价格',
dataIndex: 'totalAmount',
key: 'totalAmount',
}
];
const diningPlateColumns = [
{
title: '二维码',
dataIndex: 'qrCode',
key: 'qrCode',
},
{
title: '芯片码',
dataIndex: 'chipCode',
key: 'chipCode',
}
];


return (
<PageContainer header={{
title: '',
breadcrumb: {},
}}>
<ProTable
headerTitle="第三方订单"
actionRef={actionRef}
rowKey="orderFlowId"
search={{
labelWidth: 120,
}}
columns={columns}
//数据绑定
request={async (params, sorter, filter) => {
const msg = await api.GetWeighOrderPage(params);
return {
data: msg.data.data,
success: true,
total: msg.data.total,
};
}}
></ProTable>

<>
<Modal title="详情" width={800} open={isModalOpen}
footer={[
<Button key="back" onClick={()=>{setIsModalOpen(false)}}>
关闭
</Button>
]}
onCancel={() => { setIsModalOpen(false); }}>
<Card bordered={false}>
<Descriptions
title="订单信息"
style={{
marginBottom: 32,
}}
>
<Descriptions.Item label="订单编号">{data.orderNumber}</Descriptions.Item>
<Descriptions.Item label="总额">{data.totalAmount}</Descriptions.Item>
<Descriptions.Item label="订单状态">{data.states == 0 ? "选菜中" : "已完成"}</Descriptions.Item>
<Descriptions.Item label="支付状态">{data.payStates == 0 ? "待支付" : "已支付"}</Descriptions.Item>
<Descriptions.Item label="OpenId">{data.createId}</Descriptions.Item>
<Descriptions.Item label="创建时间">{data.createAt}</Descriptions.Item>
</Descriptions>
<Divider
style={{
marginBottom: 32,
}}
/>
<div >餐盘信息</div>
<ProTable
style={{
marginBottom: 24,
}}
pagination={false}
search={false}
options={false}
toolBarRender={false}
dataSource={dataDiningPlate}
columns={diningPlateColumns}
rowKey="id"
/>
<div >商品信息</div>
<ProTable
style={{
marginBottom: 24,
}}
pagination={false}
search={false}
options={false}
toolBarRender={false}
dataSource={dataGoods}
columns={goodsColumns}
rowKey="id"
/>
</Card>
</Modal>
</>
</PageContainer>
);
};

export default Manage;

+ 18
- 0
src/pages/order/weighOrder/service.js View File

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

/* eslint-disable */
import { request } from 'umi';
import { getgroupmealorderUrl,getgroupmealUrl } from '@/global_data';

export default {
/** 查询称重订单*/
GetWeighOrderPage(data) {
data.isreport = true;
return request(getgroupmealorderUrl()+`/api/WeighOrder/GetWeighOrderPage`, {
method: 'Post',
data: data
});
}
};



Loading…
Cancel
Save