doctorDesk.vue 202KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508
  1. <template>
  2. <div class="main-contain new-main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  7. <div class="mainLeft">
  8. <el-date-picker
  9. v-model="record_date"
  10. prefix-icon="el-icon-date"
  11. @change="changeTimeTwo"
  12. :editable="false"
  13. style="width: 100%;"
  14. type="date"
  15. placeholder="选择开始时间"
  16. align="right"
  17. format="yyyy-MM-dd"
  18. value-format="yyyy-MM-dd">
  19. </el-date-picker>
  20. <div class="mainCell" style="justify-content: space-between;">
  21. <p style="font-size:14px;">未就诊:<span>{{cal_one}}</span>人</p>
  22. <p style="font-size:14px;">已就诊:<span>{{cal_two}}</span>人</p>
  23. </div>
  24. <div class="mainCell">
  25. <el-radio-group v-model="schedule_type" @change="changeScheduleType">
  26. <el-radio :label="1">上午</el-radio>
  27. <el-radio :label="2">下午</el-radio>
  28. <el-radio :label="3">晚上</el-radio>
  29. <el-radio :label="0">全部</el-radio>
  30. </el-radio-group>
  31. </div>
  32. <div class="mainCell">
  33. <el-radio-group v-model="radio" @change="change">
  34. <el-radio :label="1">未就诊</el-radio>
  35. <el-radio :label="2">已就诊</el-radio>
  36. <el-radio :label="0">全部</el-radio>
  37. </el-radio-group>
  38. </div>
  39. <div class="mainCell" style="margin-bottom:10px;">
  40. <el-input size="small" placeholder="请输入姓名或就诊号"
  41. v-model="search_input" class="filter-item"/>
  42. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  43. @click="searchAction">
  44. 搜索
  45. </el-button>
  46. </div>
  47. <div>
  48. <el-table :data="patientTableData" :height="tableHeight" @row-click='choosePatient'
  49. @current-change='currentChange' border style="width: 100%;"
  50. :row-style="{ color: '#303133' }"
  51. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  52. highlight-current-row
  53. ref="tab"
  54. >
  55. <el-table-column prop="name" label="姓名" width='89'>
  56. <template slot-scope="scope">{{ scope.$index + 1 }}. {{scope.row.name}}</template>
  57. </el-table-column>
  58. <el-table-column prop="name" label="就诊号" width="110">
  59. <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}</template>
  60. </el-table-column>
  61. </el-table>
  62. </div>
  63. </div>
  64. <div class="mainRight">
  65. <div class="mainHeader">
  66. <el-tabs v-model="titleType" @tab-click="handleClick"
  67. style="position: fixed;width: calc(100% - 490px);background:#fff;">
  68. <el-tab-pane label="电子处方" name="电子处方"></el-tab-pane>
  69. <el-tab-pane label="透析记录" name="透析记录"></el-tab-pane>
  70. <el-tab-pane label="电子病历" name="电子病历"></el-tab-pane>
  71. </el-tabs>
  72. <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子处方'">
  73. <el-button size="small" ref="button_one" @click="open(1)" type="primary"
  74. v-loading="saveLoading">保存
  75. </el-button>
  76. <el-button size="small" ref="button_three" @click="open_two()" type="primary">处方调用</el-button>
  77. <!--<el-button size="small" @click="open_three()" type="primary">存模板</el-button>-->
  78. <!-- <el-popover
  79. placement="bottom"
  80. width="300"
  81. trigger="click">
  82. <el-button size="small" ref="button_two" @click="open(2)">处方单</el-button>
  83. <el-button size="small" ref="button_six" @click="open(6)">治疗单</el-button>
  84. <el-button size="small" ref="button_six" @click="open(20)">检验单</el-button>
  85. <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印
  86. </el-button>
  87. </el-popover> -->
  88. <el-button size="small" @click="openPrint" type="primary">打印</el-button>
  89. <!-- <el-button size="small" ref="button_four" @click="open(5)" type="primary" :disabled='prescriptions && prescriptions[0].advices && prescriptions[0].project ? prescriptions[0].advices.length == 0 && prescriptions[0].project.length == 0 : false'>存模板</el-button> -->
  90. </div>
  91. <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子病历'">
  92. <el-button size="small" @click="opentwo(1)" type="primary">保存</el-button>
  93. <el-button size="small" @click="opentwo(2)" type="primary">打印</el-button>
  94. <el-button size="small" @click="opentwo(3)" type="primary">病历调用</el-button>
  95. <el-button size="small" @click="opentwo(4)" type="primary">存模板</el-button>
  96. </div>
  97. </div>
  98. <!--<desk-prescription ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"-->
  99. <!--v-if="titleType == '处方'" style="flex:1;"></desk-prescription>-->
  100. <desk-prescription v-on:setData="setData"
  101. :diagnoses="diagnoses"
  102. :loading="isloading"
  103. :sick="sick"
  104. :record_date="record_date"
  105. :drugs="drugs"
  106. :allDrugs="allDrugs"
  107. :advices_template="advices_template"
  108. :additions="additions"
  109. :doctors="doctors"
  110. :department="department"
  111. v-on:change="changeOther"
  112. v-on:month="changeMonth"
  113. v-on:day="changeDay"
  114. :month_prescriptions="month_prescriptions"
  115. ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
  116. :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
  117. :org_id="org_id" @editKeepLoad="editKeepLoad"
  118. v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
  119. <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
  120. :hisPatientInfo="hisPatientInfo" v-if="titleType == '电子病历'" :detalid="detalid"
  121. ref="child"></desk-record>
  122. <medicalRecord ref='medicalRecord' @func="getMsgFormSon"></medicalRecord>
  123. <saveRecordTemplate ref='saveRecordTemplate'></saveRecordTemplate>
  124. <!--<dialysis-index v-if="titleType == '透析记录'" :record_date="record_date" :patientid='patientid'></dialysis-index>-->
  125. <dialysis-index v-if="titleType == '透析记录'" :record_date="record_date" :patientid='patientid'
  126. :dialysisShow="dialysisShow"></dialysis-index>
  127. </div>
  128. </div>
  129. <el-dialog
  130. title="打印"
  131. :visible.sync="centerDialogVisible"
  132. width="600px"
  133. center>
  134. <el-button @click="allCheck">全选</el-button>
  135. <div style="text-align:center;margin-top:10px;font-weight:bold;font-size:20px;">处方笺打印</div>
  136. <el-table
  137. ref="multipleTable1"
  138. :data="tableData1"
  139. tooltip-effect="dark"
  140. style="width: 600px"
  141. @selection-change="handleSelectionChange1">
  142. <el-table-column
  143. align='center'
  144. type="selection"
  145. width="50">
  146. </el-table-column>
  147. <el-table-column
  148. align='center'
  149. label="处方编号"
  150. width="120">
  151. <template slot-scope="scope">
  152. <span>处方 {{scope.$index + 1}}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="处方号">
  156. <template slot-scope="scope">
  157. <span>
  158. <el-input v-model="scope.row.prescription_number" :disabled="true"></el-input>
  159. </span>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <div style="text-align:center;margin-top:10px;font-weight:bold;font-size:20px;">治疗单打印</div>
  164. <el-table
  165. ref="multipleTable2"
  166. :data="tableData2"
  167. tooltip-effect="dark"
  168. style="width: 600px"
  169. @selection-change="handleSelectionChange2">
  170. <el-table-column
  171. align='center'
  172. type="selection"
  173. width="50">
  174. </el-table-column>
  175. <el-table-column
  176. align='center'
  177. label="治疗单编号"
  178. width="120">
  179. <template slot-scope="scope">
  180. <span>治疗 {{scope.$index + 1}}</span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="治疗单号">
  184. <template slot-scope="scope">
  185. <span>
  186. <el-input v-model="scope.row.prescription_number" :disabled="true"></el-input>
  187. </span>
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. <div style="text-align:center;margin-top:10px;font-weight:bold;font-size:20px;">检验单打印</div>
  192. <el-table
  193. ref="multipleTable3"
  194. :data="tableData3"
  195. tooltip-effect="dark"
  196. style="width: 600px"
  197. @selection-change="handleSelectionChange3">
  198. <el-table-column
  199. align='center'
  200. type="selection"
  201. width="50">
  202. </el-table-column>
  203. <el-table-column
  204. align='center'
  205. label="处方编号"
  206. width="120">
  207. <template slot-scope="scope">
  208. <span>检验单1</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="检验单号">
  212. <template slot-scope="scope">
  213. <span>
  214. <el-input v-model="scope.row.prescription_number" :disabled="true"></el-input>
  215. </span>
  216. </template>
  217. </el-table-column>
  218. </el-table>
  219. <el-dialog
  220. class="centerDialog"
  221. width="600px"
  222. title="打印"
  223. :visible.sync="innerVisible"
  224. append-to-body>
  225. <template>
  226. <el-button
  227. style="float:right;"
  228. :loading="loading"
  229. size="small"
  230. icon="el-icon-printer"
  231. @click="printThisPage"
  232. type="primary"
  233. >打印
  234. </el-button
  235. >
  236. </template>
  237. <div id='printMain'>
  238. <print ref="print" v-if="selecting_schs1.length > 0" :paramsObj='paramsObj'></print>
  239. <treatPrint ref="treatPrint" v-if="selecting_schs2.length > 0" :paramsObj='paramsObj2'></treatPrint>
  240. <checkPrint ref="checkPrint" v-if="selecting_schs3.length > 0" :paramsObj='paramsObj3'></checkPrint>
  241. </div>
  242. </el-dialog>
  243. <span slot="footer" class="dialog-footer">
  244. <el-button @click="centerDialogVisible = false">取 消</el-button>
  245. <el-button type="primary" @click="savePrint">确 定</el-button>
  246. </span>
  247. </el-dialog>
  248. <!-- <el-dialog
  249. class="centerDialog"
  250. width="600px"
  251. title="打印"
  252. :visible.sync="checkVisible">
  253. <checkPrint v-if="index == 20" :paramsObj='paramsObj'></checkPrint>
  254. </el-dialog> -->
  255. <el-dialog
  256. class="centerDialog"
  257. width="600px"
  258. title="打印"
  259. :visible.sync="recordVisible">
  260. <recordPrint :patientid="patientid" ref="recordPrint"></recordPrint>
  261. </el-dialog>
  262. </div>
  263. </template>
  264. <script>
  265. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  266. import deskPrescription from './components/deskPrescription'
  267. import deskRecord from './components/deskRecord'
  268. import {
  269. createCaseHistory,
  270. getHospitalPatientList,
  271. getInitData,
  272. getMonthHisPateintInfo,
  273. getPatientInfo
  274. } from '@/api/his/his'
  275. import { getDictionaryDataConfig } from '@/utils/data'
  276. import medicalRecord from './components/medicalRecord'
  277. import saveRecordTemplate from './components/saveRecordTemplate'
  278. import { uParseTime } from '@/utils/tools'
  279. import { getPrescriptionList } from '@/api/project/project'
  280. import print from './print'
  281. import treatPrint from './treatPrint'
  282. import recordPrint from './recordPrint'
  283. import checkPrint from './checkPrint'
  284. import dialysisIndex from './components/dialysisIndex'
  285. const moment = require('moment')
  286. export default {
  287. components: {
  288. BreadCrumb,
  289. deskPrescription,
  290. deskRecord,
  291. medicalRecord,
  292. saveRecordTemplate,
  293. print,
  294. treatPrint,
  295. recordPrint,
  296. checkPrint,
  297. dialysisIndex
  298. },
  299. data() {
  300. return {
  301. settle_total:0,
  302. current_data:null,
  303. drugs: [],
  304. allDrugs: [],
  305. advices_template: [],
  306. sick: [],
  307. diagnoses: [],
  308. additions: [],
  309. doctors: [],
  310. department: [],
  311. tableHeight: '',
  312. saveloading: false,
  313. fullHeight: document.documentElement.clientHeight,
  314. month_prescriptions: [],
  315. isloading: false,
  316. prescriptions: [
  317. {
  318. name: '处方1',
  319. advices: [],
  320. project: [],
  321. addition: []
  322. }
  323. ],
  324. search_input: '',
  325. cal_one: 0,
  326. cal_two: 0,
  327. radio: 1,
  328. schedule_type: 0,
  329. record_date: '',
  330. crumbs: [
  331. { path: false, name: '住院医生站' },
  332. { path: false, name: '医生工作台' }
  333. ],
  334. titleType: '电子处方',
  335. patientTableData: [{}],
  336. patientTableDataTwo: [{}],
  337. patientInfo: {},
  338. hisPatientInfo: {},
  339. case_history: {},
  340. patient_id: 0,
  341. other_sick: [],
  342. info: {},
  343. last_info: {},
  344. templatedetail: {},
  345. detalid: 0,
  346. prescription_id: 0,
  347. patientid: 0,
  348. prescriptionList: [],
  349. centerDialogVisible: false,
  350. tableData1: [],
  351. tableData2: [],
  352. tableData3: [],
  353. tableData4: [],
  354. selecting_schs1: [],
  355. selecting_schs2: [],
  356. selecting_schs3: [],
  357. index: 0,
  358. admin_info: {},
  359. saveLoading: false,
  360. innerVisible: false,
  361. paramsObj: {},
  362. paramsObj2: {},
  363. paramsObj3: {},
  364. recordVisible: false,
  365. recordObj: {},
  366. dialysisShow: true,
  367. all_data: [],
  368. all_data_two: [],
  369. un_cure_data: [],
  370. un_cure_data_two: [],
  371. cure_data: [],
  372. cure_data_two: [],
  373. all_his_patients: [],
  374. checkVisible: false,
  375. current_tab: 'day'
  376. }
  377. },
  378. methods: {
  379. editKeepLoad(data){
  380. this.saveLoading = data
  381. },
  382. changeTimeTwo() {
  383. this.titleType = "电子处方"
  384. this.getList()
  385. },
  386. openPrint() {
  387. // this.centerDialogVisible = true
  388. this.getPrescriptionList(this.patientInfo.id,this.record_date)
  389. },
  390. allCheck() {
  391. this.$refs.multipleTable1.toggleAllSelection()
  392. this.$refs.multipleTable2.toggleAllSelection()
  393. this.$refs.multipleTable3.toggleAllSelection()
  394. },
  395. printThisPage() {
  396. if(this.org_id == 10138){
  397. const style =
  398. '@media print {#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 87%;}}}'
  399. printJS({
  400. printable: 'printMain',
  401. type: 'html',
  402. style: style,
  403. scanStyles: false
  404. })
  405. }else{
  406. const style =
  407. '@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}'
  408. printJS({
  409. printable: 'printMain',
  410. type: 'html',
  411. style: style,
  412. scanStyles: false
  413. })
  414. }
  415. this.innerVisible = false
  416. // this.$nextTick(() => {
  417. // this.$refs.print.printThisPage()
  418. // this.$refs.treatPrint.printThisPage()
  419. // this.$refs.checkPrint.printThisPage()
  420. // })
  421. },
  422. changeOther(patient_id) {
  423. if (this.radio == 2){
  424. if (this.patientTableData.length > 0) {
  425. for(let i = 0; i < this.patientTableData.length; i++){
  426. if(this.patientTableData[i].id == patient_id){
  427. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  428. this.oldCurrentRow = this.patientTableData[i]
  429. this.getPatientInfo(this.patientTableData[i])
  430. }
  431. }
  432. }
  433. }else{
  434. this.radio = 2
  435. let params = {
  436. 'record_date': this.record_date,
  437. 'type': this.radio,
  438. 'sch_type': this.schedule_type
  439. }
  440. this.patientTableData = []
  441. this.un_cure_data = []
  442. this.cure_data = []
  443. this.all_data = []
  444. getHospitalPatientList(params).then(response => {
  445. if (response.data.state == 0) {
  446. this.$message.error(response.data.msg)
  447. return false
  448. } else {
  449. this.patientTableData = response.data.data.list
  450. this.all_data = this.patientTableData
  451. this.patientTableDataTwo = response.data.data.list
  452. this.cal_one = response.data.data.total_one
  453. this.cal_two = response.data.data.total_two
  454. this.admin_info = response.data.data.info
  455. if (this.patientTableData.length > 0) {
  456. for(let i = 0; i < this.patientTableData.length; i++){
  457. if(this.patientTableData[i].id == patient_id){
  458. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  459. this.oldCurrentRow = this.patientTableData[i]
  460. this.getPatientInfo(this.patientTableData[i])
  461. }
  462. }
  463. }
  464. }
  465. })
  466. }
  467. // getSchedulePatientList(params).then(response => {
  468. // if (response.data.state == 0) {
  469. // this.$message.error(response.data.msg);
  470. // return false
  471. // } else {
  472. // this.patientTableData = response.data.data.list;
  473. // this.patientTableDataTwo = response.data.data.list;
  474. // this.cal_one = response.data.data.total_one;
  475. // this.cal_two = response.data.data.total_two;
  476. // this.admin_info = response.data.data.info;
  477. //
  478. //
  479. // if (this.patientTableData.length > 0) {
  480. // for(let i = 0; i < this.patientTableData.length; i++){
  481. // if (this.patientTableData[i].id == patient_id){
  482. // this.$refs.tab.setCurrentRow(this.patientTableData[i]);
  483. // this.oldCurrentRow = this.patientTableData[i];
  484. // this.getPatientInfo(this.patientTableData[i])
  485. // }
  486. // }
  487. //
  488. // }
  489. //
  490. // this.prescriptionList = response.data.data.list.prescription
  491. //
  492. // }
  493. // })
  494. },
  495. setData(val) {
  496. this.prescriptions = val
  497. },
  498. getDictionaryDataConfig(module, filed_name) {
  499. return getDictionaryDataConfig(module, filed_name)
  500. },
  501. searchAction() {
  502. if (this.search_input.length == 0) {
  503. this.patientTableData = this.all_data
  504. } else {
  505. switch (this.radio) {
  506. case 0:
  507. let arr4 = []
  508. for (let i = 0; i < this.all_data.length; i++) {
  509. if (this.all_data[i].name.indexOf(this.search_input) != -1 || this.all_data[i].his_patient.number.indexOf(this.search_input) != -1) {
  510. arr4 = arr4.concat(this.all_data[i])
  511. }
  512. }
  513. this.patientTableData = arr4
  514. break
  515. case 2:
  516. let arr2 = []
  517. for (let i = 0; i < this.all_data.length; i++) {
  518. if (this.all_data[i].name.indexOf(this.search_input) != -1 || this.all_data[i].his_patient.number.indexOf(this.search_input) != -1) {
  519. arr2 = arr2.concat(this.all_data[i])
  520. }
  521. }
  522. this.patientTableData = arr2
  523. break
  524. case 1:
  525. let arr3 = []
  526. for (let i = 0; i < this.all_data.length; i++) {
  527. if (this.all_data[i].name.indexOf(this.search_input) != -1 || this.all_data[i].his_patient.number.indexOf(this.search_input) != -1) {
  528. arr3 = arr3.concat(this.all_data[i])
  529. }
  530. }
  531. this.patientTableData = arr3
  532. break
  533. }
  534. }
  535. },
  536. change() {
  537. let params = {
  538. 'record_date': this.record_date,
  539. 'type': this.radio,
  540. 'sch_type': this.schedule_type
  541. }
  542. this.un_cure_data = []
  543. this.cure_data = []
  544. this.all_data = []
  545. getHospitalPatientList(params).then(response => {
  546. if (response.data.state == 0) {
  547. this.$message.error(response.data.msg)
  548. return false
  549. } else {
  550. this.patientTableData = response.data.data.list
  551. this.all_data = this.patientTableData
  552. this.patientTableDataTwo = response.data.data.list
  553. this.cal_one = response.data.data.total_one
  554. this.cal_two = response.data.data.total_two
  555. this.admin_info = response.data.data.info
  556. if (this.patientTableData.length > 0) {
  557. this.current_data = this.patientTableData[0]
  558. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  559. this.oldCurrentRow = this.patientTableData[0]
  560. this.getPatientInfo(this.patientTableData[0])
  561. }
  562. }
  563. })
  564. }, changeScheduleType() {
  565. let params = {
  566. 'record_date': this.record_date,
  567. 'type': this.radio,
  568. 'sch_type': this.schedule_type
  569. }
  570. this.un_cure_data = []
  571. this.cure_data = []
  572. this.all_data = []
  573. getHospitalPatientList(params).then(response => {
  574. if (response.data.state == 0) {
  575. this.$message.error(response.data.msg)
  576. return false
  577. } else {
  578. this.patientTableData = response.data.data.list
  579. this.all_data = this.patientTableData
  580. this.patientTableDataTwo = response.data.data.list
  581. this.cal_one = response.data.data.total_one
  582. this.cal_two = response.data.data.total_two
  583. this.admin_info = response.data.data.info
  584. if (this.patientTableData.length > 0) {
  585. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  586. this.oldCurrentRow = this.patientTableData[0]
  587. this.getPatientInfo(this.patientTableData[0])
  588. }
  589. }
  590. })
  591. },
  592. setMonthPrescription(month_prescriptions) {
  593. this.month_prescriptions = []
  594. let drug_month_prescriptions = {
  595. advices: []
  596. }
  597. let drug_ids = []
  598. let project_month_prescriptions = {
  599. project: []
  600. }
  601. let project_ids = []
  602. let addition_month_prescriptions = {
  603. addition: []
  604. }
  605. let additions_ids = []
  606. let count = 0
  607. for (let i = 0; i < month_prescriptions.length; i++) {
  608. if (month_prescriptions[i].type == 1) { //药品
  609. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  610. let obj = {
  611. id: month_prescriptions[i].advices[a].drug_id,
  612. price: month_prescriptions[i].advices[a].price
  613. }
  614. drug_ids.push(obj)
  615. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  616. }
  617. } else if (month_prescriptions[i].type == 2) { //项目
  618. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  619. let obj = {
  620. id: month_prescriptions[i].project[a].project_id,
  621. price: month_prescriptions[i].project[a].price
  622. }
  623. if(month_prescriptions[i].project[a].project_id == 1735){
  624. count = count + 1
  625. }
  626. project_ids.push(obj)
  627. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  628. }
  629. }
  630. //附加收费
  631. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  632. // let obj = {
  633. // id: month_prescriptions[i].addition[a].item_id,
  634. // price: month_prescriptions[i].addition[a].price
  635. //
  636. // }
  637. // additions_ids.push(obj)
  638. // addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  639. // }
  640. }
  641. console.log("打印日志了:")
  642. console.log(count)
  643. const obj = {}
  644. const obj1 = {}
  645. const obj2 = {}
  646. drug_ids = this.unique(drug_ids)
  647. project_ids = this.unique(project_ids)
  648. additions_ids = this.unique(additions_ids)
  649. let drugs = []
  650. let projects = []
  651. let additions = []
  652. for (let i = 0; i < drug_ids.length; i++) {
  653. let obj = {}
  654. let count = 0
  655. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  656. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  657. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  658. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  659. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  660. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  661. obj['day'] = drug_month_prescriptions.advices[a].day
  662. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  663. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  664. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  665. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  666. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  667. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  668. obj['drug'] = drug_month_prescriptions.advices[a].drug
  669. obj['single_dose_unit'] = drug_month_prescriptions.advices[a].single_dose_unit
  670. count = count + drug_month_prescriptions.advices[a].prescribing_number
  671. }
  672. }
  673. obj['prescribing_number'] = count
  674. drugs.push(obj)
  675. }
  676. for (let i = 0; i < project_ids.length; i++) {
  677. let obj = {}
  678. let count = 0
  679. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  680. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  681. if (project_month_prescriptions.project[a].type == 2) {
  682. obj['statistical_classification'] = ''
  683. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  684. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  685. obj['project'] = project_month_prescriptions.project[a].project
  686. } else if (project_month_prescriptions.project[a].type == 3) {
  687. obj['statistical_classification'] = ''
  688. obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
  689. obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
  690. obj['good_info'] = project_month_prescriptions.project[a].good_info
  691. }
  692. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  693. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  694. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  695. obj['type'] = project_month_prescriptions.project[a].type
  696. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  697. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  698. obj['number_days'] = project_month_prescriptions.project[a].day
  699. // obj['medical_c/**/ode'] = project_month_prescriptions.project[a].project.medical_code
  700. obj['unit'] = project_month_prescriptions.project[a].unit
  701. obj['project_id'] = project_month_prescriptions.project[a].project_id
  702. count = count + parseFloat(project_month_prescriptions.project[a].count)
  703. // price = price + project_month_prescriptions.project[a].price
  704. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  705. }
  706. }
  707. obj['total'] = count
  708. projects.push(obj)
  709. }
  710. for (let i = 0; i < additions_ids.length; i++) {
  711. let obj = {}
  712. let count = 0
  713. if (addition_month_prescriptions.addition) {
  714. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  715. if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
  716. obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  717. obj['id'] = addition_month_prescriptions.addition[a].id
  718. obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  719. count = count + addition_month_prescriptions.addition[a].count
  720. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  721. }
  722. }
  723. obj['count'] = count
  724. additions.push(obj)
  725. }
  726. }
  727. let p1 = {
  728. name: '处方' + 1,
  729. advices: drugs,
  730. project: [],
  731. type: 1,
  732. addition: additions
  733. }
  734. let p2 = {
  735. name: '处方' + 2,
  736. type: 2,
  737. project: projects,
  738. advices: [],
  739. addition: []
  740. }
  741. this.month_prescriptions.push(p1)
  742. this.month_prescriptions.push(p2)
  743. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info,this.settle_total)
  744. },
  745. // setMonthPrescription(month_prescriptions){
  746. // let drug_month_prescriptions = {
  747. // advices:[],
  748. // }
  749. // let drug_ids=[]
  750. // let project_month_prescriptions ={
  751. // project:[],
  752. //
  753. // }
  754. // let project_ids=[]
  755. //
  756. // let addition_month_prescriptions ={
  757. // addtions:[],
  758. //
  759. // }
  760. // let additions_ids=[]
  761. //
  762. //
  763. // for (let i = 0; i < month_prescriptions.length; i++){
  764. // if(month_prescriptions[i].type == 1){ //药品
  765. // for (let a = 0; a < month_prescriptions[i].advices.length; a++){
  766. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  767. // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  768. // }
  769. //
  770. // }else if(month_prescriptions[i].type == 2){ //项目
  771. // for (let a = 0; a < month_prescriptions[i].project.length; a++){
  772. // project_ids.push(month_prescriptions[i].project[a].project_id)
  773. // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  774. // }
  775. // }
  776. // //附加收费
  777. // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  778. // additions_ids.push(month_prescriptions[i].addition[a].item_id)
  779. // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
  780. // }
  781. //
  782. // }
  783. //
  784. //
  785. //
  786. //
  787. // const obj = {}
  788. // const obj1 = {}
  789. // const obj2 = {}
  790. //
  791. // drug_ids = drug_ids.reduce((cur, next) => {
  792. // obj[next] ? '' : obj[next] = true && cur.push(next)
  793. // return cur
  794. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  795. // project_ids = project_ids.reduce((cur, next) => {
  796. // obj1[next] ? '' : obj1[next] = true && cur.push(next)
  797. // return cur
  798. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  799. // additions_ids = additions_ids.reduce((cur, next) => {
  800. // obj2[next] ? '' : obj2[next] = true && cur.push(next)
  801. // return cur
  802. // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  803. //
  804. //
  805. //
  806. //
  807. //
  808. // let drugs =[]
  809. // let projects =[]
  810. // let additions =[]
  811. //
  812. //
  813. // for (let i = 0; i < drug_ids.length; i++){
  814. // let obj = {}
  815. // let price = 0
  816. // let count = 0
  817. // for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
  818. // if(drug_ids[i] == drug_month_prescriptions.advices[a].drug_id){
  819. // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  820. // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  821. // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  822. // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  823. // obj['day'] = drug_month_prescriptions.advices[a].day
  824. // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  825. // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  826. // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  827. // obj['id'] = drug_month_prescriptions.advices[a].drug_id
  828. // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  829. //
  830. //
  831. // count = count + drug_month_prescriptions.advices[a].prescribing_number
  832. // price = price + drug_month_prescriptions.advices[a].price
  833. //
  834. // }
  835. // }
  836. // obj['retail_price'] = price
  837. // obj['prescribing_number'] = count
  838. // drugs.push(obj)
  839. // }
  840. //
  841. //
  842. //
  843. //
  844. // for (let i = 0; i < project_ids.length; i++){
  845. // let obj = {}
  846. // let price = 0
  847. // let count = 0
  848. // for (let a = 0; a < project_month_prescriptions.project.length; a++){
  849. // if(project_ids[i] == project_month_prescriptions.project[a].project_id){
  850. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  851. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  852. // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  853. // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  854. // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  855. // obj['number_days'] = project_month_prescriptions.project[a].day
  856. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  857. // obj['unit'] = project_month_prescriptions.project[a].unit
  858. // obj['project_id'] = project_month_prescriptions.project[a].project_id
  859. // count = count + project_month_prescriptions.project[a].count
  860. // price = price + project_month_prescriptions.project[a].price
  861. // }
  862. // }
  863. // obj['price'] = price
  864. // obj['total'] = count
  865. // projects.push(obj)
  866. // }
  867. //
  868. //
  869. // for (let i = 0; i < additions_ids.length; i++){
  870. // let obj = {}
  871. // let price = 0
  872. // let count = 0
  873. // for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
  874. // if(project_ids[i] == addition_month_prescriptions.addition[a].item_id){
  875. // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  876. // obj['id'] = addition_month_prescriptions.addition[a].id
  877. // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  878. // count = count + addition_month_prescriptions.addition[a].count
  879. // price = price + addition_month_prescriptions.addition[a].price
  880. // }
  881. // }
  882. // obj['price'] = price
  883. // obj['count'] = count
  884. // additions.push(obj)
  885. // }
  886. //
  887. //
  888. // let p1 = {
  889. // name: '处方' + 1,
  890. // advices: drugs,
  891. // project: [],
  892. // type:1,
  893. // addition: additions,
  894. // }
  895. // let p2 = {
  896. // name: '处方' + 2,
  897. // type:2,
  898. // project: projects,
  899. // advices: [],
  900. // }
  901. // this.month_prescriptions.push(p1)
  902. // this.month_prescriptions.push(p2)
  903. //
  904. // },
  905. getInitData() {
  906. getInitData().then(response => {
  907. if (response.data.state == 0) {
  908. this.$message.error(response.data.msg)
  909. return false
  910. } else {
  911. var drugs = response.data.data.drugs
  912. for(let i=0;i<drugs.length;i++){
  913. drugs[i].count = 0
  914. if(drugs[i].stock_in.length > 0){
  915. for(let j=0;j<drugs[i].stock_in.length;j++){
  916. drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
  917. }
  918. }
  919. }
  920. this.drugs = drugs
  921. console.log("所有药品信息",this.drugs)
  922. this.allDrugs = response.data.data.drugs
  923. this.advices_template = response.data.data.advices_template
  924. this.department = response.data.data.department
  925. this.sick = response.data.data.sick
  926. this.diagnoses = response.data.data.diagnose
  927. this.additions = response.data.data.additions
  928. }
  929. })
  930. },
  931. getList() {
  932. let params = {
  933. 'record_date': this.record_date,
  934. 'type': this.radio,
  935. 'sch_type': this.schedule_type
  936. }
  937. this.un_cure_data = []
  938. this.cure_data = []
  939. this.all_data = []
  940. getHospitalPatientList(params).then(response => {
  941. if (response.data.state == 0) {
  942. this.$message.error(response.data.msg)
  943. return false
  944. } else {
  945. this.patientTableData = response.data.data.list
  946. this.all_data = this.patientTableData
  947. this.patientTableDataTwo = response.data.data.list
  948. this.cal_one = response.data.data.total_one
  949. this.cal_two = response.data.data.total_two
  950. this.admin_info = response.data.data.info
  951. if (this.patientTableData.length > 0) {
  952. this.current_data = this.patientTableData[0]
  953. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  954. this.oldCurrentRow = this.patientTableData[0]
  955. this.getPatientInfo(this.patientTableData[0])
  956. }
  957. }
  958. })
  959. },
  960. getPatientInfo(val) {
  961. var nowDate = new Date()
  962. var nowYear = nowDate.getFullYear()
  963. var nowMonth = nowDate.getMonth() + 1
  964. var nowDay = nowDate.getDate()
  965. var hours = nowDate.getHours()
  966. var min = nowDate.getMinutes()
  967. var nowTime =
  968. nowYear +
  969. '-' +
  970. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  971. '-' +
  972. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  973. ':' + (min < 10 ? '0' + min : min)
  974. let params = {
  975. 'record_date': this.record_date,
  976. 'patient_id': val.id,
  977. 'his_patient_id': val.his_patient_id,
  978. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  979. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  980. 'p_type': 1
  981. }
  982. this.isloading = true
  983. getPatientInfo(params).then(response => {
  984. if (response.data.state == 0) {
  985. this.$message.error(response.data.msg)
  986. this.isloading = false
  987. return false
  988. } else {
  989. if (response.data.data.sch_prescriptions == null) {
  990. response.data.data.sch_prescriptions = []
  991. }
  992. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  993. if (response.data.data.sch_prescriptions[i].advices == null) {
  994. response.data.data.sch_prescriptions[i].advices = []
  995. }
  996. if (response.data.data.sch_prescriptions[i].project == null) {
  997. response.data.data.sch_prescriptions[i].project = []
  998. }
  999. }
  1000. this.patientid = val.id
  1001. this.isloading = false
  1002. this.prescriptions = []
  1003. this.month_prescriptions = []
  1004. this.patientInfo = response.data.data.xt_info
  1005. this.hisPatientInfo = response.data.data.his_info
  1006. this.case_history = response.data.data.case_history
  1007. console.log("电子比你2333223232323232323232323",this.case_history)
  1008. this.info = response.data.data.info
  1009. this.last_info = response.data.data.last_info
  1010. this.schedule = response.data.data.schedule
  1011. this.doctors = response.data.data.doctors
  1012. this.department = response.data.data.department
  1013. for (let i = 0; i < this.doctors.length; i++) {
  1014. if (this.doctors[i].user_type == 1) {
  1015. this.doctors.splice(i, 1)
  1016. }
  1017. }
  1018. // var month_prescriptions = response.data.data.month_prescriptions
  1019. // this.setMonthPrescription(month_prescriptions)
  1020. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  1021. if (this.case_history.temperature <= 0) {
  1022. this.case_history.temperature = ''
  1023. }
  1024. if (this.case_history.blood_sugar <= 0) {
  1025. this.case_history.blood_sugar = ''
  1026. }
  1027. if (this.case_history.pulse <= 0) {
  1028. this.case_history.pulse = ''
  1029. }
  1030. if (this.case_history.sbp <= 0) {
  1031. this.case_history.sbp = ''
  1032. }
  1033. if (this.case_history.dbp <= 0) {
  1034. this.case_history.dbp = ''
  1035. }
  1036. if (this.case_history.height <= 0) {
  1037. this.case_history.height = ''
  1038. }
  1039. if (this.case_history.blood_fat <= 0) {
  1040. this.case_history.blood_fat = ''
  1041. }
  1042. if (this.case_history.sick_type <= 0) {
  1043. this.case_history.sick_type = ''
  1044. }
  1045. if (this.case_history.sick <= 0) {
  1046. this.case_history.sick = ''
  1047. }
  1048. if (this.case_history.diagnose <= 0) {
  1049. this.case_history.diagnose = ''
  1050. }
  1051. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  1052. if (this.case_history.is_infect == 1) {
  1053. this.case_history.is_infect = true
  1054. } else {
  1055. this.case_history.is_infect = false
  1056. }
  1057. this.case_history.primary_disease = this.case_history.primary_disease
  1058. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  1059. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  1060. this.case_history.physical_examination = this.case_history.physical_examination
  1061. this.case_history.special_inspection = this.case_history.special_inspection
  1062. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  1063. //处方相关
  1064. this.prescriptionList = response.data.data.prescription
  1065. if (response.data.data.prescription.length > 0) {
  1066. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1067. var prescription = response.data.data.prescription[i]
  1068. let tempAdvice = []
  1069. let tempProject = []
  1070. let tempAddition = []
  1071. //药品
  1072. for (let b = 0; b < prescription.advices.length; b++) {
  1073. let obj = {
  1074. advice_id: prescription.advices[b].id,
  1075. drug_name: prescription.advices[b].advice_name,
  1076. single_dose: prescription.advices[b].single_dose,
  1077. delivery_way: prescription.advices[b].delivery_way,
  1078. execution_frequency: prescription.advices[b].execution_frequency,
  1079. retail_price: prescription.advices[b].price.toString(),
  1080. remark: prescription.advices[b].remark,
  1081. day: prescription.advices[b].day,
  1082. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1083. single_dose_unit: prescription.advices[b].single_dose_unit,
  1084. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1085. medical_insurance_number: prescription.advices[b].med_list_codg,
  1086. id: prescription.advices[b].drug_id,
  1087. drug: prescription.advices[b].drug,
  1088. groupno: prescription.advices[b].groupno,
  1089. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
  1090. }
  1091. tempAdvice.push(obj)
  1092. }
  1093. //项目
  1094. for (let b = 0; b < prescription.project.length; b++) {
  1095. let obj = {
  1096. id: prescription.project[b].id,
  1097. project_id: prescription.project[b].project_id,
  1098. project_name: prescription.project[b].project.project_name,
  1099. single_dose: prescription.project[b].single_dose,
  1100. delivery_way: prescription.project[b].delivery_way,
  1101. execution_frequency: prescription.project[b].execution_frequency,
  1102. number_days: prescription.project[b].day,
  1103. total: prescription.project[b].count.toString(),
  1104. price: prescription.project[b].price,
  1105. remark: prescription.project[b].remark,
  1106. medical_code: prescription.project[b].project.medical_code,
  1107. unit: prescription.project[b].project.unit,
  1108. type: prescription.project[b].type
  1109. }
  1110. if (prescription.project[b].type == 2) {
  1111. console.log("prescription.project[b].team.project_team:")
  1112. console.log(prescription.project[b].team.project_team)
  1113. obj['statistical_classification'] = prescription.project[b].team.project_team
  1114. obj['medical_code'] = prescription.project[b].project.medical_code
  1115. obj['project_name'] = prescription.project[b].project.project_name
  1116. obj['project'] = prescription.project[b].project
  1117. } else if (prescription.project[b].type == 3) {
  1118. if(prescription.project[b].team_id > 0){
  1119. obj['statistical_classification'] = prescription.project[b].team.project_team
  1120. }
  1121. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1122. obj['project_name'] = prescription.project[b].good_info.good_name
  1123. obj['good_info'] = prescription.project[b].good_info
  1124. }
  1125. tempProject.push(obj)
  1126. }
  1127. //附加收费
  1128. // for (let b = 0; b < prescription.addition.length; b++) {
  1129. // let obj = {
  1130. // id: prescription.addition[b].id,
  1131. // item_name: prescription.addition[b].item_name,
  1132. // price: prescription.addition[b].price,
  1133. // count: prescription.addition[b].count,
  1134. // item_id: prescription.addition[b].item_id
  1135. // }
  1136. // tempAddition.push(obj)
  1137. // }
  1138. var preTime = ''
  1139. if (prescription.pre_time == 0) {
  1140. if (this.schedule.schedule_type == 1) {
  1141. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1142. } else if (this.schedule.schedule_type == 2) {
  1143. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1144. } else if (this.schedule.schedule_type == 3) {
  1145. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1146. }
  1147. // preTime = nowTime
  1148. } else {
  1149. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  1150. }
  1151. let index = i + 1
  1152. let obj = {
  1153. id: prescription.id,
  1154. name: '处方' + index,
  1155. advices: tempAdvice,
  1156. project: tempProject,
  1157. addition: tempAddition,
  1158. order_status: prescription.order_status,
  1159. pre_time: preTime,
  1160. med_type: parseInt(prescription.med_type)
  1161. }
  1162. this.prescriptions.push(obj)
  1163. }
  1164. } else {
  1165. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  1166. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1167. var prescription = response.data.data.sch_prescriptions[i]
  1168. let tempAdvice = []
  1169. let tempProject = []
  1170. let tempAddition = []
  1171. //药品
  1172. for (let b = 0; b < prescription.advices.length; b++) {
  1173. let obj = {
  1174. advice_id: 0,
  1175. drug_name: prescription.advices[b].advice_name,
  1176. single_dose: prescription.advices[b].single_dose,
  1177. delivery_way: prescription.advices[b].delivery_way,
  1178. execution_frequency: prescription.advices[b].execution_frequency,
  1179. // retail_price: prescription.advices[b].price.toString(),
  1180. remark: prescription.advices[b].remark,
  1181. day: prescription.advices[b].day,
  1182. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1183. single_dose_unit: prescription.advices[b].single_dose_unit,
  1184. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1185. medical_insurance_number: prescription.advices[b].med_list_codg,
  1186. id: prescription.advices[b].drug_id,
  1187. drug: prescription.advices[b].drug,
  1188. groupno: prescription.advices[b].groupno,
  1189. hosp_appr_flag: '1'
  1190. }
  1191. console.log('看看数据6:')
  1192. console.log(obj.prescribing_number_unit)
  1193. console.log(prescription.advices[b].drug.min_unit)
  1194. console.log(prescription.advices[b].drug.max_unit)
  1195. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  1196. obj['retail_price'] = prescription.advices[b].drug.min_price
  1197. console.log('1')
  1198. console.log(obj.retail_price)
  1199. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  1200. obj['retail_price'] = prescription.advices[b].drug.retail_price
  1201. console.log('2')
  1202. console.log(obj.retail_price)
  1203. } else {
  1204. console.log('3')
  1205. obj['retail_price'] = prescription.advices[b].drug.min_price
  1206. console.log(obj.retail_price)
  1207. }
  1208. tempAdvice.push(obj)
  1209. }
  1210. //项目
  1211. for (let b = 0; b < prescription.project.length; b++) {
  1212. let obj = {
  1213. id: 0,
  1214. project_id: prescription.project[b].project_id,
  1215. project_name: prescription.project[b].project.project_name,
  1216. single_dose: prescription.project[b].single_dose,
  1217. delivery_way: prescription.project[b].delivery_way,
  1218. execution_frequency: prescription.project[b].execution_frequency,
  1219. number_days: prescription.project[b].day,
  1220. total: prescription.project[b].count.toString(),
  1221. remark: prescription.project[b].remark,
  1222. medical_code: prescription.project[b].project.medical_code,
  1223. unit: prescription.project[b].project.unit,
  1224. type: prescription.project[b].type
  1225. }
  1226. if (prescription.project[b].type == 2) {
  1227. obj['statistical_classification'] = ""
  1228. obj['medical_code'] = prescription.project[b].project.medical_code
  1229. obj['project_name'] = prescription.project[b].project.project_name
  1230. obj['price'] = prescription.project[b].project.price
  1231. obj['project'] = prescription.project[b].project
  1232. } else if (prescription.project[b].type == 3) {
  1233. obj['statistical_classification'] = ''
  1234. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1235. obj['project_name'] = prescription.project[b].good_info.good_name
  1236. obj['price'] = prescription.project[b].good_info.packing_price
  1237. obj['good_info'] = prescription.project[b].good_info
  1238. }
  1239. tempProject.push(obj)
  1240. }
  1241. if (this.schedule.schedule_type == 1) {
  1242. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1243. } else if (this.schedule.schedule_type == 2) {
  1244. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1245. } else if (this.schedule.schedule_type == 3) {
  1246. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1247. }
  1248. let index = i + 1
  1249. let obj = {
  1250. id: 0,
  1251. name: '处方' + index,
  1252. advices: tempAdvice,
  1253. project: tempProject,
  1254. addition: tempAddition,
  1255. order_status: 1,
  1256. pre_time: preTime,
  1257. med_type: ''
  1258. }
  1259. if (prescription.med_type == 0 || prescription.med_type == '') {
  1260. obj.med_type = ''
  1261. } else {
  1262. obj.med_type = parseInt(prescription.med_type)
  1263. }
  1264. if (obj.med_type == 0 || obj.med_type == '') {
  1265. obj.med_type = 14
  1266. }
  1267. this.prescriptions.push(obj)
  1268. }
  1269. } else {
  1270. let obj = {
  1271. id: 0,
  1272. name: '处方' + 1,
  1273. advices: [],
  1274. project: [],
  1275. addition: [],
  1276. order_status: 0,
  1277. pre_time: nowTime,
  1278. med_type: ''
  1279. }
  1280. obj.med_type = 14
  1281. this.prescriptions.push(obj)
  1282. }
  1283. }
  1284. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  1285. }
  1286. })
  1287. },unique(array) {
  1288. // res用来存储结果
  1289. var res = []
  1290. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  1291. for (var j = 0, resLen = res.length; j < resLen; j++) {
  1292. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  1293. break
  1294. }
  1295. }
  1296. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  1297. if (j === resLen) {
  1298. res.push(array[i])
  1299. }
  1300. }
  1301. return res
  1302. },
  1303. choosePatient(val) {
  1304. this.current_data = val
  1305. if (this.titleType == '电子病历') {
  1306. if (this.$refs.child.watchSign > 2) {
  1307. this.$confirm('是否保存当前病例', '保存', {
  1308. confirmButtonText: '确 定',
  1309. cancelButtonText: '取 消',
  1310. type: 'warning'
  1311. }).then(() => {
  1312. this.$refs.child.createCaseHistory(this.newPatientId)
  1313. this.patientid = val.id
  1314. let params = {
  1315. 'record_date': this.record_date,
  1316. 'patient_id': val.id,
  1317. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1318. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  1319. 'p_type': 1
  1320. }
  1321. var nowDate = new Date()
  1322. var nowYear = nowDate.getFullYear()
  1323. var nowMonth = nowDate.getMonth() + 1
  1324. var nowDay = nowDate.getDate()
  1325. var hours = nowDate.getHours()
  1326. var min = nowDate.getMinutes()
  1327. var nowTime =
  1328. nowYear +
  1329. '-' +
  1330. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1331. '-' +
  1332. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1333. ':' + (min < 10 ? '0' + min : min)
  1334. getPatientInfo(params).then(response => {
  1335. if (response.data.state == 0) {
  1336. this.$message.error(response.data.msg)
  1337. return false
  1338. } else {
  1339. if (response.data.data.sch_prescriptions == null) {
  1340. response.data.data.sch_prescriptions = []
  1341. }
  1342. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1343. if (response.data.data.sch_prescriptions[i].advices == null) {
  1344. response.data.data.sch_prescriptions[i].advices = []
  1345. }
  1346. if (response.data.data.sch_prescriptions[i].project == null) {
  1347. response.data.data.sch_prescriptions[i].project = []
  1348. }
  1349. }
  1350. this.prescriptions = []
  1351. this.month_prescriptions = []
  1352. // var month_prescriptions = response.data.data.month_prescriptions
  1353. // this.setMonthPrescription(month_prescriptions)
  1354. this.patientInfo = response.data.data.xt_info
  1355. this.hisPatientInfo = response.data.data.his_info
  1356. this.case_history = response.data.data.case_history
  1357. this.info = response.data.data.info
  1358. this.last_info = response.data.data.last_info
  1359. this.schedule = response.data.data.schedule
  1360. this.doctors = response.data.data.doctors
  1361. this.department = response.data.data.department
  1362. for (let i = 0; i < this.doctors.length; i++) {
  1363. if (this.doctors[i].user_type == 1) {
  1364. this.doctors.splice(i, 1)
  1365. }
  1366. }
  1367. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  1368. if (this.case_history.breathing <= 0) {
  1369. this.case_history.breathing = ''
  1370. }
  1371. if (this.case_history.sick <= 0) {
  1372. this.case_history.sick = ''
  1373. }
  1374. if (this.case_history.diagnose <= 0) {
  1375. this.case_history.diagnose = ''
  1376. }
  1377. if (this.case_history.temperature <= 0) {
  1378. this.case_history.temperature = ''
  1379. }
  1380. if (this.case_history.blood_sugar <= 0) {
  1381. this.case_history.blood_sugar = ''
  1382. }
  1383. if (this.case_history.pulse <= 0) {
  1384. this.case_history.pulse = ''
  1385. }
  1386. if (this.case_history.sbp <= 0) {
  1387. this.case_history.sbp = ''
  1388. }
  1389. if (this.case_history.dbp <= 0) {
  1390. this.case_history.dbp = ''
  1391. }
  1392. if (this.case_history.height <= 0) {
  1393. this.case_history.height = ''
  1394. }
  1395. if (this.case_history.blood_fat <= 0) {
  1396. this.case_history.blood_fat = ''
  1397. }
  1398. if (this.case_history.sick_type <= 0) {
  1399. this.case_history.sick_type = ''
  1400. }
  1401. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  1402. if (this.case_history.is_infect == 1) {
  1403. this.case_history.is_infect = true
  1404. } else {
  1405. this.case_history.is_infect = false
  1406. }
  1407. this.case_history.primary_disease = this.case_history.primary_disease
  1408. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  1409. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  1410. this.case_history.physical_examination = this.case_history.physical_examination
  1411. this.case_history.special_inspection = this.case_history.special_inspection
  1412. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  1413. this.prescriptionList = response.data.data.prescription
  1414. if (response.data.data.prescription.length > 0) {
  1415. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1416. var prescription = response.data.data.prescription[i]
  1417. let tempAdvice = []
  1418. let tempProject = []
  1419. let tempAddition = []
  1420. //药品
  1421. for (let b = 0; b < prescription.advices.length; b++) {
  1422. let obj = {
  1423. advice_id: prescription.advices[b].id,
  1424. drug_name: prescription.advices[b].advice_name,
  1425. single_dose: prescription.advices[b].single_dose,
  1426. delivery_way: prescription.advices[b].delivery_way,
  1427. execution_frequency: prescription.advices[b].execution_frequency,
  1428. retail_price: prescription.advices[b].price.toString(),
  1429. remark: prescription.advices[b].remark,
  1430. day: prescription.advices[b].day,
  1431. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1432. single_dose_unit: prescription.advices[b].single_dose_unit,
  1433. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1434. medical_insurance_number: prescription.advices[b].med_list_codg,
  1435. id: prescription.advices[b].drug_id,
  1436. drug: prescription.advices[b].drug,
  1437. groupno: prescription.advices[b].groupno,
  1438. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  1439. }
  1440. tempAdvice.push(obj)
  1441. }
  1442. //项目
  1443. for (let b = 0; b < prescription.project.length; b++) {
  1444. let obj = {
  1445. id: prescription.project[b].id,
  1446. project_id: prescription.project[b].project_id,
  1447. project_name: prescription.project[b].project.project_name,
  1448. single_dose: prescription.project[b].single_dose,
  1449. delivery_way: prescription.project[b].delivery_way,
  1450. execution_frequency: prescription.project[b].execution_frequency,
  1451. number_days: prescription.project[b].day,
  1452. total: prescription.project[b].count.toString(),
  1453. price: prescription.project[b].price,
  1454. remark: prescription.project[b].remark,
  1455. medical_code: prescription.project[b].project.medical_code,
  1456. unit: prescription.project[b].project.unit,
  1457. type: prescription.project[b].type
  1458. }
  1459. if (prescription.project[b].type == 2) {
  1460. obj['statistical_classification'] = prescription.project[b].team.project_team
  1461. obj['medical_code'] = prescription.project[b].project.medical_code
  1462. obj['project_name'] = prescription.project[b].project.project_name
  1463. obj['project'] = prescription.project[b].project
  1464. } else if (prescription.project[b].type == 3) {
  1465. if(prescription.project[b].team_id > 0){
  1466. obj['statistical_classification'] = prescription.project[b].team.project_team
  1467. }
  1468. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1469. obj['project_name'] = prescription.project[b].good_info.good_name
  1470. obj['good_info'] = prescription.project[b].good_info
  1471. }
  1472. tempProject.push(obj)
  1473. }
  1474. //附加收费
  1475. // for (let b = 0; b < prescription.addition.length; b++) {
  1476. // let obj = {
  1477. // id: prescription.addition[b].id,
  1478. // item_name: prescription.addition[b].item_name,
  1479. // price: prescription.addition[b].price,
  1480. // count: prescription.addition[b].count,
  1481. // item_id: prescription.addition[b].item_id
  1482. // }
  1483. // tempAddition.push(obj)
  1484. // }
  1485. var preTime = ''
  1486. if (prescription.pre_time == 0) {
  1487. // preTime = nowTime
  1488. if (this.schedule.schedule_type == 1) {
  1489. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1490. } else if (this.schedule.schedule_type == 2) {
  1491. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1492. } else if (this.schedule.schedule_type == 3) {
  1493. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1494. }
  1495. } else {
  1496. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  1497. }
  1498. let index = i + 1
  1499. let obj = {
  1500. id: prescription.id,
  1501. name: '处方' + index,
  1502. advices: tempAdvice,
  1503. project: tempProject,
  1504. addition: tempAddition,
  1505. order_status: prescription.order_status,
  1506. pre_time: preTime,
  1507. med_type: parseInt(prescription.med_type)
  1508. }
  1509. this.prescriptions.push(obj)
  1510. }
  1511. } else {
  1512. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  1513. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1514. var prescription = response.data.data.sch_prescriptions[i]
  1515. let tempAdvice = []
  1516. let tempProject = []
  1517. let tempAddition = []
  1518. //药品
  1519. for (let b = 0; b < prescription.advices.length; b++) {
  1520. let obj = {
  1521. advice_id: 0,
  1522. drug_name: prescription.advices[b].advice_name,
  1523. single_dose: prescription.advices[b].single_dose,
  1524. delivery_way: prescription.advices[b].delivery_way,
  1525. execution_frequency: prescription.advices[b].execution_frequency,
  1526. // retail_price: prescription.advices[b].price.toString(),
  1527. remark: prescription.advices[b].remark,
  1528. day: prescription.advices[b].day,
  1529. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1530. single_dose_unit: prescription.advices[b].single_dose_unit,
  1531. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1532. medical_insurance_number: prescription.advices[b].med_list_codg,
  1533. id: prescription.advices[b].drug_id,
  1534. drug: prescription.advices[b].drug,
  1535. groupno: prescription.advices[b].groupno,
  1536. hosp_appr_flag: '1'
  1537. }
  1538. console.log('看看数据1:')
  1539. console.log(obj.prescribing_number_unit)
  1540. console.log(prescription.advices[b].drug.min_unit)
  1541. console.log(prescription.advices[b].drug.max_unit)
  1542. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  1543. obj['retail_price'] = prescription.advices[b].drug.min_price
  1544. console.log('1')
  1545. console.log(obj.retail_price)
  1546. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  1547. obj['retail_price'] = prescription.advices[b].drug.retail_price
  1548. console.log('2')
  1549. console.log(obj.retail_price)
  1550. } else {
  1551. console.log('3')
  1552. obj['retail_price'] = prescription.advices[b].drug.min_price
  1553. console.log(obj.retail_price)
  1554. }
  1555. tempAdvice.push(obj)
  1556. }
  1557. //项目
  1558. for (let b = 0; b < prescription.project.length; b++) {
  1559. let obj = {
  1560. id: 0,
  1561. project_id: prescription.project[b].project_id,
  1562. project_name: prescription.project[b].project.project_name,
  1563. single_dose: prescription.project[b].single_dose,
  1564. delivery_way: prescription.project[b].delivery_way,
  1565. execution_frequency: prescription.project[b].execution_frequency,
  1566. number_days: prescription.project[b].day,
  1567. total: prescription.project[b].count.toString(),
  1568. remark: prescription.project[b].remark,
  1569. medical_code: prescription.project[b].project.medical_code,
  1570. unit: prescription.project[b].project.unit,
  1571. type: prescription.project[b].type
  1572. }
  1573. if (prescription.project[b].type == 2) {
  1574. obj['statistical_classification'] = ""
  1575. obj['medical_code'] = prescription.project[b].project.medical_code
  1576. obj['project_name'] = prescription.project[b].project.project_name
  1577. obj['price'] = prescription.project[b].project.price
  1578. obj['project'] = prescription.project[b].project
  1579. } else if (prescription.project[b].type == 3) {
  1580. obj['statistical_classification'] = ''
  1581. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1582. obj['project_name'] = prescription.project[b].good_info.good_name
  1583. obj['price'] = prescription.project[b].good_info.packing_price
  1584. obj['good_info'] = prescription.project[b].good_info
  1585. }
  1586. tempProject.push(obj)
  1587. }
  1588. // var preTime = nowTime
  1589. var preTime = ''
  1590. if (this.schedule.schedule_type == 1) {
  1591. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1592. } else if (this.schedule.schedule_type == 2) {
  1593. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1594. } else if (this.schedule.schedule_type == 3) {
  1595. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1596. }
  1597. let index = i + 1
  1598. let obj = {
  1599. id: 0,
  1600. name: '处方' + index,
  1601. advices: tempAdvice,
  1602. project: tempProject,
  1603. addition: tempAddition,
  1604. order_status: 1,
  1605. pre_time: preTime,
  1606. med_type: ''
  1607. }
  1608. if (prescription.med_type == 0 || prescription.med_type == '') {
  1609. obj.med_type = ''
  1610. } else {
  1611. obj.med_type = parseInt(prescription.med_type)
  1612. }
  1613. if (obj.med_type == 0 || obj.med_type == '') {
  1614. obj.med_type = 14
  1615. }
  1616. this.prescriptions.push(obj)
  1617. }
  1618. } else {
  1619. let obj = {
  1620. id: 0,
  1621. name: '处方' + 1,
  1622. advices: [],
  1623. project: [],
  1624. addition: [],
  1625. order_status: 0,
  1626. pre_time: nowTime,
  1627. med_type: ''
  1628. }
  1629. obj.med_type = 14
  1630. this.prescriptions.push(obj)
  1631. // if(response.data.data.count <= 1 ){
  1632. // if(response.data.data.last_prescriptions.length == 0){
  1633. // let obj = {
  1634. // id: 0,
  1635. // name: '处方' + 1,
  1636. // advices: [],
  1637. // project: [],
  1638. // addition: [],
  1639. // order_status: 0,
  1640. // pre_time: nowTime,
  1641. //
  1642. // };
  1643. // this.prescriptions.push(obj)
  1644. //
  1645. //
  1646. // }else {
  1647. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  1648. // var prescription = response.data.data.last_prescriptions[i];
  1649. // let tempAdvice = [];
  1650. // let tempProject = [];
  1651. // let tempAddition = [];
  1652. //
  1653. // //药品
  1654. // for (let b = 0; b < prescription.advices.length; b++) {
  1655. // let obj = {
  1656. // advice_id:0,
  1657. // drug_name: prescription.advices[b].advice_name,
  1658. // single_dose: prescription.advices[b].single_dose,
  1659. // delivery_way: prescription.advices[b].delivery_way,
  1660. // execution_frequency: prescription.advices[b].execution_frequency,
  1661. // retail_price: prescription.advices[b].price.toString(),
  1662. // remark: prescription.advices[b].remark,
  1663. // day: prescription.advices[b].day,
  1664. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1665. // single_dose_unit: prescription.advices[b].single_dose_unit,
  1666. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1667. // medical_insurance_number: prescription.advices[b].med_list_codg,
  1668. // id: prescription.advices[b].drug_id,
  1669. // drug:prescription.advices[b].drug
  1670. //
  1671. // };
  1672. // tempAdvice.push(obj)
  1673. // }
  1674. //
  1675. // //项目
  1676. // for (let b = 0; b < prescription.project.length; b++) {
  1677. // let obj = {
  1678. // id:0,
  1679. // project_id: prescription.project[b].project_id,
  1680. // project_name: prescription.project[b].project.project_name,
  1681. // statistical_classification: prescription.project[b].project.statistical_classification,
  1682. // single_dose: prescription.project[b].single_dose,
  1683. // delivery_way: prescription.project[b].delivery_way,
  1684. // execution_frequency: prescription.project[b].execution_frequency,
  1685. // number_days: prescription.project[b].day,
  1686. // total: prescription.project[b].count.toString(),
  1687. // price: prescription.project[b].price,
  1688. // remark: prescription.project[b].remark,
  1689. // medical_code: prescription.project[b].project.medical_code,
  1690. // unit: prescription.project[b].project.unit,
  1691. // type: prescription.project[b].type
  1692. // };
  1693. //
  1694. // if (prescription.project[b].type == 2) {
  1695. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1696. // obj['medical_code'] = prescription.project[b].project.medical_code
  1697. // obj['project_name'] = prescription.project[b].project.project_name
  1698. //
  1699. // } else if (prescription.project[b].type == 3) {
  1700. // obj['statistical_classification'] = ""
  1701. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1702. // obj['project_name'] = prescription.project[b].good_info.good_name
  1703. // }
  1704. // tempProject.push(obj)
  1705. // }
  1706. //
  1707. // //附加收费
  1708. // for (let b = 0; b < prescription.addition.length; b++) {
  1709. // let obj = {
  1710. // item_name: prescription.addition[b].item_name,
  1711. // price: prescription.addition[b].price,
  1712. // count: prescription.addition[b].count,
  1713. // item_id: prescription.addition[b].item_id,
  1714. // };
  1715. // tempAddition.push(obj)
  1716. // }
  1717. //
  1718. // var preTime = nowTime
  1719. //
  1720. // let index = i + 1;
  1721. // let obj = {
  1722. // id: 0,
  1723. // name: '处方' + index,
  1724. // advices: tempAdvice,
  1725. // project: tempProject,
  1726. // addition: tempAddition,
  1727. // order_status: 1,
  1728. // pre_time: preTime
  1729. // };
  1730. // this.prescriptions.push(obj)
  1731. // }
  1732. // }
  1733. // }
  1734. // else{
  1735. // let obj = {
  1736. // id: 0,
  1737. // name: '处方' + 1,
  1738. // advices: [],
  1739. // project: [],
  1740. // addition: [],
  1741. // order_status: 0,
  1742. // pre_time: nowTime,
  1743. //
  1744. // };
  1745. // this.prescriptions.push(obj)
  1746. // }
  1747. }
  1748. }
  1749. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  1750. this.$refs.child.watchSign = 0
  1751. }
  1752. })
  1753. this.$refs.child.watchSign = 0
  1754. }).catch(() => {
  1755. this.patientid = val.id
  1756. let params = {
  1757. 'record_date': this.record_date,
  1758. 'patient_id': val.id,
  1759. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1760. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  1761. 'p_type': 1
  1762. }
  1763. getPatientInfo(params).then(response => {
  1764. if (response.data.state == 0) {
  1765. this.$message.error(response.data.msg)
  1766. return false
  1767. } else {
  1768. if (response.data.data.sch_prescriptions == null) {
  1769. response.data.data.sch_prescriptions = []
  1770. }
  1771. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1772. if (response.data.data.sch_prescriptions[i].advices == null) {
  1773. response.data.data.sch_prescriptions[i].advices = []
  1774. }
  1775. if (response.data.data.sch_prescriptions[i].project == null) {
  1776. response.data.data.sch_prescriptions[i].project = []
  1777. }
  1778. }
  1779. this.prescriptions = []
  1780. this.month_prescriptions = []
  1781. // var month_prescriptions = response.data.data.month_prescriptions
  1782. // this.setMonthPrescription(month_prescriptions)
  1783. this.patientInfo = response.data.data.xt_info
  1784. this.hisPatientInfo = response.data.data.his_info
  1785. this.case_history = response.data.data.case_history
  1786. this.info = response.data.data.info
  1787. this.last_info = response.data.data.last_info
  1788. this.doctors = response.data.data.doctors
  1789. this.department = response.data.data.department
  1790. for (let i = 0; i < this.doctors.length; i++) {
  1791. if (this.doctors[i].user_type == 1) {
  1792. this.doctors.splice(i, 1)
  1793. }
  1794. }
  1795. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  1796. if (this.case_history.breathing <= 0) {
  1797. this.case_history.breathing = ''
  1798. }
  1799. if (this.case_history.sick <= 0) {
  1800. this.case_history.sick = ''
  1801. }
  1802. if (this.case_history.diagnose <= 0) {
  1803. this.case_history.diagnose = ''
  1804. }
  1805. if (this.case_history.temperature <= 0) {
  1806. this.case_history.temperature = ''
  1807. }
  1808. if (this.case_history.blood_sugar <= 0) {
  1809. this.case_history.blood_sugar = ''
  1810. }
  1811. if (this.case_history.pulse <= 0) {
  1812. this.case_history.pulse = ''
  1813. }
  1814. if (this.case_history.sbp <= 0) {
  1815. this.case_history.sbp = ''
  1816. }
  1817. if (this.case_history.dbp <= 0) {
  1818. this.case_history.dbp = ''
  1819. }
  1820. if (this.case_history.height <= 0) {
  1821. this.case_history.height = ''
  1822. }
  1823. if (this.case_history.blood_fat <= 0) {
  1824. this.case_history.blood_fat = ''
  1825. }
  1826. if (this.case_history.sick_type <= 0) {
  1827. this.case_history.sick_type = ''
  1828. }
  1829. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  1830. if (this.case_history.is_infect == 1) {
  1831. this.case_history.is_infect = true
  1832. } else {
  1833. this.case_history.is_infect = false
  1834. }
  1835. this.case_history.primary_disease = this.case_history.primary_disease
  1836. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  1837. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  1838. this.case_history.physical_examination = this.case_history.physical_examination
  1839. this.case_history.special_inspection = this.case_history.special_inspection
  1840. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  1841. this.prescriptionList = response.data.data.prescription
  1842. if (response.data.data.prescription.length > 0) {
  1843. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1844. var prescription = response.data.data.prescription[i]
  1845. let tempAdvice = []
  1846. let tempProject = []
  1847. let tempAddition = []
  1848. //药品
  1849. for (let b = 0; b < prescription.advices.length; b++) {
  1850. let obj = {
  1851. advice_id: prescription.advices[b].id,
  1852. drug_name: prescription.advices[b].advice_name,
  1853. single_dose: prescription.advices[b].single_dose,
  1854. delivery_way: prescription.advices[b].delivery_way,
  1855. execution_frequency: prescription.advices[b].execution_frequency,
  1856. retail_price: prescription.advices[b].price.toString(),
  1857. remark: prescription.advices[b].remark,
  1858. day: prescription.advices[b].day,
  1859. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1860. single_dose_unit: prescription.advices[b].single_dose_unit,
  1861. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1862. medical_insurance_number: prescription.advices[b].med_list_codg,
  1863. id: prescription.advices[b].drug_id,
  1864. drug: prescription.advices[b].drug,
  1865. groupno: prescription.advices[b].groupno,
  1866. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  1867. }
  1868. tempAdvice.push(obj)
  1869. }
  1870. //项目
  1871. for (let b = 0; b < prescription.project.length; b++) {
  1872. let obj = {
  1873. id: prescription.project[b].id,
  1874. project_id: prescription.project[b].project_id,
  1875. project_name: prescription.project[b].project.project_name,
  1876. single_dose: prescription.project[b].single_dose,
  1877. delivery_way: prescription.project[b].delivery_way,
  1878. execution_frequency: prescription.project[b].execution_frequency,
  1879. number_days: prescription.project[b].day,
  1880. total: prescription.project[b].count.toString(),
  1881. price: prescription.project[b].price,
  1882. remark: prescription.project[b].remark,
  1883. medical_code: prescription.project[b].project.medical_code,
  1884. unit: prescription.project[b].project.unit,
  1885. type: prescription.project[b].type
  1886. }
  1887. if (prescription.project[b].type == 2) {
  1888. obj['statistical_classification'] = prescription.project[b].team.project_team
  1889. obj['medical_code'] = prescription.project[b].project.medical_code
  1890. obj['project_name'] = prescription.project[b].project.project_name
  1891. obj['project'] = prescription.project[b].project
  1892. } else if (prescription.project[b].type == 3) {
  1893. if(prescription.project[b].team_id > 0){
  1894. obj['statistical_classification'] = prescription.project[b].team.project_team
  1895. }
  1896. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1897. obj['project_name'] = prescription.project[b].good_info.good_name
  1898. obj['good_info'] = prescription.project[b].good_info
  1899. }
  1900. tempProject.push(obj)
  1901. }
  1902. //附加收费
  1903. // for (let b = 0; b < prescription.addition.length; b++) {
  1904. // let obj = {
  1905. // id: prescription.addition[b].id,
  1906. // item_name: prescription.addition[b].item_name,
  1907. // price: prescription.addition[b].price,
  1908. // count: prescription.addition[b].count,
  1909. // item_id: prescription.addition[b].item_id
  1910. // }
  1911. // tempAddition.push(obj)
  1912. // }
  1913. var preTime = ''
  1914. if (prescription.pre_time == 0) {
  1915. preTime = nowTime
  1916. } else {
  1917. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  1918. }
  1919. let index = i + 1
  1920. let obj = {
  1921. id: prescription.id,
  1922. name: '处方' + index,
  1923. advices: tempAdvice,
  1924. project: tempProject,
  1925. addition: tempAddition,
  1926. order_status: prescription.order_status,
  1927. pre_time: preTime,
  1928. med_type: parseInt(prescription.med_type)
  1929. }
  1930. this.prescriptions.push(obj)
  1931. }
  1932. } else {
  1933. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  1934. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1935. var prescription = response.data.data.sch_prescriptions[i]
  1936. let tempAdvice = []
  1937. let tempProject = []
  1938. let tempAddition = []
  1939. //药品
  1940. for (let b = 0; b < prescription.advices.length; b++) {
  1941. let obj = {
  1942. advice_id: 0,
  1943. drug_name: prescription.advices[b].advice_name,
  1944. single_dose: prescription.advices[b].single_dose,
  1945. delivery_way: prescription.advices[b].delivery_way,
  1946. execution_frequency: prescription.advices[b].execution_frequency,
  1947. // retail_price: prescription.advices[b].price.toString(),
  1948. remark: prescription.advices[b].remark,
  1949. day: prescription.advices[b].day,
  1950. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1951. single_dose_unit: prescription.advices[b].single_dose_unit,
  1952. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1953. medical_insurance_number: prescription.advices[b].med_list_codg,
  1954. id: prescription.advices[b].drug_id,
  1955. drug: prescription.advices[b].drug,
  1956. groupno: prescription.advices[b].groupno,
  1957. hosp_appr_flag: '1'
  1958. }
  1959. console.log('看看数据2:')
  1960. console.log(obj.prescribing_number_unit)
  1961. console.log(prescription.advices[b].drug.min_unit)
  1962. console.log(prescription.advices[b].drug.max_unit)
  1963. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  1964. obj['retail_price'] = prescription.advices[b].drug.min_price
  1965. console.log('1')
  1966. console.log(obj.retail_price)
  1967. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  1968. obj['retail_price'] = prescription.advices[b].drug.retail_price
  1969. console.log('2')
  1970. console.log(obj.retail_price)
  1971. } else {
  1972. console.log('3')
  1973. obj['retail_price'] = prescription.advices[b].drug.min_price
  1974. console.log(obj.retail_price)
  1975. }
  1976. tempAdvice.push(obj)
  1977. }
  1978. //项目
  1979. for (let b = 0; b < prescription.project.length; b++) {
  1980. let obj = {
  1981. id: 0,
  1982. project_id: prescription.project[b].project_id,
  1983. project_name: prescription.project[b].project.project_name,
  1984. single_dose: prescription.project[b].single_dose,
  1985. delivery_way: prescription.project[b].delivery_way,
  1986. execution_frequency: prescription.project[b].execution_frequency,
  1987. number_days: prescription.project[b].day,
  1988. total: prescription.project[b].count.toString(),
  1989. remark: prescription.project[b].remark,
  1990. medical_code: prescription.project[b].project.medical_code,
  1991. unit: prescription.project[b].project.unit,
  1992. type: prescription.project[b].type
  1993. }
  1994. if (prescription.project[b].type == 2) {
  1995. obj['statistical_classification'] =""
  1996. obj['medical_code'] = prescription.project[b].project.medical_code
  1997. obj['project_name'] = prescription.project[b].project.project_name
  1998. obj['price'] = prescription.project[b].project.price
  1999. obj['project'] = prescription.project[b].project
  2000. } else if (prescription.project[b].type == 3) {
  2001. obj['statistical_classification'] = ''
  2002. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2003. obj['project_name'] = prescription.project[b].good_info.good_name
  2004. obj['price'] = prescription.project[b].good_info.packing_price
  2005. obj['good_info'] = prescription.project[b].good_info
  2006. }
  2007. tempProject.push(obj)
  2008. }
  2009. var preTime = nowTime
  2010. let index = i + 1
  2011. let obj = {
  2012. id: 0,
  2013. name: '处方' + index,
  2014. advices: tempAdvice,
  2015. project: tempProject,
  2016. addition: tempAddition,
  2017. order_status: 1,
  2018. pre_time: preTime,
  2019. med_type: ''
  2020. }
  2021. if (prescription.med_type == 0 || prescription.med_type == '') {
  2022. obj.med_type = ''
  2023. } else {
  2024. obj.med_type = parseInt(prescription.med_type)
  2025. }
  2026. if (obj.med_type == 0 || obj.med_type == '') {
  2027. obj.med_type = 14
  2028. }
  2029. this.prescriptions.push(obj)
  2030. }
  2031. } else {
  2032. let obj = {
  2033. id: 0,
  2034. name: '处方' + 1,
  2035. advices: [],
  2036. project: [],
  2037. addition: [],
  2038. order_status: 0,
  2039. pre_time: nowTime,
  2040. med_type: ''
  2041. }
  2042. obj.med_type = 14
  2043. this.prescriptions.push(obj)
  2044. // if(response.data.data.count <= 1 ){
  2045. // if(response.data.data.last_prescriptions.length == 0){
  2046. // let obj = {
  2047. // id: 0,
  2048. // name: '处方' + 1,
  2049. // advices: [],
  2050. // project: [],
  2051. // addition: [],
  2052. // order_status: 0,
  2053. // pre_time: nowTime,
  2054. //
  2055. // };
  2056. // this.prescriptions.push(obj)
  2057. //
  2058. //
  2059. // }else {
  2060. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  2061. // var prescription = response.data.data.last_prescriptions[i];
  2062. // let tempAdvice = [];
  2063. // let tempProject = [];
  2064. // let tempAddition = [];
  2065. //
  2066. // //药品
  2067. // for (let b = 0; b < prescription.advices.length; b++) {
  2068. // let obj = {
  2069. // advice_id:0,
  2070. // drug_name: prescription.advices[b].advice_name,
  2071. // single_dose: prescription.advices[b].single_dose,
  2072. // delivery_way: prescription.advices[b].delivery_way,
  2073. // execution_frequency: prescription.advices[b].execution_frequency,
  2074. // retail_price: prescription.advices[b].price.toString(),
  2075. // remark: prescription.advices[b].remark,
  2076. // day: prescription.advices[b].day,
  2077. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2078. // single_dose_unit: prescription.advices[b].single_dose_unit,
  2079. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2080. // medical_insurance_number: prescription.advices[b].med_list_codg,
  2081. // id: prescription.advices[b].drug_id,
  2082. // drug:prescription.advices[b].drug
  2083. //
  2084. // };
  2085. // tempAdvice.push(obj)
  2086. // }
  2087. //
  2088. // //项目
  2089. // for (let b = 0; b < prescription.project.length; b++) {
  2090. // let obj = {
  2091. // id:0,
  2092. // project_id: prescription.project[b].project_id,
  2093. // project_name: prescription.project[b].project.project_name,
  2094. // statistical_classification: prescription.project[b].project.statistical_classification,
  2095. // single_dose: prescription.project[b].single_dose,
  2096. // delivery_way: prescription.project[b].delivery_way,
  2097. // execution_frequency: prescription.project[b].execution_frequency,
  2098. // number_days: prescription.project[b].day,
  2099. // total: prescription.project[b].count.toString(),
  2100. // price: prescription.project[b].price,
  2101. // remark: prescription.project[b].remark,
  2102. // medical_code: prescription.project[b].project.medical_code,
  2103. // unit: prescription.project[b].project.unit,
  2104. // type: prescription.project[b].type
  2105. // };
  2106. //
  2107. // if (prescription.project[b].type == 2) {
  2108. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2109. // obj['medical_code'] = prescription.project[b].project.medical_code
  2110. // obj['project_name'] = prescription.project[b].project.project_name
  2111. //
  2112. // } else if (prescription.project[b].type == 3) {
  2113. // obj['statistical_classification'] = ""
  2114. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2115. // obj['project_name'] = prescription.project[b].good_info.good_name
  2116. // }
  2117. // tempProject.push(obj)
  2118. // }
  2119. //
  2120. // //附加收费
  2121. // for (let b = 0; b < prescription.addition.length; b++) {
  2122. // let obj = {
  2123. // item_name: prescription.addition[b].item_name,
  2124. // price: prescription.addition[b].price,
  2125. // count: prescription.addition[b].count,
  2126. // item_id: prescription.addition[b].item_id,
  2127. // };
  2128. // tempAddition.push(obj)
  2129. // }
  2130. //
  2131. // var preTime = nowTime
  2132. //
  2133. // let index = i + 1;
  2134. // let obj = {
  2135. // id: 0,
  2136. // name: '处方' + index,
  2137. // advices: tempAdvice,
  2138. // project: tempProject,
  2139. // addition: tempAddition,
  2140. // order_status: 1,
  2141. // pre_time: preTime
  2142. // };
  2143. // this.prescriptions.push(obj)
  2144. // }
  2145. // }
  2146. // }else{
  2147. // let obj = {
  2148. // id: 0,
  2149. // name: '处方' + 1,
  2150. // advices: [],
  2151. // project: [],
  2152. // addition: [],
  2153. // order_status: 0,
  2154. // pre_time: nowTime,
  2155. //
  2156. // };
  2157. // this.prescriptions.push(obj)
  2158. // }
  2159. }
  2160. }
  2161. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  2162. this.$refs.child.watchSign = 0
  2163. }
  2164. })
  2165. })
  2166. this.$refs.child.watchSign = 0
  2167. } else {
  2168. this.patientid = val.id
  2169. let params = {
  2170. 'record_date': this.record_date,
  2171. 'patient_id': val.id,
  2172. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  2173. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  2174. 'p_type': 1
  2175. }
  2176. getPatientInfo(params).then(response => {
  2177. if (response.data.state == 0) {
  2178. this.$message.error(response.data.msg)
  2179. return false
  2180. } else {
  2181. if (response.data.data.sch_prescriptions == null) {
  2182. response.data.data.sch_prescriptions = []
  2183. }
  2184. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2185. if (response.data.data.sch_prescriptions[i].advices == null) {
  2186. response.data.data.sch_prescriptions[i].advices = []
  2187. }
  2188. if (response.data.data.sch_prescriptions[i].project == null) {
  2189. response.data.data.sch_prescriptions[i].project = []
  2190. }
  2191. }
  2192. this.prescriptions = []
  2193. this.month_prescriptions = []
  2194. // var month_prescriptions = response.data.data.month_prescriptions
  2195. // this.setMonthPrescription(month_prescriptions)
  2196. this.patientInfo = response.data.data.xt_info
  2197. this.hisPatientInfo = response.data.data.his_info
  2198. this.case_history = response.data.data.case_history
  2199. this.info = response.data.data.info
  2200. this.last_info = response.data.data.last_info
  2201. this.doctors = response.data.data.doctors
  2202. this.department = response.data.data.department
  2203. for (let i = 0; i < this.doctors.length; i++) {
  2204. if (this.doctors[i].user_type == 1) {
  2205. this.doctors.splice(i, 1)
  2206. }
  2207. }
  2208. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2209. if (this.case_history.breathing <= 0) {
  2210. this.case_history.breathing = ''
  2211. }
  2212. if (this.case_history.sick <= 0) {
  2213. this.case_history.sick = ''
  2214. }
  2215. if (this.case_history.diagnose <= 0) {
  2216. this.case_history.diagnose = ''
  2217. }
  2218. if (this.case_history.temperature <= 0) {
  2219. this.case_history.temperature = ''
  2220. }
  2221. if (this.case_history.blood_sugar <= 0) {
  2222. this.case_history.blood_sugar = ''
  2223. }
  2224. if (this.case_history.pulse <= 0) {
  2225. this.case_history.pulse = ''
  2226. }
  2227. if (this.case_history.sbp <= 0) {
  2228. this.case_history.sbp = ''
  2229. }
  2230. if (this.case_history.dbp <= 0) {
  2231. this.case_history.dbp = ''
  2232. }
  2233. if (this.case_history.height <= 0) {
  2234. this.case_history.height = ''
  2235. }
  2236. if (this.case_history.blood_fat <= 0) {
  2237. this.case_history.blood_fat = ''
  2238. }
  2239. if (this.case_history.sick_type <= 0) {
  2240. this.case_history.sick_type = ''
  2241. }
  2242. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  2243. if (this.case_history.is_infect == 1) {
  2244. this.case_history.is_infect = true
  2245. } else {
  2246. this.case_history.is_infect = false
  2247. }
  2248. this.case_history.primary_disease = this.case_history.primary_disease
  2249. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  2250. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  2251. this.case_history.physical_examination = this.case_history.physical_examination
  2252. this.case_history.special_inspection = this.case_history.special_inspection
  2253. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  2254. this.prescriptionList = response.data.data.prescription
  2255. if (response.data.data.prescription.length > 0) {
  2256. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2257. var prescription = response.data.data.prescription[i]
  2258. let tempAdvice = []
  2259. let tempProject = []
  2260. let tempAddition = []
  2261. //药品
  2262. for (let b = 0; b < prescription.advices.length; b++) {
  2263. let obj = {
  2264. advice_id: prescription.advices[b].id,
  2265. drug_name: prescription.advices[b].advice_name,
  2266. single_dose: prescription.advices[b].single_dose,
  2267. delivery_way: prescription.advices[b].delivery_way,
  2268. execution_frequency: prescription.advices[b].execution_frequency,
  2269. retail_price: prescription.advices[b].price.toString(),
  2270. remark: prescription.advices[b].remark,
  2271. day: prescription.advices[b].day,
  2272. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2273. single_dose_unit: prescription.advices[b].single_dose_unit,
  2274. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2275. medical_insurance_number: prescription.advices[b].med_list_codg,
  2276. id: prescription.advices[b].drug_id,
  2277. drug: prescription.advices[b].drug,
  2278. groupno: prescription.advices[b].groupno,
  2279. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  2280. }
  2281. tempAdvice.push(obj)
  2282. }
  2283. //项目
  2284. for (let b = 0; b < prescription.project.length; b++) {
  2285. let obj = {
  2286. id: prescription.project[b].id,
  2287. project_id: prescription.project[b].project_id,
  2288. project_name: prescription.project[b].project.project_name,
  2289. single_dose: prescription.project[b].single_dose,
  2290. delivery_way: prescription.project[b].delivery_way,
  2291. execution_frequency: prescription.project[b].execution_frequency,
  2292. number_days: prescription.project[b].day,
  2293. total: prescription.project[b].count.toString(),
  2294. price: prescription.project[b].price,
  2295. remark: prescription.project[b].remark,
  2296. medical_code: prescription.project[b].project.medical_code,
  2297. unit: prescription.project[b].project.unit,
  2298. type: prescription.project[b].type
  2299. }
  2300. if (prescription.project[b].type == 2) {
  2301. obj['statistical_classification'] = prescription.project[b].team.project_team
  2302. obj['medical_code'] = prescription.project[b].project.medical_code
  2303. obj['project_name'] = prescription.project[b].project.project_name
  2304. obj['project'] = prescription.project[b].project
  2305. } else if (prescription.project[b].type == 3) {
  2306. if(prescription.project[b].team_id > 0){
  2307. obj['statistical_classification'] = prescription.project[b].team.project_team
  2308. }
  2309. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2310. obj['project_name'] = prescription.project[b].good_info.good_name
  2311. obj['good_info'] = prescription.project[b].good_info
  2312. }
  2313. tempProject.push(obj)
  2314. }
  2315. //附加收费
  2316. // for (let b = 0; b < prescription.addition.length; b++) {
  2317. // let obj = {
  2318. // id: prescription.addition[b].id,
  2319. // item_name: prescription.addition[b].item_name,
  2320. // price: prescription.addition[b].price,
  2321. // count: prescription.addition[b].count,
  2322. // item_id: prescription.addition[b].item_id
  2323. // }
  2324. // tempAddition.push(obj)
  2325. // }
  2326. var preTime = ''
  2327. if (prescription.pre_time == 0) {
  2328. preTime = nowTime
  2329. } else {
  2330. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  2331. }
  2332. let index = i + 1
  2333. let obj = {
  2334. id: prescription.id,
  2335. name: '处方' + index,
  2336. advices: tempAdvice,
  2337. project: tempProject,
  2338. addition: tempAddition,
  2339. order_status: prescription.order_status,
  2340. pre_time: preTime,
  2341. med_type: parseInt(prescription.med_type)
  2342. }
  2343. this.prescriptions.push(obj)
  2344. }
  2345. } else {
  2346. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  2347. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2348. var prescription = response.data.data.sch_prescriptions[i]
  2349. let tempAdvice = []
  2350. let tempProject = []
  2351. let tempAddition = []
  2352. //药品
  2353. for (let b = 0; b < prescription.advices.length; b++) {
  2354. let index = b + 1
  2355. let obj = {
  2356. advice_id: 0,
  2357. drug_name: prescription.advices[b].advice_name,
  2358. single_dose: prescription.advices[b].single_dose,
  2359. delivery_way: prescription.advices[b].delivery_way,
  2360. execution_frequency: prescription.advices[b].execution_frequency,
  2361. // retail_price: prescription.advices[b].price.toString(),
  2362. remark: prescription.advices[b].remark,
  2363. day: prescription.advices[b].day,
  2364. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2365. single_dose_unit: prescription.advices[b].single_dose_unit,
  2366. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2367. medical_insurance_number: prescription.advices[b].med_list_codg,
  2368. id: prescription.advices[b].drug_id,
  2369. drug: prescription.advices[b].drug,
  2370. groupno: prescription.advices[b].groupno,
  2371. hosp_appr_flag: '1'
  2372. }
  2373. console.log('看看数据3:')
  2374. console.log(obj.prescribing_number_unit)
  2375. console.log(prescription.advices[b].drug.min_unit)
  2376. console.log(prescription.advices[b].drug.max_unit)
  2377. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  2378. obj['retail_price'] = prescription.advices[b].drug.min_price
  2379. console.log('1')
  2380. console.log(obj.retail_price)
  2381. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  2382. obj['retail_price'] = prescription.advices[b].drug.retail_price
  2383. console.log('2')
  2384. console.log(obj.retail_price)
  2385. } else {
  2386. console.log('3')
  2387. obj['retail_price'] = prescription.advices[b].drug.min_price
  2388. console.log(obj.retail_price)
  2389. }
  2390. tempAdvice.push(obj)
  2391. }
  2392. //项目
  2393. for (let b = 0; b < prescription.project.length; b++) {
  2394. let obj = {
  2395. id: 0,
  2396. project_id: prescription.project[b].project_id,
  2397. project_name: prescription.project[b].project.project_name,
  2398. single_dose: prescription.project[b].single_dose,
  2399. delivery_way: prescription.project[b].delivery_way,
  2400. execution_frequency: prescription.project[b].execution_frequency,
  2401. number_days: prescription.project[b].day,
  2402. total: prescription.project[b].count.toString(),
  2403. remark: prescription.project[b].remark,
  2404. medical_code: prescription.project[b].project.medical_code,
  2405. unit: prescription.project[b].project.unit,
  2406. type: prescription.project[b].type
  2407. }
  2408. if (prescription.project[b].type == 2) {
  2409. obj['statistical_classification'] = ''
  2410. obj['medical_code'] = prescription.project[b].project.medical_code
  2411. obj['project_name'] = prescription.project[b].project.project_name
  2412. obj['price'] = prescription.project[b].project.price
  2413. obj['project'] = prescription.project[b].project
  2414. } else if (prescription.project[b].type == 3) {
  2415. obj['statistical_classification'] = ''
  2416. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2417. obj['project_name'] = prescription.project[b].good_info.good_name
  2418. obj['price'] = prescription.project[b].good_info.packing_price
  2419. obj['good_info'] = prescription.project[b].good_info
  2420. }
  2421. tempProject.push(obj)
  2422. }
  2423. var preTime = nowTime
  2424. let index = i + 1
  2425. let obj = {
  2426. id: 0,
  2427. name: '处方' + index,
  2428. advices: tempAdvice,
  2429. project: tempProject,
  2430. addition: tempAddition,
  2431. order_status: 1,
  2432. pre_time: preTime,
  2433. med_type: ''
  2434. }
  2435. if (prescription.med_type == 0 || prescription.med_type == '') {
  2436. obj.med_type = ''
  2437. } else {
  2438. obj.med_type = parseInt(prescription.med_type)
  2439. }
  2440. if (obj.med_type == 0 || obj.med_type == '') {
  2441. obj.med_type = 14
  2442. }
  2443. this.prescriptions.push(obj)
  2444. }
  2445. } else {
  2446. let obj = {
  2447. id: 0,
  2448. name: '处方' + 1,
  2449. advices: [],
  2450. project: [],
  2451. addition: [],
  2452. order_status: 0,
  2453. pre_time: nowTime,
  2454. med_type: ''
  2455. }
  2456. obj.med_type = 14
  2457. this.prescriptions.push(obj)
  2458. // if(response.data.data.count <= 1 ){
  2459. // if(response.data.data.last_prescriptions.length == 0){
  2460. // let obj = {
  2461. // id: 0,
  2462. // name: '处方' + 1,
  2463. // advices: [],
  2464. // project: [],
  2465. // addition: [],
  2466. // order_status: 0,
  2467. // pre_time: nowTime,
  2468. //
  2469. // };
  2470. // this.prescriptions.push(obj)
  2471. //
  2472. //
  2473. // }else {
  2474. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  2475. // var prescription = response.data.data.last_prescriptions[i];
  2476. // let tempAdvice = [];
  2477. // let tempProject = [];
  2478. // let tempAddition = [];
  2479. //
  2480. // //药品
  2481. // for (let b = 0; b < prescription.advices.length; b++) {
  2482. // let obj = {
  2483. // advice_id:0,
  2484. // drug_name: prescription.advices[b].advice_name,
  2485. // single_dose: prescription.advices[b].single_dose,
  2486. // delivery_way: prescription.advices[b].delivery_way,
  2487. // execution_frequency: prescription.advices[b].execution_frequency,
  2488. // retail_price: prescription.advices[b].price.toString(),
  2489. // remark: prescription.advices[b].remark,
  2490. // day: prescription.advices[b].day,
  2491. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2492. // single_dose_unit: prescription.advices[b].single_dose_unit,
  2493. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2494. // medical_insurance_number: prescription.advices[b].med_list_codg,
  2495. // id: prescription.advices[b].drug_id,
  2496. // drug:prescription.advices[b].drug
  2497. //
  2498. // };
  2499. // tempAdvice.push(obj)
  2500. // }
  2501. //
  2502. // //项目
  2503. // for (let b = 0; b < prescription.project.length; b++) {
  2504. // let obj = {
  2505. // id:0,
  2506. // project_id: prescription.project[b].project_id,
  2507. // project_name: prescription.project[b].project.project_name,
  2508. // statistical_classification: prescription.project[b].project.statistical_classification,
  2509. // single_dose: prescription.project[b].single_dose,
  2510. // delivery_way: prescription.project[b].delivery_way,
  2511. // execution_frequency: prescription.project[b].execution_frequency,
  2512. // number_days: prescription.project[b].day,
  2513. // total: prescription.project[b].count.toString(),
  2514. // price: prescription.project[b].price,
  2515. // remark: prescription.project[b].remark,
  2516. // medical_code: prescription.project[b].project.medical_code,
  2517. // unit: prescription.project[b].project.unit,
  2518. // type: prescription.project[b].type
  2519. // };
  2520. //
  2521. // if (prescription.project[b].type == 2) {
  2522. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2523. // obj['medical_code'] = prescription.project[b].project.medical_code
  2524. // obj['project_name'] = prescription.project[b].project.project_name
  2525. //
  2526. // } else if (prescription.project[b].type == 3) {
  2527. // obj['statistical_classification'] = ""
  2528. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2529. // obj['project_name'] = prescription.project[b].good_info.good_name
  2530. // }
  2531. // tempProject.push(obj)
  2532. // }
  2533. //
  2534. // //附加收费
  2535. // for (let b = 0; b < prescription.addition.length; b++) {
  2536. // let obj = {
  2537. // item_name: prescription.addition[b].item_name,
  2538. // price: prescription.addition[b].price,
  2539. // count: prescription.addition[b].count,
  2540. // item_id: prescription.addition[b].item_id,
  2541. // };
  2542. // tempAddition.push(obj)
  2543. // }
  2544. //
  2545. // var preTime = nowTime
  2546. //
  2547. // let index = i + 1;
  2548. // let obj = {
  2549. // id: 0,
  2550. // name: '处方' + index,
  2551. // advices: tempAdvice,
  2552. // project: tempProject,
  2553. // addition: tempAddition,
  2554. // order_status: 1,
  2555. // pre_time: preTime
  2556. // };
  2557. // this.prescriptions.push(obj)
  2558. // }
  2559. // }
  2560. // }else{
  2561. // let obj = {
  2562. // id: 0,
  2563. // name: '处方' + 1,
  2564. // advices: [],
  2565. // project: [],
  2566. // addition: [],
  2567. // order_status: 0,
  2568. // pre_time: nowTime,
  2569. //
  2570. // };
  2571. // this.prescriptions.push(obj)
  2572. // }
  2573. }
  2574. }
  2575. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  2576. this.$refs.child.watchSign = 0
  2577. }
  2578. })
  2579. this.$refs.child.watchSign = 0
  2580. }
  2581. } else {
  2582. var nowDate = new Date()
  2583. var nowYear = nowDate.getFullYear()
  2584. var nowMonth = nowDate.getMonth() + 1
  2585. var nowDay = nowDate.getDate()
  2586. var hours = nowDate.getHours()
  2587. var min = nowDate.getMinutes()
  2588. var nowTime =
  2589. nowYear +
  2590. '-' +
  2591. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  2592. '-' +
  2593. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2594. ':' + (min < 10 ? '0' + min : min)
  2595. var last_month = nowDate.getMonth() < 10 ? '0' + nowDate.getMonth().toString() : nowDate.getMonth() //获取当前月份(0-11,0代表1月)
  2596. var endTime =
  2597. nowYear +
  2598. '-' +
  2599. last_month +
  2600. '-' +
  2601. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2602. ':' + (min < 10 ? '0' + min : min)
  2603. let isShowDailog = false
  2604. for (let i = 0; i < this.prescriptions.length; i++) {
  2605. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  2606. isShowDailog = true
  2607. }
  2608. }
  2609. if (isShowDailog) {
  2610. this.all_data.map((item, index) => {
  2611. if (item.id == this.oldCurrentRow.id) {
  2612. this.$refs.tab.setCurrentRow(this.all_data[index])
  2613. return
  2614. }
  2615. })
  2616. // this.$confirm('是否保存当前处方', '保存', {
  2617. // confirmButtonText: '确 定',
  2618. // cancelButtonText: '取 消',
  2619. // type: 'warning'
  2620. // }).then(() => {
  2621. // this.open(1)
  2622. // }).catch(() => {
  2623. for (let i = 0; i < this.all_data.length; i++) {
  2624. if (this.all_data[i].id == val.id) {
  2625. this.$refs.tab.setCurrentRow(this.all_data[i])
  2626. }
  2627. }
  2628. this.patientid = val.id
  2629. let params = {
  2630. 'record_date': this.record_date,
  2631. 'patient_id': val.id,
  2632. 'his_patient_id': val.his_patient_id,
  2633. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  2634. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  2635. 'p_type': 1
  2636. }
  2637. if (this.current_tab == 'day') {
  2638. getPatientInfo(params).then(response => {
  2639. if (response.data.state == 0) {
  2640. this.$message.error(response.data.msg)
  2641. return false
  2642. } else {
  2643. if (response.data.data.sch_prescriptions == null) {
  2644. response.data.data.sch_prescriptions = []
  2645. }
  2646. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2647. if (response.data.data.sch_prescriptions[i].advices == null) {
  2648. response.data.data.sch_prescriptions[i].advices = []
  2649. }
  2650. if (response.data.data.sch_prescriptions[i].project == null) {
  2651. response.data.data.sch_prescriptions[i].project = []
  2652. }
  2653. }
  2654. for (let i = 0; i < this.all_data.length; i++) {
  2655. if (this.all_data[i].id == val.id) {
  2656. this.oldCurrentRow = this.all_data[i]
  2657. }
  2658. }
  2659. this.prescriptions = []
  2660. this.patientInfo = response.data.data.xt_info
  2661. this.hisPatientInfo = response.data.data.his_info
  2662. this.case_history = response.data.data.case_history
  2663. this.doctors = response.data.data.doctors
  2664. this.department = response.data.data.department
  2665. this.schedule = response.data.data.schedule
  2666. for (let i = 0; i < this.doctors.length; i++) {
  2667. if (this.doctors[i].user_type == 1) {
  2668. this.doctors.splice(i, 1)
  2669. }
  2670. }
  2671. this.case_history = response.data.data.case_history
  2672. this.info = response.data.data.info
  2673. this.last_info = response.data.data.last_info
  2674. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2675. if (this.case_history.breathing <= 0) {
  2676. this.case_history.breathing = ''
  2677. }
  2678. if (this.case_history.sick <= 0) {
  2679. this.case_history.sick = ''
  2680. }
  2681. if (this.case_history.diagnose <= 0) {
  2682. this.case_history.diagnose = ''
  2683. }
  2684. if (this.case_history.temperature <= 0) {
  2685. this.case_history.temperature = ''
  2686. }
  2687. if (this.case_history.blood_sugar <= 0) {
  2688. this.case_history.blood_sugar = ''
  2689. }
  2690. if (this.case_history.pulse <= 0) {
  2691. this.case_history.pulse = ''
  2692. }
  2693. if (this.case_history.sbp <= 0) {
  2694. this.case_history.sbp = ''
  2695. }
  2696. if (this.case_history.dbp <= 0) {
  2697. this.case_history.dbp = ''
  2698. }
  2699. if (this.case_history.height <= 0) {
  2700. this.case_history.height = ''
  2701. }
  2702. if (this.case_history.blood_fat <= 0) {
  2703. this.case_history.blood_fat = ''
  2704. }
  2705. if (this.case_history.sick_type <= 0) {
  2706. this.case_history.sick_type = ''
  2707. }
  2708. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  2709. if (this.case_history.is_infect == 1) {
  2710. this.case_history.is_infect = true
  2711. } else {
  2712. this.case_history.is_infect = false
  2713. }
  2714. this.case_history.primary_disease = this.case_history.primary_disease
  2715. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  2716. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  2717. this.case_history.physical_examination = this.case_history.physical_examination
  2718. this.case_history.special_inspection = this.case_history.special_inspection
  2719. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  2720. this.prescriptionList = response.data.data.prescription
  2721. if (response.data.data.prescription.length > 0) {
  2722. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2723. var prescription = response.data.data.prescription[i]
  2724. let tempAdvice = []
  2725. let tempProject = []
  2726. let tempAddition = []
  2727. //药品
  2728. for (let b = 0; b < prescription.advices.length; b++) {
  2729. let obj = {
  2730. advice_id: prescription.advices[b].id,
  2731. drug_name: prescription.advices[b].advice_name,
  2732. single_dose: prescription.advices[b].single_dose,
  2733. delivery_way: prescription.advices[b].delivery_way,
  2734. execution_frequency: prescription.advices[b].execution_frequency,
  2735. retail_price: prescription.advices[b].price.toString(),
  2736. remark: prescription.advices[b].remark,
  2737. day: prescription.advices[b].day,
  2738. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2739. single_dose_unit: prescription.advices[b].single_dose_unit,
  2740. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2741. medical_insurance_number: prescription.advices[b].med_list_codg,
  2742. id: prescription.advices[b].drug_id,
  2743. drug: prescription.advices[b].drug,
  2744. groupno: prescription.advices[b].groupno,
  2745. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  2746. }
  2747. tempAdvice.push(obj)
  2748. }
  2749. //项目
  2750. for (let b = 0; b < prescription.project.length; b++) {
  2751. let obj = {
  2752. id: prescription.project[b].id,
  2753. project_id: prescription.project[b].project_id,
  2754. project_name: prescription.project[b].project.project_name,
  2755. single_dose: prescription.project[b].single_dose,
  2756. delivery_way: prescription.project[b].delivery_way,
  2757. execution_frequency: prescription.project[b].execution_frequency,
  2758. number_days: prescription.project[b].day,
  2759. total: prescription.project[b].count.toString(),
  2760. price: prescription.project[b].price,
  2761. remark: prescription.project[b].remark,
  2762. medical_code: prescription.project[b].project.medical_code,
  2763. unit: prescription.project[b].project.unit,
  2764. type: prescription.project[b].type
  2765. }
  2766. if (prescription.project[b].type == 2) {
  2767. obj['statistical_classification'] = prescription.project[b].team.project_team
  2768. obj['medical_code'] = prescription.project[b].project.medical_code
  2769. obj['project_name'] = prescription.project[b].project.project_name
  2770. obj['project'] = prescription.project[b].project
  2771. } else if (prescription.project[b].type == 3) {
  2772. if(prescription.project[b].team_id > 0){
  2773. obj['statistical_classification'] = prescription.project[b].team.project_team
  2774. }
  2775. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2776. obj['project_name'] = prescription.project[b].good_info.good_name
  2777. obj['good_info'] = prescription.project[b].good_info
  2778. }
  2779. tempProject.push(obj)
  2780. }
  2781. //附加收费
  2782. // for (let b = 0; b < prescription.addition.length; b++) {
  2783. // let obj = {
  2784. // id: prescription.addition[b].id,
  2785. // item_name: prescription.addition[b].item_name,
  2786. // price: prescription.addition[b].price,
  2787. // count: prescription.addition[b].count,
  2788. // item_id: prescription.addition[b].item_id
  2789. // }
  2790. // tempAddition.push(obj)
  2791. // }
  2792. var preTime = ''
  2793. if (prescription.pre_time == 0) {
  2794. // preTime = nowTime
  2795. if (this.schedule.schedule_type == 1) {
  2796. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  2797. } else if (this.schedule.schedule_type == 2) {
  2798. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  2799. } else if (this.schedule.schedule_type == 3) {
  2800. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  2801. }
  2802. } else {
  2803. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  2804. }
  2805. let index = i + 1
  2806. let obj = {
  2807. id: prescription.id,
  2808. name: '处方' + index,
  2809. advices: tempAdvice,
  2810. project: tempProject,
  2811. addition: tempAddition,
  2812. order_status: prescription.order_status,
  2813. pre_time: preTime,
  2814. med_type: parseInt(prescription.med_type)
  2815. }
  2816. this.prescriptions.push(obj)
  2817. }
  2818. } else {
  2819. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  2820. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2821. var prescription = response.data.data.sch_prescriptions[i]
  2822. let tempAdvice = []
  2823. let tempProject = []
  2824. let tempAddition = []
  2825. //药品
  2826. for (let b = 0; b < prescription.advices.length; b++) {
  2827. let index = b + 1
  2828. let obj = {
  2829. advice_id: 0,
  2830. drug_name: prescription.advices[b].advice_name,
  2831. single_dose: prescription.advices[b].single_dose,
  2832. delivery_way: prescription.advices[b].delivery_way,
  2833. execution_frequency: prescription.advices[b].execution_frequency,
  2834. // retail_price: prescription.advices[b].price.toString(),
  2835. remark: prescription.advices[b].remark,
  2836. day: prescription.advices[b].day,
  2837. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2838. single_dose_unit: prescription.advices[b].single_dose_unit,
  2839. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2840. medical_insurance_number: prescription.advices[b].med_list_codg,
  2841. id: prescription.advices[b].drug_id,
  2842. drug: prescription.advices[b].drug,
  2843. groupno: prescription.advices[b].groupno,
  2844. hosp_appr_flag: '1'
  2845. }
  2846. console.log('看看数据4:')
  2847. console.log(obj.prescribing_number_unit)
  2848. console.log(prescription.advices[b].drug.min_unit)
  2849. console.log(prescription.advices[b].drug.max_unit)
  2850. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  2851. obj['retail_price'] = prescription.advices[b].drug.min_price
  2852. console.log('1')
  2853. console.log(obj.retail_price)
  2854. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  2855. obj['retail_price'] = prescription.advices[b].drug.retail_price
  2856. console.log('2')
  2857. console.log(obj.retail_price)
  2858. } else {
  2859. console.log('3')
  2860. obj['retail_price'] = prescription.advices[b].drug.min_price
  2861. console.log(obj.retail_price)
  2862. }
  2863. tempAdvice.push(obj)
  2864. }
  2865. //项目
  2866. for (let b = 0; b < prescription.project.length; b++) {
  2867. let obj = {
  2868. id: 0,
  2869. project_id: prescription.project[b].project_id,
  2870. project_name: prescription.project[b].project.project_name,
  2871. single_dose: prescription.project[b].single_dose,
  2872. delivery_way: prescription.project[b].delivery_way,
  2873. execution_frequency: prescription.project[b].execution_frequency,
  2874. number_days: prescription.project[b].day,
  2875. total: prescription.project[b].count.toString(),
  2876. remark: prescription.project[b].remark,
  2877. medical_code: prescription.project[b].project.medical_code,
  2878. unit: prescription.project[b].project.unit,
  2879. type: prescription.project[b].type
  2880. }
  2881. if (prescription.project[b].type == 2) {
  2882. obj['statistical_classification'] = ""
  2883. obj['medical_code'] = prescription.project[b].project.medical_code
  2884. obj['project_name'] = prescription.project[b].project.project_name
  2885. obj['price'] = prescription.project[b].project.price
  2886. obj['project'] = prescription.project[b].project
  2887. } else if (prescription.project[b].type == 3) {
  2888. obj['statistical_classification'] = ''
  2889. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2890. obj['project_name'] = prescription.project[b].good_info.good_name
  2891. obj['price'] = prescription.project[b].good_info.packing_price
  2892. obj['good_info'] = prescription.project[b].good_info
  2893. }
  2894. tempProject.push(obj)
  2895. }
  2896. // var preTime = nowTime
  2897. var preTime = ''
  2898. if (this.schedule.schedule_type == 1) {
  2899. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  2900. } else if (this.schedule.schedule_type == 2) {
  2901. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  2902. } else if (this.schedule.schedule_type == 3) {
  2903. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  2904. }
  2905. let index = i + 1
  2906. let obj = {
  2907. id: 0,
  2908. name: '处方' + index,
  2909. advices: tempAdvice,
  2910. project: tempProject,
  2911. addition: tempAddition,
  2912. order_status: 1,
  2913. pre_time: preTime,
  2914. med_type: ''
  2915. }
  2916. if (prescription.med_type == 0 || prescription.med_type == '') {
  2917. obj.med_type = ''
  2918. } else {
  2919. obj.med_type = parseInt(prescription.med_type)
  2920. }
  2921. if (obj.med_type == 0 || obj.med_type == '') {
  2922. obj.med_type = 14
  2923. }
  2924. this.prescriptions.push(obj)
  2925. }
  2926. } else {
  2927. let obj = {
  2928. id: 0,
  2929. name: '处方' + 1,
  2930. advices: [],
  2931. project: [],
  2932. addition: [],
  2933. order_status: 0,
  2934. pre_time: nowTime,
  2935. med_type: ''
  2936. }
  2937. obj.med_type = 14
  2938. this.prescriptions.push(obj)
  2939. }
  2940. }
  2941. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  2942. }
  2943. })
  2944. } else {
  2945. getMonthHisPateintInfo(params).then(response => {
  2946. if (response.data.state == 0) {
  2947. this.$message.error(response.data.msg)
  2948. return false
  2949. } else {
  2950. for (let i = 0; i < this.all_data.length; i++) {
  2951. if (this.all_data[i].id == val.id) {
  2952. this.oldCurrentRow = this.all_data[i]
  2953. }
  2954. }
  2955. this.patientInfo = response.data.data.xt_info
  2956. this.hisPatientInfo = response.data.data.his_info
  2957. this.case_history = response.data.data.case_history
  2958. var month_prescriptions = response.data.data.month_prescriptions
  2959. this.settle_total = response.data.data.settle_total
  2960. console.log(this.settle_total)
  2961. this.setMonthPrescription(month_prescriptions)
  2962. this.doctors = response.data.data.doctors
  2963. this.department = response.data.data.department
  2964. this.schedule = response.data.data.schedule
  2965. for (let i = 0; i < this.doctors.length; i++) {
  2966. if (this.doctors[i].user_type == 1) {
  2967. this.doctors.splice(i, 1)
  2968. }
  2969. }
  2970. this.case_history = response.data.data.case_history
  2971. this.info = response.data.data.info
  2972. this.last_info = response.data.data.last_info
  2973. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2974. if (this.case_history.breathing <= 0) {
  2975. this.case_history.breathing = ''
  2976. }
  2977. if (this.case_history.sick <= 0) {
  2978. this.case_history.sick = ''
  2979. }
  2980. if (this.case_history.diagnose <= 0) {
  2981. this.case_history.diagnose = ''
  2982. }
  2983. if (this.case_history.temperature <= 0) {
  2984. this.case_history.temperature = ''
  2985. }
  2986. if (this.case_history.blood_sugar <= 0) {
  2987. this.case_history.blood_sugar = ''
  2988. }
  2989. if (this.case_history.pulse <= 0) {
  2990. this.case_history.pulse = ''
  2991. }
  2992. if (this.case_history.sbp <= 0) {
  2993. this.case_history.sbp = ''
  2994. }
  2995. if (this.case_history.dbp <= 0) {
  2996. this.case_history.dbp = ''
  2997. }
  2998. if (this.case_history.height <= 0) {
  2999. this.case_history.height = ''
  3000. }
  3001. if (this.case_history.blood_fat <= 0) {
  3002. this.case_history.blood_fat = ''
  3003. }
  3004. if (this.case_history.sick_type <= 0) {
  3005. this.case_history.sick_type = ''
  3006. }
  3007. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3008. this.case_history.primary_disease = this.case_history.primary_disease
  3009. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  3010. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  3011. this.case_history.physical_examination = this.case_history.physical_examination
  3012. this.case_history.special_inspection = this.case_history.special_inspection
  3013. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  3014. if (this.case_history.is_infect == 1) {
  3015. this.case_history.is_infect = true
  3016. } else {
  3017. this.case_history.is_infect = false
  3018. }
  3019. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info,this.settle_total)
  3020. }
  3021. })
  3022. }
  3023. } else {
  3024. this.patientid = val.id
  3025. let params = {
  3026. 'record_date': this.record_date,
  3027. 'patient_id': val.id,
  3028. 'his_patient_id': val.his_patient_id,
  3029. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  3030. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  3031. 'p_type': 1
  3032. }
  3033. if (this.current_tab == 'day') {
  3034. getPatientInfo(params).then(response => {
  3035. if (response.data.state == 0) {
  3036. this.$message.error(response.data.msg)
  3037. return false
  3038. } else {
  3039. if (response.data.data.sch_prescriptions == null) {
  3040. response.data.data.sch_prescriptions = []
  3041. }
  3042. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3043. if (response.data.data.sch_prescriptions[i].advices == null) {
  3044. response.data.data.sch_prescriptions[i].advices = []
  3045. }
  3046. if (response.data.data.sch_prescriptions[i].project == null) {
  3047. response.data.data.sch_prescriptions[i].project = []
  3048. }
  3049. }
  3050. this.prescriptions = []
  3051. this.month_prescriptions = []
  3052. this.patientInfo = response.data.data.xt_info
  3053. this.hisPatientInfo = response.data.data.his_info
  3054. this.case_history = response.data.data.case_history
  3055. this.info = response.data.data.info
  3056. this.last_info = response.data.data.last_info
  3057. this.schedule = response.data.data.schedule
  3058. this.doctors = response.data.data.doctors
  3059. this.department = response.data.data.department
  3060. for (let i = 0; i < this.doctors.length; i++) {
  3061. if (this.doctors[i].user_type == 1) {
  3062. this.doctors.splice(i, 1)
  3063. }
  3064. }
  3065. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3066. if (this.case_history.breathing <= 0) {
  3067. this.case_history.breathing = ''
  3068. }
  3069. if (this.case_history.sick <= 0) {
  3070. this.case_history.sick = ''
  3071. }
  3072. if (this.case_history.diagnose <= 0) {
  3073. this.case_history.diagnose = ''
  3074. }
  3075. if (this.case_history.temperature <= 0) {
  3076. this.case_history.temperature = ''
  3077. }
  3078. if (this.case_history.blood_sugar <= 0) {
  3079. this.case_history.blood_sugar = ''
  3080. }
  3081. if (this.case_history.pulse <= 0) {
  3082. this.case_history.pulse = ''
  3083. }
  3084. if (this.case_history.sbp <= 0) {
  3085. this.case_history.sbp = ''
  3086. }
  3087. if (this.case_history.dbp <= 0) {
  3088. this.case_history.dbp = ''
  3089. }
  3090. if (this.case_history.height <= 0) {
  3091. this.case_history.height = ''
  3092. }
  3093. if (this.case_history.blood_fat <= 0) {
  3094. this.case_history.blood_fat = ''
  3095. }
  3096. if (this.case_history.sick_type <= 0) {
  3097. this.case_history.sick_type = ''
  3098. }
  3099. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3100. if (this.case_history.is_infect == 1) {
  3101. this.case_history.is_infect = true
  3102. } else {
  3103. this.case_history.is_infect = false
  3104. }
  3105. this.prescriptionList = response.data.data.prescription
  3106. this.case_history.primary_disease = this.case_history.primary_disease
  3107. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  3108. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  3109. this.case_history.physical_examination = this.case_history.physical_examination
  3110. this.case_history.special_inspection = this.case_history.special_inspection
  3111. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  3112. if (response.data.data.prescription.length > 0) {
  3113. for (let i = 0; i < response.data.data.prescription.length; i++) {
  3114. var prescription = response.data.data.prescription[i]
  3115. let tempAdvice = []
  3116. let tempProject = []
  3117. let tempAddition = []
  3118. //药品
  3119. for (let b = 0; b < prescription.advices.length; b++) {
  3120. let obj = {
  3121. advice_id: prescription.advices[b].id,
  3122. drug_name: prescription.advices[b].advice_name,
  3123. single_dose: prescription.advices[b].single_dose,
  3124. delivery_way: prescription.advices[b].delivery_way,
  3125. execution_frequency: prescription.advices[b].execution_frequency,
  3126. retail_price: prescription.advices[b].price.toString(),
  3127. remark: prescription.advices[b].remark,
  3128. day: prescription.advices[b].day,
  3129. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3130. single_dose_unit: prescription.advices[b].single_dose_unit,
  3131. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3132. medical_insurance_number: prescription.advices[b].med_list_codg,
  3133. id: prescription.advices[b].drug_id,
  3134. drug: prescription.advices[b].drug,
  3135. groupno: prescription.advices[b].groupno,
  3136. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  3137. }
  3138. tempAdvice.push(obj)
  3139. }
  3140. //项目
  3141. for (let b = 0; b < prescription.project.length; b++) {
  3142. let obj = {
  3143. id: prescription.project[b].id,
  3144. project_id: prescription.project[b].project_id,
  3145. project_name: prescription.project[b].project.project_name,
  3146. single_dose: prescription.project[b].single_dose,
  3147. delivery_way: prescription.project[b].delivery_way,
  3148. execution_frequency: prescription.project[b].execution_frequency,
  3149. number_days: prescription.project[b].day,
  3150. total: prescription.project[b].count.toString(),
  3151. price: prescription.project[b].price,
  3152. remark: prescription.project[b].remark,
  3153. medical_code: prescription.project[b].project.medical_code,
  3154. unit: prescription.project[b].project.unit,
  3155. type: prescription.project[b].type
  3156. }
  3157. if (prescription.project[b].type == 2) {
  3158. obj['statistical_classification'] = prescription.project[b].team.project_team
  3159. obj['medical_code'] = prescription.project[b].project.medical_code
  3160. obj['project_name'] = prescription.project[b].project.project_name
  3161. obj['project'] = prescription.project[b].project
  3162. } else if (prescription.project[b].type == 3) {
  3163. if(prescription.project[b].team_id > 0){
  3164. obj['statistical_classification'] = prescription.project[b].team.project_team
  3165. }
  3166. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3167. obj['project_name'] = prescription.project[b].good_info.good_name
  3168. obj['good_info'] = prescription.project[b].good_info
  3169. }
  3170. tempProject.push(obj)
  3171. }
  3172. //附加收费
  3173. // for (let b = 0; b < prescription.addition.length; b++) {
  3174. // let obj = {
  3175. // id: prescription.addition[b].id,
  3176. // item_name: prescription.addition[b].item_name,
  3177. // price: prescription.addition[b].price,
  3178. // count: prescription.addition[b].count,
  3179. // item_id: prescription.addition[b].item_id
  3180. // }
  3181. // tempAddition.push(obj)
  3182. // }
  3183. var preTime = ''
  3184. if (prescription.pre_time == 0) {
  3185. // preTime = nowTime
  3186. if (this.schedule.schedule_type == 1) {
  3187. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3188. } else if (this.schedule.schedule_type == 2) {
  3189. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3190. } else if (this.schedule.schedule_type == 3) {
  3191. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3192. }
  3193. } else {
  3194. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  3195. }
  3196. let index = i + 1
  3197. let obj = {
  3198. id: prescription.id,
  3199. name: '处方' + index,
  3200. advices: tempAdvice,
  3201. project: tempProject,
  3202. addition: tempAddition,
  3203. order_status: prescription.order_status,
  3204. pre_time: preTime,
  3205. med_type: parseInt(prescription.med_type)
  3206. }
  3207. this.prescriptions.push(obj)
  3208. }
  3209. } else {
  3210. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  3211. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3212. var prescription = response.data.data.sch_prescriptions[i]
  3213. let tempAdvice = []
  3214. let tempProject = []
  3215. let tempAddition = []
  3216. //药品
  3217. for (let b = 0; b < prescription.advices.length; b++) {
  3218. let index = b + 1
  3219. let obj = {
  3220. advice_id: 0,
  3221. drug_name: prescription.advices[b].advice_name,
  3222. single_dose: prescription.advices[b].single_dose,
  3223. delivery_way: prescription.advices[b].delivery_way,
  3224. execution_frequency: prescription.advices[b].execution_frequency,
  3225. // retail_price: prescription.advices[b].price.toString(),
  3226. remark: prescription.advices[b].remark,
  3227. day: prescription.advices[b].day,
  3228. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3229. single_dose_unit: prescription.advices[b].single_dose_unit,
  3230. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3231. medical_insurance_number: prescription.advices[b].med_list_codg,
  3232. id: prescription.advices[b].drug_id,
  3233. drug: prescription.advices[b].drug,
  3234. groupno: prescription.advices[b].groupno,
  3235. hosp_appr_flag: '1'
  3236. }
  3237. console.log('看看数据5:')
  3238. console.log(obj.prescribing_number_unit)
  3239. console.log(prescription.advices[b].drug.min_unit)
  3240. console.log(prescription.advices[b].drug.max_unit)
  3241. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  3242. obj['retail_price'] = prescription.advices[b].drug.min_price
  3243. console.log('1')
  3244. console.log(obj.retail_price)
  3245. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  3246. obj['retail_price'] = prescription.advices[b].drug.retail_price
  3247. console.log('2')
  3248. console.log(obj.retail_price)
  3249. } else {
  3250. console.log('3')
  3251. obj['retail_price'] = prescription.advices[b].drug.min_price
  3252. console.log(obj.retail_price)
  3253. }
  3254. tempAdvice.push(obj)
  3255. }
  3256. //项目
  3257. for (let b = 0; b < prescription.project.length; b++) {
  3258. let obj = {
  3259. id: 0,
  3260. project_id: prescription.project[b].project_id,
  3261. project_name: prescription.project[b].project.project_name,
  3262. single_dose: prescription.project[b].single_dose,
  3263. delivery_way: prescription.project[b].delivery_way,
  3264. execution_frequency: prescription.project[b].execution_frequency,
  3265. number_days: prescription.project[b].day,
  3266. total: prescription.project[b].count.toString(),
  3267. remark: prescription.project[b].remark,
  3268. medical_code: prescription.project[b].project.medical_code,
  3269. unit: prescription.project[b].project.unit,
  3270. type: prescription.project[b].type
  3271. }
  3272. if (prescription.project[b].type == 2) {
  3273. obj['statistical_classification'] = ""
  3274. obj['medical_code'] = prescription.project[b].project.medical_code
  3275. obj['project_name'] = prescription.project[b].project.project_name
  3276. obj['price'] = prescription.project[b].project.price
  3277. obj['project'] = prescription.project[b].project
  3278. } else if (prescription.project[b].type == 3) {
  3279. obj['statistical_classification'] = ''
  3280. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3281. obj['project_name'] = prescription.project[b].good_info.good_name
  3282. obj['price'] = prescription.project[b].good_info.packing_price
  3283. obj['good_info'] = prescription.project[b].good_info
  3284. }
  3285. tempProject.push(obj)
  3286. }
  3287. // var preTime = nowTime
  3288. var preTime = ''
  3289. if (this.schedule.schedule_type == 1) {
  3290. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3291. } else if (this.schedule.schedule_type == 2) {
  3292. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3293. } else if (this.schedule.schedule_type == 3) {
  3294. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3295. }
  3296. let index = i + 1
  3297. let obj = {
  3298. id: 0,
  3299. name: '处方' + index,
  3300. advices: tempAdvice,
  3301. project: tempProject,
  3302. addition: tempAddition,
  3303. order_status: 1,
  3304. pre_time: preTime,
  3305. med_type: ''
  3306. }
  3307. if (prescription.med_type == 0 || prescription.med_type == '') {
  3308. obj.med_type = ''
  3309. } else {
  3310. obj.med_type = parseInt(prescription.med_type)
  3311. }
  3312. if (obj.med_type == 0 || obj.med_type == '') {
  3313. obj.med_type = 14
  3314. }
  3315. this.prescriptions.push(obj)
  3316. }
  3317. } else {
  3318. let obj = {
  3319. id: 0,
  3320. name: '处方' + 1,
  3321. advices: [],
  3322. project: [],
  3323. addition: [],
  3324. order_status: 0,
  3325. pre_time: nowTime,
  3326. med_type: ''
  3327. }
  3328. obj.med_type = 14
  3329. this.prescriptions.push(obj)
  3330. }
  3331. }
  3332. this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info, this.sick, this.diagnosis)
  3333. }
  3334. })
  3335. } else {
  3336. getMonthHisPateintInfo(params).then(response => {
  3337. if (response.data.state == 0) {
  3338. this.$message.error(response.data.msg)
  3339. return false
  3340. } else {
  3341. this.prescriptions = []
  3342. this.month_prescriptions = []
  3343. this.settle_total = response.data.data.settle_total
  3344. var month_prescriptions = response.data.data.month_prescriptions
  3345. this.setMonthPrescription(month_prescriptions)
  3346. this.patientInfo = response.data.data.xt_info
  3347. this.hisPatientInfo = response.data.data.his_info
  3348. this.case_history = response.data.data.case_history
  3349. this.info = response.data.data.info
  3350. this.last_info = response.data.data.last_info
  3351. this.schedule = response.data.data.schedule
  3352. this.doctors = response.data.data.doctors
  3353. this.department = response.data.data.department
  3354. for (let i = 0; i < this.doctors.length; i++) {
  3355. if (this.doctors[i].user_type == 1) {
  3356. this.doctors.splice(i, 1)
  3357. }
  3358. }
  3359. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3360. if (this.case_history.breathing <= 0) {
  3361. this.case_history.breathing = ''
  3362. }
  3363. if (this.case_history.sick <= 0) {
  3364. this.case_history.sick = ''
  3365. }
  3366. if (this.case_history.diagnose <= 0) {
  3367. this.case_history.diagnose = ''
  3368. }
  3369. if (this.case_history.temperature <= 0) {
  3370. this.case_history.temperature = ''
  3371. }
  3372. if (this.case_history.blood_sugar <= 0) {
  3373. this.case_history.blood_sugar = ''
  3374. }
  3375. if (this.case_history.pulse <= 0) {
  3376. this.case_history.pulse = ''
  3377. }
  3378. if (this.case_history.sbp <= 0) {
  3379. this.case_history.sbp = ''
  3380. }
  3381. if (this.case_history.dbp <= 0) {
  3382. this.case_history.dbp = ''
  3383. }
  3384. if (this.case_history.height <= 0) {
  3385. this.case_history.height = ''
  3386. }
  3387. if (this.case_history.blood_fat <= 0) {
  3388. this.case_history.blood_fat = ''
  3389. }
  3390. if (this.case_history.sick_type <= 0) {
  3391. this.case_history.sick_type = ''
  3392. }
  3393. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3394. this.case_history.primary_disease = this.case_history.primary_disease
  3395. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  3396. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  3397. this.case_history.physical_examination = this.case_history.physical_examination
  3398. this.case_history.special_inspection = this.case_history.special_inspection
  3399. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  3400. if (this.case_history.is_infect == 1) {
  3401. this.case_history.is_infect = true
  3402. } else {
  3403. this.case_history.is_infect = false
  3404. }
  3405. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info,this.settle_total)
  3406. }
  3407. })
  3408. }
  3409. }
  3410. }
  3411. },
  3412. currentChange(currentRow, oldCurrentRow) {
  3413. if (oldCurrentRow) {
  3414. this.newPatientId = oldCurrentRow.id
  3415. this.patientid = oldCurrentRow.id
  3416. }
  3417. let isShowDailog = false
  3418. for (let i = 0; i < this.prescriptions.length; i++) {
  3419. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  3420. isShowDailog = true
  3421. }
  3422. }
  3423. if (!isShowDailog) {
  3424. this.oldCurrentRow = currentRow
  3425. return
  3426. }
  3427. }, open_two() {
  3428. this.$refs.prescriptions.open_two()
  3429. }, open_three() {
  3430. this.$refs.prescriptions.open_three()
  3431. },
  3432. open(index) {
  3433. this.index = index
  3434. if (index == 1) {
  3435. this.$refs.prescriptions.open(1, this.saveLoading)
  3436. } else if (index == 2) {
  3437. this.getPrescriptionList(this.patientInfo.id, this.record_date, 1)
  3438. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3439. } else if (index == 3) {
  3440. this.$refs.prescriptions.open(3)
  3441. } else if (index == 4) {
  3442. this.$refs.prescriptions.open(4)
  3443. } else if (index == 6) {
  3444. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3445. this.getPrescriptionList(this.patientInfo.id, this.record_date, 2)
  3446. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3447. } else if (index == 20) {
  3448. this.getPrescriptionList(this.patientInfo.id, this.record_date, 2, 3)
  3449. }
  3450. },
  3451. // 电子病历打印
  3452. opentwo(index) {
  3453. if (index == 1) {
  3454. if (this.patientInfo.id == undefined) {
  3455. this.$message.error('请先选择病人')
  3456. return
  3457. }
  3458. this.$refs.child.createCaseHistory()
  3459. } else if (index == 2) {
  3460. this.recordVisible = true
  3461. this.$nextTick(() => {
  3462. this.$refs.recordPrint.show(this.patientid,this.org_id)
  3463. })
  3464. // this.$router.push('/outpatientDoctorStation/recordPrint?record='+this.record_date+"&patient_id="+this.patientid)
  3465. } else if (index == 3) {
  3466. var mode_status = this.$refs.saveRecordTemplate.mode_status
  3467. this.$refs.medicalRecord.show(mode_status)
  3468. } else if (index == 4) {
  3469. this.$refs.saveRecordTemplate.show(this.case_history)
  3470. }
  3471. },
  3472. // changePatient(val){
  3473. // console.log("患者val",val)
  3474. // this.hisPatientInfo = val.hisPatientInfo
  3475. // console.log("333333",this.hisPatientInfo)
  3476. // }
  3477. getMsgFormSon(id) {
  3478. this.detalid = id
  3479. },
  3480. changetwo(data) {
  3481. this.prescription_id = data
  3482. },
  3483. getPrescriptionList(id, record_date, type, checkType) {
  3484. getPrescriptionList(id, 1, record_date).then(response => {
  3485. if (response.data.state == 1) {
  3486. if (checkType != 3) {
  3487. this.centerDialogVisible = true
  3488. var list = response.data.data.list
  3489. let arr1 = []
  3490. let arr2 = []
  3491. let arr3 = []
  3492. let arr4 = []
  3493. for (var i = list.length - 1; i >= 0; i--) {
  3494. if (list[i].type == 1) {
  3495. list[i].prescription_number = list[i].prescription_number + i
  3496. arr1.push(list[i])
  3497. }
  3498. if (list[i].type == 2) {
  3499. list[i].prescription_number = list[i].prescription_number + i
  3500. arr2.push(list[i])
  3501. arr3.push(list[i])
  3502. arr4.push(list[i])
  3503. }
  3504. if (list[i].type == 2) {
  3505. let count = 0
  3506. list[i].project.map(item => {
  3507. if (item.type == 2) {
  3508. if (item.project.cost_classify == 3) {
  3509. count++
  3510. }
  3511. }
  3512. })
  3513. if (count == list[i].project.length) {
  3514. arr2.map((items, index) => {
  3515. if (items.id == list[i].id) {
  3516. arr2.splice(index, 1)
  3517. }
  3518. })
  3519. }
  3520. }
  3521. }
  3522. this.tableData1 = arr1
  3523. this.tableData2 = arr2
  3524. this.tableData4 = arr4
  3525. this.tableData3 = [arr3[0]]
  3526. } else {
  3527. var list = response.data.data.list
  3528. let arr = []
  3529. for (let i = 0; i < list.length; i++) {
  3530. if (list[i].type == type) {
  3531. list[i].prescription_number = list[i].prescription_number + i
  3532. arr.push(list[i])
  3533. }
  3534. }
  3535. console.log('arrrrrrrrrr', arr)
  3536. this.selecting_schs = arr
  3537. this.savePrint()
  3538. }
  3539. }
  3540. })
  3541. },
  3542. handleSelectionChange1(val) {
  3543. console.log('val', val)
  3544. this.selecting_schs1 = val
  3545. },
  3546. handleSelectionChange2(val) {
  3547. this.selecting_schs2 = val
  3548. },
  3549. handleSelectionChange3(val) {
  3550. if (val.length == 0) {
  3551. this.selecting_schs3 = []
  3552. } else {
  3553. this.selecting_schs3 = this.tableData4
  3554. }
  3555. },
  3556. handleClick() {
  3557. console.log("hhahdf adf adf ",this.titleType)
  3558. console.log("radio ",this.radio)
  3559. if (this.titleType == '电子处方' || this.titleType == "电子病历") {
  3560. if (this.radio == 1) {
  3561. this.un_cure_data.map(item => {
  3562. if (item.id == this.patientid) {
  3563. this.getPatientInfo(item)
  3564. }
  3565. })
  3566. } else if (this.radio == 2) {
  3567. this.cure_data.map(item => {
  3568. if (item.id == this.patientid) {
  3569. this.getPatientInfo(item)
  3570. }
  3571. })
  3572. } else {
  3573. this.all_data.map(item => {
  3574. if (item.id == this.patientid) {
  3575. this.getPatientInfo(item)
  3576. }
  3577. })
  3578. }
  3579. }
  3580. },
  3581. savePrint() {
  3582. //处方
  3583. var arr1 = []
  3584. if (this.selecting_schs1.length > 0) {
  3585. for (let i = 0; i < this.selecting_schs1.length; i++) {
  3586. arr1.push(this.selecting_schs1[i].id)
  3587. }
  3588. var ids1 = arr1.join(',')
  3589. let obj1 = {
  3590. record: this.record_date,
  3591. prescription_id: this.prescription_id,
  3592. ids: ids1,
  3593. patient_id: this.patientid,
  3594. p_type:1
  3595. }
  3596. this.paramsObj = obj1
  3597. }
  3598. //治疗
  3599. var arr2 = []
  3600. if (this.selecting_schs2.length > 0) {
  3601. for (let i = 0; i < this.selecting_schs2.length; i++) {
  3602. arr2.push(this.selecting_schs2[i].id)
  3603. }
  3604. var ids2 = arr2.join(',')
  3605. let obj2 = {
  3606. record: this.record_date,
  3607. prescription_id: this.prescription_id,
  3608. ids: ids2,
  3609. patient_id: this.patientid,
  3610. p_type:1
  3611. }
  3612. this.paramsObj2 = obj2
  3613. }
  3614. var arr3 = []
  3615. if (this.selecting_schs3.length > 0) {
  3616. for (let i = 0; i < this.selecting_schs3.length; i++) {
  3617. arr3.push(this.selecting_schs3[i].id)
  3618. }
  3619. var ids2 = arr3.join(',')
  3620. let obj3 = {
  3621. record: this.record_date,
  3622. prescription_id: this.prescription_id,
  3623. ids: ids2,
  3624. patient_id: this.patientid,
  3625. p_type:1
  3626. }
  3627. this.paramsObj3 = obj3
  3628. }
  3629. this.innerVisible = true
  3630. // if(this.index == 20){
  3631. // console.log('ids',ids)
  3632. // let obj = {
  3633. // record: this.record_date,
  3634. // prescription_id: this.prescription_id,
  3635. // ids: ids,
  3636. // patient_id: this.patientid
  3637. // };
  3638. // this.paramsObj = obj;
  3639. // this.checkVisible = true
  3640. // }
  3641. }, getTime(val, temp) {
  3642. if (val != 0) {
  3643. return uParseTime(val, temp)
  3644. } else {
  3645. return ''
  3646. }
  3647. }, getGoodUnit(id) {
  3648. var goodUnit = this.$store.getters.good_unit
  3649. for (let i = 0; i < goodUnit.length; i++) {
  3650. if (goodUnit[i].id == id) {
  3651. return goodUnit[i].name
  3652. }
  3653. }
  3654. }, changeDay() {
  3655. this.current_tab = 'day'
  3656. this.getPatientInfo(this.current_data)
  3657. }, changeMonth(val) {
  3658. this.current_tab = 'month'
  3659. var nowDate = new Date()
  3660. var nowYear = nowDate.getFullYear()
  3661. var nowMonth = nowDate.getMonth() + 1
  3662. var nowDay = nowDate.getDate()
  3663. var hours = nowDate.getHours()
  3664. var min = nowDate.getMinutes()
  3665. var nowTime =
  3666. nowYear +
  3667. '-' +
  3668. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  3669. '-' +
  3670. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  3671. ':' + (min < 10 ? '0' + min : min)
  3672. let params = {
  3673. 'record_date': this.record_date,
  3674. 'patient_id': val.id,
  3675. 'his_patient_id': val.his_patient_id,
  3676. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  3677. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  3678. 'p_type': 1
  3679. }
  3680. this.isloading = true
  3681. getMonthHisPateintInfo(params).then(response => {
  3682. if (response.data.state == 0) {
  3683. this.$message.error(response.data.msg)
  3684. this.isloading = false
  3685. return false
  3686. } else {
  3687. this.patientid = val.id
  3688. this.isloading = false
  3689. this.prescriptions = []
  3690. this.month_prescriptions = []
  3691. this.patientInfo = response.data.data.xt_info
  3692. this.hisPatientInfo = response.data.data.his_info
  3693. this.case_history = response.data.data.case_history
  3694. this.info = response.data.data.info
  3695. this.last_info = response.data.data.last_info
  3696. this.schedule = response.data.data.schedule
  3697. this.doctors = response.data.data.doctors
  3698. this.department = response.data.data.department
  3699. this.settle_total = response.data.data.settle_total
  3700. for (let i = 0; i < this.doctors.length; i++) {
  3701. if (this.doctors[i].user_type == 1) {
  3702. this.doctors.splice(i, 1)
  3703. }
  3704. }
  3705. var month_prescriptions = response.data.data.month_prescriptions
  3706. this.setMonthPrescription(month_prescriptions)
  3707. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3708. if (this.case_history.temperature <= 0) {
  3709. this.case_history.temperature = ''
  3710. }
  3711. if (this.case_history.blood_sugar <= 0) {
  3712. this.case_history.blood_sugar = ''
  3713. }
  3714. if (this.case_history.pulse <= 0) {
  3715. this.case_history.pulse = ''
  3716. }
  3717. if (this.case_history.sbp <= 0) {
  3718. this.case_history.sbp = ''
  3719. }
  3720. if (this.case_history.dbp <= 0) {
  3721. this.case_history.dbp = ''
  3722. }
  3723. if (this.case_history.height <= 0) {
  3724. this.case_history.height = ''
  3725. }
  3726. if (this.case_history.blood_fat <= 0) {
  3727. this.case_history.blood_fat = ''
  3728. }
  3729. if (this.case_history.sick_type <= 0) {
  3730. this.case_history.sick_type = ''
  3731. }
  3732. if (this.case_history.sick <= 0) {
  3733. this.case_history.sick = ''
  3734. }
  3735. if (this.case_history.diagnose <= 0) {
  3736. this.case_history.diagnose = ''
  3737. }
  3738. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3739. this.case_history.primary_disease = this.case_history.primary_disease
  3740. this.case_history.confirm_failure_date = uParseTime(this.case_history.confirm_failure_date, '{y}-{m}-{d}')
  3741. this.case_history.drug_allergy_history = this.case_history.drug_allergy_history
  3742. this.case_history.physical_examination = this.case_history.physical_examination
  3743. this.case_history.special_inspection = this.case_history.special_inspection
  3744. this.case_history.lab_apparatus = this.case_history.lab_apparatus
  3745. if (this.case_history.is_infect == 1) {
  3746. this.case_history.is_infect = true
  3747. } else {
  3748. this.case_history.is_infect = false
  3749. }
  3750. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info,this.settle_total)
  3751. }
  3752. })
  3753. }
  3754. },
  3755. created() {
  3756. this.getInitData()
  3757. var nowDate = new Date()
  3758. var nowYear = nowDate.getFullYear()
  3759. var nowMonth = nowDate.getMonth() + 1
  3760. var nowDay = nowDate.getDate()
  3761. this.record_date =
  3762. nowYear +
  3763. '-' +
  3764. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  3765. '-' +
  3766. (nowDay < 10 ? '0' + nowDay : nowDay)
  3767. this.getList()
  3768. // this.diagnoses = this.getDictionaryDataConfig('system', 'diagnose')
  3769. // this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
  3770. let tableHeight = document.body.clientHeight - 323
  3771. this.tableHeight = tableHeight
  3772. this.org_id = this.$store.getters.xt_user.template_info.org_id
  3773. },
  3774. mounted() {
  3775. const that = this
  3776. window.onresize = () => {
  3777. return (() => {
  3778. window.fullHeight = document.documentElement.clientHeight
  3779. that.fullHeight = window.fullHeight
  3780. })()
  3781. }
  3782. },
  3783. watch: {
  3784. fullHeight(val) {
  3785. if (!this.timer) {
  3786. this.fullHeight = val
  3787. let tableHeight = val - 323
  3788. this.tableHeight = tableHeight
  3789. this.timer = true
  3790. let that = this
  3791. setTimeout(function() {
  3792. that.timer = false
  3793. }, 400)
  3794. }
  3795. }
  3796. }
  3797. }
  3798. </script>
  3799. <style lang="scss" scoped>
  3800. .new-main-contain {
  3801. height: 100%;
  3802. display: flex;
  3803. flex-direction: column;
  3804. }
  3805. .app-container {
  3806. height: 100%;
  3807. }
  3808. .mainCell {
  3809. height: 36px;
  3810. display: flex;
  3811. align-items: center;
  3812. }
  3813. .mainLeft {
  3814. width: 200px;
  3815. height: 100%;
  3816. display: flex;
  3817. flex-direction: column;
  3818. .el-radio {
  3819. margin-right: 5px;
  3820. }
  3821. }
  3822. .mainRight {
  3823. margin-left: 10px;
  3824. flex: 1;
  3825. height: 100%;
  3826. display: flex;
  3827. flex-direction: column;
  3828. overflow-y: auto;
  3829. .cellSpan {
  3830. min-width: 80px;
  3831. display: inline-block;
  3832. margin-right: 10px;
  3833. }
  3834. }
  3835. .mainCenter {
  3836. display: flex;
  3837. flex: 1;
  3838. }
  3839. .centerLeft {
  3840. flex: 1;
  3841. display: flex;
  3842. flex-direction: column;
  3843. position: relative;
  3844. .el-form-item {
  3845. width: 32%;
  3846. margin-right: 1%;
  3847. float: left;
  3848. }
  3849. .el-form-item__label {
  3850. text-align: left;
  3851. }
  3852. }
  3853. .backColor {
  3854. background: #f6f8f9;
  3855. height: 5px;
  3856. margin-bottom: 5px;
  3857. }
  3858. .tabsBox {
  3859. position: relative;
  3860. height: 76%;
  3861. overflow-y: auto;
  3862. margin-bottom: 60px;
  3863. .el-tabs__item {
  3864. padding: 0 10px;
  3865. }
  3866. }
  3867. .preTabs {
  3868. height: 100%;
  3869. display: flex;
  3870. flex-direction: column;
  3871. .el-tabs__content {
  3872. flex: 1;
  3873. overflow-y: auto;
  3874. }
  3875. }
  3876. .costBox {
  3877. width: 100%;
  3878. height: 60px;
  3879. background: #fff;
  3880. position: absolute;
  3881. bottom: 0;
  3882. display: flex;
  3883. align-items: center;
  3884. }
  3885. .addTab {
  3886. position: absolute;
  3887. right: 0;
  3888. top: 14px;
  3889. z-index: 20;
  3890. }
  3891. .centerRight {
  3892. width: 300px;
  3893. margin-left: 10px;
  3894. display: flex;
  3895. flex-direction: column;
  3896. position: relative;
  3897. }
  3898. .rightTab {
  3899. height: 40px;
  3900. width: 100%;
  3901. border: 1px solid #d2d2d2;
  3902. box-sizing: border-box;
  3903. p {
  3904. width: 50%;
  3905. height: 40px;
  3906. line-height: 40px;
  3907. text-align: center;
  3908. background: #eee;
  3909. float: left;
  3910. }
  3911. > p:last-child {
  3912. border-left: 1px solid #d2d2d2;
  3913. float: right;
  3914. }
  3915. .activeP {
  3916. background: #409EFF;
  3917. color: #fff;
  3918. }
  3919. }
  3920. .comfirmBox {
  3921. width: 100%;
  3922. height: 60px;
  3923. background: #fff;
  3924. position: absolute;
  3925. bottom: 0;
  3926. display: flex;
  3927. align-items: center;
  3928. justify-content: space-between;
  3929. }
  3930. .mainHeader {
  3931. width: 100%;
  3932. background: #fff;
  3933. position: fixed;
  3934. z-index: 100;
  3935. height: 36px;
  3936. }
  3937. .titleBox {
  3938. position: fixed;
  3939. z-index: 99;
  3940. background: #fff;
  3941. }
  3942. .fixedCell {
  3943. position: fixed;
  3944. z-index: 99;
  3945. right: 30px;
  3946. background: #fff;
  3947. width: 300px;
  3948. display: flex;
  3949. justify-content: space-between;
  3950. }
  3951. </style>
  3952. <style lang="scss">
  3953. .centerLeft {
  3954. .el-form-item__label {
  3955. text-align: left;
  3956. }
  3957. }
  3958. .tabsBox {
  3959. .el-tabs__item {
  3960. padding: 0 10px;
  3961. }
  3962. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
  3963. padding: 0 10px;
  3964. }
  3965. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
  3966. padding: 0 10px;
  3967. }
  3968. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  3969. padding: 0 10px;
  3970. }
  3971. }
  3972. .centerRight {
  3973. .el-tabs__nav-scroll {
  3974. display: flex;
  3975. }
  3976. .el-tabs__nav {
  3977. margin: 0 auto;
  3978. }
  3979. .el-table th .cell, .el-table td .cell {
  3980. padding: 0 2px;
  3981. }
  3982. }
  3983. .preTabs {
  3984. .el-tabs__content {
  3985. }
  3986. }
  3987. .rightTabs {
  3988. height: 100%;
  3989. .el-tabs__content {
  3990. }
  3991. }
  3992. .centerDialog {
  3993. .el-dialog__body {
  3994. max-height: calc(100vh - 100px) !important;
  3995. padding: 0 20px;
  3996. }
  3997. }
  3998. </style>