From 020f0b9483b8732961e497ddeaec1a8e6d8e6fbd Mon Sep 17 00:00:00 2001
From: pengjun <158915633@qq.com>
Date: Tue, 6 Feb 2024 11:40:38 +0800
Subject: [PATCH] seo
---
src/components/doctorCheck/CheckItemList.vue | 4 +-
src/components/doctorCheck/CheckSumSug.vue | 2 +-
.../doctorCheck/PatientRegisterBase.vue | 4 +-
.../doctorCheck/RegisterCheckEdit.vue | 2 +-
.../doctorCheck/RegisterCheckList.vue | 10 +-
.../patientRegister/PatientRegisterEdit.vue | 93 ++++++++-----------
.../patientRegister/PatientRegisterList.vue | 61 ++++++++----
src/store/index.js | 21 +++--
src/views/doctorCheck/doctorCheck.vue | 6 +-
9 files changed, 108 insertions(+), 95 deletions(-)
diff --git a/src/components/doctorCheck/CheckItemList.vue b/src/components/doctorCheck/CheckItemList.vue
index abaccfa..e30a8be 100644
--- a/src/components/doctorCheck/CheckItemList.vue
+++ b/src/components/doctorCheck/CheckItemList.vue
@@ -334,10 +334,10 @@ export default {
// },
//检查项目未切换换时 也可以强制刷新数据
- "dataTransOpts.refresh.register_check_item":{
+ "dataTransOpts.refresh.register_check_item.S":{
immediate:true,
handler(newVal, oldVal) {
- console.log(`watch dataTransOpts.refresh.register_check_item newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`);
+ console.log(`watch dataTransOpts.refresh.register_check_item.S newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`);
this.checkItemList(this.registerCheckId);
}
},
diff --git a/src/components/doctorCheck/CheckSumSug.vue b/src/components/doctorCheck/CheckSumSug.vue
index 0da2744..23f7a81 100644
--- a/src/components/doctorCheck/CheckSumSug.vue
+++ b/src/components/doctorCheck/CheckSumSug.vue
@@ -221,7 +221,7 @@ export default {
// this.checkSuggestionList(newVal)
// },
//检查项目未切换换时 也可以强制刷新数据
- "dataTransOpts.refresh.register_check_item":{
+ "dataTransOpts.refresh.register_check_item.S":{
immediate:true,
handler(newVal, oldVal) {
console.log(`watch 小结 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`);
diff --git a/src/components/doctorCheck/PatientRegisterBase.vue b/src/components/doctorCheck/PatientRegisterBase.vue
index b0c3802..94bf03c 100644
--- a/src/components/doctorCheck/PatientRegisterBase.vue
+++ b/src/components/doctorCheck/PatientRegisterBase.vue
@@ -269,7 +269,7 @@ export default {
objCopy(rd,this.prBase)
this.doctorCheck.prBase = Object.assign({},this.doctorCheck.prBase,rd)
- this.dataTransOpts.refresh.register_check++
+ this.dataTransOpts.refresh.register_check.S++
// objCopy(rd,this.doctorCheck.prBase)
// this.sumPREditInit()
@@ -286,7 +286,7 @@ export default {
let val = this.prBase[queryType]
this.doctorCheckPrBaseInit()
- this.dataTransOpts.refresh.register_check++
+ this.dataTransOpts.refresh.register_check.S++
this.sumPREditInit()
diff --git a/src/components/doctorCheck/RegisterCheckEdit.vue b/src/components/doctorCheck/RegisterCheckEdit.vue
index 0f941d4..afbd21b 100644
--- a/src/components/doctorCheck/RegisterCheckEdit.vue
+++ b/src/components/doctorCheck/RegisterCheckEdit.vue
@@ -82,7 +82,7 @@ export default {
// },
//检查项目未切换换时 也可以强制刷新数据
- "dataTransOpts.refresh.register_check_item":{
+ "dataTransOpts.refresh.register_check_item.S":{
immediate:true,
handler(newVal, oldVal) {
console.log(`watch dataTransOpts.refresh.register_check_item newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`);
diff --git a/src/components/doctorCheck/RegisterCheckList.vue b/src/components/doctorCheck/RegisterCheckList.vue
index b8d2530..6198d21 100644
--- a/src/components/doctorCheck/RegisterCheckList.vue
+++ b/src/components/doctorCheck/RegisterCheckList.vue
@@ -61,9 +61,9 @@ export default {
rowClick(row){
console.log('rowClick')
this.doctorCheck.RegisterCheckId = row.id
- this.dataTransOpts.table.register_check.id = row.id
+ this.dataTransOpts.tableS.register_check.id = row.id
setTimeout(() => { // 不管值是否改变,点击就强制刷新
- this.dataTransOpts.refresh.register_check_item++
+ this.dataTransOpts.refresh.register_check_item.S++
}, 100);
// this.doctorCheck.RegisterCheckEdit = row
},
@@ -85,9 +85,9 @@ export default {
//查询出来 默认显示第1条记录明细、小结等
if(res.data.length > 0) {
this.doctorCheck.RegisterCheckId = res.data[0].id
- this.dataTransOpts.table.register_check.id = res.data[0].id
+ this.dataTransOpts.tableS.register_check.id = res.data[0].id
setTimeout(() => { // 不管值是否改变,点击就强制刷新
- this.dataTransOpts.refresh.register_check_item++
+ this.dataTransOpts.refresh.register_check_item.S++
}, 100);
// this.doctorCheck.RegisterCheckEdit = res.data[0]
@@ -109,7 +109,7 @@ export default {
//监听事件
watch: {
//体检人员未切换时 也可以强制刷新数据
- "dataTransOpts.refresh.register_check":{
+ "dataTransOpts.refresh.register_check.S":{
immediate:true,
handler(newVal, oldVal) {
console.log("watch doctorCheck.prBase.id newVal:", newVal, " oldVal:", oldVal);
diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue
index 590ed76..c2626d8 100644
--- a/src/components/patientRegister/PatientRegisterEdit.vue
+++ b/src/components/patientRegister/PatientRegisterEdit.vue
@@ -355,7 +355,7 @@
-
+
@@ -788,7 +788,7 @@ export default {
},
computed: {
- ...mapState(["window", "dict", "patientRegister", "customerOrg", "projPriv"]),
+ ...mapState(["window","dataTransOpts","dict", "patientRegister", "customerOrg", "projPriv"]),
displayPackage(){
@@ -828,7 +828,7 @@ export default {
}
});
- //性别(查询)
+ //适用性别
getapi("/api/app/for-sex").then((res) => {
if (res.code == 1) {
this.dict.forSex = res.data;
@@ -921,30 +921,27 @@ export default {
// }
// });
- console.log("dict", this.dict);
+ // console.log("dict", this.dict);
},
- //初始form表单数据
- async initFormData(){
+
+ // 获取登记信息 初始form表单数据
+ async initFormData(patientRegisterId){
- try {
- // objCopy(this.formInitData, this.form);
- this.peisid = window.sessionStorage.getItem('peisid');
- if (!this.form.id) {
- objCopy(this.formInit, this.form);
- this.form.organizationUnitId = this.peisid;
- }else{
- let res = await getapi(`/api/app/patient-register/${this.form.id}`)
- this.form = res.data
- }
- this.initBox();
- this.getPeoplePhoto(this.form.photo)
-
- // 单位/个人 的分组与套餐处理
- await this.changeCustomerOrgId(this.form.customerOrgId)
- } catch (error) {
- console.log(`initFormData ${error}`)
+ this.peisid = window.sessionStorage.getItem('peisid');
+ if (!patientRegisterId) {
+ objCopy(this.formInit, this.form);
+ this.form.organizationUnitId = this.peisid;
+ }else{
+ let res = await getapi(`/api/app/patient-register/${patientRegisterId}`)
+ this.form = res.data
}
+ this.initBox();
+ this.getPeoplePhoto(this.form.photo)
+
+ // 单位/个人 的分组与套餐处理
+ await this.changeCustomerOrgId(this.form.customerOrgId)
+
},
//选择单位
@@ -1384,12 +1381,22 @@ export default {
madePrBody(){
//赋值
let body = deepCopy(this.form);
-
- if (this.form.birthDate && this.form.birthDate != "Invalid date") {
- body.birthDate = moment(this.form.birthDate).format("yyyy-MM-DD")
+ // console.log('this.form',this.form)
+ // console.log('body',body)
+ if (this.form.birthDate) {
+ try {
+ body.birthDate = moment(body.birthDate).format("yyyy-MM-DD")
+ } catch (error) {
+ // this.form.birthDate != "Invalid date"
+ body.birthDate = null
+ }
}else{
body.birthDate = null
}
+ if(body.birthDate == "Invalid date") body.birthDate = null
+ if(isNaN(body.age)) body.age = null
+ // console.log('body',body)
+ // Invalid date
delete body.registerManType;
delete body.id;
@@ -1465,6 +1472,7 @@ export default {
//触发已选组合项目保存
this.prAsbOpraOpts.formId = res.data.id
+ this.dataTransOpts.tableS.patient_register.id = res.data.id
let temp = Object.assign({},res.data,{id:''})
objCopy(temp,this.form)
@@ -1473,6 +1481,7 @@ export default {
this.prAsbOpraOpts.prAsbSave++
},100)
+ // 用于刷新登记的列表
this.refreshRegister(Object.assign({},res.data))
//一般读身份证照片时,会出现这种情况
@@ -1882,35 +1891,13 @@ export default {
},
//监听事件
- watch: {
- // 外部传入参数(登记表id)
- "patientRegisterId":{
- immediate:true,
- // deep:true,
- handler(newVal, oldVal) {
- console.log('watch:patientRegisterId:',newVal,' oldVal:',oldVal)
- if (newVal != oldVal) {
- this.form.id = newVal
- }
- }
- },
-
- "form.id":{
+ watch: {
+ //人员ID未切换换时 也可以强制刷新数据
+ "dataTransOpts.refresh.patient_register.S":{
immediate:true,
- // deep:true,
handler(newVal, oldVal) {
- console.log('watch:form.id:',newVal,' oldVal:',oldVal)
- if (newVal != oldVal) {
- this.initFormData()
- }
- }
- },
-
- //新增或编辑
- "editTimes"(newVal, oldVal) {
- console.log('editTimes newVal:',newVal,' oldVal:',oldVal)
- if (newVal != oldVal) {
- this.initFormData()
+ console.log(`watch 人员登记 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.patient_register.id}`);
+ this.initFormData(this.dataTransOpts.tableS.patient_register.id)
}
},
diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue
index 3539ba4..ef19034 100644
--- a/src/components/patientRegister/PatientRegisterList.vue
+++ b/src/components/patientRegister/PatientRegisterList.vue
@@ -202,9 +202,9 @@
-->
-
+
-1 && this.patientRegister.patientRegisterRd.id != this.patientRegister.prList[lfind].id){
- this.setForm(this.patientRegister.prList[lfind])
- // this.patientRegister.query.customerOrgParentId = this.patientRegister.prList[lfind].customerOrgParentId;
- this.patientRegister.customerOrgGroupChange = 0; //控制体检列表记录切换时,0 无需触发更换分组操作
- this.patientRegister.medicalPackageChange = 0; //控制体检列表记录切换时,0 无需触发更换套餐操作
- // this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId);
- this.dict.asbItem = [...this.dict.asbItemAll];
- this.getPatientRegisterAbs(this.patientRegister.prList[lfind].id);
+ if(lfind > -1){
+ // 弹出编辑框,只有在编辑框显示时,才去触发获取数据
+ this.dataTransOpts.tableS.patient_register.id = this.patientRegister.prList[lfind].id
+
+ // 旧的方式
+ if(this.patientRegister.patientRegisterRd.id != this.patientRegister.prList[lfind].id){
+ this.setForm(this.patientRegister.prList[lfind])
+ // this.patientRegister.query.customerOrgParentId = this.patientRegister.prList[lfind].customerOrgParentId;
+ this.patientRegister.customerOrgGroupChange = 0; //控制体检列表记录切换时,0 无需触发更换分组操作
+ this.patientRegister.medicalPackageChange = 0; //控制体检列表记录切换时,0 无需触发更换套餐操作
+ // this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId);
+ this.dict.asbItem = [...this.dict.asbItemAll];
+ this.getPatientRegisterAbs(this.patientRegister.prList[lfind].id);
+ }
}
},
@@ -838,15 +845,27 @@ export default {
this.$message.warning("请选择单位或个人");
return;
}
- this.patientRegister.patientRegisterRdInit.customerOrgId = customerOrgId
- this.setForm(this.patientRegister.patientRegisterRdInit)
- this.patientRegister.patientRegisterAbs = [];
- this.patientRegister.patientRegisterRd.id = ''
+
+ // this.patientRegister.patientRegisterRdInit.customerOrgId = customerOrgId
+ // this.setForm(this.patientRegister.patientRegisterRdInit)
+ // this.patientRegister.patientRegisterAbs = [];
+ // this.patientRegister.patientRegisterRd.id = ''
+ // this.dialogVisible = true;
+ // this.editTimes++; //触发表单窗口,数据更新
+ // this.getPatientRegisterAbs();
+
+ this.dataTransOpts.tableS.patient_register.id = ''
this.dialogVisible = true;
- this.editTimes++; //触发表单窗口,数据更新
- this.getPatientRegisterAbs();
+ setTimeout(() => {
+ // 触发数据刷新
+ this.dataTransOpts.refresh.patient_register.S++ //人员信息
+ this.dataTransOpts.refresh.register_asbitem.M++ //人员登记组合项目
+ }, 10);
+
},
+
+
//刷新或添加列表数据
refreshRegister(patientRegister){
console.log('编辑/新增的 form :',patientRegister)
@@ -889,13 +908,17 @@ export default {
// 单个编辑
btnEdit() {
- if (!this.patientRegister.patientRegisterRd.id) {
+ // if (!this.patientRegister.patientRegisterRd.id) {
+ if (!this.dataTransOpts.tableS.patient_register.id ) {
this.$message.warning("请选择要操作的记录");
return;
}
//console.log(this.patientRegister.patientRegisterRd,this.patientRegister.prList)
this.dialogVisible = true;
- this.editTimes++; //触发表单窗口,数据更新
+ // 触发数据刷新
+ this.dataTransOpts.refresh.patient_register.S++ //人员信息
+ this.dataTransOpts.refresh.register_asbitem.M++ //人员登记组合项目
+
},
//新增或编辑后选中记录
diff --git a/src/store/index.js b/src/store/index.js
index 7e37856..7964d14 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -262,23 +262,26 @@ export default new Vuex.Store({
}, //读取身份证信息
},
- //多层数据传递时使用
+ //多层数据传递时使用(统一归结在此,便于管理)
dataTransOpts: {
- //强制刷新(ID值没有变化,但也想强制刷新数据)
+ //强制刷新(如触发数据刷新的ID值没有变化时,但也想强制刷新数据: S--single 单记录刷新,M--more 多记录刷新)
refresh: {
- patient_register: 0,
- register_check: 0,
- register_check_item: 0,
+ patient_register: { S: 0, M: 0 },
+ register_asbitem: { S: 0, M: 0 },
+ register_check: { S: 0, M: 0 },
+ register_check_item: { S: 0, M: 0 },
},
- //表当前数据(单条记录)
- table: {
+ //表当前数据(单条记录 S--single)
+ tableS: {
patient_register: { id: '' },
+ register_asbitem: { id: '' },
register_check: { id: '' },
register_check_item: { id: '' }
},
- //表当前数据(多条记录)
- tableList: {
+ //表当前数据(多条记录 M--more)
+ tableM: {
patient_register: [],
+ register_asbitem: [],
register_check: [],
register_check_item: []
}
diff --git a/src/views/doctorCheck/doctorCheck.vue b/src/views/doctorCheck/doctorCheck.vue
index 42700f0..822c659 100644
--- a/src/views/doctorCheck/doctorCheck.vue
+++ b/src/views/doctorCheck/doctorCheck.vue
@@ -46,16 +46,16 @@