MzRegister.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <el-container>
  3. <el-header style="height: 35px; margin-top: 10px">
  4. <el-input v-model="patientId" style="width: 200px; margin-left: 2px" clearable placeholder="请输入">
  5. <template #prepend>门诊id</template>
  6. </el-input>
  7. <el-select v-model="medType" style="width: 120px">
  8. <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
  9. </el-select>
  10. <el-dropdown trigger="click" @command="registor" style="margin-left: 8px">
  11. <el-button type="primary">登记<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
  12. <template #dropdown>
  13. <el-dropdown-menu>
  14. <el-dropdown-item icon="el-icon-bank-card" command="execute">医保登记</el-dropdown-item>
  15. <el-dropdown-item icon="el-icon-refresh-left" command="revoke">取消登记</el-dropdown-item>
  16. </el-dropdown-menu>
  17. </template>
  18. </el-dropdown>
  19. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  20. <el-button type="primary">处方<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
  21. <template #dropdown>
  22. <el-dropdown-menu>
  23. <el-dropdown-item icon="el-icon-document" command="require">获取门诊处方</el-dropdown-item>
  24. <el-dropdown-item icon="el-icon-delete" command="delete">删除所有处方</el-dropdown-item>
  25. <el-dropdown-item icon="el-icon-upload" command="upload">医保处方上传</el-dropdown-item>
  26. <el-dropdown-item icon="el-icon-refresh-left" command="retract">撤销处方上传</el-dropdown-item>
  27. </el-dropdown-menu>
  28. </template>
  29. </el-dropdown>
  30. <el-button type="primary" icon="el-icon-edit-outline" @click="mzPreSetl" style="margin-left: 8px"> 试算 </el-button>
  31. <el-button type="danger" icon="el-icon-refresh" @click="clearinfo" style="margin-left: 8px"> 重置 </el-button>
  32. </el-header>
  33. <el-main>
  34. <el-row :gutter="5">
  35. <el-col :span="2">
  36. <el-table ref="timesTable" :data="data" highlight-current-row :height="tableHeight" @row-click="clickTimes">
  37. <el-table-column label="就诊次数">
  38. <template #default="scope"> 第 {{ scope.row.times }} 次 </template>
  39. </el-table-column>
  40. </el-table>
  41. </el-col>
  42. <el-col :span="7">
  43. <el-table ref="ordersTable" :data="orderNos" highlight-current-row :height="tableHeight" @row-click="clickOrderNo">
  44. <el-table-column label="处方" width="60">
  45. <template #default="scope"> 第{{ scope.row.orderNo }}张 </template>
  46. </el-table-column>
  47. <el-table-column label="金额(¥)" width="80">
  48. <template #default="scope">
  49. {{ scope.row.totalFee.toFixed(2) }}
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="状态" width="80">
  53. <template #default="scope">
  54. <span v-html="colorStatus(scope.row.status)"></span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="操作">
  58. <template #default="scope">
  59. <el-button type="text" icon="el-icon-check" @click="markMzFees" :disabled="scope.row.status"> 生成 </el-button>
  60. <el-button type="text" icon="el-icon-delete" @click="unmarkMzFees(scope.row)" :disabled="!scope.row.status"> 撤销 </el-button>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. </el-col>
  65. <el-col :span="15">
  66. <div style="margin-left: 30px">
  67. <div class="receipt-title">湖南泰和医院处方笺</div>
  68. <el-divider></el-divider>
  69. <div class="receipt-head">
  70. <div>姓名:{{ mzPatient.name }}</div>
  71. <div>性别:{{ mzPatient.sex }}</div>
  72. <div>年龄:{{ mzPatient.age }} 岁</div>
  73. </div>
  74. <div class="receipt-head">
  75. <div>门诊号:{{ mzVisit.patientId }}</div>
  76. <div>科别:{{ mzVisit.visitDeptName }}</div>
  77. <div class="ellipsis-text">
  78. 临床诊断:<span :title="mzVisit.icdText">{{ mzVisit.icdText }}</span>
  79. </div>
  80. </div>
  81. <div class="receipt-head">
  82. <div>开具日期:{{ mzVisit.opDay }}</div>
  83. <div class="ellipsis-text">
  84. 地址:<span :title="mzPatient.address">{{ mzPatient.address }}</span>
  85. </div>
  86. <div>电话:{{ mzPatient.phoneNo }}</div>
  87. </div>
  88. <el-divider></el-divider>
  89. <div :style="receiptBoxStyle">
  90. <div v-for="(item, index) in currentReceipts" :key="index">
  91. <div class="receipt-item">
  92. <div class="w75">
  93. <el-checkbox v-model="item.checked">
  94. {{ index + 1 }}){{ item.drugName }}&nbsp; (
  95. <span v-if="item.specification">{{ item.specification }}</span>
  96. <span v-else>{{ item.drugUnit }}</span>
  97. </el-checkbox>
  98. </div>
  99. <div class="w25">&times;&nbsp;&nbsp;&nbsp;{{ item.quantity }}</div>
  100. </div>
  101. <div class="receipt-tips">
  102. <span v-if="item.drugQuan"> 用法:{{ item.drugQuan }}{{ item.drugUnit }}/次 </span>
  103. <span v-if="item.frequency"> {{ item.frequency }} </span>
  104. <span v-if="item.orderDays"> {{ item.orderDays }}天 </span>
  105. <span v-if="item.supplyCode"> {{ item.supplyCode }} </span>
  106. <span v-if="item.instructionText"> 备注:{{ item.instructionText }} </span>
  107. </div>
  108. </div>
  109. </div>
  110. <el-divider></el-divider>
  111. <div class="receipt-head">
  112. <div style="font-size: 15px">医师:{{ mzVisit.doctorName }} / {{ mzVisit.doctorCode }}</div>
  113. <div style="font-size: 15px">
  114. 总金额:<span style="font-size: 18px; font-weight: bold">¥{{ totalFee }}</span>
  115. </div>
  116. </div>
  117. </div>
  118. </el-col>
  119. </el-row>
  120. </el-main>
  121. <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
  122. <el-tag>参保信息</el-tag>
  123. <el-table :data="psnBaseinfo.insuinfo" @row-click="handleClickInsuinfo">
  124. <el-table-column property="balc" label="余额"></el-table-column>
  125. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  126. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  127. <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
  128. <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
  129. <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
  130. <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
  131. <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
  132. <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
  133. <el-table-column property="empName" label="单位名称"></el-table-column>
  134. </el-table>
  135. <div style="height: 16px"></div>
  136. <el-tag>身份信息</el-tag>
  137. <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
  138. <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
  139. <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
  140. <el-table-column label="备注" prop="memo"></el-table-column>
  141. <el-table-column label="开始时间" prop="begntime"></el-table-column>
  142. <el-table-column label="结束时间" prop="endtime"></el-table-column>
  143. </el-table>
  144. </el-dialog>
  145. <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
  146. <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
  147. <el-table-column property="opspDiseCode" label="病种编码"></el-table-column>
  148. <el-table-column property="opspDiseName" label="病种名称"></el-table-column>
  149. <el-table-column property="begndate" label="生效日期"></el-table-column>
  150. <el-table-column property="enddate" label="失效日期"></el-table-column>
  151. </el-table>
  152. </el-dialog>
  153. <el-dialog title="请选择生育诊断" v-model="showMatnDises" width="60%">
  154. <el-table :data="matnDises" @row-click="uploadFees" stripe height="360">
  155. <el-table-column property="code" label="病种编码"></el-table-column>
  156. <el-table-column property="name" label="病种名称"></el-table-column>
  157. <el-table-column property="insutype" label="险种类型"></el-table-column>
  158. <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
  159. </el-table>
  160. </el-dialog>
  161. </el-container>
  162. </template>
  163. <script>
  164. import { onMounted, ref } from 'vue'
  165. import {
  166. deleteAllMzReceipts,
  167. deleteMzReceipt,
  168. getMzReceipts,
  169. insertSiMzFees,
  170. outpatientPreSettlement,
  171. outpatientRegistration,
  172. revokeOutpatientFeeDetails,
  173. revokeOutpatientRegistration,
  174. uploadOutpatientFeeDetails,
  175. } from '@/api/medical-insurance/si-outpatient'
  176. import { cptInsutype, cptPersType, cptYbState } from '@/utils/computed'
  177. import { ElMessage, ElMessageBox } from 'element-plus'
  178. import store from '@/store'
  179. import { obtainBasicPersonInfo, querySpecialChronicDiseasesAccreditation, queryMzMatnDises } from '@/api/medical-insurance/si-query'
  180. import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
  181. export default {
  182. setup() {
  183. const medType = ref(null)
  184. const medTypes = ref([])
  185. const patientId = ref('')
  186. const times = ref(null)
  187. const windowSize = store.state.app.windowSize
  188. const tableHeight = windowSize.h - 45
  189. const receiptBoxStyle = {
  190. height: tableHeight - 200 + 'px',
  191. overflowY: 'auto',
  192. }
  193. const data = ref([])
  194. const mzPatient = ref({})
  195. const showInsuinfo = ref(false)
  196. const psnBaseinfo = ref({})
  197. const mzVisit = ref({})
  198. const receipts = ref({})
  199. const orderNos = ref([])
  200. const currentReceipts = ref([])
  201. const totalFee = ref(null)
  202. const timesTable = ref(null)
  203. const ordersTable = ref(null)
  204. const currentOrder = ref({})
  205. const spcChrDiseAccts = ref([])
  206. const showSpcChrAccts = ref(false)
  207. const matnDises = ref([])
  208. const showMatnDises = ref(false)
  209. const nullPatientId = () => {
  210. if (!patientId.value) {
  211. ElMessage({
  212. message: '请输入门诊id号!',
  213. type: 'warning',
  214. duration: 2500,
  215. showClose: true,
  216. })
  217. return true
  218. }
  219. return false
  220. }
  221. const clearBscData = () => {
  222. data.value = []
  223. orderNos.value = []
  224. currentReceipts.value = []
  225. mzPatient.value = {}
  226. mzVisit.value = {}
  227. }
  228. const registor = (command) => {
  229. if (nullPatientId()) {
  230. return
  231. }
  232. clearBscData()
  233. const param = {
  234. patNo: patientId.value,
  235. medType: medType.value,
  236. times: times.value,
  237. needSaving: 1,
  238. }
  239. if (command === 'execute') {
  240. obtainBasicPersonInfo(param).then((res) => {
  241. times.value = res.times
  242. psnBaseinfo.value = res
  243. showInsuinfo.value = true
  244. })
  245. } else {
  246. revokeOutpatientRegistration(param).then((res) => {
  247. ElMessage({
  248. message: res,
  249. type: 'success',
  250. duration: 2000,
  251. showClose: true,
  252. })
  253. })
  254. }
  255. }
  256. const receiptsOpts = (command) => {
  257. if (nullPatientId()) {
  258. return
  259. }
  260. data.value = []
  261. const param = {
  262. patNo: patientId.value,
  263. times: times.value,
  264. }
  265. switch (command) {
  266. case 'require':
  267. fetchReceipts(param)
  268. break
  269. case 'delete':
  270. deleteAllMzReceipts(param).then((res) => {
  271. ElMessage({
  272. message: res,
  273. type: 'success',
  274. duration: 2000,
  275. showClose: true,
  276. })
  277. fetchReceipts(param)
  278. })
  279. break
  280. case 'upload':
  281. qrySpcChrDiseAcct(param)
  282. break
  283. case 'retract':
  284. revokeOutpatientFeeDetails(param).then((res) => {
  285. ElMessage({
  286. message: res,
  287. type: 'success',
  288. duration: 2000,
  289. showClose: true,
  290. })
  291. })
  292. break
  293. }
  294. }
  295. const fetchReceipts = (param) => {
  296. getMzReceipts(param)
  297. .then((res) => {
  298. data.value = res
  299. setTimeout(() => {
  300. timesTable.value.setCurrentRow(res[0])
  301. clickTimes(res[0])
  302. }, 100)
  303. })
  304. .catch(() => {
  305. currentReceipts.value = []
  306. })
  307. }
  308. const markMzFees = () => {
  309. if (currentReceipts.value.length === 0) {
  310. ElMessage({
  311. message: '请先选择要保存的处方!',
  312. type: 'warning',
  313. duration: 2500,
  314. showClose: true,
  315. })
  316. return
  317. }
  318. ElMessageBox.confirm('是否将选中处方生成门特费用?', '提示', {
  319. type: 'warning',
  320. confirmButtonText: '生成',
  321. cancelButtonText: '取消',
  322. })
  323. .then(() => {
  324. insertSiMzFees(currentReceipts.value).then(() => {
  325. currentOrder.value.status = true
  326. ElMessage({
  327. message: '已成功生成门特处方。',
  328. type: 'success',
  329. duration: 2500,
  330. showClose: true,
  331. })
  332. })
  333. })
  334. .catch(() => {})
  335. }
  336. const qrySpcChrDiseAcct = (param) => {
  337. if (medType.value === '51') {
  338. queryMzMatnDises().then((res) => {
  339. matnDises.value = res
  340. showMatnDises.value = true
  341. })
  342. } else if (medType.value === '14') {
  343. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  344. spcChrDiseAccts.value = res
  345. showSpcChrAccts.value = true
  346. })
  347. } else {
  348. uploadFees(param)
  349. }
  350. }
  351. const uploadFees = (row) => {
  352. if (medType.value === '51') {
  353. row.patNo = patientId.value
  354. row.times = times.value
  355. row.opspDiseCode = row.code
  356. row.opspDiseName = row.name
  357. }
  358. uploadOutpatientFeeDetails(row).then((res) => {
  359. times.value = res.times
  360. showSpcChrAccts.value = false
  361. showMatnDises.value = false
  362. mzPreSetl()
  363. })
  364. }
  365. const handleClickInsuinfo = (row) => {
  366. const param = {
  367. patNo: patientId.value,
  368. times: times.value,
  369. insutype: row.insutype,
  370. psnType: row.psnType,
  371. insuplcAdmdvs: row.insuplcAdmdvs,
  372. empName: row.empName,
  373. }
  374. outpatientRegistration(param).then((res) => {
  375. showInsuinfo.value = false
  376. ElMessage({
  377. message: res,
  378. type: 'success',
  379. duration: 2000,
  380. showClose: true,
  381. })
  382. })
  383. }
  384. const clickOrderNo = (row) => {
  385. currentOrder.value = row
  386. currentReceipts.value = receipts.value[row.orderNo]
  387. totalFee.value = row.totalFee.toFixed(2)
  388. }
  389. const clickTimes = (row) => {
  390. mzPatient.value = row.mzPatient
  391. mzVisit.value = row.mzVisit
  392. receipts.value = row.mzReceipts
  393. orderNos.value = row.orderNos
  394. times.value = row.times
  395. currentReceipts.value = []
  396. setTimeout(() => {
  397. ordersTable.value.setCurrentRow(orderNos.value[0])
  398. clickOrderNo(orderNos.value[0])
  399. }, 100)
  400. }
  401. const colorStatus = (status) => {
  402. return status ? '<span style="color: green">已生成</span>' : '<span style="color: red">未生成</span>'
  403. }
  404. const unmarkMzFees = (row) => {
  405. ElMessageBox.confirm('是否将选中处方从门特处方中删除?', '提示', {
  406. type: 'warning',
  407. confirmButtonText: '确定',
  408. cancelButtonText: '取消',
  409. })
  410. .then(() => {
  411. deleteMzReceipt(row).then(() => {
  412. currentOrder.value.status = false
  413. ElMessage({
  414. message: '已成功删除门特处方。',
  415. type: 'success',
  416. duration: 2500,
  417. showClose: true,
  418. })
  419. })
  420. })
  421. .catch(() => {})
  422. }
  423. const mzPreSetl = () => {
  424. const param = {
  425. staffId: store.state.user.info.code,
  426. patNo: patientId.value,
  427. times: times.value,
  428. }
  429. outpatientPreSettlement(param).then((res) => {
  430. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  431. ElMessageBox.alert(message, '试算成功', {
  432. type: 'success',
  433. showCancelButton: false,
  434. }).then(() => {})
  435. })
  436. }
  437. const clearinfo = () => {
  438. patientId.value = ''
  439. times.value = null
  440. data.value = []
  441. mzPatient.value = {}
  442. psnBaseinfo.value = {}
  443. mzVisit.value = {}
  444. receipts.value = {}
  445. orderNos.value = []
  446. currentReceipts.value = []
  447. totalFee.value = null
  448. timesTable.value = null
  449. ordersTable.value = null
  450. currentOrder.value = {}
  451. spcChrDiseAccts.value = []
  452. }
  453. onMounted(() => {
  454. getMedTypesByFlag('clinic').then((res) => {
  455. medTypes.value = res
  456. })
  457. })
  458. return {
  459. medType,
  460. medTypes,
  461. patientId,
  462. cptYbState,
  463. cptInsutype,
  464. cptPersType,
  465. receiptBoxStyle,
  466. tableHeight,
  467. showInsuinfo,
  468. psnBaseinfo,
  469. mzPatient,
  470. mzVisit,
  471. receipts,
  472. orderNos,
  473. currentReceipts,
  474. totalFee,
  475. ordersTable,
  476. timesTable,
  477. data,
  478. spcChrDiseAccts,
  479. showSpcChrAccts,
  480. matnDises,
  481. showMatnDises,
  482. mzPreSetl,
  483. clickTimes,
  484. colorStatus,
  485. clickOrderNo,
  486. handleClickInsuinfo,
  487. uploadFees,
  488. clearinfo,
  489. markMzFees,
  490. unmarkMzFees,
  491. registor,
  492. receiptsOpts,
  493. }
  494. },
  495. }
  496. </script>
  497. <style scoped>
  498. .receipt-title {
  499. width: 100%;
  500. text-align: center;
  501. font-weight: bold;
  502. font-size: 20px;
  503. height: 32px;
  504. line-height: 32px;
  505. }
  506. .receipt-head {
  507. display: flex;
  508. height: 22px;
  509. line-height: 22px;
  510. }
  511. .receipt-head > div {
  512. width: 33%;
  513. padding-right: 20px;
  514. }
  515. .receipt-item {
  516. display: flex;
  517. }
  518. .receipt-tips {
  519. margin: 0 0 10px 100px;
  520. }
  521. .receipt-tips > span {
  522. margin-right: 15px;
  523. }
  524. .w75 {
  525. width: 70%;
  526. font-size: 15px;
  527. }
  528. .w75 * {
  529. font-size: 15px;
  530. }
  531. .w25 {
  532. width: 25%;
  533. font-size: 15px;
  534. color: #0f5e0f;
  535. font-weight: bold;
  536. }
  537. </style>