Files
nademitex_user/dist/assets/PreorderPaymentFields-CD1-vV2l.js
T

1 line
2.1 KiB
JavaScript
Raw Normal View History

import{At as e,F as t,M as n,Pt as r,c as i,d as a,f as o,i as s,l as c,t as l,v as u}from"./_plugin-vue_export-helper-1xMDlcEE.js";var d={class:`pay-plan`},f={key:0,class:`pay-plan__note`},p={key:1,class:`pay-plan__methods`},m=[`onClick`],h={key:2,class:`pay-plan__terms`},g={class:`pay-plan__terms-row`},_=[`onClick`],v=l(u({__name:`PreorderPaymentFields`,props:{settlementType:{},checkTermMonths:{},allowedMethods:{},maxCheckMonths:{}},emits:[`update:settlementType`,`update:checkTermMonths`],setup(l,{emit:u}){let v=l,y=u,b=[{value:`cash`,title:`نقدی`,hint:`کل مبلغ به‌صورت نقدی`},{value:`cash_check`,title:`نصف نقد، نصف چکی`,hint:`نیمی نقد و نیمی چک`},{value:`check`,title:`چکی`,hint:`کل مبلغ با چک`}],x=i(()=>{let e=v.allowedMethods;return e?.length?b.filter(t=>e.includes(t.value)):e?[]:b}),S=i(()=>{let e=Math.min(4,Math.max(1,v.maxCheckMonths??4));return Array.from({length:e},(e,t)=>t+1)});return(i,u)=>(n(),o(`fieldset`,d,[u[1]||=c(`legend`,{class:`pay-plan__legend`},`روش پرداخت`,-1),u[2]||=c(`p`,{class:`pay-plan__note`},`قیمت پیش‌سفارش به روش پرداخت بستگی دارد. قبل از اعلام قیمت باید مشخص شود.`,-1),x.value.length?(n(),o(`div`,p,[(n(!0),o(s,null,t(x.value,t=>(n(),o(`button`,{key:t.value,type:`button`,class:e([`pay-plan__method`,{"pay-plan__method--active":l.settlementType===t.value}]),onClick:e=>y(`update:settlementType`,t.value)},[c(`strong`,null,r(t.title),1),c(`span`,null,r(t.hint),1)],10,m))),128))])):(n(),o(`p`,f,`روش پرداخت مشترکی برای محصولات این سفارش وجود ندارد.`)),l.settlementType===`check`||l.settlementType===`cash_check`?(n(),o(`div`,h,[u[0]||=c(`span`,{class:`pay-plan__terms-label`},`مدت چک`,-1),c(`div`,g,[(n(!0),o(s,null,t(S.value,t=>(n(),o(`button`,{key:t,type:`button`,class:e([`pay-plan__term`,{"pay-plan__term--active":l.checkTermMonths===t}]),onClick:e=>y(`update:checkTermMonths`,t)},r(t)+` ماهه `,11,_))),128))])])):a(``,!0)]))}}),[[`__scopeId`,`data-v-4acb4dad`]]);export{v as t};