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

doctorDesk.vue 215KB

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