Browse Source

register

master
pengjun 2 years ago
parent
commit
f87963e8a6
  1. 9
      src/assets/css/global_input.css
  2. 10
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  3. 64
      src/components/patientRegister/PatientRegisterEdit.vue
  4. 44
      src/components/patientRegister/PatientRegisterList.vue
  5. 41
      src/utlis/proFunc.js

9
src/assets/css/global_input.css

@ -48,3 +48,12 @@ input[type="number"]::-webkit-outer-spin-button {
.el-select-dropdown__item.hover, .el-select-dropdown__item:hover {
background-color: #CCF9CB; /* 原始 默认 #F5F7FA */
}
/* cascader 节点样式 */
.el-cascader-node {
padding: 0 20px 0 10px; /* 原始 默认 0 30px 0 20px; */
height: 28px; /* 原始 默认 34px */
line-height: 28px; /* 原始 默认 34px */
}

10
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -53,7 +53,7 @@
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small"
filterable default-first-option :filter-method="filterMethod"
clearable @clear="quickAsb = deepCopy(dict.asbItemQuick)"
@change="quickChoosedAsb" ref="asbItemId"
@change="quickChoosedAsb" ref="quickAsbOCX"
style="margin-left: 3px;width:160px;">
<el-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" />
</el-select>
@ -350,6 +350,7 @@ export default {
})
this.dict.asbItem = deepCopy(this.dict.asbItemAll);
this.dict.asbItemQuick = deepCopy(res.data.items);
this.quickAsb = deepCopy(res.data.items);
}
});
@ -530,6 +531,13 @@ export default {
}
}
this.$nextTick(() => {
this.$refs['quickAsbOCX'].blur(); //total asbItemId
this.asbItemId = ''
this.quickAsb = deepCopy(this.dict.asbItemQuick)
this.$refs['quickAsbOCX'].focus(); //total asbItemId
});
},
//

64
src/components/patientRegister/PatientRegisterEdit.vue

