|
|
@@ -119,36 +119,26 @@ onMounted(async () => {
|
|
|
getConstitutionGroup();
|
|
|
// 获取禁忌
|
|
|
getTabooCrowds();
|
|
|
+ // 获取适用情况数据
|
|
|
+ let matchRule = props.data.cpPatientMatchRule || {};
|
|
|
+ // if (props.data.id) {
|
|
|
+ // // 调编辑接口获取调理包详情
|
|
|
+ // const res: any = await getConditioningSchemeDetailMethod(props.data);
|
|
|
+ // console.log(res,'调编辑接口获取调理包详情');
|
|
|
+ // await nextTick(); // 确保视图更新
|
|
|
+ // matchRule = res?.cpPatientMatchRule || {};
|
|
|
+ // }
|
|
|
|
|
|
- // 如果没有传入数据且有id,则从接口获取
|
|
|
- if (props.data.id) {
|
|
|
- // 调编辑接口获取调理包详情 获取这些症状
|
|
|
- const res: any = await getConditioningSchemeDetailMethod(props.data);
|
|
|
- await nextTick(); // 确保视图更新
|
|
|
- // 获取适用情况
|
|
|
- const matchRule = res?.cpPatientMatchRule || {};
|
|
|
- Object.assign(formData.cpPatientMatchRule!, {
|
|
|
- sex: matchRule.sex ?? '',
|
|
|
- age: matchRule.age ?? '',
|
|
|
- diagnoseDiseaseNames: Array.isArray(matchRule.diagnoseDiseaseNames) ? matchRule.diagnoseDiseaseNames : [],
|
|
|
- diagnoseSyndromeNames: Array.isArray(matchRule.diagnoseSyndromeNames) ? matchRule.diagnoseSyndromeNames : [],
|
|
|
- constitutionGroupNames: Array.isArray(matchRule.constitutionGroupNames) ? matchRule.constitutionGroupNames : [],
|
|
|
- willillStateNames: Array.isArray(matchRule.willillStateNames) ? matchRule.willillStateNames : [],
|
|
|
- tabooCrowds: Array.isArray(matchRule.tabooCrowds) ? matchRule.tabooCrowds : [],
|
|
|
- });
|
|
|
- } else if (props.data.cpPatientMatchRule) {
|
|
|
- // 在没保存之前回填上次的数据
|
|
|
- const matchRule = props.data.cpPatientMatchRule;
|
|
|
- Object.assign(formData.cpPatientMatchRule!, {
|
|
|
- sex: matchRule.sex ?? '',
|
|
|
- age: matchRule.age ?? '',
|
|
|
- diagnoseDiseaseNames: Array.isArray(matchRule.diagnoseDiseaseNames) ? matchRule.diagnoseDiseaseNames : [],
|
|
|
- diagnoseSyndromeNames: Array.isArray(matchRule.diagnoseSyndromeNames) ? matchRule.diagnoseSyndromeNames : [],
|
|
|
- constitutionGroupNames: Array.isArray(matchRule.constitutionGroupNames) ? matchRule.constitutionGroupNames : [],
|
|
|
- willillStateNames: Array.isArray(matchRule.willillStateNames) ? matchRule.willillStateNames : [],
|
|
|
- tabooCrowds: Array.isArray(matchRule.tabooCrowds) ? matchRule.tabooCrowds : [],
|
|
|
- });
|
|
|
- }
|
|
|
+ // 统一处理数据赋值
|
|
|
+ Object.assign(formData.cpPatientMatchRule!, {
|
|
|
+ sex: matchRule.sex ?? '',
|
|
|
+ age: matchRule.age ?? '',
|
|
|
+ diagnoseDiseaseNames: Array.isArray(matchRule.diagnoseDiseaseNames) ? matchRule.diagnoseDiseaseNames : [],
|
|
|
+ diagnoseSyndromeNames: Array.isArray(matchRule.diagnoseSyndromeNames) ? matchRule.diagnoseSyndromeNames : [],
|
|
|
+ constitutionGroupNames: Array.isArray(matchRule.constitutionGroupNames) ? matchRule.constitutionGroupNames : [],
|
|
|
+ willillStateNames: Array.isArray(matchRule.willillStateNames) ? matchRule.willillStateNames : [],
|
|
|
+ tabooCrowds: Array.isArray(matchRule.tabooCrowds) ? matchRule.tabooCrowds : [],
|
|
|
+ });
|
|
|
});
|
|
|
let multiple = ref<boolean>(true);
|
|
|
</script>
|