MzRegister.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div class="m-b_8px round-header">
  4. <el-input v-model="patientId" style="width: 100px" clearable placeholder="门诊ID">
  5. </el-input>
  6. <el-select v-model="medType" style="width: 120px" placeholder="医疗类别" @change="handleMedTypeChange">
  7. <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
  8. </el-select>
  9. <el-cascader v-model="admdvsCascader" clearable filterable placeholder="参保地区"
  10. :options="allAdmdvses" @change="handleAdmdvsChange"
  11. style="width: 160px" :disabled="injuryMode === true"></el-cascader>
  12. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  13. <el-button type="primary">
  14. 处方&nbsp;<el-icon>
  15. <ArrowDown/>
  16. </el-icon>
  17. </el-button>
  18. <template #dropdown>
  19. <el-dropdown-menu>
  20. <el-dropdown-item icon="Document" command="require">获取门诊处方</el-dropdown-item>
  21. <el-dropdown-item icon="Delete" command="delete">删除所有处方</el-dropdown-item>
  22. </el-dropdown-menu>
  23. </template>
  24. </el-dropdown>
  25. <ReadCard :pat-no="patientId" @success="afterReadCard"/>
  26. <el-dropdown trigger="click" @command="register">
  27. <el-button type="primary">
  28. 登记&nbsp;<el-icon>
  29. <ArrowDown/>
  30. </el-icon>
  31. </el-button>
  32. <template #dropdown>
  33. <el-dropdown-menu>
  34. <el-dropdown-item icon="CreditCard" command="execute">医保登记</el-dropdown-item>
  35. <el-dropdown-item icon="RefreshLeft" command="revoke">取消登记</el-dropdown-item>
  36. </el-dropdown-menu>
  37. </template>
  38. </el-dropdown>
  39. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  40. <el-button type="primary">
  41. 上传&nbsp;<el-icon>
  42. <ArrowDown/>
  43. </el-icon>
  44. </el-button>
  45. <template #dropdown>
  46. <el-dropdown-menu>
  47. <el-dropdown-item icon="Upload" command="upload">医保处方上传</el-dropdown-item>
  48. <el-dropdown-item icon="RefreshLeft" command="retract">撤销处方上传</el-dropdown-item>
  49. <el-dropdown-item divided icon="Edit" command="diags">医保诊断补录</el-dropdown-item>
  50. </el-dropdown-menu>
  51. </template>
  52. </el-dropdown>
  53. <el-dropdown trigger="click" @command="settlement" style="margin-left: 8px">
  54. <el-button type="primary">
  55. 结算&nbsp;<el-icon>
  56. <ArrowDown/>
  57. </el-icon>
  58. </el-button>
  59. <template #dropdown>
  60. <el-dropdown-menu>
  61. <el-dropdown-item icon="SetUp" command="preSettlement">试算</el-dropdown-item>
  62. <el-dropdown-item icon="Stamp" command="realSettlement">结算</el-dropdown-item>
  63. <el-dropdown-item divided icon="RefreshLeft" command="cancelSettlement">取消结算</el-dropdown-item>
  64. </el-dropdown-menu>
  65. </template>
  66. </el-dropdown>
  67. <el-button type="success" style="margin-left: 8px" @click="seeMzBlRecord">门诊病历</el-button>
  68. <el-button type="danger" icon="Refresh" @click="clearinfo"> 重置</el-button>
  69. </div>
  70. <div class="layout_display_flex">
  71. <div>
  72. <el-table
  73. ref="timesTable"
  74. :data="unPaidReceipts"
  75. highlight-current-row
  76. @row-click="clickTimes"
  77. empty-text="无"
  78. height="100%"
  79. >
  80. <el-table-column label="次数" prop="times" width="50"></el-table-column>
  81. <el-table-column label="诊间" width="50">
  82. <template #default="scope">
  83. <span v-html="isMztczf(scope.row)"></span>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </div>
  88. <div>
  89. <el-table
  90. ref="ordersTable"
  91. :data="orderNos"
  92. highlight-current-row
  93. @row-click="clickOrderNo"
  94. empty-text="无"
  95. height="100%"
  96. >
  97. <el-table-column label="处方" width="50">
  98. <template #default="scope">
  99. <span v-html="colorStatus(scope.row)"></span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="金额" width="60">
  103. <template #default="scope">
  104. {{ scope.row.totalFee.toFixed(2) }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作" width="160">
  108. <template #default="scope">
  109. <button @click="markMzFees" :disabled="scope.row.status">生成</button>
  110. <button @click="unmarkMzFees(scope.row)" :disabled="!scope.row.status">撤销</button>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. </div>
  115. <div class="layout_flex_1-x">
  116. <div style="margin: 30px; position: relative">
  117. <img v-if="mzVisit.settledFlag === 1" :src="mzSettled" alt="" style="z-index: 999; width: 230px;
  118. position: absolute; top: 160px; left: 260px; background: rgba(255,255,255,.5)">
  119. <mz-receipt :mz-visit="mzVisit" :receipts="currentReceipts" show-checkbox />
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
  125. <el-tag>{{ injuryMode ? '工伤信息' : '参保信息' }}</el-tag>
  126. <div v-if="injuryMode">
  127. <el-table :data="injuryinfo" height="180" stripe @row-click="handleClickInjuryinfo">
  128. <el-table-column label="证件号码" prop="aac002"></el-table-column>
  129. <el-table-column label="姓名" prop="aac003"></el-table-column>
  130. <el-table-column label="单位名称" prop="aab004"></el-table-column>
  131. <el-table-column label="受伤时间" prop="alc020"></el-table-column>
  132. <el-table-column label="认定申请时间" prop="alc017"></el-table-column>
  133. <el-table-column label="认定ID" prop="aaz127"></el-table-column>
  134. <el-table-column label="个人编号" prop="aac001"></el-table-column>
  135. <el-table-column label="参保统筹区" prop="baa027Name"></el-table-column>
  136. </el-table>
  137. </div>
  138. <div v-else>
  139. <el-table :data="psnBaseinfo.insuinfo" @row-click="handleClickInsuinfo">
  140. <el-table-column property="balc" label="余额"></el-table-column>
  141. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  142. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  143. <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
  144. <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
  145. <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
  146. <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
  147. <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
  148. <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
  149. <el-table-column property="empName" label="单位名称"></el-table-column>
  150. </el-table>
  151. <div style="height: 16px"></div>
  152. <el-tag>身份信息</el-tag>
  153. <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
  154. <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
  155. <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
  156. <el-table-column label="备注" prop="memo"></el-table-column>
  157. <el-table-column label="开始时间" prop="begntime"></el-table-column>
  158. <el-table-column label="结束时间" prop="endtime"></el-table-column>
  159. </el-table>
  160. </div>
  161. </el-dialog>
  162. <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
  163. <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
  164. <el-table-column property="opspDiseCode" label="病种编码"></el-table-column>
  165. <el-table-column property="opspDiseName" label="病种名称"></el-table-column>
  166. <el-table-column property="begndate" label="生效日期"></el-table-column>
  167. <el-table-column property="enddate" label="失效日期"></el-table-column>
  168. </el-table>
  169. </el-dialog>
  170. <el-dialog title="请选择生育病种" v-model="showMatnDises" width="60%">
  171. <el-table :data="matnDises" @row-click="uploadFees" stripe height="360">
  172. <el-table-column property="code" label="病种编码"></el-table-column>
  173. <el-table-column property="name" label="病种名称"></el-table-column>
  174. <el-table-column property="insutype" label="险种类型"></el-table-column>
  175. <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
  176. </el-table>
  177. </el-dialog>
  178. <el-dialog title="医保诊断补录" v-model="showInputDiags" width="60%" :close-on-click-modal="false"
  179. :close-on-press-escape="false">
  180. <outpatient-diagnose-supply :med-type="medType" :mz-visit="mzVisit"
  181. @close="showInputDiags = false"></outpatient-diagnose-supply>
  182. </el-dialog>
  183. <el-dialog v-model="showMdtrtGrpType" title="跨省患者请选择" width="360px">
  184. <div>
  185. &nbsp;&nbsp;&nbsp;&nbsp;就诊人群类型:
  186. <el-select v-model="expContent.MDTRT_GRP_TYPE" style="width: 160px">
  187. <el-option v-for="item in mdtrtGrpTypes" :key="item.key" :label="item.name" :value="item.code"></el-option>
  188. </el-select>
  189. </div>
  190. <div style="margin-top: 12px">
  191. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;外伤标志:
  192. <el-select v-model="expContent.TRUM_FLAG" style="width: 160px">
  193. <el-option label="无" value="" key="trumFlag-N"></el-option>
  194. <el-option label="非外伤" value="0" key="trumFlag-0"></el-option>
  195. <el-option label="外伤" value="1" key="trumFlag-1"></el-option>
  196. </el-select>
  197. </div>
  198. <div style="margin-top: 12px">
  199. 涉及第三方标志:
  200. <el-select v-model="expContent.REL_TTP_FLAG" style="width: 160px">
  201. <el-option label="无" value="" key="relTtpFlag-N"></el-option>
  202. <el-option label="涉及" value="0" key="relTtpFlag-0"></el-option>
  203. <el-option label="不涉及" value="1" key="relTtpFlag-1"></el-option>
  204. </el-select>
  205. </div>
  206. <div style="margin-top: 12px">
  207. 门急诊转诊标志:
  208. <el-select v-model="expContent.OTP_ER_REFL_FLAG" style="width: 160px">
  209. <el-option label="无" value="" key="otpErReflFlag-N"></el-option>
  210. <el-option label="急诊" value="1" key="otpErReflFlag-1"></el-option>
  211. <el-option label="转诊" value="2" key="otpErReflFlag-2"></el-option>
  212. <el-option label="转诊合并急诊" value="3" key="otpErReflFlag-3"></el-option>
  213. </el-select>
  214. </div>
  215. <div style="margin-top: 20px; width: 100%; text-align: right">
  216. <el-button @click="afterChooseMdtrtGrpType" type="primary" size="default">确定</el-button>
  217. </div>
  218. </el-dialog>
  219. <el-dialog v-model="showAcctUsedFlagPicker" width="260px" title="是否使用个账">
  220. <div style="width: 100%; display: flex; align-items: center;justify-content: center">
  221. <div style="width: 120px; text-align: left">
  222. <el-radio label="0" v-model="acctUsedFlag">不使用个账</el-radio>
  223. <div></div>
  224. <el-radio label="1" v-model="acctUsedFlag">使用本人个账</el-radio>
  225. <div></div>
  226. <el-radio label="2" v-model="acctUsedFlag">使用共济人个账</el-radio>
  227. </div>
  228. </div>
  229. <div style="width: 100%; text-align: center; margin-top: 30px">
  230. <el-button type="primary" style="width: 120px" @click="confirmAcctUsedFlag">确定</el-button>
  231. </div>
  232. </el-dialog>
  233. <mz-bl-record v-if="showMzBlRecord" :patient-id="patientId" :times="times" @closed="showMzBlRecord = false"></mz-bl-record>
  234. </template>
  235. <script setup>
  236. import {onMounted, reactive, ref} from 'vue'
  237. import {allAdmdvses} from '@/data/admdvs'
  238. import {
  239. deleteAllMzReceipts,
  240. deleteMzReceipt,
  241. getMzReceipts,
  242. insertSiMzFees,
  243. outpatientPreSettlement,
  244. outpatientRegistration,
  245. revokeOutpatientFeeDetails,
  246. revokeOutpatientRegistration,
  247. uploadOutpatientFeeDetails,
  248. outpatientSettlement,
  249. revokeOutpatientSettlement,
  250. } from '@/api/medical-insurance/si-outpatient'
  251. import {ElMessage, ElMessageBox, ElSelect} from 'element-plus'
  252. import {
  253. obtainBasicPersonInfo,
  254. querySpecialChronicDiseasesAccreditation,
  255. queryMzMatnDises
  256. } from '@/api/medical-insurance/si-query'
  257. import {getMedTypesByFlag} from '@/api/medical-insurance/si-dict'
  258. import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
  259. import mzSettled from '@/assets/mz-settled.png'
  260. import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-diagnose-supply/Index.vue'
  261. import {
  262. employeeInfoInquiry2, injuryOutpatientFeeUpload,
  263. injuryOutpatientRegister, injuryOutpatientSettlement, revokeInjuryOutpatientFee,
  264. revokeInjuryOutpatientRegistration, revokeInjuryOutpatientSettlement
  265. } from "@/api/medical-insurance/si-injury";
  266. import MzBlRecord from "@/components/outpatient/MzBlRecord.vue";
  267. import MzReceipt from "@/components/outpatient/MzReceipt.vue";
  268. import {useUserStore} from "@/pinia/user-store";
  269. const medType = ref(null)
  270. const admdvs = ref(null)
  271. const certainAdmdvs = ref('')
  272. const medTypes = ref([])
  273. const patientId = ref('')
  274. const times = ref(null)
  275. const unPaidReceipts = ref([])
  276. const showInsuinfo = ref(false)
  277. const psnBaseinfo = ref({})
  278. const mzVisit = ref({})
  279. const receipts = ref({})
  280. const orderNos = ref([])
  281. const currentReceipts = ref([])
  282. const timesTable = ref(null)
  283. const ordersTable = ref(null)
  284. const currentOrder = ref({})
  285. const spcChrDiseAccts = ref([])
  286. const showSpcChrAccts = ref(false)
  287. const matnDises = ref([])
  288. const showMatnDises = ref(false)
  289. const showInputDiags = ref(false)
  290. const showMdtrtGrpType = ref(false)
  291. const expContent = reactive({
  292. MDTRT_GRP_TYPE: '',
  293. TRUM_FLAG: '',
  294. REL_TTP_FLAG: '',
  295. OTP_ER_REFL_FLAG: ''
  296. })
  297. const mdtrtGrpTypes = [
  298. {code: '', name: '普通患者', key: 'mdtrtGrpTypes-N'},
  299. {code: '1', name: '新冠肺炎确诊患者', key: 'mdtrtGrpTypes-1'},
  300. {code: '2', name: '其他国家突发公共事件', key: 'mdtrtGrpTypes-2'},
  301. {code: '3', name: '新冠肺炎疑似患者', key: 'mdtrtGrpTypes-3'},
  302. {code: '4', name: '无症状感染者', key: 'mdtrtGrpTypes-4'},
  303. ]
  304. const injuryMode = computed(() => {
  305. return medType.value === '41' || medType.value === '46'
  306. })
  307. const injuryinfo = ref([])
  308. const handleClickInjuryinfo = (row) => {
  309. row.patNo = patientId.value
  310. row.times = times.value
  311. row.ledgerSn = 0
  312. row.aka130 = medType.value
  313. if (row.aka130 === '41') {
  314. row.bka003 = '410'
  315. } else if (row.aka130 === '46') {
  316. row.bka003 = '461'
  317. }
  318. injuryOutpatientRegister(row).then(() => {
  319. showInsuinfo.value = false
  320. clearReadCardData()
  321. ElMessage({
  322. message: '登记成功',
  323. type: 'success',
  324. duration: 2000,
  325. showClose: true,
  326. })
  327. });
  328. }
  329. const nullPatientId = () => {
  330. if (!patientId.value) {
  331. ElMessage({
  332. message: '请输入门诊id号!',
  333. type: 'warning',
  334. duration: 2500,
  335. showClose: true,
  336. })
  337. return true
  338. }
  339. return false
  340. }
  341. const clearExpContent = () => {
  342. expContent.MDTRT_GRP_TYPE = ''
  343. expContent.TRUM_FLAG = ''
  344. expContent.REL_TTP_FLAG = ''
  345. expContent.OTP_ER_REFL_FLAG = ''
  346. }
  347. const nullMedType = () => {
  348. if (!medType.value) {
  349. ElMessage({
  350. message: '请先选择医疗类别!',
  351. type: 'warning',
  352. duration: 2500,
  353. showClose: true,
  354. })
  355. return true
  356. }
  357. return false
  358. }
  359. const admdvsCascader = ref([])
  360. const handleMedTypeChange = (val) => {
  361. if (val === '41') {
  362. admdvsCascader.value = []
  363. admdvs.value = null
  364. }
  365. }
  366. const invalidateTips = () => {
  367. return nullPatientId() || nullTimes() || nullMedType()
  368. }
  369. const register = (command) => {
  370. if (invalidateTips()) {
  371. return
  372. }
  373. clearExpContent()
  374. const param = {
  375. patNo: patientId.value,
  376. medType: medType.value,
  377. admdvs: admdvs.value,
  378. times: times.value,
  379. legderSn: 0,
  380. needSaving: 1,
  381. }
  382. if (command === 'execute') {
  383. if (injuryMode.value) {
  384. employeeInfoInquiry2(param).then((res) => {
  385. injuryinfo.value = res
  386. showInsuinfo.value = true
  387. })
  388. } else {
  389. obtainBasicPersonInfo(param).then((res) => {
  390. times.value = res.times
  391. psnBaseinfo.value = res
  392. showInsuinfo.value = true
  393. });
  394. }
  395. } else {
  396. if (injuryMode.value) {
  397. revokeInjuryOutpatientRegistration(param).then(res => {
  398. ElMessage({
  399. message: res,
  400. type: 'success',
  401. duration: 2000,
  402. showClose: true,
  403. })
  404. })
  405. } else {
  406. revokeOutpatientRegistration(param).then((res) => {
  407. ElMessage({
  408. message: res,
  409. type: 'success',
  410. duration: 2000,
  411. showClose: true,
  412. })
  413. })
  414. }
  415. }
  416. }
  417. const nullTimes = () => {
  418. if (!times.value) {
  419. ElMessage({
  420. message: '请先获取门诊处方!',
  421. type: 'warning',
  422. duration: 2500,
  423. showClose: true,
  424. })
  425. return true
  426. }
  427. return false
  428. }
  429. const receiptsOpts = (command) => {
  430. if (nullPatientId()) {
  431. return
  432. }
  433. if (command !== 'require') {
  434. if (nullTimes()) {
  435. return
  436. }
  437. }
  438. const param = {
  439. patNo: patientId.value,
  440. times: times.value,
  441. }
  442. switch (command) {
  443. case 'require':
  444. fetchReceipts(param)
  445. break
  446. case 'delete':
  447. deleteAllMzReceipts(param).then((res) => {
  448. ElMessage({
  449. message: res,
  450. type: 'success',
  451. duration: 2000,
  452. showClose: true,
  453. })
  454. fetchReceipts(param)
  455. })
  456. break
  457. case 'upload':
  458. if (injuryMode.value) {
  459. const param = {
  460. patNo: patientId.value,
  461. times: times.value,
  462. ledgerSn: 0,
  463. calType: 0
  464. }
  465. injuryOutpatientFeeUpload(param).then(() => {
  466. injuryOutpatientSettlement(param).then(res => {
  467. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  468. ElMessageBox.alert(message, '提示', {
  469. type: 'success',
  470. showCancelButton: false,
  471. }).then(() => {})
  472. })
  473. })
  474. } else {
  475. qrySpcChrDiseAcct(param)
  476. }
  477. break;
  478. case 'retract':
  479. if (injuryMode.value) {
  480. const param = {
  481. patNo: patientId.value,
  482. times: times.value,
  483. ledgerSn: 0,
  484. }
  485. revokeInjuryOutpatientFee(param).then(res => {
  486. ElMessage({
  487. message: res,
  488. type: 'success',
  489. duration: 2000,
  490. showClose: true,
  491. })
  492. })
  493. } else {
  494. revokeOutpatientFeeDetails(param).then((res) => {
  495. ElMessage({
  496. message: res,
  497. type: 'success',
  498. duration: 2000,
  499. showClose: true,
  500. })
  501. });
  502. }
  503. break
  504. case 'diags':
  505. showInputDiags.value = true
  506. break
  507. }
  508. }
  509. const fetchReceipts = (param) => {
  510. clearReadCardData()
  511. getMzReceipts(param).then((res) => {
  512. unPaidReceipts.value = res
  513. setTimeout(() => {
  514. timesTable.value.setCurrentRow(res[0])
  515. clickTimes(res[0])
  516. }, 100)
  517. }).catch(() => {
  518. unPaidReceipts.value = []
  519. orderNos.value = []
  520. currentReceipts.value = []})
  521. }
  522. const markMzFees = () => {
  523. if (currentReceipts.value.length === 0) {
  524. ElMessage({
  525. message: '请先选择要保存的处方!',
  526. type: 'warning',
  527. duration: 2500,
  528. showClose: true,
  529. })
  530. return
  531. }
  532. ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
  533. type: 'warning',
  534. confirmButtonText: '生成',
  535. cancelButtonText: '取消',
  536. }).then(() => {
  537. insertSiMzFees(currentReceipts.value).then(() => {
  538. currentOrder.value.status = true
  539. ElMessage({
  540. message: '已成功生成医保处方。',
  541. type: 'success',
  542. duration: 2500,
  543. showClose: true,
  544. })
  545. })
  546. }).catch(() => {
  547. })
  548. }
  549. const qrySpcChrDiseAcct = (param) => {
  550. if (medType.value === '51') {
  551. queryMzMatnDises().then((res) => {
  552. matnDises.value = res
  553. showMatnDises.value = true
  554. })
  555. } else if (medType.value === '14') {
  556. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  557. spcChrDiseAccts.value = res
  558. showSpcChrAccts.value = true
  559. })
  560. } else {
  561. uploadFees(param)
  562. }
  563. }
  564. const uploadFees = (row) => {
  565. if (medType.value === '51') {
  566. row.patNo = patientId.value
  567. row.times = times.value
  568. row.opspDiseCode = row.code
  569. row.opspDiseName = row.name
  570. }
  571. uploadOutpatientFeeDetails(row).then((res) => {
  572. times.value = res.times
  573. showSpcChrAccts.value = false
  574. showMatnDises.value = false
  575. mzPreSetl()
  576. })
  577. }
  578. const readCardData = reactive({
  579. mdtrtCertType: null,
  580. readCardResult: null,
  581. readCardBizType: null,
  582. })
  583. const clearReadCardData = () => {
  584. readCardData.mdtrtCertType = null
  585. readCardData.readCardResult = null
  586. readCardData.readCardBizType = null
  587. }
  588. const afterReadCard = (result) => {
  589. readCardData.mdtrtCertType = result.mdtrtCertType
  590. readCardData.readCardResult = result.readCardResult
  591. readCardData.readCardBizType = result.readCardBizType
  592. }
  593. const handleClickInsuinfo = (row) => {
  594. certainAdmdvs.value = row.insuplcAdmdvs
  595. const param = {
  596. patNo: patientId.value,
  597. times: times.value,
  598. name: mzVisit.value.name,
  599. insutype: row.insutype,
  600. medType: medType.value,
  601. psnType: row.psnType,
  602. insuplcAdmdvs: row.insuplcAdmdvs,
  603. empName: row.empName,
  604. balc: row.balc,
  605. mdtrtCertType: readCardData.mdtrtCertType,
  606. readCardResult: readCardData.readCardResult,
  607. readCardBizType: readCardData.readCardBizType,
  608. }
  609. outpatientRegistration(param).then((res) => {
  610. showInsuinfo.value = false
  611. clearReadCardData()
  612. ElMessage({
  613. message: res,
  614. type: 'success',
  615. duration: 2000,
  616. showClose: true,
  617. })
  618. })
  619. }
  620. const clickOrderNo = (row) => {
  621. currentOrder.value = row
  622. currentReceipts.value = receipts.value[row.orderNo]
  623. mzVisit.value.totalFee = row.totalFee.toFixed(2)
  624. }
  625. const clickTimes = (row) => {
  626. mzVisit.value = row.mzVisit
  627. receipts.value = row.mzReceipts
  628. orderNos.value = row.orderNos
  629. times.value = row.times
  630. currentReceipts.value = []
  631. setTimeout(() => {
  632. ordersTable.value.setCurrentRow(orderNos.value[0])
  633. clickOrderNo(orderNos.value[0])
  634. }, 100)
  635. }
  636. const colorStatus = (row) => {
  637. return row.status ? `<span style="color: green">第${row.orderNo}张</span>` : `<span style="color: red">第${row.orderNo}张</span>`
  638. }
  639. const unmarkMzFees = (row) => {
  640. ElMessageBox.confirm('是否将选中处方从医保处方中删除?', '提示', {
  641. type: 'warning',
  642. confirmButtonText: '确定',
  643. cancelButtonText: '取消',
  644. }).then(() => {
  645. deleteMzReceipt(row).then(() => {
  646. currentOrder.value.status = false
  647. ElMessage({
  648. message: '已成功删除医保处方。',
  649. type: 'success',
  650. duration: 2500,
  651. showClose: true,
  652. })
  653. })
  654. }).catch(() => {
  655. })
  656. }
  657. const currentCommand = ref(null)
  658. const settlement = (command) => {
  659. if (nullPatientId() || nullTimes()) {
  660. return
  661. }
  662. if (command === 'cancelSettlement') {
  663. revokeMzSettle()
  664. } else {
  665. if (injuryMode.value) {
  666. const param = {
  667. patNo: patientId.value,
  668. times: times.value,
  669. ledgerSn: 0,
  670. calType: command === 'preSettlement' ? 0 : 1
  671. }
  672. injuryOutpatientSettlement(param).then(res => {
  673. const title = command === 'preSettlement' ? '试算成功' : '结算成功'
  674. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  675. ElMessageBox.alert(message, title, {
  676. type: 'success',
  677. showCancelButton: false,
  678. }).then(() => {})
  679. })
  680. } else {
  681. if (certainAdmdvs.value.startsWith('43')) {
  682. command === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag();
  683. } else {
  684. currentCommand.value = command;
  685. showMdtrtGrpType.value = true;
  686. }
  687. }
  688. }
  689. }
  690. const afterChooseMdtrtGrpType = () => {
  691. if (currentCommand.value) {
  692. currentCommand.value === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag()
  693. }
  694. showMdtrtGrpType.value = false
  695. }
  696. const userStore = useUserStore()
  697. const mzPreSetl = () => {
  698. const param = {
  699. staffId: userStore.userInfo.code,
  700. patNo: patientId.value,
  701. times: times.value,
  702. mdtrtCertType: readCardData.mdtrtCertType,
  703. readCardResult: readCardData.readCardResult,
  704. readCardBizType: readCardData.readCardBizType,
  705. expContent: JSON.stringify(expContent)
  706. }
  707. outpatientPreSettlement(param).then((res) => {
  708. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  709. ElMessageBox.alert(message, '试算成功', {
  710. type: 'success',
  711. showCancelButton: false,
  712. }).then(() => {
  713. })
  714. })
  715. }
  716. const showAcctUsedFlagPicker = ref(false)
  717. const acctUsedFlag = ref('0')
  718. const chooseWhetherUseAcctFlag = () => {
  719. showAcctUsedFlagPicker.value = true
  720. }
  721. const confirmAcctUsedFlag = () => {
  722. showAcctUsedFlagPicker.value = false
  723. const param = {
  724. patNo: patientId.value,
  725. times: times.value,
  726. acctUsedFlag: acctUsedFlag.value,
  727. mdtrtCertType: readCardData.mdtrtCertType,
  728. readCardResult: readCardData.readCardResult,
  729. readCardBizType: readCardData.readCardBizType,
  730. expContent: JSON.stringify(expContent)
  731. }
  732. outpatientSettlement(param).then((res) => {
  733. clearReadCardData()
  734. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  735. ElMessageBox.alert(message, '结算成功', {
  736. type: 'success',
  737. showCancelButton: false,
  738. }).then(() => {})
  739. })
  740. }
  741. const revokeMzSettle = () => {
  742. const param = {
  743. patNo: patientId.value,
  744. times: times.value,
  745. ledgerSn: 0,
  746. }
  747. if (injuryMode.value) {
  748. revokeInjuryOutpatientSettlement(param).then(res => {
  749. ElMessageBox.alert(res, '提示', {
  750. type: 'success',
  751. showCancelButton: false,
  752. })
  753. })
  754. } else {
  755. revokeOutpatientSettlement(param).then((res) => {
  756. ElMessageBox.alert('撤销门诊结算成功', '提示', {
  757. type: 'success',
  758. showCancelButton: false,
  759. })
  760. })
  761. }
  762. }
  763. const isMztczf = (row) => {
  764. return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
  765. }
  766. const clearinfo = () => {
  767. patientId.value = ''
  768. times.value = null
  769. unPaidReceipts.value = []
  770. psnBaseinfo.value = {}
  771. mzVisit.value = {}
  772. receipts.value = {}
  773. orderNos.value = []
  774. currentReceipts.value = []
  775. timesTable.value = null
  776. ordersTable.value = null
  777. currentOrder.value = {}
  778. spcChrDiseAccts.value = []
  779. }
  780. const handleAdmdvsChange = (val) => {
  781. admdvs.value = val ? val[1] : null;
  782. }
  783. const showMzBlRecord = ref(false)
  784. function seeMzBlRecord() {
  785. if (nullTimes()) {
  786. return
  787. }
  788. showMzBlRecord.value = true
  789. }
  790. onMounted(() => {
  791. getMedTypesByFlag('clinic').then((res) => {
  792. medTypes.value = res
  793. })
  794. })
  795. </script>