@ -44,12 +44,12 @@
<el-row>
<el-col :span="5">
<el-form-item label="姓名" prop="patientName">
<el-input v-model="form.patientName" @blur="Query(form.patientName)" size="small"></el-input>
<el-input v-model="form.patientName" @change="Query(form.patientName)" size="small" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="身份证号" prop="idNo">
<el-input v-model="form.idNo" @change="changeIdNo" @blur="Query(form.idNo)" size="small"></el-input>
<el-input v-model="form.idNo" @change="changeIdNo" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
@ -61,7 +61,7 @@
</el-col>
<el-col :span="3">
<el-form-item label="年龄" prop="age">
<el-input v-model="form.age" size="small"></el-input>
<el-input v-model="form.age" size="small" @change="changeAge"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
@ -397,7 +397,7 @@
</div>
<!-- 人员档案列表 -->
<el-dialog title="人员档案列表" :visible.sync="dialogVisible" width="800" :show-close="false" :close-on-click-modal="false"
<el-dialog title="人员档案列表" :visible.sync="dialogVisible" width="800px" :show-close="false" :close-on-click-modal="false"
:append-to-body="true">
<el-table :data="patientList" border width="800" height="480" row-key="id" size="small"
class="el-table__body-wrapper tbody" highlight-current-row @row-click="rowick" ref="patientList">
@ -451,7 +451,7 @@
</el-dialog>
<!-- 体检人员记录列表 -->
<el-dialog title="体检人员列表" :visible.sync="registerVisible" width="800" :show-close="false" :close-on-click-modal="false"
<el-dialog title="体检人员列表" :visible.sync="registerVisible" width="800px" :show-close="false" :close-on-click-modal="false"
:append-to-body="true">
<el-table :data="patientRegisters" border width="800" height="480" highlight-current-row
@row-click="registerRowClick" size="small">
@ -623,7 +623,7 @@ import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import mm from "../../utlis/mm";
import { objCopy, setNull, dddw, parseID, birthdayToAge, deepCopy, arrayFilter, parsIcCardtoLocal, photoParse, savePeoplePhoto, arrayExistObj } from "../../utlis/proFunc";
import { objCopy, setNull, dddw,checkIDCode, parseID, birthdayToAge,ageToBirthday, deepCopy, arrayFilter, parsIcCardtoLocal, photoParse, savePeoplePhoto, arrayExistObj } from "../../utlis/proFunc";
import Camera from "./Camera.vue";
import PatientRegisterItem from "./PatientRegisterItem.vue";
import LisRequest from "./LisRequest.vue";
@ -704,6 +704,7 @@ export default {
"customerOrgId",
"customerOrgGroupId",
"medicalPackageId",
"birthDate",
"age",
"medicalTypeId",
"personnelTypeId",
@ -913,8 +914,14 @@ export default {
this.form.age = birthdayToAge(this.form.birthDate)
},
//
changeAge() {
this.form.birthDate = ageToBirthday(this.form.age)
},
//
changeIdNo() {
this.Query(this.form.idNo)
let ret = parseID(this.form.idNo)
if (ret.age != -1) {
this.form.birthDate = new Date(ret.birthday)
@ -940,9 +947,14 @@ export default {
//
if (this.form.id || !param) return;
//console.log(param)
getapi(`/api/app/patient/in-filter?Filter=${param}`).then((res) => {
if (res.code == 1) {
//console.log(`/api/app/patient/in-filter?Filter=${param}`)
let body = {
filter:param,
maxResultCount:500
}
postapi('/api/app/patient/getlistinfilter',body).then((res) => {
if (res.code != -1) {
console.log("查重 ", res); //
if (res.data.items && res.data.items.length > 0) {
this.patientList = res.data.items;
@ -950,6 +962,7 @@ export default {
}
}
});
},
//
@ -1066,18 +1079,26 @@ export default {
this.$message.warning(fields[Object.keys(fields)[0]][0].message);
return false
}
if(this.form.customerOrgId != this.dict.personOrgId){
if(!this.form.customerOrgRegisterId){
this.$message.warning("请填写单位体检次数!");
return false
}
}
if(this.form.idNo && checkIDCode(this.form.idNo) == false){
this.$message.warning("身份证号填写不合法!");
return false
}
//
let body = deepCopy(this.form);
if (this.form.birthDate) {
if (this.form.birthDate && this.form.birthDate != "Invalid date") {
body.birthDate = moment(this.form.birthDate).format("yyyy-MM-DD")
}else{
body.birthDate = null
}
@ -1096,9 +1117,9 @@ export default {
delete body.isPhoneFollowBox;
delete body.isLockBox;
delete body.photo;
setNull(body, this.defaultNull);
//
// console.log("body.birthDate", body.birthDate);
// if (body.birthDate) {
@ -1119,12 +1140,15 @@ export default {
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
objCopy(res.data, this.form);
// this.patientRegister.prList.push(res.data); //
this.patientRegister.patientRegisterId = res.data.id;
this.patientRegister.patientRegisterRd = res.data;
this.patientRegister.patientRegisterId = res.data.id;
objCopy(this.form, this.patientRegister.patientRegisterRd);
//this.patientRegister.query.times++;
this.patientRegister.prList.push(res.data)
//this.patientRegister.query.times++;
let curRow = deepCopy(this.patientRegister.patientRegisterRd)
curRow.index = this.patientRegister.prList.length
this.patientRegister.prList.push(curRow)
//
this.patientRegister.patientRegisterAbs.forEach(e => {
@ -1143,10 +1167,10 @@ export default {
if (msgTip) this.$message.success("更新 操作成功");
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
//this.patientRegister.query.times++;
let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id)
if(lfind > - 1) objCopy(this.form,this.patientRegister.prList[lfind])
objCopy(this.form, this.patientRegister.patientRegisterRd);
// this.patientRegister.query.times++;
// let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id)
// if(lfind > - 1) objCopy(this.form,this.patientRegister.prList[lfind])
//this.patientRegister.saveTimes++; //
}

44
src/components/patientRegister/PatientRegisterList.vue

@ -186,12 +186,10 @@
<!-- 体检人员登记 -->
<el-dialog
:title="
patientRegister.patientRegisterRd.id ? '体检人员--编辑' : '体检人员--新增'
"
:title="patientRegister.patientRegisterRd.id ? '体检人员--编辑' : '体检人员--新增'"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
fullscreen
fullscreen @close="closeDialogPR"
>
<PatientRegisterEdit
:formInitData="patientRegister.patientRegisterRd"
@ -728,9 +726,9 @@ export default {
// shift
if (this.window.shift) {
//
this.patientRegister.prList.forEach((e) => {
this.patientRegister.prList.forEach((e,index) => {
e.choosed = false;
return e;
e.index = index;
});
if (this.startPoint == -1) {
@ -756,10 +754,13 @@ export default {
// ctrl shift
//
console.log("清除所有选择");
this.patientRegister.prList.forEach((e) => {
this.patientRegister.prList.forEach((e,index) => {
e.choosed = false;
return e;
e.index = index;
});
console.log(this.patientRegister.prList,row.index);
console.log(this.patientRegister.prList[row.index].choosed);
this.patientRegister.prList[row.index].choosed = true;
this.startPoint = row.index;
}
@ -811,10 +812,37 @@ export default {
this.$message.warning("请选择要操作的记录");
return;
}
//console.log(this.patientRegister.patientRegisterRd,this.patientRegister.prList)
this.dialogVisible = true;
this.editTimes++; //
},
//
closeDialogPR(){
this.patientRegister.prList.forEach(e =>{
e.choosed = false
})
let currentRow = {}
let lfind = arrayExistObj(this.patientRegister.prList,'id',this.patientRegister.patientRegisterRd.id)
if(lfind > -1){
this.patientRegister.prList[lfind].choosed = true
currentRow = this.patientRegister.prList[lfind]
}else if(this.patientRegister.patientRegisterRd.id){
currentRow = deepCopy(this.patientRegister.patientRegisterRd)
lfind = this.patientRegister.prList.length
currentRow.choosed = true
currentRow.index = lfind
this.patientRegister.prList.push(currentRow)
}
if(lfind > -1){
setTimeout(() => {
this.$refs['info'].setCurrentRow(currentRow)
}, 100)
}
},
//
openCamera() {
if (!this.patientRegister.patientRegisterId) {

41
src/utlis/proFunc.js

@ -156,18 +156,36 @@ function arrayExistObj(arr, key, value) {
};
exports.arrayExistObj = arrayExistObj;
//判断身份证是否合法
function checkIDCode(IDCode) {
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
let ret = false;
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(IDCode)) {
ret = true;
}
if(!ret) return ret
if(IDCode.length == 15){
if (IDCode.substring(8, 10).parseInt > 12 || IDCode.substring(8, 10).parseInt == 0) return false
if (IDCode.substring(10, 12).parseInt > 31 || IDCode.substring(10, 12).parseInt == 0) return false
}else{
if (IDCode.substring(10, 12).parseInt > 12 || IDCode.substring(10, 12).parseInt == 0) return false
if (IDCode.substring(12, 14).parseInt > 31 || IDCode.substring(12, 14).parseInt == 0) return false
}
return ret
};
exports.checkIDCode = checkIDCode;
//根据身份证号判断出生日期(yyyy-MM-DD),当前年龄与性别 粗犷式,不精确判断闰年平年
function parseID(id) {
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425;
function parseID(id) {
let ret = {
birthday: '',
age: -1,
birthday: null,
age: null,
sex: 'U',
}
if (!id || id.length != 18) return ret
if (id.substring(10, 12).parseInt > 12 || id.substring(10, 12).parseInt == 0) return ret
if (id.substring(12, 14).parseInt > 31 || id.substring(12, 14).parseInt == 0) return ret
if(!checkIDCode(id)) return ret
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425;
//出生日期
ret.birthday = id.substring(6, 10) + '-' + id.substring(10, 12) + '-' + id.substring(12, 14)
@ -193,6 +211,13 @@ function birthdayToAge(birthday) {
};
exports.birthdayToAge = birthdayToAge;
function ageToBirthday(age) {
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425 * Number(age);
//年龄
return new Date(new Date().getTime() - yearInMs)
};
exports.ageToBirthday = ageToBirthday;
//分析身份证数据
function parsIcCardtoLocal(idNos, dictSex, dictNation) {
let local = deepCopy(idNos);

Loading…
Cancel
Save