123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314 |
- <template>
- <div class="page_editPatients">
- <van-sticky>
- <div class="addPatientsTitle">
- <i class="iconfont icon-zuojiantou jiantou" @click="$router.go(-1)"></i>
- <span class="titleName">编辑患者</span>
- <span @click="spread" id="copy">修改</span>
- </div>
- </van-sticky>
- <div class="basicTitle">基本信息</div>
- <div class="basicBox">
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.name"
- required
- label="姓名"
- :readonly="readonly"
- placeholder="请输入"
- />
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="性别"
- v-model="patientForm.sex"
- right-icon="arrow"
- placeholder="请选择"
- required
- :readonly="readonly"
- @click="clickSex"
- />
- <van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
- <van-picker :columns="columns" show-toolbar @change="onChange" />
- </van-popup>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.idCard"
- required
- label="身份证号"
- @blur="checkIdCardNo"
- placeholder="请输入"
- :readonly="readonly"
- />
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.birthday"
- required
- label="出生日期"
- :readonly="readonly"
- placeholder="请输入"
- />
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.phone"
- type="tel"
- required
- label="手机号"
- placeholder="请输入"
- :readonly="readonly"
- />
- <van-cell>
- <!-- 使用 title 插槽来自定义标题 -->
- <template slot="title">
- <span class="custom-title">患者类型</span>
- <div style="width:60%;margin-left:2rem">
- <van-checkbox-group v-model="result">
- <van-checkbox name="1" shape="square" @click="changeMode"
- >血透患者</van-checkbox
- >
- <van-checkbox name="2" shape="square" @click="changeMode"
- >慢病患者</van-checkbox
- >
- <van-checkbox name="3" shape="square" @click="changeMode"
- >会员患者</van-checkbox
- >
- </van-checkbox-group>
- </div>
- </template>
- </van-cell>
- </div>
- <div v-show="bloodShow">
- <div class="basicTitle">血透信息</div>
- <div class="xtBox">
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.dialysis"
- center
- clearable
- required
- label="透析号"
- :readonly="readonly"
- >
- <van-button
- slot="button"
- size="small"
- type="info"
- @click="generatedialysisno"
- >自动生成</van-button
- >
- </van-field>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="患者来源"
- v-model="patientForm.patientsoure"
- right-icon="arrow"
- required
- :readonly="readonly"
- placeholder="请选择"
- @click="clickPatientSoure"
- />
- <van-popup v-model="show3" position="bottom" :style="{ height: '40%' }">
- <van-picker :columns="columns2" show-toolbar @change="onChange1" />
- </van-popup>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="留治状态"
- v-model="patientForm.lapseto"
- right-icon="arrow"
- required
- :readonly="readonly"
- placeholder="请选择"
- @click="clickLapseto"
- />
- <van-popup v-model="show4" position="bottom" :style="{ height: '40%' }">
- <van-picker :columns="columns4" show-toolbar @change="onChange2" />
- </van-popup>
-
- <van-cell>
- <!-- 使用 title 插槽来自定义标题 -->
- <template slot="title">
- <span class="custom-title">有无传染病</span>
- <div
- style="width:60%;margin-left:1.3rem;display: flex;align-items: center;"
- >
- <van-radio-group v-model="radio" @change="changRadio">
- <van-radio name="1" shape="square">无</van-radio>
- <van-radio name="2" shape="square">有</van-radio>
- </van-radio-group>
- </div>
- </template>
- </van-cell>
-
- <van-cell v-show="showOne">
- <!-- 使用 title 插槽来自定义标题 -->
- <template slot="title">
- <span class="custom-title">传染病</span>
- <div style="width:60%;margin-left:3rem">
- <van-checkbox-group v-model="resultTwo">
- <van-checkbox name="2" shape="square">乙肝</van-checkbox>
- <van-checkbox name="3" shape="square">丙肝</van-checkbox>
- <van-checkbox name="4" shape="square">艾滋</van-checkbox>
- <van-checkbox name="5" shape="square">肺结核</van-checkbox>
- <van-checkbox name="6" shape="square">梅毒</van-checkbox>
- </van-checkbox-group>
- </div>
- </template>
- </van-cell>
-
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.admissionNumber"
- :readonly="readonly"
- type="text"
- label="住院(门诊)号"
- />
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="首次透析日期"
- v-model="patientForm.fistDate"
- right-icon="arrow"
- :readonly="readonly"
- placeholder="请选择"
- @click="clickDate"
- />
- <van-popup v-model="show2" position="bottom" :style="{ height: '40%' }">
- <van-datetime-picker
- v-model="currentDate"
- type="date"
- :min-date="minDate"
- :max-date="maxDate"
- @cancel="onCancel"
- @confirm="onConfirm"
- />
- </van-popup>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.diagnose"
- rows="1"
- autosize
- label="诊断"
- type="textarea"
- maxlength="50"
- :readonly="readonly"
- placeholder="请输入主要诊断信息"
- />
- </div>
- </div>
- <div v-show="slowShow">
- <div class="basicTitle">慢病信息</div>
- <div class="xtBox">
- <van-field
- :class="readonly ? 'changeColor' : ''"
- v-model="patientForm.requipmentId"
- label="设备ID"
- placeholder="请输入"
- :readonly="readonly"
- />
-
- <van-cell>
- <!-- 使用 title 插槽来自定义标题 -->
- <template slot="title">
- <span class="custom-title2">传染病</span>
- <div style="width:60%;margin-left:3rem">
- <van-checkbox-group v-model="resultThree">
- <van-checkbox name="1" shape="square">乙肝</van-checkbox>
- <van-checkbox name="2" shape="square">丙肝</van-checkbox>
- <van-checkbox name="3" shape="square">艾滋</van-checkbox>
- <van-checkbox name="4" shape="square">肺结核</van-checkbox>
- <van-checkbox name="5" shape="square">梅毒</van-checkbox>
- </van-checkbox-group>
- </div>
- </template>
- </van-cell>
-
- <van-cell>
- <!-- 使用 title 插槽来自定义标题 -->
- <template slot="title">
- <span class="custom-title2">慢性病</span>
- <div style="width:60%;margin-left:3rem">
- <van-checkbox-group v-model="resultFour">
- <van-checkbox name="1" shape="square">血透</van-checkbox>
- <van-checkbox name="2" shape="square">腹透</van-checkbox>
- <van-checkbox name="3" shape="square">移植</van-checkbox>
- <van-checkbox name="4" shape="square">高血压</van-checkbox>
- <van-checkbox name="5" shape="square">糖尿病</van-checkbox>
- <van-checkbox name="6" shape="square">慢性肾病</van-checkbox>
- <van-checkbox name="7" shape="square">其他</van-checkbox>
- </van-checkbox-group>
- </div>
- </template>
- </van-cell>
- </div>
- </div>
- <div v-show="memberShow">
- <div class="basicTitle">会员资料</div>
- <div class="xtBox">
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="首次透析日期"
- v-model="patientForm.memberFistDate"
- right-icon="arrow"
- :readonly="readonly"
- placeholder="请选择"
- @click="clickDateTwo"
- />
- <van-popup
- v-model="show12"
- position="bottom"
- :style="{ height: '40%' }"
- >
- <van-datetime-picker
- v-model="currentDate"
- type="date"
- :min-date="minDate"
- :max-date="maxDate"
- @cancel="onCancel"
- @confirm="onConfirmOne"
- />
- </van-popup>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="病种"
- v-model="patientForm.patient_type"
- right-icon="arrow"
- :readonly="readonly"
- placeholder="请选择"
- @click="clickPatientType"
- />
- <van-popup
- v-model="show14"
- position="bottom"
- :style="{ height: '40%' }"
- >
- <van-picker
- :columns="patientType"
- show-toolbar
- @change="onChangeSix"
- @cancel="cancelSeven"
- />
- </van-popup>
- <van-field
- :class="readonly ? 'changeColor' : ''"
- label="治疗方式"
- v-model="patientForm.treatmentMethod"
- right-icon="arrow"
- :readonly="readonly"
- placeholder="请选择"
- @click="clickTreatMethod"
- />
- <van-popup
- v-model="show13"
- position="bottom"
- :style="{ height: '40%' }"
- >
- <van-picker
- :columns="treatmentMethod"
- show-toolbar
- @change="onChangeSeven"
- @cancel="cancelEight"
- />
- </van-popup>
- </div>
- </div>
- <div class="moreInfo">如需要完善更多病人信息,请在电脑端完善</div>
- </div>
- </template>
-
- <script>
- import {
- GenerateDialysisNo,
- GetIllnessList,
- savePatient,
- GetPatientInfo,
- getBloodPatientInfo,
- getSlowPatientInfo,
- getMemberPatientInfo,
- GetPatientDetail,
- updatedPatient
- } from "@/api/patient/patient";
- import {
- isCardNo,
- checkMobile,
- getFileExtension,
- uParseTime,
- uParseTimeOne
- } from "@/utils/tools";
- import { getToken } from "@/api/qiniu";
- import { setRem, setHeight } from "@/libs/functionRem";
- const moment = require("moment");
- export default {
- data() {
- var checkMobileRule = (rule, value, callback) => {
- if (!checkMobile(value)) {
- callback(new Error("请填写正确的手机号"));
- } else {
- callback();
- }
- };
-
- return {
- show: false,
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- name: "",
- columns: ["男", "女"],
- columns1: ["1", "2", "3"],
- columns2: ["门诊", "住院"],
- columns4: ["留治", "转出"],
- sex: "",
- idCard: "",
- birthday: "",
- tel: "",
- result: [],
- dialysisNumber: "",
- source: "",
- source2: "",
- source3: "",
- show10: false,
- show9: false,
- show8: false,
- show7: false,
- show6: false,
- show11: false,
- show12: false,
- show13: false,
- show14: false,
- hospitalNum: "",
- minDate: new Date(1970, 0, 1),
- maxDate: new Date(2025, 10, 1),
- currentDate: new Date(),
- time: "",
- message: "",
- patient_id: "",
- resultTwo: [],
- resultThree: [],
- resultFour: [],
- patientForm: {
- id: "",
- name: "",
- sex: "",
- idCard: "",
- birthday: "",
- phone: "",
- dialysis: "",
- patient_type: "",
- admissionNumber: "",
- patientsoure: "",
- lapseto: "",
- contagions: [],
- fistDate: "",
- diagnose: "",
- requipmentId: "",
- slowcontagions: [],
- slowDisease: "",
- memberIllnessTime: "",
- memberlapseto: "",
- TreatmentMethod: "",
- bloodPatient: 0,
- slowPatient: 0,
- memberPatient: 0,
- avatar: "",
- memberFistDate: "",
- blood_patients: "",
- slow_patients: "",
- member_patients: ""
- },
- bloodShow: true,
- slowShow: false,
- memberShow: false,
- patientType: [],
- treatmentMethod: [
- "西医治疗",
- "中医治疗",
- "血液透析",
- "腹膜透析",
- "肾移植"
- ],
- illnesslist: [],
- radio: "1",
- showOne: false,
- readonly: true
- };
- },
- methods: {
- onChange(picker, value, index) {
- this.patientForm.sex = value;
- this.show = false;
- },
- onChange1(picker, value, index) {
- this.patientForm.patientsoure = value;
- this.show3 = false;
- },
- onChange2(picker, value, index) {
- this.patientForm.lapseto = value;
- this.show4 = false;
- },
- onChange3(picker, value, index) {
- this.source3 = value;
- this.show3 = false;
- },
- onChange4(picker, value, index) {
- this.source = value;
- this.show1 = false;
- },
- onCancel() {
- this.show2 = false;
- },
- onConfirm(value) {
- let year = value.getFullYear();
- let month = value.getMonth() + 1;
- let day = value.getDate();
- if (month >= 1 && month <= 9) {
- month = `0${month}`;
- }
- if (day >= 1 && day <= 9) {
- day = `0${day}`;
- }
-
- this.patientForm.fistDate = `${year}-${month}-${day}`;
- this.show2 = false;
- },
- onConfirmOne(value) {
- let year = value.getFullYear();
- let month = value.getMonth() + 1;
- let day = value.getDate();
- if (month >= 1 && month <= 9) {
- month = `0${month}`;
- }
- if (day >= 1 && day <= 9) {
- day = `0${day}`;
- }
-
- this.patientForm.memberFistDate = `${year}-${month}-${day}`;
- this.show12 = false;
- },
- cancelSeven() {
- this.show14 = false;
- },
- cancelEight() {
- this.show13 = false;
- },
- toReturn() {
- this.$router.push("/patientdetail?patientid=" + this.patient_id);
- },
- changeMode(val) {
- if (val == 1) {
- getBloodPatientInfo(this.patientForm.phone).then(response => {
- if (response.data.state === 1) {
- var msg = response.data.data.msg;
- } else {
- this.$toast("血透患者已存在");
- return false;
- }
- });
- }
-
- if (val == 2) {
- getSlowPatientInfo(this.patientForm.phone).then(response => {
- if (response.data.state === 1) {
- var msg = response.data.data.msg;
- } else {
- this.$toast("慢病患者已存在");
- return false;
- }
- });
- }
-
- if (val == 3) {
- getMemberPatientInfo(this.patientForm.phone).then(response => {
- if (response.data.state === 1) {
- var msg = response.data.data.msg;
- } else {
- this.$toast("会员已存在");
- return false;
- }
- });
- }
-
- if (this.result.indexOf("1") != -1) {
- this.bloodShow = true;
- this.slowShow = false;
- this.memberShow = false;
- }
- if (this.result.indexOf("2") != -1) {
- this.slowShow = true;
- this.bloodShow = false;
- this.memberShow = false;
- }
- if (this.result.indexOf("3") != -1) {
- this.memberShow = true;
- this.bloodShow = false;
- this.slowShow = false;
- }
-
- if (this.result.indexOf("1") != -1 && this.result.indexOf("2") != -1) {
- this.bloodShow = true;
- this.slowShow = true;
- this.memberShow = false;
- }
- if (
- this.result.indexOf("1") != -1 &&
- this.result.indexOf("2") != -1 &&
- this.result.indexOf("3") != -1
- ) {
- this.bloodShow = true;
- this.slowShow = true;
- this.memberShow = true;
- }
-
- if (this.result.indexOf("1") != -1 && this.result.indexOf("3") != -1) {
- this.bloodShow = false;
- this.slowShow = true;
- this.memberShow = true;
- }
- if (this.result.indexOf("3") != -1 && this.result.indexOf("1") != -1) {
- this.bloodShow = true;
- this.slowShow = false;
- this.memberShow = true;
- }
- if (this.result.indexOf("2") != -1 && this.result.indexOf("3") != -1) {
- this.bloodShow = false;
- this.slowShow = true;
- this.memberShow = true;
- }
-
- if (
- this.result.indexOf("2") != -1 &&
- this.result.indexOf("3") != -1 &&
- this.result.indexOf("1") != -1
- ) {
- this.bloodShow = true;
- this.slowShow = true;
- this.memberShow = true;
- }
-
- if (this.result.length == 0) {
- this.bloodShow = false;
- this.slowShow = false;
- this.memberShow = false;
- }
- },
- generatedialysisno() {
- GenerateDialysisNo().then(response => {
- // eslint-disable-next-line eqeqeq
- if (response.data.state == 1) {
- var no = response.data.data.no + "";
- this.patientForm.dialysis = no;
- }
- });
- },
- onChangeSix(picker, value, index) {
- this.patientForm.patient_type = value;
- this.show14 = false;
- },
- onChangeSeven(picker, value, index) {
- this.patientForm.treatmentMethod = value;
- this.show13 = false;
- },
- GetPatientDetail(patientid) {
- GetPatientDetail(patientid).then(response => {
- if (response.data.state === 1) {
- var patientdetail = response.data.data.patientDetail;
- // console.log("patientdetail", patientdetail);
- var diseases = response.data.data.diseases;
- var slowDisease = response.data.data.slowDiseases;
- for (let i = 0; i < diseases.length; i++) {
- this.resultTwo.push(String(diseases[i]));
- }
- for (let i = 0; i < slowDisease.length; i++) {
- this.resultThree.push(String(slowDisease[i].disease_id));
- }
- var cronicdisease = response.data.data.cronicDiseases;
- for (let i = 0; i < cronicdisease.length; i++) {
- this.resultFour.push(String(cronicdisease[i].disease_id));
- }
- if (patientdetail.gender === 1) {
- patientdetail.gender = "男";
- }
- if (patientdetail.gender === 2) {
- patientdetail.gender = "女";
- }
- if (patientdetail.source === 1) {
- patientdetail.source = "门诊";
- }
- if (patientdetail.source === 2) {
- patientdetail.source = "住院";
- }
- if (patientdetail.lapseto === 1) {
- patientdetail.lapseto = "留治";
- }
- if (patientdetail.lapseto === 2) {
- patientdetail.lapseto = "转出";
- }
- this.patientForm.name = patientdetail.name;
- this.patientForm.sex = patientdetail.gender;
- this.patientForm.idCard = patientdetail.id_card_no;
- this.patientForm.birthday = uParseTime(
- patientdetail.birthday,
- "{y}-{m}-{d}"
- );
- this.patientForm.phone = patientdetail.phone;
-
- if (patientdetail.blood_patients == 1) {
- this.result.push(String(1));
- }
- if (patientdetail.slow_patients == 1) {
- this.result.push(String(2));
- }
- if (patientdetail.member_patients == 1) {
- this.result.push(String(3));
- }
- this.patientForm.id = patientdetail.id;
- this.patientForm.dialysis = patientdetail.dialysis_no;
- this.patientForm.patientsoure = patientdetail.source;
- this.patientForm.lapseto = patientdetail.lapseto;
- this.patientForm.admissionNumber = patientdetail.admission_number;
- this.patientForm.requipmentId = patientdetail.equitment_id;
- this.patientForm.blood_patients = patientdetail.blood_patients;
- this.patientForm.member_patients = patientdetail.member_patients;
- this.patientForm.slow_patients = patientdetail.slow_patients;
- this.patientForm.memberFistDate = uParseTimeOne(
- patientdetail.member_fistdate,
- "{y}-{m}-{d}"
- );
-
- console.log("首次透析日期", patientdetail.first_dialysis_date);
-
- if (patientdetail.first_dialysis_date < 0) {
- this.patientForm.fistDate = "";
- }
- if (patientdetail.first_dialysis_date > 0) {
- this.patientForm.fistDate = uParseTimeOne(
- patientdetail.first_dialysis_date
- );
- }
-
- this.patientForm.diagnose = patientdetail.diagnose;
- if (patientdetail.member_treatement === 1) {
- this.patientForm.treatmentMethod = "西医治疗";
- }
- if (patientdetail.member_treatement === 2) {
- this.patientForm.treatmentMethod = "中医治疗";
- }
- if (patientdetail.member_treatement === 3) {
- this.patientForm.treatmentMethod = "血液透析";
- }
- if (patientdetail.member_treatement === 4) {
- this.patientForm.treatmentMethod = "腹膜透析";
- }
- if (patientdetail.member_treatement === 5) {
- this.patientForm.treatmentMethod = "肾移植";
- }
-
- for (let i = 0; i < this.illnesslist.length; i++) {
- if (patientdetail.member_patienttype === this.illnesslist[i].id) {
- this.patientForm.patient_type = this.illnesslist[i].illness_name;
- }
- }
-
- if (patientdetail.member_patients === 1) {
- this.bloodShow = false;
- this.slowShow = false;
- this.memberShow = true;
- }
- if (patientdetail.slow_patients === 1) {
- this.bloodShow = false;
- this.memberShow = false;
- this.slowShow = true;
- }
- if (
- patientdetail.blood_patients === 1 &&
- patientdetail.slow_patients === 1
- ) {
- this.bloodShow = true;
- this.slowShow = true;
- this.memberShow = false;
- }
- if (
- patientdetail.blood_patients === 1 &&
- patientdetail.member_patients === 1
- ) {
- this.bloodShow = true;
- this.memberShow = true;
- this.slowShow = false;
- }
- if (
- patientdetail.member_patients === 1 &&
- patientdetail.slow_patients === 1
- ) {
- this.memberShow = true;
- this.slowShow = true;
- this.bloodShow = false;
- }
- if (
- patientdetail.blood_patients === 1 &&
- patientdetail.slow_patients === 1 &&
- patientdetail.member_patients === 1
- ) {
- this.bloodShow = 1;
- this.slowShow = 1;
- this.memberShow = 1;
- }
- if (patientdetail.is_infectious === 1) {
- this.showOne = false;
- this.radio = "1";
- }
- if (patientdetail.is_infectious === 2) {
- this.showOne = true;
- this.radio = "2";
- }
- }
- });
- },
- GetIllnessList() {
- GetIllnessList().then(response => {
- if (response.data.state === 1) {
- var illnesslist = response.data.data.illnesslist;
- console.log("illnesslist", illnesslist);
- this.illnesslist = illnesslist;
- var arr = [];
- for (let i = 0; i < illnesslist.length; i++) {
- arr.push(illnesslist[i].illness_name);
- }
- this.patientType = arr;
- }
- });
- },
- checkIdCardNo() {
- if (!isCardNo(this.patientForm.idCard)) {
- this.$toast("身份证号码信息有误!");
- this.patientForm.birthday = "";
- return false;
- }
- var thisLen = this.patientForm.idCard.length;
- var birth = "";
- if (thisLen === 15) {
- birth = "19" + this.patientForm.idCard.substr(6, 6);
- } else {
- birth = this.patientForm.idCard.substr(6, 8);
- }
- this.patientForm.birthday =
- birth.substr(0, 4) +
- "-" +
- birth.substr(4, 2) +
- "-" +
- birth.substr(6, 2);
- },
- spread() {
- var spancontent = document.getElementById("copy").innerHTML;
- if (spancontent == "修改") {
- this.readonly = false;
- document.getElementById("copy").innerHTML = "保存";
- }
- if (spancontent == "保存") {
- this.updatedPatient();
- }
- },
- clickSex() {
- if (this.readonly == true) {
- this.show = false;
- }
- if (this.readonly == false) {
- this.show = true;
- }
- },
- clickPatientSoure() {
- if (this.readonly == true) {
- this.show3 = false;
- }
- if (this.readonly == false) {
- this.show3 = true;
- }
- },
- clickLapseto() {
- if (this.readonly == true) {
- this.show4 = false;
- }
- if (this.readonly == false) {
- this.show4 = true;
- }
- },
- clickDate() {
- if (this.readonly == true) {
- this.show2 = false;
- }
- if (this.readonly == false) {
- this.show2 = true;
- }
- },
- clickDateTwo() {
- if (this.readonly == true) {
- this.show12 = false;
- }
- if (this.readonly == false) {
- this.show12 = true;
- }
- },
- clickPatientType() {
- if (this.readonly == true) {
- this.show14 = false;
- }
- if (this.readonly == false) {
- this.show14 = true;
- }
- },
- clickTreatMethod() {
- if (this.readonly == true) {
- this.show13 = false;
- }
- if (this.readonly == false) {
- this.show13 = true;
- }
- },
- updatedPatient() {
- if (this.patientForm.name === "") {
- this.$toast("姓名不能为空");
- return false;
- }
- if (this.patientForm.sex === "") {
- this.$toast(" 性别不能为空");
- return false;
- }
- if (this.patientForm.idCard === "") {
- this.$toast("身份证不能为空");
- return false;
- }
- if (this.patientForm.birthday === "") {
- this.$toast("出生日期不能为空");
- return false;
- }
- if (this.patientForm.phone === "") {
- this.$toast("手机号码不能为空");
- return false;
- }
- if (this.result.length === 0) {
- this.$toast("患者类型不能为空");
- return false;
- }
- if (this.patientForm.dialysis === "" && this.result.indexOf("1") != -1) {
- this.$toast("透析号不能为空");
- return false;
- }
- if (
- this.patientForm.patientsoure === "" &&
- this.result.indexOf("1") != -1
- ) {
- this.$toast("患者来源不能为空");
- return false;
- }
-
- if (this.patientForm.lapseto === "" && this.result.indexOf("1") != -1) {
- this.$toast("留置状态不能为空");
- return false;
- }
-
- if (this.patientForm.lapseto === "") {
- this.patientForm.lapseto = 0;
- }
-
- if (this.patientForm.patientsoure == "门诊") {
- this.patientForm.patientsoure = 1;
- }
- if (this.patientForm.patientsoure == "住院") {
- this.patientForm.patientsoure = 2;
- }
-
- if (this.patientForm.lapseto == "留治") {
- this.patientForm.lapseto = 1;
- }
-
- if (this.patientForm.lapseto == "转出") {
- this.patientForm.lapseto = 2;
- }
-
- if (this.resultTwo.length === 0) {
- this.patientForm.is_infectious = 1;
- }
-
- if (this.resultTwo.length > 0) {
- this.patientForm.is_infectious = 2;
- }
-
- if (this.patientForm.treatmentMethod === undefined) {
- this.patientForm.treatmentMethod = 0;
- }
-
- if (this.patientForm.patient_type === "尿毒症") {
- this.patientForm.patient_type = 21;
- }
- if (this.patientForm.patient_type === "慢性肾衰竭") {
- this.patientForm.patient_type = 22;
- }
- if (this.patientForm.patient_type === "糖尿病肾病") {
- this.patientForm.patient_type = 23;
- }
-
- if (this.patientForm.patient_type === "高血压肾病") {
- this.patientForm.patient_type = 24;
- }
-
- if (this.patientForm.patient_type === "肾病综合征") {
- this.patientForm.patient_type = 25;
- }
-
- if (this.patientForm.patient_type === "IGA肾病") {
- this.patientForm.patient_type = 26;
- }
-
- if (this.patientForm.patient_type === "慢性肾炎") {
- this.patientForm.patient_type = 27;
- }
-
- if (this.patientForm.patient_type === "紫癜性肾炎") {
- this.patientForm.patient_type = 28;
- }
-
- if (this.patientForm.patient_type === "狼疮性肾炎") {
- this.patientForm.patient_type = 29;
- }
- if (this.patientForm.patient_type === "小儿肾病") {
- this.patientForm.patient_type = 30;
- }
- if (this.patientForm.patient_type === "肾结石") {
- this.patientForm.patient_type = 31;
- }
- if (this.patientForm.patient_type === "其他") {
- this.patientForm.patient_type = 32;
- }
-
- if (this.patientForm.treatmentMethod === "西医治疗") {
- this.patientForm.treatmentMethod = 1;
- }
- if (this.patientForm.treatmentMethod === "中医治疗") {
- this.patientForm.treatmentMethod = 2;
- }
- if (this.patientForm.treatmentMethod === "血液透析") {
- this.patientForm.treatmentMethod = 3;
- }
- if (this.patientForm.treatmentMethod === "腹膜透析") {
- this.patientForm.treatmentMethod = 4;
- }
- if (this.patientForm.treatmentMethod === "肾移植") {
- this.patientForm.treatmentMethod = 5;
- }
-
- if (this.patientForm.patient_type === "") {
- this.patientForm.patient_type = 0;
- }
-
- for (let i = 0; i < this.result.length; i++) {
- if (this.result[i] == 1) {
- this.patientForm.bloodPatient = 1;
- }
- if (this.result[i] == 2) {
- this.patientForm.slowPatient = 1;
- }
- if (this.result[i] == 3) {
- this.patientForm.memberPatient = 1;
- }
- }
-
- if (!checkMobile(this.patientForm.phone)) {
- this.$toast("请填写正确的手机号");
- return false;
- }
-
- if (this.patientForm.sex !== "") {
- if (this.patientForm.sex === "男") {
- this.patientForm.sex = 1;
- this.patientForm.avatar =
- "https://images.shengws.com/201809182128111.png";
- }
- if (this.patientForm.sex === "女") {
- this.patientForm.sex = 2;
- this.patientForm.avatar =
- "https://images.shengws.com/201809182128222.png";
- }
- }
- if (this.patientForm.patientsoure === "") {
- this.patientForm.patientsoure = 0;
- }
- if (this.patientForm.patientsoure !== "") {
- if (this.patientForm.patientsoure === "门诊") {
- this.patientForm.patientsoure = 1;
- }
- if (this.patientForm.patientsoure === "住院") {
- this.patientForm.patientsoure = 2;
- }
- }
- if (this.patientForm.lapseto !== "") {
- if (this.patientForm.lapseto === "留治") {
- this.patientForm.lapseto = 1;
- }
- if (this.patientForm.lapseto === "转出") {
- this.patientForm.lapseto = 2;
- }
- }
- for (let i = 0; i < this.illnesslist.length; i++) {
- if (
- this.illnesslist[i].illness_name === this.patientForm.patient_type
- ) {
- this.patientForm.patient_type = this.illnesslist[i].id;
- }
- }
-
- const params = {
- id: this.patientForm.id,
- name: this.patientForm.name,
- sex: this.patientForm.sex,
- idCard: this.patientForm.idCard,
- birthday: this.patientForm.birthday,
- phone: this.patientForm.phone,
- result: this.result,
- dialysis: this.patientForm.dialysis,
- patientsoure: this.patientForm.patientsoure,
- lapseto: this.patientForm.lapseto,
- resultTwo: this.resultTwo,
- admissionNumber: this.patientForm.admissionNumber,
- fistDate: this.patientForm.fistDate,
- diagnose: this.patientForm.diagnose,
- bloodPatient: this.patientForm.bloodPatient,
- slowPatient: this.patientForm.slowPatient,
- memberPatient: this.patientForm.memberPatient,
- avatar: this.patientForm.avatar,
- requipmentId: this.patientForm.requipmentId, // 慢病信息
- resultThree: this.resultThree,
- resultFour: this.resultFour,
- patientType: this.patientForm.patient_type,
- memberFistDate: this.patientForm.memberFistDate,
- treatmentMethod: this.patientForm.treatmentMethod,
- is_infectious: this.patientForm.is_infectious
- };
- updatedPatient(params).then(response => {
- if (response.data.state === 1) {
- var msg = response.data.data.msg;
- console.log("msg", msg);
- if (msg === "身份证号码已存在") {
- this.$toast("身份证号码已存在");
- if (this.patientForm.sex === 1) {
- this.patientForm.sex = "男";
- }
- if (this.patientForm.sex === 2) {
- this.patientForm.sex = "女";
- }
- if (this.patientForm.patientsoure === 1) {
- this.patientForm.patientsoure = "门诊";
- }
- if (this.patientForm.patientsoure === 2) {
- this.patientForm.patientsoure = "住院";
- }
- if (this.patientForm.lapseto === 1) {
- this.patientForm.lapseto = "留治";
- }
- if (this.patientForm.lapseto === 2) {
- this.patientForm.lapseto = "转出";
- }
- return false;
- }
- if (msg == "手机号码已存在") {
- this.$toast("手机号码已存在");
- if (this.patientForm.sex === 1) {
- this.patientForm.sex = "男";
- }
- if (this.patientForm.sex === 2) {
- this.patientForm.sex = "女";
- }
- if (this.patientForm.patientsoure === 1) {
- this.patientForm.patientsoure = "门诊";
- }
- if (this.patientForm.patientsoure === 2) {
- this.patientForm.patientsoure = "住院";
- }
- if (this.patientForm.lapseto === 1) {
- this.patientForm.lapseto = "留治";
- }
- if (this.patientForm.lapseto === 2) {
- this.patientForm.lapseto = "转出";
- }
- return false;
- }
- if (msg === "透析号码已存在") {
- this.$toast("透析号码已存在");
- if (this.patientForm.sex === 1) {
- this.patientForm.sex = "男";
- }
- if (this.patientForm.sex === 2) {
- this.patientForm.sex = "女";
- }
- if (this.patientForm.patientsoure === 1) {
- this.patientForm.patientsoure = "门诊";
- }
- if (this.patientForm.patientsoure === 2) {
- this.patientForm.patientsoure = "住院";
- }
- if (this.patientForm.lapseto === 1) {
- this.patientForm.lapseto = "留治";
- }
- if (this.patientForm.lapseto === 2) {
- this.patientForm.lapseto = "转出";
- }
- return false;
- }
-
- if (msg === undefined) {
- this.$toast("修改成功");
- var patients = response.data.data.patients;
- this.$router.push("/patientdetail?patientid=" + patients.id);
- }
- }
- });
- },
- changRadio() {
- if (this.radio === "1") {
- this.showOne = false;
- }
- if (this.radio === "2") {
- this.showOne = true;
- }
- }
- },
- created() {
- setRem();
- setHeight();
- var patientid = this.$route.query.patientid;
- this.patient_id = patientid;
- this.GetPatientDetail(patientid);
- this.GetIllnessList();
- }
- };
- </script>
-
- <style lang="scss" scoped>
- .page_editPatients {
- overflow-y: auto;
- height: 100%;
- background: #fafafa;
- .addPatientsTitle {
- height: 3.125rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- padding: 0 1.125rem;
- background: #fff;
- span {
- font-size: 1rem;
- }
- }
- .jiantou {
- font-size: 1.5rem;
- font-weight: 600;
- margin-right: 1.25rem;
- }
- .titleName {
- font-size: 1.125rem !important;
- font-weight: 600;
- }
- .basicTitle {
- font-size: 0.75rem;
- color: #989898;
- padding: 0 1rem;
- height: 1.875rem;
- line-height: 1.875rem;
- }
- .basicBox {
- .van-cell__value {
- display: flex;
- }
- .van-field__body {
- width: 100%;
- }
- }
- .custom-title::before {
- position: absolute;
- left: 8px;
- color: #ee0a24;
- font-size: 14px;
- content: "*";
- }
- .van-cell__title {
- display: flex;
- }
- .van-checkbox-group {
- display: flex;
- flex-wrap: wrap;
- }
- .van-checkbox {
- width: 48%;
- margin-bottom: 0.625rem;
- }
- .van-radio-group {
- display: flex;
- flex-wrap: wrap;
- width: 100%;
- }
- .van-radio {
- width: 48%;
- }
- .autoGeneration {
- width: 5rem;
- height: 1.875rem;
- line-height: 1.875rem;
- background: #338afb;
- border-radius: 0.9375rem;
- text-align: center;
- }
- .van-button--info {
- border-radius: 0.9375rem;
- }
- .van-button--small {
- min-width: 3.75rem !important;
- height: 1.875rem;
- padding: 0 0.5rem;
- font-size: 0.75rem !important;
- line-height: 1.75rem;
- }
- .moreInfo {
- text-align: center;
- font-size: 0.75rem;
- color: #338afb;
- margin: 0.625rem 0 4.5rem;
- }
- .van-cell {
- align-items: center;
- }
- .turnOut {
- height: 2.8125rem;
- line-height: 2.8125rem;
- text-align: center;
- background: #fff;
- margin-top: 0.75rem;
- }
- }
- ::-webkit-scrollbar {
- width: 0;
- }
- </style>
-
- <style lang="scss">
- .page_editPatients {
- .changeColor {
- .van-field__control {
- color: #9b9b9b !important;
- }
- }
- .basicBox {
- .van-cell__value {
- font-size: 1rem;
- }
- .van-cell__title {
- font-size: 1rem;
- }
- }
- .xtBox {
- .van-cell__value {
- font-size: 1rem;
- }
- .van-cell__title {
- font-size: 1rem;
- }
- }
- }
- </style>
|