import{basz,dasoe,iasr,casa,gast,pasne,easu,oasn,nasP,Aasle,tass,jasp,hasw,f,FasV,kasX,lasi,rasU,xasN,zasb,Casae}from"./index-BhesYFRn.js";import{aasse,basv,Xasre}from"./model-d1Prdbon.js";import{_asq}from"./TooltipBtn.vue_vue_type_script_setup_true_lang-LSOTzQP2.js";import{pasie,jasde}from"./filters-ZZ3U37Dy.js";import{_asue}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./icons-MICjc-88.js";import"./UnorderedListOutlined-wfihx1Ro.js";import"./TeamOutlined-D8v3LQ4l.js";import"./CreditCardOutlined-B5AuqjiO.js";import"./index-DSwQVDho.js";functionce(){constd=newse("admin/orders/list","لیست سفارش های تک فروشی");d.add(newv("id","شماره").filterNumber()),d.add(newv("customer.fname","نام مشتری").filterKey("customer.fullName").filterText()),d.add(newv("customer.lname","نام خانوادگی").filterKey("customer.fullName").filterText()),d.add(newv("total_price","جمع کل سفارش").renderSlot("total_price").filterText()),d.add(newv("items","تعداد آیتم ها").renderSlot("items_len").noSort()),d.add(newv("caj","تاریخ ثبت").filterKey("createdAt").filterDate().noSort()),d.add(newv("uaj","تاریخ ویرایش").hidden().filterKey("updatedAt").filterDate().noSort()),d.add(newv("user","ثبت کننده").renderSlot("user").noSort());const$=z();return$.roles&&$.roles.includes("order.tamin.state")&&(d.add(newv("sts_str","وضعیت").renderSlot("sts").noSort()),d.add(newv("branch.name","نام شعبه").filterText().noSort())),d.add(newv("opt","عملیات").noSort().renderSlot("opt")),d}const_e={id:"page-user-list"},fe={class:"flex"},pe={key:0},ve={key:0},me={key:1},ye={key:0},ke=["onClick"],we={key:1},be={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"},je=oe({__name:"List",setup(d){const$=z(),y=l=>!!$.hasPermission(l),A=ce(),j=U(null),c=U(void0),g=U(!1),h=U(!1),S=U(!1),I=ne(()=>ae()),T=l=>l?de(l):"";functionM(l){returnl.proceed?"green":"gray"}asyncfunctionO(l){l.branch_id||(c.value=awaitB(l.id),h.value=!0)}asyncfunctionB(l){const{data:o}=awaitN.get(`admin/orders/${l}`);returno}asyncfunctionR(l){varo;try{awaitN.post("single/order-sts/edit",l),h.value=!1,b.info("ویرایش موفق آمیز"),(o=j.value)==null||o.fetch()}catch{b.error("خطا در ویرایش")}}asyncfunctionE(l){varo;try{l.remove=!0,awaitN.post("single/order-sts/edit",l),h.value=!1,b.info("ویرایش موفق آمیز"),(o=j.value)==null||o.fetch()}catch{b.error("خطا در ویرایش")}}asyncfunctionG(){varl;try{S.value=!S.value,g.value=!g.value,b.info("ویرایش موفق آمیز"),(l=j.value)==null||l.fetch()}catch{b.error("خطا در ویرایش")}}asyncfunctionH(l){c.value=awaitB(l.id),g.value=!0}asyncfunctionJ(l){b.warning("خروجی PDF هنوز در بکاند جدید پیادهسازی نشده است")}return(l,o)=>{constC=u("a-tag"),x=u("a-button"),Q=u("a-popconfirm"),W=u("a-input"),Y=u("a-timeline-item"),Z=u("a-timeline"),D=u("a-modal"),m=u("a-descriptions-item"),L=u("a-descriptions"),F=u("a-input-number"),ee=u("a-divider"),K=u("a-card"),te=u("a-empty");returnn(),r("div",_e,[a(K,{title:I.value?"لیست سفارش":"لیست سفارش های تک فروشی"},{default:t(()=>[a(re,{ref_key:"tbl",ref:j,model:P(A)},{opt:t(({record:e})=>[w("div",fe,[y("order.list.view")?(n(),f(q,{key:0,"icon-class":"w-5 h-5 text-primary",class:"mr-3",icon:"ListIcon",title:"مشاهده سفارش",onClick:_=>H(e)},null,8,["onClick"])):p("",!0),y("order.list.pdf")?(n(),f(q,{key:1,"icon-class":"w-5 h-5 text-danger",class:"mr-3",icon:"FileIcon",title:"دانلود pdf",onClick:_=>J(e.id)},null,8,["onClick"])):p("",!0)])]),items_len:t(({text:e})=>[e?(n(),r("div",pe,s(e.length),1)):p("",!0)]),user:t(({text:e,record:_})=>[e?(n(),r("div",ve,s(e.name),1)):(n(),r("div",me,s(_.customer.fname+" "+_.customer.lname),1))]),total_price:t(({text:e})=>[e?(n(),r("div",ye,s(P(ie)(e)),1)):p("",!