patients.vue 54KB

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