MzRegister.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925
  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. <el-dialog v-model="showAcctUsedFlagPicker" width="260px" title="是否使用个账">
  256. <div style="width: 100%; display: flex; align-items: center;justify-content: center">
  257. <div style="width: 120px; text-align: left">
  258. <el-radio label="0" v-model="acctUsedFlag">不使用个账</el-radio>
  259. <div></div>
  260. <el-radio label="1" v-model="acctUsedFlag">使用本人个账</el-radio>
  261. <div></div>
  262. <el-radio label="2" v-model="acctUsedFlag">使用共济人个账</el-radio>
  263. </div>
  264. </div>
  265. <div style="width: 100%; text-align: center; margin-top: 30px">
  266. <el-button type="primary" style="width: 120px" @click="confirmAcctUsedFlag">确定</el-button>
  267. </div>
  268. </el-dialog>
  269. </template>
  270. </page-layer>
  271. </template>
  272. <script setup>
  273. import {onMounted, reactive, ref} from 'vue'
  274. import {allAdmdvses} from '@/data/admdvs'
  275. import {
  276. deleteAllMzReceipts,
  277. deleteMzReceipt,
  278. getMzReceipts,
  279. insertSiMzFees,
  280. outpatientPreSettlement,
  281. outpatientRegistration,
  282. revokeOutpatientFeeDetails,
  283. revokeOutpatientRegistration,
  284. uploadOutpatientFeeDetails,
  285. outpatientSettlement,
  286. revokeOutpatientSettlement,
  287. } from '@/api/medical-insurance/si-outpatient'
  288. import {ElMessage, ElMessageBox, ElSelect} from 'element-plus'
  289. import store from '@/store'
  290. import {
  291. obtainBasicPersonInfo,
  292. querySpecialChronicDiseasesAccreditation,
  293. queryMzMatnDises
  294. } from '@/api/medical-insurance/si-query'
  295. import {getMedTypesByFlag} from '@/api/medical-insurance/si-dict'
  296. import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
  297. import mzSettled from '@/assets/mz-settled.png'
  298. import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-diagnose-supply/Index.vue'
  299. import PageLayer from "@/layout/PageLayer";
  300. import {
  301. employeeInfoInquiry2, injuryOutpatientFeeUpload,
  302. injuryOutpatientRegister, injuryOutpatientSettlement, revokeInjuryOutpatientFee,
  303. revokeInjuryOutpatientRegistration, revokeInjuryOutpatientSettlement
  304. } from "@/api/medical-insurance/si-injury";
  305. const medType = ref(null)
  306. const admdvs = ref(null)
  307. const certainAdmdvs = ref('')
  308. const medTypes = ref([])
  309. const patientId = ref('')
  310. const times = ref(null)
  311. const windowSize = store.state.app.windowSize
  312. const receiptBoxStyle = {
  313. height: windowSize.h - 335 + 'px',
  314. overflowY: 'auto',
  315. }
  316. const unPaidReceipts = ref([])
  317. const showInsuinfo = ref(false)
  318. const psnBaseinfo = ref({})
  319. const mzVisit = ref({})
  320. const receipts = ref({})
  321. const orderNos = ref([])
  322. const currentReceipts = ref([])
  323. const totalFee = ref(null)
  324. const timesTable = ref(null)
  325. const ordersTable = ref(null)
  326. const currentOrder = ref({})
  327. const spcChrDiseAccts = ref([])
  328. const showSpcChrAccts = ref(false)
  329. const matnDises = ref([])
  330. const showMatnDises = ref(false)
  331. const showInputDiags = ref(false)
  332. const showMdtrtGrpType = ref(false)
  333. const expContent = reactive({
  334. MDTRT_GRP_TYPE: '',
  335. TRUM_FLAG: '',
  336. REL_TTP_FLAG: '',
  337. OTP_ER_REFL_FLAG: ''
  338. })
  339. const mdtrtGrpTypes = [
  340. {code: '', name: '普通患者', key: 'mdtrtGrpTypes-N'},
  341. {code: '1', name: '新冠肺炎确诊患者', key: 'mdtrtGrpTypes-1'},
  342. {code: '2', name: '其他国家突发公共事件', key: 'mdtrtGrpTypes-2'},
  343. {code: '3', name: '新冠肺炎疑似患者', key: 'mdtrtGrpTypes-3'},
  344. {code: '4', name: '无症状感染者', key: 'mdtrtGrpTypes-4'},
  345. ]
  346. const injuryMode = computed(() => {
  347. return medType.value === '41' || medType.value === '46'
  348. })
  349. const injuryinfo = ref([])
  350. const handleClickInjuryinfo = (row) => {
  351. row.patNo = patientId.value
  352. row.times = times.value
  353. row.ledgerSn = 0
  354. row.aka130 = medType.value
  355. if (row.aka130 === '41') {
  356. row.bka003 = '410'
  357. } else if (row.aka130 === '46') {
  358. row.bka003 = '461'
  359. }
  360. injuryOutpatientRegister(row).then(() => {
  361. showInsuinfo.value = false
  362. clearReadCardData()
  363. ElMessage({
  364. message: '登记成功',
  365. type: 'success',
  366. duration: 2000,
  367. showClose: true,
  368. })
  369. });
  370. }
  371. const nullPatientId = () => {
  372. if (!patientId.value) {
  373. ElMessage({
  374. message: '请输入门诊id号!',
  375. type: 'warning',
  376. duration: 2500,
  377. showClose: true,
  378. })
  379. return true
  380. }
  381. return false
  382. }
  383. const clearExpContent = () => {
  384. expContent.MDTRT_GRP_TYPE = ''
  385. expContent.TRUM_FLAG = ''
  386. expContent.REL_TTP_FLAG = ''
  387. expContent.OTP_ER_REFL_FLAG = ''
  388. }
  389. const nullMedType = () => {
  390. if (!medType.value) {
  391. ElMessage({
  392. message: '请先选择医疗类别!',
  393. type: 'warning',
  394. duration: 2500,
  395. showClose: true,
  396. })
  397. return true
  398. }
  399. return false
  400. }
  401. const admdvsCascader = ref([])
  402. const handleMedTypeChange = (val) => {
  403. if (val === '41') {
  404. admdvsCascader.value = []
  405. admdvs.value = null
  406. }
  407. }
  408. const invalidateTips = () => {
  409. return nullPatientId() || nullTimes() || nullMedType()
  410. }
  411. const register = (command) => {
  412. if (invalidateTips()) {
  413. return
  414. }
  415. clearExpContent()
  416. const param = {
  417. patNo: patientId.value,
  418. medType: medType.value,
  419. admdvs: admdvs.value,
  420. times: times.value,
  421. legderSn: 0,
  422. needSaving: 1,
  423. }
  424. if (command === 'execute') {
  425. if (injuryMode.value) {
  426. employeeInfoInquiry2(param).then((res) => {
  427. injuryinfo.value = res
  428. showInsuinfo.value = true
  429. })
  430. } else {
  431. obtainBasicPersonInfo(param).then((res) => {
  432. times.value = res.times
  433. psnBaseinfo.value = res
  434. showInsuinfo.value = true
  435. });
  436. }
  437. } else {
  438. if (injuryMode.value) {
  439. revokeInjuryOutpatientRegistration(param).then(res => {
  440. ElMessage({
  441. message: res,
  442. type: 'success',
  443. duration: 2000,
  444. showClose: true,
  445. })
  446. })
  447. } else {
  448. revokeOutpatientRegistration(param).then((res) => {
  449. ElMessage({
  450. message: res,
  451. type: 'success',
  452. duration: 2000,
  453. showClose: true,
  454. })
  455. })
  456. }
  457. }
  458. }
  459. const nullTimes = () => {
  460. if (!times.value) {
  461. ElMessage({
  462. message: '请先获取门诊处方!',
  463. type: 'warning',
  464. duration: 2500,
  465. showClose: true,
  466. })
  467. return true
  468. }
  469. return false
  470. }
  471. const receiptsOpts = (command) => {
  472. if (nullPatientId()) {
  473. return
  474. }
  475. if (command !== 'require') {
  476. if (nullTimes()) {
  477. return
  478. }
  479. }
  480. const param = {
  481. patNo: patientId.value,
  482. times: times.value,
  483. }
  484. switch (command) {
  485. case 'require':
  486. fetchReceipts(param)
  487. break
  488. case 'delete':
  489. deleteAllMzReceipts(param).then((res) => {
  490. ElMessage({
  491. message: res,
  492. type: 'success',
  493. duration: 2000,
  494. showClose: true,
  495. })
  496. fetchReceipts(param)
  497. })
  498. break
  499. case 'upload':
  500. if (injuryMode.value) {
  501. const param = {
  502. patNo: patientId.value,
  503. times: times.value,
  504. ledgerSn: 0,
  505. calType: 0
  506. }
  507. injuryOutpatientFeeUpload(param).then(() => {
  508. injuryOutpatientSettlement(param).then(res => {
  509. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  510. ElMessageBox.alert(message, '提示', {
  511. type: 'success',
  512. showCancelButton: false,
  513. }).then(() => {})
  514. })
  515. })
  516. } else {
  517. qrySpcChrDiseAcct(param)
  518. }
  519. break;
  520. case 'retract':
  521. if (injuryMode.value) {
  522. const param = {
  523. patNo: patientId.value,
  524. times: times.value,
  525. ledgerSn: 0,
  526. }
  527. revokeInjuryOutpatientFee(param).then(res => {
  528. ElMessage({
  529. message: res,
  530. type: 'success',
  531. duration: 2000,
  532. showClose: true,
  533. })
  534. })
  535. } else {
  536. revokeOutpatientFeeDetails(param).then((res) => {
  537. ElMessage({
  538. message: res,
  539. type: 'success',
  540. duration: 2000,
  541. showClose: true,
  542. })
  543. });
  544. }
  545. break
  546. case 'diags':
  547. showInputDiags.value = true
  548. break
  549. }
  550. }
  551. const fetchReceipts = (param) => {
  552. clearReadCardData()
  553. getMzReceipts(param).then((res) => {
  554. unPaidReceipts.value = res
  555. setTimeout(() => {
  556. timesTable.value.setCurrentRow(res[0])
  557. clickTimes(res[0])
  558. }, 100)
  559. }).catch(() => {
  560. unPaidReceipts.value = []
  561. orderNos.value = []
  562. currentReceipts.value = []})
  563. }
  564. const markMzFees = () => {
  565. if (currentReceipts.value.length === 0) {
  566. ElMessage({
  567. message: '请先选择要保存的处方!',
  568. type: 'warning',
  569. duration: 2500,
  570. showClose: true,
  571. })
  572. return
  573. }
  574. ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
  575. type: 'warning',
  576. confirmButtonText: '生成',
  577. cancelButtonText: '取消',
  578. }).then(() => {
  579. insertSiMzFees(currentReceipts.value).then(() => {
  580. currentOrder.value.status = true
  581. ElMessage({
  582. message: '已成功生成医保处方。',
  583. type: 'success',
  584. duration: 2500,
  585. showClose: true,
  586. })
  587. })
  588. }).catch(() => {
  589. })
  590. }
  591. const qrySpcChrDiseAcct = (param) => {
  592. if (medType.value === '51') {
  593. queryMzMatnDises().then((res) => {
  594. matnDises.value = res
  595. showMatnDises.value = true
  596. })
  597. } else if (medType.value === '14') {
  598. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  599. spcChrDiseAccts.value = res
  600. showSpcChrAccts.value = true
  601. })
  602. } else {
  603. uploadFees(param)
  604. }
  605. }
  606. const uploadFees = (row) => {
  607. if (medType.value === '51') {
  608. row.patNo = patientId.value
  609. row.times = times.value
  610. row.opspDiseCode = row.code
  611. row.opspDiseName = row.name
  612. }
  613. uploadOutpatientFeeDetails(row).then((res) => {
  614. times.value = res.times
  615. showSpcChrAccts.value = false
  616. showMatnDises.value = false
  617. mzPreSetl()
  618. })
  619. }
  620. const readCardData = reactive({
  621. mdtrtCertType: null,
  622. readCardResult: null,
  623. readCardBizType: null,
  624. })
  625. const clearReadCardData = () => {
  626. readCardData.mdtrtCertType = null
  627. readCardData.readCardResult = null
  628. readCardData.readCardBizType = null
  629. }
  630. const afterReadCard = (result) => {
  631. readCardData.mdtrtCertType = result.mdtrtCertType
  632. readCardData.readCardResult = result.readCardResult
  633. readCardData.readCardBizType = result.readCardBizType
  634. }
  635. const handleClickInsuinfo = (row) => {
  636. certainAdmdvs.value = row.insuplcAdmdvs
  637. const param = {
  638. patNo: patientId.value,
  639. times: times.value,
  640. name: mzVisit.value.name,
  641. insutype: row.insutype,
  642. medType: medType.value,
  643. psnType: row.psnType,
  644. insuplcAdmdvs: row.insuplcAdmdvs,
  645. empName: row.empName,
  646. balc: row.balc,
  647. mdtrtCertType: readCardData.mdtrtCertType,
  648. readCardResult: readCardData.readCardResult,
  649. readCardBizType: readCardData.readCardBizType,
  650. }
  651. outpatientRegistration(param).then((res) => {
  652. showInsuinfo.value = false
  653. clearReadCardData()
  654. ElMessage({
  655. message: res,
  656. type: 'success',
  657. duration: 2000,
  658. showClose: true,
  659. })
  660. })
  661. }
  662. const clickOrderNo = (row) => {
  663. currentOrder.value = row
  664. currentReceipts.value = receipts.value[row.orderNo]
  665. totalFee.value = row.totalFee.toFixed(2)
  666. }
  667. const clickTimes = (row) => {
  668. mzVisit.value = row.mzVisit
  669. receipts.value = row.mzReceipts
  670. orderNos.value = row.orderNos
  671. times.value = row.times
  672. currentReceipts.value = []
  673. setTimeout(() => {
  674. ordersTable.value.setCurrentRow(orderNos.value[0])
  675. clickOrderNo(orderNos.value[0])
  676. }, 100)
  677. }
  678. const colorStatus = (row) => {
  679. return row.status ? `<span style="color: green">第${row.orderNo}张</span>` : `<span style="color: red">第${row.orderNo}张</span>`
  680. }
  681. const unmarkMzFees = (row) => {
  682. ElMessageBox.confirm('是否将选中处方从医保处方中删除?', '提示', {
  683. type: 'warning',
  684. confirmButtonText: '确定',
  685. cancelButtonText: '取消',
  686. }).then(() => {
  687. deleteMzReceipt(row).then(() => {
  688. currentOrder.value.status = false
  689. ElMessage({
  690. message: '已成功删除医保处方。',
  691. type: 'success',
  692. duration: 2500,
  693. showClose: true,
  694. })
  695. })
  696. }).catch(() => {
  697. })
  698. }
  699. const currentCommand = ref(null)
  700. const settlement = (command) => {
  701. if (nullPatientId() || nullTimes()) {
  702. return
  703. }
  704. if (command === 'cancelSettlement') {
  705. revokeMzSettle()
  706. } else {
  707. if (injuryMode.value) {
  708. const param = {
  709. patNo: patientId.value,
  710. times: times.value,
  711. ledgerSn: 0,
  712. calType: command === 'preSettlement' ? 0 : 1
  713. }
  714. injuryOutpatientSettlement(param).then(res => {
  715. const title = command === 'preSettlement' ? '试算成功' : '结算成功'
  716. const message = '处方总费用:' + res.totalCost + ',工伤报销金额:' + res.fundPay + '。'
  717. ElMessageBox.alert(message, title, {
  718. type: 'success',
  719. showCancelButton: false,
  720. }).then(() => {})
  721. })
  722. } else {
  723. if (certainAdmdvs.value.startsWith('43')) {
  724. command === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag();
  725. } else {
  726. currentCommand.value = command;
  727. showMdtrtGrpType.value = true;
  728. }
  729. }
  730. }
  731. }
  732. const afterChooseMdtrtGrpType = () => {
  733. if (currentCommand.value) {
  734. currentCommand.value === 'preSettlement' ? mzPreSetl() : chooseWhetherUseAcctFlag()
  735. }
  736. showMdtrtGrpType.value = false
  737. }
  738. const mzPreSetl = () => {
  739. const param = {
  740. staffId: store.state.user.info.code,
  741. patNo: patientId.value,
  742. times: times.value,
  743. mdtrtCertType: readCardData.mdtrtCertType,
  744. readCardResult: readCardData.readCardResult,
  745. readCardBizType: readCardData.readCardBizType,
  746. expContent: JSON.stringify(expContent)
  747. }
  748. outpatientPreSettlement(param).then((res) => {
  749. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  750. ElMessageBox.alert(message, '试算成功', {
  751. type: 'success',
  752. showCancelButton: false,
  753. }).then(() => {
  754. })
  755. })
  756. }
  757. const showAcctUsedFlagPicker = ref(false)
  758. const acctUsedFlag = ref('0')
  759. const chooseWhetherUseAcctFlag = () => {
  760. showAcctUsedFlagPicker.value = true
  761. }
  762. const confirmAcctUsedFlag = () => {
  763. const param = {
  764. patNo: patientId.value,
  765. times: times.value,
  766. acctUsedFlag: acctUsedFlag.value,
  767. mdtrtCertType: readCardData.mdtrtCertType,
  768. readCardResult: readCardData.readCardResult,
  769. readCardBizType: readCardData.readCardBizType,
  770. expContent: JSON.stringify(expContent)
  771. }
  772. outpatientSettlement(param).then((res) => {
  773. clearReadCardData()
  774. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  775. ElMessageBox.alert(message, '结算成功', {
  776. type: 'success',
  777. showCancelButton: false,
  778. }).then(() => {})
  779. })
  780. }
  781. const revokeMzSettle = () => {
  782. const param = {
  783. patNo: patientId.value,
  784. times: times.value,
  785. ledgerSn: 0,
  786. }
  787. if (injuryMode.value) {
  788. revokeInjuryOutpatientSettlement(param).then(res => {
  789. ElMessageBox.alert(res, '提示', {
  790. type: 'success',
  791. showCancelButton: false,
  792. })
  793. })
  794. } else {
  795. revokeOutpatientSettlement(param).then((res) => {
  796. ElMessageBox.alert('撤销门诊结算成功', '提示', {
  797. type: 'success',
  798. showCancelButton: false,
  799. })
  800. })
  801. }
  802. }
  803. const isMztczf = (row) => {
  804. return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
  805. }
  806. const clearinfo = () => {
  807. patientId.value = ''
  808. times.value = null
  809. unPaidReceipts.value = []
  810. psnBaseinfo.value = {}
  811. mzVisit.value = {}
  812. receipts.value = {}
  813. orderNos.value = []
  814. currentReceipts.value = []
  815. totalFee.value = null
  816. timesTable.value = null
  817. ordersTable.value = null
  818. currentOrder.value = {}
  819. spcChrDiseAccts.value = []
  820. }
  821. const highlightYbCode = (hisCode, ybCode) => {
  822. if (!hisCode) {
  823. return ''
  824. }
  825. return ybCode ? `<span>${ybCode}</span>` : '<span style="color: red">医师无医保编码</span>'
  826. }
  827. const handleAdmdvsChange = (val) => {
  828. admdvs.value = val ? val[1] : null;
  829. }
  830. onMounted(() => {
  831. getMedTypesByFlag('clinic').then((res) => {
  832. medTypes.value = res
  833. })
  834. })
  835. </script>
  836. <style scoped>
  837. .receipt-title {
  838. width: 100%;
  839. text-align: center;
  840. font-weight: bold;
  841. font-size: 20px;
  842. height: 32px;
  843. line-height: 32px;
  844. }
  845. .receipt-head {
  846. display: flex;
  847. height: 22px;
  848. line-height: 22px;
  849. }
  850. .receipt-head > div {
  851. width: 33%;
  852. padding-right: 20px;
  853. }
  854. .receipt-item {
  855. display: flex;
  856. }
  857. .receipt-tips {
  858. margin: 0 0 0 64px;
  859. }
  860. .receipt-tips > span {
  861. margin-right: 15px;
  862. }
  863. .w75 {
  864. width: 70%;
  865. font-size: 15px;
  866. }
  867. .w75 * {
  868. font-size: 15px;
  869. }
  870. .w25 {
  871. width: 25%;
  872. font-size: 15px;
  873. color: #0f5e0f;
  874. font-weight: bold;
  875. }
  876. </style>