DiscSettlement.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  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="fetchActOrders(false)">出院结算</el-button>
  7. <el-button type="info" icon="el-icon-video-pause" @click="selectZjdzTime">中间断账</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. {{ patient.responceTypeName }}
  37. </el-descriptions-item>
  38. <el-descriptions-item>
  39. <template #label> 医保类别 </template>
  40. {{ patient.ybTypeName }}
  41. </el-descriptions-item>
  42. <el-descriptions-item>
  43. <template #label> 待遇类别 </template>
  44. {{ patient.treatTypeName }}
  45. </el-descriptions-item>
  46. <el-descriptions-item>
  47. <template #label> 入院日期 </template>
  48. {{ patient.admissDate }}
  49. </el-descriptions-item>
  50. <el-descriptions-item>
  51. <template #label> 总费用 </template>
  52. <span v-show="patient.inpatientNo">{{ patient.totalCharge }}</span>
  53. </el-descriptions-item>
  54. <el-descriptions-item>
  55. <template #label> 余额 </template>
  56. <span v-html="getBalance(patient.balance)"></span>
  57. </el-descriptions-item>
  58. <el-descriptions-item>
  59. <template #label> 手术 </template>
  60. <span v-show="patient.inpatientNo">{{ cptOperation(patient.operation) }}</span>
  61. </el-descriptions-item>
  62. </el-descriptions>
  63. <div class="m-divider"></div>
  64. <div>
  65. <el-tag type="info">医保出院诊断</el-tag>
  66. <el-table :data="diags.yb" stripe :height="tableHeight">
  67. <el-table-column prop="disDiagNo" label="序号"></el-table-column>
  68. <el-table-column prop="disDiag" label="诊断编码"></el-table-column>
  69. <el-table-column prop="disDiagComment" label="诊断内容"></el-table-column>
  70. <el-table-column prop="disDiagStatus" label="出院转归"></el-table-column>
  71. <el-table-column prop="opName" label="录入人"></el-table-column>
  72. </el-table>
  73. <div style="height: 10px"></div>
  74. <el-tag type="info">病案首页诊断</el-tag>
  75. <el-table :data="diags.bl" stripe :height="tableHeight">
  76. <el-table-column prop="disDiagNo" label="序号"></el-table-column>
  77. <el-table-column prop="disDiag" label="诊断编码"></el-table-column>
  78. <el-table-column prop="disDiagComment" label="诊断内容"></el-table-column>
  79. <el-table-column prop="disDiagStatusName" label="出院转归"></el-table-column>
  80. <el-table-column prop="opName" label="录入人"></el-table-column>
  81. </el-table>
  82. </div>
  83. <el-dialog title="请选择中间断账的日期和时间" v-model="showZjdzDate" width="500px">
  84. <div style="height: 20px"></div>
  85. <el-date-picker v-model="patient.zjdzDatetime" type="datetime" placeholder="选择日期时间"></el-date-picker>
  86. <div style="height: 30px"></div>
  87. <div style="width: 450px; text-align: right">
  88. <el-button type="info" icon="el-icon-close" @click="cancelSelectZjdzDate">取消</el-button>
  89. <el-button type="success" icon="el-icon-check" @click="confirmSelectZjdzDate">确定</el-button>
  90. </div>
  91. </el-dialog>
  92. <el-dialog :title="dismissBtnText" v-model="showActOrders" fullscreen @close="closeActOrder">
  93. <el-table :data="actOrders" @row-click="switchActOrder" :height="actOrderHeight">
  94. <el-table-column label="医嘱号" fixed>
  95. <template #default="scope">
  96. <span v-html="getOrderStatus(scope.row)"></span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column property="list[0].orderName" label="医嘱名称" fixed></el-table-column>
  100. <el-table-column property="list[0].frequCode" label="频率"></el-table-column>
  101. <el-table-column property="cxFlag" label="撤销">
  102. <template #default="scope">
  103. <span v-html="getCxFlag(scope.row.cxFlag)"></span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column property="list[0].drugSpecification" label="规格"></el-table-column>
  107. <el-table-column property="list[0].startTime" label="开始时间"></el-table-column>
  108. <el-table-column property="list[0].endTime" label="结束时间"></el-table-column>
  109. <el-table-column property="list[0].chargeAmount" label="一次领量"></el-table-column>
  110. <el-table-column property="list[0].supplyCode" label="给药方式"></el-table-column>
  111. <el-table-column property="list[0].physician" label="医生"></el-table-column>
  112. <el-table-column property="list[0].enterOper" label="录入人"></el-table-column>
  113. <el-table-column property="list[0].orderCode" label="医嘱码"></el-table-column>
  114. <el-table-column property="list[0].wardCode" label="病房"></el-table-column>
  115. </el-table>
  116. <div style="height: 1px; background: lightgray; margin: 15px 0"></div>
  117. <el-table :data="actOrderDetail" :height="actOrderHeight">
  118. <el-table-column label="日期" fixed>
  119. <template #default="scope">
  120. <span v-html="getOrderDetailStatus(scope.row)"></span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column property="chargeCode" label="收费码"></el-table-column>
  124. <el-table-column property="chargeName" label="项目名称"></el-table-column>
  125. <el-table-column property="drugSpecification" label="规格"></el-table-column>
  126. <el-table-column property="chargeStatus" label="状态">
  127. <template #default="scope">
  128. {{ scope.row.chargeStatus }}
  129. </template>
  130. </el-table-column>
  131. <el-table-column property="chargeAmount" label="数量"></el-table-column>
  132. <el-table-column property="chargeFee" label="金额"></el-table-column>
  133. <el-table-column property="pageNo" label="药品单号"></el-table-column>
  134. <el-table-column property="execUnit" label="执行科室"></el-table-column>
  135. <el-table-column property="wardName" label="病区"></el-table-column>
  136. </el-table>
  137. <div style="height: 5px"></div>
  138. <el-tag style="float: left; margin-top: 5px" v-cloak>
  139. <span style="background: orangered" class="color-span"></span>&nbsp;医技未确认 <span style="background: dodgerblue" class="color-span"></span>&nbsp;未确认药
  140. <span style="background: orange" class="color-span"></span>&nbsp;未接收
  141. </el-tag>
  142. <div style="float: right; margin-top: 5px" v-cloak>
  143. <el-dropdown trigger="click" style="margin-right: 10px" @command="beforeReadCard">
  144. <el-button type="info"> 读卡<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
  145. <template #dropdown>
  146. <el-dropdown-menu>
  147. <el-dropdown-item icon="el-icon-bank-card" command="normal">普通IC卡</el-dropdown-item>
  148. <el-dropdown-item icon="el-icon-s-grid" command="qrcode">二维码</el-dropdown-item>
  149. <el-dropdown-item disabled icon="el-icon-user" command="face">刷脸</el-dropdown-item>
  150. </el-dropdown-menu>
  151. </template>
  152. </el-dropdown>
  153. <el-button type="primary" icon="el-icon-data-analysis" @click="doCalFee">费用计算</el-button>
  154. <el-button type="success" icon="el-icon-time" @click="excuteDismiss">{{ dismissBtnText }}</el-button>
  155. <el-button type="warning" icon="el-icon-close" @click="closeActOrder">关闭</el-button>
  156. </div>
  157. </el-dialog>
  158. <el-dialog title="此患者费用清单存在负数" v-model="showNegativeFee" width="800px">
  159. <div style="display: inline-block">
  160. <el-table :data="negativeFees.slice(0, negativeFees.length / 2 + 1)" empty-text=" " height="300">
  161. <el-table-column property="code" label="费用" width="80"></el-table-column>
  162. <el-table-column property="chargeCode" label="编码" width="80"></el-table-column>
  163. <el-table-column property="name" label="名称" width="180"></el-table-column>
  164. </el-table>
  165. </div>
  166. <div style="display: inline-block; margin-left: 8px">
  167. <el-table :data="negativeFees.slice(negativeFees.length / 2 + 1, negativeFees.length)" empty-text=" " height="300">
  168. <el-table-column property="code" label="费用" width="80"></el-table-column>
  169. <el-table-column property="chargeCode" label="编码" width="80"></el-table-column>
  170. <el-table-column property="name" label="名称" width="180"></el-table-column>
  171. </el-table>
  172. </div>
  173. </el-dialog>
  174. <el-dialog title="撤销检验项目" v-model="conventionsVisible" fullscreen @close="closeThreeConventions">
  175. <el-table :data="roughConventions" @row-click="clickConvention" highlight-current-row :height="actOrderHeight" @selection-change="handleSelectConvention">
  176. <el-table-column type="selection"></el-table-column>
  177. <el-table-column property="inpatientNo" label="住院号"></el-table-column>
  178. <el-table-column property="name" label="姓名"></el-table-column>
  179. <el-table-column property="bedNo" label="床号"></el-table-column>
  180. <el-table-column property="actOrderNo" label="医嘱号"></el-table-column>
  181. <el-table-column property="occTime" label="医嘱日期"></el-table-column>
  182. <el-table-column property="doctorName" label="医生"></el-table-column>
  183. <el-table-column property="orderName" label="医嘱名称"></el-table-column>
  184. </el-table>
  185. <div style="height: 1px; background: lightgray; margin: 15px 0"></div>
  186. <el-table :data="conventionDetails" :height="actOrderHeight">
  187. <el-table-column label="选择" width="70">
  188. <template #default="scope">
  189. <input type="checkbox" disabled :checked="scope.row.checked" />
  190. </template>
  191. </el-table-column>
  192. <el-table-column property="name" label="姓名"></el-table-column>
  193. <el-table-column property="actOrderNo" label="医嘱号"></el-table-column>
  194. <el-table-column property="orderName" label="医嘱名称"></el-table-column>
  195. <el-table-column property="doctorName" label="医生"></el-table-column>
  196. <el-table-column property="occTime" label="医嘱日期"></el-table-column>
  197. <el-table-column property="xmName" label="项目名称"></el-table-column>
  198. <el-table-column property="price" label="单价"></el-table-column>
  199. <el-table-column property="amount" label="数量"></el-table-column>
  200. <el-table-column property="fee" label="金额"></el-table-column>
  201. </el-table>
  202. <el-tag style="float: right; margin-top: 5px" v-cloak>
  203. <el-button type="success" @click="confirmRetractConventions">撤销检验项目</el-button>
  204. <el-button type="warning" @click="closeThreeConventions">关闭</el-button>
  205. </el-tag>
  206. </el-dialog>
  207. <el-dialog title="请选择出院医嘱的日期和时间" v-model="showDismissOrderDate" width="500px">
  208. <el-date-picker v-model="patient.dismissOrderDate" type="datetime" placeholder="选择日期时间"> </el-date-picker>
  209. <div style="height: 30px"></div>
  210. <div style="width: 450px; text-align: right">
  211. <el-button type="info" icon="el-icon-close" @click="cancelSelectDismissOrderDate">取消</el-button>
  212. <el-button type="success" icon="el-icon-check" @click="confirmSelectDismissOrderDate">确定</el-button>
  213. </div>
  214. </el-dialog>
  215. </el-main>
  216. </el-container>
  217. </template>
  218. <script>
  219. import { computed, onActivated, onDeactivated, onMounted, reactive, ref, watchEffect } from 'vue'
  220. import store from '@/store'
  221. import { cptSex, cptOperation, cptDisDiagStatus } from '@/utils/computed'
  222. import { genDismissActOrder, getDisDiag, receiveAndRecalculateCost } from '@/api/yibao/patient'
  223. import { dismissCalculate, getActOrders, selfPayDismiss } from '@/api/yibao/dismiss'
  224. import { getDatetime, formatDatetime } from '@/utils/date'
  225. import { nullPatient } from '@/utils/validate'
  226. import { ElMessage, ElMessageBox } from 'element-plus'
  227. import { dischargeProcessing, revokeSettlement } from '@/api/medical-insurance/si-inpatient'
  228. import { getSiPatInfo } from '@/api/medical-insurance/si-query'
  229. import { getDetailConventions, getRoughConventions, retractConventions } from '@/api/yibao/conventions'
  230. import { prepareReadCard } from '@/utils/readcard'
  231. import { getGreatestRole } from '@/utils/permission'
  232. import { injurySettlement, revokeInjurySettlement } from '@/api/medical-insurance/si-injury'
  233. import { baseinfo } from '@/data/inpatient'
  234. export default {
  235. setup() {
  236. const isAdmin = getGreatestRole() < 10
  237. const actOrderHeight = (store.state.app.windowSize.h - 160) / 2
  238. const patient = computed(() => {
  239. return baseinfo()
  240. })
  241. const injuryMode = computed(() => {
  242. return store.state.ptnt.injuryMode
  243. })
  244. const diags = initDiags()
  245. const fecthDisDiags = () => {
  246. getDisDiag(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  247. diags.yb = res.yb
  248. diags.bl = res.bl
  249. })
  250. }
  251. const clearDiags = () => {
  252. diags.yb = []
  253. diags.bl = []
  254. }
  255. const actived = ref(false)
  256. watchEffect(() => {
  257. if (actived.value) {
  258. if (patient.value.inpatientNo) {
  259. fecthDisDiags()
  260. } else {
  261. clearDiags()
  262. }
  263. }
  264. })
  265. onActivated(() => {
  266. actived.value = true
  267. })
  268. onDeactivated(() => {
  269. actived.value = false
  270. })
  271. const tableHeight = (store.state.app.windowSize.h - 256) / 2
  272. const showZjdzDate = ref(false)
  273. const selectZjdzTime = () => {
  274. if (nullPatient()) return
  275. patient.value.zjdzDatetime = getDatetime()
  276. showZjdzDate.value = true
  277. }
  278. const cancelSelectZjdzDate = () => {
  279. patient.value.zjdzDatetime = getDatetime()
  280. showZjdzDate.value = false
  281. }
  282. const confirmSelectZjdzDate = () => {
  283. patient.value.zjdzDatetime = formatDatetime(patient.value.zjdzDatetime)
  284. ElMessageBox.confirm('您选择的中间断账时间为【' + patient.value.zjdzDatetime + '】,是否确认?', '提示', {
  285. type: 'warning',
  286. confirmButtonText: '确定',
  287. cancelButtonText: '取消',
  288. })
  289. .then(() => {
  290. showZjdzDate.value = false
  291. fetchActOrders(true)
  292. })
  293. .catch(() => {})
  294. }
  295. const dismissBtnText = computed(() => {
  296. return patient.value.midSetl ? '中间断账' : '出院结算'
  297. })
  298. const dismissCalMsg = ref('')
  299. const actOrders = ref([])
  300. const actOrderDetail = ref([])
  301. const showActOrders = ref(false)
  302. const closeActOrder = () => {
  303. actOrders.value = actOrderDetail.value = []
  304. dismissCalMsg.value = ''
  305. showActOrders.value = false
  306. }
  307. const fetchActOrders = (midSetl) => {
  308. if (nullPatient()) return
  309. patient.value.midSetl = midSetl
  310. getActOrders(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  311. actOrders.value = res
  312. if (res.length > 0) {
  313. actOrderDetail.value = res[0].list
  314. }
  315. showActOrders.value = true
  316. })
  317. }
  318. const switchActOrder = (row) => {
  319. actOrderDetail.value = row.list
  320. }
  321. const showNegativeFee = ref(false)
  322. const negativeFees = ref([])
  323. const doCalFee = () => {
  324. patient.value.sid = store.getters['user/sid']
  325. dismissCalculate(patient.value)
  326. .then((res) => {
  327. dismissCalMsg.value = 'done'
  328. ElMessageBox.alert('计算成功。', '提示', {
  329. type: 'success',
  330. })
  331. })
  332. .catch((res) => {
  333. if (res.code && res.code === 1004) {
  334. negativeFees.value = res.data
  335. showNegativeFee.value = true
  336. dismissCalMsg.value = res.message
  337. } else {
  338. dismissCalMsg.value = res.toString()
  339. }
  340. })
  341. }
  342. const excuteDismiss = () => {
  343. if (dismissCalMsg.value !== 'done') {
  344. const message = dismissCalMsg.value === '' ? '请先进行费用计算!' : dismissCalMsg.value
  345. ElMessage({
  346. message: message,
  347. type: 'error',
  348. duration: 2500,
  349. showClose: true,
  350. })
  351. } else {
  352. if (injuryMode.value) {
  353. injurySettlement(patient.value).then((res) => {
  354. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  355. type: 'success',
  356. })
  357. })
  358. } else {
  359. const param = {
  360. patNo: patient.value.inpatientNo,
  361. times: patient.value.admissTimes,
  362. ledgerSn: patient.value.ledgerSn,
  363. }
  364. getSiPatInfo(param).then((res) => {
  365. patient.value.medType = res.medType
  366. if (res.mdtrtId) {
  367. yibaoDismiss()
  368. } else {
  369. ziFeiDismiss()
  370. }
  371. })
  372. }
  373. }
  374. }
  375. const ziFeiDismiss = () => {
  376. const param = {
  377. inpatientNo: patient.value.inpatientNo,
  378. admissTimes: patient.value.admissTimes,
  379. bedNo: patient.value.bedNo,
  380. deptCode: patient.value.admissDept,
  381. wardCode: patient.value.admissWard,
  382. midSetl: patient.value.midSetl,
  383. zjdzDatetime: patient.value.zjdzDatetime,
  384. }
  385. selfPayDismiss(param).then(() => {
  386. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  387. type: 'success',
  388. })
  389. })
  390. }
  391. const yibaoDismiss = () => {
  392. dischargeProcessing(patient.value).then(() => {
  393. ElMessageBox.alert(dismissBtnText.value + '成功。', '提示', {
  394. type: 'success',
  395. })
  396. })
  397. }
  398. const conventionsVisible = ref(false)
  399. const roughConventions = ref([])
  400. const conventionDetails = ref([])
  401. const selectedConventions = ref([])
  402. const showConventions = () => {
  403. if (nullPatient()) return
  404. conventionDetails.value = []
  405. getRoughConventions(patient.value.inpatientNo, patient.value.admissTimes).then((res) => {
  406. roughConventions.value = res
  407. if (res.length > 0) {
  408. clickConvention(res[0])
  409. }
  410. conventionsVisible.value = true
  411. })
  412. }
  413. const clickConvention = (row) => {
  414. getDetailConventions(row.inpatientNo, row.actOrderNo).then((res) => {
  415. conventionDetails.value = res
  416. if (selectedConventions.value.indexOf(row) > -1) {
  417. conventionDetails.value.forEach((item) => (item.checked = true))
  418. }
  419. })
  420. }
  421. const handleSelectConvention = (val) => {
  422. selectedConventions.value = val
  423. }
  424. const confirmRetractConventions = () => {
  425. if (selectedConventions.value.length === 0) {
  426. ElMessage({
  427. message: '没有选中的条目。',
  428. type: 'warning',
  429. duration: 2500,
  430. showClose: true,
  431. })
  432. } else {
  433. ElMessageBox.confirm('确定撤销选中的常规项目吗?', '提示', {
  434. type: 'warning',
  435. confirmButtonText: '确定',
  436. cancelButtonText: '放弃',
  437. })
  438. .then(() => {
  439. let orders = []
  440. selectedConventions.value.forEach((item) => {
  441. orders.push(item.actOrderNo)
  442. })
  443. retractConventions(orders).then(() => {
  444. ElMessage({
  445. message: '撤销成功。',
  446. type: 'success',
  447. duration: 2500,
  448. showClose: true,
  449. })
  450. showConventions()
  451. })
  452. })
  453. .catch(() => {})
  454. }
  455. }
  456. const closeThreeConventions = () => {
  457. roughConventions.value = conventionDetails.value = []
  458. conventionsVisible.value = false
  459. }
  460. const beforeReadCard = (val) => {
  461. if (nullPatient()) return
  462. prepareReadCard(val, patient.value.responceType, patient.value.inpatientNo)
  463. }
  464. const cancelDismiss = () => {
  465. ElMessageBox.confirm('确定取消此患者的医保结算?', '提示', {
  466. confirmButtonText: '确定',
  467. cancelButtonText: '放弃',
  468. type: 'warning',
  469. })
  470. .then(() => {
  471. if (injuryMode.value) {
  472. revokeInjurySettlement(patient.value).then(() => {
  473. ElMessage({
  474. message: '取消医保结算成功。',
  475. type: 'success',
  476. duration: 2500,
  477. showClose: true,
  478. })
  479. })
  480. } else {
  481. revokeSettlement(patient.value).then(() => {
  482. ElMessage({
  483. message: '取消医保结算成功。',
  484. type: 'success',
  485. duration: 2500,
  486. showClose: true,
  487. })
  488. })
  489. }
  490. })
  491. .catch(() => {})
  492. }
  493. const showDismissOrderDate = ref(false)
  494. const cancelSelectDismissOrderDate = () => {
  495. patient.value.dismissOrderDate = new Date()
  496. showDismissOrderDate.value = false
  497. }
  498. const confirmSelectDismissOrderDate = () => {
  499. ElMessageBox.confirm('您选择的出院医嘱时间为:' + formatDatetime(patient.value.dismissOrderDate) + ',是否确认?', '提示', {
  500. type: 'warning',
  501. confirmButtonText: '确定',
  502. cancelButtonText: '取消',
  503. })
  504. .then(() => {
  505. patient.value.dismissOrderDate = formatDatetime(patient.value.dismissOrderDate)
  506. genDismissActOrder(patient.value)
  507. .then((res) => {
  508. showZjdzDate.value = false
  509. ElMessageBox.alert('生成出院医嘱成功!医嘱号为:' + res, '提示', {
  510. type: 'success',
  511. confirmButtonText: '确定',
  512. })
  513. })
  514. .then(() => {
  515. showDismissOrderDate.value = false
  516. fecthDisDiags()
  517. })
  518. })
  519. .catch(() => {})
  520. }
  521. const makeDismissOrder = () => {
  522. if (nullPatient()) return
  523. patient.value.dismissOrderDate = new Date()
  524. showDismissOrderDate.value = true
  525. }
  526. const isKqk = computed(() => {
  527. return store.state.user.info.deptCode === '8000201' || store.state.user.info.deptCode === '1090000'
  528. })
  529. const rcvrcalcost = () => {
  530. if (nullPatient()) return
  531. receiveAndRecalculateCost(patient.value).then((res) => {
  532. ElMessage({
  533. type: 'success',
  534. message: res,
  535. duration: 2000,
  536. showClose: true,
  537. })
  538. })
  539. }
  540. onMounted(() => {
  541. if (patient.value.inpatientNo) {
  542. fecthDisDiags()
  543. }
  544. })
  545. return {
  546. isAdmin,
  547. patient,
  548. actOrderHeight,
  549. getBalance,
  550. cptSex,
  551. cptOperation,
  552. diags,
  553. tableHeight,
  554. cptDisDiagStatus,
  555. selectZjdzTime,
  556. showZjdzDate,
  557. cancelSelectZjdzDate,
  558. confirmSelectZjdzDate,
  559. dismissBtnText,
  560. fetchActOrders,
  561. dismissCalMsg,
  562. actOrders,
  563. actOrderDetail,
  564. showActOrders,
  565. switchActOrder,
  566. closeActOrder,
  567. showNegativeFee,
  568. negativeFees,
  569. getOrderStatus,
  570. getOrderDetailStatus,
  571. getCxFlag,
  572. doCalFee,
  573. excuteDismiss,
  574. conventionsVisible,
  575. showConventions,
  576. roughConventions,
  577. conventionDetails,
  578. selectedConventions,
  579. clickConvention,
  580. handleSelectConvention,
  581. confirmRetractConventions,
  582. closeThreeConventions,
  583. beforeReadCard,
  584. cancelDismiss,
  585. showDismissOrderDate,
  586. cancelSelectDismissOrderDate,
  587. confirmSelectDismissOrderDate,
  588. makeDismissOrder,
  589. isKqk,
  590. rcvrcalcost,
  591. }
  592. },
  593. }
  594. function getBalance(val) {
  595. return val > 0 ? '<span style="color: green">' + val + '</span>' : val
  596. }
  597. function initDiags() {
  598. const diags = reactive({
  599. yb: [],
  600. bl: [],
  601. })
  602. return diags
  603. }
  604. function getOrderStatus(val) {
  605. switch (val.chargeStatus) {
  606. case 5: // 未确认药
  607. return '<p style="background: dodgerblue; color: white;">' + val.actOrderNo + '</p>'
  608. case 6: // 未接收
  609. return '<p style="background: orange; color: white;">' + val.actOrderNo + '</p>'
  610. case 8: // 医技未确认
  611. return '<p style="background: orangered; color: white;">' + val.actOrderNo + '</p>'
  612. default:
  613. return '<p>' + val.actOrderNo + '</p>'
  614. }
  615. }
  616. function getOrderDetailStatus(val) {
  617. switch (val.chargeStatus) {
  618. case 5: // 未确认药
  619. return '<p style="background: dodgerblue; color: white;">' + val.chargeDate + '</p>'
  620. case 6: // 未接收
  621. return '<p style="background: orange; color: white;">' + val.chargeDate + '</p>'
  622. case 8: // 医技未确认
  623. return '<p style="background: orangered; color: white;">' + val.chargeDate + '</p>'
  624. default:
  625. return '<p>' + val.chargeDate + '</p>'
  626. }
  627. }
  628. function getCxFlag(val) {
  629. return val === '1' ? '<p style="color: orangered;">是</p>' : '<p style="color:green">否</p>'
  630. }
  631. </script>
  632. <style scoped>
  633. .m-divider {
  634. height: 1px;
  635. background-color: white;
  636. width: 100%;
  637. margin: 5px 0;
  638. }
  639. .color-span {
  640. display: inline-block;
  641. width: 30px;
  642. height: 10px;
  643. margin-left: 15px;
  644. }
  645. </style>