DiscSettlement.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <el-container>
  3. <el-header height="35px">
  4. <el-button type="success" icon="el-icon-refresh-right" @click="rcvrcalcost"> 费用接收重算 </el-button>
  5. <el-button type="primary" icon="el-icon-refresh-left" @click="showConventions"> 撤销检验项目 </el-button>
  6. <el-button type="success" icon="el-icon-time" @click="beforeSettle(false)">出院结算</el-button>
  7. <el-button type="info" icon="el-icon-video-pause" @click="beforeSettle(true)">中间断账</el-button>
  8. <el-button type="warning" icon="el-icon-odometer" :disabled="!isAdmin" @click="cancelDismiss">取消出院结算</el-button>
  9. <el-button v-if="isKqk" type="danger" icon="el-icon-tickets" @click="makeDismissOrder">生成出院医嘱</el-button>
  10. </el-header>
  11. <el-main>
  12. <el-tag type="info">基本信息</el-tag>
  13. <el-descriptions :column="4" border>
  14. <el-descriptions-item>
  15. <template #label> 住院号 </template>
  16. {{ patient.inpatientNo }}
  17. </el-descriptions-item>
  18. <el-descriptions-item>
  19. <template #label> 姓名 </template>
  20. {{ patient.name }}
  21. </el-descriptions-item>
  22. <el-descriptions-item>
  23. <template #label>性别 </template>
  24. {{ cptSex(patient.sex) }}
  25. </el-descriptions-item>
  26. <el-descriptions-item>
  27. <template #label> 病房 </template>
  28. {{ patient.admissWardName }}
  29. </el-descriptions-item>
  30. <el-descriptions-item>
  31. <template #label> 床号 </template>
  32. {{ patient.bedNo }}
  33. </el-descriptions-item>
  34. <el-descriptions-item>
  35. <template #label> 总费用 </template>
  36. <span v-show="patient.inpatientNo">{{ patient.totalCharge }}</span>
  37. </el-descriptions-item>
  38. <el-descriptions-item>
  39. <template #label> 余额 </template>
  40. <span v-html="getBalance(patient.balance)"></span>
  41. </el-descriptions-item>
  42. <el-descriptions-item>
  43. <template #label> 入院日期 </template>
  44. {{ patient.admissDate }}
  45. </el-descriptions-item>
  46. <el-descriptions-item>
  47. <template #label> 手术 </template>
  48. <span v-show="patient.inpatientNo">{{ cptOperation(patient.operation) }}</span>
  49. </el-descriptions-item>
  50. <el-descriptions-item>
  51. <template #label> 医疗类别 </template>
  52. {{ patient.medTypeName }}
  53. </el-descriptions-item>
  54. <el-descriptions-item>
  55. <template #label> 险种类型 </template>
  56. {{ patient.insutypeName }}
  57. </el-descriptions-item>
  58. </el-descriptions>
  59. <div class="m-divider"></div>
  60. <div>
  61. <el-tag type="info">医保出院诊断</el-tag>
  62. <el-table :data="diags.yb" stripe :height="tableHeight">
  63. <el-table-column prop="disDiagNo" label="序号"></el-table-column>
  64. <el-table-column prop="disDiag" label="诊断编码"></el-table-column>
  65. <el-table-column prop="disDiagComment" label="诊断内容"></el-table-column>
  66. <el-table-column prop="disDiagStatus" label="出院转归"></el-table-column>
  67. <el-table-column prop="opName" label="录入人"></el-table-column>
  68. </el-table>
  69. <div style="height: 10px"></div>
  70. <el-tag type="info">病案首页诊断</el-tag>
  71. <el-table :data="diags.bl" stripe :height="tableHeight">
  72. <el-table-column prop="disDiagNo" label="序号"></el-table-column>
  73. <el-table-column prop="disDiag" label="诊断编码"></el-table-column>
  74. <el-table-column prop="disDiagComment" label="诊断内容"></el-table-column>
  75. <el-table-column prop="disDiagStatusName" label="出院转归"></el-table-column>
  76. <el-table-column prop="opName" label="录入人"></el-table-column>
  77. </el-table>
  78. </div>
  79. <el-dialog title="请选择中间断账的日期和时间" v-model="showZjdzDate" width="500px">
  80. <div style="height: 20px"></div>
  81. <el-date-picker v-model="patient.zjdzDatetime" type="datetime" placeholder="选择日期时间"></el-date-picker>
  82. <div style="height: 30px"></div>
  83. <div style="width: 450px; text-align: right">
  84. <el-button type="info" icon="el-icon-close" @click="cancelSelectZjdzDate">取消</el-button>
  85. <el-button type="success" icon="el-icon-check" @click="confirmSelectZjdzDate">确定</el-button>
  86. </div>
  87. </el-dialog>
  88. <el-dialog :title="dismissBtnText + '申请'" v-model="showSettleApplyForm" width="500px">
  89. <div style="margin-bottom: 20px">
  90. {{ dismissBtnText }}时间:<el-date-picker
  91. :disabled="!patient.midSetl"
  92. v-model="settleApply.settleDatetime"
  93. type="datetime"
  94. placeholder="请选择要断账的时间"
  95. ></el-date-picker>
  96. </div>
  97. <el-input type="textarea" v-model="settleApply.inputComment" placeholder="请输入申请理由"></el-input>
  98. <div style="width: 450px; text-align: right; margin-top: 30px">
  99. <el-button type="info" icon="el-icon-close" @click="cancelSettleApply">取消</el-button>
  100. <el-button type="success" icon="el-icon-check" @click="confirmSettleApply">提交</el-button>
  101. </div>
  102. </el-dialog>
  103. <el-dialog :title="dismissBtnText" v-model="showActOrders" fullscreen @close="closeActOrder">
  104. <el-table :data="actOrders" @row-click="switchActOrder" :height="actOrderHeight">
  105. <el-table-column label="医嘱号" fixed>
  106. <template #default="scope">
  107. <span v-html="getOrderStatus(scope.row)"></span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column property="list[0].orderName" label="医嘱名称" fixed></el-table-column>
  111. <el-table-column property="list[0].frequCode" label="频率"></el-table-column>
  112. <el-table-column property="cxFlag" label="撤销">
  113. <template #default="scope">
  114. <span v-html="getCxFlag(scope.row.cxFlag)"></span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column property="list[0].drugSpecification" label="规格"></el-table-column>
  118. <el-table-column property="list[0].startTime" label="开始时间"></el-table-column>
  119. <el-table-column property="list[0].endTime" label="结束时间"></el-table-column>
  120. <el-table-column property="list[0].chargeAmount" label="一次领量"></el-table-column>
  121. <el-table-column property="list[0].supplyCode" label="给药方式"></el-table-column>
  122. <el-table-column property="list[0].physician" label="医生"></el-table-column>
  123. <el-table-column property="list[0].enterOper" label="录入人"></el-table-column>
  124. <el-table-column property="list[0].orderCode" label="医嘱码"></el-table-column>
  125. <el-table-column property="list[0].wardCode" label="病房"></el-table-column>
  126. </el-table>
  127. <div style="height: 1px; background: lightgray; margin: 15px 0"></div>
  128. <el-table :data="actOrderDetail" :height="actOrderHeight">
  129. <el-table-column label="日期" fixed>
  130. <template #default="scope">
  131. <span v-html="getOrderDetailStatus(scope.row)"></span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column property="chargeCode" label="收费码"></el-table-column>
  135. <el-table-column property="chargeName" label="项目名称"></el-table-column>
  136. <el-table-column property="drugSpecification" label="规格"></el-table-column>
  137. <el-table-column property="chargeStatus" label="状态">
  138. <template #default="scope">
  139. {{ scope.row.chargeStatus }}
  140. </template>
  141. </el-table-column>
  142. <el-table-column property="chargeAmount" label="数量"></el-table-column>
  143. <el-table-column property="chargeFee" label="金额"></el-table-column>
  144. <el-table-column property="pageNo" label="药品单号"></el-table-column>
  145. <el-table-column property="execUnit" label="执行科室"></el-table-column>
  146. <el-table-column property="wardName" label="病区"></el-table-column>
  147. </el-table>
  148. <div style="height: 5px"></div>
  149. <el-tag style="float: left; margin-top: 5px" v-cloak>
  150. <span style="background: orangered" class="color-span"></span>&nbsp;医技未确认 <span style="background: dodgerblue" class="color-span"></span>&nbsp;未确认药
  151. <span style="background: orange" class="color-span"></span>&nbsp;未接收
  152. </el-tag>
  153. <div style="float: right; margin-top: 5px" v-cloak>
  154. <ReadCard :pat-no="patient.inpatientNo" biztype="01301" @success="afterReadCard" />
  155. <el-button type="primary" icon="el-icon-data-analysis" @click="doCalFee">费用计算</el-button>
  156. <el-button type="success" icon="el-icon-time" @click="excuteDismiss">{{ dismissBtnText }}</el-button>
  157. <el-button type="warning" icon="el-icon-close" @click="closeActOrder">关闭</el-button>
  158. </div>
  159. </el-dialog>
  160. <el-dialog title="此患者费用清单存在负数" v-model="showNegativeFee" width="800px">
  161. <div style="display: inline-block">
  162. <el-table :data="negativeFees.slice(0, negativeFees.length / 2 + 1)" empty-text=" " height="300">
  163. <el-table-column property="code" label="费用" width="80"></el-table-column>
  164. <el-table-column property="chargeCode" label="编码" width="80"></el-table-column>
  165. <el-table-column property="name" label="名称" width="180"></el-table-column>
  166. </el-table>
  167. </div>
  168. <div style="display: inline-block; margin-left: 8px">
  169. <el-table :data="negativeFees.slice(negativeFees.length / 2 + 1, negativeFees.length)" empty-text=" " height="300">
  170. <el-table-column property="code" label="费用" width="80"></el-table-column>
  171. <el-table-column property="chargeCode" label="编码" width="80"></el-table-column>
  172. <el-table-column property="name" label="名称" width="180"></el-table-column>
  173. </el-table>
  174. </div>
  175. </el-dialog>
  176. <el-dialog title="撤销检验项目" v-model="conventionsVisible" fullscreen @close="closeThreeConventions">
  177. <el-table :data="roughConventions" @row-click="clickConvention" highlight-current-row :height="actOrderHeight" @selection-change="handleSelectConvention">
  178. <el-table-column type="selection"></el-table-column>
  179. <el-table-column property="inpatientNo" label="住院号"></el-table-column>
  180. <el-table-column property="name" label="姓名"></el-table-column>
  181. <el-table-column property="bedNo" label="床号"></el-table-column>
  182. <el-table-column property="actOrderNo" label="医嘱号"></el-table-column>
  183. <el-table-column property="occTime" label="医嘱日期"></el-table-column>
  184. <el-table-column property="doctorName" label="医生"></el-table-column>
  185. <el-table-column property="orderName" label="医嘱名称"></el-table-column>
  186. </el-table>
  187. <div style="height: 1px; background: lightgray; margin: 15px 0"></div>
  188. <el-table :data="conventionDetails" :height="actOrderHeight">
  189. <el-table-column label="选择" width="70">
  190. <template #default="scope">
  191. <input type="checkbox" disabled :checked="scope.row.checked" />
  192. </template>
  193. </el-table-column>
  194. <el-table-column property="name" label="姓名"></el-table-column>
  195. <el-table-column property="actOrderNo" label="医嘱号"></el-table-column>
  196. <el-table-column property="orderName" label="医嘱名称"></el-table-column>
  197. <el-table-column property="doctorName" label="医生"></el-table-column>
  198. <el-table-column property="occTime" label="医嘱日期"></el-table-column>
  199. <el-table-column property="xmName" label="项目名称"></el-table-column>
  200. <el-table-column property="price" label="单价"></el-table-column>
  201. <el-table-column property="amount" label="数量"></el-table-column>
  202. <el-table-column property="fee" label="金额"></el-table-column>
  203. </el-table>
  204. <el-tag style="float: right; margin-top: 5px" v-cloak>
  205. <el-button type="success" @click="confirmRetractConventions">撤销检验项目</el-button>
  206. <el-button type="warning" @click="closeThreeConventions">关闭</el-button>
  207. </el-tag>
  208. </el-dialog>
  209. <el-dialog title="请选择出院医嘱的日期和时间" v-model="showDismissOrderDate" width="500px">
  210. <el-date-picker v-model="patient.dismissOrderDate" type="datetime" placeholder="选择日期时间"> </el-date-picker>
  211. <div style="height: 30px"></div>
  212. <div style="width: 450px; text-align: right">
  213. <el-button type="info" icon="el-icon-close" @click="cancelSelectDismissOrderDate">取消</el-button>
  214. <el-button type="success" icon="el-icon-check" @click="confirmSelectDismissOrderDate">确定</el-button>
  215. </div>
  216. </el-dialog>
  217. </el-main>
  218. </el-container>
  219. </template>
  220. <script>
  221. import { computed, onActivated, onDeactivated, onMounted, reactive, ref, watchEffect } from 'vue'
  222. import store from '@/store'
  223. import { cptSex, cptOperation, cptDisDiagStatus } from '@/utils/computed'
  224. import { genDismissActOrder, getDisDiag, receiveAndRecalculateCost } from '@/api/yibao/patient'
  225. import { dismissCalculate, getActOrders, selfPayDismiss } from '@/api/yibao/dismiss'
  226. import { getDatetime, formatDatetime } from '@/utils/date'
  227. import { nullPatient } from '@/utils/validate'
  228. import { ElMessage, ElMessageBox } from 'element-plus'
  229. import { dischargeProcessing, revokeSettlement } from '@/api/medical-insurance/si-inpatient'
  230. import { getSiPatInfo } from '@/api/medical-insurance/si-query'
  231. import { getDetailConventions, getRoughConventions, retractConventions } from '@/api/yibao/conventions'
  232. import { getGreatestRole } from '@/utils/permission'
  233. import { injurySettlement, revokeInjurySettlement } from '@/api/medical-insurance/si-injury'
  234. import { selectSettleApply, submitSettleApply } from '@/api/medical-insurance/si-settle-apply'
  235. import { baseinfo } from '@/data/inpatient'
  236. import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
  237. export default {
  238. components: {
  239. ReadCard,
  240. },
  241. setup() {
  242. const isAdmin = getGreatestRole() < 10
  243. const actOrderHeight = (store.state.app.windowSize.h - 160) / 2
  244. const patient = computed(() => {
  245. return baseinfo()
  246. })
  247. const injuryMode = computed(() => {
  248. return store.state.ptnt.injuryMode
  249. })
  250. const diags = initDiags()
  251. const fecthDisDiags = () => {
  252. getDisDiag(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  253. diags.yb = res.yb
  254. diags.bl = res.bl
  255. })
  256. }
  257. const clearDiags = () => {
  258. diags.yb = []
  259. diags.bl = []
  260. }
  261. const actived = ref(false)
  262. watchEffect(() => {
  263. if (actived.value) {
  264. if (patient.value.inpatientNo) {
  265. fecthDisDiags()
  266. } else {
  267. clearDiags()
  268. }
  269. }
  270. })
  271. onActivated(() => {
  272. actived.value = true
  273. })
  274. onDeactivated(() => {
  275. actived.value = false
  276. })
  277. const tableHeight = (store.state.app.windowSize.h - 256) / 2
  278. const showZjdzDate = ref(false)
  279. const cancelSelectZjdzDate = () => {
  280. patient.value.zjdzDatetime = null
  281. showZjdzDate.value = false
  282. }
  283. const confirmSelectZjdzDate = () => {
  284. patient.value.zjdzDatetime = formatDatetime(patient.value.zjdzDatetime)
  285. ElMessageBox.confirm('您选择的中间断账时间为【' + patient.value.zjdzDatetime + '】', '提示', {
  286. type: 'warning',
  287. confirmButtonText: '确定',
  288. cancelButtonText: '取消',
  289. }).then(() => {
  290. showZjdzDate.value = false
  291. fetchActOrders()
  292. })
  293. }
  294. const cancelSettleApply = () => {
  295. patient.value.zjdzDatetime = null
  296. settleApply.value = {}
  297. showSettleApplyForm.value = false
  298. }
  299. const confirmSettleApply = () => {
  300. if (settleApply.value.type === 2 && !settleApply.value.settleDatetime) {
  301. ElMessage({
  302. message: '中间断账的时间不能为空!',
  303. type: 'error',
  304. duration: 2500,
  305. showClose: true,
  306. })
  307. return
  308. }
  309. if (!settleApply.value.inputComment) {
  310. ElMessage({
  311. message: '申请理由不能为空!',
  312. type: 'error',
  313. duration: 2500,
  314. showClose: true,
  315. })
  316. return
  317. }
  318. settleApply.value.settleDatetime = formatDatetime(settleApply.value.settleDatetime)
  319. let message = '是否确认提交' + dismissBtnText.value + '申请?'
  320. if (settleApply.value.type === 2) {
  321. message += '您选择的中间断账时间为【' + settleApply.value.settleDatetime + '】,请仔细核对。'
  322. }
  323. ElMessageBox.confirm(message, '提示', {
  324. type: 'warning',
  325. confirmButtonText: '确定',
  326. cancelButtonText: '取消',
  327. })
  328. .then(() => {
  329. submitSettleApply(settleApply.value).then((res) => {
  330. ElMessage({
  331. message: res,
  332. type: 'success',
  333. duration: 2500,
  334. showClose: true,
  335. })
  336. showSettleApplyForm.value = false
  337. })
  338. })
  339. .catch(() => {})
  340. }
  341. const dismissBtnText = computed(() => {
  342. return patient.value.midSetl ? '中间断账' : '出院结算'
  343. })
  344. const dismissCalMsg = ref('')
  345. const actOrders = ref([])
  346. const actOrderDetail = ref([])
  347. const showActOrders = ref(false)
  348. const showSettleApplyForm = ref(false)
  349. const settleApply = ref({})
  350. const closeActOrder = () => {
  351. actOrders.value = actOrderDetail.value = []
  352. dismissCalMsg.value = ''
  353. showActOrders.value = false
  354. }
  355. const beforeSettle = (midSetl) => {
  356. if (nullPatient()) {
  357. return
  358. }
  359. patient.value.midSetl = midSetl
  360. selectSettleApply(patient.value).then((res) => {
  361. if (null === res.status) {
  362. patient.value.sid = store.getters['user/sid']
  363. patient.value.zjdzDatetime = getDatetime()
  364. dismissCalculate(patient.value)
  365. .then(() => {
  366. settleApply.value.patNo = patient.value.inpatientNo
  367. settleApply.value.times = patient.value.admissTimes
  368. settleApply.value.ledgerSn = patient.value.ledgerSn
  369. settleApply.value.type = midSetl ? 2 : 1
  370. settleApply.value.settleDatetime = res.settleDatetime
  371. settleApply.value.inputComment = midSetl ? null : '医嘱离院。'
  372. showSettleApplyForm.value = true
  373. })
  374. .catch((res2) => {
  375. if (res2.code && res2.code === 1004) {
  376. negativeFees.value = res2.data
  377. showNegativeFee.value = true
  378. dismissCalMsg.value = res2.message
  379. } else {
  380. dismissCalMsg.value = res2.toString()
  381. }
  382. })
  383. } else {
  384. switch (res.status) {
  385. case 0:
  386. ElMessageBox.alert('医保科尚未处理此患者的' + dismissBtnText.value + '申请,请耐心等候或者致电医保科(内线电话:2102)。', '提示', {
  387. type: 'warning',
  388. })
  389. break
  390. case 1:
  391. if (res.settleDatetime) {
  392. patient.value.zjdzDatetime = res.settleDatetime
  393. fetchActOrders()
  394. } else {
  395. if (midSetl) {
  396. patient.value.zjdzDatetime = getDatetime()
  397. showZjdzDate.value = true
  398. } else {
  399. fetchActOrders()
  400. }
  401. }
  402. break
  403. case 2:
  404. ElMessageBox.confirm('医保科驳回了此患者的' + dismissBtnText.value + '申请,驳回意见为【' + res.handleComment + '】', '提示', {
  405. type: 'error',
  406. distinguishCancelAndClose: true,
  407. confirmButtonText: '我知道了',
  408. cancelButtonText: '重新提交',
  409. showCancelButton: true,
  410. }).catch((action) => {
  411. if (action === 'cancel') {
  412. patient.value.sid = store.getters['user/sid']
  413. patient.value.zjdzDatetime = res.settleDatetime
  414. dismissCalculate(patient.value)
  415. .then(() => {
  416. settleApply.value.patNo = patient.value.inpatientNo
  417. settleApply.value.times = patient.value.admissTimes
  418. settleApply.value.ledgerSn = patient.value.ledgerSn
  419. settleApply.value.type = res.type
  420. settleApply.value.inputComment = null
  421. settleApply.value.settleDatetime = res.settleDatetime
  422. showSettleApplyForm.value = true
  423. })
  424. .catch((res) => {
  425. if (res.code && res.code === 1004) {
  426. negativeFees.value = res.data
  427. showNegativeFee.value = true
  428. dismissCalMsg.value = res.message
  429. } else {
  430. dismissCalMsg.value = res.toString()
  431. }
  432. })
  433. }
  434. })
  435. break
  436. }
  437. }
  438. })
  439. }
  440. const fetchActOrders = () => {
  441. getActOrders(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  442. actOrders.value = res
  443. if (res.length > 0) {
  444. actOrderDetail.value = res[0].list
  445. }
  446. showActOrders.value = true
  447. })
  448. }
  449. const switchActOrder = (row) => {
  450. actOrderDetail.value = row.list
  451. }
  452. const showNegativeFee = ref(false)
  453. const negativeFees = ref([])
  454. const doCalFee = () => {
  455. patient.value.sid = store.getters['user/sid']
  456. dismissCalculate(patient.value)
  457. .then((res) => {
  458. dismissCalMsg.value = 'done'
  459. ElMessageBox.alert('计算成功。', '提示', {
  460. type: 'success',
  461. })
  462. })
  463. .catch((res) => {
  464. if (res.code && res.code === 1004) {
  465. negativeFees.value = res.data
  466. showNegativeFee.value = true
  467. dismissCalMsg.value = res.message
  468. } else {
  469. dismissCalMsg.value = res.toString()
  470. }
  471. })
  472. }
  473. const excuteDismiss = () => {
  474. if (dismissCalMsg.value !== 'done') {
  475. const message = dismissCalMsg.value === '' ? '请先进行费用计算!' : dismissCalMsg.value
  476. ElMessage({
  477. message: message,
  478. type: 'error',
  479. duration: 2500,
  480. showClose: true,
  481. })
  482. } else {
  483. if (injuryMode.value) {
  484. injurySettlement(patient.value)
  485. .then((res) => {
  486. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  487. type: 'success',
  488. })
  489. })
  490. .then(() => {
  491. afterDismiss()
  492. })
  493. } else {
  494. const param = {
  495. patNo: patient.value.inpatientNo,
  496. times: patient.value.admissTimes,
  497. ledgerSn: patient.value.ledgerSn,
  498. }
  499. getSiPatInfo(param).then((res) => {
  500. patient.value.medType = res.medType
  501. if (res.mdtrtId) {
  502. yibaoDismiss()
  503. } else {
  504. ziFeiDismiss()
  505. }
  506. })
  507. }
  508. }
  509. }
  510. const ziFeiDismiss = () => {
  511. const param = {
  512. inpatientNo: patient.value.inpatientNo,
  513. admissTimes: patient.value.admissTimes,
  514. bedNo: patient.value.bedNo,
  515. deptCode: patient.value.admissDept,
  516. wardCode: patient.value.admissWard,
  517. midSetl: patient.value.midSetl,
  518. zjdzDatetime: patient.value.zjdzDatetime,
  519. }
  520. selfPayDismiss(param).then(() => {
  521. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  522. type: 'success',
  523. }).then(() => {
  524. afterDismiss()
  525. })
  526. })
  527. }
  528. const yibaoDismiss = () => {
  529. dischargeProcessing(patient.value).then(() => {
  530. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  531. type: 'success',
  532. }).then(() => {
  533. afterDismiss()
  534. })
  535. })
  536. }
  537. const afterDismiss = () => {
  538. if (patient.value.midSetl) {
  539. patient.value.ledgerSn += 1
  540. }
  541. showActOrders.value = false
  542. }
  543. const conventionsVisible = ref(false)
  544. const roughConventions = ref([])
  545. const conventionDetails = ref([])
  546. const selectedConventions = ref([])
  547. const showConventions = () => {
  548. if (nullPatient()) return
  549. conventionDetails.value = []
  550. getRoughConventions(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  551. roughConventions.value = res
  552. if (res.length > 0) {
  553. clickConvention(res[0])
  554. }
  555. conventionsVisible.value = true
  556. })
  557. }
  558. const clickConvention = (row) => {
  559. getDetailConventions(row.inpatientNo, row.actOrderNo).then((res) => {
  560. conventionDetails.value = res
  561. if (selectedConventions.value.indexOf(row) > -1) {
  562. conventionDetails.value.forEach((item) => (item.checked = true))
  563. }
  564. })
  565. }
  566. const handleSelectConvention = (val) => {
  567. selectedConventions.value = val
  568. }
  569. const confirmRetractConventions = () => {
  570. if (selectedConventions.value.length === 0) {
  571. ElMessage({
  572. message: '没有选中的条目。',
  573. type: 'warning',
  574. duration: 2500,
  575. showClose: true,
  576. })
  577. } else {
  578. ElMessageBox.confirm('确定撤销选中的常规项目吗?', '提示', {
  579. type: 'warning',
  580. confirmButtonText: '确定',
  581. cancelButtonText: '放弃',
  582. })
  583. .then(() => {
  584. let orders = []
  585. selectedConventions.value.forEach((item) => {
  586. orders.push(item.actOrderNo)
  587. })
  588. retractConventions(orders).then(() => {
  589. ElMessage({
  590. message: '撤销成功。',
  591. type: 'success',
  592. duration: 2500,
  593. showClose: true,
  594. })
  595. showConventions()
  596. })
  597. })
  598. .catch(() => {})
  599. }
  600. }
  601. const closeThreeConventions = () => {
  602. roughConventions.value = conventionDetails.value = []
  603. conventionsVisible.value = false
  604. }
  605. const afterReadCard = (result) => {
  606. patient.value.mdtrtCertType = result.mdtrtCertType
  607. patient.value.readCardResult = result.readCardResult
  608. patient.value.readCardBizType = result.readCardBizType
  609. }
  610. const cancelDismiss = () => {
  611. ElMessageBox.confirm('确定取消此患者的医保结算?', '提示', {
  612. confirmButtonText: '确定',
  613. cancelButtonText: '放弃',
  614. type: 'warning',
  615. })
  616. .then(() => {
  617. if (injuryMode.value) {
  618. revokeInjurySettlement(patient.value).then(() => {
  619. ElMessage({
  620. message: '取消医保结算成功。',
  621. type: 'success',
  622. duration: 2500,
  623. showClose: true,
  624. })
  625. })
  626. } else {
  627. revokeSettlement(patient.value).then(() => {
  628. ElMessage({
  629. message: '取消医保结算成功。',
  630. type: 'success',
  631. duration: 2500,
  632. showClose: true,
  633. })
  634. })
  635. }
  636. })
  637. .catch(() => {})
  638. }
  639. const showDismissOrderDate = ref(false)
  640. const cancelSelectDismissOrderDate = () => {
  641. patient.value.dismissOrderDate = new Date()
  642. showDismissOrderDate.value = false
  643. }
  644. const confirmSelectDismissOrderDate = () => {
  645. ElMessageBox.confirm('您选择的出院医嘱时间为:' + formatDatetime(patient.value.dismissOrderDate) + ',是否确认?', '提示', {
  646. type: 'warning',
  647. confirmButtonText: '确定',
  648. cancelButtonText: '取消',
  649. })
  650. .then(() => {
  651. patient.value.dismissOrderDate = formatDatetime(patient.value.dismissOrderDate)
  652. genDismissActOrder(patient.value)
  653. .then((res) => {
  654. ElMessageBox.alert('生成出院医嘱成功!医嘱号为:' + res, '提示', {
  655. type: 'success',
  656. confirmButtonText: '确定',
  657. })
  658. })
  659. .then(() => {
  660. showDismissOrderDate.value = false
  661. fecthDisDiags()
  662. })
  663. })
  664. .catch(() => {})
  665. }
  666. const makeDismissOrder = () => {
  667. if (nullPatient()) return
  668. patient.value.dismissOrderDate = new Date()
  669. showDismissOrderDate.value = true
  670. }
  671. const isKqk = computed(() => {
  672. return store.state.user.info.deptCode === '8000201' || store.state.user.info.deptCode === '1090000'
  673. })
  674. const rcvrcalcost = () => {
  675. if (nullPatient()) return
  676. receiveAndRecalculateCost(patient.value).then((res) => {
  677. ElMessage({
  678. type: 'success',
  679. message: res,
  680. duration: 2000,
  681. showClose: true,
  682. })
  683. })
  684. }
  685. onMounted(() => {
  686. if (patient.value.inpatientNo) {
  687. fecthDisDiags()
  688. }
  689. })
  690. return {
  691. isAdmin,
  692. patient,
  693. actOrderHeight,
  694. getBalance,
  695. cptSex,
  696. cptOperation,
  697. diags,
  698. tableHeight,
  699. cptDisDiagStatus,
  700. settleApply,
  701. showSettleApplyForm,
  702. showZjdzDate,
  703. cancelSelectZjdzDate,
  704. confirmSelectZjdzDate,
  705. cancelSettleApply,
  706. confirmSettleApply,
  707. dismissBtnText,
  708. beforeSettle,
  709. dismissCalMsg,
  710. actOrders,
  711. actOrderDetail,
  712. showActOrders,
  713. switchActOrder,
  714. closeActOrder,
  715. showNegativeFee,
  716. negativeFees,
  717. getOrderStatus,
  718. getOrderDetailStatus,
  719. getCxFlag,
  720. doCalFee,
  721. excuteDismiss,
  722. conventionsVisible,
  723. showConventions,
  724. roughConventions,
  725. conventionDetails,
  726. selectedConventions,
  727. clickConvention,
  728. handleSelectConvention,
  729. confirmRetractConventions,
  730. closeThreeConventions,
  731. afterReadCard,
  732. cancelDismiss,
  733. showDismissOrderDate,
  734. cancelSelectDismissOrderDate,
  735. confirmSelectDismissOrderDate,
  736. makeDismissOrder,
  737. isKqk,
  738. rcvrcalcost,
  739. }
  740. },
  741. }
  742. function getBalance(val) {
  743. return val > 0 ? '<span style="color: green">' + val + '</span>' : val
  744. }
  745. function initDiags() {
  746. const diags = reactive({
  747. yb: [],
  748. bl: [],
  749. })
  750. return diags
  751. }
  752. function getOrderStatus(val) {
  753. switch (val.chargeStatus) {
  754. case 5: // 未确认药
  755. return '<p style="background: dodgerblue; color: white;">' + val.actOrderNo + '</p>'
  756. case 6: // 未接收
  757. return '<p style="background: orange; color: white;">' + val.actOrderNo + '</p>'
  758. case 8: // 医技未确认
  759. return '<p style="background: orangered; color: white;">' + val.actOrderNo + '</p>'
  760. default:
  761. return '<p>' + val.actOrderNo + '</p>'
  762. }
  763. }
  764. function getOrderDetailStatus(val) {
  765. switch (val.chargeStatus) {
  766. case 5: // 未确认药
  767. return '<p style="background: dodgerblue; color: white;">' + val.chargeDate + '</p>'
  768. case 6: // 未接收
  769. return '<p style="background: orange; color: white;">' + val.chargeDate + '</p>'
  770. case 8: // 医技未确认
  771. return '<p style="background: orangered; color: white;">' + val.chargeDate + '</p>'
  772. default:
  773. return '<p>' + val.chargeDate + '</p>'
  774. }
  775. }
  776. function getCxFlag(val) {
  777. return val === '1' ? '<p style="color: orangered;">是</p>' : '<p style="color:green">否</p>'
  778. }
  779. </script>
  780. <style scoped>
  781. .m-divider {
  782. height: 1px;
  783. background-color: white;
  784. width: 100%;
  785. margin: 5px 0;
  786. }
  787. .color-span {
  788. display: inline-block;
  789. width: 30px;
  790. height: 10px;
  791. margin-left: 15px;
  792. }
  793. </style>