You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
21 KiB
1 lines
21 KiB
!function(){function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{Yqpq:function(e,i,n){"use strict";n.r(i),n.d(i,"MaterialModule",function(){return ft});var o=n("PCNd"),c=n("tyNb"),l=n("mrSG"),s=n("wd/R"),u=n("fXoL"),d=n("S+vS"),m=n("bUwk"),f=n("Xi3o"),p=n("Olgc"),h=n("TmDA"),b=n("bTqV"),v=n("kmnG"),g=n("3Pt+"),_=n("d3UM"),y=n("FKr1"),w=n("ofXK"),C=n("0IaG"),O=n("bv9b"),S=n("sYmb"),T=["$crud"],U=["$catc"],k=["$qcc"],x=["$catf"],I=["$cate"],$=["$download"],L=["$qce"];function F(t,e){if(1&t&&u.Hc(0),2&t){var r=e.$implicit,i=u.fc();u.Ic(null==i.category.map[r.category]?null:i.category.map[r.category].data.name)}}function H(t,e){1&t&&(u.Hc(0),u.gc(1,"translate")),2&t&&u.Ic(u.hc(1,1,"routes.material.enum.qc."+e.$implicit.qualityControl))}function M(t,e){if(1&t){var r=u.Vb();u.Ub(0,"button",9),u.bc("click",function(){return u.wc(r),u.fc().export()}),u.Hc(1),u.gc(2,"uppercase"),u.gc(3,"translate"),u.Tb()}2&t&&(u.Cb(1),u.Ic(u.hc(2,1,u.hc(3,3,"routes.query.record.export"))))}function q(t,e){if(1&t&&(u.Ub(0,"mat-option",13),u.Hc(1),u.Tb()),2&t){var r=e.$implicit;u.Cc("padding-left",16*r.level+"px"),u.lc("value",r.data.id),u.Cb(1),u.Ic(r.data.name)}}function G(t,e){if(1&t&&(u.Ub(0,"mat-form-field",10),u.Ub(1,"mat-label"),u.Hc(2),u.gc(3,"translate"),u.Tb(),u.Ub(4,"mat-select",11),u.Pb(5,"mat-option"),u.Fc(6,q,2,4,"mat-option",12),u.Tb(),u.Tb()),2&t){var r=e.$implicit,i=u.fc();u.lc("formGroup",r),u.Cb(2),u.Ic(u.hc(3,3,"routes.material.cat")),u.Cb(4),u.lc("ngForOf",i.category.items)}}function P(t,e){if(1&t&&(u.Ub(0,"mat-option",13),u.Hc(1),u.Tb()),2&t){var r=e.$implicit;u.Cc("padding-left",16*r.level+"px"),u.lc("value",r.data.id),u.Cb(1),u.Ic(r.data.name)}}function j(t,e){if(1&t&&(u.Ub(0,"mat-form-field",10),u.Ub(1,"mat-label"),u.Hc(2),u.gc(3,"translate"),u.Tb(),u.Ub(4,"mat-select",11),u.Fc(5,P,2,4,"mat-option",12),u.Tb(),u.Tb()),2&t){var r=e.$implicit,i=u.fc();u.lc("formGroup",r),u.Cb(2),u.Ic(u.hc(3,3,"routes.material.cat")),u.Cb(3),u.lc("ngForOf",i.category.items)}}function E(t,e){1&t&&(u.Ub(0,"mat-form-field",10),u.Ub(1,"mat-label"),u.Hc(2),u.gc(3,"translate"),u.Tb(),u.Ub(4,"mat-select",14),u.Ub(5,"mat-option",13),u.Hc(6),u.gc(7,"translate"),u.Tb(),u.Ub(8,"mat-option",13),u.Hc(9),u.gc(10,"translate"),u.Tb(),u.Tb(),u.Tb()),2&t&&(u.lc("formGroup",e.$implicit),u.Cb(2),u.Ic(u.hc(3,6,"routes.material.qc")),u.Cb(3),u.lc("value",!0),u.Cb(1),u.Ic(u.hc(7,8,"routes.material.enum.qc.true")),u.Cb(2),u.lc("value",!1),u.Cb(1),u.Ic(u.hc(10,10,"routes.material.enum.qc.false")))}function N(t,e){1&t&&(u.Ub(0,"div",19),u.Ub(1,"button",20),u.Hc(2),u.gc(3,"uppercase"),u.gc(4,"translate"),u.Tb(),u.Tb()),2&t&&(u.Cb(2),u.Ic(u.hc(3,1,u.hc(4,3,"shared.dialog.ok"))))}function R(t,e){if(1&t&&(u.Ub(0,"h2",15),u.Hc(1),u.gc(2,"translate"),u.Tb(),u.Ub(3,"div",16),u.Pb(4,"mat-progress-bar",17),u.Ub(5,"p"),u.Hc(6),u.gc(7,"translate"),u.Tb(),u.Tb(),u.Fc(8,N,5,5,"div",18)),2&t){var r=u.fc();u.Cb(1),u.Ic(u.hc(2,6,"shared.dialog.title")),u.Cb(3),u.lc("mode",r.download.loaded||r.download.error?"determinate":"indeterminate")("color",r.download.error?"warn":"primary")("value",r.download.error?100:100*r.download.loaded/r.download.total),u.Cb(2),u.Ic(u.hc(7,8,r.download.error?"shared.notification.fail":"routes.query.record.exporting")),u.Cb(2),u.lc("ngIf",r.download.error)}}var A,V=((A=function(){function e(i,a,n,o){var c=this;r(this,e),this._dialogService=i,this._httpService=a,this._i18nService=n,this._toastService=o,this._dfs=function(e){var r,i=[];if(null==e?void 0:e.length)for(var a=t(e.reverse());a.length;){var n=a.pop();i.push(n),(null===(r=n.children)||void 0===r?void 0:r.length)&&a.push.apply(a,t(n.children.reverse()))}return i},this.error=function(t){var e,r,i,a;switch(t.status){case 409:return c._toastService.show(c._i18nService.translate("routes.material.main.error.conflict."+(null===(r=null===(e=t.error)||void 0===e?void 0:e.propertyName)||void 0===r?void 0:r.toLowerCase()))),!1;case 410:return c._toastService.show(c._i18nService.translate("routes.material.main.error.gone."+(null===(a=null===(i=t.error)||void 0===i?void 0:i.propertyName)||void 0===a?void 0:a.toLowerCase()))),!0;case 422:return c._toastService.show(c._i18nService.translate("shared.notification.fail")),!1;default:return!0}},this.export=function(){c._download={loaded:0,total:0,error:!1};var t=c._dialogService.show(c._downloadDialog);c._httpService.download("materials/excel?"+c._template.query,"WMS METERIALS "+s().format("YYYYMMDDHHmmss"),"GET",{onProgress:function(e){switch(e.type){case 3:c._download.loaded=e.loaded,c._download.total=e.total;break;case 4:t.close()}}}).catch(function(){return c._download.error=!0})}}return a(e,[{key:"ngAfterViewInit",value:function(){return Object(l.a)(this,void 0,void 0,regeneratorRuntime.mark(function t(){var e,r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._httpService.get("materials/categories");case 2:e=t.sent,this._category={map:{},items:[]},this._dfs(e.children).forEach(function(t){r._category.map[t.data.id]=t,r._category.items.push(t)}),this._defination=[{id:"code",header:"routes.material.code",editor:{field:"text",required:!0},filter:{field:"text"}},{id:"name",header:"routes.material.name",editor:{field:"text",required:!0},filter:{field:"text"}},{id:"category",header:"routes.material.cat",template:this._catColumn,editor:{field:"select",template:this._catEditor},filter:{field:"select",template:this._catFilter,convertor:function(t){return t?r._dfs([r._category.map[t]]).map(function(t){return"category=".concat(t.data.id,"&")}).join(""):""}}},{id:"unit",header:"routes.material.unit",editor:{field:"text"}}],this._api="materials";case 4:case"end":return t.stop()}},t,this)}))}},{key:"defination",get:function(){return this._defination}},{key:"api",get:function(){return this._api}},{key:"category",get:function(){return this._category}},{key:"download",get:function(){return this._download}}]),e}()).\u0275fac=function(t){return new(t||A)(u.Ob(d.a),u.Ob(m.a),u.Ob(f.a),u.Ob(p.a))},A.\u0275cmp=u.Ib({type:A,selectors:[["app-material-main"]],viewQuery:function(t,e){var r;1&t&&(u.Oc(T,!0),u.Oc(U,!0),u.Oc(k,!0),u.Oc(x,!0),u.Oc(I,!0),u.Oc($,!0),u.Oc(L,!0)),2&t&&(u.tc(r=u.cc())&&(e._template=r.first),u.tc(r=u.cc())&&(e._catColumn=r.first),u.tc(r=u.cc())&&(e._qcColumn=r.first),u.tc(r=u.cc())&&(e._catFilter=r.first),u.tc(r=u.cc())&&(e._catEditor=r.first),u.tc(r=u.cc())&&(e._downloadDialog=r.first),u.tc(r=u.cc())&&(e._qcEditor=r.first))},decls:16,vars:4,consts:[[3,"defination","api","error","toolbar-buttons-template"],["$crud",""],["$catc",""],["$qcc",""],["$export",""],["$catf",""],["$cate",""],["$qce",""],["$download",""],["mat-button","","color","primary",3,"click"],[3,"formGroup"],["formControlName","category"],[3,"value","paddingLeft",4,"ngFor","ngForOf"],[3,"value"],["formControlName","qualityControl"],["mat-dialog-title",""],["mat-dialog-content",""],[3,"mode","color","value"],["mat-dialog-actions","","align","end",4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary","mat-dialog-close",""]],template:function(t,e){if(1&t&&(u.Ub(0,"crud-template",0,1),u.Fc(2,F,1,1,"ng-template",null,2,u.Gc),u.Fc(4,H,2,3,"ng-template",null,3,u.Gc),u.Fc(6,M,4,5,"ng-template",null,4,u.Gc),u.Fc(8,G,7,5,"ng-template",null,5,u.Gc),u.Fc(10,j,6,5,"ng-template",null,6,u.Gc),u.Fc(12,E,11,12,"ng-template",null,7,u.Gc),u.Fc(14,R,9,10,"ng-template",null,8,u.Gc),u.Tb()),2&t){var r=u.uc(7);u.lc("defination",e.defination)("api",e.api)("error",e.error)("toolbar-buttons-template",r)}},directives:[h.a,b.a,v.b,g.o,g.g,v.e,_.a,g.n,g.f,y.o,w.m,C.h,C.e,O.a,w.n,C.c,C.d],pipes:[S.d,w.v],styles:[".indent[_ngcontent-%COMP%]{padding-left:16px}.tooltip-ul[_ngcontent-%COMP%]{margin-top:-8px;margin-bottom:0;padding-left:0;list-style-type:disc;list-style-position:inside}.tooltip-ul[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff}.mat-dialog-content[_ngcontent-%COMP%] .mat-progress-bar[_ngcontent-%COMP%] + p[_ngcontent-%COMP%]{margin-top:12px}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),A),D=["$name"],Y=["$parent"];function X(t,e){if(1&t&&(u.Ub(0,"span"),u.Hc(1),u.Tb()),2&t){var r=e.$implicit;u.Cc("margin-left",16*(r.level-1)+"px"),u.Cb(1),u.Ic(r.name)}}function K(t,e){if(1&t&&(u.Ub(0,"mat-option",7),u.Hc(1),u.Tb()),2&t){var r=e.$implicit,i=u.fc().data;u.Cc("padding-left",16*r.level+"px"),u.lc("value",r.id)("disabled",r.id==(null==i?null:i.id)),u.Cb(1),u.Ic(r.name)}}function Q(t,e){if(1&t&&(u.Ub(0,"mat-form-field",4),u.Ub(1,"mat-label"),u.Hc(2),u.gc(3,"translate"),u.Tb(),u.Ub(4,"mat-select",5),u.Pb(5,"mat-option"),u.Fc(6,K,2,5,"mat-option",6),u.Tb(),u.Tb()),2&t){var r=e.$implicit,i=u.fc();u.lc("formGroup",r),u.Cb(2),u.Ic(u.hc(3,3,"routes.material.category.parent")),u.Cb(4),u.lc("ngForOf",i.tree)}}var B,J=((B=function(){function e(i,a){var n=this;r(this,e),this._i18nService=i,this._toastService=a,this._dfs=function(e){var r,i=[];if(null==e?void 0:e.length)for(var a=t(e.reverse());a.length;){var n=a.pop();i.push(Object.assign({},n.data,{level:n.level})),(null===(r=n.children)||void 0===r?void 0:r.length)&&a.push.apply(a,t(n.children.reverse()))}return i},this.convertor=function(t){return{items:n._tree=n._dfs(t.children)}},this.error=function(t){var e,r,i,a;switch(t.status){case 409:return n._toastService.show(n._i18nService.translate("routes.material.category.error.conflict."+(null===(r=null===(e=t.error)||void 0===e?void 0:e.propertyName)||void 0===r?void 0:r.toLowerCase()))),!1;case 410:return n._toastService.show(n._i18nService.translate("routes.material.category.error.gone."+(null===(a=null===(i=t.error)||void 0===i?void 0:i.propertyName)||void 0===a?void 0:a.toLowerCase()))),!0;case 422:return n._toastService.show(n._i18nService.translate("shared.notification.fail")),!1;default:return!0}}}return a(e,[{key:"ngAfterViewInit",value:function(){var t=this;setTimeout(function(){t._defination=[{id:"parent",header:"routes.material.category.parent",editor:{field:"select",template:t._parentEditor,default:0},display:null},{id:"name",header:"routes.material.category.name",template:t._nameColumn,sortable:!1,editor:{field:"text",required:!0}},{id:"code",header:"routes.material.category.code",sortable:!1,editor:{field:"text"}}],t._api="materials/categories"})}},{key:"defination",get:function(){return this._defination}},{key:"api",get:function(){return this._api}},{key:"tree",get:function(){return this._tree}}]),e}()).\u0275fac=function(t){return new(t||B)(u.Ob(f.a),u.Ob(p.a))},B.\u0275cmp=u.Ib({type:B,selectors:[["app-material-category"]],viewQuery:function(t,e){var r;1&t&&(u.Oc(D,!0),u.Oc(Y,!0)),2&t&&(u.tc(r=u.cc())&&(e._nameColumn=r.first),u.tc(r=u.cc())&&(e._parentEditor=r.first))},decls:6,vars:6,consts:[[3,"fixed","pageable","defination","api","convertor","error"],["$crud",""],["$name",""],["$parent",""],[3,"formGroup"],["formControlName","parent"],[3,"value","paddingLeft","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"]],template:function(t,e){1&t&&(u.Ub(0,"crud-template",0,1),u.Fc(2,X,2,3,"ng-template",null,2,u.Gc),u.Fc(4,Q,7,5,"ng-template",null,3,u.Gc),u.Tb()),2&t&&u.lc("fixed",!0)("pageable",!1)("defination",e.defination)("api",e.api)("convertor",e.convertor)("error",e.error)},directives:[h.a,v.b,g.o,g.g,v.e,_.a,g.n,g.f,y.o,w.m],pipes:[S.d],styles:[""]}),B),z=n("hbEN"),W=n("qFsG");function Z(t,e){if(1&t&&(u.Ub(0,"mat-option",10),u.Hc(1),u.Tb()),2&t){var r=e.$implicit;u.lc("value",r),u.Cb(1),u.Kc("",r.name,"--",r.code,"")}}var tt,et=((tt=function(){function t(e,i,a,n,o,c){var s=this;r(this,t),this._data=e,this._formBuilder=i,this._httpService=a,this._i18nService=n,this._toastService=o,this._dialogRef=c,this._validators=function(t){var e,r;if(t.parent){var i=null===t.parent.controls.lowerLimit.value&&null===t.parent.controls.upperLimit.value||(null!==(e=t.parent.controls.lowerLimit.value)&&void 0!==e?e:0)>(null!==(r=t.parent.controls.upperLimit.value)&&void 0!==r?r:Number.MAX_VALUE)?{limit:!0}:null;return t.parent.controls.lowerLimit.setErrors(i),t.parent.controls.upperLimit.setErrors(i),i}},this._error=function(t){var e,r,i,a;switch(t.status){case 409:s._toastService.show(s._i18nService.translate("routes.material.safeties.error.conflict."+(null===(r=null===(e=t.error)||void 0===e?void 0:e.propertyName)||void 0===r?void 0:r.toLowerCase())));break;case 410:s._toastService.show(s._i18nService.translate("routes.material.safeties.error.gone."+(null===(a=null===(i=t.error)||void 0===i?void 0:i.propertyName)||void 0===a?void 0:a.toLowerCase()))),s._dialogRef.close({success:!1});break;case 422:s._toastService.show(s._i18nService.translate("shared.notification.fail"));break;default:s._dialogRef.close({success:!1})}},this.autocomplete=Object(z.a)(function(){var t=s._form.controls.code.value;(null==t?void 0:t.length)>=3?s._httpService.get("materials?code=".concat(t,"&limit=50")).then(function(t){s._materials=t.items}):s._materials&&(s._materials.length=0)},300),this.save=function(){return Object(l.a)(s,void 0,void 0,regeneratorRuntime.mark(function t(){var e,r,i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this._materials.find(function(t){return t.code==i._form.controls.code.value.code}))){t.next=19;break}if(r={material:e.id,lowerLimit:this._form.controls.lowerLimit.value,upperLimit:this._form.controls.upperLimit.value},t.t0=void 0,!this.id){t.next=10;break}return t.next=7,this._httpService.put("materials/safeties/"+this.id,r).catch(this._error);case 7:t.t1=t.sent,t.next=13;break;case 10:return t.next=12,this._httpService.post("materials/safeties",r).catch(this._error);case 12:t.t1=t.sent;case 13:if(t.t2=t.t1,t.t3=t.t0!==t.t2,!t.t3){t.next=17;break}this._toastService.show(this._i18nService.translate("shared.notification.success")),this._dialogRef.close({success:!0});case 17:t.next=20;break;case 19:this._toastService.show("\u7269\u6599\u4e0d\u5b58\u5728");case 20:case"end":return t.stop()}},t,this)}))},this.reGoods=function(){return Object(l.a)(s,void 0,void 0,regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this._materials=null,this._form.controls.code.setValue(null),this._httpService.get("materials?category="+this._form.controls.cat.value.id).then(function(t){e._materials=t.items});case 1:case"end":return t.stop()}},t,this)}))},this._httpService.join(this._httpService.get("materials")).then(function(t){s._materials=t[0].items.filter(function(t){return t.category<=3})}),this._form=this._formBuilder.group({cat:[null],code:[null,[g.u.required]],lowerLimit:[null,[this._validators]],upperLimit:[null,[this._validators]]}),e.item&&(this._httpService.get("materials/"+e.item.material).then(function(t){return s._materials=[t]}),this._form.controls.code.setValue(e.item.code),this._form.controls.lowerLimit.setValue(e.item.lowerLimit),this._form.controls.upperLimit.setValue(e.item.upperLimit))}return a(t,[{key:"ngOnInit",value:function(){}},{key:"form",get:function(){return this._form}},{key:"id",get:function(){var t;return null===(t=this._data.item)||void 0===t?void 0:t.id}},{key:"warehouse",get:function(){return this._data.warehouse}},{key:"materials",get:function(){return this._materials}},{key:"catList",get:function(){return this._catList}}]),t}()).\u0275fac=function(t){return new(t||tt)(u.Ob(C.a),u.Ob(g.d),u.Ob(m.a),u.Ob(f.a),u.Ob(p.a),u.Ob(C.g))},tt.\u0275cmp=u.Ib({type:tt,selectors:[["app-material-safety-edit"]],decls:30,vars:25,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["formControlName","code","required",""],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","number","min","0","formControlName","lowerLimit"],["matInput","","type","number","min","0","formControlName","upperLimit"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],[3,"value"]],template:function(t,e){1&t&&(u.Ub(0,"h2",0),u.Hc(1),u.gc(2,"translate"),u.Tb(),u.Ub(3,"div",1),u.Ub(4,"form",2),u.Ub(5,"mat-form-field"),u.Ub(6,"mat-label"),u.Hc(7),u.gc(8,"translate"),u.Tb(),u.Ub(9,"mat-select",3),u.Fc(10,Z,2,3,"mat-option",4),u.Tb(),u.Tb(),u.Ub(11,"mat-form-field"),u.Ub(12,"mat-label"),u.Hc(13),u.gc(14,"translate"),u.Tb(),u.Pb(15,"input",5),u.Tb(),u.Ub(16,"mat-form-field"),u.Ub(17,"mat-label"),u.Hc(18),u.gc(19,"translate"),u.Tb(),u.Pb(20,"input",6),u.Tb(),u.Tb(),u.Tb(),u.Ub(21,"div",7),u.Ub(22,"button",8),u.bc("click",function(){return e.save()}),u.Hc(23),u.gc(24,"uppercase"),u.gc(25,"translate"),u.Tb(),u.Ub(26,"button",9),u.Hc(27),u.gc(28,"uppercase"),u.gc(29,"translate"),u.Tb(),u.Tb()),2&t&&(u.Cb(1),u.Ic(u.hc(2,9,e.id?"shared.operation.edit":"shared.operation.add")),u.Cb(3),u.lc("formGroup",e.form),u.Cb(3),u.Ic(u.hc(8,11,"routes.material.code")),u.Cb(3),u.lc("ngForOf",e.materials),u.Cb(3),u.Ic(u.hc(14,13,"routes.material.safety.lower")),u.Cb(5),u.Ic(u.hc(19,15,"routes.material.safety.upper")),u.Cb(4),u.lc("disabled",e.form.invalid),u.Cb(1),u.Ic(u.hc(24,17,u.hc(25,19,"shared.dialog.ok"))),u.Cb(4),u.Ic(u.hc(28,21,u.hc(29,23,"shared.dialog.cancel"))))},directives:[C.h,C.e,g.v,g.o,g.g,v.b,v.e,_.a,g.n,g.f,g.t,w.m,W.b,g.r,g.c,C.c,b.a,C.d,y.o],pipes:[S.d,w.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-option[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-right:8px}.mat-option[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-left:8px}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),tt),rt=n("FFMq"),it=n("hZOD"),at=["$crud"],nt=["$wh"];function ot(t,e){1&t&&(u.Hc(0),u.gc(1,"join"),u.gc(2,"field")),2&t&&u.Ic(u.ic(1,1,u.ic(2,4,e.$implicit.warehouse,"name")," + "))}var ct,lt,st,ut=[{path:"",component:V},{path:"category",component:J},{path:"safety",component:(ct=function(){function e(t,i){var a=this;r(this,e),this._dialogService=t,this._httpService=i,this.convertor=function(t){return t.items.forEach(function(t){return t.warehouse=t.warehouse.split(",").map(function(t){return a._warehouse[t]})}),t}}return a(e,[{key:"ngAfterViewInit",value:function(){return Object(l.a)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,i=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._httpService.get("warehouses");case 2:r=e.sent,this._warehouse=r.items.reduce(function(t,e){return t[e.id]=e,t},{}),this._defination=[{id:"code",header:"routes.material.code",filter:{field:"text"}},{id:"name",header:"routes.material.name",filter:{field:"text"}},{id:"lowerLimit",header:"routes.material.safety.lower"},{id:"upperLimit",header:"routes.material.safety.upper"},{id:"unit",header:"routes.material.unit"},{id:"warehouse",header:"routes.material.safety.warehouse",template:this._warehouseColumn,filter:{field:"select",range:[{}].concat(t(r.items))}}],this._api="materials/safeties",this._template.edit=function(t){return Object(l.a)(i,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._dialogService.open(et,{autoFocus:!t,data:{item:t,warehouse:Object.values(this._warehouse)}});case 2:if(e.t0=e.sent,!e.t0){e.next=5;break}this._template.refresh();case 5:case"end":return e.stop()}},e,this)}))};case 4:case"end":return e.stop()}},e,this)}))}},{key:"defination",get:function(){return this._defination}},{key:"api",get:function(){return this._api}}]),e}(),ct.\u0275fac=function(t){return new(t||ct)(u.Ob(d.a),u.Ob(m.a))},ct.\u0275cmp=u.Ib({type:ct,selectors:[["app-material-safety"]],viewQuery:function(t,e){var r;1&t&&(u.Oc(at,!0),u.Oc(nt,!0)),2&t&&(u.tc(r=u.cc())&&(e._template=r.first),u.tc(r=u.cc())&&(e._warehouseColumn=r.first))},decls:4,vars:3,consts:[[3,"defination","api","convertor"],["$crud",""],["$wh",""]],template:function(t,e){1&t&&(u.Ub(0,"crud-template",0,1),u.Fc(2,ot,3,7,"ng-template",null,2,u.Gc),u.Tb()),2&t&&u.lc("defination",e.defination)("api",e.api)("convertor",e.convertor)},directives:[h.a],pipes:[rt.a,it.a],styles:[""]}),ct)}],dt=((lt=function t(){r(this,t)}).\u0275mod=u.Mb({type:lt}),lt.\u0275inj=u.Lb({factory:function(t){return new(t||lt)},imports:[[c.h.forChild(ut)],c.h]}),lt),mt=n("95ze"),ft=((st=function t(){r(this,t)}).\u0275mod=u.Mb({type:st}),st.\u0275inj=u.Lb({factory:function(t){return new(t||st)},imports:[[o.a,dt,mt.a]]}),st)}}])}();
|