Files
FBSAdminTool/build/static/js/6.0f9bfcf6.chunk.js
2021-07-12 10:46:19 +05:30

2 lines
3.3 KiB
JavaScript

(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[6],{687:function(e,t,c){"use strict";c.r(t);var n=c(657),s=c.n(n),o=c(658),a=c(678),i=c(1),r=c(659),l=c.n(r),j=c(631),u=c(629),h=c(20),d=c(677);t.default=function(){var e=new Date,t=e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear(),c=Object(i.useState)([]),n=Object(a.a)(c,2),r=n[0],b=n[1],O=Object(i.useState)(t),p=Object(a.a)(O,2),x=p[0],m=p[1],f=Object(i.useState)(""),g=Object(a.a)(f,2),v=g[0],k=g[1],S=Object(i.useState)(""),C=Object(a.a)(S,2),w=C[0],M=C[1];return Object(i.useEffect)((function(){function e(){return(e=Object(o.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l()("https://natnats.mobilous.com/getConstructionList");case 2:t=e.sent,b(t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),Object(h.jsxs)(j.J,{children:[Object(h.jsx)(j.k,{xs:"12",sm:"12",md:"12",children:Object(h.jsxs)(j.f,{children:[Object(h.jsx)(j.j,{children:"Reports"}),Object(h.jsxs)(j.g,{children:[Object(h.jsxs)(j.K,{custom:!0,name:"cons_select",id:"cons_select",onChange:function(e){M(e.target.value)},children:['" ',Object(h.jsx)("option",{value:"",children:"-- Select --"}),'"+',r.map((function(e,t){return Object(h.jsx)("option",{value:e.construction_id,children:e.construction_name},e.construction_id)}))]}),Object(h.jsxs)(j.f,{children:[Object(h.jsx)(j.g,{children:Object(h.jsxs)(j.t,{action:"",method:"post",encType:"multipart/form-data",className:"form-horizontal",children:[Object(h.jsxs)(j.u,{row:!0,children:[Object(h.jsx)(j.k,{md:"3",children:Object(h.jsxs)(j.G,{htmlFor:"date-input",children:["Date (",x,")"]})}),Object(h.jsx)(j.k,{xs:"12",md:"9",children:Object(h.jsx)(j.B,{type:"date",id:"date-input",name:"date-input",placeholder:"date",value:x,onChange:function(e){m(e.target.value)}})})]}),Object(h.jsxs)(j.u,{row:!0,children:[Object(h.jsx)(j.k,{md:"3",children:Object(h.jsx)(j.G,{htmlFor:"select",children:"Select"})}),Object(h.jsx)(j.k,{xs:"12",md:"9",children:Object(h.jsxs)(j.K,{custom:!0,name:"select",id:"select",onChange:function(e){k(e.target.value)},value:v,children:[Object(h.jsx)("option",{value:"",children:"-- Select --"}),Object(h.jsx)("option",{value:"generateBoxDisplacement",children:"Box Displacement"}),Object(h.jsx)("option",{value:"generateMachineControl",children:"Machine Control"}),Object(h.jsx)("option",{value:"generateMachineSheet",children:"Machine Sheet"}),Object(h.jsx)("option",{value:"generateMeasurement",children:"Measurement"}),Object(h.jsx)("option",{value:"generateCheckSheet",children:"Check Sheet"}),Object(h.jsx)("option",{value:"generateInjection",children:"Injection"})]})})]})]})}),Object(h.jsx)(j.h,{children:Object(h.jsxs)(j.e,{type:"submit",size:"sm",color:"primary",onClick:function(){if(""!=v&&""!=w){var e="https://natnats.mobilous.com//"+v+"?construction_id="+w+"&construction_date="+x;console.log(w),console.log(x),console.log(v),function(e){var t=l()(e).then((function(e){d(e.data,"report.xls")}));console.log(t)}(e)}else alert("Please select both Construction and Report")},children:[Object(h.jsx)(u.a,{name:"cil-scrubber"})," Download"]})})]})]})]})}),Object(h.jsx)(j.k,{xs:"1",sm:"1",md:"1"})]})}}}]);
//# sourceMappingURL=6.0f9bfcf6.chunk.js.map