MzSpltryRcrd.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. <template>
  2. <div class="layout_container">
  3. <header class="round-header">
  4. <el-date-picker
  5. style="width: 200px"
  6. v-model="dateRange"
  7. type="daterange"
  8. :shortcuts="shortcuts"
  9. range-separator="至"
  10. start-placeholder="开始日期"
  11. end-placeholder="结束日期"
  12. ></el-date-picker>
  13. <el-input v-model="patNo" style="width: 100px; margin-left: 2px" clearable placeholder="门诊id"></el-input>
  14. <el-select v-model="medType" style="width: 106px" placeholder="医疗类别" @change="handleMedTypeChange">
  15. <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
  16. </el-select>
  17. <el-cascader
  18. v-model="admdvsCascader"
  19. clearable filterable
  20. placeholder="参保地区"
  21. :options="allAdmdvses"
  22. @change="handleAdmdvsChange"
  23. style="width: 160px"
  24. :disabled="injuryMode === true"
  25. ></el-cascader>
  26. <el-select v-model="acctUsedFlag" style="width: 118px">
  27. <el-option label="不使用个账" value="0"></el-option>
  28. <el-option label="使用本人个账" value="1"></el-option>
  29. <el-option label="使用共济人个账" value="2"></el-option>
  30. </el-select>
  31. <el-select v-model="patMedInsPaused" style="width: 110px">
  32. <el-option label="患者正常参保" value="normal"></el-option>
  33. <el-option label="患者已停保" value="paused"></el-option>
  34. </el-select>
  35. <el-divider direction="vertical"></el-divider>
  36. <el-button type="primary" @click="fetchHistoryReceipts">历史处方</el-button>
  37. <ReadCard :pat-no="patNo" @success="afterReadCard"/>
  38. <el-dropdown trigger="click" @command="register">
  39. <el-button type="primary">
  40. 登记&nbsp;
  41. <el-icon>
  42. <ArrowDown/>
  43. </el-icon>
  44. </el-button>
  45. <template #dropdown>
  46. <el-dropdown-menu>
  47. <el-dropdown-item icon="CreditCard" command="execute">医保登记</el-dropdown-item>
  48. <el-dropdown-item icon="RefreshLeft" command="revoke">取消登记</el-dropdown-item>
  49. <el-dropdown-item divided icon="Help" command="emergencyRescue">急诊抢救</el-dropdown-item>
  50. <el-dropdown-item icon="Refresh" command="rvkEmergencyRescue">急诊抢救撤销</el-dropdown-item>
  51. <el-dropdown-item divided icon="Edit" command="diags">医保诊断补录</el-dropdown-item>
  52. </el-dropdown-menu>
  53. </template>
  54. </el-dropdown>
  55. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  56. <el-button type="primary">
  57. 处方&nbsp;
  58. <el-icon>
  59. <ArrowDown/>
  60. </el-icon>
  61. </el-button>
  62. <template #dropdown>
  63. <el-dropdown-menu>
  64. <el-dropdown-item icon="Document" command="insert">生成医保处方</el-dropdown-item>
  65. <el-dropdown-item icon="Delete" command="delete">删除已生成处方</el-dropdown-item>
  66. <el-dropdown-item icon="Upload" command="upload">医保处方上传</el-dropdown-item>
  67. <el-dropdown-item icon="RefreshLeft" command="retract">撤销医保上传</el-dropdown-item>
  68. </el-dropdown-menu>
  69. </template>
  70. </el-dropdown>
  71. <el-dropdown trigger="click" @command="settlement" style="margin-left: 8px">
  72. <el-button type="primary">
  73. 结算&nbsp;<el-icon>
  74. <ArrowDown/>
  75. </el-icon>
  76. </el-button>
  77. <template #dropdown>
  78. <el-dropdown-menu>
  79. <el-dropdown-item icon="SetUp" command="pre">试算</el-dropdown-item>
  80. <el-dropdown-item icon="Stamp" command="fin">结算</el-dropdown-item>
  81. <el-dropdown-item icon="RefreshLeft" command="revoke">取消结算</el-dropdown-item>
  82. </el-dropdown-menu>
  83. </template>
  84. </el-dropdown>
  85. <el-button type="success" style="margin-left: 8px" @click="seeMzBlRecord">门诊病历</el-button>
  86. <el-button type="danger" icon="Refresh" @click="clearinfo"> 重置</el-button>
  87. </header>
  88. <div class="layout_main layout_container layout-horizontal">
  89. <aside class="layout_el-table">
  90. <el-table
  91. :data="historyReceipts"
  92. stripe
  93. highlight-current-row
  94. @row-click="fetchHistoryReceiptDetail"
  95. height="100%"
  96. >
  97. <el-table-column property="patNo" label="ID号_次数" width="120">
  98. <template #default="scope">
  99. <span v-html="colorStatus(scope.row)"></span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="诊间" width="40">
  103. <template #default="scope">
  104. <span v-html="isMztczf(scope.row)"></span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column property="chargeFee" label="金额" width="60"></el-table-column>
  108. <el-table-column property="chargeDate" label="时间" width="130"></el-table-column>
  109. </el-table>
  110. </aside>
  111. <div class="layout_main" style="padding: 30px; position: relative">
  112. <img v-if="mzVisit.settledFlag === 1" :src="mzSettled" alt="" style="z-index: 999; width: 230px;
  113. position: absolute; top: 160px; left: 260px; background: rgba(255,255,255,.5)">
  114. <mz-receipt :mz-visit="mzVisit" :receipts="currentReceipts" show-checkbox/>
  115. </div>
  116. </div>
  117. </div>
  118. <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
  119. <el-tag>{{ injuryMode ? '工伤信息' : '参保信息' }}</el-tag>
  120. <div v-if="injuryMode">
  121. <el-table :data="injuryinfo" height="180" stripe @row-click="handleClickInjuryinfo">
  122. <el-table-column label="证件号码" prop="aac002"></el-table-column>
  123. <el-table-column label="姓名" prop="aac003"></el-table-column>
  124. <el-table-column label="单位名称" prop="aab004"></el-table-column>
  125. <el-table-column label="受伤时间" prop="alc020"></el-table-column>
  126. <el-table-column label="认定申请时间" prop="alc017"></el-table-column>
  127. <el-table-column label="认定ID" prop="aaz127"></el-table-column>
  128. <el-table-column label="个人编号" prop="aac001"></el-table-column>
  129. <el-table-column label="参保统筹区" prop="baa027Name"></el-table-column>
  130. </el-table>
  131. </div>
  132. <div v-else>
  133. <el-table :data="insuinfo" @row-click="handleClickInsuinfo">
  134. <el-table-column property="balc" label="余额"></el-table-column>
  135. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  136. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  137. <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
  138. <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
  139. <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
  140. <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
  141. <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
  142. <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
  143. <el-table-column property="empName" label="单位名称"></el-table-column>
  144. </el-table>
  145. </div>
  146. </el-dialog>
  147. <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
  148. <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
  149. <el-table-column property="opspDiseCode" label="病种编码"></el-table-column>
  150. <el-table-column property="opspDiseName" label="病种名称"></el-table-column>
  151. <el-table-column property="begndate" label="生效日期"></el-table-column>
  152. <el-table-column property="enddate" label="失效日期"></el-table-column>
  153. </el-table>
  154. </el-dialog>
  155. <el-dialog title="请选择生育诊断" v-model="showMatnDises" width="50%">
  156. <el-table :data="matnDises" @row-click="uploadFees" stripe height="360" highlight-current-row>
  157. <el-table-column property="code" label="病种编码"></el-table-column>
  158. <el-table-column property="name" label="病种名称"></el-table-column>
  159. <el-table-column property="insutype" label="险种类型"></el-table-column>
  160. <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
  161. </el-table>
  162. </el-dialog>
  163. <el-dialog title="医保诊断补录" v-model="showInputDiags" width="60%" :close-on-click-modal="false"
  164. :close-on-press-escape="false">
  165. <outpatient-diagnose-supply :med-type="medType" :mz-visit="mzVisit"
  166. @close="showInputDiags = false"></outpatient-diagnose-supply>
  167. </el-dialog>
  168. <mz-bl-record
  169. v-if="showMzBlRecord"
  170. :patient-id="currentRow.patNo"
  171. :times="currentRow.times"
  172. @closed="showMzBlRecord = false"
  173. ></mz-bl-record>
  174. <EmergencyRescue ref="emergencyRef" :param="emergencyParams" />
  175. </template>
  176. <script setup>
  177. import {
  178. deleteAllMzReceipts,
  179. getHistoryMzReceipts,
  180. getHistoryReceiptDetail,
  181. insertSiMzFeesForSupplement,
  182. outpatientPreSettlement,
  183. outpatientRegistration,
  184. revokeOutpatientFeeDetails,
  185. revokeOutpatientRegistration,
  186. uploadOutpatientFeeDetails,
  187. outpatientSettlement,
  188. revokeOutpatientSettlement,
  189. } from '@/api/medical-insurance/si-outpatient'
  190. import {
  191. employeeInfoInquiry2, injuryOutpatientFeeUpload,
  192. injuryOutpatientRegister, injuryOutpatientSettlement, revokeInjuryOutpatientFee,
  193. revokeInjuryOutpatientRegistration, revokeInjuryOutpatientSettlement
  194. } from "@/api/medical-insurance/si-injury";
  195. import {
  196. obtainBasicPersonInfo,
  197. querySpecialChronicDiseasesAccreditation,
  198. queryMzMatnDises
  199. } from '@/api/medical-insurance/si-query'
  200. import {onMounted, ref} from 'vue'
  201. import {ElMessageBox, ElSelect} from 'element-plus'
  202. import {getMedTypesByFlag} from '@/api/medical-insurance/si-dict'
  203. import {shortcuts} from '@/data/shortcuts'
  204. import {getDateRangeFormatDate} from '@/utils/date'
  205. import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
  206. import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-diagnose-supply/Index.vue'
  207. import mzSettled from '@/assets/mz-settled.png'
  208. import {allAdmdvses} from "@/data/admdvs";
  209. import MzBlRecord from "@/components/outpatient/MzBlRecord.vue";
  210. import MzReceipt from "@/components/outpatient/MzReceipt.vue";
  211. import {useUserStore} from "@/pinia/user-store";
  212. import {CyMessageBox} from "@/components/cy/message-box";
  213. import EmergencyRescue from "@/views/medical-insurance/outpatient/component/EmergencyRescue.vue";
  214. import {xcMessage} from "@/utils/xiaochan-element-plus";
  215. import {checkGeneratedFees} from "@/api/medical-insurance/emergency-rescue";
  216. const patNo = ref('')
  217. const medType = ref('')
  218. const medTypes = ref([])
  219. const historyReceipts = ref([])
  220. const currentRow = ref({})
  221. const mzVisit = ref({})
  222. const currentReceipts = ref([])
  223. const showInputDiags = ref(false)
  224. const dateRange = ref(shortcuts[2].value)
  225. const patMedInsPaused = ref('normal')
  226. const injuryinfo = ref([])
  227. const injuryMode = computed(() => {
  228. return medType.value === '41' || medType.value === '46'
  229. })
  230. const colorStatus = (row) => {
  231. return row.status > 0 ? `<span style="color: green">${row.patNo}_${row.times}</span>` : `<span style="color: red">${row.patNo}_${row.times}</span>`
  232. }
  233. const isMztczf = (row) => {
  234. return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
  235. }
  236. const admdvs = ref(null)
  237. const admdvsCascader = ref([])
  238. const handleMedTypeChange = (val) => {
  239. if (val === '41') {
  240. admdvsCascader.value = []
  241. admdvs.value = null
  242. }
  243. }
  244. const handleAdmdvsChange = (val) => {
  245. admdvs.value = val ? val[1] : null;
  246. }
  247. const nullPatNo = () => {
  248. if (patNo.value) {
  249. return false
  250. }
  251. xcMessage.warning('请输入门诊ID!')
  252. return true
  253. }
  254. const nullMedtype = () => {
  255. if (medType.value) {
  256. return false
  257. }
  258. xcMessage.warning('请选择医疗类别!')
  259. return true
  260. }
  261. const fetchHistoryReceipts = () => {
  262. if (nullPatNo()) {
  263. return
  264. }
  265. if (nullMedtype()) {
  266. return
  267. }
  268. if (!dateRange.value) {
  269. xcMessage.warning('请选择日期范围!')
  270. return
  271. }
  272. clearReadCardData()
  273. historyReceipts.value = []
  274. currentRow.value = {}
  275. const dates = getDateRangeFormatDate(dateRange.value)
  276. getHistoryMzReceipts(patNo.value, dates.startTime, dates.endTime).then((res) => {
  277. historyReceipts.value = res
  278. })
  279. }
  280. const fetchHistoryReceiptDetail = (row) => {
  281. currentRow.value = row
  282. getHistoryReceiptDetail(row).then((res) => {
  283. mzVisit.value = res.mzVisit
  284. mzVisit.value.totalFee = row.chargeFee
  285. currentReceipts.value = res.mzReceipts
  286. })
  287. }
  288. const insuinfo = ref([])
  289. const showInsuinfo = ref(false)
  290. const handleClickInjuryinfo = (row) => {
  291. row.patNo = patNo.value
  292. row.times = currentRow.value.times
  293. row.ledgerSn = 0
  294. row.aka130 = medType.value
  295. if (row.aka130 === '41') {
  296. row.bka003 = '410'
  297. } else if (row.aka130 === '46') {
  298. row.bka003 = '461'
  299. }
  300. injuryOutpatientRegister(row).then(() => {
  301. showInsuinfo.value = false
  302. clearReadCardData()
  303. xcMessage.success('登记成功')
  304. })
  305. }
  306. const register = (command) => {
  307. if (!currentRow.value.times) {
  308. xcMessage.warning('请先选择历史处方。')
  309. return
  310. }
  311. const param = {
  312. patNo: patNo.value,
  313. medType: medType.value,
  314. times: currentRow.value.times,
  315. admdvs: admdvs.value,
  316. legderSn: 0,
  317. needSaving: 1,
  318. }
  319. if (command === 'execute') {
  320. beforeRegister(param)
  321. } else if (command === 'revoke') {
  322. revokeRegister(param)
  323. } else if (command === 'emergencyRescue') {
  324. beforeEmergencyRescue(param)
  325. } else if (command === 'rvkEmergencyRescue') {
  326. revokeEmergencyRescue(param)
  327. } else {
  328. showInputDiags.value = true
  329. }
  330. }
  331. function beforeRegister(param) {
  332. if (param.medType === '1301') {
  333. xcMessage.error('医疗类别为【急诊抢救】的患者,请选择急诊抢救专用通道。')
  334. return
  335. }
  336. if (injuryMode.value) {
  337. employeeInfoInquiry2(param).then((res) => {
  338. injuryinfo.value = res
  339. showInsuinfo.value = true
  340. })
  341. } else {
  342. obtainBasicPersonInfo(param).then((res) => {
  343. insuinfo.value = res.insuinfo
  344. showInsuinfo.value = true
  345. })
  346. }
  347. }
  348. function revokeRegister(param) {
  349. if (injuryMode.value) {
  350. revokeInjuryOutpatientRegistration(param).then(res => {
  351. xcMessage.success(res)
  352. })
  353. } else {
  354. revokeOutpatientRegistration(param).then((res) => {
  355. xcMessage.success(res)
  356. })
  357. }
  358. }
  359. function beforeEmergencyRescue(param) {
  360. if (param.medType !== '1301') {
  361. xcMessage.error('医疗类别请选择【急诊抢救】。')
  362. return
  363. }
  364. checkGeneratedFees(param).then(() => {
  365. obtainBasicPersonInfo(param).then(res => {
  366. insuinfo.value = res.insuinfo
  367. showInsuinfo.value = true
  368. })
  369. })
  370. }
  371. const readCardData = reactive({
  372. mdtrtCertType: null,
  373. readCardResult: null,
  374. readCardBizType: null,
  375. })
  376. const clearReadCardData = () => {
  377. readCardData.mdtrtCertType = null
  378. readCardData.readCardResult = null
  379. readCardData.readCardBizType = null
  380. }
  381. const afterReadCard = (result) => {
  382. readCardData.mdtrtCertType = result.mdtrtCertType
  383. readCardData.readCardResult = result.readCardResult
  384. readCardData.readCardBizType = result.readCardBizType
  385. }
  386. const emergencyRef = ref(null)
  387. const emergencyParams = ref({})
  388. const handleClickInsuinfo = (row) => {
  389. const param = {
  390. patNo: patNo.value,
  391. times: currentRow.value.times,
  392. insutype: row.insutype,
  393. psnType: row.psnType,
  394. medType: medType.value,
  395. balc: row.balc,
  396. insuplcAdmdvs: row.insuplcAdmdvs,
  397. empName: row.empName,
  398. mdtrtCertType: readCardData.mdtrtCertType,
  399. readCardResult: readCardData.readCardResult,
  400. readCardBizType: readCardData.readCardBizType,
  401. }
  402. if (param.medType === '1301') {
  403. emergencyRescueProcess(param)
  404. } else {
  405. normalOutpatientRegister(param)
  406. }
  407. }
  408. function emergencyRescueProcess(param) {
  409. showInsuinfo.value = false
  410. emergencyParams.value = param
  411. nextTick().then(() => {
  412. emergencyRef.value.start()
  413. })
  414. }
  415. function revokeEmergencyRescue(param) {
  416. if (param.medType !== '1301') {
  417. xcMessage.error('医疗类别请选择【急诊抢救】。')
  418. return
  419. }
  420. emergencyParams.value = param
  421. nextTick().then(() => {
  422. emergencyRef.value.revoke()
  423. })
  424. }
  425. function normalOutpatientRegister(param) {
  426. outpatientRegistration(param).then((res) => {
  427. clearReadCardData()
  428. showInsuinfo.value = false
  429. xcMessage.success(res)
  430. });
  431. }
  432. const receiptsOpts = (command) => {
  433. switch (command) {
  434. case 'insert':
  435. markMzFees()
  436. break
  437. case 'delete':
  438. deleteMtFees()
  439. break
  440. case 'upload':
  441. qrySpcChrDiseAcct()
  442. break
  443. case 'retract':
  444. revokeFees()
  445. break
  446. }
  447. }
  448. const markMzFees = () => {
  449. if (currentReceipts.value.length === 0) {
  450. xcMessage.warning('请先选择要保存的处方!')
  451. return
  452. }
  453. ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
  454. type: 'warning',
  455. confirmButtonText: '生成',
  456. cancelButtonText: '取消',
  457. }).then(() => {
  458. insertSiMzFeesForSupplement(currentReceipts.value).then(() => {
  459. currentRow.value.status = '1'
  460. xcMessage.success('已成功生成医保处方。');
  461. })
  462. }).catch(() => {
  463. })
  464. }
  465. const matnDises = ref([])
  466. const showMatnDises = ref(false)
  467. const spcChrDiseAccts = ref([])
  468. const showSpcChrAccts = ref(false)
  469. const qrySpcChrDiseAcct = () => {
  470. if (!currentRow.value.times) {
  471. xcMessage.warning('请先选择历史处方!')
  472. return
  473. }
  474. const param = {
  475. patNo: patNo.value,
  476. times: currentRow.value.times,
  477. ledgerSn: 0,
  478. calType: 0
  479. }
  480. if (injuryMode.value) {
  481. injuryOutpatientFeeUpload(param).then(() => {
  482. injuryOutpatientSettlement(param).then(res => {
  483. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  484. ElMessageBox.alert(message, '试算成功', {
  485. type: 'success',
  486. showCancelButton: false,
  487. }).then(() => {
  488. })
  489. })
  490. });
  491. } else {
  492. if (medType.value === '51') {
  493. queryMzMatnDises().then((res) => {
  494. matnDises.value = res
  495. showMatnDises.value = true
  496. })
  497. } else if (medType.value === '14') {
  498. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  499. spcChrDiseAccts.value = res
  500. showSpcChrAccts.value = true
  501. })
  502. } else {
  503. uploadFees(param)
  504. }
  505. }
  506. }
  507. const uploadFees = (row) => {
  508. if (medType.value === '51') {
  509. row.patNo = patNo.value
  510. row.times = currentRow.value.times
  511. row.opspDiseCode = row.code
  512. row.opspDiseName = row.name
  513. }
  514. uploadOutpatientFeeDetails(row).then((res) => {
  515. showMatnDises.value = false
  516. showSpcChrAccts.value = false
  517. if (patMedInsPaused.value === 'normal') {
  518. mzPreSetl()
  519. } else {
  520. CyMessageBox.alert({
  521. type: 'success',
  522. message: '上传成功'
  523. })
  524. }
  525. })
  526. }
  527. const userStore = useUserStore()
  528. const mzPreSetl = () => {
  529. if (!currentRow.value.times) {
  530. xcMessage.warning('请先选择历史处方!')
  531. return
  532. }
  533. const param = {
  534. staffId: userStore.code,
  535. patNo: patNo.value,
  536. times: currentRow.value.times,
  537. mdtrtCertType: readCardData.mdtrtCertType,
  538. readCardResult: readCardData.readCardResult,
  539. readCardBizType: readCardData.readCardBizType,
  540. acctUsedFlag: acctUsedFlag.value,
  541. ledgerSn: 0,
  542. calType: 0
  543. }
  544. if (injuryMode.value) {
  545. injuryOutpatientSettlement(param).then(res => {
  546. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  547. ElMessageBox.alert(message, '试算成功', {
  548. type: 'success',
  549. showCancelButton: false,
  550. }).then(() => {
  551. })
  552. });
  553. } else {
  554. outpatientPreSettlement(param).then((res) => {
  555. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  556. ElMessageBox.alert(message, '试算成功', {
  557. type: 'success',
  558. showCancelButton: false,
  559. }).then(() => {
  560. })
  561. })
  562. }
  563. }
  564. const revokeFees = () => {
  565. if (!currentRow.value.times) {
  566. xcMessage.warning('请先选择历史处方!')
  567. return
  568. }
  569. const param = {
  570. patNo: patNo.value,
  571. times: currentRow.value.times,
  572. ledgerSn: 0,
  573. }
  574. if (injuryMode.value) {
  575. revokeInjuryOutpatientFee(param).then(res => {
  576. xcMessage.success(res)
  577. })
  578. } else {
  579. revokeOutpatientFeeDetails(param).then((res) => {
  580. xcMessage.success(res)
  581. });
  582. }
  583. }
  584. const deleteMtFees = () => {
  585. if (!currentRow.value.times) {
  586. xcMessage.warning('请先选择历史处方!')
  587. return
  588. }
  589. const param = {
  590. patNo: patNo.value,
  591. times: currentRow.value.times,
  592. }
  593. deleteAllMzReceipts(param).then((res) => {
  594. xcMessage.success(res)
  595. currentReceipts.value = []
  596. fetchHistoryReceipts()
  597. })
  598. }
  599. const acctUsedFlag = ref('1')
  600. const mzSettle = () => {
  601. if (!currentRow.value.times) {
  602. xcMessage.warning('请先选择历史处方!')
  603. return
  604. }
  605. const param = {
  606. patNo: patNo.value,
  607. times: currentRow.value.times,
  608. saved: 1,
  609. mdtrtCertType: readCardData.mdtrtCertType,
  610. readCardResult: readCardData.readCardResult,
  611. readCardBizType: readCardData.readCardBizType,
  612. ledgerSn: 0,
  613. calType: 1,
  614. acctUsedFlag: acctUsedFlag.value,
  615. }
  616. if (injuryMode.value) {
  617. injuryOutpatientSettlement(param).then(res => {
  618. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  619. ElMessageBox.alert(message, '结算成功', {
  620. type: 'success',
  621. showCancelButton: false,
  622. }).then(() => {
  623. })
  624. });
  625. } else {
  626. outpatientSettlement(param).then((res) => {
  627. clearReadCardData()
  628. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  629. ElMessageBox.alert(message, '结算成功', {
  630. type: 'success',
  631. showCancelButton: false,
  632. }).then(() => {
  633. })
  634. })
  635. }
  636. }
  637. const revokeMzSettle = () => {
  638. if (!currentRow.value.times) {
  639. xcMessage.warning('请先选择历史处方!')
  640. return
  641. }
  642. const param = {
  643. patNo: patNo.value,
  644. times: currentRow.value.times,
  645. ledgerSn: 0
  646. }
  647. if (injuryMode.value) {
  648. revokeInjuryOutpatientSettlement(param).then(res => {
  649. ElMessageBox.alert(res, '提示', {
  650. type: 'success',
  651. showCancelButton: false,
  652. })
  653. });
  654. } else {
  655. revokeOutpatientSettlement(param).then((res) => {
  656. ElMessageBox.alert('撤销门诊结算成功', '提示', {
  657. type: 'success',
  658. showCancelButton: false,
  659. })
  660. })
  661. }
  662. }
  663. const settlement = (command) => {
  664. if (command === 'pre') {
  665. mzPreSetl()
  666. } else if (command === 'fin') {
  667. mzSettle()
  668. } else {
  669. revokeMzSettle()
  670. }
  671. }
  672. const clearinfo = () => {
  673. patNo.value = ''
  674. medType.value = ''
  675. historyReceipts.value = []
  676. currentRow.value = {}
  677. currentReceipts.value = []
  678. }
  679. const showMzBlRecord = ref(false)
  680. function seeMzBlRecord() {
  681. if (!currentRow.value.times) {
  682. xcMessage.warning('请先选择历史处方!')
  683. return
  684. }
  685. showMzBlRecord.value = true
  686. }
  687. onMounted(() => {
  688. getMedTypesByFlag('clinic').then((res) => {
  689. medTypes.value = res
  690. })
  691. })
  692. </script>