浏览代码

修复用户护理项删除失败的问题,修复用户责任医生责任护士删除失败的问题,修复superadmin修改设备,会导致设备part_id变更的问题

vothin 2 年之前
父节点
当前提交
6d8faa8c0d

+ 9 - 0
src/api/ncs_customer_mapping.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function deleteByCustomerAndNurseConfigId(customer, ids) {
+  return request({
+    url: `/ncs/customer_mapping/${customer}/${ids}`,
+    method: 'DELETE',
+    loading: true
+  })
+}

+ 0 - 1
src/views/customer/components/customerManager.vue

@@ -1142,7 +1142,6 @@ export default {
     },
     /** 生日选择变化,修改年龄字段 */
     birthdayChange(val) {
-      console.log(val)
       const ageObj = this.getAge(val)
       console.log('ageobj', ageObj)
       this.$set(this.formmodel, 'age_unit', ageObj.ageunit)

+ 23 - 23
src/views/customer/components/elderlyCareManager.vue

@@ -1524,29 +1524,29 @@
              * 医护人员选择变化
              * @param type
              */
-            doctorChange(type) {
-                if (this.customerId !== 0) {
-                    if (type === 1) {
-                        if (this.doctor_mapping_id === null) {
-                            this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.doctor_mapping_id = this.doctor_mapping_id
-                        }
-                    } else if (type === 2) {
-                        if (this.nurse_Mapping_id === null) {
-                            this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
-                        }
-                    } else if (type === 3) {
-                        if (this.worker_mapping_id === null) {
-                            this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.worker_mapping_id = this.worker_mapping_id
-                        }
-                    }
-                }
-            },
+            // doctorChange(type) {
+            //     if (this.customerId !== 0) {
+            //         if (type === 1) {
+            //             if (this.doctor_mapping_id === null) {
+            //                 this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.doctor_mapping_id = this.doctor_mapping_id
+            //             }
+            //         } else if (type === 2) {
+            //             if (this.nurse_Mapping_id === null) {
+            //                 this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
+            //             }
+            //         } else if (type === 3) {
+            //             if (this.worker_mapping_id === null) {
+            //                 this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.worker_mapping_id = this.worker_mapping_id
+            //             }
+            //         }
+            //     }
+            // },
             // 护理项选择 设置选中项的颜色
             changeNurseData(val, configid, index) {
                 const currentCfg = this.nurseconfigSelection.find(p => p.config.id === configid).options.find(p => p.id === val)

+ 54 - 36
src/views/customer/components/patientManager.vue

@@ -200,8 +200,8 @@
                             <el-row>
                                 <el-col :span="8">
                                     <el-form-item :label="this.$t('customerManage.doctor')">
-                                        <el-select v-model="formmodel.doctor_id" :placeholder="this.$t('customerManage.choiceDoctor')" clearable
-                                                   @change="doctorChange(1)">
+                                        <el-select v-model="formmodel.doctor_id" :placeholder="this.$t('customerManage.choiceDoctor')" clearable>
+<!--                                                   @change="doctorChange(1)">-->
                                             <el-option v-for="(item,index) in doctors" :key="index"
                                                        :label="item.clerk_name" :value="item.clerk_id"/>
                                         </el-select>
@@ -209,8 +209,8 @@
                                 </el-col>
                                 <el-col :span="8">
                                     <el-form-item :label="this.$t('customerManage.nurse')">
-                                        <el-select v-model="formmodel.nurse_id" :placeholder="this.$t('customerManage.choiceNurse')" clearable
-                                                   @change="doctorChange(2)">
+                                        <el-select v-model="formmodel.nurse_id" :placeholder="this.$t('customerManage.choiceNurse')" clearable>
+<!--                                                   @change="doctorChange(2)">-->
                                             <el-option v-for="(item,index) in nurses" :key="index"
                                                        :label="item.clerk_name" :value="item.clerk_id"/>
                                         </el-select>
@@ -218,8 +218,8 @@
                                 </el-col>
                                 <el-col :span="8">
                                     <el-form-item :label="this.$t('customerManage.worker')">
-                                        <el-select v-model="formmodel.worker_id" :placeholder="this.$t('customerManage.choiceWorker')" clearable
-                                                   @change="doctorChange(3)">
+                                        <el-select v-model="formmodel.worker_id" :placeholder="this.$t('customerManage.choiceWorker')" clearable>
+<!--                                                   @change="doctorChange(3)">-->
                                             <el-option v-for="(item,index) in workers" :key="index"
                                                        :label="item.clerk_name" :value="item.clerk_id"/>
                                         </el-select>
@@ -529,6 +529,7 @@
     import * as API_User from '@/api/user'
     import * as API_Clerk from '@/api/ncs_clerk'
     import * as API_NurseConfig from '@/api/ncs_nurse_config'
+    import * as API_CustomerMapping from "@/api/ncs_customer_mapping";
     import vitalSignLog from '@/views/vital-sign/log'
     import vueQr from "vue-qr";
     import {FRAME_TYPE} from "@/utils/enum/FrameTypeEnum";
@@ -686,6 +687,7 @@
                 workers: [],
                 nurseData: [],
                 nurseconfigSelection: [],
+              deleteNurseConfig: [],
                 sexTransfer: [
                     {key: this.$t('member.man'), value: 1, color: 'green'},
                     {key: this.$t('member.woman'), value: 0, color: 'red'}
@@ -1146,7 +1148,6 @@
             },
             /** 生日选择变化,修改年龄字段 */
             birthdayChange(val) {
-                console.log(val)
                 const ageObj = this.getAge(val)
                 console.log('ageobj', ageObj)
                 this.$set(this.formmodel, 'age_unit', ageObj.ageunit)
@@ -1261,12 +1262,19 @@
                                 this.$message.success(this.$t('action.editSuccess'))
                                 this.customerFormVisible = false
                                 this.getList()
-                                this.isDisabled = false
-                                this.$emit('saved')
+                              this.isDisabled = false
+                              this.$emit('saved')
                             }).catch(err => {
                                 this.$message.error(err.message)
                                 this.isDisabled = false
                             })
+                          if (this.deleteNurseConfig.length > 0) {
+                            console.log("this.deleteNurseConfig = " + this.deleteNurseConfig)
+                            API_CustomerMapping.deleteByCustomerAndNurseConfigId(this.formmodel.id, this.deleteNurseConfig).then(res => {
+                              this.isDisabled = false
+                            })
+                          }
+
                         }
                     } else {
                         this.$message.error(this.$t('action.fromError'))
@@ -1454,11 +1462,7 @@
             },
             /** 添加亲属 */
             addRelative() {
-              console.log('8888888888888888888888888888')
-              console.log(this.$refs['relativeForm'])
                 this.$refs['relativeForm'].validate(valid => {
-                  console.log('222222222222222')
-                  console.log(valid)
                     if (valid) {
                         this.relativeFormModel.relative_id = this.formmodel.member_id
                         API_User.addRelative(this.relativeFormModel).then(res => {
@@ -1587,31 +1591,36 @@
              * 医护人员选择变化
              * @param type
              */
-            doctorChange(type) {
-                if (this.customerId !== 0) {
-                    if (type === 1) {
-                        if (this.doctor_mapping_id === null) {
-                            this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.doctor_mapping_id = this.doctor_mapping_id
-                        }
-                    } else if (type === 2) {
-                        if (this.nurse_Mapping_id === null) {
-                            this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
-                        }
-                    } else if (type === 3) {
-                        if (this.worker_mapping_id === null) {
-                            this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
-                        } else {
-                            this.formmodel.worker_mapping_id = this.worker_mapping_id
-                        }
-                    }
-                }
-            },
+            // doctorChange(type) {
+            //     if (this.customerId !== 0) {
+            //         if (type === 1) {
+            //             if (this.doctor_mapping_id === null) {
+            //                 this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.doctor_mapping_id = this.doctor_mapping_id
+            //             }
+            //         } else if (type === 2) {
+            //             if (this.nurse_mapping_id === null) {
+            //                 this.formmodel.nurse_mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.nurse_mapping_id = this.nurse_mapping_id
+            //             }
+            //         } else if (type === 3) {
+            //             if (this.worker_mapping_id === null) {
+            //                 this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
+            //             } else {
+            //                 this.formmodel.worker_mapping_id = this.worker_mapping_id
+            //             }
+            //         }
+            //     }
+            // },
             // 护理项选择 设置选中项的颜色
             changeNurseData(val, configid, index) {
+              if (val === null || val === '') {
+                this.setDeleteNurseConfig(configid);
+              } else {
+                this.removeDeleteNurseConfig(configid)
+              }
                 const currentCfg = this.nurseconfigSelection.find(p => p.config.id === configid).options.find(p => p.id === val)
                 if (currentCfg) {
                     this.$refs['patient_nurse_' + configid][0].$el.getElementsByClassName('el-input__inner')[0].style = 'color:#' + currentCfg.color_rgb + ' !important'
@@ -1709,6 +1718,15 @@
                 this.formmodel.sex = 1
               }
             }
+          },
+          setDeleteNurseConfig(config) {
+            this.deleteNurseConfig.push(config)
+          },
+          removeDeleteNurseConfig(config) {
+            var index = this.deleteNurseConfig.map(item => item).indexOf(config)
+            if (index != null) {
+              this.deleteNurseConfig.splice(index, index + 1)
+            }
           }
         }
     }

+ 5 - 5
src/views/ncs-device/components/deviceManager.vue

@@ -1090,14 +1090,14 @@
                 this.$refs[formName].validate((valid) => {
                     if (valid) {
                         const _this = this;
-                        if (this.frame.type != null) {
-                            this.deviceModel.part_id = this.frame.type === FRAME_TYPE.HOSPITAL ? this.frame.hospital_id : this.frame.part_id
-                        } else {
-                            this.deviceModel.part_id = this.$store.getters.partId
-                        }
                         console.log('this.deviceModel', this.deviceModel)
                         /** 新增 */
                         if (!this.deviceModel.id) {
+                          if (this.frame.type != null) {
+                            this.deviceModel.part_id = this.frame.type === FRAME_TYPE.HOSPITAL ? this.frame.hospital_id : this.frame.part_id
+                          } else {
+                            this.deviceModel.part_id = this.$store.getters.partId
+                          }
                             API_Device.add(this.deviceModel).then(r => {
                                 this.$message.success(this.$t('action.saveSuccess'))
                                 _this.device = r

+ 0 - 4
src/views/ncs-interaction/index.vue

@@ -453,14 +453,10 @@ export default {
             params.data.action_type === TCP_TYPE.PHONE
         ) {
           if (params.data.action_start !== null && params.data.action_accept !== null) {
-            console.log("params.data.action_accept : " +  params.data.action_accept)
-            console.log("params.data.action_start : " + params.data.action_start)
             responseTime = params.data.action_accept - params.data.action_start
             return this.formateSeconds(responseTime)
           }
         } else {
-          console.log("params.data.action_end : " +  params.data.action_end)
-          console.log("params.data.action_start : " + params.data.action_start)
           responseTime = params.data.action_end - params.data.action_start
           return this.formateSeconds(responseTime)
         }