MzRegister.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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-container>
  154. </template>
  155. <script>
  156. import { onMounted, ref } from 'vue'
  157. import {
  158. deleteAllMzReceipts,
  159. deleteMzReceipt,
  160. getMzReceipts,
  161. insertSiMzFees,
  162. outpatientPreSettlement,
  163. outpatientRegistration,
  164. revokeOutpatientFeeDetails,
  165. revokeOutpatientRegistration,
  166. uploadOutpatientFeeDetails,
  167. } from '@/api/medical-insurance/si-outpatient'
  168. import { cptInsutype, cptPersType, cptYbState } from '@/utils/computed'
  169. import { ElMessage, ElMessageBox } from 'element-plus'
  170. import store from '@/store'
  171. import { obtainBasicPersonInfo, querySpecialChronicDiseasesAccreditation } from '@/api/medical-insurance/si-query'
  172. import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
  173. export default {
  174. setup() {
  175. const medType = ref(null)
  176. const medTypes = ref([])
  177. const patientId = ref('')
  178. const times = ref(null)
  179. const windowSize = store.state.app.windowSize
  180. const tableHeight = windowSize.h - 45
  181. const receiptBoxStyle = {
  182. height: tableHeight - 200 + 'px',
  183. overflowY: 'auto',
  184. }
  185. const data = ref([])
  186. const mzPatient = ref({})
  187. const showInsuinfo = ref(false)
  188. const psnBaseinfo = ref({})
  189. const mzVisit = ref({})
  190. const receipts = ref({})
  191. const orderNos = ref([])
  192. const currentReceipts = ref([])
  193. const totalFee = ref(null)
  194. const timesTable = ref(null)
  195. const ordersTable = ref(null)
  196. const currentOrder = ref({})
  197. const spcChrDiseAccts = ref([])
  198. const showSpcChrAccts = ref(false)
  199. const nullPatientId = () => {
  200. if (!patientId.value) {
  201. ElMessage({
  202. message: '请输入门诊id号!',
  203. type: 'warning',
  204. duration: 2500,
  205. showClose: true,
  206. })
  207. return true
  208. }
  209. return false
  210. }
  211. const clearBscData = () => {
  212. data.value = []
  213. orderNos.value = []
  214. currentReceipts.value = []
  215. mzPatient.value = {}
  216. mzVisit.value = {}
  217. }
  218. const registor = (command) => {
  219. if (nullPatientId()) {
  220. return
  221. }
  222. clearBscData()
  223. const param = {
  224. patNo: patientId.value,
  225. medType: medType.value,
  226. times: times.value,
  227. needSaving: 1,
  228. }
  229. if (command === 'execute') {
  230. obtainBasicPersonInfo(param).then((res) => {
  231. times.value = res.times
  232. psnBaseinfo.value = res
  233. showInsuinfo.value = true
  234. })
  235. } else {
  236. revokeOutpatientRegistration(param).then((res) => {
  237. ElMessage({
  238. message: res,
  239. type: 'success',
  240. duration: 2000,
  241. showClose: true,
  242. })
  243. })
  244. }
  245. }
  246. const receiptsOpts = (command) => {
  247. if (nullPatientId()) {
  248. return
  249. }
  250. data.value = []
  251. const param = {
  252. patNo: patientId.value,
  253. times: times.value,
  254. }
  255. switch (command) {
  256. case 'require':
  257. fetchReceipts(param)
  258. break
  259. case 'delete':
  260. deleteAllMzReceipts(param).then((res) => {
  261. ElMessage({
  262. message: res,
  263. type: 'success',
  264. duration: 2000,
  265. showClose: true,
  266. })
  267. fetchReceipts(param)
  268. })
  269. break
  270. case 'upload':
  271. qrySpcChrDiseAcct(param)
  272. break
  273. case 'retract':
  274. revokeOutpatientFeeDetails(param).then((res) => {
  275. ElMessage({
  276. message: res,
  277. type: 'success',
  278. duration: 2000,
  279. showClose: true,
  280. })
  281. })
  282. break
  283. }
  284. }
  285. const fetchReceipts = (param) => {
  286. getMzReceipts(param)
  287. .then((res) => {
  288. data.value = res
  289. setTimeout(() => {
  290. timesTable.value.setCurrentRow(res[0])
  291. clickTimes(res[0])
  292. }, 100)
  293. })
  294. .catch(() => {
  295. currentReceipts.value = []
  296. })
  297. }
  298. const markMzFees = () => {
  299. if (currentReceipts.value.length === 0) {
  300. ElMessage({
  301. message: '请先选择要保存的处方!',
  302. type: 'warning',
  303. duration: 2500,
  304. showClose: true,
  305. })
  306. return
  307. }
  308. ElMessageBox.confirm('是否将选中处方生成门特费用?', '提示', {
  309. type: 'warning',
  310. confirmButtonText: '生成',
  311. cancelButtonText: '取消',
  312. })
  313. .then(() => {
  314. insertSiMzFees(currentReceipts.value).then(() => {
  315. currentOrder.value.status = true
  316. ElMessage({
  317. message: '已成功生成门特处方。',
  318. type: 'success',
  319. duration: 2500,
  320. showClose: true,
  321. })
  322. })
  323. })
  324. .catch(() => {})
  325. }
  326. const qrySpcChrDiseAcct = (param) => {
  327. if (medType.value === '14') {
  328. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  329. spcChrDiseAccts.value = res
  330. showSpcChrAccts.value = true
  331. })
  332. } else {
  333. uploadFees(param)
  334. }
  335. }
  336. const uploadFees = (row) => {
  337. uploadOutpatientFeeDetails(row).then((res) => {
  338. times.value = res.times
  339. showSpcChrAccts.value = false
  340. mzPreSetl()
  341. })
  342. }
  343. const handleClickInsuinfo = (row) => {
  344. const param = {
  345. patNo: patientId.value,
  346. times: times.value,
  347. insutype: row.insutype,
  348. psnType: row.psnType,
  349. insuplcAdmdvs: row.insuplcAdmdvs,
  350. empName: row.empName,
  351. }
  352. outpatientRegistration(param).then((res) => {
  353. showInsuinfo.value = false
  354. ElMessage({
  355. message: res,
  356. type: 'success',
  357. duration: 2000,
  358. showClose: true,
  359. })
  360. })
  361. }
  362. const clickOrderNo = (row) => {
  363. currentOrder.value = row
  364. currentReceipts.value = receipts.value[row.orderNo]
  365. totalFee.value = row.totalFee.toFixed(2)
  366. }
  367. const clickTimes = (row) => {
  368. mzPatient.value = row.mzPatient
  369. mzVisit.value = row.mzVisit
  370. receipts.value = row.mzReceipts
  371. orderNos.value = row.orderNos
  372. times.value = row.times
  373. currentReceipts.value = []
  374. setTimeout(() => {
  375. ordersTable.value.setCurrentRow(orderNos.value[0])
  376. clickOrderNo(orderNos.value[0])
  377. }, 100)
  378. }
  379. const colorStatus = (status) => {
  380. return status ? '<span style="color: green">已生成</span>' : '<span style="color: red">未生成</span>'
  381. }
  382. const unmarkMzFees = (row) => {
  383. ElMessageBox.confirm('是否将选中处方从门特处方中删除?', '提示', {
  384. type: 'warning',
  385. confirmButtonText: '确定',
  386. cancelButtonText: '取消',
  387. })
  388. .then(() => {
  389. deleteMzReceipt(row).then(() => {
  390. currentOrder.value.status = false
  391. ElMessage({
  392. message: '已成功删除门特处方。',
  393. type: 'success',
  394. duration: 2500,
  395. showClose: true,
  396. })
  397. })
  398. })
  399. .catch(() => {})
  400. }
  401. const mzPreSetl = () => {
  402. const param = {
  403. staffId: store.state.user.info.code,
  404. patNo: patientId.value,
  405. times: times.value,
  406. }
  407. outpatientPreSettlement(param).then((res) => {
  408. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  409. ElMessageBox.alert(message, '试算成功', {
  410. type: 'success',
  411. showCancelButton: false,
  412. }).then(() => {})
  413. })
  414. }
  415. const clearinfo = () => {
  416. patientId.value = ''
  417. times.value = null
  418. data.value = []
  419. mzPatient.value = {}
  420. psnBaseinfo.value = {}
  421. mzVisit.value = {}
  422. receipts.value = {}
  423. orderNos.value = []
  424. currentReceipts.value = []
  425. totalFee.value = null
  426. timesTable.value = null
  427. ordersTable.value = null
  428. currentOrder.value = {}
  429. spcChrDiseAccts.value = []
  430. }
  431. onMounted(() => {
  432. getMedTypesByFlag('clinic').then((res) => {
  433. medTypes.value = res
  434. })
  435. })
  436. return {
  437. medType,
  438. medTypes,
  439. patientId,
  440. cptYbState,
  441. cptInsutype,
  442. cptPersType,
  443. receiptBoxStyle,
  444. registor,
  445. receiptsOpts,
  446. tableHeight,
  447. markMzFees,
  448. unmarkMzFees,
  449. showInsuinfo,
  450. psnBaseinfo,
  451. handleClickInsuinfo,
  452. mzPatient,
  453. mzVisit,
  454. receipts,
  455. orderNos,
  456. colorStatus,
  457. clickOrderNo,
  458. currentReceipts,
  459. totalFee,
  460. ordersTable,
  461. timesTable,
  462. mzPreSetl,
  463. data,
  464. clickTimes,
  465. spcChrDiseAccts,
  466. showSpcChrAccts,
  467. uploadFees,
  468. clearinfo,
  469. }
  470. },
  471. }
  472. </script>
  473. <style scoped>
  474. .receipt-title {
  475. width: 100%;
  476. text-align: center;
  477. font-weight: bold;
  478. font-size: 20px;
  479. height: 32px;
  480. line-height: 32px;
  481. }
  482. .receipt-head {
  483. display: flex;
  484. height: 22px;
  485. line-height: 22px;
  486. }
  487. .receipt-head > div {
  488. width: 33%;
  489. padding-right: 20px;
  490. }
  491. .receipt-item {
  492. display: flex;
  493. }
  494. .receipt-tips {
  495. margin: 0 0 10px 100px;
  496. }
  497. .receipt-tips > span {
  498. margin-right: 15px;
  499. }
  500. .w75 {
  501. width: 70%;
  502. font-size: 15px;
  503. }
  504. .w75 * {
  505. font-size: 15px;
  506. }
  507. .w25 {
  508. width: 25%;
  509. font-size: 15px;
  510. color: #0f5e0f;
  511. font-weight: bold;
  512. }
  513. </style>