pengjun 2 years ago
parent
commit
56d8d3061f
  1. 49
      src/components/patientRegister/PatientRegisterEdit.vue

49
src/components/patientRegister/PatientRegisterEdit.vue

@ -81,9 +81,10 @@
<el-form-item label="出生日期" prop="birthDate">
<el-date-picker
v-model="form.birthDate"
type="date"
type="date" value-format="yyyy-MM-dd"
placeholder="出生日期"
style="width: 135px"
style="width: 135px"
@change="changeBirthDate"
/>
</el-form-item>
</el-col>
@ -167,6 +168,7 @@
<el-form-item label="身份证号" prop="idNo">
<el-input
v-model="form.idNo"
@change="changeIdNo"
@blur="query(form.idNo)"
></el-input>
</el-form-item>
@ -412,8 +414,7 @@
</div>
<div class="btn">
<el-button type="primary" @click="openCamera" icon="el-icon-camera"
>拍照</el-button
>
>拍照</el-button>
</div>
<div class="btn">
<el-button type="primary">申请单</el-button>
@ -473,14 +474,7 @@
<el-table-column prop="maritalStatusId" label="婚姻">
<template slot-scope="scope">
<div>
{{
ldddw(
dict.maritalStatus,
"id",
scope.row.maritalStatusId,
"displayName"
)
}}
{{ ldddw(dict.maritalStatus,"id",scope.row.maritalStatusId,"displayName") }}
</div>
</template>
</el-table-column>
@ -526,7 +520,7 @@ import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import mm from "../../utlis/mm";
import { objCopy, setNull, dddw } from "../../utlis/proFunc";
import { objCopy, setNull, dddw,parseID,birthdayToAge } from "../../utlis/proFunc";
import Camera from "./Camera.vue";
import PatientRegisterItem from "./PatientRegisterItem.vue";
export default {
@ -629,6 +623,21 @@ export default {
console.log("this.form1", this.form);
},
//
changeBirthDate(){
this.form.age = birthdayToAge(this.form.birthDate)
},
//
changeIdNo(){
let ret = parseID(this.form.idNo)
if(ret.age != -1){
this.form.birthDate = ret.birthday
this.form.age = ret.age
this.form.sexId = ret.sex
}
},
//
changeCustomerOrgGroupId() {
this.patientRegister.customerOrgGroupChange++;
@ -711,13 +720,13 @@ export default {
setNull(body, this.defaultNull);
//
console.log("body.birthDate", body.birthDate);
if (body.birthDate) {
body.birthDate = moment(new Date(body.birthDate)).format(
"yyyy-MM-DD"
);
}
//
// console.log("body.birthDate", body.birthDate);
// if (body.birthDate) {
// body.birthDate = moment(new Date(body.birthDate)).format(
// "yyyy-MM-DD"
// );
// }
if (this.form.id.length < 1) {
//id

Loading…
Cancel
Save