import{d as y,h as l,o as r,g as d,u,i as b,w as c,j as t,k as s,l as i,b as h,F as m,p as w,S}from"./app-Cb9hmj6k.js";import{a as v}from"./AppLayout.vue_vue_type_script_setup_true_lang-CteAxl0C.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./AppLogoIcon.vue_vue_type_script_setup_true_lang-DKWl2XLX.js";import"./index-hboZUdbT.js";import"./RovingFocusGroup-CP1IPgEn.js";import"./index-bRFR14ax.js";const k={class:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4"},L={class:"text-2xl font-bold mb-4"},N={class:"w-full text-sm text-left text-gray-700"},V={class:"divide-y divide-gray-100"},B={class:"px-4 py-3 font-medium capitalize"},C={class:"px-4 py-3"},F={class:"px-4 py-3"},j={class:"px-4 py-3"},$={key:0},z=y({__name:"Show",props:{user:Object,requests:Array,avg_hours:Number},setup(x){const _=[{title:"Монтажник",href:"/installers/{user}"}],a=x,g={new:"Новая",assigned:"Назначена",in_progress:"В работе",done:"Завершена",cancelled:"Отменена"};function f(n){return g[n]??n}return(n,e)=>(r(),l(m,null,[d(u(b),{title:`Монтажник: ${a.user.name}`},null,8,["title"]),d(v,{breadcrumbs:_},{default:c(()=>{var p;return[t("div",k,[t("h1",L,"Монтажник: "+s(a.user.name),1),t("p",null,[e[0]||(e[0]=t("strong",null,"Рейтинг:",-1)),i(" "+s(((p=a.user.rating)==null?void 0:p.toFixed(1))??"—"),1)]),t("p",null,[e[1]||(e[1]=t("strong",null,"Среднее время выполнения:",-1)),i(" "+s(a.avg_hours??"—")+" часов",1)]),e[5]||(e[5]=t("h2",{class:"mt-6 text-xl font-semibold mb-2"},"Заявки",-1)),t("table",N,[e[3]||(e[3]=t("thead",{class:"text-xs text-gray-500 uppercase bg-gray-50 border-b"},[t("tr",null,[t("th",{class:"px-4 py-3"},"Статус"),t("th",{class:"px-4 py-3"},"Дата создания"),t("th",{class:"px-4 py-3"},"Запланированная дата"),t("th",{class:"px-4 py-3"},"Дата завершения")])],-1)),t("tbody",V,[(r(!0),l(m,null,w(a.requests,o=>(r(),l("tr",{key:o.id,class:"hover:bg-gray-50 transition-colors"},[t("td",B,s(f(o.status)),1),t("td",C,s(new Date(o.created_at).toLocaleDateString()),1),t("td",F,s(new Date(o.scheduled_date).toLocaleDateString()),1),t("td",j,s(o.completed_at?new Date(o.completed_at).toLocaleDateString():"—"),1)]))),128)),a.requests.length===0?(r(),l("tr",$,e[2]||(e[2]=[t("td",{colspan:"4",class:"px-4 py-6 text-center text-gray-500"},"Заявок нет",-1)]))):h("",!0)])]),d(u(S),{href:"/installers/stats",class:"inline-block mt-6 text-blue-600 underline"},{default:c(()=>e[4]||(e[4]=[i(" ← Вернуться к списку монтажников ")])),_:1,__:[4]})])]}),_:1})],64))}}),J=D(z,[["__scopeId","data-v-c8d31471"]]);export{J as default};
