diff --git a/config/routes.js b/config/routes.js index 439e8ba..5bc59bd 100644 --- a/config/routes.js +++ b/config/routes.js @@ -357,6 +357,41 @@ 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: 'smile', + path: '/push/technologypush', + component: './push/technologypush', + access: 'k14', + }, + ], + }, { name: '订单管理', icon: 'BankFilled', diff --git a/src/pages/push/batchingpush/components/PushFrom.jsx b/src/pages/push/batchingpush/components/PushFrom.jsx index 5386ccf..983baae 100644 --- a/src/pages/push/batchingpush/components/PushFrom.jsx +++ b/src/pages/push/batchingpush/components/PushFrom.jsx @@ -114,4 +114,4 @@ const PushFrom = (props) => { ); }; -export default PushFrom; \ No newline at end of file +export default PushFrom; diff --git a/src/pages/push/batchingpush/index.jsx b/src/pages/push/batchingpush/index.jsx index c41075b..905a902 100644 --- a/src/pages/push/batchingpush/index.jsx +++ b/src/pages/push/batchingpush/index.jsx @@ -80,15 +80,10 @@ const goodspush = () => { dataIndex: 'type', ellipsis: true, valueEnum: { - 1: { - text: '商品', - }, 2: { text: '物料', }, - 3: { - text: '配方', - }, + }, }, { @@ -255,7 +250,7 @@ const HandleOk= async(values)=>{ {currentRow?.topic} - + {currentRow?.dataResore} @@ -265,4 +260,4 @@ const HandleOk= async(values)=>{ ); }; -export default goodspush; \ No newline at end of file +export default goodspush; diff --git a/src/pages/push/batchingpush/services.js b/src/pages/push/batchingpush/services.js index ded9185..26ef687 100644 --- a/src/pages/push/batchingpush/services.js +++ b/src/pages/push/batchingpush/services.js @@ -36,4 +36,4 @@ export async function GetDevicePushRecodePage(data) { // params: { ...params }, // ...(options || {}), }); - } \ No newline at end of file + } diff --git a/src/pages/push/goodspush/components/PushFrom.jsx b/src/pages/push/goodspush/components/PushFrom.jsx index 388a0ea..b1b0eb6 100644 --- a/src/pages/push/goodspush/components/PushFrom.jsx +++ b/src/pages/push/goodspush/components/PushFrom.jsx @@ -89,18 +89,18 @@ const PushFrom = (props) => { }else{ var de=DeviceInfo.find(x=>x.id==DeviceIds); var data={goodsinfo:[]}; - if(isGlogy){ - data.goodstechnology=[] - } + // if(isGlogy){ + // data.goodstechnology=[] + // } selectedRowsState.map(x=>{ var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} data.goodsinfo.push(pa); - if(isGlogy){ - //data.goodstechnology=[] - if(x.goodstechnology.length>0){ - data.goodstechnology.push(x.goodstechnology) - } - } + // if(isGlogy){ + // //data.goodstechnology=[] + // if(x.goodstechnology.length>0){ + // data.goodstechnology.push(x.goodstechnology) + // } + // } }) var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:1,data:data} props.HandleOk(parm) @@ -126,12 +126,12 @@ const PushFrom = (props) => { - +{/* 是否包含工艺: - + */} 选择数据: @@ -158,4 +158,4 @@ const PushFrom = (props) => { ); }; -export default PushFrom; \ No newline at end of file +export default PushFrom; diff --git a/src/pages/push/goodspush/index.jsx b/src/pages/push/goodspush/index.jsx index e9e6a25..53e5257 100644 --- a/src/pages/push/goodspush/index.jsx +++ b/src/pages/push/goodspush/index.jsx @@ -83,12 +83,7 @@ const goodspush = () => { 1: { text: '商品', }, - 2: { - text: '物料', - }, - 3: { - text: '配方', - }, + }, }, { @@ -255,7 +250,7 @@ const HandleOk= async(values)=>{ {currentRow?.topic} - + {currentRow?.dataResore} @@ -265,4 +260,4 @@ const HandleOk= async(values)=>{ ); }; -export default goodspush; \ No newline at end of file +export default goodspush; diff --git a/src/pages/push/goodspush/services.js b/src/pages/push/goodspush/services.js index da55d51..4af60f4 100644 --- a/src/pages/push/goodspush/services.js +++ b/src/pages/push/goodspush/services.js @@ -43,4 +43,4 @@ export async function GetDevicePushRecodePage(data) { // params: { ...params }, // ...(options || {}), }); - } \ No newline at end of file + } diff --git a/src/pages/push/technologypush/components/PushFrom.jsx b/src/pages/push/technologypush/components/PushFrom.jsx new file mode 100644 index 0000000..e4f8369 --- /dev/null +++ b/src/pages/push/technologypush/components/PushFrom.jsx @@ -0,0 +1,166 @@ +import React, { useState, useEffect,useRef } from 'react'; +import { Modal, Row, Col, Checkbox, Select,message,Switch} 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 [isGlogy, setisGlogy] = useState(false); + 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} + GetGoodsData(params) + },[props.values]) + const GetGoodsData=(params)=>{ + GetGoodsPage(params).then((r) => { + setdataSource(r.data.data); + //console.log(goodsData) + //total = r.data.total; + }); + } + const handleChange=(value)=>{ + setDeviceIds(value) + var params={current:1,pageSize:10,deviceId:value} + GetGoodsData(params) + } + const onChange=(checked)=>{ + if(!DeviceIds){ + message.error('请先选择设备'); + }else{ + setisGlogy(checked) + + } + + } + 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 ( + { + if(!DeviceIds){ + message.error('请选择设备'); + }else{ + var de=DeviceInfo.find(x=>x.id==DeviceIds); + var data={goodstechnology:[]}; + // if(isGlogy){ + // data.goodstechnology=[] + // } + selectedRowsState.map(x=>{ + // var pa={id:x.id,code:x.code,goodsTypeId:x.goodsTypeId,goodsTypeName:x.goodsTypeName,goodsUintId:x.goodsUintId,imgUrl:x.imgUrl,isAttrubute:x.isAttrubute,name:x.name,price:x.price,design:x.design,remark:x.remark} + // data.goodsinfo.push(pa); + // if(isGlogy){ + // //data.goodstechnology=[] + if(x.goodstechnology.length>0){ + data.goodstechnology.push(x.goodstechnology) + } + // } + }) + if(data.goodstechnology.length==0){ + message.error('选择的商品还没有工艺'); + }else{ + var parm={deviceId:de.id,deviceName:de.name,deviceAutoKey:de.autoKey,type:4,data:data} + props.HandleOk(parm) + console.log(de) + } + + } + }} + onCancel={() => { + props.onCancel(); + }} + destroyOnClose + > + + + 选择设备: +