diff --git a/config/routes.js b/config/routes.js index d2ceac2..eea84bc 100644 --- a/config/routes.js +++ b/config/routes.js @@ -234,6 +234,34 @@ export default [ }, ], }, + { + name: '设备数据下发', + icon: 'BankFilled', + path: '/push', + routes: [ + { + name: '商品数据下发', + icon: 'smile', + path: '/push/goodspush', + component: './push/goodspush', + access: 'k12', + }, + { + name: '物料数据下发', + icon: 'smile', + path: '/push/batchingpush', + component: './push/batchingpush', + access: 'k14', + }, + { + name: '配方数据下发', + icon: 'smile', + path: '/push/bompush', + component: './push/bompush', + access: 'k14', + }, + ], + }, { name: '订单管理', icon: 'BankFilled', diff --git a/src/pages/push/batchingpush/index.jsx b/src/pages/push/batchingpush/index.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/push/bompush/index.jsx b/src/pages/push/bompush/index.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/push/goodspush/components/PushFrom.jsx b/src/pages/push/goodspush/components/PushFrom.jsx new file mode 100644 index 0000000..3065322 --- /dev/null +++ b/src/pages/push/goodspush/components/PushFrom.jsx @@ -0,0 +1,132 @@ +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 actionRef = useRef(); + useEffect(() => { + console.log(props.values) + GetDeviceList().then((r)=>{ + 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) + }} + onCancel={() => { + props.onCancel(); + }} + destroyOnClose + > + + + 选择设备: +