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

outpatientChargesManagement.vue 141KB

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