From bbce8395ab1f42374656012592be856535a8276b Mon Sep 17 00:00:00 2001
From: pengjun <158915633@qq.com>
Date: Tue, 20 Feb 2024 15:56:56 +0800
Subject: [PATCH] dj seo
---
 .../patientRegister/PatientRegisterEdit.vue   | 63 +++++++++++++------
 .../patientRegister/PatientRegisterItem.vue   | 54 +++++++++-------
 .../patientRegister/PatientRegisterList.vue   | 10 ++-
 3 files changed, 82 insertions(+), 45 deletions(-)
diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue
index be7b042..63a5329 100644
--- a/src/components/patientRegister/PatientRegisterEdit.vue
+++ b/src/components/patientRegister/PatientRegisterEdit.vue
@@ -3,7 +3,7 @@
     
       
         
-        
+        
           
             查找:  条码号
             
        
+        @row-click="registerRowClick" @row-dblclick="registerRowDblclick" size="small"> 
         
           
             {{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}
@@ -927,8 +927,14 @@ export default {
     
     // 获取登记信息 初始form表单数据
     async initFormData(patientRegisterId){      
-      
+      // 清空查询条件
+      this.query.patientRegisterNo = ''
+      this.query.patientNo = ''
+      this.query.patientName = ''
+      this.query.tel = ''
+
       this.peisid = window.sessionStorage.getItem('peisid');
+
       if (!patientRegisterId) {
         objCopy(this.formInit, this.form);
         this.form.organizationUnitId = this.peisid;
@@ -1047,9 +1053,13 @@ export default {
           console.log('getpatientregisterorpatient', res)
           if (res.code == 1) {            
             objCopy(res.data, this.form)
-            this.patientRegister.patientRegisterId = res.data.id
-            this.patientRegister.photo = res.data.photo
-            this.getPatientRegisterAbs(res.data.id)
+            this.dataTransOpts.tableS.patient_register.id = res.data.id
+            setTimeout(() => {
+              this.dataTransOpts.refresh.register_asbitem.M++
+            }, 20);
+            // this.patientRegister.patientRegisterId = res.data.id
+            // this.patientRegister.photo = res.data.photo
+            // this.getPatientRegisterAbs(res.data.id)
           }else if(res.code == 0){
             this.$message.info("未找到相关信息")            
           } 
@@ -1058,6 +1068,7 @@ export default {
 
     //按手机号或姓名查找客户信息
     getlistinfilter(url,body){
+      // url = '/api/app/patientregister/getlistinfilter'
       postapi(url, body)
         .then((res) => {
           if (res.code != -1) {
@@ -1065,10 +1076,14 @@ export default {
               this.$message.info("未找到相关信息")
             }else if(res.data.items.length == 1){
               objCopy(res.data.items[0], this.form)
-              objCopy(res.data.items[0], this.patientRegister.patientRegisterRd)              
-              this.patientRegister.patientRegisterId = res.data.items[0].id
-              this.patientRegister.photo = res.data.items[0].photo
-              this.getPatientRegisterAbs(res.data.items[0].id)
+              this.dataTransOpts.tableS.patient_register.id = res.data.items[0].id
+              setTimeout(() => {
+                this.dataTransOpts.refresh.register_asbitem.M++
+              }, 20);
+              // objCopy(res.data.items[0], this.patientRegister.patientRegisterRd)              
+              // this.patientRegister.patientRegisterId = res.data.items[0].id
+              // this.patientRegister.photo = res.data.items[0].photo
+              // this.getPatientRegisterAbs(res.data.items[0].id)
             }else{
               //显示列表,供选择
               this.patientRegisters = res.data.items
@@ -1330,18 +1345,28 @@ export default {
     registerRowClick(row){
       this.registerChoosed = row;
     },
+    registerRowDblclick(row){
+      this.registerChoosed = row;
+      this.chooseRegister()
+    },
 
     chooseRegister(){
       if (!this.registerChoosed) {
-        alert("请选中人员档案信息");
+        alert("请选中人员登记信息");
         return;
       }
        
       objCopy(this.registerChoosed, this.form)
-      this.patientRegister.patientRegisterId = this.registerChoosed.id
-      this.patientRegister.photo = this.registerChoosed.photo
+      // this.patientRegister.patientRegisterId = this.registerChoosed.id
+      // this.patientRegister.photo = this.registerChoosed.photo
+      // this.getPatientRegisterAbs(this.registerChoosed.id)
+      this.dataTransOpts.tableS.patient_register.id = this.registerChoosed.id
+      setTimeout(() => {
+        this.dataTransOpts.refresh.register_asbitem.M++
+      }, 20);
+
       this.registerVisible = false
-      this.getPatientRegisterAbs(this.registerChoosed.id)
+      
     },
   
     changeBox(type) {
@@ -1485,7 +1510,7 @@ export default {
                 // 稍作延时,否则 this.prAsbOpraOpts.formId 尚未更新
                 setTimeout(() =>{
                   this.prAsbOpraOpts.prAsbSave++
-                },100)
+                },20)
 
                 // 用于刷新登记的列表
                 this.refreshRegister(Object.assign({},res.data))
@@ -1527,7 +1552,7 @@ export default {
       // 触发明细项目复制
       setTimeout(() => {
         this.prAsbOpraOpts.copyNew++
-      }, 100);
+      }, 20);
 
       // console.log('this.patientRegister.patientRegisterAbs',this.patientRegister.patientRegisterAbs)
       this.$message.info("操作成功,请记得点保存");
@@ -1824,9 +1849,9 @@ export default {
     },
 
     //关闭收费窗口时,刷新收费状态信息
-    closeDialogCharge(){
-      // this.getPatientRegisterAbs(this.form.id)
-      this.prAsbOpraOpts.prAsbQuery++
+    closeDialogCharge(){      
+      // this.prAsbOpraOpts.prAsbQuery++
+      this.dataTransOpts.refresh.register_asbitem.M++
     },
 
     //触发人员信息保存(更新)
diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue
index 90ff49c..66eae0e 100644
--- a/src/components/patientRegister/PatientRegisterItem.vue
+++ b/src/components/patientRegister/PatientRegisterItem.vue
@@ -199,7 +199,7 @@ export default {
     };
   },
   computed: {
-    ...mapState(["window", "dict", "customerOrg", "patientRegister", "personnelUnit"]),
+    ...mapState(["window", "dataTransOpts", "dict", "customerOrg", "patientRegister", "personnelUnit"]),
   },
 
   created(){
@@ -1040,31 +1040,39 @@ export default {
   },
 
   //监听事件
-  watch: {
-
-    //配合复制新增使用 查询人员下的组合项目
-    "prForm.id":{
+  watch: {    
+    // //配合复制新增使用 查询人员下的组合项目
+    // "prForm.id":{
+    //   immediate: true, // 立即执行
+    //   // deep: true, // 深度监听复杂类型内变化
+    //   handler(newVal,oldVal){
+    //     console.log('人员登记 组合项目明细,人员id:',newVal,oldVal)
+    //     this.oldFormId = oldVal   
+    //     this.getPrAsb(newVal)
+    //     // if(newVal != oldVal){
+    //     //   this.getPrAsb(newVal)
+    //     // }     
+    //   }
+    // },
+
+    // //人员 id 未变的情况下,亦可触发刷新组合项目
+    // "prAsbOpraOpts.prAsbQuery":{
+    //   // immediate: true, // 立即执行
+    //   // deep: true, // 深度监听复杂类型内变化
+    //   handler(newVal,oldVal){        
+    //     console.log('watch:prAsbOpraOpts.prAsbQuery:',newVal,oldVal)
+    //     if(newVal != oldVal){
+    //       this.getPrAsb(this.prForm.id)
+    //     }
+    //   }
+    // },
+
+    "dataTransOpts.refresh.register_asbitem.M":{
       immediate: true, // 立即执行
       // deep: true, // 深度监听复杂类型内变化
-      handler(newVal,oldVal){
-        console.log('人员登记 组合项目明细,人员id:',newVal,oldVal)
-        this.oldFormId = oldVal   
-        this.getPrAsb(newVal)
-        // if(newVal != oldVal){
-        //   this.getPrAsb(newVal)
-        // }     
-      }
-    },
-
-    //人员 id 未变的情况下,触发刷新,主要针对收费
-    "prAsbOpraOpts.prAsbQuery":{
-      // immediate: true, // 立即执行
-      // deep: true, // 深度监听复杂类型内变化
       handler(newVal,oldVal){        
-        console.log('watch:prAsbOpraOpts.prAsbQuery:',newVal,oldVal)
-        if(newVal != oldVal){
-          this.getPrAsb(this.prForm.id)
-        }
+        console.log('watch: 刷新 人员登记/编辑 时的组合项目: ',this.dataTransOpts.tableS.patient_register.id)
+        this.getPrAsb(this.dataTransOpts.tableS.patient_register.id)        
       }
     },
 
diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue
index 1ab6ec6..e931fdc 100644
--- a/src/components/patientRegister/PatientRegisterList.vue
+++ b/src/components/patientRegister/PatientRegisterList.vue
@@ -863,7 +863,7 @@ export default {
         // 触发数据刷新
         this.dataTransOpts.refresh.patient_register.S++ //人员信息
         this.dataTransOpts.refresh.register_asbitem.M++  //人员登记组合项目
-      }, 10);
+      }, 20);
 
     },
 
@@ -935,9 +935,14 @@ export default {
       })
       let res = await postapi(`/api/app/patientregister/getinfoorpatient?PatientRegisterId=${this.dataTransOpts.tableS.patient_register.id}`)
       if(res.code != 1) return
+
+      this.patientRegister.prList.forEach(e => {
+        e.choosed = false
+      });
       let lfind = arrayExistObj(this.patientRegister.prList,'id',this.dataTransOpts.tableS.patient_register.id)
       if(lfind > -1){
         objCopy(res.data,this.patientRegister.prList[lfind])
+        this.patientRegister.prList[lfind].choosed = true
       }else{           
         lfind = this.patientRegister.prList.length
         this.patientRegister.prList.push(res.data)
@@ -957,8 +962,7 @@ export default {
         //   // this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId);
         //   this.dict.asbItem = [...this.dict.asbItemAll];
         //   this.getPatientRegisterAbs(currentRow.id);          
-        // }, 100)
-        
+        // }, 100)        
       } 
     },