|
@@ -507,69 +507,26 @@ const NewService = Form.create()(React.createClass({
|
|
})
|
|
})
|
|
this.setState({
|
|
this.setState({
|
|
commodityName:value,
|
|
commodityName:value,
|
|
|
|
+ gid:kid.id,
|
|
commodityPrice:kid.price==0?kid.price.toString():kid.price,
|
|
commodityPrice:kid.price==0?kid.price.toString():kid.price,
|
|
commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
|
|
commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- blurState(value){
|
|
|
|
- let kid;
|
|
|
|
- let fwList=this.state.customerArr;
|
|
|
|
- fwList.map(function(item){
|
|
|
|
- if(value==item.bname){
|
|
|
|
- kid=item.id
|
|
|
|
- }else{
|
|
|
|
- kid=''
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- this.setState({
|
|
|
|
- kid:kid,
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- //客户
|
|
|
|
- selectAutoCUT(value,options){
|
|
|
|
- this.setState({
|
|
|
|
- customerName:value,
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- blurCutor(value){
|
|
|
|
- let autoIds;
|
|
|
|
- let fwList=this.state.customerArr;
|
|
|
|
- fwList.map(function(item){
|
|
|
|
- if(value==item.name){
|
|
|
|
- autoIds=item.id
|
|
|
|
- }else{
|
|
|
|
- autoIds=''
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- this.setState({
|
|
|
|
- autoId:autoIds
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
//服务值改变时请求客户名称
|
|
//服务值改变时请求客户名称
|
|
httpChange(e){
|
|
httpChange(e){
|
|
|
|
+ this.state.gid='';
|
|
if(e.length>=1){
|
|
if(e.length>=1){
|
|
this.supervisor(e,false);
|
|
this.supervisor(e,false);
|
|
}
|
|
}
|
|
this.setState({
|
|
this.setState({
|
|
- kid:'',
|
|
|
|
commodityName:e
|
|
commodityName:e
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //客户名称自动补全
|
|
|
|
- customerChange(e){
|
|
|
|
- if(e.length>=1){
|
|
|
|
- this.supervisor(e,true);
|
|
|
|
- }
|
|
|
|
- this.setState({
|
|
|
|
- autoId:'',
|
|
|
|
- customerName:e
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
//新建明细保存
|
|
//新建明细保存
|
|
nextSubmit(e) {
|
|
nextSubmit(e) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
- if(this.state.kid==undefined||!this.state.kid){
|
|
|
|
- message.warning('商品名称不匹配!');
|
|
|
|
|
|
+ if(this.state.gid==undefined||!this.state.gid){
|
|
|
|
+ message.warning('服务名称不匹配!');
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
if(!this.state.commodityPrice){
|
|
if(!this.state.commodityPrice){
|
|
@@ -607,7 +564,7 @@ const NewService = Form.create()(React.createClass({
|
|
crossDomain: false,
|
|
crossDomain: false,
|
|
url: globalConfig.context +api ,
|
|
url: globalConfig.context +api ,
|
|
data: {
|
|
data: {
|
|
- commodityId:this.state.kid,
|
|
|
|
|
|
+ commodityId:this.state.gid,
|
|
orderNo:this.props.datauser.orderNo,
|
|
orderNo:this.props.datauser.orderNo,
|
|
commodityName:this.state.commodityName,//商品名称
|
|
commodityName:this.state.commodityName,//商品名称
|
|
commodityMode:this.state.commodityMode,//商品规格
|
|
commodityMode:this.state.commodityMode,//商品规格
|
|
@@ -819,50 +776,8 @@ const NewService = Form.create()(React.createClass({
|
|
<Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
|
|
<Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
|
|
<Spin spinning={this.state.loading}>
|
|
<Spin spinning={this.state.loading}>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- {!this.props.userDetaile?
|
|
|
|
- <div className="clearfix">
|
|
|
|
|
|
+ {!this.props.userDetaile?<div></div>:
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- <FormItem
|
|
|
|
- {...formItemLayout}
|
|
|
|
- label="订单类型" >
|
|
|
|
- <Select placeholder="请选择订单类型"
|
|
|
|
- style={{ width:'200px'}}
|
|
|
|
- value={this.state.orderType}
|
|
|
|
- onChange={(e) => { this.setState({ orderType: e }) }}>
|
|
|
|
- {
|
|
|
|
- orderType.map(function (item) {
|
|
|
|
- return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- </Select>
|
|
|
|
- <span className="mandatory">*</span>
|
|
|
|
- </FormItem>
|
|
|
|
- </div>
|
|
|
|
- <div className="clearfix">
|
|
|
|
- <FormItem
|
|
|
|
- {...formItemLayout}
|
|
|
|
- label="客户名称" >
|
|
|
|
- <AutoComplete
|
|
|
|
- className="certain-category-search"
|
|
|
|
- dropdownClassName="certain-category-search-dropdown"
|
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
|
- dropdownStyle={{ width: 200 }}
|
|
|
|
- size="large"
|
|
|
|
- style={{ width: '200px' }}
|
|
|
|
- dataSource={options}
|
|
|
|
- placeholder="输入名称"
|
|
|
|
- value={this.state.customerName}
|
|
|
|
- onChange={this.customerChange}
|
|
|
|
- filterOption={true}
|
|
|
|
- onBlur={this.blurCutor}
|
|
|
|
- onSelect={this.selectAutoCUT}
|
|
|
|
- >
|
|
|
|
- <Input/>
|
|
|
|
- </AutoComplete>
|
|
|
|
- <span className="mandatory">*</span>
|
|
|
|
- </FormItem>
|
|
|
|
- </div>
|
|
|
|
- </div>:<div className="clearfix">
|
|
|
|
<FormItem className="half-item"
|
|
<FormItem className="half-item"
|
|
{...formItemLayout}
|
|
{...formItemLayout}
|
|
label="订单编号" >
|
|
label="订单编号" >
|
|
@@ -1064,10 +979,10 @@ const NewService = Form.create()(React.createClass({
|
|
<Button style={{marginRight:'10px',marginLeft:'200px'}} type="danger">作废</Button>
|
|
<Button style={{marginRight:'10px',marginLeft:'200px'}} type="danger">作废</Button>
|
|
</Popconfirm>}
|
|
</Popconfirm>}
|
|
{this.props.datauser.active.applyLock&&<Popconfirm title={'请确认您是否锁定客户【'+this.props.datauser.buyerName+'】的服务订单,订单锁定将导致订单暂停!'} onConfirm={(e)=>{this.lockOrder()}} okText="确认" cancelText="取消">
|
|
{this.props.datauser.active.applyLock&&<Popconfirm title={'请确认您是否锁定客户【'+this.props.datauser.buyerName+'】的服务订单,订单锁定将导致订单暂停!'} onConfirm={(e)=>{this.lockOrder()}} okText="确认" cancelText="取消">
|
|
- <Button style={{marginRight:'10px'}} type="danger">锁定</Button>
|
|
|
|
|
|
+ <Button style={{marginRight:'10px',marginLeft:'200px'}} type="danger">锁定</Button>
|
|
</Popconfirm>}
|
|
</Popconfirm>}
|
|
{this.props.datauser.active.applyUnLock&&<Popconfirm title={'请确认您是否解锁客户【'+this.props.datauser.buyerName+'】的服务订单,订单解锁将导致订单正常!'} onConfirm={(e)=>{this.unlockOrder()}} okText="确认" cancelText="取消">
|
|
{this.props.datauser.active.applyUnLock&&<Popconfirm title={'请确认您是否解锁客户【'+this.props.datauser.buyerName+'】的服务订单,订单解锁将导致订单正常!'} onConfirm={(e)=>{this.unlockOrder()}} okText="确认" cancelText="取消">
|
|
- <Button style={{marginRight:'10px'}} type="primary">解锁</Button>
|
|
|
|
|
|
+ <Button style={{marginRight:'10px',marginLeft:'200px'}} type="primary">解锁</Button>
|
|
</Popconfirm>}
|
|
</Popconfirm>}
|
|
</div>:''}
|
|
</div>:''}
|
|
<Button className="cancel" type="ghost" onClick={this.handleCancel} style={{float:'right',marginRight:'200px'}}>返回</Button>
|
|
<Button className="cancel" type="ghost" onClick={this.handleCancel} style={{float:'right',marginRight:'200px'}}>返回</Button>
|
|
@@ -1099,7 +1014,6 @@ const NewService = Form.create()(React.createClass({
|
|
value={this.state.commodityName}
|
|
value={this.state.commodityName}
|
|
onChange={this.httpChange}
|
|
onChange={this.httpChange}
|
|
filterOption={true}
|
|
filterOption={true}
|
|
- onBlur={this.blurState}
|
|
|
|
onSelect={this.selectAuto}
|
|
onSelect={this.selectAuto}
|
|
>
|
|
>
|
|
<Input/>
|
|
<Input/>
|