text: (window.webpackJsonp=window.webpackJsonp||[]).push([[85],{1515:function(e,a,t){"use strict";t.r(a);var n=t(24),r=t.n(n),o=t(25),s=t.n(o),i=t(26),l=t.n(i),c=t(27),u=t.n(c),m=t(16),d=t.n(m),p=t(0),f=t.n(p),g=t(22),h=t.n(g),v=t(6),b=t.n(v),y=t(32),N=t(4),E=t(7),C=t.n(E),q=t(190),O=t(747),A=t(696),R=t(693),k=t(694),D=t(699),z=t(737),I=t(697),w=t.n(I);function S(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function x(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?S(Object(t),!0).forEach((function(a){b()(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function P(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=d()(e);if(a){var r=d()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u()(this,t)}}C.a.locale("nl");var T=function(e){l()(t,e);var a=P(t);function t(e){var n;return r()(this,t),n=a.call(this,e),b()(h()(n),"handleInputChange",(function(e){var a=e.target,t="checkbox"===a.type?a.checked:a.value,r=a.name;n.setState(x(x({},n.state),{},{quotationRequest:x(x({},n.state.quotationRequest),{},b()({},r,t))}))})),b()(h()(n),"handleSubmit",(function(e){e.preventDefault();var a=n.state.quotationRequest,t={},r=!1;w.a.isEmpty(a.statusId)&&(t.status=!0,r=!0),w.a.isEmpty(a.organisationId)&&(t.organisation=!0,r=!0),n.setState(x(x({},n.state),{},{errors:t})),!r&&q.a.newQuotationRequest(a).then((function(e){N.f.push("/offerteverzoek/".concat(e.data.id))}))})),n.state={opportunity:{fullName:"",fullAddress:"",measureName:""},organisations:[],quotationRequest:{opportunityId:"",organisationId:"",dateRecorded:"",statusId:"5",dateReleased:"",quotationText:""},errors:{organisation:!1,status:!1}},n.handleInputChangeDate=n.handleInputChangeDate.bind(h()(n)),n}return s()(t,[{key:"componentWillMount",value:function(){var e=this;q.a.fetchNewQuotationRequest(this.props.opportunityId).then((function(a){e.setState({opportunity:{fullName:a.intake.contact.fullName,fullAddress:a.intake.fullAddress,measureNames:a.measures&&a.measures.map((function(e){return e.name})).join(", "),measureCategoryName:a.measureCategory.name},quotationRequest:{opportunityId:a.id,organisationId:"",dateRecorded:"",statusId:"5",dateReleased:"",quotationText:a.quotationText?a.quotationText:""}})})),O.a.getOrganisationPeek().then((function(a){e.setState({organisations:a})}))}},{key:"handleInputChangeDate",value:function(e,a){this.setState(x(x({},this.state),{},{quotationRequest:x(x({},this.state.quotationRequest),{},b()({},a,e))}))}},{key:"render",value:function(){var e=this.state.quotationRequest,a=e.organisationId,t=e.dateRecorded,n=e.statusId,r=e.dateReleased,o=e.quotationText,s=this.state.opportunity,i=s.fullName,l=s.fullAddress,c=s.measureNames,u=s.measureCategoryName;return f.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},f.a.createElement("div",{className:"row"},f.a.createElement(A.a,{label:"Organisatie",size:"col-sm-6",name:"organisationId",value:a,options:this.state.organisations,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.organisation}),f.a.createElement(k.a,{label:"Verzoek voor",name:"fullName",value:i,onChange:function(){},readOnly:!0})),f.a.createElement("div",{className:"row"},f.a.createElement(k.a,{label:"Adres voor",name:"address",value:l,onChange:function(){},readOnly:!0}),f.a.createElement(k.a,{label:"Maatregel - categorie",name:"measureCategory",value:u,onChange:function(){},readOnly:!0})),f.a.createElement("div",{className:"row"},f.a.createElement(k.a,{label:"Maatregel - specifiek",name:"measure",value:c,onChange:function(){},readOnly:!0}),f.a.createElement(D.a,{label:"Datum opname",size:"col-sm-6",name:"dateRecorded",value:t,onChangeAction:this.handleInputChangeDate})),f.a.createElement("div",{className:"row"},f.a.createElement(A.a,{label:"Offerte status",size:"col-sm-6",name:"statusId",value:n,options:this.props.quotationRequestStatus,onChangeAction:this.handleInputChange,required:"required",error:this.state.errors.status}),f.a.createElement(D.a,{label:"Offerte uitgebracht",size:"col-sm-6",name:"dateReleased",value:r,onChangeAction:this.handleInputChangeDate})),f.a.createElement("div",{className:"row"},f.a.createElement(z.a,{label:"Offerte omschrijving",name:"quotationText",value:o,onChangeAction:this.handleInputChange})),f.a.createElement("div",{className:"panel-footer"},f.a.createElement("div",{className:"pull-right btn-group",role:"group"},f.a.createElement(R.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit}))))}}]),t}(p.Component),M=Object(y.b)((function(e){return{quotationRequestStatus:e.systemData.quotationRequestStatus}}),null)(T),B=t(690),j=t(691),L=function(e){return f.a.createElement("div",null,f.a.createElement(B.a,null,f.a.createElement(j.a,null,f.a.createElement(M,{opportunityId:e.opportunityId}))))},F=t(692),V=function(e){return f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"col-md-4"},f.a.createElement("div",{className:"btn-group",role:"group"},f.a.createElement(F.a,{iconName:"glyphicon-arrow-left",onClickAction:N.e.goBack}))),f.a.createElement("div",{className:"col-md-4"},f.a.createElement("h4",{className:"text-center"},"Nieuw offerteverzoek")),f.a.createElement("div",{className:"col-md-4"}))};function Y(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=d()(e);if(a){var r=d()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return u()(this,t)}}var _=function(e){l()(t,e);var a=Y(t);function t(e){return r()(this,t),a.call(this,e)}return s()(t,[{key:"render",value:function(){return f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"col-md-9"},f.a.createElement("div",{className:"col-md-12 margin-10-top"},f.a.createElement(V,null)),f.a.createElement("div",{className:"col-md-12 margin-10-top"},f.a.createElement(L,{opportunityId:this.props.params.opportunityId}))),f.a.createElement("div",{className:"col-md-3"}))}}]),t}(p.Component);a.default=_},690:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.children,t=e.className,n=e.onMouseEnter,o=e.onMouseLeave;return r.a.createElement("div",{className:"panel panel-default ".concat(t),onMouseEnter:n,onMouseLeave:o},a)};i.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},i.propTypes={className:s.a.string,onMouseEnter:s.a.func,onMouseLeave:s.a.func},a.a=i},691:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.className,t=e.children;return r.a.createElement("div",{className:"panel-body ".concat(a)},t)};i.defaultProps={className:""},i.propTypes={className:s.a.string},a.a=i},692:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.buttonClassName,t=e.iconName,n=e.onClickAction,o=e.title,s=e.disabled;return r.a.createElement("button",{type:"button",className:"btn ".concat(a),onClick:n,disabled:s,title:o},r.a.createElement("span",{className:"glyphicon ".concat(t)}))};i.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},i.propTypes={buttonClassName:s.a.string,iconName:s.a.string.isRequired,onClickAction:s.a.func,title:s.a.string,disabled:s.a.bool},a.a=i},693:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.buttonClassName,t=e.buttonText,n=e.onClickAction,o=e.type,s=e.value,i=e.loading,l=e.loadText,c=e.disabled;return i?r.a.createElement("button",{type:o,className:"btn btn-sm btn-loading ".concat(a),value:s,disabled:i},r.a.createElement("span",{className:"glyphicon glyphicon-refresh glyphicon-refresh-animate"})," ",l):r.a.createElement("button",{type:o,className:"btn btn-sm ".concat(a),onClick:n,value:s,disabled:c},t)};i.defaultProps={buttonClassName:"btn-success",type:"button",value:"",loading:!1,loadText:"Aan het laden",disabled:!1},i.propTypes={buttonClassName:s.a.string,buttonText:s.a.string.isRequired,onClickAction:s.a.func,type:s.a.string,value:s.a.string,loading:s.a.bool,loadText:s.a.string,disabled:s.a.bool},a.a=i},694:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.label,t=e.type,n=e.className,o=e.size,s=e.id,i=e.placeholder,l=e.name,c=e.value,u=e.onClickAction,m=e.onChangeAction,d=e.onBlurAction,p=e.required,f=e.readOnly,g=e.maxLength,h=e.error,v=e.min,b=e.max,y=e.step,N=e.errorMessage,E=e.divSize,C=e.divClassName,q=e.autoComplete;return r.a.createElement("div",{className:"form-group ".concat(E," ").concat(C)},r.a.createElement("label",{htmlFor:s,className:"col-sm-6 ".concat(p)},a),r.a.createElement("div",{className:"".concat(o)},r.a.createElement("input",{type:t,className:"form-control input-sm ".concat(n)+(h?"has-error":""),id:s,placeholder:i,name:l,value:c,onClick:u,onChange:m,onBlur:d,readOnly:f,maxLength:g,min:v,max:b,autoComplete:q,step:y})),h&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",N)))};i.defaultProps={divClassName:"",className:"",size:"col-sm-6",divSize:"col-sm-6",name:"",type:"text",value:"",required:"",readOnly:!1,maxLength:null,error:!1,min:"",max:"",step:"",errorMessage:"",autoComplete:"off",onBlurAction:function(){},onClickAction:function(){},onChangeAction:function(){}},i.propTypes={label:s.a.oneOfType([s.a.string,s.a.object]).isRequired,type:s.a.string,className:s.a.string,divClassName:s.a.string,size:s.a.string,divSize:s.a.string,id:s.a.string,placeholder:s.a.string,name:s.a.string.isRequired,value:s.a.oneOfType([s.a.string,s.a.number]),onClickAction:s.a.func,onChangeAction:s.a.func,onBlurAction:s.a.func,required:s.a.string,readOnly:s.a.bool,maxLength:s.a.string,error:s.a.bool,min:s.a.string,max:s.a.string,step:s.a.string,errorMessage:s.a.string,autoComplete:s.a.string},a.a=i},696:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.label,t=e.className,n=e.size,o=e.id,s=e.name,i=e.value,l=e.options,c=e.onChangeAction,u=e.onBlurAction,m=e.required,d=e.error,p=e.errorMessage,f=e.optionValue,g=e.optionName,h=e.readOnly,v=e.placeholder,b=e.divClassName,y=e.emptyOption;return r.a.createElement("div",{className:"form-group ".concat(n," ").concat(b)},r.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(m)},a),r.a.createElement("div",{className:"col-sm-6"},r.a.createElement("select",{className:"form-control input-sm ".concat(t)+(d&&" has-error"),id:o,name:s,value:i,onChange:c,onBlur:u,readOnly:h},y&&r.a.createElement("option",{value:""},v),l.map((function(e){return r.a.createElement("option",{key:e[f],value:e[f]},e[g])})))),d&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",p)))};i.defaultProps={divClassName:"",className:"",size:"col-sm-6",readOnly:!1,required:"",error:!1,errorMessage:"",value:"",optionValue:"id",optionName:"name",placeholder:"",emptyOption:!0},i.propTypes={label:s.a.string.isRequired,className:s.a.string,size:s.a.string,id:s.a.string,name:s.a.string.isRequired,options:s.a.array,value:s.a.oneOfType([s.a.string,s.a.number]),onChangeAction:s.a.func,onBlurAction:s.a.func,required:s.a.string,readOnly:s.a.bool,error:s.a.bool,errorMessage:s.a.string,emptyOption:s.a.bool,optionValue:s.a.string,optionName:s.a.string,placeholder:s.a.string},a.a=i},699:function(e,a,t){"use strict";var n=t(24),r=t.n(n),o=t(25),s=t.n(o),i=t(22),l=t.n(i),c=t(26),u=t.n(c),m=t(27),d=t.n(m),p=t(16),f=t.n(p),g=t(6),h=t.n(g),v=t(0),b=t.n(v),y=t(8),N=t.n(y),E=t(707),C=t.n(E),q=t(708),O=t.n(q),A=t(7),R=t.n(A);function k(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f()(e);if(a){var r=f()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d()(this,t)}}R.a.locale("nl");var D=function(e){u()(t,e);var a=k(t);function t(e){var n;return r()(this,t),n=a.call(this,e),h()(l()(n),"validateDate",(function(e){var a=R()(e.target.value,"DD-MM-YYYY",!0),t=!1;a.isValid()||""===e.target.value||(t=!0),n.props.disabledBefore&&a.isBefore(n.props.disabledBefore)&&(t=!0),n.props.disabledAfter&&a.isAfter(n.props.disabledAfter)&&(t=!0),n.setState({errorDateFormat:t})})),h()(l()(n),"onDateChange",(function(e){var a=e?R()(e).format("Y-MM-DD"):"",t=!1;a&&n.props.disabledBefore&&R()(a).isBefore(n.props.disabledBefore)&&(t=!0),a&&n.props.disabledAfter&&R()(a).isAfter(n.props.disabledAfter)&&(t=!0),n.setState({errorDateFormat:t}),!t&&n.props.onChangeAction(a,n.props.name)})),n.state={errorDateFormat:!1},n}return s()(t,[{key:"render",value:function(){var e=this.props,a=e.label,t=e.className,n=e.size,r=e.divSize,o=e.id,s=e.value,i=e.required,l=e.readOnly,c=e.name,u=e.error,m=e.errorMessage,d=e.disabledBefore,p=e.disabledAfter,f=s?R()(s).format("L"):"",g={};return d&&(g.before=new Date(d)),p&&(g.after=new Date(p)),b.a.createElement("div",{className:"form-group ".concat(r)},b.a.createElement("div",null,b.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(i)},a)),b.a.createElement("div",{className:"".concat(n)},b.a.createElement(C.a,{id:o,value:f,formatDate:q.formatDate,parseDate:q.parseDate,onDayChange:this.onDateChange,dayPickerProps:{showWeekNumbers:!0,locale:"nl",firstDayOfWeek:1,localeUtils:O.a,disabledDays:g},inputProps:{className:"form-control input-sm ".concat(t)+(this.state.errorDateFormat||u?" has-error":""),name:c,onBlur:this.validateDate,autoComplete:"off",readOnly:l,disabled:l},required:i,readOnly:l,placeholder:""})),u&&b.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},b.a.createElement("span",{className:"has-error-message"}," ",m)))}}]),t}(v.Component);D.defaultProps={className:"",size:"col-sm-6",divSize:"col-sm-6",required:"",readOnly:!1,value:null,error:!1,errorMessage:"",disabledBefore:null,disabledAfter:null},D.propTypes={label:N.a.string.isRequired,type:N.a.string,className:N.a.string,size:N.a.string,divSize:N.a.string,id:N.a.string,name:N.a.string,value:N.a.oneOfType([N.a.string,N.a.object]),onChangeAction:N.a.func,required:N.a.string,readOnly:N.a.bool,error:N.a.bool,errorMessage:N.a.string,disabledBefore:N.a.string,disabledAfter:N.a.string},a.a=D},737:function(e,a,t){"use strict";var n=t(0),r=t.n(n),o=t(8),s=t.n(o),i=function(e){var a=e.label,t=e.size,n=e.sizeLabel,o=e.sizeInput,s=e.id,i=e.name,l=e.value,c=e.onChangeAction,u=e.required,m=e.error,d=e.rows;return r.a.createElement("div",{className:"form-group ".concat(t)},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:n},r.a.createElement("label",{htmlFor:s,className:"col-sm-12 ".concat(u)},a)),r.a.createElement("div",{className:o},r.a.createElement("textarea",{name:i,value:l,onChange:c,className:"form-control input-sm "+(m?"has-error":""),rows:d}))))};i.defaultProps={size:"col-sm-12",sizeLabel:"col-sm-3",sizeInput:"col-sm-9",value:"",required:"",error:!1,rows:"5"},i.propTypes={label:s.a.string.isRequired,type:s.a.string,size:s.a.string,sizeLabel:s.a.string,sizeInput:s.a.string,id:s.a.string,name:s.a.string.isRequired,value:s.a.oneOfType([s.a.string,s.a.number]),onChangeAction:s.a.func,required:s.a.string,error:s.a.bool},a.a=i},747:function(e,a,t){"use strict";var n=t(2),r=t.n(n),o="".concat(URL_API,"/api/organisation");a.a={newOrganisation:function(e){var a="".concat(o),t="Bearer "+localStorage.getItem("access_token");return r.a.defaults.headers.common.Authorization=t,r.a.post(a,e).then((function(e){return e.data.data})).catch((function(e){console.log(e)}))},updateOrganisation:function(e){var a="".concat(o,"/").concat(e.id),t="Bearer "+localStorage.getItem("access_token");return r.a.defaults.headers.common.Authorization=t,r.a.post(a,e)},getOrganisationPeek:function(){var e="".concat(o,"/peek"),a="Bearer "+localStorage.getItem("access_token");return r.a.defaults.headers.common.Authorization=a,r.a.get(e).then((function(e){return e.data.data})).catch((function(e){console.log(e)}))}}}}]);