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

outpatientChargesManagement.vue 120KB

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