%PDF- %PDF-
Direktori : /var/www/html/hrsys/web/js/ |
Current File : /var/www/html/hrsys/web/js/chunk-fe7473d6.0e725b91.js |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fe7473d6"],{"37b7":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("base-loader",{attrs:{loading:t.loadingData}},[n("details-component",{attrs:{action:t.$t("buttons."+[t.process]),clients:t.clients,currencies:t.currencies,loading:t.loadingContent,"loading-select":t.isLoadingSelect,managers:t.managers,data:t.paymentData},on:{confirm:t.doPayment,requestClients:t.getClients}})],1)},i=[],c=(n("99af"),n("d3b7"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"view-container"},[n("div",{staticClass:"flex flex-col justify-around items-center"},[n("div",{staticClass:"max-w-md w-full sm:w-1/2 lg:w-1/3 xl:w-1/3 flex flex-wrap content-center justify-center"},[n("ValidationObserver",{ref:"validator",staticClass:"w-full",scopedSlots:t._u([{key:"default",fn:function(e){var a=e.invalid;return[n("form",{on:{submit:function(e){return e.preventDefault(),t.submit()}}},[t.isCreating?n("base-multiselect",{attrs:{"input-label":t.$t("maintenancePayments.table.client"),loading:t.loadingSelect,"max-height":200,options:t.clients,label:"name","track-by":"id"},on:{"search-change":function(e){return t.$emit("requestClients",e)}},model:{value:t.data.client,callback:function(e){t.$set(t.data,"client",e)},expression:"data.client"}}):t._e(),n("base-input",{staticClass:"w-full",attrs:{"label-placeholder":t.$t("maintenancePayments.table.name"),name:t.$t("maintenancePayments.table.name"),rules:"required"},model:{value:t.data.name,callback:function(e){t.$set(t.data,"name",e)},expression:"data.name"}}),n("base-textarea",{staticClass:"w-full",attrs:{"input-label":t.$t("maintenancePayments.table.description"),name:t.$t("maintenancePayments.table.description")},model:{value:t.data.description,callback:function(e){t.$set(t.data,"description",e)},expression:"data.description"}}),t.isCreating?n("date-picker",{staticClass:"w-ful",attrs:{"input-label":t.$t("maintenancePayments.table.start_date"),name:t.$t("maintenancePayments.table.start_date"),rules:"required"},model:{value:t.data.start_date,callback:function(e){t.$set(t.data,"start_date",e)},expression:"data.start_date"}}):t._e(),n("base-input",{staticClass:"w-full",attrs:{"label-placeholder":t.$t("maintenancePayments.table.cycle"),name:t.$t("maintenancePayments.table.cycle"),type:"number",rules:"required"},model:{value:t.data.cycle,callback:function(e){t.$set(t.data,"cycle",e)},expression:"data.cycle"}}),n("base-input",{staticClass:"w-full",attrs:{"label-placeholder":t.$t("maintenancePayments.table.amount"),name:t.$t("maintenancePayments.table.amount"),type:"number",rules:"required"},model:{value:t.data.amount,callback:function(e){t.$set(t.data,"amount",e)},expression:"data.amount"}}),n("base-multiselect",{attrs:{"custom-label":t.customCurrencyLabel,"allow-empty":!1,"input-label":t.$t("projects.table.currency"),"max-height":200,options:t.currencies},on:{input:t.currencyChange},model:{value:t.data.currency,callback:function(e){t.$set(t.data,"currency",e)},expression:"data.currency"}}),n("base-multiselect",{attrs:{"custom-label":t.customTypeLabel,"allow-empty":!1,"input-label":t.$t("maintenancePayments.table.type"),"max-height":200,options:t.types},on:{input:t.typeChange},model:{value:t.data.type,callback:function(e){t.$set(t.data,"type",e)},expression:"data.type"}}),n("base-button",{staticClass:"w-full mb-5 mt-2",attrs:{disabled:a,loading:t.loading,button:"filled",color:"success",type:"submit"}},[t._v(" "+t._s(t.action)+" ")])],1)]}}])})],1)])])}),r=[],s=(n("96cf"),n("1da1")),o=n("e94a"),u={name:"MaintenancePaymentDetailsComponent",components:{DatePicker:o["a"]},props:{data:{type:Object,required:!0},clients:{type:Array,required:!0},currencies:{type:Array,required:!0},loadingSelect:{type:Boolean,default:!1},action:{type:String,required:!0},loading:{type:Boolean,default:!1}},computed:{isCreating:function(){return this.data&&!this.data.id},types:function(){return["EARNING","EXPENSE"]}},methods:{submit:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.validator.validate();case 2:if(n=e.sent,n){e.next=5;break}return e.abrupt("return");case 5:t.$emit("confirm");case 6:case"end":return e.stop()}}),e)})))()},currencyChange:function(t){this.data.currency=t},customCurrencyLabel:function(t){return this.$t("currencies.".concat(t))},customTypeLabel:function(t){return this.$t("maintenanceTypes.".concat(t))}}},l=u,m=n("2877"),d=Object(m["a"])(l,c,r,!1,null,null,null),f=d.exports,p=n("a226"),y=n("1226"),h=n("73e8"),b={name:"MaintenancePaymentDetails",components:{DetailsComponent:f},data:function(){return{paymentData:{client:{},currency:"EURO",type:"EARNING"},paymentId:null,clients:[],managers:[],currencies:[],isLoadingSelect:!1,loadingContent:!1,loadingData:!1}},computed:{formattedData:function(){var t=Object.assign({},this.paymentData);return t.client&&(t.client_id=t.client.id),delete t.client,t},process:function(){return this.paymentId?"update":"create"}},methods:{doPayment:function(){"update"===this.process?this.updatePayment():this.createPayment()},createPayment:function(){var t=this;this.loadingContent=!0,p["a"].create(this.formattedData).then((function(){t.$notificationService.success("".concat(t.$t("maintenancePayments.maintenancePayment")," ").concat(t.$t("maintenancePayments.successCreate"))),history.back()})).catch((function(e){t.$notificationService.error(e.message)})).finally((function(){t.loadingContent=!1}))},updatePayment:function(){var t=this;this.loadingContent=!0,p["a"].update(this.formattedData).then((function(){t.$notificationService.success("".concat(t.$t("maintenancePayments.maintenancePayment")," ").concat(t.$t("maintenancePayments.successUpdate"))),history.back()})).catch((function(e){t.$notificationService.error(e.message)})).finally((function(){t.loadingContent=!1}))},getPaymentDetails:function(){var t=this;this.loadingData=!0,p["a"].details(this.paymentId).then((function(e){t.paymentData=e.data})).catch((function(e){t.$notificationService.error(e.message)})).finally((function(){t.loadingData=!1}))},getManagers:function(){var t=this;p["a"].getManagers().then((function(e){t.managers=e.data}))},getCurrencies:function(){var t=this;y["a"].getCurrencies().then((function(e){t.currencies=e}))},getClients:function(t){var e=this;this.isLoadingSelect=!0,h["a"].list(t).then((function(t){e.clients=t.data,e.isLoadingSelect=!1}))}},mounted:function(){this.paymentId=parseInt(this.$route.params.id),this.getCurrencies(),"update"===this.process&&this.getPaymentDetails()}},g=b,v=Object(m["a"])(g,a,i,!1,null,"6086c7ea",null);e["default"]=v.exports},"73e8":function(t,e,n){"use strict";n("d3b7");var a=n("1829"),i=n("18c2");e["a"]={list:function(t){return new Promise((function(e,n){a["a"].get("v1/clients?".concat(Object(i["a"])(t))).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},details:function(t){return new Promise((function(e,n){a["a"].get("v1/clients/".concat(t)).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},create:function(t){return new Promise((function(e,n){a["a"].post("v1/clients",t).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},update:function(t){return new Promise((function(e,n){var i=t.id;a["a"].put("v1/clients/".concat(i),t).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},delete:function(t){return new Promise((function(e,n){a["a"].delete("v1/clients/".concat(t)).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))}}},a226:function(t,e,n){"use strict";n("d3b7");var a=n("1829"),i=n("18c2");e["a"]={list:function(t){return new Promise((function(e,n){a["a"].get("v1/maintenancePayments?".concat(Object(i["a"])(t))).then((function(t){return e(t.data)}),(function(t){return n(t)})).catch((function(t){return n(t)}))}))},details:function(t){return new Promise((function(e,n){a["a"].get("v1/maintenancePayments/".concat(t)).then((function(t){return e(t.data)}),(function(t){return n(t)})).catch((function(t){return n(t)}))}))},create:function(t){return new Promise((function(e,n){a["a"].post("v1/maintenancePayments",t).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},update:function(t){return new Promise((function(e,n){a["a"].put("v1/maintenancePayments/".concat(t.id),t).then((function(t){return e(t.data)}),(function(t){return n(t)}))}))},cancel:function(t){return new Promise((function(e,n){a["a"].delete("v1/maintenancePayments/".concat(t,"/actions/cancel")).then((function(){return e()}),(function(t){return n(t)}))}))},confirm:function(t){return new Promise((function(e,n){a["a"].post("v1/maintenancePayments/".concat(t,"/actions/paymentReceived")).then((function(){return e()}),(function(t){return n(t)}))}))},getTransactions:function(t){return new Promise((function(e,n){a["a"].get("v1/maintenancePayments/".concat(t,"/actions/getTransactions")).then((function(t){return e(t.data.data)}),(function(t){return n(t)}))}))}}}}]); //# sourceMappingURL=chunk-fe7473d6.0e725b91.js.map