0xV3NOMx
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 : 3.146.107.152


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/DisplayTempCode-2ldwAKZi.js

import{x as h,r as s,y as j,t as e,D as y,L as d,B as n,W as b,N as C,M as D,v as T,E as l}from"./index-ChT0xYiY.js";import{g as I}from"./TemplateCode-ComJELAE.js";import{g as i,s as c}from"./datatable-Pmr3nCys.js";import{p as R}from"./sem-DLpF_ddZ.js";import{S as m}from"./index-CCqRUA_e.js";import{R as v}from"./HomeOutlined-C_Cn3B9w.js";import{F as S}from"./Table-74BLe3me.js";import{R as k}from"./EditOutlined-BXzCBBe2.js";import{R as w}from"./FilePdfOutlined-CxBg6VEx.js";import{R as A}from"./DeleteOutlined-CPPj1lhl.js";import"./index-G2j282sA.js";import"./index-cEGmOHHy.js";import"./index-BDLcy6G-.js";import"./responsiveObserver-CMjrehYy.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};