Files
hedena_gold/apps/admin-panel/dist/assets/OrderStatusModal-rOjZ1q1_.js
T

2 lines
9.9 KiB
JavaScript
Raw Normal View History

import{a as F,j as x}from"./filters-B9z4I-pb.js";import{d as G,l as q,o as t,c as m,w as v,a as n,m as e,t as a,f,p as k,e as u,F as g,q as H,b as j,k as W,r as p,_ as z,z as J,g as S,n as P}from"./index-QQcP5-AC.js";const K={key:0,class:"ov"},Q={class:"ov__hero"},X={class:"ov__heroMain"},Y={class:"ov__number"},Z={class:"ov__heroMeta"},ee={key:0},te={class:"ov__facts"},se={class:"ov__fact"},oe={class:"ov__factValue"},ae={class:"ov__fact"},ne={class:"ov__factValue ov__factValue--ltr"},re={class:"ov__fact"},le={class:"ov__factValue"},_e={class:"ov__fact"},ce={class:"ov__factValue"},de={key:0,class:"ov__fact"},ie={class:"ov__factValue"},ue={key:1,class:"ov__fact"},ve={class:"ov__factValue"},fe={key:2,class:"ov__fact"},me={class:"ov__factValue"},pe={class:"ov__items"},he={class:"ov__itemsHead"},ye={class:"ov__itemsCount"},ge={key:0,class:"ov__list"},ke={class:"ov__thumb"},be={key:1,class:"ov__thumbEmpty","aria-hidden":"true"},Ee={class:"ov__itemBody"},$e={class:"ov__itemTitle"},Ce={key:0,class:"ov__itemVariant"},Ne={class:"ov__itemStats"},De={class:"ov__pill"},we={class:"ov__pill ov__pill--warn"},Ve={key:0,class:"ov__pill ov__pill--mute"},Le={key:1,class:"ov__itemNote"},Oe={class:"ov__footer"},Re=G({__name:"OrderViewModal",props:{open:{type:Boolean},order:{default:null},editable:{type:Boolean,default:!1}},emits:["update:open"],setup(s,{emit:U}){const w=s,C=U,i=W(!1);q(()=>w.open,_=>{_&&(i.value=!1)});function N(_){C("update:open",_)}function A(_){return _?x(_):""}function D(_){const o=Number(_);return Number.isFinite(o)?`${o.toFixed(2)} گرم`:"—"}function b(_){if(!_)return"—";const o=(_.fullName||_.name||"").trim();return o||[_.fname,_.lname].filter(Boolean).join(" ").trim()||"—"}function V(_){switch(_){case"SUSPENDED":return"gold";case"CANCELLED":return"error";case"DELIVERED_TO_CUSTOMER":return"success";case"DELIVERED_TO_AGENT":return"cyan";case"PREPARING":return"orange";case"SOURCING":return"warning";case"ADMIN_APPROVED":return"purple";case"PLACED":return"processing";default:return"default"}}return(_,o)=>{const I=p("a-tag"),r=p("a-image"),c=p("a-input-number"),y=p("a-empty"),E=p("a-button"),T=p("a-modal");return t(),m(T,{open:s.open,title:"مشاهده سفارش",footer:null,width:"920px","wrap-class-name":"detail-modal order-view-modal","destroy-on-close":"","onUpdate:open":N},{default:v(()=>{var L,O,R,l,h,$,M;return[s.order?(t(),n("div",K,[e("header",Q,[e("div",X,[e("h2",Y,a(s.order.orderNumber||"—"),1),e("div",Z,[e("span",null,a(A(s.order.caj)),1),(L=s.order.items)!=null&&L.length?(t(),n("span",ee,a(s.order.items.length)+" آیتم",1)):f("",!0)])]),k(I,{class:"ov__status",color:V(s.order.status)},{default:v(()=>[u(a(s.order.sts_str||"—"),1)]),_:1},8,["color"])]),e("section",te,[e("div",se,[o[2]||(o[2]=e("span",{class:"ov__factLabel"},"مشتری",-1)),e("strong",oe,a(b(s.order.customer)),1)]),e("div",ae,[o[3]||(o[3]=e("span",{class:"ov__factLabel"},"تلفن همراه",-1)),e("strong",ne,a(((O=s.order.customer)==null?void 0:O.phone)||((R=s.order.customer)==null?void 0:R.mobile)||"—"),1)]),e("div",re,[o[4]||(o[4]=e("span",{class:"ov__factLabel"},"وزن کل",-1)),e("strong",le,a(D(s.order.totalGoldWeightGrams)),1)]),e("div",_e,[o[5]||(o[5]=e("span",{class:"ov__factLabel"},"جمع ریالی",-1)),e("strong",ce,[Number(s.order.total_price)>0?(t(),n(g,{key:0},[u(a(H(F)(s.order.total_price)),1)],64)):(t(),n(g,{key:1},[u("—")],64))])]),(l=s.order.user)!=null&&l.name?(t(),n("div",de,[o[6]||(o[6]=e("span",{class:"ov__factLabel"},"مسئول فروش",-1)),e("strong",ie,a(s.order.user.name),1)])):f("",!0),(h=s.order.branch)!=null&&h.name?(t(),n("div",ue,[o[7]||(o[7]=e("span",{class:"ov__factLabel"},"شعبه",-1)),e("strong",ve,a(s.order.branch.name),1)])):f("",!0),s.order.confirmed_str?(t(),n("div",fe,[o[8]||(o[8]=e("span",{class:"ov__factLabel"},"تایید مشتری",-1)),e("strong",me,a(s.order.confirmed_str),1)])):f("",!0)]),e("section",pe,[e("div",he,[o[9]||(o[9]=e("h3",{class:"ov__itemsTitle"},"آیتم‌های سفارش",-1)),e("span",ye,a((($=s.order.items)==null?void 0:$.length)||0)+" مورد"