|
@@ -0,0 +1,1537 @@
|
|
|
+<template>
|
|
|
+ <div class="p-2">
|
|
|
+ <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
+ <div v-show="showSearch" class="mb-[10px]">
|
|
|
+ <el-card shadow="hover">
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
+ <el-form-item label="产品分类" prop="productCategory">
|
|
|
+ <el-cascader v-model="queryParams.productCategoryList" :options="categoryOptions" :props="{ checkStrictly: false, emitPath: true, value: 'value', label: 'label', children: 'children' }" placeholder="请选择" clearable filterable style="width: 200px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="queryParams.productName" placeholder="请输入名称/编码" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+
|
|
|
+ <el-card shadow="never">
|
|
|
+ <template #header>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:nutrition:add']">新增营养产品</el-button>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
+ <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['warehouse:nutrition:edit']">修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['warehouse:nutrition:remove']">删除</el-button>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['warehouse:nutrition:export']">导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" border :data="nutritionList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="产品名称" align="center" prop="productName" />
|
|
|
+ <el-table-column label="商品编码" align="center" prop="productCode" />
|
|
|
+ <el-table-column label="产品分类" align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ getCategoryName(row.productCategory) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="规格" align="center" prop="productSpec" />
|
|
|
+ <el-table-column label="剂型/形态" align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ dosage_form.find(item => item.value === row.dosageForm)?.label || row.dosageForm }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="许可证临期提醒" align="center" prop="productLicenseExpiry" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.productLicenseExpiry ? parseTime(scope.row.productLicenseExpiry, '{y}-{m}-{d}') : '--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="保质期临期提醒" align="center" prop="shelfLife" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.shelfLife || '--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="上架状态" align="center" prop="putFlag" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ put_flag.find(item => item.value === row.putFlag)?.label || row.putFlag }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button v-if="scope.row.putFlag === '1'" link type="danger" @click="handlePutFlag(scope.row, '0')">下架</el-button>
|
|
|
+ <el-button v-else link type="success" @click="handlePutFlag(scope.row, '1')">上架</el-button>
|
|
|
+ <el-button link type="primary" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
+ </el-card>
|
|
|
+ <!-- 添加或修改营养产品信息对话框 -->
|
|
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" width="70%" append-to-body class="nutrition-dialog">
|
|
|
+ <el-tabs v-model="activeTab">
|
|
|
+ <el-scrollbar height="calc(70vh - 120px)">
|
|
|
+ <el-tab-pane label="基本信息" name="basic">
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-divider content-position="left">基本信息:</el-divider>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品名称:" prop="productName">
|
|
|
+ <el-input v-model="form.productName" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品资质:" prop="productQualification">
|
|
|
+ <el-select v-model="form.productQualification" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in product_qualification" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="院方系统编码:" prop="hospitalSystemCode">
|
|
|
+ <el-input v-model="form.hospitalSystemCode" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="批准文号:" prop="approvalNumber">
|
|
|
+ <el-input v-model="form.approvalNumber" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品编码:" prop="productCode">
|
|
|
+ <el-input v-model="form.productCode" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="口味:" prop="taste">
|
|
|
+ <el-input v-model="form.taste" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品所属分类:" prop="productCategory">
|
|
|
+ <el-cascader v-model="form.productCategoryList" :options="categoryOptions" :props="{ checkStrictly: false, emitPath: true, value: 'value', label: 'label', children: 'children' }" placeholder="请选择" clearable filterable style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="剂型/形态:" prop="dosageForm">
|
|
|
+ <el-select v-model="form.dosageForm" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in dosage_form" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="生产厂商:" prop="manufacturer">
|
|
|
+ <el-select v-model="form.manufacturer" placeholder="请选择">
|
|
|
+ <el-option label="请选择" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="供应商:" prop="supplier">
|
|
|
+ <el-select v-model="form.supplier" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in product_supplier" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="品牌:" prop="brand">
|
|
|
+ <el-input v-model="form.brand" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品适用科室:" prop="applicableDepartment">
|
|
|
+ <el-select v-model="form.applicableDepartment" placeholder="请选择">
|
|
|
+ <el-option label="请选择" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品所属标签:" prop="productLabel">
|
|
|
+ <el-select v-model="form.productLabel" placeholder="请选择">
|
|
|
+ <el-option label="请选择" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="禁忌症所属标签:" prop="contraindicationLabel">
|
|
|
+ <el-select v-model="form.contraindicationLabel" placeholder="请选择">
|
|
|
+ <el-option label="请选择" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="许可证临期提醒:" prop="licenseExpiryReminder">
|
|
|
+ <el-input v-model="form.licenseExpiryReminder" placeholder="请输入">
|
|
|
+ <template #append>个月</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="保质期临期提醒:" prop="shelfLifeReminder">
|
|
|
+ <el-input v-model="form.shelfLifeReminder" placeholder="请输入">
|
|
|
+ <template #append>个月</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品许可证有效期至:" prop="productLicenseExpiry">
|
|
|
+ <el-date-picker v-model="form.productLicenseExpiry" type="date" placeholder="请选择" value-format="YYYY-MM-DD" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="保质期:" prop="shelfLife">
|
|
|
+ <el-input v-model="form.shelfLife" placeholder="请输入">
|
|
|
+ <template #append>个月</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 入货配置部分 -->
|
|
|
+ <el-divider content-position="left">入货信息:</el-divider>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="入货价格:" prop="purchasePrice" required>
|
|
|
+ <el-input v-model="form.purchasePrice" placeholder="请输入">
|
|
|
+ <template #append>元/盒</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="入货单位:" prop="purchaseUnit" required>
|
|
|
+ <el-select v-model="form.purchaseUnit" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品规格:" prop="productSpec" required>
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <el-input v-model="form.productSpec" placeholder="请输入" style="width: 500px; border-top-right-radius: 0; border-bottom-right-radius: 0;" :maxlength="10" />
|
|
|
+ <el-select v-model="form.productSpecUnit" style="width: 80px; border-radius: 0; border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0;" :popper-append-to-body="false" size="default" @change="onSpecUnitChange">
|
|
|
+ <el-option label="g" value="g" />
|
|
|
+ <el-option label="ml" value="ml" />
|
|
|
+ <el-option label="mg" value="mg" />
|
|
|
+ </el-select>
|
|
|
+ <span style="margin-left: 8px; color: #606266; font-size: 14px;">/包</span>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="预包装单位:" prop="packageUnit">
|
|
|
+ <el-select v-model="form.packageUnit" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">预包装销售设置:</el-divider>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="预包装销售价:" prop="packagePrice" required>
|
|
|
+ <el-input v-model="form.packagePrice" placeholder="请输入">
|
|
|
+ <template #append>元/盒</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="最小包装单位:" prop="minUnit">
|
|
|
+ <el-select v-model="form.minUnit" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="最小包装规格:" prop="minSpec">
|
|
|
+ <el-input v-model="form.minSpec" placeholder="请输入">
|
|
|
+ <template #append>g/包</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="净含量/规格:" prop="minUnit">
|
|
|
+ <span>--</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">配置销售设置::</el-divider>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="配置销售价格:" prop="configSalePrice" required>
|
|
|
+ <el-input v-model="form.configSalePrice" placeholder="请输入">
|
|
|
+ <template #append>元/g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="配置损耗率:" prop="configLossRate">
|
|
|
+ <el-input v-model="form.configLossRate" placeholder="请输入">
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="热能及三大营养素" name="nutrition">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 20px">注:每100(g/ml) 含量</span>
|
|
|
+
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="热量:" prop="calorie">
|
|
|
+ <el-input v-model="form.calorie" placeholder="请输入">
|
|
|
+ <template #append>kcal</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="蛋白质:" prop="protein">
|
|
|
+ <el-input v-model="form.protein" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="脂肪:" prop="fat">
|
|
|
+ <el-input v-model="form.fat" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="碳水化合物:" prop="carbohydrate">
|
|
|
+ <el-input v-model="form.carbohydrate" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="热能:" prop="heatEnergy">
|
|
|
+ <el-input v-model="form.heatEnergy" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="常量元素" name="macroElements">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="钙:" prop="ca">
|
|
|
+ <el-input v-model="form.ca" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="磷:" prop="p">
|
|
|
+ <el-input v-model="form.p" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="钾:" prop="k">
|
|
|
+ <el-input v-model="form.k" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="钠:" prop="na">
|
|
|
+ <el-input v-model="form.na" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="镁:" prop="mg">
|
|
|
+ <el-input v-model="form.mg" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="氯:" prop="cl">
|
|
|
+ <el-input v-model="form.cl" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="微量元素" name="microElements">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="铁:" prop="fe">
|
|
|
+ <el-input v-model="form.fe" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="锌:" prop="zn">
|
|
|
+ <el-input v-model="form.zn" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="硒:" prop="se">
|
|
|
+ <el-input v-model="form.se" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="铜:" prop="cu">
|
|
|
+ <el-input v-model="form.cu" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="锰:" prop="mn">
|
|
|
+ <el-input v-model="form.mn" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="碘:" prop="i">
|
|
|
+ <el-input v-model="form.i" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="氟:" prop="f">
|
|
|
+ <el-input v-model="form.f" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="铬:" prop="cr">
|
|
|
+ <el-input v-model="form.cr" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="钼:" prop="mo">
|
|
|
+ <el-input v-model="form.mo" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="氨基酸" name="aminoAcids">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="异亮氨酸:" prop="isoleucine">
|
|
|
+ <el-input v-model="form.isoleucine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="亮氨酸:" prop="leucine">
|
|
|
+ <el-input v-model="form.leucine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="赖氨酸:" prop="lysine">
|
|
|
+ <el-input v-model="form.lysine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="蛋氨酸:" prop="methionine">
|
|
|
+ <el-input v-model="form.methionine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="苯丙氨酸:" prop="phenylalanine">
|
|
|
+ <el-input v-model="form.phenylalanine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="苏氨酸:" prop="threonine">
|
|
|
+ <el-input v-model="form.threonine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="色氨酸:" prop="tryptophan">
|
|
|
+ <el-input v-model="form.tryptophan" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="缬氨酸:" prop="valine">
|
|
|
+ <el-input v-model="form.valine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="组氨酸:" prop="histidine">
|
|
|
+ <el-input v-model="form.histidine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="精氨酸:" prop="arginine">
|
|
|
+ <el-input v-model="form.arginine" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="脂肪酸" name="fattyAcids">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="饱和脂肪酸:" prop="saturatedFattyAcid">
|
|
|
+ <el-input v-model="form.saturatedFattyAcid" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="单不饱和脂肪酸:" prop="monounsaturatedFattyAcid">
|
|
|
+ <el-input v-model="form.monounsaturatedFattyAcid" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="多不饱和脂肪酸:" prop="polyunsaturatedFattyAcid">
|
|
|
+ <el-input v-model="form.polyunsaturatedFattyAcid" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="维生素" name="vitamins">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素A:" prop="vitaminA">
|
|
|
+ <el-input v-model="form.vitaminA" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素D:" prop="vitaminD">
|
|
|
+ <el-input v-model="form.vitaminD" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素E:" prop="vitaminE">
|
|
|
+ <el-input v-model="form.vitaminE" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素K:" prop="vitaminK">
|
|
|
+ <el-input v-model="form.vitaminK" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素B1:" prop="vitaminBOne">
|
|
|
+ <el-input v-model="form.vitaminBOne" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素B2:" prop="vitaminBTwo">
|
|
|
+ <el-input v-model="form.vitaminBTwo" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素B6:" prop="vitaminBSix">
|
|
|
+ <el-input v-model="form.vitaminBSix" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素B12:" prop="vitaminBTwelve">
|
|
|
+ <el-input v-model="form.vitaminBTwelve" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维生素C:" prop="vitaminC">
|
|
|
+ <el-input v-model="form.vitaminC" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="叶酸:" prop="folicAcid">
|
|
|
+ <el-input v-model="form.folicAcid" placeholder="请输入">
|
|
|
+ <template #append>μg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="脂类" name="lipids">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="胆固醇:" prop="cholesterol">
|
|
|
+ <el-input v-model="form.cholesterol" placeholder="请输入">
|
|
|
+ <template #append>mg</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="其他" name="others">
|
|
|
+ <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px" style="margin-top:20px">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="膳食纤维:" prop="dietaryFiber">
|
|
|
+ <el-input v-model="form.dietaryFiber" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="灰分:" prop="ash">
|
|
|
+ <el-input v-model="form.ash" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="不可溶性膳食纤维:" prop="insolubleDietaryFiber">
|
|
|
+ <el-input v-model="form.insolubleDietaryFiber" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="可溶性膳食纤维:" prop="solubleDietaryFiber">
|
|
|
+ <el-input v-model="form.solubleDietaryFiber" placeholder="请输入">
|
|
|
+ <template #append>g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="血糖生成指数:" prop="bloodGlucoseIndex">
|
|
|
+ <el-input v-model="form.bloodGlucoseIndex" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="渗透压:" prop="osmoticPressure">
|
|
|
+ <el-input v-model="form.osmoticPressure" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="商品说明" name="productDescription">
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
|
|
|
+
|
|
|
+ <el-row :gutter="20" style="margin-top:20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="适用人群:" prop="applicableCrowd">
|
|
|
+ <el-input v-model="form.applicableCrowd" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原料:" prop="storageConditions">
|
|
|
+ <el-input v-model="form.storageConditions" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="食用方法和食用量:" prop="usageAndDosage">
|
|
|
+ <el-input v-model="form.usageAndDosage" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="储存条件:" prop="storageConditions">
|
|
|
+ <el-input v-model="form.storageConditions" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="不适用人群:" prop="unsuitableCrowd">
|
|
|
+ <el-input v-model="form.unsuitableCrowd" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="渗透压:" prop="unsuitableCrowd">
|
|
|
+ <el-input v-model="form.unsuitableCrowd" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="适应症及禁忌:" prop="indicationsContraindications">
|
|
|
+ <el-input v-model="form.indicationsContraindications" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品特点:" prop="productFeatures">
|
|
|
+ <el-input v-model="form.productFeatures" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="警示说明及注意事项:" prop="warningInstructions">
|
|
|
+ <el-input v-model="form.warningInstructions" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="商品附件" name="productAttachments">
|
|
|
+ <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px" style="margin-top: 30px">
|
|
|
+ <el-form-item label="商品附件" prop="productAttachments">
|
|
|
+ <el-upload class="upload-demo" action="#" :auto-upload="false" :on-change="handleFileChange" :file-list="fileList" multiple>
|
|
|
+ <el-button type="primary">选择文件</el-button>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">支持上传jpg/png/pdf文件</div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-tabs>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="text-align: center">
|
|
|
+ <el-button type="primary" @click="submitForm">保存</el-button>
|
|
|
+ <el-button type="primary" @click="submitFormAndPutaway">保存并上架</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 新增详情弹窗,内容全部静态分组展示,仿照a1.png -->
|
|
|
+ <el-dialog title="营养产品详情" v-model="detailDialogVisible" width="60%" append-to-body class="nutrition-dialog">
|
|
|
+ <el-tabs v-model="activeTab">
|
|
|
+ <el-scrollbar height="calc(80vh - 120px)">
|
|
|
+ <el-tab-pane label="基本信息" name="basic">
|
|
|
+ <el-divider content-position="left">基本信息:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>产品名称:</b>{{ form.productName || '--' }}</div>
|
|
|
+ <div><b>院方系统编码:</b>{{ form.hospitalSystemCode || '--' }}</div>
|
|
|
+ <div><b>商品编码:</b>{{ form.productCode || '--' }}</div>
|
|
|
+ <div><b>产品所属分类:</b>{{ form.productCategory || '--' }}</div>
|
|
|
+ <div><b>生产厂商:</b>{{ form.manufacturer || '--' }}</div>
|
|
|
+ <div><b>品牌:</b>{{ form.brand || '--' }}</div>
|
|
|
+ <div><b>产品所属标签:</b>{{ form.productLabel || '--' }}</div>
|
|
|
+ <div><b>许可证临期提醒:</b>{{ form.licenseExpiryReminder || '--' }}</div>
|
|
|
+ <div><b>商品许可证有效期至:</b>{{ form.productLicenseExpiry || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>商品资质:</b>{{ form.productQualification || '--' }}</div>
|
|
|
+ <div><b>批准文号:</b>{{ form.approvalNumber || '--' }}</div>
|
|
|
+ <div><b>口味:</b>{{ form.taste || '--' }}</div>
|
|
|
+ <div><b>剂型/形态:</b>{{ form.dosageForm || '--' }}</div>
|
|
|
+ <div><b>供应商:</b>{{ form.supplier || '--' }}</div>
|
|
|
+ <div><b>产品适用科室:</b>{{ form.applicableDepartment || '--' }}</div>
|
|
|
+ <div><b>禁忌症所属标签:</b>{{ form.contraindicationLabel || '--' }}</div>
|
|
|
+ <div><b>保质期临期提醒:</b>{{ form.shelfLifeReminder || '--' }}</div>
|
|
|
+ <div><b>保质期:</b>{{ form.shelfLife || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">入货信息:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>入货价格:</b>{{ form.purchasePrice || '--' }} 元</div>
|
|
|
+ <div><b>默认入货单位:</b>{{ form.purchaseUnit || '--' }}</div>
|
|
|
+ <div><b>商品规格:</b>{{ form.productSpec || '--' }}/{{ form.productSpecUnit || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>入货单位:</b>{{ form.purchaseUnit || '--' }}</div>
|
|
|
+ <div><b>预包装单位:</b>{{ form.packageUnit || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">预包装销售设置:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>预包装销售价:</b>{{ form.packagePrice || '--' }} 元/袋</div>
|
|
|
+ <div><b>最小包装规格:</b>{{ form.minSpec || '--' }} g/包</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>最小包装单位:</b>{{ form.minUnit || '--' }}</div>
|
|
|
+ <div><b>净含量/规格:</b>{{ form.netContent || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">配置销售设置:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>配置销售价格:</b>{{ form.configSalePrice || '--' }} 元/g</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>配置损耗率:</b>{{ form.configLossRate || '--' }} %</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="热能及三大营养素" name="nutrition">
|
|
|
+ <el-divider content-position="left">热能及三大营养素:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>热量:</b>{{ form.calorie || '--' }} kcal</div>
|
|
|
+ <div><b>脂肪:</b>{{ form.fat || '--' }} g</div>
|
|
|
+ <div><b>热能:</b>{{ form.heatEnergy || '--' }} g</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>蛋白质:</b>{{ form.protein || '--' }} g</div>
|
|
|
+ <div><b>碳水化合物:</b>{{ form.carbohydrate || '--' }} g</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="常量元素" name="macroElements">
|
|
|
+ <el-divider content-position="left">常量元素:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>钙:</b>{{ form.ca || '--' }} mg</div>
|
|
|
+ <div><b>钾:</b>{{ form.k || '--' }} mg</div>
|
|
|
+ <div><b>镁:</b>{{ form.mg || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>磷:</b>{{ form.p || '--' }} mg</div>
|
|
|
+ <div><b>钠:</b>{{ form.na || '--' }} mg</div>
|
|
|
+ <div><b>氯:</b>{{ form.cl || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="微量元素" name="microElements">
|
|
|
+ <el-divider content-position="left">微量元素:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>铁:</b>{{ form.fe || '--' }} mg</div>
|
|
|
+ <div><b>硒:</b>{{ form.se || '--' }} μg</div>
|
|
|
+ <div><b>锰:</b>{{ form.mn || '--' }} mg</div>
|
|
|
+ <div><b>氟:</b>{{ form.f || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>锌:</b>{{ form.zn || '--' }} mg</div>
|
|
|
+ <div><b>铜:</b>{{ form.cu || '--' }} mg</div>
|
|
|
+ <div><b>碘:</b>{{ form.i || '--' }} μg</div>
|
|
|
+ <div><b>铬:</b>{{ form.cr || '--' }} μg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>钼:</b>{{ form.mo || '--' }} μg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="氨基酸" name="aminoAcids">
|
|
|
+ <el-divider content-position="left">氨基酸:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>异亮氨酸:</b>{{ form.isoleucine || '--' }} mg</div>
|
|
|
+ <div><b>赖氨酸:</b>{{ form.lysine || '--' }} mg</div>
|
|
|
+ <div><b>苯丙氨酸:</b>{{ form.phenylalanine || '--' }} mg</div>
|
|
|
+ <div><b>组氨酸:</b>{{ form.histidine || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>亮氨酸:</b>{{ form.leucine || '--' }} mg</div>
|
|
|
+ <div><b>蛋氨酸:</b>{{ form.methionine || '--' }} mg</div>
|
|
|
+ <div><b>苏氨酸:</b>{{ form.threonine || '--' }} mg</div>
|
|
|
+ <div><b>精氨酸:</b>{{ form.arginine || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>色氨酸:</b>{{ form.tryptophan || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>缬氨酸:</b>{{ form.valine || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="脂肪酸" name="fattyAcids">
|
|
|
+ <el-divider content-position="left">脂肪酸:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>饱和脂肪酸:</b>{{ form.saturatedFattyAcid || '--' }} g</div>
|
|
|
+ <div><b>多不饱和脂肪酸:</b>{{ form.polyunsaturatedFattyAcid || '--' }} g</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>单不饱和脂肪酸:</b>{{ form.monounsaturatedFattyAcid || '--' }} g</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="维生素" name="vitamins">
|
|
|
+ <el-divider content-position="left">维生素:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>维生素A:</b>{{ form.vitaminA || '--' }} μg</div>
|
|
|
+ <div><b>维生素E:</b>{{ form.vitaminE || '--' }} mg</div>
|
|
|
+ <div><b>维生素B1:</b>{{ form.vitaminBOne || '--' }} mg</div>
|
|
|
+ <div><b>维生素B6:</b>{{ form.vitaminBSix || '--' }} mg</div>
|
|
|
+ <div><b>维生素C:</b>{{ form.vitaminC || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>维生素D:</b>{{ form.vitaminD || '--' }} μg</div>
|
|
|
+ <div><b>维生素K:</b>{{ form.vitaminK || '--' }} μg</div>
|
|
|
+ <div><b>维生素B2:</b>{{ form.vitaminBTwo || '--' }} mg</div>
|
|
|
+ <div><b>维生素B12:</b>{{ form.vitaminBTwelve || '--' }} μg</div>
|
|
|
+ <div><b>叶酸:</b>{{ form.folicAcid || '--' }} μg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="脂类" name="lipids">
|
|
|
+ <el-divider content-position="left">脂类:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>胆固醇:</b>{{ form.cholesterol || '--' }} mg</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="其他" name="others">
|
|
|
+ <el-divider content-position="left">其他:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>膳食纤维:</b>{{ form.dietaryFiber || '--' }} g</div>
|
|
|
+ <div><b>不可溶性膳食纤维:</b>{{ form.insolubleDietaryFiber || '--' }} g</div>
|
|
|
+ <div><b>血糖生成指数:</b>{{ form.bloodGlucoseIndex || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>灰分:</b>{{ form.ash || '--' }} g</div>
|
|
|
+ <div><b>可溶性膳食纤维:</b>{{ form.solubleDietaryFiber || '--' }} g</div>
|
|
|
+ <div><b>渗透压:</b>{{ form.osmoticPressure || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="商品说明" name="productDescription">
|
|
|
+ <el-divider content-position="left">商品说明:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>适用人群:</b>{{ form.applicableCrowd || '--' }}</div>
|
|
|
+ <div><b>原料:</b>{{ form.rawMaterial || '--' }}</div>
|
|
|
+ <div><b>食用方法和食用量:</b>{{ form.usageAndDosage || '--' }}</div>
|
|
|
+ <div><b>储存条件:</b>{{ form.storageConditions || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div><b>不适用人群:</b>{{ form.unsuitableCrowd || '--' }}</div>
|
|
|
+ <div><b>适应症及禁忌:</b>{{ form.indicationsContraindications || '--' }}</div>
|
|
|
+ <div><b>产品特点:</b>{{ form.productFeatures || '--' }}</div>
|
|
|
+ <div><b>警示说明及注意事项:</b>{{ form.warningInstructions || '--' }}</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="商品附件" name="productAttachments">
|
|
|
+ <el-divider content-position="left">商品附件:</el-divider>
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :span="24">
|
|
|
+ <div v-if="form.productAttachments && form.productAttachments.length">
|
|
|
+ <div v-for="(file, idx) in form.productAttachments" :key="idx">
|
|
|
+ <a :href="file.url" target="_blank">{{ file.name }}</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>--</div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-tabs>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="Nutrition" lang="ts">
|
|
|
+ import { listNutrition, getNutrition, delNutrition, addNutrition, updateNutrition } from '@/api/warehouse/productNutrition/index';
|
|
|
+ import { NutritionVO, NutritionQuery, NutritionForm } from '@/api/warehouse/productNutrition/types';
|
|
|
+ import { listCategory } from '@/api/warehouse/productCategory/index';
|
|
|
+
|
|
|
+ import { FormInstance, ElMessageBox, UploadFile, UploadFiles } from 'element-plus';
|
|
|
+ import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted } from 'vue';
|
|
|
+ import { log } from 'console';
|
|
|
+
|
|
|
+ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+ const { product_qualification, dosage_form, product_package_unit, product_supplier, put_flag } = toRefs < any > (proxy ?.useDict('product_qualification', 'dosage_form', 'product_package_unit', 'product_supplier', 'put_flag'));
|
|
|
+
|
|
|
+
|
|
|
+ const nutritionList = ref < NutritionVO[] > ([]);
|
|
|
+ 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 total = ref(0);
|
|
|
+ const activeTab = ref('basic');
|
|
|
+ const fileList = ref < UploadFiles > ([]);
|
|
|
+ const detailDialogVisible = ref(false);
|
|
|
+
|
|
|
+ const treeData = ref([]); // 定义 treeData
|
|
|
+
|
|
|
+ const queryFormRef = ref < FormInstance > ();
|
|
|
+ const nutritionFormRef = ref < FormInstance > ();
|
|
|
+
|
|
|
+ const dialog = reactive < DialogOption > ({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+ });
|
|
|
+
|
|
|
+ const initFormData: NutritionForm = {
|
|
|
+ id: undefined,
|
|
|
+ productName: undefined,
|
|
|
+ hospitalSystemCode: undefined,
|
|
|
+ productCode: undefined,
|
|
|
+ productCategory: undefined,
|
|
|
+ productCategoryList: undefined,
|
|
|
+ manufacturer: undefined,
|
|
|
+ brand: undefined,
|
|
|
+ productLabel: undefined,
|
|
|
+ licenseExpiryReminder: undefined,
|
|
|
+ productLicenseExpiry: undefined,
|
|
|
+ productQualification: undefined,
|
|
|
+ approvalNumber: undefined,
|
|
|
+ taste: undefined,
|
|
|
+ dosageForm: undefined,
|
|
|
+ supplier: undefined,
|
|
|
+ applicableDepartment: undefined,
|
|
|
+ contraindicationLabel: undefined,
|
|
|
+ shelfLifeReminder: undefined,
|
|
|
+ shelfLife: undefined,
|
|
|
+ purchasePrice: undefined,
|
|
|
+ purchaseUnit: '袋',
|
|
|
+ defaultUsage: undefined,
|
|
|
+ packageUnit: '袋',
|
|
|
+ productSpec: undefined,
|
|
|
+ productSpecValue: undefined,
|
|
|
+ productSpecUnit: 'g',
|
|
|
+ packagePrice: undefined,
|
|
|
+ minUnit: '包',
|
|
|
+ minSpec: undefined,
|
|
|
+ netContent: undefined,
|
|
|
+ configSalePrice: undefined,
|
|
|
+ configLossRate: undefined,
|
|
|
+ calorie: undefined,
|
|
|
+ carbohydrate: undefined,
|
|
|
+ heatEnergy: undefined,
|
|
|
+ protein: undefined,
|
|
|
+ fat: undefined,
|
|
|
+ moisture: undefined,
|
|
|
+ ca: undefined,
|
|
|
+ p: undefined,
|
|
|
+ k: undefined,
|
|
|
+ na: undefined,
|
|
|
+ mg: undefined,
|
|
|
+ cl: undefined,
|
|
|
+ fe: undefined,
|
|
|
+ zn: undefined,
|
|
|
+ se: undefined,
|
|
|
+ cu: undefined,
|
|
|
+ mn: undefined,
|
|
|
+ i: undefined,
|
|
|
+ f: undefined,
|
|
|
+ cr: undefined,
|
|
|
+ mo: undefined,
|
|
|
+ isoleucine: undefined,
|
|
|
+ tryptophan: undefined,
|
|
|
+ sulfurAminoAcid: undefined,
|
|
|
+ histidine: undefined,
|
|
|
+ aromaticAminoAcid: undefined,
|
|
|
+ glutamicAcid: undefined,
|
|
|
+ threonine: undefined,
|
|
|
+ serine: undefined,
|
|
|
+ arginine: undefined,
|
|
|
+ lysine: undefined,
|
|
|
+ asparticAcid: undefined,
|
|
|
+ cysteine: undefined,
|
|
|
+ proline: undefined,
|
|
|
+ tyrosine: undefined,
|
|
|
+ leucine: undefined,
|
|
|
+ valine: undefined,
|
|
|
+ methionine: undefined,
|
|
|
+ alanine: undefined,
|
|
|
+ phenylalanine: undefined,
|
|
|
+ glycine: undefined,
|
|
|
+ fattyAcid: undefined,
|
|
|
+ saturatedFattyAcid: undefined,
|
|
|
+ monounsaturatedFattyAcid: undefined,
|
|
|
+ polyunsaturatedFattyAcid: undefined,
|
|
|
+ vitaminA: undefined,
|
|
|
+ vitaminACarotene: undefined,
|
|
|
+ vitaminAAlcohol: undefined,
|
|
|
+ vitaminD: undefined,
|
|
|
+ vitaminE: undefined,
|
|
|
+ vitaminETocopherol: undefined,
|
|
|
+ vitaminK: undefined,
|
|
|
+ vitaminBOne: undefined,
|
|
|
+ vitaminBTwo: undefined,
|
|
|
+ vitaminBSix: undefined,
|
|
|
+ vitaminBTwelve: undefined,
|
|
|
+ niacin: undefined,
|
|
|
+ vitaminC: undefined,
|
|
|
+ folicAcid: undefined,
|
|
|
+ choline: undefined,
|
|
|
+ biotin: undefined,
|
|
|
+ pantothenicAcid: undefined,
|
|
|
+ cholesterol: undefined,
|
|
|
+ bloodGlucoseIndex: undefined,
|
|
|
+ insolubleDietaryFiber: undefined,
|
|
|
+ dietaryFiber: undefined,
|
|
|
+ ash: undefined,
|
|
|
+ solubleDietaryFiber: undefined,
|
|
|
+ applicableCrowd: undefined,
|
|
|
+ unsuitableCrowd: undefined,
|
|
|
+ osmoticPressure: undefined,
|
|
|
+ rawMaterial: undefined,
|
|
|
+ indicationsContraindications: undefined,
|
|
|
+ usageAndDosage: undefined,
|
|
|
+ productFeatures: undefined,
|
|
|
+ storageConditions: undefined,
|
|
|
+ warningInstructions: undefined,
|
|
|
+ productAttachments: undefined,
|
|
|
+ status: undefined,
|
|
|
+ putFlag: undefined,
|
|
|
+ outboundNumber: undefined
|
|
|
+ };
|
|
|
+
|
|
|
+ const data = reactive < PageData < NutritionForm,
|
|
|
+ NutritionQuery >> ({
|
|
|
+ form: { ...initFormData },
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ productName: undefined,
|
|
|
+ productCategory: undefined,
|
|
|
+ productCategoryList: [],
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ productName: [
|
|
|
+ { required: true, message: "产品名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ hospitalSystemCode: [
|
|
|
+ { required: true, message: "院方系统编码不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ productCode: [
|
|
|
+ { required: true, message: "商品编码不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ productCategory: [
|
|
|
+ { required: true, message: "产品所属分类不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ productQualification: [
|
|
|
+ { required: true, message: "商品资质不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ shelfLifeReminder: [
|
|
|
+ { required: true, message: "保质期临期提醒不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ shelfLife: [
|
|
|
+ { required: true, message: "保质期不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ purchasePrice: [
|
|
|
+ { required: true, message: "入货价格不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ purchaseUnit: [
|
|
|
+ { required: true, message: "入货单位不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ productSpec: [
|
|
|
+ { required: true, message: "商品规格不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ configSalePrice: [
|
|
|
+ { required: true, message: "配置销售价格不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ packagePrice: [
|
|
|
+ { required: true, message: "预包装价格不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const { queryParams, form, rules } = toRefs(data);
|
|
|
+
|
|
|
+ const categoryOptions = ref([]);
|
|
|
+
|
|
|
+ function buildCategoryTree(flatList) {
|
|
|
+ const idMap = {};
|
|
|
+ const tree = [];
|
|
|
+ flatList.forEach(item => {
|
|
|
+ idMap[item.categoryId] = {
|
|
|
+ label: item.categoryName,
|
|
|
+ value: item.categoryId,
|
|
|
+ children: []
|
|
|
+ };
|
|
|
+ });
|
|
|
+ flatList.forEach(item => {
|
|
|
+ if (item.parentId && item.parentId !== 0 && idMap[item.parentId]) {
|
|
|
+ idMap[item.parentId].children.push(idMap[item.categoryId]);
|
|
|
+ } else if (item.parentId === 0) {
|
|
|
+ tree.push(idMap[item.categoryId]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 去除没有children的children字段
|
|
|
+ function clean(node) {
|
|
|
+ if (node.children && node.children.length === 0) {
|
|
|
+ delete node.children;
|
|
|
+ } else if (node.children) {
|
|
|
+ node.children.forEach(clean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tree.forEach(clean);
|
|
|
+ return tree;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 查询营养产品信息列表 */
|
|
|
+ const getList = async () => {
|
|
|
+
|
|
|
+ loading.value = true;
|
|
|
+ const res = await listNutrition(queryParams.value);
|
|
|
+ nutritionList.value = res.rows;
|
|
|
+ total.value = res.total;
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 取消按钮 */
|
|
|
+ const cancel = () => {
|
|
|
+ reset();
|
|
|
+ dialog.visible = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 表单重置 */
|
|
|
+ const reset = () => {
|
|
|
+ form.value = { ...initFormData };
|
|
|
+ nutritionFormRef.value ?.resetFields();
|
|
|
+ fileList.value = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ const handleQuery = () => {
|
|
|
+ // 取最后一级分类ID传给后端
|
|
|
+ if (queryParams.value.productCategoryList && queryParams.value.productCategoryList.length) {
|
|
|
+ queryParams.value.productCategory = queryParams.value.productCategoryList.slice(-1)[0];
|
|
|
+ } else {
|
|
|
+ queryParams.value.productCategory = undefined;
|
|
|
+ }
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ const resetQuery = () => {
|
|
|
+ queryFormRef.value?.resetFields();
|
|
|
+ queryParams.value.productCategoryList = [];
|
|
|
+ queryParams.value.productCategory = undefined;
|
|
|
+ queryParams.value.productName = undefined;
|
|
|
+ handleQuery();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 多选框选中数据 */
|
|
|
+ const handleSelectionChange = (selection: NutritionVO[]) => {
|
|
|
+ ids.value = selection.map(item => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ const handleAdd = () => {
|
|
|
+ reset();
|
|
|
+ dialog.visible = true;
|
|
|
+ dialog.title = "添加营养产品信息";
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ const handleUpdate = async (row ? : NutritionVO) => {
|
|
|
+ reset();
|
|
|
+ const _id = row ?.id || ids.value[0]
|
|
|
+ const res = await getNutrition(_id);
|
|
|
+ Object.assign(form.value, res.data);
|
|
|
+ dialog.visible = true;
|
|
|
+ dialog.title = "修改营养产品信息";
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 提交按钮 */
|
|
|
+ const submitForm = () => {
|
|
|
+ nutritionFormRef.value ?.validate(async (valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ buttonLoading.value = true;
|
|
|
+ // form.value.productSpec = form.value.productSpec && form.value.productSpecUnit ? `${form.value.productSpec}${form.value.productSpecUnit}` : '';
|
|
|
+ if (form.value.id) {
|
|
|
+ await updateNutrition(form.value).finally(() => buttonLoading.value = false);
|
|
|
+ } else {
|
|
|
+ await addNutrition(form.value).finally(() => buttonLoading.value = false);
|
|
|
+ }
|
|
|
+ proxy ?.$modal.msgSuccess("操作成功");
|
|
|
+ dialog.visible = false;
|
|
|
+ await getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 保存并上架按钮操作 */
|
|
|
+ const submitFormAndPutaway = () => {
|
|
|
+ nutritionFormRef.value ?.validate(async (valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ buttonLoading.value = true;
|
|
|
+ form.value.putFlag = '1';
|
|
|
+ form.value.productSpec = form.value.productSpec && form.value.productSpecUnit ? `${form.value.productSpec}${form.value.productSpecUnit}` : '';
|
|
|
+ if (form.value.id) {
|
|
|
+ await updateNutrition(form.value).finally(() => buttonLoading.value = false);
|
|
|
+ } else {
|
|
|
+ await addNutrition(form.value).finally(() => buttonLoading.value = false);
|
|
|
+ }
|
|
|
+ proxy ?.$modal.msgSuccess("操作成功");
|
|
|
+ dialog.visible = false;
|
|
|
+ await getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ const handleDelete = async (row ? : NutritionVO) => {
|
|
|
+ const _ids = row ?.id || ids.value;
|
|
|
+ await proxy ?.$modal.confirm('是否确认删除营养产品信息编号为"' + _ids + '"的数据项?');
|
|
|
+ await delNutrition(_ids);
|
|
|
+ proxy ?.$modal.msgSuccess("删除成功");
|
|
|
+ await getList();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ const handleExport = () => {
|
|
|
+ proxy ?.download('warehouse/nutrition/export', {
|
|
|
+ ...queryParams.value
|
|
|
+ }, `nutrition_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 文件上传相关操作 */
|
|
|
+ const handleFileChange = (file: UploadFile, uploadFiles: UploadFiles) => {
|
|
|
+ fileList.value = uploadFiles;
|
|
|
+ }
|
|
|
+
|
|
|
+ const onSpecUnitChange = () => {
|
|
|
+ if (!form.value.productSpecUnit) form.value.productSpecUnit = 'g';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 详情弹窗逻辑
|
|
|
+ const handleDetail = async (row: NutritionVO) => {
|
|
|
+ reset();
|
|
|
+ const res = await getNutrition(row.id);
|
|
|
+ Object.assign(form.value, res.data);
|
|
|
+ detailDialogVisible.value = true;
|
|
|
+ activeTab.value = 'basic';
|
|
|
+ };
|
|
|
+
|
|
|
+ // 上下架切换
|
|
|
+ const handlePutFlag = async (row: NutritionVO, flag: string) => {
|
|
|
+ await proxy ?.$modal.confirm(`是否确认${flag === '1' ? '上架' : '下架'}该产品?`);
|
|
|
+ const updateData = { ...row, putFlag: flag };
|
|
|
+ await updateNutrition(updateData);
|
|
|
+ proxy ?.$modal.msgSuccess(`${flag === '1' ? '上架' : '下架'}成功`);
|
|
|
+ await getList();
|
|
|
+ };
|
|
|
+
|
|
|
+ onMounted(async () => {
|
|
|
+ getList();
|
|
|
+ const res = await listCategory();
|
|
|
+ categoryOptions.value = buildCategoryTree(res.rows || []);
|
|
|
+ if (!form.value.productSpecUnit) form.value.productSpecUnit = 'g';
|
|
|
+ });
|
|
|
+
|
|
|
+ const getCategoryName = (categoryIds) => {
|
|
|
+ if (!categoryIds) return '--';
|
|
|
+
|
|
|
+ // 处理多个分类ID的情况
|
|
|
+ const ids = categoryIds.toString().split(',');
|
|
|
+ const categoryNames = ids.map(id => {
|
|
|
+ const findCategory = (categories, targetId) => {
|
|
|
+ for (const category of categories) {
|
|
|
+ if (category.value.toString() === targetId.toString()) {
|
|
|
+ return category.label;
|
|
|
+ }
|
|
|
+ if (category.children) {
|
|
|
+ const found = findCategory(category.children, targetId);
|
|
|
+ if (found) return found;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+ return findCategory(categoryOptions.value, id);
|
|
|
+ }).filter(name => name !== null);
|
|
|
+
|
|
|
+ return categoryNames.length > 0 ? categoryNames.join('/') : '--';
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .nutrition-dialog {
|
|
|
+ :deep(.el-dialog) {
|
|
|
+ height: 70vh;
|
|
|
+ margin-top: 15vh !important;
|
|
|
+
|
|
|
+ .el-dialog__body {
|
|
|
+ height: calc(100% - 120px);
|
|
|
+ padding: 10px 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .el-tabs__content {
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-scrollbar {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .el-scrollbar__wrap {
|
|
|
+ overflow-x: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-form {
|
|
|
+ padding: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialog-footer {
|
|
|
+ padding: 20px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+</style>
|