Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

doctorDesk.vue 199KB

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