MzSpltryRcrd.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  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
  14. v-model="patNo"
  15. style="width: 100px; margin-left: 2px"
  16. clearable
  17. placeholder="门诊id"
  18. ></el-input>
  19. <el-select
  20. v-model="medType"
  21. style="width: 106px"
  22. placeholder="医疗类别"
  23. @change="handleMedTypeChange"
  24. >
  25. <el-option
  26. v-for="item in medTypes"
  27. :key="item.code"
  28. :value="item.code"
  29. :label="item.name"
  30. ></el-option>
  31. </el-select>
  32. <el-cascader
  33. v-model="admdvsCascader"
  34. clearable
  35. filterable
  36. placeholder="参保地区"
  37. :options="allAdmdvses"
  38. @change="handleAdmdvsChange"
  39. style="width: 160px"
  40. :disabled="injuryMode === true"
  41. ></el-cascader>
  42. <el-select v-model="acctUsedFlag" style="width: 118px">
  43. <el-option label="不使用个账" value="0"></el-option>
  44. <el-option label="使用本人个账" value="1"></el-option>
  45. <el-option label="使用共济人个账" value="2"></el-option>
  46. </el-select>
  47. <el-select v-model="patMedInsPaused" style="width: 110px">
  48. <el-option label="患者正常参保" value="normal"></el-option>
  49. <el-option label="患者已停保" value="paused"></el-option>
  50. </el-select>
  51. <el-divider direction="vertical"></el-divider>
  52. <el-button type="primary" @click="fetchHistoryReceipts"
  53. >历史处方</el-button
  54. >
  55. <ReadCard :pat-no="patNo" @success="afterReadCard" />
  56. <el-dropdown trigger="click" @command="register">
  57. <el-button type="primary">
  58. 登记&nbsp;
  59. <el-icon>
  60. <ArrowDown />
  61. </el-icon>
  62. </el-button>
  63. <template #dropdown>
  64. <el-dropdown-menu>
  65. <el-dropdown-item icon="CreditCard" command="execute"
  66. >医保登记</el-dropdown-item
  67. >
  68. <el-dropdown-item icon="RefreshLeft" command="revoke"
  69. >取消登记</el-dropdown-item
  70. >
  71. <el-dropdown-item divided icon="Help" command="emergencyRescue"
  72. >急诊抢救</el-dropdown-item
  73. >
  74. <el-dropdown-item icon="Refresh" command="rvkEmergencyRescue"
  75. >急诊抢救撤销</el-dropdown-item
  76. >
  77. <el-dropdown-item divided icon="Edit" command="diags"
  78. >医保诊断补录</el-dropdown-item
  79. >
  80. </el-dropdown-menu>
  81. </template>
  82. </el-dropdown>
  83. <el-dropdown
  84. trigger="click"
  85. @command="receiptsOpts"
  86. style="margin-left: 8px"
  87. >
  88. <el-button type="primary">
  89. 处方&nbsp;
  90. <el-icon>
  91. <ArrowDown />
  92. </el-icon>
  93. </el-button>
  94. <template #dropdown>
  95. <el-dropdown-menu>
  96. <el-dropdown-item icon="Document" command="insert"
  97. >生成医保处方</el-dropdown-item
  98. >
  99. <el-dropdown-item icon="Delete" command="delete"
  100. >删除已生成处方</el-dropdown-item
  101. >
  102. <el-dropdown-item icon="Upload" command="upload"
  103. >医保处方上传</el-dropdown-item
  104. >
  105. <el-dropdown-item icon="RefreshLeft" command="retract"
  106. >撤销医保上传</el-dropdown-item
  107. >
  108. <el-dropdown-item
  109. v-if="medType === '1301'"
  110. icon="Link"
  111. divided
  112. command="merge"
  113. >
  114. 合并处方(多次就诊)
  115. </el-dropdown-item>
  116. </el-dropdown-menu>
  117. </template>
  118. </el-dropdown>
  119. <el-dropdown
  120. trigger="click"
  121. @command="settlement"
  122. style="margin-left: 8px"
  123. >
  124. <el-button type="primary">
  125. 结算&nbsp;<el-icon>
  126. <ArrowDown />
  127. </el-icon>
  128. </el-button>
  129. <template #dropdown>
  130. <el-dropdown-menu>
  131. <el-dropdown-item icon="SetUp" command="pre">试算</el-dropdown-item>
  132. <el-dropdown-item icon="Stamp" command="fin">结算</el-dropdown-item>
  133. <el-dropdown-item icon="RefreshLeft" command="revoke"
  134. >取消结算</el-dropdown-item
  135. >
  136. </el-dropdown-menu>
  137. </template>
  138. </el-dropdown>
  139. <el-button type="success" style="margin-left: 8px" @click="seeMzBlRecord"
  140. >门诊病历</el-button
  141. >
  142. <el-button type="danger" icon="Refresh" @click="clearinfo">
  143. 重置</el-button
  144. >
  145. </header>
  146. <div class="layout_main layout_container layout-horizontal">
  147. <aside class="layout_el-table">
  148. <el-table
  149. ref="asideRef"
  150. :data="historyReceipts"
  151. stripe
  152. highlight-current-row
  153. @row-click="fetchHistoryReceiptDetail"
  154. height="100%"
  155. >
  156. <el-table-column property="patNo" label="ID号_次数" width="120">
  157. <template #default="scope">
  158. <span v-html="colorStatus(scope.row)"></span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="诊间" width="40">
  162. <template #default="scope">
  163. <span v-html="isMztczf(scope.row)"></span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column
  167. property="chargeFee"
  168. label="金额"
  169. width="60"
  170. ></el-table-column>
  171. <el-table-column
  172. property="chargeDate"
  173. label="时间"
  174. width="130"
  175. ></el-table-column>
  176. </el-table>
  177. </aside>
  178. <div class="layout_main" style="padding: 30px; position: relative">
  179. <img
  180. v-if="mzVisit.settledFlag === 1"
  181. :src="mzSettled"
  182. class="settle-img"
  183. alt=""
  184. />
  185. <img
  186. v-if="mzVisit.settledFlag === 2"
  187. :src="mipSettled"
  188. class="settle-img"
  189. alt=""
  190. />
  191. <img
  192. v-if="mzVisit.settledFlag === 3"
  193. :src="gsSettled"
  194. class="settle-img"
  195. alt=""
  196. />
  197. <mz-receipt
  198. :mz-visit="mzVisit"
  199. :receipts="currentReceipts"
  200. show-checkbox
  201. />
  202. </div>
  203. </div>
  204. </div>
  205. <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
  206. <el-tag>{{ injuryMode ? "工伤信息" : "参保信息" }}</el-tag>
  207. <div v-if="injuryMode">
  208. <el-table
  209. :data="injuryinfo"
  210. height="180"
  211. stripe
  212. @row-click="handleClickInjuryinfo"
  213. >
  214. <el-table-column label="证件号码" prop="aac002"></el-table-column>
  215. <el-table-column label="姓名" prop="aac003"></el-table-column>
  216. <el-table-column label="单位名称" prop="aab004"></el-table-column>
  217. <el-table-column label="受伤时间" prop="alc020"></el-table-column>
  218. <el-table-column label="认定申请时间" prop="alc017"></el-table-column>
  219. <el-table-column label="认定ID" prop="aaz127"></el-table-column>
  220. <el-table-column label="个人编号" prop="aac001"></el-table-column>
  221. <el-table-column label="参保统筹区" prop="baa027Name"></el-table-column>
  222. </el-table>
  223. </div>
  224. <div v-else>
  225. <el-table :data="insuinfo" @row-click="handleClickInsuinfo">
  226. <el-table-column property="balc" label="余额"></el-table-column>
  227. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  228. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  229. <el-table-column
  230. label="参保状态"
  231. prop="psnInsuStasName"
  232. ></el-table-column>
  233. <el-table-column
  234. property="psnInsuDate"
  235. label="个人参保日期"
  236. ></el-table-column>
  237. <el-table-column
  238. property="pausInsuDate"
  239. label="暂停参保日期"
  240. ></el-table-column>
  241. <el-table-column
  242. property="cvlservFlagName"
  243. label="公务员标志"
  244. ></el-table-column>
  245. <el-table-column
  246. property="insuplcAdmdvs"
  247. label="参保地医保区划"
  248. ></el-table-column>
  249. <el-table-column
  250. property="insuplcAdmdvsName"
  251. label="参保地名称"
  252. ></el-table-column>
  253. <el-table-column property="empName" label="单位名称"></el-table-column>
  254. </el-table>
  255. </div>
  256. </el-dialog>
  257. <el-dialog
  258. title="请选择(慢特病备案信息)"
  259. v-model="showSpcChrAccts"
  260. width="40%"
  261. >
  262. <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
  263. <el-table-column
  264. property="opspDiseCode"
  265. label="病种编码"
  266. ></el-table-column>
  267. <el-table-column
  268. property="opspDiseName"
  269. label="病种名称"
  270. ></el-table-column>
  271. <el-table-column property="begndate" label="生效日期"></el-table-column>
  272. <el-table-column property="enddate" label="失效日期"></el-table-column>
  273. </el-table>
  274. </el-dialog>
  275. <el-dialog title="请选择生育诊断" v-model="showMatnDises" width="50%">
  276. <el-table
  277. :data="matnDises"
  278. @row-click="uploadFees"
  279. stripe
  280. height="360"
  281. highlight-current-row
  282. >
  283. <el-table-column property="code" label="病种编码"></el-table-column>
  284. <el-table-column property="name" label="病种名称"></el-table-column>
  285. <el-table-column property="insutype" label="险种类型"></el-table-column>
  286. <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
  287. </el-table>
  288. </el-dialog>
  289. <el-dialog
  290. title="医保诊断补录"
  291. v-model="showInputDiags"
  292. width="60%"
  293. :close-on-click-modal="false"
  294. :close-on-press-escape="false"
  295. >
  296. <outpatient-diagnose-supply
  297. :med-type="medType"
  298. :mz-visit="mzVisit"
  299. @close="showInputDiags = false"
  300. ></outpatient-diagnose-supply>
  301. </el-dialog>
  302. <mz-bl-record
  303. v-if="showMzBlRecord"
  304. :patient-id="currentRow.patNo"
  305. :times="currentRow.times"
  306. @closed="showMzBlRecord = false"
  307. ></mz-bl-record>
  308. <EmergencyRescue ref="emergencyRef" :param="emergencyParams" />
  309. <el-dialog
  310. v-model="showMergeReceipts"
  311. title="请选择要合并的处方"
  312. :close-on-click-modal="false"
  313. :close-on-press-escape="false"
  314. width="460px"
  315. >
  316. <el-table ref="mergeRef" :data="historyReceipts" stripe height="100%">
  317. <el-table-column type="selection"></el-table-column>
  318. <el-table-column property="patNo" label="ID号_次数" width="120">
  319. <template #default="{ row }">
  320. {{ row.patNo }}_{{ row.times }}
  321. </template>
  322. </el-table-column>
  323. <el-table-column label="诊间" width="60">
  324. <template #default="scope">
  325. <span v-html="isMztczf(scope.row)"></span>
  326. </template>
  327. </el-table-column>
  328. <el-table-column
  329. property="chargeFee"
  330. label="金额"
  331. width="70"
  332. ></el-table-column>
  333. <el-table-column
  334. property="chargeDate"
  335. label="时间"
  336. width="130"
  337. ></el-table-column>
  338. </el-table>
  339. <div style="margin-top: 20px; width: 100%; text-align: right">
  340. <el-button @click="showMergeReceipts = false">取消</el-button>
  341. <el-button type="primary" @click="confirmMerge">合并</el-button>
  342. </div>
  343. </el-dialog>
  344. </template>
  345. <script setup>
  346. import {
  347. deleteAllMzReceipts,
  348. getHistoryMzReceipts,
  349. getHistoryReceiptDetail,
  350. mergeReceipts,
  351. insertSiMzFeesForSupplement,
  352. outpatientPreSettlement,
  353. outpatientRegistration,
  354. revokeOutpatientFeeDetails,
  355. revokeOutpatientRegistration,
  356. uploadOutpatientFeeDetails,
  357. outpatientSettlement,
  358. revokeOutpatientSettlement,
  359. } from "@/api/medical-insurance/si-outpatient";
  360. import {
  361. employeeInfoInquiry2,
  362. injuryOutpatientFeeUpload,
  363. injuryOutpatientRegister,
  364. injuryOutpatientSettlement,
  365. revokeInjuryOutpatientFee,
  366. revokeInjuryOutpatientRegistration,
  367. revokeInjuryOutpatientSettlement,
  368. } from "@/api/medical-insurance/si-injury";
  369. import {
  370. obtainBasicPersonInfo,
  371. querySpecialChronicDiseasesAccreditation,
  372. queryMzMatnDises,
  373. } from "@/api/medical-insurance/si-query";
  374. import { onMounted, ref } from "vue";
  375. import { ElMessageBox, ElSelect } from "element-plus";
  376. import { getMedTypesByFlag } from "@/api/medical-insurance/si-dict";
  377. import { shortcuts } from "@/data/shortcuts";
  378. import { getDateRangeFormatDate } from "@/utils/date";
  379. import ReadCard from "@/components/medical-insurance/readcard/Index.vue";
  380. import OutpatientDiagnoseSupply from "@/components/medical-insurance/outpatient-diagnose-supply/Index.vue";
  381. import mzSettled from "@/assets/mz-settled.png";
  382. import mipSettled from "@/assets/mip-settled.png";
  383. import gsSettled from "@/assets/injury-settled.png"
  384. import { allAdmdvses } from "@/data/admdvs";
  385. import MzBlRecord from "@/components/outpatient/MzBlRecord.vue";
  386. import MzReceipt from "@/components/outpatient/MzReceipt.vue";
  387. import { useUserStore } from "@/pinia/user-store";
  388. import { CyMessageBox } from "@/utils/cy-message-box";
  389. import EmergencyRescue from "@/views/medical-insurance/outpatient/component/EmergencyRescue.vue";
  390. import { xcMessage } from "@/utils/xiaochan-element-plus";
  391. import { checkGeneratedFees } from "@/api/medical-insurance/emergency-rescue";
  392. const patNo = ref("");
  393. const medType = ref("");
  394. const medTypes = ref([]);
  395. const historyReceipts = ref([]);
  396. const currentRow = ref({});
  397. const mzVisit = ref({});
  398. const asideRef = ref(null);
  399. const currentReceipts = ref([]);
  400. const showInputDiags = ref(false);
  401. const dateRange = ref(shortcuts[2].value);
  402. const patMedInsPaused = ref("normal");
  403. const injuryinfo = ref([]);
  404. const injuryMode = computed(() => {
  405. return medType.value === "41" || medType.value === "46";
  406. });
  407. const colorStatus = row => {
  408. return row.status > 0
  409. ? `<span style="color: green">${row.patNo}_${row.times}</span>`
  410. : `<span style="color: red">${row.patNo}_${row.times}</span>`;
  411. };
  412. const isMztczf = row => {
  413. return row.zgmztczf === 1
  414. ? `<span style="color: green">医保</span>`
  415. : `<span>自费</span>`;
  416. };
  417. const admdvs = ref(null);
  418. const admdvsCascader = ref([]);
  419. const handleMedTypeChange = val => {
  420. if (val === "41") {
  421. admdvsCascader.value = [];
  422. admdvs.value = null;
  423. }
  424. };
  425. const handleAdmdvsChange = val => {
  426. admdvs.value = val ? val[1] : null;
  427. };
  428. const nullPatNo = () => {
  429. if (patNo.value) {
  430. return false;
  431. }
  432. xcMessage.warning("请输入门诊ID!");
  433. return true;
  434. };
  435. const nullMedtype = () => {
  436. if (medType.value) {
  437. return false;
  438. }
  439. xcMessage.warning("请选择医疗类别!");
  440. return true;
  441. };
  442. const fetchHistoryReceipts = () => {
  443. if (nullPatNo()) {
  444. return;
  445. }
  446. if (nullMedtype()) {
  447. return;
  448. }
  449. if (!dateRange.value) {
  450. xcMessage.warning("请选择日期范围!");
  451. return;
  452. }
  453. clearReadCardData();
  454. historyReceipts.value = [];
  455. currentRow.value = {};
  456. const dates = getDateRangeFormatDate(dateRange.value);
  457. getHistoryMzReceipts(patNo.value, dates.startTime, dates.endTime).then(
  458. res => {
  459. historyReceipts.value = res;
  460. }
  461. );
  462. };
  463. const fetchHistoryReceiptDetail = row => {
  464. currentRow.value = row;
  465. getHistoryReceiptDetail(row).then(res => {
  466. mzVisit.value = res.mzVisit;
  467. mzVisit.value.totalFee = row.chargeFee;
  468. currentReceipts.value = res.mzReceipts;
  469. });
  470. };
  471. const insuinfo = ref([]);
  472. const showInsuinfo = ref(false);
  473. const handleClickInjuryinfo = row => {
  474. row.patNo = patNo.value;
  475. row.times = currentRow.value.times;
  476. row.ledgerSn = 0;
  477. row.aka130 = medType.value;
  478. if (row.aka130 === "41") {
  479. row.bka003 = "410";
  480. } else if (row.aka130 === "46") {
  481. row.bka003 = "461";
  482. }
  483. injuryOutpatientRegister(row).then(() => {
  484. showInsuinfo.value = false;
  485. clearReadCardData();
  486. xcMessage.success("登记成功");
  487. });
  488. };
  489. const register = command => {
  490. if (!currentRow.value.times) {
  491. xcMessage.warning("请先选择历史处方。");
  492. return;
  493. }
  494. const param = {
  495. patNo: patNo.value,
  496. medType: medType.value,
  497. times: currentRow.value.times,
  498. admdvs: admdvs.value,
  499. legderSn: 0,
  500. needSaving: 1,
  501. };
  502. if (command === "execute") {
  503. beforeRegister(param);
  504. } else if (command === "revoke") {
  505. revokeRegister(param);
  506. } else if (command === "emergencyRescue") {
  507. beforeEmergencyRescue(param);
  508. } else if (command === "rvkEmergencyRescue") {
  509. revokeEmergencyRescue(param);
  510. } else {
  511. showInputDiags.value = true;
  512. }
  513. };
  514. function beforeRegister(param) {
  515. if (param.medType === "1301") {
  516. xcMessage.error("医疗类别为【急诊抢救】的患者,请选择急诊抢救专用通道。");
  517. return;
  518. }
  519. if (injuryMode.value) {
  520. employeeInfoInquiry2(param).then(res => {
  521. injuryinfo.value = res;
  522. showInsuinfo.value = true;
  523. });
  524. } else {
  525. obtainBasicPersonInfo(param).then(res => {
  526. insuinfo.value = res.insuinfo;
  527. showInsuinfo.value = true;
  528. });
  529. }
  530. }
  531. function revokeRegister(param) {
  532. if (injuryMode.value) {
  533. revokeInjuryOutpatientRegistration(param).then(res => {
  534. xcMessage.success(res);
  535. });
  536. } else {
  537. revokeOutpatientRegistration(param).then(res => {
  538. xcMessage.success(res);
  539. });
  540. }
  541. }
  542. function beforeEmergencyRescue(param) {
  543. if (param.medType !== "1301") {
  544. xcMessage.error("医疗类别请选择【急诊抢救】。");
  545. return;
  546. }
  547. checkGeneratedFees(param).then(() => {
  548. obtainBasicPersonInfo(param).then(res => {
  549. insuinfo.value = res.insuinfo;
  550. showInsuinfo.value = true;
  551. });
  552. });
  553. }
  554. const readCardData = reactive({
  555. mdtrtCertType: null,
  556. readCardResult: null,
  557. readCardBizType: null,
  558. });
  559. const clearReadCardData = () => {
  560. readCardData.mdtrtCertType = null;
  561. readCardData.readCardResult = null;
  562. readCardData.readCardBizType = null;
  563. };
  564. const afterReadCard = result => {
  565. readCardData.mdtrtCertType = result.mdtrtCertType;
  566. readCardData.readCardResult = result.readCardResult;
  567. readCardData.readCardBizType = result.readCardBizType;
  568. };
  569. const emergencyRef = ref(null);
  570. const emergencyParams = ref({});
  571. const handleClickInsuinfo = row => {
  572. const param = {
  573. patNo: patNo.value,
  574. times: currentRow.value.times,
  575. insutype: row.insutype,
  576. psnType: row.psnType,
  577. medType: medType.value,
  578. balc: row.balc,
  579. insuplcAdmdvs: row.insuplcAdmdvs,
  580. insuplcAdmdvsName: row.insuplcAdmdvsName,
  581. empName: row.empName,
  582. mdtrtCertType: readCardData.mdtrtCertType,
  583. readCardResult: readCardData.readCardResult,
  584. readCardBizType: readCardData.readCardBizType,
  585. };
  586. if (param.medType === "1301") {
  587. emergencyRescueProcess(param);
  588. } else {
  589. normalOutpatientRegister(param);
  590. }
  591. };
  592. function emergencyRescueProcess(param) {
  593. showInsuinfo.value = false;
  594. emergencyParams.value = param;
  595. nextTick().then(() => {
  596. emergencyRef.value.start();
  597. });
  598. }
  599. function revokeEmergencyRescue(param) {
  600. if (param.medType !== "1301") {
  601. xcMessage.error("医疗类别请选择【急诊抢救】。");
  602. return;
  603. }
  604. emergencyParams.value = param;
  605. nextTick().then(() => {
  606. emergencyRef.value.revoke();
  607. });
  608. }
  609. function normalOutpatientRegister(param) {
  610. outpatientRegistration(param).then(res => {
  611. clearReadCardData();
  612. showInsuinfo.value = false;
  613. xcMessage.success(res);
  614. });
  615. }
  616. const receiptsOpts = command => {
  617. switch (command) {
  618. case "insert":
  619. markMzFees();
  620. break;
  621. case "delete":
  622. deleteMtFees();
  623. break;
  624. case "upload":
  625. qrySpcChrDiseAcct();
  626. break;
  627. case "retract":
  628. revokeFees();
  629. break;
  630. case "merge":
  631. beforeMergeReceipts();
  632. break;
  633. }
  634. };
  635. const mergeRef = ref(null);
  636. const showMergeReceipts = ref(false);
  637. function beforeMergeReceipts() {
  638. if (historyReceipts.value.length === 0) {
  639. xcMessage.warning("请先获取历史处方!");
  640. return;
  641. }
  642. showMergeReceipts.value = true;
  643. }
  644. function confirmMerge() {
  645. const selections = mergeRef.value.getSelectionRows();
  646. if (selections.length === 0) {
  647. xcMessage.warning("请勾选至少一条就诊记录!");
  648. return;
  649. }
  650. mergeReceipts(selections).then(res => {
  651. showMergeReceipts.value = false;
  652. ElMessageBox.alert(res.message, "提示", {
  653. type: "success",
  654. showClose: false,
  655. closeOnClickOutside: false,
  656. closeOnClickModal: false,
  657. closeOnPressEscape: false,
  658. }).then(() => {
  659. fetchHistoryReceiptDetail(res);
  660. let index = historyReceipts.value.findIndex(item => {
  661. return item.times === res.times;
  662. });
  663. asideRef.value.setCurrentRow(historyReceipts.value[index]);
  664. });
  665. });
  666. }
  667. const markMzFees = () => {
  668. if (currentReceipts.value.length === 0) {
  669. xcMessage.warning("请先选择要保存的处方!");
  670. return;
  671. }
  672. ElMessageBox.confirm("是否将选中处方生成医保处方?", "提示", {
  673. type: "warning",
  674. confirmButtonText: "生成",
  675. cancelButtonText: "取消",
  676. })
  677. .then(() => {
  678. insertSiMzFeesForSupplement(currentReceipts.value).then(() => {
  679. currentRow.value.status = "1";
  680. xcMessage.success("已成功生成医保处方。");
  681. });
  682. })
  683. .catch(() => {});
  684. };
  685. const matnDises = ref([]);
  686. const showMatnDises = ref(false);
  687. const spcChrDiseAccts = ref([]);
  688. const showSpcChrAccts = ref(false);
  689. const qrySpcChrDiseAcct = () => {
  690. if (!currentRow.value.times) {
  691. xcMessage.warning("请先选择历史处方!");
  692. return;
  693. }
  694. const param = {
  695. patNo: patNo.value,
  696. times: currentRow.value.times,
  697. ledgerSn: 0,
  698. calType: 0,
  699. };
  700. if (injuryMode.value) {
  701. injuryOutpatientFeeUpload(param).then(() => {
  702. injuryOutpatientSettlement(param).then(res => {
  703. const message =
  704. "处方总费用:" +
  705. res.totalCost +
  706. ",工伤报销金额:" +
  707. res.fundPay +
  708. "。";
  709. ElMessageBox.alert(message, "试算成功", {
  710. type: "success",
  711. showCancelButton: false,
  712. }).then(() => {});
  713. });
  714. });
  715. } else {
  716. if (medType.value === "51") {
  717. queryMzMatnDises().then(res => {
  718. matnDises.value = res;
  719. showMatnDises.value = true;
  720. });
  721. } else if (medType.value === "14") {
  722. querySpecialChronicDiseasesAccreditation(param).then(res => {
  723. spcChrDiseAccts.value = res;
  724. showSpcChrAccts.value = true;
  725. });
  726. } else {
  727. uploadFees(param);
  728. }
  729. }
  730. };
  731. const uploadFees = row => {
  732. if (medType.value === "51") {
  733. row.patNo = patNo.value;
  734. row.times = currentRow.value.times;
  735. row.opspDiseCode = row.code;
  736. row.opspDiseName = row.name;
  737. }
  738. uploadOutpatientFeeDetails(row).then(res => {
  739. showMatnDises.value = false;
  740. showSpcChrAccts.value = false;
  741. if (patMedInsPaused.value === "normal") {
  742. mzPreSetl();
  743. } else {
  744. CyMessageBox.alert({
  745. type: "success",
  746. message: "上传成功",
  747. });
  748. }
  749. });
  750. };
  751. const userStore = useUserStore();
  752. const mzPreSetl = () => {
  753. if (!currentRow.value.times) {
  754. xcMessage.warning("请先选择历史处方!");
  755. return;
  756. }
  757. const param = {
  758. staffId: userStore.code,
  759. patNo: patNo.value,
  760. times: currentRow.value.times,
  761. mdtrtCertType: readCardData.mdtrtCertType,
  762. readCardResult: readCardData.readCardResult,
  763. readCardBizType: readCardData.readCardBizType,
  764. acctUsedFlag: acctUsedFlag.value,
  765. ledgerSn: 0,
  766. calType: 0,
  767. };
  768. if (injuryMode.value) {
  769. injuryOutpatientSettlement(param).then(res => {
  770. const message =
  771. "处方总费用:" +
  772. res.totalCost +
  773. ",工伤报销金额:" +
  774. res.fundPay +
  775. "。";
  776. ElMessageBox.alert(message, "试算成功", {
  777. type: "success",
  778. showCancelButton: false,
  779. }).then(() => {});
  780. });
  781. } else {
  782. outpatientPreSettlement(param).then(res => {
  783. const message =
  784. "医保处方总费用:" +
  785. res.totalCost +
  786. ",医保报销金额:" +
  787. res.fundPay +
  788. "。";
  789. ElMessageBox.alert(message, "试算成功", {
  790. type: "success",
  791. showCancelButton: false,
  792. }).then(() => {});
  793. });
  794. }
  795. };
  796. const revokeFees = () => {
  797. if (!currentRow.value.times) {
  798. xcMessage.warning("请先选择历史处方!");
  799. return;
  800. }
  801. const param = {
  802. patNo: patNo.value,
  803. times: currentRow.value.times,
  804. ledgerSn: 0,
  805. };
  806. if (injuryMode.value) {
  807. revokeInjuryOutpatientFee(param).then(res => {
  808. xcMessage.success(res);
  809. });
  810. } else {
  811. revokeOutpatientFeeDetails(param).then(res => {
  812. xcMessage.success(res);
  813. });
  814. }
  815. };
  816. const deleteMtFees = () => {
  817. if (!currentRow.value.times) {
  818. xcMessage.warning("请先选择历史处方!");
  819. return;
  820. }
  821. const param = {
  822. patNo: patNo.value,
  823. times: currentRow.value.times,
  824. };
  825. deleteAllMzReceipts(param).then(res => {
  826. xcMessage.success(res);
  827. currentReceipts.value = [];
  828. fetchHistoryReceipts();
  829. });
  830. };
  831. const acctUsedFlag = ref("1");
  832. const mzSettle = () => {
  833. if (!currentRow.value.times) {
  834. xcMessage.warning("请先选择历史处方!");
  835. return;
  836. }
  837. const param = {
  838. patNo: patNo.value,
  839. times: currentRow.value.times,
  840. saved: 1,
  841. mdtrtCertType: readCardData.mdtrtCertType,
  842. readCardResult: readCardData.readCardResult,
  843. readCardBizType: readCardData.readCardBizType,
  844. ledgerSn: 0,
  845. calType: 1,
  846. acctUsedFlag: acctUsedFlag.value,
  847. };
  848. if (injuryMode.value) {
  849. injuryOutpatientSettlement(param).then(res => {
  850. const message =
  851. "处方总费用:" +
  852. res.totalCost +
  853. ",工伤报销金额:" +
  854. res.fundPay +
  855. "。";
  856. ElMessageBox.alert(message, "结算成功", {
  857. type: "success",
  858. showCancelButton: false,
  859. }).then(() => {});
  860. });
  861. } else {
  862. outpatientSettlement(param).then(res => {
  863. clearReadCardData();
  864. const message =
  865. "医保处方总费用:" +
  866. res.totalCost +
  867. ",医保报销金额:" +
  868. res.fundPay +
  869. "。";
  870. ElMessageBox.alert(message, "结算成功", {
  871. type: "success",
  872. showCancelButton: false,
  873. }).then(() => {});
  874. });
  875. }
  876. };
  877. const revokeMzSettle = () => {
  878. if (!currentRow.value.times) {
  879. xcMessage.warning("请先选择历史处方!");
  880. return;
  881. }
  882. const param = {
  883. patNo: patNo.value,
  884. times: currentRow.value.times,
  885. ledgerSn: 0,
  886. };
  887. if (injuryMode.value) {
  888. revokeInjuryOutpatientSettlement(param).then(res => {
  889. ElMessageBox.alert(res, "提示", {
  890. type: "success",
  891. showCancelButton: false,
  892. });
  893. });
  894. } else {
  895. revokeOutpatientSettlement(param).then(res => {
  896. ElMessageBox.alert("撤销门诊结算成功", "提示", {
  897. type: "success",
  898. showCancelButton: false,
  899. });
  900. });
  901. }
  902. };
  903. const settlement = command => {
  904. if (command === "pre") {
  905. mzPreSetl();
  906. } else if (command === "fin") {
  907. mzSettle();
  908. } else {
  909. revokeMzSettle();
  910. }
  911. };
  912. const clearinfo = () => {
  913. patNo.value = "";
  914. medType.value = "";
  915. historyReceipts.value = [];
  916. currentRow.value = {};
  917. currentReceipts.value = [];
  918. };
  919. const showMzBlRecord = ref(false);
  920. function seeMzBlRecord() {
  921. if (!currentRow.value.times) {
  922. xcMessage.warning("请先选择历史处方!");
  923. return;
  924. }
  925. showMzBlRecord.value = true;
  926. }
  927. onMounted(() => {
  928. getMedTypesByFlag("clinic").then(res => {
  929. medTypes.value = res;
  930. });
  931. });
  932. </script>
  933. <style scoped lang="scss">
  934. .settle-img {
  935. z-index: 999;
  936. width: 230px;
  937. position: absolute;
  938. top: 160px;
  939. left: 260px;
  940. background: rgba(255, 255, 255, 0.5);
  941. }
  942. </style>