|
@@ -1,209 +1,415 @@
|
|
|
<template>
|
|
|
<div style="overflow-y: scroll;" :style=divStyle>
|
|
|
- <el-card shadow="always">
|
|
|
- <el-button type="primary" plain size="large" @click="close()">返回</el-button>
|
|
|
- <span style="margin-left: 20px;">{{isView?'查看食谱':form.foodIngredientId?'编辑食谱':'食谱管理'}}</span>
|
|
|
- <el-divider />
|
|
|
+ <el-card shadow="always">
|
|
|
+ <el-button type="primary" plain size="large" @click="close()">返回</el-button>
|
|
|
+ <span style="margin-left: 20px;">{{ isView ? '查看食谱' : form.foodIngredientId ? '编辑食谱' : '食谱管理' }}</span>
|
|
|
+ <el-divider />
|
|
|
<div style="font-size: 14px; margin-top: -10px;margin-bottom: -10px;">基本信息</div>
|
|
|
<el-divider />
|
|
|
- <div width="1024px" >
|
|
|
+ <div width="1024px">
|
|
|
<el-form ref="foodIngredientFormRef" :model="form" :rules="rules" append-to-body label-width="130px">
|
|
|
- <el-row style="margin-top: 20px;">
|
|
|
+ <el-row style="margin-top: 20px;">
|
|
|
<el-col :span="24" style="margin-left: 100px;">
|
|
|
- <div><span style="color: red;"> </span></div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ <div><span style="color: red;"> </span></div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" style="margin-left: -100px;">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="基本膳食" prop="baseDiet">
|
|
|
+ <el-form-item label="基本膳食" prop="baseDiet">
|
|
|
<el-radio-group v-model="form.baseDiet">
|
|
|
- <el-radio v-for="item in dietary_types" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-radio v-for="item in dietary_types" :key="item.value" :label="item.value">{{ item.label
|
|
|
+ }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ </el-col>
|
|
|
<el-col :span="2">
|
|
|
- </el-col>
|
|
|
- <el-col :span="9">
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
- <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item label="餐次" prop="mealTime">
|
|
|
+ <el-checkbox-group v-model="form.mealTimes">
|
|
|
+ <el-checkbox v-for="item in meal_times" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-checkbox-group>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="餐次" prop="mealTime">
|
|
|
- <el-checkbox-group v-model="form.mealTimes">
|
|
|
- <el-checkbox v-for="item in meal_times" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-checkbox-group>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
- <el-col :span="9">
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
- <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" style="margin-left: -100px;">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="食谱名称" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入" :disabled="isView"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ <el-input v-model="form.name" placeholder="请输入" :disabled="isView" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="食谱分类" prop="edibleRatio">
|
|
|
- <el-select v-model="form.unit" placeholder="请选择" clearable :disabled="isView">
|
|
|
- <el-option v-for="dict in food_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ <el-form-item label="食谱分类" prop="categoryId">
|
|
|
+ <el-select v-model="form.categoryId" placeholder="请选择" clearable :disabled="isView">
|
|
|
+ <el-option v-for="dict in recipeCategoryList" :key="dict.recipeCategoryId" :label="dict.name"
|
|
|
+ :value="dict.recipeCategoryId"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
+ <el-row>
|
|
|
<el-col :span="2" style="margin-left: -100px;">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="食谱价格" prop="shelfLife">
|
|
|
- <el-input v-model="form.shelfLife" placeholder="请输入" :disabled="isView"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ <el-form-item label="食谱价格" prop="price">
|
|
|
+ <el-input v-model="form.price" placeholder="请输入" :disabled="isView" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="适用疾病" prop="stockWarning">
|
|
|
- <el-input v-model="form.stockWarning" placeholder="请输入" :disabled="isView"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ <el-form-item label="适用疾病" prop="suitableDisease">
|
|
|
+ <span style="width: 100%;" @click="openAvoidDiseaseDialog">
|
|
|
+ <el-input v-model="form.suitableDisease" placeholder="请选择" :disabled="isView" readonly>
|
|
|
+ <template #suffix>
|
|
|
+ <el-icon class="el-input__icon">
|
|
|
+ <ArrowDown />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
- <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" style="margin-left: -100px;">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
- <el-form-item label="忌食病症" prop="expiryWarning">
|
|
|
- <el-input v-model="form.expiryWarning" placeholder="请输入" :disabled="isView"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
- <el-col :span="9">
|
|
|
- <el-form-item label="适用科室" prop="expiryWarning">
|
|
|
- <el-input v-model="form.expiryWarning" placeholder="请输入" :disabled="isView"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
-
|
|
|
+ <el-form-item label="忌食病症" prop="avoidDisease">
|
|
|
+ <span style="width: 100%;" @click="openAvoidDiseaseDialog2">
|
|
|
+ <el-input v-model="form.avoidDisease" placeholder="请选择" :disabled="isView" readonly>
|
|
|
+ <template #suffix>
|
|
|
+ <el-icon class="el-input__icon">
|
|
|
+ <ArrowDown />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-input></span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item label="适用科室" prop="suitableDept">
|
|
|
+ <el-tree-select :disabled="isView" v-model="form.suitableDept" show-checkbox multiple
|
|
|
+ :default-expanded-keys="[2, 3]" :data="enabledDeptOptions"
|
|
|
+ :props="{ value: 'id', label: 'label', children: 'children' } as any" value-key="id"
|
|
|
+ placeholder="请选择" />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
+
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
- <el-col :span="2" style="margin-left: -100px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" style="margin-left: -100px;">
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="智能推荐" prop="smartRecommend">
|
|
|
- <el-radio-group v-model="form.smartRecommend" :disabled="isView">
|
|
|
- <el-radio v-for="item in intelligent_recommendation" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- </el-col>
|
|
|
+ <el-radio-group v-model="form.smartRecommend" :disabled="isView">
|
|
|
+ <el-radio v-for="item in intelligent_recommendation" :key="item.value" :label="item.value">{{
|
|
|
+ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-divider />
|
|
|
- <div style="font-size: 14px;margin-top: -10px;margin-bottom: -10px;">食材组成</div>
|
|
|
- <el-divider />
|
|
|
- <div style="margin-top: 10px; margin-bottom: 20px;"><span>食材总量:111.0000 g</span><span style="margin-left: 100px;">膳食总热量:410.70kcal</span></div>
|
|
|
- <el-table border :data="foodIngredientList" @selection-change="handleSelectionChange">
|
|
|
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
- <el-table-column label="食材名称" align="center" prop="bigCategory" />
|
|
|
- <el-table-column label="食材分类" align="center" prop="subCategory" />
|
|
|
- <el-table-column label="用量" align="center" prop="name" />
|
|
|
- <el-table-column label="热量(kcal)" align="center" prop="name" />
|
|
|
- <el-table-column label="备注" align="center" prop="name" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template #default="scope">
|
|
|
- <el-tooltip content="删除" placement="top">
|
|
|
- <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:foodIngredient:remove']">删除</el-button>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="8">
|
|
|
+ <el-divider />
|
|
|
+ <div style="font-size: 14px;margin-top: -10px;margin-bottom: -10px;">食材组成</div>
|
|
|
+ <el-divider />
|
|
|
+ <div style="margin-top: 10px; margin-bottom: 20px;"><span>食材总量:111.0000 g</span><span
|
|
|
+ style="margin-left: 100px;">膳食总热量:410.70kcal</span></div>
|
|
|
+ <el-table border :data="foodIngredientList" @selection-change="handleSelectionChange3">
|
|
|
+ <!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
+ <el-table-column label="食材名称" align="center" prop="bigCategory" />
|
|
|
+ <el-table-column label="食材分类" align="center" prop="subCategory" />
|
|
|
+ <el-table-column label="用量" align="center" prop="name" />
|
|
|
+ <el-table-column label="热量(kcal)" align="center" prop="name" />
|
|
|
+ <el-table-column label="备注" align="center" prop="name" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tooltip content="删除" placement="top">
|
|
|
+ <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:foodIngredient:remove']">删除</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="8">
|
|
|
</el-col>
|
|
|
<el-col :span="8" align="center" style="margin-top: 30PX;">
|
|
|
- <el-link type="primary" icon="Plus" @click="handleDelete()">添加食材</el-link>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- </el-col>
|
|
|
+ <el-link type="primary" icon="Plus" @click="handleDelete()">添加食材</el-link>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="制作方式" prop="description">
|
|
|
- <el-input v-model="form.description" type="textarea" placeholder="请输入" :disabled="isView" :rows="3" maxlength="3000" show-word-limit/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="制作方式" prop="cookingMethod">
|
|
|
+ <el-input v-model="form.cookingMethod" type="textarea" placeholder="请输入" :disabled="isView" :rows="3"
|
|
|
+ maxlength="3000" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
-
|
|
|
|
|
|
- <el-card shadow="always" class="card-footer" v-if="!isView">
|
|
|
+
|
|
|
+ <el-card shadow="always" class="card-footer" v-if="!isView">
|
|
|
<div>
|
|
|
- <el-button type="primary" size="large" plain @click="close" v-hasPermi="['system:hospital:add']">
|
|
|
- 营养数据分析
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" size="large" @click="submitForm" v-hasPermi="['system:hospital:add']">
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <el-button type="primary" size="large" plain @click="close" v-hasPermi="['system:hospital:add']">
|
|
|
+ 营养数据分析
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="large" @click="submitForm" v-hasPermi="['system:hospital:add']">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- 适用疾病对话框 -->
|
|
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" width="78%" append-to-body>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="24">
|
|
|
+ <!-- <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==1}">常见营养诊断</span>
|
|
|
+ <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==2}">ICD诊断</span>
|
|
|
+ <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==3}">营养诊断</span> -->
|
|
|
+ <span class="diagnosis-tag" :class="{ 'diagnosisActive': diseaseLabelQuery.category == item.value }"
|
|
|
+ v-for="item in disease_label" :key="item.value" @click="changeTag(item.value)">{{ item.label }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="labelCode">
|
|
|
+ <el-input v-model="diseaseLabelQuery.labelCode" placeholder="疾病名称/疾病编码" clearable />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="left">
|
|
|
+ <el-button type="primary" @click="getDiseaseLabelList">查询</el-button>
|
|
|
+ <el-button type="primary" @click="addDiseaseLabelDialog">新增疾病标签</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-table border stripe :data="diseaseLabelList" @selection-change="handleSelectionChange" ref="diseaseLabelRef" >
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="疾病/部位名称" align="center" prop="labelName" />
|
|
|
+ <el-table-column label="疾病/部位编码" align="center" prop="labelCode" />
|
|
|
+ <el-table-column label="所属分类" align="center" prop="categoryName" />
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-left: 10px;width: 100%;">
|
|
|
+ <pagination v-show="total > -1" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ layout="total, sizes, prev, pager, next" v-model:limit="queryParams.pageSize" @pagination="getDiseaseLabelList"
|
|
|
+ size="small" />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="right">
|
|
|
+ <div style="height: 100%;">
|
|
|
+ <el-table border :data="selecteddiseaseLabelList">
|
|
|
+ <el-table-column label="疾病/部位名称" align="center" prop="labelName" />
|
|
|
+ <el-table-column label="疾病/部位编码" align="center" prop="labelCode" />
|
|
|
+ <el-table-column label="所属分类" align="center" prop="categoryName" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tooltip content="删除" placement="top">
|
|
|
+ <el-button link type="danger" icon="Delete" @click="handleSelectedDelete(scope.row)">删除</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="left" style="margin-top: -40px;">
|
|
|
+ <span style="color: rgb(118, 180, 244);">已选:{{ selecteddiseaseLabelList.length }}项</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="24" align="center">
|
|
|
+ <el-button type="primary" @click="handleSelectedconfirm"> 确定 </el-button>
|
|
|
+ <el-button @click="dialog.visible=!dialog.visible"> 取消 </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 添加或修改疾病/部位标签对话框 -->
|
|
|
+ <!-- <el-dialog :title="diseaseLabelDialog.title" v-model="diseaseLabelDialog.visible" width="700px" append-to-body>
|
|
|
+ <el-form ref="diseaseLabelFormRef" :model="form" :rules="rules" label-width="150px">
|
|
|
+ <el-form-item label="疾病/部位名称" prop="labelName">
|
|
|
+ <el-input v-model="form.labelName" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属分类" prop="category">
|
|
|
+ <el-select v-model="form.category" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in disease_label" :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="疾病/部位编码" prop="labelCode">
|
|
|
+ <el-input v-model="form.labelCode" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog> -->
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 忌食病症 -->
|
|
|
+ <el-dialog :title="dialog2.title" v-model="dialog2.visible" width="78%" append-to-body>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="24">
|
|
|
+ <!-- <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==1}">常见营养诊断</span>
|
|
|
+ <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==2}">ICD诊断</span>
|
|
|
+ <span class="diagnosis-tag" :class="{'diagnosisActive':diseaseLabelQuery.category==3}">营养诊断</span> -->
|
|
|
+ <span class="diagnosis-tag" :class="{ 'diagnosisActive': diseaseLabelQuery.category == item.value }"
|
|
|
+ v-for="item in disease_label" :key="item.value" @click="changeTag(item.value)">{{ item.label }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="labelCode">
|
|
|
+ <el-input v-model="diseaseLabelQuery.labelCode" placeholder="疾病名称/疾病编码" clearable />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="left">
|
|
|
+ <el-button type="primary" @click="getDiseaseLabelList">查询</el-button>
|
|
|
+ <el-button type="primary">新增疾病标签</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-table border stripe :data="diseaseLabelList" @selection-change="handleSelection2Change" ref="diseaseLabel2Ref">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="疾病/部位名称" align="center" prop="labelName" />
|
|
|
+ <el-table-column label="疾病/部位编码" align="center" prop="labelCode" />
|
|
|
+ <el-table-column label="所属分类" align="center" prop="categoryName" />
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-left: 10px;width: 100%;">
|
|
|
+ <pagination v-show="total > -1" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ layout="total, sizes, prev, pager, next" v-model:limit="queryParams.pageSize" @pagination="getDiseaseLabelList"
|
|
|
+ size="small" />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="right">
|
|
|
+ <div style="height: 100%;">
|
|
|
+ <el-table border :data="selecteddiseaseLabel2List">
|
|
|
+ <el-table-column label="疾病/部位名称" align="center" prop="labelName" />
|
|
|
+ <el-table-column label="疾病/部位编码" align="center" prop="labelCode" />
|
|
|
+ <el-table-column label="所属分类" align="center" prop="categoryName" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tooltip content="删除" placement="top">
|
|
|
+ <el-button link type="danger" icon="Delete" @click="handleSelected2Delete(scope.row)">删除</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" align="left" style="margin-top: -40px;">
|
|
|
+ <span style="color: rgb(118, 180, 244);">已选:{{ selecteddiseaseLabel2List.length }}项</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="24" align="center">
|
|
|
+ <el-button type="primary" @click="handleSelected2confirm"> 确定 </el-button>
|
|
|
+ <el-button @click="dialog2.visible=!dialog2.visible"> 取消 </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name="FoodIngredient" lang="ts">
|
|
|
-import { listTree} from '@/api/system/foodCategory';
|
|
|
-
|
|
|
+<script setup name="FoodIngredient" lang="ts">
|
|
|
+import { listTree } from '@/api/system/foodCategory';
|
|
|
+import { listDiseaseLabel, getDiseaseLabel, delDiseaseLabel, addDiseaseLabel, updateDiseaseLabel } from '@/api/system/diseaseLabel';
|
|
|
+import { DiseaseLabelVO, DiseaseLabelQuery, DiseaseLabelForm } from '@/api/system/diseaseLabel/types';
|
|
|
import { listRecipe, getRecipe, delRecipe, addRecipe, updateRecipe } from '@/api/system/recipe';
|
|
|
import { RecipeVO, RecipeQuery, RecipeForm } from '@/api/system/recipe/types';
|
|
|
+import { listRecipeCategory, getRecipeCategory, delRecipeCategory, addRecipeCategory, updateRecipeCategory } from '@/api/system/recipeCategory';
|
|
|
+import { RecipeCategoryVO, RecipeCategoryQuery, RecipeCategoryForm } from '@/api/system/recipeCategory/types';
|
|
|
+import { DeptTreeVO } from '@/api/system/dept/types';
|
|
|
+import api from '@/api/system/user';
|
|
|
+import { View } from '@element-plus/icons-vue';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { intelligent_recommendation,meal_times,dietary_types } = toRefs<any>(proxy?.useDict('intelligent_recommendation','meal_times','dietary_types'));
|
|
|
+const { intelligent_recommendation, meal_times, dietary_types, disease_label } = toRefs<any>(
|
|
|
+ proxy?.useDict('intelligent_recommendation', 'meal_times', 'dietary_types', 'disease_label'));
|
|
|
+
|
|
|
|
|
|
-const recipeList = ref<RecipeVO[]>([]);
|
|
|
+const selecteddiseaseLabelList = ref<DiseaseLabelVO[]>([]);
|
|
|
+const selecteddiseaseLabel2List = ref<DiseaseLabelVO[]>([]);
|
|
|
+const selecteddiseaseLabelListBak = ref<DiseaseLabelVO[]>([]);
|
|
|
+const selecteddiseaseLabel2ListBak = ref<DiseaseLabelVO[]>([]);
|
|
|
+const diseaseLabelList = ref<DiseaseLabelVO[]>([]);
|
|
|
+const enabledDeptOptions = ref<DeptTreeVO[]>([]);
|
|
|
const buttonLoading = ref(false);
|
|
|
-const loading = ref(true);
|
|
|
-const showSearch = ref(true);
|
|
|
-const ids = ref<Array<string | number>>([]);
|
|
|
-const single = ref(true);
|
|
|
-const multiple = ref(true);
|
|
|
+const loading = ref(true);
|
|
|
const total = ref(0);
|
|
|
+const recipeCategoryList = ref<RecipeCategoryVO[]>([]);
|
|
|
+const diseaseLabelRef=ref<ElTableInstance>();
|
|
|
+const diseaseLabel2Ref=ref<ElTableInstance>();
|
|
|
|
|
|
const divStyle = ref({
|
|
|
height: '755px'
|
|
|
});
|
|
|
-
|
|
|
-const queryFormRef = ref<ElFormInstance>();
|
|
|
-const isView = ref<boolean>(false)
|
|
|
+
|
|
|
+const isView = ref<boolean>(false)
|
|
|
const route = useRoute();
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
@@ -211,13 +417,38 @@ const dialog = reactive<DialogOption>({
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+const diseaseLabelDialog = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+const diseaseLabelDialog2 = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
+const diseaseLabelQuery = ref<DiseaseLabelQuery>({
|
|
|
+ labelCode: undefined,
|
|
|
+ category: '1',
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+})
|
|
|
+
|
|
|
+const dialog2 = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
const initFormData: RecipeForm = {
|
|
|
recipeId: undefined,
|
|
|
name: undefined,
|
|
|
categoryId: undefined,
|
|
|
baseDiet: '1',
|
|
|
mealTime: undefined,
|
|
|
- price: undefined,
|
|
|
+ price: '0.00',
|
|
|
suitableDisease: undefined,
|
|
|
avoidDisease: undefined,
|
|
|
suitableDept: undefined,
|
|
@@ -226,7 +457,7 @@ const initFormData: RecipeForm = {
|
|
|
status: undefined,
|
|
|
}
|
|
|
const data = reactive<PageData<RecipeForm, RecipeQuery>>({
|
|
|
- form: {...initFormData},
|
|
|
+ form: { ...initFormData },
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
@@ -275,152 +506,199 @@ const close = () => {
|
|
|
};
|
|
|
proxy?.$tab.closeOpenPage(obj);
|
|
|
};
|
|
|
+
|
|
|
|
|
|
-const getListTree = async () => {
|
|
|
- const res = await listTree(queryParams.value);
|
|
|
- foodCategoryList.value = res.rows;
|
|
|
-}
|
|
|
-
|
|
|
-/** 查询食材管理列表 */
|
|
|
-const getList = async () => {
|
|
|
- const foodIngredientId = route.params && route.params.id;
|
|
|
- const vfoodIngredientId = route.params && route.params.vid;
|
|
|
- let id=undefined;
|
|
|
- if(vfoodIngredientId){
|
|
|
- isView.value=true;
|
|
|
- id=vfoodIngredientId;
|
|
|
- }else{
|
|
|
- isView.value=false ;
|
|
|
- id=foodIngredientId;
|
|
|
- }
|
|
|
-
|
|
|
- if (id&&id!='0') {
|
|
|
- loading.value = true;
|
|
|
- const res = await getFoodIngredient(id as string);
|
|
|
- Object.assign(form.value, res.data);
|
|
|
- form.value.foodCategoryIds=res.data.foodCategoryId.toString().split(',') ;
|
|
|
- console.log(form.value.foodCategoryIds)
|
|
|
- loading.value = false;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/** 取消按钮 */
|
|
|
-const cancel = () => {
|
|
|
- reset();
|
|
|
- dialog.visible = false;
|
|
|
-}
|
|
|
-
|
|
|
-/** 表单重置 */
|
|
|
-const reset = () => {
|
|
|
- form.value = {...initFormData};
|
|
|
- foodIngredientFormRef.value?.resetFields();
|
|
|
-}
|
|
|
-
|
|
|
-/** 搜索按钮操作 */
|
|
|
-const handleQuery = () => {
|
|
|
- queryParams.value.pageNum = 1;
|
|
|
- getList();
|
|
|
+/** 多选框选中数据 */
|
|
|
+const handleSelectionChange = (selection: DiseaseLabelVO[]) => {
|
|
|
+ selecteddiseaseLabelList.value = selection;
|
|
|
}
|
|
|
|
|
|
-/** 重置按钮操作 */
|
|
|
-const resetQuery = () => {
|
|
|
- queryFormRef.value?.resetFields();
|
|
|
- handleQuery();
|
|
|
-}
|
|
|
+const handleSelection2Change = (selection: DiseaseLabelVO[]) => {
|
|
|
+ selecteddiseaseLabel2List.value = selection;
|
|
|
+}
|
|
|
|
|
|
-/** 多选框选中数据 */
|
|
|
-const handleSelectionChange = (selection: FoodIngredientVO[]) => {
|
|
|
- ids.value = selection.map(item => item.foodIngredientId);
|
|
|
- single.value = selection.length != 1;
|
|
|
- multiple.value = !selection.length;
|
|
|
+const handleSelectedDelete = (row?: DiseaseLabelVO[]) => {
|
|
|
+ if (row) {
|
|
|
+ const tList = ref<DiseaseLabelVO[]>([]);
|
|
|
+ selecteddiseaseLabelList.value.forEach(item => {
|
|
|
+ if (item.labelId != row.labelId) {
|
|
|
+ tList.value.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ selecteddiseaseLabelList.value = tList.value;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-/** 新增按钮操作 */
|
|
|
-const handleAdd = () => {
|
|
|
- reset();
|
|
|
- dialog.visible = true;
|
|
|
- dialog.title = "添加食材管理";
|
|
|
+const handleSelected2Delete = (row?: DiseaseLabelVO[]) => {
|
|
|
+ if (row) {
|
|
|
+ const tList = ref<DiseaseLabelVO[]>([]);
|
|
|
+ selecteddiseaseLabel2List.value.forEach(item => {
|
|
|
+ if (item.labelId != row.labelId) {
|
|
|
+ tList.value.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ selecteddiseaseLabel2List.value = tList.value;
|
|
|
+ selecteddiseaseLabel2ListBak.value = tList.value;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-/** 修改按钮操作 */
|
|
|
-const handleUpdate = async (row?: FoodIngredientVO) => {
|
|
|
- reset();
|
|
|
- const _foodIngredientId = row?.foodIngredientId || ids.value[0]
|
|
|
- const res = await getFoodIngredient(_foodIngredientId);
|
|
|
- Object.assign(form.value, res.data);
|
|
|
- dialog.visible = true;
|
|
|
- dialog.title = "修改食材管理";
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
const submitForm = () => {
|
|
|
foodIngredientFormRef.value?.validate(async (valid: boolean) => {
|
|
|
if (valid) {
|
|
|
buttonLoading.value = true;
|
|
|
- let params=ref<FoodIngredientForm>({});
|
|
|
+ let params = ref<FoodIngredientForm>({});
|
|
|
Object.assign(params.value, form.value);
|
|
|
params.value.foodCategoryId = form.value.foodCategoryIds.join(',')
|
|
|
if (form.value.foodIngredientId) {
|
|
|
- await updateFoodIngredient(params.value).finally(() => buttonLoading.value = false);
|
|
|
+ await updateFoodIngredient(params.value).finally(() => buttonLoading.value = false);
|
|
|
} else {
|
|
|
- await addFoodIngredient(params.value).then(res=>{
|
|
|
- form.value.foodIngredientId=res.data;
|
|
|
- }).finally(() => buttonLoading.value = false);
|
|
|
+ await addFoodIngredient(params.value).then(res => {
|
|
|
+ form.value.foodIngredientId = res.data;
|
|
|
+ }).finally(() => buttonLoading.value = false);
|
|
|
}
|
|
|
- proxy?.$modal.msgSuccess("操作成功");
|
|
|
- if(currentIndex.value=='2'){
|
|
|
+ proxy?.$modal.msgSuccess("操作成功");
|
|
|
+ if (currentIndex.value == '2') {
|
|
|
close()
|
|
|
- }else{
|
|
|
- currentIndex.value='2';
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ currentIndex.value = '2';
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (row?: FoodIngredientVO) => {
|
|
|
- const _foodIngredientIds = row?.foodIngredientId || ids.value;
|
|
|
- await proxy?.$modal.confirm('是否确认删除食材管理编号为"' + _foodIngredientIds + '"的数据项?').finally(() => loading.value = false);
|
|
|
- await delFoodIngredient(_foodIngredientIds);
|
|
|
- proxy?.$modal.msgSuccess("删除成功");
|
|
|
- await getList();
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+/** 查询食谱管理列表 */
|
|
|
+const getRecipeCategoryList = async () => {
|
|
|
+ const queryParams = ref<RecipeCategoryQuery>({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ })
|
|
|
+ const res = await listRecipeCategory(queryParams.value);
|
|
|
+ recipeCategoryList.value = res.rows;
|
|
|
+}
|
|
|
+
|
|
|
+/** 查询科室下拉树结构 */
|
|
|
+const getDeptTree = async () => {
|
|
|
+ const res = await api.deptTreeSelect();
|
|
|
+ enabledDeptOptions.value = res.data;
|
|
|
+};
|
|
|
|
|
|
-/** 导出按钮操作 */
|
|
|
-const handleExport = () => {
|
|
|
- proxy?.download('system/foodIngredient/export', {
|
|
|
- ...queryParams.value
|
|
|
- }, `foodIngredient_${new Date().getTime()}.xlsx`)
|
|
|
+/** 查询疾病/部位标签列表 */
|
|
|
+const getDiseaseLabelList = async () => {
|
|
|
+ const res = await listDiseaseLabel(diseaseLabelQuery.value);
|
|
|
+ diseaseLabelList.value = res.rows;
|
|
|
+ total.value = res.total;
|
|
|
+ loading.value=true;
|
|
|
}
|
|
|
|
|
|
+const changeTag = async (tagVal: string) => {
|
|
|
+ diseaseLabelQuery.value.category = tagVal;
|
|
|
+ getDiseaseLabelList();
|
|
|
+}
|
|
|
|
|
|
-const handleSelect = (key: string, keyPath: string[]) => {
|
|
|
- currentIndex.value=key.toString()
|
|
|
- // console.log(key, keyPath,currentIndex)
|
|
|
+const openAvoidDiseaseDialog=async ()=>{
|
|
|
+ dialog.visible=true;
|
|
|
+ dialog.title='添加疾病标签';
|
|
|
+ diseaseLabelQuery.value.labelCode=''
|
|
|
+ diseaseLabelQuery.value.category=disease_label.value[0].value;
|
|
|
+ await getDiseaseLabelList();
|
|
|
+ if(selecteddiseaseLabelListBak.value&&selecteddiseaseLabelListBak.value.length>0){
|
|
|
+ let dataMap=ref({});
|
|
|
+ selecteddiseaseLabelListBak.value.forEach(item=>{
|
|
|
+ dataMap[item.labelId]=true;
|
|
|
+ });
|
|
|
+
|
|
|
+ diseaseLabelList.value.forEach(item=>{
|
|
|
+ if(dataMap[item.labelId]){
|
|
|
+ diseaseLabelRef.value.toggleRowSelection(item,true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const openAvoidDiseaseDialog2=async ()=>{
|
|
|
+ dialog2.visible=true;
|
|
|
+ dialog2.title='添加疾病标签';
|
|
|
+ diseaseLabelQuery.value.labelCode=''
|
|
|
+ diseaseLabelQuery.value.category=disease_label.value[disease_label.value.length -1].value;
|
|
|
+ await getDiseaseLabelList();
|
|
|
+ if(selecteddiseaseLabel2ListBak.value&&selecteddiseaseLabel2ListBak.value.length>0){
|
|
|
+ let dataMap=ref({});
|
|
|
+ selecteddiseaseLabel2ListBak.value.forEach(item=>{
|
|
|
+ dataMap[item.labelId]=true;
|
|
|
+ });
|
|
|
+
|
|
|
+ diseaseLabelList.value.forEach(item=>{
|
|
|
+ if(dataMap[item.labelId]){
|
|
|
+ diseaseLabel2Ref.value.toggleRowSelection(item,true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleSelectedconfirm=async ()=>{
|
|
|
+ dialog.visible=false;
|
|
|
+ form.value.suitableDisease=selecteddiseaseLabelList.value.map(v=>v.labelName).join(',')
|
|
|
+ selecteddiseaseLabelListBak.value = selecteddiseaseLabelList.value;
|
|
|
+}
|
|
|
+
|
|
|
+const handleSelected2confirm=async ()=>{
|
|
|
+ dialog2.visible=false;
|
|
|
+ form.value.avoidDisease=selecteddiseaseLabel2List.value.map(v=>v.labelName).join(',')
|
|
|
+ selecteddiseaseLabel2ListBak.value = selecteddiseaseLabel2List.value;
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getListTree()
|
|
|
- getList();
|
|
|
- let timerId=setInterval(() => {
|
|
|
- if(food_unit&&food_unit.value.length>0){
|
|
|
- form.value.unit=food_unit.value[0].value;
|
|
|
- clearInterval(timerId);
|
|
|
- }
|
|
|
- }, 300);
|
|
|
-
|
|
|
+ getDiseaseLabelList()
|
|
|
+ getDeptTree();
|
|
|
+ getRecipeCategoryList();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.card-footer{
|
|
|
- z-index: 99;
|
|
|
- bottom: 0px;
|
|
|
- left: calc(var(--left-menu-max-width) + var(--app-content-padding));
|
|
|
- right: 0px;
|
|
|
- height: 90px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
+.card-footer {
|
|
|
+ z-index: 99;
|
|
|
+ bottom: 0px;
|
|
|
+ left: calc(var(--left-menu-max-width) + var(--app-content-padding));
|
|
|
+ right: 0px;
|
|
|
+ height: 90px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.diagnosis-tag {
|
|
|
+ border-left: 1px solid #409EFF;
|
|
|
+ border-top: 1px solid #409EFF;
|
|
|
+ border-bottom: 1px solid #409EFF;
|
|
|
+ padding: 8px 8px;
|
|
|
+ color: #409EFF;
|
|
|
+ background: #f4f8ff;
|
|
|
+ display: inline-block;
|
|
|
+ width: 33.3%;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+
|
|
|
+.diagnosis-tag:last-child {
|
|
|
+ border-right: 1px solid #409EFF;
|
|
|
+}
|
|
|
+
|
|
|
+.diagnosisActive {
|
|
|
+ background: #409EFF;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.el-pagination__sizes {
|
|
|
+ width: 100px;
|
|
|
}
|
|
|
</style>
|