|
|
@@ -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> |
|
|
|
|
|
|
|
|
|
|
|