%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/hr/web/js/
Upload File :
Create Path :
Current File : /var/www/html/hr/web/js/chunk-7e838a71.c13c262b.js.map

{"version":3,"sources":["webpack:///./src/components/Pagination.vue?fb44","webpack:///src/components/Pagination.vue","webpack:///./src/components/Pagination.vue?b5ee","webpack:///./src/components/Pagination.vue","webpack:///./src/views/ptos/ApprovePTOs.vue?c8f7","webpack:///./src/components/ptos/PtosApprovalTable.vue?3a46","webpack:///src/components/ptos/PtosApprovalTable.vue","webpack:///./src/components/ptos/PtosApprovalTable.vue?65c6","webpack:///./src/components/ptos/PtosApprovalTable.vue","webpack:///src/views/ptos/ApprovePTOs.vue","webpack:///./src/views/ptos/ApprovePTOs.vue?135d","webpack:///./src/views/ptos/ApprovePTOs.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","_s","$t","attrs","pagination","per_page","paginationOptions","on","$event","$emit","_e","max","total_pages","pageChange","model","value","callback","$$v","expression","staticRenderFns","component","loading","tableHeader","list","updatingPtos","approvePto","openDetails","rejectPto","changePage","ptos","scopedSlots","_u","key","fn","ref","data","_l","tr","indexTr","user","name","surname","start_date","_f","end_date","status","can_approve","isUpdating","id","approve","can_reject","reject","slot","title","i","class","queryParams","page"],"mappings":"gHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,QAAQ,CAAEN,EAAiB,cAAEI,EAAG,MAAM,CAACE,YAAY,qBAAqB,CAACF,EAAG,OAAO,CAACE,YAAY,uBAAuB,CAACN,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIS,GAAG,oBAAoB,OAAOL,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,mBAAmB,CAACE,YAAY,QAAQI,MAAM,CAAC,MAAQV,EAAIW,WAAWC,SAAS,QAAUZ,EAAIa,kBAAkB,cA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M,KAAN,wBACM,KAAN,oBAEI,OARJ,SAQA,GACM,KAAN,wBACM,KAAN,qBCzE0W,I,YCOtWjC,EAAY,eACd,EACA,EACA,GACA,EACA,KACA,WACA,MAIa,EAAAA,E,4CCGf,GACE,KAAF,cACE,WAAF,CACI,kBAAJ,EACI,WAAJ,QAEE,KAAF,WAAI,MAAJ,CACMC,SAAS,EACTE,KAAM,GACNnB,WAAY,GACZoD,YAAa,CACXC,KAAM,GAERjC,aAAc,KAElB,QAAF,CACI,QADJ,WACM,IAAN,OACM,KAAN,WACM,EAAN,gCACQ,EAAR,eACA,mBACQ,EAAR,yCACA,oBACQ,EAAR,eAGI,YAXJ,SAWA,GACM,EAAN,4BAEI,WAdJ,SAcA,GAAM,IAAN,OACM,EAAN,oCACQ,EAAR,8BACQ,EAAR,6GACA,mBACQ,EAAR,yCACA,oBACQ,EAAR,sDAGI,UAxBJ,SAwBA,GAAM,IAAN,OACM,EAAN,mCACQ,EAAR,8BACQ,EAAR,4GACA,mBACQ,EAAR,yCACA,oBACQ,EAAR,sDAGI,OAlCJ,WAmCM,KAAN,cAAQ,MAAR,yCAEM,KAAN,mBACM,KAAN,WAEI,aAxCJ,WAyCM,IAAN,OACA,yBACQ,EAAR,+CAGI,WA9CJ,SA8CA,GACM,KAAN,mBACM,KAAN,cAAQ,MAAR,yCAEM,KAAN,WAEI,gBApDJ,SAoDA,KACM,IAAN,mCAAQ,OAAR,eACM,KAAN,mBAGE,SAAF,CACI,YADJ,WAEM,MAAN,CACA,4BACA,+BACA,iCACA,+BACA,6BACA,iCAIE,QApFF,WAoFI,IAAJ,OACI,KAAJ,eACI,KAAJ,UACI,EAAJ,uCACM,EAAN,eC7GoW,ICOhW,EAAY,eACd,EACAhC,EACA2B,GACA,EACA,KACA,WACA,MAIa,e","file":"js/chunk-7e838a71.c13c262b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"flex\"},[(_vm.selectPerPage)?_c('div',{staticClass:\"flex items-center\"},[_c('span',{staticClass:\"mr-2 whitespace-pre\"},[_vm._v(_vm._s(_vm.$t('labels.per_page'))+\":\")]),_c('div',{staticClass:\"z-500 w-20\"},[_c('base-multiselect',{staticClass:\"-mt-4\",attrs:{\"value\":_vm.pagination.per_page,\"options\":_vm.paginationOptions,\"selectedLabel\":\"\",\"selectLabel\":\"\",\"deselectLabel\":\"\",\"allow-empty\":false},on:{\"input\":function($event){return _vm.$emit('selectedPerPage', $event)}}})],1)]):_vm._e(),_c('vs-pagination',{staticClass:\"mt-2\",attrs:{\"max\":_vm.max,\"total\":_vm.pagination.total_pages},on:{\"input\":_vm.pageChange},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v},expression:\"value\"}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div class=\"flex\">\n    <div v-if=\"selectPerPage\" class=\"flex items-center\">\n      <span class=\"mr-2 whitespace-pre\">{{ $t('labels.per_page') }}:</span>\n      <div class=\"z-500 w-20\">\n        <base-multiselect\n          :value=\"pagination.per_page\"\n          :options=\"paginationOptions\"\n          @input=\"$emit('selectedPerPage', $event)\"\n          selectedLabel=\"\"\n          selectLabel=\"\"\n          deselectLabel=\"\"\n          class=\"-mt-4\"\n          :allow-empty=\"false\"/>\n      </div>\n    </div>\n    <vs-pagination :max=\"max\" :total=\"pagination.total_pages\" @input=\"pageChange\" class=\"mt-2\"\n                   v-model=\"value\"></vs-pagination>\n  </div>\n</template>\n\n<script>\n  export default {\n    name:'Pagination',\n    props:{\n      pagination:{\n        type:Object,\n        required:true\n      },\n      max:{\n        type:Number,\n        default:7\n      },\n      selectPerPage: {\n        type:Boolean,\n        default:false\n      }\n    },\n    data:() => ({\n      paginationOptions:[5, 10, 15, 20, 30, 50, 100],\n      value:null\n    }),\n    methods:{\n      pageChange(val) {\n        this.$emit('input', val)\n      }\n    },\n    created() {\n      this.value = this.pagination.current_page\n    }\n  }\n</script>\n\n<style scoped>\n\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Pagination.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Pagination.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Pagination.vue?vue&type=template&id=cb826a88&scoped=true&\"\nimport script from \"./Pagination.vue?vue&type=script&lang=js&\"\nexport * from \"./Pagination.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"cb826a88\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('base-loader',{attrs:{\"loading\":_vm.loading}},[_c('div',{staticClass:\"rounded-lg shadow-md\"},[_c('ptos-approval-table',{attrs:{\"header\":_vm.tableHeader,\"ptos\":_vm.list,\"updatingPtos\":_vm.updatingPtos},on:{\"approve\":_vm.approvePto,\"details\":_vm.openDetails,\"reject\":_vm.rejectPto}}),(_vm.pagination.total)?_c('pagination',{attrs:{\"pagination\":_vm.pagination},on:{\"input\":_vm.changePage}}):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('vs-table',{attrs:{\"data\":_vm.ptos},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar data = ref.data;\nreturn _vm._l((data),function(tr,indexTr){return _c('vs-tr',{key:indexTr,attrs:{\"data\":tr}},[_c('vs-td',{attrs:{\"data\":tr.user.name}},[_vm._v(\" \"+_vm._s(tr.user.name)+\" \")]),_c('vs-td',{attrs:{\"data\":tr.user.surname}},[_vm._v(\" \"+_vm._s(tr.user.surname)+\" \")]),_c('vs-td',{attrs:{\"data\":tr.start_date}},[_vm._v(\" \"+_vm._s(_vm._f(\"date\")(tr.start_date,'MMM Do YYYY'))+\" \")]),_c('vs-td',{attrs:{\"data\":tr.end_date}},[_vm._v(\" \"+_vm._s(_vm._f(\"date\")(tr.end_date,'MMM Do YYYY'))+\" \")]),_c('vs-td',{attrs:{\"data\":tr.status}},[_vm._v(\" \"+_vm._s(_vm._f(\"ptoStatus\")(tr.status))+\" \")]),_c('vs-td',{staticClass:\"text-right w-16\"},[_c('div',{staticClass:\"flex justify-end\"},[_c('vx-tooltip',{attrs:{\"text\":_vm.$t('buttons.details'),\"position\":\"top\"}},[_c('base-button',{staticClass:\"self-end mx-px\",attrs:{\"icon\":\"info\"},on:{\"click\":function($event){return _vm.$emit('details', tr)}}})],1),_c('vx-tooltip',{attrs:{\"text\":_vm.$t('buttons.approve'),\"position\":\"top\"}},[_c('base-button',{staticClass:\"self-end mx-px\",attrs:{\"disabled\":!tr.can_approve,\"loading\":_vm.isUpdating(tr.id),\"icon\":\"check\"},on:{\"click\":function($event){return _vm.approve(tr)}}})],1),_c('vx-tooltip',{attrs:{\"text\":_vm.$t('buttons.reject'),\"position\":\"top\"}},[_c('base-button',{staticClass:\"self-end mx-px\",attrs:{\"disabled\":!tr.can_reject,\"loading\":_vm.isUpdating(tr.id),\"color\":\"danger\",\"icon\":\"ban\"},on:{\"click\":function($event){return _vm.reject(tr)}}})],1)],1)])],1)})}}])},[_c('template',{slot:\"thead\"},_vm._l((_vm.header),function(title,i){return _c('vs-th',{key:i,staticClass:\"text-base\",class:{'float-right': title === _vm.$t('ptos.table.actions')}},[_vm._v(_vm._s(title))])}),1)],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\n  <vs-table :data=\"ptos\">\n\n    <template slot=\"thead\">\n      <vs-th :key=\"i\" class=\"text-base\" v-for=\"(title, i) in header\"\n             :class=\"{'float-right': title === $t('ptos.table.actions')}\">{{ title }}</vs-th>\n    </template>\n\n    <template slot-scope=\"{data}\">\n      <vs-tr :data=\"tr\" :key=\"indexTr\" v-for=\"(tr, indexTr) in data\">\n        <vs-td :data=\"tr.user.name\">\n          {{ tr.user.name }}\n        </vs-td>\n        <vs-td :data=\"tr.user.surname\">\n          {{ tr.user.surname }}\n        </vs-td>\n        <vs-td :data=\"tr.start_date\">\n          {{ tr.start_date | date('MMM Do YYYY') }}\n        </vs-td>\n        <vs-td :data=\"tr.end_date\">\n          {{ tr.end_date | date('MMM Do YYYY') }}\n        </vs-td>\n        <vs-td :data=\"tr.status\">\n          {{ tr.status | ptoStatus }}\n        </vs-td>\n        <vs-td class=\"text-right w-16\">\n          <div class=\"flex justify-end\">\n            <vx-tooltip :text=\"$t('buttons.details')\" position=\"top\">\n              <base-button @click=\"$emit('details', tr)\" class=\"self-end mx-px\" icon=\"info\"></base-button>\n            </vx-tooltip>\n            <vx-tooltip :text=\"$t('buttons.approve')\" position=\"top\">\n              <base-button :disabled=\"!tr.can_approve\" :loading=\"isUpdating(tr.id)\" @click=\"approve(tr)\"\n                           class=\"self-end mx-px\" icon=\"check\"></base-button>\n            </vx-tooltip>\n            <vx-tooltip :text=\"$t('buttons.reject')\" position=\"top\">\n              <base-button :disabled=\"!tr.can_reject\" :loading=\"isUpdating(tr.id)\" @click=\"reject(tr)\" class=\"self-end mx-px\"\n                           color=\"danger\" icon=\"ban\"></base-button>\n            </vx-tooltip>\n          </div>\n        </vs-td>\n      </vs-tr>\n    </template>\n  </vs-table>\n</template>\n\n<script>\n  export default {\n    name: 'PtosApprovalTable',\n    props: {\n      header: {\n        type: Array,\n        required: true\n      },\n      ptos: {\n        type: Array,\n        required: true\n      },\n      updatingPtos: {\n        type: Array,\n        default: () => ([])\n      }\n    },\n    methods: {\n      isUpdating (id) {\n        return this.updatingPtos.indexOf(id) > -1\n      },\n      approve (tr) {\n        this.updatingPtos.push(tr.id);\n        this.$emit('approve', tr);\n      },\n      reject (tr) {\n        this.updatingPtos.push(tr.id);\n        this.$emit('reject', tr);\n      }\n    },\n  }\n</script>\n\n<style lang=\"scss\" scoped>\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PtosApprovalTable.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PtosApprovalTable.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PtosApprovalTable.vue?vue&type=template&id=17ec09f6&scoped=true&\"\nimport script from \"./PtosApprovalTable.vue?vue&type=script&lang=js&\"\nexport * from \"./PtosApprovalTable.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"17ec09f6\",\n  null\n  \n)\n\nexport default component.exports","<template>\n  <base-loader :loading=\"loading\">\n    <div class=\"rounded-lg shadow-md\">\n      <ptos-approval-table\n        :header=\"tableHeader\"\n        :ptos=\"list\"\n        :updatingPtos=\"updatingPtos\"\n        @approve=\"approvePto\"\n        @details=\"openDetails\"\n        @reject=\"rejectPto\"/>\n      <pagination :pagination=\"pagination\" @input=\"changePage\" v-if=\"pagination.total\"/>\n    </div>\n  </base-loader>\n</template>\n\n<script>\n  import PtosApprovalTable from \"../../components/ptos/PtosApprovalTable\";\n  import Pagination from \"../../components/Pagination\";\n  import Ptos from \"../../services/Ptos\";\n  import EventBus from \"../../utilities/eventBus\";\n\n  export default {\n    name: \"ApprovePTOs\",\n    components: {\n      PtosApprovalTable,\n      Pagination\n    },\n    data: () => ({\n      loading: false,\n      list: [],\n      pagination: {},\n      queryParams: {\n        page: 1,\n      },\n      updatingPtos: []\n    }),\n    methods: {\n      getPtos () {\n        this.loading = true;\n        Ptos.getAll().then(res => {\n          this.list = res.data\n        }).catch(error => {\n          this.$notificationService.error(error.message)\n        }).finally(() => {\n          this.loading = false;\n        })\n      },\n      openDetails (pto) {\n        EventBus.$emit('ptoDetails', pto)\n      },\n      approvePto (pto) {\n        Ptos.approve(pto.id).then(() => {\n          this.changePtoStatus(pto, 'APPROVED')\n          this.$notificationService.success(`${this.$t('ptos.pto')} ${this.$t('notification.successApprove')}`)\n        }).catch(error => {\n          this.$notificationService.error(error.message)\n        }).finally(() => {\n          this.updatingPtos.splice(this.updatingPtos.indexOf(pto.id))\n        })\n      },\n      rejectPto (pto) {\n        Ptos.reject(pto.id).then(() => {\n          this.changePtoStatus(pto, 'REJECTED')\n          this.$notificationService.success(`${this.$t('ptos.pto')} ${this.$t('notification.successReject')}`)\n        }).catch(error => {\n          this.$notificationService.error(error.message)\n        }).finally(() => {\n          this.updatingPtos.splice(this.updatingPtos.indexOf(pto.id))\n        })\n      },\n      search () {\n        this.$router.push({query: this.queryParams}).catch(() => {\n        })\n        this.queryParams.page = 1\n        this.getPtos()\n      },\n      getUrlParams () {\n        let vm = this;\n        if (this.$route.query.page) {\n          vm.queryParams = Object.assign({}, vm.$route.query);\n        }\n      },\n      changePage (newPage) {\n        this.queryParams.page = newPage\n        this.$router.push({query: this.queryParams}).catch(() => {\n        })\n        this.getPtos()\n      },\n      changePtoStatus (selectedPto, newStatus) {\n        let ptoIndex = this.list.findIndex((pto) => pto.id === selectedPto.id)\n        this.list[ptoIndex].status = newStatus\n      }\n    },\n    computed: {\n      tableHeader () {\n        return ([\n          this.$t('users.table.name'),\n          this.$t('users.table.surname'),\n          this.$t('ptos.table.start_date'),\n          this.$t('ptos.table.end_date'),\n          this.$t('ptos.table.status'),\n          this.$t('ptos.table.actions')\n        ])\n      }\n    },\n    mounted () {\n      this.getUrlParams()\n      this.getPtos()\n      EventBus.$on('ptoStatusChange', () => {\n        this.getPtos()\n      })\n    },\n  }\n</script>\n\n<style scoped>\n\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ApprovePTOs.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ApprovePTOs.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ApprovePTOs.vue?vue&type=template&id=b899646c&scoped=true&\"\nimport script from \"./ApprovePTOs.vue?vue&type=script&lang=js&\"\nexport * from \"./ApprovePTOs.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"b899646c\",\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}

Zerion Mini Shell 1.0