// SYSTEM PANEL //
[ROOT]
/
home
/
csender
/
legus.lawnet.me_backup_20250830-203603
/
assets
[ PARENT ]
EDIT :: CasesManagement-newFXDY6.js
import{d as ye,r as i,c as m,g as fe,a as we,o as he,b as a,e as z,f as e,i as F,T as Ce,S as _e,n as $,h as j,u as N,j as se,t as u,w as p,v as y,k as B,l as V,F as E,m as S,B as oe,p as ke,q as Ae,C as re,s as Fe,D as Ve,E as Ee,x as De,y as Me,z as l,_ as Le}from"./index-B7W3O7UI.js";const He={class:"min-h-screen bg-[#F4F4F6]",dir:"rtl"},je={class:"flex pt-16"},Be={class:"px-6 py-4"},Se={class:"flex items-center justify-between mb-4"},Ue={key:0,class:"flex justify-center items-center p-8"},Te={key:1,class:"p-8 text-center"},Pe={class:"text-red-500 mb-4"},ze={class:"text-sm text-gray-600 mt-1"},$e={key:2,class:"p-6"},Ne={class:"bg-white rounded-lg border border-gray-200 p-6 mb-6"},Ie={class:"flex items-center justify-between w-full",dir:"rtl"},qe={class:"flex items-center gap-4"},Re={class:"flex-1 flex justify-center"},Ze={class:"relative"},Oe={class:"flex items-center gap-4"},Qe={class:"flex items-center gap-2"},Ge={class:"bg-white rounded-lg border border-gray-200 flex-1"},Je={class:"overflow-x-auto"},Ke={class:"w-full border-collapse border border-gray-200"},We={key:0},Xe={class:"px-4 py-3 border-r border-gray-200"},Ye={class:"flex items-center gap-2"},et={class:"text-sm text-[#DA7E13] font-medium"},tt=["onClick"],st={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},ot={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},rt={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},at={key:0},lt={key:1},nt={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},dt={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},it={class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"},ut={class:"px-4 py-3 border-r border-gray-200"},ct={class:"px-4 py-3 border-r border-gray-200"},pt={class:"flex items-center gap-1 justify-end",dir:"rtl"},vt=["onClick"],gt={key:0,class:"bg-white rounded-lg border border-gray-200 p-12 text-center mt-4"},bt={key:1,class:"bg-white rounded-lg border border-gray-200 p-4 mt-4"},xt={class:"flex items-center justify-center gap-2"},mt=["disabled"],yt={class:"flex items-center gap-1"},ft=["onClick"],wt={key:1,class:"px-2 text-gray-500"},ht=["disabled"],Ct={class:"p-6"},_t={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},kt={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},At=["value"],Ft=["value"],Vt={class:"flex items-center gap-4 p-6 border-t border-gray-200"},Et=["disabled"],Dt={key:0,class:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"},Mt={key:1,class:"w-4 h-4 fill-current",viewBox:"0 0 24 24"},Lt=ye({__name:"CasesManagement",setup(Ht){const ae=(o,t)=>{let r;return(...s)=>{clearTimeout(r),r=setTimeout(()=>o.apply(null,s),t)}},f=i(!1),U=i(!1),D=i(""),w=i(!1),le=Ee(),ne=m(()=>fe()),de=m(()=>we()),I=i([]),q=i([]),R=i([]),c=i(""),v=i({status:"",priority:"",case_type:"",client_id:void 0,assigned_employee_id:void 0}),d=i(1),b=i(15),Z=i(0),O=i(!1),n=i({title:"",case_type:"",client_id:0,assigned_employee_id:void 0,priority:"medium",status:"open",start_date:new Date().toISOString().split("T")[0],description:""}),ie=m(()=>{let o=I.value;return c.value&&(o=o.filter(t=>{var r,s,x,h,C,_,k,H,A,X,Y,ee,te;return((r=t.title)==null?void 0:r.toLowerCase().includes(c.value.toLowerCase()))||((s=t.case_number)==null?void 0:s.toLowerCase().includes(c.value.toLowerCase()))||((x=t.id)==null?void 0:x.toString().includes(c.value))||((C=(h=t.client)==null?void 0:h.name_ar)==null?void 0:C.toLowerCase().includes(c.value.toLowerCase()))||((k=(_=t.client)==null?void 0:_.trade_name_ar)==null?void 0:k.toLowerCase().includes(c.value.toLowerCase()))||((A=(H=t.assigned_user)==null?void 0:H.name)==null?void 0:A.toLowerCase().includes(c.value.toLowerCase()))||((Y=(X=t.case_type)==null?void 0:X.name_ar)==null?void 0:Y.toLowerCase().includes(c.value.toLowerCase()))||((te=(ee=t.court)==null?void 0:ee.name_ar)==null?void 0:te.toLowerCase().includes(c.value.toLowerCase()))})),o}),T=m(()=>{const o=(d.value-1)*b.value,t=o+b.value;return ie.value.slice(o,t)}),M=m(()=>Math.ceil(Z.value/b.value)),ue=m(()=>{const o=M.value,t=d.value,r=[];if(o<=7)for(let s=1;s<=o;s++)r.push(s);else t<=4?r.push(1,2,3,4,5,"...",o):t>=o-3?r.push(1,"...",o-4,o-3,o-2,o-1,o):r.push(1,"...",t-1,t,t+1,"...",o);return r}),Q=()=>{f.value=!f.value},g=async()=>{U.value=!0,D.value="";try{const o=ne.value,t={page:d.value,per_page:b.value,search:c.value||void 0,case_status_id:v.value.status||void 0,case_priority_id:v.value.priority||void 0,case_type_id:v.value.case_type||void 0,client_id:v.value.client_id,assigned_user_id:v.value.assigned_employee_id};ke()||Ae()?o&&"officeId"in o&&(t.office_id=o.officeId):se()&&o&&"id"in o&&(t.client_id=o.id),Object.keys(t).forEach(s=>t[s]===void 0&&delete t[s]),console.log("Loading cases with filters:",t);const r=await re.getCases(t);if(r.success&&r.data)I.value=r.data,Z.value=r.data.length,console.log(`Loaded ${r.data.length} cases for user role: ${de.value}`);else throw new Error(r.message||"فشل في تحميل القضايا")}catch(o){D.value=o.message||"حدث خطأ في تحميل القضايا",console.error("Failed to load cases:",o)}finally{U.value=!1}},ce=async()=>{try{const o=await Fe.getClients({per_page:100});o.success&&o.data&&(q.value=o.data);const t=await Ve.getEmployees({per_page:100});t.success&&t.data&&(R.value=t.data)}catch(o){console.error("Failed to load dropdown data:",o)}},G=ae(()=>{d.value=1,g()},500),P=()=>{d.value=1,g()},pe=()=>{le.push("/cases/add")},L=()=>{O.value=!1},J=async()=>{if(!n.value.title||!n.value.client_id||!n.value.case_type){alert("يرجى ملء جميع الحقول المطلوبة");return}w.value=!0;try{const o=await re.createCase(n.value);if(o.success)L(),g(),alert("تم إنشاء القضية بنجاح");else throw new Error(o.message||"فشل في إنشاء القضية")}catch(o){alert(o.message||"حدث خطأ في إنشاء القضية"),console.error("Failed to create case:",o)}finally{w.value=!1}},ve=o=>{var s;if(!o)return"bg-gray-100 text-gray-800";const t=((s=o.name_en)==null?void 0:s.toLowerCase())||"";return{open:"bg-blue-100 text-blue-800",new:"bg-blue-100 text-blue-800",pending:"bg-blue-100 text-blue-800","in progress":"bg-yellow-100 text-yellow-800","under review":"bg-yellow-100 text-yellow-800","on hold":"bg-orange-100 text-orange-800",active:"bg-green-100 text-green-800",closed:"bg-green-100 text-green-800",completed:"bg-green-100 text-green-800",resolved:"bg-green-100 text-green-800",cancelled:"bg-red-100 text-red-800",rejected:"bg-red-100 text-red-800"}[t]||"bg-gray-100 text-gray-800"},K=o=>o?o.client_type==="individual"?o.name_ar||o.name_en||"غير محدد":o.client_type==="company"?o.trade_name_ar||"غير محدد":o.name_ar||o.name_en||o.trade_name_ar||"غير محدد":"غير محدد",ge=o=>{const t=`${window.location.origin}/cases/${o}`;navigator.share?navigator.share({title:"مشاركة القضية",url:t}).catch(r=>console.error("Error sharing:",r)):(W(t),alert("تم نسخ رابط القضية إلى الحافظة"))},W=async o=>{try{await navigator.clipboard.writeText(o)}catch(t){console.error("Failed to copy text: ",t)}},be=()=>{d.value>1&&(d.value--,g())},xe=()=>{d.value<M.value&&(d.value++,g())},me=o=>{typeof o=="number"&&o!==d.value&&(d.value=o,g())};return he(()=>{Promise.all([g(),ce()])}),(o,t)=>{const r=Me("router-link");return l(),a("div",He,[z(Ce,{sidebarCollapsed:f.value,onToggleSidebar:Q},null,8,["sidebarCollapsed"]),e("div",je,[z(_e,{isCollapsed:f.value,onToggle:Q},null,8,["isCollapsed"]),e("div",{class:$(["flex-1 min-h-full transition-all duration-300",f.value?"mr-16":"mr-64"])},[e("div",Be,[e("div",Se,[t[13]||(t[13]=e("h1",{class:"text-2xl font-bold text-[#1a1a1a]"},"إدارة القضايا",-1)),N(se)()?F("",!0):(l(),a("button",{key:0,onClick:pe,class:"flex items-center gap-3 px-6 py-3 bg-[#DA7E13] text-white rounded-lg hover:bg-[#DA7E13]/90 transition-colors text-base font-medium"},t[12]||(t[12]=[e("svg",{class:"w-4 h-4 fill-current",viewBox:"0 0 24 24"},[e("path",{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"})],-1),e("span",null,"إضافة قضية",-1)])))]),t[14]||(t[14]=j('<nav class="flex items-center text-sm text-gray-600" dir="rtl" data-v-c46c64d9><span class="text-[#DA7E13]" data-v-c46c64d9>الرئيسية</span><span class="mx-2" data-v-c46c64d9>/</span><span class="text-[#DA7E13]" data-v-c46c64d9>إدارة القضايا</span><span class="mx-2" data-v-c46c64d9>/</span><span class="text-gray-400" data-v-c46c64d9>القضايا</span></nav>',1))]),U.value?(l(),a("div",Ue,t[15]||(t[15]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-[#DA7E13] mx-auto"}),e("p",{class:"mt-2 text-gray-600"},"جاري تحميل القضايا...")],-1)]))):D.value?(l(),a("div",Te,[e("div",Pe,[t[16]||(t[16]=e("svg",{class:"w-12 h-12 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),t[17]||(t[17]=e("p",{class:"text-lg font-medium"},"خطأ في تحميل القضايا",-1)),e("p",ze,u(D.value),1)]),e("button",{onClick:g,class:"px-4 py-2 bg-[#DA7E13] text-white rounded hover:bg-[#DA7E13]/90"}," إعادة المحاولة ")])):(l(),a("div",$e,[e("div",Ne,[e("div",Ie,[e("div",qe,[t[20]||(t[20]=e("h2",{class:"text-lg font-semibold text-[#54524F] whitespace-nowrap"},"بيانات القضايا",-1)),p(e("select",{"onUpdate:modelValue":t[0]||(t[0]=s=>v.value.status=s),onChange:P,class:"px-4 py-2 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-[#DA7E13] focus:border-[#DA7E13] bg-white min-w-[140px]"},t[18]||(t[18]=[j('<option value="" data-v-c46c64d9>جميع الحالات</option><option value="1" data-v-c46c64d9>جديدة</option><option value="2" data-v-c46c64d9>قيد المراجعة</option><option value="3" data-v-c46c64d9>نشطة</option><option value="4" data-v-c46c64d9>مكتملة</option><option value="5" data-v-c46c64d9>ملغاة</option><option value="6" data-v-c46c64d9>مرفوضة</option><option value="7" data-v-c46c64d9>مؤجلة</option>',8)]),544),[[y,v.value.status]]),p(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>v.value.priority=s),onChange:P,class:"px-4 py-2 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-[#DA7E13] focus:border-[#DA7E13] bg-white min-w-[140px]"},t[19]||(t[19]=[j('<option value="" data-v-c46c64d9>جميع الأولويات</option><option value="1" data-v-c46c64d9>منخفض</option><option value="2" data-v-c46c64d9>عالي</option><option value="3" data-v-c46c64d9>عاجل</option><option value="4" data-v-c46c64d9>حرج</option>',5)]),544),[[y,v.value.priority]])]),e("div",Re,[e("div",Ze,[p(e("input",{"onUpdate:modelValue":t[2]||(t[2]=s=>c.value=s),onInput:t[3]||(t[3]=(...s)=>N(G)&&N(G)(...s)),type:"text",placeholder:"بحث...",class:"w-80 px-4 py-2 pr-10 border border-gray-300 rounded text-right text-sm focus:ring-2 focus:ring-[#DA7E13] focus:border-[#DA7E13] bg-white"},null,544),[[B,c.value]]),t[21]||(t[21]=e("svg",{class:"absolute right-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))])]),e("div",Oe,[e("div",Qe,[t[23]||(t[23]=e("span",{class:"text-sm text-[#54524F]"},"عرض",-1)),p(e("select",{"onUpdate:modelValue":t[4]||(t[4]=s=>b.value=s),onChange:P,class:"px-3 py-2 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-[#DA7E13] focus:border-[#DA7E13] bg-white"},t[22]||(t[22]=[e("option",{value:"15"},"15",-1),e("option",{value:"10"},"10",-1),e("option",{value:"25"},"25",-1),e("option",{value:"50"},"50",-1)]),544),[[y,b.value]])]),t[24]||(t[24]=e("button",{class:"flex items-center gap-2 px-4 py-2 bg-transparent text-[#54524F] text-sm font-medium rounded-lg border border-gray-300 hover:bg-gray-50 transition-colors"},[e("svg",{class:"w-4 h-4 fill-[#DA7E13]",viewBox:"0 0 24 24"},[e("path",{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"})]),V(" تصدير ")],-1))])])]),e("div",Ge,[e("div",Je,[e("table",Ke,[t[31]||(t[31]=e("thead",{class:"bg-[#F8F9FA]"},[e("tr",{class:"text-right border-b border-gray-200"},[e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"رقم الملف"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"الرقم الآلي"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"الفرع"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"الموكل"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"المحكمة"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"الدائرة"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"نوع القضية"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"المرحلة الحالية"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"الحالة"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"تاريخ اخر جلسة"),e("th",{class:"px-4 py-3 text-sm font-medium text-[#54524F] border-r border-gray-200"},"خيارات")])],-1)),e("tbody",null,[T.value.length===0?(l(),a("tr",We,t[25]||(t[25]=[e("td",{colspan:"11",class:"text-center py-8 text-gray-500"},[e("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})]),e("p",null,"لا توجد قضايا مطابقة للبحث")],-1)]))):F("",!0),(l(!0),a(E,null,S(T.value,s=>{var x,h,C,_,k;return l(),a("tr",{key:s.id,class:"hover:bg-gray-50 border-b border-gray-200 last:border-b"},[e("td",Xe,[e("div",Ye,[e("span",et,u(s.file_number||s.id),1),e("button",{class:"text-gray-400 hover:text-[#DA7E13] focus:outline-none focus:ring-0 active:outline-none",onClick:H=>{var A;return W(s.file_number||((A=s.id)==null?void 0:A.toString()))}},t[26]||(t[26]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)]),8,tt)])]),e("td",st,u(s.case_number||"-"),1),e("td",ot,u(((x=s.branch)==null?void 0:x.name_ar)||"الفرع الرئيسي"),1),e("td",rt,[s.client?(l(),a("span",at,u(K(s.client)),1)):(l(),a("span",lt,"غير محدد"))]),e("td",nt,u(((h=s.court)==null?void 0:h.name_ar)||"محكمة الجنح"),1),e("td",dt,u(s.court_round||"-"),1),e("td",it,u(((C=s.judicial_procedure_type)==null?void 0:C.name_ar)||((_=s.case_type)==null?void 0:_.name_ar)||"أحوال شخصية / نسب"),1),t[29]||(t[29]=e("td",{class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"}," ابتدائية ",-1)),e("td",ut,[e("span",{class:$([ve(s.case_status),"px-2 py-1 rounded text-xs"])},u(((k=s.case_status)==null?void 0:k.name_ar)||"غير محدد"),3)]),t[30]||(t[30]=e("td",{class:"px-4 py-3 text-sm text-[#54524F] border-r border-gray-200"}," 01/2024 ",-1)),e("td",ct,[e("div",pt,[z(r,{to:`/cases/${s.id}`,class:"p-1 text-[#DA7E13] hover:bg-orange-50 rounded",title:"عرض"},{default:De(()=>t[27]||(t[27]=[e("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"})],-1)])),_:2,__:[27]},1032,["to"]),e("button",{class:"p-1 text-gray-600 hover:bg-gray-50 rounded",title:"مشاركة",onClick:H=>ge(s.id)},t[28]||(t[28]=[e("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z"})],-1)]),8,vt)])])])}),128))])])])]),T.value.length===0?(l(),a("div",gt,t[32]||(t[32]=[e("svg",{class:"w-16 h-16 mx-auto mb-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),e("h3",{class:"text-lg font-medium text-gray-900 mb-2"},"لا توجد قضايا",-1),e("p",{class:"text-gray-600 mb-4"},"لا توجد قضايا مطابقة لمعايير البحث الخاصة بك",-1)]))):F("",!0),M.value>1?(l(),a("div",bt,[e("div",xt,[e("button",{onClick:be,disabled:d.value===1,class:"px-3 py-1 border border-gray-300 rounded text-sm disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50"}," السابق ",8,mt),e("div",yt,[(l(!0),a(E,null,S(ue.value,s=>(l(),a(E,{key:s},[typeof s=="number"?(l(),a("button",{key:0,onClick:x=>me(s),class:$(["px-3 py-1 rounded text-sm",s===d.value?"bg-[#DA7E13] text-white":"border border-gray-300 hover:bg-gray-50"])},u(s),11,ft)):(l(),a("span",wt,u(s),1))],64))),128))]),e("button",{onClick:xe,disabled:d.value===M.value,class:"px-3 py-1 border border-gray-300 rounded text-sm disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50"}," التالي ",8,ht)])])):F("",!0)]))],2)]),O.value?(l(),a("div",{key:0,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:L},[e("div",{class:"bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto m-4",onClick:t[11]||(t[11]=oe(()=>{},["stop"]))},[e("div",{class:"flex items-center justify-between p-6 border-b border-gray-200"},[t[34]||(t[34]=e("h2",{class:"text-xl font-semibold text-[#273F62]"},"إضافة قضية جديدة",-1)),e("button",{onClick:L,class:"text-gray-400 hover:text-gray-600"},t[33]||(t[33]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("div",Ct,[e("form",{onSubmit:oe(J,["prevent"]),class:"space-y-6",dir:"rtl"},[e("div",_t,[e("div",null,[t[35]||(t[35]=e("label",{class:"block text-sm text-gray-500 mb-1"},[V("عنوان القضية "),e("span",{class:"text-red-500"},"*")],-1)),p(e("input",{"onUpdate:modelValue":t[5]||(t[5]=s=>n.value.title=s),type:"text",required:"",class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-sm text-right",placeholder:"أدخل عنوان القضية"},null,512),[[B,n.value.title]])]),e("div",null,[t[36]||(t[36]=e("label",{class:"block text-sm text-gray-500 mb-1"},[V("نوع القضية "),e("span",{class:"text-red-500"},"*")],-1)),p(e("input",{"onUpdate:modelValue":t[6]||(t[6]=s=>n.value.case_type=s),type:"text",required:"",class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-sm text-right",placeholder:"مثال: جنائي، مدني، تجاري"},null,512),[[B,n.value.case_type]])])]),e("div",kt,[e("div",null,[t[38]||(t[38]=e("label",{class:"block text-sm text-gray-500 mb-1"},[V("العميل "),e("span",{class:"text-red-500"},"*")],-1)),p(e("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>n.value.client_id=s),required:"",class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-sm"},[t[37]||(t[37]=e("option",{value:""},"اختر العميل",-1)),(l(!0),a(E,null,S(q.value,s=>(l(),a("option",{key:s.id,value:s.id},u(K(s)),9,At))),128))],512),[[y,n.value.client_id]])]),e("div",null,[t[40]||(t[40]=e("label",{class:"block text-sm text-gray-500 mb-1"},"المحامي المسؤول",-1)),p(e("select",{"onUpdate:modelValue":t[8]||(t[8]=s=>n.value.assigned_employee_id=s),class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-sm"},[t[39]||(t[39]=e("option",{value:""},"اختر المحامي",-1)),(l(!0),a(E,null,S(R.value,s=>(l(),a("option",{key:s.id,value:s.id},u(s.name_ar||s.name_en),9,Ft))),128))],512),[[y,n.value.assigned_employee_id]])]),e("div",null,[t[42]||(t[42]=e("label",{class:"block text-sm text-gray-500 mb-1"},[V("الأولوية "),e("span",{class:"text-red-500"},"*")],-1)),p(e("select",{"onUpdate:modelValue":t[9]||(t[9]=s=>n.value.priority=s),required:"",class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-sm"},t[41]||(t[41]=[j('<option value="" data-v-c46c64d9>اختر الأولوية</option><option value="low" data-v-c46c64d9>منخفض</option><option value="medium" data-v-c46c64d9>متوسط</option><option value="high" data-v-c46c64d9>عالي</option><option value="urgent" data-v-c46c64d9>عاجل</option>',5)]),512),[[y,n.value.priority]])])]),e("div",null,[t[43]||(t[43]=e("label",{class:"block text-sm text-gray-500 mb-1"},"وصف القضية",-1)),p(e("textarea",{"onUpdate:modelValue":t[10]||(t[10]=s=>n.value.description=s),class:"w-full px-3 py-2 border border-gray-200 rounded focus:outline-none focus:border-gray-400 text-right text-sm",rows:"3",placeholder:"أدخل وصف مفصل للقضية"},null,512),[[B,n.value.description]])])],32)]),e("div",Vt,[e("button",{onClick:J,disabled:w.value,class:"flex-1 flex items-center justify-center gap-2 py-2 bg-[#DA7E13] text-white rounded hover:bg-[#DA7E13]/90 transition-colors disabled:opacity-50"},[w.value?(l(),a("div",Dt)):(l(),a("svg",Mt,t[44]||(t[44]=[e("path",{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},null,-1)]))),e("span",null,u(w.value?"جاري الحفظ...":"إضافة قضية جديدة"),1)],8,Et),e("button",{onClick:L,class:"flex-1 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 transition-colors"}," إلغاء ")])])])):F("",!0)])}}}),Bt=Le(Lt,[["__scopeId","data-v-c46c64d9"]]);export{Bt as default};
SAVE
CANCEL