AdmRegistration.vue 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761
  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("resultccccccccccccccccccccccc",result)
  960. if (result && result.code === 1 && result.data && result.data.code === 200 && result.data.data.infcode == '0') {
  961. if(result.data && result.data.data && result.data.data.output && result.data.data.output.certno && (result.data.data.output.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.output && result.data.data.output.psn_name && (result.data.data.output.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.output.exam_ccls) {
  986. // 格式:^工伤医疗费资格审核信息ID|受伤部位信息描述|就诊类型^
  987. const match = result.data.data.output.exam_ccls.match(/^\^?(.*?)\|(.*?)\|(.*?)\^?$/);
  988. if (match) {
  989. QualificationId = match[1];
  990. injury_part_desc = match[2];
  991. visit_type = match[3];
  992. }
  993. }
  994. const responseTwo = 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.output.psn_no,
  1003. emp_no:result.data.data.output.emp_no,
  1004. emp_name:result.data.data.output.emp_name,
  1005. certno:result.data.data.output.certno,
  1006. psn_name:result.data.data.output.psn_name,
  1007. gend:result.data.data.output.gend,
  1008. age:result.data.data.output.age,
  1009. psn_type:result.data.data.output.psn_type,
  1010. insu_admdvs:result.data.data.output.insu_admdvs,
  1011. inhosp_stas:result.data.data.output.inhosp_stas,
  1012. trt_chk_rslt:result.data.data.output.trt_chk_rslt,
  1013. exam_ccls:result.data.data.output.exam_ccls,
  1014. certificate_type:result.data.data.output.certificate_type,
  1015. birthday:result.data.data.output.birthday,
  1016. QualificationId,
  1017. injury_part_desc,
  1018. visit_type
  1019. }),
  1020. });
  1021. const resultTwo = await responseTwo.json();
  1022. if(!(resultTwo && resultTwo.code === 1)) {
  1023. ElMessage({
  1024. message: '本地录入工伤社保卡信息失败',
  1025. type: 'error',
  1026. duration: 2500,
  1027. showClose: true,
  1028. });
  1029. return
  1030. }
  1031. } catch (e) {
  1032. ElMessage({
  1033. message: '本地录入工伤社保卡信息失败',
  1034. type: 'error',
  1035. duration: 2500,
  1036. showClose: true,
  1037. });
  1038. return
  1039. }
  1040. injurySicardResult.value = result.data;
  1041. patient.value.mdtrtCertType = 'injurySicard';
  1042. patient.value.readCardResult = injurySicardResult.value;
  1043. patient.value.readCardBizType = '01103';
  1044. console.log("patient.value22222222222222222222222222222222222222222",patient.value)
  1045. ElMessage({
  1046. message: '工伤读社保卡成功',
  1047. type: 'success',
  1048. duration: 2500,
  1049. showClose: true,
  1050. });
  1051. } else {
  1052. ElMessage({
  1053. message: result.message || '工伤读社保卡失败',
  1054. type: 'error',
  1055. duration: 2500,
  1056. showClose: true,
  1057. });
  1058. }
  1059. } catch (error) {
  1060. ElMessage({
  1061. message: '工伤读社保卡接口异常',
  1062. type: 'error',
  1063. duration: 2500,
  1064. showClose: true,
  1065. });
  1066. } finally {
  1067. loading.close && loading.close();
  1068. }
  1069. };
  1070. const checkRegisterDatetime = () => {
  1071. if (nullPatient()) {
  1072. return;
  1073. }
  1074. if(!(patient.value && patient.value.mdtrtCertType && patient.value.readCardResult)) {
  1075. ElMessage({
  1076. message: "请进行读卡操作!",
  1077. type: "warning",
  1078. duration: 2600,
  1079. showClose: true,
  1080. });
  1081. return;
  1082. }
  1083. if(patient.value.mdtrtCertType === "sicard"){
  1084. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1085. ElMessage({
  1086. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1087. type: "warning",
  1088. duration: 2500,
  1089. showClose: true,
  1090. });
  1091. return;
  1092. }
  1093. if(!(patient.value.name && patient.value.readCardResult && patient.value.readCardResult.includes(patient.value.name))) {
  1094. // 社保卡读卡成功,但姓名不匹配!
  1095. ElMessage({
  1096. message: "社保卡读卡成功,但姓名不匹配!",
  1097. type: "warning",
  1098. duration: 2500,
  1099. showClose: true,
  1100. });
  1101. return;
  1102. }
  1103. if(!(patient.value.socialNo && patient.value.readCardResult && patient.value.readCardResult.includes(patient.value.socialNo))) {
  1104. // 社保卡读卡成功,但身份证不匹配!
  1105. ElMessage({
  1106. message: "社保卡读卡成功,但身份证不匹配!",
  1107. type: "warning",
  1108. duration: 2500,
  1109. showClose: true,
  1110. });
  1111. return;
  1112. }
  1113. }else if(patient.value.mdtrtCertType === "qrcode"){
  1114. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1115. ElMessage({
  1116. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1117. type: "warning",
  1118. duration: 2500,
  1119. showClose: true,
  1120. });
  1121. return;
  1122. }
  1123. // 电子凭证读卡逻辑 - JSON格式数据
  1124. try {
  1125. const cardData = JSON.parse(patient.value.readCardResult);
  1126. if (!(patient.value.name && cardData.userName === patient.value.name)) {
  1127. ElMessage({
  1128. message: "电子凭证读卡成功,但姓名不匹配!",
  1129. type: "warning",
  1130. duration: 2500,
  1131. showClose: true,
  1132. });
  1133. return;
  1134. }
  1135. if (!(patient.value.socialNo && cardData.idNo === patient.value.socialNo)) {
  1136. ElMessage({
  1137. message: "电子凭证读卡成功,但身份证不匹配!",
  1138. type: "warning",
  1139. duration: 2500,
  1140. showClose: true,
  1141. });
  1142. return;
  1143. }
  1144. } catch (error) {
  1145. ElMessage({
  1146. message: "电子凭证读卡数据格式错误!",
  1147. type: "error",
  1148. duration: 2500,
  1149. showClose: true,
  1150. });
  1151. return;
  1152. }
  1153. }else if(patient.value.mdtrtCertType === "face"){
  1154. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1155. ElMessage({
  1156. message: "工伤相关的医疗类别,不能用此读卡功能!",
  1157. type: "warning",
  1158. duration: 2500,
  1159. showClose: true,
  1160. });
  1161. return;
  1162. }
  1163. // 刷脸读卡逻辑 - JSON格式数据
  1164. try {
  1165. const cardData = JSON.parse(patient.value.readCardResult);
  1166. if (!(patient.value.name && cardData.userName === patient.value.name)) {
  1167. ElMessage({
  1168. message: "刷脸读卡成功,但姓名不匹配!",
  1169. type: "warning",
  1170. duration: 2500,
  1171. showClose: true,
  1172. });
  1173. return;
  1174. }
  1175. if (!(patient.value.socialNo && cardData.idNo === patient.value.socialNo)) {
  1176. ElMessage({
  1177. message: "刷脸读卡成功,但身份证不匹配!",
  1178. type: "warning",
  1179. duration: 2500,
  1180. showClose: true,
  1181. });
  1182. return;
  1183. }
  1184. } catch (error) {
  1185. ElMessage({
  1186. message: "刷脸读卡数据格式错误!",
  1187. type: "error",
  1188. duration: 2500,
  1189. showClose: true,
  1190. });
  1191. return;
  1192. }
  1193. }
  1194. if ((patient.value.medType&&((patient.value.medType === 'gs21') || (patient.value.medType === 'gs22') || (patient.value.medType === 'gs23')))) {
  1195. if(!(zyInYbDiags.value && zyInYbDiags.value.length && zyInYbDiags.value.length > 0)) {
  1196. ElMessage({
  1197. message: "医保入院诊断,不能为空!",
  1198. type: "warning",
  1199. duration: 2500,
  1200. showClose: true,
  1201. });
  1202. return;
  1203. }
  1204. }
  1205. patient.value.expContent = JSON.stringify(expContent);
  1206. submitSiPatientInfo({
  1207. patient: patient.value,
  1208. diags: zyInYbDiags.value,
  1209. }).then(() => {
  1210. checkRegisterDate(
  1211. patient.value.inpatientNo,
  1212. patient.value.admissTimes
  1213. ).then(() => {
  1214. selectAdmissApply(patient.value).then(res => {
  1215. if (null === res.status) {
  1216. admissApply.value.patNo = patient.value.inpatientNo;
  1217. admissApply.value.times = patient.value.admissTimes;
  1218. admissApply.value.ledgerSn = patient.value.ledgerSn;
  1219. admissApply.value.admissDatetime = patient.value.ybRegisterDate;
  1220. admissApply.value.inputComment = "人证相符。";
  1221. showAdmissApplyForm.value = true;
  1222. } else {
  1223. switch (res.status) {
  1224. case 0:
  1225. ElMessageBox.alert(
  1226. "医保科尚未处理此患者的医保入院申请,请耐心等候或者致电医保科(内线电话:2102)。",
  1227. "提示",
  1228. {
  1229. type: "warning",
  1230. }
  1231. );
  1232. break;
  1233. case 1:
  1234. getPsnInsuinfo();
  1235. break;
  1236. case 2:
  1237. ElMessageBox.confirm(
  1238. "医保科驳回了此患者的医保入院申请,驳回意见为【" +
  1239. res.handleComment +
  1240. "】",
  1241. "提示",
  1242. {
  1243. type: "error",
  1244. distinguishCancelAndClose: true,
  1245. confirmButtonText: "我知道了",
  1246. cancelButtonText: "重新提交",
  1247. showCancelButton: true,
  1248. }
  1249. ).catch(action => {
  1250. if (action === "cancel") {
  1251. admissApply.value.patNo = patient.value.inpatientNo;
  1252. admissApply.value.times = patient.value.admissTimes;
  1253. admissApply.value.ledgerSn = patient.value.ledgerSn;
  1254. admissApply.value.admissDatetime =
  1255. patient.value.ybRegisterDate;
  1256. showAdmissApplyForm.value = true;
  1257. }
  1258. });
  1259. break;
  1260. }
  1261. }
  1262. });
  1263. });
  1264. });
  1265. };
  1266. const cancelAdmissApply = () => {
  1267. admissApply.value = {};
  1268. showAdmissApplyForm.value = false;
  1269. };
  1270. const confirmAdmissApply = () => {
  1271. if (!admissApply.value.admissDatetime) {
  1272. ElMessage({
  1273. message: "医保入院登记时间不能为空!",
  1274. type: "error",
  1275. duration: 2500,
  1276. showClose: true,
  1277. });
  1278. return;
  1279. }
  1280. if (!admissApply.value.inputComment) {
  1281. ElMessage({
  1282. message: "申请理由不能为空!",
  1283. type: "error",
  1284. duration: 2500,
  1285. showClose: true,
  1286. });
  1287. return;
  1288. }
  1289. admissApply.value.admissDatetime = formatDatetime(
  1290. admissApply.value.admissDatetime
  1291. );
  1292. ElMessageBox.confirm("是否确认提交入院登记申请?", "提示", {
  1293. type: "warning",
  1294. confirmButtonText: "确定",
  1295. cancelButtonText: "取消",
  1296. })
  1297. .then(() => {
  1298. submitAdmissApply(admissApply.value).then(res => {
  1299. ElMessage({
  1300. message: res,
  1301. type: "success",
  1302. duration: 2500,
  1303. showClose: true,
  1304. });
  1305. showAdmissApplyForm.value = false;
  1306. });
  1307. })
  1308. .catch(() => {});
  1309. };
  1310. const psnBaseinfo = ref({});
  1311. const showPsnInsuinfo = ref(false);
  1312. const injuryinfo = ref([]);
  1313. const getPsnInsuinfo = () => {
  1314. if (nullPatient()) {
  1315. return;
  1316. }
  1317. if (!patient.value.medType) {
  1318. ElMessage({
  1319. message: "请选择患者的医疗类别!",
  1320. type: "warning",
  1321. showClose: true,
  1322. });
  1323. return;
  1324. }
  1325. if (injuryMode.value) {
  1326. //employeeInfoInquiry(patient.value).then(res => {
  1327. //injuryinfo.value = res;
  1328. injuryinfo.value = [patient.value.readCardResult.data.output];
  1329. showPsnInsuinfo.value = true;
  1330. //});
  1331. } else {
  1332. const param = {
  1333. medType: patient.value.medType,
  1334. patNo: patient.value.inpatientNo,
  1335. times: patient.value.admissTimes,
  1336. ledgerSn: patient.value.ledgerSn,
  1337. socialNo: patient.value.socialNo,
  1338. name: patient.value.name,
  1339. admdvs: patient.value.admdvs,
  1340. psnCertType: patient.value.psnCertType,
  1341. needSaving: 1,
  1342. };
  1343. obtainBasicPersonInfo(param).then(res => {
  1344. patient.value.psnNo = res.psnNo;
  1345. psnBaseinfo.value = res;
  1346. showPsnInsuinfo.value = true;
  1347. if (XEUtils.toNumber(res.gend) !== patient.value.sex) {
  1348. sleep(800).then(() => {
  1349. CyMessageBox.alert({
  1350. message: `患者医保性别<span style="color:red">${res.gendName}</span>,与HIS信息不一致,请核实。`,
  1351. type: "warning",
  1352. dangerouslyUseHTMLString: true,
  1353. });
  1354. });
  1355. }
  1356. });
  1357. }
  1358. };
  1359. const handleClickInjuryinfo = row => {
  1360. ElMessageBox.confirm("确定进行工伤入院登记?", "提示", {
  1361. type: "warning",
  1362. confirmButtonText: "确定",
  1363. cancelButtonText: "取消",
  1364. })
  1365. .then(async () => {
  1366. // 解析 exam_ccls 字段
  1367. let QualificationId = '';
  1368. let injury_part_desc = '';
  1369. let visit_type = '';
  1370. if (patient.value.readCardResult.data.output.exam_ccls) {
  1371. // 格式:^工伤医疗费资格审核信息ID|受伤部位信息描述|就诊类型^
  1372. const match = patient.value.readCardResult.data.output.exam_ccls.match(/^\^?(.*?)\|(.*?)\|(.*?)\^?$/);
  1373. if (match) {
  1374. QualificationId = match[1];
  1375. injury_part_desc = match[2];
  1376. visit_type = match[3];
  1377. }
  1378. }
  1379. const businessParams = {
  1380. ipt_otp_no: patient.value.inpatientNo + '_' + patient.value.admissTimes,
  1381. med_type: patient.value.medType,
  1382. adm_time: getCurrentDateTimeStr(),
  1383. adm_diag_dscr: zyInYbDiags.value && zyInYbDiags.value.length && (zyInYbDiags.value.length > 0) && zyInYbDiags.value[0] && zyInYbDiags.value[0].icdCode ? zyInYbDiags.value[0].icdCode : '',
  1384. wardarea_name: patient.value.admissWardName,
  1385. adm_dept_codg: patient.value.admissWard,
  1386. adm_bed: patient.value.bedNo,
  1387. atddr_no: patient.value.admissPhysician,
  1388. tel: patient.value.contactPhone,
  1389. psn_no: patient.value.readCardResult.data.output.psn_no,
  1390. ipt_no: patient.value.inpatientNo,
  1391. qualification_id: QualificationId
  1392. }
  1393. const params = {
  1394. "action": "transaction",
  1395. "transactionName": "RegisterPatient",
  1396. "businessParams": businessParams
  1397. }
  1398. console.log("params22222222222222222222222222222222222222222222222222",params)
  1399. try {
  1400. const response = await fetch('http://130.150.161.72:9206/thyy/api/public/injury/workinjury', {
  1401. method: 'POST',
  1402. headers: {
  1403. 'Content-Type': 'application/json',
  1404. },
  1405. body: JSON.stringify(params),
  1406. });
  1407. const result = await response.json();
  1408. // 你可以根据 result 做后续处理
  1409. if (result && result.code === 1 && result.data && result.data.code === 200 && result.data.data.infcode == '0') {
  1410. //调用addWorkInjuryInterfaceLog接口
  1411. try {
  1412. const responseTwo = await fetch('http://130.150.161.72:9206/thyy/api/public/injury/addWorkInjuryInterfaceLog', {
  1413. method: 'POST',
  1414. headers: {
  1415. 'Content-Type': 'application/json',
  1416. },
  1417. body: JSON.stringify({
  1418. inpatient_no:patient.value.inpatientNo,
  1419. admiss_times:patient.value.admissTimes,
  1420. ledger_sn:patient.value.ledger_sn,
  1421. infno:result.data.transformed_parameters.infno,
  1422. msgid:result.data.transformed_parameters.msgid,
  1423. recer_sys_code:result.data.transformed_parameters.recer_sys_code,
  1424. infver:result.data.transformed_parameters.infver,
  1425. opter_type:result.data.transformed_parameters.opter_type,
  1426. opter:result.data.transformed_parameters.opter,
  1427. opter_name:result.data.transformed_parameters.opter_name,
  1428. inf_time:result.data.transformed_parameters.inf_time,
  1429. fixmedins_code:result.data.transformed_parameters.fixmedins_code,
  1430. sign_no:result.data.transformed_parameters.sign_no,
  1431. idfi_mode:result.data.transformed_parameters.idfi_mode,
  1432. input:result.data.transformed_parameters.input,
  1433. qrcode_info:result.data.transformed_parameters.qrcode_info,
  1434. infcode:result.data.data.infcode,
  1435. inf_refmsgid:result.data.data.inf_refmsgid,
  1436. refmsg_time:result.data.data.refmsg_time,
  1437. respond_time:result.data.data.respond_time,
  1438. err_msg:result.data.data.err_msg,
  1439. warn_msg:result.data.data.warn_msg,
  1440. output:result.data.data.output
  1441. }),
  1442. });
  1443. const resultTwo = await responseTwo.json();
  1444. if(resultTwo && resultTwo.code === 1) {
  1445. ElMessage({
  1446. message: '工伤入院登记成功',
  1447. type: 'success',
  1448. duration: 2500,
  1449. showClose: true,
  1450. });
  1451. }else {
  1452. ElMessage({
  1453. message: '本地工伤入院登记接口异常,需要你进行冲正处理了',
  1454. type: 'error',
  1455. duration: 10000,
  1456. showClose: true,
  1457. });
  1458. return
  1459. }
  1460. } catch (e) {
  1461. ElMessage({
  1462. message: '本地工伤入院登记接口异常,需要你进行冲正处理了',
  1463. type: 'error',
  1464. duration: 10000,
  1465. showClose: true,
  1466. });
  1467. return
  1468. }
  1469. } else {
  1470. ElMessage({
  1471. message: result.message || '工伤入院登记失败',
  1472. type: 'error',
  1473. duration: 2500,
  1474. showClose: true,
  1475. });
  1476. }
  1477. } catch (e) {
  1478. ElMessage({
  1479. message: '工伤入院登记接口异常',
  1480. type: 'error',
  1481. duration: 2500,
  1482. showClose: true,
  1483. });
  1484. }
  1485. //row.patNo = patient.value.inpatientNo;
  1486. //row.times = patient.value.admissTimes;
  1487. //row.ledgerSn = patient.value.ledgerSn;
  1488. //row.aka130 = "42";
  1489. //row.bka003 = "420";
  1490. //inpatientRegister(row).then(res => {
  1491. // ElMessage({
  1492. // message: "审核已通过,医保入院登记成功。",
  1493. // type: "success",
  1494. // duration: 2500,
  1495. //// showClose: true,
  1496. // });
  1497. showPsnInsuinfo.value = false;
  1498. //});
  1499. })
  1500. .catch(() => {});
  1501. };
  1502. const handleClickInsuinfo = row => {
  1503. ElMessageBox.confirm("确定进行医保入院登记?", "提示", {
  1504. type: "warning",
  1505. confirmButtonText: "确定",
  1506. cancelButtonText: "取消",
  1507. })
  1508. .then(() => {
  1509. patient.value.balc = row.balc;
  1510. patient.value.insutype = row.insutype;
  1511. patient.value.psnType = row.psnType;
  1512. patient.value.insuplcAdmdvs = row.insuplcAdmdvs;
  1513. patient.value.insuplcAdmdvsName = row.insuplcAdmdvsName;
  1514. patient.value.empName = row.empName;
  1515. admissRegister(patient.value).then(() => {
  1516. ElMessage({
  1517. message: "医保入院登记成功。",
  1518. type: "success",
  1519. duration: 2500,
  1520. showClose: true,
  1521. });
  1522. showPsnInsuinfo.value = false;
  1523. });
  1524. })
  1525. .catch(() => {});
  1526. };
  1527. const beforeCancelRegister = () => {
  1528. if (nullPatient()) return;
  1529. ElMessageBox.prompt("请输入撤销入院登记的原因:", "提示", {
  1530. confirmButtonText: "确定",
  1531. cancelButtonText: "取消",
  1532. })
  1533. .then(({ value }) => {
  1534. if (!value) {
  1535. ElMessage({
  1536. message: "撤销入院登记的原因不能为空!",
  1537. type: "warning",
  1538. duration: 2500,
  1539. showClose: true,
  1540. });
  1541. return;
  1542. }
  1543. ElMessageBox.confirm(
  1544. "撤销医保入院登记的原因为【" + value + "】确定撤销?",
  1545. "提示",
  1546. {
  1547. type: "warning",
  1548. }
  1549. ).then(() => {
  1550. patient.value.revokeRemark = value;
  1551. if (injuryMode.value) {
  1552. revokeInpatientRegister(patient.value).then(() => {
  1553. ElMessageBox.alert("撤销入院登记成功。", "提示", {
  1554. type: "success",
  1555. });
  1556. });
  1557. } else {
  1558. revokeAdmission(patient.value).then(() => {
  1559. ElMessageBox.alert("撤销入院登记成功。", "提示", {
  1560. type: "success",
  1561. });
  1562. });
  1563. }
  1564. });
  1565. })
  1566. .catch(() => {});
  1567. };
  1568. const showAssigninfo = ref(false);
  1569. const beforeFetchAssigninfo = () => {
  1570. if (nullPatient()) {
  1571. return;
  1572. }
  1573. if (!patient.value.socialNo) {
  1574. ElMessage({
  1575. message: "患者身份证不能为空!",
  1576. type: "warning",
  1577. duration: 2500,
  1578. showClose: true,
  1579. });
  1580. return;
  1581. }
  1582. if (!patient.value.admdvs) {
  1583. ElMessage({
  1584. message: "患者参保地不能为空!",
  1585. type: "warning",
  1586. duration: 2500,
  1587. showClose: true,
  1588. });
  1589. return;
  1590. }
  1591. showAssigninfo.value = true;
  1592. };
  1593. function chronicDiseaseRegister() {
  1594. if (nullPatient()) {
  1595. return;
  1596. }
  1597. router.push(
  1598. "/outpatient/chronicDisease/chronicDiseaseRegister/" +
  1599. patient.value.inpatientNo
  1600. );
  1601. }
  1602. const xiangMuLuRuRouter = () => {
  1603. if (nullPatient()) {
  1604. return;
  1605. }
  1606. useDialog(XmlrV2, {
  1607. dialogProps: {
  1608. fullscreen: true,
  1609. showClose: false,
  1610. },
  1611. showFooter: false,
  1612. hideHeader: true,
  1613. params: { patNo: patient.value.inpatientNo },
  1614. });
  1615. };
  1616. const currentPage = ref(1);
  1617. const handleCurrentChange = val => {
  1618. currentPage.value = val;
  1619. };
  1620. // 性别转化
  1621. function formatGender(val) {
  1622. switch (val) {
  1623. case '1': return '男';
  1624. case '2': return '女';
  1625. case '9': return '未说明性别';
  1626. default: return val || '';
  1627. }
  1628. }
  1629. // 工伤人员类别转化
  1630. function formatInjuryPersonType(val) {
  1631. const map = {
  1632. '01': '新工伤', '02': '老工伤', '03': '建筑业', '04': '退休职业病',
  1633. '05': '机关事业老工伤纳入', '06': '机关事业老工伤确认', '07': '伤残军人',
  1634. '08': '非全日制和多单位就业', '09': '8023人员', '10': '包干老工伤',
  1635. '11': '超龄就业人员', '12': '实习生', '13': '离职职业病', '14': '见习生',
  1636. '15': '新业态人员'
  1637. };
  1638. return map[val] || val || '';
  1639. }
  1640. // 在院状态转化
  1641. function formatInHospStatus(val) {
  1642. switch (val) {
  1643. case '0': return '未在院';
  1644. case '1': return '工伤在院';
  1645. case '2': return '医疗在院';
  1646. default: return val || '';
  1647. }
  1648. }
  1649. // 证件类型转化
  1650. function formatCertType(val) {
  1651. const map = {
  1652. '01': '居民身份证', '04': '港澳居民来往内地通行证', '05': '台湾居民来往大陆通行证',
  1653. '07': '外国人永久居留身份证', '08': '外国人护照', '16': '港澳台居民居住证',
  1654. '90': '社会保障卡', '99': '其他'
  1655. };
  1656. return map[val] || val || '';
  1657. }
  1658. // 获取当前时间,格式为YYYYMMDDHH24MISS
  1659. function getCurrentDateTimeStr() {
  1660. const now = new Date();
  1661. const pad = (n) => n < 10 ? '0' + n : n;
  1662. return (
  1663. now.getFullYear().toString() +
  1664. pad(now.getMonth() + 1) +
  1665. pad(now.getDate()) +
  1666. pad(now.getHours()) +
  1667. pad(now.getMinutes()) +
  1668. pad(now.getSeconds())
  1669. );
  1670. }
  1671. onMounted(() => {
  1672. getPsnCertTypes().then(res => {
  1673. psnCertTypes.value = res;
  1674. });
  1675. getMedTypesByFlag("hospitalization").then(res => {
  1676. medTypes.value = res;
  1677. });
  1678. fetchCountryDictionary().then(res => {
  1679. countries.value = res;
  1680. });
  1681. fetchNationDictionary().then(res => {
  1682. nations.value = res;
  1683. });
  1684. fetchRelationDictionary().then(res => {
  1685. relations.value = res;
  1686. });
  1687. getMatnTypes().then(res => {
  1688. matnTypes.value = res;
  1689. });
  1690. });
  1691. </script>
  1692. <style scoped>
  1693. .el-date-editor.el-input,
  1694. .el-date-editor.el-input__inner {
  1695. width: 100%;
  1696. }
  1697. .el-collapse-item__content {
  1698. padding-bottom: 0;
  1699. }
  1700. .el-collapse-item__header {
  1701. height: 30px;
  1702. line-height: 30px;
  1703. }
  1704. .el-collapse-item__header,
  1705. .el-collapse-item__wrap {
  1706. background-color: inherit;
  1707. }
  1708. .el-autocomplete-suggestion li {
  1709. line-height: normal !important;
  1710. }
  1711. </style>