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

chargeDetailManagement.vue 63KB

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