Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-pc-cloud
# Conflicts: # .env.development
This commit is contained in:
commit
301c290a42
27 files changed
+1561
-1568
No files matched your search
+4
-4
@@ -9,13 +9,13 @@ ENV = 'development'
|
||||
|
||||
# ADMIN 服务地址
|
||||
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/
|
||||
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||
VITE_ADMIN_PROXY_PATH = http://localhost:9999
|
||||
VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||
# VITE_ADMIN_PROXY_PATH = http://localhost:9999
|
||||
|
||||
# 图片访问基础地址
|
||||
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api
|
||||
VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api
|
||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
||||
VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
|
||||
# 代码生成服务地址
|
||||
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
|
||||
@@ -1,107 +1,103 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-input v-model="form.boxesId" placeholder="请输入包厢Id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-input v-model="form.boxesId" placeholder="请输入包厢Id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约id" prop="bookingId">
|
||||
<el-input v-model="form.bookingId" placeholder="请输入预约id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约id" prop="bookingId">
|
||||
<el-input v-model="form.bookingId" placeholder="请输入预约id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态 0空闲 1已使用" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态 0空闲 1已使用"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态 0空闲 1已使用" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态 0空闲 1已使用" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="格式为 YYYY-MM-DD" prop="bxDate">
|
||||
<el-input v-model="form.bxDate" placeholder="请输入格式为 YYYY-MM-DD"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="格式为 YYYY-MM-DD" prop="bxDate">
|
||||
<el-input v-model="form.bxDate" placeholder="请输入格式为 YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="时间" prop="hour">
|
||||
<el-date-picker type="datetime" placeholder="请选择时间" v-model="form.hour" :value-format="dateTimeStr"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="时间索引(0-24)" prop="hourIndex">
|
||||
<el-input v-model="form.hourIndex" placeholder="请输入时间索引(0-24)"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="时间" prop="hour">
|
||||
<el-date-picker type="datetime" placeholder="请选择时间" v-model="form.hour" :value-format="dateTimeStr"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="时间索引(0-24)" prop="hourIndex">
|
||||
<el-input v-model="form.hourIndex" placeholder="请输入时间索引(0-24)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="BoxesAvailabilityDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesAvailability'
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesAvailability';
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
// 定义字典
|
||||
const { booking_status } = useDict('booking_status')
|
||||
const { booking_status } = useDict('booking_status');
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
boxesId: '',
|
||||
bookingId: '',
|
||||
status: '',
|
||||
userId: '',
|
||||
bxDate: '',
|
||||
hour: '',
|
||||
hourIndex: '',
|
||||
id: '',
|
||||
boxesId: '',
|
||||
bookingId: '',
|
||||
status: '',
|
||||
userId: '',
|
||||
bxDate: '',
|
||||
hour: '',
|
||||
hourIndex: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
})
|
||||
const dataRules = ref({});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
visible.value = true;
|
||||
form.id = '';
|
||||
|
||||
// 重置表单数据
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取boxesAvailability信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getboxesAvailabilityData(id)
|
||||
}
|
||||
// 获取boxesAvailability信息
|
||||
if (id) {
|
||||
form.id = id;
|
||||
getboxesAvailabilityData(id);
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
@@ -110,7 +106,7 @@ const onSubmit = async () => {
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
@@ -118,24 +114,25 @@ const onSubmit = async () => {
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getboxesAvailabilityData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
// 获取数据
|
||||
loading.value = true;
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,139 +1,147 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="状态 0空闲 1已使用" prop="status">
|
||||
<el-select v-model="state.queryForm.status" placeholder="请选择状态 0空闲 1已使用">
|
||||
<el-option :label="item.label" :value="item.value" v-for="(item, index) in booking_status" :key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_boxesAvailability_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'canteen_boxesAvailability_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_boxesAvailability_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="状态 0空闲 1已使用" prop="status">
|
||||
<el-select v-model="state.queryForm.status" placeholder="请选择状态 0空闲 1已使用">
|
||||
<el-option :label="item.label" :value="item.value" v-for="(item, index) in booking_status" :key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesAvailability_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'canteen_boxesAvailability_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'canteen_boxesAvailability_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="boxesId" label="包厢Id" show-overflow-tooltip/>
|
||||
<el-table-column prop="bookingId" label="预约id" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="状态 0空闲 1已使用" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="booking_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" label="用户id" show-overflow-tooltip/>
|
||||
<el-table-column prop="bxDate" label="格式为 YYYY-MM-DD" show-overflow-tooltip/>
|
||||
<el-table-column prop="hour" label="时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="hourIndex" label="时间索引(0-24)" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesAvailability_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesAvailability_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="boxesId" label="包厢Id" show-overflow-tooltip />
|
||||
<el-table-column prop="bookingId" label="预约id" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态 0空闲 1已使用" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="booking_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" label="用户id" show-overflow-tooltip />
|
||||
<el-table-column prop="bxDate" label="格式为 YYYY-MM-DD" show-overflow-tooltip />
|
||||
<el-table-column prop="hour" label="时间" show-overflow-tooltip />
|
||||
<el-table-column prop="hourIndex" label="时间索引(0-24)" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesAvailability_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesAvailability_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesAvailability">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesAvailability";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesAvailability';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { booking_status } = useDict('booking_status')
|
||||
const { booking_status } = useDict('booking_status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesAvailability/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesAvailability.xlsx')
|
||||
}
|
||||
downBlobFile('/canteen/boxesAvailability/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesAvailability.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,145 +1,143 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-input v-model="form.boxesId" placeholder="请输入包厢Id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-input v-model="form.boxesId" placeholder="请输入包厢Id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-input v-model="form.startTime" placeholder="请输入开始时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-input v-model="form.startTime" placeholder="请输入开始时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-input v-model="form.endTime" placeholder="请输入结束时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-input v-model="form.endTime" placeholder="请输入结束时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="审核人id" prop="checkUserId">
|
||||
<el-input v-model="form.checkUserId" placeholder="请输入审核人id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="审核人id" prop="checkUserId">
|
||||
<el-input v-model="form.checkUserId" placeholder="请输入审核人id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="1审核中 2通过 3驳回 4" prop="checkStatus">
|
||||
<el-select v-model="form.checkStatus" placeholder="请选择1审核中 2通过 3驳回 4">
|
||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in check_status" :key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="1审核中 2通过 3驳回 4" prop="checkStatus">
|
||||
<el-select v-model="form.checkStatus" placeholder="请选择1审核中 2通过 3驳回 4">
|
||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in check_status" :key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="创建人" prop="creator">
|
||||
<el-input v-model="form.creator" placeholder="请输入创建人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="创建人" prop="creator">
|
||||
<el-input v-model="form.creator" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="更新人" prop="updater">
|
||||
<el-input v-model="form.updater" placeholder="请输入更新人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="更新人" prop="updater">
|
||||
<el-input v-model="form.updater" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="是否删除" prop="deleted">
|
||||
<el-input v-model="form.deleted" placeholder="请输入是否删除"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="是否删除" prop="deleted">
|
||||
<el-input v-model="form.deleted" placeholder="请输入是否删除" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约日期" prop="bookingDate">
|
||||
<el-input v-model="form.bookingDate" placeholder="请输入预约日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约日期" prop="bookingDate">
|
||||
<el-input v-model="form.bookingDate" placeholder="请输入预约日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约状态(0 预约成功,1预约失败 2取消预约 )" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择预约状态(0 预约成功,1预约失败 2取消预约 )">
|
||||
<el-option label="请选择">0</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="总价单位分" prop="totalPrice">
|
||||
<el-input v-model="form.totalPrice" placeholder="请输入总价单位分"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="预约状态(0 预约成功,1预约失败 2取消预约 )" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择预约状态(0 预约成功,1预约失败 2取消预约 )">
|
||||
<el-option label="??" :value="0" />
|
||||
<el-option label="??" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="总价单位分" prop="totalPrice">
|
||||
<el-input v-model="form.totalPrice" placeholder="请输入总价单位分" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="BoxesBookingDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesBooking'
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesBooking';
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
// 定义字典
|
||||
const { check_status } = useDict('check_status')
|
||||
const { check_status } = useDict('check_status');
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
boxesId: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
checkUserId: '',
|
||||
checkStatus: '',
|
||||
creator: '',
|
||||
updater: '',
|
||||
deleted: '',
|
||||
bookingDate: '',
|
||||
userId: '',
|
||||
status: '',
|
||||
totalPrice: '',
|
||||
id: '',
|
||||
boxesId: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
checkUserId: '',
|
||||
checkStatus: '',
|
||||
creator: '',
|
||||
updater: '',
|
||||
deleted: '',
|
||||
bookingDate: '',
|
||||
userId: '',
|
||||
status: '',
|
||||
totalPrice: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
})
|
||||
const dataRules = ref({});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
visible.value = true;
|
||||
form.id = '';
|
||||
|
||||
// 重置表单数据
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取boxesBooking信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getboxesBookingData(id)
|
||||
}
|
||||
// 获取boxesBooking信息
|
||||
if (id) {
|
||||
form.id = id;
|
||||
getboxesBookingData(id);
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
@@ -148,7 +146,7 @@ const onSubmit = async () => {
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
@@ -156,24 +154,25 @@ const onSubmit = async () => {
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getboxesBookingData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
// 获取数据
|
||||
loading.value = true;
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,148 +1,148 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-select v-model="state.queryForm.boxesId" placeholder="请选择包厢Id">
|
||||
<el-option label="请选择">0</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId" >
|
||||
<el-input placeholder="请输入用户id" v-model="state.queryForm.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_boxesBooking_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'canteen_boxesBooking_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_boxesBooking_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="包厢Id" prop="boxesId">
|
||||
<el-select v-model="state.queryForm.boxesId" placeholder="请选择包厢Id">
|
||||
<el-option label="??" :value="0" />
|
||||
<el-option label="??" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input placeholder="请输入用户id" v-model="state.queryForm.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesBooking_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete(selectObjs)">
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'canteen_boxesBooking_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="boxesId" label="包厢Id" show-overflow-tooltip/>
|
||||
<el-table-column prop="startTime" label="开始时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="endTime" label="结束时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="checkUserId" label="审核人id" show-overflow-tooltip/>
|
||||
<el-table-column prop="checkStatus" label="1审核中 2通过 3驳回 4" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creator" label="创建人" show-overflow-tooltip/>
|
||||
<el-table-column prop="updater" label="更新人" show-overflow-tooltip/>
|
||||
<el-table-column prop="deleted" label="是否删除" show-overflow-tooltip/>
|
||||
<el-table-column prop="bookingDate" label="预约日期" show-overflow-tooltip/>
|
||||
<el-table-column prop="userId" label="用户id" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="预约状态(0 预约成功,1预约失败 2取消预约 )" show-overflow-tooltip/>
|
||||
<el-table-column prop="totalPrice" label="总价单位分" show-overflow-tooltip/>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesBooking_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="boxesId" label="包厢Id" show-overflow-tooltip />
|
||||
<el-table-column prop="startTime" label="开始时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="endTime" label="结束时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="checkUserId" label="审核人id" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="checkStatus" label="1审核中 2通过 3驳回 4" show-overflow-tooltip min-width="160">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creator" label="创建人" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="updater" label="更新人" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="deleted" label="是否删除" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="bookingDate" label="预约日期" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="userId" label="用户id" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="status" label="预约状态(0 预约成功,1预约失败 2取消预约 )" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="totalPrice" label="总价/单位分" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesBooking_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesBooking">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesBooking";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesBooking';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { check_status } = useDict('check_status')
|
||||
const { check_status } = useDict('check_status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesBooking/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesBooking.xlsx')
|
||||
}
|
||||
downBlobFile('/canteen/boxesBooking/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesBooking.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,122 +1,122 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商户" prop="merchantId">
|
||||
<el-select
|
||||
v-model="form.merchantId"
|
||||
placeholder="请选择商户"
|
||||
size="large"
|
||||
style="width: 240px; display: inline-block"
|
||||
:disabled="merchantStatus"
|
||||
>
|
||||
<el-option v-for="item in merchantInfo" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入包厢名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢图片" prop="images">
|
||||
<upload-img v-model="form.images"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="容纳人数" prop="capacity">
|
||||
<el-input v-model="form.capacity" placeholder="请输入容纳人数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商户" prop="merchantId">
|
||||
<el-select
|
||||
v-model="form.merchantId"
|
||||
placeholder="请选择商户"
|
||||
size="large"
|
||||
style="width: 240px; display: inline-block"
|
||||
:disabled="merchantStatus"
|
||||
>
|
||||
<el-option v-for="item in merchantInfo" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入包厢名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢图片" prop="images">
|
||||
<upload-img v-model="form.images"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="容纳人数" prop="capacity">
|
||||
<el-input v-model="form.capacity" placeholder="请输入容纳人数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="item.value" v-for="(item, index) in boxes_status" border :key="index">{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢地址" prop="address">
|
||||
<el-input type="textarea" v-model="form.address" placeholder="请输入包厢地址"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢描述" prop="description">
|
||||
<editor v-if="visible" v-model:get-html="form.description" placeholder="请输入包厢描述"></editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="包厢状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="item.value" v-for="(item, index) in boxes_status" border :key="index">{{ item.label }} </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢地址" prop="address">
|
||||
<el-input type="textarea" v-model="form.address" placeholder="请输入包厢地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="包厢描述" prop="description">
|
||||
<editor v-if="visible" v-model:get-html="form.description" placeholder="请输入包厢描述"></editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="BoxesInfoDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesInfo'
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/boxesInfo';
|
||||
import { rule } from '/@/utils/validate';
|
||||
import {selectMerchantList} from "/@/api/canteen/merchantInfo";
|
||||
import { selectMerchantList } from '/@/api/canteen/merchantInfo';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
//业务变量
|
||||
// const merchantId = ref()
|
||||
const merchantStatus = ref(true)
|
||||
const merchantInfo = ref([])
|
||||
const merchantStatus = ref(true);
|
||||
const merchantInfo = ref<any>([]);
|
||||
// 定义字典
|
||||
const { boxes_status } = useDict('boxes_status')
|
||||
const { boxes_status } = useDict('boxes_status');
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
capacity: '',
|
||||
description: '',
|
||||
address: '',
|
||||
images: '',
|
||||
status: '0',
|
||||
merchantId: '',
|
||||
id: '',
|
||||
name: '',
|
||||
capacity: '',
|
||||
description: '',
|
||||
address: '',
|
||||
images: '',
|
||||
status: '0',
|
||||
merchantId: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
name: [{required: true, message: '包厢名称不能为空', trigger: 'blur'}],
|
||||
capacity: [{required: true, message: '容纳人数不能为空', trigger: 'blur'}, { validator: rule.number, trigger: 'blur' }],
|
||||
images: [{required: true, message: '包厢图片不能为空', trigger: 'blur'}],
|
||||
})
|
||||
merchantId: [{ required: true, message: '商户不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '包厢名称不能为空', trigger: 'blur' }],
|
||||
capacity: [
|
||||
{ required: true, message: '容纳人数不能为空', trigger: 'blur' },
|
||||
{ validator: rule.number, trigger: 'blur' },
|
||||
],
|
||||
images: [{ required: true, message: '包厢图片不能为空', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
visible.value = true;
|
||||
form.id = '';
|
||||
|
||||
// 重置表单数据
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取boxesInfo信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getboxesInfoData(id)
|
||||
}
|
||||
//初始化商户信息
|
||||
merchantInit()
|
||||
// 获取boxesInfo信息
|
||||
if (id) {
|
||||
form.id = id;
|
||||
getboxesInfoData(id);
|
||||
}
|
||||
//初始化商户信息
|
||||
merchantInit();
|
||||
};
|
||||
|
||||
// 提交
|
||||
@@ -125,7 +125,7 @@ const onSubmit = async () => {
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
@@ -133,40 +133,37 @@ const onSubmit = async () => {
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getboxesInfoData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
// 获取数据
|
||||
loading.value = true;
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
const merchantInit = async () => {
|
||||
// 获取下拉框
|
||||
let res = await selectMerchantList("1")
|
||||
merchantInfo.value=res.data
|
||||
//默认选中第一个
|
||||
if (merchantInfo.value) {
|
||||
if (merchantInfo.value.length > 1) {
|
||||
merchantStatus.value = false
|
||||
}else {
|
||||
form.merchantId=merchantInfo.value[0].id
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
// 获取下拉框
|
||||
let res = await selectMerchantList('1');
|
||||
merchantInfo.value = res.data;
|
||||
//默认选中第一个
|
||||
if (merchantInfo.value) {
|
||||
if (merchantInfo.value.length > 1) {
|
||||
merchantStatus.value = false;
|
||||
} else {
|
||||
form.merchantId = merchantInfo.value[0].id;
|
||||
}
|
||||
}
|
||||
};
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
openDialog,
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,138 +1,137 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="包厢名称" prop="name" >
|
||||
<el-input placeholder="请输入包厢名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_boxesInfo_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'canteen_boxesInfo_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_boxesInfo_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="包厢名称" prop="name">
|
||||
<el-input placeholder="请输入包厢名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesInfo_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete(selectObjs)">
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'canteen_boxesInfo_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="包厢名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="capacity" label="容纳人数" show-overflow-tooltip/>
|
||||
<el-table-column prop="description" label="包厢描述" show-overflow-tooltip/>
|
||||
<el-table-column prop="address" label="包厢地址" show-overflow-tooltip/>
|
||||
<el-table-column prop="images" label="包厢图片" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="包厢状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="boxes_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="包厢价格单位分" show-overflow-tooltip/>
|
||||
<el-table-column prop="merchantId" label="商户id" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesInfo_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="包厢名称" show-overflow-tooltip />
|
||||
<el-table-column prop="capacity" label="容纳人数" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="包厢描述" show-overflow-tooltip />
|
||||
<el-table-column prop="address" label="包厢地址" show-overflow-tooltip />
|
||||
<el-table-column prop="images" label="包厢图片" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="包厢状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="boxes_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="包厢价格单位分" show-overflow-tooltip />
|
||||
<el-table-column prop="merchantId" label="商户id" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesInfo_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemBoxesInfo">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/canteen/boxesInfo";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/boxesInfo';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { boxes_status } = useDict('boxes_status')
|
||||
const { boxes_status } = useDict('boxes_status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/boxesInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesInfo.xlsx')
|
||||
}
|
||||
downBlobFile('/canteen/boxesInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesInfo.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,298 +1,291 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div style="margin-left: 4.5%;margin-top: 1.5%">
|
||||
<el-select
|
||||
v-model="merchantId"
|
||||
placeholder="请选择商户"
|
||||
size="large"
|
||||
style="width: 240px; display: inline-block"
|
||||
:disabled="merchantStatus"
|
||||
@change="merchantSelect"
|
||||
>
|
||||
<el-option v-for="item in merchantInfo" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<h1 class="title">今日菜谱</h1>
|
||||
</div>
|
||||
<table width="100%" class="titleTable">
|
||||
<tr class="trclass">
|
||||
<td @click="addClick(-1)"><</td>
|
||||
<td
|
||||
v-for="(item, index) in weekData.data"
|
||||
:key="index"
|
||||
@click="timeClick(item, index)"
|
||||
class="tdclass"
|
||||
:class="{ selectedSpan: isActive === index ? 'selected' : '' }"
|
||||
>
|
||||
<span>{{ item }}</span>
|
||||
</td>
|
||||
<td @click="addClick(1)">></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="dataDiv">
|
||||
<table :style="{ width: tableWitch + 'px' }" class="foodTable">
|
||||
<tr class="food">
|
||||
<td @click="addFood(1)"> 早餐</td>
|
||||
<td v-for="(item, index) in foodData1" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="food" style="margin: 0px 5px 5px 0px">
|
||||
<td @click="addFood(2)"> 中餐</td>
|
||||
<td v-for="(item, index) in foodData2" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="food">
|
||||
<td @click="addFood(3)"> 晚餐</td>
|
||||
<td v-for="(item, index) in foodData3" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @success="selectTimeFood" />
|
||||
</div>
|
||||
<div class="layout-padding">
|
||||
<div style="margin-left: 4.5%; margin-top: 1.5%">
|
||||
<el-select
|
||||
v-model="merchantId"
|
||||
placeholder="请选择商户"
|
||||
size="large"
|
||||
style="width: 240px; display: inline-block"
|
||||
:disabled="merchantStatus"
|
||||
@change="merchantSelect"
|
||||
>
|
||||
<el-option v-for="item in merchantInfo" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<h1 class="title">今日菜谱</h1>
|
||||
</div>
|
||||
<table width="100%" class="titleTable">
|
||||
<tr class="trclass">
|
||||
<td @click="addClick(-1)"><</td>
|
||||
<td
|
||||
v-for="(item, index) in weekData.data"
|
||||
:key="index"
|
||||
@click="timeClick(item, index)"
|
||||
class="tdclass"
|
||||
:class="{ selectedSpan: isActive === index ? 'selected' : '' }"
|
||||
>
|
||||
<span>{{ item }}</span>
|
||||
</td>
|
||||
<td @click="addClick(1)">></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="dataDiv">
|
||||
<table :style="{ width: tableWitch + 'px' }" class="foodTable">
|
||||
<tr class="food">
|
||||
<td @click="addFood(1)">早餐</td>
|
||||
<td v-for="(item, index) in foodData1" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="food" style="margin: 0px 5px 5px 0px">
|
||||
<td @click="addFood(2)">中餐</td>
|
||||
<td v-for="(item, index) in foodData2" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="food">
|
||||
<td @click="addFood(3)">晚餐</td>
|
||||
<td v-for="(item, index) in foodData3" :key="index">
|
||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @success="selectTimeFood" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemCanteenDailyMenu">
|
||||
import { delObjs ,selectTimeFoodApi,selectWeekInfo,} from "/@/api/canteen/canteenDailyMenu";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { delObjs, selectTimeFoodApi, selectWeekInfo } from '/@/api/canteen/canteenDailyMenu';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import {selectMerchantList} from "/@/api/canteen/merchantInfo";
|
||||
import { selectMerchantList } from '/@/api/canteen/merchantInfo';
|
||||
|
||||
// 引入组件
|
||||
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 loading = ref(true) // 列表的加载中
|
||||
const loading = ref(true); // 列表的加载中
|
||||
|
||||
// ---------新增业务变量
|
||||
const message = useMessage() // 消息弹窗
|
||||
const message = useMessage(); // 消息弹窗
|
||||
const weekData = reactive({
|
||||
data: []
|
||||
}) //时间数组
|
||||
data: [],
|
||||
}); //时间数组
|
||||
const weekParams = reactive({
|
||||
index: 0
|
||||
})
|
||||
const foodData1 = ref({})
|
||||
const foodData2 = ref({})
|
||||
const foodData3 = ref({})
|
||||
let isActive = ref(-1)
|
||||
let timedata = ''
|
||||
const merchantId = ref()
|
||||
const merchantStatus = ref(true)
|
||||
const merchantInfo = ref([])
|
||||
let tableWitch = 1000
|
||||
|
||||
index: 0,
|
||||
});
|
||||
const foodData1 = ref({});
|
||||
const foodData2 = ref({});
|
||||
const foodData3 = ref({});
|
||||
let isActive = ref(-1);
|
||||
let timedata = '';
|
||||
const merchantId = ref();
|
||||
const merchantStatus = ref(true);
|
||||
const merchantInfo = ref([]);
|
||||
let tableWitch = 1000;
|
||||
|
||||
const addFood = async (hourType: number) => {
|
||||
if (!merchantId.value) {
|
||||
useMessage().error('请选择商户再进行新增')
|
||||
return
|
||||
}
|
||||
//打开新增框
|
||||
formDialogRef.value.openDialog(null,timedata,hourType,merchantId.value)
|
||||
}
|
||||
if (!merchantId.value) {
|
||||
useMessage().error('请选择商户再进行新增');
|
||||
return;
|
||||
}
|
||||
//打开新增框
|
||||
formDialogRef.value.openDialog(null, timedata, hourType, merchantId.value);
|
||||
};
|
||||
//选中具体时间数据
|
||||
const timeClick = async (time: string, index: number) => {
|
||||
//数据查询操作
|
||||
if (time) {
|
||||
//时间处理
|
||||
time = time.substring(0, time.indexOf('('))
|
||||
timedata = time
|
||||
//选中
|
||||
isActive.value = index
|
||||
selectTimeFood()
|
||||
}
|
||||
}
|
||||
//数据查询操作
|
||||
if (time) {
|
||||
//时间处理
|
||||
time = time.substring(0, time.indexOf('('));
|
||||
timedata = time;
|
||||
//选中
|
||||
isActive.value = index;
|
||||
selectTimeFood();
|
||||
}
|
||||
};
|
||||
//切换时间
|
||||
const addClick = async (index: number) => {
|
||||
//数据值操作
|
||||
weekParams.index = weekParams.index + index
|
||||
fetchData()
|
||||
}
|
||||
//数据值操作
|
||||
weekParams.index = weekParams.index + index;
|
||||
fetchData();
|
||||
};
|
||||
const merchantSelect = async () => {
|
||||
// getList()
|
||||
fetchData()
|
||||
}
|
||||
// getList()
|
||||
fetchData();
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
let weekDataRes= await selectWeekInfo(weekParams);
|
||||
weekData.data = weekDataRes.data
|
||||
isActive.value = 0
|
||||
timedata = weekData.data[0]
|
||||
//时间格式
|
||||
timedata = timedata.substring(0, timedata.indexOf('('))
|
||||
selectTimeFood()
|
||||
}
|
||||
let weekDataRes = await selectWeekInfo(weekParams);
|
||||
weekData.data = weekDataRes.data;
|
||||
isActive.value = 0;
|
||||
timedata = weekData.data[0];
|
||||
//时间格式
|
||||
timedata = timedata.substring(0, timedata.indexOf('('));
|
||||
selectTimeFood();
|
||||
};
|
||||
|
||||
const selectTimeFood = async () => {
|
||||
foodData1.value = []
|
||||
foodData2.value = []
|
||||
foodData3.value = []
|
||||
tableWitch = 1000
|
||||
let params = {
|
||||
time: timedata,
|
||||
merchantId: merchantId.value
|
||||
}
|
||||
//最大长度
|
||||
let count = 0
|
||||
const result = await selectTimeFoodApi(params)
|
||||
result.data.forEach((r) => {
|
||||
if (r.dailyMenuVOS.length > count) {
|
||||
count = r.dailyMenuVOS.length
|
||||
}
|
||||
switch (r.hourType) {
|
||||
case 1:
|
||||
foodData1.value = r.dailyMenuVOS
|
||||
break
|
||||
case 2:
|
||||
foodData2.value = r.dailyMenuVOS
|
||||
break
|
||||
case 3:
|
||||
foodData3.value = r.dailyMenuVOS
|
||||
break
|
||||
}
|
||||
})
|
||||
if (count > 0) {
|
||||
tableWitch = count * 300 + 100
|
||||
} else {
|
||||
tableWitch = 600
|
||||
}
|
||||
|
||||
}
|
||||
foodData1.value = [];
|
||||
foodData2.value = [];
|
||||
foodData3.value = [];
|
||||
tableWitch = 1000;
|
||||
let params = {
|
||||
time: timedata,
|
||||
merchantId: merchantId.value,
|
||||
};
|
||||
//最大长度
|
||||
let count = 0;
|
||||
const result = await selectTimeFoodApi(params);
|
||||
result.data.forEach((r) => {
|
||||
if (r.dailyMenuVOS.length > count) {
|
||||
count = r.dailyMenuVOS.length;
|
||||
}
|
||||
switch (r.hourType) {
|
||||
case 1:
|
||||
foodData1.value = r.dailyMenuVOS;
|
||||
break;
|
||||
case 2:
|
||||
foodData2.value = r.dailyMenuVOS;
|
||||
break;
|
||||
case 3:
|
||||
foodData3.value = r.dailyMenuVOS;
|
||||
break;
|
||||
}
|
||||
});
|
||||
if (count > 0) {
|
||||
tableWitch = count * 300 + 100;
|
||||
} else {
|
||||
tableWitch = 600;
|
||||
}
|
||||
};
|
||||
/** 删除数据源按钮 */
|
||||
const delteData = async (tid: number) => {
|
||||
await message.delConfirm("确定删除菜品吗?",'今日菜品?')
|
||||
await delObjs(tid)
|
||||
message.success(('common.delSuccess'))
|
||||
selectTimeFood()
|
||||
}
|
||||
|
||||
|
||||
await message.delConfirm('确定删除菜品吗?', '今日菜品?');
|
||||
await delObjs(tid);
|
||||
message.success('common.delSuccess');
|
||||
selectTimeFood();
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
// getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
}
|
||||
/** 查询列表 */
|
||||
// const getList = async () => {
|
||||
// loading.value = true
|
||||
// try {
|
||||
// const data = await fetchList(queryParams)
|
||||
// list.value = data.list
|
||||
// total.value = data.total
|
||||
// } finally {
|
||||
// loading.value = false
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 初始化下拉框 */
|
||||
const merchantInit = async () => {
|
||||
// 获取下拉框
|
||||
let res = await selectMerchantList("1")
|
||||
merchantInfo.value=res.data
|
||||
//默认选中第一个
|
||||
if (merchantInfo.value) {
|
||||
merchantId.value = merchantInfo.value[0].id
|
||||
if (merchantInfo.value.length > 1) {
|
||||
merchantStatus.value = false
|
||||
}
|
||||
// getList()
|
||||
fetchData()
|
||||
|
||||
}
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
merchantInit()
|
||||
})
|
||||
try {
|
||||
await delObjs(ids);
|
||||
// getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
/** 查询列表 */
|
||||
// const getList = async () => {
|
||||
// loading.value = true
|
||||
// try {
|
||||
// const data = await fetchList(queryParams)
|
||||
// list.value = data.list
|
||||
// total.value = data.total
|
||||
// } finally {
|
||||
// loading.value = false
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 初始化下拉框 */
|
||||
const merchantInit = async () => {
|
||||
// 获取下拉框
|
||||
let res = await selectMerchantList('1');
|
||||
merchantInfo.value = res.data;
|
||||
//默认选中第一个
|
||||
if (merchantInfo.value) {
|
||||
merchantId.value = merchantInfo.value[0].id;
|
||||
if (merchantInfo.value.length > 1) {
|
||||
merchantStatus.value = false;
|
||||
}
|
||||
// getList()
|
||||
fetchData();
|
||||
}
|
||||
};
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
merchantInit();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.title {
|
||||
font-size: 28px;
|
||||
display: inline-block;
|
||||
margin-left: 25%;
|
||||
font-size: 28px;
|
||||
display: inline-block;
|
||||
margin-left: 25%;
|
||||
}
|
||||
|
||||
.titleTable {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin-top: 20px;
|
||||
cursor: pointer;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin-top: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tdclass {
|
||||
border: 1px solid rgb(233, 233, 233);
|
||||
width: 13%;
|
||||
height: 36px;
|
||||
text-align: center;
|
||||
background-color: white;
|
||||
border: 1px solid rgb(233, 233, 233);
|
||||
width: 13%;
|
||||
height: 36px;
|
||||
text-align: center;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.trclass > td:first-child {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
.trclass > td:last-child {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.foodTable {
|
||||
margin-top: 30px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.food td {
|
||||
width: 250px;
|
||||
height: 200px;
|
||||
display: inline-block;
|
||||
background-color: white;
|
||||
margin-left: 20px;
|
||||
cursor: pointer;
|
||||
width: 250px;
|
||||
height: 200px;
|
||||
display: inline-block;
|
||||
background-color: white;
|
||||
margin-left: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.imageCss {
|
||||
width: 250px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.food td:first-child {
|
||||
width: 60px;
|
||||
height: 200px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-left: 4%;
|
||||
background-color: transparent;
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
// text-decoration: blue underline;
|
||||
color: rgb(0, 118, 228);
|
||||
cursor: pointer;
|
||||
width: 60px;
|
||||
height: 200px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-left: 4%;
|
||||
background-color: transparent;
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
// text-decoration: blue underline;
|
||||
color: rgb(0, 118, 228);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dataDiv {
|
||||
overflow-x: auto;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.selectedSpan {
|
||||
border: 1px solid rgb(255, 187, 0);
|
||||
color: rgb(255, 187, 0);
|
||||
border: 1px solid rgb(255, 187, 0);
|
||||
color: rgb(255, 187, 0);
|
||||
}
|
||||
</style>
|
||||
@@ -2,12 +2,6 @@
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="父分类编号" prop="parentId">-->
|
||||
<!-- <el-input v-model="form.parentId" placeholder="请输入父分类编号"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户" prop="merchantId">
|
||||
<el-select v-model="form.merchantId" placeholder="请选择商户" style="width: 240px">
|
||||
@@ -15,25 +9,21 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称" />
|
||||
</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="12" class="mb20">
|
||||
<el-form-item label="分类排序" prop="sort">
|
||||
<el-input-number v-model="form.sort" placeholder="请输入分类排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="开启状态" prop="status">-->
|
||||
<!-- <el-radio-group v-model="form.status">-->
|
||||
@@ -41,12 +31,6 @@
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="部门id" prop="deptId">-->
|
||||
<!-- <el-input v-model="form.deptId" placeholder="请输入部门id"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -59,7 +43,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="CanteenOnlineCategoryDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/canteenOnlineCategory';
|
||||
import { selectMerchantList } from '/@/api/canteen/merchantInfo';
|
||||
@@ -79,7 +62,7 @@ const form = reactive({
|
||||
parentId: '',
|
||||
name: '',
|
||||
picUrl: '',
|
||||
sort: '',
|
||||
sort: 0,
|
||||
status: '',
|
||||
deptId: '',
|
||||
});
|
||||
|
||||
@@ -1,130 +1,147 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="分类名称" prop="name" >
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_canteenOnlineCategory_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'canteen_canteenOnlineCategory_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_canteenOnlineCategory_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_canteenOnlineCategory_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenOnlineCategory_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'canteen_canteenOnlineCategory_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="分类排序" show-overflow-tooltip/>
|
||||
<!-- <el-table-column prop="status" label="开启状态" show-overflow-tooltip/>-->
|
||||
<!-- <el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>-->
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenOnlineCategory_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineCategory_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip />
|
||||
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<preview-image style="width: 50px; height: 50px" :src="imageBaseUrl + scope.row.picUrl" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="分类排序" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="status" label="开启状态" show-overflow-tooltip /> -->
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenOnlineCategory_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineCategory_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemCanteenOnlineCategory">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/canteen/canteenOnlineCategory";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/canteenOnlineCategory';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
|
||||
const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH;
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/canteenOnlineCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenOnlineCategory.xlsx')
|
||||
}
|
||||
downBlobFile('/canteen/canteenOnlineCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenOnlineCategory.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :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="110px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商户" prop="merchantId">
|
||||
@@ -14,15 +14,14 @@
|
||||
<el-input v-model="form.name" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商品分类" prop="categoryId">
|
||||
<el-select v-model="form.categoryId" placeholder="请选择商品分类">
|
||||
<el-option label="请选择">0</el-option>
|
||||
<el-option label="??" :value="0" />
|
||||
<el-option label="??" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商品价格" prop="price">
|
||||
<el-input-number v-model="form.price" placeholder="请输入商品价格" />
|
||||
@@ -43,19 +42,16 @@
|
||||
<upload-img v-model="form.picUrl"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品轮播图" prop="sliderPicUrls">
|
||||
<upload-imgs v-model="form.sliderPicUrls"></upload-imgs>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="排序字段" prop="sort">
|
||||
<el-input-number v-model="form.sort" placeholder="请输入排序字段" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商品状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
@@ -63,12 +59,6 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="部门id" prop="deptId">-->
|
||||
<!-- <el-input v-model="form.deptId" placeholder="请输入部门id"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品详情" prop="description">
|
||||
<editor v-if="visible" v-model:get-html="form.description" placeholder="请输入商品详情"></editor>
|
||||
@@ -111,11 +101,11 @@ const form = reactive({
|
||||
categoryId: '',
|
||||
picUrl: '',
|
||||
sliderPicUrls: '',
|
||||
sort: '',
|
||||
sort: 0,
|
||||
status: '0',
|
||||
price: '',
|
||||
marketPrice: '',
|
||||
stock: '',
|
||||
price: 0,
|
||||
marketPrice: 0,
|
||||
stock: 0,
|
||||
giveIntegral: '',
|
||||
salesCount: '',
|
||||
virtualSalesCount: '',
|
||||
|
||||
@@ -1,145 +1,159 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="商品名称" prop="name" >
|
||||
<el-input placeholder="请输入商品名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类编号" prop="categoryId">
|
||||
<el-select v-model="state.queryForm.categoryId" placeholder="请选择商品分类编号">
|
||||
<el-option label="请选择">0</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'canteen_canteenOnlineSpu_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'canteen_canteenOnlineSpu_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'canteen_canteenOnlineSpu_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input placeholder="请输入商品名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类编号" prop="categoryId">
|
||||
<el-select v-model="state.queryForm.categoryId" placeholder="请选择商品分类编号">
|
||||
<el-option label="??" :value="0" />
|
||||
<el-option label="??" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_canteenOnlineSpu_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'canteen_canteenOnlineSpu_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'canteen_canteenOnlineSpu_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="商品名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="categoryId" label="商品分类" show-overflow-tooltip/>
|
||||
<el-table-column prop="picUrl" label="商品封面图" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="排序字段" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="商品上下架" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="spu_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="商品价格" show-overflow-tooltip/>
|
||||
<el-table-column prop="marketPrice" label="市场价" show-overflow-tooltip/>
|
||||
<el-table-column prop="stock" label="库存" show-overflow-tooltip/>
|
||||
<el-table-column prop="salesCount" label="商品销量" show-overflow-tooltip/>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenOnlineSpu_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineSpu_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="name" label="商品名称" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="categoryId" label="商品分类" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="picUrl" label="商品封面图" show-overflow-tooltip min-width="100">
|
||||
<template #default="scope">
|
||||
<preview-image style="width: 50px; height: 50px" :src="imageBaseUrl + scope.row.picUrl" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序字段" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="status" label="商品上下架" show-overflow-tooltip min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="spu_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="商品价格" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="marketPrice" label="市场价" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="stock" label="库存" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="salesCount" label="商品销量" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenOnlineSpu_edit'" @click="formDialogRef.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineSpu_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemCanteenOnlineSpu">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/canteen/canteenOnlineSpu";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/canteen/canteenOnlineSpu';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH;
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { spu_status } = useDict('spu_status')
|
||||
const { spu_status } = useDict('spu_status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/canteen/canteenOnlineSpu/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenOnlineSpu.xlsx')
|
||||
}
|
||||
downBlobFile('/canteen/canteenOnlineSpu/export', Object.assign(state.queryForm, { ids: selectObjs }), 'canteenOnlineSpu.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -4,9 +4,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户" prop="merchantId">
|
||||
<el-select v-model="form.merchantId" placeholder="请选择商户" style="width: 240px">
|
||||
<el-option v-for="item in merchantInfo" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<select-mch v-model="form.merchantId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
@@ -106,7 +104,6 @@ import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/canteen/canteenSpu';
|
||||
import { getAllSimple } from '/@/api/canteen/canteenCategory';
|
||||
import { rule } from '/@/utils/validate';
|
||||
import { selectMerchantList } from '/@/api/canteen/merchantInfo';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
@@ -115,7 +112,6 @@ const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
// 定义字典
|
||||
const { spu_status } = useDict('spu_status');
|
||||
const merchantInfo = ref<any>([]); // 商户信息
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
@@ -163,17 +159,6 @@ const openDialog = async (id: string) => {
|
||||
// 重置表单数据
|
||||
dataFormRef.value?.resetFields();
|
||||
|
||||
if (merchantInfo.value.length <= 0) {
|
||||
try {
|
||||
// 获取商户下拉框选项
|
||||
const res = await selectMerchantList('1');
|
||||
merchantInfo.value = res.data;
|
||||
} catch (error) {
|
||||
merchantInfo.value = [];
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取canteenSpu信息
|
||||
if (id) {
|
||||
form.id = id;
|
||||
@@ -185,7 +170,7 @@ const openDialog = async (id: string) => {
|
||||
const onSubmit = async () => {
|
||||
console.log(form);
|
||||
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
const valid = await dataFormRef?.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类编号" prop="categoryId">
|
||||
<el-select v-model="state.queryForm.categoryId" placeholder="请选择商品分类编号">
|
||||
<el-option label="请选择">0</el-option>
|
||||
<el-option label="??" :value="0" />
|
||||
<el-option label="??" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -23,7 +24,7 @@
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_canteenSpu_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -70,9 +71,9 @@
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenSpu_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenSpu_edit'" @click="formDialogRef?.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenSpu_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -76,7 +76,7 @@ onMounted(async () => {
|
||||
.card {
|
||||
padding: 5vw;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(0deg, #ffffff 0%, #d3f9f1aa 100%);
|
||||
background-image: linear-gradient(0deg, #ffffff 0%, #f3f6ff 100%);
|
||||
}
|
||||
.nav-menu-item-top {
|
||||
height: 6.5vw;
|
||||
|
||||
@@ -36,25 +36,18 @@
|
||||
<mobile v-if="loginType === LoginTypeEnum.MOBILE" @signInSuccess="signInSuccess" @change="changeLoginType" />
|
||||
<expire v-if="loginType === LoginTypeEnum.EXPIRE" :username="username" @change="changeLoginType" />
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="flex items-center justify-center my-6 space-x-3">
|
||||
<span class="w-20 h-[1.5px] bg-gray-200 dark:bg-slate-600"></span>
|
||||
<span class="text-gray-600 dark:text-slate-400">{{ $t('divider.or') }}</span>
|
||||
<span class="w-20 h-[1.5px] bg-gray-200 dark:bg-slate-600"></span>
|
||||
</div>
|
||||
|
||||
<!-- 社交登录 -->
|
||||
<social @signInSuccess="signInSuccess" />
|
||||
<!-- <social @signInSuccess="signInSuccess" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 小程序二维码 -->
|
||||
<Qrcode />
|
||||
<!-- <Qrcode /> -->
|
||||
|
||||
<!-- Footer 组件 -->
|
||||
<Footer />
|
||||
<!-- <Footer /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,50 +1,59 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'mch_mchManage_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'mch_mchManage_del'"
|
||||
@click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'mch_mchManage_export'" @exportExcel="exportExcel"
|
||||
class="ml10 mr20" style="float: right;" @queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="deptId" label="绑定的部门id" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="商户名" show-overflow-tooltip />
|
||||
<el-table-column prop="types" label="店铺类型,逗号分隔" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'mch_mchManage_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'mch_mchManage_del'"
|
||||
@click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'mch_mchManage_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'mch_mchManage_del'" @click="handleDelete(selectObjs)">
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'mch_mchManage_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="deptId" label="绑定的部门id" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="商户名" show-overflow-tooltip />
|
||||
<el-table-column prop="types" label="店铺类型,逗号分隔" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'mch_mchManage_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'mch_mchManage_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemMchManage">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "../../../api/mch/mch-manage";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '../../../api/mch/mch-manage';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
@@ -52,63 +61,56 @@ const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/mch/mchManage/export', Object.assign(state.queryForm, { ids: selectObjs }), 'mchManage.xlsx')
|
||||
}
|
||||
downBlobFile('/mch/mchManage/export', Object.assign(state.queryForm, { ids: selectObjs }), 'mchManage.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,131 +1,129 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入品牌名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" 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="picUrl">
|
||||
<upload-img v-model="form.picUrl"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌图片" prop="picUrl">
|
||||
<upload-img v-model="form.picUrl"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌排序" prop="sort">
|
||||
<el-input-number :min="1" :max="1000" v-model="form.sort" placeholder="请输入品牌排序"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌排序" prop="sort">
|
||||
<el-input-number :min="1" :max="1000" v-model="form.sort" placeholder="请输入品牌排序"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌描述" prop="description">
|
||||
<el-input v-model="form.description" placeholder="请输入品牌描述"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="品牌描述" prop="description">
|
||||
<el-input v-model="form.description" placeholder="请输入品牌描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="item.value" v-for="(item, index) in status" border :key="index">{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="item.value" v-for="(item, index) in status" border :key="index">{{ item.label }} </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="SupermarketBrandDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/supermarket/supermarketBrand'
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import { getObj, addObj, putObj } from '/@/api/supermarket/supermarketBrand';
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
// 定义字典
|
||||
const { status } = useDict('status')
|
||||
const { status } = useDict('status');
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
picUrl: '',
|
||||
sort: 0,
|
||||
description: '',
|
||||
status: '',
|
||||
id: '',
|
||||
name: '',
|
||||
picUrl: '',
|
||||
sort: 0,
|
||||
description: '',
|
||||
status: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
name: [{required: true, message: '品牌名称不能为空', trigger: 'blur'}],
|
||||
sort: [{ validator: rule.number, trigger: 'blur' }],
|
||||
})
|
||||
name: [{ required: true, message: '品牌名称不能为空', trigger: 'blur' }],
|
||||
sort: [{ validator: rule.number, trigger: 'blur' }],
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
visible.value = true;
|
||||
form.id = '';
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取supermarketBrand信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getsupermarketBrandData(id)
|
||||
}
|
||||
// 获取supermarketBrand信息
|
||||
if (id) {
|
||||
form.id = id;
|
||||
getsupermarketBrandData(id);
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getsupermarketBrandData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
// 获取数据
|
||||
loading.value = true;
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
@@ -1,135 +1,155 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="品牌名称" prop="name" >
|
||||
<el-input placeholder="请输入品牌名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'supermarket_supermarketBrand_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'supermarket_supermarketBrand_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'supermarket_supermarketBrand_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="品牌名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="picUrl" label="品牌图片" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="品牌排序" show-overflow-tooltip/>
|
||||
<el-table-column prop="description" label="品牌描述" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'supermarket_supermarketBrand_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketBrand_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="品牌名称" prop="name">
|
||||
<el-input placeholder="请输入品牌名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'supermarket_supermarketBrand_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketBrand_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'supermarket_supermarketBrand_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="name" label="品牌名称" show-overflow-tooltip />
|
||||
<el-table-column prop="picUrl" label="品牌图片" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<preview-image style="width: 50px; height: 50px" :src="imageBaseUrl + scope.row.picUrl" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="品牌排序" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="品牌描述" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketBrand_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketBrand_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSupermarketBrand">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/supermarket/supermarketBrand";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/supermarket/supermarketBrand';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 图片基础路径
|
||||
const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH;
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { status } = useDict('status')
|
||||
const { status } = useDict('status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/supermarket/supermarketBrand/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketBrand.xlsx')
|
||||
}
|
||||
downBlobFile('/supermarket/supermarketBrand/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketBrand.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,136 +1,150 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="分类名称" prop="name" >
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'supermarket_supermarketCategory_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'supermarket_supermarketCategory_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'supermarket_supermarketCategory_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'supermarket_supermarketCategory_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketCategory_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'supermarket_supermarketCategory_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="parentId" label="父分类编号" show-overflow-tooltip/>
|
||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="分类排序" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="开启状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'supermarket_supermarketCategory_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketCategory_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="parentId" label="父分类编号" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip />
|
||||
<el-table-column prop="picUrl" label="分类图" show-overflow-tooltip />
|
||||
<el-table-column prop="sort" label="分类排序" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="开启状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_supermarketCategory_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_supermarketCategory_del'" @click="handleDelete([scope.row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemSupermarketCategory">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/supermarket/supermarketCategory";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { fetchList, delObjs } from '/@/api/supermarket/supermarketCategory';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { status } = useDict('status')
|
||||
const { status } = useDict('status');
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const formDialogRef = ref();
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const selectObjs = ref([]) as any;
|
||||
const multiple = ref(true);
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields();
|
||||
// 清空多选
|
||||
selectObjs.value = [];
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/supermarket/supermarketCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketCategory.xlsx')
|
||||
}
|
||||
downBlobFile('/supermarket/supermarketCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'supermarketCategory.xlsx');
|
||||
};
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -7,15 +7,6 @@
|
||||
<el-input v-model="form.barCode" placeholder="请输入条码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">
|
||||
<el-form-item label="spuID" prop="spuId">
|
||||
<el-select v-model="form.spuId" placeholder="请选择spuID">
|
||||
<el-option label="1234" value="1234"></el-option>
|
||||
<el-option label="5678" value="5678"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -30,8 +21,6 @@
|
||||
<script setup lang="ts" name="SupermarketAuxiliaryCodeDialog">
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
// import { useMessage } from '/@/hooks/message';
|
||||
// import { getObj, addObj, putObj } from '/@/api/supermarket/supermarketAuxiliaryCode';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
|
||||
@@ -78,8 +78,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
// import { fetchList, delObjs } from '/@/api/supermarket/supermarketAuxiliaryCode';
|
||||
// import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
|
||||
const supermarketAuxiliaryCodeEntityList = defineModel<any>('supermarketAuxiliaryCodeEntityList', { default: [] });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :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="110px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="条码" prop="barCode">
|
||||
@@ -72,8 +72,6 @@
|
||||
<script setup lang="ts" name="SupermarketAuxiliaryCodeDialog">
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
// import { useMessage } from '/@/hooks/message';
|
||||
// import { getObj, addObj, putObj } from '/@/api/supermarket/supermarketUnit';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
|
||||
@@ -91,8 +91,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
// import { fetchList, delObjs } from '/@/api/supermarket/supermarketUnit';
|
||||
// import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
|
||||
const supermarketUnitEntityList = defineModel<any>('supermarketUnitEntityList', { default: [] });
|
||||
|
||||
@@ -156,11 +156,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" class="mb20 pr-10">-->
|
||||
<!-- <el-form-item label="商品简介" prop="introduction">-->
|
||||
<!-- <el-input type="textarea" v-model="form.introduction" rows="4" placeholder="请输入商品简介" maxlength="400" show-word-limit />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="24" class="mb20 pr-10">
|
||||
<el-form-item label="商品简介" prop="introduction">
|
||||
<el-input type="textarea" v-model="form.introduction" rows="4" placeholder="请输入商品简介" maxlength="400" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="24" class="mb20 pr-10">
|
||||
<el-form-item label="商品详情" prop="description">
|
||||
<editor v-if="visible" v-model:get-html="form.description" placeholder="请输入商品详情"></editor>
|
||||
@@ -309,7 +309,7 @@ const openDialog = async (id: string) => {
|
||||
getsupermarketSpuData(id);
|
||||
}
|
||||
|
||||
// 获取分类选项
|
||||
// 获取分类下拉选项
|
||||
if (categoryOptions.value.length <= 0) {
|
||||
try {
|
||||
const res = await getSupermarketCategory();
|
||||
@@ -319,7 +319,7 @@ const openDialog = async (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取品牌选项
|
||||
// 获取品牌下拉选项
|
||||
if (brandOptions.value.length <= 0) {
|
||||
try {
|
||||
const res = await getSupermarketBrand();
|
||||
@@ -329,7 +329,7 @@ const openDialog = async (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取货商选项
|
||||
// 获取货商下拉选项
|
||||
if (supplierOptions.value.length <= 0) {
|
||||
try {
|
||||
const res = await getSupplierTypeOptions();
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" fixed="left" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column type="index" label="#" width="50" fixed="left" />
|
||||
<el-table-column prop="productCode" label="货号" show-overflow-tooltip />
|
||||
<el-table-column prop="barcode" label="自编码/条码" show-overflow-tooltip width="100" />
|
||||
<el-table-column prop="productName" label="商品名称" show-overflow-tooltip width="100" />
|
||||
@@ -73,16 +73,16 @@
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="costPrice" label="成本单价" show-overflow-tooltip width="100" />-->
|
||||
<!-- <el-table-column prop="costPrice" label="成本单价" show-overflow-tooltip width="100" /> -->
|
||||
<el-table-column prop="stock" label="库存" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="giveIntegral" label="赠送积分" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="merchantId" label="商户编号" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="specification" label="规格" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="specification" label="规格" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="origin" label="产地" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="packingQuantity" label="装数" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="purchasePrice" label="进价)" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="retailPrice" label="零售价" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="promotionPrice" label="促销价" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="packingQuantity" label="装数" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="purchasePrice" label="进价)" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="retailPrice" label="零售价" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column prop="promotionPrice" label="促销价" show-overflow-tooltip /> -->
|
||||
<el-table-column prop="productNature" label="商品性质" show-overflow-tooltip width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="supermarket_nature" :value="scope.row.productNature"></dict-tag>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<el-input placeholder="请输入联系人" v-model="state.queryForm.linkName" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
|
||||
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -31,7 +31,7 @@
|
||||
v-auth="'supermarketerp_smErpSupplier_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删除
|
||||
删 除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -52,29 +52,29 @@
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="supplierName" label="货商名称" show-overflow-tooltip />
|
||||
<el-table-column type="selection" width="40" align="center" fixed="left" />
|
||||
<el-table-column type="index" label="#" width="50" fixed="left" />
|
||||
<el-table-column prop="supplierName" label="货商名称" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="phone" label="电话号码" show-overflow-tooltip />
|
||||
<el-table-column prop="tax" label="税号" show-overflow-tooltip />
|
||||
<el-table-column prop="linkName" label="联系人" show-overflow-tooltip />
|
||||
<el-table-column prop="openAccount" label="开户行账号" show-overflow-tooltip />
|
||||
<el-table-column prop="supplierType" label="货商类别" show-overflow-tooltip>
|
||||
<el-table-column prop="supplierType" label="货商类别" show-overflow-tooltip min-width="160">
|
||||
<template #default="scope">{{
|
||||
supplierType.length > 0 && supplierType.find((item: any) => item.id == scope.row.supplierType).typeName
|
||||
supplierType.length > 0 && supplierType?.find((item: any) => item.id == scope.row.supplierType)?.typeName
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierArea" label="货商地区" show-overflow-tooltip />
|
||||
<el-table-column prop="openName" label="开户行" show-overflow-tooltip />
|
||||
<el-table-column prop="contractNumber" label="合同号" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip>
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pinyinCod" label="拼音简码" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
|
||||
Reference in new issue
Block a user