outpatientChargesManagement.vue 88KB

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