patients.vue 56KB

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