Files
tehran_taj/apps/admin-panel/dist/assets/List-CPUuTUZY.js
T
s.esmaeiliandClaude Opus 5 53436ec855 chore(release): prepare release/delivery + fix docker env passthrough
DEPLOY-01: docker-compose.yml passed only DATABASE_URL and PORT to the api
service, so JWT_SECRET, JWT_CUSTOMER_SECRET, OTP_MASTER_CODE and every SMS_TREZ_*
variable were silently dropped in Docker. A deployed build would have used the
development JWT fallback and would not have had the delivery master code at all,
so the demo login would have failed with no obvious cause. All are now forwarded,
defaulting to empty (which the code treats as unset); verified with
`docker compose config`.

TEST-01: test-sales-expert-roundtrip.cjs had localhost:3077 hardcoded and could
only connect by accident. Now defaults to the repo's API_PORT. 33/33.

DELIVERY.md documents env vars (names only), run/deploy commands, how migrations
run inside the container, the verification results and the known issues.

release/delivery contains both parity branches with no conflicts (fast-forward).
build 5/5, jest 45/45, admin smoke 43/43, apps smoke 43/43, B2B scan 34/34,
B2B writes 25/25, auth-smoke 32/32, typecheck clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 00:30:09 +03:30

2 lines
7.6 KiB
JavaScript

