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

outpatientChargesManagement.vue 219KB

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