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

doctorDesk.vue 182KB

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