血透系统PC前端

FastUploadDetail.vue 37KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. <template>
  2. <div class="app-container ">
  3. <el-form ref="form" :model="form" label-width="134px" class="clearfix" id="patient-info" >
  4. <div class="dataTitle">基本资料</div>
  5. <el-row >
  6. <el-col :span="20" >
  7. <el-row :gutter="10">
  8. <el-col :span="8">
  9. <el-form-item label="登记人员 : ">
  10. <el-input style="width: 120px" v-model="form.registrars" disabled id="registrars"></el-input>
  11. <el-button type="primary" size="mini" v-clipboard:copy="form.registrars"
  12. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="8">
  16. <el-form-item label="创建日期 : ">
  17. <el-date-picker style="width: 120px" v-model="form.created_time" type="date" disabled placeholder="选择日期" :suffix-icon="'el-icon-menu'" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="8">
  21. <el-form-item label="姓名 : " class="is-required" >
  22. <el-input style="width: 100px" v-model="form.name" disabled></el-input>
  23. <el-button type="primary" size="mini" v-clipboard:copy="form.name"
  24. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="8" style="height:59px;">
  28. <el-form-item label="性别 : " class="is-required" >
  29. <el-radio-group v-model="form.gender">
  30. <el-radio v-for="item in sexOptions" :key="item.value" :label="item.value" :value="item.value" disabled>{{item.label}}</el-radio>
  31. </el-radio-group>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="身份证号 : " class="is-required" >
  36. <el-input style="width: 150px" v-model="form.idCardNo" disabled></el-input>
  37. <el-button type="primary" size="mini" v-clipboard:copy="form.idCardNo"
  38. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="8">
  42. <el-form-item label="民族 : " >
  43. <el-input style="width: 100px;" v-model="form.nation" maxlength="30" disabled></el-input>
  44. <el-button type="primary" size="mini" v-clipboard:copy="form.nation"
  45. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="8">
  49. <el-form-item label="婚姻状况 : " >
  50. <el-select v-model="form.maritalStatus" placeholder="请选择婚姻状况" disabled>
  51. <el-option v-for="item in maritalOptions" :key="item.id" :label="item.name" :value="item.id"/>
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="8">
  56. <el-form-item label="职业 : " prop="profession">
  57. <el-select v-model="form.profession" disabled >
  58. <el-option v-for="item in professionOptions" :key="item.id" :label="item.name" :value="item.id"/>
  59. </el-select>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8" style="height:59px;" >
  63. <el-form-item label="年龄 : " class="is-required" >
  64. <el-input style="width: 50px" v-model="form.age" disabled ></el-input>
  65. <el-button type="primary" size="mini" v-clipboard:copy="form.age"
  66. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="8">
  70. <el-form-item label="出生日期 : " class="is-required" >
  71. <el-date-picker style="width: 150px" v-model="form.birth" type="date" disabled placeholder="选择日期" :suffix-icon="'el-icon-menu'" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label="教育程度 : " >
  76. <el-select v-model="form.education" disabled >
  77. <el-option v-for="item in educationOptions" :key="item.id" :label="item.name" :value="item.id"/>
  78. </el-select>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="住院(门诊)号 : ">
  83. <el-input style="width: 150px" v-model="form.admissionNumber" disabled></el-input>
  84. <el-button type="primary" size="mini" v-clipboard:copy="form.admissionNumber"
  85. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="8">
  89. <el-form-item label="透析号 : " class="is-required">
  90. <el-input disabled v-model="form.dialysisNo" placeholder="填写或自动生成" style="width:110px;float:left;margin-right: 1%;" ></el-input>
  91. <el-button type="primary" size="mini" v-clipboard:copy="form.dialysisNo"
  92. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="8">
  96. <el-form-item label="籍贯 : " >
  97. <el-input style="width: 150px" v-model="form.native_place" maxlength="30" disabled></el-input>
  98. <el-button type="primary" size="mini" v-clipboard:copy="form.native_place"
  99. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="家庭住址 : ">
  104. <el-input style="width: 150px" v-model="form.homeAddress" disabled></el-input>
  105. <el-button type="primary" size="mini" v-clipboard:copy="form.homeAddress"
  106. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  107. </el-form-item>
  108. </el-col>
  109. <el-col :span="8">
  110. <el-form-item label="本人电话: " class="is-required" >
  111. <el-input style="width: 150px" v-model="form.phone" maxlength="20" disabled></el-input>
  112. <el-button type="primary" size="mini" v-clipboard:copy="form.phone"
  113. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="8">
  117. <el-form-item label="家属电话: " prop="homeTelephone">
  118. <el-input style="width: 150px" v-model="form.homeTelephone" maxlength="20" disabled></el-input>
  119. <el-button type="primary" size="mini" v-clipboard:copy="form.homeTelephone"
  120. v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="8">
  124. <el-form-item label="首次透析日期 : " prop="firstDialysisDate">
  125. <el-date-picker style="width: 150px" v-model="form.firstDialysisDate" type="date" disabled format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. </el-col>
  130. </el-row>
  131. </el-form>
  132. </div>
  133. </template>
  134. <script>
  135. import { getDataConfig } from '@/utils/data'
  136. import { getToken } from '@/api/qiniu'
  137. import { fetchAllList } from "@/api/patient";
  138. import {
  139. getFileExtension,
  140. isCardNo,
  141. jsGetAge,
  142. isPositiveInteger,
  143. dialysisAge,
  144. uParseTime
  145. } from '@/utils/tools'
  146. import {
  147. generateDialysisNo,
  148. createPatient,
  149. editPatient,
  150. fetchPatient
  151. } from '@/api/patient'
  152. import { fetchAllDoctorAndNurse, fetchAllAdminUsers } from '@/api/doctor'
  153. import { getZones } from '@/api/device/device'
  154. import { parse } from 'path'
  155. const defaultForm = {
  156. avatar: '',
  157. patientType: '',
  158. dialysisNo: '',
  159. admissionNumber: '',
  160. source: '',
  161. lapseto: '',
  162. partition: '',
  163. bed: '',
  164. name: '',
  165. gender: '',
  166. nation: '',
  167. native_place: '',
  168. maritalStatus: '',
  169. idCardNo: '',
  170. birth: '',
  171. age: '',
  172. reimbursementWayID: '',
  173. healthCareNo: '',
  174. healthCareDueDate: '',
  175. height: '',
  176. blood: '',
  177. rh: '',
  178. healthCareDueAlertDate: '',
  179. education: '',
  180. profession: '',
  181. phone: '',
  182. homeTelephone: '',
  183. homeAddress: '',
  184. work: '',
  185. receivingDate: '',
  186. firstDialysisDate: '',
  187. dialysisAge: '',
  188. induction: '',
  189. initial: '',
  190. dialysisTotal: '',
  191. contagions: [],
  192. doctor: '',
  193. nurse: '',
  194. assessment: '',
  195. diseases: [],
  196. diagnose: '',
  197. registrars: '',
  198. patient_complains: '',
  199. present_history: '',
  200. past_history: '',
  201. temperature: '',
  202. pulse: '',
  203. respiratory: '',
  204. sbp: '',
  205. dbp: '',
  206. created_time:'',
  207. }
  208. export default {
  209. name: 'FastUploadDetail',
  210. components: { },
  211. props: {
  212. id: 0,
  213. },
  214. data() {
  215. return {
  216. generic_info_fold: true,
  217. treat_info_fold: true,
  218. orgname: '',
  219. adminusername: '',
  220. form: Object.assign({}, defaultForm),
  221. formSubmit: true,
  222. submitMethod: '',
  223. uploadData: { token: '', key: '' },
  224. dialogImageUrl: '',
  225. qiniuDomain: 'https://images.shengws.com/',
  226. dialogVisible: false,
  227. typeOptions: null,
  228. styleOptions: null,
  229. sourceOptions: [{ value: 1, label: '门诊' }, { value: 2, label: '住院' }],
  230. lapsetoOptions: [{ value: 1, label: '留治' }, { value: 2, label: '转出' }],
  231. partitionOptions: [],
  232. sexOptions: [{ value: 1, label: '男' }, { value: 2, label: '女' }],
  233. isHospitalFirstDialysisOptions: [{ value: 1, label: '是' }, { value: 2, label: '否' }],
  234. predialysisConditionOptions: [{ value: 1, label: '腹膜透析' }, { value: 2, label: '肾移植' }],
  235. maritalOptions: null,
  236. wayOptions: null,
  237. educationOptions: null,
  238. professionOptions: null,
  239. inductionOptions: null,
  240. doctorOptions: null,
  241. nurseOptions: null,
  242. adminUserOptions: [],
  243. rhOptions: null,
  244. checkDisease: null,
  245. contagionList: null,
  246. loading: null,
  247. patientID: 0,
  248. patientPrint: {},
  249. print_time: '',
  250. }
  251. },
  252. computed: {
  253. generic_fold_icon: function() {
  254. return this.generic_info_fold ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
  255. },
  256. treat_fold_icon: function() {
  257. return this.treat_info_fold ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
  258. }
  259. },
  260. created() {
  261. this.styleOptions = this.$store.getters.patient_types
  262. this.maritalOptions = getDataConfig('patient', 'marital_options')
  263. this.wayOptions = getDataConfig('patient', 'reimbursement_ways')
  264. this.typeOptions = this.$store.getters.blood_types
  265. this.rhOptions = this.$store.getters.rh
  266. this.educationOptions = getDataConfig('patient', 'education_types')
  267. this.professionOptions = getDataConfig('patient', 'profession_options')
  268. this.inductionOptions = this.$store.getters.induction_options
  269. this.contagionList = this.$store.getters.contagions
  270. this.checkDisease = this.$store.getters.disease
  271. var xtuser = this.$store.getters.xt_user
  272. this.orgname = xtuser.org.org_name
  273. this.adminusername = xtuser.user.user_name
  274. this.fetchAllAdminUsers()
  275. const id = this.$route.query && this.$route.query.id
  276. this.patientID = parseInt(id)
  277. if (isNaN(this.patientID) || this.patientID <= 0) {
  278. this.getList()
  279. }
  280. this.fetchPatient(id)
  281. this.getZones()
  282. var ptime = Math.round(new Date().getTime() / 1000)
  283. // this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}');
  284. },
  285. methods: {
  286. onCopy(){
  287. this.$message.success('复制成功')
  288. },onError(){
  289. this.$message.success('复制失败,请重试')
  290. },
  291. getList() {
  292. fetchAllList().then(response => {
  293. if (response.data.state == 1) {
  294. this.patientsList = response.data.data.patients;
  295. this.fetchPatient(this.patientsList[0].id)
  296. }
  297. });
  298. },
  299. copy(val){
  300. },
  301. printThisInfo() {
  302. var ptime = Math.round(new Date().getTime() / 1000)
  303. this.print_time = uParseTime(ptime, '{y}年{m}月{d}日')
  304. const style = '@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;} }'
  305. setTimeout(() => {
  306. printJS({
  307. printable: 'print-info-box',
  308. type: 'html',
  309. style: style,
  310. scanStyles: false
  311. })
  312. }, 1)
  313. },
  314. getZones() {
  315. getZones().then(response => {
  316. if (response.data.state === 1) {
  317. this.partitionOptions = response.data.data.zones
  318. }
  319. })
  320. },
  321. fetchPatient(id) {
  322. fetchPatient(id)
  323. .then(response => {
  324. if (response.data.state === 1) {
  325. this.$emit('tran-patient-info', response.data.data.patient)
  326. var patietInfo = response.data.data.patient
  327. this.form.avatar = patietInfo.avatar
  328. this.form.name = patietInfo.name
  329. this.form.alias = patietInfo.alias
  330. this.form.lapseto = patietInfo.lapseto
  331. this.form.idCardNo = patietInfo.id_card_no
  332. this.form.dialysisNo = patietInfo.dialysis_no
  333. this.form.gender = patietInfo.gender
  334. if (patietInfo.gender === 1 || patietInfo.gender === 2) {
  335. this.form.gender = patietInfo.gender
  336. }
  337. this.form.nation = patietInfo.nation
  338. this.form.native_place = patietInfo.native_place
  339. this.form.birth = uParseTime(patietInfo.birthday, '{y}-{m}-{d}')
  340. this.form.height = patietInfo.height + ''
  341. // this.form.age = jsGetAge(this.form.birth, "-");
  342. if (patietInfo.marital_status > 0) {
  343. this.form.maritalStatus = patietInfo.marital_status
  344. }
  345. this.form.children = patietInfo.children
  346. this.form.admissionNumber = patietInfo.admission_number
  347. if (patietInfo.reimbursement_way_id > 0) {
  348. this.form.reimbursementWayID = patietInfo.reimbursement_way_id
  349. }
  350. this.form.healthCareNo = patietInfo.health_care_no
  351. this.form.phone = patietInfo.phone
  352. this.form.homeTelephone = patietInfo.home_telephone
  353. this.form.relative_phone = patietInfo.relative_phone
  354. this.form.relative_relations = patietInfo.relative_relations
  355. this.form.homeAddress = patietInfo.home_address
  356. this.form.work = patietInfo.work_unit
  357. this.form.unit_address = patietInfo.unit_address
  358. this.form.created_time = patietInfo.created_time
  359. if (patietInfo.age == 0){
  360. this.form.age = jsGetAge(this.form.birth, '-')
  361. }else{
  362. this.form.age = patietInfo.age
  363. }
  364. if (patietInfo.profession > 0) {
  365. this.form.profession = patietInfo.profession
  366. }
  367. if (patietInfo.education_level > 0) {
  368. this.form.education = patietInfo.education_level
  369. }
  370. if (patietInfo.source === 1 || patietInfo.source === 2) {
  371. this.form.source = patietInfo.source
  372. }
  373. if (patietInfo.lapseto === 1 || patietInfo.lapseto === 2) {
  374. this.form.lapseto = patietInfo.lapseto
  375. }
  376. if (patietInfo.is_hospital_first_dialysis === 1 || patietInfo.is_hospital_first_dialysis === 2) {
  377. this.form.is_hospital_first_dialysis = patietInfo.is_hospital_first_dialysis
  378. }
  379. if (patietInfo.first_dialysis_date !== 0) {
  380. this.form.firstDialysisDate = uParseTime(
  381. patietInfo.first_dialysis_date,
  382. '{y}-{m}-{d}'
  383. )
  384. }
  385. this.form.first_dialysis_hospital = patietInfo.first_dialysis_hospital
  386. if (patietInfo.predialysis_condition.length > 0) {
  387. this.form.predialysis_condition = patietInfo.predialysis_condition.split(',')
  388. }
  389. this.form.pre_hospital_dialysis_frequency = patietInfo.pre_hospital_dialysis_frequency
  390. this.form.pre_hospital_dialysis_times = patietInfo.pre_hospital_dialysis_times
  391. if (patietInfo.hospital_first_dialysis_date !== 0) {
  392. this.form.hospital_first_dialysis_date = uParseTime(
  393. patietInfo.hospital_first_dialysis_date,
  394. '{y}-{m}-{d}'
  395. )
  396. }
  397. this.form.contagions = response.data.data.contagions
  398. this.form.diseases = response.data.data.diseases
  399. this.form.remark = patietInfo.remark
  400. this.form.diagnose = patietInfo.diagnose
  401. this.form.patient_complains = patietInfo.patient_complains
  402. this.form.present_history = patietInfo.present_history
  403. this.form.past_history = patietInfo.past_history
  404. this.form.temperature = patietInfo.temperature
  405. this.form.pulse = patietInfo.pulse
  406. this.form.respiratory = patietInfo.respiratory
  407. this.form.sbp = patietInfo.sbp
  408. this.form.dbp = patietInfo.dbp
  409. // this.form.initial = patietInfo.initial_dialysis + "";
  410. // this.form.dialysisTotal = patietInfo.total_dialysis + "";
  411. // this.form.assessment = patietInfo.evaluate;
  412. // if (patietInfo.patient_type > 0) {
  413. // this.form.patientType = patietInfo.patient_type;
  414. // }
  415. // if (patietInfo.partition_id > 0) {
  416. // this.form.partition = patietInfo.partition_id;
  417. // }
  418. // if (patietInfo.bed_id > 0) {
  419. // this.form.bed = patietInfo.bed_id;
  420. // }
  421. // this.form.healthCareDueDate = uParseTime(
  422. // patietInfo.health_care_due_date,
  423. // "{y}-{m}-{d}"
  424. // );
  425. // if (patietInfo.blood_type > 0) {
  426. // this.form.blood = patietInfo.blood_type;
  427. // }
  428. // if (patietInfo.rh > 0) {
  429. // this.form.rh = patietInfo.rh;
  430. // }
  431. // this.form.healthCareDueAlertDate = uParseTime(
  432. // patietInfo.health_care_due_alert_date,
  433. // "{y}-{m}-{d}"
  434. // );
  435. // this.form.receivingDate = uParseTime(
  436. // patietInfo.receiving_date,
  437. // "{y}-{m}-{d}"
  438. // );
  439. // this.form.dialysisAge = dialysisAge(
  440. // this.form.firstDialysisDate,
  441. // "-"
  442. // );
  443. // if (patietInfo.induction_period > 0) {
  444. // this.form.induction = patietInfo.induction_period;
  445. // }
  446. // if (patietInfo.attending_doctor_id > 0) {
  447. // this.form.doctor = patietInfo.attending_doctor_id;
  448. // }
  449. // if (patietInfo.head_nurse_id > 0) {
  450. // this.form.nurse = patietInfo.head_nurse_id;
  451. // }
  452. // if (patietInfo.registrars_id > 0) {
  453. // this.form.registrars = patietInfo.registrars_id;
  454. // }
  455. var contagionsArr = response.data.data.contagions
  456. var diseasesArr = response.data.data.diseases
  457. this.patientPrint = patietInfo
  458. var sourceLen = this.sourceOptions.length
  459. for (let index = 0; index < sourceLen; index++) {
  460. if (this.sourceOptions[index].value === patietInfo.source) {
  461. this.patientPrint.source = this.sourceOptions[index].label
  462. break
  463. }
  464. }
  465. var styleLen = this.styleOptions.length
  466. for (let index = 0; index < styleLen; index++) {
  467. if (this.styleOptions[index].id === patietInfo.patient_type) {
  468. this.patientPrint.patient_type = this.styleOptions[index].name
  469. break
  470. }
  471. }
  472. var partitionLen = this.partitionOptions.length
  473. for (let index = 0; index < partitionLen; index++) {
  474. if (this.partitionOptions[index].id === patietInfo.partition_id) {
  475. this.patientPrint.partition_id = this.partitionOptions[index].name
  476. break
  477. }
  478. }
  479. this.patientPrint.bed_id = patietInfo.bed_id > 0 ? patietInfo.bed_id : ''
  480. if (patietInfo.gender === 1) {
  481. this.patientPrint.gender = '男'
  482. } else if (patietInfo.gender === 2) {
  483. this.patientPrint.gender = '女'
  484. } else {
  485. this.patientPrint.gender = ''
  486. }
  487. var maritalLen = this.maritalOptions.length
  488. this.patientPrint.marital_status = ''
  489. for (let index = 0; index < maritalLen; index++) {
  490. if (this.maritalOptions[index].id === patietInfo.marital_status) {
  491. this.patientPrint.marital_status = this.maritalOptions[index].name
  492. break
  493. }
  494. }
  495. this.patientPrint.birthday = uParseTime(patietInfo.birthday, '{y}-{m}-{d}')
  496. this.patientPrint.age = jsGetAge(this.patientPrint.birthday, '-')
  497. this.patientPrint.patient_complains = patietInfo.patient_complains.replace(/\n/g, '<br/>')
  498. this.patientPrint.present_history = patietInfo.present_history.replace(/\n/g, '<br/>')
  499. this.patientPrint.past_history = patietInfo.past_history.replace(/\n/g, '<br/>')
  500. this.patientPrint.remark = patietInfo.remark.replace(/\n/g, '<br/>')
  501. this.patientPrint.diagnose = patietInfo.diagnose.replace(/\n/g, '<br/>')
  502. if (typeof patietInfo.temperature === 'number') {
  503. this.patientPrint.temperature = patietInfo.temperature.toFixed(1)
  504. }
  505. if (patietInfo.reimbursement_way_id > 0) {
  506. var wayLen = this.wayOptions.length
  507. for (let index = 0; index < wayLen; index++) {
  508. if (this.wayOptions[index].id === patietInfo.reimbursement_way_id) {
  509. this.patientPrint.reimbursement_way_id = this.wayOptions[index].name
  510. break
  511. }
  512. }
  513. } else {
  514. this.patientPrint.reimbursement_way_id = ''
  515. }
  516. if (patietInfo.health_care_due_date !== 0) {
  517. this.patientPrint.health_care_due_date = uParseTime(patietInfo.health_care_due_date, '{y}-{m}-{d}')
  518. } else {
  519. this.patientPrint.health_care_due_date = ''
  520. }
  521. if (patietInfo.blood_type > 0) {
  522. var typeLen = this.typeOptions.length
  523. for (let index = 0; index < typeLen; index++) {
  524. if (this.typeOptions[index].id === patietInfo.blood_type) {
  525. this.patientPrint.blood_type = this.typeOptions[index].name
  526. break
  527. }
  528. }
  529. } else {
  530. this.patientPrint.blood_type = ''
  531. }
  532. if (patietInfo.rh > 0) {
  533. var rhLen = this.rhOptions.length
  534. for (let index = 0; index < rhLen; index++) {
  535. if (this.rhOptions[index].id === patietInfo.rh) {
  536. this.patientPrint.rh = this.rhOptions[index].name
  537. break
  538. }
  539. }
  540. } else {
  541. this.patientPrint.rh = ''
  542. }
  543. if (patietInfo.health_care_due_alert_date !== 0) {
  544. this.patientPrint.health_care_due_alert_date = uParseTime(patietInfo.health_care_due_alert_date, '{y}-{m}-{d}')
  545. } else {
  546. this.patientPrint.health_care_due_alert_date = ''
  547. }
  548. if (patietInfo.education_level > 0) {
  549. var eLen = this.educationOptions.length
  550. for (let index = 0; index < eLen; index++) {
  551. if (this.educationOptions[index].id === patietInfo.education_level) {
  552. this.patientPrint.education_level = this.educationOptions[index].name
  553. break
  554. }
  555. }
  556. } else {
  557. this.patientPrint.education_level = ''
  558. }
  559. if (patietInfo.profession > 0) {
  560. var eLen = this.professionOptions.length
  561. for (let index = 0; index < eLen; index++) {
  562. if (this.professionOptions[index].id === patietInfo.profession) {
  563. this.patientPrint.profession = this.professionOptions[index].name
  564. break
  565. }
  566. }
  567. } else {
  568. this.patientPrint.profession = ''
  569. }
  570. if (patietInfo.receiving_date !== 0) {
  571. this.patientPrint.receiving_date = uParseTime(patietInfo.receiving_date, '{y}-{m}-{d}')
  572. } else {
  573. this.patientPrint.receiving_date = ''
  574. }
  575. if (patietInfo.first_dialysis_date !== 0) {
  576. this.patientPrint.first_dialysis_date = uParseTime(patietInfo.first_dialysis_date, '{y}-{m}-{d}')
  577. this.patientPrint.dialysis_age = dialysisAge(this.patientPrint.first_dialysis_date)
  578. } else {
  579. this.patientPrint.first_dialysis_date = ''
  580. this.patientPrint.dialysis_age = ''
  581. }
  582. if (patietInfo.induction_period > 0) {
  583. var eLen = this.inductionOptions.length
  584. for (let index = 0; index < eLen; index++) {
  585. if (this.inductionOptions[index].id === patietInfo.induction_period) {
  586. this.patientPrint.induction_period = this.inductionOptions[index].name
  587. break
  588. }
  589. }
  590. } else {
  591. this.patientPrint.induction_period = ''
  592. }
  593. if (patietInfo.attending_doctor_id > 0) {
  594. var eLen = this.adminUserOptions.length
  595. for (let index = 0; index < eLen; index++) {
  596. if (this.adminUserOptions[index].id === patietInfo.attending_doctor_id) {
  597. this.patientPrint.attending_doctor_id = this.adminUserOptions[index].name
  598. break
  599. }
  600. }
  601. } else {
  602. this.patientPrint.attending_doctor_id = ''
  603. }
  604. if (patietInfo.head_nurse_id > 0) {
  605. var eLen = this.adminUserOptions.length
  606. for (let index = 0; index < eLen; index++) {
  607. if (this.adminUserOptions[index].id === patietInfo.head_nurse_id) {
  608. this.patientPrint.head_nurse_id = this.adminUserOptions[index].name
  609. break
  610. }
  611. }
  612. } else {
  613. this.patientPrint.head_nurse_id = ''
  614. }
  615. if (contagionsArr.length > 0) {
  616. var contagionsIdArr = {}
  617. var alen = contagionsArr.length
  618. for (let index = 0; index < alen; index++) {
  619. contagionsIdArr[contagionsArr[index]] = 1
  620. }
  621. var printContagions = []
  622. var clen = this.contagionList.length
  623. for (let index = 0; index < clen; index++) {
  624. if (this.contagionList[index].id in contagionsIdArr) {
  625. printContagions.push(this.contagionList[index].name)
  626. }
  627. }
  628. this.patientPrint.contagions = printContagions.join('、')
  629. } else {
  630. this.patientPrint.contagions = '无'
  631. }
  632. if (diseasesArr.length > 0) {
  633. var diseasesIdArr = {}
  634. var alen = diseasesArr.length
  635. for (let index = 0; index < alen; index++) {
  636. diseasesIdArr[diseasesArr[index]] = 1
  637. }
  638. var printDisease = []
  639. var clen = this.checkDisease.length
  640. for (let index = 0; index < clen; index++) {
  641. if (this.checkDisease[index].id in diseasesIdArr) {
  642. printDisease.push(this.checkDisease[index].name)
  643. }
  644. }
  645. this.patientPrint.diseases = printDisease.join('、')
  646. } else {
  647. this.patientPrint.diseases = ''
  648. }
  649. if (patietInfo.registrars_id > 0) {
  650. var eLen = this.adminUserOptions.length
  651. for (let index = 0; index < eLen; index++) {
  652. if (this.adminUserOptions[index].id === patietInfo.registrars_id) {
  653. this.patientPrint.registrars = this.adminUserOptions[index].name
  654. this.form.registrars = this.adminUserOptions[index].name
  655. break
  656. }
  657. }
  658. } else {
  659. this.patientPrint.registrars = ''
  660. }
  661. if (patietInfo.hospital_first_dialysis_date !== 0) {
  662. this.patientPrint.hospital_first_dialysis_date = uParseTime(patietInfo.hospital_first_dialysis_date, '{y}-{m}-{d}')
  663. } else {
  664. this.patientPrint.hospital_first_dialysis_date = ''
  665. }
  666. } else {
  667. // console.log('patient get err state')
  668. // this.$notify.error({
  669. // title: '错误',
  670. // message: '网络异常'
  671. // })
  672. // this.$router.push('/patients/patients')
  673. }
  674. // this.postForm = response.data
  675. // // Just for test
  676. // this.postForm.title += ` Article Id:${this.postForm.id}`
  677. // this.postForm.content_short += ` Article Id:${this.postForm.id}`
  678. }).catch(err => {
  679. // console.log('patient get err', err)
  680. // this.$notify.error({
  681. // title: '错误',
  682. // message: '网络异常'
  683. // })
  684. // this.$router.push('/patients/patients')
  685. })
  686. },
  687. fetchAllDoctorAndNurse() {
  688. fetchAllDoctorAndNurse().then(response => {
  689. if (response.data.state === 1) {
  690. this.doctorOptions = response.data.data.doctors
  691. this.nurseOptions = response.data.data.nursers
  692. }
  693. })
  694. },
  695. fetchAllAdminUsers() {
  696. fetchAllAdminUsers().then(response => {
  697. if (response.data.state === 1) {
  698. this.adminUserOptions = response.data.data.users
  699. }
  700. })
  701. },
  702. printCard() {
  703. var ptime = Math.round(new Date().getTime() / 1000)
  704. this.print_time = uParseTime(ptime, '{y}年{m}月{d}日')
  705. const style = '@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;} }'
  706. setTimeout(() => {
  707. printJS({
  708. printable: 'print-card-info',
  709. type: 'html',
  710. style: style,
  711. scanStyles: false
  712. })
  713. }, 1)
  714. var patientID = this.patientPrint.id
  715. var name = this.patientPrint.name
  716. var gender = this.patientPrint.gender
  717. if (gender === 1) {
  718. gender = '男'
  719. }
  720. if (gender === 2) {
  721. gender = '女'
  722. }
  723. var idCardNo = this.patientPrint.id_card_no
  724. var dialysisNo = this.patientPrint.dialysis_no
  725. var phone = this.patientPrint.phone
  726. var healthCareNo = this.patientPrint.health_care_no
  727. // Base64加密
  728. var epatientID = this.Base64.encode(patientID)
  729. var ename = this.Base64.encode(name)
  730. var egender = this.Base64.encode(gender)
  731. var eidCardNo = this.Base64.encode(idCardNo)
  732. var edialysisNo = this.Base64.encode(dialysisNo)
  733. var ephone = this.Base64.encode(phone)
  734. var eheathCareNo = this.Base64.encode(healthCareNo)
  735. console.log('id号:' + epatientID, '姓名:' + ename, '性别:' + egender, '身份证:' + eidCardNo, '透析号:' + edialysisNo, '电话:' + ephone, '社保号:' + eheathCareNo)
  736. // var params =new Object();
  737. // params.id = this.patientPrint.id
  738. // params.name = this.patientPrint.name;
  739. this.$options.methods.qrcode(epatientID, ename, egender, eidCardNo, edialysisNo, ephone, eheathCareNo)// 调用生成二维码的方法
  740. // this.$options.methods.qrcode(params)
  741. },
  742. qrcode(patientID, name, gender, idCardNo, dialysisNo, phone, healthCareNo) {
  743. document.getElementById("qrcode").innerHTML = "";
  744. new QRCode('qrcode', {
  745. width: 200,
  746. height: 200,
  747. text: 'user_id:' + patientID + ',' + 'name:' + name + ',' + 'dialysis_no:' + dialysisNo + ',' + 'gender:' + gender + ',' + 'idcard_no:' + idCardNo + ',' + 'phone:' + phone + ',' + 'healthcare_no:' + healthCareNo
  748. })
  749. }
  750. }
  751. }
  752. </script>
  753. <style rel="stylesheet/scss" lang="scss" scoped>
  754. .uploadHead {
  755. margin-top: 25%;
  756. }
  757. .uploadHeadBtn {
  758. width: 148px;
  759. margin-top: 10px;
  760. }
  761. .el-form {
  762. .el-col-6,
  763. .el-col-8 {
  764. width: 360px;
  765. height:59px!important;
  766. }
  767. .el-form-item {
  768. // margin-bottom: 17px !important;
  769. .el-select {
  770. width: 100%;
  771. }
  772. .el-date-editor.el-input {
  773. width: 100%;
  774. }
  775. .textarea {
  776. width: 100%;
  777. height: 70px;
  778. border-color: #dcdfe6;
  779. padding: 5px;
  780. }
  781. }
  782. }
  783. // #print-info-box .info_print {
  784. // width: 920px;
  785. // margin: 0 auto !important;
  786. // position: relative;
  787. // top: 0;
  788. // left: 0;
  789. // padding: 20px 30px;
  790. // }
  791. // #print-info-box .box-title {
  792. // text-align: center;
  793. // font-weight: 600;
  794. // font-size: 30px;
  795. // line-height: 80px;
  796. // margin-bottom: 20px;
  797. // }
  798. // #print-info-box .unit-title {
  799. // text-align: center;
  800. // line-height: 40px;
  801. // font-size: 20px;
  802. // font-weight: 400;
  803. // padding-top: 10px;
  804. // /* border: 1px solid #333; */
  805. // }
  806. // #print-info-box .unit-box {
  807. // padding: 15px;
  808. // }
  809. // #print-info-box .unit-box-item {
  810. // display: flex;
  811. // align-items: center;
  812. // justify-content: space-between;
  813. // padding: 4px 1em;
  814. // }
  815. // #print-info-box .unit-box-item-col3 {
  816. // width: 30%;
  817. // display: flex;
  818. // padding: 4px 0;
  819. // }
  820. // #print-info-box .unit-box-item-col4 {
  821. // width: 23%;
  822. // display: flex;
  823. // padding: 4px 0;
  824. // }
  825. // #print-info-box .item-value {
  826. // flex: 1;
  827. // border-bottom: 1px solid #333;
  828. // }
  829. </style>
  830. <style scoped>
  831. /* 打印表格的样式 */
  832. .print_main_content {
  833. background-color: white;
  834. width:960px;
  835. margin:0 auto;
  836. padding: 0 0 20px 0;
  837. }
  838. .print_main_content .order_title {
  839. text-align: center;
  840. font-size: 23px;
  841. line-height: 50px;
  842. font-weight: 500;
  843. }
  844. .print_main_content table {
  845. width: 100%;
  846. border: 1px solid;
  847. border-collapse: collapse;
  848. padding: 2px;
  849. }
  850. .print_main_content table tbody tr td {
  851. border: 1px solid;
  852. text-align: center;
  853. /* font-size: 17px; */
  854. padding: 10px 8px;
  855. }
  856. .td_proj_title {
  857. font-size: 18px;
  858. line-height: 25px;
  859. font-weight: 500;
  860. }
  861. .td_proj_content {
  862. font-size: 18px;
  863. line-height: 25px;
  864. }
  865. .td_align_left {
  866. text-align: left;
  867. }
  868. .print_footnote_panel {
  869. font-size: 17px;
  870. line-height: 40px;
  871. }
  872. .print_footnote_panel .proj {
  873. display: inline-block;
  874. width: 49%;
  875. }
  876. .print_footnote_panel .proj .proj_title {
  877. font-weight: 500;
  878. }
  879. .el-select-dropdown{
  880. z-index: 998!important;
  881. }
  882. </style>