| 1 |
- var f=(M,y,r)=>new Promise((m,h)=>{var u=o=>{try{p(r.next(o))}catch(c){h(c)}},x=o=>{try{p(r.throw(o))}catch(c){h(c)}},p=o=>o.done?m(o.value):Promise.resolve(o.value).then(u,x);p((r=r.apply(M,y)).next())});import{_ as O}from"./componentMap-6df01015.js";import{u as H}from"./useForm-c3e28b04.js";import"./FormItem.vue_vue_type_script_lang-35d3ca4d.js";import{P as j}from"./ImportModal.vue_vue_type_style_index_0_scoped_a59c69fa_lang-1f52fa9b.js";import"./index-8cbf1e33.js";import{a as z}from"./index-b614de6b.js";import{l as v,O as b,R as S}from"./antd-ecb53b14.js";import{_ as L}from"./index.js";import{g as Z,a as q}from"./suppliesStatsApi-067d5637.js";import{u as I,_ as R}from"./useTable-e1a77cdc.js";import A from"./pie-f7e3374e.js";import{d as G,f as i,o as J,Y as _,Z as g,_ as C,l as a,u as e,a7 as n,$ as P,a9 as D,F as Y,E as w}from"./vue-8fccce23.js";import"./index-22d6b33a.js";import"./index-3eef3423.js";import"./useFormItem-d8cab136.js";import"./uuid-31b8b5a4.js";import"./useSortable-987ef813.js";import"./download-c6c2acd3.js";import"./copyTextToClipboard-ab85e052.js";import"./TextEditor-284232fa.js";import"./onMountedOrActivated-cb072c10.js";import"./useWindowSizeFn-8ad2dbf2.js";import"./useForm-19fca69f.js";import"./componentMap-16efd70f.js";import"./sortable.esm-4ae27e0b.js";import"./useECharts-e79dc066.js";const K=[{title:"药品类型",dataIndex:"type",align:"left"},{title:"剂量",dataIndex:"sum",align:"left"},{title:"占比",dataIndex:"proportion",align:"left"}],Q=[{title:"药品名称",dataIndex:"type",align:"left"},{title:"剂量",dataIndex:"sum",align:"left"},{title:"占比",dataIndex:"proportion",align:"left"}],U=[{field:"patrolTime",component:"RangePicker",componentProps:{allowClear:!1,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},defaultValue:[v().subtract(3,"month").format("YYYY-MM-DD"),v().format("YYYY-MM-DD")]}],W={class:"flex items-center xt-form"},X={class:"flex"},tt={class:"mb-4"},et=["onClick"],at=G({__name:"index",setup(M){const y=i("药品用量统计"),r=i({}),m=i([]),h=i([]),u=i([v().subtract(3,"month").format("YYYY-MM-DD"),v().format("YYYY-MM-DD")]),x=i(""),[p,{getFieldsValue:o}]=H({schemas:U,autoSubmitOnEnter:!0,size:"large",rowProps:{gutter:16}}),[c,{setTableData:V}]=I({showIndexColumn:!1,bordered:!0,striped:!1,pagination:!1,maxHeight:400,showSummary:!0,summaryFunc:B,dataSource:m.value,columns:K}),[E,{setTableData:T}]=I({showIndexColumn:!1,bordered:!0,striped:!1,pagination:!1,maxHeight:400,dataSource:h.value,columns:Q}),N=i();J(()=>f(this,null,function*(){N.value=yield z({dictCode:"pht"}),k()}));function $(){return f(this,null,function*(){u.value=o().patrolTime||[],k()})}function k(){return f(this,null,function*(){const s={time:u.value},l=yield Z(s);m.value=l,yield V(l);const t={content:[],description:y.value};l.forEach(d=>{t.content.push({name:d.type,value:d.sum})}),r.value=t,F(m.value[0])})}function F(s){return f(this,null,function*(){if(s){const l={time:u.value,type:s.type},t=yield q(l);x.value=s.type,yield T(t)}else yield T([])})}function B(s){console.log(s);let l=0;return s.forEach(t=>{l+=parseFloat(t.sum)}),[{type:"合计",sum:parseFloat(l).toFixed(2),proportion:"100%"}]}return(s,l)=>(_(),g(Y,null,[C("div",W,[C("div",X,[a(e(O),{onRegister:e(p),onFieldValueChange:$,style:{width:"300px"},class:"mr-2"},null,8,["onRegister"])])]),C("div",tt,[a(e(j),{title:y.value},null,8,["title"])]),a(e(S),{style:{"max-height":"400px"}},{default:n(()=>[a(e(b),{span:16},{default:n(()=>[a(A,{data:r.value},null,8,["data"])]),_:1}),a(e(b),{span:8},{default:n(()=>[a(e(R),{onRegister:e(c)},{bodyCell:n(({column:t,record:d})=>[t.key==="sum"?(_(),g("a",{key:0,onClick:ot=>F(d)},P(d.sum),9,et)):D("",!0)]),_:1},8,["onRegister"])]),_:1})]),_:1}),a(e(S),{style:{"max-height":"200px"}},{default:n(()=>[a(e(b),{span:24},{default:n(()=>[a(e(R),{onRegister:e(E)},{headerCell:n(({column:t})=>[t.key==="type"?(_(),g(Y,{key:0},[w(P(x.value),1)],64)):D("",!0),t.key==="sum"?(_(),g(Y,{key:1},[w(" 数量 ")],64)):D("",!0),t.key==="proportion"?(_(),g(Y,{key:2},[w(" 占比 ")],64)):D("",!0)]),_:1},8,["onRegister"])]),_:1})]),_:1})],64))}});const It=L(at,[["__scopeId","data-v-6e58371d"]]);export{It as default};
|