Commit 05f8c9a5 authored by 陈卓's avatar 陈卓

提交代码

parent 852c62ff
...@@ -763,6 +763,16 @@ const pdaApi = { ...@@ -763,6 +763,16 @@ const pdaApi = {
code code
}) })
}, },
//箱号模糊查询
getorderlist: ({
ordernum, //箱号
code
}) => {
return http.post(IP + '/api/server/getorderlist', {
ordernum,
code
})
},
//在途查询 //在途查询
getqueryinfo: ({ getqueryinfo: ({
box_number, //箱号 box_number, //箱号
......
/**
* 首次绑定,经销商在途之箱号查询。
*/
import React, {
Component
} from 'react';
import ReactDOM from 'react-dom';
import {
NavBar,
Icon,
Button,
Toast,
Modal,
Picker,
Accordion,
List,
} from 'antd-mobile';
import './index.less';
import pdaApi from '../../common/api/pdauser'
import SingleItem,{SingleInput,SpecialSingleItem} from '../../common/commonview/singleitem';
import back from '../../assets/back.png';
class DstributorOnTheWayVagueQuery extends React.Component {
constructor(props) {
super(props)
this.state = {
boxnum:'',
data:[],
userInfo:''
}
this.handleInputChange = this.handleInputChange.bind(this)
}
/*handleInputChange(event){
var tempboxnum=event.target.value
this.setState({
boxnum:tempboxnum
},()=>{
this.vagueQuery()
})
}*/
handleInputChange(event){
const target = event.target
const value = target.type === 'checkbox' ? target.checked : target.value
const name = target.name
this.setState({
[name]: value
})
}
vagueQuery(){
// localStorage.getItem("")
if(!this.state.boxnum){
Toast.info('请填写数据')
}else{
let ordernum=this.state.boxnum
let code=this.state.userInfo.code || ""//站点
pdaApi.getorderlist({ordernum,code}).then(res=>{
console.log('箱号模糊查询',res);
if(res.code==1&&res.result.length!=0){
this.setState({
data:res.result,
})
}else{
this.setState({
data:[],
})
Toast.info('没有查找到数据')
}
})
}
}
goOnTheWay(ordernum){
if(ordernum){
localStorage.setItem("ordernum",ordernum);
window.location.href='/dstributorOnTheWayQuery.html'
}else{
localStorage.removeItem("ordernum",ordernum);
window.location.href='/dstributorOnTheWayQuery.html'
}
}
render() {
var containner={
marginTop:'0.3rem',
width:'100%',
display:'flex',
flexDirection: 'column',
alignItems: 'center',
backgroundColor:'#ffffff'
}
var data=this.state.data || []
return (
<div>
<NavBar
leftContent={<div style={{ 'display': 'flex', 'alignItems': 'center' }}>
< img style={{ 'width': '.25rem' }} src={back} />
<span style={{ 'marginLeft': '.12rem' }}>返回</span>
</div>
}
iconName={false}
onLeftClick={() => {
window.history.back(-1);
}}>
在途查询
</NavBar>
<div style={containner}>
{/*<SingleItem
name="箱号"
>
<SingleInput name="boxnum" onChange={this.handleInputChange} value={this.state.boxnum}/>
</SingleItem>*/}
<SpecialSingleItem
inputPosition="0"
rightText="查询"
singleName="订单号"
name="boxnum"
value={this.state.boxnum}
onChange={this.handleInputChange}
onClick={()=>this.vagueQuery()}
outerStyle={{marginTop:'.5rem',width:'110%',marginLeft:'-.3rem'}}/>
<div className='seachresultwrap'>
<ul className='seachresultbox'>
{/* <li className='seachresultitem' onClick={()=>{this.goOnTheWay()}}>清除</li> */}
{this.state.data.map((item,index)=>{
return<li key= {index} className='seachresultitem' onClick={()=>{this.goOnTheWay(item.ordernum)}}>{item.ordernum}</li>
})}
</ul>
</div>
</div>
</div>
);
}
componentDidMount(){
var boxnum=localStorage.getItem("boxnum")||''
if(boxnum!=''){
this.setState({
boxnum:boxnum,
})
}
let userInfo=JSON.parse(localStorage.getItem("userInfo")) || ''
if(userInfo!=''){
console.log('用户信息',userInfo);
this.setState({
userInfo:userInfo
})
}else{
window.location.href = "/binduser.html";
}
}
}
const render = () => {
ReactDOM.render(
<DstributorOnTheWayVagueQuery></DstributorOnTheWayVagueQuery>, document.getElementById('root'));
}
render();
\ No newline at end of file
@import "../../common/css/index.less";
#root {
width: 100%;
height: 100%;
background-color: #fff;
}
.seachresultwrap{
width: 100%;
.seachresultbox{
width: 90%;
height: 0.8rem;
margin: 0 auto;
.seachresultitem{
height: 0.8rem;
line-height:0.8rem;
border-bottom: #d7d7d7 0.02rem solid;
background-color: #fff;
font-family:'PingFangSC-Regular';
font-size:28px;
color:#4a4a4a;
letter-spacing:0;
text-align:left;
}
}
}
\ No newline at end of file
...@@ -41,6 +41,8 @@ class DstributorOnTheWayQuery extends React.Component { ...@@ -41,6 +41,8 @@ class DstributorOnTheWayQuery extends React.Component {
this.handleInputChange = this.handleInputChange.bind(this) this.handleInputChange = this.handleInputChange.bind(this)
this.goVagueaQuery = this.goVagueaQuery.bind(this) this.goVagueaQuery = this.goVagueaQuery.bind(this)
this.goVagueaQuerybox = this.goVagueaQuerybox.bind(this) this.goVagueaQuerybox = this.goVagueaQuerybox.bind(this)
this.goVagueaQueryorder = this.goVagueaQueryorder.bind(this)
} }
handleInputChange(event){ handleInputChange(event){
const target = event.target const target = event.target
...@@ -140,6 +142,9 @@ class DstributorOnTheWayQuery extends React.Component { ...@@ -140,6 +142,9 @@ class DstributorOnTheWayQuery extends React.Component {
goVagueaQuerybox(){ goVagueaQuerybox(){
window.location.href='/dstributorOnTheWayBoxNumVagueQuery.html' window.location.href='/dstributorOnTheWayBoxNumVagueQuery.html'
} }
goVagueaQueryorder(){
window.location.href='/dstributorOnTheWayOrderNumVagueQuery.html'
}
render() { render() {
var containner = { var containner = {
display: 'flex', display: 'flex',
...@@ -243,6 +248,8 @@ class DstributorOnTheWayQuery extends React.Component { ...@@ -243,6 +248,8 @@ class DstributorOnTheWayQuery extends React.Component {
<SingleInput <SingleInput
name="ordernum" name="ordernum"
onChange={this.handleInputChange} onChange={this.handleInputChange}
onFocus={this.goVagueaQueryorder}
value={this.state.ordernum} value={this.state.ordernum}
onIconClick={()=>{this.clear('ordernum')}} onIconClick={()=>{this.clear('ordernum')}}
iconStyle={{marginTop:'.2rem'}} iconStyle={{marginTop:'.2rem'}}
...@@ -352,6 +359,12 @@ class DstributorOnTheWayQuery extends React.Component { ...@@ -352,6 +359,12 @@ class DstributorOnTheWayQuery extends React.Component {
boxnum:boxnum, boxnum:boxnum,
}) })
} }
var ordernum=localStorage.getItem("ordernum")||''
if(ordernum!=''){
this.setState({
ordernum:ordernum,
})
}
} }
clear(type){ clear(type){
......
...@@ -448,8 +448,8 @@ export default class Tab2 extends Component { ...@@ -448,8 +448,8 @@ export default class Tab2 extends Component {
checkboxs() { checkboxs() {
//GJ20180929001 //GJ20180929001
if (this.state.deliverid) { if (this.state.deliverid) {
var sitecode = 'CMAL/SP.50140' // var sitecode = 'CMAL/SP.50140'
// var sitecode = this.state.userInfo.code || ""//站点 var sitecode = this.state.userInfo.code || ""//站点
var ho = this.state.deliverid//交接单号 var ho = this.state.deliverid//交接单号
Toast.loading('Loading...', 0, () => { Toast.loading('Loading...', 0, () => {
},true); },true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment