Files
zyt/server/public/admin/assets/progress-BVpNfzBl.js
T
2026-10-17 16:13:23 +08:00

2 lines
11 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{o as at,W as Nt,M as $,ap as Et,aq as St,q as i,r as c,s as a,v as l,D as r,u as I,cg as Vt,w as xt,L as k,az as Ct,cy as Mt,bi as $t,bh as It,bB as et,bc as Tt,aA as Dt,K as At,cz as Rt,cn as Pt,F as U,G as nt,O as T,be as Yt,T as p,bf as zt,P as N,ac as Bt,bn as Ut,bl as Lt,ae as G,bm as Ft,bY as Ot,aC as qt,p as D,bk as Gt,bC as Kt}from"./.pnpm-CyuAWpdG.js";import{d as K}from"./dayjs-B2bPhvDy.js";import{f as jt,a as st}from"./doctor-8vo_5fa4.js";import{u as Wt,_ as Ht}from"./index-Dxvz9lb1.js";const Zt={class:"dp-page"},Jt={class:"dp-glass dp-toolbar"},Qt={class:"dp-toolbar-row"},Xt={class:"dp-field-label"},wt={class:"dp-field-label"},te={class:"dp-field-label"},ee={class:"dp-toolbar-actions"},ne={key:0,class:"dp-glass dp-doc-section"},se={class:"dp-section-head"},ae={class:"dp-glass dp-table-wrap"},le={class:"dp-table-head"},oe={class:"dp-table-head-left"},ie={key:0,class:"dp-table-range"},de={class:"dp-table-badges"},ue={key:0,class:"dp-chip dp-chip--account"},re={key:1,class:"dp-chip dp-chip--doc"},ce={key:2,class:"dp-chip dp-chip--count"},pe={key:3,class:"dp-chip dp-chip--muted"},me={class:"dp-my-patients-eta"},_e={class:"dp-cell-user-body"},fe={class:"dp-avatar"},ve={class:"dp-user-meta"},be={class:"dp-user-name"},ge={class:"dp-user-phone"},he={class:"dp-time"},ye={class:"dp-steps"},ke={class:"dp-step-dot"},Ne={class:"dp-step-text"},Ee={class:"dp-step-name"},Se={key:0,class:"dp-step-hint"},Ve={key:1,class:"dp-muted"},xe={key:1,class:"dp-muted"},Ce=at({name:"doctorProgress"}),Me=at({...Ce,setup($e){const lt=Nt(),j=Wt(),A=$(!1),E=$([]),f=$(void 0),S=$([]),R=()=>K().format("YYYY-MM-DD"),h=$([R(),R()]),v=qt({status:"",patient_name:""}),W=D(()=>{const e=f.value;if(e===void 0)return"";const t=E.value.find(n=>Number(n.id)===e);return t?String(t.name||t.account||""):""}),ot=D(()=>{var t;const e=(t=j.userInfo)==null?void 0:t.id;return e!=null&&e!==""?Number(e):NaN}),H=D(()=>{const e=j.userInfo||{};return String(e.name||e.account||"").trim()});function L(e){const t=ot.value;if(Number.isNaN(t))return!1;const n=e==null?void 0:e.assistant_id;return n==null||n===""?!1:Number(n)===t}const it=15,Z=$(0);let P=null;function J(e){const t=String(e.appointment_date||"");let n=e.appointment_time||"";return typeof n=="string"&&n.length>5&&(n=n.slice(0,5)),`${t} ${n}`.trim()}function dt(e){const t=e.appointment_date;if(!t)return null;let n=e.appointment_time||"00:00";typeof n=="string"&&n.length>5&&(n=n.slice(0,5));const o=K(`${t} ${n}`);return o.isValid()?o:null}function Q(e){const t=Math.max(0,Math.round(e));if(t===0)return"不到 1 分钟";if(t<60)return`${t} 分钟`;const n=Math.floor(t/60),o=t%60;return o===0?`${n} 小时`:`${n} 小时${o} 分钟`}function ut(e){if(Z.value,!L(e))return"";const t=Number(e.status);if(t===3)return"面诊已完成(医生已点完成)";if(t===4)return"已过号,无法按序预估";if(t!==1)return"";const n=K(),o=dt(e),d=o?o.isAfter(n):!1,m=d&&o?Math.max(0,o.diff(n,"minute")):0,y=S.value.filter(u=>u.appointment_date===e.appointment_date&&Number(u.status)===1).slice().sort((u,C)=>{const B=J(u).localeCompare(J(C));return B!==0?B:Number(u.id)-Number(C.id)}).findIndex(u=>Number(u.id)===Number(e.id)),b=y>=0?y:0,x=b*it,_=[];return d&&_.push(`距预约时段还有约 ${Q(m)}`),b===0?_.push(d?"到号后可优先安排面诊":"已到号,可尽快面诊"):_.push(`前面约 ${b} 人,按序粗估约 ${Q(x)}`),_.join(";")}function X(){const e=v.status;return e===""||e===void 0||e===null}const Y=D(()=>X()?S.value.filter(e=>Number(e.status)===3).length:0),F=D(()=>X()?S.value.filter(e=>Number(e.status)!==3):S.value),rt=D(()=>Y.value>0&&F.value.length===0?`本时段有 ${Y.value} 条「已完成」已隐藏,可在状态中选择「已完成」查看`:"该时段内暂无挂号");function ct(e){const t=String(e||"?").trim();return t?t[0]:"?"}function pt(e){const t=e.appointment_date||"";let n=e.appointment_time||"";return typeof n=="string"&&n.length>5&&(n=n.slice(0,5)),t?`${t} ${n}`.trim():"—"}function mt(e){return e===3?"success":e===4?"warning":e===2?"info":"primary"}function w(e){const t=Number(e.status)===2,n=!t&&[1,3,4].includes(Number(e.status)),o=!!e.diagnosis_confirmed,d=Number(e.status)===3,m=!!e.has_prescription;return[{label:"挂号",done:n,current:n&&!o&&Number(e.status)===1,hint:t?"已取消":Number(e.status)===4?"已过号":""},{label:"确认诊单",done:o,current:n&&!o,hint:""},{label:"就诊中",done:d,current:n&&o&&!d&&Number(e.status)===1,hint:Number(e.status)===1&&o?"待完诊":""},{label:"开方",done:m,current:d&&!m,hint:""}]}function _t(e){const n=w(e).filter(o=>o.done).length;return Math.round(n/4*100)}const O=2e3,ft=15e3;let z=null;async function vt(){const e=await jt({role_id:1,page_type:0,page_no:1,progress_board:1});if(E.value=(e==null?void 0:e.lists)||[],!E.value.length){f.value=void 0,S.value=[];return}const t=E.value.some(n=>Number(n.id)===f.value);(f.value===void 0||!t)&&(f.value=Number(E.value[0].id))}async function V(e){var n,o;if(f.value===void 0){S.value=[];return}const t=(e==null?void 0:e.silent)===!0;t||(A.value=!0);try{const d={doctor_id:f.value,page_type:1,page_no:1,page_size:O,prescription_today_only:1,exclude_cancelled:1,progress_board:1};((n=h.value)==null?void 0:n.length)===2&&(d.start_date=h.value[0],d.end_date=h.value[1]),v.status!==""&&(d.status=v.status),(o=v.patient_name)!=null&&o.trim()&&(d.patient_name=v.patient_name.trim());const m=await st(d);let g=(m==null?void 0:m.lists)||[];const y=Number((m==null?void 0:m.count)??g.length);if(y>g.length&&g.length>=O){const b=[],x=Math.min(Math.ceil(y/O),20);for(let _=2;_<=x;_++){const u=await st({...d,page_no:_}),C=(u==null?void 0:u.lists)||[];if(!C.length)break;b.push(...C)}g=[...g,...b]}S.value=[...g].sort((b,x)=>{const _=`${b.appointment_date||""} ${b.appointment_time||""}`,u=`${x.appointment_date||""} ${x.appointment_time||""}`;return _.localeCompare(u)})}catch(d){console.error(d),t||(S.value=[])}finally{t||(A.value=!1)}}function bt(){typeof document<"u"&&document.hidden||V({silent:!0}).catch(()=>{})}function gt(){v.status="",v.patient_name="",h.value=[R(),R()],V()}function ht(e){lt.push({path:"/tcm/diagnosis",query:{id:String(e)}})}return Et(async()=>{await vt(),await V(),z=setInterval(bt,ft),P=setInterval(()=>{Z.value+=1},6e4)}),St(()=>{z!=null&&(clearInterval(z),z=null),P!=null&&(clearInterval(P),P=null)}),(e,t)=>{var tt;const n=xt,o=Ct,d=$t,m=It,g=Dt,y=At,b=Yt,x=zt,_=Kt,u=Lt,C=Ft,B=Ot,yt=Gt,kt=Ut;return i(),c("div",Zt,[a("section",Jt,[a("div",Qt,[a("span",Xt,[l(n,null,{default:r(()=>[l(I(Vt))]),_:1}),t[9]||(t[9]=k(" 预约日期 ",-1))]),l(o,{modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=s=>h.value=s),type:"daterange","range-separator":"—","start-placeholder":"开始","end-placeholder":"结束","value-format":"YYYY-MM-DD","unlink-panels":"",class:"dp-field-date",onChange:t[1]||(t[1]=()=>V())},null,8,["modelValue"]),a("span",wt,[l(n,null,{default:r(()=>[l(I(Mt))]),_:1}),t[10]||(t[10]=k(" 状态 ",-1))]),l(m,{modelValue:v.status,"onUpdate:modelValue":t[2]||(t[2]=s=>v.status=s),placeholder:"全部",clearable:"",class:"dp-field-select",onChange:t[3]||(t[3]=()=>V())},{default:r(()=>[l(d,{label:"全部状态",value:""}),l(d,{label:"已预约(待就诊)",value:"1"}),l(d,{label:"已完成",value:"3"}),l(d,{label:"已过号",value:"4"})]),_:1},8,["modelValue"]),a("span",te,[l(n,null,{default:r(()=>[l(I(et))]),_:1}),t[11]||(t[11]=k(" 患者 ",-1))]),l(g,{modelValue:v.patient_name,"onUpdate:modelValue":t[4]||(t[4]=s=>v.patient_name=s),placeholder:"姓名",clearable:"",class:"dp-field-search",onKeyup:t[5]||(t[5]=Tt(()=>V(),["enter"]))},null,8,["modelValue"]),a("div",ee,[l(y,{type:"primary",loading:A.value,icon:I(et),onClick:t[6]||(t[6]=()=>V())},{default:r(()=>[...t[12]||(t[12]=[k(" 查询 ",-1)])]),_:1},8,["loading","icon"]),l(y,{icon:I(Rt),onClick:gt},{default:r(()=>[...t[13]||(t[13]=[k("重置",-1)])]),_:1},8,["icon"])])])]),E.value.length?(i(),c("section",ne,[a("div",se,[l(n,{class:"dp-section-icon"},{default:r(()=>[l(I(Pt))]),_:1}),t[14]||(t[14]=a("span",{class:"dp-section-title"},"选择医生",-1)),t[15]||(t[15]=a("span",{class:"dp-section-hint"},"切换后自动加载该医生挂号",-1))]),l(x,{modelValue:f.value,"onUpdate:modelValue":t[7]||(t[7]=s=>f.value=s),class:"dp-doc-pills",onChange:t[8]||(t[8]=()=>V())},{default:r(()=>[(i(!0),c(U,null,nt(E.value,s=>(i(),T(b,{key:s.id,label:Number(s.id),class:"dp-doc-pill"},{default:r(()=>[k(p(s.name||s.account||"—"),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])):N("",!0),Bt((i(),c("section",ae,[a("div",le,[a("div",oe,[t[16]||(t[16]=a("span",{class:"dp-table-title"},"患者列表",-1)),((tt=h.value)==null?void 0:tt.length)===2?(i(),c("span",ie,p(h.value[0])+" ~ "+p(h.value[1]),1)):N("",!0)]),a("div",de,[H.value?(i(),c("span",ue,"当前账号 "+p(H.value),1)):N("",!0),W.value?(i(),c("span",re,p(W.value),1)):N("",!0),f.value!==void 0&&!A.value?(i(),c("span",ce,p(F.value.length)+" 人",1)):N("",!0),Y.value>0?(i(),c("span",pe,"已隐藏已完成 "+p(Y.value),1)):N("",!0)])]),E.value.length?f.value===void 0?(i(),T(_,{key:1,description:"请选择医生"})):(i(),T(yt,{key:2,data:F.value,class:"dp-table",size:"default","empty-text":rt.value},{default:r(()=>[l(u,{label:"患者","min-width":"200",fixed:"left"},{default:r(({row:s})=>[a("div",{class:G(["dp-cell-user",{"is-my-patients":L(s)}])},[L(s)?(i(),c(U,{key:0},[t[17]||(t[17]=a("div",{class:"dp-my-patients-caption"},"我的患者",-1)),a("div",me,p(ut(s)),1)],64)):N("",!0),a("div",_e,[a("div",fe,p(ct(s.patient_name)),1),a("div",ve,[a("span",be,p(s.patient_name||"—"),1),a("span",ge,p(s.patient_phone||"—"),1)])])],2)]),_:1}),l(u,{label:"预约时间",width:"170"},{default:r(({row:s})=>[a("span",he,p(pt(s)),1)]),_:1}),l(u,{label:"挂号",width:"104",align:"center"},{default:r(({row:s})=>[l(C,{type:mt(s.status),effect:"light",round:"",size:"small"},{default:r(()=>[k(p(s.status_desc),1)]),_:2},1032,["type"])]),_:1}),l(u,{label:"面诊进度","min-width":"360"},{default:r(({row:s})=>[a("div",ye,[(i(!0),c(U,null,nt(w(s),(M,q)=>(i(),c(U,{key:q},[a("div",{class:G(["dp-step",{"is-done":M.done,"is-current":M.current&&!M.done}])},[a("div",ke,p(q+1),1),a("div",Ne,[a("span",Ee,p(M.label),1),M.hint?(i(),c("span",Se,p(M.hint),1)):N("",!0)])],2),q<3?(i(),c("div",{key:0,class:G(["dp-step-line",{"is-done":M.done}])},null,2)):N("",!0)],64))),128))]),l(B,{percentage:_t(s),"stroke-width":8,class:"dp-progress"},null,8,["percentage"])]),_:1}),l(u,{label:"处方",width:"92",align:"center"},{default:r(({row:s})=>[s.has_prescription?(i(),T(C,{key:0,type:"success",effect:"dark",round:"",size:"small"},{default:r(()=>[...t[18]||(t[18]=[k("已开",-1)])]),_:1})):(i(),c("span",Ve,"未开"))]),_:1}),l(u,{label:"操作",width:"96",fixed:"right",align:"center"},{default:r(({row:s})=>[s.diagnosis_id?(i(),T(y,{key:0,type:"primary",size:"small",round:"",plain:"",onClick:M=>ht(s.diagnosis_id)},{default:r(()=>[...t[19]||(t[19]=[k(" 诊单 ",-1)])]),_:1},8,["onClick"])):(i(),c("span",xe,"—"))]),_:1})]),_:1},8,["data","empty-text"])):(i(),T(_,{key:0,description:"暂无医生数据"}))])),[[kt,A.value]])])}}}),Re=Ht(Me,[["__scopeId","data-v-607f52e0"]]);export{Re as default};