MzRegister.vue 27 KB

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