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
160 KiB
1 lines
160 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{f6D1:function(t,e,a){"use strict";a.r(e),a.d(e,"StockModule",function(){return Si});var o=a("PCNd"),i=a("tyNb"),r=a("mrSG"),n=a("+0xr"),c=a("Dh3D"),l=a("3Pt+"),s=a("0IaG"),u=a("hbEN"),m=a("fXoL"),b=a("bUwk"),d=a("Xi3o"),p=a("Olgc"),h=a("kmnG"),f=a("qFsG"),g=a("/1cH"),v=a("ofXK"),_=a("iadO"),C=a("7OFo"),y=a("d3UM"),T=a("FKr1"),O=a("bTqV"),U=a("sYmb");function k(t,e){if(1&t&&(m.Ub(0,"mat-option",25),m.Ub(1,"span"),m.Hc(2),m.Tb(),m.Hc(3,"|"),m.Ub(4,"small"),m.Hc(5),m.Tb(),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.code),m.Cb(2),m.Ic(t.code),m.Cb(3),m.Ic(t.name)}}function S(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Pb(4,"input",26),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,1,"routes.material.remark")))}const I=function(){return[4,2,2]},w=function(t){return{delimiter:"-",blocks:t}};let q=(()=>{class t{constructor(t,e,a,o,i,n){this._data=t,this._formBuilder=e,this._httpService=a,this._i18nService=o,this._toastService=i,this._dialogRef=n,this.autocomplete=Object(u.a)(()=>{const t=this._form.controls.code.value;(null==t?void 0:t.length)>=3?this._httpService.get(`materials?code=${t}&limit=50`).then(t=>{this._material=t.items}):this._material&&(this._material.length=0)},300),this.save=()=>Object(r.a)(this,void 0,void 0,function*(){const t=this._material.find(t=>t.code==this._form.controls.code.value);t?(t.material=t.id,delete t.id,this._dialogRef.close(Object.assign(t,{code:this._form.controls.code.value,quantity:this._form.controls.quantity.value,batch:this._form.controls.batch.value,bill:this._form.controls.bill.value,supplier:this._form.controls.supplier.value,manufacturingDate:this._form.controls.manufacturingDate.value,qualityState:this._form.controls.qualityState.value||(t.qualityControl?"na":null),enabled:this._form.controls.enabled.value||null,remark:"false"==this._form.controls.enabled.value?this._form.controls.remark.value:null}))):this._toastService.show("\u7269\u6599\u4e0d\u5b58\u5728")}),this._form=this._formBuilder.group({code:[null==t?void 0:t.code,[l.u.required]],quantity:[null==t?void 0:t.quantity,[l.u.required,l.u.min(.001)]],batch:[null==t?void 0:t.batch],bill:[null==t?void 0:t.bill],supplier:[null==t?void 0:t.supplier],manufacturingDate:[null==t?void 0:t.manufacturingDate],qualityState:[null==t?void 0:t.qualityState],enabled:[null==t?void 0:t.enabled],remark:[null==t?void 0:t.remark]}),(null==t?void 0:t.code)&&this.autocomplete()}get data(){return this._data}get form(){return this._form}get material(){return this._material}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-inbound-edit"]],decls:79,vars:63,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["matInput","","formControlName","code","required","",3,"matAutocomplete","ngModelChange"],["$autocomplete","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["type","number","matInput","","formControlName","quantity","min","0","required",""],["matInput","","formControlName","batch"],["matInput","","formControlName","bill"],["matInput","","formControlName","supplier"],["matInput","","formControlName","manufacturingDate",3,"matDatepicker","cleave"],["matSuffix","",3,"for"],["$picker",""],["formControlName","qualityState"],["value","na"],["value","ok"],["value","ng"],["formControlName","enabled"],["$enabled",""],["value","true"],["value","false"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],[3,"value"],["matInput","","formControlName","remark"]],template:function(t,e){if(1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Ub(9,"input",3),m.bc("ngModelChange",function(){return e.autocomplete()}),m.Tb(),m.Ub(10,"mat-autocomplete",null,4),m.Fc(12,k,6,3,"mat-option",5),m.Tb(),m.Tb(),m.Ub(13,"mat-form-field"),m.Ub(14,"mat-label"),m.Hc(15),m.gc(16,"translate"),m.Tb(),m.Pb(17,"input",6),m.Tb(),m.Ub(18,"mat-form-field"),m.Ub(19,"mat-label"),m.Hc(20),m.gc(21,"translate"),m.Tb(),m.Pb(22,"input",7),m.Tb(),m.Ub(23,"mat-form-field"),m.Ub(24,"mat-label"),m.Hc(25),m.gc(26,"translate"),m.Tb(),m.Pb(27,"input",8),m.Tb(),m.Ub(28,"mat-form-field"),m.Ub(29,"mat-label"),m.Hc(30),m.gc(31,"translate"),m.Tb(),m.Pb(32,"input",9),m.Tb(),m.Ub(33,"mat-form-field"),m.Ub(34,"mat-label"),m.Hc(35),m.gc(36,"translate"),m.Tb(),m.Pb(37,"input",10),m.Pb(38,"mat-datepicker-toggle",11),m.Pb(39,"mat-datepicker",null,12),m.Tb(),m.Ub(41,"mat-form-field"),m.Ub(42,"mat-label"),m.Hc(43),m.gc(44,"translate"),m.Tb(),m.Ub(45,"mat-select",13),m.Pb(46,"mat-option"),m.Ub(47,"mat-option",14),m.Hc(48),m.gc(49,"translate"),m.Tb(),m.Ub(50,"mat-option",15),m.Hc(51),m.gc(52,"translate"),m.Tb(),m.Ub(53,"mat-option",16),m.Hc(54),m.gc(55,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Ub(56,"mat-form-field"),m.Ub(57,"mat-label"),m.Hc(58),m.gc(59,"translate"),m.Tb(),m.Ub(60,"mat-select",17,18),m.Pb(62,"mat-option"),m.Ub(63,"mat-option",19),m.Hc(64),m.gc(65,"translate"),m.Tb(),m.Ub(66,"mat-option",20),m.Hc(67),m.gc(68,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Fc(69,S,5,3,"mat-form-field",21),m.Tb(),m.Tb(),m.Ub(70,"div",22),m.Ub(71,"button",23),m.bc("click",function(){return e.save()}),m.Hc(72),m.gc(73,"uppercase"),m.gc(74,"translate"),m.Tb(),m.Ub(75,"button",24),m.Hc(76),m.gc(77,"uppercase"),m.gc(78,"translate"),m.Tb(),m.Tb()),2&t){const t=m.uc(11),a=m.uc(40),o=m.uc(61);m.Cb(1),m.Ic(m.hc(2,24,e.data?"shared.operation.edit":"shared.operation.add")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,26,"routes.material.code")),m.Cb(2),m.lc("matAutocomplete",t),m.Cb(3),m.lc("ngForOf",e.material),m.Cb(3),m.Ic(m.hc(16,28,"routes.material.qty")),m.Cb(5),m.Ic(m.hc(21,30,"routes.material.batch")),m.Cb(5),m.Ic(m.hc(26,32,"routes.material.bill")),m.Cb(5),m.Ic(m.hc(31,34,"routes.material.supplier")),m.Cb(5),m.Ic(m.hc(36,36,"routes.material.mfg")),m.Cb(2),m.lc("matDatepicker",a)("cleave",m.pc(61,w,m.oc(60,I))),m.Cb(1),m.lc("for",a),m.Cb(5),m.Ic(m.hc(44,38,"routes.material.qs")),m.Cb(5),m.Ic(m.hc(49,40,"routes.material.enum.qs.na")),m.Cb(3),m.Ic(m.hc(52,42,"routes.material.enum.qs.ok")),m.Cb(3),m.Ic(m.hc(55,44,"routes.material.enum.qs.ng")),m.Cb(4),m.Ic(m.hc(59,46,"routes.material.enabled")),m.Cb(6),m.Ic(m.hc(65,48,"routes.material.enum.enabled.true")),m.Cb(3),m.Ic(m.hc(68,50,"routes.material.enum.enabled.false")),m.Cb(2),m.lc("ngIf","false"==o.value),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(73,52,m.hc(74,54,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(77,56,m.hc(78,58,"shared.dialog.cancel")))}},directives:[s.h,s.e,l.v,l.o,l.g,h.b,h.e,f.b,l.c,g.c,l.n,l.f,l.t,g.a,v.m,l.r,_.g,C.a,_.j,h.f,_.f,y.a,T.o,v.n,s.c,O.a,s.d],pipes:[U.d,v.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}"]}),t})();var H=a("pHS2");function F(t,e){if(1&t&&(m.Ub(0,"mat-option",11),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function G(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",9),m.Fc(1,F,2,2,"mat-option",10),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}let $=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._toastService=a,this._dialogRef=o,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t,e;const a=this._form.controls.barcode.value;if(a){let e=yield this._httpService.get("stocks?barcode="+a);if(null==e?void 0:e.items[0]){const t=this._area.find(t=>t.name==e.items[0].warehouse);(null==t?void 0:t.area.find(t=>t.id==this._form.controls.area.value))?this._dialogRef.close({cell:null,barcode:a}):this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728\u4e8e\u53e6\u4e00\u4e2a\u5e93\u623f")}else e=yield this._httpService.get(`cells?area=${this._form.controls.area.value}&type=Cache`),this._dialogRef.close({cell:(null===(t=null==e?void 0:e.items[0])||void 0===t?void 0:t.id)||null,barcode:a})}else{const t=yield this._httpService.get(`cells?area=${this._form.controls.area.value}&type=Cache`),a=(null===(e=null==t?void 0:t.items[0])||void 0===e?void 0:e.id)||null;this._dialogRef.close({cell:a,barcode:a&&"#@"+a})}}),this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas")).then(t=>{const e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._form.controls.area.setValue(t[1].items[0].id)}),this._form=this._formBuilder.group({area:[null,[l.u.required]],barcode:null})}get form(){return this._form}get area(){return this._area}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(p.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-inbound-target"]],decls:25,vars:22,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["matInput","","formControlName","barcode"],["formControlName","area","required",""],[3,"label",4,"ngFor","ngForOf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Pb(9,"input",3),m.Tb(),m.Ub(10,"mat-form-field"),m.Ub(11,"mat-label"),m.Hc(12),m.gc(13,"translate"),m.Tb(),m.Ub(14,"mat-select",4),m.Fc(15,G,2,2,"mat-optgroup",5),m.Tb(),m.Tb(),m.Tb(),m.Tb(),m.Ub(16,"div",6),m.Ub(17,"button",7),m.bc("click",function(){return e.save()}),m.Hc(18),m.gc(19,"uppercase"),m.gc(20,"translate"),m.Tb(),m.Ub(21,"button",8),m.Hc(22),m.gc(23,"uppercase"),m.gc(24,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,8,"routes.stock.inbound.target")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,10,"routes.stock.inbound.barcode")),m.Cb(5),m.Ic(m.hc(13,12,"routes.stock.inbound.area")),m.Cb(3),m.lc("ngForOf",e.area),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(19,14,m.hc(20,16,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(23,18,m.hc(24,20,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,y.a,l.t,v.m,s.c,O.a,s.d,T.n,T.o],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),t})();var M=a("S+vS"),P=a("/t3+"),x=a("qUOr"),N=a("++hd"),j=a("NFeN"),V=a("f0Cb"),A=a("Qu3c"),B=a("hZOD");function E(t,e){1&t&&(m.Ub(0,"p"),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"ul",14),m.Ub(4,"li",15),m.Ub(5,"span"),m.Hc(6),m.gc(7,"translate"),m.Tb(),m.Tb(),m.Ub(8,"li",16),m.Ub(9,"span"),m.Hc(10),m.gc(11,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,3,"shared.operation.dyeing")),m.Cb(5),m.Ic(m.hc(7,5,"routes.material.enum.enabled.true")),m.Cb(4),m.Ic(m.hc(11,7,"routes.material.enum.enabled.false")))}function D(t,e){if(1&t&&(m.Ub(0,"th",22),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=m.fc(2).$implicit;m.Cb(1),m.Ic(m.hc(2,1,t.header))}}function R(t,e){if(1&t&&(m.Ub(0,"td",23),m.Hc(1),m.gc(2,"date"),m.Tb()),2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",m.ic(2,1,t.manufacturingDate,"yyyy-MM-dd")," ")}}function z(t,e){1&t&&(m.Sb(0),m.Fc(1,D,3,3,"th",20),m.Fc(2,R,3,4,"td",21),m.Rb())}function L(t,e){if(1&t&&(m.Ub(0,"th",22),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=m.fc(2).$implicit;m.Cb(1),m.Ic(m.hc(2,1,t.header))}}function J(t,e){if(1&t&&(m.Ub(0,"td",23),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",m.hc(2,1,"routes.material.enum.qs."+t.qualityState)," ")}}function Q(t,e){1&t&&(m.Sb(0),m.Fc(1,L,3,3,"th",20),m.Fc(2,J,3,3,"td",21),m.Rb())}function K(t,e){if(1&t&&(m.Ub(0,"th",22),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=m.fc(2).$implicit;m.Cb(1),m.Ic(m.hc(2,1,t.header))}}function W(t,e){if(1&t&&(m.Ub(0,"span"),m.Hc(1),m.Tb()),2&t){const t=m.fc().$implicit;m.Cb(1),m.Jc("\uff08",t.remark,"\uff09")}}function Z(t,e){if(1&t&&(m.Ub(0,"td",23),m.Hc(1),m.gc(2,"translate"),m.Fc(3,W,2,1,"span",24),m.Tb()),2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",m.hc(2,2,"routes.material.enum.enabled."+t.enabled)," "),m.Cb(2),m.lc("ngIf","false"==t.enabled&&t.remark)}}function X(t,e){1&t&&(m.Sb(0),m.Fc(1,K,3,3,"th",20),m.Fc(2,Z,4,4,"td",21),m.Rb())}function Y(t,e){1&t&&m.Pb(0,"th",26)}function tt(t,e){if(1&t){const t=m.Vb();m.Ub(0,"td",23),m.Ub(1,"button",27),m.bc("click",function(){m.wc(t);const a=e.$implicit;return m.fc(3).edit(a)}),m.gc(2,"translate"),m.Ub(3,"mat-icon"),m.Hc(4,"edit"),m.Tb(),m.Tb(),m.Ub(5,"button",27),m.bc("click",function(){m.wc(t);const a=e.$implicit;return m.fc(3).delete(a)}),m.gc(6,"translate"),m.Ub(7,"mat-icon"),m.Hc(8,"delete"),m.Tb(),m.Tb(),m.Tb()}2&t&&(m.Cb(1),m.mc("matTooltip",m.hc(2,2,"shared.operation.edit")),m.Cb(4),m.mc("matTooltip",m.hc(6,4,"shared.operation.delete")))}function et(t,e){1&t&&(m.Sb(0),m.Fc(1,Y,1,0,"th",25),m.Fc(2,tt,9,6,"td",21),m.Rb())}function at(t,e){if(1&t&&(m.Ub(0,"th",22),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=m.fc(2).$implicit;m.Cb(1),m.Ic(m.hc(2,1,t.header))}}function ot(t,e){if(1&t&&(m.Ub(0,"td",23),m.Hc(1),m.Tb()),2&t){const t=e.$implicit,a=m.fc(2).$implicit;m.Cb(1),m.Ic(t[a.id])}}function it(t,e){1&t&&(m.Sb(0),m.Fc(1,at,3,3,"th",20),m.Fc(2,ot,2,1,"td",21),m.Rb())}function rt(t,e){if(1&t&&(m.Sb(0,17),m.Fc(1,z,3,0,"ng-container",18),m.Fc(2,Q,3,0,"ng-container",18),m.Fc(3,X,3,0,"ng-container",18),m.Fc(4,et,3,0,"ng-container",18),m.Fc(5,it,3,0,"ng-container",19),m.Rb()),2&t){const t=e.$implicit;m.lc("matColumnDef",t.id)("ngSwitch",t.id)("stickyEnd","operation"==t.id),m.Cb(1),m.lc("ngSwitchCase","manufacturingDate"),m.Cb(1),m.lc("ngSwitchCase","qualityState"),m.Cb(1),m.lc("ngSwitchCase","enabled"),m.Cb(1),m.lc("ngSwitchCase","operation")}}function nt(t,e){1&t&&m.Pb(0,"tr",28)}const ct=function(t,e){return{"app-background-primary-lighter":t,"app-background-accent-lighter":e}};function lt(t,e){if(1&t&&m.Pb(0,"tr",29),2&t){const t=e.$implicit,a=m.fc();m.lc("ngClass",m.qc(1,ct,a.colorful&&"true"==t.enabled,a.colorful&&"false"==t.enabled))}}function st(t,e){if(1&t&&(m.Ub(0,"tr",30),m.Ub(1,"td",31),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(1),m.Db("colspan",t.columns.length),m.Cb(1),m.Ic(m.hc(3,2,"routes.stock.inbound.empty"))}}const ut=function(t){return{"app-foreground-primary":t}};let mt=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.edit=t=>Object(r.a)(this,void 0,void 0,function*(){const e=yield this._dialogService.open(q,{autoFocus:!t,data:t});if(e)if(t)for(const a in t)t[a]=e[a];else this._rows.data=[...this._rows.data,e]}),this.delete=t=>Object(r.a)(this,void 0,void 0,function*(){(yield this._dialogService.confirm(this._i18nService.translate("shared.notification.confirm")))&&(this._rows.data.splice(this._rows.data.indexOf(t),1),this._rows.data=[...this._rows.data])}),this.inbound=()=>Object(r.a)(this,void 0,void 0,function*(){let t=yield this._dialogService.open($);if(t){const e=t.barcode;this._loading=!0,t=yield this._httpService.post("stocks",{operation:"inbound",destination:t.cell,stock:{barcode:e,lines:this._rows.data}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==t&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this._rows.data=[]),this._loading=!1}}),this.reset=()=>Object(r.a)(this,void 0,void 0,function*(){(yield this._dialogService.confirm(this._i18nService.translate("shared.notification.confirm")))&&(this._rows.data=[])}),this._columns=[{id:"code",header:"routes.material.code"},{id:"name",header:"routes.material.name"},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty"},{id:"unit",header:"routes.material.unit"},{id:"batch",header:"routes.material.batch"},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"manufacturingDate",header:"routes.material.mfg"},{id:"qualityState",header:"routes.material.qs"},{id:"enabled",header:"routes.material.enabled"},{id:"operation"}],this._rows=new n.l([]),this._loading=!1,this._colorful=!1}ngAfterViewInit(){this._rows.sort=this._sort}get columns(){return this._columns}get rows(){return this._rows}get loading(){return this._loading}get colorful(){return this._colorful}set colorful(t){this._colorful=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-inbound"]],viewQuery:function(t,e){if(1&t&&m.Oc(c.a,!0),2&t){let t;m.tc(t=m.cc())&&(e._sort=t.first)}},decls:30,vars:32,consts:[[1,"grid"],[1,"row-auto"],[1,"app-background-card"],["mat-button","","color","primary",3,"disabled","loading","click"],[1,"spacer"],["mat-icon-button","",3,"matTooltipTemplate","ngClass","click"],["$tooltip",""],[1,"row-fill"],["mat-table","","matSort","",3,"dataSource"],[3,"matColumnDef","ngSwitch","stickyEnd",4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",3,"ngClass",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],["mat-fab","","color","primary",3,"matTooltip","click"],[1,"tooltip-ul"],[1,"app-foreground-primary"],[1,"app-foreground-accent"],[3,"matColumnDef","ngSwitch","stickyEnd"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[4,"ngIf"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-cell",""],["mat-icon-button","",3,"matTooltip","click"],["mat-header-row",""],["mat-row","",3,"ngClass"],[1,"mat-row"],[1,"mat-cell","no-data"]],template:function(t,e){if(1&t&&(m.Ub(0,"div",0),m.Ub(1,"div",1),m.Ub(2,"mat-toolbar",2),m.Ub(3,"button",3),m.bc("click",function(){return e.inbound()}),m.Hc(4),m.gc(5,"uppercase"),m.gc(6,"translate"),m.Tb(),m.Ub(7,"button",3),m.bc("click",function(){return e.reset()}),m.Hc(8),m.gc(9,"uppercase"),m.gc(10,"translate"),m.Tb(),m.Pb(11,"span",4),m.Ub(12,"button",5),m.bc("click",function(){return e.colorful=!e.colorful}),m.Ub(13,"mat-icon"),m.Hc(14,"brush"),m.Tb(),m.Fc(15,E,12,9,"ng-template",null,6,m.Gc),m.Tb(),m.Tb(),m.Pb(17,"mat-divider"),m.Tb(),m.Ub(18,"div",7),m.Ub(19,"table",8),m.Fc(20,rt,6,7,"ng-container",9),m.Fc(21,nt,1,0,"tr",10),m.gc(22,"field"),m.Fc(23,lt,1,4,"tr",11),m.gc(24,"field"),m.Fc(25,st,4,4,"tr",12),m.Tb(),m.Tb(),m.Tb(),m.Ub(26,"button",13),m.bc("click",function(){return e.edit()}),m.gc(27,"translate"),m.Ub(28,"mat-icon"),m.Hc(29,"add"),m.Tb(),m.Tb()),2&t){const t=m.uc(16);m.Cb(3),m.lc("disabled",0==e.rows.data.length)("loading",e.loading),m.Cb(1),m.Ic(m.hc(5,14,m.hc(6,16,"routes.stock.inbound.name"))),m.Cb(3),m.lc("disabled",0==e.rows.data.length)("loading",e.loading),m.Cb(1),m.Ic(m.hc(9,18,m.hc(10,20,"routes.stock.inbound.reset"))),m.Cb(4),m.lc("matTooltipTemplate",t)("ngClass",m.pc(30,ut,e.colorful)),m.Cb(7),m.lc("dataSource",e.rows),m.Cb(1),m.lc("ngForOf",e.columns),m.Cb(1),m.lc("matHeaderRowDef",m.ic(22,22,e.columns,"id"))("matHeaderRowDefSticky",!0),m.Cb(2),m.lc("matRowDefColumns",m.ic(24,25,e.columns,"id")),m.Cb(3),m.mc("matTooltip",m.hc(27,28,"routes.stock.inbound.add"))}},directives:[P.a,O.a,x.a,N.a,v.l,j.a,V.a,n.k,c.a,v.m,n.g,n.j,n.h,A.c,n.c,v.p,v.q,v.r,n.e,n.b,n.d,c.b,n.a,v.n,n.f,n.i],pipes:[v.v,U.d,B.a,v.e],styles:[".grid[_ngcontent-%COMP%]{display:flex;height:100%;flex-direction:column}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%]{flex:0 0 auto}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%] + .mat-divider[_ngcontent-%COMP%]{margin-top:-1px}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:first-child{margin-left:-8px}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-left:8px}.grid[_ngcontent-%COMP%] > .row-auto[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1 1 auto}.grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto}.grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%]{width:100%}.grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-right:56px;white-space:nowrap}.grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child, .grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child{padding-left:16px;padding-right:16px;width:80px}.grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] td.no-data[_ngcontent-%COMP%], .grid[_ngcontent-%COMP%] > .row-fill[_ngcontent-%COMP%] .mat-table[_ngcontent-%COMP%] th.no-data[_ngcontent-%COMP%]{position:absolute;width:100%;height:48px;padding:0;text-align:center;line-height:48px}.grid[_ngcontent-%COMP%] + .mat-fab[_ngcontent-%COMP%]{position:absolute;right:24px;bottom:24px;z-index:1}.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}"]}),t})();function bt(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Pb(4,"input",7),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,3,"routes.stock.outbound.quantity")),m.Cb(2),m.lc("min",0)("max",t.quantity)}}function dt(t,e){if(1&t&&(m.Ub(0,"mat-option",10),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function pt(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",8),m.Fc(5,dt,2,2,"mat-option",9),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function ht(t,e){if(1&t&&(m.Ub(0,"mat-option",10),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function ft(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",13),m.Fc(1,ht,2,2,"mat-option",9),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function gt(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",11),m.Fc(5,ft,2,2,"mat-optgroup",12),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.area")),m.Cb(3),m.lc("ngForOf",t.area)}}let vt=(()=>{class t{constructor(t,e,a,o){var i;this._data=t,this._formBuilder=e,this._httpService=a,this._dialogRef=o,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t,e=0;"1"==this._isagv?("3"==this._form.controls.targetNo.value.remark&&(e=1),"8"==this._form.controls.targetNo.value.remark&&(e=2)):e=this._form.controls.area.value.warehouse,this._dialogRef.close({quantity:null===(t=this._form.controls.quantity)||void 0===t?void 0:t.value,id:"1"==this._isagv?this._form.controls.targetNo.value.remark:this._form.controls.area.value.id,tag:{isAgv:this._form.controls.isagv.value,slTarget:"1"==this._isagv?this._form.controls.targetNo.value.code:"",postUser:""},warehouse:e})}),"outbound"==t.operation?this._form=this._formBuilder.group({quantity:[t.quantity,[l.u.required,l.u.min(.001)]]}):(this._form=this._formBuilder.group({area:[null],isagv:["0"],targetNo:[null]}),(null===(i=t.area)||void 0===i?void 0:i.length)&&this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=hiLineCode")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"CK"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._form.controls.area.setValue(t[1].items[0].id),this._items=t[2].items}))}ngOnInit(){this._isagv=this._form.controls.isagv.value}get form(){return this._form}get area(){return this._area}get operation(){return this._data.operation}get quantity(){return this._data.quantity}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-outbound-target"]],decls:17,vars:18,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],["matInput","","formControlName","quantity","type","number","required","",3,"min","max"],["formControlName","targetNo"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Fc(5,bt,5,5,"mat-form-field",3),m.Fc(6,pt,6,4,"mat-form-field",3),m.Fc(7,gt,6,4,"mat-form-field",3),m.Tb(),m.Tb(),m.Ub(8,"div",4),m.Ub(9,"button",5),m.bc("click",function(){return e.save()}),m.Hc(10),m.gc(11,"uppercase"),m.gc(12,"translate"),m.Tb(),m.Ub(13,"button",6),m.Hc(14),m.gc(15,"uppercase"),m.gc(16,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,8,"routes.stock.outbound.target")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(1),m.lc("ngIf","outbound"==e.operation),m.Cb(1),m.lc("ngIf","1"==e.isagv&&"outfeed"==e.operation),m.Cb(1),m.lc("ngIf","0"==e.isagv&&"outfeed"==e.operation),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(11,10,m.hc(12,12,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(15,14,m.hc(16,16,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,v.n,s.c,O.a,s.d,h.b,h.e,f.b,l.c,l.r,l.n,l.f,l.t,y.a,v.m,T.o,T.n],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})();var _t=a("TmDA");const Ct=["$crud"],yt=["$barcode"],Tt=["$qs"],Ot=["$qsSelect"],Ut=["$supplier"],kt=["$enabled"],St=["$time"],It=["$area"];function wt(t,e){if(1&t&&m.Hc(0),2&t){const t=e.$implicit;m.Ic(t.barcode.startsWith("#@")?"":t.barcode)}}function qt(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function Ht(t,e){if(1&t&&(m.Ub(0,"mat-option",13),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.code),m.Cb(1),m.Ic(t.name)}}function Ft(t,e){if(1&t&&(m.Ub(0,"mat-select",11),m.bc("ngModelChange",function(t){return e.$implicit.qualityState=t}),m.Fc(1,Ht,2,2,"mat-option",12),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("ngModel",t.qualityState)("disabled",!0),m.Cb(1),m.lc("ngForOf",a.qualityState)}}function Gt(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.enabled."+e.$implicit.enabled))}function $t(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.supplier."+e.$implicit.supplier))}function Mt(t,e){1&t&&(m.Hc(0),m.gc(1,"date")),2&t&&m.Ic(m.ic(1,1,e.$implicit[e.field.id],"yyyy-MM-dd HH:mm:ss"))}function Pt(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",16),m.bc("click",function(){m.wc(t);const e=m.fc().$implicit;return m.fc().outbound(e)}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"delete"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.outbound.name"))}function xt(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",16),m.bc("click",function(){m.wc(t);const e=m.fc().$implicit;return m.fc().outfeed(e)}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"get_app"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.outbound.task"))}function Nt(t,e){1&t&&(m.Sb(0,14),m.Fc(1,Pt,4,3,"button",15),m.Fc(2,xt,4,3,"button",15),m.Rb()),2&t&&(m.lc("ngSwitch",e.$implicit.available),m.Cb(1),m.lc("ngSwitchCase",!0),m.Cb(1),m.lc("ngSwitchCase",!1))}function jt(t,e){1&t&&(m.Ub(0,"p"),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"ul",19),m.Ub(4,"li",20),m.Ub(5,"span"),m.Hc(6),m.gc(7,"translate"),m.Tb(),m.Tb(),m.Ub(8,"li",21),m.Ub(9,"span"),m.Hc(10),m.gc(11,"translate"),m.Tb(),m.Tb(),m.Ub(12,"li",22),m.Ub(13,"span"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Tb(),m.Ub(16,"li",23),m.Ub(17,"span"),m.Hc(18),m.gc(19,"translate"),m.Tb(),m.Tb(),m.Ub(20,"li",24),m.Ub(21,"span"),m.Hc(22),m.gc(23,"translate"),m.Tb(),m.Tb(),m.Ub(24,"li",25),m.Ub(25,"span"),m.Hc(26),m.gc(27,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,7,"shared.operation.dyeing")),m.Cb(5),m.Ic(m.hc(7,9,"routes.material.enum.materialAge.ng")),m.Cb(4),m.Ic(m.hc(11,11,"routes.material.enum.materialAge.freeze")),m.Cb(4),m.Ic(m.hc(15,13,"routes.material.enum.materialAge.normal")),m.Cb(4),m.Ic(m.hc(19,15,"routes.material.enum.materialAge.over3")),m.Cb(4),m.Ic(m.hc(23,17,"routes.material.enum.materialAge.over5")),m.Cb(4),m.Ic(m.hc(27,19,"routes.material.enum.materialAge.over7")))}const Vt=function(t){return{"app-foreground-primary":t}};function At(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",17),m.bc("click",function(){m.wc(t);const e=m.fc();return e.colorful=!e.colorful}),m.Ub(1,"mat-icon"),m.Hc(2,"brush"),m.Tb(),m.Fc(3,jt,28,21,"ng-template",null,18,m.Gc),m.Tb()}if(2&t){const t=m.uc(4),e=m.fc();m.lc("matTooltipTemplate",t)("ngClass",m.pc(2,Vt,e.colorful))}}function Bt(t,e){if(1&t&&(m.Ub(0,"mat-option",13),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function Et(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",29),m.Fc(1,Bt,2,2,"mat-option",12),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function Dt(t,e){if(1&t&&(m.Ub(0,"mat-form-field",26),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",27),m.Fc(5,Et,2,2,"mat-optgroup",28),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.task.area")),m.Cb(3),m.lc("ngForOf",a.area)}}let Rt=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._toastService=a,this._i18nService=o,this._colorful=!0,this.convertor=t=>Object(r.a)(this,void 0,void 0,function*(){let e=yield this._httpService.get("tasks?"+this._template.filter.form.controls.area.value.map(t=>`area=${t}&`).join(""));return e=e.items.reduce((t,e)=>(t[e.barcode]=e,t),{}),t.items.forEach(t=>{null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0)),e[t.barcode]?(t.cell=`${e[t.barcode].original} -> ${e[t.barcode].destination}`,t.available=null):t.available="Cell"!=t.position}),t}),this.dyeing=t=>this.colorful?"ng"==t.qualityState?"app-background-ng-lighter":0==t.enabled?"app-background-freeze-lighter":t.materialAge>=7?"app-background-warn-lighter":t.materialAge>=3?"app-background-accent-lighter":"app-background-primary-lighter":null,this.outbound=t=>Object(r.a)(this,void 0,void 0,function*(){(yield this._dialogService.confirm("\u76f4\u63a5"+this._i18nService.translate("routes.stock.outbound.name")))&&(this._template.loading=!0,void 0!==(yield this._httpService.post("stocks",{operation:"outbound",stock:{barcode:t.barcode,lines:null}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}))&&(yield this._template.refresh(),this._toastService.show("\u64cd\u4f5c\u6210\u529f")),this._template.loading=!1)}),this.outfeed=t=>Object(r.a)(this,void 0,void 0,function*(){let e=yield this._dialogService.open(vt,{data:{operation:"outfeed",area:this._area.find(e=>e.name==t.warehouse).area}});(null==e?void 0:e.id)&&(this._template.loading=!0,e=yield this._httpService.post("tasks",{operation:"outfeed",task:{warehouse:e.warehouse,barcode:t.barcode,destination:parseInt(e.id),priority:0,manual:!1,tag:JSON.stringify(e.tag)}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(yield this._template.refresh(),this._toastService.show("\u64cd\u4f5c\u6210\u529f")),this._template.loading=!1)})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=qualityState"));let e=Object(H.a)(t[1].items.filter(t=>null!=t.remark),"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._qualityState=t[2].items,this._defination=[{id:"barcode",header:"routes.stock.outbound.barcode",template:this._barcodeColumn,filter:{order:6,field:"text"}},{id:"code",header:"routes.material.code",filter:{order:2,field:"text"}},{id:"name",header:"routes.material.name",filter:{order:3,field:"text"}},{id:"bill",header:"routes.material.bill",filter:{order:5,field:"text"}},{id:"batch",header:"routes.material.batch",display:null},{id:"warehouse",header:"routes.stock.outbound.warehouse"},{id:"area",header:"routes.stock.outbound.area",filter:{order:1,field:"multi-select",template:this._areaControl,default:e},display:null},{id:"cell",header:"routes.stock.outbound.cell",filter:{order:7,field:"text"}},{id:"qualityState",header:"routes.material.qs",template:this._qsSelectColumn,filter:{order:6,field:"select",range:this._qualityState}},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn,filter:{order:7,field:"select",range:[{id:"true",name:this._i18nService.translate("routes.material.enum.enabled.true")},{id:"false",name:this._i18nService.translate("routes.material.enum.enabled.false")}],default:"true"}},{id:"supplier",header:"routes.material.supplier",template:this._supplierColumn,filter:{order:6,field:"select",range:[{id:"ok",name:this._i18nService.translate("routes.material.enum.supplier.ok")},{id:"unupload",name:this._i18nService.translate("routes.material.enum.supplier.unupload")}]}},{id:"materialAge",header:"routes.material.materialAge"},{id:"materialAgeStatus",header:"routes.material.materialAge",display:null,filter:{order:6,field:"select",range:[{id:"over7",name:this._i18nService.translate("routes.material.enum.materialAge.over7")},{id:"over5",name:this._i18nService.translate("routes.material.enum.materialAge.over5")},{id:"over3",name:this._i18nService.translate("routes.material.enum.materialAge.over3")},{id:"normal",name:this._i18nService.translate("routes.material.enum.materialAge.normal")}]}},{id:"manufacturingDate",header:"routes.material.mfg",template:this._timeColumn},{id:"inboundTime",header:"routes.material.inboundTime",template:this._timeColumn},{id:"workorderNo",header:"routes.material.workorderNo",filter:{order:4,field:"text"}},{id:"transQty",header:"routes.material.qualifiedNum"},{id:"transUnit",header:"routes.material.mesUnit"}],this._api="stocks"})}get defination(){return this._defination}get api(){return this._api}get area(){return this._area}get qualityState(){return this._qualityState}get colorful(){return this._colorful}set colorful(t){this._colorful=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(p.a),m.Ob(d.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-outbound"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Ct,!0),m.Oc(yt,!0),m.Oc(Tt,!0),m.Oc(Ot,!0),m.Oc(Ut,!0),m.Oc(kt,!0),m.Oc(St,!0),m.Oc(It,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._barcodeColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._qsSelectColumn=t.first),m.tc(t=m.cc())&&(e._supplierColumn=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first),m.tc(t=m.cc())&&(e._timeColumn=t.first),m.tc(t=m.cc())&&(e._areaControl=t.first)}},decls:20,vars:10,consts:[[3,"selectable","addable","editable","deletable","row-class","defination","api","convertor","toolbar-icons-template","row-operation-template"],["$crud",""],["$barcode",""],["$qs",""],["$qsSelect",""],["$enabled",""],["$supplier",""],["$time",""],["$operation",""],["$dyeing",""],["$area",""],[2,"width","100px",3,"ngModel","disabled","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[3,"ngSwitch"],["mat-icon-button","",3,"matTooltip","click",4,"ngSwitchCase"],["mat-icon-button","",3,"matTooltip","click"],["mat-icon-button","",3,"matTooltipTemplate","ngClass","click"],["$tooltip",""],[1,"tooltip-ul"],[1,"app-foreground-ng"],[1,"app-foreground-freeze"],[1,"app-foreground-primary"],[1,"app-foreground-accent"],[1,"app-foreground-over5"],[1,"app-foreground-warn"],[3,"formGroup"],["formControlName","area","multiple",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,wt,1,1,"ng-template",null,2,m.Gc),m.Fc(4,qt,2,3,"ng-template",null,3,m.Gc),m.Fc(6,Ft,2,3,"ng-template",null,4,m.Gc),m.Fc(8,Gt,2,3,"ng-template",null,5,m.Gc),m.Fc(10,$t,2,3,"ng-template",null,6,m.Gc),m.Fc(12,Mt,2,4,"ng-template",null,7,m.Gc),m.Fc(14,Nt,3,3,"ng-template",null,8,m.Gc),m.Fc(16,At,5,4,"ng-template",null,9,m.Gc),m.Fc(18,Dt,6,5,"ng-template",null,10,m.Gc),m.Tb()),2&t){const t=m.uc(15),a=m.uc(17);m.lc("selectable",!1)("addable",!1)("editable",!1)("deletable",!1)("row-class",e.dyeing)("defination",e.defination)("api",e.api)("convertor",e.convertor)("toolbar-icons-template",a)("row-operation-template",t)}},directives:[_t.a,y.a,l.n,l.q,v.m,T.o,v.p,v.q,O.a,A.c,j.a,N.a,v.l,h.b,l.o,l.g,h.e,l.f,T.n],pipes:[U.d,v.e],styles:[".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}"]}),t})();var zt=a("R0Ic");function Lt(t,e){if(1&t&&(m.Ub(0,"mat-option",9),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}let Jt=(()=>{class t{constructor(t,e,a,o,i){this._data=t,this._formBuilder=e,this._httpService=a,this._toastService=o,this._dialogRef=i,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t;let e=yield this._httpService.get("stocks?barcode="+this._form.controls.barcode.value);(null==e?void 0:e.items.length)?e.items[0].warehouse==this._data.name?this._dialogRef.close({cell:null,barcode:this._form.controls.barcode.value}):this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728\u4e8e\u53e6\u4e00\u4e2a\u5e93\u623f"):(e=yield this._httpService.get(`cells?area=${this._form.controls.area.value}&type=Cache`),this._dialogRef.close({cell:(null===(t=null==e?void 0:e.items[0])||void 0===t?void 0:t.id)||null,barcode:this._form.controls.barcode.value}))}),this._form=this._formBuilder.group({area:[1==t.area.length?t.area[0].id:null,[l.u.required]],barcode:[null,[l.u.required]]})}get form(){return this._form}get area(){return this._data.area}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(p.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-palletize-target"]],decls:25,vars:22,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["matInput","","formControlName","barcode","required",""],["formControlName","area","required",""],[3,"value",4,"ngFor","ngForOf"],["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&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Pb(9,"input",3),m.Tb(),m.Ub(10,"mat-form-field"),m.Ub(11,"mat-label"),m.Hc(12),m.gc(13,"translate"),m.Tb(),m.Ub(14,"mat-select",4),m.Fc(15,Lt,2,2,"mat-option",5),m.Tb(),m.Tb(),m.Tb(),m.Tb(),m.Ub(16,"div",6),m.Ub(17,"button",7),m.bc("click",function(){return e.save()}),m.Hc(18),m.gc(19,"uppercase"),m.gc(20,"translate"),m.Tb(),m.Ub(21,"button",8),m.Hc(22),m.gc(23,"uppercase"),m.gc(24,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,8,"routes.stock.combine.target")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,10,"routes.stock.combine.barcode")),m.Cb(5),m.Ic(m.hc(13,12,"routes.stock.combine.area")),m.Cb(3),m.lc("ngForOf",e.area),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(19,14,m.hc(20,16,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(23,18,m.hc(24,20,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,y.a,v.m,s.c,O.a,s.d,T.o],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),t})();var Qt=a("1dzw"),Kt=a("bv9b");const Wt=["$crud"],Zt=["$qty"],Xt=["$qs"],Yt=["$enabled"],te=function(t){return{"app-foreground-primary":t}};function ee(t,e){if(1&t){const t=m.Vb();m.Ub(0,"a",9),m.bc("click",function(){m.wc(t);const a=e.$implicit;return m.fc().edit(a)}),m.Hc(1),m.Tb(),m.Hc(2)}if(2&t){const t=e.$implicit;m.lc("ngClass",m.pc(3,te,t.quantity)),m.Cb(1),m.Ic(t.quantity),m.Cb(1),m.Jc(" / ",t.total,"")}}function ae(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function oe(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.enabled."+e.$implicit.enabled))}function ie(t,e){if(1&t&&m.Pb(0,"mat-progress-bar",11),2&t){const t=m.fc().$implicit;m.lc("value",100*t.quantity/t.total)}}function re(t,e){1&t&&m.Fc(0,ie,1,1,"mat-progress-bar",10),2&t&&m.lc("ngIf",e.$implicit.quantity)}function ne(t,e){if(1&t){const t=m.Vb();m.Ub(0,"mat-icon",12),m.bc("click",function(){return m.wc(t),m.fc().search()}),m.Hc(1,"search"),m.Tb(),m.Ub(2,"input",13),m.bc("ngModelChange",function(e){return m.wc(t),m.fc().barcode=e})("focus",function(){return m.wc(t),m.fc().focus=!0})("blur",function(){return m.wc(t),m.fc().focus=!1})("keydown.enter",function(){return m.wc(t),m.fc().search()}),m.gc(3,"translate"),m.Tb()}if(2&t){const t=m.fc();m.Cb(2),m.mc("placeholder",m.hc(3,2,"routes.stock.combine.barcode")),m.lc("ngModel",t.barcode)}}function ce(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",14),m.bc("click",function(){return m.wc(t),m.fc().combine()}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"rotate_90_degrees_ccw"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.combine.name"))}let le=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.search=()=>{this._template.refresh()},this.convertor=t=>Object(r.a)(this,void 0,void 0,function*(){return t.items.forEach(t=>{t.total=t.quantity,t.quantity=0,null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0))}),t}),this.edit=t=>Object(r.a)(this,void 0,void 0,function*(){if(t.quantity){const e=yield this._dialogService.prompt(this._i18nService.translate("routes.stock.combine.quantity"),t.quantity,{type:"number",range:[0,t.total],required:!0});e&&(t.quantity=e)}}),this.combine=()=>Object(r.a)(this,void 0,void 0,function*(){let t=this._area.find(t=>t.name==this._template.selection.selected[0].warehouse);if(t){let e=yield this._dialogService.open(Jt,{data:t});e&&(this._template.loading=!0,e=yield this._httpService.post("stocks",{operation:"combine",destination:e.cell,stock:{barcode:e.barcode,lines:this._template.selection.selected}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this._template.refresh()),this._template.loading=!1)}})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){this._template.selection.changed.subscribe(t=>{t.added.forEach(t=>t.quantity=t.total),t.removed.forEach(t=>t.quantity=0)});const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._defination=[{id:"code",header:"routes.material.code"},{id:"name",header:"routes.material.name"},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty",template:this._qtyColumn},{id:"unit",header:"routes.material.unit"},{id:"batch",header:"routes.material.batch"},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"qualityState",header:"routes.material.qs",template:this._qsColumn},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn}],this._api="stocks"})}ngOnDestroy(){this._template.selection.changed.unsubscribe()}get defination(){return this._defination}get api(){return this._api}get barcode(){return this._barcode}get focus(){return this._focus}set barcode(t){this._barcode=t}set focus(t){this._focus=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-combine"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Wt,!0),m.Oc(Zt,!0),m.Oc(Xt,!0),m.Oc(Yt,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._qtyColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first)}},decls:15,vars:12,consts:[[3,"addable","editable","deletable","pageable","defination","api","query","convertor","row-expanding-template","toolbar-template","toolbar-selection-template"],["$crud",""],["$qty",""],["$qs",""],["$enabled",""],["$scale",""],["$barcode",""],["$save",""],[1,"mat-elevation-z2","searchbox-focus"],[1,"qty",3,"ngClass","click"],["class","progress-bar-underline","mode","determinate",3,"value",4,"ngIf"],["mode","determinate",1,"progress-bar-underline",3,"value"],[1,"searchbox-icon",3,"click"],["cdkFocusInitial","",1,"searchbox-text",3,"placeholder","ngModel","ngModelChange","focus","blur","keydown.enter"],["mat-icon-button","",3,"matTooltip","click"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,ee,3,5,"ng-template",null,2,m.Gc),m.Fc(4,ae,2,3,"ng-template",null,3,m.Gc),m.Fc(6,oe,2,3,"ng-template",null,4,m.Gc),m.Fc(8,re,1,1,"ng-template",null,5,m.Gc),m.Fc(10,ne,4,4,"ng-template",null,6,m.Gc),m.Fc(12,ce,4,3,"ng-template",null,7,m.Gc),m.Tb(),m.Pb(14,"mat-toolbar",8)),2&t){const t=m.uc(9),a=m.uc(11),o=m.uc(13);m.lc("addable",!1)("editable",!1)("deletable",!1)("pageable",!1)("defination",e.defination)("api",e.api)("query","pallet=false&barcode="+e.barcode)("convertor",e.convertor)("row-expanding-template",t)("toolbar-template",a)("toolbar-selection-template",o),m.Cb(14),m.lc("@focus",e.focus?"focus":"blur")}},directives:[_t.a,P.a,Qt.a,v.l,v.n,Kt.a,j.a,l.c,l.n,l.q,O.a,A.c],pipes:[U.d],styles:[".searchbox-icon[_ngcontent-%COMP%]{margin:0 8px;flex:0 0 auto;cursor:default}.searchbox-text[_ngcontent-%COMP%]{margin-left:12px;flex:1 1 auto;border:none;background-color:transparent;font-size:14px;color:inherit}.searchbox-focus[_ngcontent-%COMP%]{position:absolute;left:0;top:0;width:100%;z-index:1;background-color:transparent;pointer-events:none}.qty.app-foreground-primary[_ngcontent-%COMP%]{text-decoration:underline;cursor:pointer}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%]{position:absolute;left:0;right:0;z-index:2;margin-top:-1px;height:1px}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%] .mat-progress-bar-buffer, .progress-bar-underline[mode=determinate][_ngcontent-%COMP%] svg{display:none}"],data:{animation:[Object(zt.m)("focus",[Object(zt.j)("focus",Object(zt.k)({opacity:"1"})),Object(zt.j)("blur",Object(zt.k)({opacity:"0"})),Object(zt.l)("focus <=> blur",Object(zt.e)("200ms cubic-bezier(.4, 0, .2, 1)"))])]}}),t})();var se=a("BeL+");function ue(t,e){if(1&t&&(m.Ub(0,"mat-option",9),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}let me=(()=>{class t{constructor(t,e,a,o,i){this._data=t,this._formBuilder=e,this._httpService=a,this._toastService=o,this._dialogRef=i,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t;let e=yield this._httpService.get("stocks?barcode="+this._form.controls.barcode.value);(null==e?void 0:e.items[0])?e.items[0].warehouse==this._data.name?this._dialogRef.close({cell:null,barcode:this._form.controls.barcode.value}):this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728\u4e8e\u53e6\u4e00\u4e2a\u5e93\u623f"):(e=yield this._httpService.get(`cells?area=${this._form.controls.area.value}&type=Cache`),this._dialogRef.close({cell:(null===(t=null==e?void 0:e.items[0])||void 0===t?void 0:t.id)||null,barcode:this._form.controls.barcode.value}))}),this._form=this._formBuilder.group({area:[1==t.area.length?t.area[0].id:null,[l.u.required]],barcode:[null,[l.u.required]]})}get form(){return this._form}get area(){return this._data.area}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(p.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-palletize-target"]],decls:25,vars:22,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["matInput","","formControlName","barcode","required",""],["formControlName","area","required",""],[3,"value",4,"ngFor","ngForOf"],["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&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Pb(9,"input",3),m.Tb(),m.Ub(10,"mat-form-field"),m.Ub(11,"mat-label"),m.Hc(12),m.gc(13,"translate"),m.Tb(),m.Ub(14,"mat-select",4),m.Fc(15,ue,2,2,"mat-option",5),m.Tb(),m.Tb(),m.Tb(),m.Tb(),m.Ub(16,"div",6),m.Ub(17,"button",7),m.bc("click",function(){return e.save()}),m.Hc(18),m.gc(19,"uppercase"),m.gc(20,"translate"),m.Tb(),m.Ub(21,"button",8),m.Hc(22),m.gc(23,"uppercase"),m.gc(24,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,8,"routes.stock.palletize.target")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,10,"routes.stock.palletize.barcode")),m.Cb(5),m.Ic(m.hc(13,12,"routes.stock.palletize.area")),m.Cb(3),m.lc("ngForOf",e.area),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(19,14,m.hc(20,16,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(23,18,m.hc(24,20,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,y.a,v.m,s.c,O.a,s.d,T.o],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),t})();const be=["$crud"],de=["$qty"],pe=["$qs"],he=["$enabled"],fe=["$time"],ge=["$area"],ve=function(t){return{"app-foreground-primary":t}};function _e(t,e){if(1&t){const t=m.Vb();m.Ub(0,"a",9),m.bc("click",function(){m.wc(t);const a=e.$implicit;return m.fc().edit(a)}),m.Hc(1),m.Tb(),m.Hc(2)}if(2&t){const t=e.$implicit;m.lc("ngClass",m.pc(3,ve,t.quantity)),m.Cb(1),m.Ic(t.quantity),m.Cb(1),m.Jc(" / ",t.total,"")}}function Ce(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function ye(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.enabled."+e.$implicit.enabled))}function Te(t,e){1&t&&(m.Hc(0),m.gc(1,"date")),2&t&&m.Ic(m.ic(1,1,e.$implicit[e.field.id],"yyyy-MM-dd HH:mm:ss"))}function Oe(t,e){if(1&t&&m.Pb(0,"mat-progress-bar",11),2&t){const t=m.fc().$implicit;m.lc("value",100*t.quantity/t.total)}}function Ue(t,e){1&t&&m.Fc(0,Oe,1,1,"mat-progress-bar",10),2&t&&m.lc("ngIf",e.$implicit.quantity)}function ke(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",12),m.bc("click",function(){return m.wc(t),m.fc().palletize()}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"layers"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.palletize.name"))}function Se(t,e){if(1&t&&(m.Ub(0,"mat-option",18),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function Ie(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",16),m.Fc(1,Se,2,2,"mat-option",17),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function we(t,e){if(1&t&&(m.Ub(0,"mat-form-field",13),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",14),m.Fc(5,Ie,2,2,"mat-optgroup",15),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.task.area")),m.Cb(3),m.lc("ngForOf",a.area)}}let qe=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.convertor=t=>Object(r.a)(this,void 0,void 0,function*(){return t.items.forEach(t=>{t.total=t.quantity,t.quantity=0,null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0))}),t}),this.edit=t=>Object(r.a)(this,void 0,void 0,function*(){if(t.quantity){const e=yield this._dialogService.prompt(this._i18nService.translate("routes.stock.palletize.quantity"),t.quantity,{type:"number",range:[0,t.total],required:!0});e&&(t.quantity=e)}})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){this._template.selection.changed.subscribe(t=>{t.added.forEach(t=>t.quantity=t.total),t.removed.forEach(t=>t.quantity=0)});const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._defination=[{id:"code",header:"routes.material.code",filter:{order:2,field:"text"}},{id:"name",header:"routes.material.name",filter:{order:3,field:"text"}},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty",template:this._qtyColumn},{id:"unit",header:"routes.material.unit"},{id:"warehouse",header:"routes.stock.outbound.warehouse"},{id:"area",header:"routes.stock.outbound.area",filter:{order:1,field:"multi-select",template:this._areaControl,default:e},display:null},{id:"cell",header:"routes.stock.outbound.cell"},{id:"batch",header:"routes.material.batch",filter:{order:4,field:"text"}},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"qualityState",header:"routes.material.qs",template:this._qsColumn},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn},{id:"inboundTime",header:"routes.query.stock.create",template:this._timeColumn,filter:{order:5,field:"date-range"}},{id:"inventoryTime",header:"routes.query.stock.update",template:this._timeColumn,filter:{order:6,field:"date-range"}}],this._api="stocks"})}ngOnDestroy(){this._template.selection.changed.unsubscribe()}get defination(){return this._defination}get api(){return this._api}get area(){return this._area}palletize(){return Object(r.a)(this,void 0,void 0,function*(){const t=Object(se.a)(this._template.selection.selected.map(t=>t.warehouse));if(t.length>1)return void this._toastService.show("\u4e0d\u5141\u8bb8\u6279\u91cf\u64cd\u4f5c\u4e0d\u540c\u4ed3\u5e93\u7684\u9879\u76ee");let e=yield this._dialogService.open(me,{data:this.area.find(e=>e.name==t[0])});e&&(this._template.loading=!0,e=yield this._httpService.post("stocks",{operation:"combine",destination:e.cell,stock:{barcode:e.barcode,lines:this._template.selection.selected}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this._template.refresh()),this._template.loading=!1)})}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-palletize"]],viewQuery:function(t,e){if(1&t&&(m.Oc(be,!0),m.Oc(de,!0),m.Oc(pe,!0),m.Oc(he,!0),m.Oc(fe,!0),m.Oc(ge,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._qtyColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first),m.tc(t=m.cc())&&(e._timeColumn=t.first),m.tc(t=m.cc())&&(e._areaControl=t.first)}},decls:16,vars:9,consts:[[3,"addable","editable","deletable","defination","api","query","convertor","row-expanding-template","toolbar-selection-template"],["$crud",""],["$qty",""],["$qs",""],["$enabled",""],["$time",""],["$scale",""],["$save",""],["$area",""],[1,"qty",3,"ngClass","click"],["class","progress-bar-underline","mode","determinate",3,"value",4,"ngIf"],["mode","determinate",1,"progress-bar-underline",3,"value"],["mat-icon-button","",3,"matTooltip","click"],[3,"formGroup"],["formControlName","area","multiple",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,_e,3,5,"ng-template",null,2,m.Gc),m.Fc(4,Ce,2,3,"ng-template",null,3,m.Gc),m.Fc(6,ye,2,3,"ng-template",null,4,m.Gc),m.Fc(8,Te,2,4,"ng-template",null,5,m.Gc),m.Fc(10,Ue,1,1,"ng-template",null,6,m.Gc),m.Fc(12,ke,4,3,"ng-template",null,7,m.Gc),m.Fc(14,we,6,5,"ng-template",null,8,m.Gc),m.Tb()),2&t){const t=m.uc(11),a=m.uc(13);m.lc("addable",!1)("editable",!1)("deletable",!1)("defination",e.defination)("api",e.api)("query","pallet=false&palletized=false")("convertor",e.convertor)("row-expanding-template",t)("toolbar-selection-template",a)}},directives:[_t.a,v.l,v.n,Kt.a,O.a,A.c,j.a,h.b,l.o,l.g,h.e,y.a,l.n,l.f,v.m,T.n,T.o],pipes:[U.d,v.e],styles:[".qty.app-foreground-primary[_ngcontent-%COMP%]{text-decoration:underline;cursor:pointer}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%]{position:absolute;left:0;right:0;z-index:2;margin-top:-1px;height:1px}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%] .mat-progress-bar-buffer, .progress-bar-underline[mode=determinate][_ngcontent-%COMP%] svg{display:none}"]}),t})();var He=a("owWc");const Fe=["$crud"],Ge=["$qty"],$e=["$qs"],Me=["$enabled"],Pe=function(t){return{"app-foreground-primary":t}};function xe(t,e){if(1&t){const t=m.Vb();m.Ub(0,"a",9),m.bc("click",function(){m.wc(t);const a=e.$implicit;return m.fc().edit(a)}),m.Hc(1),m.Tb(),m.Hc(2)}if(2&t){const t=e.$implicit;m.lc("ngClass",m.pc(3,Pe,t.quantity)),m.Cb(1),m.Ic(t.quantity),m.Cb(1),m.Jc(" / ",t.total,"")}}function Ne(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function je(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.enabled."+e.$implicit.enabled))}function Ve(t,e){if(1&t&&m.Pb(0,"mat-progress-bar",11),2&t){const t=m.fc().$implicit;m.lc("value",100*t.quantity/t.total)}}function Ae(t,e){1&t&&m.Fc(0,Ve,1,1,"mat-progress-bar",10),2&t&&m.lc("ngIf",e.$implicit.quantity)}function Be(t,e){if(1&t){const t=m.Vb();m.Ub(0,"mat-icon",12),m.bc("click",function(){return m.wc(t),m.fc().search()}),m.Hc(1,"search"),m.Tb(),m.Ub(2,"input",13),m.bc("ngModelChange",function(e){return m.wc(t),m.fc().barcode=e})("focus",function(){return m.wc(t),m.fc().focus=!0})("blur",function(){return m.wc(t),m.fc().focus=!1})("keydown.enter",function(){return m.wc(t),m.fc().search()}),m.gc(3,"translate"),m.Tb()}if(2&t){const t=m.fc();m.Cb(2),m.mc("placeholder",m.hc(3,2,"routes.stock.depalletize.barcode")),m.lc("ngModel",t.barcode)}}function Ee(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",14),m.bc("click",function(){return m.wc(t),m.fc().depalletize()}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"layers_clear"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.depalletize.name"))}let De=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.search=()=>{this._template.refresh()},this.convertor=t=>Object(r.a)(this,void 0,void 0,function*(){return t.items.forEach(t=>{t.total=t.quantity,t.quantity=0,null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0))}),t}),this.edit=t=>Object(r.a)(this,void 0,void 0,function*(){if(t.quantity){const e=yield this._dialogService.prompt(this._i18nService.translate("routes.stock.depalletize.quantity"),t.quantity,{type:"number",range:[0,t.total],required:!0});e&&(t.quantity=e)}}),this.depalletize=()=>Object(r.a)(this,void 0,void 0,function*(){let t=this._area.find(t=>t.name==this._template.selection.selected[0].warehouse);if(t=yield this._dialogService.prompt(this._i18nService.translate("routes.stock.depalletize.target"),1==t.area.length?t.area[0].id.toString():null,{type:"select",range:Object(He.a)(t.area,(t,e)=>(t[e.id]=e.name,t),{}),required:!0}),t){this._template.loading=!0;let e=yield this._httpService.get(`cells?area=${t}&type=Cache`);(null==e?void 0:e.items.length)&&(e=yield this._httpService.post("stocks",{operation:"combine",destination:e.items[0].id,stock:{barcode:"#@"+e.items[0].id,lines:this._template.selection.selected}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this._template.refresh())),this._template.loading=!1}})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){this._template.selection.changed.subscribe(t=>{t.added.forEach(t=>t.quantity=t.total),t.removed.forEach(t=>t.quantity=0)});const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._defination=[{id:"code",header:"routes.material.code"},{id:"name",header:"routes.material.name"},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty",template:this._qtyColumn},{id:"unit",header:"routes.material.unit"},{id:"batch",header:"routes.material.batch"},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"qualityState",header:"routes.material.qs",template:this._qsColumn},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn}],this._api="stocks"})}ngOnDestroy(){this._template.selection.changed.unsubscribe()}get defination(){return this._defination}get api(){return this._api}get barcode(){return this._barcode}get focus(){return this._focus}set barcode(t){this._barcode=t}set focus(t){this._focus=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-depalletize"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Fe,!0),m.Oc(Ge,!0),m.Oc($e,!0),m.Oc(Me,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._qtyColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first)}},decls:15,vars:12,consts:[[3,"addable","editable","deletable","pageable","defination","api","query","convertor","row-expanding-template","toolbar-template","toolbar-selection-template"],["$crud",""],["$qty",""],["$qs",""],["$enabled",""],["$scale",""],["$barcode",""],["$save",""],[1,"mat-elevation-z2","searchbox-focus"],[1,"qty",3,"ngClass","click"],["class","progress-bar-underline","mode","determinate",3,"value",4,"ngIf"],["mode","determinate",1,"progress-bar-underline",3,"value"],[1,"searchbox-icon",3,"click"],["cdkFocusInitial","",1,"searchbox-text",3,"placeholder","ngModel","ngModelChange","focus","blur","keydown.enter"],["mat-icon-button","",3,"matTooltip","click"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,xe,3,5,"ng-template",null,2,m.Gc),m.Fc(4,Ne,2,3,"ng-template",null,3,m.Gc),m.Fc(6,je,2,3,"ng-template",null,4,m.Gc),m.Fc(8,Ae,1,1,"ng-template",null,5,m.Gc),m.Fc(10,Be,4,4,"ng-template",null,6,m.Gc),m.Fc(12,Ee,4,3,"ng-template",null,7,m.Gc),m.Tb(),m.Pb(14,"mat-toolbar",8)),2&t){const t=m.uc(9),a=m.uc(11),o=m.uc(13);m.lc("addable",!1)("editable",!1)("deletable",!1)("pageable",!1)("defination",e.defination)("api",e.api)("query","pallet=false&barcode="+e.barcode)("convertor",e.convertor)("row-expanding-template",t)("toolbar-template",a)("toolbar-selection-template",o),m.Cb(14),m.lc("@focus",e.focus?"focus":"blur")}},directives:[_t.a,P.a,Qt.a,v.l,v.n,Kt.a,j.a,l.c,l.n,l.q,O.a,A.c],pipes:[U.d],styles:[".searchbox-icon[_ngcontent-%COMP%]{margin:0 8px;flex:0 0 auto;cursor:default}.searchbox-text[_ngcontent-%COMP%]{margin-left:12px;flex:1 1 auto;border:none;background-color:transparent;font-size:14px;color:inherit}.searchbox-focus[_ngcontent-%COMP%]{position:absolute;left:0;top:0;width:100%;z-index:1;background-color:transparent;pointer-events:none}.qty.app-foreground-primary[_ngcontent-%COMP%]{text-decoration:underline;cursor:pointer}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%]{position:absolute;left:0;right:0;z-index:2;margin-top:-1px;height:1px}.progress-bar-underline[mode=determinate][_ngcontent-%COMP%] .mat-progress-bar-buffer, .progress-bar-underline[mode=determinate][_ngcontent-%COMP%] svg{display:none}"],data:{animation:[Object(zt.m)("focus",[Object(zt.j)("focus",Object(zt.k)({opacity:"1"})),Object(zt.j)("blur",Object(zt.k)({opacity:"0"})),Object(zt.l)("focus <=> blur",Object(zt.e)("200ms cubic-bezier(.4, 0, .2, 1)"))])]}}),t})();var Re,ze=a("+EKe"),Le=a("LV2V"),Je=a("YHEm"),Qe=a("5WsY"),Ke=a("cSlR"),We=a("IzLi"),Ze=a("mkut"),Xe=(Re=function(t,e,a,o){Object(ze.a)(e,Object(Ze.a)(e),t,o)},Object(Le.a)(function(t,e){var a=-1,o=e.length,i=o>1?e[o-1]:void 0,r=o>2?e[2]:void 0;for(i=Re.length>3&&"function"==typeof i?(o--,i):void 0,r&&function(t,e,a){if(!Object(We.a)(a))return!1;var o=typeof e;return!!("number"==o?Object(Qe.a)(a)&&Object(Ke.a)(e,a.length):"string"==o&&e in a)&&Object(Je.a)(a[e],t)}(e[0],e[1],r)&&(i=o<3?void 0:i,o=1),t=Object(t);++a<o;){var n=e[a];n&&Re(t,n,0,i)}return t})),Ye=a("weu1"),ta=a("zmn3");function ea(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Pb(4,"input",7),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,3,"routes.stock.inventory.quantity")),m.Cb(2),m.lc("min",0)("max",t.quantity)}}function aa(t,e){if(1&t&&(m.Ub(0,"mat-option",12),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function oa(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",10),m.Fc(1,aa,2,2,"mat-option",11),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.cell)}}function ia(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",8),m.Fc(5,oa,2,2,"mat-optgroup",9),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.inventory.station")),m.Cb(3),m.lc("ngForOf",t.station)}}let ra=(()=>{class t{constructor(t,e,a,o){var i;this._data=t,this._formBuilder=e,this._httpService=a,this._dialogRef=o,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t,e;this._dialogRef.close({quantity:null===(t=this._form.controls.quantity)||void 0===t?void 0:t.value,station:null===(e=this._form.controls.station)||void 0===e?void 0:e.value})}),"inventory"==t.operation?this._form=this._formBuilder.group({quantity:[t.quantity,[l.u.required,l.u.min(.001)]]}):(this._form=this._formBuilder.group({station:[null,[l.u.required]]}),(null===(i=t.area)||void 0===i?void 0:i.length)&&this._httpService.get(`cells?${Object(Ye.a)(Object(ta.a)(t.area,t=>`area=${t.id}&`),"")}type=Station&out=true`).then(e=>{const a=Object(H.a)(e.items,"area");this._station=t.area.filter(t=>!!a[t.id]&&(a[t.id].forEach(e=>e.warehouse=t.warehouse),t.cell=a[t.id],!0)),1==this._station.length&&1==e.items.length&&this._form.controls.station.setValue(e.items[0])}))}get form(){return this._form}get station(){return this._station}get operation(){return this._data.operation}get quantity(){return this._data.quantity}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-inventory-target"]],decls:16,vars:17,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],["matInput","","formControlName","quantity","type","number","required","",3,"min","max"],["formControlName","station","required",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Fc(5,ea,5,5,"mat-form-field",3),m.Fc(6,ia,6,4,"mat-form-field",3),m.Tb(),m.Tb(),m.Ub(7,"div",4),m.Ub(8,"button",5),m.bc("click",function(){return e.save()}),m.Hc(9),m.gc(10,"uppercase"),m.gc(11,"translate"),m.Tb(),m.Ub(12,"button",6),m.Hc(13),m.gc(14,"uppercase"),m.gc(15,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,7,"routes.stock.inventory.target")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(1),m.lc("ngIf","inventory"==e.operation),m.Cb(1),m.lc("ngIf","outfeed"==e.operation),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(10,9,m.hc(11,11,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(14,13,m.hc(15,15,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,v.n,s.c,O.a,s.d,h.b,h.e,f.b,l.c,l.r,l.n,l.f,l.t,y.a,v.m,T.n,T.o],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),t})();const na=["$crud"],ca=["$barcode"],la=["$qs"],sa=["$enabled"],ua=["$area"];function ma(t,e){if(1&t&&m.Hc(0),2&t){const t=e.$implicit;m.Ic(t.barcode.startsWith("#@")?"":t.barcode)}}function ba(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function da(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.enabled."+e.$implicit.enabled))}function pa(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",10),m.bc("click",function(){m.wc(t);const e=m.fc().$implicit;return m.fc().inventory(e)}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"iso"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.inventory.name"))}function ha(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",10),m.bc("click",function(){m.wc(t);const e=m.fc().$implicit;return m.fc().outfeed(e)}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"get_app"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.inventory.task"))}function fa(t,e){1&t&&(m.Sb(0,8),m.Fc(1,pa,4,3,"button",9),m.Fc(2,ha,4,3,"button",9),m.Rb()),2&t&&(m.lc("ngSwitch",e.$implicit.available),m.Cb(1),m.lc("ngSwitchCase",!0),m.Cb(1),m.lc("ngSwitchCase",!1))}function ga(t,e){1&t&&(m.Ub(0,"p"),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"ul",13),m.Ub(4,"li",14),m.Ub(5,"span"),m.Hc(6),m.gc(7,"translate"),m.Tb(),m.Tb(),m.Ub(8,"li",15),m.Ub(9,"span"),m.Hc(10),m.gc(11,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,3,"shared.operation.dyeing")),m.Cb(5),m.Ic(m.hc(7,5,"routes.stock.inventory.available")),m.Cb(4),m.Ic(m.hc(11,7,"routes.stock.inventory.unavailable")))}const va=function(t){return{"app-foreground-primary":t}};function _a(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",11),m.bc("click",function(){m.wc(t);const e=m.fc();return e.colorful=!e.colorful}),m.Ub(1,"mat-icon"),m.Hc(2,"brush"),m.Tb(),m.Fc(3,ga,12,9,"ng-template",null,12,m.Gc),m.Tb()}if(2&t){const t=m.uc(4),e=m.fc();m.lc("matTooltipTemplate",t)("ngClass",m.pc(2,va,e.colorful))}}function Ca(t,e){if(1&t&&(m.Ub(0,"mat-option",21),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function ya(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",19),m.Fc(1,Ca,2,2,"mat-option",20),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function Ta(t,e){if(1&t&&(m.Ub(0,"mat-form-field",16),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",17),m.Fc(5,ya,2,2,"mat-optgroup",18),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.task.area")),m.Cb(3),m.lc("ngForOf",a.area)}}let Oa=(()=>{class t{constructor(t,e,a){this._dialogService=t,this._httpService=e,this._toastService=a,this.convertor=t=>Object(r.a)(this,void 0,void 0,function*(){return{total:t.total,items:(e=yield this._httpService.get("tasks?"+this._template.filter.form.controls.area.value.map(t=>`area=${t}&`).join("")),e=e.items.reduce((t,e)=>(t[e.barcode]=e,t),{}),t.items.map(t=>(null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0)),e[t.barcode]?(t.cell=`${e[t.barcode].original} -> ${e[t.barcode].destination}`,t.available=null):t.available="Cell"!=t.position,t)))};var e}),this.dyeing=t=>{if(this._colorful)switch(t.available){case!0:return"app-background-primary-lighter";case!1:return"app-background-accent-lighter"}return null},this.inventory=t=>Object(r.a)(this,void 0,void 0,function*(){let e=yield this._dialogService.open(ra,{data:{operation:"inventory",quantity:t.quantity}});(null==e?void 0:e.quantity)&&(this._template.loading=!0,e=yield this._httpService.post("stocks",{operation:"inventory",stock:{barcode:t.barcode,lines:[Xe({},t,{quantity:e.quantity})]}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(yield this._template.refresh(),this._toastService.show("\u64cd\u4f5c\u6210\u529f")),this._template.loading=!1)}),this.outfeed=t=>Object(r.a)(this,void 0,void 0,function*(){let e=yield this._dialogService.open(ra,{data:{operation:"outfeed",area:this.area.find(e=>e.name==t.warehouse).area}});(null==e?void 0:e.station)&&(this._template.loading=!0,e=yield this._httpService.post("tasks",{operation:"outfeed",task:{warehouse:e.station.warehouse,barcode:t.barcode,destination:e.station.id,priority:0,manual:!1}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(yield this._template.refresh(),this._toastService.show("\u64cd\u4f5c\u6210\u529f")),this._template.loading=!1)})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._defination=[{id:"code",header:"routes.material.code",filter:{order:2,field:"text"}},{id:"name",header:"routes.material.name",filter:{order:3,field:"text"}},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty"},{id:"unit",header:"routes.material.unit"},{id:"barcode",header:"routes.stock.inventory.barcode",template:this._barcodeColumn,filter:{order:5,field:"text"}},{id:"warehouse",header:"routes.stock.inventory.warehouse"},{id:"area",header:"routes.stock.inventory.area",filter:{order:1,field:"multi-select",template:this._areaControl,default:e},display:null},{id:"cell",header:"routes.stock.inventory.cell",filter:{order:6,field:"text"}},{id:"batch",header:"routes.material.batch",filter:{order:4,field:"text"}},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"qualityState",header:"routes.material.qs",template:this._qsColumn},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn}],this._api="stocks"})}get defination(){return this._defination}get api(){return this._api}get area(){return this._area}get colorful(){return this._colorful}set colorful(t){this._colorful=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-inventory"]],viewQuery:function(t,e){if(1&t&&(m.Oc(na,!0),m.Oc(ca,!0),m.Oc(la,!0),m.Oc(sa,!0),m.Oc(ua,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._barcodeColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first),m.tc(t=m.cc())&&(e._areaControl=t.first)}},decls:14,vars:11,consts:[[3,"selectable","addable","editable","deletable","row-class","defination","api","query","convertor","toolbar-icons-template","row-operation-template"],["$crud",""],["$barcode",""],["$qs",""],["$enabled",""],["$operation",""],["$dyeing",""],["$area",""],[3,"ngSwitch"],["mat-icon-button","",3,"matTooltip","click",4,"ngSwitchCase"],["mat-icon-button","",3,"matTooltip","click"],["mat-icon-button","",3,"matTooltipTemplate","ngClass","click"],["$tooltip",""],[1,"tooltip-ul"],[1,"app-foreground-primary"],[1,"app-foreground-accent"],[3,"formGroup"],["formControlName","area","multiple",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,ma,1,1,"ng-template",null,2,m.Gc),m.Fc(4,ba,2,3,"ng-template",null,3,m.Gc),m.Fc(6,da,2,3,"ng-template",null,4,m.Gc),m.Fc(8,fa,3,3,"ng-template",null,5,m.Gc),m.Fc(10,_a,5,4,"ng-template",null,6,m.Gc),m.Fc(12,Ta,6,5,"ng-template",null,7,m.Gc),m.Tb()),2&t){const t=m.uc(9),a=m.uc(11);m.lc("selectable",!1)("addable",!1)("editable",!1)("deletable",!1)("row-class",e.dyeing)("defination",e.defination)("api",e.api)("query","pallet=false")("convertor",e.convertor)("toolbar-icons-template",a)("row-operation-template",t)}},directives:[_t.a,v.p,v.q,O.a,A.c,j.a,N.a,v.l,h.b,l.o,l.g,h.e,y.a,l.n,l.f,v.m,T.n,T.o],pipes:[U.d],styles:[".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}"]}),t})(),Ua=(()=>{class t{constructor(t,e){this._formBuilder=t,this._dialogRef=e,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){let t=this._form.controls.value.value;"auto"==t&&(t=null),this._dialogRef.close({value:t,remark:this._form.controls.remark.value})}),this._form=this._formBuilder.group({value:[null,[l.u.required]],remark:null})}get form(){return this._form}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-block-edit"]],decls:33,vars:32,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],["formControlName","value","required",""],["value","auto"],[3,"value"],["matInput","","formControlName","remark"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Ub(9,"mat-select",3),m.Ub(10,"mat-option",4),m.Hc(11),m.gc(12,"translate"),m.Tb(),m.Ub(13,"mat-option",5),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-option",5),m.Hc(17),m.gc(18,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Ub(19,"mat-form-field"),m.Ub(20,"mat-label"),m.Hc(21),m.gc(22,"translate"),m.Tb(),m.Pb(23,"input",6),m.Tb(),m.Tb(),m.Tb(),m.Ub(24,"div",7),m.Ub(25,"button",8),m.bc("click",function(){return e.save()}),m.Hc(26),m.gc(27,"uppercase"),m.gc(28,"translate"),m.Tb(),m.Ub(29,"button",9),m.Hc(30),m.gc(31,"uppercase"),m.gc(32,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,12,"routes.stock.block.info")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,14,"routes.material.enabled")),m.Cb(4),m.Ic(m.hc(12,16,"routes.stock.block.auto")),m.Cb(2),m.lc("value",!0),m.Cb(1),m.Ic(m.hc(15,18,"routes.material.enum.enabled.true")),m.Cb(2),m.lc("value",!1),m.Cb(1),m.Ic(m.hc(18,20,"routes.material.enum.enabled.false")),m.Cb(4),m.Ic(m.hc(22,22,"routes.material.remark")),m.Cb(4),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(27,24,m.hc(28,26,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(31,28,m.hc(32,30,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,h.b,h.e,y.a,l.n,l.f,l.t,T.o,f.b,l.c,s.c,O.a,s.d],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),t})();const ka=["$crud"],Sa=["$enabled"],Ia=["$qs"],wa=["$overflow"],qa=["$barcode"],Ha=["$time"],Fa=["$area"],Ga=["$category"];function $a(t,e){1&t&&(m.Ub(0,"span"),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t&&(m.Cb(1),m.Jc("\uff08",m.hc(2,1,"routes.stock.block.auto"),"\uff09"))}function Ma(t,e){if(1&t&&(m.Hc(0),m.gc(1,"translate"),m.Fc(2,$a,3,3,"span",11)),2&t){const t=e.$implicit;m.Jc("",m.hc(1,2,"routes.material.enum.enabled."+t.enabled)," "),m.Cb(2),m.lc("ngIf",t.auto)}}function Pa(t,e){if(1&t&&(m.Ub(0,"span",14),m.Hc(1),m.gc(2,"translate"),m.Tb()),2&t){const t=m.fc().$implicit;m.Cb(1),m.Ic(m.hc(2,1,"routes.material.enum.qs."+t.qualityState))}}function xa(t,e){if(1&t&&(m.Hc(0),m.gc(1,"translate")),2&t){const t=m.fc().$implicit;m.Ic(m.hc(1,1,"routes.material.enum.qs."+t.qualityState))}}function Na(t,e){if(1&t&&(m.Fc(0,Pa,3,3,"span",12),m.Fc(1,xa,2,3,"ng-template",null,13,m.Gc)),2&t){const t=e.$implicit,a=m.uc(2);m.lc("ngIf","na"==t.qualityState||"ng"==t.qualityState)("ngIfElse",a)}}function ja(t,e){if(1&t&&(m.Ub(0,"span",14),m.Hc(1),m.Tb()),2&t){const t=m.fc(),e=t.$implicit,a=t.field.id;m.Cb(1),m.Ic(e[a])}}function Va(t,e){1&t&&m.Fc(0,ja,2,1,"span",15),2&t&&m.lc("ngIf",e.$implicit[e.field.id]>0)}function Aa(t,e){if(1&t&&m.Hc(0),2&t){const t=e.$implicit;m.Ic(t.barcode.startsWith("#@")?"":t.barcode)}}function Ba(t,e){1&t&&(m.Hc(0),m.gc(1,"date")),2&t&&m.Ic(m.ic(1,1,e.$implicit[e.field.id],"yyyy-MM-dd HH:mm:ss"))}function Ea(t,e){1&t&&(m.Ub(0,"p"),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"ul",18),m.Ub(4,"li",19),m.Ub(5,"span"),m.Hc(6),m.gc(7,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,2,"shared.operation.dyeing")),m.Cb(5),m.Ic(m.hc(7,4,"routes.stock.block.disabled")))}const Da=function(t){return{"app-foreground-primary":t}};function Ra(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",16),m.bc("click",function(){m.wc(t);const e=m.fc();return e.colorful=!e.colorful}),m.Ub(1,"mat-icon"),m.Hc(2,"brush"),m.Tb(),m.Fc(3,Ea,8,6,"ng-template",null,17,m.Gc),m.Tb()}if(2&t){const t=m.uc(4),e=m.fc();m.lc("matTooltipTemplate",t)("ngClass",m.pc(2,Da,e.colorful))}}function za(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",20),m.bc("click",function(){return m.wc(t),m.fc().set()}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"settings"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.block.setting"))}function La(t,e){if(1&t&&(m.Ub(0,"mat-option",26),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function Ja(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",24),m.Fc(1,La,2,2,"mat-option",25),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function Qa(t,e){if(1&t&&(m.Ub(0,"mat-form-field",21),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",22),m.Fc(5,Ja,2,2,"mat-optgroup",23),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.task.area")),m.Cb(3),m.lc("ngForOf",a.area)}}function Ka(t,e){if(1&t&&(m.Ub(0,"mat-option",26),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.Cc("padding-left",16*t.level+"px"),m.lc("value",t.data.id),m.Cb(1),m.Ic(t.data.name)}}function Wa(t,e){if(1&t&&(m.Ub(0,"mat-form-field",21),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",27),m.Pb(5,"mat-option"),m.Fc(6,Ka,2,4,"mat-option",28),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.material.cat")),m.Cb(4),m.lc("ngForOf",a.category.items)}}let Za=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._i18nService=a,this._toastService=o,this._dfs=t=>{var e;const a=[];if(null==t?void 0:t.length){const o=[...t.reverse()];for(;o.length;){const t=o.pop();a.push(t),(null===(e=t.children)||void 0===e?void 0:e.length)&&o.push(...t.children.reverse())}}return a},this.convertor=t=>(t.items.forEach(t=>{t&&null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0),t.auto=!0)}),t),this.dyeing=t=>this.colorful&&!t.enabled?"app-background-accent-lighter":null,this.set=()=>Object(r.a)(this,void 0,void 0,function*(){if(this._template.selection.hasValue()){let t=yield this._dialogService.open(Ua);if(t){const e=Object(H.a)(this._template.selection.selected.map(e=>Object.assign({},e,{enabled:t.value,remark:{property:"enabled",message:t.remark}})),"barcode");let a=0,o=0;this._template.loading=!0;for(const i in e)t=yield this._httpService.post("stocks",{operation:"update",stock:{barcode:i,lines:e[i]}}).catch(()=>{}),void 0!==t?a+=e[i].length:o+=e[i].length;this._toastService.show(`\u64cd\u4f5c\u5b8c\u6210\uff1a\u6210\u529f ${a} \u4e2a\uff1b\u5931\u8d25 ${o} \u4e2a\u3002`),a&&(yield this._template.refresh()),this._template.loading=!1}}})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("materials/categories"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id]),e=t[1].items.map(t=>t.id),this._category={map:{},items:[]},this._dfs(t[2].children).forEach(t=>{this.category.map[t.data.id]=t,this.category.items.push(t)}),this._defination=[{id:"code",header:"routes.material.code",filter:{order:3,field:"text"}},{id:"name",header:"routes.material.name",filter:{order:4,field:"text"}},{id:"model",header:"routes.material.model"},{id:"quantity",header:"routes.material.qty"},{id:"unit",header:"routes.material.unit"},{id:"enabled",header:"routes.material.enabled",template:this._enabledColumn},{id:"qualityState",header:"routes.material.qs",template:this._qsColumn},{id:"overdueTimeSpan",header:"routes.stock.block.overdue",template:this._overflowColumn},{id:"minimumStockTimeSpan",header:"routes.stock.block.less",template:this._overflowColumn},{id:"maximumStockTimeSpan",header:"routes.stock.block.more",template:this._overflowColumn},{id:"remark",header:"routes.material.remark"},{id:"barcode",header:"routes.stock.block.barcode",template:this._barcodeColumn,filter:{order:6,field:"text"}},{id:"warehouse",header:"routes.stock.block.warehouse"},{id:"area",header:"routes.stock.block.area",filter:{order:1,field:"multi-select",template:this._areaControl,default:e},display:null},{id:"cell",header:"routes.stock.block.cell",filter:{order:7,field:"text"}},{id:"batch",header:"routes.material.batch",filter:{order:5,field:"text"}},{id:"bill",header:"routes.material.bill"},{id:"supplier",header:"routes.material.supplier"},{id:"brand",header:"routes.material.brand"},{id:"inboundTime",header:"routes.stock.block.create",template:this._timeColumn,filter:{order:8,field:"date-range"}},{id:"inventoryTime",header:"routes.stock.block.update",template:this._timeColumn,filter:{order:9,field:"date-range"}},{id:"category",header:"routes.material.cat",filter:{order:2,field:"select",template:this._categoryControl,convertor:t=>t?this._dfs([this.category.map[t]]).map(t=>`category=${t.data.id}&`).join(""):""}}],this._api="stocks"})}get defination(){return this._defination}get api(){return this._api}get area(){return this._area}get category(){return this._category}get colorful(){return this._colorful}set colorful(t){this._colorful=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-block"]],viewQuery:function(t,e){if(1&t&&(m.Oc(ka,!0),m.Oc(Sa,!0),m.Oc(Ia,!0),m.Oc(wa,!0),m.Oc(qa,!0),m.Oc(Ha,!0),m.Oc(Fa,!0),m.Oc(Ga,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._enabledColumn=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first),m.tc(t=m.cc())&&(e._overflowColumn=t.first),m.tc(t=m.cc())&&(e._barcodeColumn=t.first),m.tc(t=m.cc())&&(e._timeColumn=t.first),m.tc(t=m.cc())&&(e._areaControl=t.first),m.tc(t=m.cc())&&(e._categoryControl=t.first)}},decls:20,vars:10,consts:[[3,"addable","editable","deletable","row-class","defination","api","query","convertor","toolbar-icons-template","toolbar-selection-template"],["$crud",""],["$enabled",""],["$qs",""],["$overflow",""],["$barcode",""],["$time",""],["$dyeing",""],["$save",""],["$area",""],["$category",""],[4,"ngIf"],["class","app-foreground-warn",4,"ngIf","ngIfElse"],["$qs1",""],[1,"app-foreground-warn"],["class","app-foreground-warn",4,"ngIf"],["mat-icon-button","",3,"matTooltipTemplate","ngClass","click"],["$tooltip",""],[1,"tooltip-ul"],[1,"app-foreground-accent"],["mat-icon-button","",3,"matTooltip","click"],[3,"formGroup"],["formControlName","area","multiple",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","category"],[3,"value","paddingLeft",4,"ngFor","ngForOf"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,Ma,3,4,"ng-template",null,2,m.Gc),m.Fc(4,Na,3,2,"ng-template",null,3,m.Gc),m.Fc(6,Va,1,1,"ng-template",null,4,m.Gc),m.Fc(8,Aa,1,1,"ng-template",null,5,m.Gc),m.Fc(10,Ba,2,4,"ng-template",null,6,m.Gc),m.Fc(12,Ra,5,4,"ng-template",null,7,m.Gc),m.Fc(14,za,4,3,"ng-template",null,8,m.Gc),m.Fc(16,Qa,6,5,"ng-template",null,9,m.Gc),m.Fc(18,Wa,7,5,"ng-template",null,10,m.Gc),m.Tb()),2&t){const t=m.uc(13),a=m.uc(15);m.lc("addable",!1)("editable",!1)("deletable",!1)("row-class",e.dyeing)("defination",e.defination)("api",e.api)("query","pallet=false")("convertor",e.convertor)("toolbar-icons-template",t)("toolbar-selection-template",a)}},directives:[_t.a,v.n,O.a,N.a,v.l,j.a,A.c,h.b,l.o,l.g,h.e,y.a,l.n,l.f,v.m,T.n,T.o],pipes:[U.d,v.e],styles:[".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}"]}),t})();var Xa=a("A5z7");const Ya=["barcodeInput"],to=["billInput"];function eo(t,e){if(1&t){const t=m.Vb();m.Ub(0,"mat-chip",16),m.bc("removed",function(){m.wc(t);const a=e.index;return m.fc().bill.remove(a)}),m.Hc(1),m.Ub(2,"mat-icon",17),m.Hc(3,"cancel"),m.Tb(),m.Tb()}if(2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",t," ")}}function ao(t,e){if(1&t&&(m.Ub(0,"mat-option",20),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function oo(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",18),m.Fc(1,ao,2,2,"mat-option",19),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.data.name),m.Cb(1),m.lc("ngForOf",t.material)}}function io(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",21),m.Pb(5,"mat-option"),m.Ub(6,"mat-option",22),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Ub(9,"mat-option",23),m.Hc(10),m.gc(11,"translate"),m.Tb(),m.Ub(12,"mat-option",24),m.Hc(13),m.gc(14,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,4,"routes.material.qs")),m.Cb(5),m.Ic(m.hc(8,6,"routes.material.enum.qs.na")),m.Cb(3),m.Ic(m.hc(11,8,"routes.material.enum.qs.ok")),m.Cb(3),m.Ic(m.hc(14,10,"routes.material.enum.qs.ng")))}function ro(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",25,26),m.Pb(6,"mat-option"),m.Ub(7,"mat-option",27),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"mat-option",28),m.Hc(11),m.gc(12,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,3,"routes.material.enabled")),m.Cb(6),m.Ic(m.hc(9,5,"routes.material.enum.enabled.true")),m.Cb(3),m.Ic(m.hc(12,7,"routes.material.enum.enabled.false")))}function no(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Pb(4,"input",29),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,1,"routes.material.remark")))}let co=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.bill={append:t=>{const e=this._formGroup.controls.bill;t.input.value&&(e.value.length<2?t.value&&!e.value.includes(t.value)&&(this._formGroup.controls.batch.value||this._formGroup.controls.batch.setValue(t.value.split("-")[0]),e.value.push(t.value),e.updateValueAndValidity()):this._toastService.show("\u6dfb\u52a0\u5931\u8d25\uff0c\u539f\u56e0\uff1a\u6807\u8bc6\u7801\u7801\u6570\u91cf\u6700\u591a2\u4e2a")),t.input.value=null},remove:t=>{const e=this._formGroup.controls.bill;e.value.splice(t,1),e.updateValueAndValidity(),this._formGroup.controls.batch.setValue(null),this._formGroup.controls.bill.value.forEach(t=>{this._formGroup.controls.batch.setValue(t.split("-")[0])})}},this.autocomplete=Object(u.a)(()=>{const t=this._formGroup.controls.code.value;(null==t?void 0:t.length)>=3?this._httpService.get(`materials?code=${t}&category=2&category=3&limit=50`).then(t=>{this._material=t.items}):this._material&&(this._material.length=0)},300),this.save=()=>Object(r.a)(this,void 0,void 0,function*(){const t=this._formGroup.controls.barcode.value;if(t){let e=yield this._httpService.get("stocks?barcode="+t);(null==e?void 0:e.items[0])?this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728,\u8bf7\u68c0\u67e5"):(this.lines=[],this._formGroup.controls.bill.value.forEach(t=>{this.lines.push({material:this._formGroup.controls.code.value.id,bill:t,quantity:this._formGroup.controls.quantity.value,batch:t.split("-")[0],supplier:this._formGroup.controls.supplier.value,manufacturingDate:this._formGroup.controls.manufacturingDate.value,qualityState:this._formGroup.controls.qualityState.value,enabled:this._formGroup.controls.enabled.value,remark:this._formGroup.controls.remark.value,isLocal:"1"})}),this.loading=!0,e=yield this._httpService.post("stocks",{operation:"scanInbound",barcode:t,destination:null,full:this.lines.length==this._formGroup.controls.code.value.price,stock:{barcode:t,lines:this.lines}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()),this.loading=!1)}}),this.scan={barcodeFocus:()=>{this.barcodeInput.nativeElement.focus()},billFocus:()=>{this.billInput.nativeElement.focus(),this._material=this._dfs(this._materialAll.filter(t=>{const e=this._formGroup.controls.barcode.value;let a=null;return"string"==typeof e&&e.length>=3&&(a=e[2]),t.data.code.includes(a)}))}},this._dfs=t=>{var e;const a=[];if(null==t?void 0:t.length){const o=[...t.reverse()];for(;o.length;){const t=o.pop();a.push(t),(null===(e=t.children)||void 0===e?void 0:e.length)&&o.push(...t.children.reverse())}}return a},this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("materials/categories"),this._httpService.get("materials")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"RK"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._formGroup.controls.area.setValue(t[1].items[0].id);const a=Object(H.a)(t[3].items.filter(t=>t.category<=3),"category");this._materialAll=this._dfs(t[2].children).filter(t=>!!a[t.data.id]&&(t.material=a[t.data.id],!0)),this._material=this._materialAll}),this._formGroup=this._formBuilder.group({barcode:[null,[l.u.required]],area:[null],code:[null,[l.u.required]],bill:[[],[l.u.required]],quantity:[1],batch:[null],supplier:[null],manufacturingDate:[null],qualityState:["ok"],enabled:["true"],remark:[null]})}get formGroup(){return this._formGroup}get material(){return this._material}get materialAll(){return this._materialAll}get area(){return this._area}refresh(){this._formGroup.controls.barcode.setValue(null),this._formGroup.controls.code.setValue(null),this._formGroup.controls.bill.setValue([])}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-scaninbound"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Ya,!0),m.Oc(to,!0)),2&t){let t;m.tc(t=m.cc())&&(e.barcodeInput=t.first),m.tc(t=m.cc())&&(e.billInput=t.first)}},decls:39,vars:33,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["matInput","","formControlName","barcode","required","",3,"keydown.enter"],["barcodeInput",""],["formControlName","bill","required",""],["$chip",""],[3,"removed",4,"ngFor","ngForOf"],[3,"matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["billInput",""],["formControlName","code","required",""],[3,"label",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"removed"],["matChipRemove",""],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","qualityState"],["value","na"],["value","ok"],["value","ng"],["formControlName","enabled"],["$enabled",""],["value","true"],["value","false"],["matInput","","formControlName","remark"]],template:function(t,e){if(1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"input",3,4),m.bc("keydown.enter",function(){return e.scan.billFocus()}),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-chip-list",5,6),m.Fc(18,eo,4,1,"mat-chip",7),m.Ub(19,"input",8,9),m.bc("matChipInputTokenEnd",function(t){return e.bill.append(t)}),m.Tb(),m.Tb(),m.Tb(),m.Ub(21,"mat-form-field"),m.Ub(22,"mat-label"),m.Hc(23),m.gc(24,"translate"),m.Tb(),m.Ub(25,"mat-select",10),m.Fc(26,oo,2,2,"mat-optgroup",11),m.Tb(),m.Tb(),m.Fc(27,io,15,12,"mat-form-field",12),m.Fc(28,ro,13,9,"mat-form-field",12),m.Fc(29,no,5,3,"mat-form-field",12),m.Tb(),m.Ub(30,"div",13),m.Ub(31,"button",14),m.bc("click",function(){return e.save()}),m.Hc(32),m.gc(33,"uppercase"),m.gc(34,"translate"),m.Tb(),m.Ub(35,"button",15),m.Hc(36),m.gc(37,"uppercase"),m.gc(38,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t){const t=m.uc(17);m.Cb(2),m.Ic(m.hc(3,17,"routes.stock.scaninbound.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,19,"routes.stock.scaninbound.barcode")),m.Cb(6),m.Ic(m.hc(15,21,"routes.material.bill")),m.Cb(4),m.lc("ngForOf",e.formGroup.controls.bill.value),m.Cb(1),m.lc("matChipInputFor",t)("matChipInputAddOnBlur",!0),m.Cb(4),m.Ic(m.hc(24,23,"routes.material.code")),m.Cb(3),m.lc("ngForOf",e.material),m.Cb(1),m.lc("ngIf",!1),m.Cb(1),m.lc("ngIf",!1),m.Cb(1),m.lc("ngIf",!1),m.Cb(2),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(33,25,m.hc(34,27,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(37,29,m.hc(38,31,"shared.dialog.cancel")))}},directives:[l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,Xa.c,v.m,Xa.b,y.a,v.n,s.c,O.a,x.a,s.d,Xa.a,j.a,Xa.d,T.n,T.o],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.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}"]}),t})();var lo=a("QibW");function so(t,e){if(1&t&&(m.Ub(0,"mat-option",22),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function uo(t,e){if(1&t&&(m.Ub(0,"mat-option",22),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Kc("",t.name,"--",t.code,"")}}function mo(t,e){if(1&t){const t=m.Vb();m.Ub(0,"section",23),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-radio-group",24),m.bc("ngModelChange",function(e){return m.wc(t),m.fc().isagv=e}),m.Ub(5,"mat-radio-button",25),m.Hc(6),m.gc(7,"translate"),m.Tb(),m.Ub(8,"mat-radio-button",26),m.Hc(9),m.gc(10,"translate"),m.Tb(),m.Tb(),m.Tb()}if(2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,4,"routes.stock.apply-out.isAGV")),m.Cb(2),m.lc("ngModel",t.isagv),m.Cb(2),m.Ic(m.hc(7,6,"routes.material.enum.isAGV.use")),m.Cb(3),m.Ic(m.hc(10,8,"routes.material.enum.isAGV.unuse"))}}function bo(t,e){if(1&t&&(m.Ub(0,"mat-option",22),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function po(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",27),m.Fc(5,bo,2,2,"mat-option",4),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function ho(t,e){if(1&t&&(m.Ub(0,"mat-option",22),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function fo(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",30),m.Fc(1,ho,2,2,"mat-option",4),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function go(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",28),m.Fc(5,fo,2,2,"mat-optgroup",29),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.area")),m.Cb(3),m.lc("ngForOf",t.area)}}let vo=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.save=()=>Object(r.a)(this,void 0,void 0,function*(){for(var t=[],e=[],a=1;a<=this._formGroup.controls.quantity.value;a++)t.push(this._formGroup.controls.code.value.id),this._formGroup.controls.batch.value&&e.push(this._formGroup.controls.batch.value.code);this.loading=!0;var o={isAgv:this._formGroup.controls.isagv.value,slTarget:"1"==this._isagv?this._formGroup.controls.targetNo.value.code:"",postUser:""};void 0!==(yield this._httpService.post("tasks",{operation:"applyout",task:{transaction:"ApplyOut",warehouse:0,Materials:t,Batchs:e,destination:"1"==this._isagv?parseInt(this._formGroup.controls.targetNo.value.remark):this._formGroup.controls.area.value.id.toString(),priority:0,manual:!1,qc:"ok",enable:!0,tag:JSON.stringify(o)}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}))&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()),this.loading=!1}),this.reCheckBatch=()=>Object(r.a)(this,void 0,void 0,function*(){this._batchList=null,this._formGroup.controls.batch.setValue(null),this._httpService.get("stocks/batch?material="+this._formGroup.controls.code.value.id).then(t=>{this._batchList=t.items})}),this.reGoods=()=>Object(r.a)(this,void 0,void 0,function*(){this._material=null,this._formGroup.controls.code.setValue(null),this._httpService.get("materials?category="+this._formGroup.controls.cat.value.id).then(t=>{this._material=t.items})}),this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=hiLineCode"),this._httpService.get("materials/goodsCategories")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"CK"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._formGroup.controls.area.setValue(t[1].items[0].id),this._items=t[2].items,this._catList=t[3].filter(t=>1==t.parent)}),this._formGroup=this._formBuilder.group({cathode:[null],anode:[null],code:[null,[l.u.required]],batch:[null],area:[null],quantity:["1",[l.u.required]],isagv:["0"],qualityState:["ok"],targetNo:[null],cat:[null]})}ngOnInit(){this._isagv=this._formGroup.controls.isagv.value}get formGroup(){return this._formGroup}get catList(){return this._catList}get material(){return this._material}get batchList(){return this._batchList}get area(){return this._area}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}refresh(){this._formGroup.controls.code.setValue(null),this._formGroup.controls.area.setValue(null),this._formGroup.controls.batch.setValue(null),this._formGroup.controls.cat.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-apply-out"]],decls:55,vars:31,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["formControlName","cat",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["formControlName","code","required","",3,"selectionChange"],["formControlName","quantity","required",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["value","6"],["value","7"],["value","8"],["value","9"],["value","10"],["class","example-section",4,"ngIf"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"value"],[1,"example-section"],["formControlName","isagv",3,"ngModel","ngModelChange"],["value","1",1,"example-margin"],["value","0",1,"example-margin"],["formControlName","targetNo"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"mat-select",3),m.bc("selectionChange",function(){return e.reGoods()}),m.Fc(11,so,2,2,"mat-option",4),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-select",5),m.bc("selectionChange",function(){return e.reCheckBatch()}),m.Fc(17,uo,2,3,"mat-option",4),m.Tb(),m.Tb(),m.Ub(18,"mat-form-field"),m.Ub(19,"mat-label"),m.Hc(20),m.gc(21,"translate"),m.Tb(),m.Ub(22,"mat-select",6),m.Ub(23,"mat-option",7),m.Hc(24,"1"),m.Tb(),m.Ub(25,"mat-option",8),m.Hc(26,"2"),m.Tb(),m.Ub(27,"mat-option",9),m.Hc(28,"3"),m.Tb(),m.Ub(29,"mat-option",10),m.Hc(30,"4"),m.Tb(),m.Ub(31,"mat-option",11),m.Hc(32,"5"),m.Tb(),m.Ub(33,"mat-option",12),m.Hc(34,"6"),m.Tb(),m.Ub(35,"mat-option",13),m.Hc(36,"7"),m.Tb(),m.Ub(37,"mat-option",14),m.Hc(38,"8"),m.Tb(),m.Ub(39,"mat-option",15),m.Hc(40,"9"),m.Tb(),m.Ub(41,"mat-option",16),m.Hc(42,"10"),m.Tb(),m.Tb(),m.Tb(),m.Fc(43,mo,11,10,"section",17),m.Fc(44,po,6,4,"mat-form-field",18),m.Fc(45,go,6,4,"mat-form-field",18),m.Tb(),m.Ub(46,"div",19),m.Ub(47,"button",20),m.bc("click",function(){return e.save()}),m.Hc(48),m.gc(49,"uppercase"),m.gc(50,"translate"),m.Tb(),m.Ub(51,"button",21),m.Hc(52),m.gc(53,"uppercase"),m.gc(54,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,15,"routes.stock.apply-out.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,17,"routes.material.cat")),m.Cb(3),m.lc("ngForOf",e.catList),m.Cb(3),m.Ic(m.hc(15,19,"routes.material.code")),m.Cb(3),m.lc("ngForOf",e.material),m.Cb(3),m.Ic(m.hc(21,21,"routes.stock.apply-out.qty")),m.Cb(23),m.lc("ngIf",!0),m.Cb(1),m.lc("ngIf","1"==e.isagv),m.Cb(1),m.lc("ngIf","0"==e.isagv),m.Cb(2),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(49,23,m.hc(50,25,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(53,27,m.hc(54,29,"shared.dialog.cancel"))))},directives:[l.v,l.o,l.g,h.b,h.e,y.a,l.n,l.f,v.m,l.t,T.o,v.n,s.c,O.a,x.a,s.d,lo.c,lo.b,T.n],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.mat-form-field[_ngcontent-%COMP%]{width:100%}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})();function _o(t,e){if(1&t&&(m.Ub(0,"mat-option",9),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}let Co=(()=>{class t{constructor(t,e,a){this._formBuilder=t,this._httpService=e,this._toastService=a,this.loading=!1,this.lines=[],this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t;const e=this._formGroup.controls.barcode.value;if(e){let a=yield this._httpService.get("stocks?barcode="+e);(null==a?void 0:a.items[0])?this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728,\u8bf7\u68c0\u67e5"):(this.lines=[{material:this._formGroup.controls.code.value.id,quantity:1,enabled:"true"}],a=yield this._httpService.get(`cells?area=${this._formGroup.controls.area.value}&type=Cache`),this.loading=!0,a=yield this._httpService.post("stocks",{operation:"palletIn",destination:(null===(t=null==a?void 0:a.items[0])||void 0===t?void 0:t.id)||null,full:1==this._formGroup.controls.code.value.price,stock:{barcode:e,lines:this.lines}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==a&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.lines=[],this.refresh()),this.loading=!1)}}),this.scan=()=>Object(r.a)(this,void 0,void 0,function*(){this._material=this._materialAll.filter(t=>t.code==this._formGroup.controls.barcode.value.substring(0,3))})}get formGroup(){return this._formGroup}get material(){return this._material}get materialAll(){return this._materialAll}get area(){return this._area}ngOnInit(){this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"ZCQ"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._formGroup.controls.area.setValue(t[1].items[0].id)}),this._formGroup=this._formBuilder.group({barcode:[null,[l.u.required]],area:[2,[l.u.required]],code:[null,[l.u.required]]}),this._httpService.get("materials?&category=5&category=6&category=9").then(t=>{this._materialAll=t.items,this._material=t.items,this._formGroup.controls.code.setValue(t.items[0].id)})}refresh(){this._formGroup.controls.barcode.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-pallet-in"]],decls:26,vars:24,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["matInput","","formControlName","barcode","required","",3,"keydown.enter"],["formControlName","code","required",""],[3,"value",4,"ngFor","ngForOf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"value"]],template:function(t,e){1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"input",3),m.bc("keydown.enter",function(){return e.scan()}),m.Tb(),m.Tb(),m.Ub(11,"mat-form-field"),m.Ub(12,"mat-label"),m.Hc(13),m.gc(14,"translate"),m.Tb(),m.Ub(15,"mat-select",4),m.Fc(16,_o,2,2,"mat-option",5),m.Tb(),m.Tb(),m.Tb(),m.Ub(17,"div",6),m.Ub(18,"button",7),m.bc("click",function(){return e.save()}),m.Hc(19),m.gc(20,"uppercase"),m.gc(21,"translate"),m.Tb(),m.Ub(22,"button",8),m.Hc(23),m.gc(24,"uppercase"),m.gc(25,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,10,"routes.stock.pallet-in.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,12,"routes.stock.pallet-in.barcode")),m.Cb(5),m.Ic(m.hc(14,14,"routes.stock.pallet-in.code")),m.Cb(3),m.lc("ngForOf",e.material),m.Cb(2),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(20,16,m.hc(21,18,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(24,20,m.hc(25,22,"shared.dialog.cancel"))))},directives:[l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,y.a,v.m,s.c,O.a,x.a,s.d,T.o],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.mat-form-field[_ngcontent-%COMP%]{width:100%}"]}),t})();function yo(t,e){if(1&t&&(m.Ub(0,"mat-option",11),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function To(t,e){if(1&t&&(m.Ub(0,"mat-option",11),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function Oo(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",12),m.Fc(5,To,2,2,"mat-option",6),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function Uo(t,e){if(1&t&&(m.Ub(0,"mat-option",11),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function ko(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",15),m.Fc(1,Uo,2,2,"mat-option",6),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function So(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",13),m.Fc(5,ko,2,2,"mat-optgroup",14),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.area")),m.Cb(3),m.lc("ngForOf",t.area)}}let Io=(()=>{class t{constructor(t,e,a,o,i){this._data=t,this._formBuilder=e,this._httpService=a,this._toastService=o,this._dialogRef=i,this.outfeed=()=>Object(r.a)(this,void 0,void 0,function*(){var t={isAgv:this._form.controls.isagv.value,slTarget:"1"==this._isagv?this._form.controls.targetNo.value.code:"",postUser:""},e=0;"1"==this._isagv?("3"==this._form.controls.targetNo.value.remark&&(e=1),"8"==this._form.controls.targetNo.value.remark&&(e=2)):e=this._form.controls.area.value.warehouse;let a=0;for(var o=0;o<this._form.controls.quantity.value;o++){var i=[];if(i.push(this._form.controls.material.value),void 0!==(yield this._httpService.post("tasks",{operation:"applyout",task:{transaction:"PalletOut",warehouse:e,Materials:i,destination:"1"==this._isagv?this._form.controls.targetNo.value.remark:this._form.controls.area.value.id,priority:0,manual:!1,enable:!0,tag:JSON.stringify(t)}}).catch(t=>{}))&&++a==this._form.controls.quantity.value)break}this._toastService.show(`\u64cd\u4f5c\u5b8c\u6210\uff1a\u6210\u529f ${a} \u4e2a\u3002`),this._dialogRef.close(!0)}),this._form=this._formBuilder.group({quantity:[null,[l.u.required]],material:[null,[l.u.required]],area:[null],isagv:["0"],targetNo:[null]}),this._data.length&&this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("materials"),this._httpService.get("items?name=hiLineCode")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"RK"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._form.controls.area.setValue(t[1].items[0].id),this._materials=t[2].items.filter(t=>5==t.category||6==t.category||9==t.category),this._items=t[3].items})}ngOnInit(){this._isagv=this._form.controls.isagv.value}get form(){return this._form}get area(){return this._area}get materials(){return this._materials}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(p.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-pallet-out-batch"]],decls:28,vars:25,consts:[["mat-dialog-title",""],["autocomplete","off",3,"formGroup"],["mat-dialog-content",""],["matInput","","formControlName","quantity","type","number","min","1","required",""],[3,"formGroup"],["formControlName","material"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],[3,"value"],["formControlName","targetNo"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"form",1),m.Ub(4,"div",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Pb(9,"input",3),m.Tb(),m.Ub(10,"mat-form-field",4),m.Ub(11,"mat-label"),m.Hc(12),m.gc(13,"translate"),m.Tb(),m.Ub(14,"mat-select",5),m.Pb(15,"mat-option"),m.Fc(16,yo,2,2,"mat-option",6),m.Tb(),m.Tb(),m.Fc(17,Oo,6,4,"mat-form-field",7),m.Fc(18,So,6,4,"mat-form-field",7),m.Tb(),m.Ub(19,"div",8),m.Ub(20,"button",9),m.bc("click",function(){return e.outfeed()}),m.Hc(21),m.gc(22,"uppercase"),m.gc(23,"translate"),m.Tb(),m.Ub(24,"button",10),m.Hc(25),m.gc(26,"uppercase"),m.gc(27,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,11,"routes.task.pallet.batch")),m.Cb(2),m.lc("formGroup",e.form),m.Cb(4),m.Ic(m.hc(8,13,"routes.stock.pallet-out.quantity")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(2),m.Ic(m.hc(13,15,"routes.stock.pallet-out.material")),m.Cb(4),m.lc("ngForOf",e.materials),m.Cb(1),m.lc("ngIf","1"==e.isagv),m.Cb(1),m.lc("ngIf","0"==e.isagv),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(22,17,m.hc(23,19,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(26,21,m.hc(27,23,"shared.dialog.cancel"))))},directives:[s.h,l.v,l.o,l.g,s.e,h.b,h.e,f.b,l.c,l.r,l.n,l.f,l.t,y.a,T.o,v.m,v.n,s.c,O.a,s.d,T.n],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}.mat-optgroup.mat-optgroup-lv2[_ngcontent-%COMP%] >.mat-optgroup-label{height:auto!important}.mat-optgroup.mat-optgroup-lv2[_ngcontent-%COMP%] >.mat-optgroup-label>span{display:block}.mat-optgroup.mat-optgroup-lv2[_ngcontent-%COMP%] >.mat-optgroup-label>span:last-child{margin-left:16px}.mat-optgroup.mat-optgroup-lv2[_ngcontent-%COMP%] >.mat-optgroup-label>span:last-child:not(:first-child){margin-top:-8px}.mat-optgroup.mat-optgroup-lv2[_ngcontent-%COMP%] >.mat-option{padding-left:48px!important}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})();function wo(t,e){if(1&t&&(m.Ub(0,"mat-option",9),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function qo(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",7),m.Fc(5,wo,2,2,"mat-option",8),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function Ho(t,e){if(1&t&&(m.Ub(0,"mat-option",9),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function Fo(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",12),m.Fc(1,Ho,2,2,"mat-option",8),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function Go(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",10),m.Fc(5,Fo,2,2,"mat-optgroup",11),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.area")),m.Cb(3),m.lc("ngForOf",t.area)}}let $o=(()=>{class t{constructor(t,e,a,o){this._data=t,this._formBuilder=e,this._httpService=a,this._dialogRef=o,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){var t=0;"1"==this._isagv?("3"==this._form.controls.targetNo.value.remark&&(t=1),"8"==this._form.controls.targetNo.value.remark&&(t=2)):t=this._form.controls.area.value.warehouse,this._dialogRef.close({id:"1"==this._isagv?this._form.controls.targetNo.value.remark:this._form.controls.area.value.id,tag:{isAgv:this._form.controls.isagv.value,slTarget:"1"==this._isagv?this._form.controls.targetNo.value.code:"",postUser:""},warehouse:t})}),this._form=this._formBuilder.group({area:[null],isagv:["0"],targetNo:[null]}),this._data.length&&this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=hiLineCode")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"RK"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._form.controls.area.setValue(t[1].items[0].id),this._items=t[2].items})}ngOnInit(){this._isagv=this._form.controls.isagv.value}get form(){return this._form}get area(){return this._area}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(s.a),m.Ob(l.d),m.Ob(b.a),m.Ob(s.g))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-pallet-out-outfeed"]],decls:16,vars:17,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["autocomplete","off",3,"formGroup"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""],["formControlName","targetNo"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){1&t&&(m.Ub(0,"h2",0),m.Hc(1),m.gc(2,"translate"),m.Tb(),m.Ub(3,"div",1),m.Ub(4,"form",2),m.Fc(5,qo,6,4,"mat-form-field",3),m.Fc(6,Go,6,4,"mat-form-field",3),m.Tb(),m.Tb(),m.Ub(7,"div",4),m.Ub(8,"button",5),m.bc("click",function(){return e.save()}),m.Hc(9),m.gc(10,"uppercase"),m.gc(11,"translate"),m.Tb(),m.Ub(12,"button",6),m.Hc(13),m.gc(14,"uppercase"),m.gc(15,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(1),m.Ic(m.hc(2,7,"routes.stock.pallet-out.outfeed")),m.Cb(3),m.lc("formGroup",e.form),m.Cb(1),m.lc("ngIf","1"==e.isagv),m.Cb(1),m.lc("ngIf","0"==e.isagv),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(10,9,m.hc(11,11,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(14,13,m.hc(15,15,"shared.dialog.cancel"))))},directives:[s.h,s.e,l.v,l.o,l.g,v.n,s.c,O.a,s.d,h.b,h.e,y.a,l.n,l.f,v.m,T.o,T.n],pipes:[U.d,v.v],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})();const Mo=["$crud"],Po=["$area"],xo=["$time"],No=["$category"],jo=["$qs"];function Vo(t,e){1&t&&(m.Hc(0),m.gc(1,"date")),2&t&&m.Ic(m.ic(1,1,e.$implicit[e.field.id],"yyyy-MM-dd HH:mm:ss"))}function Ao(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",8),m.bc("click",function(){return m.wc(t),m.fc().batch()}),m.Hc(1),m.gc(2,"uppercase"),m.gc(3,"translate"),m.Tb()}2&t&&(m.Cb(1),m.Ic(m.hc(2,1,m.hc(3,3,"routes.stock.pallet-out.batch"))))}function Bo(t,e){1&t&&(m.Hc(0),m.gc(1,"translate")),2&t&&m.Ic(m.hc(1,1,"routes.material.enum.qs."+e.$implicit.qualityState))}function Eo(t,e){if(1&t){const t=m.Vb();m.Ub(0,"button",9),m.bc("click",function(){return m.wc(t),m.fc().palletOut()}),m.gc(1,"translate"),m.Ub(2,"mat-icon"),m.Hc(3,"get_app"),m.Tb(),m.Tb()}2&t&&m.mc("matTooltip",m.hc(1,1,"routes.stock.pallet-out.outfeed"))}function Do(t,e){if(1&t&&(m.Ub(0,"mat-option",15),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t.id),m.Cb(1),m.Ic(t.name)}}function Ro(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",13),m.Fc(1,Do,2,2,"mat-option",14),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function zo(t,e){if(1&t&&(m.Ub(0,"mat-form-field",10),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",11),m.Fc(5,Ro,2,2,"mat-optgroup",12),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.stock.pallet-out.area")),m.Cb(3),m.lc("ngForOf",a.area)}}function Lo(t,e){if(1&t&&(m.Ub(0,"mat-option",15),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.Cc("padding-left",16*t.level+"px"),m.lc("value",t.data.id),m.Cb(1),m.Ic(t.data.name)}}function Jo(t,e){if(1&t&&(m.Ub(0,"mat-form-field",10),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",16),m.Pb(5,"mat-option"),m.Fc(6,Lo,2,4,"mat-option",17),m.Tb(),m.Tb()),2&t){const t=e.$implicit,a=m.fc();m.lc("formGroup",t),m.Cb(2),m.Ic(m.hc(3,3,"routes.material.cat")),m.Cb(4),m.lc("ngForOf",a.category.items)}}let Qo=(()=>{class t{constructor(t,e,a,o){this._dialogService=t,this._httpService=e,this._toastService=a,this._i18nService=o,this._dfs=t=>{var e;const a=[];if(null==t?void 0:t.length){const o=[...t.reverse()];for(;o.length;){const t=o.pop();a.push(t),(null===(e=t.children)||void 0===e?void 0:e.length)&&o.push(...t.children.reverse())}}return a},this.convertor=t=>(t.items.forEach(t=>{t&&null==t.enabled&&(t.enabled=!(null!=t.qualityState&&"ok"!=t.qualityState||t.overdueTimeSpan>0||t.minimumStockTimeSpan>0||t.maximumStockTimeSpan>0))}),t),this.batch=()=>Object(r.a)(this,void 0,void 0,function*(){(yield this._dialogService.open(Io,{data:this.area}))&&this._template.refresh()}),this.palletOut=()=>Object(r.a)(this,void 0,void 0,function*(){const t=Object(se.a)(this._template.selection.selected.map(t=>t.warehouse));if(t.length>1)return void this._toastService.show("\u4e0d\u5141\u8bb8\u6279\u91cf\u64cd\u4f5c\u4e0d\u540c\u4ed3\u5e93\u7684\u9879\u76ee");let e=yield this._dialogService.open($o,{data:this.area.find(e=>e.name==t[0]).area});if(e){let t=0,a=0;this._template.loading=!0;for(const o of this._template.selection.selected)void 0!==(yield this._httpService.post("tasks",{operation:"palletOut",task:{warehouse:e.warehouse,barcode:o.barcode,destination:e.id,priority:0,manual:!1,tag:JSON.stringify(e.tag)}}).catch(()=>{}))?t++:a++;this._toastService.show(`\u64cd\u4f5c\u5b8c\u6210\uff1a\u6210\u529f ${t} \u4e2a\uff1b\u5931\u8d25 ${a} \u4e2a\u3002`),t&&(yield this._template.refresh()),this._template.loading=!1}})}ngAfterViewInit(){return Object(r.a)(this,void 0,void 0,function*(){const t=yield this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("materials/categories"),this._httpService.get("items?name=qualityState"));let e=Object(H.a)(t[1].items,"warehouse");this._area=t[0].items.filter(t=>t.area=e[t.id].filter(t=>"LKQ"==t.type)),e=t[1].items.filter(t=>"LKQ"==t.type).map(t=>t.id),this._category={map:{},items:[]},this._dfs(t[2].children).forEach(t=>{4==t.data.parent&&(this.category.map[t.data.id]=t,this.category.items.push(t))}),this._qualityState=t[3].items,this._defination=[{id:"barcode",header:"routes.stock.pallet-out.barcode",filter:{order:3,field:"text"}},{id:"code",header:"routes.material.code",filter:{order:3,field:"text"}},{id:"cell",header:"routes.stock.pallet-out.cell"},{id:"warehouse",header:"routes.stock.pallet-out.warehouse"},{id:"area",header:"routes.stock.pallet-out.area",filter:{order:1,field:"multi-select",template:this._areaControl,default:e},display:null},{id:"laneway",header:"routes.stock.pallet-out.laneway",filter:{order:1,field:"text"}},{id:"inboundTime",header:"routes.material.inboundTime",template:this._timeColumn,filter:{order:4,field:"date-range"}}],this._api="stocks"})}get defination(){return this._defination}get api(){return this._api}get area(){return this._area}get category(){return this._category}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(M.a),m.Ob(b.a),m.Ob(p.a),m.Ob(d.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-pallet-out"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Mo,!0),m.Oc(Po,!0),m.Oc(xo,!0),m.Oc(No,!0),m.Oc(jo,!0)),2&t){let t;m.tc(t=m.cc())&&(e._template=t.first),m.tc(t=m.cc())&&(e._areaControl=t.first),m.tc(t=m.cc())&&(e._timeColumn=t.first),m.tc(t=m.cc())&&(e._categoryControl=t.first),m.tc(t=m.cc())&&(e._qsColumn=t.first)}},decls:14,vars:8,consts:[[3,"addable","editable","deletable","defination","api","query","toolbar-buttons-template","toolbar-selection-template"],["$crud",""],["$time",""],["$batch",""],["$qs",""],["$outfeed",""],["$area",""],["$category",""],["mat-button","","color","primary",3,"click"],["mat-icon-button","",3,"matTooltip","click"],[3,"formGroup"],["formControlName","area","multiple",""],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","category"],[3,"value","paddingLeft",4,"ngFor","ngForOf"]],template:function(t,e){if(1&t&&(m.Ub(0,"crud-template",0,1),m.Fc(2,Vo,2,4,"ng-template",null,2,m.Gc),m.Fc(4,Ao,4,5,"ng-template",null,3,m.Gc),m.Fc(6,Bo,2,3,"ng-template",null,4,m.Gc),m.Fc(8,Eo,4,3,"ng-template",null,5,m.Gc),m.Fc(10,zo,6,5,"ng-template",null,6,m.Gc),m.Fc(12,Jo,7,5,"ng-template",null,7,m.Gc),m.Tb()),2&t){const t=m.uc(5),a=m.uc(9);m.lc("addable",!1)("editable",!1)("deletable",!1)("defination",e.defination)("api",e.api)("query","pallet=true&excludeTask=true")("toolbar-buttons-template",t)("toolbar-selection-template",a)}},directives:[_t.a,O.a,A.c,j.a,h.b,l.o,l.g,h.e,y.a,l.n,l.f,v.m,T.n,T.o],pipes:[v.e,v.v,U.d],styles:[""]}),t})();const Ko=["barcodeInput"],Wo=["goodsCodeInput"],Zo=["qtyInput"];let Xo=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.scan={goodsCodefocus:t=>{this.goodsCodeInput.nativeElement.focus()},goodsCodeScan:t=>Object(r.a)(this,void 0,void 0,function*(){let t=yield this._httpService.get("materials?code="+this._formGroup.controls.goodsCode.value);(null==t?void 0:t.items[0])?(null==t?void 0:t.items[0].model)==this._formGroup.controls.barcode.value.substring(0,3)?(this._formGroup.controls.goodsCode.setValue((null==t?void 0:t.items[0].code)+"-"+(null==t?void 0:t.items[0].name)),this._formGroup.controls.material.setValue(null==t?void 0:t.items[0].id),this._formGroup.controls.quantity.setValue(null==t?void 0:t.items[0].brand),this.qtyInput.nativeElement.focus()):this._toastService.show(`\u6b64\u6258\u76d8\u7c7b\u578b(${this._formGroup.controls.barcode.value})\u4e0d\u80fd\u88c5\u8f7d\u7269\u6599(${this._formGroup.controls.goodsCode.value})`):this._toastService.show("\u7269\u6599\u7f16\u7801\u672a\u5b9a\u4e49")})},this.save=()=>Object(r.a)(this,void 0,void 0,function*(){const t=this._formGroup.controls.barcode.value;if(t){let e=yield this._httpService.get("stocks?barcode="+t);(null==e?void 0:e.items[0])?this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728,\u8bf7\u68c0\u67e5"):(this.lines=[],this.lines.push({material:this._formGroup.controls.material.value,quantity:this._formGroup.controls.quantity.value,supplier:this._formGroup.controls.supplier.value,manufacturingDate:this._formGroup.controls.manufacturingDate.value,qualityState:this._formGroup.controls.qualityState.value,enabled:this._formGroup.controls.enabled.value,remark:this._formGroup.controls.remark.value,isLocal:"1"}),this.loading=!0,e=yield this._httpService.post("stocks",{operation:"scanInbound",barcode:t,destination:null,full:!0,stock:{barcode:t,lines:this.lines}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==e&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()),this.loading=!1)}}),this._formGroup=this._formBuilder.group({barcode:[null,[l.u.required]],goodsCode:[null,[l.u.required]],bill:[[]],quantity:[null,[l.u.required]],material:[-1],batch:[null],supplier:[null],manufacturingDate:[null],qualityState:["ok"],enabled:["true"],remark:[null]})}ngAfterViewInit(){setTimeout(()=>{this.loading=!1,this.barcodeInput.nativeElement.focus()},100)}get formGroup(){return this._formGroup}refresh(){this._formGroup.controls.barcode.setValue(null),this._formGroup.controls.goodsCode.setValue(null),this._formGroup.controls.quantity.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-applyin"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Ko,!0),m.Oc(Wo,!0),m.Oc(Zo,!0)),2&t){let t;m.tc(t=m.cc())&&(e.barcodeInput=t.first),m.tc(t=m.cc())&&(e.goodsCodeInput=t.first),m.tc(t=m.cc())&&(e.qtyInput=t.first)}},decls:33,vars:26,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["matInput","","formControlName","barcode","required","",3,"keydown.enter"],["barcodeInput",""],["matInput","","formControlName","goodsCode","required","",3,"keydown.enter"],["goodsCodeInput",""],["matInput","","formControlName","quantity","required",""],["qtyInput",""],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"]],template:function(t,e){1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"input",3,4),m.bc("keydown.enter",function(t){return e.scan.goodsCodefocus(t)}),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"input",5,6),m.bc("keydown.enter",function(t){return e.scan.goodsCodeScan(t)}),m.Tb(),m.Tb(),m.Ub(18,"mat-form-field"),m.Ub(19,"mat-label"),m.Hc(20),m.gc(21,"translate"),m.Tb(),m.Pb(22,"input",7,8),m.Tb(),m.Tb(),m.Ub(24,"div",9),m.Ub(25,"button",10),m.bc("click",function(){return e.save()}),m.Hc(26),m.gc(27,"uppercase"),m.gc(28,"translate"),m.Tb(),m.Ub(29,"button",11),m.Hc(30),m.gc(31,"uppercase"),m.gc(32,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,10,"routes.stock.applyin.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,12,"routes.stock.applyin.barcode")),m.Cb(6),m.Ic(m.hc(15,14,"routes.stock.applyin.goodsCode")),m.Cb(6),m.Ic(m.hc(21,16,"routes.stock.applyin.qty")),m.Cb(5),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(27,18,m.hc(28,20,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(31,22,m.hc(32,24,"shared.dialog.cancel"))))},directives:[l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,s.c,O.a,x.a,s.d],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.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}"]}),t})();const Yo=["barcodeInput"],ti=["billInput"];function ei(t,e){if(1&t){const t=m.Vb();m.Ub(0,"mat-chip",19),m.bc("removed",function(){m.wc(t);const a=e.index;return m.fc().bill.remove(a)}),m.Hc(1),m.Ub(2,"mat-icon",20),m.Hc(3,"cancel"),m.Tb(),m.Tb()}if(2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",t," ")}}function ai(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",21,22),m.Pb(6,"mat-option"),m.Ub(7,"mat-option",23),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"mat-option",24),m.Hc(11),m.gc(12,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,3,"routes.material.enabled")),m.Cb(6),m.Ic(m.hc(9,5,"routes.material.enum.enabled.true")),m.Cb(3),m.Ic(m.hc(12,7,"routes.material.enum.enabled.false")))}let oi=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.bill={append:t=>{const e=this._formGroup.controls.bill;t.input.value&&(e.value.length<2?t.value&&!e.value.includes(t.value)&&(this._formGroup.controls.batch.value||this._formGroup.controls.batch.setValue(t.value.split("-")[0]),e.value.push(t.value),e.updateValueAndValidity()):this._toastService.show("\u6dfb\u52a0\u5931\u8d25\uff0c\u539f\u56e0\uff1a\u6807\u8bc6\u7801\u7801\u6570\u91cf\u6700\u591a2\u4e2a")),t.input.value=null},remove:t=>{const e=this._formGroup.controls.bill;e.value.splice(t,1),e.updateValueAndValidity(),this._formGroup.controls.batch.setValue(null),this._formGroup.controls.bill.value.forEach(t=>{this._formGroup.controls.batch.setValue(t.split("-")[0])})}},this.save=()=>Object(r.a)(this,void 0,void 0,function*(){const t=this._formGroup.controls.barcode.value,e=this._formGroup.controls.cell.value;if(t){let o=yield this._httpService.get("stocks?barcode="+t);if(null==o?void 0:o.items[0])this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728,\u8bf7\u68c0\u67e5");else{if(e){let t=yield this._httpService.get("cells?name="+e);if(!(null==t?void 0:t.items[0]))return void this._toastService.show("\u8d27\u4f4d\u7f16\u7801\u586b\u5199\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u586b\u5199\u3002");if("Empty"!=(null==t?void 0:t.items[0].store))return void this._toastService.show("\u8d27\u4f4d\u5df2\u7ecf\u88ab\u4f7f\u7528\uff0c\u8bf7\u66f4\u6362\u8d27\u4f4d");if("Enabled"!=(null==t?void 0:t.items[0].task))return void this._toastService.show("\u8d27\u4f4d\u6709\u4efb\u52a1\uff0c\u8bf7\u66f4\u6362\u8d27\u4f4d")}this.lines=[],this._formGroup.controls.bill.value.forEach(t=>{this.lines.push({material:0,bill:t,quantity:this._formGroup.controls.quantity.value,batch:t.split("-")[0],supplier:this._formGroup.controls.supplier.value,manufacturingDate:this._formGroup.controls.manufacturingDate.value,qualityState:this._formGroup.controls.qualityState.value,enabled:this._formGroup.controls.enabled.value,remark:this._formGroup.controls.remark.value})});var a={Cell:e};this.loading=!0,o=yield this._httpService.post("stocks",{operation:"applyin",barcode:t,full:2==this.lines.length,stock:{barcode:t,lines:this.lines,tag:JSON.stringify(a)}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==o&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()),this.loading=!1}}}),this.scan={billfocus:t=>{this.billInput.nativeElement.focus()}},this._formGroup=this._formBuilder.group({barcode:[null,[l.u.required]],bill:[[],[l.u.required]],quantity:[1],batch:[null],supplier:[null],manufacturingDate:[null],qualityState:["ng"],enabled:["true"],remark:[null],cell:[null]})}ngAfterViewInit(){setTimeout(()=>{this.loading=!1,this.barcodeInput.nativeElement.focus()},100)}get formGroup(){return this._formGroup}refresh(){this._formGroup.controls.barcode.setValue(null),this._formGroup.controls.bill.setValue([]),this._formGroup.controls.cell.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-stock-ngin"]],viewQuery:function(t,e){if(1&t&&(m.Oc(Yo,!0),m.Oc(ti,!0)),2&t){let t;m.tc(t=m.cc())&&(e.barcodeInput=t.first),m.tc(t=m.cc())&&(e.billInput=t.first)}},decls:53,vars:42,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["matInput","","formControlName","barcode","required","",3,"keydown.enter"],["barcodeInput",""],["formControlName","bill","required",""],["$chip",""],[3,"removed",4,"ngFor","ngForOf"],[3,"matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["billInput",""],["formControlName","qualityState"],["value","ng"],["value","check"],[4,"ngIf"],["matInput","","formControlName","remark"],["matInput","","formControlName","cell"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"removed"],["matChipRemove",""],["formControlName","enabled"],["$enabled",""],["value","true"],["value","false"]],template:function(t,e){if(1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"input",3,4),m.bc("keydown.enter",function(t){return e.scan.billfocus(t)}),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-chip-list",5,6),m.Fc(18,ei,4,1,"mat-chip",7),m.Ub(19,"input",8,9),m.bc("matChipInputTokenEnd",function(t){return e.bill.append(t)}),m.Tb(),m.Tb(),m.Tb(),m.Ub(21,"mat-form-field"),m.Ub(22,"mat-label"),m.Hc(23),m.gc(24,"translate"),m.Tb(),m.Ub(25,"mat-select",10),m.Pb(26,"mat-option"),m.Ub(27,"mat-option",11),m.Hc(28),m.gc(29,"translate"),m.Tb(),m.Ub(30,"mat-option",12),m.Hc(31),m.gc(32,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Fc(33,ai,13,9,"mat-form-field",13),m.Ub(34,"mat-form-field"),m.Ub(35,"mat-label"),m.Hc(36),m.gc(37,"translate"),m.Tb(),m.Pb(38,"input",14),m.Tb(),m.Ub(39,"mat-form-field"),m.Ub(40,"mat-label"),m.Hc(41),m.gc(42,"translate"),m.Tb(),m.Pb(43,"input",15),m.Tb(),m.Tb(),m.Ub(44,"div",16),m.Ub(45,"button",17),m.bc("click",function(){return e.save()}),m.Hc(46),m.gc(47,"uppercase"),m.gc(48,"translate"),m.Tb(),m.Ub(49,"button",18),m.Hc(50),m.gc(51,"uppercase"),m.gc(52,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t){const t=m.uc(17);m.Cb(2),m.Ic(m.hc(3,18,"routes.stock.ngin.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,20,"routes.stock.ngin.barcode")),m.Cb(6),m.Ic(m.hc(15,22,"routes.material.bill")),m.Cb(4),m.lc("ngForOf",e.formGroup.controls.bill.value),m.Cb(1),m.lc("matChipInputFor",t)("matChipInputAddOnBlur",!0),m.Cb(4),m.Ic(m.hc(24,24,"routes.material.qs")),m.Cb(5),m.Ic(m.hc(29,26,"routes.material.enum.qs.ng")),m.Cb(3),m.Ic(m.hc(32,28,"routes.material.enum.qs.check")),m.Cb(2),m.lc("ngIf",!1),m.Cb(3),m.Ic(m.hc(37,30,"routes.material.remark")),m.Cb(5),m.Ic(m.hc(42,32,"routes.material.cell")),m.Cb(4),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(47,34,m.hc(48,36,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(51,38,m.hc(52,40,"shared.dialog.cancel")))}},directives:[l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,Xa.c,v.m,Xa.b,y.a,T.o,v.n,s.c,O.a,x.a,s.d,Xa.a,j.a,Xa.d],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.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}"]}),t})();function ii(t,e){if(1&t&&(m.Ub(0,"mat-option",29),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Kc("",t.name,"--",t.code,"")}}function ri(t,e){if(1&t&&(m.Ub(0,"mat-option",29),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Kc("",t.name,"--",t.code,"")}}function ni(t,e){if(1&t&&(m.Ub(0,"mat-option",29),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function ci(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",30),m.Fc(5,ni,2,2,"mat-option",4),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function li(t,e){if(1&t&&(m.Ub(0,"mat-option",29),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function si(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",33),m.Fc(1,li,2,2,"mat-option",4),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function ui(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",31),m.Fc(5,si,2,2,"mat-optgroup",32),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.ngout.area")),m.Cb(3),m.lc("ngForOf",t.area)}}let mi=(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.save=()=>Object(r.a)(this,void 0,void 0,function*(){for(var t=[],e=[],a=1;a<=this._formGroup.controls.quantity.value;a++)t.push(this._formGroup.controls.code.value.id),this._formGroup.controls.batch.value&&e.push(this._formGroup.controls.batch.value.code);this.loading=!0;var o={isAgv:this._formGroup.controls.isagv.value,slTarget:"1"==this._isagv?this._formGroup.controls.targetNo.value.code:"",postUser:""};void 0!==(yield this._httpService.post("tasks",{operation:"applyout",task:{transaction:"ApplyOut",warehouse:0,Materials:t,Batchs:e,destination:"1"==this._isagv?this._formGroup.controls.targetNo.value.remark:this._formGroup.controls.area.value.id,priority:0,manual:!1,Qc:this._formGroup.controls.qualityState.value,enable:!0,remark:this._formGroup.controls.remark.value,tag:JSON.stringify(o)}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}))&&this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.loading=!1}),this.reCheckBatch=()=>Object(r.a)(this,void 0,void 0,function*(){this._batchList=null,this._formGroup.controls.batch.setValue(null),this._httpService.get("stocks/batch?material="+this._formGroup.controls.code.value.id).then(t=>{this._batchList=t.items})}),this.reGoods=()=>Object(r.a)(this,void 0,void 0,function*(){this._material=null,this._formGroup.controls.code.setValue(null),this._httpService.get("materials?category="+this._formGroup.controls.cat.value.id).then(t=>{this._material=t.items})}),this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=hiLineCode"),this._httpService.get("materials/goodsCategories")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"ZCQ"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._formGroup.controls.area.setValue(t[1].items[0].id),this._items=t[2].items,this._catList=t[3].filter(t=>1==t.parent)}),this._formGroup=this._formBuilder.group({cathode:[null],anode:[null],code:[null,[l.u.required]],batch:[null],area:[null],quantity:["1",[l.u.required]],isagv:["1"],targetNo:[null],qualityState:["ng"],remark:[null],cat:[null]})}ngOnInit(){this._isagv=this._formGroup.controls.isagv.value}get formGroup(){return this._formGroup}get catList(){return this._catList}get material(){return this._material}get batchList(){return this._batchList}get area(){return this._area}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app--stock-ngout"]],decls:82,vars:52,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["formControlName","cat",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["formControlName","code","required","",3,"selectionChange"],["formControlName","quantity","required",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["value","6"],["value","7"],["value","8"],["value","9"],["value","10"],["formControlName","qualityState"],["value","ng"],["value","check"],["matInput","","formControlName","remark"],[1,"example-section"],["formControlName","isagv",3,"ngModel","ngModelChange"],["value","1",1,"example-margin"],["value","0",1,"example-margin"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"value"],["formControlName","targetNo"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"mat-select",3),m.bc("selectionChange",function(){return e.reGoods()}),m.Fc(11,ii,2,3,"mat-option",4),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-select",5),m.bc("selectionChange",function(){return e.reCheckBatch()}),m.Fc(17,ri,2,3,"mat-option",4),m.Tb(),m.Tb(),m.Ub(18,"mat-form-field"),m.Ub(19,"mat-label"),m.Hc(20),m.gc(21,"translate"),m.Tb(),m.Ub(22,"mat-select",6),m.Ub(23,"mat-option",7),m.Hc(24,"1"),m.Tb(),m.Ub(25,"mat-option",8),m.Hc(26,"2"),m.Tb(),m.Ub(27,"mat-option",9),m.Hc(28,"3"),m.Tb(),m.Ub(29,"mat-option",10),m.Hc(30,"4"),m.Tb(),m.Ub(31,"mat-option",11),m.Hc(32,"5"),m.Tb(),m.Ub(33,"mat-option",12),m.Hc(34,"6"),m.Tb(),m.Ub(35,"mat-option",13),m.Hc(36,"7"),m.Tb(),m.Ub(37,"mat-option",14),m.Hc(38,"8"),m.Tb(),m.Ub(39,"mat-option",15),m.Hc(40,"9"),m.Tb(),m.Ub(41,"mat-option",16),m.Hc(42,"10"),m.Tb(),m.Tb(),m.Tb(),m.Ub(43,"mat-form-field"),m.Ub(44,"mat-label"),m.Hc(45),m.gc(46,"translate"),m.Tb(),m.Ub(47,"mat-select",17),m.Pb(48,"mat-option"),m.Ub(49,"mat-option",18),m.Hc(50),m.gc(51,"translate"),m.Tb(),m.Ub(52,"mat-option",19),m.Hc(53),m.gc(54,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Ub(55,"mat-form-field"),m.Ub(56,"mat-label"),m.Hc(57),m.gc(58,"translate"),m.Tb(),m.Pb(59,"input",20),m.Tb(),m.Ub(60,"section",21),m.Ub(61,"mat-label"),m.Hc(62),m.gc(63,"translate"),m.Tb(),m.Ub(64,"mat-radio-group",22),m.bc("ngModelChange",function(t){return e.isagv=t}),m.Ub(65,"mat-radio-button",23),m.Hc(66),m.gc(67,"translate"),m.Tb(),m.Ub(68,"mat-radio-button",24),m.Hc(69),m.gc(70,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Fc(71,ci,6,4,"mat-form-field",25),m.Fc(72,ui,6,4,"mat-form-field",25),m.Tb(),m.Ub(73,"div",26),m.Ub(74,"button",27),m.bc("click",function(){return e.save()}),m.Hc(75),m.gc(76,"uppercase"),m.gc(77,"translate"),m.Tb(),m.Ub(78,"button",28),m.Hc(79),m.gc(80,"uppercase"),m.gc(81,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,22,"routes.stock.ngout.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,24,"routes.material.cat")),m.Cb(3),m.lc("ngForOf",e.catList),m.Cb(3),m.Ic(m.hc(15,26,"routes.material.code")),m.Cb(3),m.lc("ngForOf",e.material),m.Cb(3),m.Ic(m.hc(21,28,"routes.stock.ngout.qty")),m.Cb(25),m.Ic(m.hc(46,30,"routes.material.qs")),m.Cb(5),m.Ic(m.hc(51,32,"routes.material.enum.qs.ng")),m.Cb(3),m.Ic(m.hc(54,34,"routes.material.enum.qs.check")),m.Cb(4),m.Ic(m.hc(58,36,"routes.material.remark")),m.Cb(5),m.Ic(m.hc(63,38,"routes.stock.apply-out.isAGV")),m.Cb(2),m.lc("ngModel",e.isagv),m.Cb(2),m.Ic(m.hc(67,40,"routes.material.enum.isAGV.use")),m.Cb(3),m.Ic(m.hc(70,42,"routes.material.enum.isAGV.unuse")),m.Cb(2),m.lc("ngIf","1"==e.isagv),m.Cb(1),m.lc("ngIf","0"==e.isagv),m.Cb(2),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(76,44,m.hc(77,46,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(80,48,m.hc(81,50,"shared.dialog.cancel"))))},directives:[l.v,l.o,l.g,h.b,h.e,y.a,l.n,l.f,v.m,l.t,T.o,f.b,l.c,lo.c,lo.b,v.n,s.c,O.a,x.a,s.d,T.n],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.mat-form-field[_ngcontent-%COMP%]{width:100%}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})();const bi=["barcodeInput"],di=["billInput"];function pi(t,e){if(1&t){const t=m.Vb();m.Ub(0,"mat-chip",22),m.bc("removed",function(){m.wc(t);const a=e.index;return m.fc().bill.remove(a)}),m.Hc(1),m.Ub(2,"mat-icon",23),m.Hc(3,"cancel"),m.Tb(),m.Tb()}if(2&t){const t=e.$implicit;m.Cb(1),m.Jc(" ",t," ")}}function hi(t,e){1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",24,25),m.Pb(6,"mat-option"),m.Ub(7,"mat-option",26),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"mat-option",27),m.Hc(11),m.gc(12,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,3,"routes.material.enabled")),m.Cb(6),m.Ic(m.hc(9,5,"routes.material.enum.enabled.true")),m.Cb(3),m.Ic(m.hc(12,7,"routes.material.enum.enabled.false")))}function fi(t,e){if(1&t&&(m.Ub(0,"mat-option",30),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function gi(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",28),m.Fc(5,fi,2,2,"mat-option",29),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.targetNo")),m.Cb(3),m.lc("ngForOf",t.items)}}function vi(t,e){if(1&t&&(m.Ub(0,"mat-option",30),m.Hc(1),m.Tb()),2&t){const t=e.$implicit;m.lc("value",t),m.Cb(1),m.Ic(t.name)}}function _i(t,e){if(1&t&&(m.Ub(0,"mat-optgroup",33),m.Fc(1,vi,2,2,"mat-option",29),m.Tb()),2&t){const t=e.$implicit;m.lc("label",t.name),m.Cb(1),m.lc("ngForOf",t.area)}}function Ci(t,e){if(1&t&&(m.Ub(0,"mat-form-field"),m.Ub(1,"mat-label"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"mat-select",31),m.Fc(5,_i,2,2,"mat-optgroup",32),m.Tb(),m.Tb()),2&t){const t=m.fc();m.Cb(2),m.Ic(m.hc(3,2,"routes.stock.apply-out.area")),m.Cb(3),m.lc("ngForOf",t.area)}}const yi=function(){return[2,2,2]},Ti=function(t){return{delimiter:"-",blocks:t}},Oi=[{path:"inbound",component:mt},{path:"outbound",component:Rt},{path:"combine",component:le},{path:"palletize",component:qe},{path:"depalletize",component:De},{path:"block",component:Za},{path:"inventory",component:Oa},{path:"scaninbound",component:co},{path:"apply-out",component:vo},{path:"pallet-in",component:Co},{path:"pallet-out",component:Qo},{path:"applyin",component:Xo},{path:"ngin",component:oi},{path:"ngbypass",component:(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.loading=!1,this.lines=[],this.bill={append:t=>{const e=this._formGroup.controls.bill;t.input.value&&(e.value.length<2?t.value&&!e.value.includes(t.value)&&(this._formGroup.controls.batch.value||this._formGroup.controls.batch.setValue(t.value.split("-")[0]),e.value.push(t.value),e.updateValueAndValidity()):this._toastService.show("\u6dfb\u52a0\u5931\u8d25\uff0c\u539f\u56e0\uff1a\u6807\u8bc6\u7801\u7801\u6570\u91cf\u6700\u591a2\u4e2a")),t.input.value=null},remove:t=>{const e=this._formGroup.controls.bill;e.value.splice(t,1),e.updateValueAndValidity(),this._formGroup.controls.batch.setValue(null),this._formGroup.controls.bill.value.forEach(t=>{this._formGroup.controls.batch.setValue(t.split("-")[0])})}},this.save=()=>Object(r.a)(this,void 0,void 0,function*(){const t=this._formGroup.controls.barcode.value;if(t){let i=yield this._httpService.get("stocks?barcode="+t);if(null==i?void 0:i.items[0])this._toastService.show("\u8f7d\u5177\u5df2\u5b58\u5728,\u8bf7\u68c0\u67e5");else{this.lines=[];var e=19;"W1JPB"==this._formGroup.controls.barcode.value.substr(0,5)&&(e=18),"M2C"==this._formGroup.controls.barcode.value.substr(0,5)&&(e=18),"1"==this._isagv&&""==this._formGroup.controls.targetNo.value.code&&("W1JPA"==this._formGroup.controls.barcode.value.substr(0,5)||"M2C"==this._formGroup.controls.barcode.value.substr(0,5)?this._formGroup.controls.targetNo.setValue({code:"",name:"\u4e00\u697c\u5f02\u5e38",remark:2}):this._formGroup.controls.targetNo.setValue({code:"",name:"\u4e00\u697c\u5f02\u5e38",remark:7})),this._formGroup.controls.bill.value.forEach(t=>{this.lines.push({material:e,bill:t,quantity:this._formGroup.controls.quantity.value,batch:t.split("-")[0],supplier:this._formGroup.controls.supplier.value,manufacturingDate:this._formGroup.controls.manufacturingDate.value,qualityState:this._formGroup.controls.qualityState.value,enabled:this._formGroup.controls.enabled.value,remark:this._formGroup.controls.remark.value,IS_LOCAL:"1"})}),this.loading=!0;var a={Transaction:"bypass",isAgv:this._formGroup.controls.isagv.value,slTarget:"1"==this._isagv?this._formGroup.controls.targetNo.value.code:"",postUser:"",BypassArea:"1"==this._isagv?this._formGroup.controls.targetNo.value.remark:this._formGroup.controls.area.value.id},o=11e4;"W1JPB"==this._formGroup.controls.barcode.value.substr(0,5)&&(o=21e4),"M2A"==this._formGroup.controls.barcode.value.substr(0,5)&&(o=21e4),i=yield this._httpService.post("stocks",{operation:"scanInbound",barcode:t,destination:o,full:2==this.lines.length,stock:{barcode:t,lines:this.lines,tag:JSON.stringify(a)}}).catch(t=>{var e;this._toastService.show((null===(e=t.error)||void 0===e?void 0:e.errorMessage)||"\u672a\u77e5\u9519\u8bef")}),void 0!==i&&(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()),this.loading=!1}}}),this.scan={billfocus:t=>{this.billInput.nativeElement.focus()}},this._httpService.join(this._httpService.get("warehouses"),this._httpService.get("areas"),this._httpService.get("items?name=hiLineCode")).then(t=>{const e=Object(H.a)(t[1].items.filter(t=>"ZCQ"==t.type),"warehouse");this._area=t[0].items.filter(t=>!!e[t.id]&&(t.area=e[t.id],!0)),1==this._area.length&&1==t[1].total&&this._formGroup.controls.area.setValue(t[1].items[0].id),this._items=t[2].items,this._items.push({code:"",name:"\u4e00\u697c\u5f02\u5e38",remark:0})}),this._formGroup=this._formBuilder.group({barcode:[null,[l.u.required]],bill:[[],[l.u.required]],quantity:[1],batch:[null],supplier:[null],manufacturingDate:[null],qualityState:["ng"],enabled:["true"],remark:[null],isagv:["1"],targetNo:[null],area:[null]})}ngOnInit(){this._isagv=this._formGroup.controls.isagv.value}ngAfterViewInit(){setTimeout(()=>{this.loading=!1,this.barcodeInput.nativeElement.focus()},100)}get formGroup(){return this._formGroup}get area(){return this._area}get items(){return this._items}get isagv(){return this._isagv}set isagv(t){this._isagv=t}refresh(){this._formGroup.controls.barcode.setValue(null),this._formGroup.controls.bill.setValue([])}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-ngbypass"]],viewQuery:function(t,e){if(1&t&&(m.Oc(bi,!0),m.Oc(di,!0)),2&t){let t;m.tc(t=m.cc())&&(e.barcodeInput=t.first),m.tc(t=m.cc())&&(e.billInput=t.first)}},decls:61,vars:51,consts:[[1,"grid"],["autocomplete","off",3,"formGroup"],["form",""],["matInput","","formControlName","barcode","required","",3,"keydown.enter"],["barcodeInput",""],["formControlName","bill","required",""],["$chip",""],[3,"removed",4,"ngFor","ngForOf"],[3,"matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["billInput",""],["formControlName","qualityState"],["value","ng"],["value","check"],[4,"ngIf"],["matInput","","formControlName","remark"],[1,"example-section"],["formControlName","isagv",3,"ngModel","ngModelChange"],["value","1",1,"example-margin"],["value","0",1,"example-margin"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","loading","click"],["mat-button","","mat-dialog-close","",3,"loading"],[3,"removed"],["matChipRemove",""],["formControlName","enabled"],["$enabled",""],["value","true"],["value","false"],["formControlName","targetNo"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","area"],[3,"label",4,"ngFor","ngForOf"],[3,"label"]],template:function(t,e){if(1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2"),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",1,2),m.Ub(6,"mat-form-field"),m.Ub(7,"mat-label"),m.Hc(8),m.gc(9,"translate"),m.Tb(),m.Ub(10,"input",3,4),m.bc("keydown.enter",function(t){return e.scan.billfocus(t)}),m.Tb(),m.Tb(),m.Ub(12,"mat-form-field"),m.Ub(13,"mat-label"),m.Hc(14),m.gc(15,"translate"),m.Tb(),m.Ub(16,"mat-chip-list",5,6),m.Fc(18,pi,4,1,"mat-chip",7),m.Ub(19,"input",8,9),m.bc("matChipInputTokenEnd",function(t){return e.bill.append(t)}),m.Tb(),m.Tb(),m.Tb(),m.Ub(21,"mat-form-field"),m.Ub(22,"mat-label"),m.Hc(23),m.gc(24,"translate"),m.Tb(),m.Ub(25,"mat-select",10),m.Pb(26,"mat-option"),m.Ub(27,"mat-option",11),m.Hc(28),m.gc(29,"translate"),m.Tb(),m.Ub(30,"mat-option",12),m.Hc(31),m.gc(32,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Fc(33,hi,13,9,"mat-form-field",13),m.Ub(34,"mat-form-field"),m.Ub(35,"mat-label"),m.Hc(36),m.gc(37,"translate"),m.Tb(),m.Pb(38,"input",14),m.Tb(),m.Ub(39,"section",15),m.Ub(40,"mat-label"),m.Hc(41),m.gc(42,"translate"),m.Tb(),m.Ub(43,"mat-radio-group",16),m.bc("ngModelChange",function(t){return e.isagv=t}),m.Ub(44,"mat-radio-button",17),m.Hc(45),m.gc(46,"translate"),m.Tb(),m.Ub(47,"mat-radio-button",18),m.Hc(48),m.gc(49,"translate"),m.Tb(),m.Tb(),m.Tb(),m.Fc(50,gi,6,4,"mat-form-field",13),m.Fc(51,Ci,6,4,"mat-form-field",13),m.Tb(),m.Ub(52,"div",19),m.Ub(53,"button",20),m.bc("click",function(){return e.save()}),m.Hc(54),m.gc(55,"uppercase"),m.gc(56,"translate"),m.Tb(),m.Ub(57,"button",21),m.Hc(58),m.gc(59,"uppercase"),m.gc(60,"translate"),m.Tb(),m.Tb(),m.Tb()),2&t){const t=m.uc(17);m.Cb(2),m.Ic(m.hc(3,23,"routes.stock.ngbypass.title")),m.Cb(2),m.lc("formGroup",e.formGroup),m.Cb(4),m.Ic(m.hc(9,25,"routes.stock.ngin.barcode")),m.Cb(6),m.Ic(m.hc(15,27,"routes.material.bill")),m.Cb(4),m.lc("ngForOf",e.formGroup.controls.bill.value),m.Cb(1),m.lc("matChipInputFor",t)("matChipInputAddOnBlur",!0),m.Cb(4),m.Ic(m.hc(24,29,"routes.material.qs")),m.Cb(5),m.Ic(m.hc(29,31,"routes.material.enum.qs.ng")),m.Cb(3),m.Ic(m.hc(32,33,"routes.material.enum.qs.check")),m.Cb(2),m.lc("ngIf",!1),m.Cb(3),m.Ic(m.hc(37,35,"routes.material.remark")),m.Cb(5),m.Ic(m.hc(42,37,"routes.stock.apply-out.isAGV")),m.Cb(2),m.lc("ngModel",e.isagv),m.Cb(2),m.Ic(m.hc(46,39,"routes.material.enum.isAGV.use")),m.Cb(3),m.Ic(m.hc(49,41,"routes.material.enum.isAGV.unuse")),m.Cb(2),m.lc("ngIf","1"==e.isagv),m.Cb(1),m.lc("ngIf","0"==e.isagv),m.Cb(2),m.lc("disabled",e.formGroup.invalid)("loading",e.loading),m.Cb(1),m.Ic(m.hc(55,43,m.hc(56,45,"shared.dialog.ok"))),m.Cb(3),m.lc("loading",e.loading),m.Cb(1),m.Ic(m.hc(59,47,m.hc(60,49,"shared.dialog.cancel")))}},directives:[l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,l.t,Xa.c,v.m,Xa.b,y.a,T.o,v.n,lo.c,lo.b,s.c,O.a,x.a,s.d,Xa.a,j.a,Xa.d,T.n],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.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}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})()},{path:"ngout",component:mi},{path:"assign-in",component:(()=>{class t{constructor(t,e,a,o){this._formBuilder=t,this._httpService=e,this._i18nService=a,this._toastService=o,this.save=()=>Object(r.a)(this,void 0,void 0,function*(){let t=yield this._httpService.get("cells?name="+this._form.controls.cell.value);if(t.total){var e=t.items[0];"Enabled"==e.task&&"Empty"==e.store?(this._toastService.show("\u64cd\u4f5c\u6210\u529f"),this.refresh()):("Enabled"!=e.task&&this._toastService.show("\u8d27\u4f4d\u72b6\u6001\u4e0d\u53ef\u7528\uff0c\u8bf7\u9009\u62e9\u5176\u5b83\u8d27\u4f4d"),"Empty"!=e.store&&this._toastService.show("\u8d27\u4f4d\u5df2\u88ab\u4f7f\u7528\uff0c\u8bf7\u9009\u62e9\u5176\u5b83\u8d27\u4f4d"))}else this._toastService.show("\u8d27\u4f4d\u4e0d\u5b58\u5728\uff0c\u8bf7\u6b63\u786e\u586b\u5199\u8d27\u4f4d\u7f16\u7801")}),this._form=this._formBuilder.group({barcode:[null,[l.u.required]],cell:[null,[l.u.required]]})}get form(){return this._form}refresh(){this._form.controls.barcode.setValue(null),this._form.controls.cell.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(m.Ob(l.d),m.Ob(b.a),m.Ob(d.a),m.Ob(p.a))},t.\u0275cmp=m.Ib({type:t,selectors:[["app-assign-in"]],decls:24,vars:25,consts:[[1,"grid"],["mat-dialog-title",""],["autocomplete","off",3,"formGroup"],["matInput","","formControlName","barcode"],["matInput","","formControlName","cell",3,"cleave"],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"disabled","click"],["mat-button","","mat-dialog-close",""]],template:function(t,e){1&t&&(m.Ub(0,"div",0),m.Ub(1,"h2",1),m.Hc(2),m.gc(3,"translate"),m.Tb(),m.Ub(4,"form",2),m.Ub(5,"mat-form-field"),m.Ub(6,"mat-label"),m.Hc(7),m.gc(8,"translate"),m.Tb(),m.Pb(9,"input",3),m.Tb(),m.Ub(10,"mat-form-field"),m.Ub(11,"mat-label"),m.Hc(12),m.gc(13,"translate"),m.Tb(),m.Pb(14,"input",4),m.Tb(),m.Tb(),m.Tb(),m.Ub(15,"div",5),m.Ub(16,"button",6),m.bc("click",function(){return e.save()}),m.Hc(17),m.gc(18,"uppercase"),m.gc(19,"translate"),m.Tb(),m.Ub(20,"button",7),m.Hc(21),m.gc(22,"uppercase"),m.gc(23,"translate"),m.Tb(),m.Tb()),2&t&&(m.Cb(2),m.Ic(m.hc(3,8,"routes.stock.assign-in.title")),m.Cb(2),m.lc("formGroup",e.form),m.Cb(3),m.Ic(m.hc(8,10,"routes.stock.assign-in.barcode")),m.Cb(5),m.Ic(m.hc(13,12,"routes.stock.assign-in.cell")),m.Cb(2),m.lc("cleave",m.pc(23,Ti,m.oc(22,yi))),m.Cb(2),m.lc("disabled",e.form.invalid),m.Cb(1),m.Ic(m.hc(18,14,m.hc(19,16,"shared.dialog.ok"))),m.Cb(4),m.Ic(m.hc(22,18,m.hc(23,20,"shared.dialog.cancel"))))},directives:[s.h,l.v,l.o,l.g,h.b,h.e,f.b,l.c,l.n,l.f,C.a,s.c,O.a,s.d],pipes:[U.d,v.v],styles:[".grid[_ngcontent-%COMP%]{margin-top:10px;margin-left:20px;margin-right:20px}.mat-form-field[_ngcontent-%COMP%]{width:100%}.example-section[_ngcontent-%COMP%]{display:flex;align-content:center;align-items:center;height:60px}.example-margin[_ngcontent-%COMP%]{margin:0 10px}"]}),t})()}];let Ui=(()=>{class t{}return t.\u0275mod=m.Mb({type:t}),t.\u0275inj=m.Lb({factory:function(e){return new(e||t)},imports:[[i.h.forChild(Oi)],i.h]}),t})();var ki=a("95ze");let Si=(()=>{class t{}return t.\u0275mod=m.Mb({type:t}),t.\u0275inj=m.Lb({factory:function(e){return new(e||t)},imports:[[o.a,Ui,ki.a]]}),t})()}}]);
|