MzSpltryRcrd.vue 22 KB

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