Files
tehran_taj/apps/admin-panel/dist/assets/List-BRVkWgnF.js
T

2 lines
8.1 KiB
JavaScript
Raw Normal View History

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-CpVArufm.js";import{a as re,b as v,X as ie}from"./model-mwiDYd1J.js";import{_ as P}from"./TooltipBtn.vue_vue_type_script_setup_true_lang-DuvVMhj7.js";import{a as de,j as ue}from"./filters-CoNJlguG.js";import"./SettingOutlined-E4OknxY2.js";import"./icons-BRqF3liF.js";import"./UnorderedListOutlined-CLUl5bxX.js";import"./PercentageOutlined-IS1MVcbY.js";import"./UserAddOutlined-Bpe7Keo_.js";import"./CreditCardOutlined-CIq9Sdft.js";import"./AppstoreOutlined-BRgpp4c5.js";import"./TeamOutlined-DL6Ofm69.js";import"./UserOutlined-DeX82IP7.js";import"./CameraOutlined-JfS-rAEW.js";import"./index-DjZc5EYL.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:"FileI