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

chargeDetailManagement.vue 65KB

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