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

outpatientChargesManagement.vue 38KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  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;">
  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>人</el-radio>-->
  20. <!--<el-radio :label=2>已收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_two}}</span>人</el-radio>-->
  21. <!--<el-radio :label=3>已退费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_three}}</span>人</el-radio>-->
  22. <!--<el-radio :label=4>全部</el-radio>-->
  23. </el-radio-group>
  24. </div>
  25. <div class="mainCell" style="margin-bottom:10px;">
  26. <el-input size="small" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
  27. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary" @click="searchAction">
  28. 搜索
  29. </el-button>
  30. </div>
  31. <div>
  32. <el-table :data="patientTableData" :height="tableHeight" border style="width: 100%;"
  33. :row-style="{ color: '#303133' }"
  34. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  35. highlight-current-row ref="tab"
  36. @current-change="handleCurrentChange">
  37. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  38. <template slot-scope="scope">{{scope.row.patients?scope.row.patients.name:''}}</template>
  39. </el-table-column>
  40. <el-table-column align="center" prop="name" label="就诊号" width="110">
  41. <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}</template>
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. </div>
  46. <div class="mainRight">
  47. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  48. <!-- <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">打印处置单</el-button>
  49. <el-button size="small" @click="open(2)" type="primary">打印治疗单</el-button> -->
  50. <el-button size="small" @click="open(3)" type="primary">打印</el-button>
  51. <el-button v-loading="loadingone" size="small"
  52. @click="open(6)"
  53. v-if="this.hisPatientInfo && this.hisPatientInfo.id == 0"
  54. type="primary">挂号
  55. </el-button>
  56. <el-button v-loading="loadingtwo" v-if="this.info.prescription_status == 1" size="small"
  57. @click="open(4)"
  58. type="primary">收费
  59. </el-button>
  60. <el-button size="small" @click="open(5)" type="primary"
  61. v-if="this.info && this.info.prescription_status == 3">退费
  62. </el-button>
  63. </div>
  64. <div class="mainCenter">
  65. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  66. <el-tab-pane label="日结" name="first">
  67. <div style="display:flex;height:100%;">
  68. <div class="centerLeft">
  69. <div class="tabsBox">
  70. <!--<el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>-->
  71. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card" @tab-click="tabclickEvent">
  72. <el-tab-pane
  73. v-for="(item, index) in prescriptions"
  74. :key="index"
  75. :label="item.name"
  76. :name="item.name"
  77. >
  78. </el-tab-pane>
  79. <div class="RP">
  80. Rp
  81. <el-date-picker
  82. v-model="record_date"
  83. type="date"
  84. :clearable="false"
  85. @change="changeDate"
  86. format="yyyy-MM-dd"
  87. value-format="yyyy-MM-dd"
  88. placeholder="选择日期">
  89. </el-date-picker>
  90. </div>
  91. <prescription-table ref="prescription_tables"
  92. :prescription="curPrescriptions"></prescription-table>
  93. </el-tabs>
  94. </div>
  95. <div class="costBox">
  96. <span>当前处方总费用:<span style="color:red;">{{ total}}元</span></span>
  97. <span v-if="this.curPrescriptions.order_status == 1">待结算</span>
  98. <span v-if="this.curPrescriptions.order_status == 2">已结算</span>
  99. <span v-if="this.curPrescriptions.order_status == 3">已退费</span>
  100. </div>
  101. </div>
  102. <div class="centerRight">
  103. <p class="centerRightTitle">人员信息</p>
  104. <div style="display:flex;justify-content: space-between;line-height:30px;">
  105. <span style="font-size:14px;">人员编码:{{patientInfo.dialysis_no}}</span>
  106. <span style="font-size:14px;">日期:{{record_date}}</span>
  107. </div>
  108. <ul class="basicUl">
  109. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  110. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  111. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  112. <li style="width:50%;">身高:{{patientInfo.height?patientInfo.height:''}}</li>
  113. <li style="width:50%;">体重:{{patientInfo.weight?patientInfo.weight:''}}</li>
  114. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  115. <li style="width:100%;">地址:{{patientInfo.home_address}}</li>
  116. <li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>
  117. </ul>
  118. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  119. <div style="display:flex;justify-content: space-between;line-height:30px;">
  120. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number}}</span>
  121. </div>
  122. <ul class="basicUl">
  123. <li style="width:50%;">医生:{{ info.doctor }}</li>
  124. <li style="width:50%;">科室:{{ info.departments }}</li>
  125. <li style="width:100%;">总费用:{{ getTotal() }}</li>
  126. <li style="width:100%;">判断结果:{{info.diagnosis}}</li>
  127. <li style="width:100%;">是否有传染病:</li>
  128. <li style="width:100%;">血压:</li>
  129. </ul>
  130. </div>
  131. </div>
  132. </el-tab-pane>
  133. <!--<el-tab-pane label="月结" name="second">-->
  134. <!--<div style="display:flex;height:100%;">-->
  135. <!--<div class="centerLeft">-->
  136. <!--<div class="tabsBox">-->
  137. <!--&lt;!&ndash;<el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>&ndash;&gt;-->
  138. <!--<el-tabs class="preTabs" v-model="editableTabsValue" type="card" closable>-->
  139. <!--<el-tab-pane-->
  140. <!--v-for="(item, index) in editableTabs"-->
  141. <!--:key="index"-->
  142. <!--:label="item.title"-->
  143. <!--:name="item.name"-->
  144. <!--&gt;-->
  145. <!--<div class="RP">-->
  146. <!--Rp-->
  147. <!--<el-date-picker-->
  148. <!--style="width:420px;"-->
  149. <!--v-model="value1"-->
  150. <!--type="daterange"-->
  151. <!--range-separator="至"-->
  152. <!--start-placeholder="开始日期"-->
  153. <!--end-placeholder="结束日期">-->
  154. <!--</el-date-picker>-->
  155. <!--</div>-->
  156. <!--<prescription-table :preTableData='preTableData'></prescription-table>-->
  157. <!--</el-tab-pane>-->
  158. <!--&lt;!&ndash;<el-tab-pane name="more" closable><span slot="label"><i class="el-icon-plus" @click="addTab"></i></span></el-tab-pane>&ndash;&gt;-->
  159. <!--</el-tabs>-->
  160. <!--</div>-->
  161. <!--<div class="costBox">-->
  162. <!--<span>处方编号:2134348971237883</span>-->
  163. <!--<span>当前处方总费用:<span style="color:red;">{{ total }}元</span></span>-->
  164. <!--<span>{{ state }}</span>-->
  165. <!--</div>-->
  166. <!--</div>-->
  167. <!--<div class="centerRight">-->
  168. <!--<p class="centerRightTitle">人员信息</p>-->
  169. <!--<div style="display:flex;justify-content: space-between;line-height:30px;">-->
  170. <!--<span style="font-size:14px;">人员编码:</span>-->
  171. <!--<span style="font-size:14px;">日期:{{start_time}}</span>-->
  172. <!--</div>-->
  173. <!--<ul class="basicUl">-->
  174. <!--<li style="width:50%;">姓名:{{ patientInfo.name }}</li>-->
  175. <!--<li style="width:50%;">性别:{{ patientInfo && patientInfo.gend == 1 ? '男' : "女" }}</li>-->
  176. <!--<li style="width:50%;">年龄:{{ patientInfo.age }}</li>-->
  177. <!--<li style="width:50%;">身高:</li>-->
  178. <!--<li style="width:50%;">体重:</li>-->
  179. <!--<li style="width:50%;">电话:</li>-->
  180. <!--<li style="width:100%;">地址:</li>-->
  181. <!--<li style="width:100%;">过敏史:</li>-->
  182. <!--</ul>-->
  183. <!--<p class="centerRightTitle">诊断信息</p>-->
  184. <!--<div style="display:flex;justify-content: space-between;line-height:30px;">-->
  185. <!--<span style="font-size:14px;">门诊编号:676273816287361</span>-->
  186. <!--</div>-->
  187. <!--<ul class="basicUl">-->
  188. <!--<li style="width:50%;">医生:{{ doctor.name }}</li>-->
  189. <!--<li style="width:50%;">科室:{{ doctor.department }}</li>-->
  190. <!--<li style="width:100%;">费用:{{ doctor.total }}元</li>-->
  191. <!--<li style="width:100%;">判断结果:</li>-->
  192. <!--<li style="width:100%;">是否有传染病:</li>-->
  193. <!--<li style="width:100%;">血压:</li>-->
  194. <!--</ul>-->
  195. <!--</div>-->
  196. <!--</div>-->
  197. <!--</el-tab-pane>-->
  198. </el-tabs>
  199. </div>
  200. </div>
  201. </div>
  202. <additionalCharges ref='additionalCharges' @click="addCharges"
  203. :addtions_charge="addtions_charge"></additionalCharges>
  204. <register-dialog ref='register' v-on:confirm="confirm" v-on:cancel="cancel"></register-dialog>
  205. <charge-dialog ref='charge' v-on:confirm="chargeConfirm" v-on:cancel="chargeCancel"></charge-dialog>
  206. <el-dialog
  207. class="centerDialog"
  208. width="900px"
  209. title="打印"
  210. :visible.sync="treatVisible">
  211. <treatPrint :paramsObj='paramsObj'></treatPrint>
  212. </el-dialog>
  213. </div>
  214. </template>
  215. <script>
  216. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  217. import noCharge from './components/noCharge'
  218. import charged from './components/charged'
  219. import medicalInsuranceRefund from './components/medicalInsuranceRefund'
  220. import prescriptionTable from './components/prescriptionTable'
  221. import additionalCharges from './components/additionalCharges'
  222. import {getPatientInformation, getPatientList} from '@/api/project/project'
  223. import {getPatientInfo, getSchedulePatientList, Refund, register, upload} from '@/api/his/his'
  224. import RegisterDialog from "./components/registerDialog";
  225. import treatPrint from './treatPrint'
  226. import ChargeDialog from "./components/chargeDialog";
  227. const moment = require('moment')
  228. export default {
  229. components: {
  230. ChargeDialog,
  231. RegisterDialog,
  232. BreadCrumb,
  233. noCharge,
  234. charged,
  235. medicalInsuranceRefund,
  236. prescriptionTable,
  237. additionalCharges,
  238. treatPrint,
  239. },
  240. data() {
  241. return {
  242. crumbs: [
  243. {path: false, name: '门诊收费'},
  244. {path: false, name: '门诊收费管理'}
  245. ],
  246. current_index: 0,
  247. cal_one: '',
  248. cal_two: '',
  249. cal_three: '',
  250. tableHeight: '',
  251. fullHeight: document.documentElement.clientHeight,
  252. activeName: 'first',
  253. info: {},
  254. curPrescriptions: {},
  255. prescriptions: [],
  256. record_date: '',
  257. tableData: [],
  258. editableTabsValue: '处方1',
  259. loadingone: false,
  260. editableTabs: [{
  261. title: '处方1',
  262. name: '1'
  263. }],
  264. tabIndex: 1,
  265. hisPatientInfo: {},
  266. loadingtwo: false,
  267. patientTableData: [{
  268. name: '杨美英',
  269. mdtrt_id: '1709946'
  270. }],
  271. patientInfo: {id: 0},
  272. doctor: {},
  273. total: 0,
  274. state: '未收费',
  275. radio: 1,
  276. radioStatus: 1,
  277. search_input: '',
  278. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  279. patient_id: 0,
  280. prescription_id: 0,
  281. all_table_data: [],
  282. order: {},
  283. addtions_charge: [],
  284. treatVisible: false,
  285. paramsObj: {}
  286. }
  287. },
  288. created() {
  289. let tableHeight = document.body.clientHeight - 243
  290. this.tableHeight = tableHeight
  291. var nowDate = new Date()
  292. var nowYear = nowDate.getFullYear()
  293. var nowMonth = nowDate.getMonth() + 1
  294. var nowDay = nowDate.getDate()
  295. this.record_date =
  296. nowYear +
  297. '-' +
  298. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  299. '-' +
  300. (nowDay < 10 ? '0' + nowDay : nowDay)
  301. //获取患者信息
  302. this.getPatientList()
  303. },
  304. methods: {
  305. chargeConfirm(form){
  306. form['id'] = this.patientInfo.id
  307. form['record_time'] = this.record_date
  308. this.loadingtwo = true
  309. upload(form).then(response => {
  310. if (response.data.state == 0) {
  311. this.$message.error(response.data.msg)
  312. this.loadingtwo = false
  313. return false
  314. } else {
  315. this.state = '已收费'
  316. this.$message({message: '收费成功', type: 'success'})
  317. this.loadingtwo = false
  318. this.cal_one = this.cal_one - 1
  319. this.cal_two = this.cal_two + 1
  320. this.patientTableData.splice(this.current_index, 1)
  321. }
  322. })
  323. },chargeCancel(){
  324. this.$refs.charge.hide()
  325. },
  326. confirm(forms) {
  327. forms['id'] = this.patientInfo.id,
  328. forms['record_time'] = this.record_date,
  329. this.loadingone = true
  330. register(forms).then(response => {
  331. if (response.data.state == 0) {
  332. this.$message.error(response.data.msg)
  333. this.loadingone = false
  334. this.$refs.register.hide()
  335. return false
  336. } else {
  337. this.$message({message: '挂号成功', type: 'success'})
  338. this.$refs.register.hide()
  339. this.loadingone = false
  340. var his_info = response.data.data.his_info
  341. this.hisPatientInfo = his_info
  342. }
  343. })
  344. }, cancel() {
  345. this.$refs.register.hide()
  346. },
  347. addCharges() {
  348. this.$refs.additionalCharges.show()
  349. },
  350. changeDate(val) {
  351. if (this.patientInfo.id == 0) {
  352. this.$message.error('请先选择患者')
  353. return
  354. }
  355. let params = {
  356. 'record_date': val,
  357. 'patient_id': this.patientInfo.id
  358. }
  359. getPatientInfo(params).then(response => {
  360. if (response.data.state == 0) {
  361. this.$message.error(response.data.msg)
  362. return false
  363. } else {
  364. this.patientInfo = response.data.data.xt_info
  365. this.hisPatientInfo = response.data.data.his_info
  366. this.info = response.data.data.info
  367. this.addtions_charge = response.data.data.addtions_charge
  368. this.prescriptions = []
  369. for (let i = 0; i < response.data.data.prescription.length; i++) {
  370. var prescription = response.data.data.prescription[i]
  371. let tempAdvice = []
  372. let tempProject = []
  373. for (let b = 0; b < prescription.advices.length; b++) {
  374. let obj = {
  375. advice_id: prescription.advices[b].id,
  376. drug_name: prescription.advices[b].advice_name,
  377. single_dose: prescription.advices[b].single_dose,
  378. delivery_way: prescription.advices[b].delivery_way,
  379. execution_frequency: prescription.advices[b].execution_frequency,
  380. retail_price: prescription.advices[b].price.toString(),
  381. remark: prescription.advices[b].remark,
  382. day: prescription.advices[b].day,
  383. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  384. single_dose_unit: prescription.advices[b].single_dose_unit,
  385. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  386. medical_insurance_number: prescription.advices[b].med_list_codg
  387. }
  388. tempAdvice.push(obj)
  389. }
  390. for (let b = 0; b < prescription.project.length; b++) {
  391. console.log(prescription.project[b].project.project_name)
  392. let obj = {
  393. id: prescription.project[b].id,
  394. project_id: prescription.project[b].project.id,
  395. project_name: prescription.project[b].project.project_name,
  396. statistical_classification: prescription.project[b].project.statistical_classification,
  397. single_dose: prescription.project[b].single_dose,
  398. delivery_way: prescription.project[b].delivery_way,
  399. execution_frequency: prescription.project[b].execution_frequency,
  400. number_days: prescription.project[b].day,
  401. total: prescription.project[b].count.toString(),
  402. price: prescription.project[b].price,
  403. remark: prescription.project[b].remark,
  404. medical_code: prescription.project[b].project.medical_code,
  405. unit: prescription.project[b].unit,
  406. }
  407. tempProject.push(obj)
  408. }
  409. let index = i + 1
  410. let obj = {
  411. id: prescription.id,
  412. name: '处方' + index,
  413. advices: tempAdvice,
  414. project: tempProject,
  415. type: response.data.data.prescription[i].type,
  416. order_status: response.data.data.prescription[i].order_status
  417. }
  418. this.prescriptions.push(obj)
  419. this.curPrescriptions = this.prescriptions[0]
  420. this.total = 0
  421. this.total = this.getTotalOne()
  422. }
  423. }
  424. })
  425. },
  426. handleClick() {
  427. },
  428. searchAction() {
  429. },
  430. tabclickEvent(val) {
  431. console.log('val', val.name)
  432. for (let i = 0; i < this.prescriptions.length; i++) {
  433. if (this.prescriptions[i].name == val.name) {
  434. this.curPrescriptions = {}
  435. var temp = this.deepClone(this.prescriptions[i])
  436. this.curPrescriptions = temp
  437. }
  438. }
  439. console.log('9999', this.curPrescriptions)
  440. this.prescription_id = this.curPrescriptions.id
  441. this.total = 0
  442. this.total = this.getTotalOne()
  443. }, deepClone(source) {
  444. if (!source && typeof source !== 'object') {
  445. throw new Error('error arguments', 'shallowClone')
  446. }
  447. const targetObj = source.constructor === Array ? [] : {}
  448. Object.keys(source).forEach((keys) => {
  449. if (source[keys] && typeof source[keys] === 'object') {
  450. targetObj[keys] = this.deepClone(source[keys])
  451. } else {
  452. targetObj[keys] = source[keys]
  453. }
  454. })
  455. return targetObj
  456. }, getTotalOne() {
  457. var total = 0
  458. if (this.curPrescriptions.type == 1) {
  459. if (this.curPrescriptions.advices != null) {
  460. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  461. total = total + Math.floor((this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number) * 100) / 100
  462. }
  463. }
  464. } else {
  465. if (this.curPrescriptions.project != null) {
  466. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  467. total = total + Math.floor((this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total) * 100) / 100
  468. }
  469. }
  470. }
  471. if (this.curPrescriptions.addition != null) {
  472. for (let b = 0; b < this.curPrescriptions.addition.length; b++) {
  473. total = total + Math.floor((this.curPrescriptions.addition[b].price * this.curPrescriptions.addition[b].count) * 100) / 100
  474. }
  475. }
  476. return Math.floor(total * 100) / 100
  477. },
  478. getTotal() {
  479. var total = 0
  480. for (let i = 0; i < this.prescriptions.length; i++) {
  481. if (this.prescriptions[i].advices != null) {
  482. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  483. total = total + Math.floor((this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number) * 100) / 100
  484. }
  485. }
  486. if (this.prescriptions[i].project != null) {
  487. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  488. total = total + Math.floor((this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total) * 100) / 100
  489. }
  490. }
  491. if (this.prescriptions[i].addition != null) {
  492. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  493. total = total + Math.floor((this.prescriptions[i].addition[b].price * this.prescriptions[i].addition[b].count) * 100) / 100
  494. }
  495. }
  496. }
  497. return Math.floor(total * 100) / 100
  498. },
  499. moreState(tab, event) {
  500. if (tab == 'more') {
  501. return false
  502. }
  503. },
  504. open(index) {
  505. if (index == 1) {
  506. } else if (index == 2) {
  507. this.$router.push('/outpatientDoctorStation/printtwo?record=' + this.record_date)
  508. } else if (index == 3) {
  509. let obj = {
  510. record_date: this.record_date,
  511. patient_id: this.patient_id,
  512. prescription_id: this.prescription_id
  513. }
  514. this.paramsObj = obj
  515. this.treatVisible = true
  516. // this.$router.push('/outpatientCharges/treatPrint?record_date=' + this.record_date + '&patient_id=' + this.patient_id + '&prescription_id=' + this.prescription_id)
  517. } else if (index == 4) {
  518. if (this.hisPatientInfo.id == 0) {
  519. this.$message({message: '该患者尚未挂号,请先挂号', type: 'error'})
  520. return
  521. }
  522. this.$refs.charge.show(this.getTotal())
  523. } else if (index == 5) {
  524. this.$confirm('是否退费', '退费', {
  525. confirmButtonText: '确 定',
  526. cancelButtonText: '取 消',
  527. type: 'warning'
  528. }).then(() => {
  529. let params = {
  530. 'order_id': this.order.id,
  531. 'number': this.order.number,
  532. }
  533. Refund(params).then(response => {
  534. if (response.data.state == 0) {
  535. this.$message.error(response.data.msg)
  536. this.loadingtwo = false
  537. return false
  538. } else {
  539. this.$message({message: '退费成功', type: 'success'})
  540. this.loadingtwo = false
  541. }
  542. })
  543. }).catch(() => {
  544. })
  545. } else if (index == 6) {
  546. if (this.patientInfo.id == 0) {
  547. this.$message.error('请先选择要挂号的病人')
  548. return
  549. }
  550. this.$refs.register.show(this.patientInfo)
  551. }
  552. },
  553. choosePatient() {
  554. console.log(id)
  555. this.radioStatus = id
  556. this.getPatientList()
  557. },
  558. changeRadio(id) {
  559. // console.log(id)
  560. // this.radioStatus = id
  561. // this.getPatientList()
  562. let temp_id = id
  563. let params = {
  564. 'record_date': this.record_date
  565. }
  566. getSchedulePatientList(params).then(response => {
  567. if (response.data.state == 0) {
  568. this.$message.error(response.data.msg)
  569. return false
  570. } else {
  571. this.patientTableData = []
  572. this.all_table_data = []
  573. let one_count = 0
  574. let two_count = 0
  575. let three_count = 0
  576. for (let i = 0; i < response.data.data.list.length; i++) {
  577. console.log('99999999', response.data.data.list)
  578. if (response.data.data.list[i].info.prescription_status == 0 || response.data.data.list[i].info.prescription_status == 1 || response.data.data.list[i].info.prescription_status == 2) {
  579. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  580. one_count = one_count + 1
  581. this.patientTableData.push(response.data.data.list[i])
  582. }
  583. }
  584. if (response.data.data.list[i].info.prescription_status == 3) {
  585. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  586. two_count = two_count + 1
  587. }
  588. }
  589. if (response.data.data.list[i].info.prescription_status == 4) {
  590. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  591. three_count = three_count + 1
  592. }
  593. }
  594. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  595. this.all_table_data.push(response.data.data.list[i])
  596. }
  597. }
  598. this.cal_one = one_count
  599. this.cal_two = two_count
  600. this.cal_three = three_count
  601. switch (temp_id) {
  602. case 1:
  603. this.patientTableData = []
  604. for (let i = 0; i < this.all_table_data.length; i++) {
  605. if (this.all_table_data[i].info.prescription_status == 0 || this.all_table_data[i].info.prescription_status == 1 || this.all_table_data[i].info.prescription_status == 2) {
  606. this.patientTableData.push(this.all_table_data[i])
  607. }
  608. }
  609. break
  610. case 2:
  611. this.patientTableData = []
  612. for (let i = 0; i < this.all_table_data.length; i++) {
  613. if (this.all_table_data[i].info.prescription_status == 3) {
  614. this.patientTableData.push(this.all_table_data[i])
  615. }
  616. }
  617. break
  618. case 3:
  619. this.patientTableData = []
  620. for (let i = 0; i < this.all_table_data.length; i++) {
  621. if (this.all_table_data[i].info.prescription_status == 4) {
  622. this.patientTableData.push(this.all_table_data[i])
  623. }
  624. }
  625. break
  626. case 4:
  627. this.patientTableData = []
  628. this.patientTableData = this.all_table_data
  629. break
  630. }
  631. this.current_index = 0
  632. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  633. this.getPatientInformation(this.patientTableData[0].patients.id, "")
  634. }
  635. })
  636. },
  637. //患者列表
  638. getPatientList() {
  639. let params = {
  640. 'record_date': this.record_date
  641. }
  642. getSchedulePatientList(params).then(response => {
  643. if (response.data.state == 0) {
  644. this.$message.error(response.data.msg)
  645. return false
  646. } else {
  647. this.patientTableData = []
  648. this.all_table_data = []
  649. let one_count = 0
  650. let two_count = 0
  651. let three_count = 0
  652. for (let i = 0; i < response.data.data.list.length; i++) {
  653. // console.log('99999999', response.data.data.list)
  654. if (response.data.data.list[i].info.prescription_status == 0 || response.data.data.list[i].info.prescription_status == 1 || response.data.data.list[i].info.prescription_status == 2) {
  655. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  656. one_count = one_count + 1
  657. this.patientTableData.push(response.data.data.list[i])
  658. }
  659. }
  660. if (response.data.data.list[i].info.prescription_status == 3) {
  661. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  662. two_count = two_count + 1
  663. }
  664. }
  665. if (response.data.data.list[i].info.prescription_status == 4) {
  666. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  667. three_count = three_count + 1
  668. }
  669. }
  670. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  671. this.all_table_data.push(response.data.data.list[i])
  672. }
  673. }
  674. this.cal_one = one_count
  675. this.cal_two = two_count
  676. this.cal_three = three_count
  677. this.current_index = 0
  678. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  679. this.getPatientInformation(this.patientTableData[0].patients.id, "")
  680. }
  681. })
  682. },
  683. unique(arr) {
  684. const res = new Map()
  685. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  686. },
  687. handleCurrentChange(val) {
  688. console.log('val', val)
  689. this.getPatientInformation(val.patients.id, val.info.batch_number)
  690. this.patient_id = val.patients.id
  691. for (let i = 0; i < this.patientTableData.length; i++) {
  692. if (this.patientTableData[i].patients.id == val.patients.id) {
  693. this.current_index = i
  694. }
  695. }
  696. },
  697. //获取患者的基本信息
  698. getPatientInformation(id, batch_number) {
  699. let params = {
  700. 'record_date': this.record_date,
  701. 'patient_id': id,
  702. 'number': batch_number,
  703. }
  704. getPatientInfo(params).then(response => {
  705. if (response.data.state == 0) {
  706. this.$message.error(response.data.msg)
  707. return false
  708. } else {
  709. this.patientInfo = response.data.data.xt_info
  710. this.hisPatientInfo = response.data.data.his_info
  711. this.info = response.data.data.info
  712. this.order = response.data.data.order
  713. this.addtions_charge = response.data.data.addtions_charge
  714. this.prescriptions = []
  715. console.log("9991323242r5253535", response.data.data.prescription)
  716. this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
  717. console.log("222222", this.prescription_id)
  718. for (let i = 0; i < response.data.data.prescription.length; i++) {
  719. var prescription = response.data.data.prescription[i]
  720. let tempAdvice = []
  721. let tempProject = []
  722. let tempAddition = []
  723. for (let b = 0; b < prescription.advices.length; b++) {
  724. let obj = {
  725. advice_id: prescription.advices[b].id,
  726. drug_name: prescription.advices[b].advice_name,
  727. single_dose: prescription.advices[b].single_dose,
  728. delivery_way: prescription.advices[b].delivery_way,
  729. execution_frequency: prescription.advices[b].execution_frequency,
  730. retail_price: prescription.advices[b].price.toString(),
  731. remark: prescription.advices[b].remark,
  732. day: prescription.advices[b].day,
  733. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  734. single_dose_unit: prescription.advices[b].single_dose_unit,
  735. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  736. medical_insurance_number: prescription.advices[b].med_list_codg
  737. }
  738. tempAdvice.push(obj)
  739. }
  740. for (let b = 0; b < prescription.project.length; b++) {
  741. console.log(prescription.project[b].project.project_name)
  742. let obj = {
  743. id: prescription.project[b].id,
  744. project_id: prescription.project[b].project.id,
  745. project_name: prescription.project[b].project.project_name,
  746. statistical_classification: prescription.project[b].project.statistical_classification,
  747. single_dose: prescription.project[b].single_dose,
  748. delivery_way: prescription.project[b].delivery_way,
  749. execution_frequency: prescription.project[b].execution_frequency,
  750. number_days: prescription.project[b].day,
  751. total: prescription.project[b].count.toString(),
  752. price: prescription.project[b].price,
  753. remark: prescription.project[b].remark,
  754. medical_code: prescription.project[b].project.medical_code
  755. }
  756. tempProject.push(obj)
  757. }
  758. for (let b = 0; b < prescription.addition.length; b++) {
  759. let obj = {
  760. id: prescription.addition[b].id,
  761. item_name: prescription.addition[b].item_name,
  762. price: prescription.addition[b].price,
  763. count: prescription.addition[b].count,
  764. item_id: prescription.addition[b].item_id,
  765. }
  766. tempAddition.push(obj)
  767. }
  768. let index = i + 1
  769. let obj = {
  770. id: prescription.id,
  771. name: '处方' + index,
  772. advices: tempAdvice,
  773. project: tempProject,
  774. addition: tempAddition,
  775. order_status: response.data.data.prescription[i].order_status,
  776. type: response.data.data.prescription[i].type
  777. }
  778. this.prescriptions.push(obj)
  779. this.curPrescriptions = this.prescriptions[0]
  780. this.total = 0
  781. this.total = this.getTotalOne()
  782. console.log(this.total)
  783. }
  784. }
  785. })
  786. }
  787. },
  788. mounted() {
  789. const that = this
  790. window.onresize = () => {
  791. return (() => {
  792. window.fullHeight = document.documentElement.clientHeight
  793. that.fullHeight = window.fullHeight
  794. })()
  795. }
  796. },
  797. watch: {
  798. fullHeight(val) {
  799. if (!this.timer) {
  800. this.fullHeight = val
  801. let tableHeight = val - 243
  802. this.tableHeight = tableHeight
  803. this.timer = true
  804. let that = this
  805. setTimeout(function () {
  806. that.timer = false
  807. }, 400)
  808. }
  809. }
  810. }
  811. }
  812. </script>
  813. <style lang="scss" scoped>
  814. .app-container {
  815. height: 100%;
  816. }
  817. .outpatientChargesManagement {
  818. height: 100%;
  819. display: flex;
  820. flex-direction: column;
  821. .mainLeft {
  822. width: 200px;
  823. height: 100%;
  824. display: flex;
  825. flex-direction: column;
  826. margin-top: 20px;
  827. .el-radio {
  828. margin-right: 5px;
  829. }
  830. }
  831. .mainCell {
  832. height: 36px;
  833. display: flex;
  834. align-items: center;
  835. }
  836. .fixedCell {
  837. position: fixed;
  838. z-index: 99;
  839. right: 42px;
  840. background: #fff;
  841. display: flex;
  842. justify-content: space-between;
  843. }
  844. .mainRight {
  845. margin-left: 10px;
  846. flex: 1;
  847. height: 100%;
  848. display: flex;
  849. flex-direction: column;
  850. overflow-y: auto;
  851. .cellSpan {
  852. min-width: 80px;
  853. display: inline-block;
  854. margin-right: 10px;
  855. }
  856. }
  857. .tabsBox {
  858. position: relative;
  859. height: 90%;
  860. overflow-y: auto;
  861. margin-bottom: 60px;
  862. .el-tabs__item {
  863. padding: 0 10px;
  864. }
  865. }
  866. .addTab {
  867. position: absolute;
  868. right: 6px;
  869. top: 3px;
  870. z-index: 20;
  871. }
  872. .mainCenter {
  873. display: flex;
  874. flex: 1;
  875. height:100%;
  876. }
  877. .costBox {
  878. width: 100%;
  879. height: 60px;
  880. background: #fff;
  881. position: absolute;
  882. bottom: 0;
  883. display: flex;
  884. align-items: center;
  885. justify-content: space-between;
  886. }
  887. .centerLeft {
  888. flex: 1;
  889. display: flex;
  890. flex-direction: column;
  891. position: relative;
  892. }
  893. .preTabs {
  894. height: 100%;
  895. display: flex;
  896. flex-direction: column;
  897. .el-tab-pane {
  898. height: auto !important;
  899. }
  900. }
  901. .settlementTabs {
  902. flex: 1;
  903. .el-tab-pane {
  904. height: 100%;
  905. }
  906. .el-tabs__content {
  907. height: 100%;
  908. }
  909. }
  910. .centerRight {
  911. width: 300px;
  912. margin-left: 10px;
  913. display: flex;
  914. flex-direction: column;
  915. overflow-y: auto;
  916. }
  917. .RP {
  918. color: #409EFF;
  919. font-size: 20px;
  920. margin-bottom: 5px;
  921. }
  922. .centerRightTitle {
  923. color: #409EFF;
  924. }
  925. .basicUl {
  926. border-top: 1px solid #e5e5e5;
  927. border-left: 1px solid #e5e5e5;
  928. display: flex;
  929. flex-wrap: wrap;
  930. li {
  931. border-bottom: 1px solid #e5e5e5;
  932. border-right: 1px solid #e5e5e5;
  933. width: 100%;
  934. height: 38px;
  935. line-height: 38px;
  936. text-indent: 5px;
  937. font-size: 14px;
  938. }
  939. }
  940. }
  941. </style>
  942. <style lang="scss">
  943. #tab-more {
  944. .el-icon-close {
  945. display: none;
  946. }
  947. }
  948. .settlementTabs {
  949. .el-tabs__content {
  950. height: 90%;
  951. }
  952. }
  953. .preTabs {
  954. .el-tabs__content {
  955. flex: 1;
  956. overflow-y: auto;
  957. padding: 5px 0 5px 5px;
  958. }
  959. }
  960. </style>