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

chargeDetailManagement.vue 65KB

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