(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e6de034"],{"1c52":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("breadcrumbs",{staticClass:"mb-3",attrs:{breadcrumbs:e.breadcrumbs}},[e.allowedTo("add")?t("v-btn",{attrs:{color:"primary",depressed:"",to:{name:"admin.rems.service-desk.general-feedback.view",params:{ticketId:"new"}}}},[e._v(e._s(e.$t("message.new")))]):e._e()],1),t("v-container",{staticClass:"pt-0",attrs:{fluid:""}},[t("v-card",{attrs:{flat:""}},[t("v-toolbar",{staticClass:"primary lighten-2",attrs:{flat:"",dark:""}},[t("v-toolbar-title",{staticClass:"font-weight-light"},[e._v(e._s(e.$t("message.facilityManagementFeedback")))])],1),t("v-tabs",{attrs:{"slider-color":"info","show-arrows":""},model:{value:e.tabs,callback:function(t){e.tabs=t},expression:"tabs"}},[t("v-tab",{key:"details",staticClass:"subheading font-weight-light",attrs:{to:{name:"admin.rems.service-desk.general-feedback.view"}}},[e._v(e._s(e.$t("message.details")))]),t("v-tab",{directives:[{name:"show",rawName:"v-show",value:e.getValue(e.record,"status.id")!=e.STATUS_RESOLVED&&e.count<3,expression:"getValue(record, 'status.id') != STATUS_RESOLVED && count < 3"}],key:"workflow",staticClass:"subheading font-weight-light",attrs:{disabled:"new"===e.recordId,to:{name:"admin.rems.service-desk.general-feedback.workflow.listing"}}},[e._v(e._s(e.$t("message.workflowSubTicket")))]),t("v-tab",{key:"field-service-request",staticClass:"subheading font-weight-light",attrs:{disabled:"new"===e.recordId,to:{name:"admin.rems.service-desk.general-feedback.field-service-request.listing"}}},[e._v(e._s(e.$t("message.fieldServiceRequest")))]),t("v-tab",{key:"inventories",staticClass:"subheading font-weight-light",attrs:{disabled:"new"===e.recordId,to:{name:"admin.rems.service-desk.general-feedback.inventory.listing"}}},[e._v(e._s(e.$t("message.inventories")))]),t("v-tab",{key:"history",staticClass:"subheading font-weight-light",attrs:{disabled:"new"===e.recordId,to:{name:"admin.rems.service-desk.general-feedback.history.listing"}}},[e._v(e._s(e.$t("message.history")))])],1),t("router-view",{attrs:{fetching:e.form.fetching},model:{value:e.record,callback:function(t){e.record=t},expression:"record"}})],1)],1),t("snackbar",{attrs:{snackbar:e.snackbar}})],1)},o=[],a=(n("8e6e"),n("ac6a"),n("456d"),n("ade3")),i=n("365c"),c=n("2f62"),s=n("4da1"),d=n("323e"),u=n.n(d),l=(n("7fb5"),n("1dce")),f=n("5e44"),m=n("8106");function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){Object(a["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b={mixins:[l["validationMixin"]],validations:{},constants:{STATUS_PENDING:1,STATUS_IN_PROGRESS:2,STATUS_RESOLVED:3,STATUS_PENDING_INSPECTION:4},created:function(){this.record=this.defaultRecord,"new"==this.recordId&&(this.mode="new"),this.getRoleAccess(),this.getData()},components:{Breadcrumbs:f["a"],Snackbar:m["a"]},computed:h(h({},Object(c["b"])(["adminScope","mySession"])),{},{defaultRecord:function(){return Object.assign({},{})},breadcrumbs:function(){var e=[{text:this.$t("message.facilityManagementFeedback"),disabled:!1,to:{name:"admin.rems.service-desk.general-feedback"}}];return this.record.parent_ticket&&this.roleAccess&&e.push({text:Object(s["j"])(this.record.parent_ticket,"ticket_no"),to:{name:"admin.rems.service-desk.general-feedback.view",params:{ticketId:Object(s["j"])(this.record.parent_ticket,"id")}},disabled:!1}),e.push({text:"new"==this.recordId?"New":Object(s["j"])(this.record,"ticket_no"),disabled:!0}),e},locked:function(){return this.record.locked}}),watch:{$route:function(e,t){this.recordId=Object(s["j"])(e.params,"ticketId"),this.record=this.defaultRecord,"new"==this.recordId&&(this.mode="new"),this.getData()}},methods:{getValue:function(e,t){return Object(s["j"])(e,t)},getDateTimeFromISO:function(e,t){return Object(s["g"])(e,t)},getDateFromISO:function(e,t){return Object(s["e"])(e,t)},convertDateToISO:function(e,t){return Object(s["a"])(e,t)},allowedTo:function(e){switch(e){case"add":return!this.$can.not("add","acl.admin.rems.work-order.general-feedback");case"delete":if(this.$can.not("add","acl.admin.rems.work-order.general-feedback")&&this.$can.not("delete","acl.admin.rems.work-order.general-feedback"))return!1;if("new"==this.mode)return!1;if("new"!=this.recordId)return!this.record.locked;break;case"save":if(this.$can.not("add","acl.admin.rems.work-order.general-feedback")&&this.$can.not("edit","acl.admin.rems.work-order.general-feedback"))return!1;if("new"==this.mode||"edit"==this.mode)return!0;break;case"edit":return(!this.$can.not("add","acl.admin.rems.work-order.general-feedback")||!this.$can.not("edit","acl.admin.rems.work-order.general-feedback"))&&("new"!=this.recordId&&"edit"!=this.mode);case"cancel":if(this.$can.not("add","acl.admin.rems.work-order.general-feedback")&&this.$can.not("edit","acl.admin.rems.work-order.general-feedback"))return!1;if("new"!=this.recordId&&"edit"==this.mode)return!0;break}return!1},getRoleAccess:function(){var e=this;this.form.fetching=!0,u.a.start(),i["a"].get("/admin/rems/service-desk/general-feedback/role-access/"+this.mySession.id,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.roleAccess=Object(s["j"])(t,"data.data")})).catch((function(e){})).then((function(){u.a.done(),e.form.fetching=!1}))},getData:function(){var e=this;"new"!=this.recordId&&(this.form.fetching=!0,u.a.start(),i["a"].get("admin/rems/service-desk/general-feedback/"+this.recordId,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.record=Object(s["j"])(t,"data.data"),e.recordStatus=Object(s["j"])(t,"data.data.status.id"),Object(s["j"])(e.record,"id")&&(console.log("id",Object(s["j"])(e.record,"id")),e.getCountWorkflow())})).catch((function(e){})).then((function(){u.a.done(),e.form.fetching=!1})))},getCountWorkflow:function(){var e=this;this.form.fetching=!0,u.a.start(),i["a"].get("/admin/rems/service-desk/general-feedback/count-workflow/"+this.record.id,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.count=Object(s["j"])(t,"data.data"),console.log("count",e.count)})).catch((function(e){})).then((function(){u.a.done(),e.form.fetching=!1}))}},data:function(){return{recordId:this.$route.params.ticketId,record:null,recordStatus:"",count:"",mode:"view",showConfirmDeleteRecord:!1,tabs:null,roleAccess:null,form:{fetching:!1,loading:!1,action:null},snackbar:{show:!1,type:null,message:null},errorMessages:null}}},p=b,g=n("2877"),w=Object(g["a"])(p,r,o,!1,null,null,null);t["default"]=w.exports},"3ba2":function(e,t,n){"use strict";var r=function(){var e=this,t=e._self._c;return t("router-link",{attrs:{to:e.to},nativeOn:{click:function(t){return e.routeToAnchor.apply(null,arguments)}}},[e._t("default")],2)},o=[],a=(n("c5f6"),n("2b0e")),i=n("8c4f"),c=n("f13c"),s=n.n(c);a["default"].use(i["a"]),a["default"].use(s.a);var d={name:"vue-anchor-router-link",props:{to:Object,scrollOptions:{type:[Object,Number],default:1}},data:function(){return{previousRoute:this.$route}},methods:{routeToAnchor:function(){this.$route.fullPath===this.previousRoute.fullPath&&this.$scrollTo(this.to.hash,this.scrollOptions)}},watch:{$route:function(e,t){this.previousRoute=e}}},u=d,l=n("2877"),f=Object(l["a"])(u,r,o,!1,null,null,null),m=f.exports;t["a"]=m},"5e44":function(e,t,n){"use strict";var r=function(){var e=this,t=e._self._c;return t("v-toolbar",{attrs:{flat:"",color:e.color?e.color:"white"}},[t("v-breadcrumbs",{attrs:{divider:"/",items:e.breadcrumbs},scopedSlots:e._u([{key:"item",fn:function(n){return[n.item.to?[t("vue-anchor-router-link",{attrs:{to:n.item.to}},[e._v(e._s(n.item.text))])]:[e._v("\n        "+e._s(n.item.text)+"\n      ")]]}}])}),t("v-spacer"),e._t("default")],2)},o=[],a=n("3ba2"),i={props:["breadcrumbs","color"],computed:{},components:{VueAnchorRouterLink:a["a"]}},c=i,s=n("2877"),d=Object(s["a"])(c,r,o,!1,null,null,null);t["a"]=d.exports},"7fb5":function(e,t,n){var r,o;(function(n,a){n||(n={}),r=[],o=function(){return n.jsonToFormData=a()}.apply(t,r),void 0===o||(e.exports=o)})(this,(function(){function e(e,t){return[e,t].reduce((function(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}),{})}function t(e){return"[object Array]"==={}.toString.call(e)}function n(e){return!t(e)&&"object"===typeof e&&!!e&&!(e instanceof Blob)&&!(e instanceof Date)}function r(e){return"function"===typeof e.append}function o(){return"function"===typeof FormData}function a(){if(o())return new FormData}function i(t,n){if(n&&n.initialFormData){if(!r(n.initialFormData))throw"initialFormData must have an append function."}else if(!o())throw"This environment does not have global form data. options.initialFormData must be specified.";var i={initialFormData:a(),showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"===typeof e?+e?"1":"0":e}},s=e(i,n||{});return c(t,s,s.initialFormData)}function c(e,r,o,a){var i=0;for(var s in e){if(e.hasOwnProperty(s)){var d=a||s,u=r.mapping(e[s]);if(a&&n(e)&&(d=a+"["+s+"]"),a&&t(e)&&(d=t(u)||r.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),t(u)||n(u))c(u,r,o,d);else if(u instanceof FileList)for(var l=0;l<u.length;l++)o.append(d+"["+l+"]",u.item(l));else u instanceof Blob?o.append(d,u,u.name):u instanceof Date?o.append(d,u.toISOString()):(null===u&&r.includeNullValues||null!==u)&&void 0!==u&&o.append(d,u)}i++}return o}return i}))},f13c:function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=4,t=.001,n=1e-7,r=10,o=11,a=1/(o-1),i="function"===typeof Float32Array;function c(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function d(e){return 3*e}function u(e,t,n){return((c(t,n)*e+s(t,n))*e+d(t))*e}function l(e,t,n){return 3*c(t,n)*e*e+2*s(t,n)*e+d(t)}function f(e,t,o,a,i){var c,s,d=0;do{s=t+(o-t)/2,c=u(s,a,i)-e,c>0?o=s:t=s}while(Math.abs(c)>n&&++d<r);return s}function m(t,n,r,o){for(var a=0;a<e;++a){var i=l(n,r,o);if(0===i)return n;var c=u(n,r,o)-t;n-=c/i}return n}var v=function(e,n,r,c){if(!(0<=e&&e<=1&&0<=r&&r<=1))throw new Error("bezier x values must be in [0, 1] range");var s=i?new Float32Array(o):new Array(o);if(e!==n||r!==c)for(var d=0;d<o;++d)s[d]=u(d*a,e,r);function v(n){for(var i=0,c=1,d=o-1;c!==d&&s[c]<=n;++c)i+=a;--c;var u=(n-s[c])/(s[c+1]-s[c]),v=i+u*a,h=l(v,e,r);return h>=t?m(n,v,e,r):0===h?v:f(n,i,i+a,e,r)}return function(t){return e===n&&r===c?t:0===t?0:1===t?1:u(v(t),n,c)}},h={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},b=!1;try{var p=Object.defineProperty({},"passive",{get:function(){b=!0}});window.addEventListener("test",null,p)}catch(P){}var g={$:function(e){return"string"!==typeof e?e:document.querySelector(e)},on:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!1};t instanceof Array||(t=[t]);for(var o=0;o<t.length;o++)e.addEventListener(t[o],n,!!b&&r)},off:function(e,t,n){t instanceof Array||(t=[t]);for(var r=0;r<t.length;r++)e.removeEventListener(t[r],n)},cumulativeOffset:function(e){var t=0,n=0;do{t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:n}}},w="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],O={container:"body",duration:500,easing:"ease",offset:0,force:!0,cancelable:!0,onStart:!1,onDone:!1,onCancel:!1,x:!1,y:!0};function j(e){O=k({},O,e)}var S=function(){var e=void 0,t=void 0,n=void 0,r=void 0,o=void 0,a=void 0,i=void 0,c=void 0,s=void 0,d=void 0,u=void 0,l=void 0,f=void 0,m=void 0,b=void 0,p=void 0,k=void 0,j=void 0,S=void 0,_=void 0,I=function(e){i&&(_=e,S=!0)},T=void 0,D=void 0,$=void 0,A=void 0;function x(e){var t=e.scrollTop;return"body"===e.tagName.toLowerCase()&&(t=t||document.documentElement.scrollTop),t}function E(e){var t=e.scrollLeft;return"body"===e.tagName.toLowerCase()&&(t=t||document.documentElement.scrollLeft),t}function P(e){if(S)return C();D||(D=e),$=e-D,A=Math.min($/n,1),A=T(A),F(t,b+j*A,f+k*A),$<n?window.requestAnimationFrame(P):C()}function C(){S||F(t,p,m),D=!1,g.off(t,y,I),S&&d&&d(_,e),!S&&s&&s(e)}function F(e,t,n){l&&(e.scrollTop=t),u&&(e.scrollLeft=n),"body"===e.tagName.toLowerCase()&&(l&&(document.documentElement.scrollTop=t),u&&(document.documentElement.scrollLeft=n))}function L(D,$){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"===("undefined"===typeof $?"undefined":w($))?A=$:"number"===typeof $&&(A.duration=$),e=g.$(D),!e)return console.warn("[vue-scrollto warn]: Trying to scroll to an element that is not on the page: "+D);t=g.$(A.container||O.container),n=A.duration||O.duration,r=A.easing||O.easing,o=A.offset||O.offset,a=A.hasOwnProperty("force")?!1!==A.force:O.force,i=A.hasOwnProperty("cancelable")?!1!==A.cancelable:O.cancelable,c=A.onStart||O.onStart,s=A.onDone||O.onDone,d=A.onCancel||O.onCancel,u=void 0===A.x?O.x:A.x,l=void 0===A.y?O.y:A.y;var C=g.cumulativeOffset(t),F=g.cumulativeOffset(e);if("function"===typeof o&&(o=o()),b=x(t),p=F.top-C.top+o,f=E(t),m=F.left-C.left+o,S=!1,j=p-b,k=m-f,!a){var L=b,R=L+t.offsetHeight,N=p,V=N+e.offsetHeight;if(N>=L&&V<=R)return}return"string"===typeof r&&(r=h[r]||h["ease"]),T=v.apply(v,r),j||k?(c&&c(e),g.on(t,y,I,{passive:!0}),window.requestAnimationFrame(P),function(){_=null,S=!0}):void 0}return L},_=S(),I=[];function T(e){for(var t=0;t<I.length;++t)if(I[t].el===e)return I.splice(t,1),!0;return!1}function D(e){for(var t=0;t<I.length;++t)if(I[t].el===e)return I[t]}function $(e){var t=D(e);return t||(I.push(t={el:e,binding:{}}),t)}function A(e){e.preventDefault();var t=$(this).binding;if("string"===typeof t.value)return _(t.value);_(t.value.el||t.value.element,t.value)}var x={bind:function(e,t){$(e).binding=t,g.on(e,"click",A)},unbind:function(e){T(e),g.off(e,"click",A)},update:function(e,t){$(e).binding=t},scrollTo:_,bindings:I},E=function(e,t){t&&j(t),e.directive("scroll-to",x),e.prototype.$scrollTo=x.scrollTo};return"undefined"!==typeof window&&window.Vue&&(window.VueScrollTo=x,window.VueScrollTo.setDefaults=j,window.Vue.use(E)),x.install=E,x}))}}]);