diff --git a/src/pages/device/deviceStock/index.jsx b/src/pages/device/deviceStock/index.jsx index 7dfcb80..61cdf43 100644 --- a/src/pages/device/deviceStock/index.jsx +++ b/src/pages/device/deviceStock/index.jsx @@ -13,7 +13,8 @@ import { CheckStockAdjust, removeSingleStockAdjust, PushDeviceTMC, - CheckStockTMCAdjust + CheckStockTMCAdjust, + PushDeviceTMC_MT } from './services'; const key = 'message'; @@ -54,7 +55,23 @@ const DeviceStockManager = (props) => { const pushStock = async (id) => { try { message.loading('正在同步', key); - if (props.isbom) { + if (props.values.deviceTypeKey =="TMC_MT") { + await PushDeviceTMC_MT(id).then((r) => { + message.destroy(key); + if (r.data) { + setSelectedRows([]); + message.success('同步成功'); + actionRef.current.reload(); + return true; + } else { + message.success('同步失败'); + actionRef.current.reload(); + return false; + } + } + ); + } + else if (props.isbom) { await PushDeviceTMC(id).then((r) => { message.destroy(key); if (r.data) { diff --git a/src/pages/device/deviceStock/services.js b/src/pages/device/deviceStock/services.js index d125816..78e2602 100644 --- a/src/pages/device/deviceStock/services.js +++ b/src/pages/device/deviceStock/services.js @@ -22,6 +22,14 @@ export async function PushStockAsync(data) { }); } +/** 同步库存 */ +export async function PushDeviceTMC_MT(data) { + return request(`/kitchen/api/Device/PushDeviceTMC_MT?DeviceId=${data}`, { + method: 'post', + }); +} + + /** 获取实时库存 */ export async function CheckStockAdjust(data) { return request(`/kitchen/api/Device/CheckStockAdjust?DeviceId=${data}`, { diff --git a/src/pages/goods/goodsInfo/index.jsx b/src/pages/goods/goodsInfo/index.jsx index c757976..ba38a73 100644 --- a/src/pages/goods/goodsInfo/index.jsx +++ b/src/pages/goods/goodsInfo/index.jsx @@ -1,18 +1,19 @@ import { PlusOutlined, UploadOutlined } from '@ant-design/icons'; -import { Button, Card, message, Steps, Empty, Form, Input, Upload, Select, InputNumber } from 'antd'; +import { Button, Card, message, Steps, Empty, Form, Input, Upload, Select, InputNumber, Switch } from 'antd'; import { GridContent, PageContainer, RouteContext } from '@ant-design/pro-layout'; import React, { Fragment, useRef, useState, useEffect } from 'react'; import classNames from 'classnames'; import ProTable from '@ant-design/pro-table'; import GoodsbomFrom from './components/GoodsbomFrom'; import { addGoods, goodsType, goodsbigType, getgoodsTaste } from '../newgoods/service'; -import { GetGoodsBom, AddBomApi, DelGoodsBom, GetCosRequestURL } from './service' +import { GetGoodsBom, AddBomApi, DelGoodsBom, GetCosRequestURL, unitList } from './service' import axios from 'axios'; const { Step } = Steps; const { Option, OptGroup } = Select; const Advanced = (props) => { const [form] = Form.useForm(); const [goodsTypes, setGoodsTypes] = useState([]); + const [goodsUnit, setGoodsUnit] = useState([]); const [goodsBigTypes, setGoodsBigTypes] = useState([]); const [goodsTaste, setGoodsTaste] = useState([]); const [setGoodsBomModalVisible, handleGoodsBomModalVisible] = useState(); @@ -111,10 +112,10 @@ const Advanced = (props) => { SetCurrTabKey(tabStatus.tabActiveKey); }, [tabStatus]) const onTabChange = (key) => { - if (currentGoodsProp === 1) { - message.info('套餐不能设置配方'); - return; - } + if (currentGoodsProp === 1) { + message.info('套餐不能设置配方'); + return; + } seTabStatus({ operationKey: key, tabActiveKey: key }); }; @@ -217,6 +218,21 @@ const Advanced = (props) => { + + + @@ -297,6 +313,11 @@ const Advanced = (props) => { + + + + +