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 d725446a..3ca7f2ff 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 @@ -904,9 +904,9 @@ export default { }, }; }, - created() { - this.getTrialBodyPartList(); - }, + // created() { + // this.getTrialBodyPartList(); + // }, methods: { handleConfirmModality() { this.form.ModalityList = Object.assign( @@ -961,14 +961,16 @@ export default { let obj = this.trialBodyPartList.filter( (item) => item.Code === data.Code ); - console.log(obj); this.$refs.bodyPartTable.toggleRowSelection(obj[0]); }); } } + return true; } + return false; } catch (err) { console.log(err); + return false; } }, // 添加检查部位 @@ -1006,7 +1008,7 @@ export default { this.$nextTick(() => { var a = this.trialBodyPartList.filter((v) => { return !!this.form.BodyPartTypeList.find((v1) => { - return v1 === v.Name; + return v1 === v.Code; }); }); this.toggleBodyPartSelection(a); @@ -1024,9 +1026,11 @@ export default { handleConfirmBodyParts() { this.form.BodyPartTypeList = Object.assign( [], - this.selectedBodyParts.map((v) => v.Name) + this.selectedBodyParts.map((v) => v.Code) ); - var bodyPartTypes = this.form.BodyPartTypeList; + var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { + return this.changeBodyPart(i.trim()); + }); this.form.BodyPartTypes = bodyPartTypes.join(" | "); this.bodyPartListVisible = false; }, @@ -1257,13 +1261,27 @@ export default { " | " ); this.form.BodyPartTypeList = this.form.BodyPartTypes.split("|"); - var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { - return i.trim(); - }); - this.form.BodyPartTypes = bodyPartTypes.toString().replaceAll(",", " | "); - // this.form.ClinicalDataSetNamesStr = this.form.ClinicalDataSetNames.join(', ') - this.initialForm = { ...this.form }; - this.loading = false; + let r = await this.getTrialBodyPartList(); + if (r) { + var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { + return this.changeBodyPart(i.trim()); + }); + this.form.BodyPartTypes = bodyPartTypes + .toString() + .replaceAll(",", " | "); + // this.form.ClinicalDataSetNamesStr = this.form.ClinicalDataSetNames.join(', ') + this.initialForm = { ...this.form }; + this.loading = false; + } + }, + // bodyPart中英文转换 + changeBodyPart(code) { + let arr = this.trialBodyPartList.filter((item) => item.Code === code); + if (arr[0]) { + return arr[0].Name; + } else { + return null; + } }, // 获取临床数据模板信息 getClinicalDataList(isSelect = false) {