Files
FBSAdminTool/build/static/js/7.204501b5.chunk.js
2022-02-17 18:28:18 +05:30

2 lines
5.2 KiB
JavaScript

(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[7],{774:function(e,t,c){"use strict";c.r(t);var n=c(659),s=c.n(n),r=c(660),a=c(657),i=c(1),o=c(644),l=c.n(o),j=c(639),u=c(638),b=c(717),h=c.n(b),d=(c(716),c(18));t.default=function(){var e="https://natnats.mobilous.com/",t=Object(i.useState)([]),c=Object(a.a)(t,2),n=c[0],o=c[1],b=Object(i.useState)(""),x=Object(a.a)(b,2),O=x[0],p=x[1],m=Object(i.useState)(""),f=Object(a.a)(m,2),v=f[0],k=f[1],g=Object(i.useState)(!1),y=Object(a.a)(g,2),S=y[0],C=y[1],_=Object(i.useState)(null),w=Object(a.a)(_,2),M=w[0],D=w[1],z=Object(i.useState)([]),F=Object(a.a)(z,2),H=F[0],B=F[1],L=Object(i.useState)(""),N=Object(a.a)(L,2),T=N[0],E=N[1];function J(e){var t=String(e.getDate()).padStart(2,"0"),c=String(e.getMonth()+1).padStart(2,"0");return e.getFullYear()+"-"+c+"-"+t}function I(){if(""!=O&&""!=v){var t="";null!==M?(t=S?e+"/generate"+O+"?construction_id="+v+"&construction_date="+J(M)+"&graph=true":e+"/generate"+O+"?construction_id="+v+"&construction_date="+J(M),E(t)):E("")}else alert("\u5efa\u8a2d\u3068\u30ec\u30dd\u30fc\u30c8\u306e\u4e21\u65b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044")}function K(){return"BoxDisplacement"===O||"MachineControl"===O||"MachineSheet"===O}return Object(i.useEffect)((function(){function e(){return(e=Object(r.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,o(t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),Object(i.useEffect)((function(){function e(){return(e=Object(r.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===v||""===O||1!=K()){e.next=5;break}return e.next=3,l()("https://fbssso.ts.bizside.biz/getDateToHaveData?construction_id="+v+"&sheetname="+O);case 3:t=e.sent,B(t.data.record);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[O,v]),Object(d.jsxs)(j.K,{children:[Object(d.jsx)(j.k,{xs:"12",sm:"12",md:"12",children:Object(d.jsxs)(j.f,{children:[Object(d.jsx)(j.j,{children:"\u30ec\u30dd\u30fc\u30c8"}),Object(d.jsxs)(j.g,{children:[Object(d.jsxs)(j.L,{custom:!0,name:"cons_select",id:"cons_select",onChange:function(e){k(e.target.value),D(null),E("")},children:['" ',Object(d.jsx)("option",{value:"",children:"-- \u5de5\u4e8b\u540d --"}),'"+',n.map((function(e,t){return Object(d.jsx)("option",{value:e.construction_id,children:e.construction_name},e.construction_id)}))]}),Object(d.jsxs)(j.f,{children:[Object(d.jsx)(j.g,{children:Object(d.jsxs)(j.s,{action:"",method:"post",encType:"multipart/form-data",className:"form-horizontal",children:[Object(d.jsxs)(j.t,{row:!0,children:[Object(d.jsx)(j.k,{md:"3",children:Object(d.jsx)(j.H,{htmlFor:"select",children:"\u30ec\u30dd\u30fc\u30c8\u7a2e\u985e"})}),Object(d.jsx)(j.k,{xs:"12",md:"9",children:Object(d.jsxs)(j.L,{custom:!0,name:"select",id:"select",onChange:function(e){p(e.target.value),D(null),E("")},value:O,children:[Object(d.jsx)("option",{value:"",children:"-- \u30ec\u30dd\u30fc\u30c8\u7a2e\u985e --"}),Object(d.jsx)("option",{value:"BoxDisplacement",children:"\u51fd\u4f53\u5909\u4f4d\u8868"}),Object(d.jsx)("option",{value:"MachineControl",children:"\u30aa\u30fc\u30d7\u30f3\u30b7\u30fc\u30eb\u30c9\u30de\u30b7\u30f3\u7ba1\u7406\u65e5\u5831"}),Object(d.jsx)("option",{value:"Measurement",children:"\u51fd\u5e95\u9ad8\u30fb\u504f\u4f4d\u91cf\u6e2c\u5b9a\u4e00\u89a7\u8868"}),Object(d.jsx)("option",{value:"CheckSheet",children:"\u5de5\u7a0b\u5185\u691c\u67fb\u8868"}),Object(d.jsx)("option",{value:"Injection",children:"\u88cf\u8fbc\u6ce8\u5165\u6750\u6599\u53d7\u6255\u3044\u7c3f"})]})})]}),!0===K()?Object(d.jsxs)(j.t,{row:!0,children:[Object(d.jsx)(j.k,{md:"3",children:Object(d.jsx)(j.H,{htmlFor:"select",children:"\u5831\u544a\u65e5"})}),Object(d.jsx)(j.k,{xs:"12",md:"9",children:Object(d.jsx)(h.a,{dateFormat:"yyyy/MM/dd",selected:M,onChange:function(e){return D(e)},filterDate:function(e){if(void 0===H)return!1;var t=J(e);return!!H.includes(t)},placeholderText:"\u65e5\u4ed8\u3092\u9078\u629e"})})]}):Object(d.jsx)("div",{}),"MachineControl"==O?Object(d.jsxs)(j.t,{variant:"checkbox",className:"checkbox",children:[Object(d.jsx)(j.B,{id:"checkbox1",name:"checkbox1",checked:S,value:"graph",onChange:function(e){console.log("setting report"+T),C(e.target.checked),E("")}}),Object(d.jsx)(j.H,{variant:"checkbox",className:"form-check-label",htmlFor:"checkbox1",children:"\u30b0\u30e9\u30d5\u306e\u6709\u7121"})]}):""]})}),Object(d.jsx)(j.h,{children:!0===(!1===K()&&""!==O&&""!==v||null!==M)?Object(d.jsxs)("p",{children:[Object(d.jsxs)(j.e,{type:"submit",size:"sm",color:"primary",onClick:I,children:[Object(d.jsx)(u.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]}),Object(d.jsx)("br",{}),""===T?Object(d.jsx)("p",{}):Object(d.jsx)("a",{href:T,children:"Download"})]}):Object(d.jsxs)(j.e,{disabled:!0,type:"submit",size:"sm",color:"primary",onClick:I,children:[Object(d.jsx)(u.a,{name:"cil-scrubber"})," \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9"]})})]})]})]})}),Object(d.jsx)(j.k,{xs:"1",sm:"1",md:"1"})]})}}}]);
//# sourceMappingURL=7.204501b5.chunk.js.map