Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.217.26.8
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/DisplayTempCode-DOUjPw80.js |
import{x as h,r as s,y as j,t as e,D as y,L as d,B as n,T as b,O as C,M as D,v as T,E as l}from"./index-B1vCiLdb.js";import{g as I}from"./TemplateCode-DT501iwv.js";import{g as i,s as c}from"./datatable-CUbHEgW_.js";import{p as R}from"./sem-BK69X1ab.js";import{S as m}from"./index-Bg4J2mA-.js";import{R as v}from"./HomeOutlined-URzAi1xv.js";import{F as S}from"./Table-DAx1ImL3.js";import{R as k}from"./EditOutlined-DqmLq85I.js";import{R as w}from"./FilePdfOutlined-CqeY-_8u.js";import{R as A}from"./DeleteOutlined-Df0cjl3o.js";import"./index-CQr3Towi.js";import"./index-Bk72D_Kc.js";import"./index-BYuc-nPv.js";import"./responsiveObserver-MZZXoO8e.js";const E=a=>{s.useState(""),j();const[p,f]=s.useState([]);s.useEffect(()=>{a.getTempCodeDet()},[]),s.useEffect(()=>{f(a.tempData)},[a.tempData]);const g=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"4rem"},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Code"}),dataIndex:"ftempcode",...i("ftempcode","tempcode"),sorter:(o,t)=>c(o,t,"ftempcode"),align:"center"},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Name"}),dataIndex:"ftempname",...i("ftempname","tempname"),sorter:(o,t)=>c(o,t,"ftempname")},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Description"}),dataIndex:"ftempdesc",...i("ftempdesc","temp desc."),sorter:(o,t)=>c(o,t,"ftempdesc")},{title:"Action",render:(o,t)=>e.jsxs(m,{children:[e.jsx(d,{to:`/qpsettings/edit/edit/${t.ftempcode}`,children:e.jsxs(n,{size:"medium",style:{background:"green",color:"#fff"},children:[e.jsx(k,{})," Edit"]})}),e.jsxs(n,{size:"medium",style:{background:"#2185d0",color:"#fff"},onClick:()=>x(t.ftempcode),children:[e.jsx(w,{})," Report"]}),e.jsxs(n,{size:"medium",style:{background:"#db2828",color:"#fff"},onClick:()=>u(t.ftempcode),children:[e.jsx(A,{})," Delete"]})]}),align:"center"}],x=async o=>{let t=localStorage.getItem("dbname");window.open(C+"/app.php?a=QPPatternDet&db="+t+"&univcode="+a.funivcode+"&tempcode="+o)},u=async o=>{let t=localStorage.getItem("dbname");D.confirm({title:"Warning",content:"Do you want delete?",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){T.post("app.php?a=deleteTemplateCode&db="+t+"&univcode="+a.funivcode+"&tempcode="+o).then(r=>{if(typeof r.data!="object"){l("Error","Something went wrong, Please try again later");return}else if(r.data.error_code==0){l("success",r.data.data.msg),a.getTempCodeDet();return}}).catch(r=>console.log(r))},onCancel(){console.log("Cancelled")}})};return e.jsx(y,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"QP Template"}),extra:e.jsxs(m,{children:[e.jsx(d,{to:"/qpsettings/edit/add/''",children:e.jsxs(n,{type:"primary",style:{backgroundColor:"green"},children:[e.jsx(b,{}),"Add"]})}),e.jsx(d,{to:"/dashboard",children:e.jsxs(n,{type:"primary",danger:!0,children:[e.jsx(v,{})," Exit"]})})]}),children:e.jsx(S,{dataSource:p,columns:g,scroll:{x:1300,y:500},bordered:!0,size:"small",pagination:R})})},P=a=>({funivcode:a.loginfo.userData.funivcode,tempData:a.tempDet}),J=h(P,{getTempCodeDet:I})(E);export{J as default};
|