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

patients.vue 53KB

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