MzRegister.vue 17 KB

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