Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

patients.vue 56KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798
  1. <template>
  2. <div class="main-contain">
  3. <el-dialog
  4. title="提示"
  5. :visible.sync="exportVisible"
  6. width="40%"
  7. >
  8. <div>
  9. 您提交的患者名单已上传成功,系统正在执行导入,请稍候点击当前页面右上角“下载日志”查看导入结果
  10. </div>
  11. <span slot="footer" class="dialog-footer">
  12. <el-button @click="exportVisible = false">取 消</el-button>
  13. <el-button type="primary" @click="exportVisible = false">确 定</el-button>
  14. </span>
  15. </el-dialog>
  16. <el-dialog
  17. title="提示"
  18. :visible.sync="dialogVisible"
  19. width="40%"
  20. >
  21. <span>您提交的文档不是系统标准导入模板,请检查您的文档或重新 <a href="https://kuyi.shengws.com/patient_template.xlsx" style="color: blue" download="template">下载导入模板</a></span>
  22. <span slot="footer" class="dialog-footer">
  23. <el-button @click="dialogVisible = false">取 消</el-button>
  24. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  25. </span>
  26. </el-dialog>
  27. <el-dialog
  28. title="提示"
  29. :visible.sync="dialysisVisible"
  30. width="40%"
  31. >
  32. <span>您提交的文档中存在不同病人存在相同的透析号,请检查修改后在提交 </span>
  33. <span slot="footer" class="dialog-footer">
  34. <el-button @click="dialysisVisible = false">取 消</el-button>
  35. <el-button type="primary" @click="dialysisVisible = false">确 定</el-button>
  36. </span>
  37. </el-dialog>
  38. <el-dialog
  39. title="提示"
  40. :visible.sync="phoneVisible"
  41. width="40%"
  42. >
  43. <span>您提交的文档中存在不同病人存在相同的手机号,请检查修改后在提交 </span>
  44. <span slot="footer" class="dialog-footer">
  45. <el-button @click="phoneVisible = false">取 消</el-button>
  46. <el-button type="primary" @click="phoneVisible = false">确 定</el-button>
  47. </span>
  48. </el-dialog>
  49. <el-dialog
  50. title="提示"
  51. :visible.sync="idCardNoVisible"
  52. width="40%"
  53. >
  54. <span>您提交的文档中存在不同病人存在相同的身份证,请检查修改后在提交 </span>
  55. <span slot="footer" class="dialog-footer">
  56. <el-button @click="idCardNoVisible = false">取 消</el-button>
  57. <el-button type="primary" @click="idCardNoVisible = false">确 定</el-button>
  58. </span>
  59. </el-dialog>
  60. <el-dialog
  61. title="提示"
  62. :visible.sync="exportLogVisible"
  63. width="40%"
  64. >
  65. <div v-for="(item,index) in logs" :key="index">
  66. <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
  67. <br/>
  68. <br/>
  69. <span>{{getContent(item)}}</span>
  70. <span >点击</span>
  71. <span style="color:blue" @click="generateTxt(item)">查看详情</span>
  72. <br/>
  73. <br/>
  74. </div>
  75. <span slot="footer" class="dialog-footer">
  76. <el-button @click="exportLogVisible = false">取 消</el-button>
  77. <el-button type="primary" @click="exportLogVisible = false">确 定</el-button>
  78. </span>
  79. </el-dialog>
  80. <div class="position">
  81. <bread-crumb :crumbs="crumbs"></bread-crumb>
  82. <div style="display:flex;align-items:center">
  83. <el-badge :value=value class="item">
  84. <el-button size="small" type="primary" @click="toRemind">传染病检查提醒</el-button>
  85. </el-badge>
  86. <upload-excel :on-success='handleSuccess' :before-upload="beforeUpload" v-if="isShow"></upload-excel>
  87. <el-link target="_blank" href="https://kuyi.shengws.com/patient_template.xlsx" :underline="false"
  88. style="margin-left:15px">
  89. <el-button
  90. class="filter-item"
  91. type="primary"
  92. size="small"
  93. >下载模版
  94. </el-button>
  95. </el-link>
  96. <el-button
  97. style="margin-left:10px;"
  98. @click="generateLog()"
  99. class="filter-item"
  100. type="primary"
  101. size="small"
  102. >下载日志
  103. </el-button>
  104. <el-button
  105. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  106. @click="$router.push({ path: '/patients/create' })"
  107. class="filter-item"
  108. type="primary"
  109. icon="el-icon-circle-plus-outline"
  110. size="small"
  111. >新增
  112. </el-button>
  113. </div>
  114. <!-- <el-button type="primary" plain style="float:right;" icon="el-icon-download" @click="putOnRecord(2,{})" >备案</el-button> -->
  115. </div>
  116. <div class="app-container">
  117. <div class="cell clearfix">
  118. <!-- <label class="title"><span class="name">病人搜索</span> : </label> -->
  119. <el-input
  120. style="width: 400px;"
  121. v-model.trim="searchKey"
  122. class="filter-item"
  123. placeholder="病人姓名/透析号"
  124. size="small"
  125. @keyup.enter.native='search'
  126. />
  127. <el-button
  128. class="filter-item"
  129. type="primary"
  130. icon="el-icon-search"
  131. @click="search"
  132. size="small"
  133. >搜索
  134. </el-button
  135. >
  136. </div>
  137. <div class="cell clearfix">
  138. <label class="title"><span class="name">日期查询</span> : </label>
  139. <el-date-picker
  140. size="small"
  141. clearable
  142. v-model="listQuery.start_time"
  143. prefix-icon="el-icon-date"
  144. @change="changeTimeOne"
  145. :editable="false"
  146. style="width: 196px;"
  147. type="date"
  148. placeholder="选择日期时间"
  149. align="right"
  150. format="yyyy-MM-dd"
  151. value-format="yyyy-MM-dd"
  152. >
  153. </el-date-picker>
  154. <span class="cellLine"> - </span>
  155. <el-date-picker
  156. size="small"
  157. clearable
  158. v-model="listQuery.end_time"
  159. prefix-icon="el-icon-date"
  160. @change="changeTime"
  161. :editable="false"
  162. style="width: 196px;"
  163. type="date"
  164. placeholder="选择日期时间"
  165. align="right"
  166. format="yyyy-MM-dd"
  167. value-format="yyyy-MM-dd"
  168. >
  169. </el-date-picker>
  170. </div>
  171. <div class="cell clearfix">
  172. <label class="title"><span class="name">排班班次</span> : </label>
  173. <div class="time ">
  174. <ul class="">
  175. <li
  176. :class="item.value == schedulType ? 'active' : ''"
  177. @click="selectSchedulType(item.value)"
  178. v-for="item in schedulArr"
  179. :key="item.value"
  180. >
  181. {{ item.label }}
  182. </li>
  183. </ul>
  184. </div>
  185. </div>
  186. <div class="cell clearfix">
  187. <label class="title"><span class="name">状态</span> : </label>
  188. <div class="time ">
  189. <ul class="">
  190. <li
  191. :class="item.value == systemType ? 'active' : ''"
  192. @click="selectSystemType(item.value)"
  193. v-for="item in systemArr"
  194. :key="item.value"
  195. >
  196. {{ item.label }}
  197. </li>
  198. </ul>
  199. </div>
  200. </div>
  201. <div class="cell clearfix">
  202. <label class="title"><span class="name">转归情况</span> : </label>
  203. <div class="time ">
  204. <ul class="">
  205. <li
  206. :class="item.lapseto == lapsetoType ? 'active' : ''"
  207. @click="selectLapseTo(item.lapseto)"
  208. v-for="item in lapsetoArr"
  209. :key="item.value"
  210. >
  211. {{ item.label }}
  212. </li>
  213. </ul>
  214. </div>
  215. </div>
  216. <div class="cell clearfix">
  217. <label class="title"><span class="name">病人来源</span> : </label>
  218. <div class="time ">
  219. <ul class="">
  220. <li
  221. :class="item.source == sourceType ? 'active' : ''"
  222. @click="selectSource(item.source)"
  223. v-for="item in sourceArr"
  224. :key="item.value"
  225. >
  226. {{ item.label }}
  227. </li>
  228. </ul>
  229. </div>
  230. </div>
  231. <div class="cell clearfix">
  232. <label class="title"><span class="name">其它查询</span> : </label>
  233. <el-select
  234. v-model="listQuery.contagion"
  235. size="small"
  236. clearable
  237. placeholder="传染病"
  238. @change="changeOtherSearch"
  239. >
  240. <el-option
  241. v-for="item in contagionList"
  242. :key="item.id"
  243. :label="item.name"
  244. :value="item.id"
  245. >
  246. </el-option>
  247. </el-select>
  248. <el-select
  249. style="margin-left: 10px;"
  250. v-model="listQuery.reimbursement_way"
  251. size="small"
  252. clearable
  253. placeholder="付费方式"
  254. @change="changeOtherSearch"
  255. >
  256. <el-option
  257. v-for="item in reimbursement_ways"
  258. :key="item.id"
  259. :label="item.name"
  260. :value="item.id"
  261. >
  262. </el-option>
  263. </el-select>
  264. <el-select
  265. v-model="listQuery.isscheduling"
  266. collapse-tags
  267. style="margin-left: 10px;"
  268. clearable
  269. placeholder="排班情况"
  270. size="small"
  271. @change="changeOtherSearch"
  272. >
  273. <el-option
  274. v-for="item in scheduling"
  275. :key="item.value"
  276. :label="item.label"
  277. :value="item.value"
  278. >
  279. </el-option>
  280. </el-select>
  281. <el-select
  282. v-model="listQuery.isprescription"
  283. collapse-tags
  284. style="margin-left:10px;"
  285. clearable
  286. placeholder="透析处方"
  287. size="small"
  288. @change="changeOtherSearch"
  289. >
  290. <el-option
  291. v-for="item in prescription"
  292. :key="item.value"
  293. :label="item.label"
  294. :value="item.value"
  295. >
  296. </el-option>
  297. </el-select>
  298. <el-button type="primary" size="small" style="float:right" @click="toExport">导出</el-button>
  299. </div>
  300. <el-table
  301. ref="multipleTable"
  302. :row-style="{ color: '#303133' }"
  303. :header-cell-style="{
  304. backgroundColor: 'rgb(245, 247, 250)',
  305. color: '#606266'
  306. }"
  307. :data="tableData"
  308. border
  309. fit
  310. highlight-current-row
  311. style="width: 100%;margin-top: 10px;"
  312. @selection-change="handleSelectionChange"
  313. >
  314. <el-table-column
  315. align="center"
  316. label="全选"
  317. width="60px"
  318. type="selection"
  319. ></el-table-column>
  320. <el-table-column
  321. type="index"
  322. label="序号"
  323. width="40px"
  324. align="center"
  325. ></el-table-column>
  326. <el-table-column
  327. label="透析号"
  328. min-width="70"
  329. property="dialysis_no"
  330. align="center"
  331. style="color:red"
  332. ></el-table-column>
  333. <el-table-column
  334. label="住院号"
  335. min-width="70"
  336. property="admission_number"
  337. align="center"
  338. >
  339. </el-table-column>
  340. <el-table-column
  341. property="name"
  342. label="姓名"
  343. min-width="70"
  344. align="center"
  345. >
  346. <template slot-scope="scope">
  347. <router-link
  348. :to="'/patients/patient/' + scope.row.id"
  349. style="color:#409eff;width:100%;display:block;"
  350. >{{ scope.row.name }}
  351. </router-link
  352. >
  353. </template>
  354. </el-table-column>
  355. <el-table-column label="性别" min-width="60" align="center">
  356. <template slot-scope="scope">
  357. <span v-if="scope.row.gender == 1">男</span>
  358. <span v-else-if="scope.row.gender == 2">女</span>
  359. <span v-else>未知</span>
  360. </template>
  361. </el-table-column>
  362. <el-table-column label="来源" min-width="60" align="center">
  363. <template slot-scope="scope">
  364. <span v-if="scope.row.source == 1">门诊</span>
  365. <span v-else-if="scope.row.source == 2">住院</span>
  366. <span v-else>未知</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="透析次数" min-width="84" align="center">
  370. <template slot-scope="scope">
  371. <span>{{ getCount(scope.row) }}</span>
  372. </template>
  373. </el-table-column>
  374. <!-- <el-table-column min-width="150" label="二维码" align="center">
  375. <template slot-scope="scope" type="text">
  376. <a style="color:#409eff" v-if="scope.row.binding_state==1" @click="openWechatBindDialog">已绑定</a>
  377. <a style="color:#409eff" v-else @click="openWechatBindDialog">生成</a>
  378. </template>
  379. </el-table-column> -->
  380. <el-table-column label="登记日期" min-width="120" align="center">
  381. <template slot-scope="scope">
  382. <span>{{ scope.row.created_time | parseTime('{y}-{m}-{d}') }}</span>
  383. </template>
  384. </el-table-column>
  385. <el-table-column label="转归" align="center">
  386. <template slot-scope="scope">
  387. <span>{{ LapsetoInfo(scope.row) }}</span>
  388. </template>
  389. </el-table-column>
  390. <el-table-column label="转出(死亡)时间" min-width="134" align="center">
  391. <template slot-scope="scope">
  392. <span>{{getTime(scope.row.death_time)}}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column label="转出(死亡)原因" align="center" min-width="150">
  396. <template slot-scope="scope">
  397. <span>{{scope.row.out_reason}}</span>
  398. </template>
  399. </el-table-column>
  400. <el-table-column label="操作" align="center" min-width="140">
  401. <template slot-scope="scope">
  402. <el-tooltip
  403. class="item"
  404. effect="dark"
  405. content="转归"
  406. placement="top"
  407. >
  408. <el-button
  409. type="primary"
  410. icon="el-icon-edit"
  411. size="small"
  412. @click="OpenSetLapseto(scope.row, scope.$index)"
  413. ></el-button>
  414. </el-tooltip>
  415. <el-tooltip
  416. class="item"
  417. effect="dark"
  418. content="预览"
  419. placement="top"
  420. >
  421. <el-button
  422. type="danger"
  423. icon="el-icon-tickets"
  424. size="small"
  425. @click="
  426. OpenView(scope.row.name, scope.row.dialysis_no, scope.row.id)
  427. "
  428. ></el-button>
  429. </el-tooltip>
  430. </template>
  431. </el-table-column>
  432. </el-table>
  433. <!-- <pagi-nation title="分页"></pagi-nation> -->
  434. <el-pagination
  435. @size-change="handleSizeChange"
  436. @current-change="handleCurrentChange"
  437. :current-page="listQuery.page"
  438. :page-sizes="[10, 20, 50, 100,200,500,1000,2000]"
  439. :page-size="listQuery.limit"
  440. background
  441. style="margin-top:20px;"
  442. align="right"
  443. layout="total, sizes, prev, pager, next, jumper"
  444. :total="total"
  445. >
  446. </el-pagination>
  447. <el-dialog
  448. title="微信绑定"
  449. :visible.sync="bindWechatDialog"
  450. width="30%"
  451. center
  452. >
  453. <img :src="wechatbindimg" width="100%" alt="" v-if="wechatbindimg"/>
  454. <i class="el-icon-loading" v-else></i>
  455. <span slot="footer" class="dialog-footer">
  456. <el-button type="primary" @click="bindWechatDialog = false"
  457. >关闭</el-button
  458. >
  459. </span>
  460. </el-dialog>
  461. <el-dialog title="转归" :visible.sync="LapsetoDialogVisible">
  462. <el-form
  463. :model="lapsetoForm"
  464. :rules="lapsetoRules"
  465. ref="lapsetoForm"
  466. label-width="140px"
  467. >
  468. <el-form-item label="治疗状态(转归):" prop="lapseto_type" required>
  469. <el-radio-group v-model="lapsetoForm.lapseto_type">
  470. <el-radio
  471. v-for="item in lapsetoOptions"
  472. :key="item.value"
  473. :label="item.value"
  474. :value="item.value"
  475. >{{ item.label }}
  476. </el-radio
  477. >
  478. </el-radio-group>
  479. </el-form-item>
  480. <!-- <el-form-item label="治疗状态(转归):" prop="lapseto_type" required>
  481. <el-radio v-model="lapsetoForm.lapseto_type" :label="lapsetoForm.lapseto_type">转出</el-radio>
  482. <el-radio v-model="lapsetoForm.lapseto_type" :label="lapsetoForm.lapseto_type">死亡</el-radio>
  483. </el-form-item> -->
  484. <el-form-item label="转归(死亡)时间 :" prop="lapseto_time" required>
  485. <el-date-picker
  486. v-model="lapsetoForm.lapseto_time"
  487. type="datetime"
  488. format="yyyy-MM-dd HH:mm:ss"
  489. value-format="yyyy-MM-dd HH:mm:ss"
  490. placeholder="选择日期时间"
  491. default-time="12:00:00"
  492. >
  493. </el-date-picker>
  494. </el-form-item>
  495. <el-form-item label="转出(死亡)原因:" v-if="lapsetoForm.lapseto_type == 2 || lapsetoForm.lapseto_type == 3">
  496. <el-input v-model="lapsetoForm.out_reason"></el-input>
  497. </el-form-item>
  498. </el-form>
  499. <div slot="footer" class="dialog-footer">
  500. <el-button @click="LapsetoDialogVisible = false">取 消</el-button>
  501. <el-button type="primary" @click="EditLapseto()">保 存</el-button>
  502. </div>
  503. </el-dialog>
  504. <el-dialog
  505. title="签到卡"
  506. :visible.sync="centerDialogVisible"
  507. :close-on-click-modal="false"
  508. @opened="ShowQRCode()"
  509. width="30%"
  510. center
  511. >
  512. <div align="center" style="margin-bottom:6px;font-size:20px">
  513. <!-- 姓名:<el-input v-model="name" size="small" style="width:200px"></el-input><br> -->
  514. 姓名:<span>{{ this.name }}</span>
  515. </div>
  516. <div align="center" style="margin-bottom:10px;font-size:20px">
  517. <!-- 透析号:<el-input v-model="dialysis_no" size="small" style="width:200px"></el-input><br> -->
  518. 透析号:<span>{{ this.dialysis_no }}</span>
  519. </div>
  520. <div id="qrcode" align="center"></div>
  521. <span slot="footer" class="dialog-footer">
  522. <!-- <el-button type="primary" @click="download()">下载</el-button> -->
  523. <el-button type="primary" @click="print()">打印</el-button>
  524. </span>
  525. </el-dialog>
  526. <div hidden="hidden">
  527. <div id="print-card-info">
  528. <div
  529. class="order_title"
  530. align="center"
  531. style="margin-bottom:20px;font-size:35px"
  532. >
  533. 签到卡
  534. </div>
  535. <div align="center" style="margin-bottom:4px;font-size:25px">
  536. 姓名:<span>&nbsp;&nbsp;{{ this.name }}</span
  537. ><br/>
  538. </div>
  539. <div align="center" style="margin-bottom:20px;font-size:25px">
  540. 透析号:<span>&nbsp;&nbsp;{{ this.dialysis_no }}</span>
  541. </div>
  542. <div>
  543. <div id="code" align="center"></div>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. <el-dialog title="传染病检查提醒通知" :visible.sync="dialogTableVisible">
  549. <el-table :data="gridData">
  550. <el-table-column property="date" align="center" label="姓名" width="150">
  551. <template slot-scope="scope">{{scope.row.name}}</template>
  552. </el-table-column>
  553. <el-table-column property="name" align="center" label="检查日期" width="200">
  554. <template slot-scope="scope">
  555. <span
  556. v-if="dateCompare(scope.row.infectious_next_record_time) == 1"
  557. >{{ scope.row.infectious_next_record_time | parseTime('{y}-{m}-{d}')}}</span>
  558. <span
  559. v-if="dateCompare(scope.row.infectious_next_record_time) == 2"
  560. style="color: red"
  561. >{{ scope.row.infectious_next_record_time | parseTime('{y}-{m}-{d}')}}</span>
  562. </template>
  563. </el-table-column>
  564. <el-table-column property="address" align="center" label="操作">
  565. <template slot-scope="scope">
  566. <el-button size="mini" type="primary" @click="jump(scope.row.id)">查看</el-button>
  567. </template>
  568. </el-table-column>
  569. </el-table>
  570. <el-pagination
  571. @size-change="handleSizeChangeOne"
  572. @current-change="handleCurrentChangeOne"
  573. :page-size="5"
  574. :page-sizes="[10, 20, 50, 100,500,1000,2000]"
  575. background
  576. style="margin-top:20px;float: right"
  577. :total="value"
  578. ></el-pagination>
  579. </el-dialog>
  580. </div>
  581. </template>
  582. <script>
  583. import { code, EditLapseto, fetchList, getMaxDialysisNo, OpenView, postExportPatients,GetRemind } from '@/api/patient'
  584. import { generateLog } from '@/api/config'
  585. import QRCode from 'qrcodejs2'
  586. import Vue from 'vue'
  587. import { Base64 } from 'js-base64'
  588. import { jsGetAge,uParseTime } from '@/utils/tools'
  589. import { log } from 'util'
  590. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  591. import UploadExcel from '@/xt_pages/components/UploadExcel'
  592. export default {
  593. name: 'Patient',
  594. components: {
  595. UploadExcel,
  596. BreadCrumb
  597. },
  598. data() {
  599. return {
  600. logs: [],
  601. downloadUrl: 'https://kuyi.shengws.com/patient_template.xltx',
  602. crumbs: [
  603. { path: false, name: '病人管理' },
  604. { path: '/patients/patients', name: '病人管理' }
  605. ],
  606. lapsetoRules: {
  607. lapseto_type: [{ required: true, message: '请选择治疗状态' }],
  608. lapseto_time: [{ required: true, message: '请选择时间' }]
  609. },
  610. currentIndex: -1,
  611. LapsetoDialogVisible: false,
  612. centerDialogVisible: false,
  613. checkAll: false,
  614. isIndeterminate: true,
  615. dialogVisible: false,
  616. exportLogVisible: false,
  617. exportVisible:false,
  618. phoneVisible:false,
  619. idCardNoVisible:false,
  620. wechatbindimg: '',
  621. isShow:true,
  622. active: true,
  623. schedulType: 0,
  624. lapsetoForm: {
  625. lapseto_type: 0,
  626. lapseto_time: '',
  627. patient_id: 0,
  628. out_reason:''
  629. },
  630. schedulArr: [
  631. { value: 0, label: '全部' },
  632. { value: 1, label: '上午' },
  633. { value: 2, label: '下午' },
  634. { value: 3, label: '晚上' }
  635. ],
  636. lapsetoOptions: [
  637. { value: 1, label: '留治' },
  638. { value: 2, label: '转出' },
  639. { value: 3, label: "死亡" },
  640. ],
  641. systemType: 0,
  642. systemArr: [
  643. { value: 0, label: '全部' },
  644. { value: 1, label: '已绑定' },
  645. { value: 2, label: '未绑定' }
  646. ],
  647. sourceType: 0,
  648. sourceID: 0,
  649. lapsetoType: 1,
  650. sourceArr: [
  651. { value: 0, label: '全部', source: 0, lapseto: 0 },
  652. // { value: 1, label: "转出", source: 0, lapseto: 2 },
  653. // { value: 2, label: "留治", source: 0, lapseto: 1 },
  654. { value: 3, label: '门诊', source: 1, lapseto: 1 },
  655. { value: 4, label: '住院', source: 2, lapseto: 1 }
  656. ],
  657. lapsetoArr: [
  658. { value: 0, label: '全部', source: 0, lapseto: 0 },
  659. { value: 1, label: '转出', source: 0, lapseto: 2 },
  660. { value: 2, label: '留治', source: 0, lapseto: 1 },
  661. { value: 3, label: '死亡', source:0, lapseto: 3 },
  662. // { value: 3, label: "门诊", source: 1, lapseto: 1 },
  663. // { value: 4, label: "住院", source: 2, lapseto: 1 }
  664. ],
  665. scheduling: [
  666. {
  667. value: 1,
  668. label: '已排班'
  669. },
  670. {
  671. value: 2,
  672. label: '未排班'
  673. }
  674. ],
  675. prescription: [
  676. {
  677. value: 1,
  678. label: '有处方'
  679. },
  680. {
  681. value: 2,
  682. label: '无处方'
  683. }
  684. ],
  685. tableData: null,
  686. searchKey: '',
  687. // value2: '',
  688. total: 0,
  689. pageTotal: 0,
  690. dialysisVisible:false,
  691. pageSelect: 0,
  692. max_dialysis_no: '',
  693. listQuery: {
  694. page: 1,
  695. limit: 10,
  696. schedul_type: 0,
  697. binding_state: 0,
  698. lapseto: 1,
  699. source: 0,
  700. start_time: '',
  701. end_time: '',
  702. keywords: '',
  703. contagion: '',
  704. reimbursement_way: '',
  705. isscheduling: '',
  706. isprescription: ''
  707. },
  708. multipleSelection: [],
  709. bindWechatDialog: false,
  710. contagionList: [],
  711. reimbursement_ways: [],
  712. patient: null,
  713. id: '',
  714. name: '',
  715. dialysis_no: '',
  716. patientPrint: {},
  717. patient_id: '',
  718. gender: '',
  719. idcardno: '',
  720. phone: '',
  721. healthcareno: '',
  722. startTime: '',
  723. export_date: [],
  724. lapeseto:"",
  725. value:13,
  726. dialogTableVisible:false,
  727. gridData:[],
  728. totalOne: 0,
  729. page: 1,
  730. limit: 5
  731. }
  732. },
  733. created() {
  734. if(sessionStorage.getItem('patientPageSize')){
  735. this.listQuery.limit = parseInt(sessionStorage.getItem('patientPageSize'))
  736. }
  737. this.getList()
  738. this.contagionList = this.$store.getters.contagions
  739. this.reimbursement_ways = this.$store.getters.reimbursement_ways
  740. const keyword = this.$route.query && this.$route.query.keyword
  741. if (typeof keyword === 'string' && keyword.length > 0) {
  742. this.listQuery.keywords = keyword
  743. this.searchKey = keyword
  744. }
  745. //获取
  746. this.GetRemindPatientList()
  747. },
  748. methods: {
  749. putOnRecord:function(type,row){
  750. if(type == 1){
  751. }else{
  752. }
  753. },
  754. generateTxt: function(log) {
  755. var content = ''
  756. var errlog = log.err_logs
  757. content = this.getContent(log)
  758. for (let i = 0; i < errlog.length; i++) {
  759. if (content.length == 0) {
  760. content = errlog[i].err_msg
  761. } else {
  762. content = content + '\n' + errlog[i].err_msg
  763. }
  764. }
  765. var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' })
  766. if (typeof url === 'object' && url instanceof Blob) {
  767. url = URL.createObjectURL(url) // 创建blob地址
  768. }
  769. const aLink = document.createElement('a')
  770. aLink.href = url
  771. aLink.download = this.timestampToTime(log.export_time) + '患者导入日志' + '.txt'
  772. aLink.click()
  773. },
  774. getContent(log) {
  775. return '您导入的文档共' + log.total_num + '条患者数据' + ',' + '已成功导入' + log.success_num + '条,导入失败' + log.fail_num + '条,'
  776. },
  777. timestampToTime(timestamp) {
  778. var date = new Date(timestamp * 1000)//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  779. var Y = date.getFullYear() + '年'
  780. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'
  781. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
  782. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
  783. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
  784. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒'
  785. return Y + M + D + h + m + s
  786. },
  787. generateLog() {
  788. let params = {
  789. 'log_type': 1
  790. }
  791. generateLog(params).then(
  792. response => {
  793. if (response.data.state === 1) {
  794. this.logs = response.data.data.logs
  795. this.exportLogVisible = true
  796. } else {
  797. this.$message.error(response.data.msg)
  798. }
  799. }
  800. )
  801. },
  802. handleSuccess({ results, header }) {
  803. if (header != undefined && header.length > 0) {
  804. var isHasName = header.includes('*姓名')
  805. var isHasGender = header.includes('*性别')
  806. var isHasPhone = header.includes('*手机号')
  807. var isHasIdCard = header.includes('*身份证号')
  808. var isHasDate = header.includes('*首次肾脏治疗时间')
  809. var isHasSource = header.includes('*患者来源')
  810. var isHasLapseto = header.includes('*治疗状态')
  811. var isHasInfectious = header.includes('*传染病')
  812. var isHasDiagnose = header.includes('诊断')
  813. var isHasDialysisNo = header.includes('透析号')
  814. var isHasDryWeight = header.includes('干体重(kg)')
  815. var isHasHeight = header.includes('身高(cm)')
  816. var isHasHomeAddress = header.includes('家庭住址')
  817. if (!(isHasName && isHasGender && isHasPhone && isHasIdCard && isHasDate && isHasSource && isHasLapseto && isHasInfectious && isHasDiagnose && isHasDialysisNo && isHasDryWeight && isHasHeight && isHasHomeAddress)) {
  818. this.dialogVisible = true
  819. return
  820. }
  821. } else {
  822. this.dialogVisible = true
  823. return
  824. }
  825. getMaxDialysisNo().then(response => {
  826. if (response.data.state === 1) {
  827. this.max_dialysis_no = response.data.data.dialysis_no
  828. if (this.max_dialysis_no == 0) {
  829. this.max_dialysis_no = 1
  830. } else {
  831. this.max_dialysis_no++
  832. }
  833. this.export_date = []
  834. for (let i = 1; i < results.length; i++) {
  835. let obj = {}
  836. for (var key in results[i]) {
  837. if (results[i]['*姓名'] === undefined) {
  838. obj['name'] = ''
  839. } else {
  840. if (key == '*姓名') {
  841. obj['name'] = results[i][key].replace(/\s/g,"")
  842. }
  843. }
  844. if (results[i]['*性别'] === undefined) {
  845. obj['gender'] = '0'
  846. } else {
  847. if (key == '*性别') {
  848. if (results[i][key] == '男') {
  849. obj['gender'] = '1'
  850. } else if (results[i][key] == '女') {
  851. obj['gender'] = '2'
  852. } else {
  853. obj['gender'] = '0'
  854. }
  855. }
  856. }
  857. if (results[i]['*手机号'] === undefined) {
  858. obj['phone'] = ''
  859. } else {
  860. if (key == '*手机号') {
  861. obj['phone'] = results[i][key].replace(/\s/g,"")
  862. }
  863. }
  864. if (results[i]['*身份证号'] === undefined) {
  865. obj['id_card_no'] = ''
  866. } else {
  867. if (key == '*身份证号') {
  868. obj['id_card_no'] = results[i][key].replace(/\s/g,"")
  869. }
  870. }
  871. if (results[i]['*首次肾脏治疗时间'] === undefined) {
  872. obj['first_treatment_date'] = ''
  873. } else {
  874. if (key == '*首次肾脏治疗时间') {
  875. var month = parseInt(results[i][key].replace(/\s/g,"").split('/')[0])
  876. var day = parseInt(results[i][key].replace(/\s/g,"").split('/')[1])
  877. var year = parseInt(results[i][key].replace(/\s/g,"").split('/')[2])
  878. if (year < 10) {
  879. year = '0' + year
  880. }
  881. if (day < 10) {
  882. day = '0' + day
  883. }
  884. if (month < 10) {
  885. month = '0' + month
  886. }
  887. obj['first_treatment_date'] = '20' + year.toString() + '/' + month.toString() + '/' + day.toString()
  888. }
  889. }
  890. if (results[i]['*患者来源'] === undefined) {
  891. obj['source'] = '3'
  892. } else {
  893. if (key == '*患者来源') {
  894. if (results[i][key] == '门诊') {
  895. obj['source'] = '1'
  896. } else if (results[i][key] == '住院') {
  897. obj['source'] = '2'
  898. } else {
  899. obj['source'] = '0'
  900. }
  901. }
  902. }
  903. if (results[i]['*治疗状态'] === undefined) {
  904. obj['lapseto'] = '3'
  905. } else {
  906. if (key == '*治疗状态') {
  907. if (results[i][key] == '留治') {
  908. obj['lapseto'] = '1'
  909. } else if (results[i][key] == '转归') {
  910. obj['lapseto'] = '2'
  911. } else {
  912. obj['lapseto'] = '0'
  913. }
  914. }
  915. }
  916. if (results[i]['*传染病'] === undefined) {
  917. let contagions = []
  918. obj['is_infectious'] = '3'
  919. obj['contagions'] = contagions
  920. } else {
  921. if (key == '*传染病') {
  922. if (results[i][key] == '无') {
  923. let contagions = []
  924. obj['is_infectious'] = '1'
  925. obj['contagions'] = contagions
  926. } else if (results[i][key] == '乙肝') {
  927. let contagions = []
  928. contagions.push(2)
  929. obj['is_infectious'] = '2'
  930. obj['contagions'] = contagions
  931. } else if (results[i][key] == '丙肝') {
  932. let contagions = []
  933. contagions.push(3)
  934. obj['is_infectious'] = '2'
  935. obj['contagions'] = contagions
  936. } else if (results[i][key] == '艾滋病') {
  937. let contagions = []
  938. contagions.push(4)
  939. obj['is_infectious'] = '2'
  940. obj['contagions'] = contagions
  941. } else if (results[i][key] == '肺结核') {
  942. let contagions = []
  943. contagions.push(5)
  944. obj['is_infectious'] = '2'
  945. obj['contagions'] = contagions
  946. } else if (results[i][key] == '梅毒') {
  947. let contagions = []
  948. contagions.push(6)
  949. obj['is_infectious'] = '2'
  950. obj['contagions'] = contagions
  951. } else {
  952. let contagions = []
  953. obj['is_infectious'] = '0'
  954. obj['contagions'] = contagions
  955. }
  956. }
  957. }
  958. if (results[i]['诊断'] === undefined) {
  959. obj['diagnose'] = ''
  960. } else {
  961. if (key == '诊断') {
  962. obj['diagnose'] = results[i][key]
  963. }
  964. }
  965. // console.log(obj)
  966. if (results[i]['透析号'] === undefined) {
  967. obj['dialysis_no'] = ''
  968. } else {
  969. if (key == '透析号') {
  970. obj['dialysis_no'] = results[i][key].replace(/\s/g,"")
  971. }
  972. }
  973. // console.log(obj)
  974. if (results[i]['干体重(kg)'] === undefined) {
  975. obj['dry_weight'] = ''
  976. } else {
  977. if (key == '干体重(kg)') {
  978. obj['dry_weight'] = results[i][key].replace(/\s/g,"")
  979. }
  980. }
  981. // console.log(obj)
  982. if (results[i]['身高(cm)'] === undefined) {
  983. obj['height'] = ''
  984. } else {
  985. if (key == '身高(cm)') {
  986. obj['height'] = results[i][key].replace(/\s/g,"")
  987. }
  988. }
  989. console.log("2222222",obj)
  990. if (results[i]['家庭住址'] === undefined) {
  991. obj['home_address'] = ''
  992. } else {
  993. if (key == '家庭住址') {
  994. obj['home_address'] = results[i][key]
  995. }
  996. }
  997. }
  998. this.export_date.push(obj)
  999. }
  1000. let index = 0
  1001. for (let i = 0; i < this.export_date.length; i++) {
  1002. if (this.export_date[i].dialysis_no == '') {
  1003. let new_dialysis_no = this.max_dialysis_no + index
  1004. // console.log(new_dialysis_no)
  1005. index++
  1006. let no = new_dialysis_no.toString()
  1007. // console.log(no)
  1008. let rep = 3 - no.length
  1009. // console.log(rep)
  1010. let tempNo = ""
  1011. if (rep == 1){
  1012. tempNo = "0"
  1013. }
  1014. if (rep == 2){
  1015. tempNo = "00"
  1016. }
  1017. // console.log(tempNo)
  1018. if (rep > 0) {
  1019. no = tempNo + no
  1020. }
  1021. this.export_date[i].dialysis_no = no
  1022. }
  1023. }
  1024. // console.log(this.export_date)
  1025. var tempExportDate = this.export_date
  1026. var tempExportDateOne = this.export_date
  1027. var tempExportDateTwo = this.export_date
  1028. const obj2 = {}
  1029. tempExportDate = tempExportDate.reduce((cur, next) => {
  1030. obj2[next.dialysis_no] ? '' : obj2[next.dialysis_no] = true && cur.push(next)
  1031. return cur
  1032. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1033. if (tempExportDate.length < this.export_date.length){
  1034. this.dialysisVisible = true
  1035. return
  1036. }
  1037. const obj3 = {}
  1038. tempExportDateOne = tempExportDateOne.reduce((cur, next) => {
  1039. obj3[next.phone] ? '' : obj3[next.phone] = true && cur.push(next)
  1040. return cur
  1041. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1042. if (tempExportDateOne.length < this.export_date.length){
  1043. this.phoneVisible = true
  1044. return
  1045. }
  1046. const obj4 = {}
  1047. tempExportDateTwo = tempExportDateTwo.reduce((cur, next) => {
  1048. obj4[next.id_card_no] ? '' : obj4[next.id_card_no] = true && cur.push(next)
  1049. return cur
  1050. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1051. if (tempExportDateTwo.length < this.export_date.length){
  1052. this.idCardNoVisible = true
  1053. return
  1054. }
  1055. // this.exportVisible = true
  1056. this.$alert('您提交的患者名单已上传成功,系统正在执行导入,请稍候点击当前页面右上角“下载日志”查看导入结果', '上传成功', {
  1057. confirmButtonText: '确定',
  1058. callback: action => {
  1059. }
  1060. });
  1061. this.isShow = false
  1062. let params = {
  1063. 'patients': this.export_date
  1064. }
  1065. console.log("export2222",this.export_date)
  1066. postExportPatients(params).then(
  1067. response => {
  1068. if (response.data.state === 1) {
  1069. this.getList()
  1070. this.isShow = true
  1071. } else {
  1072. this.isShow = true
  1073. this.$message.error(response.data.msg)
  1074. }
  1075. }
  1076. )
  1077. }
  1078. }
  1079. )
  1080. },
  1081. getCount(row) {
  1082. return row.total_dialysis + row.user_sys_before_count
  1083. },
  1084. EditLapseto() {
  1085. if (this.lapsetoForm.lapseto_time == '') {
  1086. this.$message.error('请选择时间')
  1087. return
  1088. }
  1089. // if(this.lapeseto == "留治"){
  1090. // this.lapsetoForm.lapseto_type = 1
  1091. // }
  1092. // if(this.lapeseto == "转出"){
  1093. // this.lapsetoForm.lapseto_type = 2
  1094. // }
  1095. // if(this.lapeseto == "死亡"){
  1096. // this.lapsetoForm.lapseto_type = 3
  1097. // }
  1098. console.log("22222",this.lapsetoForm)
  1099. EditLapseto(this.lapsetoForm.patient_id, this.lapsetoForm).then(
  1100. response => {
  1101. if (response.data.state === 1) {
  1102. this.$notify({
  1103. title: '成功',
  1104. message: '转归设置完成',
  1105. type: 'success',
  1106. duration: 2000
  1107. })
  1108. this.tableData[this.currentIndex].lapseto = this.lapsetoForm.lapseto_type
  1109. this.tableData[this.currentIndex].out_reason = this.lapsetoForm.out_reason
  1110. this.currentIndex = -1
  1111. this.LapsetoDialogVisible = false
  1112. } else {
  1113. this.$message.error(response.data.msg)
  1114. }
  1115. }
  1116. )
  1117. },
  1118. OpenSetLapseto(row, index) {
  1119. // if(row.lapseto == 1){
  1120. // this.lapeseto = "转出"
  1121. // }
  1122. // if(row.lapseto == 2){
  1123. // this.lapeseto = "留治"
  1124. // }
  1125. // if(row.lapeseto == 3){
  1126. // this.lapeseto = "死亡"
  1127. // }
  1128. this.patient = row
  1129. this.currentIndex = index
  1130. this.lapsetoForm.lapseto_time = ''
  1131. this.lapsetoForm.lapseto_type = row.lapseto
  1132. this.lapsetoForm.patient_id = row.id
  1133. this.lapsetoForm.out_reason = row.out_reason
  1134. this.LapsetoDialogVisible = true
  1135. },
  1136. LapsetoInfo(row) {
  1137. console.log("row",row)
  1138. if (typeof row.lapseto === 'undefined' ||(row.lapseto !== 1 && row.lapseto !== 2 && row.lapseto !==3)) {
  1139. return '未设置'
  1140. } else if (row.lapseto === 1) {
  1141. return '留治'
  1142. } else if(row.lapseto === 2) {
  1143. return '转出'
  1144. }else if(row.lapseto === 3){
  1145. return '死亡'
  1146. }
  1147. },
  1148. openWechatBindDialog() {
  1149. this.bindWechatDialog = true
  1150. },
  1151. handleCheckAllChange(val) {
  1152. // console.log(val)
  1153. // console.log(this.checkAll)
  1154. // console.log(this.isIndeterminate)
  1155. },
  1156. handleSelectionChange(val) {
  1157. this.multipleSelection = val
  1158. this.pageSelect = this.multipleSelection.length
  1159. },
  1160. handleCheckedCitiesChange(value) {
  1161. const checkedCount = value.length
  1162. this.checkAll = checkedCount === this.cities.length
  1163. this.isIndeterminate =
  1164. checkedCount > 0 && checkedCount < this.cities.length
  1165. },
  1166. handleSizeChange(val) {
  1167. sessionStorage.setItem('patientPageSize',val)
  1168. this.listQuery.limit = val
  1169. this.getList()
  1170. },
  1171. handleCurrentChange(val) {
  1172. this.listQuery.page = val
  1173. this.getList()
  1174. },
  1175. changeCategoryId(categoryId) {
  1176. this.categoryId = categoryId
  1177. },
  1178. selectSchedulType(scheduleType) {
  1179. // alert(scheduleType);/
  1180. this.schedulType = scheduleType
  1181. this.listQuery.schedul_type = scheduleType
  1182. this.getList()
  1183. },
  1184. selectSystemType(systemType) {
  1185. this.systemType = systemType
  1186. this.listQuery.binding_state = systemType
  1187. this.getList()
  1188. },
  1189. selectLapseTo(lapseto) {
  1190. this.lapsetoType = lapseto
  1191. this.listQuery.lapseto = lapseto
  1192. this.getList()
  1193. },
  1194. selectSource(source) {
  1195. this.sourceType = source
  1196. this.listQuery.source = source
  1197. this.getList()
  1198. },
  1199. changeTimeOne(val) {
  1200. var time = this.getTimestamp(val) - this.end_time
  1201. if (time > 0) {
  1202. this.$message.error('结束时间不能小于开始时间')
  1203. this.listQuery.start_time = ''
  1204. } else {
  1205. this.getList()
  1206. this.startTime = this.getTimestamp(val)
  1207. }
  1208. },
  1209. changeTime(val) {
  1210. var time = this.getTimestamp(val) - this.startTime
  1211. if (time < 0) {
  1212. this.$message.error('结束时间不能小于开始时间')
  1213. this.listQuery.end_time = ''
  1214. } else {
  1215. this.getList()
  1216. this.end_time = this.getTimestamp(val)
  1217. }
  1218. },
  1219. getTimestamp(time) {
  1220. // 把时间日期转成时间戳
  1221. return new Date(time).getTime() / 1000
  1222. },
  1223. search() {
  1224. this.listQuery.keywords = this.searchKey
  1225. this.getList()
  1226. },
  1227. changeOtherSearch() {
  1228. this.getList()
  1229. },
  1230. getList() {
  1231. console.log("parasm2222",this.listQuery)
  1232. fetchList(this.listQuery).then(response => {
  1233. if (response.data.state === 0) {
  1234. this.$message.error(response.data.msg)
  1235. return false
  1236. } else {
  1237. this.tableData = response.data.data.patients
  1238. console.log('病人是', this.tableData)
  1239. this.pageTotal = this.tableData.length
  1240. this.total = response.data.data.total
  1241. }
  1242. })
  1243. },
  1244. OpenView(name, number, id) {
  1245. this.name = name
  1246. this.dialysis_no = number
  1247. this.centerDialogVisible = true
  1248. OpenView(id).then(response => {
  1249. if (response.data.state === 0) {
  1250. this.$message.error(response.data.msg)
  1251. return false
  1252. } else {
  1253. var patient = response.data.data.patient
  1254. console.log('二维码病人信息', patient)
  1255. this.id = patient.id
  1256. this.name = patient.name
  1257. this.gender = patient.gender
  1258. this.idcardno = patient.id_card_no
  1259. this.phone = patient.phone
  1260. this.healthcareno = patient.health_care_no
  1261. }
  1262. })
  1263. },
  1264. ShowQRCode() {
  1265. document.getElementById('qrcode').innerHTML = ''
  1266. this.qrcode = this.$QRCode()
  1267. },
  1268. download() {
  1269. alert('aaaa')
  1270. },
  1271. print() {
  1272. var ptime = Math.round(new Date().getTime() / 1000)
  1273. this.print_time = uParseTime(ptime, '{y}年{m}月{d}日')
  1274. const style =
  1275. '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .print_main_content .order_title { text-align: center; font-size: 23px; line-height: 50px; font-weight: 500; } .print_main_content table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } .print_main_content table tbody tr td { border: 1px solid; text-align: center; padding: 10px 8px; } .td_proj_title { font-size: 18px; line-height: 25px; font-weight: 500; } .td_proj_content { font-size: 18px; line-height: 25px; } .td_align_left { text-align: left; } .print_footnote_panel { font-size: 17px; line-height: 40px; } .print_footnote_panel .proj { display: inline-block; width: 49%; } .print_footnote_panel .proj .proj_title { font-weight: 500;} }'
  1276. setTimeout(() => {
  1277. printJS({
  1278. printable: 'print-card-info',
  1279. type: 'html',
  1280. style: style,
  1281. scanStyles: false
  1282. })
  1283. }, 1)
  1284. var id = this.id
  1285. var name = this.name
  1286. var gender = this.gender
  1287. if (gender === 1) {
  1288. gender = '男'
  1289. }
  1290. if (gender === 2) {
  1291. gender = '女'
  1292. }
  1293. var idcardno = this.idcardno
  1294. var phone = this.phone
  1295. var healthcareno = this.healthcareno
  1296. var dialysisno = this.dialysis_no
  1297. // Base64位加密
  1298. // var aid = this.Base64.encode(id);
  1299. // var aname = this.Base64.encode(name);
  1300. // var agender = this.Base64.encode(gender);
  1301. // var aidcardno = this.Base64.encode(idcardno);
  1302. // var aphone = this.Base64.encode(phone);
  1303. // var ahealthcareno = this.Base64.encode(healthcareno);
  1304. // var adialysisno = this.Base64.encode(dialysisno);
  1305. // 调用生成二维码的方法
  1306. this.$options.methods.qrcode(
  1307. id,
  1308. name,
  1309. gender,
  1310. idcardno,
  1311. phone,
  1312. healthcareno,
  1313. dialysisno
  1314. )
  1315. },
  1316. qrcode(id, name, gender, idcardno, phone, healthcareno, dialysisno) {
  1317. document.getElementById('code').innerHTML = ''
  1318. const qrcode = new QRCode('code', {
  1319. width: 200,
  1320. height: 200,
  1321. text:
  1322. 'user_id:' +
  1323. id +
  1324. ',' +
  1325. 'name:' +
  1326. name +
  1327. ',' +
  1328. 'dialysis_no:' +
  1329. dialysisno +
  1330. ',' +
  1331. 'gender:' +
  1332. gender +
  1333. ',' +
  1334. 'idcard_no:' +
  1335. idcardno +
  1336. ',' +
  1337. 'phone:' +
  1338. phone +
  1339. ',' +
  1340. 'healthcare_no:' +
  1341. healthcareno
  1342. })
  1343. },
  1344. toRemind(){
  1345. this.dialogTableVisible = true
  1346. },
  1347. GetRemindPatientList(){
  1348. const params = {
  1349. page: this.page,
  1350. limit: this.limit
  1351. }
  1352. GetRemind(params).then(response=>{
  1353. if(response.data.state == 1){
  1354. this.gridData = response.data.data.patients;
  1355. this.totalOne = response.data.data.total;
  1356. var value = response.data.data.total
  1357. if(value == 0){
  1358. this.value = ""
  1359. }
  1360. if(value != 0){
  1361. this.value = value
  1362. }
  1363. }
  1364. })
  1365. },
  1366. jump(id) {
  1367. // this.$router.replace({ path: "/patients/inspection?id=" + id });
  1368. this.$router.replace({path:"/patients/patients/"+id +"/inspectionInfectious"})
  1369. },
  1370. dateCompare(date) {
  1371. var date1 = Date.parse(new Date()) / 1000;
  1372. if (date > date1) {
  1373. return 1;
  1374. } else {
  1375. return 2;
  1376. }
  1377. },
  1378. handleSizeChangeOne(val) {
  1379. this.limit = val
  1380. this.GetRemindPatientList();
  1381. },
  1382. handleCurrentChangeOne(val) {
  1383. this.page = val;
  1384. this.GetRemindPatientList();
  1385. },
  1386. getTime(val) {
  1387. if(val < 0){
  1388. return ""
  1389. }
  1390. if(val == ""){
  1391. return ""
  1392. }else {
  1393. return uParseTime(val, '{y}-{m}-{d}')
  1394. }
  1395. },
  1396. toExport(){
  1397. import('@/vendor/Export2Excel').then(excel => {
  1398. console.log("hhhh323223",this.tableData)
  1399. for(let i=0;i<this.tableData.length;i++){
  1400. if(this.tableData[i].gender == 1){
  1401. this.tableData[i].genders = "男"
  1402. }
  1403. if(this.tableData[i].gender == 2){
  1404. this.tableData[i].genders = "女"
  1405. }
  1406. this.tableData[i].age_year = this.tranAge(this.tableData[i])
  1407. this.tableData[i].first_dialysis_date = this.getTime(this.tableData[i].first_dialysis_date)
  1408. if(this.tableData[i].lapseto == 0){
  1409. this.tableData[i].lapesetos = ""
  1410. }
  1411. if(this.tableData[i].lapseto == 1){
  1412. this.tableData[i].lapesetos = "留治"
  1413. }
  1414. if(this.tableData[i].lapseto == 2){
  1415. this.tableData[i].lapesetos = "转归"
  1416. }
  1417. if(this.tableData[i].source == 0){
  1418. this.tableData[i].sources = ""
  1419. }
  1420. if(this.tableData[i].source == 1){
  1421. this.tableData[i].sources = "门诊"
  1422. }
  1423. if(this.tableData[i].source == 2){
  1424. this.tableData[i].sources = "住院"
  1425. }
  1426. if(this.tableData[i].is_infectious == 0){
  1427. this.tableData[i].is_infectiouss = ""
  1428. }
  1429. if(this.tableData[i].is_infectious == 1){
  1430. this.tableData[i].is_infectiouss = "阴性"
  1431. }
  1432. if(this.tableData[i].is_infectious == 2){
  1433. this.tableData[i].is_infectiouss = "阳性"
  1434. }
  1435. }
  1436. const tHeader = ['姓名', '性别', '身份证号码','年龄','透析号','首次治疗时间','本人电话','患者来源','治疗状态','传染病']
  1437. const filterVal = ['name', 'genders', 'id_card_no','age_year','dialysis_no','first_dialysis_date','phone','sources','lapesetos','is_infectiouss']
  1438. console.log("table",this.tableData)
  1439. const data = this.formatJson(filterVal, this.tableData)
  1440. excel.export_json_to_excel({
  1441. header: tHeader,
  1442. data,
  1443. filename: '患者名单'
  1444. })
  1445. this.downloadLoading = false
  1446. })
  1447. },
  1448. formatJson(filterVal, jsonData) {
  1449. return jsonData.map(v => filterVal.map(j => v[j]));
  1450. },
  1451. tranAge(val) {
  1452. if(val.birthday){
  1453. var birth = uParseTime(val.birthday, '{y}-{m}-{d}');
  1454. return jsGetAge(birth, '-');
  1455. }
  1456. },
  1457. }
  1458. }
  1459. Vue.prototype.$QRCode = function() {
  1460. var name = this.name
  1461. var dialysis_no = this.dialysis_no
  1462. var id = this.id
  1463. var gender = this.gender
  1464. if (gender === 1) {
  1465. gender = '男'
  1466. }
  1467. if (gender === 2) {
  1468. gender = '女'
  1469. }
  1470. var idcardno = this.idcardno
  1471. var phone = this.phone
  1472. var healthcareno = this.healthcareno
  1473. // BASE64加密
  1474. // var eid = this.Base64.encode(id)
  1475. // var ename = this.Base64.encode(name)
  1476. // var egender = this.Base64.encode(gender)
  1477. // var eidcardno = this.Base64.encode(idcardno)
  1478. // var ephone = this.Base64.encode(phone)
  1479. // var ehealthcareno = this.Base64.encode(healthcareno)
  1480. // var edialysisno = this.Base64.encode(dialysis_no)
  1481. var eid = id
  1482. var ename = name
  1483. var egender = gender
  1484. var eidcardno = idcardno
  1485. var ephone = phone
  1486. var ehealthcareno = healthcareno
  1487. var edialysisno = dialysis_no
  1488. console.log(
  1489. 'user_id' + eid,
  1490. 'name:' + ename,
  1491. 'gender:' + egender,
  1492. 'idcard_no:' + eidcardno,
  1493. 'phone:' + ephone,
  1494. 'healthcare_no:' + ehealthcareno,
  1495. 'edialysis_no:' + edialysisno
  1496. )
  1497. const salting = 'admin-authority'
  1498. new QRCode('qrcode', {
  1499. width: 150, // 设置宽度
  1500. height: 150, // 设置高度
  1501. text:
  1502. 'user_id:' +
  1503. eid +
  1504. ',' +
  1505. 'name:' +
  1506. ename +
  1507. ',' +
  1508. 'dialysis_no:' +
  1509. edialysisno +
  1510. ',' +
  1511. 'gender:' +
  1512. egender +
  1513. ',' +
  1514. 'idcard_no:' +
  1515. eidcardno +
  1516. ',' +
  1517. 'phone:' +
  1518. ephone +
  1519. ',' +
  1520. 'healthcare_no:' +
  1521. ehealthcareno
  1522. })
  1523. }
  1524. </script>
  1525. <style rel="stylesheet/scss" lang="scss">
  1526. .app-container {
  1527. /*margin: 20 px;*/
  1528. font-size: 15px;
  1529. .filter-container {
  1530. padding-bottom: 5px;
  1531. }
  1532. .search-component {
  1533. width: 500px;
  1534. .searchBox {
  1535. width: 300px;
  1536. height: 36px;
  1537. line-height: 36px;
  1538. padding-left: 15px;
  1539. border: 1px #dcdfe6 solid;
  1540. border-right: none;
  1541. outline: none;
  1542. float: left;
  1543. border-radius: 6px 0 0 6px;
  1544. font-size: 14px;
  1545. color: #333;
  1546. background: #fff;
  1547. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  1548. }
  1549. .searchBtn {
  1550. background-color: #409eff;
  1551. color: #fff;
  1552. font-size: 15px;
  1553. text-align: center;
  1554. height: 36px;
  1555. line-height: 36px;
  1556. float: left;
  1557. outline: none;
  1558. width: 70px;
  1559. border: none;
  1560. border-radius: 0 6px 6px 0;
  1561. font-family: "Microsoft Yahei";
  1562. cursor: pointer;
  1563. }
  1564. }
  1565. .amount {
  1566. font-weight: normal;
  1567. padding: 10px 0 0 0;
  1568. color: #606266;
  1569. font-size: 14px;
  1570. span {
  1571. color: #ef2525;
  1572. font-family: "Arial";
  1573. padding: 0 2px;
  1574. }
  1575. }
  1576. .print_main_content {
  1577. background-color: white;
  1578. width: 960px;
  1579. margin: 0 auto;
  1580. padding: 0 0 20px 0;
  1581. }
  1582. .print_main_content .order_title {
  1583. text-align: center;
  1584. font-size: 23px;
  1585. line-height: 50px;
  1586. font-weight: 500px;
  1587. }
  1588. .print_main_content table {
  1589. width: 100%;
  1590. border: 1px solid;
  1591. border-collapse: collapse;
  1592. padding: 2px;
  1593. }
  1594. .print_main_content table tbody tr td {
  1595. border: 1px solid;
  1596. text-align: center;
  1597. /* font-size: 17px; */
  1598. padding: 10px 8px;
  1599. }
  1600. .td_proj_title {
  1601. font-size: 18px;
  1602. line-height: 25px;
  1603. font-weight: 500;
  1604. }
  1605. .td_proj_content {
  1606. font-size: 18px;
  1607. line-height: 25px;
  1608. }
  1609. .td_align_left {
  1610. text-align: left;
  1611. }
  1612. .print_footnote_panel {
  1613. font-size: 17px;
  1614. line-height: 40px;
  1615. }
  1616. .print_footnote_panel .proj {
  1617. display: inline-block;
  1618. width: 49%;
  1619. }
  1620. .print_footnote_panel .proj .proj_title {
  1621. font-weight: 500;
  1622. }
  1623. }
  1624. .el-table td,
  1625. .el-table th.is-leaf,
  1626. .el-table--border,
  1627. .el-table--group {
  1628. border-color: #d0d3da;
  1629. }
  1630. .el-table--border::after,
  1631. .el-table--group::after,
  1632. .el-table::before {
  1633. background-color: #d0d3da;
  1634. }
  1635. .el-select--small {
  1636. width: 196px;
  1637. }
  1638. .el-checkbox__inner::after {
  1639. height: 10px;
  1640. left: 7px;
  1641. }
  1642. .el-checkbox__inner {
  1643. width: 20px;
  1644. height: 20px;
  1645. }
  1646. </style>