cmc_fe/dist/js/553.fb74f1fb.js

2 lines
No EOL
12 KiB
JavaScript

"use strict";(self["webpackChunkcmc_fe"]=self["webpackChunkcmc_fe"]||[]).push([[553],{6553:function(e,l,t){t.r(l),t.d(l,{default:function(){return T}});var o=t(3396),a=t(7139),i=t(7312),r=t(6824),n=t(8521),s=t(3289),u=t(3173),d=t(7325),c=t(2718),m=t(4544),v=t(2465),p=t(5180),f=t(489),h=t(4231),y=t(1138),g=t(7041),C=t(2370),_=t(320),w=t(4870);const b=(0,_.a)({name:"VSheet",props:{color:String,...(0,c.m)(),...(0,m.x)(),...(0,v.c)(),...(0,p.y)(),...(0,f.F)(),...(0,h.I)(),...(0,y.Q)(),...(0,g.x$)()},setup(e,l){let{slots:t}=l;const{themeClasses:a}=(0,g.ER)(e),{backgroundColorClasses:i,backgroundColorStyles:r}=(0,C.Y5)((0,w.Vh)(e,"color")),{borderClasses:n}=(0,c.P)(e),{dimensionStyles:s}=(0,m.$)(e),{elevationClasses:u}=(0,v.Y)(e),{locationStyles:d}=(0,p.T)(e),{positionClasses:y}=(0,f.K)(e),{roundedClasses:_}=(0,h.b)(e);return()=>(0,o.Wm)(e.tag,{class:["v-sheet",a.value,i.value,n.value,u.value,y.value,_.value],style:[r.value,s.value,d.value]},t)}});var V=t(3104),S=t(165);const k=(0,o._)("h3",null,"Sales Orders Printed",-1),W=(0,o._)("br",null,null,-1),P=(0,o._)("br",null,null,-1),F=["alt","title"],x=["alt","title"],D={key:2},O=["alt","title"],U=(0,o._)("img",{class:"icon",malt:"Print Confirmed",title:"Print Confirmed",src:"/images/icons/printedconfirm.png"},null,-1),z=["textContent"];function B(e,l,t,c,m,v){const p=(0,o.up)("RecycleScroller");return(0,o.wg)(),(0,o.iD)(o.HY,null,[k,(0,o.Wm)(r.o,null,{default:(0,o.w5)((()=>[(0,o.Wm)(n.D,{cols:"6",sm:"6",md:"6"},{default:(0,o.w5)((()=>[(0,o.Wm)(S.hw,{clearable:"",label:"Search",variant:"outlined",modelValue:m.searchQuery,"onUpdate:modelValue":l[0]||(l[0]=e=>m.searchQuery=e),density:"compact","append-inner-icon":"mdi-magnify"},null,8,["modelValue"])])),_:1}),(0,o.Wm)(n.D,{cols:"6",sm:"6",md:"4"},{default:(0,o.w5)((()=>[(0,o.Wm)(i.T,{color:"blue",onClick:v.getSalesOrdersPrinted},{default:(0,o.w5)((()=>[(0,o.Uk)("Search")])),_:1},8,["onClick"]),(0,o.Wm)(V.G,{modelValue:m.onlyNotPrinted,"onUpdate:modelValue":l[1]||(l[1]=e=>m.onlyNotPrinted=e),color:"blue",label:"Show Only NOT Printed"},null,8,["modelValue"])])),_:1})])),_:1}),(0,o.Wm)(r.o,null,{default:(0,o.w5)((()=>[(0,o.Wm)(n.D,{cols:"8",xs:"12",sm:"12",md:"8"},{default:(0,o.w5)((()=>[(0,o.Wm)(b,{class:"lastrefresh"},{default:(0,o.w5)((()=>[(0,o.Uk)("Last Refreshed : "+(0,a.zw)(m.last_refresh),1)])),_:1}),W,(0,o.Wm)(d.K,{indeterminate:"",color:"blue",active:m.loading},null,8,["active"]),(0,o.Wm)(p,{class:"scroller",items:v.sopFilteredOrders,"item-size":100,"key-field":"id"},{default:(0,o.w5)((({item:l})=>[(0,o.Wm)(r.o,{class:"item"},{default:(0,o.w5)((()=>[(0,o.Wm)(n.D,{cols:"6"},{default:(0,o.w5)((()=>[(0,o._)("h4",null,"Sales Order : "+(0,a.zw)(l.doc_no),1),(0,o.Uk)(" "+(0,a.zw)(e.formatDate(l.doc_date,"DD/MM/YYYY")),1),P,(0,o.Uk)(" "+(0,a.zw)(l.customer.acc_no)+" - "+(0,a.zw)(l.customer.name),1)])),_:2},1024),(0,o.Wm)(n.D,{cols:"1"},{default:(0,o.w5)((()=>["Completed"==l.doc_status?((0,o.wg)(),(0,o.iD)("img",{key:0,class:"icon",alt:l.doc_status,title:l.doc_status,src:"/images/icons/Completed.png"},null,8,F)):"Live"==l.doc_status?((0,o.wg)(),(0,o.iD)("img",{key:1,class:"icon",alt:l.doc_status,title:l.doc_status,src:"/images/icons/Live.png"},null,8,x)):((0,o.wg)(),(0,o.iD)("span",D,(0,a.zw)(l.doc_status),1))])),_:2},1024),(0,o.Wm)(n.D,{cols:"2"},{default:(0,o.w5)((()=>["Printed"==l.print_status?((0,o.wg)(),(0,o.iD)("img",{key:0,class:"icon",alt:l.print_status,title:l.print_status,src:"/images/icons/printed.png"},null,8,O)):(0,o.kq)("",!0)])),_:2},1024),(0,o.Wm)(n.D,{cols:"3"},{default:(0,o.w5)((()=>["Printed"!=l.print_status||l.confirmprinted?1==l.confirmprinted?((0,o.wg)(),(0,o.iD)(o.HY,{key:1},[U,"Unknown"!=l.confirmedby?((0,o.wg)(),(0,o.iD)("sup",{key:0,textContent:(0,a.zw)(l.confirmedby)},null,8,z)):(0,o.kq)("",!0),(0,o.Wm)(i.T,{color:"error",variant:"plain",icon:"",size:"x-small",onClick:e=>v.setSOPPrintedStatus(l,!1),title:"Un-confirm print status"},{default:(0,o.w5)((()=>[(0,o.Wm)(s.t,null,{default:(0,o.w5)((()=>[(0,o.Uk)("mdi-minus-box")])),_:1})])),_:2},1032,["onClick"])],64)):(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(i.T,{key:0,size:"small",color:"blue",onClick:e=>v.setSOPPrintedStatus(l,!0)},{default:(0,o.w5)((()=>[(0,o.Uk)("Confirm Printed")])),_:2},1032,["onClick"])),-1==l.confirmprinted?((0,o.wg)(),(0,o.j4)(u.L,{key:2,indeterminate:""})):(0,o.kq)("",!0)])),_:2},1024)])),_:2},1024)])),_:1},8,["items"])])),_:1})])),_:1})],64)}t(7658);var L=t(6943),q=t(7585),I={props:{site_info:{},user_info:{},query:String},data(){return{searchQuery:this.query,onlyNotPrinted:!1,orders:[],hasList:!1,loading:!0,loaded:!1,last_refresh:"",limit:100}},computed:{sopFilteredOrders(){this.hasList||this.getSalesOrdersPrinted();let e=this.searchQuery.toLowerCase(),l=this.orders.filter((l=>l.customer.name.toLowerCase().includes(e)||l.customer.acc_no.includes(e)||l.doc_no.toString().includes(e)));return this.onlyNotPrinted&&(l=l.filter((e=>1!=e.confirmprinted))),l}},mixins:[q.Z],methods:{async viewMoreRecords(){this.limit+=100,this.getSalesOrdersPrinted()},async getSalesOrdersPrinted(){if(this.limit>2e3)return void this.errors.push("Maximum 2000 orders : "+this.limit+" is too high");this.searchQuery||(this.searchQuery=""),this.loading=!0;let e=this.$api_url+"/sales-orders/printed";console.log("Getting Sales Orders Printed..."),console.log({limit:this.limit,query:this.searchQuery}),L.Z.get(e,{params:{limit:this.limit,query:this.searchQuery}}).then((e=>{this.orders=e.data,this.loading=!1,this.hasList=!0,this.last_refresh=this.getTimeNow()})).catch((e=>{console.log(e)}))},async setSOPPrintedStatus(e,l){e.confirmprinted=-1;let t=this.$api_url+"/sales-orders/setconfirmprinted";L.Z.post(t,{confirmprinted:l,id:e.id}).then((l=>{e.confirmprinted=l.data.confirmed})).catch((l=>{console.log("Error Setting Sales Order Printed Status..."+l),e.confirmprinted=0}))}},mounted(){setInterval((()=>{this.getSalesOrdersPrinted()}),3e5)}},A=t(89);const Q=(0,A.Z)(I,[["render",B]]);var T=Q},6193:function(e,l,t){t.d(l,{g5:function(){return S},fU:function(){return k},$9:function(){return b}});var o=t(3396),a=t(3289),i=t(7302),r=t(4960),n=t(9694),s=t(7041),u=t(8434),d=t(8717),c=t(4870),m=t(3766),v=t(131),p=t(320),f=t(7514),h=t(9888);const y=Symbol.for("vuetify:selection-control-group"),g=(0,m.U)({color:String,disabled:Boolean,error:Boolean,id:String,inline:Boolean,falseIcon:r.lE,trueIcon:r.lE,ripple:{type:Boolean,default:!0},multiple:{type:Boolean,default:null},name:String,readonly:Boolean,modelValue:null,type:String,valueComparator:{type:Function,default:v.vZ},...(0,s.x$)(),...(0,n.f)()},"v-selection-control-group");(0,p.a)({name:"VSelectionControlGroup",props:{defaultsTarget:{type:String,default:"VSelectionControl"},...g()},emits:{"update:modelValue":e=>!0},setup(e,l){let{slots:t}=l;const a=(0,d.z)(e,"modelValue"),i=(0,f.sq)(),r=(0,o.Fl)((()=>e.id||`v-selection-control-group-${i}`)),n=(0,o.Fl)((()=>e.name||r.value));return(0,o.JJ)(y,{modelValue:a}),(0,u.AF)({[e.defaultsTarget]:{color:(0,c.Vh)(e,"color"),disabled:(0,c.Vh)(e,"disabled"),density:(0,c.Vh)(e,"density"),error:(0,c.Vh)(e,"error"),inline:(0,c.Vh)(e,"inline"),modelValue:a,multiple:(0,o.Fl)((()=>!!e.multiple||null==e.multiple&&Array.isArray(a.value))),name:n,falseIcon:(0,c.Vh)(e,"falseIcon"),trueIcon:(0,c.Vh)(e,"trueIcon"),readonly:(0,c.Vh)(e,"readonly"),ripple:(0,c.Vh)(e,"ripple"),type:(0,c.Vh)(e,"type"),valueComparator:(0,c.Vh)(e,"valueComparator")}}),(0,h.L)((()=>{var l;return(0,o.Wm)("div",{class:["v-selection-control-group",{"v-selection-control-group--inline":e.inline}],"aria-labelled-by":"radio"===e.type?r.value:void 0,role:"radio"===e.type?"radiogroup":void 0},[null==(l=t.default)?void 0:l.call(t)])})),{}}});var C=t(3824),_=t(2370),w=t(2385);const b=(0,m.U)({label:String,trueValue:null,falseValue:null,value:null,...g()},"v-selection-control");function V(e){const l=(0,o.f3)(y,void 0),{densityClasses:t}=(0,n.t)(e),a=(0,d.z)(e,"modelValue"),i=(0,o.Fl)((()=>void 0!==e.trueValue?e.trueValue:void 0===e.value||e.value)),r=(0,o.Fl)((()=>void 0!==e.falseValue&&e.falseValue)),s=(0,o.Fl)((()=>!!e.multiple||null==e.multiple&&Array.isArray(a.value))),u=(0,o.Fl)({get(){const t=l?l.modelValue.value:a.value;return s.value?t.some((l=>e.valueComparator(l,i.value))):e.valueComparator(t,i.value)},set(t){if(e.readonly)return;const o=t?i.value:r.value;let n=o;s.value&&(n=t?[...(0,v.FT)(a.value),o]:(0,v.FT)(a.value).filter((l=>!e.valueComparator(l,i.value)))),l?l.modelValue.value=n:a.value=n}}),{textColorClasses:c,textColorStyles:m}=(0,_.rY)((0,o.Fl)((()=>!u.value||e.error||e.disabled?void 0:e.color))),p=(0,o.Fl)((()=>u.value?e.trueIcon:e.falseIcon));return{group:l,densityClasses:t,trueValue:i,falseValue:r,model:u,textColorClasses:c,textColorStyles:m,icon:p}}const S=(0,p.e)()({name:"VSelectionControl",directives:{Ripple:C.H},inheritAttrs:!1,props:b(),emits:{"update:modelValue":e=>!0},setup(e,l){let{attrs:t,slots:r}=l;const{densityClasses:n,icon:s,model:u,textColorClasses:d,textColorStyles:m,trueValue:p}=V(e),y=(0,f.sq)(),g=(0,o.Fl)((()=>e.id||`input-${y}`)),C=(0,c.iH)(!1),_=(0,c.iH)(!1),b=(0,c.iH)();function S(e){C.value=!0,(!w.Z1||w.Z1&&e.target.matches(":focus-visible"))&&(_.value=!0)}function k(){C.value=!1,_.value=!1}function W(e){u.value=e.target.checked}return(0,h.L)((()=>{var l,c;const f=r.label?r.label({label:e.label,props:{for:g.value}}):e.label,[h,y]=(0,v.An)(t);return(0,o.Wm)("div",(0,o.dG)({class:["v-selection-control",{"v-selection-control--dirty":u.value,"v-selection-control--disabled":e.disabled,"v-selection-control--error":e.error,"v-selection-control--focused":C.value,"v-selection-control--focus-visible":_.value,"v-selection-control--inline":e.inline},n.value]},h),[(0,o.Wm)("div",{class:["v-selection-control__wrapper",d.value],style:m.value},[null==(l=r.default)?void 0:l.call(r),(0,o.wy)((0,o.Wm)("div",{class:["v-selection-control__input"]},[s.value&&(0,o.Wm)(a.t,{key:"icon",icon:s.value},null),(0,o.Wm)("input",(0,o.dG)({ref:b,checked:u.value,disabled:e.disabled,id:g.value,onBlur:k,onFocus:S,onInput:W,"aria-readonly":e.readonly,type:e.type,value:p.value,name:e.name,"aria-checked":"checkbox"===e.type?u.value:void 0},y),null),null==(c=r.input)?void 0:c.call(r,{model:u,textColorClasses:d,textColorStyles:m,props:{onFocus:S,onBlur:k,id:g.value}})]),[[(0,o.Q2)("ripple"),e.ripple&&[!e.disabled&&!e.readonly,null,["center","circle"]]]])]),f&&(0,o.Wm)(i.J,{for:g.value,clickable:!0},{default:()=>[f]})])})),{isFocused:C,input:b}}});function k(e){return(0,v.ei)(e,Object.keys(S.props))}},3104:function(e,l,t){t.d(l,{G:function(){return f}});var o=t(3396),a=t(6193),i=t(8302),r=t(3173),n=t(1710),s=t(8969),u=t(8717),d=t(4870),c=t(320),m=t(7514),v=t(9888),p=t(131);const f=(0,c.a)({name:"VSwitch",inheritAttrs:!1,props:{indeterminate:Boolean,inset:Boolean,flat:Boolean,loading:{type:[Boolean,String],default:!1},...(0,i.co)(),...(0,a.$9)()},emits:{"update:focused":e=>!0,"update:modelValue":()=>!0,"update:indeterminate":e=>!0},setup(e,l){let{attrs:t,slots:c}=l;const f=(0,u.z)(e,"indeterminate"),h=(0,u.z)(e,"modelValue"),{loaderClasses:y}=(0,n.U2)(e),{isFocused:g,focus:C,blur:_}=(0,s.K)(e),w=(0,o.Fl)((()=>"string"===typeof e.loading&&""!==e.loading?e.loading:e.color)),b=(0,m.sq)(),V=(0,o.Fl)((()=>e.id||`switch-${b}`));function S(){f.value&&(f.value=!1)}return(0,v.L)((()=>{const[l,s]=(0,p.An)(t),[u,m]=(0,i.PE)(e),[v,b]=(0,a.fU)(e),k=(0,d.iH)();function W(){var e,l;null==(e=k.value)||null==(l=e.input)||l.click()}return(0,o.Wm)(i.q8,(0,o.dG)({class:["v-switch",{"v-switch--inset":e.inset},{"v-switch--indeterminate":f.value},y.value]},l,u,{id:V.value,focused:g.value}),{...c,default:l=>{let{id:t,isDisabled:i,isReadonly:u,isValid:d}=l;return(0,o.Wm)(a.g5,(0,o.dG)({ref:k},v,{modelValue:h.value,"onUpdate:modelValue":[e=>h.value=e,S],id:t.value,type:"checkbox","aria-checked":f.value?"mixed":void 0,disabled:i.value,readonly:u.value,onFocus:C,onBlur:_},s),{...c,default:()=>(0,o.Wm)("div",{class:"v-switch__track",onClick:W},null),input:l=>{let{textColorClasses:t,textColorStyles:a}=l;return(0,o.Wm)("div",{class:["v-switch__thumb",t.value],style:a.value},[e.loading&&(0,o.Wm)(n.rD,{name:"v-switch",active:!0,color:!1===d.value?void 0:w.value},{default:e=>c.loader?c.loader(e):(0,o.Wm)(r.L,{active:e.isActive,color:e.color,indeterminate:!0,size:"16",width:"2"},null)})])}})}})})),{}}})}}]);
//# sourceMappingURL=553.fb74f1fb.js.map