patients.vue 53KB

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