mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:31:07 +03:30
1 line
18 KiB
JavaScript
Vendored
1 line
18 KiB
JavaScript
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"7ZrJ":function(t,e,r){(t.exports=r("JPst")(!1)).push([t.i,"\n.v-btn--floating {\r\n padding: 0 !important;\n}\n.theme--light.v-btn.v-btn--flat {\r\n color: rgba(0, 0, 0, .87) !important;\n}\n.v-btn--floating,\r\n.v-btn--icon:before {\r\n border-radius: 50% !important;\n}\r\n",""])},YASW:function(t,e,r){"use strict";r.r(e);var n=r("Y8XJ"),a=r("85lN"),o=r("L2JU");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function v(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),s=new M(n||[]);return a(i,"_invoke",{value:P(t,r,s)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=v;var h="suspendedStart",d="executing",m="completed",y={};function g(){}function _(){}function b(){}var w={};f(w,c,(function(){return this}));var x=Object.getPrototypeOf,C=x&&x(x(B([])));C&&C!==r&&n.call(C,c)&&(w=C);var k=b.prototype=g.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(a,o,s,c){var l=p(t[a],t,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function P(e,r,n){var a=h;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var c=j(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var l=p(e,r,n);if("normal"===l.type){if(a=n.done?m:"suspendedYield",l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=p(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function B(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(i(e)+" is not iterable")}return _.prototype=b,a(k,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:_,configurable:!0}),_.displayName=f(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},S(O.prototype),f(O.prototype,l,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new O(v(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(k),f(k,u,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=B,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:B(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function c(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){c(o,n,a,i,s,"next",t)}function s(t){c(o,n,a,i,s,"throw",t)}i(void 0)}))}}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===i(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p,h,d,m,y,g,_={data:function(){return{headers:[{sortable:!0,text:"Item ID",value:"id"},{sortable:!1,text:"Name",value:"name"},{sortable:!0,text:"Hospital",value:"Hospital"},{sortable:!1,text:"UDI",value:"udi"},{sortable:!1,text:"Size",value:"size"},{sortable:!1,text:"Action",value:"action",align:"left"}],filter:{name:"",size:"",item_id:"",medical_center_id:""},items:[],currentPage:1,lastPage:1,medicalCenters:[]}},created:function(){this.load()},methods:f(f({},Object(o.d)("modal",["changeCurrentModal"])),{},{load:(g=l(s().mark((function t(){var e,r,o,i,c=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o in e=c.length>0&&void 0!==c[0]?c[0]:1,r="?",this.filter)this.filter.hasOwnProperty(o)&&(r+="".concat(o,"=").concat(this.filter[o],"&"));return r+=e?"page=".concat(e):"page=1",t.next=6,n.a.get(a.a.listItem(r));case 6:(i=t.sent)&&200==i.status&&(this.items=i.data.data.data,this.currentPage=i.data.data.current_page,this.lastPage=i.data.data.last_page),this.loadMedicalCenters();case 9:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)}),generateBarcode:(y=l(s().mark((function t(e){var r,o,i,c=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:null,o=e.udi?e.udi:e.id,t.next=4,n.a.post(a.a.Barcode(o,r));case 4:(i=t.sent)&&200==i.status&&this.changeCurrentModal({modal:"modal-barcode-barcode",properties:{result:i,item:e}});case 6:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)}),show:(m=l(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.get(a.a.showItem(e));case 2:(r=t.sent)&&200==r.status&&this.changeCurrentModal({modal:"modal-item-show",properties:{result:r}});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)}),remove:(d=l(s().mark((function t(e){var r,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.delete(a.a.removeItem(e));case 2:if((r=t.sent)&&200==r.status)for(o in this.items)this.items.hasOwnProperty(o)&&this.items[o].id==e&&this.items.splice(o,1);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)}),changeStatus:(h=l(s().mark((function t(e){var r,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.post(a.a.changeItemStatus(e));case 2:if(r=t.sent)for(o in this.items)this.items.hasOwnProperty(o)&&this.items[o].id==e&&(this.items[o].status=r.data.data.status);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)}),loadMedicalCenters:(p=l(s().mark((function t(){var e;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.a.get(a.a.listFilterItemsTestResult);case 2:(e=t.sent)&&200==e.status&&(this.medicalCenters=e.data.data.MedicalCenters);case 4:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})}),watch:{currentPage:function(t){this.load(t)}}},b=(r("e8Wp"),r("KHd+")),w=Object(b.a)(_,(function(){var t=this,e=t._self._c;return e("div",{},[e("v-container",{attrs:{fluid:""}},[e("material-card",{attrs:{color:"black",title:"All Items",text:""}},[e("v-layout",{staticClass:"my-3 px-5",attrs:{"align-center":"",wrap:""}},[e("v-flex",{staticClass:"WM-FlexCenter",attrs:{xs12:"",md3:"",sm3:""}},[e("v-icon",{staticClass:"fas fa-sort-numeric-up mr-2 WM-Margin-B-8"}),t._v(" "),e("v-text-field",{staticClass:"py-3 pr-3",attrs:{label:"Item ID",color:"black"},model:{value:t.filter.item_id,callback:function(e){t.$set(t.filter,"item_id",e)},expression:"filter.item_id"}})],1),t._v(" "),e("v-flex",{staticClass:"WM-FlexCenter pl-3",attrs:{xs12:"",md3:"",sm3:""}},[e("v-icon",{staticClass:"fa fa-align-left mr-2 WM-Margin-B-8"}),t._v(" "),e("v-text-field",{staticClass:"py-3 pr-3",attrs:{label:"Name",color:"black"},model:{value:t.filter.name,callback:function(e){t.$set(t.filter,"name",e)},expression:"filter.name"}})],1),t._v(" "),t.$hasRole("Admin")?e("v-flex",{staticClass:"WM-FlexCenter pl-3",attrs:{xs12:"",md3:"",sm3:""}},[e("v-icon",{staticClass:"fa fa-hospital-o mr-2 WM-Margin-B-8"}),t._v(" "),e("v-autocomplete",{staticClass:"py-3 pr-3",attrs:{"item-text":"name","item-value":"id",label:"Hospital",color:"black",items:t.medicalCenters,clearable:!0},model:{value:t.filter.medical_center_id,callback:function(e){t.$set(t.filter,"medical_center_id",e)},expression:"filter.medical_center_id"}})],1):t._e(),t._v(" "),e("v-flex",{staticClass:"WM-FlexCenter pl-3",attrs:{xs12:"",md3:"",sm3:""}},[e("v-icon",{staticClass:"fas fa-sort-numeric-up mr-2 WM-Margin-B-8"}),t._v(" "),e("v-text-field",{staticClass:"py-3 pr-3",attrs:{label:"Size",color:"black"},model:{value:t.filter.size,callback:function(e){t.$set(t.filter,"size",e)},expression:"filter.size"}})],1),t._v(" "),e("v-flex",{attrs:{xs12:"",md2:"",sm3:""}},[e("v-btn",{staticClass:"WM-CyanBlueGradient-BG",staticStyle:{padding:"10px 60px"},on:{click:function(e){return t.load()}}},[e("v-icon",{staticClass:"white--text mr-2 caption"},[t._v("fas fa-search")]),t._v(" "),e("span",{staticClass:"white--text CSSD-font"},[t._v("Filter")])],1)],1),t._v(" "),e("v-spacer"),t._v(" "),e("v-flex",{staticClass:"text-xs-right",attrs:{xs12:"",md2:"",sm2:""}},[e("router-link",{attrs:{to:{name:"AddItem"}}},[e("v-btn",{staticClass:"WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"},[e("v-icon",{staticClass:"black--text mr-2 caption"},[t._v("fas fa-plus")]),t._v(" "),e("span",{staticClass:"black--text CSSD-font"},[t._v("Add")])],1)],1)],1)],1),t._v(" "),e("v-layout",{staticClass:"px-4 my-3"},[e("v-divider")],1),t._v(" "),e("v-layout",{staticClass:"my-3 px-5",attrs:{"align-center":"",wrap:""}},[e("v-flex",{attrs:{md12:""}},[e("v-data-table",{attrs:{headers:t.headers,items:t.items,"hide-actions":""},scopedSlots:t._u([{key:"headerCell",fn:function(r){var n=r.header;return[e("span",{staticClass:"subheading font-weight-light text-white text--darken-3",domProps:{textContent:t._s(n.text)}})]}},{key:"items",fn:function(r){var n=r.item;return[e("td",{staticClass:"title font-weight-light"},[t._v(t._s(n.id))]),t._v(" "),e("td",{staticClass:"title font-weight-light"},[t._v(t._s(n.name))]),t._v(" "),e("td",{staticClass:"title font-weight-light"},[t._v(t._s(n.user&&n.user.medical_center?n.user.medical_center.name:""))]),t._v(" "),e("td",{staticClass:"title font-weight-light"},[t._v(t._s(n.udi))]),t._v(" "),e("td",{staticClass:"title font-weight-light"},[t._v(t._s(n.size))]),t._v(" "),e("td",{staticClass:"text-xs-right FlexBtn Height-MD-60"},[t.$hasRole("Supervisor|Admin")?e("v-tooltip",{attrs:{bottom:"","open-on-hover":""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on,o=r.attrs;return[e("v-btn",t._g(t._b({staticClass:"mr-2",attrs:{color:n.status?"red":"green"},on:{click:function(e){return t.changeStatus(n.id)}}},"v-btn",o,!1),a),[e("v-icon",{staticClass:"white--text mr-1 caption"},[t._v("fas "+t._s(n.status?"fa-close":"fa-check"))]),t._v(" "),e("span",[t._v(t._s(n.status?"reject":"approve"))])],1)]}}],null,!0)},[t._v(" "),e("span",[t._v(t._s(n.status?"reject":"approve"))])]):t._e(),t._v(" "),e("v-tooltip",{attrs:{bottom:"","open-on-hover":""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on,o=r.attrs;return[e("v-btn",t._g(t._b({staticClass:"mr-2",attrs:{color:"cyan"},on:{click:function(e){return t.show(n.id)}}},"v-btn",o,!1),a),[e("v-icon",{staticClass:"white--text mr-1 caption"},[t._v("fas fa-eye")]),t._v(" "),e("span",[t._v("Show")])],1)]}}],null,!0)},[t._v(" "),e("span",[t._v("Show")])]),t._v(" "),e("v-tooltip",{attrs:{bottom:"","open-on-hover":""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on,o=r.attrs;return[t.$hasRole("Admin")||n.user_id==t.$store.state.user.id?e("router-link",{staticClass:"LinkBtn",attrs:{to:{name:"EditItem",params:{Item:n.id}}}},[e("v-btn",t._g(t._b({staticClass:"mr-2",attrs:{color:"orange"}},"v-btn",o,!1),a),[e("v-icon",{staticClass:"white--text mr-1 caption"},[t._v("fas fa-pen")]),t._v(" "),e("span",[t._v("Edit")])],1)],1):t._e()]}}],null,!0)},[t._v(" "),e("span",[t._v("Edit")])]),t._v(" "),e("v-tooltip",{attrs:{bottom:"","open-on-hover":""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on,o=r.attrs;return[t.$hasRole("Admin")||n.user_id==t.$store.state.user.id?e("v-btn",t._g(t._b({staticClass:"WM-ActionButton mr-2",attrs:{color:"pink"},on:{click:function(e){return t.remove(n.id)}}},"v-btn",o,!1),a),[e("v-icon",{staticClass:"white--text mr-2 caption"},[t._v("fas fa-trash")]),t._v(" "),e("span",[t._v("Remove")])],1):t._e()]}}],null,!0)},[t._v(" "),e("span",[t._v("Remove")])]),t._v(" "),e("v-tooltip",{attrs:{bottom:"","open-on-hover":""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on,o=r.attrs;return[e("v-btn",t._g(t._b({staticClass:"mr-2",attrs:{color:"orange darken-1"},on:{click:function(e){return t.generateBarcode(n,"Item")}}},"v-btn",o,!1),a),[e("v-icon",{staticClass:"white--text mr-2 caption"},[t._v("fas fa-barcode")]),t._v(" "),e("span",{staticClass:"CSSD-font"},[t._v("Generate Barcode")])],1)]}}],null,!0)},[t._v(" "),e("span",[t._v("Generate Barcode")])])],1)]}}])})],1)],1),t._v(" "),e("v-divider"),t._v(" "),t.lastPage>1?e("div",{staticClass:"text-xs-center"},[e("v-pagination",{attrs:{color:"black",length:t.lastPage,"total-visible":6},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):t._e(),t._v(" "),e("v-layout",{staticClass:"mt-3",attrs:{row:"",wrap:"","align-center":"","justify-center":""}},[e("router-link",{attrs:{to:"/dashboard"}},[e("v-btn",{staticClass:"WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5"},[e("v-icon",{staticClass:"black--text mr-2 caption"},[t._v("fas fa-chevron-left")]),t._v(" "),e("span",{staticClass:"black--text CSSD-font"},[t._v("Back")])],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null);e.default=w.exports},cXFo:function(t,e,r){var n=r("7ZrJ");"string"==typeof n&&(n=[[t.i,n,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};r("aET+")(n,a);n.locals&&(t.exports=n.locals)},e8Wp:function(t,e,r){"use strict";r("cXFo")}}]); |