import{u as q,d as oe,b as i,c as l,w as t,p as ne,r as c,o as n,h as K,A as ae,t as s,i as p,n as b,a as f,F as P,e as V,f as d,l as U,x as N,z as h,C as le}from"./index-JKzARUiG.js";import{a as se,b as v,X as re}from"./model-DOsh9ZRP.js";import{_ as X}from"./TooltipBtn.vue_vue_type_script_setup_true_lang-D_q9Um7S.js";import{a as ie,j as de}from"./filters-Xxl3NQYx.js";import{_ as ue}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./SettingOutlined-7WAqpvd6.js";import"./icons-CwsTCmB2.js";import"./TeamOutlined-C5THHLk7.js";import"./UnorderedListOutlined-B1ZzTECl.js";import"./CreditCardOutlined-D3QvbK_r.js";import"./index-DbDK8cBI.js";function ce(){const u=new se("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 $=q();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"},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(u){const $=q(),k=a=>!!$.hasPermission(a),z=ce(),j=U(null),r=U(void 0),C=U(!1),S=U(!1),x=U(!1),A=ne(()=>le()),T=a=>a?de(a):"";function M(a){return a.proceed?"green":"gray"}async function O(a){a.branch_id||(r.value=await B(a.id),S.value=!0)}async function B(a){const{data:o}=await N.get(`admin/orders/${a}`);return o}async function R(a){var o,m;try{await N.post("single/order-sts/edit",{orderId:(o=r.value)==null?void 0:o.id,status:a.status,note:a.note}),S.value=!1,h.info("ویرایش موفق آمیز"),(m=j.value)==null||m.fetch()}catch{h.error("خطا در ویرایش")}}async function E(a){var o,m;try{await N.post("single/order-sts/edit",{orderId:(o=r.value)==null?void 0:o.id,status:a.status,note:a.note,remove:!0}),S.value=!1,h.info("ویرایش موفق آمیز"),(m=j.value)==null||m.fetch()}catch{h.error("خطا در ویرایش")}}async function G(){var a;try{x.value=!x.value,C.value=!C.value,h.info("ویرایش موفق آمیز"),(a=j.value)==null||a.fetch()}catch{h.error("خطا در ویرایش")}}async function H(a){r.value=await B(a.id),C.value=!0}async function J(a){h.warning("خروجی PDF هنوز در بک‌اند جدید پیاده‌سازی نشده است")}return(a,o)=>{const m=c("a-tag"),g=c("a-button"),Q=c("a-popconfirm"),W=c("a-input"),Y=c("a-timeline-item"),Z=c("a-timeline"),D=c("a-modal"),y=c("a-descriptions-item"),L=c("a-descriptions"),I=c("a-input-number"),ee=c("a-divider"),F=c("a-card"),te=c("a-empty");return n(),i("div",_e,[l(F,{title:A.value?"لیست سفارش":"لیست سفارش های تک فروشی"},{default:t(()=>[l(re,{ref_key:"tbl",ref:j,model:K(z)},{opt:t(({record:e})=>[b("div",fe,[k("order.list.view")?(n(),f(X,{key:0,"icon-class":"w-5 h-5 text-primary",class:"mr-3",icon:"ListIcon",title:"مشاهده سفارش",onClick:_=>H(e)},null,8,["onClick"])):p("",!0),k("order.list.pdf")?(n(),f(X,{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(),i("div",pe,s(e.length),1)):p("",!0)]),user:t(({text:e,record:_})=>[e?(n(),i("div",ve,s(e.name),1)):(n(),i("div",me,s(_.customer.fname+" "+_.customer.lname),1))]),total_price:t(({text:e})=>[e?(n(),i("div",ye,s(K(ie)(e)),1)):p("",!0)]),sts:t(({text:e,record:_})=>[k("order.list.sts")?(n(),i("a",{key:0,href:"",onClick:ae(w=>O(_),["prevent"])},s(e),9,ke)):(n(),i("span",we,s(e),1))]),_:1},8,["model"]),l(D,{open:S.value,"onUpdate:open":o[1]||(o[1]=e=>S.value=e),title:"وضعیت سفارش"},{footer:t(()=>[l(g,{onClick:o[0]||(o[0]=e=>S.value=!1)},{default:t(()=>[...o[8]||(o[8]=[d("باشه",-1)])]),_:1})]),default:t(()=>[r.value?(n(),f(Z,{key:0},{default:t(()=>[(n(!0),i(P,null,V(r.value.activity,(e,_)=>(n(),f(Y,{key:_,color:M(e)},{default:t(()=>[b("div",be,[b("div",null,s(e.title),1),e.proceed?(n(),i("div",ge,[b("div",he,[b("div",Ce,[l(m,null,{default:t(()=>[d(s(T(e.uaj)),1)]),_:2},1024)]),_>0&&k("order.list.sts.remove")?(n(),f(Q,{key:0,"ok-text":"بله","cancel-text":"بی خیال",onConfirm:w=>E(e)},{title:t(()=>[...o[5]||(o[5]=[b("p",null,"آیا مطمئن به حذف وضعیت مورد نظر هستید ؟",-1)])]),default:t(()=>[l(g,{size:"small",danger:""},{default:t(()=>[...o[6]||(o[6]=[d("حذف وضعیت",-1)])]),_:1})]),_:1},8,["onConfirm"])):p("",!0)])])):p("",!0),!e.proceed&&k("order.list.sts.submit")?(n(),i("div",Se,[l(W,{value:e.note,"onUpdate:value":w=>e.note=w,placeholder:"یادداشت"},null,8,["value","onUpdate:value"]),l(g,{type:"text",size:"small",onClick:w=>R(e)},{default:t(()=>[...o[7]||(o[7]=[d("ثبت وضعیت",-1)])]),_:1},8,["onClick"])])):p("",!0),e.proceed?(n(),i("div",xe,s(e.note),1)):p("",!0)])]),_:2},1032,["color"]))),128))]),_:1})):p("",!0)]),_:1},8,["open"]),l(D,{open:C.value,"onUpdate:open":o[4]||(o[4]=e=>C.value=e),title:"مشاهده سفارش",width:"80%"},{footer:t(()=>[b("div",$e,[l(g,{onClick:o[2]||(o[2]=e=>C.value=!1)},{default:t(()=>[...o[9]||(o[9]=[d("باشه",-1)])]),_:1}),x.value&&k("order.list.view.edit")?(n(),f(g,{key:0,danger:"",onClick:o[3]||(o[3]=e=>G())},{default:t(()=>[...o[10]||(o[10]=[d(" ویرایش سفارش ",-1)])]),_:1})):p("",!0)])]),default:t(()=>[r.value?(n(),i("div",Ue,[l(L,null,{default:t(()=>[l(y,{label:"مشتری"},{default:t(()=>[d(s(r.value.customer.fname)+" "+s(r.value.customer.lname),1)]),_:1}),l(y,{label:"تلفن همراه"},{default:t(()=>[d(s(r.value.customer.phone),1)]),_:1}),l(y,{label:"تاریخ ثبت"},{default:t(()=>[d(s(T(r.value.caj)),1)]),_:1}),l(y,{label:"وضعیت"},{default:t(()=>[d(s(r.value.sts_str),1)]),_:1})]),_:1}),l(F,{title:"آیتم های سفارش"},{default:t(()=>[(n(!0),i(P,null,V(r.value.items,(e,_)=>(n(),i("div",{key:_},[l(L,null,{default:t(()=>[l(y,{label:"نام محصول"},{default:t(()=>[l(m,{color:"blue"},{default:t(()=>[d(s(e.title),1)]),_:2},1024)]),_:2},1024),l(y,{label:"عنوان تنوع"},{default:t(()=>[d(s(e.variant_title),1)]),_:2},1024),l(y,{label:"وزن نهایی"},{default:t(()=>[x.value&&k("order.list.view.edit")?(n(),f(I,{key:0,value:e.grams,"onUpdate:value":w=>e.grams=w,class:"w-full mt-0"},null,8,["value","onUpdate:value"])):(n(),f(m,{key:1,color:"red"},{default:t(()=>[d(s(e.grams),1)]),_:2},1024))]),_:2},1024),l(y,{label:"تعداد"},{default:t(()=>[x.value&&k("order.list.view.edit")?(n(),f(I,{key:0,value:e.qty,"onUpdate:value":w=>e.qty=w},null,8,["value","onUpdate:value"])):(n(),f(m,{key:1,color:"orange"},{default:t(()=>[d(s(e.qty),1)]),_:2},1024))]),_:2},1024),l(y,{label:"توضیحات"},{default:t(()=>[b("div",null,s(e.note),1)]),_:2},1024)]),_:2},1024),_<r.value.items.length-1?(n(),f(ee,{key:0})):p("",!0)]))),128))]),_:1})])):(n(),f(te,{key:1}))]),_:1},8,["open"])]),_:1},8,["title"])])}}}),qe=ue(je,[["__scopeId","data-v-a0837a14"]]);export{qe as default};