File manager - Edit - /home/autoph/.trash/assets/index-357c88fa.js
Back
import{L as m}from"./index-ad690dea.js";import{I as h}from"./index-f08865fb.js";import{P as f}from"./PurchaseRequestService-838abcda.js";import{h as i}from"./moment-a9aaa855.js";import{L as _}from"./Loading-1c8e1d47.js";import{C as y}from"./lodash-a972d5da.js";import{B as g}from"./index-d4f7a3db.js";import{H as v}from"./header-8bd13cea.js";import{_ as b,r as c,o as u,c as p,g as w,b as R,e as q}from"./index-47f877af.js";import"./vue-cleave.min-87f94ebc.js";import"./_commonjsHelpers-de833af9.js";import"./xhebrhsj-9c2f02c9.js";import"./es.string.replace-2e300990.js";const C={components:{Badge:g,Card:y,Loading:_,Layout:m,Icon:h,Header:v},data(){return{noDataFound:!1,showRequestQuery:!1,items:[],assetItems:[],error:[],totalItems:0,state:{isEdit:!1,isLoading:!1,isMounted:!1,isResetError:!1,isSubmitted:!1,showModal:!1,showRowModal:!1,isDeleting:!1},columns:[{label:"#",field:"#",tdClass:"text-center w-[20px]",sortable:!1},{label:"Ref. Code",field:"reference_no",tdStyle:"w-[200px]"},{label:"Company",field:"company_name"},{label:"Dealer",field:"dealership_name"},{label:"Department",field:"department_name"},{label:"Req. Category",field:"expense_category_name"},{label:"Req. Type",field:"item_classification_name"},{label:"Created",field:"created_at"},{label:"Date Needed",field:"needed_at"},{label:"Disclaimer",field:"disclaimer"},{label:"Status",field:"status",sortable:!1}],perPageOptions:[{value:"10",label:"10"},{value:"50",label:"50"},{value:"100",label:"100"}],searchQuery:this.$route.query.s??"",serverOptions:{page:1,rowsPerPage:10,sortBy:"created_at",sortType:"desc"},currentDate:i()}},props:{breadcrumbs:{type:Array,default:[{text:"Home",href:"/"},{text:"Transactions",href:"/transactions/purchase-requests"},{text:"Purchase Requests",active:!0}]}},computed:{perPage:function(){return this.serverOptions.rowsPerPage},activeUser:function(){return this.$store.userSettings.getActiveUser},activeCompany:function(){return this.$store.userSettings.getActiveCompany},activeDealership:function(){return this.$store.userSettings.getActiveDealership},roleGroups:function(){return this.activeUser.roles.flatMap(e=>e.group_id)},departmentAccess:function(){return this.activeUser&&this.activeUser.department_access?this.activeUser.department_access.flatMap(e=>e.id):null},employeeInfo:function(){if(this.activeUser.employees){let e=this.activeUser.employees;return{user_id:this.activeUser.id,employee_id:e.employee_id,company_id:e.company_id,dealership_id:e.dealer_id,department_id:e.department_id}}return null}},methods:{goTo(e){this.$router.push(e)},checkRefCode(){const e=this.$route.query.ref_code;e?(this.showRequestQuery=!0,this.fetchRecords(e)):this.showRequestQuery=!1},async fetchRecords(e){this.state.isLoading=!0,this.state.isMounted=!1,this.state.showModal=!1,console.log("this.activeUser"),console.log(this.activeUser),await f.fetchRecordsMyRequestSearchBar({keyword:e,page:this.serverOptions.page,per_page:this.serverOptions.rowsPerPage,sortBy:this.serverOptions.sortBy,sortType:this.serverOptions.sortType,company_id:this.activeCompany,dealership_id:this.activeDealership,departments:this.departmentAccess,role_groups:this.roleGroups,employee:this.employeeInfo}).then(s=>{console.log(s);let n=s.data.data.data,d=s.data.pr_dtls;this.items=n.map((t,r)=>{var o;return{"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(r+1),...t,needed_at:i(t.needed_at).format("MMM D, YYYY"),created_at:i(t.created_at).format("MMM D, YYYY"),overdue:this.currentDate.isAfter(i(t.needed_at)),allowed_to_act:(o=this.roleGroups)==null?void 0:o.some(l=>t.current_status.access.filter(a=>a.permission=="action").map(a=>a.role_group_id).includes(l))}}),this.assetItems=d.map((t,r)=>({"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(r+1),name:t.asset_item.name,uom:t.uom,quantity:t.quantity,item_status:t.status.name})),console.log("processed this.items"),console.log(this.items),this.totalItems=s.data.total??0}).catch(s=>{this.noDataFound=!0}).finally(()=>{this.state.isLoading=!1,this.state.isMounted=!0})}},mounted(){this.checkRefCode()},watch:{"$route.query.ref_code"(e,s){e?(this.showRequestQuery=!0,this.fetchRecords(e)):this.showRequestQuery=!1}}};function D(e,s,n,d,t,r){const o=c("Loading"),l=c("Header"),a=c("Layout");return u(),p(a,{breadcrumbs:n.breadcrumbs},{nocard:w(()=>[t.state.isLoading?(u(),p(o,{key:0,searching:!0,text:"Fetching records"})):R("",!0),q(l)]),_:1},8,["breadcrumbs"])}const Q=b(C,[["render",D]]);export{Q as default};
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings