chargeDetailManagement.vue 64KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809
  1. <template>
  2. <div class="main-contain outpatientChargesManagement">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  7. <div class="mainLeft">
  8. <el-date-picker
  9. v-model="record_date"
  10. prefix-icon="el-icon-date"
  11. @change="changeTimeTwo"
  12. :editable="false"
  13. style="width: 100%;"
  14. type="date"
  15. :picker-options="pickerOptions"
  16. placeholder="选择开始时间"
  17. align="right"
  18. format="yyyy-MM-dd"
  19. value-format="yyyy-MM-dd">
  20. </el-date-picker>
  21. <div class="mainCell">
  22. <el-radio-group v-model="schedule_type" @change="changeScheduleType">
  23. <el-radio :label="1">上午</el-radio>
  24. <el-radio :label="2">下午</el-radio>
  25. <el-radio :label="3">晚上</el-radio>
  26. <el-radio :label="0">全部</el-radio>
  27. </el-radio-group>
  28. </div>
  29. <div class="mainCell">
  30. <el-radio-group v-model="radio" @change="changeRadio">
  31. <el-radio :label=1>未上传<span
  32. style="color: red;margin-bottom:10px;display: inline-block;">{{ un_upload_num }}</span>人
  33. </el-radio>
  34. <el-radio :label=2>已上传<span
  35. style="color: red;margin-bottom:10px;display: inline-block;">{{ upload_num }}</span>人
  36. </el-radio>
  37. </el-radio-group>
  38. </div>
  39. <div class="mainCell" style="margin-bottom:10px;">
  40. <el-input size="small" v-model.trim="search_input"
  41. class="filter-item"/>
  42. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  43. @click="searchAction">
  44. 搜索
  45. </el-button>
  46. </div>
  47. <div>
  48. <el-table :data="patientTableData" :height="tableHeight" border
  49. style="width: 100%;"
  50. :row-style="{ color: '#303133' }"
  51. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  52. highlight-current-row ref="tab"
  53. @current-change="handleCurrentChange">
  54. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  55. <template slot-scope="scope">{{ scope.$index + 1 }}.{{ scope.row.name }}</template>
  56. </el-table-column>
  57. <el-table-column align="center" prop="name" label="就诊号" width="110">
  58. <template slot-scope="scope">{{ scope.row ? scope.row.number : '' }}
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. </div>
  63. </div>
  64. <div class="mainRight">
  65. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  66. <div v-if="activeName == 'first'">
  67. <el-button
  68. v-if="(this.radio == 1 && this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0 )"
  69. size="small"
  70. @click="open(1)"
  71. type="primary">上传费用明细
  72. </el-button>
  73. <el-button
  74. v-if="(this.radio == 1 && this.hisPatientInfo.balance_accounts_type == 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0 )"
  75. size="small"
  76. @click="open(1)"
  77. type="primary">上传费用明细
  78. </el-button>
  79. <el-button
  80. v-if="( this.radio == 2 &&this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0)"
  81. size="small" @click="open(2)" type="primary"
  82. >撤销明细
  83. </el-button>
  84. </div>
  85. <div v-if="activeName == 'second'">
  86. <el-button
  87. v-if="( this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0 )"
  88. size="small"
  89. @click="open(1)"
  90. type="primary">上传费用明细
  91. </el-button>
  92. <el-button
  93. v-if="( this.hisPatientInfo.balance_accounts_type != 2 && this.hisPatientInfo.id > 0 && this.hisPatientInfo.in_hospital_status == 1 && this.hisPatientInfo.out_hospital_status == 0)"
  94. size="small" @click="open(2)" type="primary"
  95. >撤销明细
  96. </el-button>
  97. </div>
  98. </div>
  99. <div class="mainCenter" v-loading="loading">
  100. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  101. <el-tab-pane label="日结" name="first">
  102. <div style="display:flex;height:100%;">
  103. <div class="centerLeft">
  104. <div class="tabsBox">
  105. <!--<el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>-->
  106. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  107. @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. <!--<charge-prescription-table ref="prescription_tables"-->
  128. <!--:prescription="curPrescriptions"></charge-prescription-table>-->
  129. <!--<charge-prescription-table ref="prescription_tables" :prescription="curPrescriptions"></charge-prescription-table>-->
  130. <charge-prescription-table ref="prescription_tables"
  131. :manufacturers="manufacturers"
  132. :prescription="curPrescriptions"></charge-prescription-table>
  133. </el-tabs>
  134. </div>
  135. <div class="costBox">
  136. <span>当前处方总费用:<span style="color:red;">{{ total }}元</span></span>
  137. <span v-if="this.radio == 2">处方总价:<span style="color:red;">{{all_total+'元' + ' = 全自费总金额:'+fulamt_ownpay_amt + '元+' + '超限价总金额:' + overlmt_amt + '元+' + '先行自付金额:' + preselfpay_amt + '元+' + '符合正常范围总金额:' + inscp_scp_amt + '元' }}</span></span>
  138. <span v-if="this.radio == 1">处方总价:<span style="color:red;">{{all_total }}元</span></span>
  139. <!-- <span v-if="this.curPrescriptions.order_status == 1">待结算</span>-->
  140. <!-- <span v-if="this.curPrescriptions.order_status == 2">已结算</span>-->
  141. <!-- <span v-if="this.curPrescriptions.order_status == 3">已退费</span>-->
  142. </div>
  143. </div>
  144. <!-- <div class="centerRight">-->
  145. <!-- <p class="centerRightTitle">人员信息</p>-->
  146. <!-- <div style="display:flex;justify-content: space-between;line-height:30px;">-->
  147. <!-- <span style="font-size:14px;">人员编码:{{ patientInfo.dialysis_no }}</span>-->
  148. <!-- <span style="font-size:14px;">日期:{{ record_date }}</span>-->
  149. <!-- </div>-->
  150. <!-- <ul class="basicUl">-->
  151. <!-- <li style="width:50%;">姓名:{{ patientInfo.name }}</li>-->
  152. <!-- <li style="width:50%;">性别:{{ patientInfo.gender == 1 ? '男' : '女' }}</li>-->
  153. <!-- <li style="width:50%;">年龄:{{ patientInfo.age }}</li>-->
  154. <!-- <li style="width:50%;">电话:{{ patientInfo.phone }}</li>-->
  155. <!-- &lt;!&ndash;<span>过敏病史:</span>&ndash;&gt;-->
  156. <!-- &lt;!&ndash;<el-autocomplete&ndash;&gt;-->
  157. <!-- &lt;!&ndash;style="width:100%;"&ndash;&gt;-->
  158. <!-- &lt;!&ndash;class="inline-input"&ndash;&gt;-->
  159. <!-- &lt;!&ndash;v-model="sick_history"&ndash;&gt;-->
  160. <!-- &lt;!&ndash;:fetch-suggestions="querySearch2"&ndash;&gt;-->
  161. <!-- &lt;!&ndash;placeholder="请输入内容"&ndash;&gt;-->
  162. <!-- &lt;!&ndash;&gt;</el-autocomplete>&ndash;&gt;-->
  163. <!-- &lt;!&ndash;<li style="width:100%;">地址:{{patientInfo.home_address}}</li>&ndash;&gt;-->
  164. <!-- &lt;!&ndash;<li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>&ndash;&gt;-->
  165. <!-- </ul>-->
  166. <!-- <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>-->
  167. <!-- <div style="display:flex;justify-content: space-between;line-height:30px;">-->
  168. <!-- <span style="font-size:14px;">住院编号:{{ hisPatientInfo.number }}</span>-->
  169. <!-- </div>-->
  170. <!-- <ul class="basicUl">-->
  171. <!-- <li style="width:50%;">医生:{{ info.doctor }}</li>-->
  172. <!-- <li style="width:50%;">科室:{{ info.departments }}</li>-->
  173. <!-- <li style="width:100%;">总费用:{{ getTotal() }}</li>-->
  174. <!-- <li style="width:100%;">判断结果:{{ info.diagnosis }}</li>-->
  175. <!-- <li style="width:100%;">是否有传染病:</li>-->
  176. <!-- <li style="width:100%;">血压:</li>-->
  177. <!-- </ul>-->
  178. <!-- </div>-->
  179. </div>
  180. </el-tab-pane>
  181. <el-tab-pane label="月结" name="second">
  182. <div style="display:flex;height:100%;">
  183. <div class="centerLeft">
  184. <div class="tabsBox">
  185. <!-- <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button> -->
  186. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  187. @tab-click="tabclickEventTwo">
  188. <el-tab-pane
  189. v-for="(item, index) in month_prescriptions"
  190. :key="index"
  191. :label="item.name"
  192. :name="item.name">
  193. </el-tab-pane>
  194. <div class="RP">
  195. Rp
  196. <el-date-picker
  197. v-model="other_start_time"
  198. prefix-icon="el-icon-date"
  199. @change="changeTime"
  200. :editable="false"
  201. style="width: 150px;"
  202. type="date"
  203. placeholder="选择开始时间"
  204. align="right"
  205. format="yyyy-MM-dd"
  206. value-format="yyyy-MM-dd">
  207. </el-date-picker>
  208. <span class>-</span>
  209. <el-date-picker
  210. v-model="other_end_time"
  211. prefix-icon="el-icon-date"
  212. @change="changeEndTime"
  213. :editable="false"
  214. style="width: 150px;"
  215. type="date"
  216. placeholder="选择结束时间"
  217. align="right"
  218. format="yyyy-MM-dd"
  219. value-format="yyyy-MM-dd">
  220. </el-date-picker>
  221. <el-select v-model="month_is_upload" @change="changeMonthData"
  222. placeholder="请选择">
  223. <el-option
  224. v-for="item in upload_options"
  225. :key="item.value"
  226. :label="item.label"
  227. :value="item.value">
  228. </el-option>
  229. </el-select>
  230. </div>
  231. <!--<prescription-table :preTableData='preTableData'></prescription-table>-->
  232. <!--<month-prescription-table ref="prescription_tables"-->
  233. <!--:activeType="activeType" :prescription="curMonthPrescriptions"></month-prescription-table>-->
  234. <charge-month-prescription-table
  235. :prescription="curMonthPrescriptions"></charge-month-prescription-table>
  236. </el-tabs>
  237. </div>
  238. <div class="costBox">
  239. <span>当前处方总费用:<span style="color:red;">{{ month_total }}元</span></span>
  240. <span>处方总价:<span style="color:red;">{{ all_month_total }}元</span></span>
  241. <!--<span>{{ state }}</span>-->
  242. </div>
  243. </div>
  244. <!-- <div class="centerRight">-->
  245. <!-- <p class="centerRightTitle">人员信息</p>-->
  246. <!-- <div style="display:flex;justify-content: space-between;line-height:30px;">-->
  247. <!-- <span style="font-size:14px;">人员编码:{{ patientInfo.dialysis_no }}</span>-->
  248. <!-- <span style="font-size:14px;">日期:{{ record_date }}</span>-->
  249. <!-- </div>-->
  250. <!-- <ul class="basicUl">-->
  251. <!-- <li style="width:50%;">姓名:{{ patientInfo.name }}</li>-->
  252. <!-- <li style="width:50%;">性别:{{ patientInfo.gender == 1 ? '男' : '女' }}</li>-->
  253. <!-- <li style="width:50%;">年龄:{{ patientInfo.age }}</li>-->
  254. <!-- <li style="width:50%;">电话:{{ patientInfo.phone }}</li>-->
  255. <!-- <li style="width:100%;">过敏史及其他病史:{{ info.sick_history }}</li>-->
  256. <!-- </ul>-->
  257. <!-- <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>-->
  258. <!-- <div style="display:flex;justify-content: space-between;line-height:30px;">-->
  259. <!-- <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number }}</span>-->
  260. <!-- </div>-->
  261. <!-- <ul class="basicUl">-->
  262. <!-- <li style="width:50%;">医生:{{ info.doctor }}</li>-->
  263. <!-- <li style="width:50%;">科室:{{ getDepartment(info.departments) }}</li>-->
  264. <!-- <li style="width:100%;" v-if="activeName == 'first'">总费用:{{ getTotal() }}</li>-->
  265. <!-- <li style="width:100%;" v-if="activeName == 'second'">总费用:{{ getTotalTwo() }}-->
  266. <!-- </li>-->
  267. <!-- <li style="width:100%;">判断结果:{{ info.diagnosis }}</li>-->
  268. <!-- &lt;!&ndash;<li style="width:100%;">是否有传染病:</li>&ndash;&gt;-->
  269. <!-- &lt;!&ndash;<li style="width:100%;">血压:</li>&ndash;&gt;-->
  270. <!-- </ul>-->
  271. <!-- </div>-->
  272. </div>
  273. </el-tab-pane>
  274. </el-tabs>
  275. </div>
  276. </div>
  277. </div>
  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 additionalCharges from './components/additionalCharges'
  287. import { getHisHospitalDetailInfo, getHisHospitalDetailList, getMonthHisHospitalDetailInfo } from '@/api/his/his'
  288. import { uParseTime } from '@/utils/tools'
  289. import RegisterDialog from './components/registerDialog'
  290. import treatPrint from './treatPrint'
  291. import statementPrint from './statementPrint'
  292. import ChargeDialog from './components/chargeDialog'
  293. import MonthPrescriptionTable from './components/monthPrescriptionTable'
  294. import ChargeMonthPrescriptionTable from './components/chargeMonthPrescriptionTable'
  295. import NewStatementPrintTwo from './newStatementPrintTwo'
  296. import RegisterDialog9504 from './components/registerDialog9504'
  297. import ChargePrescriptionTable from './components/ChargePrescriptionTable'
  298. import invoicePrint from './invoicePrint'
  299. import SettlePrescriptionTable from './components/settlePrescriptionTable'
  300. const moment = require('moment')
  301. export default {
  302. components: {
  303. SettlePrescriptionTable,
  304. ChargePrescriptionTable,
  305. RegisterDialog9504,
  306. NewStatementPrintTwo,
  307. ChargeMonthPrescriptionTable,
  308. MonthPrescriptionTable,
  309. ChargeDialog,
  310. RegisterDialog,
  311. BreadCrumb,
  312. noCharge,
  313. charged,
  314. medicalInsuranceRefund,
  315. additionalCharges,
  316. treatPrint,
  317. statementPrint,
  318. invoicePrint
  319. },
  320. data() {
  321. return {
  322. register: [
  323. { value: 11, label: '普通门诊' },
  324. // { value: 12, label: '门诊挂号' },
  325. // { value: 13, label: '急诊' },
  326. { value: 14, label: '门诊慢性病' }
  327. // { value: 15, label: '门诊统筹' },
  328. // { value: 16, label: '门诊慢性病' },
  329. // { value: 21, label: '普通住院' }
  330. ],
  331. upload_options: [
  332. { value: 0, label: '全部' },
  333. { value: 2, label: '已上传' },
  334. { value: 1, label: '未上传' }
  335. ],
  336. loading: false,
  337. dise_loading: false,
  338. month_is_upload: 0,
  339. sick_history: '',
  340. p_type: '',
  341. sick_type: '',
  342. diagnosis: '',
  343. isShowUpload: 1,
  344. isShowWithdrawUpload: 1,
  345. schedule_type: 0,
  346. month_p_type: '',
  347. month_sick_type: '',
  348. month_diagnosis: '',
  349. key: '',
  350. other_start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  351. other_end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  352. curMonthPrescriptions: null,
  353. curSettlePrescriptions: null,
  354. month_total: 0,
  355. crumbs: [
  356. { path: false, name: '住院工作站' },
  357. { path: false, name: '住院收费管理' }
  358. ],
  359. current_index: 0,
  360. un_upload_num: '',
  361. upload_num: '',
  362. tableHeight: '',
  363. fullHeight: document.documentElement.clientHeight,
  364. activeName: 'first',
  365. info: {},
  366. curPrescriptions: {},
  367. prescriptions: [],
  368. month_prescriptions: [],
  369. settle_prescriptions: [],
  370. settle_total: 0,
  371. all_total:0,
  372. all_month_total:0,
  373. record_date: '',
  374. tableData: [],
  375. editableTabsValue: '处方1',
  376. editSettletableTabsValue: '处方1',
  377. loadingone: false,
  378. editableTabs: [{
  379. title: '处方1',
  380. name: '1'
  381. }],
  382. tabIndex: 1,
  383. hisPatientInfo: {},
  384. loadingtwo: false,
  385. patientTableData: [{
  386. name: '杨美英',
  387. mdtrt_id: '1709946'
  388. }],
  389. patientInfo: { id: 0 },
  390. doctor: {},
  391. total: 0,
  392. state: '未收费',
  393. radio: 1,
  394. radioStatus: 1,
  395. search_input: '',
  396. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  397. patient_id: 0,
  398. prescription_id: 0,
  399. all_table_data: [],
  400. manufacturers: [],
  401. hisPatientDatas: [],
  402. order: {},
  403. addtions_charge: [],
  404. treatVisible: false,
  405. orderObj: {},
  406. paramsObj: {},
  407. newOrderObj: {},
  408. statementVisible: false,
  409. newStatementVisible: false,
  410. chargePatientTableData: [],
  411. sick: [],
  412. diagnoses: [],
  413. department: [],
  414. invoiceVisible: false,
  415. invoiceParams: {},
  416. fulamt_ownpay_amt:'',
  417. overlmt_amt:'',
  418. preselfpay_amt:'',
  419. inscp_scp_amt:'',
  420. }
  421. },
  422. created() {
  423. let tableHeight = document.body.clientHeight - 243
  424. this.tableHeight = tableHeight
  425. var nowDate = new Date()
  426. var nowYear = nowDate.getFullYear()
  427. var nowMonth = nowDate.getMonth() + 1
  428. var nowDay = nowDate.getDate()
  429. this.record_date =
  430. nowYear +
  431. '-' +
  432. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  433. '-' +
  434. (nowDay < 10 ? '0' + nowDay : nowDay)
  435. // this.getInitData()
  436. //获取患者信息
  437. this.getPatientList()
  438. },
  439. methods: {
  440. changeScheduleType() {
  441. this.getPatientList()
  442. },
  443. getMonthData() {
  444. this.loading = true
  445. let params = {
  446. 'id': this.hisPatientInfo.id,
  447. 'patient_id': this.hisPatientInfo.patient_id,
  448. 'start_time': this.other_start_time,
  449. 'end_time': this.other_end_time,
  450. 'is_upload': this.month_is_upload
  451. }
  452. getMonthHisHospitalDetailInfo(params).then(response => {
  453. if (response.data.state == 0) {
  454. this.loading = false
  455. this.$message.error(response.data.msg)
  456. return false
  457. } else {
  458. this.month_prescriptions = []
  459. this.curMonthPrescriptions = {}
  460. this.loading = false
  461. this.hisPatientInfo = response.data.data.his_info
  462. this.setMonthPrescription(response.data.data.month_prescriptions)
  463. this.month_total = this.getMonthTotalOne()
  464. this.all_month_total = this.getTotalTwo()
  465. }
  466. })
  467. },
  468. changeMonthData() {
  469. this.getMonthData()
  470. },
  471. getTimes(time) {
  472. return uParseTime(time, '{y}-{m}-{d}')
  473. },
  474. changeTimeTwo() {
  475. this.getPatientList()
  476. },
  477. changeTime(val) {
  478. this.getPatientInformation(this.hisPatientInfo.id, this.hisPatientInfo.patient_id)
  479. }, changeEndTime(val) {
  480. this.getPatientInformation(this.hisPatientInfo.id, this.hisPatientInfo.patient_id)
  481. },
  482. handleClick() {
  483. // this.getPatientList()
  484. if (this.activeName == 'first') {
  485. // this.patientTableData = this.all_table_data
  486. this.getDayPatientList()
  487. } else if (this.activeName == 'second') {
  488. this.getMonthPatientList()
  489. // this.getPatientList()
  490. // if (this.patientTableData.length > 0) {
  491. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  492. // this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  493. // }
  494. } else {
  495. console.log(this.settle_prescriptions)
  496. }
  497. },
  498. searchAction() {
  499. if (this.search_input.length == 0) {
  500. switch (this.radio) {
  501. case 1:
  502. this.patientTableData = this.all_table_data
  503. break
  504. case 2:
  505. this.patientTableData = this.all_table_data
  506. break
  507. }
  508. } else {
  509. switch (this.radio) {
  510. case 1:
  511. let arr3 = []
  512. for (let i = 0; i < this.all_table_data.length; i++) {
  513. if (this.all_table_data[i].name.indexOf(this.search_input) != -1) {
  514. arr3 = arr3.concat(this.all_table_data[i])
  515. }
  516. }
  517. this.patientTableData = arr3
  518. break
  519. case 2:
  520. let arr2 = []
  521. for (let i = 0; i < this.all_table_data.length; i++) {
  522. if (this.all_table_data[i].name.indexOf(this.search_input) != -1 ){
  523. arr2 = arr2.concat(this.all_table_data[i])
  524. }
  525. }
  526. this.patientTableData = arr2
  527. break
  528. }
  529. }
  530. },
  531. tabclickEventTwo(val) {
  532. for (let i = 0; i < this.month_prescriptions.length; i++) {
  533. if (this.month_prescriptions[i].name == val.name) {
  534. this.curMonthPrescriptions = {}
  535. var temp = this.deepClone(this.month_prescriptions[i])
  536. this.curMonthPrescriptions = temp
  537. }
  538. }
  539. this.prescription_id = this.month_prescriptions.id
  540. this.month_total = 0
  541. this.month_total = this.getMonthTotalOne()
  542. },
  543. tabclickEventThree(val) {
  544. for (let i = 0; i < this.settle_prescriptions.length; i++) {
  545. if (this.settle_prescriptions[i].name == val.name) {
  546. this.curSettlePrescriptions = {}
  547. var temp = this.deepClone(this.settle_prescriptions[i])
  548. this.curSettlePrescriptions = temp
  549. }
  550. }
  551. this.prescription_id = this.settle_prescriptions.id
  552. this.settle_total = 0
  553. this.settle_total = this.getSettleTotalOne()
  554. },
  555. tabclickEvent(val) {
  556. console.log('val', val.name)
  557. for (let i = 0; i < this.prescriptions.length; i++) {
  558. if (this.prescriptions[i].name == val.name) {
  559. this.curPrescriptions = {}
  560. var temp = this.deepClone(this.prescriptions[i])
  561. this.curPrescriptions = temp
  562. }
  563. }
  564. console.log('9999', this.curPrescriptions)
  565. this.prescription_id = this.curPrescriptions.id
  566. this.total = 0
  567. this.total = this.getTotalOne()
  568. },
  569. deepClone(source) {
  570. if (!source && typeof source !== 'object') {
  571. throw new Error('error arguments', 'shallowClone')
  572. }
  573. const targetObj = source.constructor === Array ? [] : {}
  574. Object.keys(source).forEach((keys) => {
  575. if (source[keys] && typeof source[keys] === 'object') {
  576. targetObj[keys] = this.deepClone(source[keys])
  577. } else {
  578. targetObj[keys] = source[keys]
  579. }
  580. })
  581. return targetObj
  582. },
  583. getTotalOne() {
  584. var total = 0
  585. if (this.curPrescriptions.type == 1) {
  586. if (this.curPrescriptions.advices != null) {
  587. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  588. total = parseFloat(total) + parseFloat(this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number)
  589. }
  590. }
  591. } else {
  592. if (this.curPrescriptions.project != null) {
  593. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  594. total = parseFloat(total) + parseFloat(this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total)
  595. }
  596. }
  597. }
  598. return total.toFixed(2)
  599. },
  600. getMonthTotalOne() {
  601. var total = 0
  602. if (this.curMonthPrescriptions.type == 1) {
  603. if (this.curMonthPrescriptions.advices != null) {
  604. for (let a = 0; a < this.curMonthPrescriptions.advices.length; a++) {
  605. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.advices[a].retail_price * this.curMonthPrescriptions.advices[a].prescribing_number)
  606. }
  607. }
  608. } else {
  609. if (this.curMonthPrescriptions.project != null) {
  610. for (let b = 0; b < this.curMonthPrescriptions.project.length; b++) {
  611. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.project[b].price * this.curMonthPrescriptions.project[b].total)
  612. }
  613. }
  614. }
  615. return total.toFixed(2)
  616. },
  617. getTotal() {
  618. var total = 0
  619. for (let i = 0; i < this.prescriptions.length; i++) {
  620. if (this.prescriptions[i].advices != null) {
  621. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  622. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number)
  623. }
  624. }
  625. if (this.prescriptions[i].project != null) {
  626. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  627. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total)
  628. }
  629. }
  630. }
  631. return total.toFixed(2)
  632. },
  633. getTotalTwo() {
  634. var total = 0
  635. for (let i = 0; i < this.month_prescriptions.length; i++) {
  636. if (this.month_prescriptions[i].advices != null) {
  637. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  638. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number)
  639. }
  640. }
  641. if (this.month_prescriptions[i].project != null) {
  642. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  643. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].project[a].price * this.month_prescriptions[i].project[a].total)
  644. }
  645. }
  646. }
  647. return total.toFixed(2)
  648. },
  649. moreState(tab, event) {
  650. if (tab == 'more') {
  651. return false
  652. }
  653. }, formatJson(filterVal, jsonData) {
  654. return jsonData.map(v => filterVal.map(j => v[j]))
  655. },
  656. open(index) {
  657. if (index == 2) {
  658. let settle_accounts_type = ''
  659. if (this.activeName == 'first') {
  660. settle_accounts_type = 1
  661. var that = this
  662. this.$confirm('是否撤销明细', '撤销明细', {
  663. confirmButtonText: '确 定',
  664. cancelButtonText: '取 消',
  665. type: 'warning'
  666. }).then(() => {
  667. let params = {
  668. 'settle_accounts_type': settle_accounts_type,
  669. 'patient_id': that.hisPatientInfo.patient_id,
  670. 'his_patient_id': that.hisPatientInfo.id,
  671. 'record_time': that.record_date,
  672. 'admin_user_id': that.$store.getters.xt_user.user.id
  673. }
  674. axios.get('http://127.0.0.1:9532/zh/api/refunddetail', {
  675. params: params
  676. })
  677. .then(function(response) {
  678. if (response.data.state == 0) {
  679. that.$message.error(response.data.msg)
  680. that.loadingtwo = false
  681. return false
  682. } else {
  683. if (response.data.data.failed_code == -10) {
  684. // that.$message.error(response.data.data.msg)
  685. that.$confirm(response.data.data.msg, '医保错误信息', {
  686. confirmButtonText: '确 定',
  687. type: 'warning'
  688. }).then(() => {
  689. }).catch(() => {
  690. })
  691. } else {
  692. that.$message.success('撤销明细成功')
  693. that.radio = 1
  694. that.getPatientList()
  695. }
  696. }
  697. })
  698. .catch(function(error) {
  699. })
  700. }).catch(() => {
  701. })
  702. } else {
  703. settle_accounts_type = 2
  704. var that = this
  705. this.$confirm('该操作会撤销此次入院后所有处方明细,是否继续操作?', '撤销明细', {
  706. confirmButtonText: '确 定',
  707. cancelButtonText: '取 消',
  708. type: 'warning'
  709. }).then(() => {
  710. let params = {
  711. 'settle_accounts_type': settle_accounts_type,
  712. 'patient_id': that.hisPatientInfo.patient_id,
  713. 'his_patient_id': that.hisPatientInfo.id,
  714. 'record_time': that.record_date,
  715. 'order_id': that.order.id,
  716. 'admin_user_id': that.$store.getters.xt_user.user.id
  717. }
  718. axios.get('http://127.0.0.1:9532/zh/api/refunddetail', {
  719. params: params
  720. })
  721. .then(function(response) {
  722. if (response.data.state == 0) {
  723. that.$message.error(response.data.msg)
  724. that.loadingtwo = false
  725. return false
  726. } else {
  727. if (response.data.data.failed_code == -10) {
  728. // that.$message.error(response.data.data.msg)
  729. that.$confirm(response.data.data.msg, '医保错误信息', {
  730. confirmButtonText: '确 定',
  731. type: 'warning'
  732. }).then(() => {
  733. }).catch(() => {
  734. })
  735. } else {
  736. that.$message.success('撤销明细成功')
  737. that.radio = 1
  738. that.getPatientList()
  739. }
  740. }
  741. })
  742. .catch(function(error) {
  743. })
  744. }).catch(() => {
  745. })
  746. }
  747. } else if (index == 1) {
  748. var that = this
  749. let params = {
  750. 'in_hospital_id': that.hisPatientInfo.id,
  751. 'id': that.hisPatientInfo.patient_id,
  752. 'admin_user_id': that.$store.getters.xt_user.user.id,
  753. 'record_time': that.record_date
  754. }
  755. if (this.activeName == 'first') {
  756. params['settle_accounts_type'] = 1
  757. } else {
  758. params['start_time'] = that.other_start_time
  759. params['end_time'] = that.other_end_time
  760. params['settle_accounts_type'] = 2
  761. }
  762. if (this.hisPatientInfo.balance_accounts_type != 2){
  763. axios.get('http://127.0.0.1:9532/zh/api/uploadinfo/get', {
  764. params: params
  765. })
  766. .then(function(response) {
  767. if (response.data.state == 0) {
  768. that.$message.error(response.data.msg)
  769. return false
  770. } else {
  771. if (response.data.data.failed_code == -10) {
  772. // that.$message.error(response.data.data.msg)
  773. that.$confirm(response.data.data.msg, '医保错误信息', {
  774. confirmButtonText: '确 定',
  775. type: 'warning'
  776. }).then(() => {
  777. }).catch(() => {
  778. })
  779. } else {
  780. that.$message.success('上传明细成功')
  781. that.radio = 2
  782. that.getPatientList()
  783. }
  784. }
  785. })
  786. .catch(function(error) {
  787. })
  788. }else if (this.hisPatientInfo.balance_accounts_type == 2){
  789. }
  790. }
  791. },
  792. changeRadio(id) {
  793. // this.hisPatientInfo = null
  794. this.getPatientList()
  795. },
  796. formatDecimal(num, decimal) {
  797. num = num.toString()
  798. let index = num.indexOf('.')
  799. if (index !== -1) {
  800. num = num.substring(0, decimal + index + 1)
  801. } else {
  802. num = num.substring(0)
  803. }
  804. return parseFloat(num).toFixed(decimal)
  805. },
  806. //患者列表
  807. getPatientList() {
  808. let params = {
  809. 'record_date': this.record_date,
  810. 'sch_type': this.schedule_type
  811. }
  812. getHisHospitalDetailList(params).then(response => {
  813. if (response.data.state == 0) {
  814. this.$message.error(response.data.msg)
  815. return false
  816. } else {
  817. if (response.data.data.list == null) {
  818. response.data.data.list = []
  819. }
  820. if (response.data.data.list_two == null) {
  821. response.data.data.list_two = []
  822. }
  823. this.hisPatientInfo = {}
  824. this.curPrescriptions = {}
  825. this.curMonthPrescriptions = {}
  826. this.month_prescriptions = []
  827. this.prescriptions = []
  828. this.patientTableData = []
  829. this.upload_num = response.data.data.upload_num
  830. this.un_upload_num = response.data.data.un_upload_num
  831. switch (this.radio) {
  832. case 1:
  833. this.all_table_data = response.data.data.list
  834. this.patientTableData = response.data.data.list
  835. if (this.hisPatientInfo.id > 0){
  836. for (let i = 0; i < this.patientTableData.length; i++) {
  837. if (this.hisPatientInfo.patient_id == this.patientTableData[i].patient_id) {
  838. this.current_index = i
  839. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  840. this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].id)
  841. }
  842. }
  843. }else{
  844. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  845. this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].id)
  846. }
  847. break
  848. case 2:
  849. this.all_table_data = response.data.data.list_two
  850. this.patientTableData = response.data.data.list_two
  851. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  852. this.getPatientInformation(this.chargePatientTableData[0].patient_id, this.patientTableData[0].id)
  853. break
  854. }
  855. }
  856. })
  857. },
  858. setMonthPrescription(month_prescriptions) {
  859. this.month_prescriptions = []
  860. let drug_month_prescriptions = {
  861. advices: []
  862. }
  863. let drug_ids = []
  864. let project_month_prescriptions = {
  865. project: []
  866. }
  867. let project_ids = []
  868. let addition_month_prescriptions = {
  869. addition: []
  870. }
  871. let additions_ids = []
  872. for (let i = 0; i < month_prescriptions.length; i++) {
  873. if (month_prescriptions[i].type == 1) { //药品
  874. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  875. let obj = {
  876. id: month_prescriptions[i].advices[a].drug_id,
  877. price: month_prescriptions[i].advices[a].price
  878. }
  879. drug_ids.push(obj)
  880. // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
  881. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  882. }
  883. } else if (month_prescriptions[i].type == 2) { //项目
  884. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  885. let obj = {
  886. id: month_prescriptions[i].project[a].project_id,
  887. price: month_prescriptions[i].project[a].price
  888. }
  889. project_ids.push(obj)
  890. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  891. }
  892. }
  893. }
  894. drug_ids = this.unique_two(drug_ids)
  895. project_ids = this.unique_two(project_ids)
  896. additions_ids = this.unique_two(additions_ids)
  897. let drugs = []
  898. let projects = []
  899. let additions = []
  900. for (let i = 0; i < drug_ids.length; i++) {
  901. let obj = {}
  902. let count = 0
  903. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  904. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  905. obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
  906. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  907. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  908. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  909. obj['day'] = drug_month_prescriptions.advices[a].day
  910. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  911. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  912. obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
  913. obj['id'] = drug_month_prescriptions.advices[a].drug_id
  914. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  915. obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  916. count = count + drug_month_prescriptions.advices[a].prescribing_number
  917. }
  918. }
  919. obj['prescribing_number'] = count
  920. drugs.push(obj)
  921. }
  922. for (let i = 0; i < project_ids.length; i++) {
  923. let obj = {}
  924. let count = 0
  925. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  926. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  927. if (project_month_prescriptions.project[a].type == 2) {
  928. obj['statistical_classification'] = ''
  929. obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  930. obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  931. obj['type'] = 2
  932. } else if (project_month_prescriptions.project[a].type == 3) {
  933. obj['statistical_classification'] = ''
  934. obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
  935. obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
  936. obj['type'] = 3
  937. }
  938. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name;
  939. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification;
  940. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  941. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  942. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  943. obj['number_days'] = project_month_prescriptions.project[a].day
  944. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code;
  945. obj['unit'] = project_month_prescriptions.project[a].unit
  946. obj['project_id'] = project_month_prescriptions.project[a].project_id
  947. count = count + parseFloat(project_month_prescriptions.project[a].count)
  948. // price = price + project_month_prescriptions.project[a].price
  949. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  950. }
  951. }
  952. obj['total'] = count
  953. projects.push(obj)
  954. }
  955. let p1 = {
  956. name: '处方' + 1,
  957. advices: drugs,
  958. project: [],
  959. type: 1,
  960. addition: additions
  961. }
  962. let p2 = {
  963. name: '处方' + 2,
  964. type: 2,
  965. project: projects,
  966. advices: [],
  967. addition: []
  968. }
  969. this.month_prescriptions.push(p1)
  970. this.month_prescriptions.push(p2)
  971. this.curMonthPrescriptions = this.month_prescriptions[0]
  972. },
  973. unique_two(array) {
  974. // res用来存储结果
  975. var res = []
  976. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  977. for (var j = 0, resLen = res.length; j < resLen; j++) {
  978. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  979. break
  980. }
  981. }
  982. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  983. if (j === resLen) {
  984. res.push(array[i])
  985. }
  986. }
  987. return res
  988. },
  989. unique(arr) {
  990. const res = new Map()
  991. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  992. },
  993. handleCurrentChange(val) {
  994. this.getPatientInformation(val.id, val.patient_id)
  995. },
  996. //获取患者的基本信息
  997. getPatientInformation(id, patient_id) {
  998. let params = {
  999. 'id': id,
  1000. 'record_date': this.record_date,
  1001. 'patient_id': patient_id,
  1002. 'start_time': this.other_start_time,
  1003. 'end_time': this.other_end_time,
  1004. 'is_upload': this.radio
  1005. }
  1006. this.loading = true
  1007. getHisHospitalDetailInfo(params).then(response => {
  1008. if (response.data.state == 0) {
  1009. this.loading = false
  1010. this.$message.error(response.data.msg)
  1011. return false
  1012. } else {
  1013. this.prescriptions = []
  1014. this.month_prescriptions = []
  1015. this.curPrescriptions = {}
  1016. this.curMonthPrescriptions = {}
  1017. this.loading = false
  1018. this.hisPatientInfo = response.data.data.his_info
  1019. this.setMonthPrescription(response.data.data.month_prescriptions)
  1020. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1021. var prescription = response.data.data.prescription[i]
  1022. let tempAdvice = []
  1023. let tempProject = []
  1024. let tempAddition = []
  1025. for (let b = 0; b < prescription.advices.length; b++) {
  1026. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  1027. let obj = {
  1028. advice_id: prescription.advices[b].id,
  1029. drug_name: prescription.advices[b].advice_name,
  1030. single_dose: prescription.advices[b].single_dose,
  1031. delivery_way: prescription.advices[b].delivery_way,
  1032. execution_frequency: prescription.advices[b].execution_frequency,
  1033. retail_price: prescription.advices[b].price.toString(),
  1034. remark: prescription.advices[b].remark,
  1035. day: prescription.advices[b].day,
  1036. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1037. single_dose_unit: prescription.advices[b].single_dose_unit,
  1038. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1039. medical_insurance_number: prescription.advices[b].med_list_codg,
  1040. spec: spec,
  1041. code: prescription.advices[b].drug.medical_insurance_number,
  1042. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  1043. name_id: prescription.advices[b].drug.manufacturer,
  1044. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
  1045. overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
  1046. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
  1047. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
  1048. execution_state: prescription.advices[b].execution_state,
  1049. }
  1050. tempAdvice.push(obj)
  1051. }
  1052. for (let b = 0; b < prescription.project.length; b++) {
  1053. let obj = {
  1054. id: prescription.project[b].id,
  1055. project_id: prescription.project[b].project.id,
  1056. // project_name: prescription.project[b].project.project_name,
  1057. // statistical_classification: prescription.project[b].project.statistical_classification,
  1058. single_dose: prescription.project[b].single_dose,
  1059. delivery_way: prescription.project[b].delivery_way,
  1060. execution_frequency: prescription.project[b].execution_frequency,
  1061. number_days: prescription.project[b].day,
  1062. total: prescription.project[b].count.toString(),
  1063. price: prescription.project[b].price,
  1064. remark: prescription.project[b].remark,
  1065. // medical_code: prescription.project[b].project.medical_code,
  1066. unit: prescription.project[b].project.unit,
  1067. type: prescription.project[b].type,
  1068. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
  1069. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
  1070. overlmt_amt: prescription.project[b].order_info.overlmt_amt,
  1071. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
  1072. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt,
  1073. execution_state: prescription.project[b].execution_state,
  1074. }
  1075. if (prescription.project[b].type == 2) {
  1076. obj['statistical_classification'] = prescription.project[b].team.project_team
  1077. obj['medical_code'] = prescription.project[b].project.medical_code
  1078. obj['project_name'] = prescription.project[b].project.project_name
  1079. obj['spec'] = ''
  1080. obj['name_id'] = 0
  1081. } else if (prescription.project[b].type == 3) {
  1082. obj['statistical_classification'] = prescription.project[b].team.project_team
  1083. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1084. obj['project_name'] = prescription.project[b].good_info.good_name
  1085. obj['spec'] = prescription.project[b].good_info.specification_name
  1086. obj['name_id'] = prescription.project[b].good_info.manufacturer
  1087. }
  1088. tempProject.push(obj)
  1089. }
  1090. let index = i + 1
  1091. let obj = {
  1092. id: prescription.id,
  1093. name: '处方' + index,
  1094. advices: tempAdvice,
  1095. project: tempProject,
  1096. addition: tempAddition,
  1097. order_status: prescription.order_status,
  1098. type: prescription.type
  1099. }
  1100. this.prescriptions.push(obj)
  1101. for (let i = 0; i < this.prescriptions.length; i++) {
  1102. if (this.prescriptions[i].order_status != 4) {
  1103. this.isShowUpload = 2
  1104. }
  1105. }
  1106. }
  1107. if (this.prescriptions.length > 0) {
  1108. this.curPrescriptions = this.prescriptions[0]
  1109. } else {
  1110. this.curPrescriptions = {}
  1111. }
  1112. if (this.month_prescriptions.length > 0) {
  1113. this.curMonthPrescriptions = this.month_prescriptions[0]
  1114. } else {
  1115. this.curMonthPrescriptions = {}
  1116. }
  1117. this.total = 0
  1118. this.total = this.getTotalOne()
  1119. this.month_total = this.getMonthTotalOne()
  1120. this.all_total = this.getTotal()
  1121. this.all_month_total = this.getTotalTwo()
  1122. this.fulamt_ownpay_amt = this.getFulamtOwnpayAmtTotal()
  1123. this.overlmt_amt = this.getOverlmtAmtTotal()
  1124. this.preselfpay_amt = this.getPreselfpayAmtTotal()
  1125. this.inscp_scp_amt = this.getInscpScpAmtTotal()
  1126. }
  1127. })
  1128. },getFulamtOwnpayAmtTotal(){
  1129. var total = 0
  1130. for (let i = 0; i < this.prescriptions.length; i++) {
  1131. if (this.prescriptions[i].advices != null) {
  1132. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1133. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].fulamt_ownpay_amt)
  1134. }
  1135. }
  1136. if (this.prescriptions[i].project != null) {
  1137. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1138. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].fulamt_ownpay_amt)
  1139. }
  1140. }
  1141. }
  1142. return total.toFixed(2)
  1143. },getOverlmtAmtTotal(){
  1144. var total = 0
  1145. for (let i = 0; i < this.prescriptions.length; i++) {
  1146. if (this.prescriptions[i].advices != null) {
  1147. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1148. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].overlmt_amt)
  1149. }
  1150. }
  1151. if (this.prescriptions[i].project != null) {
  1152. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1153. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].overlmt_amt)
  1154. }
  1155. }
  1156. }
  1157. return total.toFixed(2)
  1158. },getPreselfpayAmtTotal(){
  1159. var total = 0
  1160. for (let i = 0; i < this.prescriptions.length; i++) {
  1161. if (this.prescriptions[i].advices != null) {
  1162. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1163. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].preselfpay_amt)
  1164. }
  1165. }
  1166. if (this.prescriptions[i].project != null) {
  1167. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1168. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].preselfpay_amt)
  1169. }
  1170. }
  1171. }
  1172. return total.toFixed(2)
  1173. },getInscpScpAmtTotal(){
  1174. var total = 0
  1175. for (let i = 0; i < this.prescriptions.length; i++) {
  1176. if (this.prescriptions[i].advices != null) {
  1177. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  1178. total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].inscp_scp_amt)
  1179. }
  1180. }
  1181. if (this.prescriptions[i].project != null) {
  1182. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  1183. total = parseFloat(total) + parseFloat(this.prescriptions[i].project[b].inscp_scp_amt)
  1184. }
  1185. }
  1186. }
  1187. return total.toFixed(2)
  1188. },
  1189. sz_open(index) {
  1190. switch (index) {
  1191. case 1:
  1192. this.$refs.register9504.show()
  1193. break
  1194. case 2:
  1195. var that = this
  1196. if (this.activeName == 'first') {
  1197. this.settle_accounts_type = 1
  1198. } else {
  1199. this.settle_accounts_type = 2
  1200. this.start_time = this.other_start_time
  1201. this.end_time = this.other_end_time
  1202. this.settle_accounts_type = 2
  1203. }
  1204. let params = {
  1205. 'patient_id': this.patientInfo.id,
  1206. 'record_time': this.record_date,
  1207. 'settle_accounts_type': this.settle_accounts_type,
  1208. 'admin_user_id': this.$store.getters.xt_user.user.id
  1209. }
  1210. axios.get('http://127.0.0.1:9532/sz/api/upload/get', {
  1211. params: params,
  1212. headers: {
  1213. 'Permission': 5
  1214. }
  1215. })
  1216. .then(function(response) {
  1217. if (response.data.state == 0) {
  1218. that.$message.error(response.data.msg)
  1219. return false
  1220. } else {
  1221. if (response.data.data.failed_code == -10) {
  1222. // that.$message.error(response.data.data.msg)
  1223. that.$confirm(response.data.data.msg, '医保错误信息', {
  1224. confirmButtonText: '确 定',
  1225. type: 'warning'
  1226. }).then(() => {
  1227. }).catch(() => {
  1228. })
  1229. } else {
  1230. that.changeRadioAndPatient(1)
  1231. that.$message({ message: '预结算成功', type: 'success' })
  1232. }
  1233. }
  1234. })
  1235. .catch(function(error) {
  1236. })
  1237. break
  1238. case 3:
  1239. if (this.activeName == 'first') {
  1240. this.$refs.charge.show(this.getTotal())
  1241. } else {
  1242. this.$refs.charge.show(this.getTotalTwo())
  1243. }
  1244. break
  1245. case 4:
  1246. break
  1247. case 5:
  1248. var that = this
  1249. this.$confirm('是否退费', '退费', {
  1250. confirmButtonText: '确 定',
  1251. cancelButtonText: '取 消',
  1252. type: 'warning'
  1253. }).then(() => {
  1254. axios.get('http://127.0.0.1:9532/sz/api/refund/get', {
  1255. params: {
  1256. order_id: this.order.id,
  1257. record_time: this.record_date,
  1258. admin_user_id: this.$store.getters.xt_user.user.id,
  1259. patient_id: this.patientInfo.id
  1260. }
  1261. })
  1262. .then(function(response) {
  1263. if (response.data.state == 0) {
  1264. that.$message.error(response.data.msg)
  1265. return false
  1266. } else {
  1267. if (response.data.data.failed_code == -10) {
  1268. // that.$message.error(response.data.data.msg)
  1269. that.$confirm(response.data.data.msg, '医保错误信息', {
  1270. confirmButtonText: '确 定',
  1271. type: 'warning'
  1272. }).then(() => {
  1273. }).catch(() => {
  1274. })
  1275. } else {
  1276. that.changeRadioAndPatient(1)
  1277. that.$message({ message: '退费成功', type: 'success' })
  1278. }
  1279. }
  1280. })
  1281. .catch(function(error) {
  1282. })
  1283. }).catch(() => {
  1284. })
  1285. break
  1286. case 6:
  1287. var that = this
  1288. axios.get('http://127.0.0.1:9532/sz/api/settle/query', {
  1289. params: {
  1290. order_id: this.order.id,
  1291. record_time: this.record_date,
  1292. admin_user_id: this.$store.getters.xt_user.user.id,
  1293. patient_id: this.patientInfo.id
  1294. }
  1295. })
  1296. .then(function(response) {
  1297. if (response.data.state == 0) {
  1298. // that.$message.error(response.data.msg);
  1299. return false
  1300. } else {
  1301. if (response.data.data.failed_code == -10) {
  1302. // that.$message.error(response.data.data.msg)
  1303. that.$confirm(response.data.data.msg, '医保错误信息', {
  1304. confirmButtonText: '确 定',
  1305. type: 'warning'
  1306. }).then(() => {
  1307. }).catch(() => {
  1308. })
  1309. } else {
  1310. that.$message({ message: '查询成功', type: 'success' })
  1311. }
  1312. }
  1313. })
  1314. .catch(function(error) {
  1315. })
  1316. break
  1317. case 7:
  1318. var that = this
  1319. axios.get('http://127.0.0.1:9532/sz/api/detail/cancel', {
  1320. params: {
  1321. order_id: this.order.id,
  1322. record_time: this.record_date,
  1323. admin_user_id: this.$store.getters.xt_user.user.id,
  1324. patient_id: this.patientInfo.id
  1325. }
  1326. })
  1327. .then(function(response) {
  1328. if (response.data.state == 0) {
  1329. that.$message.error(response.data.msg)
  1330. return false
  1331. } else {
  1332. if (response.data.data.failed_code == -10) {
  1333. // that.$message.error(response.data.data.msg)
  1334. that.$confirm(response.data.data.msg, '医保错误信息', {
  1335. confirmButtonText: '确 定',
  1336. type: 'warning'
  1337. }).then(() => {
  1338. }).catch(() => {
  1339. })
  1340. } else {
  1341. that.$message({ message: '明细撤销成功', type: 'success' })
  1342. }
  1343. }
  1344. })
  1345. .catch(function(error) {
  1346. })
  1347. break
  1348. case 10:
  1349. this.newStatementVisible = true
  1350. let obj = {
  1351. record_time: this.record_date,
  1352. patient_id: this.patient_id,
  1353. prescription_id: this.prescription_id,
  1354. order_id: this.order.id,
  1355. admin_user_id: this.$store.getters.xt_user.user.id
  1356. }
  1357. this.newOrderObj = obj
  1358. // this.$refs.print.getInfo(this.order.id)
  1359. break
  1360. case 11:
  1361. var that = this
  1362. this.$confirm('是否退号', '退号', {
  1363. confirmButtonText: '确 定',
  1364. cancelButtonText: '取 消',
  1365. type: 'warning'
  1366. }).then(() => {
  1367. axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
  1368. params: {
  1369. order_id: this.order.id,
  1370. record_time: this.record_date,
  1371. admin_user_id: this.$store.getters.xt_user.user.id,
  1372. patient_id: this.patientInfo.id
  1373. }
  1374. })
  1375. .then(function(response) {
  1376. if (response.data.state == 0) {
  1377. that.$message.error(response.data.msg)
  1378. return false
  1379. } else {
  1380. if (response.data.data.failed_code == -10) {
  1381. // that.$message.error(response.data.data.msg)
  1382. that.$confirm(response.data.data.msg, '医保错误信息', {
  1383. confirmButtonText: '确 定',
  1384. type: 'warning'
  1385. }).then(() => {
  1386. }).catch(() => {
  1387. })
  1388. } else {
  1389. that.changeRadioAndPatient(1)
  1390. that.$message({ message: '退号成功', type: 'success' })
  1391. }
  1392. }
  1393. })
  1394. .catch(function(error) {
  1395. })
  1396. }).catch(() => {
  1397. })
  1398. break
  1399. }
  1400. }
  1401. },
  1402. mounted() {
  1403. const that = this
  1404. window.onresize = () => {
  1405. return (() => {
  1406. window.fullHeight = document.documentElement.clientHeight
  1407. that.fullHeight = window.fullHeight
  1408. })()
  1409. }
  1410. },
  1411. watch: {
  1412. fullHeight(val) {
  1413. if (!this.timer) {
  1414. this.fullHeight = val
  1415. let tableHeight = val - 243
  1416. this.tableHeight = tableHeight
  1417. this.timer = true
  1418. let that = this
  1419. setTimeout(function() {
  1420. that.timer = false
  1421. }, 400)
  1422. }
  1423. }
  1424. }
  1425. }
  1426. </script>
  1427. <style lang="scss" scoped>
  1428. .app-container {
  1429. height: 100%;
  1430. }
  1431. .outpatientChargesManagement {
  1432. height: 100%;
  1433. display: flex;
  1434. flex-direction: column;
  1435. .mainLeft {
  1436. width: 200px;
  1437. height: 100%;
  1438. display: flex;
  1439. flex-direction: column;
  1440. padding-top: 20px;
  1441. .el-radio {
  1442. margin-right: 5px;
  1443. }
  1444. }
  1445. .mainCell {
  1446. height: 36px;
  1447. display: flex;
  1448. align-items: center;
  1449. }
  1450. .fixedCell {
  1451. position: fixed;
  1452. z-index: 99;
  1453. right: 42px;
  1454. background: #fff;
  1455. display: flex;
  1456. justify-content: space-between;
  1457. }
  1458. .mainRight {
  1459. margin-left: 10px;
  1460. flex: 1;
  1461. height: 100%;
  1462. display: flex;
  1463. flex-direction: column;
  1464. overflow-y: auto;
  1465. .cellSpan {
  1466. min-width: 80px;
  1467. display: inline-block;
  1468. margin-right: 10px;
  1469. }
  1470. }
  1471. .tabsBox {
  1472. position: relative;
  1473. height: 90%;
  1474. overflow-y: auto;
  1475. margin-bottom: 60px;
  1476. .el-tabs__item {
  1477. padding: 0 10px;
  1478. }
  1479. }
  1480. .addTab {
  1481. position: absolute;
  1482. right: 6px;
  1483. top: 3px;
  1484. z-index: 20;
  1485. }
  1486. .mainCenter {
  1487. display: flex;
  1488. flex: 1;
  1489. height: 100%;
  1490. }
  1491. .costBox {
  1492. width: 100%;
  1493. height: 60px;
  1494. background: #fff;
  1495. position: absolute;
  1496. bottom: 0;
  1497. display: flex;
  1498. align-items: center;
  1499. justify-content: space-between;
  1500. }
  1501. .centerLeft {
  1502. flex: 1;
  1503. display: flex;
  1504. flex-direction: column;
  1505. position: relative;
  1506. }
  1507. .preTabs {
  1508. height: 100%;
  1509. display: flex;
  1510. flex-direction: column;
  1511. .el-tab-pane {
  1512. height: auto !important;
  1513. }
  1514. }
  1515. .settlementTabs {
  1516. flex: 1;
  1517. .el-tab-pane {
  1518. height: 100%;
  1519. }
  1520. .el-tabs__content {
  1521. height: 100%;
  1522. }
  1523. }
  1524. .centerRight {
  1525. width: 300px;
  1526. margin-left: 10px;
  1527. display: flex;
  1528. flex-direction: column;
  1529. overflow-y: auto;
  1530. }
  1531. .RP {
  1532. color: #409EFF;
  1533. font-size: 20px;
  1534. margin-bottom: 5px;
  1535. }
  1536. .centerRightTitle {
  1537. color: #409EFF;
  1538. }
  1539. .basicUl {
  1540. border-top: 1px solid #e5e5e5;
  1541. border-left: 1px solid #e5e5e5;
  1542. display: flex;
  1543. flex-wrap: wrap;
  1544. li {
  1545. border-bottom: 1px solid #e5e5e5;
  1546. border-right: 1px solid #e5e5e5;
  1547. width: 100%;
  1548. min-height: 38px;
  1549. /* line-height: 38px;
  1550. text-indent: 5px; */
  1551. font-size: 14px;
  1552. display: flex;
  1553. align-items: center;
  1554. padding: 5px;
  1555. box-sizing: border-box;
  1556. }
  1557. }
  1558. }
  1559. </style>
  1560. <style lang="scss">
  1561. #tab-more {
  1562. .el-icon-close {
  1563. display: none;
  1564. }
  1565. }
  1566. .settlementTabs {
  1567. .el-tabs__content {
  1568. height: 90%;
  1569. }
  1570. }
  1571. .preTabs {
  1572. .el-tabs__content {
  1573. flex: 1;
  1574. overflow-y: auto;
  1575. padding: 5px 0 5px 5px;
  1576. }
  1577. }
  1578. .centerDialog {
  1579. .el-dialog__body {
  1580. max-height: calc(100vh - 100px) !important;
  1581. padding: 0 20px;
  1582. }
  1583. }
  1584. </style>