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

doctorDesk.vue 203KB

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