From 7bd6d19f63fab157e59a696fa6c167147af1f8b5 Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Thu, 25 Jan 2024 09:54:52 +0800 Subject: [PATCH 1/4] z --- config/routes.js | 1 + .../push/goodspush/components/PushFrom.jsx | 137 ------------------ 2 files changed, 1 insertion(+), 137 deletions(-) delete mode 100644 src/pages/push/goodspush/components/PushFrom.jsx diff --git a/config/routes.js b/config/routes.js index 56f243d..9e99c34 100644 --- a/config/routes.js +++ b/config/routes.js @@ -213,6 +213,7 @@ export default [ // }, ], }, + { path: '/', redirect: '/welcome', diff --git a/src/pages/push/goodspush/components/PushFrom.jsx b/src/pages/push/goodspush/components/PushFrom.jsx deleted file mode 100644 index b92e5bf..0000000 --- a/src/pages/push/goodspush/components/PushFrom.jsx +++ /dev/null @@ -1,137 +0,0 @@ -import React, { useState, useEffect,useRef } from 'react'; -import { Modal, Row, Col, Checkbox, Select} from 'antd'; -import ProTable from '@ant-design/pro-table'; -import { - GetDeviceList, - GetGoodsPage, - GetGoodsTypeTree -} from '../services'; -const PushFrom = (props) => { - const [deviceData, setdeviceData] = useState([]); - const [selectedRowsState, setSelectedRows] = useState([]); - const [dataSource,setdataSource]= useState([]); - const [treeData, setTreeData] = useState(); - const [DeviceIds, setDeviceIds] = useState([]); - const [DeviceInfo, setDeviceInfo] = useState([]); - const actionRef = useRef(); - useEffect(() => { - console.log(props.values) - GetDeviceList().then((r)=>{ - setDeviceInfo(r.data); - var data=r.data.map(x=>{ - return {value:x.id,label:x.name} - }) - setdeviceData(data) - }) - GetGoodsTypeTree().then((r) => { - setTreeData(r.data); - }); - var params={current:1,pageSize:10} - GetGoodsPage(params).then((r) => { - setdataSource(r.data.data); - //console.log(goodsData) - //total = r.data.total; - }); - },[props.values]) - const handleChange=(value)=>{ - setDeviceIds(value) - } - const columns=[ - { - title: '编码', - dataIndex: 'code', - valueType: 'textarea', - hideInTable: true, - hideInSearch: true, - }, - { - title: '名称', - dataIndex: 'name', - valueType: 'textarea', - }, - { - title: '商品类型', - dataIndex: 'goodsTypeName', - valueType: 'treeSelect', - fieldProps: { - showSearch:true, - allowClear:true, - options: treeData - }, - }, - ] - return ( - { - console.log(selectedRowsState) - console.log(DeviceIds) - if(DeviceIds.length>0){ - - } - }} - onCancel={() => { - props.onCancel(); - }} - destroyOnClose - > - - - 选择设备: - { operationKey: props.location.query.tabStatus ? props.location.query.tabStatus : 'basis', tabActiveKey: props.location.query.tabStatus ? props.location.query.tabStatus : 'basis', }); + const { Paragraph, Text } = Typography; useEffect(() => { console.log("props.location",props.location) SetCurrTabKey(tabStatus.tabActiveKey); @@ -280,6 +281,7 @@ const bomtechnology = (props) => { valueType: 'textarea', ellipsis: true, search: true, + render: (text) => {text}, }, { title: '类型', From 0b6054da4910050c053998abc55a60c71131c54d Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Thu, 25 Jan 2024 11:37:25 +0800 Subject: [PATCH 3/4] z --- src/pages/device/productmanage/index.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/device/productmanage/index.jsx b/src/pages/device/productmanage/index.jsx index eff6f4a..53e944d 100644 --- a/src/pages/device/productmanage/index.jsx +++ b/src/pages/device/productmanage/index.jsx @@ -87,7 +87,6 @@ const bomtechnology = (props) => { operationKey: props.location.query.tabStatus ? props.location.query.tabStatus : 'basis', tabActiveKey: props.location.query.tabStatus ? props.location.query.tabStatus : 'basis', }); - const { Paragraph, Text } = Typography; useEffect(() => { console.log("props.location",props.location) SetCurrTabKey(tabStatus.tabActiveKey); @@ -279,8 +278,6 @@ const bomtechnology = (props) => { title: 'Topics类', dataIndex: 'topics', valueType: 'textarea', - ellipsis: true, - search: true, render: (text) => {text}, }, { From 298a4183ddcd8f95591a2dea752a571cf417ecbd Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Thu, 25 Jan 2024 17:42:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 7 - .../deviceInfo/components/CreateForm.jsx | 4 +- .../deviceInfo/components/DeviceFood.jsx | 216 --------------- .../deviceInfo/components/StockMaterial.jsx | 195 -------------- .../components/StockMaterialForm.jsx | 151 ----------- src/pages/device/deviceInfo/index.jsx | 26 +- .../device/devicepush/components/PushFrom.jsx | 67 ----- src/pages/device/devicepush/index.jsx | 254 ------------------ src/pages/device/devicepush/services.js | 30 --- 9 files changed, 4 insertions(+), 946 deletions(-) delete mode 100644 src/pages/device/deviceInfo/components/DeviceFood.jsx delete mode 100644 src/pages/device/deviceInfo/components/StockMaterial.jsx delete mode 100644 src/pages/device/deviceInfo/components/StockMaterialForm.jsx delete mode 100644 src/pages/device/devicepush/components/PushFrom.jsx delete mode 100644 src/pages/device/devicepush/index.jsx delete mode 100644 src/pages/device/devicepush/services.js diff --git a/config/routes.js b/config/routes.js index 9e99c34..f2a56e3 100644 --- a/config/routes.js +++ b/config/routes.js @@ -190,13 +190,6 @@ export default [ component: './device/productmanage', access: 'k14', }, - { - name: '设备数据下发', - icon: 'smile', - path: '/device/devicepush', - component: './device/devicepush', - access: 'k14', - }, // { // name: '设备工艺信息', // icon: 'smile', diff --git a/src/pages/device/deviceInfo/components/CreateForm.jsx b/src/pages/device/deviceInfo/components/CreateForm.jsx index 56c2790..d34c003 100644 --- a/src/pages/device/deviceInfo/components/CreateForm.jsx +++ b/src/pages/device/deviceInfo/components/CreateForm.jsx @@ -117,12 +117,12 @@ const CreateForm = (props) => { )} /> - + {/* 工艺 配方 - + */} - , - ]} - //数据绑定 - request={async (params) => { - if (!foodMenuId) return []; - const response = await GetByDeviceGoods({ - ...params, - foolMenuId: foodMenuId, - storeId: props.device.orgId, - foodName: params.goodsName || "" - }); - if (response.statusCode === 200) { - if (response.data.total>0) { - const set = new Set([...selectedRowKeys, ...response.data.data.checkedIds]); - const setArray = []; - set.forEach(item => { - setArray.push(item); - }); - setSelectedRowKeys(setArray); - }else{ - setSelectedRowKeys([]) - } - return { - data: response.data?.data?.data || [], - success: true, - total: response.data.total, - }; - } else { - return [] - } - }} - columns={columns} - rowSelection={{ - type: 'checkbox', - selectedRowKeys, - onSelect: (record, selected) => { - const tempArray = [...selectedRowKeys]; - const findIndex = tempArray.findIndex(item => item === record.goodsId); - if (selected) { - findIndex < 0 && tempArray.push(record.goodsId); - } else { - findIndex > -1 && tempArray.splice(findIndex, 1); - } - setSelectedRowKeys(tempArray); - }, - onSelectAll: (selected, selectedRows, changeRows) => { - const tempArray = [...selectedRowKeys]; - if (selected) { - selectedRows.forEach(item => { - if (!item) return; - const findIndex = tempArray.findIndex(fItem => fItem === item.goodsId); - if (findIndex < 0) { - tempArray.push(item.goodsId); - } - }); - } else { - changeRows.forEach(item => { - const findIndex = tempArray.findIndex(fItem => fItem === item.goodsId); - if (findIndex > -1) { - tempArray.splice(findIndex, 1); - } - }); - } - setSelectedRowKeys(tempArray); - } - }} - tableAlertOptionRender={() => { - return ( - - setSelectedRowKeys([])} - okText="确定" - cancelText="取消" - > - 取消选择 - - - ); - }} - /> - - ); -}; - -export default DeviceFood; diff --git a/src/pages/device/deviceInfo/components/StockMaterial.jsx b/src/pages/device/deviceInfo/components/StockMaterial.jsx deleted file mode 100644 index 2ba034c..0000000 --- a/src/pages/device/deviceInfo/components/StockMaterial.jsx +++ /dev/null @@ -1,195 +0,0 @@ -import { Modal, message, Popconfirm, Button } from 'antd'; -import React, { useEffect, useState, useRef } from 'react'; -import ProTable from '@ant-design/pro-table'; -import { GetDeviceStorePage, removeSingleStockAdjust, PushStockAsync, CheckStockAdjust } from '../services'; -import StockMaterialForm from "./StockMaterialForm"; -import { PlusOutlined } from '@ant-design/icons'; - -const StockMaterial = (props) => { - const actionRef = useRef(); - - // 是否展示库存弹窗 - const [showStockForm, setShowStockForm] = useState(false); - // 当前操作的库存 - const [currStock, setCurrStock] = useState(); - - const columns = [ - { - title: '主键', - dataIndex: 'id', - hideInSearch: true, - hideInTable: true, - tip: '规则名称是唯一的 key', - }, - { - title: '物料', - dataIndex: 'batching_Name', - valueType: 'textarea', - }, - { - title: '数量', - dataIndex: 'batching_Count', - valueType: 'textarea', - }, - { - title: '库位', - dataIndex: 'batching_Loc', - }, - { - title: '操作', - dataIndex: 'option', - valueType: 'option', - render: (_, record) => [ - { - setCurrStock(record); - setShowStockForm(true); - }} - > - 修改 - , - handleDelete(record)} - > - 删除 - , - ], - }, - ]; - - const handleOk = () => { - props.onOk(); - } - - /** - * 删除库存原料 - * @param {*} record - */ - const handleDelete = async (record) => { - const response = await removeSingleStockAdjust(record.id); - if (response.data) { - message.success('删除成功'); - actionRef.current.reload(); - } else { - message.error('删除失败,请重试'); - } - } - - useEffect(() => { - - }, []); - - return ( - props.onCancel()} - onOk={handleOk} - maskClosable={false} - > - [ - { - const response = await CheckStockAdjust(props.device.id); - if (response.data) { - message.success('获取实时库存会成功!'); - actionRef.current.reload(); - } else { - message.error(response.errors || '获取实时库存会失败!'); - } - }} - > - - , - { - const response = await PushStockAsync(props.device.id); - if (response.data) { - message.success('同步成功!'); - actionRef.current.reload(); - } else { - message.error(response.errors || '同步失败!'); - } - }} - > - - , - - ]} - request={async (params) => { - const response = await GetDeviceStorePage(params); - if (response.statusCode === 200) { - return { - data: response.data.data, - success: true, - total: response.data.total, - }; - } - return []; - }} - columns={columns} - /> - - { - showStockForm && { - setShowStockForm(false); - actionRef.current.reload(); - }} - onCancel={() => setShowStockForm(false)} - > - - - } - - ); -}; - -export default StockMaterial; diff --git a/src/pages/device/deviceInfo/components/StockMaterialForm.jsx b/src/pages/device/deviceInfo/components/StockMaterialForm.jsx deleted file mode 100644 index 5146c84..0000000 --- a/src/pages/device/deviceInfo/components/StockMaterialForm.jsx +++ /dev/null @@ -1,151 +0,0 @@ -import { Modal, message, Form, Input, Select, InputNumber, Button, Popconfirm } from 'antd'; -import React, { useEffect, useState } from 'react'; -import { AddStoreBatchingStocAsync, UpdateStoreBatchingStocAsync, getloc, GetBatchingAsync } from '../services'; -const key = 'message'; - -/** - * 更新 - * @param {*} props - * @returns - */ -const StockMaterialForm = (props) => { - - const [form] = Form.useForm(); - // 位置信息 - const [loc, setloc] = useState([]); - const [batchingList, setBatchingList] = useState([]); - - const handleOk = async () => { - const formData = await form.validateFields(); - formData.DeviceId = props.device.id; - if (formData.id) { - await UpdateStoreBatchingStocAsync(formData).then((r) => { - message.destroy(key); - if (r.data) { - message.success('修改成功'); - props.onOk(); - } else { - message.error('修改失败' + r.errors); - } - }); - } else { - await AddStoreBatchingStocAsync(formData).then((r) => { - message.destroy(key); - if (r.data) { - message.success('添加成功'); - props.onOk(); - } else { - message.error('添加失败' + r.errors); - } - }); - } - } - - /** - * 获取设备位置信息 - */ - const onFetchLoc = async () => { - getloc(props.device.deviceTypeKey).then((data) => { - setloc(data.data); - }); - } - - /** - * 获取原料列表 - */ - const getBatchingAsync = async () => { - GetBatchingAsync({ DeviceId: props.device.id }).then((data) => { - setBatchingList(data.data); - }); - } - - useEffect(() => { - if (props.stockMaterial?.id) { - form.setFieldsValue(props.stockMaterial); - } - onFetchLoc(); - getBatchingAsync(); - }, []); - - - return ( - - 取消 - , - - - - ]} - > -
- - - - - - - - - - -
-
- ); -}; - -export default StockMaterialForm; diff --git a/src/pages/device/deviceInfo/index.jsx b/src/pages/device/deviceInfo/index.jsx index cc20dc0..832ccbb 100644 --- a/src/pages/device/deviceInfo/index.jsx +++ b/src/pages/device/deviceInfo/index.jsx @@ -17,8 +17,7 @@ import { GoodsTemplateExport, } from './services'; import { gettree } from '../../org/orgamange/service'; -import DeviceFood from './components/DeviceFood'; -import StockMaterial from './components/StockMaterial'; + import { values } from 'lodash'; const key = 'message'; @@ -31,12 +30,7 @@ const GoodsTypeManage = () => { const [OrgListArray, setOrgListArray] = useState([]); const [dicDataAny, setDicDataAny] = useState([]); const [dicData, setDicData] = useState([]); - const [DeviceVesionData, setDeviceVesionData] = useState([]); const [deviceVersion, setDeviceVersion] = useState([]); - // 是否显示 设备商品弹窗 - const [deviceFoodModal, setDeviceFoodModal] = useState(); - // 是否显示 库存物料弹窗 - const [stockModal, setStockModal] = useState(false); /** 新建/更新窗口的弹窗 */ const [createModalVisible, handleModalVisible] = useState(false); /** 分布更新窗口的弹窗 */ @@ -431,23 +425,7 @@ const handleRemove = async (selectedRows) => { deviceVersions={deviceVersion} values={currentRow || {}} /> - {deviceFoodModal && ( - setDeviceFoodModal(false)} - onCancel={() => setDeviceFoodModal(false)} - > - )} - - {stockModal && ( - setStockModal(false)} - onCancel={() => setStockModal(false)} - > - )} + ); }; diff --git a/src/pages/device/devicepush/components/PushFrom.jsx b/src/pages/device/devicepush/components/PushFrom.jsx deleted file mode 100644 index 5558776..0000000 --- a/src/pages/device/devicepush/components/PushFrom.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import React, { useState, useEffect,useRef } from 'react'; -import { Modal, Row, Col, Checkbox, Select} from 'antd'; -import { - GetDeviceList, -} from '../services'; -const PushFrom = (props) => { - const [deviceData, setdeviceData] = useState([]); - useEffect(() => { - console.log(props.values) - GetDeviceList().then((r)=>{ - var data=r.data.map(x=>{ - return {value:x.id,label:x.name} - }) - setdeviceData(data) - }) - },[props.values]) - const handleChange=()=>{ - - } - const onChangedata=()=>{ - - } - return ( - { - }} - onCancel={() => { - props.onCancel(); - }} - destroyOnClose - > - - - 选择设备: -