Files
tehran_taj/apps/admin-panel/dist/assets/OmdeCustomerList-BhiWh4Gi.js
T
mahmoodandClaude Sonnet 5.5 5ddb225813 fix(ui): act-as strip no longer covers headers; customer type and slider permission
- apps: the fixed «در حال مشاهده به‌عنوان» strip (38px) sat over the fixed page
  headers, which still sat at top: 0 (the old 30px body padding was shorter than
  the strip too). The strip's height is now one variable, --aab-h, that the
  fixed headers (PageBar, home, dashboard, toasts) use as their top.
- admin: the customer form offers only «مغازه دار اپلیکیشن» to anyone but the
  super admin; bankers and walk-in shopkeepers are listed by super-admin-only
  endpoints, so ordinary admins lost the customers they created under them.
- admin: the mobile slider rid (custom.config.statics.slider) was only under the
  «سفارشی» branch, which the permission screen hides outside level 104. Same rid,
  now listed under «مدیریت ثابت ها». Display only: the slider routes are still
  gated by config.statics.

Rebuilds admin-panel, user-app and user-app-v2 dist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 11:16:23 +03:30

2 lines
15 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{m as ke}from"./index-DBCPuYKo.js";import{c as a,I as Se,u as J,d as be,x as Oe,y as $,z as $e,b,aj as q,w as o,r as C,o as d,f as A,t as v,p as l,i as w,h as y,Z as Te,a as p,E as je,Q as Ie,S as De,q as T,g as N,W as H,e as Ne,m as j,ak as Be,G as h,l as Ee,_ as Ae}from"./index-D8Sl1lAu.js";import{a as He,b as r,X as Me}from"./model-qEyXFzcU.js";import{_ as Le}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-BotZit-L.js";import{_ as Ve}from"./AccountingSyncButton.vue_vue_type_script_setup_true_lang-B4Nv7PnK.js";import{_ as Pe}from"./bulkCustomer.vue_vue_type_script_setup_true_lang-DgE4sNH0.js";import{S as ze}from"./SettingOutlined-BVtVPkyH.js";import{U as Re,S as M}from"./UnorderedListOutlined-Bi9vIEx9.js";var Ue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"};function G(c){for(var u=1;u<arguments.length;u++){var f=arguments[u]!=null?Object(arguments[u]):{},_=Object.keys(f);typeof Object.getOwnPropertySymbols=="function"&&(_=_.concat(Object.getOwnPropertySymbols(f).filter(function(s){return Object.getOwnPropertyDescriptor(f,s).enumerable}))),_.forEach(function(s){Fe(c,s,f[s])})}return c}function Fe(c,u,f){return u in c?Object.defineProperty(c,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[u]=f,c}var L=function(u,f){var _=G({},u,f.attrs);return a(Se,G({},_,{icon:Ue}),null)};L.displayName="CloudDownloadOutlined";L.inheritAttrs=!1;const Xe={omde:{url:"admin/customers-omde/list",title:"لیست مشتریان های عمده"},banker:{url:"admin/customers-omde/banker/list",title:"لیست بنکداران"},shopkeeper:{url:"admin/customers-omde/shopkeeper/list",title:"لیست مغازه داران حضوری"},nonVerified:{url:"admin/customers-omde/non-verified/list",title:"لیست مشتریان در انتظار"},archived:{url:"admin/customers-omde/archived/list",title:"لیست مشتریان بایگانی"}};function Ct(c){const u=J();Object.keys(u.cityFilters).length<1&&u.getCities();const{url:f,title:_}=Xe[c],s=new He(f,_);return s.add(new r("id","کد").filterNumber()),s.add(new r("fname","نام").filterText().hidden()),s.add(new r("lname","نام خانوادگی").filterText().hidden()),s.add(new r("name","نام و نام خانوادگی").filterText()),s.add(new r("mobile","موبایل").filterText().hidden().noSort()),s.add(new r("city_id","شهر").hidden().renderSlot("city").filterKey("city_id").filterSelect(u.cityFilters)),s.add(new r("reagent.name","کارشناس فروش").filterText().noSort()),s.add(new r("gram_level","سطح اعتبار").filterNumber().noSort()),s.add(new r("percent","درصد").filterNumber().noSort()),s.add(new r("remain","بدهی گرمی").filterNumber().noSort()),s.add(new r("rial_remain","بدهی ریالی").filterNumber().noSort()),s.add(new r("caj","تاریخ ثبت").filterDate().noSort()),s.add(new r("uaj","بروزرسانی").hidden().filterDate().noSort()),s.add(new r("sts_str","وضعیت ثبت سفارش").renderSlot("sts").noSort()),s.add(new r("active","وضعیت حساب کاربری").renderSlot("active").noSort().filterSelect({1:"فعال","-1":"غیر فعال"})),s.add(new r("phone","تلفن").filterText().hidden().noSort()),s.add(new r("address","آدرس").filterText().hidden().noSort()),s.add(new r("store_name","نام مغازه").filterText().hidden().noSort()),s.add(new r("zone","منطقه").filterText().hidden().noSort()),s.add(new r("pasazh_name","نام پاساژ").filterText().hidden().noSort()),s.add(new r("opt","عملیات").noSort().renderSlot("opt")),s}function Ye(c,u){if(c.cols.some(_=>_.key==="acc_remain"))return;const f=c.cols.findIndex(_=>_.key==="rial_remain");for(const _ of c.cols)_.key==="remain"&&(_.title="بدهی داخل اپ (گرم)"),_.key==="rial_remain"&&(_.title="بدهی داخل اپ (ریال)");c.cols.splice(f+1,0,new r("acc_remain",`مانده‌ی ${u} (گرم)`).filterNumber().renderSlot("acc_gold"),new r("acc_rial_remain",`مانده‌ی ${u} (ریال)`).filterNumber().renderSlot("acc_rial"))}const Qe={id:"page-user-list"},qe={key:0,class:"list-count"},Ge={class:"text-danger"},Je={key:0},We={key:1},Ze={key:0,class:"acc-none"},Ke={class:"flex"},et={class:"cursor-pointer flex items-center"},tt={class:"flex gap-2"},nt={class:"flex gap-2"},st={class:"flex gap-2"},ot={class:"flex gap-2"},it={class:"flex gap-2"},at={class:"flex gap-2"},lt={key:0,class:"text-danger text-xs"},rt={class:"flex gap-2"},ct={class:"flex gap-2"},ut={class:"flex gap-2"},dt=be({__name:"OmdeCustomerList",props:{title:{},model:{},showAddButton:{type:Boolean,default:!1},accountingSync:{type:Boolean,default:!1}},setup(c){const u=c,f=Ee(),_=J(),s=e=>!!_.hasPermission(e),x=j(null),I=j(!1),D=j(void 0),S=j(void 0);function W(e){const n=e;S.value={count:n&&n.count?n.count:void 0,total:n&&n.total?n.total:void 0}}const Z=[{slot:"acc_gold",field:"acc_remain",places:3},{slot:"acc_rial",field:"acc_rial_remain",places:0}],K=e=>Number(e)>0?"acc-debt":Number(e)<0?"acc-credit":"";function ee(e,n){const m=Number(e);return m?`${Math.abs(m).toLocaleString("fa-IR",{maximumFractionDigits:n})} ${m>0?"بدهکار":"بستانکار"}`:"۰"}const te=e=>ke(e).format("jYYYY/jMM/jDD HH:mm");Oe(async()=>{try{const{data:e}=await $.get("admin/accounting-status");e!=null&&e.connected&&e.provider&&Ye($e(u.model),e.provider)}catch{}});function ne(e,n){const m=String(e.key);return m==="5"||m==="6"||m==="7"||m==="8"||m==="9"}function se(e){switch(e.sts_verify_step_one){case 1:return"در انتظار تایید ورود مشتری";case 2:return"رد ورود مشتری";case 3:return"تایید ورود مشتری"}}function V(e){switch(e.sts_verify_step_one){case 1:return"HelpCircleIcon";case 2:return"SlashIcon";case 3:return"CheckIcon"}}function oe(e){switch(e.sts_verify_step_two){case 1:return"در انتظار فعال سازی";case 2:return"غیر فعال سازی";case 3:return"فعال سازی"}}function P(e){switch(e.sts_verify_step_two){case 1:return"HelpCircleIcon";case 2:return"SlashIcon";case 3:return"CheckIcon"}}function z(e){return e==="HelpCircleIcon"?Be:e==="CheckIcon"?H:M}function R(e){return e==="HelpCircleIcon"?"text-primary":e==="CheckIcon"?"text-success":"text-danger"}async function B(e,n){var m;try{await $.post("major/verify",e),h.info("تغییرات ثبت شد "),(m=x.value)==null||m.fetch()}catch{h.error(n)}}const U=e=>B({customer_id:e,sts_verify_step_one:2},"خطا در تغییر وضعیت اولیه مشتری"),F=e=>Q(e,"sts_verify_step_one"),X=e=>B({customer_id:e,sts_verify_step_two:2},"خطا در تغییر وضعیت سفارش مشتری"),Y=e=>Q(e,"sts_verify_step_two"),k=j({open:!1,saving:!1,id:"",step:"sts_verify_step_one",reason:""});function Q(e,n){k.value={open:!0,saving:!1,id:e,step:n,reason:""}}async function ie(){const e=k.value;e.saving=!0,await B({customer_id:e.id,[e.step]:3,reason:e.reason.trim()||null},e.step==="sts_verify_step_one"?"خطا در تغییر وضعیت اولیه مشتری":"خطا در تغییر وضعیت سفارش مشتری"),e.saving=!1,e.open=!1}function ae(e){return e.sts_verify_step_one===1?U(e.id):e.sts_verify_step_one===2?F(e.id):U(e.id)}function le(e){if(e.sts_verify_step_one===1)return F(e.id)}function re(e){return e.sts_verify_step_two===1?X(e.id):e.sts_verify_step_two===2?Y(e.id):X(e.id)}function ce(e){if(e.sts_verify_step_two===1)return Y(e.id)}async function ue(e){var n;try{await $.post("customer/toggle-active",{id:e.id}),h.info("تغییرات ثبت شد "),await((n=x.value)==null?void 0:n.fetch())}catch{h.error("خطا در تغییر وضعیت")}}async function de(e){var n;try{await $.post("customer/toggle-sts",{id:e.id,sts:e.sts}),h.info("تغییرات ثبت شد "),await((n=x.value)==null?void 0:n.fetch())}catch{h.error("خطا در تغییر وضعیت")}}async function fe(e){var n;try{await $.get(`major/archive/${e}`),h.info("تغییرات ثبت شد "),await((n=x.value)==null?void 0:n.fetch())}catch{h.error("خطا در بایگانی")}}function _e(e){u.showAddButton?(D.value=e,I.value=!0):f.push(`/bulkCustomer/edit/${e}`)}function me(){D.value=void 0,I.value=!0}function pe(e){f.push(`/bulkCustomer/view/${e}`)}function ve(e){f.push(`/bulkCustomer/view/${e.id}?tab=orders`)}function ye(e){f.push(`/bulkCustomer/view/${e.id}?tab=documents`)}return(e,n)=>{const m=C("a-tag"),E=C("a-tooltip"),g=C("a-menu-item"),O=C("a-popconfirm"),we=C("a-menu"),ge=C("a-dropdown"),Ce=C("a-textarea"),he=C("a-modal"),xe=C("a-card");return d(),b("div",Qe,[a(xe,{title:c.title,class:"page-card"},q({default:o(()=>[S.value&&S.value.count&&S.value.total?(d(),b("div",qe,[A(v(S.value.total)+" رکورد یافت شد - ",1),l("span",Ge,v(S.value.count)+" رکورد غیر فعال",1)])):w("",!0),a(Me,{ref_key:"tbl",ref:x,model:c.model,"mobile-cards":"",onQuery:W},q({city:o(({record:t})=>[t.city&&t.city.title?(d(),b("div",Je,v(t.city.title),1)):(d(),b("div",We,"-"))]),sts:o(({record:t})=>[a(m,{color:t.sts===1?"green":"red"},{default:o(()=>[A(v(t.sts_str),1)]),_:2},1032,["color"])]),active:o(({record:t})=>[a(m,{color:t.active===1?"green":"red"},{default:o(()=>[A(v(t.active===1?"فعال":"غیر فعال"),1)]),_:2},1032,["color"])]),opt:o(({record:t})=>[l("div",Ke,[a(ge,null,{overlay:o(()=>[a(we,{onClick:i=>ne(i,t.id)},{default:o(()=>[s("persons.list.client.omde.edit")?(d(),p(g,{key:"1",onClick:i=>_e(t.id)},{default:o(()=>[l("div",tt,[a(y(je),{class:"cursor-pointer w-5 ml-1"}),n[5]||(n[5]=l("div",null,"ویرایش",-1))])]),_:1},8,["onClick"])):w("",!0),s("persons.list.client.omde.view")?(d(),p(g,{key:"2",onClick:i=>pe(t.id)},{default:o(()=>[l("div",nt,[a(y(Ie),{class:"cursor-pointer w-5 ml-1"}),n[6]||(n[6]=l("div",null,"مشاهده اطلاعات",-1))])]),_:1},8,["onClick"])):w("",!0),s("persons.list.client.omde.view.orders")?(d(),p(g,{key:"3",onClick:i=>ve(t)},{default:o(()=>[l("div",st,[a(y(Re),{class:"cursor-pointer w-5 ml-1"}),n[7]||(n[7]=l("div",null,"مشاهده سفارش",-1))])]),_:1},8,["onClick"])):w("",!0),s("persons.list.client.omde.view.documents")?(d(),p(g,{key:"4",onClick:i=>ye(t)},{default:o(()=>[l("div",ot,[a(y(De),{class:"cursor-pointer w-5 ml-1"}),n[8]||(n[8]=l("div",null,"سند های مالی",-1))])]),_:1},8,["onClick"])):w("",!0),s("persons.list.client.omde.able")?(d(),p(g,{key:"7"},{default:o(()=>[a(O,{"ok-text":"بله","cancel-text":"خیر",title:"آیا مطمئن هستید؟",onConfirm:i=>fe(t.id)},{default:o(()=>[l("div",it,[a(y(L),{class:"cursor-pointer w-5 ml-1"}),n[9]||(n[9]=l("div",null,"بایگانی کردن",-1))])]),_:1},8,["onConfirm"])]),_:2},1024)):w("",!0),a(g,{key:"8"},{default:o(()=>[a(O,{"ok-text":t.sts_verify_step_one===1?"تایید":"بله","cancel-text":t.sts_verify_step_one===1?"رد":"خیر",title:t.sts_verify_step_one===1?"وضعیت تایید اولیه مشتری به چه نحوی تغییر یابد؟":"آیا از تغییر وضعیت مشتری اطمینان دارید؟",onConfirm:i=>ae(t),onCancel:i=>le(t)},{default:o(()=>[l("div",at,[(d(),p(N(z(V(t))),{class:T(["cursor-pointer w-5 ml-1",R(V(t))])},null,8,["class"])),l("div",null,[l("div",null,v(se(t)),1),t.verificationStep==="REJECTED"?(d(),b("div",lt," رد شده"+v(t.verification_rejection_reason?`: ${t.verification_rejection_reason}`:""),1)):w("",!0)])])]),_:2},1032,["ok-text","cancel-text","title","onConfirm","onCancel"])]),_:2},1024),a(g,{disabled:t.sts_verify_step_one!==2,key:"9"},{default:o(()=>[a(O,{"ok-text":t.sts_verify_step_two===1?"تایید":"بله","cancel-text":t.sts_verify_step_two===1?"رد":"خیر",title:t.sts_verify_step_two===1?"وضعیت تایید سفارش مشتری به چه نحوی تغییر یابد؟":"آیا از تغییر وضعیت سفارش مشتری اطمینان دارید؟",onConfirm:i=>re(t),onCancel:i=>ce(t)},{default:o(()=>[l("div",rt,[(d(),p(N(z(P(t))),{class:T(["cursor-pointer w-5 ml-1",R(P(t))])},null,8,["class"])),l("div",null,v(oe(t)),1)])]),_:2},1032,["ok-text","cancel-text","title","onConfirm","onCancel"])]),_:2},1032,["disabled"]),s("persons.list.client.omde.able.order")?(d(),p(g,{disabled:t.sts_verify_step_one!==2,key:"5"},{default:o(()=>[a(O,{"ok-text":"بله","cancel-text":"خیر",title:"آیا مطمئن هستید؟",onConfirm:i=>de(t)},{default:o(()=>[l("div",ct,[(d(),p(N(t.sts===1?y(H):y(M)),{class:T(["cursor-pointer w-5 ml-1",t.sts===1?"text-success":"text-danger"])},null,8,["class"])),l("div",null,v(t.sts===1?"معلق کردن سفارش":"فعال کردن سفارش"),1)])]),_:2},1032,["onConfirm"])]),_:2},1032,["disabled"])):w("",!0),s("persons.list.client.omde.able")?(d(),p(g,{disabled:t.sts_verify_step_one!==2,key:"6"},{default:o(()=>[a(O,{"ok-text":"بله","cancel-text":"خیر",title:"آیا مطمئن هستید؟",onConfirm:i=>ue(t)},{default:o(()=>[l("div",ut,[(d(),p(N(t.sts===1?y(H):y(M)),{class:T(["cursor-pointer w-5 ml-1",t.active===1?"text-success":"text-danger"])},null,8,["class"])),l("div",null,v(t.active===1?"معلق کردن حساب کاربری":" فعال کردن حساب کاربری"),1)])]),_:2},1032,["onConfirm"])]),_:2},1032,["disabled"])):w("",!0)]),_:2},1032,["onClick"])]),default:o(()=>[l("div",et,[a(y(Te)),a(y(ze),{class:"cursor-pointer w-5 ml-1"})])]),_:2},1024)])]),_:2},[c.showAddButton?{name:"add",fn:o(()=>[a(Le,{rid:"persons.create.client","add-label":"افزودن مشتری عمده",onAdd:me})]),key:"0"}:void 0,Ne(Z,t=>({name:t.slot,fn:o(({record:i})=>[i[t.field]===null||i[t.field]===void 0?(d(),b("span",Ze,"—")):(d(),p(E,{key:1,title:i.acc_at?`به‌روزرسانی: ${te(i.acc_at)}`:void 0},{default:o(()=>[l("span",{class:T(K(i[t.field]))},v(ee(i[t.field],t.places)),3)]),_:2},1032,["title"]))])}))]),1032,["model"]),a(he,{open:k.value.open,title:"رد مدارک مشتری","ok-text":"ثبت رد","cancel-text":"انصراف","ok-button-props":{danger:!0},"confirm-loading":k.value.saving,onOk:ie,onCancel:n[2]||(n[2]=t=>k.value.open=!1)},{default:o(()=>[n[10]||(n[10]=l("p",null,"دلیل رد (اختیاری) — در پرونده‌ی مشتری ثبت می‌شود.",-1)),a(Ce,{value:k.value.reason,"onUpdate:value":n[1]||(n[1]=t=>k.value.reason=t),rows:3,maxlength:500,placeholder:"مثلاً: تصویر کارت ملی خوانا نیست"},null,8,["value"])]),_:1},8,["open","confirm-loading"]),c.showAddButton?(d(),p(Pe,{key:D.value??"new","as-modal":"",open:I.value,id:D.value,"onUpdate:open":n[3]||(n[3]=t=>I.value=t),onSuccess:n[4]||(n[4]=t=>{var i;return(i=x.value)==null?void 0:i.fetch()})},null,8,["open","id"])):w("",!0)]),_:2},[c.accountingSync?{name:"extra",fn:o(()=>[a(Ve,{endpoint:"admin/customers-omde/accounting-sync",onDone:n[0]||(n[0]=t=>{var i;return(i=x.value)==null?void 0:i.fetch()})})]),key:"0"}:void 0]),1032,["title"])])}}}),ht=Ae(dt,[["__scopeId","data-v-287c42bd"]]);export{Xe as O,ht as a,Ct as b};