소스 검색

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

tags/小炒逻辑变更前
gwbvipvip 2 년 전
부모
커밋
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 { Tabs, Card, Pagination, Table, message, Button, Modal } from 'antd';
import { Tabs, Card, Pagination, Table, message, Button, Popconfirm, Modal } from 'antd';
const { TabPane } = Tabs;
import React, { useState, useRef, useEffect } from 'react';
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 CreateForm from './components/CreateForm';
import LogForm from './components/Logs';
@@ -185,12 +185,12 @@ const storeGoodsInfo = (props) => {
<a
key="primary"
onClick={() => {
var stopSales =0;
if(record.stopSales == 0)
stopSales =1;
var stopSales = 0;
if (record.stopSales == 0)
stopSales = 1;
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) => {
if (r.data) {
actionRef.current.reload();
@@ -201,20 +201,34 @@ const storeGoodsInfo = (props) => {
{' '}
{record.stopSales == 0 ? '估清' : '销售'}
</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
key="config"
onClick={() => {
@@ -222,8 +236,8 @@ const storeGoodsInfo = (props) => {
pathname: '/store/storeAddGoodsInfo',
query: {
isAdd: false,
values:record,
storeId:storeId
values: record,
storeId: storeId
},
});
}}
@@ -252,28 +266,48 @@ const storeGoodsInfo = (props) => {
rowKey="id"
search={false}
toolBarRender={() => [
// <Button
// type="primary"
// key="primary"
// onClick={() => {
// setCurrentTabRow(item.id);
// handleModalVisible(true);
// }}
// >
// <PlusOutlined /> 新增上架商品
// </Button>,
<Button
<Popconfirm
type="primary"
key="primary"
onClick={() => {
setCurrentTabRow(item.id);
title="确认估清门店所有商品"
okText="是"
cancelText="否"
onConfirm={() => {
StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 0 })
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}
bordered
@@ -335,17 +369,17 @@ const storeGoodsInfo = (props) => {
/>

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


불러오는 중...
취소
저장