patients.vue 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  7. @click="$router.push({ path: '/patients/create' })"
  8. class="filter-item"
  9. style="float:right;"
  10. type="primary"
  11. icon="el-icon-circle-plus-outline"
  12. size="small"
  13. >新增</el-button
  14. >
  15. </div>
  16. <div class="app-container">
  17. <div class="cell clearfix">
  18. <!-- <label class="title"><span class="name">病人搜索</span> : </label> -->
  19. <el-input
  20. style="width: 400px;"
  21. v-model.trim="searchKey"
  22. class="filter-item"
  23. placeholder="病人姓名/透析号"
  24. size="small"
  25. />
  26. <el-button
  27. class="filter-item"
  28. type="primary"
  29. icon="el-icon-search"
  30. @click="search"
  31. size="small"
  32. >搜索</el-button
  33. >
  34. </div>
  35. <div class="cell clearfix">
  36. <label class="title"><span class="name">日期查询</span> : </label>
  37. <el-date-picker
  38. size="small"
  39. clearable
  40. v-model="listQuery.start_time"
  41. prefix-icon="el-icon-date"
  42. @change="changeTimeOne"
  43. :editable="false"
  44. style="width: 196px;"
  45. type="date"
  46. placeholder="选择日期时间"
  47. align="right"
  48. format="yyyy-MM-dd"
  49. value-format="yyyy-MM-dd"
  50. >
  51. </el-date-picker>
  52. <span class="cellLine"> - </span>
  53. <el-date-picker
  54. size="small"
  55. clearable
  56. v-model="listQuery.end_time"
  57. prefix-icon="el-icon-date"
  58. @change="changeTime"
  59. :editable="false"
  60. style="width: 196px;"
  61. type="date"
  62. placeholder="选择日期时间"
  63. align="right"
  64. format="yyyy-MM-dd"
  65. value-format="yyyy-MM-dd"
  66. >
  67. </el-date-picker>
  68. </div>
  69. <div class="cell clearfix">
  70. <label class="title"><span class="name">排班班次</span> : </label>
  71. <div class="time ">
  72. <ul class="">
  73. <li
  74. :class="item.value == schedulType ? 'active' : ''"
  75. @click="selectSchedulType(item.value)"
  76. v-for="item in schedulArr"
  77. :key="item.value"
  78. >
  79. {{ item.label }}
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. <div class="cell clearfix">
  85. <label class="title"><span class="name">状态</span> : </label>
  86. <div class="time ">
  87. <ul class="">
  88. <li
  89. :class="item.value == systemType ? 'active' : ''"
  90. @click="selectSystemType(item.value)"
  91. v-for="item in systemArr"
  92. :key="item.value"
  93. >
  94. {{ item.label }}
  95. </li>
  96. </ul>
  97. </div>
  98. </div>
  99. <div class="cell clearfix">
  100. <label class="title"><span class="name">转归情况</span> : </label>
  101. <div class="time ">
  102. <ul class="">
  103. <li
  104. :class="item.lapseto == lapsetoType ? 'active' : ''"
  105. @click="selectLapseTo(item.lapseto)"
  106. v-for="item in lapsetoArr"
  107. :key="item.value"
  108. >
  109. {{ item.label }}
  110. </li>
  111. </ul>
  112. </div>
  113. </div>
  114. <div class="cell clearfix">
  115. <label class="title"><span class="name">病人来源</span> : </label>
  116. <div class="time ">
  117. <ul class="">
  118. <li
  119. :class="item.source == sourceType ? 'active' : ''"
  120. @click="selectSource(item.source)"
  121. v-for="item in sourceArr"
  122. :key="item.value"
  123. >
  124. {{ item.label }}
  125. </li>
  126. </ul>
  127. </div>
  128. </div>
  129. <div class="cell clearfix">
  130. <label class="title"><span class="name">其它查询</span> : </label>
  131. <el-select
  132. v-model="listQuery.contagion"
  133. size="small"
  134. clearable
  135. placeholder="传染病"
  136. @change="changeOtherSearch"
  137. >
  138. <el-option
  139. v-for="item in contagionList"
  140. :key="item.id"
  141. :label="item.name"
  142. :value="item.id"
  143. >
  144. </el-option>
  145. </el-select>
  146. <el-select
  147. style="margin-left: 10px;"
  148. v-model="listQuery.reimbursement_way"
  149. size="small"
  150. clearable
  151. placeholder="付费方式"
  152. @change="changeOtherSearch"
  153. >
  154. <el-option
  155. v-for="item in reimbursement_ways"
  156. :key="item.id"
  157. :label="item.name"
  158. :value="item.id"
  159. >
  160. </el-option>
  161. </el-select>
  162. <el-select
  163. v-model="listQuery.isscheduling"
  164. collapse-tags
  165. style="margin-left: 10px;"
  166. clearable
  167. placeholder="排班情况"
  168. size="small"
  169. @change="changeOtherSearch"
  170. >
  171. <el-option
  172. v-for="item in scheduling"
  173. :key="item.value"
  174. :label="item.label"
  175. :value="item.value"
  176. >
  177. </el-option>
  178. </el-select>
  179. <el-select
  180. v-model="listQuery.isprescription"
  181. collapse-tags
  182. style="margin-left:10px;"
  183. clearable
  184. placeholder="透析处方"
  185. size="small"
  186. @change="changeOtherSearch"
  187. >
  188. <el-option
  189. v-for="item in prescription"
  190. :key="item.value"
  191. :label="item.label"
  192. :value="item.value"
  193. >
  194. </el-option>
  195. </el-select>
  196. </div>
  197. <el-table
  198. ref="multipleTable"
  199. :row-style="{ color: '#303133' }"
  200. :header-cell-style="{
  201. backgroundColor: 'rgb(245, 247, 250)',
  202. color: '#606266'
  203. }"
  204. :data="tableData"
  205. border
  206. fit
  207. highlight-current-row
  208. style="width: 100%;margin-top: 10px;"
  209. @selection-change="handleSelectionChange"
  210. >
  211. <el-table-column
  212. align="center"
  213. label="全选"
  214. width="60px"
  215. type="selection"
  216. ></el-table-column>
  217. <el-table-column
  218. type="index"
  219. label="序号"
  220. width="60px"
  221. align="center"
  222. ></el-table-column>
  223. <el-table-column
  224. label="透析号"
  225. min-width="80"
  226. property="dialysis_no"
  227. align="center"
  228. style="color:red"
  229. ></el-table-column>
  230. <el-table-column
  231. label="住院号"
  232. min-width="80"
  233. property="admission_number"
  234. align="center"
  235. >
  236. </el-table-column>
  237. <el-table-column
  238. property="name"
  239. label="姓名"
  240. min-width="80"
  241. align="center"
  242. >
  243. <template slot-scope="scope">
  244. <router-link
  245. :to="'/patients/patient/' + scope.row.id"
  246. style="color:#409eff"
  247. >{{ scope.row.name }}</router-link
  248. >
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="性别" min-width="80" align="center">
  252. <template slot-scope="scope">
  253. <span v-if="scope.row.gender == 1">男</span>
  254. <span v-else-if="scope.row.gender == 2">女</span>
  255. <span v-else>未知</span>
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="来源" min-width="80" align="center">
  259. <template slot-scope="scope">
  260. <span v-if="scope.row.source == 1">门诊</span>
  261. <span v-else-if="scope.row.source == 2">住院</span>
  262. <span v-else>未知</span>
  263. </template>
  264. </el-table-column>
  265. <el-table-column
  266. label="透析次数"
  267. min-width="94"
  268. align="center"
  269. >
  270. <template slot-scope="scope" >
  271. <span>{{getCount(scope.row)}}</span>
  272. </template>
  273. </el-table-column>
  274. <!-- <el-table-column min-width="150" label="二维码" align="center">
  275. <template slot-scope="scope" type="text">
  276. <a style="color:#409eff" v-if="scope.row.binding_state==1" @click="openWechatBindDialog">已绑定</a>
  277. <a style="color:#409eff" v-else @click="openWechatBindDialog">生成</a>
  278. </template>
  279. </el-table-column> -->
  280. <el-table-column label="日期" min-width="144" align="center">
  281. <template slot-scope="scope">
  282. <span>{{ scope.row.created_time | parseTime("{y}-{m}-{d}") }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="转归" align="center">
  286. <template slot-scope="scope">
  287. <span>{{ LapsetoInfo(scope.row) }}</span>
  288. </template>
  289. </el-table-column>
  290. <el-table-column label="操作" align="center" min-width="140">
  291. <template slot-scope="scope">
  292. <el-tooltip
  293. class="item"
  294. effect="dark"
  295. content="转归"
  296. placement="top"
  297. >
  298. <el-button
  299. type="primary"
  300. icon="el-icon-edit"
  301. size="small"
  302. @click="OpenSetLapseto(scope.row, scope.$index)"
  303. ></el-button>
  304. </el-tooltip>
  305. <el-tooltip
  306. class="item"
  307. effect="dark"
  308. content="预览"
  309. placement="top"
  310. >
  311. <el-button
  312. type="danger"
  313. icon="el-icon-tickets"
  314. size="small"
  315. @click="
  316. OpenView(scope.row.name, scope.row.dialysis_no, scope.row.id)
  317. "
  318. ></el-button>
  319. </el-tooltip>
  320. </template>
  321. </el-table-column>
  322. </el-table>
  323. <!-- <pagi-nation title="分页"></pagi-nation> -->
  324. <el-pagination
  325. @size-change="handleSizeChange"
  326. @current-change="handleCurrentChange"
  327. :current-page="listQuery.pate"
  328. :page-sizes="[10, 20, 50, 100]"
  329. :page-size="10"
  330. background
  331. style="margin-top:20px;"
  332. align="right"
  333. layout="total, sizes, prev, pager, next, jumper"
  334. :total="total"
  335. >
  336. </el-pagination>
  337. <el-dialog
  338. title="微信绑定"
  339. :visible.sync="bindWechatDialog"
  340. width="30%"
  341. center
  342. >
  343. <img :src="wechatbindimg" width="100%" alt="" v-if="wechatbindimg" />
  344. <i class="el-icon-loading" v-else></i>
  345. <span slot="footer" class="dialog-footer">
  346. <el-button type="primary" @click="bindWechatDialog = false"
  347. >关闭</el-button
  348. >
  349. </span>
  350. </el-dialog>
  351. <el-dialog title="转归" :visible.sync="LapsetoDialogVisible">
  352. <el-form
  353. :model="lapsetoForm"
  354. :rules="lapsetoRules"
  355. ref="lapsetoForm"
  356. label-width="140px"
  357. >
  358. <el-form-item label="治疗状态(转归):" prop="lapseto_type" required>
  359. <el-radio-group v-model="lapsetoForm.lapseto_type">
  360. <el-radio
  361. v-for="item in lapsetoOptions"
  362. :key="item.value"
  363. :label="item.value"
  364. :value="item.value"
  365. >{{ item.label }}</el-radio
  366. >
  367. </el-radio-group>
  368. </el-form-item>
  369. <el-form-item label="转归时间 :" prop="lapseto_time" required>
  370. <el-date-picker
  371. v-model="lapsetoForm.lapseto_time"
  372. type="datetime"
  373. format="yyyy-MM-dd HH:mm:ss"
  374. value-format="yyyy-MM-dd HH:mm:ss"
  375. placeholder="选择日期时间"
  376. default-time="12:00:00"
  377. >
  378. </el-date-picker>
  379. </el-form-item>
  380. </el-form>
  381. <div slot="footer" class="dialog-footer">
  382. <el-button @click="LapsetoDialogVisible = false">取 消</el-button>
  383. <el-button type="primary" @click="EditLapseto()">保 存</el-button>
  384. </div>
  385. </el-dialog>
  386. <el-dialog
  387. title="签到卡"
  388. :visible.sync="centerDialogVisible"
  389. :close-on-click-modal="false"
  390. @opened="ShowQRCode()"
  391. width="30%"
  392. center
  393. >
  394. <div align="center" style="margin-bottom:6px;font-size:20px">
  395. <!-- 姓名:<el-input v-model="name" size="small" style="width:200px"></el-input><br> -->
  396. 姓名:<span>{{ this.name }}</span>
  397. </div>
  398. <div align="center" style="margin-bottom:10px;font-size:20px">
  399. <!-- 透析号:<el-input v-model="dialysis_no" size="small" style="width:200px"></el-input><br> -->
  400. 透析号:<span>{{ this.dialysis_no }}</span>
  401. </div>
  402. <div id="qrcode" align="center"></div>
  403. <span slot="footer" class="dialog-footer">
  404. <!-- <el-button type="primary" @click="download()">下载</el-button> -->
  405. <el-button type="primary" @click="print()">打印</el-button>
  406. </span>
  407. </el-dialog>
  408. <div hidden="hidden">
  409. <div id="print-card-info">
  410. <div
  411. class="order_title"
  412. align="center"
  413. style="margin-bottom:20px;font-size:35px"
  414. >
  415. 签到卡
  416. </div>
  417. <div align="center" style="margin-bottom:4px;font-size:25px">
  418. 姓名:<span>&nbsp;&nbsp;{{ this.name }}</span
  419. ><br />
  420. </div>
  421. <div align="center" style="margin-bottom:20px;font-size:25px">
  422. 透析号:<span>&nbsp;&nbsp;{{ this.dialysis_no }}</span>
  423. </div>
  424. <div>
  425. <div id="code" align="center"></div>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. </template>
  432. <script>
  433. import { fetchList, EditLapseto, OpenView, code } from "@/api/patient";
  434. import QRCode from "qrcodejs2";
  435. import Vue from "vue";
  436. import print from "print-js";
  437. import { Base64 } from "js-base64";
  438. import { uParseTime } from "@/utils/tools";
  439. import { log } from "util";
  440. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  441. export default {
  442. name: "Patient",
  443. components: {
  444. BreadCrumb
  445. },
  446. data() {
  447. return {
  448. crumbs: [
  449. { path: false, name: "病人管理" },
  450. { path: "/patients/patients", name: "病人管理" }
  451. ],
  452. lapsetoRules: {
  453. lapseto_type: [{ required: true, message: "请选择治疗状态" }],
  454. lapseto_time: [{ required: true, message: "请选择转归时间" }]
  455. },
  456. currentIndex: -1,
  457. LapsetoDialogVisible: false,
  458. centerDialogVisible: false,
  459. checkAll: false,
  460. isIndeterminate: true,
  461. wechatbindimg: "",
  462. active: true,
  463. schedulType: 0,
  464. lapsetoForm: {
  465. lapseto_type: 0,
  466. lapseto_time: "",
  467. patient_id: 0
  468. },
  469. schedulArr: [
  470. { value: 0, label: "全部" },
  471. { value: 1, label: "上午" },
  472. { value: 2, label: "下午" },
  473. { value: 3, label: "晚上" }
  474. ],
  475. lapsetoOptions: [
  476. { value: 1, label: "留治" },
  477. { value: 2, label: "转出" }
  478. ],
  479. systemType: 0,
  480. systemArr: [
  481. { value: 0, label: "全部" },
  482. { value: 1, label: "已绑定" },
  483. { value: 2, label: "未绑定" }
  484. ],
  485. sourceType: 0,
  486. sourceID: 0,
  487. lapsetoType: 0,
  488. sourceArr: [
  489. { value: 0, label: "全部", source: 0, lapseto: 0 },
  490. // { value: 1, label: "转出", source: 0, lapseto: 2 },
  491. // { value: 2, label: "留治", source: 0, lapseto: 1 },
  492. { value: 3, label: "门诊", source: 1, lapseto: 1 },
  493. { value: 4, label: "住院", source: 2, lapseto: 1 }
  494. ],
  495. lapsetoArr: [
  496. { value: 0, label: "全部", source: 0, lapseto: 0 },
  497. { value: 1, label: "转出", source: 0, lapseto: 2 },
  498. { value: 2, label: "留治", source: 0, lapseto: 1 }
  499. // { value: 3, label: "门诊", source: 1, lapseto: 1 },
  500. // { value: 4, label: "住院", source: 2, lapseto: 1 }
  501. ],
  502. scheduling: [
  503. {
  504. value: 1,
  505. label: "已排班"
  506. },
  507. {
  508. value: 2,
  509. label: "未排班"
  510. }
  511. ],
  512. prescription: [
  513. {
  514. value: 1,
  515. label: "有处方"
  516. },
  517. {
  518. value: 2,
  519. label: "无处方"
  520. }
  521. ],
  522. tableData: null,
  523. searchKey: "",
  524. // value2: '',
  525. total: 0,
  526. pageTotal: 0,
  527. pageSelect: 0,
  528. listQuery: {
  529. page: 1,
  530. limit: 10,
  531. schedul_type: 0,
  532. binding_state: 0,
  533. lapseto: 0,
  534. source: 0,
  535. start_time: "",
  536. end_time: "",
  537. keywords: "",
  538. contagion: "",
  539. reimbursement_way: "",
  540. isscheduling: "",
  541. isprescription: ""
  542. },
  543. multipleSelection: [],
  544. bindWechatDialog: false,
  545. contagionList: [],
  546. reimbursement_ways: [],
  547. patient: null,
  548. id: "",
  549. name: "",
  550. dialysis_no: "",
  551. patientPrint: {},
  552. patient_id: "",
  553. gender: "",
  554. idcardno: "",
  555. phone: "",
  556. healthcareno: "",
  557. startTime: ""
  558. };
  559. },
  560. created() {
  561. this.getList();
  562. this.contagionList = this.$store.getters.contagions;
  563. this.reimbursement_ways = this.$store.getters.reimbursement_ways;
  564. const keyword = this.$route.query && this.$route.query.keyword;
  565. if (typeof keyword === "string" && keyword.length > 0) {
  566. this.listQuery.keywords = keyword;
  567. this.searchKey = keyword;
  568. }
  569. },
  570. methods: {
  571. getCount(row){
  572. console.log(row)
  573. return row.total_dialysis + row.user_sys_before_count
  574. },
  575. EditLapseto() {
  576. if (this.lapsetoForm.lapseto_time == "") {
  577. this.$message.error("请选择时间");
  578. return;
  579. }
  580. EditLapseto(this.lapsetoForm.patient_id, this.lapsetoForm).then(
  581. response => {
  582. if (response.data.state === 1) {
  583. this.$notify({
  584. title: "成功",
  585. message: "转归设置完成",
  586. type: "success",
  587. duration: 2000
  588. });
  589. this.tableData[
  590. this.currentIndex
  591. ].lapseto = this.lapsetoForm.lapseto_type;
  592. this.currentIndex = -1;
  593. this.LapsetoDialogVisible = false;
  594. } else {
  595. this.$message.error(response.data.msg);
  596. }
  597. }
  598. );
  599. },
  600. OpenSetLapseto(row, index) {
  601. this.patient = row;
  602. this.currentIndex = index;
  603. this.lapsetoForm.lapseto_time = "";
  604. this.lapsetoForm.lapseto_type = row.lapseto;
  605. this.lapsetoForm.patient_id = row.id;
  606. this.LapsetoDialogVisible = true;
  607. },
  608. LapsetoInfo(row) {
  609. if (
  610. typeof row.lapseto === "undefined" ||
  611. (row.lapseto !== 1 && row.lapseto !== 2)
  612. ) {
  613. return "未设置";
  614. } else if (row.lapseto === 1) {
  615. return "留治";
  616. } else {
  617. return "转出";
  618. }
  619. },
  620. openWechatBindDialog() {
  621. this.bindWechatDialog = true;
  622. },
  623. handleCheckAllChange(val) {
  624. console.log(val);
  625. console.log(this.checkAll);
  626. console.log(this.isIndeterminate);
  627. },
  628. handleSelectionChange(val) {
  629. this.multipleSelection = val;
  630. this.pageSelect = this.multipleSelection.length;
  631. },
  632. handleCheckedCitiesChange(value) {
  633. const checkedCount = value.length;
  634. this.checkAll = checkedCount === this.cities.length;
  635. this.isIndeterminate =
  636. checkedCount > 0 && checkedCount < this.cities.length;
  637. },
  638. handleSizeChange(val) {
  639. this.listQuery.limit = val;
  640. this.getList();
  641. },
  642. handleCurrentChange(val) {
  643. this.listQuery.page = val;
  644. this.getList();
  645. },
  646. changeCategoryId(categoryId) {
  647. this.categoryId = categoryId;
  648. },
  649. selectSchedulType(scheduleType) {
  650. // alert(scheduleType);/
  651. this.schedulType = scheduleType;
  652. this.listQuery.schedul_type = scheduleType;
  653. this.getList();
  654. },
  655. selectSystemType(systemType) {
  656. this.systemType = systemType;
  657. this.listQuery.binding_state = systemType;
  658. this.getList();
  659. },
  660. selectLapseTo(lapseto) {
  661. this.lapsetoType = lapseto;
  662. this.listQuery.lapseto = lapseto;
  663. this.getList();
  664. },
  665. selectSource(source) {
  666. this.sourceType = source;
  667. this.listQuery.source = source;
  668. this.getList();
  669. },
  670. changeTimeOne(val) {
  671. this.startTime = this.getTimestamp(val);
  672. },
  673. changeTime(val) {
  674. var time = this.getTimestamp(val) - this.startTime;
  675. if (time < 0) {
  676. this.$message.error("结束时间不能小于开始时间");
  677. this.listQuery.end_time = "";
  678. } else {
  679. this.getList();
  680. }
  681. },
  682. getTimestamp(time) {
  683. // 把时间日期转成时间戳
  684. return new Date(time).getTime() / 1000;
  685. },
  686. search() {
  687. this.listQuery.keywords = this.searchKey;
  688. this.getList();
  689. },
  690. changeOtherSearch() {
  691. this.getList();
  692. },
  693. getList() {
  694. fetchList(this.listQuery).then(response => {
  695. if (response.data.state === 0) {
  696. this.$message.error(response.data.msg);
  697. return false;
  698. } else {
  699. this.tableData = response.data.data.patients;
  700. // console.log('病人是', this.tableData)
  701. this.pageTotal = this.tableData.length;
  702. this.total = response.data.data.total;
  703. }
  704. });
  705. },
  706. OpenView(name, number, id) {
  707. this.name = name;
  708. this.dialysis_no = number;
  709. this.centerDialogVisible = true;
  710. OpenView(id).then(response => {
  711. if (response.data.state === 0) {
  712. this.$message.error(response.data.msg);
  713. return false;
  714. } else {
  715. var patient = response.data.data.patient;
  716. console.log("二维码病人信息", patient);
  717. this.id = patient.id;
  718. this.name = patient.name;
  719. this.gender = patient.gender;
  720. this.idcardno = patient.id_card_no;
  721. this.phone = patient.phone;
  722. this.healthcareno = patient.health_care_no;
  723. }
  724. });
  725. },
  726. ShowQRCode() {
  727. document.getElementById("qrcode").innerHTML = "";
  728. this.qrcode = this.$QRCode();
  729. },
  730. download() {
  731. alert("aaaa");
  732. },
  733. print() {
  734. var ptime = Math.round(new Date().getTime() / 1000);
  735. this.print_time = uParseTime(ptime, "{y}年{m}月{d}日");
  736. const style =
  737. "@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;} }";
  738. setTimeout(() => {
  739. printJS({
  740. printable: "print-card-info",
  741. type: "html",
  742. style: style,
  743. scanStyles: false
  744. });
  745. }, 1);
  746. var id = this.id;
  747. var name = this.name;
  748. var gender = this.gender;
  749. if (gender === 1) {
  750. gender = "男";
  751. }
  752. if (gender === 2) {
  753. gender = "女";
  754. }
  755. var idcardno = this.idcardno;
  756. var phone = this.phone;
  757. var healthcareno = this.healthcareno;
  758. var dialysisno = this.dialysis_no;
  759. // Base64位加密
  760. var aid = this.Base64.encode(id);
  761. var aname = this.Base64.encode(name);
  762. var agender = this.Base64.encode(gender);
  763. var aidcardno = this.Base64.encode(idcardno);
  764. var aphone = this.Base64.encode(phone);
  765. var ahealthcareno = this.Base64.encode(healthcareno);
  766. var adialysisno = this.Base64.encode(dialysisno);
  767. // 调用生成二维码的方法
  768. this.$options.methods.qrcode(
  769. aid,
  770. aname,
  771. agender,
  772. aidcardno,
  773. aphone,
  774. ahealthcareno,
  775. adialysisno
  776. );
  777. },
  778. qrcode(id, name, gender, idcardno, phone, healthcareno, dialysisno) {
  779. document.getElementById("code").innerHTML = "";
  780. const qrcode = new QRCode("code", {
  781. width: 200,
  782. height: 200,
  783. text:
  784. "user_id:" +
  785. id +
  786. "," +
  787. "name:" +
  788. name +
  789. "," +
  790. "dialysis_no:" +
  791. dialysisno +
  792. "," +
  793. "gender:" +
  794. gender +
  795. "," +
  796. "idcard_no:" +
  797. idcardno +
  798. "," +
  799. "phone:" +
  800. phone +
  801. "," +
  802. "healthcare_no:" +
  803. healthcareno
  804. });
  805. }
  806. // components:{
  807. // pagiNation
  808. // }
  809. }
  810. };
  811. Vue.prototype.$QRCode = function() {
  812. var name = this.name;
  813. var dialysis_no = this.dialysis_no;
  814. var id = this.id;
  815. var gender = this.gender;
  816. if (gender === 1) {
  817. gender = "男";
  818. }
  819. if (gender === 2) {
  820. gender = "女";
  821. }
  822. var idcardno = this.idcardno;
  823. var phone = this.phone;
  824. var healthcareno = this.healthcareno;
  825. // BASE64加密
  826. // var eid = this.Base64.encode(id)
  827. // var ename = this.Base64.encode(name)
  828. // var egender = this.Base64.encode(gender)
  829. // var eidcardno = this.Base64.encode(idcardno)
  830. // var ephone = this.Base64.encode(phone)
  831. // var ehealthcareno = this.Base64.encode(healthcareno)
  832. // var edialysisno = this.Base64.encode(dialysis_no)
  833. var eid = id;
  834. var ename = name;
  835. var egender = gender;
  836. var eidcardno = idcardno;
  837. var ephone = phone;
  838. var ehealthcareno = healthcareno;
  839. var edialysisno = dialysis_no;
  840. console.log(
  841. "user_id" + eid,
  842. "name:" + ename,
  843. "gender:" + egender,
  844. "idcard_no:" + eidcardno,
  845. "phone:" + ephone,
  846. "healthcare_no:" + ehealthcareno,
  847. "edialysis_no:" + edialysisno
  848. );
  849. const salting = "admin-authority";
  850. new QRCode("qrcode", {
  851. width: 150, // 设置宽度
  852. height: 150, // 设置高度
  853. text:
  854. "user_id:" +
  855. eid +
  856. "," +
  857. "name:" +
  858. ename +
  859. "," +
  860. "dialysis_no:" +
  861. edialysisno +
  862. "," +
  863. "gender:" +
  864. egender +
  865. "," +
  866. "idcard_no:" +
  867. eidcardno +
  868. "," +
  869. "phone:" +
  870. ephone +
  871. "," +
  872. "healthcare_no:" +
  873. ehealthcareno
  874. });
  875. };
  876. </script>
  877. <style rel="stylesheet/scss" lang="scss">
  878. .app-container {
  879. // margin: 20px;
  880. font-size: 15px;
  881. .filter-container {
  882. padding-bottom: 5px;
  883. }
  884. .search-component {
  885. width: 500px;
  886. .searchBox {
  887. width: 300px;
  888. height: 36px;
  889. line-height: 36px;
  890. padding-left: 15px;
  891. border: 1px #dcdfe6 solid;
  892. border-right: none;
  893. outline: none;
  894. float: left;
  895. border-radius: 6px 0 0 6px;
  896. font-size: 14px;
  897. color: #333;
  898. background: #fff;
  899. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  900. }
  901. .searchBtn {
  902. background-color: #409eff;
  903. color: #fff;
  904. font-size: 15px;
  905. text-align: center;
  906. height: 36px;
  907. line-height: 36px;
  908. float: left;
  909. outline: none;
  910. width: 70px;
  911. border: none;
  912. border-radius: 0 6px 6px 0;
  913. font-family: "Microsoft Yahei";
  914. cursor: pointer;
  915. }
  916. }
  917. .amount {
  918. font-weight: normal;
  919. padding: 10px 0 0 0;
  920. color: #606266;
  921. font-size: 14px;
  922. span {
  923. color: #ef2525;
  924. font-family: "Arial";
  925. padding: 0 2px;
  926. }
  927. }
  928. .print_main_content {
  929. background-color: white;
  930. width: 960px;
  931. margin: 0 auto;
  932. padding: 0 0 20px 0;
  933. }
  934. .print_main_content .order_title {
  935. text-align: center;
  936. font-size: 23px;
  937. line-height: 50px;
  938. font-weight: 500px;
  939. }
  940. .print_main_content table {
  941. width: 100%;
  942. border: 1px solid;
  943. border-collapse: collapse;
  944. padding: 2px;
  945. }
  946. .print_main_content table tbody tr td {
  947. border: 1px solid;
  948. text-align: center;
  949. /* font-size: 17px; */
  950. padding: 10px 8px;
  951. }
  952. .td_proj_title {
  953. font-size: 18px;
  954. line-height: 25px;
  955. font-weight: 500;
  956. }
  957. .td_proj_content {
  958. font-size: 18px;
  959. line-height: 25px;
  960. }
  961. .td_align_left {
  962. text-align: left;
  963. }
  964. .print_footnote_panel {
  965. font-size: 17px;
  966. line-height: 40px;
  967. }
  968. .print_footnote_panel .proj {
  969. display: inline-block;
  970. width: 49%;
  971. }
  972. .print_footnote_panel .proj .proj_title {
  973. font-weight: 500;
  974. }
  975. }
  976. .el-table td,
  977. .el-table th.is-leaf,
  978. .el-table--border,
  979. .el-table--group {
  980. border-color: #d0d3da;
  981. }
  982. .el-table--border::after,
  983. .el-table--group::after,
  984. .el-table::before {
  985. background-color: #d0d3da;
  986. }
  987. .el-select--small {
  988. width: 196px;
  989. }
  990. .el-checkbox__inner::after {
  991. height: 10px;
  992. left: 7px;
  993. }
  994. .el-checkbox__inner {
  995. width: 20px;
  996. height: 20px;
  997. }
  998. </style>