|
|
@@ -69,6 +69,7 @@
|
|
|
<Icon icon="ep:delete" class="mr-5px" />
|
|
|
复制计划
|
|
|
</el-button>
|
|
|
+ <!-- <el-button type="success" @click="openImport"><Icon icon="ep:download" class="mr-5px" />导入</el-button> -->
|
|
|
</div>
|
|
|
|
|
|
<el-table
|
|
|
@@ -163,6 +164,8 @@
|
|
|
|
|
|
<AddForm ref="addFoodRef" @success="getList" />
|
|
|
<DetailsForm ref="foodDetailsForm" @success="getList" />
|
|
|
+ <!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
|
|
|
+ <Import ref="importRef" :config="importConfig" @success="getList" />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -172,6 +175,7 @@ import AddForm from '@/views/system/food/CateringPlan/AddForm.vue'
|
|
|
import DetailsForm from '@/views/system/food/CateringPlan/DetailsForm.vue'
|
|
|
import { chargeCategoryDel } from '@/api/elderly/fee/chargeCategory'
|
|
|
import {cateringPlanDelete, getCateringPlanPage, getListRestaurant} from "@/api/system/foods";
|
|
|
+import Import from '@/components/ImportFile/index.vue'
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
@@ -367,6 +371,24 @@ const cancelDelete = async (id: number) => {
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
+// 导入(复用 ImportFile 组件)
|
|
|
+const importRef = ref()
|
|
|
+const importConfig = reactive({
|
|
|
+ title: '餐饮计划导入',
|
|
|
+ // TODO: 替换成你的真实导入接口
|
|
|
+ importUrl: '/materialInfo/import',
|
|
|
+ excelTempName: '餐饮计划导入模板',
|
|
|
+ // TODO: 替换成你的真实模板下载接口
|
|
|
+ downloadUrl: '/materialInfo/downloadExcel',
|
|
|
+ desc: '餐饮计划',
|
|
|
+ // TODO: 如果后端支持失败信息导出,填真实接口;不支持可留空
|
|
|
+ failExportUrl: '',
|
|
|
+})
|
|
|
+
|
|
|
+const openImport = () => {
|
|
|
+ importRef.value?.open?.()
|
|
|
+}
|
|
|
+
|
|
|
/** 初始化 **/
|
|
|
onMounted(() => {
|
|
|
getList()
|