|
@@ -2,18 +2,21 @@
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<!-- 搜索工作栏 -->
|
|
<!-- 搜索工作栏 -->
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
- <el-form-item label="商品分类" prop="goodsTypeId">
|
|
|
|
- <el-input v-model="queryParams.goodsTypeId" placeholder="请输入商品分类" clearable @keyup.enter.native="handleQuery"/>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="商品名称" prop="goodsName">
|
|
<el-form-item label="商品名称" prop="goodsName">
|
|
<el-input v-model="queryParams.goodsName" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery"/>
|
|
<el-input v-model="queryParams.goodsName" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="商品价格" prop="goodsPrice">
|
|
|
|
|
|
+ <!-- <el-form-item label="商品价格" prop="goodsPrice">
|
|
<el-input v-model="queryParams.goodsPrice" placeholder="请输入商品价格" clearable @keyup.enter.native="handleQuery"/>
|
|
<el-input v-model="queryParams.goodsPrice" placeholder="请输入商品价格" clearable @keyup.enter.native="handleQuery"/>
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="创建时间" prop="createTime">
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+ <!-- <el-form-item label="创建时间" prop="createTime">
|
|
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
|
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+ <el-form-item label="商品分类" prop="goodsTypeId">
|
|
|
|
+ <!-- <el-input v-model="queryParams.goodsTypeId" placeholder="请输入商品分类Id" clearable @keyup.enter.native="handleQuery"/> -->
|
|
|
|
+ <el-select v-model="queryParams.goodsTypeId" placeholder="请选择商品分类">
|
|
|
|
+ <el-option v-for="item in typeArray" :key="item.id" :label="item.goodsTypeName" :value="item.id" />
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
@@ -25,32 +28,36 @@
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
|
|
- v-hasPermi="['restaurant:restaurant:create']">新增</el-button>
|
|
|
|
|
|
+ v-hasPermi="['restaurant:goods:create']">新增</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
|
- v-hasPermi="['restaurant:restaurant:export']">导出</el-button>
|
|
|
|
|
|
+ v-hasPermi="['restaurant:goods:export']">导出</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
- <el-table-column label="商品编号" align="center" prop="id" />
|
|
|
|
- <el-table-column label="商品分类" align="center" prop="goodsTypeId" />
|
|
|
|
|
|
+ <!-- <el-table-column label="商品编号" align="center" prop="id" /> -->
|
|
<el-table-column label="商品名称" align="center" prop="goodsName" />
|
|
<el-table-column label="商品名称" align="center" prop="goodsName" />
|
|
- <el-table-column label="商品价格" align="center" prop="goodsPrice" />
|
|
|
|
- <el-table-column label="商品图标" align="center" prop="goodsIcon" />
|
|
|
|
|
|
+ <el-table-column label="商品价格" align="center" prop="goodsPrice" >
|
|
|
|
+ <template v-slot="scope">
|
|
|
|
+ <span>{{ scope.row.goodsPrice}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- <el-table-column label="商品图标" align="center" prop="goodsIcon" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
|
|
+ </el-table-column> -->
|
|
|
|
+ <!-- <el-table-column label="商品分类Id" align="center" prop="goodsTypeId" /> -->
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
|
- v-hasPermi="['restaurant:restaurant:update']">修改</el-button>
|
|
|
|
|
|
+ v-hasPermi="['restaurant:goods:update']">修改</el-button>
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
- v-hasPermi="['restaurant:restaurant:delete']">删除</el-button>
|
|
|
|
|
|
+ v-hasPermi="['restaurant:goods:delete']">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -63,7 +70,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import * as GoodsApi from '@/api/restaurant/restaurant';
|
|
|
|
|
|
+import * as GoodsApi from '@/api/restaurant/goods';
|
|
|
|
+import * as TypeApi from '@/api/restaurant/type';
|
|
import GoodsForm from './GoodsForm.vue';
|
|
import GoodsForm from './GoodsForm.vue';
|
|
export default {
|
|
export default {
|
|
name: "Goods",
|
|
name: "Goods",
|
|
@@ -92,18 +100,29 @@ export default {
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- goodsTypeId: null,
|
|
|
|
goodsName: null,
|
|
goodsName: null,
|
|
goodsPrice: null,
|
|
goodsPrice: null,
|
|
goodsIcon: null,
|
|
goodsIcon: null,
|
|
createTime: [],
|
|
createTime: [],
|
|
|
|
+ goodsTypeId: null,
|
|
},
|
|
},
|
|
|
|
+ typeArray:[],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ this.getType()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async getType(){
|
|
|
|
+ try {
|
|
|
|
+ const res = await TypeApi.getTypePage(this.queryParams);
|
|
|
|
+ this.typeArray = res.data.list;
|
|
|
|
+ } finally {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
/** 查询列表 */
|
|
/** 查询列表 */
|
|
async getList() {
|
|
async getList() {
|
|
try {
|
|
try {
|