diff --git a/src/components/WareManager/StockQuery.js b/src/components/WareManager/StockQuery.js new file mode 100644 index 0000000000000000000000000000000000000000..c9648858db9b9e174669231308d0d27b9325fa06 --- /dev/null +++ b/src/components/WareManager/StockQuery.js @@ -0,0 +1,87 @@ +import React, { useState, useEffect } from "react"; +import axios from "axios"; +import { Table } from "antd"; +import { FiSearch } from "react-icons/fi"; +import { DatePicker, Space, ConfigProvider } from "antd"; +import locale from "antd/lib/locale/zh_CN"; + +import { wareCategories } from "../../utils/data"; +import Selector from "../Selector"; +import InputArea from "../InputArea"; +/* +class StockQuery extends React.Component{ + constructor(props){ + super(props); + this.state={ + queryCate:null, + queryDate:null, + queryInfo:null, + } + this.cateChange=this.cateChange.bind(this); + this.dateChange=this.dateChange.bind(this); + this.query=this.query.bind(this); + } + + cateChange(event){ + this.setState({ + queryCate:event.target.value, + }) + } + + dateChange(date, dateString){ + this.setState({ + queryDate:dateString, + }) + console.log(date, dateString); + } + + query(event){ + this.props.mockStockData=this.props.dataSource.filter(item=>item.time==this.state.queryDate), + + event.preventDefault(); + } + + render(){ + return( +
+
+
+ + + + + + + + + + + + + +
+
+ ) + } +} + +export default StockQuery;*/ \ No newline at end of file diff --git a/src/mock/index.js b/src/mock/index.js index 944b07974699b03d37488d5e35ccc0b224ebf428..8049d341de913189f5963aa1438a38811ff2f469 100644 --- a/src/mock/index.js +++ b/src/mock/index.js @@ -91,7 +91,7 @@ Mock.mock("/admin/ware-manager/stock", { in: /[1-7][0-9]/, out: /[1-7][0-9]/, recent: /[1-7][0-9]/, - time: "@datetime", + time: "@date", }, ], }, diff --git a/src/mock/userindex.js b/src/mock/userindex.js index fa46fa0827e4179abd75de0884ee39a3f736954e..25d8fde0d6e3a4f09cd132bc49d4bcca9e9c7e00 100644 --- a/src/mock/userindex.js +++ b/src/mock/userindex.js @@ -263,11 +263,16 @@ Mock.mock("/user/userhome/manage/instorage/order", { productName:"@name", "price|500-10000":500, productImage:"", - productType:"", + "productType|1":[ + "易碎品", + "冷冻品", + "食品", + "易爆物", + ], storgeName: /[0-4][1-9]仓/, storgePosition: "@county(true)", }, ], }, -}); \ No newline at end of file +}); diff --git a/src/userComponents/userManageCenter/homeDocuments/DocumentsManage.js b/src/userComponents/userManageCenter/homeDocuments/DocumentsManage.js index 0d2c1ff433c9bd4cde16ae978443325de5c16d14..f4697c054854fc5add61c945668a8eda3f7fb1f0 100644 --- a/src/userComponents/userManageCenter/homeDocuments/DocumentsManage.js +++ b/src/userComponents/userManageCenter/homeDocuments/DocumentsManage.js @@ -30,9 +30,27 @@ class DocumentsManage extends React.Component{ this.handleOk=this.handleOk.bind(this); this.cancelApp=this.cancelApp.bind(this); this.showModal=this.showModal.bind(this); + //this.newBtn=this.newBtn.bind(this); } componentDidMount() { + + axios.post('/user/userhome/manage/instorage/order', { + //firstName: 'Fred', + //lastName: 'Flintstone' + }) + .then(response=> { + console.log(response); + this.setState({ + dataSource:response.data.result.list, + dataSource2:response.data.result.list, + queryData:response.data.result.list, + }); + }) + .catch(function (error) { + console.log(error); + }); + /* axios.get("/user/userhome/manage/instorage/order").then(res => { this.setState({ dataSource:res.data.result.list, @@ -40,6 +58,7 @@ class DocumentsManage extends React.Component{ queryData:res.data.result.list, }); }); + */ } @@ -142,9 +161,35 @@ class DocumentsManage extends React.Component{ }else{ alert("无法取消"); } - console.log(this.state.dataSource); + + this.setState({ + dataSource:this.state.dataSource, + //queryData:this.state.dataSource + }) } + /* + newBtn(event){ + switch(this.state.showType){ + case "all": + this.setState({ + dataSource2:this.state.dataSource, + queryData:this.state.dataSource, + }) + break; + case "in": + this.setState({ + showType:"all", + showType:"in", + dataSource2:this.state.dataSource.filter(item=>item.orderType=="入库"), + queryData:this.state.dataSource.filter(item=>item.orderType=="入库"), + }) + break; + } + + event.preventDefault(); + } +*/ handleOk(){ this.setState({ @@ -175,14 +220,6 @@ class DocumentsManage extends React.Component{ title:'单据编号', dataIndex:'orderId', }, - { - title:'货物名称', - dataIndex:'productName', - }, - { - title:'货物数量', - dataIndex:'amount', - }, { title:'单据状态', dataIndex:'orderStatus', @@ -194,7 +231,10 @@ class DocumentsManage extends React.Component{ return(
+ {record.orderStatus=="待完成"? + :} +
) @@ -204,31 +244,6 @@ class DocumentsManage extends React.Component{ ] - storgeColumns=[ - { - title:'货物名称', - dataIndex:'goodsName', - }, - - { - title:'货物数量', - dataIndex:'goodsNum', - }, - { - title:'所在仓库', - dataIndex:'storgeName', - }, - { - title:'仓库地址', - dataIndex:'storgePosition', - }, - { - title:'存储到期时间', - dataIndex:'storageExpirationTime', - }, - - ] - render(){ return(
@@ -279,16 +294,21 @@ class DocumentsManage extends React.Component{ - + + {/** */} +
- { } diff --git a/src/userComponents/userManageCenter/homeGoods/QueryGoods.js b/src/userComponents/userManageCenter/homeGoods/QueryGoods.js index d8b9724be4c7e2f06d56a0cf13b991b0e9b5ded6..97d5d29c3d775b3791c1425e873a2cd5669aa74e 100644 --- a/src/userComponents/userManageCenter/homeGoods/QueryGoods.js +++ b/src/userComponents/userManageCenter/homeGoods/QueryGoods.js @@ -14,22 +14,40 @@ class QueryGoods extends React.Component{ dataSource:[], detailData:[], queryName:null, + queryId:null, queryData:[], } this.showAllGoods=this.showAllGoods.bind(this); this.showGoodsStorge=this.showGoodsStorge.bind(this); this.nameChange=this.nameChange.bind(this); + this.idChange=this.idChange.bind(this); this.queryOrder=this.queryOrder.bind(this); + } componentDidMount() { - + axios.post('/user/userhome/manage/instorage/order', { + //firstName: 'Fred', + //lastName: 'Flintstone' + }) + .then(response=> { + console.log(response); + this.setState({ + dataSource:response.data.result.list, + queryData:response.data.result.list, + }); + }) + .catch(function (error) { + console.log(error); + }); + /* axios.get("/user/userhome/manage/instorage/order").then(res => { this.setState({ dataSource:res.data.result.list, queryData:res.data.result.list, }); }); + */ } @@ -44,15 +62,34 @@ class QueryGoods extends React.Component{ }) } } + idChange(event){ + if(event.target.value==""){ + this.setState({ + queryId:null, + }) + }else{ + this.setState({ + queryId:event.target.value, + }) + } + } queryOrder(event){ - if(this.state.queryName==null){ + if(this.state.queryId==null&&this.state.queryName==null){ this.setState({ queryData:this.state.dataSource, }) + }else if(this.state.queryId!=null&&this.state.queryName==null){ + this.setState({ + queryData:this.state.dataSource.filter(item=>item.productId==this.state.queryId), + }) + }else if(this.state.queryId==null&&this.state.queryName!=null){ + this.setState({ + queryData:this.state.dataSource.filter(item=>item.productName==this.state.queryName), + }) }else{ this.setState({ - queryData:this.state.dataSource.filter(item=>item.goodsName==this.state.queryName), + queryData:this.state.dataSource.filter(item=>item.productId==this.state.queryId&&item.productName==this.state.queryName), }) } event.preventDefault(); @@ -80,10 +117,11 @@ class QueryGoods extends React.Component{ title:'货物编号', dataIndex:'productId', }, + /* { title:'货物类型', dataIndex:'productType', - }, + },*/ { title:'货物数量', dataIndex:'amount', @@ -96,38 +134,14 @@ class QueryGoods extends React.Component{ { title:'仓库地址', dataIndex:'storgePosition', - }, + },/* { title:'货物价格', dataIndex:'price', - }, + },*/ ] - storgeColumns=[ - { - title:'货物名称', - dataIndex:'goodsName', - }, - - { - title:'货物数量', - dataIndex:'goodsNum', - }, - { - title:'所在仓库', - dataIndex:'storgeName', - }, - { - title:'仓库地址', - dataIndex:'storgePosition', - }, - { - title:'存储到期时间', - dataIndex:'storageExpirationTime', - }, - - ] render(){ return( @@ -166,15 +180,19 @@ class QueryGoods extends React.Component{ - + +
-
diff --git a/src/userComponents/userManageCenter/homeIn/CreateInApplication.js b/src/userComponents/userManageCenter/homeIn/CreateInApplication.js index a9e66cf33cd2cdab67fb8eedeeaa7d2eea901ccf..b1323ffb420f27c2f1055b780709829fda991fca 100644 --- a/src/userComponents/userManageCenter/homeIn/CreateInApplication.js +++ b/src/userComponents/userManageCenter/homeIn/CreateInApplication.js @@ -34,7 +34,7 @@ class CreateInApplication extends React.Component{ align="baseline" > - - + - - + remove(name)} /> diff --git a/src/userComponents/userManageCenter/homeOut/CreateOutApplication.js b/src/userComponents/userManageCenter/homeOut/CreateOutApplication.js index 82f40955cd7017fe0739c33270d0eb4960f57d87..546119fe5571df8c8f6bf835e5cfa571609e16c3 100644 --- a/src/userComponents/userManageCenter/homeOut/CreateOutApplication.js +++ b/src/userComponents/userManageCenter/homeOut/CreateOutApplication.js @@ -34,7 +34,7 @@ class CreateOutApplication extends React.Component{ align="baseline" > - {/** */} -
+
- - + remove(name)} /> diff --git a/src/userComponents/userManageCenter/homeTrading/CreateTradingApplication.js b/src/userComponents/userManageCenter/homeTrading/CreateTradingApplication.js index 89875ce7c9426a70cf4f2698d83be5becf713ea2..e6ed20a27e056270454a85ffc686b89fd09829a0 100644 --- a/src/userComponents/userManageCenter/homeTrading/CreateTradingApplication.js +++ b/src/userComponents/userManageCenter/homeTrading/CreateTradingApplication.js @@ -34,7 +34,7 @@ class CreateTradingApplication extends React.Component{ align="baseline" > - {/** */} -
+
- - + remove(name)} />