Просмотр исходного кода

Merge branch 'dev' of http://10.2.1.24:10244/bpa/BPA.KitChen.Web into dev

tags/小炒逻辑变更前
gwbvipvip 2 лет назад
Родитель
Сommit
69b1e4cb1e
2 измененных файлов: 85 добавлений и 45 удалений
  1. +79
    -45
      src/pages/store/storeGoodsInfo/index.jsx
  2. +6
    -0
      src/pages/store/storeGoodsInfo/services.js

+ 79
- 45
src/pages/store/storeGoodsInfo/index.jsx Просмотреть файл

@@ -1,9 +1,9 @@
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { Tabs, Card, Pagination, Table, message, Button, Modal } from 'antd';
import { Tabs, Card, Pagination, Table, message, Button, Popconfirm, Modal } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import { GetStoreInfoPage, GetStoreGoods, AddStoreGood, UpdateStoreGoods, DelStoreGoods, UpdateStoreGoodsStatusAsync,stopgoods } from "./services"
import { GetStoreInfoPage, GetStoreGoods, AddStoreGood, UpdateStoreGoods, DelStoreGoods, UpdateStoreGoodsStatusAsync, stopgoods,StoreGoodsAllUpdate } from "./services"
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import CreateForm from './components/CreateForm'; import CreateForm from './components/CreateForm';
import LogForm from './components/Logs'; import LogForm from './components/Logs';
@@ -185,12 +185,12 @@ const storeGoodsInfo = (props) => {
<a <a
key="primary" key="primary"
onClick={() => { onClick={() => {
var stopSales =0;
if(record.stopSales == 0)
stopSales =1;
var stopSales = 0;
if (record.stopSales == 0)
stopSales = 1;
else else
stopSales =0;
var goodss =[{goodsId:record.foodId,storeId:storeId,StopSales:stopSales}];
stopSales = 0;
var goodss = [{ goodsId: record.foodId, storeId: storeId, StopSales: stopSales }];
stopgoods(goodss).then((r) => { stopgoods(goodss).then((r) => {
if (r.data) { if (r.data) {
actionRef.current.reload(); actionRef.current.reload();
@@ -201,20 +201,34 @@ const storeGoodsInfo = (props) => {
{' '} {' '}
{record.stopSales == 0 ? '估清' : '销售'} {record.stopSales == 0 ? '估清' : '销售'}
</a>, </a>,
<a
key="primary"
onClick={() => {
record.status = record.status == 0 ? 1 : 0;
stopgoods(record).then((r) => {
if (r.data) {
actionRef.current.reload();
}
});
}}
>
{' '}
{record.status == 0 ? '停用' : '正常'}
</a>,
<a
key="primary"
onClick={() => {
record.status = record.status == 0 ? 1 : 0;
UpdateStoreGoodsStatusAsync(record).then((r) => {
if (r.data) {
actionRef.current.reload();
}
});
}}
>
{' '}
{record.status == 0 ? '停用' : '正常'}
</a>,
<a
key="primary"
onClick={() => {
record.isDevice = record.isDevice == 0 ? 1 : 0;
UpdateStoreGoodsStatusAsync(record).then((r) => {
if (r.data) {
actionRef.current.reload();
}
});
}}
>
{' '}
{record.isDevice == 0 ? '设备制作' : '门店制作'}
</a>,
<a <a
key="config" key="config"
onClick={() => { onClick={() => {
@@ -222,8 +236,8 @@ const storeGoodsInfo = (props) => {
pathname: '/store/storeAddGoodsInfo', pathname: '/store/storeAddGoodsInfo',
query: { query: {
isAdd: false, isAdd: false,
values:record,
storeId:storeId
values: record,
storeId: storeId
}, },
}); });
}} }}
@@ -252,28 +266,48 @@ const storeGoodsInfo = (props) => {
rowKey="id" rowKey="id"
search={false} search={false}
toolBarRender={() => [ toolBarRender={() => [
// <Button
// type="primary"
// key="primary"
// onClick={() => {
// setCurrentTabRow(item.id);
// handleModalVisible(true);
// }}
// >
// <PlusOutlined /> 新增上架商品
// </Button>,
<Button
<Popconfirm
type="primary" type="primary"
key="primary" key="primary"
onClick={() => {
setCurrentTabRow(item.id);
title="确认估清门店所有商品"
okText="是"
cancelText="否"
onConfirm={() => {
StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 0 })
actionRef.current.reload(); actionRef.current.reload();
SetLogVisible(true);
}} }}
onCancel={() => { }}
> >
<UnorderedListOutlined /> 操作记录
</Button>

<Button type="primary" key="primary"> 估清</Button>
</Popconfirm>,
<Popconfirm
type="primary"
key="primary"
title="确认停用门店所有商品"
okText="是"
cancelText="否"
onConfirm={() => {
StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 1 })
actionRef.current.reload();
}}
onCancel={() => { }}
>
<Button type="primary" key="primary"> 停用</Button>
</Popconfirm>,
<Popconfirm
type="primary"
key="primary"
title="确认修改门店所有商品制作状态"
okText="是"
cancelText="否"
onConfirm={() => {
StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 2 })
actionRef.current.reload();
}}
onCancel={() => { }}
>
<Button type="primary" key="primary"> 门店制作</Button>
</Popconfirm>,
]} ]}
loading={loading} loading={loading}
bordered bordered
@@ -335,17 +369,17 @@ const storeGoodsInfo = (props) => {
/> />


<Modal <Modal
destroyOnClose={true}
width={800}
destroyOnClose={true}
width={800}
visible={logVisible} visible={logVisible}
footer={null} footer={null}
onCancel={() => { onCancel={() => {
SetLogVisible(false); SetLogVisible(false);
}}> }}>
<LogForm <LogForm
storeId={currentTabRow}
actionLogRef={actionLogRef}
/>
storeId={currentTabRow}
actionLogRef={actionLogRef}
/>
</Modal> </Modal>






+ 6
- 0
src/pages/store/storeGoodsInfo/services.js Просмотреть файл

@@ -77,6 +77,12 @@ export async function getGoods() {
}); });
} }


export function StoreGoodsAllUpdate(data) {
return request(`/kitchen//api/Store/StoreGoodsAllUpdate`, {
method: 'post',
data: data,
});
}




export function GetRequestLogPageAsync(data) { export function GetRequestLogPageAsync(data) {


Загрузка…
Отмена
Сохранить