patients.vue 52KB

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