菜品分类时段改为多选。商品管理显示封面图。
This commit is contained in:
1 parent
57059f7d99
commit
8e22166f2e
4 files changed
+204
-199
No files matched your search
@@ -1,101 +1,99 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||||
:close-on-click-modal="false" draggable>
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
<el-row :gutter="24">
|
||||||
<el-row :gutter="24">
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item label="分类名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入分类名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="餐段类型" prop="categoryType">
|
||||||
|
<el-select v-model="form.categoryType" placeholder="请选择餐段类型" multiple>
|
||||||
|
<el-option :value="item.value" :label="item.label" v-for="(item, index) in daily_menu" :key="index"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item label="分类图" prop="picUrl">
|
||||||
|
<upload-img v-model="form.picUrl"></upload-img>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="分类名称" prop="name">
|
<el-form-item label="分类排序" prop="sort">
|
||||||
<el-input v-model="form.name" placeholder="请输入分类名称"/>
|
<el-input v-model="form.sort" placeholder="请输入分类排序" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" class="mb20">
|
|
||||||
<el-form-item label="餐段类型" prop="categoryType">
|
|
||||||
<el-select v-model="form.categoryType" placeholder="请选择餐段类型">
|
|
||||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in daily_menu" :key="index"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" class="mb20">
|
|
||||||
<el-form-item label="分类图" prop="picUrl">
|
|
||||||
<upload-img v-model="form.picUrl"></upload-img>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<!-- <el-col :span="12" class="mb20">-->
|
||||||
<el-form-item label="分类排序" prop="sort">
|
<!-- <el-form-item label="开启状态" prop="status">-->
|
||||||
<el-input v-model="form.sort" placeholder="请输入分类排序"/>
|
<!-- <el-radio-group v-model="form.status">-->
|
||||||
</el-form-item>
|
<!-- <el-radio label="开启状态" border>开启状态</el-radio>-->
|
||||||
</el-col>
|
<!-- </el-radio-group>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<!-- <el-col :span="12" class="mb20">-->
|
<!-- </el-col>-->
|
||||||
<!-- <el-form-item label="开启状态" prop="status">-->
|
|
||||||
<!-- <el-radio-group v-model="form.status">-->
|
|
||||||
<!-- <el-radio label="开启状态" border>开启状态</el-radio>-->
|
|
||||||
<!-- </el-radio-group>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="CanteenCategoryDialog">
|
<script setup lang="ts" name="CanteenCategoryDialog">
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useDict } from '/@/hooks/dict';
|
||||||
import { useMessage } from "/@/hooks/message";
|
import { useMessage } from '/@/hooks/message';
|
||||||
import { getObj, addObj, putObj } from '/@/api/canteen/canteenCategory'
|
import { getObj, addObj, putObj } from '/@/api/canteen/canteenCategory';
|
||||||
import { rule } from '/@/utils/validate';
|
import { rule } from '/@/utils/validate';
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const dataFormRef = ref();
|
const dataFormRef = ref();
|
||||||
const visible = ref(false)
|
const visible = ref(false);
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
// 定义字典
|
// 定义字典
|
||||||
const { daily_menu } = useDict('daily_menu')
|
const { daily_menu } = useDict('daily_menu');
|
||||||
// 提交表单数据
|
// 提交表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
id:'',
|
id: '',
|
||||||
parentId: '',
|
parentId: '',
|
||||||
name: '',
|
name: '',
|
||||||
picUrl: '',
|
picUrl: '',
|
||||||
sort: '',
|
sort: '',
|
||||||
status: '',
|
status: '',
|
||||||
creator: '',
|
creator: '',
|
||||||
updater: '',
|
updater: '',
|
||||||
deleted: '',
|
deleted: '',
|
||||||
deptId: '',
|
deptId: '',
|
||||||
categoryType: '',
|
categoryType: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
name: [{required: true, message: '分类名称不能为空', trigger: 'blur'}],
|
name: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
|
||||||
categoryType: [{required: true, message: '餐段类型不能为空', trigger: 'blur'}],
|
categoryType: [{ required: true, message: '餐段类型不能为空', trigger: 'blur' }],
|
||||||
sort: [{required: true, message: '分类排序不能为空', trigger: 'blur'}],
|
sort: [{ required: true, message: '分类排序不能为空', trigger: 'blur' }],
|
||||||
})
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = (id: string) => {
|
const openDialog = (id: string) => {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
form.id = ''
|
form.id = '';
|
||||||
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
dataFormRef.value?.resetFields();
|
dataFormRef.value?.resetFields();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取canteenCategory信息
|
// 获取canteenCategory信息
|
||||||
if (id) {
|
if (id) {
|
||||||
form.id = id
|
form.id = id;
|
||||||
getcanteenCategoryData(id)
|
getcanteenCategoryData(id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
@@ -104,32 +102,35 @@ const onSubmit = async () => {
|
|||||||
if (!valid) return false;
|
if (!valid) return false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
form.id ? await putObj(form) : await addObj(form);
|
form.id
|
||||||
|
? await putObj({ ...form, categoryType: form.categoryType.join(',') })
|
||||||
|
: await addObj({ ...form, categoryType: form.categoryType.join(',') });
|
||||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit('refresh');
|
emit('refresh');
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg);
|
useMessage().error(err.msg);
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 初始化表单数据
|
// 初始化表单数据
|
||||||
const getcanteenCategoryData = (id: string) => {
|
const getcanteenCategoryData = (id: string) => {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
getObj(id).then((res: any) => {
|
getObj(id)
|
||||||
Object.assign(form, res.data)
|
.then((res: any) => {
|
||||||
}).finally(() => {
|
Object.assign(form, res.data, { categoryType: res.data.categoryType.split(',') });
|
||||||
loading.value = false
|
})
|
||||||
})
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 暴露变量
|
// 暴露变量
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openDialog
|
openDialog,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -1,135 +1,134 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<el-row v-show="showSearch">
|
<el-row v-show="showSearch">
|
||||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||||
<el-form-item label="分类名称" prop="name" >
|
<el-form-item label="分类名称" prop="name">
|
||||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="search" type="primary" @click="getDataList">
|
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||||
查询
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-button>
|
</el-form-item>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
</el-form>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-form>
|
<el-row>
|
||||||
</el-row>
|
<div class="mb8" style="width: 100%">
|
||||||
<el-row>
|
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_canteenCategory_add'">
|
||||||
<div class="mb8" style="width: 100%">
|
新 增
|
||||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
</el-button>
|
||||||
v-auth="'canteen_canteenCategory_add'">
|
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_canteenCategory_del'" @click="handleDelete(selectObjs)">
|
||||||
新 增
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
<right-toolbar
|
||||||
v-auth="'canteen_canteenCategory_del'" @click="handleDelete(selectObjs)">
|
v-model:showSearch="showSearch"
|
||||||
删除
|
:export="'canteen_canteenCategory_export'"
|
||||||
</el-button>
|
@exportExcel="exportExcel"
|
||||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_canteenCategory_export'"
|
class="ml10 mr20"
|
||||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
style="float: right"
|
||||||
@queryTable="getDataList"></right-toolbar>
|
@queryTable="getDataList"
|
||||||
</div>
|
></right-toolbar>
|
||||||
</el-row>
|
</div>
|
||||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
</el-row>
|
||||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
<el-table
|
||||||
|
:data="state.dataList"
|
||||||
|
v-loading="state.loading"
|
||||||
|
border
|
||||||
|
:cell-style="tableStyle.cellStyle"
|
||||||
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
@selection-change="selectionChangHandle"
|
@selection-change="selectionChangHandle"
|
||||||
@sort-change="sortChangeHandle">
|
@sort-change="sortChangeHandle"
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
>
|
||||||
<el-table-column type="index" label="#" width="40" />
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip/>
|
<el-table-column type="index" label="#" width="40" />
|
||||||
<el-table-column prop="categoryType" label="餐段类型" show-overflow-tooltip>
|
<el-table-column prop="name" label="分类名称" show-overflow-tooltip />
|
||||||
<template #default="scope">
|
<el-table-column prop="categoryType" label="餐段类型" show-overflow-tooltip width="180">
|
||||||
<dict-tag :options="daily_menu" :value="scope.row.categoryType"></dict-tag>
|
<template #default="scope">
|
||||||
</template>
|
<dict-tag :options="daily_menu" :value="scope.row.categoryType?.split(',')"></dict-tag>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip/>
|
</el-table-column>
|
||||||
<el-table-column prop="createBy" label="创建者" show-overflow-tooltip/>
|
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip />
|
||||||
<el-table-column prop="updateBy" label="更新者" show-overflow-tooltip/>
|
<el-table-column prop="createBy" label="创建者" show-overflow-tooltip />
|
||||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip/>
|
<el-table-column prop="updateBy" label="更新者" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" width="150">
|
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip />
|
||||||
<template #default="scope">
|
<el-table-column label="操作" width="150">
|
||||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenCategory_edit'"
|
<template #default="scope">
|
||||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenCategory_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenCategory_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
>编辑</el-button
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenCategory_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</el-table>
|
</template>
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
</el-table-column>
|
||||||
</div>
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 编辑、新增 -->
|
<!-- 编辑、新增 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="systemCanteenCategory">
|
<script setup lang="ts" name="systemCanteenCategory">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||||
import { fetchList, delObjs } from "/@/api/canteen/canteenCategory";
|
import { fetchList, delObjs } from '/@/api/canteen/canteenCategory';
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||||
// 定义查询字典
|
// 定义查询字典
|
||||||
const { daily_menu } = useDict('daily_menu')
|
const { daily_menu } = useDict('daily_menu');
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref();
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
const queryRef = ref()
|
const queryRef = ref();
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true);
|
||||||
// 多选变量
|
// 多选变量
|
||||||
const selectObjs = ref([]) as any
|
const selectObjs = ref([]) as any;
|
||||||
const multiple = ref(true)
|
const multiple = ref(true);
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: fetchList
|
pageList: fetchList,
|
||||||
})
|
});
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
const {
|
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||||
getDataList,
|
|
||||||
currentChangeHandle,
|
|
||||||
sizeChangeHandle,
|
|
||||||
sortChangeHandle,
|
|
||||||
downBlobFile,
|
|
||||||
tableStyle
|
|
||||||
} = useTable(state)
|
|
||||||
|
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
queryRef.value?.resetFields()
|
queryRef.value?.resetFields();
|
||||||
// 清空多选
|
// 清空多选
|
||||||
selectObjs.value = []
|
selectObjs.value = [];
|
||||||
getDataList()
|
getDataList();
|
||||||
}
|
};
|
||||||
|
|
||||||
// 导出excel
|
// 导出excel
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
downBlobFile('/canteen/canteenCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenCategory.xlsx')
|
downBlobFile('/canteen/canteenCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenCategory.xlsx');
|
||||||
}
|
};
|
||||||
|
|
||||||
// 多选事件
|
// 多选事件
|
||||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
selectObjs.value = objs.map(({ id }) => id);
|
selectObjs.value = objs.map(({ id }) => id);
|
||||||
multiple.value = !objs.length;
|
multiple.value = !objs.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = async (ids: string[]) => {
|
const handleDelete = async (ids: string[]) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('此操作将永久删除');
|
await useMessageBox().confirm('此操作将永久删除');
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await delObjs(ids);
|
await delObjs(ids);
|
||||||
getDataList();
|
getDataList();
|
||||||
useMessage().success('删除成功');
|
useMessage().success('删除成功');
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg);
|
useMessage().error(err.msg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog width="60%" :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
<el-dialog width="60%" :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="auto" v-loading="loading">
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="auto" v-loading="loading">
|
||||||
<el-tabs v-model="tabPaneActiveName">
|
<el-tabs v-model="tabPaneActiveName" @tab-change="handleTabChange">
|
||||||
<el-tab-pane label="基础信息" name="基础信息" disabled style="overflow-y: auto; height: 60vh">
|
<el-tab-pane label="基础信息" name="基础信息" style="overflow-y: auto; height: 60vh">
|
||||||
<el-row style="padding: 10px">
|
<el-row style="padding: 10px">
|
||||||
<el-col :span="12" class="mb20">
|
<el-col :span="12" class="mb20">
|
||||||
<el-form-item label="货号" prop="productCode">
|
<el-form-item label="货号" prop="productCode">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<el-col :span="12" class="mb20">
|
<el-col :span="12" class="mb20">
|
||||||
<el-form-item label="商品分类" prop="categoryId">
|
<el-form-item label="商品分类" prop="categoryId">
|
||||||
<el-select v-model="form.categoryId" placeholder="请选择商品分类">
|
<el-select v-model="form.categoryId" placeholder="请选择商品分类">
|
||||||
<el-option v-for="item in categoryOptions" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in categoryOptions" :key="item?.id" :label="item?.name" :value="item?.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -183,10 +183,10 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="包装单位" name="包装单位" disabled style="overflow-y: auto; height: 60vh">
|
<el-tab-pane label="包装单位" name="包装单位" style="overflow-y: auto; height: 60vh">
|
||||||
<supermarketUnit v-model:supermarketUnitEntityList="form.supermarketUnitEntityList" />
|
<supermarketUnit v-model:supermarketUnitEntityList="form.supermarketUnitEntityList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="辅助条码" name="辅助条码" disabled style="overflow-y: auto; height: 60vh">
|
<el-tab-pane label="辅助条码" name="辅助条码" style="overflow-y: auto; height: 60vh">
|
||||||
<supermarketAuxiliaryCode v-model:supermarketAuxiliaryCodeEntityList="form.supermarketAuxiliaryCodeEntityList" />
|
<supermarketAuxiliaryCode v-model:supermarketAuxiliaryCodeEntityList="form.supermarketAuxiliaryCodeEntityList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -213,6 +213,7 @@ import { fetchList } from '/@/api/supermarketerp/smErpSupplier';
|
|||||||
import { rule } from '/@/utils/validate';
|
import { rule } from '/@/utils/validate';
|
||||||
import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue';
|
import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue';
|
||||||
import supermarketUnit from './components/supermarketUnit/index.vue';
|
import supermarketUnit from './components/supermarketUnit/index.vue';
|
||||||
|
import { TabPaneName } from 'element-plus';
|
||||||
|
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
@@ -310,6 +311,7 @@ const getsupermarketSpuData = (id: string) => {
|
|||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = async (id: string) => {
|
const openDialog = async (id: string) => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
|
currentTabPaneIndex.value = 0;
|
||||||
form.id = '';
|
form.id = '';
|
||||||
form.supermarketUnitEntityList = [];
|
form.supermarketUnitEntityList = [];
|
||||||
form.supermarketAuxiliaryCodeEntityList = [];
|
form.supermarketAuxiliaryCodeEntityList = [];
|
||||||
@@ -356,6 +358,11 @@ const openDialog = async (id: string) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// tab栏切换
|
||||||
|
const handleTabChange = (name: TabPaneName) => {
|
||||||
|
currentTabPaneIndex.value = tabPaneEnum.findIndex((item) => item === name);
|
||||||
|
};
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
console.log(form);
|
console.log(form);
|
||||||
@@ -391,10 +398,3 @@ defineExpose({
|
|||||||
openDialog,
|
openDialog,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
:deep(.el-tabs__item.is-disabled) {
|
|
||||||
color: #2e5cf6;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -60,11 +60,15 @@
|
|||||||
<el-table-column prop="unit" label="单位" show-overflow-tooltip />
|
<el-table-column prop="unit" label="单位" show-overflow-tooltip />
|
||||||
<el-table-column prop="categoryId" label="商品分类" show-overflow-tooltip width="100">
|
<el-table-column prop="categoryId" label="商品分类" show-overflow-tooltip width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId).name }}
|
{{ supermarketCategory?.find((item: any) => item.id === scope.row.categoryId)?.name }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="picUrl" label="封面图" show-overflow-tooltip />
|
<el-table-column prop="picUrl" label="封面图" width="140">
|
||||||
<el-table-column prop="status" label="商品状态" show-overflow-tooltip width="100">
|
<template #default="scope">
|
||||||
|
<el-image style="width: 100px; height: 100px" :src="imageBaseUrl + scope.row.picUrl" fit="cover" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="status" label="商品状态" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -112,6 +116,7 @@ import { BasicTableProps, useTable } from '/@/hooks/table';
|
|||||||
import { fetchList, delObjs, getSupermarketCategory } from '/@/api/supermarket/supermarketSpu';
|
import { fetchList, delObjs, getSupermarketCategory } from '/@/api/supermarket/supermarketSpu';
|
||||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH;
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||||
|
|||||||
Reference in new issue
Block a user