HuRongxin 1 月之前
父节点
当前提交
db4ab02e26

+ 12 - 0
src/api/patients/nutritionSetting/index.ts

@@ -61,3 +61,15 @@ export const delSetting = (id: string | number | Array<string | number>) => {
     method: 'delete'
   });
 };
+
+/**
+ * 计算
+ * @param data
+ */
+export const recalculateValue = (data: NutritionSettingForm) => {
+  return request({
+    url: '/patients/recalculate',
+    method: 'post',
+    data: data
+  });
+};

+ 446 - 407
src/api/patients/nutritionSetting/types.ts

@@ -1,522 +1,561 @@
 export interface NutritionSettingVO {
-  /**
-   * 主键
-   */
-  id: string | number;
+    /**
+     * 主键
+     */
+    id: string | number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKcalPerDay: number;
+    /**
+     * 所需热量
+     */
+    caloriesKcalPerDay: number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKcalPerKgDay: number;
+    /**
+     * 所需热量
+     */
+    caloriesKcalPerKgDay: number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKjPerDay: number;
+    /**
+     * 所需热量
+     */
+    caloriesKjPerDay: number;
 
-  /**
-   * 蛋白质热量占比
-   */
-  proteinCaloriePercentage: number;
+    /**
+     * 蛋白质热量占比
+     */
+    proteinCaloriePercentage: number;
 
-  /**
-   * 脂肪热量占比
-   */
-  fatCaloriePercentage: number;
+    /**
+     * 脂肪热量占比
+     */
+    fatCaloriePercentage: number;
 
-  /**
-   * 碳水化合物热量占比
-   */
-  carbohydrateCaloriePercentage: number;
+    /**
+     * 碳水化合物热量占比
+     */
+    carbohydrateCaloriePercentage: number;
 
-  /**
-   * 所需蛋白质
-   */
-  proteinGPerKgDay: number;
+    /**
+     * 所需蛋白质
+     */
+    proteinGPerKgDay: number;
 
-  /**
-   * 所需蛋白质
-   */
-  proteinGPerDay: number;
+    /**
+     * 所需蛋白质
+     */
+    proteinGPerDay: number;
 
-  /**
-   * 所需脂肪
-   */
-  fatGPerKgDay: number;
+    /**
+     * 所需脂肪
+     */
+    fatGPerKgDay: number;
 
-  /**
-   * 所需脂肪
-   */
-  fatGPerDay: number;
+    /**
+     * 所需脂肪
+     */
+    fatGPerDay: number;
 
-  /**
-   * 所需碳水化合物
-   */
-  carbohydrateGPerKgDay: number;
+    /**
+     * 所需碳水化合物
+     */
+    carbohydrateGPerKgDay: number;
 
-  /**
-   * 所需碳水化合物
-   */
-  carbohydrateGPerDay: number;
+    /**
+     * 所需碳水化合物
+     */
+    carbohydrateGPerDay: number;
 
-  /**
-   * 钙
-   */
-  calcium: number;
+    /**
+     * 钙
+     */
+    calcium: number;
 
-  /**
-   * 钾
-   */
-  potassium: number;
+    /**
+     * 钾
+     */
+    potassium: number;
 
-  /**
-   * 钠
-   */
-  sodium: number;
+    /**
+     * 钠
+     */
+    sodium: number;
 
-  /**
-   * 镁
-   */
-  magnesium: number;
+    /**
+     * 镁
+     */
+    magnesium: number;
 
-  /**
-   * 磷
-   */
-  phosphorus: number;
+    /**
+     * 磷
+     */
+    phosphorus: number;
 
-  /**
-   * 氯
-   */
-  chloride: string | number;
+    /**
+     * 氯
+     */
+    chloride: string | number;
 
-  /**
-   * 铁
-   */
-  iron: number;
+    /**
+     * 铁
+     */
+    iron: number;
 
-  /**
-   * 硒
-   */
-  selenium: number;
+    /**
+     * 硒
+     */
+    selenium: number;
 
-  /**
-   * 锰
-   */
-  manganese: number;
+    /**
+     * 锰
+     */
+    manganese: number;
 
-  /**
-   * 氟
-   */
-  fluoride: string | number;
+    /**
+     * 氟
+     */
+    fluoride: string | number;
 
-  /**
-   * 钼
-   */
-  molybdenum: number;
+    /**
+     * 钼
+     */
+    molybdenum: number;
 
-  /**
-   * 锌
-   */
-  zinc: number;
+    /**
+     * 锌
+     */
+    zinc: number;
 
-  /**
-   * 铜
-   */
-  copper: number;
+    /**
+     * 铜
+     */
+    copper: number;
 
-  /**
-   * 碘
-   */
-  iodine: number;
+    /**
+     * 碘
+     */
+    iodine: number;
 
-  /**
-   * 铬
-   */
-  chromium: number;
+    /**
+     * 铬
+     */
+    chromium: number;
 
-  /**
-   * 维生素A
-   */
-  vitaminA: number;
+    /**
+     * 维生素A
+     */
+    vitaminA: number;
 
-  /**
-   * 维生素D
-   */
-  vitaminD: number;
+    /**
+     * 维生素D
+     */
+    vitaminD: number;
 
-  /**
-   * 维生素E
-   */
-  vitaminE: number;
+    /**
+     * 维生素E
+     */
+    vitaminE: number;
 
-  /**
-   * 维生素K
-   */
-  vitaminK: number;
+    /**
+     * 维生素K
+     */
+    vitaminK: number;
 
-  /**
-   * 维生素B1
-   */
-  vitaminBOne: number;
+    /**
+     * 维生素B1
+     */
+    vitaminBOne: number;
 
-  /**
-   * 维生素B2
-   */
-  vitaminBTwo: number;
+    /**
+     * 维生素B2
+     */
+    vitaminBTwo: number;
 
-  /**
-   * 维生素B6
-   */
-  vitaminBSix: number;
+    /**
+     * 维生素B6
+     */
+    vitaminBSix: number;
 
-  /**
-   * 维生素B12
-   */
-  vitaminBTwelve: number;
+    /**
+     * 维生素B12
+     */
+    vitaminBTwelve: number;
 
-  /**
-   * 烟酸(尼克酸)
-   */
-  niacin: number;
+    /**
+     * 烟酸(尼克酸)
+     */
+    niacin: number;
 
-  /**
-   * 维生素C
-   */
-  vitaminC: number;
+    /**
+     * 维生素C
+     */
+    vitaminC: number;
 
-  /**
-   * 叶酸
-   */
-  folicAcid: string | number;
+    /**
+     * 叶酸
+     */
+    folicAcid: string | number;
 
-  /**
-   * 胆碱
-   */
-  choline: number;
+    /**
+     * 胆碱
+     */
+    choline: number;
 
-  /**
-   * 生物素
-   */
-  biotin: number;
+    /**
+     * 生物素
+     */
+    biotin: number;
 
-  /**
-   * 泛酸
-   */
-  pantothenicAcid: string | number;
+    /**
+     * 泛酸
+     */
+    pantothenicAcid: string | number;
 
-  /**
-   * 膳食纤维
-   */
-  dietaryFiber: number;
+    /**
+     * 膳食纤维
+     */
+    dietaryFiber: number;
 
-  /**
-   * 设定方式
-   */
-  settingType: string;
+    /**
+     * 设定方式
+     */
+    settingType: string;
 
-  /**
-   * 患者id
-   */
-  patientId: string | number;
+    /**
+     * 患者id
+     */
+    patientId: string | number;
 
-  /**
-   * 看诊类型
-   */
-  type: string;
+    /**
+     * 看诊类型
+     */
+    type: string;
 
-  /**
-   * 科室
-   */
-  deptId: string | number;
+    /**
+     * 科室
+     */
+    deptId: string | number;
 
-  /**
-   * 门诊号
-   */
-  outpatientNo: string;
+    /**
+     * 门诊号
+     */
+    outpatientNo: string;
 
 }
 
 export interface NutritionSettingForm extends BaseEntity {
-  /**
-   * 主键
-   */
-  id?: string | number;
+    /**
+     * 主键
+     */
+    id?: string | number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKcalPerDay?: number;
+    /**
+     * 所需热量
+     */
+    caloriesKcalPerDay?: number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKcalPerKgDay?: number;
+    /**
+     * 所需热量
+     */
+    caloriesKcalPerKgDay?: number;
 
-  /**
-   * 所需热量
-   */
-  caloriesKjPerDay?: number;
+    /**
+     * 所需热量
+     */
+    caloriesKjPerDay?: number;
 
-  /**
-   * 蛋白质热量占比
-   */
-  proteinCaloriePercentage?: number;
+    /**
+     * 蛋白质热量占比
+     */
+    proteinCaloriePercentage?: number;
 
-  /**
-   * 脂肪热量占比
-   */
-  fatCaloriePercentage?: number;
+    /**
+     * 脂肪热量占比
+     */
+    fatCaloriePercentage?: number;
 
-  /**
-   * 碳水化合物热量占比
-   */
-  carbohydrateCaloriePercentage?: number;
+    /**
+     * 碳水化合物热量占比
+     */
+    carbohydrateCaloriePercentage?: number;
 
-  /**
-   * 所需蛋白质
-   */
-  proteinGPerKgDay?: number;
+    /**
+     * 所需蛋白质
+     */
+    proteinGPerKgDay?: number;
 
-  /**
-   * 所需蛋白质
-   */
-  proteinGPerDay?: number;
+    /**
+     * 所需蛋白质
+     */
+    proteinGPerDay?: number;
 
-  /**
-   * 所需脂肪
-   */
-  fatGPerKgDay?: number;
+    /**
+     * 所需脂肪
+     */
+    fatGPerKgDay?: number;
 
-  /**
-   * 所需脂肪
-   */
-  fatGPerDay?: number;
+    /**
+     * 所需脂肪
+     */
+    fatGPerDay?: number;
 
-  /**
-   * 所需碳水化合物
-   */
-  carbohydrateGPerKgDay?: number;
+    /**
+     * 所需碳水化合物
+     */
+    carbohydrateGPerKgDay?: number;
 
-  /**
-   * 所需碳水化合物
-   */
-  carbohydrateGPerDay?: number;
+    /**
+     * 所需碳水化合物
+     */
+    carbohydrateGPerDay?: number;
 
-  /**
-   * 钙
-   */
-  calcium?: number;
+    /**
+     * 钙
+     */
+    calcium?: number;
 
-  /**
-   * 钾
-   */
-  potassium?: number;
+    /**
+     * 钾
+     */
+    potassium?: number;
 
-  /**
-   * 钠
-   */
-  sodium?: number;
+    /**
+     * 钠
+     */
+    sodium?: number;
 
-  /**
-   * 镁
-   */
-  magnesium?: number;
+    /**
+     * 镁
+     */
+    magnesium?: number;
 
-  /**
-   * 磷
-   */
-  phosphorus?: number;
+    /**
+     * 磷
+     */
+    phosphorus?: number;
 
-  /**
-   * 氯
-   */
-  chloride?: string | number;
+    /**
+     * 氯
+     */
+    chloride?: string | number;
 
-  /**
-   * 铁
-   */
-  iron?: number;
+    /**
+     * 铁
+     */
+    iron?: number;
 
-  /**
-   * 硒
-   */
-  selenium?: number;
+    /**
+     * 硒
+     */
+    selenium?: number;
 
-  /**
-   * 锰
-   */
-  manganese?: number;
+    /**
+     * 锰
+     */
+    manganese?: number;
 
-  /**
-   * 氟
-   */
-  fluoride?: string | number;
+    /**
+     * 氟
+     */
+    fluoride?: string | number;
 
-  /**
-   * 钼
-   */
-  molybdenum?: number;
+    /**
+     * 钼
+     */
+    molybdenum?: number;
 
-  /**
-   * 锌
-   */
-  zinc?: number;
+    /**
+     * 锌
+     */
+    zinc?: number;
 
-  /**
-   * 铜
-   */
-  copper?: number;
+    /**
+     * 铜
+     */
+    copper?: number;
 
-  /**
-   * 碘
-   */
-  iodine?: number;
+    /**
+     * 碘
+     */
+    iodine?: number;
 
-  /**
-   * 铬
-   */
-  chromium?: number;
+    /**
+     * 铬
+     */
+    chromium?: number;
 
-  /**
-   * 维生素A
-   */
-  vitaminA?: number;
+    /**
+     * 维生素A
+     */
+    vitaminA?: number;
 
-  /**
-   * 维生素D
-   */
-  vitaminD?: number;
+    /**
+     * 维生素D
+     */
+    vitaminD?: number;
 
-  /**
-   * 维生素E
-   */
-  vitaminE?: number;
+    /**
+     * 维生素E
+     */
+    vitaminE?: number;
 
-  /**
-   * 维生素K
-   */
-  vitaminK?: number;
+    /**
+     * 维生素K
+     */
+    vitaminK?: number;
 
-  /**
-   * 维生素B1
-   */
-  vitaminBOne?: number;
+    /**
+     * 维生素B1
+     */
+    vitaminBOne?: number;
 
-  /**
-   * 维生素B2
-   */
-  vitaminBTwo?: number;
+    /**
+     * 维生素B2
+     */
+    vitaminBTwo?: number;
 
-  /**
-   * 维生素B6
-   */
-  vitaminBSix?: number;
+    /**
+     * 维生素B6
+     */
+    vitaminBSix?: number;
 
-  /**
-   * 维生素B12
-   */
-  vitaminBTwelve?: number;
+    /**
+     * 维生素B12
+     */
+    vitaminBTwelve?: number;
 
-  /**
-   * 烟酸(尼克酸)
-   */
-  niacin?: number;
+    /**
+     * 烟酸(尼克酸)
+     */
+    niacin?: number;
 
-  /**
-   * 维生素C
-   */
-  vitaminC?: number;
+    /**
+     * 维生素C
+     */
+    vitaminC?: number;
 
-  /**
-   * 叶酸
-   */
-  folicAcid?: string | number;
+    /**
+     * 叶酸
+     */
+    folicAcid?: string | number;
 
-  /**
-   * 胆碱
-   */
-  choline?: number;
+    /**
+     * 胆碱
+     */
+    choline?: number;
 
-  /**
-   * 生物素
-   */
-  biotin?: number;
+    /**
+     * 生物素
+     */
+    biotin?: number;
 
-  /**
-   * 泛酸
-   */
-  pantothenicAcid?: string | number;
+    /**
+     * 泛酸
+     */
+    pantothenicAcid?: string | number;
 
-  /**
-   * 膳食纤维
-   */
-  dietaryFiber?: number;
+    /**
+     * 膳食纤维
+     */
+    dietaryFiber?: number;
 
-  /**
-   * 设定方式
-   */
-  settingType?: string;
+    /**
+     * 设定方式
+     */
+    settingType?: string;
 
-  deptName?: string;    
+    deptName?: string;
 
-  /**
-   * 患者id
-   */
-  patientId?: string | number;
+    /**
+     * 患者id
+     */
+    patientId?: string | number;
 
-  /**
-   * 看诊类型
-   */
-  type?: string;
+    /**
+     * 看诊类型
+     */
+    type?: string;
 
-  /**
-   * 科室
-   */
-  deptId?: string | number;
+    /**
+     * 科室
+     */
+    deptId?: string | number;
 
-  /**
-   * 门诊号
+    /**
+     * 门诊号
+     */
+    outpatientNo?: string;
+
+    /**
+   * 身高
    */
-  outpatientNo?: string;
+    height?: number;
+
+
+    /**
+     * 体重
+     */
+    weight?: number;
+
+
+    /**
+     * 体力活动
+     */
+    activity?: number;
+
+
+    /**
+     * 应激状态
+     */
+    stressType?: number;
+
+
+    /**
+     * 上臀围
+     */
+    highHip?: number;
+
+    /**
+     * 下臀围
+     */
+    lowHip?: number;
+
+    /*烧伤面积*/
+    burnArea?: number;
+
+    BMI?: number;
 
 }
 
 export interface NutritionSettingQuery extends PageQuery {
 
-  
-  /**
-   * 设定方式
-   */
-  settingType?: string;
 
-  /**
-   * 患者id
-   */
-  patientId?: string | number;
+    /**
+     * 设定方式
+     */
+    settingType?: string;
 
-  /**
-   * 看诊类型
-   */
-  type?: string;
+    /**
+     * 患者id
+     */
+    patientId?: string | number;
 
-  /**
-   * 科室
-   */
-  deptId?: string | number;
+    /**
+     * 看诊类型
+     */
+    type?: string;
 
-  /**
-   * 门诊号
-   */
-  outpatientNo?: string;
+    /**
+     * 科室
+     */
+    deptId?: string | number;
+
+    /**
+     * 门诊号
+     */
+    outpatientNo?: string;
 
-  searchValue?: string;
+    searchValue?: string;
 
-  dateRange?: string[];
+    dateRange?: string[];
 
     /**
      * 日期范围参数

+ 283 - 279
src/api/workbench/treatmentUser/types.ts

@@ -1,292 +1,296 @@
 export interface TreatmentUserVo {
-  /**
-   * 
-   */
-  id: string | number;
-
-  /**
-   * 看诊类型
-   */
-  type: string;
-
-  /**
-   * 诊疗卡号
-   */
-  treatNum: string;
-
-  /**
-   * 门诊号
-   */
-  outpatientNo: string;
-
-  /**
-   * 科室
-   */
-  doorId: string | number;
-
-  /**
-   * 姓名
-   */
-  treatName: string;
-
-  /**
-   * 出生日期
-   */
-  birthday: string;
-
-  /**
-   * 联系电话
-   */
-  phoneNum: string;
-
-  /**
-   * 性别 
-   */
-  sex: string;
-
-  /**
-   * 身份证号
-   */
-  idCard: string | number;
-
-  /**
-   * 年龄
-   */
-  age: string;
-
-  /**
-   * 身高
-   */
-  height: string;
-
-  /**
-   * 体重
-   */
-  weight: string;
-
-  /**
-   * 过敏食物
-   */
-  allergyFoot: string;
-
-  /**
-   * 过敏药物
-   */
-  allergyDrug: string;
-
-  /**
-   * 体力活动
-   */
-  activity: string;
-
-  /**
-   * 床号
-   */
-  bedNo: string;
-
-  /**
-   * 病区
-   */
-  inpatientWard: string;
-
-  /**
-   * 入院时间
-   */
-  admissionDate: string;
-
-  deptName: string;
+    /**
+     * 
+     */
+    id: string | number;
+
+    /**
+     * 看诊类型
+     */
+    type: string;
+
+    /**
+     * 诊疗卡号
+     */
+    treatNum: string;
+
+    /**
+     * 门诊号
+     */
+    outpatientNo: string;
+
+    /**
+     * 科室
+     */
+    doorId: string | number;
+
+    /**
+     * 姓名
+     */
+    treatName: string;
+
+    /**
+     * 出生日期
+     */
+    birthday: string;
+
+    /**
+     * 联系电话
+     */
+    phoneNum: string;
+
+    /**
+     * 性别 
+     */
+    sex: string;
+
+    /**
+     * 身份证号
+     */
+    idCard: string | number;
+
+    /**
+     * 年龄
+     */
+    age: string;
+
+    /**
+     * 身高
+     */
+    height: string;
+
+    /**
+     * 体重
+     */
+    weight: string;
+
+    /**
+     * 过敏食物
+     */
+    allergyFoot: string;
+
+    /**
+     * 过敏药物
+     */
+    allergyDrug: string;
+
+    /**
+     * 体力活动
+     */
+    activity: string;
+
+    /**
+     * 床号
+     */
+    bedNo: string;
+
+    /**
+     * 病区
+     */
+    inpatientWard: string;
+
+    /**
+     * 入院时间
+     */
+    admissionDate: string;
+
+    deptName: string;
+
+    bmi: string | number;
 
 }
 
 export interface TreatmentUserForm extends BaseEntity {
- /**
-   * 
-   */
-  id?: string | number;
-
-  /**
-   * 看诊类型
-   */
-  type?: string;
-
-  /**
-   * 诊疗卡号
-   */
-  treatNum?: string;
-
-  /**
-   * 门诊号
-   */
-  outpatientNo?: string;
-
-  /**
-   * 科室
-   */
-  doorId?: string | number;
-
-  /**
-   * 姓名
-   */
-  treatName?: string;
-
-  /**
-   * 出生日期
-   */
-  birthday?: string;
-
-  /**
-   * 联系电话
-   */
-  phoneNum?: string;
-
-  /**
-   * 性别 
-   */
-  sex?: string;
-
-  /**
-   * 身份证号
-   */
-  idCard?: string | number;
-
-  /**
-   * 年龄
-   */
-  age?: string;
-
-  /**
-   * 身高
-   */
-  height?: string;
-
-  /**
-   * 体重
-   */
-  weight?: string;
-
-  /**
-   * 过敏食物
-   */
-  allergyFoot?: string;
-
-  /**
-   * 过敏药物
-   */
-  allergyDrug?: string;
-
-  /**
-   * 体力活动
-   */
-  activity?: string;
-
-  /**
-   * 床号
-   */
-  bedNo?: string;
-
-  /**
-   * 病区
-   */
-  inpatientWard?: string;
-
-  /**
-   * 入院时间
-   */
-  admissionDate?: string;
+    /**
+      * 
+      */
+    id?: string | number;
+
+    /**
+     * 看诊类型
+     */
+    type?: string;
+
+    /**
+     * 诊疗卡号
+     */
+    treatNum?: string;
+
+    /**
+     * 门诊号
+     */
+    outpatientNo?: string;
+
+    /**
+     * 科室
+     */
+    doorId?: string | number;
+
+    /**
+     * 姓名
+     */
+    treatName?: string;
+
+    /**
+     * 出生日期
+     */
+    birthday?: string;
+
+    /**
+     * 联系电话
+     */
+    phoneNum?: string;
+
+    /**
+     * 性别 
+     */
+    sex?: string;
+
+    /**
+     * 身份证号
+     */
+    idCard?: string | number;
+
+    /**
+     * 年龄
+     */
+    age?: string;
+
+    /**
+     * 身高
+     */
+    height?: string;
+
+    /**
+     * 体重
+     */
+    weight?: string;
+
+    /**
+     * 过敏食物
+     */
+    allergyFoot?: string;
+
+    /**
+     * 过敏药物
+     */
+    allergyDrug?: string;
+
+    /**
+     * 体力活动
+     */
+    activity?: string;
+
+    /**
+     * 床号
+     */
+    bedNo?: string;
+
+    /**
+     * 病区
+     */
+    inpatientWard?: string;
+
+    /**
+     * 入院时间
+     */
+    admissionDate?: string;
+
+    bmi?: string | number;
 
 }
 
 export interface TreatmentUserQuery extends PageQuery {
 
- /**
-   * 看诊类型
-   */
-  type?: string;
-
-  /**
-   * 诊疗卡号
-   */
-  treatNum?: string;
-
-  /**
-   * 门诊号
-   */
-  outpatientNo?: string;
-
-  /**
-   * 科室
-   */
-  doorId?: string | number;
-
-  /**
-   * 姓名
-   */
-  treatName?: string;
-
-  /**
-   * 出生日期
-   */
-  birthday?: string;
-
-  /**
-   * 联系电话
-   */
-  phoneNum?: string;
-
-  /**
-   * 性别 
-   */
-  sex?: string;
-
-  /**
-   * 身份证号
-   */
-  idCard?: string | number;
-
-  /**
-   * 年龄
-   */
-  age?: string;
-
-  /**
-   * 身高
-   */
-  height?: string;
-
-  /**
-   * 体重
-   */
-  weight?: string;
-
-  /**
-   * 过敏食物
-   */
-  allergyFoot?: string;
-
-  /**
-   * 过敏药物
-   */
-  allergyDrug?: string;
-
-  /**
-   * 体力活动
-   */
-  activity?: string;
-
-  /**
-   * 床号
-   */
-  bedNo?: string;
-
-  /**
-   * 病区
-   */
-  inpatientWard?: string;
-
-  /**
-   * 入院时间
-   */
-  admissionDate?: string;
+    /**
+      * 看诊类型
+      */
+    type?: string;
+
+    /**
+     * 诊疗卡号
+     */
+    treatNum?: string;
+
+    /**
+     * 门诊号
+     */
+    outpatientNo?: string;
+
+    /**
+     * 科室
+     */
+    doorId?: string | number;
+
+    /**
+     * 姓名
+     */
+    treatName?: string;
+
+    /**
+     * 出生日期
+     */
+    birthday?: string;
+
+    /**
+     * 联系电话
+     */
+    phoneNum?: string;
+
+    /**
+     * 性别 
+     */
+    sex?: string;
+
+    /**
+     * 身份证号
+     */
+    idCard?: string | number;
+
+    /**
+     * 年龄
+     */
+    age?: string;
+
+    /**
+     * 身高
+     */
+    height?: string;
+
+    /**
+     * 体重
+     */
+    weight?: string;
+
+    /**
+     * 过敏食物
+     */
+    allergyFoot?: string;
+
+    /**
+     * 过敏药物
+     */
+    allergyDrug?: string;
+
+    /**
+     * 体力活动
+     */
+    activity?: string;
+
+    /**
+     * 床号
+     */
+    bedNo?: string;
+
+    /**
+     * 病区
+     */
+    inpatientWard?: string;
+
+    /**
+     * 入院时间
+     */
+    admissionDate?: string;
 
     /**
      * 日期范围参数

+ 49 - 39
src/views/patients/medicalRecord/index.vue

@@ -95,12 +95,7 @@
                     </el-row>
                 </div>
             </el-row>
-            <component 
-                :is="currentComponent" 
-                v-if="currentComponent" 
-                :patient-info="patientInfo"
-                @change="handleSelect"
-            />
+            <component :is="currentComponent" v-if="currentComponent" :patient-info="patientInfo" @change="handleSelect" />
         </div>
 
         <!-- 患者详情弹窗 -->
@@ -138,7 +133,7 @@
 
         nutritionScreening: NutritionScreening,
         nutritionScreeningAdd: NutritionScreeningAdd,
-        nutritionEvaluation:NutritionEvaluation,
+        nutritionEvaluation: NutritionEvaluation,
         nutritionEvaluationAdd: NutritionEvaluationAdd,
 
         nutritionEducation: NutritionEducation,
@@ -162,6 +157,10 @@
         deptId: '',
         deptName: '',
         outpatientNo: '',
+        BMI: '',
+        height: '',
+        weight: '',
+        activity: '',
 
     });
 
@@ -173,16 +172,16 @@
     const showEditDialog = ref(false);
     const editData = ref({} as any);
 
-    const handleSelect = (key: string,other?:string[]) => {   
-        if(key=='nutritionScreeningAdd'||key=='nutritionEvaluationAdd'){            
-            activeMenu.value = key.replace('Add',''); 
-        }else{
-            activeMenu.value = key; 
-        }     
-        currentComponent.value = componentMap[key] || null; 
-        patientInfo.value['other']=other;
-        patientInfo.value.type=route.query.type;
-        patientInfo.value.outpatientNo=route.query.outpatientNo;             
+    const handleSelect = (key: string, other ? : string[]) => {
+        if (key == 'nutritionScreeningAdd' || key == 'nutritionEvaluationAdd') {
+            activeMenu.value = key.replace('Add', '');
+        } else {
+            activeMenu.value = key;
+        }
+        currentComponent.value = componentMap[key] || null;
+        patientInfo.value['other'] = other;
+        patientInfo.value.type = route.query.type;
+        patientInfo.value.outpatientNo = route.query.outpatientNo;
     };
 
     const goBack = () => {
@@ -205,8 +204,8 @@
         currentComponent.value = componentMap['medicalRecord'];
         const idx = patientList.value.findIndex(item => item === row);
         patientInfo.value = row;
-        patientInfo.value.type=route.query.type;
-        patientInfo.value.outpatientNo=route.query.outpatientNo;  
+        patientInfo.value.type = route.query.type;
+        patientInfo.value.outpatientNo = route.query.outpatientNo;
         if (idx !== -1) {
             currentPatientIndex.value = idx;
         }
@@ -217,8 +216,8 @@
         currentComponent.value = componentMap['medicalRecord']
         if (currentPatientIndex.value > 0) {
             patientInfo.value = patientList.value[currentPatientIndex.value - 1];
-            patientInfo.value.type=route.query.type;
-            patientInfo.value.outpatientNo=route.query.outpatientNo;  
+            patientInfo.value.type = route.query.type;
+            patientInfo.value.outpatientNo = route.query.outpatientNo;
             currentPatientIndex.value--;
         }
     };
@@ -227,8 +226,8 @@
         activeMenu.value = 'medicalRecord';
         currentComponent.value = componentMap['medicalRecord']
         patientInfo.value = patientList.value[currentPatientIndex.value + 1];
-        patientInfo.value.type=route.query.type;
-        patientInfo.value.outpatientNo=route.query.outpatientNo;  
+        patientInfo.value.type = route.query.type;
+        patientInfo.value.outpatientNo = route.query.outpatientNo;
         if (currentPatientIndex.value < patientList.value.length - 1) {
             currentPatientIndex.value++;
         }
@@ -244,7 +243,7 @@
     // 编辑按钮处理
     const handleEdit = async () => {
         if (!patientInfo.value.id) {
-            proxy ?.$modal.msgError('请先选择患者');
+            proxy  ?.$modal.msgError('请先选择患者');
             return;
         }
 
@@ -255,14 +254,14 @@
             showEditDialog.value = true;
         } catch (error) {
             console.error('获取患者详情失败:', error);
-            proxy ?.$modal.msgError('获取患者详情失败');
+            proxy  ?.$modal.msgError('获取患者详情失败');
         }
     };
 
     // 详情按钮处理
     const handleDetail = async () => {
         if (!patientInfo.value.id) {
-            proxy ?.$modal.msgError('请先选择患者');
+            proxy  ?.$modal.msgError('请先选择患者');
             return;
         }
 
@@ -273,7 +272,7 @@
             showDetailDialog.value = true;
         } catch (error) {
             console.error('获取患者详情失败:', error);
-            proxy ?.$modal.msgError('获取患者详情失败');
+            proxy  ?.$modal.msgError('获取患者详情失败');
         }
     };
 
@@ -291,7 +290,7 @@
     const handleEditSave = (data) => {
         // 可在此处调用保存API,保存后刷新列表
         showEditDialog.value = false;
-        proxy ?.$modal.msgSuccess('保存成功');
+        proxy  ?.$modal.msgSuccess('保存成功');
         getList();
     };
 
@@ -312,7 +311,6 @@
                 params.searchFlag = searchValue.value;
             }
             const res = await listTreatmentUser(params);
-            console.log("res", JSON.stringify(res));
 
             patientList.value = (res.rows || []).map(item => ({
                 id: item.id,
@@ -322,7 +320,11 @@
                 deptName: item.deptName,
                 outpatientNo: item.outpatientNo,
                 gender: item.sex === '0' ? '男' : item.sex === '1' ? '女' : '',
-                age: item.age
+                age: item.age,
+                BMI: item.bmi,
+                height: item.height,
+                weight: item.weight,
+                activity: item.activity,
             }));
             waitingCount.value = patientList.value.length;
 
@@ -334,8 +336,8 @@
                     const targetIndex = patientList.value.findIndex(patient => patient.id === id);
                     if (targetIndex !== -1) {
                         patientInfo.value = patientList.value[targetIndex];
-                        patientInfo.value.type=route.query.type;
-                        patientInfo.value.outpatientNo=route.query.outpatientNo;  
+                        patientInfo.value.type = route.query.type;
+                        patientInfo.value.outpatientNo = route.query.outpatientNo;
                         currentPatientIndex.value = targetIndex;
                     } else {
                         // 如果没找到,默认选中第一个
@@ -345,8 +347,8 @@
                 } else {
                     // 没有路由参数,默认选中第一个
                     patientInfo.value = patientList.value[0];
-                    patientInfo.value.type=route.query.type;
-                    patientInfo.value.outpatientNo=route.query.outpatientNo;  
+                    patientInfo.value.type = route.query.type;
+                    patientInfo.value.outpatientNo = route.query.outpatientNo;
                     currentPatientIndex.value = 0;
                 }
             }
@@ -366,11 +368,11 @@
 
     onMounted(() => {
         // 获取体力活动字典
-        const { physical_activity } = toRefs(proxy ?.useDict('physical_activity'));
-        physicalActivityDict.value = physical_activity ?.value || [];
-        patientInfo.value.type=route.query.type;
-        patientInfo.value.outpatientNo=route.query.outpatientNo;   
-        getList();        
+        const { physical_activity } = toRefs(proxy  ?.useDict('physical_activity'));
+        physicalActivityDict.value = physical_activity  ?.value || [];
+        patientInfo.value.type = route.query.type;
+        patientInfo.value.outpatientNo = route.query.outpatientNo;
+        getList();
     });
 </script>
 
@@ -454,6 +456,7 @@
         width: 100%;
         min-width: 220px;
         white-space: nowrap;
+
         .el-table__header th {
             background: #f5f7fa;
             color: #409eff;
@@ -461,9 +464,11 @@
             font-size: 13px;
             padding: 4px 0;
         }
+
         .el-table__row {
             cursor: pointer;
         }
+
         .el-table__row.current-row {
             background: #eaf4ff !important;
         }
@@ -516,12 +521,15 @@
         align-items: center;
         white-space: nowrap;
     }
+
     .info-row .name {
         font-size: 22px;
     }
+
     .info-row .age {
         margin-left: 30px;
     }
+
     .gender-icon {
         margin-left: 30px;
         font-size: 25px;
@@ -530,9 +538,11 @@
         display: inline-block;
         vertical-align: middle;
     }
+
     .gender-icon.female {
         color: #ff4949;
     }
+
     .gender-icon.male {
         color: #409eff;
     }

+ 1 - 1
src/views/patients/nutritionEducation/index.vue

@@ -1,4 +1,4 @@
-<template>
+<template></template>
     <div class="p-2">
         <div v-show="type === 'list'">
             <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">

+ 500 - 182
src/views/patients/nutritionSetting/addForm.vue

@@ -1,187 +1,505 @@
 <template>
-  <el-form ref="NutritionSettingFormRef" :model="form" :rules="rules" label-width="80px">
-    <el-form-item label="所需热量" prop="caloriesKcalPerDay">
-      <el-input v-model="form.caloriesKcalPerDay" placeholder="请输入所需热量" />
-    </el-form-item>
-    <el-form-item label="所需热量" prop="caloriesKcalPerKgDay">
-      <el-input v-model="form.caloriesKcalPerKgDay" placeholder="请输入所需热量" />
-    </el-form-item>
-    <el-form-item label="所需热量" prop="caloriesKjPerDay">
-      <el-input v-model="form.caloriesKjPerDay" placeholder="请输入所需热量" />
-    </el-form-item>
-    <el-form-item label="蛋白质热量占比" prop="proteinCaloriePercentage">
-      <el-input v-model="form.proteinCaloriePercentage" placeholder="请输入蛋白质热量占比" />
-    </el-form-item>
-    <el-form-item label="脂肪热量占比" prop="fatCaloriePercentage">
-      <el-input v-model="form.fatCaloriePercentage" placeholder="请输入脂肪热量占比" />
-    </el-form-item>
-    <el-form-item label="碳水化合物热量占比" prop="carbohydrateCaloriePercentage">
-      <el-input v-model="form.carbohydrateCaloriePercentage" placeholder="请输入碳水化合物热量占比" />
-    </el-form-item>
-    <el-form-item label="所需蛋白质" prop="proteinGPerKgDay">
-      <el-input v-model="form.proteinGPerKgDay" placeholder="请输入所需蛋白质" />
-    </el-form-item>
-    <el-form-item label="所需蛋白质" prop="proteinGPerDay">
-      <el-input v-model="form.proteinGPerDay" placeholder="请输入所需蛋白质" />
-    </el-form-item>
-    <el-form-item label="所需脂肪" prop="fatGPerKgDay">
-      <el-input v-model="form.fatGPerKgDay" placeholder="请输入所需脂肪" />
-    </el-form-item>
-    <el-form-item label="所需脂肪" prop="fatGPerDay">
-      <el-input v-model="form.fatGPerDay" placeholder="请输入所需脂肪" />
-    </el-form-item>
-    <el-form-item label="所需碳水化合物" prop="carbohydrateGPerKgDay">
-      <el-input v-model="form.carbohydrateGPerKgDay" placeholder="请输入所需碳水化合物" />
-    </el-form-item>
-    <el-form-item label="所需碳水化合物" prop="carbohydrateGPerDay">
-      <el-input v-model="form.carbohydrateGPerDay" placeholder="请输入所需碳水化合物" />
-    </el-form-item>
-    <el-form-item label="钙" prop="calcium">
-      <el-input v-model="form.calcium" placeholder="请输入钙" />
-    </el-form-item>
-    <el-form-item label="钾" prop="potassium">
-      <el-input v-model="form.potassium" placeholder="请输入钾" />
-    </el-form-item>
-    <el-form-item label="钠" prop="sodium">
-      <el-input v-model="form.sodium" placeholder="请输入钠" />
-    </el-form-item>
-    <el-form-item label="镁" prop="magnesium">
-      <el-input v-model="form.magnesium" placeholder="请输入镁" />
-    </el-form-item>
-    <el-form-item label="磷" prop="phosphorus">
-      <el-input v-model="form.phosphorus" placeholder="请输入磷" />
-    </el-form-item>
-    <el-form-item label="氯" prop="chloride">
-      <el-input v-model="form.chloride" placeholder="请输入氯" />
-    </el-form-item>
-    <el-form-item label="铁" prop="iron">
-      <el-input v-model="form.iron" placeholder="请输入铁" />
-    </el-form-item>
-    <el-form-item label="硒" prop="selenium">
-      <el-input v-model="form.selenium" placeholder="请输入硒" />
-    </el-form-item>
-    <el-form-item label="锰" prop="manganese">
-      <el-input v-model="form.manganese" placeholder="请输入锰" />
-    </el-form-item>
-    <el-form-item label="氟" prop="fluoride">
-      <el-input v-model="form.fluoride" placeholder="请输入氟" />
-    </el-form-item>
-    <el-form-item label="钼" prop="molybdenum">
-      <el-input v-model="form.molybdenum" placeholder="请输入钼" />
-    </el-form-item>
-    <el-form-item label="锌" prop="zinc">
-      <el-input v-model="form.zinc" placeholder="请输入锌" />
-    </el-form-item>
-    <el-form-item label="铜" prop="copper">
-      <el-input v-model="form.copper" placeholder="请输入铜" />
-    </el-form-item>
-    <el-form-item label="碘" prop="iodine">
-      <el-input v-model="form.iodine" placeholder="请输入碘" />
-    </el-form-item>
-    <el-form-item label="铬" prop="chromium">
-      <el-input v-model="form.chromium" placeholder="请输入铬" />
-    </el-form-item>
-    <el-form-item label="维生素A" prop="vitaminA">
-      <el-input v-model="form.vitaminA" placeholder="请输入维生素A" />
-    </el-form-item>
-    <el-form-item label="维生素D" prop="vitaminD">
-      <el-input v-model="form.vitaminD" placeholder="请输入维生素D" />
-    </el-form-item>
-    <el-form-item label="维生素E" prop="vitaminE">
-      <el-input v-model="form.vitaminE" placeholder="请输入维生素E" />
-    </el-form-item>
-    <el-form-item label="维生素K" prop="vitaminK">
-      <el-input v-model="form.vitaminK" placeholder="请输入维生素K" />
-    </el-form-item>
-    <el-form-item label="维生素B1" prop="vitaminBOne">
-      <el-input v-model="form.vitaminBOne" placeholder="请输入维生素B1" />
-    </el-form-item>
-    <el-form-item label="维生素B2" prop="vitaminBTwo">
-      <el-input v-model="form.vitaminBTwo" placeholder="请输入维生素B2" />
-    </el-form-item>
-    <el-form-item label="维生素B6" prop="vitaminBSix">
-      <el-input v-model="form.vitaminBSix" placeholder="请输入维生素B6" />
-    </el-form-item>
-    <el-form-item label="维生素B12" prop="vitaminBTwelve">
-      <el-input v-model="form.vitaminBTwelve" placeholder="请输入维生素B12" />
-    </el-form-item>
-    <el-form-item label="烟酸" prop="niacin">
-      <el-input v-model="form.niacin" placeholder="请输入烟酸" />
-    </el-form-item>
-    <el-form-item label="维生素C" prop="vitaminC">
-      <el-input v-model="form.vitaminC" placeholder="请输入维生素C" />
-    </el-form-item>
-    <el-form-item label="叶酸" prop="folicAcid">
-      <el-input v-model="form.folicAcid" placeholder="请输入叶酸" />
-    </el-form-item>
-    <el-form-item label="胆碱" prop="choline">
-      <el-input v-model="form.choline" placeholder="请输入胆碱" />
-    </el-form-item>
-    <el-form-item label="生物素" prop="biotin">
-      <el-input v-model="form.biotin" placeholder="请输入生物素" />
-    </el-form-item>
-    <el-form-item label="泛酸" prop="pantothenicAcid">
-      <el-input v-model="form.pantothenicAcid" placeholder="请输入泛酸" />
-    </el-form-item>
-    <el-form-item label="膳食纤维" prop="dietaryFiber">
-      <el-input v-model="form.dietaryFiber" placeholder="请输入膳食纤维" />
-    </el-form-item>
-    <el-form-item label="患者id" prop="patientId">
-      <el-input v-model="form.patientId" placeholder="请输入患者id" />
-    </el-form-item>
-    <el-form-item label="科室" prop="deptId">
-      <el-input v-model="form.deptId" placeholder="请输入科室" />
-    </el-form-item>
-    <el-form-item label="门诊号" prop="outpatientNo">
-      <el-input v-model="form.outpatientNo" placeholder="请输入门诊号" />
-    </el-form-item>
-    <template>
-      <div class="dialog-footer">
-        <el-button :loading="buttonLoading" type="primary" @click="() => submitForm()">确 定</el-button>
-        <el-button @click="() => cancel()">取 消</el-button>
-      </div>
-    </template>
-  </el-form>
+    <div class="page-current">
+        <el-button type="primary" @click="onBack">返回</el-button>
+    </div>
+    <div class="question-main">
+        <!-- 顶部信息区(完全还原图片样式) -->
+        <div class="info-card info-card-bee">
+            <div class="info-title">
+                <span class="bee-title">{{ title }}</span>
+            </div>
+            <el-row :gutter="20" align="middle" class="info-row">
+                <el-col :span="2"><span>性别:</span>{{ form.gender }}</el-col>
+                <el-col :span="2"><span>年龄:</span>{{ form.age }}</el-col>
+                <el-col :span="2"><span class="required">*</span><span>BMI:{{ form.bmi }}</span></el-col>
+                <el-col :span="4"><span class="required">*</span><span>身高:</span>
+                    <el-input v-model="form.height" style="width: 120px;" /> <span>cm</span></el-col>
+                <el-col :span="4"><span class="required">*</span><span>体力活动:</span>
+                    <el-select v-model="form.activity" style="width: 150px;">
+                        <el-option v-for="dict in physical_activity" :key="dict.value" :label="dict.label" :value="dict.value" />
+                    </el-select>
+                </el-col>
+                <el-col :span="4" v-if="title === 'BEE'"><span class="required">*</span><span>应激状态:</span>
+                    <el-select v-model="form.stressType" style="width: 150px;">
+                        <el-option v-for="dict in stress_level" :key="dict.value" :label="dict.label" :value="dict.value" />
+                    </el-select>
+                </el-col>
+                <el-col :span="3" v-if="title === '烧伤公式'"><span>烧伤面积:</span>
+                    <el-input v-model="form.burnArea" style="width: 120px;" /> <span>%</span>
+                </el-col>
+                <el-col :span="3"><span>体重:</span>
+                    <el-input v-model="form.weight" style="width: 120px;" /> <span>kg</span>
+                </el-col>
+                <el-col :span="3"><span>上臂围:</span>
+                    <el-input v-model="form.armCircumference" style="width: 120px;" /> <span>cm</span>
+                </el-col>
+            </el-row>
+            <el-row style="margin-top: 10px;">
+                <el-col :span="3"><span>小腿围:</span>
+                    <el-input v-model="form.calfCircumference" style="width: 120px;" /> <span>cm</span>
+                </el-col>
+                <el-col :span="20" style="text-align:right;">
+                    <el-button type="primary" class="recalc-btn" @click="recalculate">重新计算</el-button>
+                </el-col>
+            </el-row>
+        </div>
+        <!-- 警示提示区 -->
+        <div class="tips-box">
+            注:常量元素、微量元素、维生素、氨基酸、脂肪酸、膳食纤维默认为DRIS数据,如有必要请自行修改。
+        </div>
+        <div v-show="showFlag=='true'">
+            <el-form label-position="right" label-width="170px">
+
+                <!-- 能量及三大营养素 -->
+                <div class="group-card">
+
+                    <div class="group-title">能量及三大营养素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="所需热量:" class="right-label">
+                                <el-input v-model="form.caloriesKcalPerDay" style="width: 200px;" />
+                                <span class="unit">kcal/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需热量:" class="right-label">
+                                <span>{{ form.caloriesKcalPerKgDay }}</span>
+                                <span class="unit">kcal/kg·d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需热量:" class="right-label">
+                                <span>{{form.caloriesKjPerDay}}</span>
+                                <span class="unit">kJ/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="蛋白质热量占比:" class="right-label">
+                                <el-input v-model="form.proteinCaloriePercentage" style="width: 200px;" />
+                                <span class="unit">%</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需蛋白质:" class="right-label">
+                                <span>{{ form.proteinGPerKgDay }}</span>
+                                <span class="unit">g/kg·d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需蛋白质:" class="right-label">
+                                <span>{{ form.proteinGPerDay }}</span>
+                                <span class="unit">g/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="脂肪热量占比:" class="right-label">
+                                <el-input v-model="form.fatCaloriePercentage" style="width: 200px;" />
+                                <span class="unit">%</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需脂肪:" class="right-label">
+                                <span>{{ form.fatGPerKgDay }}</span>
+                                <span class="unit">g/kg·d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需脂肪:" class="right-label">
+                                <span>{{ form.fatGPerDay }}</span>
+                                <span class="unit">g/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="碳水化合物热量占比:" class="right-label">
+                                <el-input v-model="form.carbohydrateCaloriePercentage" style="width: 200px;" />
+                                <span class="unit">%</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需碳水化合物:" class="right-label">
+                                <el-input v-model="form.carbohydrateGPerKgDay" style="width: 200px;" />
+                                <span class="unit">g/kg·d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="所需碳水化合物:" class="right-label">
+                                <el-input v-model="form.carbohydrateGPerDay" style="width: 200px;" />
+                                <span class="unit">g/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+
+                </div>
+                <!-- 常量元素 -->
+                <div class="group-card">
+                    <div class="group-title">常量元素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="钙:" class="right-label">
+                                <el-input v-model="form.calcium" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="磷:" class="right-label">
+                                <el-input v-model="form.phosphorus" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="钾:" class="right-label">
+                                <el-input v-model="form.potassium" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="钠:" class="right-label">
+                                <el-input v-model="form.sodium" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="镁:" class="right-label">
+                                <el-input v-model="form.magnesium" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="氯:" class="right-label">
+                                <el-input v-model="form.chloride" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+
+                    </el-row>
+
+                </div>
+                <!-- 微量元素 -->
+                <div class="group-card">
+                    <div class="group-title">微量元素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="铁:" class="right-label">
+                                <el-input v-model="form.iron" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="锌:" class="right-label">
+                                <el-input v-model="form.zinc" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="硒:" class="right-label">
+                                <el-input v-model="form.selenium" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="铜:" class="right-label">
+                                <el-input v-model="form.copper" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="锰:" class="right-label">
+                                <el-input v-model="form.manganese" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="碘:" class="right-label">
+                                <el-input v-model="form.iodine" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="氟:" class="right-label">
+                                <el-input v-model="form.fluoride" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="铬:" class="right-label">
+                                <el-input v-model="form.chromium" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="钼:" class="right-label">
+                                <el-input v-model="form.molybdenum" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+                <!-- 脂溶性维生素 -->
+                <div class="group-card">
+                    <div class="group-title">脂溶性维生素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="维生素A:" class="right-label">
+                                <el-input v-model="form.vitaminA" style="width: 200px;" />
+                                <span class="unit">μgRAE/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                        <el-col :span="8">
+                            <el-form-item label="维生素D:" class="right-label">
+                                <el-input v-model="form.vitaminD" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素E:" class="right-label">
+                                <el-input v-model="form.vitaminE" style="width: 200px;" />
+                                <span class="unit">mgα-TE/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="维生素K:" class="right-label">
+                                <el-input v-model="form.vitaminK" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+                <!-- 水溶性维生素 -->
+                <div class="group-card">
+                    <div class="group-title">水溶性维生素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="维生素B1:" class="right-label">
+                                <el-input v-model="form.vitaminBOne" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素B2:" class="right-label">
+                                <el-input v-model="form.vitaminBTwo" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素B6:" class="right-label">
+                                <el-input v-model="form.vitaminBSix" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="维生素B12:" class="right-label">
+                                <el-input v-model="form.vitaminBTwelve" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="烟酸(尼克酸):" class="right-label">
+                                <el-input v-model="form.niacin" style="width: 200px;" />
+                                <span class="unit">mgNE/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素C:" class="right-label">
+                                <el-input v-model="form.vitaminC" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="叶酸:" class="right-label">
+                                <el-input v-model="form.folicAcid" style="width: 200px;" />
+                                <span class="unit">μgDFE/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="生物素:" class="right-label">
+                                <el-input v-model="form.biotin" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="胆碱:" class="right-label">
+                                <el-input v-model="form.choline" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="泛酸:" class="right-label">
+                                <el-input v-model="form.pantothenicAcid" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                </div>
+                <!-- 其他 -->
+                <div class="group-card">
+                    <div class="group-title">其他</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="膳食纤维:" class="right-label">
+                                <el-input v-model="form.dietaryFiber" style="width: 200px;" />
+                                <span class="unit">g/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+            </el-form>
+        </div>
+
+    </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
-import { addSetting, updateSetting } from '@/api/patients/nutritionSetting';
-import type { FormInstance } from 'element-plus';
-
-// 接收父组件传递的参数
-const props = defineProps({
-  form: {
-    type: Object,
-    required: true
-  },
-  rules: {
-    type: Object,
-    required: true
-  },
-  buttonLoading: {
-    type: Boolean,
-    required: true
-  },
-  submitForm: {
-    type: Function,
-    required: true
-  },
-  cancel: {
-    type: Function,
-    required: true
-  }
-});
-
-// 表单ref
-const NutritionSettingFormRef = ref<FormInstance>();
-
-// 新增
-const handleAdd = async () => {
-  await addSetting({ ...props.form });
-};
-// 更新
-const handleUpdate = async () => {
-  await updateSetting({ ...props.form });
-};
+    import { ref } from 'vue';
+    import { addSetting, updateSetting, recalculateValue } from '@/api/patients/nutritionSetting';
+    import type { FormInstance } from 'element-plus';
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+    const { physical_activity, stress_level } = toRefs(proxy ?.useDict('physical_activity', 'stress_level'));
+
+
+    const props = defineProps({
+        form: { type: Object, required: true },
+        rules: { type: Object, required: true },
+        buttonLoading: { type: Boolean, required: true },
+        submitForm: { type: Function, required: true },
+        cancel: { type: Function, required: true },
+        handleCancel: { type: Function, required: true },
+        title: { type: String }
+    });
+    const { handleCancel, form } = props;
+    const { title } = toRefs(props);
+    const showFlag = ref('false');
+    const NutritionSettingFormRef = ref < FormInstance > ();
+    const handleAdd = async () => { await addSetting({ ...form }); };
+    const handleUpdate = async () => { await updateSetting({ ...form }); };
+
+    const recalculateValue = async () => {
+        // 重新计算逻辑预留
+        showFlag.value = 'true';
+    }
+    const onBack = () => {
+        showFlag.value = 'false';
+        handleCancel();
+    };
 </script>
+
+<style scoped>
+    .page-current {
+        display: flex;
+        align-items: center;
+        padding: 20px;
+        background: #fff;
+        border-bottom: 1px solid #e6e6e6;
+    }
+
+    .question-main {
+        padding: 20px 0 100px;
+    }
+
+    .info-card-bee {
+        margin-bottom: 16px;
+        background: #f8fafc;
+        border-radius: 8px;
+        box-shadow: 0 2px 8px #f0f1f2;
+        padding: 18px 24px 10px 24px;
+        border: none;
+    }
+
+    .info-title {
+        font-weight: bold;
+        font-size: 16px;
+        color: #409EFF;
+        margin-bottom: 8px;
+        padding-left: 2px;
+    }
+
+    .bee-title {
+        border-left: 4px solid #409EFF;
+        padding-left: 8px;
+        font-size: 16px;
+        font-weight: bold;
+        color: #409EFF;
+    }
+
+    .info-row {
+        background: #f8fafc;
+        font-size: 16px;
+        padding: 0 0 0 0;
+        margin: 0;
+    }
+
+    .required {
+        color: #f56c6c;
+        margin-right: 2px;
+    }
+
+    .recalc-btn {
+        margin-left: 12px;
+    }
+
+    .tips-box {
+        color: #ff5e4c;
+        margin: 16px 0;
+        font-size: 14px;
+    }
+
+    .group-card {
+        background: #fff;
+        border-radius: 8px;
+        margin-bottom: 24px;
+        box-shadow: 0 2px 8px #f0f1f2;
+        padding: 16px 24px;
+    }
+
+    .group-title {
+        background: #f5f7fa;
+        padding: 8px 16px;
+        font-weight: bold;
+        border-radius: 4px;
+        margin-bottom: 16px;
+        font-size: 16px;
+    }
+
+    .unit {
+        margin-left: 4px;
+        color: #888;
+    }
+
+    .right-label .el-form-item__label {
+        text-align: right !important;
+        justify-content: flex-end;
+        display: flex;
+    }
+
+    ::v-deep .el-form-item__label {
+        text-align: right !important;
+        justify-content: flex-end;
+        display: flex;
+    }
+</style>

+ 20 - 8
src/views/patients/nutritionSetting/index.vue

@@ -14,7 +14,7 @@
                                 </el-select>
                             </el-form-item>
                             <el-form-item label="营养设定方式:">
-                                <el-select v-model="queryParams.type" class="spec-unit-select">
+                                <el-select v-model="queryParams.settingType" class="spec-unit-select">
                                     <el-option v-for="dict in nutrition_setting_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                                 </el-select>
                             </el-form-item>
@@ -76,25 +76,25 @@
             <el-dialog :title="'选择营养设定'" v-model="dialog.visible" width="737px" append-to-body :close-on-click-modal="false" :show-close="true" class="nutrition-setting-dialog">
                 <el-row :gutter="20" style="margin-bottom: 10px;">
                     <el-col :span="12">
-                        <el-button :class="['setting-type-btn', form.settingType === '1' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('1')">BEE</el-button>
+                        <el-button :class="['setting-type-btn', form.settingType === '1' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('1', 'BEE')">BEE</el-button>
                     </el-col>
                     <el-col :span="12">
-                        <el-button :class="['setting-type-btn', form.settingType === '2' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('2')">DRIS</el-button>
+                        <el-button :class="['setting-type-btn', form.settingType === '2' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('2', 'DRIS')">DRIS</el-button>
                     </el-col>
                 </el-row>
                 <el-row :gutter="20">
                     <el-col :span="12">
-                        <el-button :class="['setting-type-btn', form.settingType === '3' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('3')">拇指测法</el-button>
+                        <el-button :class="['setting-type-btn', form.settingType === '3' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('3','拇指测法')">拇指测法</el-button>
                     </el-col>
                     <el-col :span="12">
-                        <el-button :class="['setting-type-btn', form.settingType === '4' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('4')">烧伤公式</el-button>
+                        <el-button :class="['setting-type-btn', form.settingType === '4' ? 'active' : '']" style="width: 100%; height: 46px;" @click="handleSelectSettingType('4','烧伤公式')">烧伤公式</el-button>
                     </el-col>
                 </el-row>
             </el-dialog>
         </div>
         <div v-show="type=='addForm'">
             <!-- 添加或修改营养设定对话框 -->
-            <add-form :form="form" :rules="rules" :buttonLoading="buttonLoading" :submitForm="submitForm" :cancel="cancel" />
+            <add-form :form="form" :rules="rules" :buttonLoading="buttonLoading" :submitForm="submitForm" :cancel="cancel" :handleCancel="handleCancel" :title="title"/>
         </div>
     </div>
 </template>
@@ -116,6 +116,7 @@
     const multiple = ref(true);
     const total = ref(0);
     const type = ref('list');
+    const title= ref('');
 
     const queryFormRef = ref < ElFormInstance > ();
     const NutritionSettingFormRef = ref < ElFormInstance > ();
@@ -189,6 +190,14 @@
         deptId: props.patientInfo ?.deptId,
         deptName: undefined,
         outpatientNo: props.patientInfo ?.outpatientNo,
+        BMI: props.patientInfo ?.bmi,
+        height: props.patientInfo ?.height,
+        weight: props.patientInfo ?.weight,
+        activity: props.patientInfo ?.activity,
+        stressType: undefined,
+        highHip: undefined,
+        lowHip: undefined,
+        burnArea: undefined, // 燃烧面积
     }
     const data = reactive < PageData < NutritionSettingForm,
         NutritionSettingQuery >> ({
@@ -223,9 +232,9 @@
         loading.value = false;
     }
 
-    const handleSelectSettingType = (settingType) => {
+    const handleSelectSettingType = (settingType,typeName) => {
         form.value.settingType = settingType;
-        
+        title.value = typeName;
         dialog.visible = false;
         // 切换到表单填写界面
         nextTick(() => {
@@ -238,6 +247,9 @@
         reset();
         dialog.visible = false;
     }
+       const handleCancel = () => {
+        type.value = 'list';
+    };
 
     /** 表单重置 */
     const reset = () => {