From c32cf61c0bee2257759af91c451881e71cfbf158 Mon Sep 17 00:00:00 2001 From: txb Date: Wed, 13 Jul 2022 16:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E5=BA=97=E9=93=BA=E5=95=86?= =?UTF-8?q?=E5=93=81):=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E9=94=AE=20=E4=BC=B0?= =?UTF-8?q?=E6=B8=85=EF=BC=8C=E4=B8=8B=E6=9E=B6=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=B6=E4=BD=9C=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/store/storeGoodsInfo/index.jsx | 124 +++++++++++++-------- src/pages/store/storeGoodsInfo/services.js | 6 + 2 files changed, 85 insertions(+), 45 deletions(-) diff --git a/src/pages/store/storeGoodsInfo/index.jsx b/src/pages/store/storeGoodsInfo/index.jsx index aa7c4be..23c67dd 100644 --- a/src/pages/store/storeGoodsInfo/index.jsx +++ b/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) => { { - 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 ? '估清' : '销售'} , - { - record.status = record.status == 0 ? 1 : 0; - stopgoods(record).then((r) => { - if (r.data) { - actionRef.current.reload(); - } - }); - }} - > - {' '} - {record.status == 0 ? '停用' : '正常'} - , + { + record.status = record.status == 0 ? 1 : 0; + UpdateStoreGoodsStatusAsync(record).then((r) => { + if (r.data) { + actionRef.current.reload(); + } + }); + }} + > + {' '} + {record.status == 0 ? '停用' : '正常'} + , + { + record.isDevice = record.isDevice == 0 ? 1 : 0; + UpdateStoreGoodsStatusAsync(record).then((r) => { + if (r.data) { + actionRef.current.reload(); + } + }); + }} + > + {' '} + {record.isDevice == 0 ? '设备制作' : '门店制作'} + , { @@ -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={() => [ - // , - - + + , + { + StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 1 }) + actionRef.current.reload(); + }} + onCancel={() => { }} + > + + , + { + StoreGoodsAllUpdate({ StoreId: item.id, UpdateType: 2 }) + actionRef.current.reload(); + }} + onCancel={() => { }} + > + + , ]} loading={loading} bordered @@ -335,17 +369,17 @@ const storeGoodsInfo = (props) => { /> { SetLogVisible(false); }}> + storeId={currentTabRow} + actionLogRef={actionLogRef} + /> diff --git a/src/pages/store/storeGoodsInfo/services.js b/src/pages/store/storeGoodsInfo/services.js index a5fcb12..05bb17f 100644 --- a/src/pages/store/storeGoodsInfo/services.js +++ b/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) {