(this["webpackJsonpqq-delivery-ui"]=this["webpackJsonpqq-delivery-ui"]||[]).push([[158],{1506:function(e,t,a){"use strict";a.r(t);var s=a(0),i=a.n(s),r=a(287),l=a(355),n=a(371),o=a(300),h=a(367),u=a(1452),c=(a(509),a(36)),m=a(41),p=a(48);class d extends s.Component{constructor(e){super(e),this.addCategory=e=>{this.state.productInfo.categoryGuid.push(e)},this.saveProduct=()=>{this.dataService.retrievePOST(this.state.supplierInfo,this.config.SERVICE_NAME_SUPPLIER+this.config.SERVICE_ACTION_SUPPLIER_CREATE).then(e=>{e&&(console.log(e.data),e.success&&(window.location="/pos_supplierlist/Successfully Adding Supplier!",this.setState({})))})},this.editSupplier=e=>{this.state.editSupplier.guid=e,this.dataService.retrievePOST(this.state.editSupplier,this.config.SERVICE_NAME_SUPPLIER+this.config.SERVICE_ACTION_SUPPLIER_GET).then(e=>{e&&e.success&&(console.log("Message"+e.message),this.setState({supplierInfo:e.data}))})},this.state={errors:{errorMessage:"",error:!1},message:!1,msg:"",tabValue:1,Chooser:!1,editSupplier:{guid:""},updateCatImage:{productguid:"",type:"",guid:""},supplierInfo:{id:0,name:"",address:"",city:"",region:"",countryName:"",phone1:"",phone2:"",guid:"",fax:""},imageDirectoryPath:"",pimg:"",productImage:"",categoryList:[]},this.config=new m.a,this.dataService=new p.a,this.resources=new c.a,this.userData=this.dataService.getCurrentUserData(),this.textVlaue=this.textVlaue.bind(this)}render(){return i.a.createElement("div",null,i.a.createElement(r.a,{container:!0,direction:"row"},i.a.createElement(r.a,{item:!0,md:1,lg:1,xs:12}),i.a.createElement(r.a,{item:!0,md:10,lg:10,xs:12},i.a.createElement(l.a,{style:{padding:20}},i.a.createElement(r.a,{container:!0,direction:"column",spacing:3},i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Name",name:"name",value:this.state.supplierInfo.name,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Address",name:"address",value:this.state.supplierInfo.address,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"City",name:"city",value:this.state.supplierInfo.city,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Region",name:"region",value:this.state.supplierInfo.region,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Country Name",name:"countryName",value:this.state.supplierInfo.countryName,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Phone1",name:"phone1",value:this.state.supplierInfo.phone1,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Phone2",name:"phone2",value:this.state.supplierInfo.phone2,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(n.a,{size:"small",fullWidth:!0,label:"Fax",name:"fax",value:this.state.supplierInfo.fax,onChange:e=>this.textVlaue(e)})),i.a.createElement(r.a,{item:!0},i.a.createElement(o.a,{variant:"contained",color:"primary",onClick:this.saveProduct},"Save Supplier"))))),i.a.createElement(r.a,{item:!0,md:1,lg:1,xs:1})),i.a.createElement(h.a,{open:this.state.message,autoHideDuration:3e3,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:e=>{this.setState({message:!1})}},i.a.createElement(u.a,{severity:"success",elevation:6,variant:"filled",onClose:e=>{this.setState({message:!1})}},this.state.msg)),i.a.createElement(h.a,{open:this.state.errors.error,autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:e=>{this.state.errors.error=!1,this.state.errors.errorMessage=null,this.setState({loading:!1})}},i.a.createElement(u.a,{severity:"error",elevation:6,variant:"filled",onClose:e=>{this.state.errors.error=!1,this.state.errors.errorMessage=null,this.setState({loading:!1})}},this.state.errors.errorMessage)))}textVlaue(e){this.setState(Object.assign(this.state.supplierInfo,{[e.target.name]:e.target.value}))}componentDidMount(){const e=this.props.match.params.id;""!=e&&null!=e&&this.editSupplier(e)}}t.default=d}}]);
//# sourceMappingURL=158.2db9e99f.chunk.js.map