MzRegister.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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" placeholder="医疗类别">
  8. <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
  9. </el-select>
  10. <el-select v-model="admdvs" clearable filterable placeholder="参保地区" style="width: 180px">
  11. <el-option v-for="item in admdvses" :key="item.code" :label="item.name" :value="item.code">
  12. <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
  13. <el-divider direction="vertical"></el-divider>
  14. <span>{{ item.name }}</span>
  15. </el-option>
  16. </el-select>
  17. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  18. <el-button type="primary">
  19. 处方&nbsp;<el-icon><ArrowDown /></el-icon>
  20. </el-button>
  21. <template #dropdown>
  22. <el-dropdown-menu>
  23. <el-dropdown-item icon="Document" command="require">获取门诊处方</el-dropdown-item>
  24. <el-dropdown-item icon="Delete" command="delete">删除所有处方</el-dropdown-item>
  25. </el-dropdown-menu>
  26. </template>
  27. </el-dropdown>
  28. <ReadCard :pat-no="patientId" @success="afterReadCard" />
  29. <el-dropdown trigger="click" @command="registor">
  30. <el-button type="primary">
  31. 登记&nbsp;<el-icon><ArrowDown /></el-icon>
  32. </el-button>
  33. <template #dropdown>
  34. <el-dropdown-menu>
  35. <el-dropdown-item icon="CreditCard" command="execute">医保登记</el-dropdown-item>
  36. <el-dropdown-item icon="RefreshLeft" command="revoke">取消登记</el-dropdown-item>
  37. </el-dropdown-menu>
  38. </template>
  39. </el-dropdown>
  40. <el-dropdown trigger="click" @command="receiptsOpts" style="margin-left: 8px">
  41. <el-button type="primary">
  42. 上传&nbsp;<el-icon><ArrowDown /></el-icon>
  43. </el-button>
  44. <template #dropdown>
  45. <el-dropdown-menu>
  46. <el-dropdown-item icon="Upload" command="upload">医保处方上传</el-dropdown-item>
  47. <el-dropdown-item icon="RefreshLeft" command="retract">撤销处方上传</el-dropdown-item>
  48. <el-dropdown-item divided icon="Edit" command="diags">普门诊断补录</el-dropdown-item>
  49. </el-dropdown-menu>
  50. </template>
  51. </el-dropdown>
  52. <el-dropdown trigger="click" @command="settlement" style="margin-left: 8px">
  53. <el-button type="primary">
  54. 结算&nbsp;<el-icon><ArrowDown /></el-icon>
  55. </el-button>
  56. <template #dropdown>
  57. <el-dropdown-menu>
  58. <el-dropdown-item icon="SetUp" command="preSettlement">试算</el-dropdown-item>
  59. <el-dropdown-item icon="Stamp" command="realSettlement">结算</el-dropdown-item>
  60. <el-dropdown-item divided icon="RefreshLeft" command="cancelSettlement">取消结算</el-dropdown-item>
  61. </el-dropdown-menu>
  62. </template>
  63. </el-dropdown>
  64. <el-button type="danger" icon="Refresh" @click="clearinfo" style="margin-left: 8px"> 重置 </el-button>
  65. </el-header>
  66. <el-main>
  67. <el-row :gutter="5">
  68. <el-col :span="2">
  69. <el-table ref="timesTable" :data="unPaidReceipts" highlight-current-row :height="tableHeight" @row-click="clickTimes">
  70. <el-table-column label="就诊次数">
  71. <template #default="scope"> 第 {{ scope.row.times }} 次 </template>
  72. </el-table-column>
  73. </el-table>
  74. </el-col>
  75. <el-col :span="5">
  76. <el-table ref="ordersTable" :data="orderNos" highlight-current-row :height="tableHeight" @row-click="clickOrderNo">
  77. <el-table-column label="处方" width="60">
  78. <template #default="scope">
  79. <span v-html="colorStatus(scope.row)"></span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="金额" width="60">
  83. <template #default="scope">
  84. {{ scope.row.totalFee.toFixed(2) }}
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="操作">
  88. <template #default="scope">
  89. <el-button text icon="Check" @click="markMzFees" :disabled="scope.row.status"> 生成 </el-button>
  90. <el-button text icon="Delete" @click="unmarkMzFees(scope.row)" :disabled="!scope.row.status"> 撤销 </el-button>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. </el-col>
  95. <el-col :span="15">
  96. <div style="margin-left: 30px">
  97. <div class="receipt-title">长沙泰和医院处方笺</div>
  98. <el-divider></el-divider>
  99. <div class="receipt-head">
  100. <div>姓名:{{ mzVisit.name }}</div>
  101. <div>性别:{{ mzVisit.sex }}</div>
  102. <div>年龄:{{ mzVisit.age }} 岁</div>
  103. </div>
  104. <div class="receipt-head">
  105. <div>门诊号:{{ mzVisit.patientId }}</div>
  106. <div>科别:{{ mzVisit.visitDeptName }}</div>
  107. <div class="ellipsis-text" :title="mzVisit.icdText">临床诊断:{{ mzVisit.icdText }}</div>
  108. </div>
  109. <div class="receipt-head">
  110. <div>开具日期:{{ mzVisit.opDay }}</div>
  111. <div class="ellipsis-text">
  112. 地址:<span :title="mzVisit.address">{{ mzVisit.address }}</span>
  113. </div>
  114. <div>电话:{{ mzVisit.phoneNo }}</div>
  115. </div>
  116. <el-divider></el-divider>
  117. <div :style="receiptBoxStyle">
  118. <div v-for="(item, index) in currentReceipts" :key="index">
  119. <div class="receipt-item">
  120. <div class="w75">
  121. <el-checkbox v-model="item.checked"></el-checkbox>
  122. {{ index + 1 }}){{ item.drugName }}&nbsp; (
  123. <span v-if="item.specification">{{ item.specification }}</span>
  124. <span v-else>{{ item.drugUnit }}</span>
  125. </div>
  126. <div class="w25">&times;&nbsp;&nbsp;&nbsp;{{ item.quantity }}</div>
  127. </div>
  128. <div class="receipt-tips">
  129. <span v-if="item.drugQuan"> 用法:{{ item.drugQuan }}{{ item.drugUnit }}/次 </span>
  130. <span v-if="item.frequency"> {{ item.frequency }} </span>
  131. <span v-if="item.orderDays"> {{ item.orderDays }}天 </span>
  132. <span v-if="item.supplyCode"> {{ item.supplyCode }} </span>
  133. <span v-if="item.instructionText"> 备注:{{ item.instructionText }} </span>
  134. </div>
  135. <div :style="{ color: item.nationalCode ? 'green' : 'red', fontWeight: 'bold', padding: '0 0 12px 64px' }">医保码:{{ item.nationalCode || '未匹配' }}</div>
  136. </div>
  137. </div>
  138. <el-divider></el-divider>
  139. <div class="receipt-head">
  140. <div style="font-size: 15px">医师:{{ mzVisit.doctorName }} / {{ mzVisit.doctorCode }}</div>
  141. <div style="font-size: 15px">
  142. 总金额:<span style="font-size: 18px; font-weight: bold">¥{{ totalFee }}</span>
  143. </div>
  144. </div>
  145. </div>
  146. </el-col>
  147. </el-row>
  148. </el-main>
  149. <el-dialog title="个人信息" v-model="showInsuinfo" width="65%">
  150. <el-tag>参保信息</el-tag>
  151. <el-table :data="psnBaseinfo.insuinfo" @row-click="handleClickInsuinfo">
  152. <el-table-column property="balc" label="余额"></el-table-column>
  153. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  154. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  155. <el-table-column label="参保状态" prop="psnInsuStasName"></el-table-column>
  156. <el-table-column property="psnInsuDate" label="个人参保日期"></el-table-column>
  157. <el-table-column property="pausInsuDate" label="暂停参保日期"></el-table-column>
  158. <el-table-column property="cvlservFlagName" label="公务员标志"></el-table-column>
  159. <el-table-column property="insuplcAdmdvs" label="参保地医保区划"></el-table-column>
  160. <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
  161. <el-table-column property="empName" label="单位名称"></el-table-column>
  162. </el-table>
  163. <div style="height: 16px"></div>
  164. <el-tag>身份信息</el-tag>
  165. <el-table :data="psnBaseinfo.idetinfo" stripe height="180">
  166. <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
  167. <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
  168. <el-table-column label="备注" prop="memo"></el-table-column>
  169. <el-table-column label="开始时间" prop="begntime"></el-table-column>
  170. <el-table-column label="结束时间" prop="endtime"></el-table-column>
  171. </el-table>
  172. </el-dialog>
  173. <el-dialog title="请选择(慢特病备案信息)" v-model="showSpcChrAccts" width="40%">
  174. <el-table :data="spcChrDiseAccts" @row-click="uploadFees">
  175. <el-table-column property="opspDiseCode" label="病种编码"></el-table-column>
  176. <el-table-column property="opspDiseName" label="病种名称"></el-table-column>
  177. <el-table-column property="begndate" label="生效日期"></el-table-column>
  178. <el-table-column property="enddate" label="失效日期"></el-table-column>
  179. </el-table>
  180. </el-dialog>
  181. <el-dialog title="请选择生育诊断" v-model="showMatnDises" width="60%">
  182. <el-table :data="matnDises" @row-click="uploadFees" stripe height="360">
  183. <el-table-column property="code" label="病种编码"></el-table-column>
  184. <el-table-column property="name" label="病种名称"></el-table-column>
  185. <el-table-column property="insutype" label="险种类型"></el-table-column>
  186. <el-table-column property="limitAmt" label="疾病限额"></el-table-column>
  187. </el-table>
  188. </el-dialog>
  189. <el-dialog title="普门诊断补录" v-model="showInputDiags" width="60%" :close-on-click-modal="false" :close-on-press-escape="false">
  190. <div style="margin-top: -20px; margin-bottom: 16px; background: lightgray; padding: 8px 4px; color: black">临床诊断参考:{{ mzVisit.icdText }}</div>
  191. 检索方法:<el-select v-model="searchMethod" style="width: 80px">
  192. <el-option v-for="item in searchMethods" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select
  193. >&nbsp;
  194. <el-autocomplete v-model="diagItem.diagName" :fetch-suggestions="searchDiag" placeholder="请输入内容" clearable @select="handleSelectDiag" style="width: 220px">
  195. <template #default="{ item }">
  196. <div style="height: 40px">
  197. <div style="height: 16px; margin-top: 4px; font-size: 12px; color: #8492a6">
  198. {{ item.code }}
  199. </div>
  200. <div style="height: 16px">{{ item.name }}</div>
  201. </div>
  202. </template>
  203. </el-autocomplete>
  204. <el-select v-model="diagItem.diagType" placeholder="诊断类别" style="width: 120px">
  205. <el-option v-for="item in diagTypes" :key="item.code" :label="item.name" :value="item.code"></el-option>
  206. </el-select>
  207. <el-divider direction="vertical"></el-divider>
  208. <el-button type="primary" icon="Plus" @click="addDiag">添加到诊断列表</el-button>
  209. <el-button type="success" icon="Check" @click="saveDiag">保存诊断</el-button>
  210. <el-table :data="diags" stripe>
  211. <el-table-column prop="diagSrtNo" label="序号" width="40"></el-table-column>
  212. <el-table-column prop="diagType" label="诊断类别" width="60"></el-table-column>
  213. <el-table-column prop="diagCode" label="诊断编码"></el-table-column>
  214. <el-table-column prop="diagName" label="诊断名称"></el-table-column>
  215. <el-table-column prop="diagDept" label="诊断科室"></el-table-column>
  216. <el-table-column prop="diseDorNo" label="医生编码" width="80"></el-table-column>
  217. <el-table-column prop="diseDorName" label="医生姓名" width="80"></el-table-column>
  218. <el-table-column prop="diagTime" label="诊断时间"></el-table-column>
  219. <el-table-column label="操作">
  220. <template #default="scope">
  221. <el-button icon="Delete" text @click="deleteDiag(scope.$index)">删除</el-button>
  222. </template>
  223. </el-table-column>
  224. </el-table>
  225. </el-dialog>
  226. </el-container>
  227. </template>
  228. <script>
  229. import { onMounted, reactive, ref } from 'vue'
  230. import { admdvses } from '@/data'
  231. import {
  232. deleteAllMzReceipts,
  233. deleteMzReceipt,
  234. getMzReceipts,
  235. insertSiMzFees,
  236. outpatientPreSettlement,
  237. outpatientRegistration,
  238. revokeOutpatientFeeDetails,
  239. revokeOutpatientRegistration,
  240. uploadOutpatientFeeDetails,
  241. saveSiMzDiags,
  242. outpatientSettlement,
  243. revokeOutpatientSettlement,
  244. } from '@/api/medical-insurance/si-outpatient'
  245. import { cptInsutype } from '@/utils/computed'
  246. import { ElMessage, ElMessageBox } from 'element-plus'
  247. import store from '@/store'
  248. import { obtainBasicPersonInfo, querySpecialChronicDiseasesAccreditation, queryMzMatnDises } from '@/api/medical-insurance/si-query'
  249. import { getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
  250. import { increaseWeight, searchData } from '@/api/inpatient/dictionary'
  251. import { clone } from '@/utils/clone'
  252. import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
  253. export default {
  254. components: {
  255. ReadCard,
  256. },
  257. setup() {
  258. //todo 完成业务后清除原读卡数据
  259. const medType = ref(null)
  260. const admdvs = ref(null)
  261. const medTypes = ref([])
  262. const patientId = ref('')
  263. const readCardBizType = ref('')
  264. const times = ref(null)
  265. const windowSize = store.state.app.windowSize
  266. const tableHeight = windowSize.h - 55
  267. const receiptBoxStyle = {
  268. height: tableHeight - 280 + 'px',
  269. overflowY: 'auto',
  270. }
  271. const unPaidReceipts = ref([])
  272. const showInsuinfo = ref(false)
  273. const psnBaseinfo = ref({})
  274. const mzVisit = ref({})
  275. const receipts = ref({})
  276. const orderNos = ref([])
  277. const currentReceipts = ref([])
  278. const totalFee = ref(null)
  279. const timesTable = ref(null)
  280. const ordersTable = ref(null)
  281. const currentOrder = ref({})
  282. const spcChrDiseAccts = ref([])
  283. const showSpcChrAccts = ref(false)
  284. const matnDises = ref([])
  285. const showMatnDises = ref(false)
  286. const showInputDiags = ref(false)
  287. const searchMethods = [
  288. { code: 'alpha', name: '首拼' },
  289. { code: 'code', name: '编码' },
  290. { code: 'name', name: '名称' },
  291. ]
  292. const searchMethod = ref('alpha')
  293. const diagItem = reactive({})
  294. const searchDiag = (queryString, cb) => {
  295. if (queryString && queryString.length > 1) {
  296. const param = {
  297. method: searchMethod.value,
  298. content: queryString,
  299. target: 'diag',
  300. medType: medType.value,
  301. }
  302. searchData(param).then((res) => {
  303. cb(res)
  304. })
  305. }
  306. }
  307. const handleSelectDiag = (item) => {
  308. increaseWeight({ code: 'diag', name: item.code }).then(() => {
  309. diagItem.diagCode = item.code
  310. diagItem.diagName = item.name
  311. })
  312. }
  313. const diagTypes = [
  314. { code: '1', name: '西医诊断' },
  315. { code: '2', name: '中医主病诊断' },
  316. { code: '3', name: '中医主证诊断' },
  317. ]
  318. const diags = ref([])
  319. const addDiag = () => {
  320. if (!diagItem.diagCode) {
  321. ElMessage({
  322. message: '请选择诊断!',
  323. type: 'warning',
  324. duration: 2500,
  325. showClose: true,
  326. })
  327. return
  328. }
  329. if (!diagItem.diagType) {
  330. ElMessage({
  331. message: '请选择诊断类别!',
  332. type: 'warning',
  333. duration: 2500,
  334. showClose: true,
  335. })
  336. return
  337. }
  338. diagItem.patNo = patientId.value
  339. diagItem.times = times.value
  340. diagItem.diagSrtNo = diags.value.length + 1
  341. diagItem.diagDept = mzVisit.value.visitDeptName
  342. diagItem.diseDorNo = mzVisit.value.doctorCode
  343. diagItem.diseDorName = mzVisit.value.doctorName
  344. diagItem.diagTime = mzVisit.value.opDay
  345. diagItem.valiFlag = '1'
  346. diags.value.push(clone(diagItem))
  347. diagItem.diagCode = ''
  348. diagItem.diagName = ''
  349. diagItem.diagType = ''
  350. }
  351. const deleteDiag = (index) => {
  352. diags.value.splice(index, 1)
  353. for (let i = 0; i < diags.value.length; i++) {
  354. const element = diags.value[i]
  355. element.diagSrtNo = i + 1
  356. }
  357. }
  358. const saveDiag = () => {
  359. if (diags.value.length === 0) {
  360. ElMessage({
  361. message: '没有要保存的诊断!',
  362. type: 'warning',
  363. duration: 2500,
  364. showClose: true,
  365. })
  366. return
  367. }
  368. saveSiMzDiags(diags.value).then((res) => {
  369. ElMessageBox.alert(res, '提示', {
  370. type: 'success',
  371. showCancelButton: false,
  372. }).then(() => {
  373. diags.value = []
  374. showInputDiags.value = false
  375. })
  376. })
  377. }
  378. const nullPatientId = () => {
  379. if (!patientId.value) {
  380. ElMessage({
  381. message: '请输入门诊id号!',
  382. type: 'warning',
  383. duration: 2500,
  384. showClose: true,
  385. })
  386. return true
  387. }
  388. return false
  389. }
  390. const registor = (command) => {
  391. if (nullPatientId()) {
  392. return
  393. }
  394. if (nullTimes()) {
  395. return
  396. }
  397. const param = {
  398. patNo: patientId.value,
  399. medType: medType.value,
  400. admdvs: admdvs.value,
  401. times: times.value,
  402. needSaving: 1,
  403. }
  404. if (command === 'execute') {
  405. if (!medType.value) {
  406. ElMessage({
  407. message: '请先选择医疗类别!',
  408. type: 'warning',
  409. duration: 2500,
  410. showClose: true,
  411. })
  412. return
  413. }
  414. obtainBasicPersonInfo(param).then((res) => {
  415. times.value = res.times
  416. psnBaseinfo.value = res
  417. showInsuinfo.value = true
  418. })
  419. } else {
  420. revokeOutpatientRegistration(param).then((res) => {
  421. ElMessage({
  422. message: res,
  423. type: 'success',
  424. duration: 2000,
  425. showClose: true,
  426. })
  427. })
  428. }
  429. }
  430. const nullTimes = () => {
  431. if (!times.value) {
  432. ElMessage({
  433. message: '请先获取门诊处方!',
  434. type: 'warning',
  435. duration: 2500,
  436. showClose: true,
  437. })
  438. return true
  439. }
  440. return false
  441. }
  442. const receiptsOpts = (command) => {
  443. if (nullPatientId()) {
  444. return
  445. }
  446. if (command !== 'require') {
  447. if (nullTimes()) {
  448. return
  449. }
  450. }
  451. const param = {
  452. patNo: patientId.value,
  453. times: times.value,
  454. }
  455. switch (command) {
  456. case 'require':
  457. fetchReceipts(param)
  458. break
  459. case 'delete':
  460. deleteAllMzReceipts(param).then((res) => {
  461. ElMessage({
  462. message: res,
  463. type: 'success',
  464. duration: 2000,
  465. showClose: true,
  466. })
  467. fetchReceipts(param)
  468. })
  469. break
  470. case 'upload':
  471. qrySpcChrDiseAcct(param)
  472. break
  473. case 'retract':
  474. revokeOutpatientFeeDetails(param).then((res) => {
  475. ElMessage({
  476. message: res,
  477. type: 'success',
  478. duration: 2000,
  479. showClose: true,
  480. })
  481. })
  482. break
  483. case 'diags':
  484. showInputDiags.value = true
  485. break
  486. }
  487. }
  488. const fetchReceipts = (param) => {
  489. clearReadCardData()
  490. getMzReceipts(param)
  491. .then((res) => {
  492. unPaidReceipts.value = res
  493. setTimeout(() => {
  494. timesTable.value.setCurrentRow(res[0])
  495. clickTimes(res[0])
  496. }, 100)
  497. })
  498. .catch(() => {
  499. unPaidReceipts.value = []
  500. orderNos.value = []
  501. currentReceipts.value = []
  502. })
  503. }
  504. const markMzFees = () => {
  505. if (currentReceipts.value.length === 0) {
  506. ElMessage({
  507. message: '请先选择要保存的处方!',
  508. type: 'warning',
  509. duration: 2500,
  510. showClose: true,
  511. })
  512. return
  513. }
  514. ElMessageBox.confirm('是否将选中处方生成医保处方?', '提示', {
  515. type: 'warning',
  516. confirmButtonText: '生成',
  517. cancelButtonText: '取消',
  518. })
  519. .then(() => {
  520. insertSiMzFees(currentReceipts.value).then(() => {
  521. currentOrder.value.status = true
  522. ElMessage({
  523. message: '已成功生成医保处方。',
  524. type: 'success',
  525. duration: 2500,
  526. showClose: true,
  527. })
  528. })
  529. })
  530. .catch(() => {})
  531. }
  532. const qrySpcChrDiseAcct = (param) => {
  533. if (medType.value === '51') {
  534. queryMzMatnDises().then((res) => {
  535. matnDises.value = res
  536. showMatnDises.value = true
  537. })
  538. } else if (medType.value === '14') {
  539. querySpecialChronicDiseasesAccreditation(param).then((res) => {
  540. spcChrDiseAccts.value = res
  541. showSpcChrAccts.value = true
  542. })
  543. } else {
  544. uploadFees(param)
  545. }
  546. }
  547. const uploadFees = (row) => {
  548. if (medType.value === '51') {
  549. row.patNo = patientId.value
  550. row.times = times.value
  551. row.opspDiseCode = row.code
  552. row.opspDiseName = row.name
  553. }
  554. uploadOutpatientFeeDetails(row).then((res) => {
  555. times.value = res.times
  556. showSpcChrAccts.value = false
  557. showMatnDises.value = false
  558. mzPreSetl()
  559. })
  560. }
  561. const readCardData = reactive({
  562. mdtrtCertType: null,
  563. readCardResult: null,
  564. readCardBizType: null,
  565. })
  566. const clearReadCardData = () => {
  567. readCardData.mdtrtCertType = null
  568. readCardData.readCardResult = null
  569. readCardData.readCardBizType = null
  570. }
  571. const afterReadCard = (result) => {
  572. readCardData.mdtrtCertType = result.mdtrtCertType
  573. readCardData.readCardResult = result.readCardResult
  574. readCardData.readCardBizType = result.readCardBizType
  575. }
  576. const handleClickInsuinfo = (row) => {
  577. const param = {
  578. patNo: patientId.value,
  579. times: times.value,
  580. insutype: row.insutype,
  581. psnType: row.psnType,
  582. insuplcAdmdvs: row.insuplcAdmdvs,
  583. empName: row.empName,
  584. mdtrtCertType: readCardData.mdtrtCertType,
  585. readCardResult: readCardData.readCardResult,
  586. readCardBizType: readCardData.readCardBizType,
  587. }
  588. outpatientRegistration(param).then((res) => {
  589. showInsuinfo.value = false
  590. clearReadCardData()
  591. ElMessage({
  592. message: res,
  593. type: 'success',
  594. duration: 2000,
  595. showClose: true,
  596. })
  597. })
  598. }
  599. const clickOrderNo = (row) => {
  600. currentOrder.value = row
  601. currentReceipts.value = receipts.value[row.orderNo]
  602. totalFee.value = row.totalFee.toFixed(2)
  603. }
  604. const clickTimes = (row) => {
  605. mzVisit.value = row.mzVisit
  606. receipts.value = row.mzReceipts
  607. orderNos.value = row.orderNos
  608. times.value = row.times
  609. currentReceipts.value = []
  610. setTimeout(() => {
  611. ordersTable.value.setCurrentRow(orderNos.value[0])
  612. clickOrderNo(orderNos.value[0])
  613. }, 100)
  614. }
  615. const colorStatus = (row) => {
  616. return row.status ? `<span style="color: green">第${row.orderNo}张</span>` : `<span style="color: red">第${row.orderNo}张</span>`
  617. }
  618. const unmarkMzFees = (row) => {
  619. ElMessageBox.confirm('是否将选中处方从医保处方中删除?', '提示', {
  620. type: 'warning',
  621. confirmButtonText: '确定',
  622. cancelButtonText: '取消',
  623. })
  624. .then(() => {
  625. deleteMzReceipt(row).then(() => {
  626. currentOrder.value.status = false
  627. ElMessage({
  628. message: '已成功删除医保处方。',
  629. type: 'success',
  630. duration: 2500,
  631. showClose: true,
  632. })
  633. })
  634. })
  635. .catch(() => {})
  636. }
  637. const settlement = (command) => {
  638. if (nullPatientId() || nullTimes()) {
  639. return
  640. }
  641. switch (command) {
  642. case 'preSettlement':
  643. mzPreSetl()
  644. break
  645. case 'realSettlement':
  646. chooseWhetherUseAcctFlag()
  647. break
  648. case 'cancelSettlement':
  649. revokeMzSettle()
  650. break
  651. }
  652. }
  653. const mzPreSetl = () => {
  654. const param = {
  655. staffId: store.state.user.info.code,
  656. patNo: patientId.value,
  657. times: times.value,
  658. mdtrtCertType: readCardData.mdtrtCertType,
  659. readCardResult: readCardData.readCardResult,
  660. readCardBizType: readCardData.readCardBizType,
  661. }
  662. outpatientPreSettlement(param).then((res) => {
  663. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  664. ElMessageBox.alert(message, '试算成功', {
  665. type: 'success',
  666. showCancelButton: false,
  667. }).then(() => {})
  668. })
  669. }
  670. const chooseWhetherUseAcctFlag = () => {
  671. ElMessageBox.confirm('是否使用个人账户?', '提示', {
  672. type: 'warning',
  673. confirmButtonText: '不使用',
  674. cancelButtonText: '使用',
  675. distinguishCancelAndClose: true,
  676. closeOnClickModal: false,
  677. closeOnPressEscape: false,
  678. }).then(() => {
  679. mzSettle('0')
  680. }).catch((action) => {
  681. if (action === 'cancel') {
  682. mzSettle('1')
  683. }
  684. })
  685. }
  686. const mzSettle = (useAcctFlag) => {
  687. const param = {
  688. patNo: patientId.value,
  689. times: times.value,
  690. acctUsedFlag: useAcctFlag,
  691. mdtrtCertType: readCardData.mdtrtCertType,
  692. readCardResult: readCardData.readCardResult,
  693. readCardBizType: readCardData.readCardBizType,
  694. }
  695. outpatientSettlement(param).then((res) => {
  696. clearReadCardData()
  697. const message = '医保处方总费用:' + res.totalCost + ',医保报销金额:' + res.fundPay + '。'
  698. ElMessageBox.alert(message, '结算成功', {
  699. type: 'success',
  700. showCancelButton: false,
  701. }).then(() => {})
  702. })
  703. }
  704. const revokeMzSettle = () => {
  705. const param = {
  706. patNo: patientId.value,
  707. times: times.value,
  708. }
  709. revokeOutpatientSettlement(param).then((res) => {
  710. ElMessageBox.alert('撤销门诊结算成功', '提示', {
  711. type: 'success',
  712. showCancelButton: false,
  713. })
  714. })
  715. }
  716. const clearinfo = () => {
  717. patientId.value = ''
  718. times.value = null
  719. unPaidReceipts.value = []
  720. psnBaseinfo.value = {}
  721. mzVisit.value = {}
  722. receipts.value = {}
  723. orderNos.value = []
  724. currentReceipts.value = []
  725. totalFee.value = null
  726. timesTable.value = null
  727. ordersTable.value = null
  728. currentOrder.value = {}
  729. spcChrDiseAccts.value = []
  730. }
  731. onMounted(() => {
  732. getMedTypesByFlag('clinic').then((res) => {
  733. medTypes.value = res
  734. })
  735. })
  736. return {
  737. medType,
  738. medTypes,
  739. admdvs,
  740. admdvses,
  741. patientId,
  742. readCardBizType,
  743. cptInsutype,
  744. receiptBoxStyle,
  745. tableHeight,
  746. showInsuinfo,
  747. psnBaseinfo,
  748. mzVisit,
  749. receipts,
  750. orderNos,
  751. currentReceipts,
  752. totalFee,
  753. ordersTable,
  754. timesTable,
  755. unPaidReceipts,
  756. spcChrDiseAccts,
  757. showSpcChrAccts,
  758. matnDises,
  759. showMatnDises,
  760. showInputDiags,
  761. searchMethod,
  762. searchMethods,
  763. diagTypes,
  764. diagItem,
  765. diags,
  766. afterReadCard,
  767. addDiag,
  768. deleteDiag,
  769. saveDiag,
  770. searchDiag,
  771. handleSelectDiag,
  772. clickTimes,
  773. colorStatus,
  774. clickOrderNo,
  775. handleClickInsuinfo,
  776. uploadFees,
  777. clearinfo,
  778. markMzFees,
  779. unmarkMzFees,
  780. registor,
  781. receiptsOpts,
  782. settlement,
  783. }
  784. },
  785. }
  786. </script>
  787. <style scoped>
  788. .receipt-title {
  789. width: 100%;
  790. text-align: center;
  791. font-weight: bold;
  792. font-size: 20px;
  793. height: 32px;
  794. line-height: 32px;
  795. }
  796. .receipt-head {
  797. display: flex;
  798. height: 22px;
  799. line-height: 22px;
  800. }
  801. .receipt-head > div {
  802. width: 33%;
  803. padding-right: 20px;
  804. }
  805. .receipt-item {
  806. display: flex;
  807. }
  808. .receipt-tips {
  809. margin: 0 0 0 64px;
  810. }
  811. .receipt-tips > span {
  812. margin-right: 15px;
  813. }
  814. .w75 {
  815. width: 70%;
  816. font-size: 15px;
  817. }
  818. .w75 * {
  819. font-size: 15px;
  820. }
  821. .w25 {
  822. width: 25%;
  823. font-size: 15px;
  824. color: #0f5e0f;
  825. font-weight: bold;
  826. }
  827. </style>