File manager - Edit - /home/autoph/.trash/assets/index-bf19b75a.js
Back
import{c as I,a as w,V as M}from"./array-0fe74ce4.js";import{C as V}from"./ProposalService-082fac61.js";import{F as P}from"./index-f9b0c988.js";import{F}from"./lodash-5af90829.js";import"./index-66c6643f.js";import{_ as B,r as i,o as n,c as u,g as f,b as _,f as e,I as r,d as m,e as c,J as L,G as S,H as R,K as N,L as q,h as p}from"./index-8e9322aa.js";import"./vue-cleave.min-9b00abb0.js";import{T as G}from"./index-6cd34b81.js";import"./index-2520d048.js";import{C as Q}from"./CloseButton-19e5dd8c.js";import{S as A}from"./UpdateButton-e3d02fc4.js";/* empty css */import{I as E}from"./index-e52603fd.js";import{L as T}from"./Loading-21e5100a.js";const D={components:{FormModal:P,InputGroup:E,FormGroup:F,TextArea:G,SubmitButton:A,CloseButton:Q,Loading:T},data(){return{form:{id:null,remarks:""},searchQuery:"",items:[],state:{isLoading:!1,isSaving:!1,showModal:!1,isFetchingProposals:!1},errors:{remarks:""}}},computed:{filteredItems(){let s=this.items;return this.searchQuery&&(s=this.items.filter(a=>a.supplier_name.toLowerCase().includes(this.searchQuery.toLowerCase()||a.ref_code.includes(this.searchQuery)))),s}},methods:{async fetchRecords(){this.state.isLoading=!0,!this.state.isFetchingProposals&&(this.state.isFetchingProposals=!0,V.fetchRecords({validity:"2025-01-01"}).then(s=>{s.status==200&&(console.log("response"),console.log(s),this.items=s.data.data,this.state.isLoading=!1,console.log("this.items"),console.log(this.items))}).catch(s=>{console.log(s)}),this.state.isLoading=!1)},closeModal(){this.state.showModal=!1},selectItem(s){this.form.id=s,console.log(s)},submit(){this.errors={};try{I().shape({remarks:w().nullable().required("Remarks field is required")}).validateSync(this.form,{abortEarly:!1}),this.$emit("submit",this.form),this.$emit("reload")}catch(s){if(s instanceof M){const a={};s.inner.forEach(h=>{a[h.path]=h.message}),this.errors=a}}}}},l=s=>(N("data-v-d99a3adc"),s=s(),q(),s),j={class:"space-y-2 p-2 mb-10"},z={class:"grid lg:grid-cols-2"},H={class:"flex gap-2 border-b border-slate-300 border-dashed py-1"},U=l(()=>e("div",{class:"label text-slate-500"},"Reference No:",-1)),J={class:"value font-bold"},K=l(()=>e("div",{class:"flex gap-2 border-b border-slate-300 border-dashed py-1"},[e("div",{class:"label text-slate-500"},"Requested By:"),e("div",{class:"value font-bold"})],-1)),O={class:"grid lg:grid-cols-2"},W={class:"flex gap-2 border-b border-slate-300 border-dashed py-1"},X=l(()=>e("div",{class:"label text-slate-500"},"Company:",-1)),Y={class:"value font-bold"},Z={class:"flex gap-2 border-b border-slate-300 border-dashed py-1"},$=l(()=>e("div",{class:"label text-slate-500"},"Dealership:",-1)),ee={class:"value font-bold"},se={class:"grid lg:grid-cols-2"},oe={class:"flex gap-2 border-b border-slate-300 border-dashed py-1"},te=l(()=>e("div",{class:"label text-slate-500"},"Date Needed:",-1)),re={class:"value font-bold"},le={class:"flex gap-1 border-b border-slate-300 border-dashed py-1"},ae=l(()=>e("div",{class:"label text-slate-500"},"Approving Head:",-1)),de={class:"value font-bold"},ie={class:"flex gap-1 border-b border-slate-300 border-dashed py-1"},ne=l(()=>e("div",{class:"label text-slate-500"},"Requested By:",-1)),ce={class:"value font-bold"},me={class:"flex gap-1 border-b border-slate-500 border-dashed py-1"},he=l(()=>e("div",{class:"label text-slate-500"},"Purpose:",-1)),_e={class:"value font-bold"},pe={key:1,class:"mb-4 p-4 bg-blue-100 border border-blue-300 rounded-md flex items-center space-x-2"},ue=l(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 text-pink-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m0-4h.01M12 12h.01M12 8v.01M13 12h-1m-2 4h2v-4m1 0V8.01m1 12h1m0-8h-.01M16 16h1v-4h1m0-4h-.01M16 8V7m0 12v-1m-8 1v-1m0-12V7m-4 12v-1M4 8V7m0 12v-1M4 8V7m12 5h-1m0 0h1"})],-1)),fe=l(()=>e("p",{class:"text-pink-400 text-sm"},[p(" Please "),e("strong",null,"click on a row"),p(" to select the correct "),e("strong",null,"pre-approved proposal"),p(" for the purchase request item. ")],-1)),be=[ue,fe],ve={class:"py-4"},ge={class:"max-h-80 overflow-y-auto"},ye=l(()=>e("thead",null,[e("tr",null,[e("th",null,"Ref No"),e("th",null,"Supplier"),e("th",null,"Validity"),e("th",null,"File"),e("th",null,"Notes")])],-1)),xe={key:0},ke=["onClick"],Ce={class:"flex gap-2 justify-end"};function Ie(s,a,h,we,o,d){const b=i("Loading"),v=i("InputGroup"),g=i("TextArea"),y=i("FormGroup"),x=i("SubmitButton"),k=i("CloseButton"),C=i("FormModal");return n(),u(C,{title:"Approved Proposals",active:o.state.showModal,onClose:d.closeModal,themeClass:"bg-primary-600",sizeClass:"w-full"},{default:f(()=>[o.state.isLoading?(n(),u(b,{key:0,searching:!0,text:"Fetching records"})):_("",!0),e("div",j,[e("div",z,[e("div",H,[U,e("div",J,r(o.form.PrInfo.reference_no),1)]),K]),e("div",O,[e("div",W,[X,e("div",Y,r(o.form.PrInfo.company_name),1)]),e("div",Z,[$,e("div",ee,r(o.form.PrInfo.dealership_name),1)])]),e("div",se,[e("div",oe,[te,e("div",re,r(o.form.PrInfo.needed_at),1)]),e("div",le,[ae,e("div",de,r(o.form.PrInfo.approving_head_name),1)])]),e("div",ie,[ne,e("div",ce,r(o.form.PrInfo.requested_by_name),1)]),e("div",me,[he,e("div",_e,r(o.form.PrInfo.purpose),1)])]),o.form.PrInfo.status===31?(n(),m("div",pe,be)):_("",!0),e("div",ve,[c(v,{modelValue:o.searchQuery,"onUpdate:modelValue":a[0]||(a[0]=t=>o.searchQuery=t)},null,8,["modelValue"])]),e("div",ge,[e("table",null,[ye,d.filteredItems&&d.filteredItems.length>0?(n(),m("tbody",xe,[(n(!0),m(L,null,S(d.filteredItems,t=>(n(),m("tr",{key:t.id,onClick:Me=>d.selectItem(t.id),class:R({"bg-primary-300":o.form.id==t.id})},[e("td",null,r(t.ref_code),1),e("td",null,r(t.supplier_name),1),e("td",null,r(t.validity_date),1),e("td",null,r(t.file_code),1)],10,ke))),128))])):_("",!0)])]),c(y,{label:"Remarks",isRequired:"",formClass:"my-8"},{default:f(()=>[c(g,{modelValue:o.form.remarks,"onUpdate:modelValue":a[1]||(a[1]=t=>o.form.remarks=t),error:o.errors.remarks},null,8,["modelValue","error"])]),_:1}),e("div",Ce,[c(x,{onClick:d.submit},null,8,["onClick"]),c(k,{onClick:d.closeModal},null,8,["onClick"])])]),_:1},8,["active","onClose"])}const De=B(D,[["render",Ie],["__scopeId","data-v-d99a3adc"]]);export{De as P};
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings