diff --git a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue index a578d910..010ded2d 100644 --- a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue +++ b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue @@ -952,7 +952,7 @@ export default { this.selectedBodyParts = val; }, // 获取检查部位 - async getTrialBodyPartList() { + async getTrialBodyPartList(data) { try { let params = { TrialId: this.$route.query.trialId, @@ -960,15 +960,16 @@ export default { let res = await getTrialBodyPartList(params); if (res.IsSuccess) { this.trialBodyPartList = res.Result; - if (this.$refs.bodyPartTable) { - this.$nextTick(() => { - var a = this.trialBodyPartList.filter((v) => { - return !!this.form.BodyPartTypeList.find((v1) => { - return v1 === v.Name; - }); + if (data) { + if (this.$refs.bodyPartTable) { + this.$nextTick(() => { + let obj = this.trialBodyPartList.filter( + (item) => item.Code === data.Code + ); + console.log(obj); + this.$refs.bodyPartTable.toggleRowSelection(obj[0]); }); - this.toggleBodyPartSelection(a); - }); + } } } } catch (err) { @@ -990,7 +991,7 @@ export default { }; let res = await addOrUpdateTrialBodyPart(data); if (res.IsSuccess) { - this.getTrialBodyPartList(); + this.getTrialBodyPartList(data); this.$message.success( this.$t("trials:seeting:message:addBodyPartSuccess") );