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

outpatientChargesManagement.vue 124KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467
  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. placeholder="选择开始时间"
  16. align="right"
  17. format="yyyy-MM-dd"
  18. value-format="yyyy-MM-dd">
  19. </el-date-picker>
  20. <!-- <div class="mainCell" style="justify-content: space-between;font-size:14px;">
  21. <p >未收费:<span style="color: red">{{cal_one}}</span>人</p>
  22. <p>已收费:<span style="color: red">{{cal_two}}</span>人</p>
  23. <p>已退费:<span style="color: red">{{cal_three}}</span>人</p>
  24. </div> -->
  25. <div class="mainCell">
  26. <el-radio-group v-model="radio" @change="changeRadio">
  27. <!-- <el-radio :label=1>未收费</el-radio>
  28. <el-radio :label=2>已收费</el-radio>
  29. <el-radio :label=3>已退费</el-radio>
  30. <el-radio :label=4>全部</el-radio> -->
  31. <el-radio :label=1>未收费<span
  32. style="color: red;margin-bottom:10px;display: inline-block;">{{ cal_one }}</span>人
  33. </el-radio>
  34. <el-radio :label=2>已收费<span
  35. style="color: red;margin-bottom:10px;display: inline-block;">{{ cal_two }}</span>人
  36. </el-radio>
  37. <!--<el-radio :label=3>已退费<span-->
  38. <!--style="color: red;margin-bottom:10px;display: inline-block;">{{cal_three}}</span>人-->
  39. <!--</el-radio>-->
  40. <!--<el-radio :label=4>全部</el-radio>-->
  41. </el-radio-group>
  42. </div>
  43. <div class="mainCell" style="margin-bottom:10px;">
  44. <el-input size="small" v-model.trim="search_input"
  45. class="filter-item"/>
  46. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  47. @click="searchAction">
  48. 搜索
  49. </el-button>
  50. </div>
  51. <div>
  52. <el-table v-if="radio == 1" :data="patientTableData" :height="tableHeight" border
  53. style="width: 100%;"
  54. :row-style="{ color: '#303133' }"
  55. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  56. highlight-current-row ref="tab"
  57. @current-change="handleCurrentChange">
  58. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  59. <template slot-scope="scope">{{ scope.$index + 1 }}.{{ scope.row.name }}</template>
  60. </el-table-column>
  61. <el-table-column align="center" prop="name" label="就诊号" width="110">
  62. <template slot-scope="scope">{{ scope.row ? scope.row.number : '' }}
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <el-table v-if="radio == 2" :data="chargePatientTableData" :height="tableHeight" border
  67. style="width: 100%;"
  68. :row-style="{ color: '#303133' }"
  69. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  70. highlight-current-row ref="tab"
  71. @current-change="handleCurrentChange">
  72. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  73. <template slot-scope="scope">{{ scope.row.name }}</template>
  74. </el-table-column>
  75. <el-table-column align="center" prop="name" label="就诊号" width="110">
  76. <template slot-scope="scope">{{ scope.row.his_number }}
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. </div>
  81. </div>
  82. <div class="mainRight">
  83. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  84. <div>
  85. <div>入院时间:{{this.hisPatientInfo&&this.hisPatientInfo.in_hosptial_time?this.hisPatientInfo.in_hosptial_time:""}}</div>
  86. <el-button
  87. size="small"
  88. @click="exportUnchargeData"
  89. type="primary">导出未收费数据</el-button>
  90. <!-- -->
  91. <!-- <el-button size="small"-->
  92. <!-- @click="open(1)"-->
  93. <!-- type="primary">入院登记-->
  94. <!-- </el-button>-->
  95. <el-button v-loading="loadingone" size="small"
  96. v-if="(this.activeName == 'third' &&this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0)"
  97. @click="open(2)"
  98. type="primary">出院
  99. </el-button>
  100. <el-button v-loading="loadingone" size="small"
  101. v-if="(this.activeName == 'third' &&this.hisPatientInfo.balance_accounts_type == 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0)"
  102. @click="open(2)"
  103. type="primary">出院
  104. </el-button>
  105. <el-button
  106. size="small"
  107. @click="open(40)"
  108. type="primary">预结算
  109. </el-button>
  110. <el-button v-loading="loadingtwo"
  111. v-if="(this.radio == 1 && this.activeName == 'third' &&this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 1) || (this.activeName != 'first' &&this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 1 && this.order.order_status == 1) || (this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 1 && this.order.order_status == 3)"
  112. size="small"
  113. @click="open(3)"
  114. type="primary">收费
  115. </el-button>
  116. <el-button v-loading="loadingtwo"
  117. v-if="(this.radio == 1 &&this.activeName == 'third' &&this.hisPatientInfo.balance_accounts_type == 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 1 && this.order.order_status != 2)"
  118. size="small"
  119. @click="open(3)"
  120. type="primary">收费<!--修改的地方-->
  121. </el-button>
  122. <!-- <el-button v-loading="loadingtwo"-->
  123. <!-- size="small"-->
  124. <!-- @click="open(3)"-->
  125. <!-- type="primary">收费-->
  126. <!-- </el-button>-->
  127. <el-button size="small" @click="open(4)" type="primary"
  128. v-if="this.activeName == 'third' &&this.hisPatientInfo.id > 0 && this.order.id > 0 && this.order.order_status == 2">
  129. 退费
  130. </el-button>
  131. <el-button v-if="this.activeName == 'third' &&this.order.order_status == 2" size="small" @click="open(5)"
  132. type="primary"
  133. >结算单
  134. </el-button>
  135. <el-button
  136. v-if="(this.activeName == 'third' &&this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 1)"
  137. size="small" @click="open(6)" type="primary"
  138. >撤销出院
  139. </el-button>
  140. <el-button
  141. v-if="(this.activeName == 'third' &&this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0)"
  142. size="small" @click="open(7)" type="primary"
  143. >撤销入院
  144. </el-button>
  145. </div>
  146. </div>
  147. <div class="mainCenter">
  148. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  149. <el-tab-pane label="结算" name="third">
  150. <div style="display:flex;height:100%;">
  151. <div class="centerLeft">
  152. <div class="tabsBox">
  153. <el-tabs class="preTabs" v-model="editSettletableTabsValue" type="border-card"
  154. @tab-click="tabclickEventThree">
  155. <el-tab-pane
  156. v-for="(item, index) in settle_prescriptions"
  157. :key="index"
  158. :label="item.name"
  159. :name="item.name">
  160. </el-tab-pane>
  161. <settle-prescription-table
  162. :patientName="hisPatientInfo.name"
  163. :number="hisPatientInfo.number"
  164. :prescription="curSettlePrescriptions"
  165. ></settle-prescription-table>
  166. </el-tabs>
  167. </div>
  168. <div class="costBox">
  169. <span>当前处方总费用:<span style="color:red;">{{ settle_total }}元</span></span>
  170. <span>医疗费总额:<span style="color:red;">{{
  171. order.medfee_sumamt ? order.medfee_sumamt.toFixed(2) : settle_total ? settle_total : ''
  172. }}元</span></span>
  173. <span>基金支付总额:<span
  174. style="color:red;">{{
  175. order.fund_pay_sumamt ? order.fund_pay_sumamt.toFixed(2) : ''
  176. }}元</span></span>
  177. <span>基本医疗保险统筹基金支出:<span
  178. style="color:red;">{{
  179. order.hifp_pay ? order.hifp_pay.toFixed(2) : ''
  180. }}元</span></span>
  181. <span>医疗救助基金支出:<span
  182. style="color:red;">{{
  183. order.maf_pay ? order.maf_pay.toFixed(2) : ''
  184. }}元</span></span>
  185. <span>个人账户支付金额:<span
  186. style="color:red;">{{
  187. order.acct_pay ? order.acct_pay.toFixed(2) : ''
  188. }}元</span></span>
  189. <span v-if="hisPatientInfo.balance_accounts_type != 2">个人支付金额:<span
  190. style="color:red;">{{
  191. order.psn_cash_pay ? order.psn_cash_pay.toFixed(2) : ''
  192. }}元</span></span>
  193. <span v-if="hisPatientInfo.balance_accounts_type == 2">个人支付金额:<span
  194. style="color:red;">{{
  195. order.medfee_sumamt.toFixed(2)
  196. }}元</span></span>
  197. <span>个人账户金额:<span
  198. style="color:red;">{{
  199. order.balc ? order.balc.toFixed(2) : ''
  200. }}元</span></span>
  201. </div>
  202. </div>
  203. </div>
  204. </el-tab-pane>
  205. </el-tabs>
  206. </div>
  207. </div>
  208. </div>
  209. <additionalCharges ref='additionalCharges' @click="addCharges"
  210. :addtions_charge="addtions_charge"></additionalCharges>
  211. <charge-dialog ref='charge' v-on:confirm="chargeConfirm" v-on:cancel="chargeCancel"></charge-dialog>
  212. <hospital-register-dialog ref='hrd' v-on:confirm="hospitalRegisterConfirm" v-on:cancel="hospitalRegisterCancel"></hospital-register-dialog>
  213. <el-dialog
  214. class="centerDialog"
  215. width="900px"
  216. title="打印"
  217. :visible.sync="treatVisible">
  218. <treatPrint :paramsObj='paramsObj'></treatPrint>
  219. </el-dialog>
  220. <el-dialog
  221. class="centerDialog"
  222. width="1200px"
  223. title="打印"
  224. :visible.sync="statementVisible">
  225. <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
  226. </el-dialog>
  227. <el-dialog
  228. class="centerDialog"
  229. width="1200px"
  230. title="打印"
  231. :visible.sync="newStatementVisible">
  232. <new-statement-print-two :params-obj="newOrderObj"></new-statement-print-two>
  233. <!--<newStatementPrint ref="print" :paramsObj='newOrderObj'></newStatementPrint>-->
  234. </el-dialog>
  235. <el-dialog
  236. class="centerDialog"
  237. width="1200px"
  238. title="打印"
  239. :visible.sync="invoiceVisible">
  240. <invoice-print ref="print" :invoiceParams='invoiceParams'></invoice-print>
  241. </el-dialog>
  242. <el-dialog
  243. title="出院时间"
  244. :visible.sync="dialogVisible"
  245. width="30%"
  246. >
  247. <el-date-picker v-model="out_hospital_time" type="datetime" format="yyyy-MM-dd HH:mm:ss"
  248. value-format="yyyy-MM-dd HH:mm:ss"
  249. placeholder="请选择出院时间">
  250. </el-date-picker>
  251. <span slot="footer" class="dialog-footer">
  252. <el-button @click="dialogVisible = false">取 消</el-button>
  253. <el-button type="primary" @click="comfirmTime">确 定</el-button>
  254. </span>
  255. </el-dialog>
  256. <el-dialog
  257. title="导出时间"
  258. :visible.sync="dialogExportVisible"
  259. width="30%"
  260. >
  261. <el-date-picker v-model="export_start_time" type="datetime" format="yyyy-MM-dd"
  262. value-format="yyyy-MM-dd"
  263. placeholder="请选择导出开始时间">
  264. </el-date-picker>
  265. <el-date-picker v-model="export_end_time" type="datetime" format="yyyy-MM-dd"
  266. value-format="yyyy-MM-dd"
  267. placeholder="请选择导出结束时间">
  268. </el-date-picker>
  269. <span slot="footer" class="dialog-footer">
  270. <el-button @click="dialogExportVisible = false">取 消</el-button>
  271. <el-button type="primary" @click="comfirmExportTime">确 定</el-button>
  272. </span>
  273. </el-dialog>
  274. </div>
  275. </template>
  276. <script>
  277. import axios from 'axios'
  278. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  279. import noCharge from './components/noCharge'
  280. import charged from './components/charged'
  281. import medicalInsuranceRefund from './components/medicalInsuranceRefund'
  282. import additionalCharges from './components/additionalCharges'
  283. import {
  284. getBaiLinRecord,
  285. getDayOrMonthHisPrescription,
  286. GetHisHospitalChargePatientInfo,
  287. GetHisHospitalChargePatientList,
  288. getInitData,
  289. HopitalunRefund,
  290. Inthopitaluncheck,
  291. Outhopitalcheck,
  292. Outhopitaluncheck,
  293. Settle
  294. } from '@/api/his/his'
  295. import {
  296. exportData
  297. } from '@/api/his/his_hospital'
  298. import { uParseTime } from '@/utils/tools'
  299. import RegisterDialog from './components/registerDialog'
  300. import treatPrint from './treatPrint'
  301. import statementPrint from './statementPrint'
  302. import ChargeDialog from './components/chargeDialog'
  303. import MonthPrescriptionTable from './components/monthPrescriptionTable'
  304. import ChargeMonthPrescriptionTable from './components/chargeMonthPrescriptionTable'
  305. import NewStatementPrintTwo from './newStatementPrintTwo'
  306. import RegisterDialog9504 from './components/registerDialog9504'
  307. import ChargePrescriptionTable from './components/ChargePrescriptionTable'
  308. import invoicePrint from './invoicePrint'
  309. import SettlePrescriptionTable from './components/settlePrescriptionTable'
  310. import HospitalRegisterDialog from './components/hospitalRegisterDialog'
  311. const moment = require('moment')
  312. export default {
  313. components: {
  314. HospitalRegisterDialog,
  315. SettlePrescriptionTable,
  316. ChargePrescriptionTable,
  317. RegisterDialog9504,
  318. NewStatementPrintTwo,
  319. ChargeMonthPrescriptionTable,
  320. MonthPrescriptionTable,
  321. ChargeDialog,
  322. RegisterDialog,
  323. BreadCrumb,
  324. noCharge,
  325. charged,
  326. medicalInsuranceRefund,
  327. additionalCharges,
  328. treatPrint,
  329. statementPrint,
  330. invoicePrint
  331. },
  332. data() {
  333. return {
  334. register: [
  335. { value: 11, label: '普通门诊' },
  336. // { value: 12, label: '门诊挂号' },
  337. // { value: 13, label: '急诊' },
  338. { value: 14, label: '门诊慢性病' }
  339. // { value: 15, label: '门诊统筹' },
  340. // { value: 16, label: '门诊慢性病' },
  341. // { value: 21, label: '普通住院' }
  342. ],
  343. loading: false,
  344. dise_loading: false,
  345. dialogVisible: false,
  346. sick_history: '',
  347. p_type: '',
  348. sick_type: '',
  349. diagnosis: '',
  350. isShowUpload: 1,
  351. isShowWithdrawUpload: 1,
  352. month_p_type: '',
  353. month_sick_type: '',
  354. month_diagnosis: '',
  355. key: '',
  356. other_start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  357. other_end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  358. curMonthPrescriptions: null,
  359. curSettlePrescriptions: null,
  360. month_total: 0,
  361. crumbs: [
  362. { path: false, name: '住院工作站' },
  363. { path: false, name: '住院收费管理' }
  364. ],
  365. current_index: 0,
  366. cal_one: '',
  367. cal_two: '',
  368. cal_three: '',
  369. tableHeight: '',
  370. fullHeight: document.documentElement.clientHeight,
  371. activeName: 'third',
  372. info: {},
  373. curPrescriptions: {},
  374. prescriptions: [],
  375. month_prescriptions: [],
  376. settle_prescriptions: [],
  377. settle_total: 0,
  378. record_date: '',
  379. tableData: [],
  380. editableTabsValue: '处方1',
  381. editSettletableTabsValue: '处方1',
  382. loadingone: false,
  383. editableTabs: [{
  384. title: '处方1',
  385. name: '1'
  386. }],
  387. tabIndex: 1,
  388. hisPatientInfo: {},
  389. loadingtwo: false,
  390. patientTableData: [{
  391. name: '杨美英',
  392. mdtrt_id: '1709946'
  393. }],
  394. patientInfo: { id: 0 },
  395. doctor: {},
  396. total: 0,
  397. state: '未收费',
  398. radio: 1,
  399. radioStatus: 1,
  400. search_input: '',
  401. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  402. patient_id: 0,
  403. prescription_id: 0,
  404. all_table_data: [],
  405. all_charge_table_data: [],
  406. manufacturers: [],
  407. hisPatientDatas: [],
  408. order: {},
  409. addtions_charge: [],
  410. treatVisible: false,
  411. orderObj: {},
  412. paramsObj: {},
  413. newOrderObj: {},
  414. statementVisible: false,
  415. newStatementVisible: false,
  416. chargePatientTableData: [],
  417. sick: [],
  418. diagnoses: [],
  419. department: [],
  420. invoiceVisible: false,
  421. invoiceParams: {},
  422. out_hospital_time: moment(new Date()).add('year',0).format("YYYY-MM-DD HH:mm:ss"),
  423. dialogExportVisible:false,
  424. export_start_time: moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  425. export_end_time: moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  426. }
  427. },
  428. created() {
  429. let tableHeight = document.body.clientHeight - 243
  430. this.tableHeight = tableHeight
  431. var nowDate = new Date()
  432. var nowYear = nowDate.getFullYear()
  433. var nowMonth = nowDate.getMonth() + 1
  434. var nowDay = nowDate.getDate()
  435. this.record_date =
  436. nowYear +
  437. '-' +
  438. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  439. '-' +
  440. (nowDay < 10 ? '0' + nowDay : nowDay)
  441. this.getInitData()
  442. //获取患者信息
  443. this.getPatientList()
  444. },
  445. methods: {
  446. comfirmExportTime(){
  447. let params = {
  448. 'patient_id': this.patientInfo.id,
  449. 'start_time': this.export_start_time,
  450. 'end_time': this.export_end_time,
  451. }
  452. exportData(params).then(response => {
  453. if (response.data.state == 0) {
  454. this.$message.error(response.data.msg)
  455. this.dialogExportVisible = false
  456. return false
  457. } else {
  458. this.dialogExportVisible = false
  459. var prescriptions = response.data.data.month_prescriptions
  460. var patient_ids = this.unique_patient(prescriptions)
  461. let list= []
  462. for(var i = 0;i < patient_ids.length; i++){
  463. let obj = {}
  464. let total = 0
  465. obj["患者姓名"] = patient_ids[i].patient.name
  466. for(let b = 0; b < prescriptions.length; b++){
  467. if(patient_ids[i].patient_id == prescriptions[b].patient_id){
  468. if (prescriptions[b].type == 1) {
  469. if (prescriptions[b].advices != null) {
  470. console.log("~~~~~~~~~~~~~~~~~1111")
  471. for (let a = 0; a < prescriptions[b].advices.length; a++) {
  472. total = total + parseFloat(prescriptions[b].advices[a].price * prescriptions[b].advices[a].prescribing_number)
  473. }
  474. }
  475. } else {
  476. if (prescriptions[b].project != null) {
  477. console.log("~~~~~~~~~~~~~~~~~22222")
  478. for (let c = 0; c < prescriptions[b].project.length; c++) {
  479. total = total + parseFloat(prescriptions[b].project[c].price * prescriptions[b].project[c].count)
  480. }
  481. }
  482. }
  483. }
  484. }
  485. obj["总金额"] = total.toFixed(2)
  486. list.push(obj)
  487. }
  488. import("@/vendor/Export2Excel").then((excel) => {
  489. const tHeader = [
  490. "患者姓名",
  491. "总金额"
  492. ];
  493. const filterVal = [
  494. "患者姓名",
  495. "总金额"
  496. ];
  497. const data = this.formatJson(filterVal, list);
  498. excel.export_json_to_excel({
  499. header: tHeader,
  500. data,
  501. filename: "消费明细",
  502. });
  503. });
  504. }
  505. })
  506. },
  507. comfirmTime() {
  508. var that = this
  509. let params = {
  510. 'id': this.hisPatientInfo.id,
  511. 'patient_id': this.patientInfo.id,
  512. 'admin_user_id': this.$store.getters.xt_user.user.id,
  513. 'record_time': this.record_date,
  514. 'out_time': this.out_hospital_time
  515. }
  516. if (this.hisPatientInfo.balance_accounts_type == 2) {
  517. Outhopitalcheck(params).then(response => {
  518. if (response.data.state == 0) {
  519. this.$message.error(response.data.msg)
  520. this.dialogVisible = false
  521. return false
  522. } else {
  523. this.dialogVisible = false
  524. this.$message.success('出院成功')
  525. this.changeRadioAndPatient(1)
  526. }
  527. })
  528. } else {
  529. axios.get('http://127.0.0.1:9532/zh/api/outhopitalcheck/get', {
  530. params: params
  531. })
  532. .then(function(response) {
  533. if (response.data.state == 0) {
  534. that.$message.error(response.data.msg)
  535. that.dialogVisible = false
  536. return false
  537. } else {
  538. if (response.data.data.failed_code == -10) {
  539. that.dialogVisible = false
  540. that.$confirm(response.data.data.msg, '医保错误信息', {
  541. confirmButtonText: '确 定',
  542. type: 'warning'
  543. }).then(() => {
  544. }).catch(() => {
  545. })
  546. } else {
  547. that.dialogVisible = false
  548. that.$message.success('出院成功')
  549. that.changeRadioAndPatient(1)
  550. }
  551. }
  552. })
  553. .catch(function(error) {
  554. })
  555. }
  556. },
  557. getTimes(time) {
  558. return uParseTime(time, '{y}-{m}-{d}')
  559. },
  560. changeTimeTwo() {
  561. this.getPatientList()
  562. },
  563. query() {
  564. 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) {
  565. var that = this
  566. axios.get('http://127.0.0.1:9532/api/org/info', {
  567. params: {}
  568. })
  569. .then(function(response) {
  570. if (response.data.state == 0) {
  571. that.$message.error(response.data.msg)
  572. return false
  573. } else {
  574. }
  575. })
  576. .catch(function(error) {
  577. })
  578. }
  579. },
  580. getDepartment(department_id) {
  581. for (let i = 0; i < this.department.length; i++) {
  582. if (this.department[i].id == department_id) {
  583. return this.department[i].name
  584. }
  585. }
  586. },
  587. querySearch2(queryString, cb) {
  588. var restaurants = this.other_sick
  589. restaurants.map(item => {
  590. item.value = item.name
  591. })
  592. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  593. // 调用 callback 返回建议列表的数据
  594. cb(results)
  595. },
  596. changeTime(val) {
  597. let params = {
  598. patient_id: this.patientInfo.id,
  599. start_time: val,
  600. end_time: this.other_end_time,
  601. p_type: 1
  602. }
  603. getDayOrMonthHisPrescription(params).then(response => {
  604. if (response.data.state == 1) {
  605. this.month_prescriptions = []
  606. this.setMonthPrescription(response.data.data.day_prescription)
  607. this.curMonthPrescriptions = this.month_prescriptions[0]
  608. } else {
  609. this.$message.error(response.data.msg)
  610. }
  611. })
  612. },
  613. changeEndTime(val) {
  614. let params = {
  615. patient_id: this.patientInfo.id,
  616. start_time: this.other_start_time,
  617. end_time: val,
  618. p_type: 1
  619. }
  620. getDayOrMonthHisPrescription(params).then(response => {
  621. if (response.data.state == 1) {
  622. this.month_prescriptions = []
  623. this.setMonthPrescription(response.data.data.day_prescription)
  624. this.curMonthPrescriptions = this.month_prescriptions[0]
  625. } else {
  626. this.$message.error(response.data.msg)
  627. }
  628. })
  629. },s(){
  630. this.$refs.hrd.hide()
  631. this.getPatientList()
  632. },hospitalRegisterCancel(){
  633. this.$refs.hrd.hide()
  634. },
  635. chargeConfirm(form) {
  636. form['in_hospital_id'] = this.hisPatientInfo.id
  637. form['patient_id'] = this.patientInfo.id
  638. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  639. form['order_id'] = this.order.id
  640. form['record_time'] = this.record_date
  641. // if (this.activeName == 'first') {
  642. // form['settle_accounts_type'] = 1
  643. //
  644. // } else {
  645. // form['start_time'] = this.other_start_time
  646. // form['end_time'] = this.other_end_time
  647. // form['settle_accounts_type'] = 2
  648. //
  649. // }
  650. if (this.hisPatientInfo.balance_accounts_type != 2) {
  651. var that = this
  652. axios.get('http://127.0.0.1:9532/zh/api/settle/get', {
  653. params: form,
  654. headers: {
  655. 'Permission': 5
  656. }
  657. })
  658. .then(function(response) {
  659. if (response.data.state == 0) {
  660. that.$message.error(response.data.msg)
  661. that.loadingtwo = false
  662. that.$refs.charge.hide()
  663. return false
  664. } else {
  665. if (response.data.data.failed_code == -10) {
  666. // that.$message.error(response.data.data.msg)
  667. that.$confirm(response.data.data.msg, '医保错误信息', {
  668. confirmButtonText: '确 定',
  669. type: 'warning'
  670. }).then(() => {
  671. }).catch(() => {
  672. })
  673. } else {
  674. that.changeRadioAndPatient(2)
  675. that.radio = 2
  676. that.$refs.charge.hide()
  677. that.loadingtwo = false
  678. that.state = '已收费'
  679. that.$message({ message: '收费成功', type: 'success', duration: 5000 })
  680. that.loadingtwo = false
  681. that.cal_one = this.cal_one - 1
  682. that.cal_two = this.cal_two + 1
  683. that.patientTableData.splice(this.current_index, 1)
  684. }
  685. }
  686. })
  687. .catch(function(error) {
  688. })
  689. } else {
  690. Settle(form).then(response => {
  691. if (response.data.state == 0) {
  692. this.$message.error(response.data.msg)
  693. this.loadingtwo = false
  694. this.$refs.charge.hide()
  695. return false
  696. } else {
  697. this.$refs.charge.hide()
  698. this.changeRadioAndPatient(2)
  699. this.loadingtwo = false
  700. this.state = '已收费'
  701. this.$message({ message: '收费成功', type: 'success' })
  702. this.$refs.charge.hide()
  703. this.loadingtwo = false
  704. }
  705. })
  706. }
  707. },
  708. chargeCancel() {
  709. this.$refs.charge.hide()
  710. },
  711. registerCancel() {
  712. this.$refs.register9504.hide()
  713. },
  714. cancel() {
  715. this.$refs.register.hide()
  716. },
  717. addCharges() {
  718. this.$refs.additionalCharges.show()
  719. },
  720. changeDate(val) {
  721. if (this.patientInfo.id == 0) {
  722. this.$message.error('请先选择患者')
  723. return
  724. }
  725. let params = {
  726. 'his_patient_id': val.his_patient.id,
  727. 'record_date': val,
  728. 'patient_id': this.patientInfo.id,
  729. 'type': this.radio,
  730. 'p_type': 1
  731. }
  732. GetHisHospitalChargePatientInfo(params).then(response => {
  733. if (response.data.state == 0) {
  734. this.$message.error(response.data.msg)
  735. return false
  736. } else {
  737. this.prescriptions = []
  738. this.month_prescriptions = []
  739. this.curPrescriptions = {}
  740. this.month_prescriptions = {}
  741. this.patientInfo = response.data.data.xt_info
  742. this.hisPatientInfo = response.data.data.his_info
  743. this.info = response.data.data.info
  744. this.order = response.data.data.order
  745. this.addtions_charge = response.data.data.addtions_charge
  746. // this.setMonthPrescription(response.data.data.month_prescriptions)
  747. for (let i = 0; i < response.data.data.prescription.length; i++) {
  748. var prescription = response.data.data.prescription[i]
  749. let tempAdvice = []
  750. let tempProject = []
  751. for (let b = 0; b < prescription.advices.length; b++) {
  752. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  753. let obj = {
  754. advice_id: prescription.advices[b].id,
  755. drug_name: prescription.advices[b].advice_name,
  756. single_dose: prescription.advices[b].single_dose,
  757. delivery_way: prescription.advices[b].delivery_way,
  758. execution_frequency: prescription.advices[b].execution_frequency,
  759. retail_price: prescription.advices[b].price,
  760. remark: prescription.advices[b].remark,
  761. day: prescription.advices[b].day,
  762. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  763. single_dose_unit: prescription.advices[b].single_dose_unit,
  764. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  765. medical_insurance_number: prescription.advices[b].med_list_codg,
  766. code: prescription.advices[b].drug.medical_insurance_number,
  767. spec: spec,
  768. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  769. name_id: prescription.advices[b].drug.manufacturer,
  770. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt * prescription.advices[b].prescribing_number,
  771. overlmt_amt: prescription.advices[b].order_info.overlmt_amt* prescription.advices[b].prescribing_number,
  772. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt* prescription.advices[b].prescribing_number,
  773. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt* prescription.advices[b].prescribing_number
  774. }
  775. tempAdvice.push(obj)
  776. }
  777. for (let b = 0; b < prescription.project.length; b++) {
  778. let obj = {
  779. id: prescription.project[b].id,
  780. project_id: prescription.project[b].project.id,
  781. single_dose: prescription.project[b].single_dose,
  782. delivery_way: prescription.project[b].delivery_way,
  783. execution_frequency: prescription.project[b].execution_frequency,
  784. number_days: prescription.project[b].day,
  785. total: prescription.project[b].count.toString(),
  786. price: prescription.project[b].price,
  787. remark: prescription.project[b].remark,
  788. // medical_code: prescription.project[b].project.medical_code,
  789. unit: prescription.project[b].unit,
  790. type: prescription.project[b].type,
  791. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt* prescription.advices[b].prescribing_number,
  792. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt* prescription.advices[b].prescribing_number,
  793. overlmt_amt: prescription.project[b].order_info.overlmt_amt * prescription.advices[b].prescribing_number,
  794. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt * prescription.advices[b].prescribing_number,
  795. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt * prescription.advices[b].prescribing_number
  796. }
  797. if (prescription.project[b].type == 2) {
  798. obj['statistical_classification'] = prescription.project[b].team.project_team
  799. obj['medical_code'] = prescription.project[b].project.medical_code
  800. obj['project_name'] = prescription.project[b].project.project_name
  801. obj['spec'] = ''
  802. obj['name_id'] = 0
  803. } else if (prescription.project[b].type == 3) {
  804. obj['statistical_classification'] = prescription.project[b].team.project_team
  805. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  806. obj['project_name'] = prescription.project[b].good_info.good_name
  807. obj['spec'] = prescription.project[b].good_info.specification_name
  808. obj['name_id'] = prescription.project[b].good_info.manufacturer
  809. }
  810. tempProject.push(obj)
  811. }
  812. let index = i + 1
  813. let obj = {
  814. id: prescription.id,
  815. name: '处方' + index,
  816. advices: tempAdvice,
  817. project: tempProject,
  818. type: prescription.type,
  819. order_status: prescription.order_status
  820. }
  821. this.prescriptions.push(obj)
  822. }
  823. this.curPrescriptions = this.prescriptions[0]
  824. this.total = 0
  825. this.total = this.getTotalOne()
  826. this.month_total = 0
  827. this.month_total = this.getMonthTotalOne()
  828. }
  829. })
  830. },
  831. getInitData() {
  832. getInitData().then(response => {
  833. if (response.data.state == 0) {
  834. this.$message.error(response.data.msg)
  835. return false
  836. } else {
  837. this.doctors = response.data.data.doctors
  838. this.department = response.data.data.department
  839. this.sick = response.data.data.sick
  840. this.diagnoses = response.data.data.diagnose
  841. this.manufacturers = response.data.data.manufacturers
  842. }
  843. })
  844. },
  845. getDayPatientList() {
  846. let params = {
  847. 'record_date': this.record_date
  848. }
  849. GetHisHospitalChargePatientList(params).then(response => {
  850. if (response.data.state == 0) {
  851. this.$message.error(response.data.msg)
  852. return false
  853. } else {
  854. if (response.data.data.list == null) {
  855. response.data.data.list = []
  856. }
  857. if (response.data.data.list_two == null) {
  858. response.data.data.list_two = []
  859. }
  860. this.patientTableData = []
  861. this.all_table_data = []
  862. this.hisPatientDatas = []
  863. this.all_charge_table_data = []
  864. let one_count = 0
  865. let two_count = 0
  866. let three_count = 0
  867. for (let i = 0; i < response.data.data.list.length; i++) {
  868. this.all_table_data.push(response.data.data.list[i])
  869. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
  870. one_count = one_count + 1
  871. }
  872. if (response.data.data.list[i].order.order_status == 2) {
  873. two_count = two_count + 1
  874. }
  875. // if (response.data.data.list[i].order.order_status == 3) {
  876. // three_count = three_count + 1
  877. // }
  878. }
  879. this.hisPatientDatas = response.data.data.list_two
  880. this.cal_one = one_count
  881. this.cal_two = response.data.data.charge_list.length
  882. this.cal_three = three_count
  883. this.current_index = 0
  884. switch (this.radio) {
  885. case 1:
  886. this.patientTableData = []
  887. for (let i = 0; i < this.all_table_data.length; i++) {
  888. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
  889. this.patientTableData.push(this.all_table_data[i])
  890. }
  891. }
  892. if (this.patientTableData.length > 0) {
  893. for (let i = 0; i < this.patientTableData.length; i++) {
  894. if (this.patientTableData[i].patient_id == this.patientInfo.id) {
  895. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  896. this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
  897. }
  898. }
  899. }
  900. break
  901. case 2:
  902. this.chargePatientTableData = []
  903. for (let i = 0; i < response.data.data.charge_list.length; i++) {
  904. let obj = {
  905. name: response.data.data.charge_list[i].patient.name,
  906. id: response.data.data.charge_list[i].patient.id,
  907. number: response.data.data.charge_list[i].number,
  908. his_patient_id: response.data.data.charge_list[i].his_patient.id,
  909. his_number: response.data.data.charge_list[i].mdtrt_id
  910. }
  911. this.chargePatientTableData.push(obj)
  912. }
  913. this.all_charge_table_data = this.chargePatientTableData
  914. if (this.chargePatientTableData.length > 0) {
  915. for (let i = 0; i < this.chargePatientTableData.length; i++) {
  916. if (this.chargePatientTableData[i].id == this.patientInfo.id) {
  917. this.$refs.tab.setCurrentRow(this.chargePatientTableData[i])
  918. this.getPatientInformation(this.chargePatientTableData[i].id, this.chargePatientTableData[i].number, this.chargePatientTableData[i].his_patient_id)
  919. }
  920. }
  921. }
  922. break
  923. // case 3:
  924. // this.patientTableData = []
  925. //
  926. // for (let i = 0; i < this.all_table_data.length; i++) {
  927. //
  928. // if (this.all_table_data[i].his_patient.order.order_status == 3) {
  929. // this.patientTableData.push(this.all_table_data[i])
  930. // }
  931. //
  932. // }
  933. // break
  934. // case 4:
  935. // this.patientTableData = []
  936. // this.patientTableData = this.all_table_data
  937. // break
  938. }
  939. }
  940. })
  941. },
  942. getMonthPatientList() {
  943. let params = {
  944. 'record_date': this.record_date
  945. }
  946. GetHisHospitalChargePatientList(params).then(response => {
  947. if (response.data.state == 0) {
  948. this.$message.error(response.data.msg)
  949. return false
  950. } else {
  951. if (response.data.data.list == null) {
  952. response.data.data.list = []
  953. }
  954. if (response.data.data.list_two == null) {
  955. response.data.data.list_two = []
  956. }
  957. this.patientTableData = []
  958. this.all_table_data = []
  959. this.hisPatientDatas = []
  960. let one_count = 0
  961. let two_count = 0
  962. let three_count = 0
  963. for (let i = 0; i < response.data.data.list_two.length; i++) {
  964. this.hisPatientDatas.push(response.data.data.list_two[i])
  965. if (response.data.data.list_two[i].order.order_status == 0 || response.data.data.list_two[i].order.order_status == 1 || response.data.data.list_two[i].order.order_status == 3) {
  966. one_count = one_count + 1
  967. }
  968. if (response.data.data.list_two[i].order.order_status == 2) {
  969. two_count = two_count + 1
  970. }
  971. // if (response.data.data.list_two[i].order.order_status == 3) {
  972. // three_count = three_count + 1
  973. // }
  974. }
  975. this.cal_one = one_count
  976. this.cal_two = response.data.data.charge_list.length
  977. // this.all_charge_table_data = response.data.data.charge_list
  978. this.cal_three = three_count
  979. this.current_index = 0
  980. switch (this.radio) {
  981. case 1:
  982. this.patientTableData = []
  983. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  984. if (this.hisPatientDatas[i].order.order_status == 0 || this.hisPatientDatas[i].order.order_status == 1 || this.hisPatientDatas[i].order.order_status == 3) {
  985. this.patientTableData.push(this.hisPatientDatas[i])
  986. }
  987. }
  988. if (this.patientTableData.length > 0) {
  989. for (let i = 0; i < this.patientTableData.length; i++) {
  990. if (this.patientTableData[i].patient_id == this.patientInfo.id) {
  991. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  992. this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
  993. }
  994. }
  995. }
  996. break
  997. case 2:
  998. this.chargePatientTableData = []
  999. for (let i = 0; i < response.data.data.charge_list.length; i++) {
  1000. let obj = {
  1001. name: response.data.data.charge_list[i].patient.name,
  1002. id: response.data.data.charge_list[i].patient.id,
  1003. number: response.data.data.charge_list[i].number,
  1004. his_patient_id: response.data.data.charge_list[i].his_patient.id,
  1005. his_number: response.data.data.charge_list[i].mdtrt_id
  1006. }
  1007. this.chargePatientTableData.push(obj)
  1008. }
  1009. this.all_charge_table_data = this.chargePatientTableData
  1010. for (let i = 0; i < this.chargePatientTableData.length; i++) {
  1011. if (this.patientInfo.id == this.chargePatientTableData[i].id) {
  1012. this.current_index = i
  1013. this.$refs.tab.setCurrentRow(this.chargePatientTableData[i])
  1014. this.getPatientInformation(this.chargePatientTableData[i].id, this.chargePatientTableData[i].number, this.chargePatientTableData[i].his_patient_id)
  1015. }
  1016. }
  1017. break
  1018. // case 3:
  1019. // this.patientTableData = []
  1020. // for (let i = 0; i < this.hisPatientDatas.length; i++) {
  1021. // if (this.hisPatientDatas[i].order.order_status == 3) {
  1022. // this.patientTableData.push(this.hisPatientDatas[i])
  1023. // }
  1024. // }
  1025. // break
  1026. case 4:
  1027. this.patientTableData = []
  1028. this.patientTableData = this.hisPatientDatas
  1029. break
  1030. }
  1031. }
  1032. })
  1033. },
  1034. handleClick() {
  1035. // this.getPatientList()
  1036. // if (this.activeName == 'first') {
  1037. // // this.patientTableData = this.all_table_data
  1038. // this.getDayPatientList()
  1039. //
  1040. // } else if (this.activeName == 'second') {
  1041. // this.getMonthPatientList()
  1042. // // this.getPatientList()
  1043. //
  1044. // // if (this.patientTableData.length > 0) {
  1045. // // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1046. // // this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  1047. // // }
  1048. //
  1049. // } else {
  1050. //
  1051. // console.log(this.settle_prescriptions)
  1052. // }
  1053. },
  1054. searchAction() {
  1055. console.log(this.all_table_data)
  1056. if (this.search_input.length == 0) {
  1057. switch (this.radio) {
  1058. case 1:
  1059. this.patientTableData = this.all_table_data
  1060. break
  1061. case 2:
  1062. this.chargePatientTableData = this.all_charge_table_data
  1063. break
  1064. }
  1065. } else {
  1066. switch (this.radio) {
  1067. case 1:
  1068. let arr3 = []
  1069. for (let i = 0; i < this.all_table_data.length; i++) {
  1070. console.log(this.all_table_data[i])
  1071. console.log(this.all_table_data[i].name)
  1072. console.log(this.all_table_data[i].his_number)
  1073. if (this.all_table_data[i].name.indexOf(this.search_input) != -1) {
  1074. arr3 = arr3.concat(this.all_table_data[i])
  1075. }
  1076. }
  1077. this.patientTableData = arr3
  1078. break
  1079. case 2:
  1080. let arr2 = []
  1081. for (let i = 0; i < this.all_charge_table_data.length; i++) {
  1082. console.log(this.all_charge_table_data[i].name)
  1083. console.log(this.all_charge_table_data[i].his_number)
  1084. if (this.all_charge_table_data[i].name.indexOf(this.search_input) != -1 ) {
  1085. arr2 = arr2.concat(this.all_charge_table_data[i])
  1086. }
  1087. }
  1088. this.chargePatientTableData = arr2
  1089. break
  1090. }
  1091. }
  1092. },
  1093. tabclickEventThree(val) {
  1094. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  1095. if (this.settle_prescriptions[i].name == val.name) {
  1096. this.curSettlePrescriptions = {}
  1097. var temp = this.deepClone(this.settle_prescriptions[i])
  1098. this.curSettlePrescriptions = temp
  1099. }
  1100. }
  1101. // this.prescription_id = this.settle_prescriptions.id
  1102. // this.settle_total = 0
  1103. // this.settle_total = this.getSettleTotalOne()
  1104. },
  1105. deepClone(source) {
  1106. if (!source && typeof source !== 'object') {
  1107. throw new Error('error arguments', 'shallowClone')
  1108. }
  1109. const targetObj = source.constructor === Array ? [] : {}
  1110. Object.keys(source).forEach((keys) => {
  1111. if (source[keys] && typeof source[keys] === 'object') {
  1112. targetObj[keys] = this.deepClone(source[keys])
  1113. } else {
  1114. targetObj[keys] = source[keys]
  1115. }
  1116. })
  1117. return targetObj
  1118. },
  1119. getTotalOne() {
  1120. var total = 0
  1121. if (this.curPrescriptions.type == 1) {
  1122. if (this.curPrescriptions.advices != null) {
  1123. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1124. total = parseFloat(total) + parseFloat(this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number)
  1125. }
  1126. }
  1127. } else {
  1128. if (this.curPrescriptions.project != null) {
  1129. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  1130. total = parseFloat(total) + parseFloat(this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total)
  1131. }
  1132. }
  1133. }
  1134. return total.toFixed(2)
  1135. },
  1136. getMonthTotalOne() {
  1137. var total = 0
  1138. if (this.curMonthPrescriptions.type == 1) {
  1139. if (this.curMonthPrescriptions.advices != null) {
  1140. for (let a = 0; a < this.curMonthPrescriptions.advices.length; a++) {
  1141. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.advices[a].retail_price* this.curMonthPrescriptions.advices[a].prescribing_number)
  1142. }
  1143. }
  1144. } else {
  1145. if (this.curMonthPrescriptions.project != null) {
  1146. for (let b = 0; b < this.curMonthPrescriptions.project.length; b++) {
  1147. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.project[b].price * this.curMonthPrescriptions.project[b].total)
  1148. }
  1149. }
  1150. }
  1151. return total.toFixed(2)
  1152. },
  1153. getSettleTotalOne() {
  1154. var total = 0
  1155. if (this.curSettlePrescriptions.type == 1) {
  1156. if (this.curSettlePrescriptions.advices != null) {
  1157. for (let a = 0; a < this.curSettlePrescriptions.advices.length; a++) {
  1158. total = parseFloat(total) + (this.curSettlePrescriptions.advices[a].retail_price * this.curSettlePrescriptions.advices[a].prescribing_number).toFixed(2)
  1159. }
  1160. }
  1161. } else {
  1162. if (this.curSettlePrescriptions.project != null) {
  1163. for (let b = 0; b < this.curSettlePrescriptions.project.length; b++) {
  1164. total = parseFloat(total) + (this.curSettlePrescriptions.project[b].price * this.curSettlePrescriptions.project[b].total).toFixed(2)
  1165. }
  1166. }
  1167. }
  1168. return total
  1169. },
  1170. getSettleTotal() {
  1171. var total = 0.0
  1172. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  1173. if (this.settle_prescriptions[i].advices != null) {
  1174. for (let a = 0; a < this.settle_prescriptions[i].advices.length; a++) {
  1175. // console.log(parseFloat(this.settle_prescriptions[i].advices[a].retail_price.toFixed(2)))
  1176. // console.log(this.settle_prescriptions[i].advices[a].prescribing_number)
  1177. total = parseFloat(total) + (parseFloat(this.settle_prescriptions[i].advices[a].retail_price.toString()) * parseFloat(this.settle_prescriptions[i].advices[a].prescribing_number.toString())).toFixed(2)
  1178. // console.log(parseFloat(this.settle_prescriptions[i].advices[a].retail_price.toFixed(2) * this.settle_prescriptions[i].advices[a].prescribing_number))
  1179. // total = parseFloat(total) + parseFloat(this.settle_prescriptions[i].advices[a].retail_price).toFixed(2) * this.settle_prescriptions[i].advices[a].prescribing_number
  1180. }
  1181. }
  1182. if (this.settle_prescriptions[i].project != null) {
  1183. for (let b = 0; b < this.settle_prescriptions[i].project.length; b++) {
  1184. total = parseFloat(total) + (parseFloat(this.settle_prescriptions[i].project[b].price.toString()) * parseFloat(this.settle_prescriptions[i].project[b].total.toString())).toFixed(2)
  1185. // total = parseFloat(total) + parseFloat(this.settle_prescriptions[i].project[b].price.toFixed(2))* this.settle_prescriptions[i].project[b].total
  1186. }
  1187. }
  1188. }
  1189. return total
  1190. },
  1191. getTotal() {
  1192. var total = 0
  1193. for (let i = 0; i < this.prescriptions.length; i++) {
  1194. if (this.prescriptions[i].advices != null) {
  1195. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1196. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number)
  1197. }
  1198. }
  1199. if (this.prescriptions[i].project != null) {
  1200. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1201. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total)
  1202. }
  1203. }
  1204. }
  1205. return total.toFixed(2)
  1206. },
  1207. getTotalTwo() {
  1208. var total = 0
  1209. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1210. if (this.month_prescriptions[i].advices != null) {
  1211. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1212. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number)
  1213. }
  1214. }
  1215. if (this.month_prescriptions[i].project != null) {
  1216. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  1217. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].project[a].price * this.month_prescriptions[i].project[a].total)
  1218. }
  1219. }
  1220. }
  1221. return total.toFixed(2)
  1222. },
  1223. moreState(tab, event) {
  1224. if (tab == 'more') {
  1225. return false
  1226. }
  1227. },
  1228. formatJson(filterVal, jsonData) {
  1229. return jsonData.map(v => filterVal.map(j => v[j]))
  1230. },exportUnchargeData(){
  1231. this.dialogExportVisible = true
  1232. },
  1233. open(index) {
  1234. if (index == 1){
  1235. this.$refs.hrd.show()
  1236. }
  1237. if (index == 40) {
  1238. var form = {}
  1239. form['in_hospital_id'] = this.hisPatientInfo.id
  1240. form['patient_id'] = this.patientInfo.id
  1241. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  1242. form['order_id'] = this.order.id
  1243. form['record_time'] = this.record_date
  1244. if (this.hisPatientInfo.balance_accounts_type != 2) {
  1245. var that = this
  1246. axios.get('http://127.0.0.1:9532/zh/api/presettle/get', {
  1247. params: form,
  1248. headers: {
  1249. 'Permission': 5
  1250. }
  1251. })
  1252. .then(function(response) {
  1253. if (response.data.state == 0) {
  1254. that.$message.error(response.data.msg)
  1255. return false
  1256. } else {
  1257. if (response.data.data.failed_code == -10) {
  1258. that.$confirm(response.data.data.msg, '医保错误信息', {
  1259. confirmButtonText: '确 定',
  1260. type: 'warning'
  1261. }).then(() => {
  1262. }).catch(() => {
  1263. })
  1264. } else {
  1265. if(response.data.data.order_way != 1){
  1266. let message = ""
  1267. console.log(message)
  1268. let order = response.data.data.order
  1269. console.log(order)
  1270. message = "总费用:" + order.medfee_sumamt+"元" + "\n"
  1271. + "基金支付总额:"+ order.fund_pay_sumamt+"元" + "\n"
  1272. + "基本医疗保险统筹基金支出:"+ order.hifp_pay+"元" + "\n"
  1273. + "医疗救助基金支出:" + order.maf_pay + "元"+ "\n"
  1274. + "个人账户支付金额:" + order.acct_pay + "元" + "\n"
  1275. +"个人支付金额:" + order.psn_cash_pay + "元" +"\n"
  1276. + "个人账户金额:" + order.balc + "元"
  1277. console.log(message)
  1278. that.$confirm(message, '预结算信息', {
  1279. confirmButtonText: '确 定',
  1280. type: 'info'
  1281. }).then(() => {
  1282. }).catch(() => {
  1283. })
  1284. }else{
  1285. that.changeRadioAndPatient(1)
  1286. that.$message({ message: '预结算成功', type: 'success', duration: 5000 })
  1287. }
  1288. }
  1289. }
  1290. })
  1291. .catch(function(error) {
  1292. })
  1293. }
  1294. }
  1295. if (index == 200) {
  1296. getBaiLinRecord().then(response => {
  1297. if (response.data.state == 0) {
  1298. this.$message.error(response.data.msg)
  1299. return false
  1300. } else {
  1301. let list = []
  1302. for (let b = 0; b < response.data.data.list.length; b++) {
  1303. let time = ''
  1304. if (response.data.data.list[b].setl_time != '') {
  1305. time = response.data.data.list[b].setl_time
  1306. } else {
  1307. time = this.getTimes(response.data.data.list[b].settle_accounts_date)
  1308. }
  1309. let obj = {
  1310. '就诊id': response.data.data.list[b].mdtrt_id,
  1311. '结算id': response.data.data.list[b].setl_id,
  1312. '姓名': response.data.data.list[b].patient.name,
  1313. '证件号码': response.data.data.list[b].patient.id_card_no,
  1314. '开始时间': this.getTimes(response.data.data.list[b].settle_accounts_date),
  1315. '结束时间': this.getTimes(response.data.data.list[b].settle_accounts_date),
  1316. '费用合计': response.data.data.list[b].medfee_sumamt,
  1317. '记账合计': response.data.data.list[b].fund_pay_sumamt,
  1318. '现金支付': response.data.data.list[b].psn_cash_pay,
  1319. '统筹支出': response.data.data.list[b].hifp_pay,
  1320. '大病': response.data.data.list[b].hifp_pay,
  1321. '大额': response.data.data.list[b].hifob_pay,
  1322. '医疗救助基金': response.data.data.list[b].maf_pay,
  1323. '先行自付金额': response.data.data.list[b].preselfpay_amt,
  1324. '超限价自费费用': response.data.data.list[b].overlmt_self_pay,
  1325. '全自费金额': response.data.data.list[b].fulamt_ownpay_amt,
  1326. '结算时间': time
  1327. }
  1328. list.push(obj)
  1329. }
  1330. import('@/vendor/Export2Excel').then(excel => {
  1331. const tHeader = ['就诊id', '结算id', '姓名', '证件号码', '开始时间', '结束时间', '费用合计', '记账合计', '现金支付', '统筹支出', '大病', '大额', '医疗救助基金', '先行自付金额', '超限价自费费用', '全自费金额', '结算时间']
  1332. const filterVal = ['就诊id', '结算id', '姓名', '证件号码', '开始时间', '结束时间', '费用合计', '记账合计', '现金支付', '统筹支出', '大病', '大额', '医疗救助基金', '先行自付金额', '超限价自费费用', '全自费金额', '结算时间']
  1333. const data = this.formatJson(filterVal, list)
  1334. excel.export_json_to_excel({
  1335. header: tHeader,
  1336. data,
  1337. filename: '核酸'
  1338. })
  1339. })
  1340. }
  1341. })
  1342. }
  1343. if (index == 2) { //出院
  1344. if (this.patientInfo.id == 0) {
  1345. this.$message({ message: '该选择要出院的患者', type: 'error' })
  1346. return
  1347. }
  1348. var that = this
  1349. this.$confirm('是否出院', '出院', {
  1350. confirmButtonText: '确 定',
  1351. cancelButtonText: '取 消',
  1352. type: 'warning'
  1353. }).then(() => {
  1354. this.dialogVisible = true
  1355. this.out_hospital_time = moment(new Date()).add('year',0).format("YYYY-MM-DD HH:mm:ss")
  1356. }).catch(() => {
  1357. })
  1358. } else if (index == 3) {
  1359. if (this.patientInfo.id == 0) {
  1360. this.$message({ message: '该选择要收费的患者', type: 'error' })
  1361. return
  1362. }
  1363. let ids = []
  1364. // if (this.activeName == 'first') {
  1365. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  1366. for (let a = 0; a < this.settle_prescriptions[i].advices.length; a++) {
  1367. ids.push(this.settle_prescriptions[i].advices[a].id)
  1368. }
  1369. for (let a = 0; a < this.settle_prescriptions[i].project.length; a++) {
  1370. ids.push(this.settle_prescriptions[i].project[a].id)
  1371. }
  1372. }
  1373. if (ids.length == 0) {
  1374. this.$message.error('请先到医生工作站开处方再来结算')
  1375. return
  1376. }
  1377. console.log("this.patientInfo.id",this.patientInfo.id)
  1378. console.log("this.$refs.charge.",this.$refs.charge)
  1379. this.$nextTick(() => {
  1380. this.$refs.charge.show(this.settle_total, this.order, this.patientInfo.id)
  1381. })
  1382. } else if (index == 4) {
  1383. if (this.hisPatientInfo.balance_accounts_type == 2) {
  1384. this.$confirm('是否退费', '退费', {
  1385. confirmButtonText: '确 定',
  1386. cancelButtonText: '取 消',
  1387. type: 'warning'
  1388. }).then(() => {
  1389. let params = {
  1390. 'order_id': this.order.id,
  1391. 'admin_user_id': this.$store.getters.xt_user.user.id
  1392. }
  1393. HopitalunRefund(params).then(response => {
  1394. if (response.data.state == 0) {
  1395. this.$message.error(response.data.msg)
  1396. return false
  1397. } else {
  1398. this.$message.success('退费成功')
  1399. this.changeRadioAndPatient(1)
  1400. this.loadingtwo = false
  1401. }
  1402. })
  1403. }).catch(() => {
  1404. })
  1405. } else {
  1406. var that = this
  1407. this.$confirm('是否退费', '退费', {
  1408. confirmButtonText: '确 定',
  1409. cancelButtonText: '取 消',
  1410. type: 'warning'
  1411. }).then(() => {
  1412. let params = {
  1413. 'order_id': this.order.id,
  1414. 'admin_user_id': this.$store.getters.xt_user.user.id
  1415. }
  1416. axios.get('http://127.0.0.1:9532/zh/api/refund', {
  1417. params: params
  1418. })
  1419. .then(function(response) {
  1420. if (response.data.state == 0) {
  1421. that.$message.error(response.data.msg)
  1422. that.loadingtwo = false
  1423. return false
  1424. } else {
  1425. if (response.data.data.failed_code == -10) {
  1426. // that.$message.error(response.data.data.msg)
  1427. that.$confirm(response.data.data.msg, '医保错误信息', {
  1428. confirmButtonText: '确 定',
  1429. type: 'warning'
  1430. }).then(() => {
  1431. }).catch(() => {
  1432. })
  1433. } else {
  1434. that.changeRadioAndPatient(1)
  1435. that.$message({ message: '退费成功', type: 'success', duration: 5000 })
  1436. that.loadingtwo = false
  1437. }
  1438. }
  1439. })
  1440. .catch(function(error) {
  1441. })
  1442. }).catch(() => {
  1443. })
  1444. }
  1445. } else if (index == 5) {
  1446. this.statementVisible = true
  1447. let obj = {
  1448. order_id: this.order.id,
  1449. balance_accounts_type:this.hisPatientInfo.balance_accounts_type
  1450. }
  1451. this.orderObj = obj
  1452. // this.$refs.print.getInfo(this.order.id)
  1453. } else if (index == 6) {
  1454. if (this.patientInfo.id == 0) {
  1455. this.$message({ message: '该选择要撤销出院的患者', type: 'error' })
  1456. return
  1457. }
  1458. if (this.hisPatientInfo.balance_accounts_type == 2) {
  1459. var that = this
  1460. this.$confirm('是否撤销出院', '撤销出院', {
  1461. confirmButtonText: '确 定',
  1462. cancelButtonText: '取 消',
  1463. type: 'warning'
  1464. }).then(() => {
  1465. let params = {
  1466. 'id': that.hisPatientInfo.id,
  1467. 'admin_user_id': this.$store.getters.xt_user.user.id
  1468. }
  1469. Outhopitaluncheck(params).then(response => {
  1470. if (response.data.state == 0) {
  1471. this.$message.error(response.data.msg)
  1472. return false
  1473. } else {
  1474. this.$message.success('撤销出院成功')
  1475. this.changeRadioAndPatient(1)
  1476. }
  1477. })
  1478. }).catch(() => {
  1479. })
  1480. } else {
  1481. var that = this
  1482. this.$confirm('是否撤销出院', '撤销出院', {
  1483. confirmButtonText: '确 定',
  1484. cancelButtonText: '取 消',
  1485. type: 'warning'
  1486. }).then(() => {
  1487. let params = {
  1488. 'id': that.hisPatientInfo.id,
  1489. 'admin_user_id': this.$store.getters.xt_user.user.id
  1490. }
  1491. axios.get('http://127.0.0.1:9532/zh/api/outhopitaluncheck/get', {
  1492. params: params
  1493. })
  1494. .then(function(response) {
  1495. if (response.data.state == 0) {
  1496. that.$message.error(response.data.msg)
  1497. return false
  1498. } else {
  1499. if (response.data.data.failed_code == -10) {
  1500. // that.$message.error(response.data.data.msg)
  1501. that.$confirm(response.data.data.msg, '医保错误信息', {
  1502. confirmButtonText: '确 定',
  1503. type: 'warning'
  1504. }).then(() => {
  1505. }).catch(() => {
  1506. })
  1507. } else {
  1508. that.changeRadioAndPatient(1)
  1509. that.$message({ message: '撤销出院成功', type: 'success', duration: 5000 })
  1510. }
  1511. }
  1512. })
  1513. .catch(function(error) {
  1514. })
  1515. }).catch(() => {
  1516. })
  1517. }
  1518. } else if (index == 7) {
  1519. if (this.patientInfo.id == 0) {
  1520. this.$message({ message: '该选择要撤销入院的患者', type: 'error' })
  1521. return
  1522. }
  1523. if (this.hisPatientInfo.balance_accounts_type == 2) {
  1524. var that = this
  1525. this.$confirm('是否撤销入院', '撤销入院', {
  1526. confirmButtonText: '确 定',
  1527. cancelButtonText: '取 消',
  1528. type: 'warning'
  1529. }).then(() => {
  1530. let params = {
  1531. 'id': that.hisPatientInfo.id,
  1532. 'admin_user_id': this.$store.getters.xt_user.user.id
  1533. }
  1534. Inthopitaluncheck(params).then(response => {
  1535. if (response.data.state == 0) {
  1536. this.$message.error(response.data.msg)
  1537. return false
  1538. } else {
  1539. this.$message.success('撤销入院成功')
  1540. this.changeRadioAndPatient(1)
  1541. }
  1542. })
  1543. }).catch(() => {
  1544. })
  1545. } else {
  1546. var that = this
  1547. this.$confirm('是否撤销入院', '撤销入院', {
  1548. confirmButtonText: '确 定',
  1549. cancelButtonText: '取 消',
  1550. type: 'warning'
  1551. }).then(() => {
  1552. let params = {
  1553. 'id': that.hisPatientInfo.id,
  1554. 'admin_user_id': this.$store.getters.xt_user.user.id
  1555. }
  1556. axios.get('http://127.0.0.1:9532/zh/api/inthopitaluncheck/get', {
  1557. params: params
  1558. })
  1559. .then(function(response) {
  1560. if (response.data.state == 0) {
  1561. that.$message.error(response.data.msg)
  1562. return false
  1563. } else {
  1564. if (response.data.data.failed_code == -10) {
  1565. // that.$message.error(response.data.data.msg)
  1566. that.$confirm(response.data.data.msg, '医保错误信息', {
  1567. confirmButtonText: '确 定',
  1568. type: 'warning'
  1569. }).then(() => {
  1570. }).catch(() => {
  1571. })
  1572. } else {
  1573. that.changeRadioAndPatient(1)
  1574. that.$message({ message: '撤销入院成功', type: 'success', duration: 5000 })
  1575. }
  1576. }
  1577. })
  1578. .catch(function(error) {
  1579. })
  1580. }).catch(() => {
  1581. })
  1582. }
  1583. } else if (index == 10) {
  1584. var that = this
  1585. this.$confirm('是否退号', '退号', {
  1586. confirmButtonText: '确 定',
  1587. cancelButtonText: '取 消',
  1588. type: 'warning'
  1589. }).then(() => {
  1590. let params = {
  1591. 'patient_id': this.patientInfo.id,
  1592. 'record_time': this.record_date,
  1593. 'org_id': this.$store.getters.xt_user.org_id,
  1594. 'admin_user_id': this.$store.getters.xt_user.user.id
  1595. }
  1596. axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
  1597. params: params
  1598. })
  1599. .then(function(response) {
  1600. if (response.data.state == 0) {
  1601. that.$message.error(response.data.msg)
  1602. return false
  1603. } else {
  1604. if (response.data.data.failed_code == -10) {
  1605. // that.$message.error(response.data.data.msg)
  1606. that.$confirm(response.data.data.msg, '医保错误信息', {
  1607. confirmButtonText: '确 定',
  1608. type: 'warning'
  1609. }).then(() => {
  1610. }).catch(() => {
  1611. })
  1612. } else {
  1613. that.radio = 1
  1614. that.changeRadioAndPatient(1)
  1615. that.$message({ message: '退号成功', type: 'success', duration: 5000 })
  1616. }
  1617. }
  1618. })
  1619. .catch(function(error) {
  1620. })
  1621. }).catch(() => {
  1622. })
  1623. } else if (index == 11) {
  1624. let params = {
  1625. 'order_id': this.order.id,
  1626. 'number': this.order.number,
  1627. 'patient_id': this.patientInfo.id,
  1628. 'record_time': this.record_date,
  1629. 'org_id': this.$store.getters.xt_user.org_id
  1630. }
  1631. axios.get('http://127.0.0.1:9532/api/refunddetail/post', {
  1632. params: params
  1633. })
  1634. .then(function(response) {
  1635. if (response.data.state == 0) {
  1636. that.$message.error(response.data.msg)
  1637. that.loadingtwo = false
  1638. return false
  1639. } else {
  1640. // that.$message({ message: '退号成功', type: 'success' })
  1641. that.$message({ message: '退明细成功', type: 'success', duration: 5000 })
  1642. that.loadingtwo = false
  1643. }
  1644. })
  1645. .catch(function(error) {
  1646. })
  1647. } else if (index == 12) {
  1648. let params = {
  1649. 'name': '琥珀酸亚铁片',
  1650. 'codg': 'XB03AAH026A001010104942'
  1651. }
  1652. axios.get('http://127.0.0.1:9532/api/code/get', {
  1653. params: params
  1654. })
  1655. .then(function(response) {
  1656. if (response.data.state == 0) {
  1657. that.$message.error(response.data.msg)
  1658. that.loadingtwo = false
  1659. return false
  1660. } else {
  1661. that.loadingtwo = false
  1662. }
  1663. })
  1664. .catch(function(error) {
  1665. })
  1666. } else if (index == 13) {
  1667. let params = {
  1668. 'id': this.patientInfo.id,
  1669. 'record_time': this.record_date
  1670. }
  1671. axios.get('http://127.0.0.1:9532/api/record/put', {
  1672. params: params
  1673. })
  1674. .then(function(response) {
  1675. if (response.data.state == 0) {
  1676. that.$message.error(response.data.msg)
  1677. that.loadingtwo = false
  1678. return false
  1679. } else {
  1680. that.loadingtwo = false
  1681. }
  1682. })
  1683. .catch(function(error) {
  1684. })
  1685. } else if (index == 15) {
  1686. var that = this
  1687. 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) {
  1688. if (this.diagnosis.length || this.diagnosis == 0) {
  1689. that.$message.error('诊断不能为空,请选择诊断内容')
  1690. return
  1691. }
  1692. if (this.sick_type.length || this.sick_type == 0) {
  1693. that.$message.error('疾病类型不能为空,请选择疾病类型')
  1694. return
  1695. }
  1696. if (this.reg_type.length || this.reg_type == 0) {
  1697. that.$message.error('处方类型不能为空,请选择处方类型')
  1698. return
  1699. }
  1700. let params = {
  1701. 'id': that.patientInfo.id,
  1702. 'record_time': that.record_date,
  1703. 'diagnosis': that.diagnosis,
  1704. 'sick_type': that.sick_type,
  1705. 'reg_type': that.p_type
  1706. }
  1707. this.dise_loading = true
  1708. axios.get('http://127.0.0.1:9532/api/diag/upload', {
  1709. params: params
  1710. })
  1711. .then(function(response) {
  1712. if (response.data.state == 0) {
  1713. that.$message.error(response.data.msg)
  1714. that.dise_loading = false
  1715. return false
  1716. } else {
  1717. that.dise_loading = false
  1718. that.$message.success('上传成功')
  1719. }
  1720. })
  1721. .catch(function(error) {
  1722. })
  1723. }
  1724. } else if (index == 20) {
  1725. if (this.patientInfo.id == 0) {
  1726. this.$message({ message: '该选择要收费的患者', type: 'error' })
  1727. return
  1728. }
  1729. if (this.hisPatientInfo.id == 0) {
  1730. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  1731. return
  1732. }
  1733. let ids = []
  1734. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  1735. for (let a = 0; a < this.settle_prescriptions[i].advices.length; a++) {
  1736. ids.push(this.settle_prescriptions[i].advices[a].id)
  1737. }
  1738. for (let a = 0; a < this.settle_prescriptions[i].project.length; a++) {
  1739. ids.push(this.settle_prescriptions[i].project[a].id)
  1740. }
  1741. }
  1742. if (ids.length == 0) {
  1743. this.$message.error('请先到医生工作站开处方再来结算')
  1744. return
  1745. }
  1746. var form = {}
  1747. form['id'] = this.patientInfo.id
  1748. form['record_time'] = this.record_date
  1749. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  1750. form['org_id'] = this.$store.getters.xt_user.org_id
  1751. // if (this.activeName == 'first') {
  1752. // form['settle_accounts_type'] = 1
  1753. //
  1754. // } else {
  1755. // form['start_time'] = this.other_start_time
  1756. // form['end_time'] = this.other_end_time
  1757. // form['settle_accounts_type'] = 2
  1758. //
  1759. // }
  1760. this.loadingtwo = true
  1761. 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) {
  1762. var that = this
  1763. axios.get('http://127.0.0.1:9532/api/pre_upload/get', {
  1764. params: form
  1765. })
  1766. .then(function(response) {
  1767. if (response.data.state == 0) {
  1768. that.$message.error(response.data.msg)
  1769. that.loadingtwo = false
  1770. that.$refs.charge.hide()
  1771. return false
  1772. } else {
  1773. that.loadingtwo = false
  1774. that.state = '预结算'
  1775. that.$message({ message: '预结算成功', type: 'success' })
  1776. }
  1777. })
  1778. .catch(function(error) {
  1779. })
  1780. } else {
  1781. }
  1782. } else if (index == 21) {
  1783. if (this.patientInfo.id == 0) {
  1784. this.$message({ message: '该选择要收费的患者', type: 'error' })
  1785. return
  1786. }
  1787. if (this.hisPatientInfo.id == 0) {
  1788. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  1789. return
  1790. }
  1791. let ids = []
  1792. if (this.activeName == 'first') {
  1793. for (let i = 0; i < this.prescriptions.length; i++) {
  1794. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1795. ids.push(this.prescriptions[i].advices[a].id)
  1796. }
  1797. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  1798. ids.push(this.prescriptions[i].project[a].id)
  1799. }
  1800. }
  1801. if (ids.length == 0) {
  1802. this.$message.error('请先到医生工作站开处方再来结算')
  1803. return
  1804. }
  1805. } else {
  1806. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1807. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1808. ids.push(this.month_prescriptions[i].advices[a].id)
  1809. }
  1810. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  1811. ids.push(this.month_prescriptions[i].project[a].id)
  1812. }
  1813. }
  1814. if (ids.length == 0) {
  1815. this.$message.error('请先到医生工作站开处方再来结算')
  1816. return
  1817. }
  1818. }
  1819. if (this.activeName == 'first') {
  1820. this.$refs.charge.show(this.getTotal())
  1821. } else {
  1822. this.$refs.charge.show(this.getTotalTwo())
  1823. }
  1824. } else if (index == 8) {
  1825. var that = this
  1826. let params = {
  1827. 'in_hospital_id': that.hisPatientInfo.id,
  1828. 'id': that.patientInfo.id,
  1829. 'admin_user_id': that.$store.getters.xt_user.user.id,
  1830. 'record_time': that.record_date
  1831. }
  1832. if (this.activeName == 'first') {
  1833. params['settle_accounts_type'] = 1
  1834. } else {
  1835. params['start_time'] = that.other_start_time
  1836. params['end_time'] = that.other_end_time
  1837. params['settle_accounts_type'] = 2
  1838. }
  1839. axios.get('http://127.0.0.1:9532/zh/api/uploadinfo/get', {
  1840. params: params
  1841. })
  1842. .then(function(response) {
  1843. if (response.data.state == 0) {
  1844. that.$message.error(response.data.msg)
  1845. return false
  1846. } else {
  1847. if (response.data.data.failed_code == -10) {
  1848. // that.$message.error(response.data.data.msg)
  1849. that.$confirm(response.data.data.msg, '医保错误信息', {
  1850. confirmButtonText: '确 定',
  1851. type: 'warning'
  1852. }).then(() => {
  1853. }).catch(() => {
  1854. })
  1855. } else {
  1856. that.$message.success('上传明细成功')
  1857. that.changeRadioAndPatient(1)
  1858. }
  1859. }
  1860. })
  1861. .catch(function(error) {
  1862. })
  1863. } else if (index == 9) {
  1864. let settle_accounts_type = ''
  1865. if (this.activeName == 'first') {
  1866. settle_accounts_type = 1
  1867. } else {
  1868. settle_accounts_type = 2
  1869. }
  1870. var that = this
  1871. this.$confirm('是否撤销明细', '撤销明细', {
  1872. confirmButtonText: '确 定',
  1873. cancelButtonText: '取 消',
  1874. type: 'warning'
  1875. }).then(() => {
  1876. let params = {
  1877. 'settle_accounts_type': settle_accounts_type,
  1878. 'patient_id': that.patientInfo.id,
  1879. 'his_patient_id': that.hisPatientInfo.id,
  1880. 'record_time': that.record_date,
  1881. 'order_id': that.order.id,
  1882. 'admin_user_id': that.$store.getters.xt_user.user.id
  1883. }
  1884. axios.get('http://127.0.0.1:9532/zh/api/refunddetail', {
  1885. params: params
  1886. })
  1887. .then(function(response) {
  1888. if (response.data.state == 0) {
  1889. that.$message.error(response.data.msg)
  1890. that.loadingtwo = false
  1891. return false
  1892. } else {
  1893. if (response.data.data.failed_code == -10) {
  1894. // that.$message.error(response.data.data.msg)
  1895. that.$confirm(response.data.data.msg, '医保错误信息', {
  1896. confirmButtonText: '确 定',
  1897. type: 'warning'
  1898. }).then(() => {
  1899. }).catch(() => {
  1900. })
  1901. } else {
  1902. that.$message.success('撤销明细成功')
  1903. that.changeRadioAndPatient(1)
  1904. }
  1905. }
  1906. })
  1907. .catch(function(error) {
  1908. })
  1909. }).catch(() => {
  1910. })
  1911. } else if (index == 30) {
  1912. var that = this
  1913. let params = {
  1914. 'in_hospital_id': that.hisPatientInfo.id,
  1915. 'id': that.patientInfo.id,
  1916. 'admin_user_id': that.$store.getters.xt_user.user.id,
  1917. 'record_time': that.record_date
  1918. }
  1919. if (this.activeName == 'first') {
  1920. params['settle_accounts_type'] = 1
  1921. } else {
  1922. params['start_time'] = that.other_start_time
  1923. params['end_time'] = that.other_end_time
  1924. params['settle_accounts_type'] = 2
  1925. }
  1926. axios.get('http://127.0.0.1:9532/zh/api/uploadinfo/get', {
  1927. params: params
  1928. })
  1929. .then(function(response) {
  1930. if (response.data.state == 0) {
  1931. that.$message.error(response.data.msg)
  1932. return false
  1933. } else {
  1934. if (response.data.data.failed_code == -10) {
  1935. // that.$message.error(response.data.data.msg)
  1936. that.$confirm(response.data.data.msg, '医保错误信息', {
  1937. confirmButtonText: '确 定',
  1938. type: 'warning'
  1939. }).then(() => {
  1940. }).catch(() => {
  1941. })
  1942. } else {
  1943. that.$message.success('上传明细成功')
  1944. that.changeRadioAndPatient(1)
  1945. }
  1946. }
  1947. })
  1948. .catch(function(error) {
  1949. })
  1950. }
  1951. },
  1952. choosePatient() {
  1953. console.log(id)
  1954. this.radioStatus = id
  1955. this.getPatientList()
  1956. },
  1957. changeRadioAndPatient(id) {
  1958. // console.log(id)
  1959. // this.radioStatus = id
  1960. // this.getPatientList()
  1961. this.radio = id
  1962. let temp_id = id
  1963. let params = {
  1964. 'record_date': this.record_date
  1965. }
  1966. GetHisHospitalChargePatientList(params).then(response => {
  1967. if (response.data.state == 0) {
  1968. this.$message.error(response.data.msg)
  1969. return false
  1970. } else {
  1971. if (response.data.data.list == null) {
  1972. response.data.data.list = []
  1973. }
  1974. if (response.data.data.list_two == null) {
  1975. response.data.data.list_two = []
  1976. }
  1977. this.patientTableData = []
  1978. this.hisPatientDatas = []
  1979. this.all_table_data = []
  1980. let one_count = 0
  1981. let two_count = 0
  1982. let three_count = 0
  1983. for (let i = 0; i < response.data.data.list.length; i++) {
  1984. this.all_table_data.push(response.data.data.list[i])
  1985. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
  1986. one_count = one_count + 1
  1987. }
  1988. }
  1989. this.cal_one = one_count
  1990. this.cal_two = response.data.data.charge_list.length
  1991. // this.all_charge_table_data = response.data.data.charge_list
  1992. this.cal_three = three_count
  1993. switch (temp_id) {
  1994. case 1:
  1995. this.patientTableData = []
  1996. for (let i = 0; i < this.all_table_data.length; i++) {
  1997. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
  1998. this.patientTableData.push(this.all_table_data[i])
  1999. }
  2000. }
  2001. for (let i = 0; i < this.patientTableData.length; i++) {
  2002. if (this.patientInfo.id == this.patientTableData[i].patient_id) {
  2003. this.current_index = i
  2004. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  2005. this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
  2006. }
  2007. }
  2008. break
  2009. case 2:
  2010. this.chargePatientTableData = []
  2011. for (let i = 0; i < response.data.data.charge_list.length; i++) {
  2012. let obj = {
  2013. name: response.data.data.charge_list[i].patient.name,
  2014. id: response.data.data.charge_list[i].patient.id,
  2015. number: response.data.data.charge_list[i].number,
  2016. his_patient_id: response.data.data.charge_list[i].his_patient.id,
  2017. his_number: response.data.data.charge_list[i].mdtrt_id
  2018. }
  2019. this.chargePatientTableData.push(obj)
  2020. }
  2021. this.all_charge_table_data = this.chargePatientTableData
  2022. for (let i = 0; i < this.chargePatientTableData.length; i++) {
  2023. if (this.patientInfo.id == this.chargePatientTableData[i].id) {
  2024. this.current_index = i
  2025. this.$refs.tab.setCurrentRow(this.chargePatientTableData[i])
  2026. this.getPatientInformation(this.chargePatientTableData[i].id, this.chargePatientTableData[i].number, this.chargePatientTableData[i].his_patient_id)
  2027. }
  2028. }
  2029. break
  2030. // case 3:
  2031. // this.patientTableData = [];
  2032. //
  2033. // if (this.activeName == 'first') {
  2034. //
  2035. // for (let i = 0; i < this.all_table_data.length; i++) {
  2036. //
  2037. // if (this.all_table_data[i].his_patient.order.order_status == 3) {
  2038. // this.patientTableData.push(this.all_table_data[i])
  2039. // }
  2040. //
  2041. // }
  2042. // } else {
  2043. //
  2044. // for (let i = 0; i < this.hisPatientDatas.length; i++) {
  2045. //
  2046. // if (this.hisPatientDatas[i].his_patient.order.order_status == 3) {
  2047. // this.patientTableData.push(this.hisPatientDatas[i])
  2048. // }
  2049. //
  2050. // }
  2051. //
  2052. // }
  2053. // break;
  2054. // case 4:
  2055. // this.patientTableData = [];
  2056. // if (this.activeName == 'first') {
  2057. //
  2058. // this.patientTableData = this.all_table_data
  2059. // } else {
  2060. //
  2061. // this.patientTableData = this.hisPatientDatas
  2062. // }
  2063. // break
  2064. }
  2065. }
  2066. })
  2067. },
  2068. changeRadio(id) {
  2069. // console.log(id)
  2070. // this.radioStatus = id
  2071. // this.getPatientList()
  2072. let temp_id = id
  2073. let params = {
  2074. 'record_date': this.record_date
  2075. }
  2076. GetHisHospitalChargePatientList(params).then(response => {
  2077. if (response.data.state == 0) {
  2078. this.$message.error(response.data.msg)
  2079. return false
  2080. } else {
  2081. if (response.data.data.list == null) {
  2082. response.data.data.list = []
  2083. }
  2084. if (response.data.data.list_two == null) {
  2085. response.data.data.list_two = []
  2086. }
  2087. this.patientTableData = []
  2088. this.all_table_data = []
  2089. this.hisPatientDatas = []
  2090. let one_count = 0
  2091. let two_count = 0
  2092. let three_count = 0
  2093. for (let i = 0; i < response.data.data.list.length; i++) {
  2094. this.all_table_data.push(response.data.data.list[i])
  2095. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
  2096. one_count = one_count + 1
  2097. }
  2098. }
  2099. this.hisPatientDatas = response.data.data.list_two
  2100. this.cal_one = one_count
  2101. this.cal_two = response.data.data.charge_list.length
  2102. // this.all_charge_table_data = response.data.data.charge_list
  2103. this.current_index = 0
  2104. switch (this.radio) {
  2105. case 1:
  2106. this.patientTableData = []
  2107. for (let i = 0; i < this.all_table_data.length; i++) {
  2108. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1 || this.all_table_data[i].order.order_status == 3) {
  2109. this.patientTableData.push(this.all_table_data[i])
  2110. }
  2111. }
  2112. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  2113. this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].order.number, this.patientTableData[0].id)
  2114. break
  2115. case 2:
  2116. this.chargePatientTableData = []
  2117. for (let i = 0; i < response.data.data.charge_list.length; i++) {
  2118. let obj = {
  2119. name: response.data.data.charge_list[i].patient.name,
  2120. id: response.data.data.charge_list[i].patient.id,
  2121. number: response.data.data.charge_list[i].number,
  2122. his_patient_id: response.data.data.charge_list[i].his_patient.id,
  2123. his_number: response.data.data.charge_list[i].mdtrt_id
  2124. }
  2125. this.chargePatientTableData.push(obj)
  2126. }
  2127. this.all_charge_table_data = this.chargePatientTableData
  2128. this.$refs.tab.setCurrentRow(this.chargePatientTableData[0])
  2129. this.getPatientInformation(this.chargePatientTableData[0].id, this.chargePatientTableData[0].number, this.chargePatientTableData[0].his_patient_id)
  2130. break
  2131. // case 3:
  2132. // this.patientTableData = [];
  2133. //
  2134. // for (let i = 0; i < this.all_table_data.length; i++) {
  2135. //
  2136. // if (this.all_table_data[i].his_patient.order.order_status == 3) {
  2137. // this.patientTableData.push(this.all_table_data[i])
  2138. // }
  2139. //
  2140. // }
  2141. // break;
  2142. // case 4:
  2143. // this.patientTableData = [];
  2144. // this.patientTableData = this.all_table_data;
  2145. // break
  2146. }
  2147. }
  2148. })
  2149. },
  2150. formatDecimal(num, decimal) {
  2151. num = num.toString()
  2152. let index = num.indexOf('.')
  2153. if (index !== -1) {
  2154. num = num.substring(0, decimal + index + 1)
  2155. } else {
  2156. num = num.substring(0)
  2157. }
  2158. return parseFloat(num).toFixed(decimal)
  2159. },
  2160. //患者列表
  2161. getPatientList() {
  2162. let params = {
  2163. 'record_date': this.record_date
  2164. }
  2165. GetHisHospitalChargePatientList(params).then(response => {
  2166. if (response.data.state == 0) {
  2167. this.$message.error(response.data.msg)
  2168. return false
  2169. } else {
  2170. if (response.data.data.list == null) {
  2171. response.data.data.list = []
  2172. }
  2173. if (response.data.data.list_two == null) {
  2174. response.data.data.list_two = []
  2175. }
  2176. this.patientTableData = []
  2177. this.all_table_data = []
  2178. this.hisPatientDatas = []
  2179. let one_count = 0
  2180. let two_count = 0
  2181. let three_count = 0
  2182. for (let i = 0; i < response.data.data.list.length; i++) {
  2183. this.all_table_data.push(response.data.data.list[i])
  2184. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
  2185. one_count = one_count + 1
  2186. }
  2187. }
  2188. this.hisPatientDatas = response.data.data.list_two
  2189. this.cal_one = one_count
  2190. this.cal_two = response.data.data.charge_list.length
  2191. // this.all_charge_table_data = response.data.data.charge_list
  2192. this.current_index = 0
  2193. switch (this.radio) {
  2194. case 1:
  2195. this.patientTableData = []
  2196. for (let i = 0; i < this.all_table_data.length; i++) {
  2197. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1 || this.all_table_data[i].order.order_status == 3) {
  2198. this.patientTableData.push(this.all_table_data[i])
  2199. }
  2200. }
  2201. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  2202. this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].order.number, this.patientTableData[0].id)
  2203. break
  2204. case 2:
  2205. this.chargePatientTableData = []
  2206. for (let i = 0; i < response.data.data.charge_list.length; i++) {
  2207. let obj = {
  2208. name: response.data.data.charge_list[i].patient.name,
  2209. id: response.data.data.charge_list[i].patient.id,
  2210. number: response.data.data.charge_list[i].number,
  2211. his_patient_id: response.data.data.charge_list[i].his_patient.id,
  2212. his_number: response.data.data.charge_list[i].mdtrt_id
  2213. }
  2214. this.chargePatientTableData.push(obj)
  2215. }
  2216. this.all_charge_table_data = this.chargePatientTableData
  2217. this.$refs.tab.setCurrentRow(this.chargePatientTableData[0])
  2218. this.getPatientInformation(this.chargePatientTableData[0].id, this.chargePatientTableData[0].number, this.patientTableData[0].his_patient_id)
  2219. break
  2220. // case 3:
  2221. // this.patientTableData = [];
  2222. //
  2223. // for (let i = 0; i < this.all_table_data.length; i++) {
  2224. //
  2225. // if (this.all_table_data[i].his_patient.order.order_status == 3) {
  2226. // this.patientTableData.push(this.all_table_data[i])
  2227. // }
  2228. //
  2229. // }
  2230. // break;
  2231. // case 4:
  2232. // this.patientTableData = [];
  2233. // this.patientTableData = this.all_table_data;
  2234. // break
  2235. }
  2236. }
  2237. })
  2238. },
  2239. setMonthPrescription(month_prescriptions) {
  2240. this.month_prescriptions = []
  2241. let drug_month_prescriptions = {
  2242. advices: []
  2243. }
  2244. let drug_ids = []
  2245. let project_month_prescriptions = {
  2246. project: []
  2247. }
  2248. let project_ids = []
  2249. let addition_month_prescriptions = {
  2250. addition: []
  2251. }
  2252. let additions_ids = []
  2253. for (let i = 0; i < month_prescriptions.length; i++) {
  2254. if (month_prescriptions[i].type == 1) { //药品
  2255. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  2256. let obj = {
  2257. id: month_prescriptions[i].advices[a].drug_id,
  2258. price: month_prescriptions[i].advices[a].price
  2259. }
  2260. drug_ids.push(obj)
  2261. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  2262. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  2263. }
  2264. } else if (month_prescriptions[i].type == 2) { //项目
  2265. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  2266. let obj = {
  2267. id: month_prescriptions[i].project[a].project_id,
  2268. price: month_prescriptions[i].project[a].price
  2269. }
  2270. project_ids.push(obj)
  2271. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  2272. }
  2273. }
  2274. }
  2275. drug_ids = this.unique_two(drug_ids)
  2276. project_ids = this.unique_two(project_ids)
  2277. additions_ids = this.unique_two(additions_ids)
  2278. let drugs = []
  2279. let projects = []
  2280. let additions = []
  2281. for (let i = 0; i < drug_ids.length; i++) {
  2282. let obj = {}
  2283. let count = 0
  2284. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  2285. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  2286. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  2287. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  2288. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  2289. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  2290. obj['day'] = drug_month_prescriptions.advices[a].day
  2291. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  2292. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  2293. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  2294. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  2295. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  2296. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  2297. count = count + drug_month_prescriptions.advices[a].prescribing_number
  2298. }
  2299. }
  2300. obj['prescribing_number'] = count
  2301. drugs.push(obj)
  2302. }
  2303. for (let i = 0; i < project_ids.length; i++) {
  2304. let obj = {}
  2305. let count = 0
  2306. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  2307. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  2308. if (project_month_prescriptions.project[a].type == 2) {
  2309. obj['statistical_classification'] = ''
  2310. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  2311. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  2312. obj['type'] = 2
  2313. } else if (project_month_prescriptions.project[a].type == 3) {
  2314. obj['statistical_classification'] = ''
  2315. obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
  2316. obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
  2317. obj['type'] = 3
  2318. }
  2319. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name;
  2320. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification;
  2321. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  2322. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  2323. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  2324. obj['number_days'] = project_month_prescriptions.project[a].day
  2325. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code;
  2326. obj['unit'] = project_month_prescriptions.project[a].unit
  2327. obj['project_id'] = project_month_prescriptions.project[a].project_id
  2328. count = count + parseFloat(project_month_prescriptions.project[a].count)
  2329. // price = price + project_month_prescriptions.project[a].price
  2330. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  2331. }
  2332. }
  2333. obj['total'] = count
  2334. projects.push(obj)
  2335. }
  2336. let p1 = {
  2337. name: '处方' + 1,
  2338. advices: drugs,
  2339. project: [],
  2340. type: 1,
  2341. addition: additions
  2342. }
  2343. let p2 = {
  2344. name: '处方' + 2,
  2345. type: 2,
  2346. project: projects,
  2347. advices: [],
  2348. addition: []
  2349. }
  2350. this.month_prescriptions.push(p1)
  2351. this.month_prescriptions.push(p2)
  2352. this.curMonthPrescriptions = this.month_prescriptions[0]
  2353. },
  2354. setSettlePrescriptionTwo(month_prescriptions) {
  2355. this.settle_prescriptions = []
  2356. for (let i = 0; i < month_prescriptions.length; i++) {
  2357. var prescription = month_prescriptions[i]
  2358. let tempAdvice = []
  2359. let tempProject = []
  2360. let tempAddition = []
  2361. for (let b = 0; b < prescription.advices.length; b++) {
  2362. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  2363. let obj = {
  2364. advice_id: prescription.advices[b].id,
  2365. drug_name: prescription.advices[b].advice_name,
  2366. single_dose: prescription.advices[b].single_dose,
  2367. delivery_way: prescription.advices[b].delivery_way,
  2368. execution_frequency: prescription.advices[b].execution_frequency,
  2369. retail_price: prescription.advices[b].price.toString(),
  2370. remark: prescription.advices[b].remark,
  2371. day: prescription.advices[b].day,
  2372. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2373. single_dose_unit: prescription.advices[b].single_dose_unit,
  2374. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2375. medical_insurance_number: prescription.advices[b].med_list_codg,
  2376. code: prescription.advices[b].drug.medical_insurance_number,
  2377. spec: spec,
  2378. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  2379. name_id: prescription.advices[b].drug.manufacturer,
  2380. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
  2381. overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
  2382. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
  2383. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt
  2384. }
  2385. tempAdvice.push(obj)
  2386. }
  2387. for (let b = 0; b < prescription.project.length; b++) {
  2388. let obj = {
  2389. id: prescription.project[b].id,
  2390. project_id: prescription.project[b].project.id,
  2391. // project_name: prescription.project[b].project.project_name,
  2392. // statistical_classification: prescription.project[b].project.statistical_classification,
  2393. single_dose: prescription.project[b].single_dose,
  2394. delivery_way: prescription.project[b].delivery_way,
  2395. execution_frequency: prescription.project[b].execution_frequency,
  2396. number_days: prescription.project[b].day,
  2397. total: prescription.project[b].count.toString(),
  2398. price: prescription.project[b].price,
  2399. remark: prescription.project[b].remark,
  2400. // medical_code: prescription.project[b].project.medical_code,
  2401. unit: prescription.project[b].project.unit,
  2402. type: prescription.project[b].type,
  2403. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
  2404. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
  2405. overlmt_amt: prescription.project[b].order_info.overlmt_amt,
  2406. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
  2407. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt
  2408. }
  2409. if (prescription.project[b].type == 2) {
  2410. obj['statistical_classification'] = prescription.project[b].team.project_team
  2411. obj['medical_code'] = prescription.project[b].project.medical_code
  2412. obj['project_name'] = prescription.project[b].project.project_name
  2413. obj['spec'] = ''
  2414. obj['name_id'] = 0
  2415. } else if (prescription.project[b].type == 3) {
  2416. obj['statistical_classification'] = prescription.project[b].team.project_team
  2417. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2418. obj['project_name'] = prescription.project[b].good_info.good_name
  2419. obj['spec'] = prescription.project[b].good_info.specification_name
  2420. obj['name_id'] = prescription.project[b].good_info.manufacturer
  2421. }
  2422. tempProject.push(obj)
  2423. }
  2424. let index = i + 1
  2425. let obj = {
  2426. id: prescription.id,
  2427. name: '处方' + index,
  2428. advices: tempAdvice,
  2429. project: tempProject,
  2430. addition: tempAddition,
  2431. order_status: prescription.order_status,
  2432. type: prescription.type
  2433. }
  2434. this.settle_prescriptions.push(obj)
  2435. this.curSettlePrescriptions = this.settle_prescriptions[0]
  2436. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  2437. if (this.settle_prescriptions[i].order_status != 4) {
  2438. this.isShowUpload = 2
  2439. }
  2440. }
  2441. }
  2442. },
  2443. setSettlePrescription(month_prescriptions) {
  2444. this.settle_prescriptions = []
  2445. let drug_month_prescriptions = {
  2446. advices: []
  2447. }
  2448. let drug_ids = []
  2449. let project_month_prescriptions = {
  2450. project: []
  2451. }
  2452. let project_ids = []
  2453. let addition_month_prescriptions = {
  2454. addition: []
  2455. }
  2456. let additions_ids = []
  2457. for (let i = 0; i < month_prescriptions.length; i++) {
  2458. if (month_prescriptions[i].type == 1) { //药品
  2459. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  2460. let obj = {
  2461. id: month_prescriptions[i].advices[a].drug_id,
  2462. price: month_prescriptions[i].advices[a].price
  2463. }
  2464. drug_ids.push(obj)
  2465. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  2466. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  2467. }
  2468. } else if (month_prescriptions[i].type == 2) { //项目
  2469. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  2470. let obj = {
  2471. id: month_prescriptions[i].project[a].project_id,
  2472. price: month_prescriptions[i].project[a].price
  2473. }
  2474. project_ids.push(obj)
  2475. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  2476. }
  2477. }
  2478. }
  2479. drug_ids = this.unique_two(drug_ids)
  2480. project_ids = this.unique_two(project_ids)
  2481. additions_ids = this.unique_two(additions_ids)
  2482. let drugs = []
  2483. let projects = []
  2484. let additions = []
  2485. for (let i = 0; i < drug_ids.length; i++) {
  2486. let obj = {}
  2487. let count = 0
  2488. let fulamt_ownpay_amt = 0
  2489. let overlmt_amt = 0
  2490. let inscp_scp_amt = 0
  2491. let preselfpay_amt = 0
  2492. let day = 0
  2493. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  2494. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  2495. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  2496. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  2497. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  2498. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  2499. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  2500. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  2501. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  2502. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  2503. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  2504. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  2505. obj['code'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  2506. count = count + drug_month_prescriptions.advices[a].prescribing_number
  2507. fulamt_ownpay_amt = fulamt_ownpay_amt + drug_month_prescriptions.advices[a].order_info.fulamt_ownpay_amt
  2508. overlmt_amt = overlmt_amt + drug_month_prescriptions.advices[a].order_info.overlmt_amt
  2509. inscp_scp_amt = inscp_scp_amt + drug_month_prescriptions.advices[a].order_info.inscp_scp_amt
  2510. preselfpay_amt = preselfpay_amt + drug_month_prescriptions.advices[a].order_info.preselfpay_amt
  2511. // day =day + parseNumber(drug_month_prescriptions.advices[a].day)
  2512. }
  2513. }
  2514. obj['prescribing_number'] = count
  2515. obj['day'] = day
  2516. obj['fulamt_ownpay_amt'] = fulamt_ownpay_amt.toFixed(2)
  2517. obj['overlmt_amt'] = overlmt_amt.toFixed(2)
  2518. obj['inscp_scp_amt'] = inscp_scp_amt.toFixed(2)
  2519. obj['preselfpay_amt'] =preselfpay_amt.toFixed(2)
  2520. drugs.push(obj)
  2521. }
  2522. for (let i = 0; i < project_ids.length; i++) {
  2523. let obj = {}
  2524. let count = 0
  2525. let fulamt_ownpay_amt = 0
  2526. let overlmt_amt = 0
  2527. let inscp_scp_amt = 0
  2528. let preselfpay_amt = 0
  2529. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  2530. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  2531. if (project_month_prescriptions.project[a].type == 2) {
  2532. obj['statistical_classification'] = ''
  2533. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  2534. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  2535. obj['type'] = 2
  2536. } else if (project_month_prescriptions.project[a].type == 3) {
  2537. obj['statistical_classification'] = ''
  2538. obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
  2539. obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
  2540. obj['type'] = 3
  2541. }
  2542. // obj['fulamt_ownpay_amt'] = project_month_prescriptions.project[a].order_info.fulamt_ownpay_amt
  2543. // obj['overlmt_amt'] = project_month_prescriptions.project[a].order_info.overlmt_amt
  2544. // obj['inscp_scp_amt'] = project_month_prescriptions.project[a].order_info.inscp_scp_amt
  2545. // obj['preselfpay_amt'] = project_month_prescriptions.project[a].order_info.preselfpay_amt
  2546. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name;
  2547. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification;
  2548. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  2549. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  2550. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  2551. obj['number_days'] = project_month_prescriptions.project[a].day
  2552. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code;
  2553. obj['unit'] = project_month_prescriptions.project[a].unit
  2554. obj['project_id'] = project_month_prescriptions.project[a].project_id
  2555. count = count + parseFloat(project_month_prescriptions.project[a].count)
  2556. // price = price + project_month_prescriptions.project[a].price
  2557. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  2558. fulamt_ownpay_amt = fulamt_ownpay_amt +project_month_prescriptions.project[a].order_info.fulamt_ownpay_amt
  2559. overlmt_amt = overlmt_amt +project_month_prescriptions.project[a].order_info.overlmt_amt
  2560. inscp_scp_amt = inscp_scp_amt + project_month_prescriptions.project[a].order_info.inscp_scp_amt
  2561. preselfpay_amt = preselfpay_amt + project_month_prescriptions.project[a].order_info.preselfpay_amt
  2562. }
  2563. }
  2564. obj['fulamt_ownpay_amt'] = fulamt_ownpay_amt.toFixed(2)
  2565. obj['overlmt_amt'] = overlmt_amt.toFixed(2)
  2566. obj['inscp_scp_amt'] = inscp_scp_amt.toFixed(2)
  2567. obj['preselfpay_amt'] = preselfpay_amt.toFixed(2)
  2568. obj['total'] = count
  2569. projects.push(obj)
  2570. }
  2571. let p1 = {
  2572. name: '处方' + 1,
  2573. advices: drugs,
  2574. project: [],
  2575. type: 1,
  2576. addition: additions
  2577. }
  2578. let p2 = {
  2579. name: '处方' + 2,
  2580. type: 2,
  2581. project: projects,
  2582. advices: [],
  2583. addition: []
  2584. }
  2585. this.settle_prescriptions.push(p1)
  2586. this.settle_prescriptions.push(p2)
  2587. this.curSettlePrescriptions = this.settle_prescriptions[0]
  2588. },
  2589. unique_patient(array) {
  2590. // res用来存储结果
  2591. var res = []
  2592. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2593. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2594. if (array[i].patient_id === res[j].patient_id) {
  2595. break
  2596. }
  2597. }
  2598. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2599. if (j === resLen) {
  2600. res.push(array[i])
  2601. }
  2602. }
  2603. return res
  2604. },
  2605. unique_two(array) {
  2606. // res用来存储结果
  2607. var res = []
  2608. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2609. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2610. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  2611. break
  2612. }
  2613. }
  2614. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2615. if (j === resLen) {
  2616. res.push(array[i])
  2617. }
  2618. }
  2619. return res
  2620. },
  2621. unique(arr) {
  2622. const res = new Map()
  2623. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  2624. },
  2625. handleCurrentChange(val) {
  2626. console.log(val)
  2627. this.curPrescriptions = {}
  2628. this.curMonthPrescriptions = {}
  2629. this.prescriptions = []
  2630. this.month_prescriptions = []
  2631. if (this.radio == 1) {
  2632. this.getPatientInformation(val.patient_id, val.order.number, val.id)
  2633. } else {
  2634. this.getPatientInformation(val.id, val.number, val.his_patient_id)
  2635. }
  2636. this.patient_id = val.id
  2637. for (let i = 0; i < this.patientTableData.length; i++) {
  2638. if (this.patientTableData[i].id == val.id) {
  2639. this.current_index = i
  2640. }
  2641. }
  2642. },
  2643. //获取患者的基本信息
  2644. getPatientInformation(id, batch_number, his_patient_id) {
  2645. let params = {
  2646. 'his_patient_id': his_patient_id,
  2647. 'record_date': this.record_date,
  2648. 'patient_id': id,
  2649. 'number': batch_number,
  2650. 'start_time': this.other_start_time,
  2651. 'end_time': this.other_end_time,
  2652. 'type': this.radio,
  2653. 'p_type': 1
  2654. }
  2655. this.loading = true
  2656. GetHisHospitalChargePatientInfo(params).then(response => {
  2657. if (response.data.state == 0) {
  2658. this.loading = false
  2659. this.$message.error(response.data.msg)
  2660. return false
  2661. } else {
  2662. this.prescriptions = []
  2663. this.month_prescriptions = []
  2664. this.curPrescriptions = {}
  2665. this.curMonthPrescriptions = {}
  2666. this.settle_prescriptions = []
  2667. this.curSettlePrescriptions = {}
  2668. this.loading = false
  2669. this.patientInfo = response.data.data.xt_info
  2670. this.hisPatientInfo = response.data.data.his_info
  2671. this.info = response.data.data.info
  2672. this.order = response.data.data.order
  2673. this.p_type = ''
  2674. this.sick_type = ''
  2675. this.diagnosis = ''
  2676. this.sick_history = ''
  2677. if (this.info.id > 0) {
  2678. this.p_type = this.info.register_type
  2679. this.sick_type = this.info.sick_type
  2680. this.diagnosis = this.info.diagnosis
  2681. this.sick_history = this.info.sick_history
  2682. if (this.info.register_type == 0) {
  2683. this.p_type = ''
  2684. }
  2685. if (this.info.sick_type == 0) {
  2686. this.sick_type = ''
  2687. }
  2688. if (this.info.diagnosis == 0) {
  2689. this.diagnosis = ''
  2690. }
  2691. } else {
  2692. this.p_type = ''
  2693. this.sick_type = ''
  2694. this.diagnosis = ''
  2695. this.sick_history = ''
  2696. }
  2697. this.addtions_charge = response.data.data.addtions_charge
  2698. this.setMonthPrescription(response.data.data.month_prescriptions)
  2699. this.setSettlePrescription(response.data.data.settle_prescriptions)
  2700. if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
  2701. this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
  2702. } else {
  2703. this.prescription_id = 0
  2704. }
  2705. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2706. var prescription = response.data.data.prescription[i]
  2707. let tempAdvice = []
  2708. let tempProject = []
  2709. let tempAddition = []
  2710. for (let b = 0; b < prescription.advices.length; b++) {
  2711. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  2712. let obj = {
  2713. advice_id: prescription.advices[b].id,
  2714. drug_name: prescription.advices[b].advice_name,
  2715. single_dose: prescription.advices[b].single_dose,
  2716. delivery_way: prescription.advices[b].delivery_way,
  2717. execution_frequency: prescription.advices[b].execution_frequency,
  2718. retail_price: prescription.advices[b].price.toString(),
  2719. remark: prescription.advices[b].remark,
  2720. day: prescription.advices[b].day,
  2721. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2722. single_dose_unit: prescription.advices[b].single_dose_unit,
  2723. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2724. medical_insurance_number: prescription.advices[b].med_list_codg,
  2725. code: prescription.advices[b].drug.medical_insurance_number,
  2726. spec: spec,
  2727. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  2728. name_id: prescription.advices[b].drug.manufacturer,
  2729. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt * prescription.advices[b].prescribing_number,
  2730. overlmt_amt: prescription.advices[b].order_info.overlmt_amt * prescription.advices[b].prescribing_number,
  2731. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt * prescription.advices[b].prescribing_number,
  2732. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt * prescription.advices[b].prescribing_number
  2733. }
  2734. tempAdvice.push(obj)
  2735. }
  2736. for (let b = 0; b < prescription.project.length; b++) {
  2737. let obj = {
  2738. id: prescription.project[b].id,
  2739. project_id: prescription.project[b].project.id,
  2740. // project_name: prescription.project[b].project.project_name,
  2741. // statistical_classification: prescription.project[b].project.statistical_classification,
  2742. single_dose: prescription.project[b].single_dose,
  2743. delivery_way: prescription.project[b].delivery_way,
  2744. execution_frequency: prescription.project[b].execution_frequency,
  2745. number_days: prescription.project[b].day,
  2746. total: prescription.project[b].count.toString(),
  2747. price: prescription.project[b].price,
  2748. remark: prescription.project[b].remark,
  2749. // medical_code: prescription.project[b].project.medical_code,
  2750. unit: prescription.project[b].project.unit,
  2751. type: prescription.project[b].type,
  2752. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt * prescription.project[b].count,
  2753. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt * prescription.project[b].count,
  2754. overlmt_amt: prescription.project[b].order_info.overlmt_amt * prescription.project[b].count,
  2755. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt * prescription.project[b].count,
  2756. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt * prescription.project[b].count
  2757. }
  2758. if (prescription.project[b].type == 2) {
  2759. obj['statistical_classification'] = prescription.project[b].team.project_team
  2760. obj['medical_code'] = prescription.project[b].project.medical_code
  2761. obj['project_name'] = prescription.project[b].project.project_name
  2762. obj['spec'] = ''
  2763. obj['name_id'] = 0
  2764. } else if (prescription.project[b].type == 3) {
  2765. obj['statistical_classification'] = prescription.project[b].team.project_team
  2766. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2767. obj['project_name'] = prescription.project[b].good_info.good_name
  2768. obj['spec'] = prescription.project[b].good_info.specification_name
  2769. obj['name_id'] = prescription.project[b].good_info.manufacturer
  2770. }
  2771. tempProject.push(obj)
  2772. }
  2773. let index = i + 1
  2774. let obj = {
  2775. id: prescription.id,
  2776. name: '处方' + index,
  2777. advices: tempAdvice,
  2778. project: tempProject,
  2779. addition: tempAddition,
  2780. order_status: prescription.order_status,
  2781. type: prescription.type
  2782. }
  2783. this.prescriptions.push(obj)
  2784. for (let i = 0; i < this.prescriptions.length; i++) {
  2785. if (this.prescriptions[i].order_status != 4) {
  2786. this.isShowUpload = 2
  2787. }
  2788. }
  2789. }
  2790. if (this.prescriptions.length > 0) {
  2791. this.curPrescriptions = this.prescriptions[0]
  2792. } else {
  2793. this.curPrescriptions = {}
  2794. }
  2795. if (this.month_prescriptions.length > 0) {
  2796. this.curMonthPrescriptions = this.month_prescriptions[0]
  2797. } else {
  2798. this.curMonthPrescriptions = {}
  2799. }
  2800. // this.total = 0
  2801. this.total = this.getTotalOne()
  2802. // this.month_total = this.getMonthTotalOne()
  2803. this.settle_total = response.data.data.settle_total
  2804. }
  2805. })
  2806. },
  2807. invoicePrint(obj) {
  2808. console.log(this.hisPatientInfo)
  2809. let paramsObj = {
  2810. order_id: this.hisPatientInfo.id,
  2811. patient_id: this.hisPatientInfo.patient_id,
  2812. record_time: this.record_date,
  2813. name: this.hisPatientInfo.name,
  2814. gend: this.hisPatientInfo.gend,
  2815. setl_time: this.hisPatientInfo.out_hosptial_time
  2816. }
  2817. this.invoiceParams = paramsObj
  2818. this.invoiceVisible = true
  2819. }
  2820. },
  2821. mounted() {
  2822. const that = this
  2823. window.onresize = () => {
  2824. return (() => {
  2825. window.fullHeight = document.documentElement.clientHeight
  2826. that.fullHeight = window.fullHeight
  2827. })()
  2828. }
  2829. },
  2830. watch: {
  2831. fullHeight(val) {
  2832. if (!this.timer) {
  2833. this.fullHeight = val
  2834. let tableHeight = val - 243
  2835. this.tableHeight = tableHeight
  2836. this.timer = true
  2837. let that = this
  2838. setTimeout(function() {
  2839. that.timer = false
  2840. }, 400)
  2841. }
  2842. }
  2843. }
  2844. }
  2845. </script>
  2846. <style lang="scss" scoped>
  2847. .app-container {
  2848. height: 100%;
  2849. }
  2850. .outpatientChargesManagement {
  2851. height: 100%;
  2852. display: flex;
  2853. flex-direction: column;
  2854. .mainLeft {
  2855. width: 200px;
  2856. height: 100%;
  2857. display: flex;
  2858. flex-direction: column;
  2859. padding-top: 20px;
  2860. .el-radio {
  2861. margin-right: 5px;
  2862. }
  2863. }
  2864. .mainCell {
  2865. height: 36px;
  2866. display: flex;
  2867. align-items: center;
  2868. }
  2869. .fixedCell {
  2870. position: fixed;
  2871. z-index: 99;
  2872. right: 42px;
  2873. background: #fff;
  2874. display: flex;
  2875. justify-content: space-between;
  2876. }
  2877. .mainRight {
  2878. margin-left: 10px;
  2879. flex: 1;
  2880. height: 100%;
  2881. display: flex;
  2882. flex-direction: column;
  2883. overflow-y: auto;
  2884. .cellSpan {
  2885. min-width: 80px;
  2886. display: inline-block;
  2887. margin-right: 10px;
  2888. }
  2889. }
  2890. .tabsBox {
  2891. position: relative;
  2892. height: 90%;
  2893. overflow-y: auto;
  2894. margin-bottom: 60px;
  2895. .el-tabs__item {
  2896. padding: 0 10px;
  2897. }
  2898. }
  2899. .addTab {
  2900. position: absolute;
  2901. right: 6px;
  2902. top: 3px;
  2903. z-index: 20;
  2904. }
  2905. .mainCenter {
  2906. display: flex;
  2907. flex: 1;
  2908. height: 100%;
  2909. }
  2910. .costBox {
  2911. width: 100%;
  2912. height: 60px;
  2913. background: #fff;
  2914. position: absolute;
  2915. bottom: 0;
  2916. display: flex;
  2917. align-items: center;
  2918. justify-content: space-between;
  2919. }
  2920. .centerLeft {
  2921. flex: 1;
  2922. display: flex;
  2923. flex-direction: column;
  2924. position: relative;
  2925. }
  2926. .preTabs {
  2927. height: 100%;
  2928. display: flex;
  2929. flex-direction: column;
  2930. .el-tab-pane {
  2931. height: auto !important;
  2932. }
  2933. }
  2934. .settlementTabs {
  2935. flex: 1;
  2936. .el-tab-pane {
  2937. height: 100%;
  2938. }
  2939. .el-tabs__content {
  2940. height: 100%;
  2941. }
  2942. }
  2943. .centerRight {
  2944. width: 300px;
  2945. margin-left: 10px;
  2946. display: flex;
  2947. flex-direction: column;
  2948. overflow-y: auto;
  2949. }
  2950. .RP {
  2951. color: #409EFF;
  2952. font-size: 20px;
  2953. margin-bottom: 5px;
  2954. }
  2955. .centerRightTitle {
  2956. color: #409EFF;
  2957. }
  2958. .basicUl {
  2959. border-top: 1px solid #e5e5e5;
  2960. border-left: 1px solid #e5e5e5;
  2961. display: flex;
  2962. flex-wrap: wrap;
  2963. li {
  2964. border-bottom: 1px solid #e5e5e5;
  2965. border-right: 1px solid #e5e5e5;
  2966. width: 100%;
  2967. min-height: 38px;
  2968. /* line-height: 38px;
  2969. text-indent: 5px; */
  2970. font-size: 14px;
  2971. display: flex;
  2972. align-items: center;
  2973. padding: 5px;
  2974. box-sizing: border-box;
  2975. }
  2976. }
  2977. }
  2978. </style>
  2979. <style lang="scss">
  2980. #tab-more {
  2981. .el-icon-close {
  2982. display: none;
  2983. }
  2984. }
  2985. .settlementTabs {
  2986. .el-tabs__content {
  2987. height: 90%;
  2988. }
  2989. }
  2990. .preTabs {
  2991. .el-tabs__content {
  2992. flex: 1;
  2993. overflow-y: auto;
  2994. padding: 5px 0 5px 5px;
  2995. }
  2996. }
  2997. .centerDialog {
  2998. .el-dialog__body {
  2999. max-height: calc(100vh - 100px) !important;
  3000. padding: 0 20px;
  3001. }
  3002. }
  3003. </style>