AdmRegistration.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div>
  4. <el-button icon="Location" type="primary" @click="beforeFetchAssigninfo"
  5. >定点信息
  6. </el-button>
  7. <el-button icon="Check" type="primary" @click="submitPatientInfo">
  8. 保存
  9. </el-button>
  10. <ReadCard
  11. :pat-no="patient.inpatientNo"
  12. biztype="01103"
  13. @success="afterReadCard"
  14. />
  15. <el-button icon="CreditCard" type="primary" @click="injurySicard">
  16. 工伤读社保卡
  17. </el-button>
  18. <el-button icon="Top" type="success" @click="checkRegisterDatetime"
  19. >医保入院登记
  20. </el-button>
  21. <el-button icon="Bottom" type="danger" @click="beforeCancelRegister"
  22. >撤销入院登记
  23. </el-button>
  24. <el-button icon="Coin" type="success" @click="xiangMuLuRuRouter"
  25. >项目录入
  26. </el-button>
  27. <generate-medicine-return-order />
  28. <el-button type="danger" @click="chronicDiseaseRegister"
  29. >慢病登记
  30. </el-button>
  31. </div>
  32. <div style="margin-bottom: 8px">
  33. <el-divider content-position="left" class="el-divider_shorter"
  34. >患者基本信息
  35. </el-divider>
  36. <el-descriptions :column="3" border>
  37. <el-descriptions-item>
  38. <template #label> 住院号</template>
  39. {{ patient.inpatientNo }}
  40. </el-descriptions-item>
  41. <el-descriptions-item>
  42. <template #label> 住院次数</template>
  43. {{ patient.admissTimes }}
  44. </el-descriptions-item>
  45. <el-descriptions-item>
  46. <template #label> 出生日期</template>
  47. {{ patient.birthDate }}
  48. </el-descriptions-item>
  49. <el-descriptions-item>
  50. <template #label>入院日期</template>
  51. {{ patient.admissDate }}
  52. </el-descriptions-item>
  53. <el-descriptions-item>
  54. <template #label> 病区</template>
  55. {{ patient.admissWardName }}
  56. </el-descriptions-item>
  57. <el-descriptions-item>
  58. <template #label> 入院诊断</template>
  59. <div
  60. style="width: 180px"
  61. class="ellipsis-text"
  62. :title="patient.admissDiagStr"
  63. >
  64. {{ patient.admissDiagStr }}
  65. </div>
  66. </el-descriptions-item>
  67. <el-descriptions-item>
  68. <template #label> 小科室</template>
  69. {{ patient.smallDeptName }}
  70. </el-descriptions-item>
  71. <el-descriptions-item>
  72. <template #label> 入院医生</template>
  73. {{ patient.admissPhysicianName }}
  74. </el-descriptions-item>
  75. <el-descriptions-item>
  76. <template #label> 登记日期</template>
  77. <el-date-picker
  78. v-model="patient.ybRegisterDate"
  79. placeholder="选择日期时间"
  80. style="width: 180px"
  81. type="datetime"
  82. @change="formatYbRegisterDate"
  83. ></el-date-picker>
  84. </el-descriptions-item>
  85. <el-descriptions-item>
  86. <template #label> 证件类型</template>
  87. <el-select
  88. v-model="patient.psnCertType"
  89. :clearable="true"
  90. placeholder="请选择"
  91. style="width: 180px"
  92. >
  93. <el-option
  94. v-for="item in psnCertTypes"
  95. :key="item.code"
  96. :label="item.name"
  97. :value="item.code"
  98. >
  99. <span style="color: #8492a6; font-size: 12px">{{
  100. item.code
  101. }}</span>
  102. <el-divider direction="vertical"></el-divider>
  103. <span>{{ item.name }}</span>
  104. </el-option>
  105. </el-select>
  106. </el-descriptions-item>
  107. <el-descriptions-item>
  108. <template #label>证件号码</template>
  109. <el-input
  110. v-model="patient.socialNo"
  111. style="width: 180px"
  112. clearable
  113. ></el-input>
  114. </el-descriptions-item>
  115. <el-descriptions-item>
  116. <template #label> 姓名</template>
  117. <el-input v-model="patient.name" style="width: 180px"></el-input>
  118. </el-descriptions-item>
  119. <el-descriptions-item>
  120. <template #label> 性别</template>
  121. <el-select v-model="patient.sex" placeholder=" " style="width: 180px">
  122. <el-option
  123. v-for="item in sexes"
  124. :key="item.code"
  125. :label="item.name"
  126. :value="item.code"
  127. ></el-option>
  128. </el-select>
  129. </el-descriptions-item>
  130. <el-descriptions-item>
  131. <template #label> 联系电话</template>
  132. <el-input v-model="patient.homeTel" style="width: 180px"></el-input>
  133. </el-descriptions-item>
  134. <el-descriptions-item>
  135. <template #label> 管床医生</template>
  136. <el-input
  137. v-model="patient.referPhysicianName"
  138. readonly
  139. @click="searchPhysician(1)"
  140. style="width: 180px"
  141. ></el-input>
  142. </el-descriptions-item>
  143. <el-descriptions-item>
  144. <template #label> 责任护士</template>
  145. <el-input
  146. v-model="patient.dutyNurseName"
  147. readonly
  148. @click="searchPhysician(2)"
  149. style="width: 180px"
  150. ></el-input>
  151. </el-descriptions-item>
  152. <el-descriptions-item>
  153. <template #label> 国籍</template>
  154. <el-select
  155. v-model="patient.country"
  156. style="width: 180px"
  157. :filterable="true"
  158. >
  159. <el-option
  160. v-for="item in countries"
  161. :key="item.code"
  162. :label="item.name"
  163. :value="item.code"
  164. >
  165. <span style="color: #8492a6; font-size: 12px">{{
  166. item.code
  167. }}</span>
  168. <el-divider direction="vertical"></el-divider>
  169. <span>{{ item.name }}</span>
  170. </el-option>
  171. </el-select>
  172. </el-descriptions-item>
  173. <el-descriptions-item>
  174. <template #label> 民族</template>
  175. <el-select
  176. v-model="patient.nation"
  177. style="width: 180px"
  178. :filterable="true"
  179. >
  180. <el-option
  181. v-for="item in nations"
  182. :key="item.code"
  183. :label="item.name"
  184. :value="item.code"
  185. >
  186. <span style="color: #8492a6; font-size: 12px">{{
  187. item.code
  188. }}</span>
  189. <el-divider direction="vertical"></el-divider>
  190. <span>{{ item.name }}</span>
  191. </el-option>
  192. </el-select>
  193. </el-descriptions-item>
  194. <el-descriptions-item>
  195. <template #label> 联系人姓名</template>
  196. <el-input
  197. v-model="patient.contactName"
  198. style="width: 180px"
  199. ></el-input>
  200. </el-descriptions-item>
  201. <el-descriptions-item>
  202. <template #label> 联系人关系</template>
  203. <el-select
  204. v-model="patient.contactRelation"
  205. style="width: 180px"
  206. :filterable="true"
  207. >
  208. <el-option
  209. v-for="item in relations"
  210. :key="item.code"
  211. :label="item.name"
  212. :value="item.code"
  213. >
  214. <span style="color: #8492a6; font-size: 12px">{{
  215. item.code
  216. }}</span>
  217. <el-divider direction="vertical"></el-divider>
  218. <span>{{ item.name }}</span>
  219. </el-option>
  220. </el-select>
  221. </el-descriptions-item>
  222. <el-descriptions-item>
  223. <template #label> 联系人地址</template>
  224. <el-input
  225. v-model="patient.contactAddrName"
  226. style="width: 180px"
  227. ></el-input>
  228. </el-descriptions-item>
  229. <el-descriptions-item>
  230. <template #label> 联系人电话</template>
  231. <el-input
  232. v-model="patient.contactPhone"
  233. style="width: 180px"
  234. ></el-input>
  235. </el-descriptions-item>
  236. <el-descriptions-item>
  237. <template #label> 参保地区</template>
  238. <el-cascader
  239. v-model="patient.admdvsCascader"
  240. clearable
  241. filterable
  242. placeholder="请选择"
  243. :options="allAdmdvses"
  244. :disabled="injuryMode"
  245. @change="handleAdmdvsChange"
  246. ></el-cascader>
  247. </el-descriptions-item>
  248. <el-descriptions-item>
  249. <template #label> 医疗类别</template>
  250. <el-select
  251. v-model="patient.medType"
  252. :clearable="true"
  253. placeholder="请选择"
  254. @change="handleSelectMedType"
  255. style="width: 180px"
  256. >
  257. <el-option
  258. v-for="item in medTypes"
  259. :key="item.code"
  260. :disabled="item.disabled"
  261. :label="item.name"
  262. :value="item.code"
  263. >
  264. <span style="color: #8492a6; font-size: 12px">{{
  265. item.code
  266. }}</span>
  267. <el-divider direction="vertical"></el-divider>
  268. <span>{{ item.name }}</span>
  269. </el-option>
  270. </el-select>
  271. </el-descriptions-item>
  272. <span v-if="patient.medType === '52'">
  273. <el-descriptions-item>
  274. <template #label>生育类别</template>
  275. <el-select
  276. v-model="patient.matnType"
  277. placeholder="请选择"
  278. style="width: 180px"
  279. >
  280. <el-option
  281. v-for="item in matnTypes"
  282. :key="item.code"
  283. :label="item.name"
  284. :value="item.code"
  285. ></el-option>
  286. </el-select>
  287. </el-descriptions-item>
  288. <el-descriptions-item>
  289. <template #label>是否晚育</template>
  290. <el-select
  291. v-model="patient.latechbFlag"
  292. placeholder="请选择"
  293. style="width: 180px"
  294. >
  295. <el-option label="否" value="0"></el-option>
  296. <el-option label="是" value="1"></el-option>
  297. </el-select>
  298. </el-descriptions-item>
  299. <el-descriptions-item>
  300. <template #label>是否早产</template>
  301. <el-select
  302. v-model="patient.pretFlag"
  303. placeholder="请选择"
  304. style="width: 180px"
  305. >
  306. <el-option label="否" value="0"></el-option>
  307. <el-option label="是" value="1"></el-option>
  308. </el-select>
  309. </el-descriptions-item>
  310. </span>
  311. <el-descriptions-item
  312. v-if="patient.medType === '2102' || patient.medType === '52'"
  313. >
  314. <template #label>患者病种</template>
  315. <el-input
  316. v-model="patient.diseName"
  317. readonly
  318. style="width: 180px"
  319. @click="openDiseInput"
  320. ></el-input>
  321. </el-descriptions-item>
  322. <el-descriptions-item>
  323. <template #label>就诊人群类型</template>
  324. <el-select
  325. v-model="expContent.MDTRT_GRP_TYPE"
  326. placeholder="普通患者无需填写"
  327. clearable
  328. style="width: 180px"
  329. >
  330. <el-option
  331. v-for="item in mdtrtGrpTypes"
  332. :key="item.key"
  333. :label="item.name"
  334. :value="item.code"
  335. ></el-option>
  336. </el-select>
  337. </el-descriptions-item>
  338. <el-descriptions-item>
  339. <template #label>外伤标志</template>
  340. <el-select
  341. v-model="expContent.TRUM_FLAG"
  342. placeholder="请选择"
  343. style="width: 180px"
  344. >
  345. <el-option label="否" value="0" key="trumFlag-0"></el-option>
  346. <el-option label="是" value="1" key="trumFlag-1"></el-option>
  347. </el-select>
  348. </el-descriptions-item>
  349. <el-descriptions-item>
  350. <template #label>涉及第三方标志</template>
  351. <el-select
  352. v-model="expContent.REL_TTP_FLAG"
  353. placeholder="请选择"
  354. style="width: 180px"
  355. >
  356. <el-option label="否" value="0" key="relTtpFlag-0"></el-option>
  357. <el-option label="是" value="1" key="relTtpFlag-1"></el-option>
  358. </el-select>
  359. </el-descriptions-item>
  360. <el-descriptions-item>
  361. <template #label>住院类型</template>
  362. <el-select
  363. v-model="expContent.IPT_TYPE"
  364. placeholder="请选择"
  365. style="width: 180px"
  366. >
  367. <el-option label="普通住院" value="1" key="iptType-1"></el-option>
  368. <el-option
  369. label="急诊或者请求住院"
  370. value="2"
  371. key="iptType-2"
  372. ></el-option>
  373. <el-option label="转院住院" value="3" key="iptType-3"></el-option>
  374. </el-select>
  375. </el-descriptions-item>
  376. <el-descriptions-item>
  377. <template #label>慢病类型</template>
  378. <div>{{ patient.crmName }}</div>
  379. </el-descriptions-item>
  380. </el-descriptions>
  381. </div>
  382. <div class="layout_flex_1-y layout_display_flex_y">
  383. <el-divider content-position="left" class="el-divider_shorter">
  384. 医保入院诊断(*自费患者无需填写*)
  385. <el-button
  386. circle
  387. icon="Plus"
  388. title="添加入院诊断"
  389. type="primary"
  390. @click="openDiagDialog"
  391. ></el-button>
  392. <el-button
  393. :disabled="zyInYbDiags.length === 0"
  394. circle
  395. icon="Check"
  396. title="保存入院诊断"
  397. type="success"
  398. @click="saveYbDiags"
  399. ></el-button>
  400. </el-divider>
  401. <div class="layout_flex_1-y">
  402. <el-table :data="zyInYbDiags" height="100%" stripe>
  403. <el-table-column label="诊断序号" prop="diagNo"></el-table-column>
  404. <el-table-column label="诊断属性" prop="property"></el-table-column>
  405. <el-table-column label="诊断编码" prop="icdCode"></el-table-column>
  406. <el-table-column label="诊断名称" prop="icdText"></el-table-column>
  407. <el-table-column label="诊断类别">
  408. <template #default="scope">
  409. {{ getDiagTypeName(scope.row.diagType) }}
  410. </template>
  411. </el-table-column>
  412. <el-table-column label="诊断时间" prop="opDate"></el-table-column>
  413. <el-table-column label="操作">
  414. <template #default="scope">
  415. <el-button
  416. circle
  417. icon="Delete"
  418. type="danger"
  419. @click="deleteYbDiag(scope.$index)"
  420. ></el-button>
  421. </template>
  422. </el-table-column>
  423. </el-table>
  424. </div>
  425. </div>
  426. </div>
  427. <Assignmentinfo
  428. v-if="showAssigninfo"
  429. :admdvs="patient.admdvs"
  430. :social-no="patient.socialNo"
  431. @close="showAssigninfo = false"
  432. />
  433. <el-dialog
  434. v-model="showSearchSpecialDiag"
  435. :close-on-click-modal="false"
  436. title="医保患者病种录入"
  437. width="60%"
  438. >
  439. <div style="margin: -16px 0 4px 2px; height: 22px; line-height: 22px">
  440. 患者当前病种:
  441. <span
  442. style="
  443. padding: 2px 6px;
  444. background: #005279;
  445. border-radius: 4px;
  446. color: white;
  447. "
  448. >
  449. {{
  450. patient.diseCode ? patient.diseCode + " | " + patient.diseName : "无"
  451. }}
  452. </span>
  453. </div>
  454. <el-tag>可选病种</el-tag>&nbsp;&nbsp;
  455. <el-input
  456. v-model="specialDiagName"
  457. clearable
  458. placeholder="请输入病种名称"
  459. style="width: 260px"
  460. ></el-input>
  461. <el-table
  462. :data="cptSpecialDiags.slice((currentPage - 1) * 10, currentPage * 10)"
  463. height="400"
  464. highlight-current-row
  465. stripe
  466. >
  467. <el-table-column label="病种编码" prop="newCode"></el-table-column>
  468. <el-table-column label="病种名称" prop="newName"></el-table-column>
  469. <el-table-column label="限额方式" prop="limitWay"></el-table-column>
  470. <el-table-column
  471. label="限额额度计算方式"
  472. prop="limitAmountCalculateWay"
  473. ></el-table-column>
  474. <el-table-column label="疾病限额" prop="limitAmount"></el-table-column>
  475. <el-table-column>
  476. <template #default="scope">
  477. <el-button type="primary" @click="addDiseInfo(scope.row)"
  478. >选择此病种
  479. </el-button>
  480. </template>
  481. </el-table-column>
  482. </el-table>
  483. <el-pagination
  484. :current-page="currentPage"
  485. :page-size="10"
  486. :total="cptSpecialDiags.length"
  487. :layout="'total, prev, pager, next, jumper'"
  488. style="margin-top: 6px"
  489. @current-change="handleCurrentChange"
  490. ></el-pagination>
  491. </el-dialog>
  492. <el-dialog
  493. v-model="showAdmissApplyForm"
  494. title="医保入院登记申请"
  495. width="500px"
  496. >
  497. <div style="margin-bottom: 20px">
  498. 登记时间:
  499. <el-date-picker
  500. v-model="admissApply.admissDatetime"
  501. placeholder="请选择医保登记开始时间"
  502. type="datetime"
  503. ></el-date-picker>
  504. </div>
  505. <el-input
  506. v-model="admissApply.inputComment"
  507. placeholder="请输入申请理由"
  508. type="textarea"
  509. ></el-input>
  510. <div style="width: 450px; text-align: right; margin-top: 30px">
  511. <el-button icon="Close" type="info" @click="cancelAdmissApply"
  512. >取消
  513. </el-button>
  514. <el-button icon="Check" type="success" @click="confirmAdmissApply"
  515. >提交
  516. </el-button>
  517. </div>
  518. </el-dialog>
  519. <el-dialog v-model="showPsnInsuinfo" title="人员信息" width="65%">
  520. <el-tag>{{ injuryMode ? "工伤信息" : "参保信息" }}</el-tag>
  521. <div v-if="injuryMode">
  522. <el-table
  523. :data="injuryinfo"
  524. height="180"
  525. stripe
  526. @row-click="handleClickInjuryinfo"
  527. >
  528. <el-table-column label="个人唯一识别码" prop="psn_no" width="100"></el-table-column>
  529. <el-table-column label="单位唯一识别码" prop="emp_no" width="100"></el-table-column>
  530. <el-table-column label="单位名称" prop="emp_name" width="100"></el-table-column>
  531. <el-table-column label="证件号码" prop="certno" width="150"></el-table-column>
  532. <el-table-column label="姓名" prop="psn_name" ></el-table-column>
  533. <el-table-column label="性别" prop="gend" :formatter="(row) => formatGender(row.gend)"></el-table-column>
  534. <el-table-column label="年龄" prop="age"></el-table-column>
  535. <el-table-column label="工伤人员类别" prop="psn_type" :formatter="(row) => formatInjuryPersonType(row.psn_type)"></el-table-column>
  536. <el-table-column label="统筹区号" prop="insu_admdvs"></el-table-column>
  537. <el-table-column label="在院状态" prop="inhosp_stas" :formatter="(row) => formatInHospStatus(row.inhosp_stas)"></el-table-column>
  538. <el-table-column label="待遇不享受原因" prop="trt_chk_rslt" width="100"></el-table-column>
  539. <el-table-column label="工伤诊断结论" prop="exam_ccls" width="150"></el-table-column>
  540. <el-table-column label="证件类型" prop="certificate_type" :formatter="(row) => formatCertType(row.certificate_type)"></el-table-column>
  541. <el-table-column label="出生日期" prop="birthday"></el-table-column>
  542. </el-table>
  543. </div>
  544. <div v-else>
  545. <el-table
  546. :data="psnBaseinfo.insuinfo"
  547. height="180"
  548. stripe
  549. @row-click="handleClickInsuinfo"
  550. >
  551. <el-table-column label="余额" prop="balc"></el-table-column>
  552. <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
  553. <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
  554. <el-table-column
  555. label="参保状态"
  556. prop="psnInsuStasName"
  557. ></el-table-column>
  558. <el-table-column
  559. label="个人参保日期"
  560. prop="psnInsuDate"
  561. ></el-table-column>
  562. <el-table-column
  563. label="暂停参保日期"
  564. prop="pausInsuDate"
  565. ></el-table-column>
  566. <el-table-column
  567. label="公务员标志"
  568. prop="cvlservFlagName"
  569. ></el-table-column>
  570. <el-table-column
  571. label="参保地医保区划"
  572. prop="insuplcAdmdvs"
  573. ></el-table-column>
  574. <el-table-column
  575. label="参保地名称"
  576. prop="insuplcAdmdvsName"
  577. ></el-table-column>
  578. <el-table-column label="单位名称" prop="empName"></el-table-column>
  579. </el-table>
  580. <div style="height: 16px"></div>
  581. <el-tag>身份信息</el-tag>
  582. <el-table :data="psnBaseinfo.idetinfo" height="180" stripe>
  583. <el-table-column
  584. label="人员身份类别"
  585. prop="psnIdetTypeName"
  586. ></el-table-column>
  587. <el-table-column
  588. label="人员类别等级"
  589. prop="psnTypeLv"
  590. ></el-table-column>
  591. <el-table-column label="备注" prop="memo"></el-table-column>
  592. <el-table-column label="开始时间" prop="begntime"></el-table-column>
  593. <el-table-column label="结束时间" prop="endtime"></el-table-column>
  594. </el-table>
  595. </div>
  596. </el-dialog>
  597. <Search
  598. v-if="searchParams.showSearch"
  599. :med-type="patient.medType"
  600. :target="searchParams.target"
  601. :title="searchParams.title"
  602. :show-emp-dept="searchParams.target === 'physician'"
  603. :show-yb-code="searchParams.target === 'physician'"
  604. @close="searchParams.showSearch = false"
  605. @click-item="handleClickSearchItem"
  606. />
  607. </template>
  608. <script setup>
  609. import {
  610. computed,
  611. onActivated,
  612. onDeactivated,
  613. onMounted,
  614. reactive,
  615. ref,
  616. watchEffect,
  617. } from "vue";
  618. import {
  619. getZyInYbDiags,
  620. saveZyInYbDiags,
  621. submitSiPatientInfo,
  622. } from "@/api/inpatient/patient";
  623. import { getAllSpecialDiags } from "@/api/inpatient/dictionary";
  624. import {
  625. fetchCountryDictionary,
  626. fetchNationDictionary,
  627. fetchRelationDictionary,
  628. } from "@/api/dictionary/fetch-dictionaries";
  629. import { diagTypes, sexes } from "@/data";
  630. import { allAdmdvses } from "@/data/admdvs";
  631. import { nullPatient } from "@/utils/validate";
  632. import { ElMessage, ElMessageBox } from "element-plus";
  633. import {
  634. admissRegister,
  635. revokeAdmission,
  636. } from "@/api/medical-insurance/si-inpatient";
  637. import { formatDatetime, getDatetime } from "@/utils/date";
  638. import { clone } from "@/utils/clone";
  639. import {
  640. getMatnTypes,
  641. getMedTypesByFlag,
  642. getPsnCertTypes,
  643. } from "@/api/medical-insurance/si-dict";
  644. import {
  645. checkRegisterDate,
  646. obtainBasicPersonInfo,
  647. } from "@/api/medical-insurance/si-query";
  648. import {
  649. inpatientRegister,
  650. revokeInpatientRegister,
  651. employeeInfoInquiry,
  652. } from "@/api/medical-insurance/si-injury";
  653. import {
  654. selectAdmissApply,
  655. submitAdmissApply,
  656. } from "@/api/medical-insurance/si-admiss-apply";
  657. import { baseinfo } from "@/data/inpatient";
  658. import XmlrV2 from "@/components/xmlr/index.vue";
  659. import Assignmentinfo from "@/components/medical-insurance/assigninfo/Index.vue";
  660. import Search from "@/components/search/Index.vue";
  661. import ReadCard from "@/components/medical-insurance/readcard/Index.vue";
  662. import GenerateMedicineReturnOrder from "@/components/medical-insurance/medicine-return-order/GenerateMedicineReturnOrder.vue";
  663. import { CyMessageBox } from "@/utils/cy-message-box";
  664. import sleep from "@/utils/sleep";
  665. import XEUtils from "xe-utils";
  666. import router from "@/router";
  667. import { useMedinsStore } from "@/pinia/medins-store";
  668. import { useDialog } from "@/components/cy/CyDialog/index";
  669. const patient = computed(() => {
  670. const patientInfo = baseinfo();
  671. const pContent = patientInfo.expContent
  672. ? JSON.parse(patientInfo.expContent)
  673. : {};
  674. expContent.MDTRT_GRP_TYPE = pContent.MDTRT_GRP_TYPE;
  675. expContent.TRUM_FLAG = pContent.TRUM_FLAG;
  676. expContent.REL_TTP_FLAG = pContent.REL_TTP_FLAG;
  677. expContent.IPT_TYPE = pContent.IPT_TYPE;
  678. return patientInfo;
  679. });
  680. const fetchZyYbDiags = () => {
  681. if (nullPatient()) {
  682. return;
  683. }
  684. getZyInYbDiags(patient.value.inpatientNo, patient.value.admissTimes).then(
  685. res => {
  686. zyInYbDiags.value = res;
  687. }
  688. );
  689. };
  690. const medinsStore = useMedinsStore();
  691. const injuryMode = computed(() => {
  692. return medinsStore.isInjuryMode;
  693. });
  694. const handleSelectMedType = val => {
  695. medinsStore.setInjuryMode((val === "gs21") || (val === "gs22") || (val === "gs23"));
  696. };
  697. const actived = ref(false);
  698. onActivated(() => {
  699. actived.value = true;
  700. });
  701. onDeactivated(() => {
  702. actived.value = false;
  703. });
  704. const currentPatNo = ref(null);
  705. watchEffect(() => {
  706. if (actived.value) {
  707. if (
  708. patient.value.inpatientNo &&
  709. patient.value.inpatientNo !== currentPatNo.value
  710. ) {
  711. currentPatNo.value = patient.value.inpatientNo;
  712. fetchZyYbDiags();
  713. }
  714. }
  715. });
  716. const searchParams = reactive({
  717. showSearch: false,
  718. title: "",
  719. target: "",
  720. });
  721. const psnCertTypes = ref([]);
  722. const medTypes = ref([]);
  723. const countries = ref([]);
  724. const nations = ref([]);
  725. const relations = ref([]);
  726. const diagItem = ref({});
  727. const showSearchSpecialDiag = ref(false);
  728. const zyInYbDiags = ref([]);
  729. const specialDiags = ref([]);
  730. const specialDiagName = ref("");
  731. const cptSpecialDiags = computed(() => {
  732. return specialDiags.value.filter(item => {
  733. return (
  734. (item.oldName + "" + item.newName).indexOf(specialDiagName.value) !== -1
  735. );
  736. });
  737. });
  738. const matnTypes = ref([]);
  739. const expContent = reactive({
  740. MDTRT_GRP_TYPE: "",
  741. TRUM_FLAG: "",
  742. REL_TTP_FLAG: "",
  743. IPT_TYPE: "",
  744. });
  745. const mdtrtGrpTypes = [
  746. { code: "1", name: "新冠肺炎确诊患者", key: "mdtrtGrpTypes-1" },
  747. { code: "2", name: "其他国家突发公共事件", key: "mdtrtGrpTypes-2" },
  748. { code: "3", name: "新冠肺炎疑似患者", key: "mdtrtGrpTypes-3" },
  749. { code: "4", name: "无症状感染者", key: "mdtrtGrpTypes-4" },
  750. ];
  751. const handleAdmdvsChange = val => {
  752. patient.value.admdvs = val[1];
  753. };
  754. const openDiagDialog = () => {
  755. if (nullPatient()) {
  756. return;
  757. }
  758. if (!patient.value.medType) {
  759. ElMessage({
  760. message: "请先选择医疗类别!",
  761. type: "warning",
  762. duration: 2500,
  763. showClose: true,
  764. });
  765. return;
  766. }
  767. searchParams.title = "医保入院诊断";
  768. searchParams.target = injuryMode.value ? "injurydiag" : "diag";
  769. searchParams.showSearch = true;
  770. };
  771. const openDiseInput = () => {
  772. getAllSpecialDiags(patient.value.medType).then(res => {
  773. specialDiags.value = res;
  774. showSearchSpecialDiag.value = true;
  775. });
  776. };
  777. const addDiseInfo = row => {
  778. patient.value.diseCode = row.newCode;
  779. patient.value.diseName = row.newName;
  780. showSearchSpecialDiag.value = false;
  781. };
  782. const getDiagTypeName = val => {
  783. for (let i = 0; i < diagTypes.length; i++) {
  784. if (diagTypes[i].code === val) {
  785. return diagTypes[i].name;
  786. }
  787. }
  788. };
  789. const deleteYbDiag = index => {
  790. zyInYbDiags.value.splice(index, 1);
  791. for (let i = 0; i < zyInYbDiags.value.length; i++) {
  792. const element = zyInYbDiags.value[i];
  793. element.diagNo = i + 1;
  794. if (i === 0) {
  795. element.property = "主要诊断";
  796. }
  797. }
  798. };
  799. const saveYbDiags = () => {
  800. const param = {
  801. inpatientNo: patient.value.inpatientNo,
  802. admissTimes: patient.value.admissTimes,
  803. diags: zyInYbDiags.value,
  804. };
  805. saveZyInYbDiags(param).then(() => {
  806. ElMessage({
  807. message: "医保入院诊断保存成功。",
  808. type: "success",
  809. duration: 2500,
  810. showClose: true,
  811. });
  812. showSearchSpecialDiag.value = false;
  813. });
  814. };
  815. const submitPatientInfo = () => {
  816. if (nullPatient()) {
  817. return;
  818. }
  819. ElMessageBox.confirm("确定保存患者信息?", "提示", {
  820. confirmButtonText: "确定",
  821. cancelButtonText: "取消",
  822. type: "warning",
  823. }).then(() => {
  824. patient.value.expContent = JSON.stringify(expContent);
  825. submitSiPatientInfo({
  826. patient: patient.value,
  827. diags: zyInYbDiags.value,
  828. }).then(() => {
  829. ElMessage({
  830. message: "保存患者信息成功。",
  831. type: "success",
  832. duration: 2500,
  833. showClose: true,
  834. });
  835. });
  836. });
  837. };
  838. const searchPhysician = flag => {
  839. switch (flag) {
  840. case 1:
  841. searchParams.title = "管床医生";
  842. break;
  843. case 2:
  844. searchParams.title = "责任护士";
  845. break;
  846. }
  847. searchParams.target = "physician";
  848. searchParams.showSearch = true;
  849. };
  850. const handleClickSearchItem = item => {
  851. if (searchParams.target === "physician") {
  852. if (!item.ybCode) {
  853. ElMessage({
  854. message: "请选择有医保赋码的人员。",
  855. type: "warning",
  856. duration: 2500,
  857. showClose: true,
  858. });
  859. return;
  860. }
  861. switch (searchParams.title) {
  862. case "管床医生":
  863. if (!item.ybCode.startsWith("D")) {
  864. ElMessage({
  865. message: "医师医保编码首字母为D,请重新选择。",
  866. type: "warning",
  867. duration: 2500,
  868. showClose: true,
  869. });
  870. return;
  871. }
  872. patient.value.referPhysician = item.code;
  873. patient.value.referPhysicianName = item.name;
  874. break;
  875. case "责任护士":
  876. if (!item.ybCode.startsWith("N")) {
  877. ElMessage({
  878. message: "护士医保编码首字母为N,请重新选择。",
  879. type: "warning",
  880. duration: 2500,
  881. showClose: true,
  882. });
  883. return;
  884. }
  885. patient.value.dutyNurse = item.code;
  886. patient.value.dutyNurseName = item.name;
  887. break;
  888. }
  889. } else if (
  890. searchParams.target === "diag" ||
  891. searchParams.target === "injurydiag"
  892. ) {
  893. diagItem.value.icdCode = item.icdCode;
  894. diagItem.value.icdText = item.icdText;
  895. diagItem.value.diagType = item.diagType;
  896. diagItem.value.property =
  897. zyInYbDiags.value.length === 0 ? "主要诊断" : "次要诊断";
  898. diagItem.value.diagNo = zyInYbDiags.value.length + 1;
  899. diagItem.value.opDate = getDatetime();
  900. zyInYbDiags.value.push(clone(diagItem.value));
  901. }
  902. searchParams.showSearch = false;
  903. };
  904. const afterReadCard = result => {
  905. patient.value.mdtrtCertType = result.mdtrtCertType;
  906. patient.value.readCardResult = result.readCardResult;
  907. patient.value.busCardInfo = result.busCardInfo;
  908. patient.value.readCardBizType = result.readCardBizType;
  909. };
  910. const formatYbRegisterDate = () => {
  911. patient.value.ybRegisterDate = formatDatetime(patient.value.ybRegisterDate);
  912. };
  913. const admissApply = ref({});
  914. const showAdmissApplyForm = ref(false);
  915. // 新增:用于存储工伤读卡接口返回结果
  916. const injurySicardResult = ref({});
  917. const injurySicard = async () => {
  918. if (nullPatient()) {
  919. return;
  920. }
  921. if (!patient.value.medType) {
  922. ElMessage({
  923. message: "请先选择医疗类别!",
  924. type: "warning",
  925. duration: 2500,
  926. showClose: true,
  927. });
  928. return;
  929. }
  930. if (!(patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  931. ElMessage({
  932. message: "请先选择工伤相关的医疗类别!",
  933. type: "warning",
  934. duration: 2500,
  935. showClose: true,
  936. });
  937. return;
  938. }
  939. const loading = ElMessage({
  940. message: '正在读取社保卡,请稍候...',
  941. type: 'info',
  942. duration: 0,
  943. showClose: true,
  944. grouping: true,
  945. });
  946. try {
  947. const response = await fetch('http://130.150.161.72:9206/thyy/api/public/injury/workinjury', {
  948. method: 'POST',
  949. headers: {
  950. 'Content-Type': 'application/json',
  951. },
  952. body: JSON.stringify({
  953. action: 'transaction',
  954. transactionName: 'ReadCard',
  955. }),
  956. });
  957. const result = await response.json();
  958. console.log("patient.value00000000000000000000",patient.value)
  959. console.log("result1111111111111111111111111111",result)
  960. if (result && result.code === 1 && result.data) {
  961. if(result.data && result.data.data && result.data.data.certno && (result.data.data.certno !== patient.value.socialNo)) {
  962. ElMessage({
  963. message: '人证不符,请检查身份证号码!',
  964. type: 'error',
  965. duration: 2500,
  966. showClose: true,
  967. });
  968. return
  969. }
  970. if(result.data && result.data.data && result.data.data.psn_name && (result.data.data.psn_name !== patient.value.name)) {
  971. ElMessage({
  972. message: '人证不符,请检查姓名!',
  973. type: 'error',
  974. duration: 2500,
  975. showClose: true,
  976. });
  977. return
  978. }
  979. // 新增:调用 addWorkInjuryPatientRelation
  980. try {
  981. // 解析 exam_ccls 字段
  982. let QualificationId = '';
  983. let injury_part_desc = '';
  984. let visit_type = '';
  985. if (result.data.data.exam_ccls) {
  986. // 格式:^工伤医疗费资格审核信息ID|受伤部位信息描述|就诊类型^
  987. const match = result.data.data.exam_ccls.match(/^\^?(.*?)\|(.*?)\|(.*?)\^?$/);
  988. if (match) {
  989. QualificationId = match[1];
  990. injury_part_desc = match[2];
  991. visit_type = match[3];
  992. }
  993. }
  994. await fetch('http://130.150.161.72:9206/thyy/api/public/injury/addWorkInjuryPatientRelation', {
  995. method: 'POST',
  996. headers: {
  997. 'Content-Type': 'application/json',
  998. },
  999. body: JSON.stringify({
  1000. inpatient_no:patient.value.inpatientNo,
  1001. admiss_times:patient.value.admissTimes,
  1002. psn_no:result.data.data.psn_no,
  1003. emp_no:result.data.data.emp_no,
  1004. emp_name:result.data.data.emp_name,
  1005. certno:result.data.data.certno,
  1006. psn_name:result.data.data.psn_name,
  1007. gend:result.data.data.gend,
  1008. age:result.data.data.age,
  1009. psn_type:result.data.data.psn_type,
  1010. insu_admdvs:result.data.data.insu_admdvs,
  1011. inhosp_stas:result.data.data.inhosp_stas,
  1012. trt_chk_rslt:result.data.data.trt_chk_rslt,
  1013. exam_ccls:result.data.data.exam_ccls,
  1014. certificate_type:result.data.data.certificate_type,
  1015. birthday:result.data.data.birthday,
  1016. QualificationId,
  1017. injury_part_desc,
  1018. visit_type
  1019. }),
  1020. });
  1021. } catch (e) {
  1022. ElMessage({
  1023. message: '工伤读社保卡接口异常',
  1024. type: 'error',
  1025. duration: 2500,
  1026. showClose: true,
  1027. });
  1028. return
  1029. }
  1030. injurySicardResult.value = result.data;
  1031. patient.value.mdtrtCertType = 'injurySicard';
  1032. patient.value.readCardResult = injurySicardResult.value;
  1033. patient.value.readCardBizType = '01103';
  1034. console.log("patient.value111111111111111111111111",patient.value)
  1035. ElMessage({
  1036. message: '工伤读社保卡成功',
  1037. type: 'success',
  1038. duration: 2500,
  1039. showClose: true,
  1040. });
  1041. } else {
  1042. ElMessage({
  1043. message: result.message || '工伤读社保卡失败',
  1044. type: 'error',
  1045. duration: 2500,
  1046. showClose: true,
  1047. });
  1048. }
  1049. } catch (error) {
  1050. ElMessage({
  1051. message: '工伤读社保卡接口异常',
  1052. type: 'error',
  1053. duration: 2500,
  1054. showClose: true,
  1055. });
  1056. } finally {
  1057. loading.close && loading.close();
  1058. }
  1059. };
  1060. const checkRegisterDatetime = () => {
  1061. if (nullPatient()) {
  1062. return;
  1063. }
  1064. if(!(patient.value && patient.value.mdtrtCertType && patient.value.readCardResult)) {
  1065. ElMessage({
  1066. message: "请进行读卡操作!",
  1067. type: "warning",
  1068. duration: 2600,
  1069. showClose: true,
  1070. });
  1071. return;
  1072. }
  1073. if(patient.value.mdtrtCertType === "sicard"){
  1074. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1075. ElMessage({
  1076. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1077. type: "warning",
  1078. duration: 2500,
  1079. showClose: true,
  1080. });
  1081. return;
  1082. }
  1083. if(!(patient.value.name && patient.value.readCardResult && patient.value.readCardResult.includes(patient.value.name))) {
  1084. // 社保卡读卡成功,但姓名不匹配!
  1085. ElMessage({
  1086. message: "社保卡读卡成功,但姓名不匹配!",
  1087. type: "warning",
  1088. duration: 2500,
  1089. showClose: true,
  1090. });
  1091. return;
  1092. }
  1093. if(!(patient.value.socialNo && patient.value.readCardResult && patient.value.readCardResult.includes(patient.value.socialNo))) {
  1094. // 社保卡读卡成功,但身份证不匹配!
  1095. ElMessage({
  1096. message: "社保卡读卡成功,但身份证不匹配!",
  1097. type: "warning",
  1098. duration: 2500,
  1099. showClose: true,
  1100. });
  1101. return;
  1102. }
  1103. }else if(patient.value.mdtrtCertType === "qrcode"){
  1104. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1105. ElMessage({
  1106. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1107. type: "warning",
  1108. duration: 2500,
  1109. showClose: true,
  1110. });
  1111. return;
  1112. }
  1113. // 电子凭证读卡逻辑 - JSON格式数据
  1114. try {
  1115. const cardData = JSON.parse(patient.value.readCardResult);
  1116. if (!(patient.value.name && cardData.userName === patient.value.name)) {
  1117. ElMessage({
  1118. message: "电子凭证读卡成功,但姓名不匹配!",
  1119. type: "warning",
  1120. duration: 2500,
  1121. showClose: true,
  1122. });
  1123. return;
  1124. }
  1125. if (!(patient.value.socialNo && cardData.idNo === patient.value.socialNo)) {
  1126. ElMessage({
  1127. message: "电子凭证读卡成功,但身份证不匹配!",
  1128. type: "warning",
  1129. duration: 2500,
  1130. showClose: true,
  1131. });
  1132. return;
  1133. }
  1134. } catch (error) {
  1135. ElMessage({
  1136. message: "电子凭证读卡数据格式错误!",
  1137. type: "error",
  1138. duration: 2500,
  1139. showClose: true,
  1140. });
  1141. return;
  1142. }
  1143. }else if(patient.value.mdtrtCertType === "face"){
  1144. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1145. ElMessage({
  1146. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1147. type: "warning",
  1148. duration: 2500,
  1149. showClose: true,
  1150. });
  1151. return;
  1152. }
  1153. // 刷脸读卡逻辑 - JSON格式数据
  1154. try {
  1155. const cardData = JSON.parse(patient.value.readCardResult);
  1156. if (!(patient.value.name && cardData.userName === patient.value.name)) {
  1157. ElMessage({
  1158. message: "刷脸读卡成功,但姓名不匹配!",
  1159. type: "warning",
  1160. duration: 2500,
  1161. showClose: true,
  1162. });
  1163. return;
  1164. }
  1165. if (!(patient.value.socialNo && cardData.idNo === patient.value.socialNo)) {
  1166. ElMessage({
  1167. message: "刷脸读卡成功,但身份证不匹配!",
  1168. type: "warning",
  1169. duration: 2500,
  1170. showClose: true,
  1171. });
  1172. return;
  1173. }
  1174. } catch (error) {
  1175. ElMessage({
  1176. message: "刷脸读卡数据格式错误!",
  1177. type: "error",
  1178. duration: 2500,
  1179. showClose: true,
  1180. });
  1181. return;
  1182. }
  1183. }
  1184. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1185. if(!(zyInYbDiags && zyInYbDiags.length && zyInYbDiags.length > 0)) {
  1186. ElMessage({
  1187. message: "医保入院诊断,不能为空!",
  1188. type: "warning",
  1189. duration: 2500,
  1190. showClose: true,
  1191. });
  1192. return;
  1193. }
  1194. }
  1195. patient.value.expContent = JSON.stringify(expContent);
  1196. submitSiPatientInfo({
  1197. patient: patient.value,
  1198. diags: zyInYbDiags.value,
  1199. }).then(() => {
  1200. checkRegisterDate(
  1201. patient.value.inpatientNo,
  1202. patient.value.admissTimes
  1203. ).then(() => {
  1204. selectAdmissApply(patient.value).then(res => {
  1205. if (null === res.status) {
  1206. admissApply.value.patNo = patient.value.inpatientNo;
  1207. admissApply.value.times = patient.value.admissTimes;
  1208. admissApply.value.ledgerSn = patient.value.ledgerSn;
  1209. admissApply.value.admissDatetime = patient.value.ybRegisterDate;
  1210. admissApply.value.inputComment = "人证相符。";
  1211. showAdmissApplyForm.value = true;
  1212. } else {
  1213. switch (res.status) {
  1214. case 0:
  1215. ElMessageBox.alert(
  1216. "医保科尚未处理此患者的医保入院申请,请耐心等候或者致电医保科(内线电话:2102)。",
  1217. "提示",
  1218. {
  1219. type: "warning",
  1220. }
  1221. );
  1222. break;
  1223. case 1:
  1224. getPsnInsuinfo();
  1225. break;
  1226. case 2:
  1227. ElMessageBox.confirm(
  1228. "医保科驳回了此患者的医保入院申请,驳回意见为【" +
  1229. res.handleComment +
  1230. "】",
  1231. "提示",
  1232. {
  1233. type: "error",
  1234. distinguishCancelAndClose: true,
  1235. confirmButtonText: "我知道了",
  1236. cancelButtonText: "重新提交",
  1237. showCancelButton: true,
  1238. }
  1239. ).catch(action => {
  1240. if (action === "cancel") {
  1241. admissApply.value.patNo = patient.value.inpatientNo;
  1242. admissApply.value.times = patient.value.admissTimes;
  1243. admissApply.value.ledgerSn = patient.value.ledgerSn;
  1244. admissApply.value.admissDatetime =
  1245. patient.value.ybRegisterDate;
  1246. showAdmissApplyForm.value = true;
  1247. }
  1248. });
  1249. break;
  1250. }
  1251. }
  1252. });
  1253. });
  1254. });
  1255. };
  1256. const cancelAdmissApply = () => {
  1257. admissApply.value = {};
  1258. showAdmissApplyForm.value = false;
  1259. };
  1260. const confirmAdmissApply = () => {
  1261. if (!admissApply.value.admissDatetime) {
  1262. ElMessage({
  1263. message: "医保入院登记时间不能为空!",
  1264. type: "error",
  1265. duration: 2500,
  1266. showClose: true,
  1267. });
  1268. return;
  1269. }
  1270. if (!admissApply.value.inputComment) {
  1271. ElMessage({
  1272. message: "申请理由不能为空!",
  1273. type: "error",
  1274. duration: 2500,
  1275. showClose: true,
  1276. });
  1277. return;
  1278. }
  1279. admissApply.value.admissDatetime = formatDatetime(
  1280. admissApply.value.admissDatetime
  1281. );
  1282. ElMessageBox.confirm("是否确认提交入院登记申请?", "提示", {
  1283. type: "warning",
  1284. confirmButtonText: "确定",
  1285. cancelButtonText: "取消",
  1286. })
  1287. .then(() => {
  1288. submitAdmissApply(admissApply.value).then(res => {
  1289. ElMessage({
  1290. message: res,
  1291. type: "success",
  1292. duration: 2500,
  1293. showClose: true,
  1294. });
  1295. showAdmissApplyForm.value = false;
  1296. });
  1297. })
  1298. .catch(() => {});
  1299. };
  1300. const psnBaseinfo = ref({});
  1301. const showPsnInsuinfo = ref(false);
  1302. const injuryinfo = ref([]);
  1303. const getPsnInsuinfo = () => {
  1304. if (nullPatient()) {
  1305. return;
  1306. }
  1307. if (!patient.value.medType) {
  1308. ElMessage({
  1309. message: "请选择患者的医疗类别!",
  1310. type: "warning",
  1311. showClose: true,
  1312. });
  1313. return;
  1314. }
  1315. if (injuryMode.value) {
  1316. //employeeInfoInquiry(patient.value).then(res => {
  1317. //injuryinfo.value = res;
  1318. injuryinfo.value = [patient.value.readCardResult.data];
  1319. showPsnInsuinfo.value = true;
  1320. //});
  1321. } else {
  1322. const param = {
  1323. medType: patient.value.medType,
  1324. patNo: patient.value.inpatientNo,
  1325. times: patient.value.admissTimes,
  1326. ledgerSn: patient.value.ledgerSn,
  1327. socialNo: patient.value.socialNo,
  1328. name: patient.value.name,
  1329. admdvs: patient.value.admdvs,
  1330. psnCertType: patient.value.psnCertType,
  1331. needSaving: 1,
  1332. };
  1333. obtainBasicPersonInfo(param).then(res => {
  1334. patient.value.psnNo = res.psnNo;
  1335. psnBaseinfo.value = res;
  1336. showPsnInsuinfo.value = true;
  1337. if (XEUtils.toNumber(res.gend) !== patient.value.sex) {
  1338. sleep(800).then(() => {
  1339. CyMessageBox.alert({
  1340. message: `患者医保性别<span style="color:red">${res.gendName}</span>,与HIS信息不一致,请核实。`,
  1341. type: "warning",
  1342. dangerouslyUseHTMLString: true,
  1343. });
  1344. });
  1345. }
  1346. });
  1347. }
  1348. };
  1349. const handleClickInjuryinfo = row => {
  1350. ElMessageBox.confirm("确定进行工伤入院登记?", "提示", {
  1351. type: "warning",
  1352. confirmButtonText: "确定",
  1353. cancelButtonText: "取消",
  1354. })
  1355. .then(() => {
  1356. // 解析 exam_ccls 字段
  1357. let QualificationId = '';
  1358. let injury_part_desc = '';
  1359. let visit_type = '';
  1360. if (patient.value.readCardResult.data.exam_ccls) {
  1361. // 格式:^工伤医疗费资格审核信息ID|受伤部位信息描述|就诊类型^
  1362. const match = patient.value.readCardResult.data.exam_ccls.match(/^\^?(.*?)\|(.*?)\|(.*?)\^?$/);
  1363. if (match) {
  1364. QualificationId = match[1];
  1365. injury_part_desc = match[2];
  1366. visit_type = match[3];
  1367. }
  1368. }
  1369. const params = {
  1370. ipt_otp_no: patient.value.inpatientNo + '_' + patient.value.admissTimes,
  1371. med_type: patient.value.medType,
  1372. adm_time: getCurrentDateTimeStr(),
  1373. adm_diag_dscr: zyInYbDiags && zyInYbDiags.length && (zyInYbDiags.length > 0) && zyInYbDiags[0] && zyInYbDiags[0].icdCode ? zyInYbDiags[0].icdCode : '',
  1374. wardarea_name: patient.value.admissWardName,
  1375. adm_dept_codg: patient.value.admissWard,
  1376. adm_bed: patient.value.bedNo,
  1377. atddr_no: patient.value.admissPhysician,
  1378. tel: patient.value.contactPhone,
  1379. psn_no: patient.value.readCardResult.data.psn_no,
  1380. ipt_no: patient.value.inpatientNo,
  1381. qualification_id: QualificationId
  1382. }
  1383. //row.patNo = patient.value.inpatientNo;
  1384. //row.times = patient.value.admissTimes;
  1385. //row.ledgerSn = patient.value.ledgerSn;
  1386. //row.aka130 = "42";
  1387. //row.bka003 = "420";
  1388. //inpatientRegister(row).then(res => {
  1389. // ElMessage({
  1390. // message: "审核已通过,医保入院登记成功。",
  1391. // type: "success",
  1392. // duration: 2500,
  1393. //// showClose: true,
  1394. // });
  1395. showPsnInsuinfo.value = false;
  1396. //});
  1397. })
  1398. .catch(() => {});
  1399. };
  1400. const handleClickInsuinfo = row => {
  1401. ElMessageBox.confirm("确定进行医保入院登记?", "提示", {
  1402. type: "warning",
  1403. confirmButtonText: "确定",
  1404. cancelButtonText: "取消",
  1405. })
  1406. .then(() => {
  1407. patient.value.balc = row.balc;
  1408. patient.value.insutype = row.insutype;
  1409. patient.value.psnType = row.psnType;
  1410. patient.value.insuplcAdmdvs = row.insuplcAdmdvs;
  1411. patient.value.insuplcAdmdvsName = row.insuplcAdmdvsName;
  1412. patient.value.empName = row.empName;
  1413. admissRegister(patient.value).then(() => {
  1414. ElMessage({
  1415. message: "医保入院登记成功。",
  1416. type: "success",
  1417. duration: 2500,
  1418. showClose: true,
  1419. });
  1420. showPsnInsuinfo.value = false;
  1421. });
  1422. })
  1423. .catch(() => {});
  1424. };
  1425. const beforeCancelRegister = () => {
  1426. if (nullPatient()) return;
  1427. ElMessageBox.prompt("请输入撤销入院登记的原因:", "提示", {
  1428. confirmButtonText: "确定",
  1429. cancelButtonText: "取消",
  1430. })
  1431. .then(({ value }) => {
  1432. if (!value) {
  1433. ElMessage({
  1434. message: "撤销入院登记的原因不能为空!",
  1435. type: "warning",
  1436. duration: 2500,
  1437. showClose: true,
  1438. });
  1439. return;
  1440. }
  1441. ElMessageBox.confirm(
  1442. "撤销医保入院登记的原因为【" + value + "】确定撤销?",
  1443. "提示",
  1444. {
  1445. type: "warning",
  1446. }
  1447. ).then(() => {
  1448. patient.value.revokeRemark = value;
  1449. if (injuryMode.value) {
  1450. revokeInpatientRegister(patient.value).then(() => {
  1451. ElMessageBox.alert("撤销入院登记成功。", "提示", {
  1452. type: "success",
  1453. });
  1454. });
  1455. } else {
  1456. revokeAdmission(patient.value).then(() => {
  1457. ElMessageBox.alert("撤销入院登记成功。", "提示", {
  1458. type: "success",
  1459. });
  1460. });
  1461. }
  1462. });
  1463. })
  1464. .catch(() => {});
  1465. };
  1466. const showAssigninfo = ref(false);
  1467. const beforeFetchAssigninfo = () => {
  1468. if (nullPatient()) {
  1469. return;
  1470. }
  1471. if (!patient.value.socialNo) {
  1472. ElMessage({
  1473. message: "患者身份证不能为空!",
  1474. type: "warning",
  1475. duration: 2500,
  1476. showClose: true,
  1477. });
  1478. return;
  1479. }
  1480. if (!patient.value.admdvs) {
  1481. ElMessage({
  1482. message: "患者参保地不能为空!",
  1483. type: "warning",
  1484. duration: 2500,
  1485. showClose: true,
  1486. });
  1487. return;
  1488. }
  1489. showAssigninfo.value = true;
  1490. };
  1491. function chronicDiseaseRegister() {
  1492. if (nullPatient()) {
  1493. return;
  1494. }
  1495. router.push(
  1496. "/outpatient/chronicDisease/chronicDiseaseRegister/" +
  1497. patient.value.inpatientNo
  1498. );
  1499. }
  1500. const xiangMuLuRuRouter = () => {
  1501. if (nullPatient()) {
  1502. return;
  1503. }
  1504. useDialog(XmlrV2, {
  1505. dialogProps: {
  1506. fullscreen: true,
  1507. showClose: false,
  1508. },
  1509. showFooter: false,
  1510. hideHeader: true,
  1511. params: { patNo: patient.value.inpatientNo },
  1512. });
  1513. };
  1514. const currentPage = ref(1);
  1515. const handleCurrentChange = val => {
  1516. currentPage.value = val;
  1517. };
  1518. // 性别转化
  1519. function formatGender(val) {
  1520. switch (val) {
  1521. case '1': return '男';
  1522. case '2': return '女';
  1523. case '9': return '未说明性别';
  1524. default: return val || '';
  1525. }
  1526. }
  1527. // 工伤人员类别转化
  1528. function formatInjuryPersonType(val) {
  1529. const map = {
  1530. '01': '新工伤', '02': '老工伤', '03': '建筑业', '04': '退休职业病',
  1531. '05': '机关事业老工伤纳入', '06': '机关事业老工伤确认', '07': '伤残军人',
  1532. '08': '非全日制和多单位就业', '09': '8023人员', '10': '包干老工伤',
  1533. '11': '超龄就业人员', '12': '实习生', '13': '离职职业病', '14': '见习生',
  1534. '15': '新业态人员'
  1535. };
  1536. return map[val] || val || '';
  1537. }
  1538. // 在院状态转化
  1539. function formatInHospStatus(val) {
  1540. switch (val) {
  1541. case '0': return '未在院';
  1542. case '1': return '工伤在院';
  1543. case '2': return '医疗在院';
  1544. default: return val || '';
  1545. }
  1546. }
  1547. // 证件类型转化
  1548. function formatCertType(val) {
  1549. const map = {
  1550. '01': '居民身份证', '04': '港澳居民来往内地通行证', '05': '台湾居民来往大陆通行证',
  1551. '07': '外国人永久居留身份证', '08': '外国人护照', '16': '港澳台居民居住证',
  1552. '90': '社会保障卡', '99': '其他'
  1553. };
  1554. return map[val] || val || '';
  1555. }
  1556. // 获取当前时间,格式为YYYYMMDDHH24MISS
  1557. function getCurrentDateTimeStr() {
  1558. const now = new Date();
  1559. const pad = (n) => n < 10 ? '0' + n : n;
  1560. return (
  1561. now.getFullYear().toString() +
  1562. pad(now.getMonth() + 1) +
  1563. pad(now.getDate()) +
  1564. pad(now.getHours()) +
  1565. pad(now.getMinutes()) +
  1566. pad(now.getSeconds())
  1567. );
  1568. }
  1569. onMounted(() => {
  1570. getPsnCertTypes().then(res => {
  1571. psnCertTypes.value = res;
  1572. });
  1573. getMedTypesByFlag("hospitalization").then(res => {
  1574. medTypes.value = res;
  1575. });
  1576. fetchCountryDictionary().then(res => {
  1577. countries.value = res;
  1578. });
  1579. fetchNationDictionary().then(res => {
  1580. nations.value = res;
  1581. });
  1582. fetchRelationDictionary().then(res => {
  1583. relations.value = res;
  1584. });
  1585. getMatnTypes().then(res => {
  1586. matnTypes.value = res;
  1587. });
  1588. });
  1589. </script>
  1590. <style scoped>
  1591. .el-date-editor.el-input,
  1592. .el-date-editor.el-input__inner {
  1593. width: 100%;
  1594. }
  1595. .el-collapse-item__content {
  1596. padding-bottom: 0;
  1597. }
  1598. .el-collapse-item__header {
  1599. height: 30px;
  1600. line-height: 30px;
  1601. }
  1602. .el-collapse-item__header,
  1603. .el-collapse-item__wrap {
  1604. background-color: inherit;
  1605. }
  1606. .el-autocomplete-suggestion li {
  1607. line-height: normal !important;
  1608. }
  1609. </style>