editPatient.vue 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. <template>
  2. <div class="page_editPatients">
  3. <van-sticky>
  4. <div class="addPatientsTitle">
  5. <i class="iconfont icon-zuojiantou jiantou" @click="$router.go(-1)"></i>
  6. <span class="titleName">编辑患者</span>
  7. <span @click="spread" id="copy">修改</span>
  8. </div>
  9. </van-sticky>
  10. <div class="basicTitle">基本信息</div>
  11. <div class="basicBox">
  12. <van-field
  13. :class="readonly ? 'changeColor' : ''"
  14. v-model="patientForm.name"
  15. required
  16. label="姓名"
  17. :readonly="readonly"
  18. placeholder="请输入"
  19. />
  20. <van-field
  21. :class="readonly ? 'changeColor' : ''"
  22. label="性别"
  23. v-model="patientForm.sex"
  24. right-icon="arrow"
  25. placeholder="请选择"
  26. required
  27. :readonly="readonly"
  28. @click="clickSex"
  29. />
  30. <van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
  31. <van-picker :columns="columns" show-toolbar @change="onChange" />
  32. </van-popup>
  33. <van-field
  34. :class="readonly ? 'changeColor' : ''"
  35. v-model="patientForm.idCard"
  36. required
  37. label="身份证号"
  38. @blur="checkIdCardNo"
  39. placeholder="请输入"
  40. :readonly="readonly"
  41. />
  42. <van-field
  43. :class="readonly ? 'changeColor' : ''"
  44. v-model="patientForm.birthday"
  45. required
  46. label="出生日期"
  47. :readonly="readonly"
  48. placeholder="请输入"
  49. />
  50. <van-field
  51. :class="readonly ? 'changeColor' : ''"
  52. v-model="patientForm.phone"
  53. type="tel"
  54. required
  55. label="手机号"
  56. placeholder="请输入"
  57. :readonly="readonly"
  58. />
  59. <van-cell>
  60. <!-- 使用 title 插槽来自定义标题 -->
  61. <template slot="title">
  62. <span class="custom-title">患者类型</span>
  63. <div style="width:60%;margin-left:2rem">
  64. <van-checkbox-group v-model="result">
  65. <van-checkbox name="1" shape="square" @click="changeMode"
  66. >血透患者</van-checkbox
  67. >
  68. <van-checkbox name="2" shape="square" @click="changeMode"
  69. >慢病患者</van-checkbox
  70. >
  71. <van-checkbox name="3" shape="square" @click="changeMode"
  72. >会员患者</van-checkbox
  73. >
  74. </van-checkbox-group>
  75. </div>
  76. </template>
  77. </van-cell>
  78. </div>
  79. <div v-show="bloodShow">
  80. <div class="basicTitle">血透信息</div>
  81. <div class="xtBox">
  82. <van-field
  83. :class="readonly ? 'changeColor' : ''"
  84. v-model="patientForm.dialysis"
  85. center
  86. clearable
  87. required
  88. label="透析号"
  89. :readonly="readonly"
  90. >
  91. <van-button
  92. slot="button"
  93. size="small"
  94. type="info"
  95. @click="generatedialysisno"
  96. >自动生成</van-button
  97. >
  98. </van-field>
  99. <van-field
  100. :class="readonly ? 'changeColor' : ''"
  101. label="患者来源"
  102. v-model="patientForm.patientsoure"
  103. right-icon="arrow"
  104. required
  105. :readonly="readonly"
  106. placeholder="请选择"
  107. @click="clickPatientSoure"
  108. />
  109. <van-popup v-model="show3" position="bottom" :style="{ height: '40%' }">
  110. <van-picker :columns="columns2" show-toolbar @change="onChange1" />
  111. </van-popup>
  112. <van-field
  113. :class="readonly ? 'changeColor' : ''"
  114. label="留治状态"
  115. v-model="patientForm.lapseto"
  116. right-icon="arrow"
  117. required
  118. :readonly="readonly"
  119. placeholder="请选择"
  120. @click="clickLapseto"
  121. />
  122. <van-popup v-model="show4" position="bottom" :style="{ height: '40%' }">
  123. <van-picker :columns="columns4" show-toolbar @change="onChange2" />
  124. </van-popup>
  125. <van-cell>
  126. <!-- 使用 title 插槽来自定义标题 -->
  127. <template slot="title">
  128. <span class="custom-title">有无传染病</span>
  129. <div
  130. style="width:60%;margin-left:1.3rem;display: flex;align-items: center;"
  131. >
  132. <van-radio-group v-model="radio" @change="changRadio">
  133. <van-radio name="1" shape="square">无</van-radio>
  134. <van-radio name="2" shape="square">有</van-radio>
  135. </van-radio-group>
  136. </div>
  137. </template>
  138. </van-cell>
  139. <van-cell v-show="showOne">
  140. <!-- 使用 title 插槽来自定义标题 -->
  141. <template slot="title">
  142. <span class="custom-title">传染病</span>
  143. <div style="width:60%;margin-left:3rem">
  144. <van-checkbox-group v-model="resultTwo">
  145. <van-checkbox name="2" shape="square">乙肝</van-checkbox>
  146. <van-checkbox name="3" shape="square">丙肝</van-checkbox>
  147. <van-checkbox name="4" shape="square">艾滋</van-checkbox>
  148. <van-checkbox name="5" shape="square">肺结核</van-checkbox>
  149. <van-checkbox name="6" shape="square">梅毒</van-checkbox>
  150. </van-checkbox-group>
  151. </div>
  152. </template>
  153. </van-cell>
  154. <van-field
  155. :class="readonly ? 'changeColor' : ''"
  156. v-model="patientForm.admissionNumber"
  157. :readonly="readonly"
  158. type="text"
  159. label="住院(门诊)号"
  160. />
  161. <van-field
  162. :class="readonly ? 'changeColor' : ''"
  163. label="首次透析日期"
  164. v-model="patientForm.fistDate"
  165. right-icon="arrow"
  166. :readonly="readonly"
  167. placeholder="请选择"
  168. @click="clickDate"
  169. />
  170. <van-popup v-model="show2" position="bottom" :style="{ height: '40%' }">
  171. <van-datetime-picker
  172. v-model="currentDate"
  173. type="date"
  174. :min-date="minDate"
  175. :max-date="maxDate"
  176. @cancel="onCancel"
  177. @confirm="onConfirm"
  178. />
  179. </van-popup>
  180. <van-field
  181. :class="readonly ? 'changeColor' : ''"
  182. v-model="patientForm.diagnose"
  183. rows="1"
  184. autosize
  185. label="诊断"
  186. type="textarea"
  187. maxlength="50"
  188. :readonly="readonly"
  189. placeholder="请输入主要诊断信息"
  190. />
  191. </div>
  192. </div>
  193. <div v-show="slowShow">
  194. <div class="basicTitle">慢病信息</div>
  195. <div class="xtBox">
  196. <van-field
  197. :class="readonly ? 'changeColor' : ''"
  198. v-model="patientForm.requipmentId"
  199. label="设备ID"
  200. placeholder="请输入"
  201. :readonly="readonly"
  202. />
  203. <van-cell>
  204. <!-- 使用 title 插槽来自定义标题 -->
  205. <template slot="title">
  206. <span class="custom-title2">传染病</span>
  207. <div style="width:60%;margin-left:3rem">
  208. <van-checkbox-group v-model="resultThree">
  209. <van-checkbox name="1" shape="square">乙肝</van-checkbox>
  210. <van-checkbox name="2" shape="square">丙肝</van-checkbox>
  211. <van-checkbox name="3" shape="square">艾滋</van-checkbox>
  212. <van-checkbox name="4" shape="square">肺结核</van-checkbox>
  213. <van-checkbox name="5" shape="square">梅毒</van-checkbox>
  214. </van-checkbox-group>
  215. </div>
  216. </template>
  217. </van-cell>
  218. <van-cell>
  219. <!-- 使用 title 插槽来自定义标题 -->
  220. <template slot="title">
  221. <span class="custom-title2">慢性病</span>
  222. <div style="width:60%;margin-left:3rem">
  223. <van-checkbox-group v-model="resultFour">
  224. <van-checkbox name="1" shape="square">血透</van-checkbox>
  225. <van-checkbox name="2" shape="square">腹透</van-checkbox>
  226. <van-checkbox name="3" shape="square">移植</van-checkbox>
  227. <van-checkbox name="4" shape="square">高血压</van-checkbox>
  228. <van-checkbox name="5" shape="square">糖尿病</van-checkbox>
  229. <van-checkbox name="6" shape="square">慢性肾病</van-checkbox>
  230. <van-checkbox name="7" shape="square">其他</van-checkbox>
  231. </van-checkbox-group>
  232. </div>
  233. </template>
  234. </van-cell>
  235. </div>
  236. </div>
  237. <div v-show="memberShow">
  238. <div class="basicTitle">会员资料</div>
  239. <div class="xtBox">
  240. <van-field
  241. :class="readonly ? 'changeColor' : ''"
  242. label="首次透析日期"
  243. v-model="patientForm.memberFistDate"
  244. right-icon="arrow"
  245. :readonly="readonly"
  246. placeholder="请选择"
  247. @click="clickDateTwo"
  248. />
  249. <van-popup
  250. v-model="show12"
  251. position="bottom"
  252. :style="{ height: '40%' }"
  253. >
  254. <van-datetime-picker
  255. v-model="currentDate"
  256. type="date"
  257. :min-date="minDate"
  258. :max-date="maxDate"
  259. @cancel="onCancel"
  260. @confirm="onConfirmOne"
  261. />
  262. </van-popup>
  263. <van-field
  264. :class="readonly ? 'changeColor' : ''"
  265. label="病种"
  266. v-model="patientForm.patient_type"
  267. right-icon="arrow"
  268. :readonly="readonly"
  269. placeholder="请选择"
  270. @click="clickPatientType"
  271. />
  272. <van-popup
  273. v-model="show14"
  274. position="bottom"
  275. :style="{ height: '40%' }"
  276. >
  277. <van-picker
  278. :columns="patientType"
  279. show-toolbar
  280. @change="onChangeSix"
  281. @cancel="cancelSeven"
  282. />
  283. </van-popup>
  284. <van-field
  285. :class="readonly ? 'changeColor' : ''"
  286. label="治疗方式"
  287. v-model="patientForm.treatmentMethod"
  288. right-icon="arrow"
  289. :readonly="readonly"
  290. placeholder="请选择"
  291. @click="clickTreatMethod"
  292. />
  293. <van-popup
  294. v-model="show13"
  295. position="bottom"
  296. :style="{ height: '40%' }"
  297. >
  298. <van-picker
  299. :columns="treatmentMethod"
  300. show-toolbar
  301. @change="onChangeSeven"
  302. @cancel="cancelEight"
  303. />
  304. </van-popup>
  305. </div>
  306. </div>
  307. <div class="moreInfo">如需要完善更多病人信息,请在电脑端完善</div>
  308. </div>
  309. </template>
  310. <script>
  311. import {
  312. GenerateDialysisNo,
  313. GetIllnessList,
  314. savePatient,
  315. GetPatientInfo,
  316. getBloodPatientInfo,
  317. getSlowPatientInfo,
  318. getMemberPatientInfo,
  319. GetPatientDetail,
  320. updatedPatient
  321. } from "@/api/patient/patient";
  322. import {
  323. isCardNo,
  324. checkMobile,
  325. getFileExtension,
  326. uParseTime,
  327. uParseTimeOne
  328. } from "@/utils/tools";
  329. import { getToken } from "@/api/qiniu";
  330. import { setRem, setHeight } from "@/libs/functionRem";
  331. const moment = require("moment");
  332. export default {
  333. data() {
  334. var checkMobileRule = (rule, value, callback) => {
  335. if (!checkMobile(value)) {
  336. callback(new Error("请填写正确的手机号"));
  337. } else {
  338. callback();
  339. }
  340. };
  341. return {
  342. show: false,
  343. show1: false,
  344. show2: false,
  345. show3: false,
  346. show4: false,
  347. name: "",
  348. columns: ["男", "女"],
  349. columns1: ["1", "2", "3"],
  350. columns2: ["门诊", "住院"],
  351. columns4: ["留治", "转出"],
  352. sex: "",
  353. idCard: "",
  354. birthday: "",
  355. tel: "",
  356. result: [],
  357. dialysisNumber: "",
  358. source: "",
  359. source2: "",
  360. source3: "",
  361. show10: false,
  362. show9: false,
  363. show8: false,
  364. show7: false,
  365. show6: false,
  366. show11: false,
  367. show12: false,
  368. show13: false,
  369. show14: false,
  370. hospitalNum: "",
  371. minDate: new Date(1970, 0, 1),
  372. maxDate: new Date(2025, 10, 1),
  373. currentDate: new Date(),
  374. time: "",
  375. message: "",
  376. patient_id: "",
  377. resultTwo: [],
  378. resultThree: [],
  379. resultFour: [],
  380. patientForm: {
  381. id: "",
  382. name: "",
  383. sex: "",
  384. idCard: "",
  385. birthday: "",
  386. phone: "",
  387. dialysis: "",
  388. patient_type: "",
  389. admissionNumber: "",
  390. patientsoure: "",
  391. lapseto: "",
  392. contagions: [],
  393. fistDate: "",
  394. diagnose: "",
  395. requipmentId: "",
  396. slowcontagions: [],
  397. slowDisease: "",
  398. memberIllnessTime: "",
  399. memberlapseto: "",
  400. TreatmentMethod: "",
  401. bloodPatient: 0,
  402. slowPatient: 0,
  403. memberPatient: 0,
  404. avatar: "",
  405. memberFistDate: "",
  406. blood_patients: "",
  407. slow_patients: "",
  408. member_patients: ""
  409. },
  410. bloodShow: true,
  411. slowShow: false,
  412. memberShow: false,
  413. patientType: [],
  414. treatmentMethod: [
  415. "西医治疗",
  416. "中医治疗",
  417. "血液透析",
  418. "腹膜透析",
  419. "肾移植"
  420. ],
  421. illnesslist: [],
  422. radio: "1",
  423. showOne: false,
  424. readonly: true
  425. };
  426. },
  427. methods: {
  428. onChange(picker, value, index) {
  429. this.patientForm.sex = value;
  430. this.show = false;
  431. },
  432. onChange1(picker, value, index) {
  433. this.patientForm.patientsoure = value;
  434. this.show3 = false;
  435. },
  436. onChange2(picker, value, index) {
  437. this.patientForm.lapseto = value;
  438. this.show4 = false;
  439. },
  440. onChange3(picker, value, index) {
  441. this.source3 = value;
  442. this.show3 = false;
  443. },
  444. onChange4(picker, value, index) {
  445. this.source = value;
  446. this.show1 = false;
  447. },
  448. onCancel() {
  449. this.show2 = false;
  450. },
  451. onConfirm(value) {
  452. let year = value.getFullYear();
  453. let month = value.getMonth() + 1;
  454. let day = value.getDate();
  455. if (month >= 1 && month <= 9) {
  456. month = `0${month}`;
  457. }
  458. if (day >= 1 && day <= 9) {
  459. day = `0${day}`;
  460. }
  461. this.patientForm.fistDate = `${year}-${month}-${day}`;
  462. this.show2 = false;
  463. },
  464. onConfirmOne(value) {
  465. let year = value.getFullYear();
  466. let month = value.getMonth() + 1;
  467. let day = value.getDate();
  468. if (month >= 1 && month <= 9) {
  469. month = `0${month}`;
  470. }
  471. if (day >= 1 && day <= 9) {
  472. day = `0${day}`;
  473. }
  474. this.patientForm.memberFistDate = `${year}-${month}-${day}`;
  475. this.show12 = false;
  476. },
  477. cancelSeven() {
  478. this.show14 = false;
  479. },
  480. cancelEight() {
  481. this.show13 = false;
  482. },
  483. toReturn() {
  484. this.$router.push("/patientdetail?patientid=" + this.patient_id);
  485. },
  486. changeMode(val) {
  487. if (val == 1) {
  488. getBloodPatientInfo(this.patientForm.phone).then(response => {
  489. if (response.data.state === 1) {
  490. var msg = response.data.data.msg;
  491. } else {
  492. this.$toast("血透患者已存在");
  493. return false;
  494. }
  495. });
  496. }
  497. if (val == 2) {
  498. getSlowPatientInfo(this.patientForm.phone).then(response => {
  499. if (response.data.state === 1) {
  500. var msg = response.data.data.msg;
  501. } else {
  502. this.$toast("慢病患者已存在");
  503. return false;
  504. }
  505. });
  506. }
  507. if (val == 3) {
  508. getMemberPatientInfo(this.patientForm.phone).then(response => {
  509. if (response.data.state === 1) {
  510. var msg = response.data.data.msg;
  511. } else {
  512. this.$toast("会员已存在");
  513. return false;
  514. }
  515. });
  516. }
  517. if (this.result.indexOf("1") != -1) {
  518. this.bloodShow = true;
  519. this.slowShow = false;
  520. this.memberShow = false;
  521. }
  522. if (this.result.indexOf("2") != -1) {
  523. this.slowShow = true;
  524. this.bloodShow = false;
  525. this.memberShow = false;
  526. }
  527. if (this.result.indexOf("3") != -1) {
  528. this.memberShow = true;
  529. this.bloodShow = false;
  530. this.slowShow = false;
  531. }
  532. if (this.result.indexOf("1") != -1 && this.result.indexOf("2") != -1) {
  533. this.bloodShow = true;
  534. this.slowShow = true;
  535. this.memberShow = false;
  536. }
  537. if (
  538. this.result.indexOf("1") != -1 &&
  539. this.result.indexOf("2") != -1 &&
  540. this.result.indexOf("3") != -1
  541. ) {
  542. this.bloodShow = true;
  543. this.slowShow = true;
  544. this.memberShow = true;
  545. }
  546. if (this.result.indexOf("1") != -1 && this.result.indexOf("3") != -1) {
  547. this.bloodShow = false;
  548. this.slowShow = true;
  549. this.memberShow = true;
  550. }
  551. if (this.result.indexOf("3") != -1 && this.result.indexOf("1") != -1) {
  552. this.bloodShow = true;
  553. this.slowShow = false;
  554. this.memberShow = true;
  555. }
  556. if (this.result.indexOf("2") != -1 && this.result.indexOf("3") != -1) {
  557. this.bloodShow = false;
  558. this.slowShow = true;
  559. this.memberShow = true;
  560. }
  561. if (
  562. this.result.indexOf("2") != -1 &&
  563. this.result.indexOf("3") != -1 &&
  564. this.result.indexOf("1") != -1
  565. ) {
  566. this.bloodShow = true;
  567. this.slowShow = true;
  568. this.memberShow = true;
  569. }
  570. if (this.result.length == 0) {
  571. this.bloodShow = false;
  572. this.slowShow = false;
  573. this.memberShow = false;
  574. }
  575. },
  576. generatedialysisno() {
  577. GenerateDialysisNo().then(response => {
  578. // eslint-disable-next-line eqeqeq
  579. if (response.data.state == 1) {
  580. var no = response.data.data.no + "";
  581. this.patientForm.dialysis = no;
  582. }
  583. });
  584. },
  585. onChangeSix(picker, value, index) {
  586. this.patientForm.patient_type = value;
  587. this.show14 = false;
  588. },
  589. onChangeSeven(picker, value, index) {
  590. this.patientForm.treatmentMethod = value;
  591. this.show13 = false;
  592. },
  593. GetPatientDetail(patientid) {
  594. GetPatientDetail(patientid).then(response => {
  595. if (response.data.state === 1) {
  596. var patientdetail = response.data.data.patientDetail;
  597. // console.log("patientdetail", patientdetail);
  598. var diseases = response.data.data.diseases;
  599. var slowDisease = response.data.data.slowDiseases;
  600. for (let i = 0; i < diseases.length; i++) {
  601. this.resultTwo.push(String(diseases[i]));
  602. }
  603. for (let i = 0; i < slowDisease.length; i++) {
  604. this.resultThree.push(String(slowDisease[i].disease_id));
  605. }
  606. var cronicdisease = response.data.data.cronicDiseases;
  607. for (let i = 0; i < cronicdisease.length; i++) {
  608. this.resultFour.push(String(cronicdisease[i].disease_id));
  609. }
  610. if (patientdetail.gender === 1) {
  611. patientdetail.gender = "男";
  612. }
  613. if (patientdetail.gender === 2) {
  614. patientdetail.gender = "女";
  615. }
  616. if (patientdetail.source === 1) {
  617. patientdetail.source = "门诊";
  618. }
  619. if (patientdetail.source === 2) {
  620. patientdetail.source = "住院";
  621. }
  622. if (patientdetail.lapseto === 1) {
  623. patientdetail.lapseto = "留治";
  624. }
  625. if (patientdetail.lapseto === 2) {
  626. patientdetail.lapseto = "转出";
  627. }
  628. this.patientForm.name = patientdetail.name;
  629. this.patientForm.sex = patientdetail.gender;
  630. this.patientForm.idCard = patientdetail.id_card_no;
  631. this.patientForm.birthday = uParseTime(
  632. patientdetail.birthday,
  633. "{y}-{m}-{d}"
  634. );
  635. this.patientForm.phone = patientdetail.phone;
  636. if (patientdetail.blood_patients == 1) {
  637. this.result.push(String(1));
  638. }
  639. if (patientdetail.slow_patients == 1) {
  640. this.result.push(String(2));
  641. }
  642. if (patientdetail.member_patients == 1) {
  643. this.result.push(String(3));
  644. }
  645. this.patientForm.id = patientdetail.id;
  646. this.patientForm.dialysis = patientdetail.dialysis_no;
  647. this.patientForm.patientsoure = patientdetail.source;
  648. this.patientForm.lapseto = patientdetail.lapseto;
  649. this.patientForm.admissionNumber = patientdetail.admission_number;
  650. this.patientForm.requipmentId = patientdetail.equitment_id;
  651. this.patientForm.blood_patients = patientdetail.blood_patients;
  652. this.patientForm.member_patients = patientdetail.member_patients;
  653. this.patientForm.slow_patients = patientdetail.slow_patients;
  654. this.patientForm.memberFistDate = uParseTimeOne(
  655. patientdetail.member_fistdate,
  656. "{y}-{m}-{d}"
  657. );
  658. console.log("首次透析日期", patientdetail.first_dialysis_date);
  659. if (patientdetail.first_dialysis_date < 0) {
  660. this.patientForm.fistDate = "";
  661. }
  662. if (patientdetail.first_dialysis_date > 0) {
  663. this.patientForm.fistDate = uParseTimeOne(
  664. patientdetail.first_dialysis_date
  665. );
  666. }
  667. this.patientForm.diagnose = patientdetail.diagnose;
  668. if (patientdetail.member_treatement === 1) {
  669. this.patientForm.treatmentMethod = "西医治疗";
  670. }
  671. if (patientdetail.member_treatement === 2) {
  672. this.patientForm.treatmentMethod = "中医治疗";
  673. }
  674. if (patientdetail.member_treatement === 3) {
  675. this.patientForm.treatmentMethod = "血液透析";
  676. }
  677. if (patientdetail.member_treatement === 4) {
  678. this.patientForm.treatmentMethod = "腹膜透析";
  679. }
  680. if (patientdetail.member_treatement === 5) {
  681. this.patientForm.treatmentMethod = "肾移植";
  682. }
  683. for (let i = 0; i < this.illnesslist.length; i++) {
  684. if (patientdetail.member_patienttype === this.illnesslist[i].id) {
  685. this.patientForm.patient_type = this.illnesslist[i].illness_name;
  686. }
  687. }
  688. if (patientdetail.member_patients === 1) {
  689. this.bloodShow = false;
  690. this.slowShow = false;
  691. this.memberShow = true;
  692. }
  693. if (patientdetail.slow_patients === 1) {
  694. this.bloodShow = false;
  695. this.memberShow = false;
  696. this.slowShow = true;
  697. }
  698. if (
  699. patientdetail.blood_patients === 1 &&
  700. patientdetail.slow_patients === 1
  701. ) {
  702. this.bloodShow = true;
  703. this.slowShow = true;
  704. this.memberShow = false;
  705. }
  706. if (
  707. patientdetail.blood_patients === 1 &&
  708. patientdetail.member_patients === 1
  709. ) {
  710. this.bloodShow = true;
  711. this.memberShow = true;
  712. this.slowShow = false;
  713. }
  714. if (
  715. patientdetail.member_patients === 1 &&
  716. patientdetail.slow_patients === 1
  717. ) {
  718. this.memberShow = true;
  719. this.slowShow = true;
  720. this.bloodShow = false;
  721. }
  722. if (
  723. patientdetail.blood_patients === 1 &&
  724. patientdetail.slow_patients === 1 &&
  725. patientdetail.member_patients === 1
  726. ) {
  727. this.bloodShow = 1;
  728. this.slowShow = 1;
  729. this.memberShow = 1;
  730. }
  731. if (patientdetail.is_infectious === 1) {
  732. this.showOne = false;
  733. this.radio = "1";
  734. }
  735. if (patientdetail.is_infectious === 2) {
  736. this.showOne = true;
  737. this.radio = "2";
  738. }
  739. }
  740. });
  741. },
  742. GetIllnessList() {
  743. GetIllnessList().then(response => {
  744. if (response.data.state === 1) {
  745. var illnesslist = response.data.data.illnesslist;
  746. console.log("illnesslist", illnesslist);
  747. this.illnesslist = illnesslist;
  748. var arr = [];
  749. for (let i = 0; i < illnesslist.length; i++) {
  750. arr.push(illnesslist[i].illness_name);
  751. }
  752. this.patientType = arr;
  753. }
  754. });
  755. },
  756. checkIdCardNo() {
  757. if (!isCardNo(this.patientForm.idCard)) {
  758. this.$toast("身份证号码信息有误!");
  759. this.patientForm.birthday = "";
  760. return false;
  761. }
  762. var thisLen = this.patientForm.idCard.length;
  763. var birth = "";
  764. if (thisLen === 15) {
  765. birth = "19" + this.patientForm.idCard.substr(6, 6);
  766. } else {
  767. birth = this.patientForm.idCard.substr(6, 8);
  768. }
  769. this.patientForm.birthday =
  770. birth.substr(0, 4) +
  771. "-" +
  772. birth.substr(4, 2) +
  773. "-" +
  774. birth.substr(6, 2);
  775. },
  776. spread() {
  777. var spancontent = document.getElementById("copy").innerHTML;
  778. if (spancontent == "修改") {
  779. this.readonly = false;
  780. document.getElementById("copy").innerHTML = "保存";
  781. }
  782. if (spancontent == "保存") {
  783. this.updatedPatient();
  784. }
  785. },
  786. clickSex() {
  787. if (this.readonly == true) {
  788. this.show = false;
  789. }
  790. if (this.readonly == false) {
  791. this.show = true;
  792. }
  793. },
  794. clickPatientSoure() {
  795. if (this.readonly == true) {
  796. this.show3 = false;
  797. }
  798. if (this.readonly == false) {
  799. this.show3 = true;
  800. }
  801. },
  802. clickLapseto() {
  803. if (this.readonly == true) {
  804. this.show4 = false;
  805. }
  806. if (this.readonly == false) {
  807. this.show4 = true;
  808. }
  809. },
  810. clickDate() {
  811. if (this.readonly == true) {
  812. this.show2 = false;
  813. }
  814. if (this.readonly == false) {
  815. this.show2 = true;
  816. }
  817. },
  818. clickDateTwo() {
  819. if (this.readonly == true) {
  820. this.show12 = false;
  821. }
  822. if (this.readonly == false) {
  823. this.show12 = true;
  824. }
  825. },
  826. clickPatientType() {
  827. if (this.readonly == true) {
  828. this.show14 = false;
  829. }
  830. if (this.readonly == false) {
  831. this.show14 = true;
  832. }
  833. },
  834. clickTreatMethod() {
  835. if (this.readonly == true) {
  836. this.show13 = false;
  837. }
  838. if (this.readonly == false) {
  839. this.show13 = true;
  840. }
  841. },
  842. updatedPatient() {
  843. if (this.patientForm.name === "") {
  844. this.$toast("姓名不能为空");
  845. return false;
  846. }
  847. if (this.patientForm.sex === "") {
  848. this.$toast(" 性别不能为空");
  849. return false;
  850. }
  851. if (this.patientForm.idCard === "") {
  852. this.$toast("身份证不能为空");
  853. return false;
  854. }
  855. if (this.patientForm.birthday === "") {
  856. this.$toast("出生日期不能为空");
  857. return false;
  858. }
  859. if (this.patientForm.phone === "") {
  860. this.$toast("手机号码不能为空");
  861. return false;
  862. }
  863. if (this.result.length === 0) {
  864. this.$toast("患者类型不能为空");
  865. return false;
  866. }
  867. if (this.patientForm.dialysis === "" && this.result.indexOf("1") != -1) {
  868. this.$toast("透析号不能为空");
  869. return false;
  870. }
  871. if (
  872. this.patientForm.patientsoure === "" &&
  873. this.result.indexOf("1") != -1
  874. ) {
  875. this.$toast("患者来源不能为空");
  876. return false;
  877. }
  878. if (this.patientForm.lapseto === "" && this.result.indexOf("1") != -1) {
  879. this.$toast("留置状态不能为空");
  880. return false;
  881. }
  882. if (this.patientForm.lapseto === "") {
  883. this.patientForm.lapseto = 0;
  884. }
  885. if (this.patientForm.patientsoure == "门诊") {
  886. this.patientForm.patientsoure = 1;
  887. }
  888. if (this.patientForm.patientsoure == "住院") {
  889. this.patientForm.patientsoure = 2;
  890. }
  891. if (this.patientForm.lapseto == "留治") {
  892. this.patientForm.lapseto = 1;
  893. }
  894. if (this.patientForm.lapseto == "转出") {
  895. this.patientForm.lapseto = 2;
  896. }
  897. if (this.resultTwo.length === 0) {
  898. this.patientForm.is_infectious = 1;
  899. }
  900. if (this.resultTwo.length > 0) {
  901. this.patientForm.is_infectious = 2;
  902. }
  903. if (this.patientForm.treatmentMethod === undefined) {
  904. this.patientForm.treatmentMethod = 0;
  905. }
  906. if (this.patientForm.patient_type === "尿毒症") {
  907. this.patientForm.patient_type = 21;
  908. }
  909. if (this.patientForm.patient_type === "慢性肾衰竭") {
  910. this.patientForm.patient_type = 22;
  911. }
  912. if (this.patientForm.patient_type === "糖尿病肾病") {
  913. this.patientForm.patient_type = 23;
  914. }
  915. if (this.patientForm.patient_type === "高血压肾病") {
  916. this.patientForm.patient_type = 24;
  917. }
  918. if (this.patientForm.patient_type === "肾病综合征") {
  919. this.patientForm.patient_type = 25;
  920. }
  921. if (this.patientForm.patient_type === "IGA肾病") {
  922. this.patientForm.patient_type = 26;
  923. }
  924. if (this.patientForm.patient_type === "慢性肾炎") {
  925. this.patientForm.patient_type = 27;
  926. }
  927. if (this.patientForm.patient_type === "紫癜性肾炎") {
  928. this.patientForm.patient_type = 28;
  929. }
  930. if (this.patientForm.patient_type === "狼疮性肾炎") {
  931. this.patientForm.patient_type = 29;
  932. }
  933. if (this.patientForm.patient_type === "小儿肾病") {
  934. this.patientForm.patient_type = 30;
  935. }
  936. if (this.patientForm.patient_type === "肾结石") {
  937. this.patientForm.patient_type = 31;
  938. }
  939. if (this.patientForm.patient_type === "其他") {
  940. this.patientForm.patient_type = 32;
  941. }
  942. if (this.patientForm.treatmentMethod === "西医治疗") {
  943. this.patientForm.treatmentMethod = 1;
  944. }
  945. if (this.patientForm.treatmentMethod === "中医治疗") {
  946. this.patientForm.treatmentMethod = 2;
  947. }
  948. if (this.patientForm.treatmentMethod === "血液透析") {
  949. this.patientForm.treatmentMethod = 3;
  950. }
  951. if (this.patientForm.treatmentMethod === "腹膜透析") {
  952. this.patientForm.treatmentMethod = 4;
  953. }
  954. if (this.patientForm.treatmentMethod === "肾移植") {
  955. this.patientForm.treatmentMethod = 5;
  956. }
  957. if (this.patientForm.patient_type === "") {
  958. this.patientForm.patient_type = 0;
  959. }
  960. for (let i = 0; i < this.result.length; i++) {
  961. if (this.result[i] == 1) {
  962. this.patientForm.bloodPatient = 1;
  963. }
  964. if (this.result[i] == 2) {
  965. this.patientForm.slowPatient = 1;
  966. }
  967. if (this.result[i] == 3) {
  968. this.patientForm.memberPatient = 1;
  969. }
  970. }
  971. if (!checkMobile(this.patientForm.phone)) {
  972. this.$toast("请填写正确的手机号");
  973. return false;
  974. }
  975. if (this.patientForm.sex !== "") {
  976. if (this.patientForm.sex === "男") {
  977. this.patientForm.sex = 1;
  978. this.patientForm.avatar =
  979. "https://images.shengws.com/201809182128111.png";
  980. }
  981. if (this.patientForm.sex === "女") {
  982. this.patientForm.sex = 2;
  983. this.patientForm.avatar =
  984. "https://images.shengws.com/201809182128222.png";
  985. }
  986. }
  987. if (this.patientForm.patientsoure === "") {
  988. this.patientForm.patientsoure = 0;
  989. }
  990. if (this.patientForm.patientsoure !== "") {
  991. if (this.patientForm.patientsoure === "门诊") {
  992. this.patientForm.patientsoure = 1;
  993. }
  994. if (this.patientForm.patientsoure === "住院") {
  995. this.patientForm.patientsoure = 2;
  996. }
  997. }
  998. if (this.patientForm.lapseto !== "") {
  999. if (this.patientForm.lapseto === "留治") {
  1000. this.patientForm.lapseto = 1;
  1001. }
  1002. if (this.patientForm.lapseto === "转出") {
  1003. this.patientForm.lapseto = 2;
  1004. }
  1005. }
  1006. for (let i = 0; i < this.illnesslist.length; i++) {
  1007. if (
  1008. this.illnesslist[i].illness_name === this.patientForm.patient_type
  1009. ) {
  1010. this.patientForm.patient_type = this.illnesslist[i].id;
  1011. }
  1012. }
  1013. const params = {
  1014. id: this.patientForm.id,
  1015. name: this.patientForm.name,
  1016. sex: this.patientForm.sex,
  1017. idCard: this.patientForm.idCard,
  1018. birthday: this.patientForm.birthday,
  1019. phone: this.patientForm.phone,
  1020. result: this.result,
  1021. dialysis: this.patientForm.dialysis,
  1022. patientsoure: this.patientForm.patientsoure,
  1023. lapseto: this.patientForm.lapseto,
  1024. resultTwo: this.resultTwo,
  1025. admissionNumber: this.patientForm.admissionNumber,
  1026. fistDate: this.patientForm.fistDate,
  1027. diagnose: this.patientForm.diagnose,
  1028. bloodPatient: this.patientForm.bloodPatient,
  1029. slowPatient: this.patientForm.slowPatient,
  1030. memberPatient: this.patientForm.memberPatient,
  1031. avatar: this.patientForm.avatar,
  1032. requipmentId: this.patientForm.requipmentId, // 慢病信息
  1033. resultThree: this.resultThree,
  1034. resultFour: this.resultFour,
  1035. patientType: this.patientForm.patient_type,
  1036. memberFistDate: this.patientForm.memberFistDate,
  1037. treatmentMethod: this.patientForm.treatmentMethod,
  1038. is_infectious: this.patientForm.is_infectious
  1039. };
  1040. updatedPatient(params).then(response => {
  1041. if (response.data.state === 1) {
  1042. var msg = response.data.data.msg;
  1043. console.log("msg", msg);
  1044. if (msg === "身份证号码已存在") {
  1045. this.$toast("身份证号码已存在");
  1046. if (this.patientForm.sex === 1) {
  1047. this.patientForm.sex = "男";
  1048. }
  1049. if (this.patientForm.sex === 2) {
  1050. this.patientForm.sex = "女";
  1051. }
  1052. if (this.patientForm.patientsoure === 1) {
  1053. this.patientForm.patientsoure = "门诊";
  1054. }
  1055. if (this.patientForm.patientsoure === 2) {
  1056. this.patientForm.patientsoure = "住院";
  1057. }
  1058. if (this.patientForm.lapseto === 1) {
  1059. this.patientForm.lapseto = "留治";
  1060. }
  1061. if (this.patientForm.lapseto === 2) {
  1062. this.patientForm.lapseto = "转出";
  1063. }
  1064. return false;
  1065. }
  1066. if (msg == "手机号码已存在") {
  1067. this.$toast("手机号码已存在");
  1068. if (this.patientForm.sex === 1) {
  1069. this.patientForm.sex = "男";
  1070. }
  1071. if (this.patientForm.sex === 2) {
  1072. this.patientForm.sex = "女";
  1073. }
  1074. if (this.patientForm.patientsoure === 1) {
  1075. this.patientForm.patientsoure = "门诊";
  1076. }
  1077. if (this.patientForm.patientsoure === 2) {
  1078. this.patientForm.patientsoure = "住院";
  1079. }
  1080. if (this.patientForm.lapseto === 1) {
  1081. this.patientForm.lapseto = "留治";
  1082. }
  1083. if (this.patientForm.lapseto === 2) {
  1084. this.patientForm.lapseto = "转出";
  1085. }
  1086. return false;
  1087. }
  1088. if (msg === "透析号码已存在") {
  1089. this.$toast("透析号码已存在");
  1090. if (this.patientForm.sex === 1) {
  1091. this.patientForm.sex = "男";
  1092. }
  1093. if (this.patientForm.sex === 2) {
  1094. this.patientForm.sex = "女";
  1095. }
  1096. if (this.patientForm.patientsoure === 1) {
  1097. this.patientForm.patientsoure = "门诊";
  1098. }
  1099. if (this.patientForm.patientsoure === 2) {
  1100. this.patientForm.patientsoure = "住院";
  1101. }
  1102. if (this.patientForm.lapseto === 1) {
  1103. this.patientForm.lapseto = "留治";
  1104. }
  1105. if (this.patientForm.lapseto === 2) {
  1106. this.patientForm.lapseto = "转出";
  1107. }
  1108. return false;
  1109. }
  1110. if (msg === undefined) {
  1111. this.$toast("修改成功");
  1112. var patients = response.data.data.patients;
  1113. this.$router.push("/patientdetail?patientid=" + patients.id);
  1114. }
  1115. }
  1116. });
  1117. },
  1118. changRadio() {
  1119. if (this.radio === "1") {
  1120. this.showOne = false;
  1121. }
  1122. if (this.radio === "2") {
  1123. this.showOne = true;
  1124. }
  1125. }
  1126. },
  1127. created() {
  1128. setRem();
  1129. setHeight();
  1130. var patientid = this.$route.query.patientid;
  1131. this.patient_id = patientid;
  1132. this.GetPatientDetail(patientid);
  1133. this.GetIllnessList();
  1134. }
  1135. };
  1136. </script>
  1137. <style lang="scss" scoped>
  1138. .page_editPatients {
  1139. overflow-y: auto;
  1140. height: 100%;
  1141. background: #fafafa;
  1142. .addPatientsTitle {
  1143. height: 3.125rem;
  1144. display: flex;
  1145. align-items: center;
  1146. justify-content: space-between;
  1147. width: 100%;
  1148. padding: 0 1.125rem;
  1149. background: #fff;
  1150. span {
  1151. font-size: 1rem;
  1152. }
  1153. }
  1154. .jiantou {
  1155. font-size: 1.5rem;
  1156. font-weight: 600;
  1157. margin-right: 1.25rem;
  1158. }
  1159. .titleName {
  1160. font-size: 1.125rem !important;
  1161. font-weight: 600;
  1162. }
  1163. .basicTitle {
  1164. font-size: 0.75rem;
  1165. color: #989898;
  1166. padding: 0 1rem;
  1167. height: 1.875rem;
  1168. line-height: 1.875rem;
  1169. }
  1170. .basicBox {
  1171. .van-cell__value {
  1172. display: flex;
  1173. }
  1174. .van-field__body {
  1175. width: 100%;
  1176. }
  1177. }
  1178. .custom-title::before {
  1179. position: absolute;
  1180. left: 8px;
  1181. color: #ee0a24;
  1182. font-size: 14px;
  1183. content: "*";
  1184. }
  1185. .van-cell__title {
  1186. display: flex;
  1187. }
  1188. .van-checkbox-group {
  1189. display: flex;
  1190. flex-wrap: wrap;
  1191. }
  1192. .van-checkbox {
  1193. width: 48%;
  1194. margin-bottom: 0.625rem;
  1195. }
  1196. .van-radio-group {
  1197. display: flex;
  1198. flex-wrap: wrap;
  1199. width: 100%;
  1200. }
  1201. .van-radio {
  1202. width: 48%;
  1203. }
  1204. .autoGeneration {
  1205. width: 5rem;
  1206. height: 1.875rem;
  1207. line-height: 1.875rem;
  1208. background: #338afb;
  1209. border-radius: 0.9375rem;
  1210. text-align: center;
  1211. }
  1212. .van-button--info {
  1213. border-radius: 0.9375rem;
  1214. }
  1215. .van-button--small {
  1216. min-width: 3.75rem !important;
  1217. height: 1.875rem;
  1218. padding: 0 0.5rem;
  1219. font-size: 0.75rem !important;
  1220. line-height: 1.75rem;
  1221. }
  1222. .moreInfo {
  1223. text-align: center;
  1224. font-size: 0.75rem;
  1225. color: #338afb;
  1226. margin: 0.625rem 0 4.5rem;
  1227. }
  1228. .van-cell {
  1229. align-items: center;
  1230. }
  1231. .turnOut {
  1232. height: 2.8125rem;
  1233. line-height: 2.8125rem;
  1234. text-align: center;
  1235. background: #fff;
  1236. margin-top: 0.75rem;
  1237. }
  1238. }
  1239. ::-webkit-scrollbar {
  1240. width: 0;
  1241. }
  1242. </style>
  1243. <style lang="scss">
  1244. .page_editPatients {
  1245. .changeColor {
  1246. .van-field__control {
  1247. color: #9b9b9b !important;
  1248. }
  1249. }
  1250. .basicBox {
  1251. .van-cell__value {
  1252. font-size: 1rem;
  1253. }
  1254. .van-cell__title {
  1255. font-size: 1rem;
  1256. }
  1257. }
  1258. .xtBox {
  1259. .van-cell__value {
  1260. font-size: 1rem;
  1261. }
  1262. .van-cell__title {
  1263. font-size: 1rem;
  1264. }
  1265. }
  1266. }
  1267. </style>