outpatientChargesManagement.vue 120KB

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