- 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>
2 lines
3.6 KiB
JavaScript
2 lines
3.6 KiB
JavaScript
import{d as $,x as S,y as c,a as V,w as r,k as D,m as x,z as C,r as d,o as I,c as s,p as l,h as p,t as R,V as j,f as _,W as q,H as B,l as E,G as k,_ as N}from"./index-D8Sl1lAu.js";import{_ as M}from"./CityTreeSelect.vue_vue_type_script_setup_true_lang-C__bi7ea.js";import{D as z}from"./DateInput-B4x80lmy.js";import{U as F}from"./UserOutlined-C6rYnBkL.js";const G={class:"pf-layout pf-layout--single"},H={class:"pf-main"},Q={class:"pf-section"},T={class:"pf-section__head"},W={class:"pf-section__icon"},A={class:"pf-grid-2"},J={class:"pf-actions"},K={class:"pf-actions__hint"},v="لطفا مقدار را وارد کنید",L=$({__name:"singleCustomer",setup(P){const w=D(),y=E(),u=w.params.id,m=x(!1),h=x([]),t=C({fname:"",lname:"",phone:"",city_id:void 0,birth_day:""}),n=C({});async function b(){var a,e;if(Object.keys(n).forEach(o=>delete n[o]),t.fname||(n.fname=v),t.lname||(n.lname=v),t.phone||(n.phone=v),!Object.keys(n).length)try{m.value=!0;const o={...t,name:`${t.fname} ${t.lname}`.trim(),mobile:t.phone};u?await c.put(`single/${u}`,o):await c.post("single",o),k.info("اطلاعات با موفقیت به ثبت رسید."),y.go(-1)}catch(o){k.error(((e=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:e.message)??"خطا در ثبت اطلاعات.")}finally{m.value=!1}}return S(async()=>{try{const{data:a}=await c.post("cities/list");h.value=a.rows??[]}catch(a){console.log(a)}if(u)try{const{data:a}=await c.get(`customer/${u}`);Object.assign(t,{fname:a.fname??"",lname:a.lname??"",phone:a.mobile??"",city_id:a.city_id??void 0,birth_day:a.birth_day??""})}catch(a){console.log(a)}}),(a,e)=>{const o=d("a-input"),f=d("a-form-item"),g=d("a-button"),U=d("a-form"),O=d("a-spin");return I(),V(O,{spinning:m.value},{default:r(()=>[s(U,{layout:"vertical",class:"pf-form",onSubmit:B(b,["prevent"])},{default:r(()=>[l("div",G,[l("div",H,[l("section",Q,[l("div",T,[l("span",W,[s(p(F))]),l("div",null,[l("h3",null,R(p(u)?"ویرایش مشتری":"افزودن مشتری"),1),e[6]||(e[6]=l("p",null,"مشخصات مشتری تک",-1))])]),l("div",A,[s(f,{label:"نام ",required:"","validate-status":n.fname?"error":"",help:n.fname},{default:r(()=>[s(o,{value:t.fname,"onUpdate:value":e[0]||(e[0]=i=>t.fname=i)},null,8,["value"])]),_:1},8,["validate-status","help"]),s(f,{label:"نام خانوادگی",required:"","validate-status":n.lname?"error":"",help:n.lname},{default:r(()=>[s(o,{value:t.lname,"onUpdate:value":e[1]||(e[1]=i=>t.lname=i)},null,8,["value"])]),_:1},8,["validate-status","help"]),s(f,{label:"شماره تلفن همراه",required:"","validate-status":n.phone?"error":"",help:n.phone},{default:r(()=>[s(o,{value:t.phone,"onUpdate:value":e[2]||(e[2]=i=>t.phone=i),class:"ltr-input",inputmode:"tel",placeholder:"09xxxxxxxxx"},null,8,["value"])]),_:1},8,["validate-status","help"]),s(z,{"model-value":t.birth_day||void 0,label:"تاریخ تولد","onUpdate:modelValue":e[3]||(e[3]=i=>t.birth_day=i??"")},null,8,["model-value"]),s(f,{label:"شهر",class:"pf-span-all mb-0"},{default:r(()=>[s(M,{value:t.city_id,"onUpdate:value":e[4]||(e[4]=i=>t.city_id=i),cities:h.value},null,8,["value","cities"])]),_:1})])])])]),l("div",J,[l("span",K,[s(p(j)),e[7]||(e[7]=_(" فیلدهای ستارهدار الزامی هستند.",-1))]),s(g,{onClick:e[5]||(e[5]=i=>p(y).go(-1))},{default:r(()=>[...e[8]||(e[8]=[_("انصراف",-1)])]),_:1}),s(g,{type:"primary",class:"form-submit",loading:m.value,onClick:b},{icon:r(()=>[s(p(q))]),default:r(()=>[e[9]||(e[9]=_(" ثبت اطلاعات ",-1))]),_:1},8,["loading"])])]),_:1})]),_:1},8,["spinning"])}}}),te=N(L,[["__scopeId","data-v-e6b495e6"]]);export{te as S};
|