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

outpatientChargesManagement.vue 79KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289
  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" v-model="key" class="filter-item"/>-->
  31. <el-input size="small" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
  32. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary" @click="searchAction">
  33. 搜索
  34. </el-button>
  35. </div>
  36. <div>
  37. <el-table :data="patientTableData" :height="tableHeight" border style="width: 100%;"
  38. :row-style="{ color: '#303133' }"
  39. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  40. highlight-current-row ref="tab"
  41. @current-change="handleCurrentChange">
  42. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  43. <template slot-scope="scope">{{scope.row.name}}</template>
  44. </el-table-column>
  45. <el-table-column align="center" prop="name" label="就诊号" width="110">
  46. <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}</template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. </div>
  51. <div class="mainRight">
  52. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  53. <!-- <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">打印处置单</el-button>
  54. <el-button size="small" @click="open(2)" type="primary">打印治疗单</el-button> -->
  55. <el-button size="small" @click="open(3)" type="primary">打印</el-button>
  56. <el-button v-loading="loadingone" size="small"
  57. @click="open(6)"
  58. type="primary">挂号
  59. </el-button>
  60. <!--<el-button v-loading="dise_loading" size="small"-->
  61. <!--@click="open(15)"-->
  62. <!--v-if="this.hisPatientInfo && this.hisPatientInfo.id > 0 && this.order.id == 0 && this.$store.getters.xt_user.org_id == 9919 "-->
  63. <!--type="primary">上传就诊信息-->
  64. <!--</el-button>-->
  65. <el-button v-loading="loadingtwo" v-if="this.hisPatientInfo.id > 0 && this.order.id == 0" size="small"
  66. @click="open(4)"
  67. type="primary">收费
  68. </el-button>
  69. <el-button size="small" @click="open(5)" type="primary"
  70. v-if="this.hisPatientInfo.id > 0 && this.order.id > 0 && this.order.order_status == 2" >退费
  71. </el-button>
  72. <!-- <el-button size="small" @click="open(5)" type="primary"
  73. >退费
  74. </el-button> -->
  75. <!--<el-button v-if="this.info.prescription_status >= 2" size="small" @click="open(7)" type="primary"-->
  76. <!--&gt;对账-->
  77. <!--</el-button>-->
  78. <!--<el-button v-if="this.info.prescription_status >= 2" size="small" @click="open(8)" type="primary"-->
  79. <!--&gt;明细对账-->
  80. <!--</el-button>-->
  81. <el-button v-if="this.info.prescription_status >= 2" size="small" @click="open(9)" type="primary"
  82. >结算单
  83. </el-button>
  84. <!--<el-button v-if="this.$store.getters.xt_user.org_id == 9919"-->
  85. <!--size="small" @click="open(10)" type="primary"-->
  86. <!--&gt;退号-->
  87. <!--</el-button>-->
  88. <!--<el-button v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919"-->
  89. <!--size="small" @click="open(11)" type="primary"-->
  90. <!--&gt;撤销明细-->
  91. <!--</el-button>-->
  92. <!--<el-button v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919" size="small" @click="open(12)" type="primary"-->
  93. <!--&gt;查编码-->
  94. <!--</el-button>-->
  95. <!--<el-button v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919"-->
  96. <!--size="small" @click="open(13)" type="primary"-->
  97. <!--&gt;查待遇-->
  98. <!--</el-button>-->
  99. </div>
  100. <div class="mainCenter" v-loading="loading">
  101. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  102. <el-tab-pane label="日结" name="first">
  103. <div style="display:flex;height:100%;">
  104. <div class="centerLeft">
  105. <div class="tabsBox">
  106. <!--<el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>-->
  107. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card" @tab-click="tabclickEvent">
  108. <el-tab-pane
  109. v-for="(item, index) in prescriptions"
  110. :key="index"
  111. :label="item.name"
  112. :name="item.name"
  113. >
  114. </el-tab-pane>
  115. <!--<div class="RP">-->
  116. <!--Rp-->
  117. <!--<el-date-picker-->
  118. <!--v-model="record_date"-->
  119. <!--type="date"-->
  120. <!--:clearable="false"-->
  121. <!--@change="changeDate"-->
  122. <!--format="yyyy-MM-dd"-->
  123. <!--value-format="yyyy-MM-dd"-->
  124. <!--placeholder="选择日期">-->
  125. <!--</el-date-picker>-->
  126. <!--</div>-->
  127. <prescription-table ref="prescription_tables"
  128. :prescription="curPrescriptions"></prescription-table>
  129. </el-tabs>
  130. </div>
  131. <div class="costBox">
  132. <span>当前处方总费用:<span style="color:red;">{{ total}}元</span></span>
  133. <span v-if="this.curPrescriptions.order_status == 1">待结算</span>
  134. <span v-if="this.curPrescriptions.order_status == 2">已结算</span>
  135. <span v-if="this.curPrescriptions.order_status == 3">已退费</span>
  136. </div>
  137. </div>
  138. <div class="centerRight">
  139. <p class="centerRightTitle">人员信息</p>
  140. <div style="display:flex;justify-content: space-between;line-height:30px;">
  141. <span style="font-size:14px;">人员编码:{{patientInfo.dialysis_no}}</span>
  142. <span style="font-size:14px;">日期:{{record_date}}</span>
  143. </div>
  144. <ul class="basicUl">
  145. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  146. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  147. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  148. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  149. <!--<span>过敏病史:</span>-->
  150. <!--<el-autocomplete-->
  151. <!--style="width:100%;"-->
  152. <!--class="inline-input"-->
  153. <!--v-model="sick_history"-->
  154. <!--:fetch-suggestions="querySearch2"-->
  155. <!--placeholder="请输入内容"-->
  156. <!--&gt;</el-autocomplete>-->
  157. <!--<li style="width:100%;">地址:{{patientInfo.home_address}}</li>-->
  158. <!--<li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>-->
  159. </ul>
  160. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  161. <div style="display:flex;justify-content: space-between;line-height:30px;">
  162. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number}}</span>
  163. </div>
  164. <ul class="basicUl">
  165. <li style="width:50%;">医生:{{ info.doctor }}</li>
  166. <li style="width:50%;">科室:{{ info.departments }}</li>
  167. <li style="width:100%;">总费用:{{ getTotal() }}</li>
  168. <li style="width:100%;">判断结果:{{info.diagnosis}}</li>
  169. <li style="width:100%;">是否有传染病:</li>
  170. <li style="width:100%;">血压:</li>
  171. </ul>
  172. </div>
  173. </div>
  174. </el-tab-pane>
  175. <el-tab-pane label="月结" name="second">
  176. <div style="display:flex;height:100%;">
  177. <div class="centerLeft">
  178. <div class="tabsBox">
  179. <!-- <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button> -->
  180. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  181. @tab-click="tabclickEventTwo">
  182. <el-tab-pane
  183. v-for="(item, index) in month_prescriptions"
  184. :key="index"
  185. :label="item.name"
  186. :name="item.name">
  187. </el-tab-pane>
  188. <div class="RP">
  189. Rp
  190. <el-date-picker
  191. v-model="other_start_time"
  192. prefix-icon="el-icon-date"
  193. @change="changeTime"
  194. :editable="false"
  195. style="width: 150px;"
  196. type="date"
  197. :picker-options="pickerOptions"
  198. placeholder="选择开始时间"
  199. align="right"
  200. format="yyyy-MM-dd"
  201. value-format="yyyy-MM-dd">
  202. </el-date-picker>
  203. <span class>-</span>
  204. <el-date-picker
  205. v-model="other_end_time"
  206. prefix-icon="el-icon-date"
  207. @change="changeEndTime"
  208. :editable="false"
  209. style="width: 150px;"
  210. type="date"
  211. placeholder="选择结束时间"
  212. align="right"
  213. format="yyyy-MM-dd"
  214. value-format="yyyy-MM-dd">
  215. </el-date-picker>
  216. </div>
  217. <!--<prescription-table :preTableData='preTableData'></prescription-table>-->
  218. <!--<month-prescription-table ref="prescription_tables"-->
  219. <!--:activeType="activeType" :prescription="curMonthPrescriptions"></month-prescription-table>-->
  220. <charge-month-prescription-table
  221. :prescription="curMonthPrescriptions"></charge-month-prescription-table>
  222. </el-tabs>
  223. </div>
  224. <div class="costBox">
  225. <span>当前处方总费用:<span style="color:red;">{{ month_total }}元</span></span>
  226. <!--<span>{{ state }}</span>-->
  227. </div>
  228. </div>
  229. <div class="centerRight">
  230. <p class="centerRightTitle">人员信息</p>
  231. <div style="display:flex;justify-content: space-between;line-height:30px;">
  232. <span style="font-size:14px;">人员编码:{{patientInfo.dialysis_no}}</span>
  233. <span style="font-size:14px;">日期:{{record_date}}</span>
  234. </div>
  235. <ul class="basicUl">
  236. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  237. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  238. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  239. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  240. <li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>
  241. </ul>
  242. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  243. <div style="display:flex;justify-content: space-between;line-height:30px;">
  244. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number}}</span>
  245. </div>
  246. <ul class="basicUl">
  247. <li style="width:50%;">医生:{{ info.doctor }}</li>
  248. <li style="width:50%;">科室:{{ getDepartment(info.departments) }}</li>
  249. <li style="width:100%;" v-if="activeName == 'first'">总费用:{{ getTotal() }}</li>
  250. <li style="width:100%;" v-if="activeName == 'second'">总费用:{{ getTotalTwo() }}</li>
  251. <li style="width:100%;">判断结果:{{info.diagnosis}}</li>
  252. <!--<li style="width:100%;">是否有传染病:</li>-->
  253. <!--<li style="width:100%;">血压:</li>-->
  254. </ul>
  255. </div>
  256. </div>
  257. </el-tab-pane>
  258. </el-tabs>
  259. </div>
  260. </div>
  261. </div>
  262. <additionalCharges ref='additionalCharges' @click="addCharges"
  263. :addtions_charge="addtions_charge"></additionalCharges>
  264. <register-dialog ref='register' :doctors="doctors" :department="department" :sick="sick" :diagnoses="diagnoses"
  265. v-on:confirm="confirm" v-on:cancel="cancel"></register-dialog>
  266. <charge-dialog ref='charge' v-on:confirm="chargeConfirm" v-on:cancel="chargeCancel"></charge-dialog>
  267. <el-dialog
  268. class="centerDialog"
  269. width="900px"
  270. title="打印"
  271. :visible.sync="treatVisible">
  272. <treatPrint :paramsObj='paramsObj'></treatPrint>
  273. </el-dialog>
  274. <el-dialog
  275. class="centerDialog"
  276. width="1200px"
  277. title="打印"
  278. :visible.sync="statementVisible">
  279. <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
  280. </el-dialog>
  281. </div>
  282. </template>
  283. <script>
  284. import axios from 'axios'
  285. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  286. import noCharge from './components/noCharge'
  287. import charged from './components/charged'
  288. import medicalInsuranceRefund from './components/medicalInsuranceRefund'
  289. import prescriptionTable from './components/prescriptionTable'
  290. import additionalCharges from './components/additionalCharges'
  291. import { getPatientInformation, getPatientList } from '@/api/project/project'
  292. import {
  293. getChargeHisPatientInfo,
  294. getChargeHisPatientList,
  295. getDayOrMonthHisPrescription,
  296. getInitData,
  297. getSchedulePatientList,
  298. Refund,
  299. register,
  300. upload
  301. } from '@/api/his/his'
  302. import RegisterDialog from './components/registerDialog'
  303. import treatPrint from './treatPrint'
  304. import statementPrint from './statementPrint'
  305. import ChargeDialog from './components/chargeDialog'
  306. import MonthPrescriptionTable from './components/monthPrescriptionTable'
  307. import ChargeMonthPrescriptionTable from './components/chargeMonthPrescriptionTable'
  308. const moment = require('moment')
  309. export default {
  310. components: {
  311. ChargeMonthPrescriptionTable,
  312. MonthPrescriptionTable,
  313. ChargeDialog,
  314. RegisterDialog,
  315. BreadCrumb,
  316. noCharge,
  317. charged,
  318. medicalInsuranceRefund,
  319. prescriptionTable,
  320. additionalCharges,
  321. treatPrint,
  322. statementPrint
  323. },
  324. data() {
  325. return {
  326. register: [
  327. { value: 11, label: '普通门诊' },
  328. { value: 12, label: '门诊挂号' },
  329. { value: 13, label: '急诊' },
  330. { value: 14, label: '门诊特殊病' },
  331. { value: 15, label: '门诊统筹' },
  332. { value: 16, label: '门诊慢性病' },
  333. { value: 21, label: '普通住院' }
  334. ],
  335. loading: false,
  336. dise_loading: false,
  337. sick_history: '',
  338. p_type: '',
  339. sick_type: '',
  340. diagnosis: '',
  341. month_p_type: '',
  342. month_sick_type: '',
  343. month_diagnosis: '',
  344. key: '',
  345. other_start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  346. other_end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  347. curMonthPrescriptions: null,
  348. month_total: 0,
  349. crumbs: [
  350. { path: false, name: '门诊收费' },
  351. { path: false, name: '门诊收费管理' }
  352. ],
  353. current_index: 0,
  354. cal_one: '',
  355. cal_two: '',
  356. cal_three: '',
  357. tableHeight: '',
  358. fullHeight: document.documentElement.clientHeight,
  359. activeName: 'first',
  360. info: {},
  361. curPrescriptions: {},
  362. prescriptions: [],
  363. month_prescriptions: [],
  364. record_date: '',
  365. tableData: [],
  366. editableTabsValue: '处方1',
  367. loadingone: false,
  368. editableTabs: [{
  369. title: '处方1',
  370. name: '1'
  371. }],
  372. tabIndex: 1,
  373. hisPatientInfo: {},
  374. loadingtwo: false,
  375. patientTableData: [{
  376. name: '杨美英',
  377. mdtrt_id: '1709946'
  378. }],
  379. patientInfo: { id: 0 },
  380. doctor: {},
  381. total: 0,
  382. state: '未收费',
  383. radio: 1,
  384. radioStatus: 1,
  385. search_input: '',
  386. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  387. patient_id: 0,
  388. prescription_id: 0,
  389. all_table_data: [],
  390. hisPatientDatas: [],
  391. order: {},
  392. addtions_charge: [],
  393. treatVisible: false,
  394. orderObj: {},
  395. paramsObj: {},
  396. statementVisible: false,
  397. sick: [],
  398. diagnoses: [],
  399. department: []
  400. }
  401. },
  402. created() {
  403. let tableHeight = document.body.clientHeight - 243
  404. this.tableHeight = tableHeight
  405. var nowDate = new Date()
  406. var nowYear = nowDate.getFullYear()
  407. var nowMonth = nowDate.getMonth() + 1
  408. var nowDay = nowDate.getDate()
  409. this.record_date =
  410. nowYear +
  411. '-' +
  412. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  413. '-' +
  414. (nowDay < 10 ? '0' + nowDay : nowDay)
  415. this.getInitData()
  416. //获取患者信息
  417. this.getPatientList()
  418. },
  419. methods: {
  420. getDepartment(department_id) {
  421. for (let i = 0; i < this.department.length; i++) {
  422. if (this.department[i].id == department_id) {
  423. return this.department[i].name
  424. }
  425. }
  426. },
  427. querySearch2(queryString, cb) {
  428. var restaurants = this.other_sick
  429. restaurants.map(item => {
  430. item.value = item.name
  431. })
  432. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  433. // 调用 callback 返回建议列表的数据
  434. cb(results)
  435. },
  436. changeTime(val) {
  437. let params = {
  438. patient_id: this.patientInfo.id,
  439. start_time: val,
  440. end_time: this.other_end_time
  441. }
  442. getDayOrMonthHisPrescription(params).then(response => {
  443. if (response.data.state == 1) {
  444. this.month_prescriptions = []
  445. this.setMonthPrescription(response.data.data.day_prescription)
  446. this.curMonthPrescriptions = this.month_prescriptions[0]
  447. } else {
  448. this.$message.error(response.data.msg)
  449. }
  450. })
  451. }, changeEndTime(val) {
  452. let params = {
  453. patient_id: this.patientInfo.id,
  454. start_time: this.other_start_time,
  455. end_time: val
  456. }
  457. getDayOrMonthHisPrescription(params).then(response => {
  458. if (response.data.state == 1) {
  459. this.month_prescriptions = []
  460. this.setMonthPrescription(response.data.data.day_prescription)
  461. this.curMonthPrescriptions = this.month_prescriptions[0]
  462. } else {
  463. this.$message.error(response.data.msg)
  464. }
  465. })
  466. }, chargeConfirm(form) {
  467. form['id'] = this.patientInfo.id
  468. form['record_time'] = this.record_date
  469. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  470. if (this.activeName == 'first') {
  471. form['settle_accounts_type'] = 1
  472. } else {
  473. form['start_time'] = this.other_start_time
  474. form['end_time'] = this.other_end_time
  475. form['settle_accounts_type'] = 2
  476. }
  477. this.loadingtwo = true
  478. if (this.$store.getters.xt_user.org_id == 9919) {
  479. var that = this
  480. axios.get('http://127.0.0.1:9532/api/upload/get', {
  481. params: form
  482. })
  483. .then(function(response) {
  484. if (response.data.state == 0) {
  485. that.$message.error(response.data.msg)
  486. that.loadingtwo = false
  487. that.$refs.charge.hide()
  488. return false
  489. } else {
  490. that.changeRadio(2)
  491. that.radio = 2
  492. that.$refs.charge.hide()
  493. that.loadingtwo = false
  494. that.state = '已收费'
  495. that.$message({ message: '收费成功', type: 'success' })
  496. that.loadingtwo = false
  497. that.cal_one = this.cal_one - 1
  498. that.cal_two = this.cal_two + 1
  499. that.patientTableData.splice(this.current_index, 1)
  500. }
  501. })
  502. .catch(function(error) {
  503. })
  504. } else {
  505. upload(form).then(response => {
  506. if (response.data.state == 0) {
  507. this.$message.error(response.data.msg)
  508. this.loadingtwo = false
  509. this.$refs.charge.hide()
  510. return false
  511. } else {
  512. this.$refs.charge.hide()
  513. this.changeRadio(2)
  514. this.radio = 2
  515. this.loadingtwo = false
  516. this.state = '已收费'
  517. this.$message({ message: '收费成功', type: 'success' })
  518. this.$refs.charge.hide()
  519. this.loadingtwo = false
  520. }
  521. })
  522. }
  523. }, chargeCancel() {
  524. this.$refs.charge.hide()
  525. },
  526. confirm(forms) {
  527. forms['record_time'] = this.record_date,
  528. forms['admin_user_id'] = this.$store.getters.xt_user.user.id
  529. this.loadingone = true
  530. if (this.$store.getters.xt_user.org_id == 9919) {
  531. var that = this
  532. axios.get('http://127.0.0.1:9532/api/register/get', {
  533. params: forms
  534. })
  535. .then(function(response) {
  536. if (response.data.state == 0) {
  537. that.$message.error(response.data.msg)
  538. that.loadingone = false
  539. that.$refs.register.hide()
  540. return false
  541. } else {
  542. that.$refs.register.hide()
  543. let params = {
  544. 'record_date': that.record_date
  545. }
  546. getChargeHisPatientList(params).then(response => {
  547. if (response.data.state == 0) {
  548. that.$message.error(response.data.msg)
  549. return false
  550. } else {
  551. that.loadingone = false
  552. that.patientTableData = []
  553. that.all_table_data = []
  554. that.hisPatientDatas = []
  555. let one_count = 0
  556. let two_count = 0
  557. let three_count = 0
  558. for (let i = 0; i < response.data.data.list.length; i++) {
  559. that.all_table_data.push(response.data.data.list[i])
  560. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1) {
  561. one_count = one_count + 1
  562. that.patientTableData.push(response.data.data.list[i])
  563. }
  564. if (response.data.data.list[i].order.order_status == 2) {
  565. two_count = two_count + 1
  566. that.patientTableData.push(response.data.data.list[i])
  567. }
  568. if (response.data.data.list[i].order.order_status == 3) {
  569. three_count = three_count + 1
  570. that.patientTableData.push(response.data.data.list[i])
  571. }
  572. }
  573. that.hisPatientDatas = response.data.data.list_two
  574. that.cal_one = one_count
  575. that.cal_two = two_count
  576. that.cal_three = three_count
  577. that.current_index = 0
  578. for (let i = 0; i < that.patientTableData.length; i++) {
  579. if (this.patientTableData[i].id == this.patientInfo.id) {
  580. that.$refs.tab.setCurrentRow(that.patientTableData[i])
  581. that.getPatientInformation(that.patientTableData[i].id, that.patientTableData[i].order.number)
  582. }
  583. }
  584. that.$message({ message: '挂号成功', type: 'success' })
  585. that.loadingone = false
  586. var his_info = response.data.data.his_info
  587. that.hisPatientInfo = his_info
  588. }
  589. })
  590. }
  591. })
  592. .catch(function(error) {
  593. })
  594. } else {
  595. register(forms).then(response => {
  596. if (response.data.state == 0) {
  597. this.$message.error(response.data.msg)
  598. this.loadingone = false
  599. // this.$refs.register.hide()
  600. return false
  601. } else {
  602. this.getPatientList()
  603. this.$message({ message: '挂号成功', type: 'success' })
  604. this.$refs.register.hide()
  605. this.loadingone = false
  606. var his_info = response.data.data.his_info
  607. this.hisPatientInfo = his_info
  608. }
  609. })
  610. }
  611. }, cancel() {
  612. this.$refs.register.hide()
  613. },
  614. addCharges() {
  615. this.$refs.additionalCharges.show()
  616. },
  617. changeDate(val) {
  618. if (this.patientInfo.id == 0) {
  619. this.$message.error('请先选择患者')
  620. return
  621. }
  622. let params = {
  623. 'record_date': val,
  624. 'patient_id': this.patientInfo.id
  625. }
  626. getChargeHisPatientInfo(params).then(response => {
  627. if (response.data.state == 0) {
  628. this.$message.error(response.data.msg)
  629. return false
  630. } else {
  631. this.prescriptions = []
  632. this.month_prescriptions = []
  633. this.curPrescriptions = {}
  634. this.month_prescriptions = {}
  635. this.patientInfo = response.data.data.xt_info
  636. this.hisPatientInfo = response.data.data.his_info
  637. this.info = response.data.data.info
  638. this.order = response.data.data.order
  639. this.addtions_charge = response.data.data.addtions_charge
  640. // this.setMonthPrescription(response.data.data.month_prescriptions)
  641. for (let i = 0; i < response.data.data.prescription.length; i++) {
  642. var prescription = response.data.data.prescription[i]
  643. let tempAdvice = []
  644. let tempProject = []
  645. for (let b = 0; b < prescription.advices.length; b++) {
  646. let obj = {
  647. advice_id: prescription.advices[b].id,
  648. drug_name: prescription.advices[b].advice_name,
  649. single_dose: prescription.advices[b].single_dose,
  650. delivery_way: prescription.advices[b].delivery_way,
  651. execution_frequency: prescription.advices[b].execution_frequency,
  652. retail_price: prescription.advices[b].price,
  653. remark: prescription.advices[b].remark,
  654. day: prescription.advices[b].day,
  655. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  656. single_dose_unit: prescription.advices[b].single_dose_unit,
  657. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  658. medical_insurance_number: prescription.advices[b].med_list_codg
  659. }
  660. tempAdvice.push(obj)
  661. }
  662. for (let b = 0; b < prescription.project.length; b++) {
  663. console.log(prescription.project[b].project.project_name)
  664. let obj = {
  665. id: prescription.project[b].id,
  666. project_id: prescription.project[b].project.id,
  667. project_name: prescription.project[b].project.project_name,
  668. statistical_classification: prescription.project[b].project.statistical_classification,
  669. single_dose: prescription.project[b].single_dose,
  670. delivery_way: prescription.project[b].delivery_way,
  671. execution_frequency: prescription.project[b].execution_frequency,
  672. number_days: prescription.project[b].day,
  673. total: prescription.project[b].count.toString(),
  674. price: prescription.project[b].price,
  675. remark: prescription.project[b].remark,
  676. medical_code: prescription.project[b].project.medical_code,
  677. unit: prescription.project[b].unit
  678. }
  679. tempProject.push(obj)
  680. }
  681. let index = i + 1
  682. let obj = {
  683. id: prescription.id,
  684. name: '处方' + index,
  685. advices: tempAdvice,
  686. project: tempProject,
  687. type: prescription.type,
  688. order_status: prescription.order_status
  689. }
  690. this.prescriptions.push(obj)
  691. }
  692. this.curPrescriptions = this.prescriptions[0]
  693. this.total = 0
  694. this.total = this.getTotalOne()
  695. this.month_total = 0
  696. this.month_total = this.getMonthTotalOne()
  697. }
  698. })
  699. },
  700. getInitData() {
  701. getInitData().then(response => {
  702. if (response.data.state == 0) {
  703. this.$message.error(response.data.msg)
  704. return false
  705. } else {
  706. this.doctors = response.data.data.doctors
  707. this.department = response.data.data.department
  708. this.sick = response.data.data.sick
  709. this.diagnoses = response.data.data.diagnose
  710. }
  711. })
  712. },
  713. getDayPatientList() {
  714. let params = {
  715. 'record_date': this.record_date
  716. }
  717. getChargeHisPatientList(params).then(response => {
  718. if (response.data.state == 0) {
  719. this.$message.error(response.data.msg)
  720. return false
  721. } else {
  722. this.patientTableData = []
  723. this.all_table_data = []
  724. this.hisPatientDatas = []
  725. let one_count = 0
  726. let two_count = 0
  727. let three_count = 0
  728. for (let i = 0; i < response.data.data.list.length; i++) {
  729. this.all_table_data.push(response.data.data.list[i])
  730. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1) {
  731. one_count = one_count + 1
  732. }
  733. if (response.data.data.list[i].order.order_status == 2) {
  734. two_count = two_count + 1
  735. }
  736. if (response.data.data.list[i].order.order_status == 3) {
  737. three_count = three_count + 1
  738. }
  739. }
  740. switch (this.radio) {
  741. case 1:
  742. this.patientTableData = []
  743. for (let i = 0; i < this.all_table_data.length; i++) {
  744. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
  745. this.patientTableData.push(this.all_table_data[i])
  746. }
  747. }
  748. break
  749. case 2:
  750. this.patientTableData = []
  751. for (let i = 0; i < this.all_table_data.length; i++) {
  752. if (this.all_table_data[i].order.order_status == 2) {
  753. this.patientTableData.push(this.all_table_data[i])
  754. }
  755. }
  756. break
  757. case 3:
  758. this.patientTableData = []
  759. for (let i = 0; i < this.all_table_data.length; i++) {
  760. if (this.all_table_data[i].order.order_status == 3) {
  761. this.patientTableData.push(this.all_table_data[i])
  762. }
  763. }
  764. break
  765. case 4:
  766. this.patientTableData = []
  767. this.patientTableData = this.all_table_data
  768. break
  769. }
  770. this.hisPatientDatas = response.data.data.list_two
  771. this.cal_one = one_count
  772. this.cal_two = two_count
  773. this.cal_three = three_count
  774. this.current_index = 0
  775. if (this.patientTableData.length > 0) {
  776. for (let i = 0; i < this.patientTableData.length; i++) {
  777. if (this.patientTableData[i].id == this.patientInfo.id) {
  778. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  779. this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order.number)
  780. }
  781. }
  782. }
  783. }
  784. })
  785. },
  786. getMonthPatientList() {
  787. let params = {
  788. 'record_date': this.record_date
  789. }
  790. getChargeHisPatientList(params).then(response => {
  791. if (response.data.state == 0) {
  792. this.$message.error(response.data.msg)
  793. return false
  794. } else {
  795. this.patientTableData = []
  796. this.all_table_data = []
  797. this.hisPatientDatas = []
  798. let one_count = 0
  799. let two_count = 0
  800. let three_count = 0
  801. for (let i = 0; i < response.data.data.list_two.length; i++) {
  802. this.hisPatientDatas.push(response.data.data.list_two[i])
  803. if (response.data.data.list_two[i].order.order_status == 0 || response.data.data.list_two[i].order.order_status == 1) {
  804. one_count = one_count + 1
  805. }
  806. if (response.data.data.list_two[i].order.order_status == 2) {
  807. two_count = two_count + 1
  808. }
  809. if (response.data.data.list_two[i].order.order_status == 3) {
  810. three_count = three_count + 1
  811. }
  812. }
  813. switch (this.radio) {
  814. case 1:
  815. this.patientTableData = []
  816. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  817. if (this.hisPatientDatas[i].order.order_status == 0 || this.hisPatientDatas[i].order.order_status == 1) {
  818. this.patientTableData.push(this.hisPatientDatas[i])
  819. }
  820. }
  821. break
  822. case 2:
  823. this.patientTableData = []
  824. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  825. if (this.hisPatientDatas[i].order.order_status == 2) {
  826. this.patientTableData.push(this.hisPatientDatas[i])
  827. }
  828. }
  829. break
  830. case 3:
  831. this.patientTableData = []
  832. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  833. if (this.hisPatientDatas[i].order.order_status == 3) {
  834. this.patientTableData.push(this.hisPatientDatas[i])
  835. }
  836. }
  837. break
  838. case 4:
  839. this.patientTableData = []
  840. this.patientTableData = this.hisPatientDatas
  841. break
  842. }
  843. this.cal_one = one_count
  844. this.cal_two = two_count
  845. this.cal_three = three_count
  846. this.current_index = 0
  847. if (this.patientTableData.length > 0) {
  848. for (let i = 0; i < this.patientTableData.length; i++) {
  849. if (this.patientTableData[i].id == this.patientInfo.id) {
  850. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  851. this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order.number)
  852. }
  853. }
  854. }
  855. }
  856. })
  857. },
  858. handleClick() {
  859. if (this.activeName == 'first') {
  860. // this.patientTableData = this.all_table_data
  861. this.getDayPatientList()
  862. } else if (this.activeName == 'second') {
  863. this.getMonthPatientList()
  864. // if (this.patientTableData.length > 0) {
  865. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  866. // this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  867. // }
  868. }
  869. },
  870. searchAction() {
  871. }, tabclickEventTwo(val) {
  872. for (let i = 0; i < this.month_prescriptions.length; i++) {
  873. if (this.month_prescriptions[i].name == val.name) {
  874. this.curMonthPrescriptions = {}
  875. var temp = this.deepClone(this.month_prescriptions[i])
  876. this.curMonthPrescriptions = temp
  877. }
  878. }
  879. this.prescription_id = this.month_prescriptions.id
  880. this.month_total = 0
  881. this.month_total = this.getMonthTotalOne()
  882. },
  883. tabclickEvent(val) {
  884. console.log('val', val.name)
  885. for (let i = 0; i < this.prescriptions.length; i++) {
  886. if (this.prescriptions[i].name == val.name) {
  887. this.curPrescriptions = {}
  888. var temp = this.deepClone(this.prescriptions[i])
  889. this.curPrescriptions = temp
  890. }
  891. }
  892. console.log('9999', this.curPrescriptions)
  893. this.prescription_id = this.curPrescriptions.id
  894. this.total = 0
  895. this.total = this.getTotalOne()
  896. }, deepClone(source) {
  897. if (!source && typeof source !== 'object') {
  898. throw new Error('error arguments', 'shallowClone')
  899. }
  900. const targetObj = source.constructor === Array ? [] : {}
  901. Object.keys(source).forEach((keys) => {
  902. if (source[keys] && typeof source[keys] === 'object') {
  903. targetObj[keys] = this.deepClone(source[keys])
  904. } else {
  905. targetObj[keys] = source[keys]
  906. }
  907. })
  908. return targetObj
  909. }, getTotalOne() {
  910. var total = 0
  911. if (this.curPrescriptions.type == 1) {
  912. if (this.curPrescriptions.advices != null) {
  913. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  914. total = parseFloat(total) + parseFloat(this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number)
  915. }
  916. }
  917. } else {
  918. if (this.curPrescriptions.project != null) {
  919. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  920. total = parseFloat(total) + parseFloat(this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total)
  921. }
  922. }
  923. }
  924. if (this.curPrescriptions.addition != null) {
  925. for (let b = 0; b < this.curPrescriptions.addition.length; b++) {
  926. total = parseFloat(total) + parseFloat(this.curPrescriptions.addition[b].price * this.curPrescriptions.addition[b].count)
  927. }
  928. }
  929. return total.toFixed(2)
  930. }, getMonthTotalOne() {
  931. var total = 0
  932. if (this.curMonthPrescriptions.type == 1) {
  933. if (this.curMonthPrescriptions.advices != null) {
  934. for (let a = 0; a < this.curMonthPrescriptions.advices.length; a++) {
  935. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.advices[a].retail_price * this.curMonthPrescriptions.advices[a].prescribing_number)
  936. }
  937. }
  938. } else {
  939. if (this.curMonthPrescriptions.project != null) {
  940. for (let b = 0; b < this.curMonthPrescriptions.project.length; b++) {
  941. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.project[b].price * this.curMonthPrescriptions.project[b].total)
  942. }
  943. }
  944. }
  945. if (this.curMonthPrescriptions.addition != null) {
  946. for (let b = 0; b < this.curMonthPrescriptions.addition.length; b++) {
  947. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.addition[b].price * this.curMonthPrescriptions.addition[b].count)
  948. }
  949. }
  950. return total.toFixed(2)
  951. },
  952. getTotal() {
  953. var total = 0
  954. for (let i = 0; i < this.prescriptions.length; i++) {
  955. if (this.prescriptions[i].advices != null) {
  956. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  957. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number)
  958. }
  959. }
  960. if (this.prescriptions[i].project != null) {
  961. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  962. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total)
  963. }
  964. }
  965. if (this.prescriptions[i].addition != null) {
  966. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  967. total = parseFloat(total) + parseFloat(this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count)
  968. }
  969. }
  970. }
  971. return total.toFixed(2)
  972. }, getTotalTwo() {
  973. var total = 0
  974. for (let i = 0; i < this.month_prescriptions.length; i++) {
  975. if (this.month_prescriptions[i].advices != null) {
  976. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  977. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number)
  978. }
  979. }
  980. if (this.month_prescriptions[i].project != null) {
  981. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  982. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].project[a].price * this.month_prescriptions[i].project[a].total)
  983. }
  984. }
  985. if (this.month_prescriptions[i].addition != null) {
  986. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  987. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].addition[a].price * this.month_prescriptions[i].addition[b].count)
  988. }
  989. }
  990. }
  991. return total.toFixed(2)
  992. },
  993. moreState(tab, event) {
  994. if (tab == 'more') {
  995. return false
  996. }
  997. },
  998. open(index) {
  999. if (index == 1) {
  1000. } else if (index == 2) {
  1001. this.$router.push('/outpatientDoctorStation/printtwo?record=' + this.record_date)
  1002. } else if (index == 3) {
  1003. let obj = {
  1004. record_date: this.record_date,
  1005. patient_id: this.patient_id,
  1006. prescription_id: this.prescription_id
  1007. }
  1008. this.paramsObj = obj
  1009. this.treatVisible = true
  1010. // this.$router.push('/outpatientCharges/treatPrint?record_date=' + this.record_date + '&patient_id=' + this.patient_id + '&prescription_id=' + this.prescription_id)
  1011. } else if (index == 4) {
  1012. if (this.patientInfo.id == 0) {
  1013. this.$message({ message: '该选择要收费的患者', type: 'error' })
  1014. return
  1015. }
  1016. if (this.hisPatientInfo.id == 0) {
  1017. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  1018. return
  1019. }
  1020. let ids = []
  1021. if (this.activeName == 'first') {
  1022. for (let i = 0; i < this.prescriptions.length; i++) {
  1023. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1024. ids.push(this.prescriptions[i].advices[a].id)
  1025. }
  1026. for (let a = 0; a < this.prescriptions[i].addition.length; a++) {
  1027. ids.push(this.prescriptions[i].addition[a].id)
  1028. }
  1029. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  1030. ids.push(this.prescriptions[i].project[a].id)
  1031. }
  1032. }
  1033. if (ids.length == 0) {
  1034. this.$message.error('请先到医生工作站开处方再来结算')
  1035. return
  1036. }
  1037. } else {
  1038. console.log(this.month_prescriptions)
  1039. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1040. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1041. ids.push(this.month_prescriptions[i].advices[a].id)
  1042. }
  1043. for (let a = 0; a < this.month_prescriptions[i].addition.length; a++) {
  1044. ids.push(this.month_prescriptions[i].addition[a].id)
  1045. }
  1046. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  1047. ids.push(this.month_prescriptions[i].project[a].id)
  1048. }
  1049. }
  1050. if (ids.length == 0) {
  1051. this.$message.error('请先到医生工作站开处方再来结算')
  1052. return
  1053. }
  1054. }
  1055. if (this.activeName == 'first') {
  1056. this.$refs.charge.show(this.getTotal())
  1057. } else {
  1058. this.$refs.charge.show(this.getTotalTwo())
  1059. }
  1060. } else if (index == 5) {
  1061. if (this.$store.getters.xt_user.org_id == 9919) {
  1062. var that = this
  1063. this.$confirm('是否退费', '退费', {
  1064. confirmButtonText: '确 定',
  1065. cancelButtonText: '取 消',
  1066. type: 'warning'
  1067. }).then(() => {
  1068. let params = {
  1069. 'order_id': this.order.id,
  1070. 'number': this.order.number,
  1071. 'patient_id': this.patientInfo.id,
  1072. 'record_time': this.record_date,
  1073. 'admin_user_id': this.$store.getters.xt_user.user.id
  1074. }
  1075. axios.get('http://127.0.0.1:9532/api/refund/post', {
  1076. params: params
  1077. })
  1078. .then(function(response) {
  1079. if (response.data.state == 0) {
  1080. that.$message.error(response.data.msg)
  1081. that.loadingtwo = false
  1082. return false
  1083. } else {
  1084. that.changeRadio(1)
  1085. that.$message({ message: '退费成功', type: 'success' })
  1086. that.loadingtwo = false
  1087. }
  1088. })
  1089. .catch(function(error) {
  1090. })
  1091. }).catch(() => {
  1092. })
  1093. } else {
  1094. this.$confirm('是否退费', '退费', {
  1095. confirmButtonText: '确 定',
  1096. cancelButtonText: '取 消',
  1097. type: 'warning'
  1098. }).then(() => {
  1099. let params = {
  1100. 'order_id': this.order.id,
  1101. 'number': this.order.number,
  1102. 'patient_id': this.patientInfo.id,
  1103. 'record_time': this.record_date
  1104. }
  1105. Refund(params).then(response => {
  1106. if (response.data.state == 0) {
  1107. this.$message.error(response.data.msg)
  1108. this.loadingtwo = false
  1109. return false
  1110. } else {
  1111. this.radio = 1
  1112. this.changeRadio(1)
  1113. this.$message({ message: '退费成功', type: 'success' })
  1114. this.loadingtwo = false
  1115. }
  1116. })
  1117. }).catch(() => {
  1118. })
  1119. }
  1120. } else if (index == 6) {
  1121. // if (this.patientInfo.id == 0) {
  1122. // this.$message.error('请先选择要挂号的病人')
  1123. // return
  1124. // }
  1125. this.$refs.register.show()
  1126. } else if (index == 7) {
  1127. let params = {
  1128. start_time: '2020-12-28',
  1129. end_time: '2020-12-30',
  1130. insutype: '390',
  1131. clr_type: '11'
  1132. }
  1133. var that = this
  1134. if (this.$store.getters.xt_user.org_id == 9919) {
  1135. axios.get('http://127.0.0.1:9532/api/checkaccount/get', {
  1136. params: params
  1137. })
  1138. .then(function(response) {
  1139. if (response.data.state == 0) {
  1140. that.$message.error(response.data.msg)
  1141. that.loadingtwo = false
  1142. return false
  1143. } else {
  1144. }
  1145. })
  1146. .catch(function(error) {
  1147. })
  1148. }
  1149. } else if (index == 8) {
  1150. let params = {
  1151. start_time: '2020-12-28',
  1152. end_time: '2020-12-30'
  1153. }
  1154. var that = this
  1155. axios.get('http://127.0.0.1:9532/api/checkdetailaccount/get', {
  1156. params: params
  1157. })
  1158. .then(function(response) {
  1159. if (response.data.state == 0) {
  1160. that.$message.error(response.data.msg)
  1161. that.loadingtwo = false
  1162. return false
  1163. } else {
  1164. }
  1165. })
  1166. .catch(function(error) {
  1167. })
  1168. } else if (index == 9) {
  1169. this.statementVisible = true
  1170. let obj = {
  1171. order_id: this.order.id
  1172. }
  1173. this.orderObj = obj
  1174. // this.$refs.print.getInfo(this.order.id)
  1175. } else if (index == 10) {
  1176. let params = {
  1177. 'patient_id': this.patientInfo.id,
  1178. 'record_time': this.record_date
  1179. }
  1180. axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
  1181. params: params
  1182. })
  1183. .then(function(response) {
  1184. if (response.data.state == 0) {
  1185. that.$message.error(response.data.msg)
  1186. that.loadingtwo = false
  1187. return false
  1188. } else {
  1189. that.$message({ message: '退号成功', type: 'success' })
  1190. that.loadingtwo = false
  1191. }
  1192. })
  1193. .catch(function(error) {
  1194. })
  1195. } else if (index == 11) {
  1196. let params = {
  1197. 'order_id': this.order.id,
  1198. 'number': this.order.number,
  1199. 'patient_id': this.patientInfo.id,
  1200. 'record_time': this.record_date
  1201. }
  1202. axios.get('http://127.0.0.1:9532/api/refunddetail/post', {
  1203. params: params
  1204. })
  1205. .then(function(response) {
  1206. if (response.data.state == 0) {
  1207. that.$message.error(response.data.msg)
  1208. that.loadingtwo = false
  1209. return false
  1210. } else {
  1211. that.$message({ message: '退号成功', type: 'success' })
  1212. that.loadingtwo = false
  1213. }
  1214. })
  1215. .catch(function(error) {
  1216. })
  1217. } else if (index == 12) {
  1218. let params = {
  1219. 'name': '琥珀酸亚铁片',
  1220. 'codg': 'XB03AAH026A001010104942'
  1221. }
  1222. axios.get('http://127.0.0.1:9532/api/code/get', {
  1223. params: params
  1224. })
  1225. .then(function(response) {
  1226. if (response.data.state == 0) {
  1227. that.$message.error(response.data.msg)
  1228. that.loadingtwo = false
  1229. return false
  1230. } else {
  1231. that.loadingtwo = false
  1232. }
  1233. })
  1234. .catch(function(error) {
  1235. })
  1236. } else if (index == 13) {
  1237. let params = {
  1238. 'id': this.patientInfo.id,
  1239. 'record_time': this.record_date
  1240. }
  1241. axios.get('http://127.0.0.1:9532/api/record/put', {
  1242. params: params
  1243. })
  1244. .then(function(response) {
  1245. if (response.data.state == 0) {
  1246. that.$message.error(response.data.msg)
  1247. that.loadingtwo = false
  1248. return false
  1249. } else {
  1250. that.loadingtwo = false
  1251. }
  1252. })
  1253. .catch(function(error) {
  1254. })
  1255. } else if (index == 15) {
  1256. var that = this
  1257. if (this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919) {
  1258. if (this.diagnosis.length || this.diagnosis == 0) {
  1259. that.$message.error('诊断不能为空,请选择诊断内容')
  1260. return
  1261. }
  1262. if (this.sick_type.length || this.sick_type == 0) {
  1263. that.$message.error('疾病类型不能为空,请选择疾病类型')
  1264. return
  1265. }
  1266. if (this.reg_type.length || this.reg_type == 0) {
  1267. that.$message.error('处方类型不能为空,请选择处方类型')
  1268. return
  1269. }
  1270. let params = {
  1271. 'id': that.patientInfo.id,
  1272. 'record_time': that.record_date,
  1273. 'diagnosis': that.diagnosis,
  1274. 'sick_type': that.sick_type,
  1275. 'reg_type': that.p_type
  1276. }
  1277. this.dise_loading = true
  1278. axios.get('http://127.0.0.1:9532/api/diag/upload', {
  1279. params: params
  1280. })
  1281. .then(function(response) {
  1282. if (response.data.state == 0) {
  1283. that.$message.error(response.data.msg)
  1284. that.dise_loading = false
  1285. return false
  1286. } else {
  1287. that.dise_loading = false
  1288. that.$message.success('上传成功')
  1289. }
  1290. })
  1291. .catch(function(error) {
  1292. })
  1293. }
  1294. }
  1295. },
  1296. choosePatient() {
  1297. console.log(id)
  1298. this.radioStatus = id
  1299. this.getPatientList()
  1300. },
  1301. changeRadio(id) {
  1302. // console.log(id)
  1303. // this.radioStatus = id
  1304. // this.getPatientList()
  1305. let temp_id = id
  1306. let params = {
  1307. 'record_date': this.record_date
  1308. }
  1309. getChargeHisPatientList(params).then(response => {
  1310. if (response.data.state == 0) {
  1311. this.$message.error(response.data.msg)
  1312. return false
  1313. } else {
  1314. this.patientTableData = []
  1315. this.hisPatientDatas = []
  1316. this.all_table_data = []
  1317. let one_count = 0
  1318. let two_count = 0
  1319. let three_count = 0
  1320. if (this.activeName == 'first') { //日结
  1321. for (let i = 0; i < response.data.data.list.length; i++) {
  1322. this.all_table_data.push(response.data.data.list[i])
  1323. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1) {
  1324. one_count = one_count + 1
  1325. }
  1326. if (response.data.data.list[i].order.order_status == 2) {
  1327. two_count = two_count + 1
  1328. }
  1329. if (response.data.data.list[i].order.order_status == 3) {
  1330. three_count = three_count + 1
  1331. }
  1332. }
  1333. } else { //月结
  1334. for (let i = 0; i < response.data.data.list_two.length; i++) {
  1335. this.hisPatientDatas.push(response.data.data.list_two[i])
  1336. if (response.data.data.list_two[i].order.order_status == 0 || response.data.data.list_two[i].order.order_status == 1) {
  1337. one_count = one_count + 1
  1338. }
  1339. if (response.data.data.list_two[i].order.order_status == 2) {
  1340. two_count = two_count + 1
  1341. }
  1342. if (response.data.data.list_two[i].order.order_status == 3) {
  1343. three_count = three_count + 1
  1344. }
  1345. }
  1346. }
  1347. this.cal_one = one_count
  1348. this.cal_two = two_count
  1349. this.cal_three = three_count
  1350. switch (temp_id) {
  1351. case 1:
  1352. this.patientTableData = []
  1353. if (this.activeName == 'first') {
  1354. for (let i = 0; i < this.all_table_data.length; i++) {
  1355. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
  1356. this.patientTableData.push(this.all_table_data[i])
  1357. }
  1358. }
  1359. } else {
  1360. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  1361. if (this.hisPatientDatas[i].order.order_status == 0 || this.hisPatientDatas[i].order.order_status == 1) {
  1362. this.patientTableData.push(this.hisPatientDatas[i])
  1363. }
  1364. }
  1365. }
  1366. break
  1367. case 2:
  1368. this.patientTableData = []
  1369. if (this.activeName == 'first') {
  1370. for (let i = 0; i < this.all_table_data.length; i++) {
  1371. if (this.all_table_data[i].order.order_status == 2) {
  1372. this.patientTableData.push(this.all_table_data[i])
  1373. }
  1374. }
  1375. } else {
  1376. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  1377. if (this.hisPatientDatas[i].order.order_status == 2) {
  1378. this.patientTableData.push(this.hisPatientDatas[i])
  1379. }
  1380. }
  1381. }
  1382. break
  1383. case 3:
  1384. this.patientTableData = []
  1385. if (this.activeName == 'first') {
  1386. for (let i = 0; i < this.all_table_data.length; i++) {
  1387. if (this.all_table_data[i].order.order_status == 3) {
  1388. this.patientTableData.push(this.all_table_data[i])
  1389. }
  1390. }
  1391. } else {
  1392. for (let i = 0; i < this.hisPatientDatas.length; i++) {
  1393. if (this.hisPatientDatas[i].order.order_status == 3) {
  1394. this.patientTableData.push(this.hisPatientDatas[i])
  1395. }
  1396. }
  1397. }
  1398. break
  1399. case 4:
  1400. this.patientTableData = []
  1401. if (this.activeName == 'first') {
  1402. this.patientTableData = this.all_table_data
  1403. } else {
  1404. this.patientTableData = this.hisPatientDatas
  1405. }
  1406. break
  1407. }
  1408. this.current_index = 0
  1409. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1410. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  1411. }
  1412. })
  1413. }, formatDecimal(num, decimal) {
  1414. num = num.toString()
  1415. let index = num.indexOf('.')
  1416. if (index !== -1) {
  1417. num = num.substring(0, decimal + index + 1)
  1418. } else {
  1419. num = num.substring(0)
  1420. }
  1421. return parseFloat(num).toFixed(decimal)
  1422. },
  1423. //患者列表
  1424. getPatientList() {
  1425. let params = {
  1426. 'record_date': this.record_date
  1427. }
  1428. getChargeHisPatientList(params).then(response => {
  1429. if (response.data.state == 0) {
  1430. this.$message.error(response.data.msg)
  1431. return false
  1432. } else {
  1433. this.patientTableData = []
  1434. this.all_table_data = []
  1435. this.hisPatientDatas = []
  1436. let one_count = 0
  1437. let two_count = 0
  1438. let three_count = 0
  1439. for (let i = 0; i < response.data.data.list.length; i++) {
  1440. this.all_table_data.push(response.data.data.list[i])
  1441. if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1) {
  1442. one_count = one_count + 1
  1443. }
  1444. if (response.data.data.list[i].order.order_status == 2) {
  1445. two_count = two_count + 1
  1446. }
  1447. if (response.data.data.list[i].order.order_status == 3) {
  1448. three_count = three_count + 1
  1449. }
  1450. }
  1451. switch (this.radio) {
  1452. case 1:
  1453. this.patientTableData = []
  1454. for (let i = 0; i < this.all_table_data.length; i++) {
  1455. if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
  1456. this.patientTableData.push(this.all_table_data[i])
  1457. }
  1458. }
  1459. break
  1460. case 2:
  1461. this.patientTableData = []
  1462. for (let i = 0; i < this.all_table_data.length; i++) {
  1463. if (this.all_table_data[i].order.order_status == 2) {
  1464. this.patientTableData.push(this.all_table_data[i])
  1465. }
  1466. }
  1467. break
  1468. case 3:
  1469. this.patientTableData = []
  1470. for (let i = 0; i < this.all_table_data.length; i++) {
  1471. if (this.all_table_data[i].order.order_status == 3) {
  1472. this.patientTableData.push(this.all_table_data[i])
  1473. }
  1474. }
  1475. break
  1476. case 4:
  1477. this.patientTableData = []
  1478. this.patientTableData = this.all_table_data
  1479. break
  1480. }
  1481. this.hisPatientDatas = response.data.data.list_two
  1482. this.cal_one = one_count
  1483. this.cal_two = two_count
  1484. this.cal_three = three_count
  1485. this.current_index = 0
  1486. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1487. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  1488. }
  1489. })
  1490. }, setMonthPrescription(month_prescriptions) {
  1491. this.month_prescriptions = []
  1492. let drug_month_prescriptions = {
  1493. advices: []
  1494. }
  1495. let drug_ids = []
  1496. let project_month_prescriptions = {
  1497. project: []
  1498. }
  1499. let project_ids = []
  1500. let addition_month_prescriptions = {
  1501. addition: []
  1502. }
  1503. let additions_ids = []
  1504. for (let i = 0; i < month_prescriptions.length; i++) {
  1505. if (month_prescriptions[i].type == 1) { //药品
  1506. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  1507. drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  1508. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  1509. }
  1510. } else if (month_prescriptions[i].type == 2) { //项目
  1511. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1512. project_ids.push(month_prescriptions[i].project[a].project_id)
  1513. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  1514. }
  1515. }
  1516. //附加收费
  1517. for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  1518. additions_ids.push(month_prescriptions[i].addition[a].item_id)
  1519. addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  1520. }
  1521. }
  1522. const obj = {}
  1523. const obj1 = {}
  1524. const obj2 = {}
  1525. drug_ids = drug_ids.reduce((cur, next) => {
  1526. obj[next] ? '' : obj[next] = true && cur.push(next)
  1527. return cur
  1528. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1529. project_ids = project_ids.reduce((cur, next) => {
  1530. obj1[next] ? '' : obj1[next] = true && cur.push(next)
  1531. return cur
  1532. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1533. additions_ids = additions_ids.reduce((cur, next) => {
  1534. obj2[next] ? '' : obj2[next] = true && cur.push(next)
  1535. return cur
  1536. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1537. console.log(drug_ids)
  1538. console.log(project_ids)
  1539. console.log(additions_ids)
  1540. console.log(additions_ids)
  1541. let drugs = []
  1542. let projects = []
  1543. let additions = []
  1544. for (let i = 0; i < drug_ids.length; i++) {
  1545. let obj = {}
  1546. let count = 0
  1547. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  1548. if (drug_ids[i] == drug_month_prescriptions.advices[a].drug_id) {
  1549. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  1550. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  1551. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  1552. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  1553. obj['day'] = drug_month_prescriptions.advices[a].day
  1554. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  1555. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  1556. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  1557. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  1558. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  1559. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  1560. count = count + drug_month_prescriptions.advices[a].prescribing_number
  1561. }
  1562. }
  1563. obj['prescribing_number'] = count
  1564. drugs.push(obj)
  1565. }
  1566. for (let i = 0; i < project_ids.length; i++) {
  1567. let obj = {}
  1568. let count = 0
  1569. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1570. if (project_ids[i] == project_month_prescriptions.project[a].project_id) {
  1571. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  1572. obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  1573. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  1574. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  1575. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  1576. obj['number_days'] = project_month_prescriptions.project[a].day
  1577. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  1578. obj['unit'] = project_month_prescriptions.project[a].unit
  1579. obj['project_id'] = project_month_prescriptions.project[a].project_id
  1580. count = count + project_month_prescriptions.project[a].count
  1581. // price = price + project_month_prescriptions.project[a].price
  1582. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  1583. }
  1584. }
  1585. obj['total'] = count
  1586. projects.push(obj)
  1587. }
  1588. for (let i = 0; i < additions_ids.length; i++) {
  1589. let obj = {}
  1590. let count = 0
  1591. console.log(addition_month_prescriptions.addition)
  1592. if (addition_month_prescriptions.addition) {
  1593. for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
  1594. if (project_ids[i] == addition_month_prescriptions.addition[a].item_id) {
  1595. obj['item_name'] = addition_month_prescriptions.addition[a].item_name
  1596. obj['id'] = addition_month_prescriptions.addition[a].id
  1597. obj['item_id'] = addition_month_prescriptions.addition[a].item_id
  1598. count = count + addition_month_prescriptions.addition[a].count
  1599. obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
  1600. }
  1601. }
  1602. obj['count'] = count
  1603. additions.push(obj)
  1604. }
  1605. }
  1606. console.log(drugs)
  1607. console.log(projects)
  1608. console.log(additions)
  1609. let p1 = {
  1610. name: '处方' + 1,
  1611. advices: drugs,
  1612. project: [],
  1613. type: 1,
  1614. addition: additions
  1615. }
  1616. let p2 = {
  1617. name: '处方' + 2,
  1618. type: 2,
  1619. project: projects,
  1620. advices: [],
  1621. addition: []
  1622. }
  1623. console.log(this.month_prescriptions)
  1624. console.log(this.curMonthPrescriptions)
  1625. this.month_prescriptions.push(p1)
  1626. this.month_prescriptions.push(p2)
  1627. this.curMonthPrescriptions = this.month_prescriptions[0]
  1628. },
  1629. unique(arr) {
  1630. const res = new Map()
  1631. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  1632. },
  1633. handleCurrentChange(val) {
  1634. this.curPrescriptions = {}
  1635. this.curMonthPrescriptions = {}
  1636. this.prescriptions = []
  1637. this.month_prescriptions = []
  1638. this.getPatientInformation(val.id, val.order.number)
  1639. this.patient_id = val.id
  1640. for (let i = 0; i < this.patientTableData.length; i++) {
  1641. if (this.patientTableData[i].id == val.id) {
  1642. this.current_index = i
  1643. }
  1644. }
  1645. },
  1646. //获取患者的基本信息
  1647. getPatientInformation(id, batch_number) {
  1648. let params = {
  1649. 'record_date': this.record_date,
  1650. 'patient_id': id,
  1651. 'number': batch_number,
  1652. 'start_time': this.other_start_time,
  1653. 'end_time': this.other_end_time
  1654. }
  1655. this.loading = true
  1656. getChargeHisPatientInfo(params).then(response => {
  1657. if (response.data.state == 0) {
  1658. this.loading = false
  1659. this.$message.error(response.data.msg)
  1660. return false
  1661. } else {
  1662. this.prescriptions = []
  1663. this.month_prescriptions = []
  1664. this.curPrescriptions = {}
  1665. this.curMonthPrescriptions = {}
  1666. this.loading = false
  1667. this.patientInfo = response.data.data.xt_info
  1668. this.hisPatientInfo = response.data.data.his_info
  1669. this.info = response.data.data.info
  1670. this.order = response.data.data.order
  1671. this.p_type = ''
  1672. this.sick_type = ''
  1673. this.diagnosis = ''
  1674. this.sick_history = ''
  1675. if (this.info.id > 0) {
  1676. this.p_type = this.info.register_type
  1677. this.sick_type = this.info.sick_type
  1678. this.diagnosis = this.info.diagnosis
  1679. this.sick_history = this.info.sick_history
  1680. if (this.info.register_type == 0) {
  1681. this.p_type = ''
  1682. }
  1683. if (this.info.sick_type == 0) {
  1684. this.sick_type = ''
  1685. }
  1686. if (this.info.diagnosis == 0) {
  1687. this.diagnosis = ''
  1688. }
  1689. } else {
  1690. this.p_type = ''
  1691. this.sick_type = ''
  1692. this.diagnosis = ''
  1693. this.sick_history = ''
  1694. }
  1695. this.addtions_charge = response.data.data.addtions_charge
  1696. this.setMonthPrescription(response.data.data.month_prescriptions)
  1697. if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
  1698. this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
  1699. } else {
  1700. this.prescription_id = 0
  1701. }
  1702. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1703. var prescription = response.data.data.prescription[i]
  1704. let tempAdvice = []
  1705. let tempProject = []
  1706. let tempAddition = []
  1707. for (let b = 0; b < prescription.advices.length; b++) {
  1708. let obj = {
  1709. advice_id: prescription.advices[b].id,
  1710. drug_name: prescription.advices[b].advice_name,
  1711. single_dose: prescription.advices[b].single_dose,
  1712. delivery_way: prescription.advices[b].delivery_way,
  1713. execution_frequency: prescription.advices[b].execution_frequency,
  1714. retail_price: prescription.advices[b].price.toString(),
  1715. remark: prescription.advices[b].remark,
  1716. day: prescription.advices[b].day,
  1717. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1718. single_dose_unit: prescription.advices[b].single_dose_unit,
  1719. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1720. medical_insurance_number: prescription.advices[b].med_list_codg
  1721. }
  1722. tempAdvice.push(obj)
  1723. }
  1724. for (let b = 0; b < prescription.project.length; b++) {
  1725. console.log(prescription.project[b].project.project_name)
  1726. let obj = {
  1727. id: prescription.project[b].id,
  1728. project_id: prescription.project[b].project.id,
  1729. project_name: prescription.project[b].project.project_name,
  1730. statistical_classification: prescription.project[b].project.statistical_classification,
  1731. single_dose: prescription.project[b].single_dose,
  1732. delivery_way: prescription.project[b].delivery_way,
  1733. execution_frequency: prescription.project[b].execution_frequency,
  1734. number_days: prescription.project[b].day,
  1735. total: prescription.project[b].count.toString(),
  1736. price: prescription.project[b].price,
  1737. remark: prescription.project[b].remark,
  1738. medical_code: prescription.project[b].project.medical_code,
  1739. unit: prescription.project[b].project.unit
  1740. }
  1741. tempProject.push(obj)
  1742. }
  1743. for (let b = 0; b < prescription.addition.length; b++) {
  1744. let obj = {
  1745. id: prescription.addition[b].id,
  1746. item_name: prescription.addition[b].item_name,
  1747. price: prescription.addition[b].price,
  1748. count: prescription.addition[b].count,
  1749. item_id: prescription.addition[b].item_id
  1750. }
  1751. tempAddition.push(obj)
  1752. }
  1753. let index = i + 1
  1754. let obj = {
  1755. id: prescription.id,
  1756. name: '处方' + index,
  1757. advices: tempAdvice,
  1758. project: tempProject,
  1759. addition: tempAddition,
  1760. order_status: prescription.order_status,
  1761. type: prescription.type
  1762. }
  1763. this.prescriptions.push(obj)
  1764. }
  1765. if (this.prescriptions.length > 0) {
  1766. this.curPrescriptions = this.prescriptions[0]
  1767. } else {
  1768. this.curPrescriptions = {}
  1769. }
  1770. if (this.month_prescriptions.length > 0) {
  1771. this.curMonthPrescriptions = this.month_prescriptions[0]
  1772. } else {
  1773. this.curMonthPrescriptions = {}
  1774. }
  1775. this.total = 0
  1776. this.total = this.getTotalOne()
  1777. this.month_total = this.getMonthTotalOne()
  1778. }
  1779. })
  1780. }
  1781. },
  1782. mounted() {
  1783. const that = this
  1784. window.onresize = () => {
  1785. return (() => {
  1786. window.fullHeight = document.documentElement.clientHeight
  1787. that.fullHeight = window.fullHeight
  1788. })()
  1789. }
  1790. },
  1791. watch: {
  1792. fullHeight(val) {
  1793. if (!this.timer) {
  1794. this.fullHeight = val
  1795. let tableHeight = val - 243
  1796. this.tableHeight = tableHeight
  1797. this.timer = true
  1798. let that = this
  1799. setTimeout(function() {
  1800. that.timer = false
  1801. }, 400)
  1802. }
  1803. }
  1804. }
  1805. }
  1806. </script>
  1807. <style lang="scss" scoped>
  1808. .app-container {
  1809. height: 100%;
  1810. }
  1811. .outpatientChargesManagement {
  1812. height: 100%;
  1813. display: flex;
  1814. flex-direction: column;
  1815. .mainLeft {
  1816. width: 200px;
  1817. height: 100%;
  1818. display: flex;
  1819. flex-direction: column;
  1820. padding-top: 20px;
  1821. .el-radio {
  1822. margin-right: 5px;
  1823. }
  1824. }
  1825. .mainCell {
  1826. height: 36px;
  1827. display: flex;
  1828. align-items: center;
  1829. }
  1830. .fixedCell {
  1831. position: fixed;
  1832. z-index: 99;
  1833. right: 42px;
  1834. background: #fff;
  1835. display: flex;
  1836. justify-content: space-between;
  1837. }
  1838. .mainRight {
  1839. margin-left: 10px;
  1840. flex: 1;
  1841. height: 100%;
  1842. display: flex;
  1843. flex-direction: column;
  1844. overflow-y: auto;
  1845. .cellSpan {
  1846. min-width: 80px;
  1847. display: inline-block;
  1848. margin-right: 10px;
  1849. }
  1850. }
  1851. .tabsBox {
  1852. position: relative;
  1853. height: 90%;
  1854. overflow-y: auto;
  1855. margin-bottom: 60px;
  1856. .el-tabs__item {
  1857. padding: 0 10px;
  1858. }
  1859. }
  1860. .addTab {
  1861. position: absolute;
  1862. right: 6px;
  1863. top: 3px;
  1864. z-index: 20;
  1865. }
  1866. .mainCenter {
  1867. display: flex;
  1868. flex: 1;
  1869. height: 100%;
  1870. }
  1871. .costBox {
  1872. width: 100%;
  1873. height: 60px;
  1874. background: #fff;
  1875. position: absolute;
  1876. bottom: 0;
  1877. display: flex;
  1878. align-items: center;
  1879. justify-content: space-between;
  1880. }
  1881. .centerLeft {
  1882. flex: 1;
  1883. display: flex;
  1884. flex-direction: column;
  1885. position: relative;
  1886. }
  1887. .preTabs {
  1888. height: 100%;
  1889. display: flex;
  1890. flex-direction: column;
  1891. .el-tab-pane {
  1892. height: auto !important;
  1893. }
  1894. }
  1895. .settlementTabs {
  1896. flex: 1;
  1897. .el-tab-pane {
  1898. height: 100%;
  1899. }
  1900. .el-tabs__content {
  1901. height: 100%;
  1902. }
  1903. }
  1904. .centerRight {
  1905. width: 300px;
  1906. margin-left: 10px;
  1907. display: flex;
  1908. flex-direction: column;
  1909. overflow-y: auto;
  1910. }
  1911. .RP {
  1912. color: #409EFF;
  1913. font-size: 20px;
  1914. margin-bottom: 5px;
  1915. }
  1916. .centerRightTitle {
  1917. color: #409EFF;
  1918. }
  1919. .basicUl {
  1920. border-top: 1px solid #e5e5e5;
  1921. border-left: 1px solid #e5e5e5;
  1922. display: flex;
  1923. flex-wrap: wrap;
  1924. li {
  1925. border-bottom: 1px solid #e5e5e5;
  1926. border-right: 1px solid #e5e5e5;
  1927. width: 100%;
  1928. min-height: 38px;
  1929. /* line-height: 38px;
  1930. text-indent: 5px; */
  1931. font-size: 14px;
  1932. display: flex;
  1933. align-items: center;
  1934. padding: 5px;
  1935. box-sizing: border-box;
  1936. }
  1937. }
  1938. }
  1939. </style>
  1940. <style lang="scss">
  1941. #tab-more {
  1942. .el-icon-close {
  1943. display: none;
  1944. }
  1945. }
  1946. .settlementTabs {
  1947. .el-tabs__content {
  1948. height: 90%;
  1949. }
  1950. }
  1951. .preTabs {
  1952. .el-tabs__content {
  1953. flex: 1;
  1954. overflow-y: auto;
  1955. padding: 5px 0 5px 5px;
  1956. }
  1957. }
  1958. .centerDialog {
  1959. .el-dialog__body {
  1960. max-height: calc(100vh - 100px) !important;
  1961. padding: 0 20px;
  1962. }
  1963. }
  1964. </style>