MzRegister.vue 29 KB

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