Files
zyt/server/public/admin/assets/progress-CrGLMdb0.js
T
Your NameandClaude Opus 5 b55f30753c 处方作废不再受签署/审核/订单状态限制,作废后订单随重新开方自动关联;签署原文去掉辅方方名;出丸显示辅方克数;查看处方可下载 CA 原件或药房联/处方联
- 作废:药师签署、审核通过、已有业务订单后均可作废(仍需「作废」权限;已提交药房的订单须先远端取消)。
  作废时关联的待审核/履约中订单处方审核重置为待审核(履约中退回待审核,支付审核保留),
  同诊单重新开方后自动改关联到新处方并写订单日志;已发货/已完成订单按原处方留档。
  迁移 2026_11_30_prescription_order_reissue.sql 新增 reissue_from_prescription_id
- 签署 PDF 不再写入「辅方方名」
- 出丸:有辅方药材时显示「主方 X克,辅方 Y克」(管理后台与桌面端)
- 已开处方「查看处方」下载改为下拉:CA 签署处方 PDF、药房联 PDF、处方联 PDF(A4,按当前笺面样式)
- 重新构建管理后台

Co-Authored-By: Claude Opus 5 <[EMAIL]>
2026-11-30 10:45:08 +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 C,a0 as Et,at as St,q as i,r as c,s as a,v as l,D as r,u as I,ci as Vt,w as xt,L as k,aC as Mt,cy as $t,bm as Ct,bl as It,b_ as et,bd as Tt,a3 as Dt,K as At,cz as Rt,cn as Pt,F as B,G as nt,O as T,bh as Ut,T as p,bi as Yt,P as N,ag as zt,bq as Bt,bo as Lt,ai as G,bp as Ot,bO as Ft,aD as qt,p as D,bn as Gt,by as Kt}from"./.pnpm-DnXobOVo.js";import{d as K}from"./dayjs-aTvZpZ6f.js";import{f as jt,a as st}from"./doctor-ByMfF4JT.js";import{u as Wt,_ as Ht}from"./index-CtDDMof-.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"},_e={class:"dp-my-patients-eta"},me={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"},Me=at({name:"doctorProgress"}),$e=at({...Me,setup(Ce){const lt=Nt(),j=Wt(),A=C(!1),E=C([]),f=C(void 0),S=C([]),R=()=>K().format("YYYY-MM-DD"),h=C([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=C(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,_=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,M)=>{const z=J(u).localeCompare(J(M));return z!==0?z:Number(u.id)-Number(M.id)}).findIndex(u=>Number(u.id)===Number(e.id)),b=y>=0?y:0,x=b*it,m=[];return d&&m.push(`距预约时段还有约 ${Q(_)}`),b===0?m.push(d?"到号后可优先安排面诊":"已到号,可尽快面诊"):m.push(`前面约 ${b} 人,按序粗估约 ${Q(x)}`),m.join(";")}function X(){const e=v.status;return e===""||e===void 0||e===null}const U=D(()=>X()?S.value.filter(e=>Number(e.status)===3).length:0),O=D(()=>X()?S.value.filter(e=>Number(e.status)!==3):S.value),rt=D(()=>U.value>0&&O.value.length===0?`本时段有 ${U.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 _t(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,_=!!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:_,current:d&&!_,hint:""}]}function mt(e){const n=w(e).filter(o=>o.done).length;return Math.round(n/4*100)}const F=2e3,ft=15e3;let Y=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:F,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 _=await st(d);let g=(_==null?void 0:_.lists)||[];const y=Number((_==null?void 0:_.count)??g.length);if(y>g.length&&g.length>=F){const b=[],x=Math.min(Math.ceil(y/F),20);for(let m=2;m<=x;m++){const u=await st({...d,page_no:m}),M=(u==null?void 0:u.lists)||[];if(!M.length)break;b.push(...M)}g=[...g,...b]}S.value=[...g].sort((b,x)=>{const m=`${b.appointment_date||""} ${b.appointment_time||""}`,u=`${x.appointment_date||""} ${x.appointment_time||""}`;return m.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(),Y=setInterval(bt,ft),P=setInterval(()=>{Z.value+=1},6e4)}),St(()=>{Y!=null&&(clearInterval(Y),Y=null),P!=null&&(clearInterval(P),P=null)}),(e,t)=>{var tt;const n=xt,o=Mt,d=Ct,_=It,g=Dt,y=At,b=Ut,x=Yt,m=Kt,u=Lt,M=Ot,z=Ft,yt=Gt,kt=Bt;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($t))]),_:1}),t[10]||(t[10]=k(" 状态 ",-1))]),l(_,{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(B,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),zt((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(O.value.length)+" 人",1)):N("",!0),U.value>0?(i(),c("span",pe,"已隐藏已完成 "+p(U.value),1)):N("",!0)])]),E.value.length?f.value===void 0?(i(),T(m,{key:1,description:"请选择医生"})):(i(),T(yt,{key:2,data:O.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(B,{key:0},[t[17]||(t[17]=a("div",{class:"dp-my-patients-caption"},"我的患者",-1)),a("div",_e,p(ut(s)),1)],64)):N("",!0),a("div",me,[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(M,{type:_t(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(B,null,nt(w(s),($,q)=>(i(),c(B,{key:q},[a("div",{class:G(["dp-step",{"is-done":$.done,"is-current":$.current&&!$.done}])},[a("div",ke,p(q+1),1),a("div",Ne,[a("span",Ee,p($.label),1),$.hint?(i(),c("span",Se,p($.hint),1)):N("",!0)])],2),q<3?(i(),c("div",{key:0,class:G(["dp-step-line",{"is-done":$.done}])},null,2)):N("",!0)],64))),128))]),l(z,{percentage:mt(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(M,{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:$=>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(m,{key:0,description:"暂无医生数据"}))])),[[kt,A.value]])])}}}),Re=Ht($e,[["__scopeId","data-v-6bc1551c"]]);export{Re as default};