Default Vite base to /admin/ (ADMIN_PANEL_BASE) so Dokploy Path+/admin + Strip Path resolves assets instead of the user app root. Co-authored-by: Cursor <cursoragent@cursor.com>
2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
import{u as V,d as oe,b as d,c as n,w as t,s as ae,r as c,o as a,h as X,H as le,t as s,i as m,p as w,a as _,F,e as K,f as r,m as U,y as j,J as h,X as ne,_ as se}from"./index-BpoVO8sC.js";import{a as re,b as v,X as ie}from"./model-CTGHGliB.js";import{_ as P}from"./TooltipBtn.vue_vue_type_script_setup_true_lang-BtgRnLgi.js";import{a as de,j as ue}from"./filters-OZN7JLpr.js";import"./SettingOutlined-adv0dYGx.js";import"./icons-DnTs2TDe.js";import"./UnorderedListOutlined-2L8Ker7x.js";import"./PercentageOutlined-ma5C50gj.js";import"./UserAddOutlined-DKEEd5gy.js";import"./CreditCardOutlined-bYAqn5Tz.js";import"./AppstoreOutlined-DpD8Fmqj.js";import"./TeamOutlined-5QvSnkbN.js";import"./UserOutlined-LZP399mF.js";import"./CameraOutlined-CV3xdZPp.js";import"./index-B_k8FJMA.js";function ce(){const u=new re("admin/orders/list","لیست سفارش های تک فروشی");u.add(new v("id","شماره").filterNumber()),u.add(new v("customer.fname","نام مشتری").filterKey("customer.fullName").filterText()),u.add(new v("customer.lname","نام خانوادگی").filterKey("customer.fullName").filterText()),u.add(new v("total_price","جمع کل سفارش").renderSlot("total_price").filterText()),u.add(new v("items","تعداد آیتم ها").renderSlot("items_len").noSort()),u.add(new v("caj","تاریخ ثبت").filterKey("createdAt").filterDate().noSort()),u.add(new v("uaj","تاریخ ویرایش").hidden().filterKey("updatedAt").filterDate().noSort()),u.add(new v("user","ثبت کننده").renderSlot("user").noSort());const $=V();return $.roles&&$.roles.includes("order.tamin.state")&&(u.add(new v("sts_str","وضعیت").renderSlot("sts").noSort()),u.add(new v("branch.name","نام شعبه").filterText().noSort())),u.add(new v("opt","عملیات").noSort().renderSlot("opt")),u}const _e={id:"page-user-list"},fe={class:"flex"},me={key:0},pe={key:0},ve={key:1},ye={key:0},ke=["onClick"],be={key:1},we={class:"flex flex-col"},ge={key:0},he={class:"flex"},Ce={class:"flex-1"},Se={key:1,class:"flex items-center"},xe={key:2},Ue={key:0},$e={class:"flex justify-between"},Ne=oe({__name:"List",setup(u){const $=V(),k=l=>!!$.hasPermission(l),q=ce(),N=U(null),i=U(void 0),C=U(!1),S=U(!1),x=U(!1),M=ae(()=>ne()),L=l=>l?ue(l):"";function z(l){return l.proceed?"green":"gray"}async function A(l){l.branch_id||(i.value=await T(l.id),S.value=!0)}async function T(l){const{data:o}=await j.get(`admin/orders/${l}`);return o}async function O(l){var o,p;try{await j.post("single/order-sts/edit",{orderId:(o=i.value)==null?void 0:o.id,status:l.status,note:l.note}),S.value=!1,h.info("ویرایش موفق آمیز"),(p=N.value)==null||p.fetch()}catch{h.error("خطا در ویرایش")}}async function E(l){var o,p;try{await j.post("single/order-sts/edit",{orderId:(o=i.value)==null?void 0:o.id,status:l.status,note:l.note,remove:!0}),S.value=!1,h.info("ویرایش موفق آمیز"),(p=N.value)==null||p.fetch()}catch{h.error("خطا در ویرایش")}}async function H(){var l;try{x.value=!x.value,C.value=!C.value,h.info("ویرایش موفق آمیز"),(l=N.value)==null||l.fetch()}catch{h.error("خطا در ویرایش")}}async function J(l){i.value=await T(l.id),C.value=!0}async function G(l){h.warning("خروجی PDF هنوز در بکاند جدید پیادهسازی نشده است")}return(l,o)=>{const p=c("a-tag"),g=c("a-button"),Q=c("a-popconfirm"),W=c("a-input"),Y=c("a-timeline-item"),Z=c("a-timeline"),B=c("a-modal"),y=c("a-descriptions-item"),D=c("a-descriptions"),I=c("a-input-number"),ee=c("a-divider"),R=c("a-card"),te=c("a-empty");return a(),d("div",_e,[n(R,{title:M.value?"لیست سفارش":"لیست سفارش های تک فروشی",class:"page-card"},{default:t(()=>[n(ie,{ref_key:"tbl",ref:N,model:X(q),"mobile-cards":""},{opt:t(({record:e})=>[w("div",fe,[k("order.list.view")?(a(),_(P,{key:0,"icon-class":"w-5 h-5 text-primary",class:"mr-3",icon:"ListIcon",title:"مشاهده سفارش",onClick:f=>J(e)},null,8,["onClick"])):m("",!0),k("order.list.pdf")?(a(),_(P,{key:1,"icon-class":"w-5 h-5 text-danger",class:"mr-3",icon:"FileIcon",title:"دانلود pdf",onClick:f=>G(e.id)},null,8,["onClick"])):m("",!0)])]),items_len:t(({text:e})=>[e?(a(),d("div",me,s(e.length),1)):m("",!0)]),user:t(({text:e,record:f})=>[e?(a(),d("div",pe,s(e.name),1)):(a(),d("div",ve,s(f.customer.fname+" "+f.customer.lname),1))]),total_price:t(({text:e})=>[e?(a(),d("div",ye,s(X(de)(e)),1)):m("",!0)]),sts:t(({text:e,record:f})=>[k("order.list.sts")?(a(),d("a",{key:0,href:"",onClick:le(b=>A(f),["prevent"])},s(e),9,ke)):(a(),d("span",be,s(e),1))]),_:1},8,["model"]),n(B,{open:S.value,"onUpdate:open":o[1]||(o[1]=e=>S.value=e),title:"وضعیت سفارش","wrap-class-name":"detail-modal"},{footer:t(()=>[n(g,{onClick:o[0]||(o[0]=e=>S.value=!1)},{default:t(()=>[...o[8]||(o[8]=[r("باشه",-1)])]),_:1})]),default:t(()=>[i.value?(a(),_(Z,{key:0},{default:t(()=>[(a(!0),d(F,null,K(i.value.activity,(e,f)=>(a(),_(Y,{key:f,color:z(e)},{default:t(()=>[w("div",we,[w("div",null,s(e.title),1),e.proceed?(a(),d("div",ge,[w("div",he,[w("div",Ce,[n(p,null,{default:t(()=>[r(s(L(e.uaj)),1)]),_:2},1024)]),f>0&&k("order.list.sts.remove")?(a(),_(Q,{key:0,"ok-text":"بله","cancel-text":"بی خیال",onConfirm:b=>E(e)},{title:t(()=>[...o[5]||(o[5]=[w("p",null,"آیا مطمئن به حذف وضعیت مورد نظر هستید ؟",-1)])]),default:t(()=>[n(g,{size:"small",danger:""},{default:t(()=>[...o[6]||(o[6]=[r("حذف وضعیت",-1)])]),_:1})]),_:1},8,["onConfirm"])):m("",!0)])])):m("",!0),!e.proceed&&k("order.list.sts.submit")?(a(),d("div",Se,[n(W,{value:e.note,"onUpdate:value":b=>e.note=b,placeholder:"یادداشت"},null,8,["value","onUpdate:value"]),n(g,{type:"text",size:"small",onClick:b=>O(e)},{default:t(()=>[...o[7]||(o[7]=[r("ثبت وضعیت",-1)])]),_:1},8,["onClick"])])):m("",!0),e.proceed?(a(),d("div",xe,s(e.note),1)):m("",!0)])]),_:2},1032,["color"]))),128))]),_:1})):m("",!0)]),_:1},8,["open"]),n(B,{open:C.value,"onUpdate:open":o[4]||(o[4]=e=>C.value=e),title:"مشاهده سفارش",width:"80%","wrap-class-name":"detail-modal"},{footer:t(()=>[w("div",$e,[n(g,{onClick:o[2]||(o[2]=e=>C.value=!1)},{default:t(()=>[...o[9]||(o[9]=[r("باشه",-1)])]),_:1}),x.value&&k("order.list.view.edit")?(a(),_(g,{key:0,danger:"",onClick:o[3]||(o[3]=e=>H())},{default:t(()=>[...o[10]||(o[10]=[r(" ویرایش سفارش ",-1)])]),_:1})):m("",!0)])]),default:t(()=>[i.value?(a(),d("div",Ue,[n(D,null,{default:t(()=>[n(y,{label:"مشتری"},{default:t(()=>[r(s(i.value.customer.fname)+" "+s(i.value.customer.lname),1)]),_:1}),n(y,{label:"تلفن همراه"},{default:t(()=>[r(s(i.value.customer.phone),1)]),_:1}),n(y,{label:"تاریخ ثبت"},{default:t(()=>[r(s(L(i.value.caj)),1)]),_:1}),n(y,{label:"وضعیت"},{default:t(()=>[r(s(i.value.sts_str),1)]),_:1})]),_:1}),n(R,{title:"آیتم های سفارش"},{default:t(()=>[(a(!0),d(F,null,K(i.value.items,(e,f)=>(a(),d("div",{key:f},[n(D,null,{default:t(()=>[n(y,{label:"نام محصول"},{default:t(()=>[n(p,{color:"blue"},{default:t(()=>[r(s(e.title),1)]),_:2},1024)]),_:2},1024),n(y,{label:"عنوان تنوع"},{default:t(()=>[r(s(e.variant_title),1)]),_:2},1024),n(y,{label:"وزن نهایی"},{default:t(()=>[x.value&&k("order.list.view.edit")?(a(),_(I,{key:0,value:e.grams,"onUpdate:value":b=>e.grams=b,class:"w-full mt-0"},null,8,["value","onUpdate:value"])):(a(),_(p,{key:1,color:"red"},{default:t(()=>[r(s(e.grams),1)]),_:2},1024))]),_:2},1024),n(y,{label:"تعداد"},{default:t(()=>[x.value&&k("order.list.view.edit")?(a(),_(I,{key:0,value:e.qty,"onUpdate:value":b=>e.qty=b},null,8,["value","onUpdate:value"])):(a(),_(p,{key:1,color:"orange"},{default:t(()=>[r(s(e.qty),1)]),_:2},1024))]),_:2},1024),Number(e.flatRialCharge)>0?(a(),_(y,{key:0,label:"اجرت ریالی"},{default:t(()=>[n(p,null,{default:t(()=>[r(s(Number(e.flatRialCharge).toLocaleString("fa-IR"))+" ریال",1)]),_:2},1024)]),_:2},1024)):m("",!0),n(y,{label:"توضیحات"},{default:t(()=>[w("div",null,s(e.note),1)]),_:2},1024)]),_:2},1024),f<i.value.items.length-1?(a(),_(ee,{key:0})):m("",!0)]))),128))]),_:1})])):(a(),_(te,{key:1}))]),_:1},8,["open"])]),_:1},8,["title"])])}}}),Ae=se(Ne,[["__scopeId","data-v-73ba2ddd"]]);export{Ae as default};
|