菜品管理,客户反馈

This commit is contained in:
zzyuan 2025-05-28 15:48:48 +08:00
parent bf5467765a
commit 86a9767b60
7 changed files with 192 additions and 456 deletions

View File

@ -101,7 +101,7 @@ import request from '@/utils/request'
// 投诉建议列表
export function getPlaintByPageApi(data) {
return request({
url: '/smart-canteen/alloc_canteen_suggestion/list',
url: '/smart-canteen/basic_canteen_suggestion/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
@ -112,7 +112,7 @@ export function getPlaintByPageApi(data) {
// 回复-投诉建议
export function replyComplaintApi(data) {
return request({
url: '/smart-canteen/alloc_canteen_suggestion/reply',
url: '/smart-canteen/basic_canteen_suggestion/reply',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -126,22 +126,18 @@ export function replyComplaintApi(data) {
// 订单评价列表
export function getOrderEvaluatePageApi(data) {
return request({
url: '/smart-canteen/api/v1/applet/menuevaluaorder/page/evaluate/order',
method: 'post',
url: '/smart-canteen/cook_evalua_order/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data,
params:{
pageNum:data.pageNum,
pageSize:data.pageSize
}
params: data
})
}
// 订单评价-回复
export function orderEvaluateReplyApi(data) {
return request({
url: '/smart-canteen/api/v1/applet/menuevaluaorder/add/evalua/reply',
url: '/smart-canteen/cook_evalua_order/reply',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -157,7 +153,7 @@ export function orderEvaluateReplyApi(data) {
// 食堂评价列表
export function getCanteenEvaluatePageApi(data) {
return request({
url: '/smart-canteen/alloc_canteen_evaluate/list',
url: '/smart-canteen/basic_canteen_evaluate/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
@ -165,33 +161,8 @@ export function getCanteenEvaluatePageApi(data) {
params: data
})
}
// 食堂评价-详情
export function getCanteenEvaluateDetailApi(data) {
return request({
url: '/smart-canteen/api/v1/canteen/evaluate/get-evaluate-detail',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 评价统计列表
export function getEvaluateCountPageApi(data) {
return request({
url: '/smart-canteen/api/v1/canteen/evaluate/page-evaluate-count',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data,
params:{
pageNum:data.pageNum,
pageSize:data.pageSize
}
})
}

View File

@ -1,42 +1,22 @@
import request from '@/utils/request'
// 查询菜品灶类列表 key
// dishes_cook 菜品灶类
// dishes_label 菜品标签
// dishes_taste 菜品口味
// dishes_effec 菜品功效
// dishes_style 菜品菜系
// dishes_suitId 适宜人群
// dishes_meal 餐次
// dishes_season 事宜季节
export function getDishesTypeListApi(data) {
return request({
url: '/smart-canteen/menu_dishes/getDishesType',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 菜品种类-全量数据
export function menuDishesTypeAllListApi(data) {
return request({
url: '/smart-canteen/menu_material/getAllMenuDishesTypeList',
method: 'post',
url: '/smart-canteen/cook_dishes_type/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
// 菜品种类-新增 areaId typeName
export function addMenuDishesTypeApi(data) {
return request({
url: '/smart-canteen/menu_material/addMenuDishesType',
url: '/smart-canteen/cook_dishes_type/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -47,7 +27,7 @@ export function addMenuDishesTypeApi(data) {
// 菜品种类-修改 areaId typeId typeName
export function editMenuDishesTypeApi(data) {
return request({
url: '/smart-canteen/menu_material/updateMenuDishesType',
url: '/smart-canteen/cook_dishes_type/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -58,12 +38,11 @@ export function editMenuDishesTypeApi(data) {
// 菜品种类-删除 typeId
export function removeMenuDishesTypeApi(data) {
return request({
url: '/smart-canteen/menu_material/delMenuDishesType',
url: '/smart-canteen/cook_dishes_type/del/'+data.dishesTypeId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
}
})
}
@ -72,22 +51,18 @@ export function removeMenuDishesTypeApi(data) {
// 菜品列表-分页
export function getMenuDishesListApi(data) {
return request({
url: '/smart-canteen/menu_dishes/list',
method: 'post',
url: '/smart-canteen/cook_dishes/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data,
params:{
pageNum:data.pageNum,
pageSize:data.pageSize
}
params: data
})
}
// 菜品列表-新增
export function addMenuDishesApi(data) {
return request({
url: '/smart-canteen/menu_dishes/addMenuDishes',
url: '/smart-canteen/cook_dishes/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -98,7 +73,7 @@ export function addMenuDishesApi(data) {
// 菜品列表-修改
export function editMenuDishesApi(data) {
return request({
url: '/smart-canteen/menu_dishes/deitMenuDishes',
url: '/smart-canteen/cook_dishes/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -109,24 +84,22 @@ export function editMenuDishesApi(data) {
// 菜品列表-详情
export function menuDishesDetailApi(data) {
return request({
url: '/smart-canteen/menu_dishes/check',
method: 'post',
url: '/smart-canteen/cook_dishes/getInfo/'+data.dishesId,
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
}
})
}
// 菜品列表-删除
export function removeMenuDishesApi(data) {
return request({
url: '/smart-canteen/menu_dishes/del',
url: '/smart-canteen/cook_dishes/del/'+data.dishesId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
}
})
}

View File

@ -42,7 +42,7 @@
</template>
</el-table-column>
<el-table-column label="投诉人" align="center" prop="createBy" :show-overflow-tooltip="true"/>
<el-table-column label="用户手机号" align="center" prop="mobile" :show-overflow-tooltip="true"/>
<el-table-column label="用户手机号" align="center" prop="contactTel" :show-overflow-tooltip="true"/>
<el-table-column label="投诉日期" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/> -->
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
@ -84,8 +84,8 @@
<el-form-item label="投诉人" prop="createBy">
<el-input v-model="form.createBy" disabled style="width: 100%"/>
</el-form-item>
<el-form-item label="用户手机号" prop="mobile">
<el-input v-model="form.mobile" disabled style="width: 100%"/>
<el-form-item label="用户手机号" prop="contactTel">
<el-input v-model="form.contactTel" disabled style="width: 100%"/>
</el-form-item>
<el-form-item label="投诉建议内容" prop="content">
<el-input
@ -129,7 +129,7 @@
</template>
<script>
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
import { getCanteenByAreaApi } from "@/api/base/stall";
import { getPlaintByPageApi,replyComplaintApi } from "@/api/base/mobile";
export default {
@ -287,7 +287,7 @@
this.$refs["form"].validate(valid => {
if (valid) {
let param = {
complaintId:this.form.complaintId,
suggestionId:this.form.suggestionId,
replyContent:this.form.replyContent
}
replyComplaintApi(param).then(response => {

View File

@ -169,12 +169,17 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList2"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData2" height="550">
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{(queryParams2.pageNum - 1) * queryParams2.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
<el-table-column label="所属档口" align="center" prop="shopstallName" :show-overflow-tooltip="true"/>
<el-table-column label="所属档口" align="center" prop="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="意见和建议" align="center" prop="proposal" :show-overflow-tooltip="true"/>
<el-table-column label="用户姓名" align="center" prop="createBy" :show-overflow-tooltip="true"/>
<el-table-column label="评价日期" align="center" prop="evaluateDate" :show-overflow-tooltip="true"/>
@ -196,73 +201,6 @@
@pagination="getList2"
/>
<!-- </el-tab-pane> -->
<!-- <el-tab-pane label="评价统计" name="3">
<el-form :model="queryParams3" ref="queryForm3" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="统计日期">
<el-date-picker
v-model="dateRange3"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd" style="width: 220px"
:picker-options="pickerOptions2" >
</el-date-picker>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams3.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 220px" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable collapse-tags @change="handleAreaChange3">
</el-cascader>
</el-form-item>
<el-form-item label="所属食堂" prop="canteenId">
<el-select v-model="queryParams3.canteenId" clearable placeholder="请选择所属食堂" style="width: 220px" @change="handleCanteenChange3">
<el-option v-for="item in canteenOptions2"
:key="item.canteenId"
:label="item.canteenName"
:value="item.canteenId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属档口" prop="stallId">
<el-select v-model="queryParams3.stallId" clearable placeholder="请选择所属档口" style="width: 220px" >
<el-option v-for="item in stallOptions2"
:key="item.stallId"
:label="item.stallName"
:value="item.stallId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery3">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery3">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData3" height="550">
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
<el-table-column label="所属档口" align="center" prop="stallName" :show-overflow-tooltip="true"/>
<el-table-column v-for="(item,index) in titleList3" :key="index" :label="item.functionName" align="center" :prop="item.functionId+''" :show-overflow-tooltip="true">
</el-table-column>
</el-table>
<pagination
v-show="total3>0"
:total="total3"
:page.sync="queryParams3.pageNum"
:limit.sync="queryParams3.pageSize"
@pagination="getList3"
/>
</el-tab-pane> -->
<!-- </el-tabs> -->
@ -330,7 +268,7 @@
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { getOrderEvaluatePageApi,getCanteenEvaluatePageApi,getEvaluateCountPageApi,getCanteenEvaluateDetailApi,orderEvaluateReplyApi } from "@/api/base/mobile";
import { getOrderEvaluatePageApi,getCanteenEvaluatePageApi,orderEvaluateReplyApi } from "@/api/base/mobile";
export default {
name: "",
@ -481,8 +419,6 @@
// this.getList();
// }else if(this.activeName=='2'){
// this.getList2();
// }else if(this.activeName=='2'){
// this.getList3();
// }
this.getList2();
},
@ -556,8 +492,6 @@
this.getList();
}else if(this.activeName=='2'){
this.getList2();
}else if(this.activeName=='2'){
this.getList3();
}
},
/** 搜索按钮操作 */
@ -599,24 +533,7 @@
this.resetForm("queryForm2");
this.handleQuery2();
},
/** 搜索按钮操作 */
handleQuery3() {
this.queryParams3.pageNum = 1;
this.getList3();
},
/** 重置按钮操作 */
resetQuery3() {
this.dateRange3 = [new Date(),new Date()]
this.queryParams3 = {
pageNum: 1,
pageSize: 10,
areaId:null,
canteenId:null,
stallId:null,
}
this.resetForm("queryForm3");
this.handleQuery3();
},
/** 查询列表 */
getList() {
this.loading = true;
@ -624,13 +541,13 @@
areaId:this.queryParams.areaId,
canteenId:this.queryParams.canteenId,
stallId:this.queryParams.stallId,
ordId:this.queryParams.ordId,
mealtimeType:this.queryParams.mealtimeType,
orderEvaluaType:this.queryParams.orderEvaluaType,
startTime:this.formatDateTime(this.dateTimeRange[0]),
endTime:this.formatDateTime(this.dateTimeRange[1]),
current: this.queryParams.pageNum,
size: this.queryParams.pageSize,
// ordId:this.queryParams.ordId,
// mealtimeType:this.queryParams.mealtimeType,
// orderEvaluaType:this.queryParams.orderEvaluaType,
// startTime:this.formatDateTime(this.dateTimeRange[0]),
// endTime:this.formatDateTime(this.dateTimeRange[1]),
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
}
getOrderEvaluatePageApi(param).then(response => {
this.tableListData = response.records;
@ -655,8 +572,8 @@
areaId:this.queryParams2.areaId,
canteenId:this.queryParams2.canteenId,
stallId:this.queryParams2.stallId,
startDate:this.formatDate(this.dateRange[0]),
endDate:this.formatDate(this.dateRange[1]),
// startDate:this.formatDate(this.dateRange[0]),
// endDate:this.formatDate(this.dateRange[1]),
pageNum: this.queryParams2.pageNum,
pageSize: this.queryParams2.pageSize,
}
@ -666,31 +583,14 @@
this.loading = false;
});
},
/** 详情按钮操作 */
handleView2(row) {
getCanteenEvaluateDetailApi({"content":row.evaluateId}).then(response => {
this.dialogContent2 = response.dataList
this.titleList2 = response.titleList
this.contentVisible2 = true;
});
},
getList3() {
this.loading = true;
let param = {
areaId:this.queryParams3.areaId,
canteenId:this.queryParams3.canteenId,
stallId:this.queryParams3.stallId,
startDate:this.formatDate(this.dateRange3[0]),
endDate:this.formatDate(this.dateRange3[1]),
current: this.queryParams3.pageNum,
size: this.queryParams3.pageSize,
}
getEvaluateCountPageApi(param).then(response => {
this.tableListData3 = response.countDetailPage.records;
this.total3 = Number(response.countDetailPage.total);
this.titleList3 = response.titleList
this.loading = false;
});
// getCanteenEvaluateDetailApi({"content":row.evaluateId}).then(response => {
// this.dialogContent2 = response.dataList
// this.titleList2 = response.titleList
// this.contentVisible2 = true;
// });
},
//
cancel() {

View File

@ -23,17 +23,17 @@
<div class="head-container" style>
<el-tree style="height: 700px; overflow: scroll"
:data="treeOptions" :props="defaultProps"
:show-checkbox="true" :default-expand-all="false"
:show-checkbox="true" :default-expand-all="true"
:expand-on-click-node="false" :filter-node-method="filterNode"
ref="typeTree" node-key="typeId" highlight-current @node-click="handleNodeClick" @check-change="handleCheckChange"
ref="typeTree" node-key="dishesTypeId" highlight-current @node-click="handleNodeClick" @check-change="handleCheckChange"
>
<span class="custom-tree-node" slot-scope="{ node, data }" @mousemove="onMousemove(data)" @mouseleave="onMouseleave()">
<span v-if="isMousemoveId === data.typeId && node.label.length > 10">{{
<span v-if="isMousemoveId === data.dishesTypeId && node.label.length > 10">{{
node.label.slice(0, 10) + "..."
}}</span>
<span v-else>{{ node.label }}</span>
<span class="btn-items" v-if="isMousemoveId === data.typeId">
<span class="btn-items" v-if="isMousemoveId === data.dishesTypeId">
<!-- <el-button
type="text"
size="mini"
@ -84,8 +84,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属档口" prop="shopstallId">
<el-select v-model="queryParams.shopstallId" placeholder="请选择所属档口" style="width: 100%;" >
<el-form-item label="所属档口" prop="stallId">
<el-select v-model="queryParams.stallId" placeholder="请选择所属档口" style="width: 100%;" >
<el-option v-for="item in stallOptions"
:key="item.stallId"
:label="item.stallName"
@ -172,10 +172,10 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="菜品编号" align="center" key="dishesNum" prop="dishesNum" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="菜品图片" align="center" key="imageUrl" prop="imageUrl" :show-overflow-tooltip="true" width="120">
<!-- <el-table-column label="菜品编号" align="center" key="dishesNum" prop="dishesNum" :show-overflow-tooltip="true" width="100"/> -->
<el-table-column label="菜品图片" align="center" key="imageUrl" prop="imageUrl" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
<img :src="scope.row.imageUrl" alt="" style="width: 80px;height: 40px;">
<img :src="scope.row.imageUrl" alt="" style="width: 100px;height: 50px;">
</template>
</el-table-column>
<el-table-column label="菜品名称" align="center" key="dishesName" prop="dishesName" :show-overflow-tooltip="true" width="150"/>
@ -185,7 +185,7 @@
<span v-if="scope.row.mealType==2">套餐</span>
</template>
</el-table-column> -->
<el-table-column label="菜品分类" align="center" key="typeName" prop="typeName" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="菜品分类" align="center" key="dishesTypeName" prop="dishesTypeName" :show-overflow-tooltip="true" width="140"/>
<!-- <el-table-column label="计价方式" align="center" key="salesMode" prop="salesMode" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
@ -198,10 +198,10 @@
<span v-if="scope.row.sizeType==2">大小份</span>
</template>
</el-table-column> -->
<el-table-column label="所属区域" align="center" key="areaName" prop="areaName" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="所属食堂" align="center" key="canteenName" prop="canteenName" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="所属档口" align="center" key="stallName" prop="stallName" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="售价" align="center" key="price" prop="price" :show-overflow-tooltip="true" width="100">
<el-table-column label="所属区域" align="center" key="areaName" prop="areaName" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="所属食堂" align="center" key="canteenName" prop="canteenName" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="所属档口" align="center" key="stallName" prop="stallName" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="售价" align="center" key="price" prop="price" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{(scope.row.price/100).toFixed(2)}}</span>
</template>
@ -266,8 +266,8 @@
}" clearable>
</el-cascader>
</el-form-item>
<el-form-item label="类别名称" prop="typeName">
<el-input v-model="form.typeName" placeholder="请输入类别名称" maxlength="30"/>
<el-form-item label="类别名称" prop="dishesTypeName">
<el-input v-model="form.dishesTypeName" placeholder="请输入类别名称" maxlength="30"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -316,8 +316,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属档口" prop="shopstallId">
<el-select v-model="baseForm.shopstallId" placeholder="请选择所属档口" style="width: 100%;" clearable>
<el-form-item label="所属档口" prop="stallId">
<el-select v-model="baseForm.stallId" placeholder="请选择所属档口" style="width: 100%;" clearable>
<el-option v-for="item in stallOptions2"
:key="item.stallId"
:label="item.stallName"
@ -326,11 +326,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="菜品编号" prop="dishesNum">
<el-input v-model="baseForm.dishesNum" placeholder="请输入菜品编号" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="菜品名称" prop="dishesName">
<el-input v-model="baseForm.dishesName" placeholder="请输入菜品名称" maxlength="30" clearable/>
@ -338,13 +338,21 @@
</el-col>
<el-col :span="12">
<el-form-item label="菜品分类" prop="typeId">
<el-select v-model="baseForm.typeId" style="width: 100%;" clearable>
<el-cascader v-model="baseForm.typeId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'dishesTypeId',label:'dishesTypeName'
}" clearable>
</el-cascader>
<!-- <el-select v-model="baseForm.typeId" style="width: 100%;" clearable>
<el-option v-for="item in treeOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
:key="item.dishesTypeId"
:label="item.dishesTypeName"
:value="item.dishesTypeId"
></el-option>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="12">
@ -366,7 +374,7 @@
</el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-col :span="12">
<el-form-item label="成本价" prop="materialCost" v-if="baseForm.sizeType==1">
<el-input
v-model="baseForm.materialCost" maxlength="10"
@ -377,7 +385,7 @@
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col> -->
</el-col>
<!-- <el-col :span="12">
<el-form-item label="计价方式" prop="salesMode">
<el-select v-model="baseForm.salesMode" style="width: 100%;" @change="changeSalesMode">
@ -467,14 +475,7 @@
</el-form-item>
</el-col> -->
<!-- <el-col :span="12">
<el-form-item label="质量偏差" prop="weightDeviation" v-if="baseForm.salesMode==1">
<el-input v-model="baseForm.weightDeviation" placeholder="份量" maxlength="9" clearable @input="(v)=>(baseForm.weightDeviation=v.replace(/[^\d]/g,''))">
<template slot="append">%</template>
</el-input>
</el-form-item>
</el-col>
<!--
<el-col :span="12">
<el-form-item label="餐次" prop="mealList">
<el-select v-model="baseForm.mealList" multiple style="width: 100%;" clearable>
@ -486,94 +487,12 @@
</el-select>
</el-form-item>
</el-col>
-->
<el-col :span="12">
<el-form-item label="菜品灶类" prop="cookId">
<el-select v-model="baseForm.cookId" style="width: 100%;" clearable>
<el-option v-for="item in dishesCookOptions"
:key="item.value"
:label="item.key"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜品标签" prop="labelIdList">
<el-select v-model="baseForm.labelIdList" multiple style="width: 100%;" clearable>
<el-option v-for="item in dishesLabelOptions"
:key="item.value"
:label="item.key"
:value="Number(item.value)"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜品口味" prop="tasteIdList">
<el-select v-model="baseForm.tasteIdList" multiple style="width: 100%;" clearable>
<el-option v-for="item in dishesTasteOptions"
:key="item.value"
:label="item.key"
:value="Number(item.value)"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜品菜系" prop="styleId">
<el-select v-model="baseForm.styleId" style="width: 100%;" clearable>
<el-option v-for="item in dishesStyleOptions"
:key="item.value"
:label="item.key"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="适用季节" prop="season">
<el-select v-model="baseForm.season" multiple style="width: 100%;" clearable>
<el-option label="春" :value="1"></el-option>
<el-option label="夏" :value="2"></el-option>
<el-option label="秋" :value="3"></el-option>
<el-option label="冬" :value="4"></el-option>
<el-option label="四季皆宜" :value="5"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜品功效" prop="effectId">
<el-select v-model="baseForm.effectId" style="width: 100%;" clearable>
<el-option v-for="item in dishesEffectOptions"
:key="item.value"
:label="item.key"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="适宜人群" prop="suitIdList">
<el-select v-model="baseForm.suitIdList" multiple style="width: 100%;" clearable>
<el-option v-for="item in dishesSuitOptions"
:key="item.value"
:label="item.key"
:value="Number(item.value)"
></el-option>
</el-select>
</el-form-item>
</el-col> -->
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="菜品简介" prop="remark">
<el-input v-model="baseForm.remark" type="textarea" :rows="2" maxlength="50" placeholder="请输入内容" ></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="菜品图片" prop="imageUrl">
<el-upload
@ -611,13 +530,13 @@
<div style="font-size: 16px;font-weight: 600;margin-right: 40px;border-left: 4px solid #1890ff;padding-left: 2px;">
菜品组成
</div>
<el-button type="primary" size="mini" v-if="materialList.length==0" @click="addDishMaterial"> </el-button>
<el-button type="primary" size="mini" v-if="dishesMaterialList.length==0" @click="addDishMaterial"> </el-button>
<div v-else style="font-size: 14px;font-weight: bold;color: #606266;justify-self: flex-start">
<span v-if="baseForm.sizeType==1">{{baseForm.weight}}g含原材料如下</span>
<span v-else>小份{{baseForm.littleWeight}}g/大份{{baseForm.largeWeight}}g 含原材料如下</span>
</div>
</div>
<el-table :data="materialList" height="320px" style="margin-bottom: 10px;">
<el-table :data="dishesMaterialList" height="320px" style="margin-bottom: 10px;">
<el-table-column label="序号" align="center" width="100" type="index"></el-table-column>
<el-table-column label="原料" align="center" key="materialId" prop="materialId">
<template slot-scope="scope">
@ -636,8 +555,8 @@
<el-table-column label="主/辅料" align="center" key="materialType" prop="materialType">
<template slot-scope="scope">
<el-select v-model="scope.row.materialType" placeholder="请选择" style="width: 100%;margin-right: 20px;" clearable>
<el-option label="主料" :value="1" />
<el-option label="辅料" :value="2" />
<el-option label="主料" value="1" />
<el-option label="辅料" value="2" />
</el-select>
</template>
</el-table-column>
@ -667,7 +586,7 @@
</el-table-column> -->
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-plus" size="mini" v-if="scope.$index==(materialList.length-1)" @click="addDishMaterial">增加</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" v-if="scope.$index==(dishesMaterialList.length-1)" @click="addDishMaterial">增加</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="delDishMaterial(scope.$index)">删除</el-button>
</template>
</el-table-column>
@ -820,7 +739,6 @@
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { menuDishesTypeAllListApi,addMenuDishesTypeApi,editMenuDishesTypeApi,removeMenuDishesTypeApi} from "@/api/dish/dish";//
import { getMenuDishesListApi,addMenuDishesApi, editMenuDishesApi,menuDishesDetailApi,removeMenuDishesApi,importMenuDishesApi } from "@/api/dish/dish";
import { getDishesTypeListApi } from "@/api/dish/dish";
import { getMaterialListApi } from "@/api/dish/material";
import { imgUpLoadTwo } from '@/api/system/upload'
import { getToken } from '@/utils/auth'
@ -847,8 +765,8 @@
isMousemoveId: null,
defaultProps: {
children: "children",
label: "typeName",
id: "typeId"
label: "dishesTypeName",
id: "dishesTypeId"
},
keyWord:"",//-
canteenOptions:[],//-
@ -859,7 +777,7 @@
pageSize: 10,
areaId: null,
canteenId: null,
shopstallId: null,
stallId: null,
dishesName: "",
typeIdList: []
},
@ -873,12 +791,12 @@
title: "",
//
form: {
typeName: "",
dishesTypeName: "",
areaId:null
},
//
rules: {
typeName: [
dishesTypeName: [
{
required: true,
message: "类别名称不能为空",
@ -903,7 +821,7 @@
publicDishes: 2,
areaId:null,
canteenId:null,
shopstallId:null,
stallId:null,
dishesNum:null,
dishesName:null,
salesMode:1,
@ -936,9 +854,9 @@
// mealType: [
// { required: true, message: "", trigger: "change" }
// ],
dishesNum: [
{ required: true, message: "菜品编号不能为空", trigger: "blur" }
],
// dishesNum: [
// { required: true, message: "", trigger: "blur" }
// ],
dishesName: [
{ required: true, message: "菜品名称不能为空", trigger: "blur" }
],
@ -984,7 +902,7 @@
//
url: process.env.VUE_APP_BASE_API + '/smart-canteen/menu_dishes/import/check',
},
materialList:[],
dishesMaterialList:[],
materialOptions:[],
openResult:false,
resultData:{}
@ -1010,13 +928,12 @@
// -
filterNode(value, data) {
if (!value) return true;
return data.typeName.indexOf(value) !== -1;
return data.dishesTypeName.indexOf(value) !== -1;
},
/** 查询新增页面-上级类型下拉树结构 */
getTreeData() {
menuDishesTypeAllListApi({}).then((response) => {
this.treeOptions = response.data;
console.log("this.treeOptions",this.treeOptions)
this.getList();
});
},
@ -1030,7 +947,10 @@
},
/* 树节点增加 */
appendTreeNode(data) {
this.form={}
this.form={
"level": "0",
"parentId": "1",
}
this.resetForm("form");
this.openType = true;
this.title = "新增";
@ -1052,7 +972,7 @@
this.$modal
.confirm("是否确认删除数据项?")
.then(function () {
return removeMenuDishesTypeApi({typeId:data.typeId});
return removeMenuDishesTypeApi({dishesTypeId:data.dishesTypeId});
})
.then(() => {
this.$modal.msgSuccess("删除成功");
@ -1062,7 +982,7 @@
.catch(() => {});
},
onMousemove(data) {
this.isMousemoveId = data.typeId;
this.isMousemoveId = data.dishesTypeId;
},
onMouseleave() {
this.isMousemoveId = null;
@ -1071,7 +991,7 @@
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.form.typeId != undefined) {
if (this.form.dishesTypeId != undefined) {
editMenuDishesTypeApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openType = false;
@ -1102,7 +1022,7 @@
this.canteenOptions=response.rows||[]
this.queryParams.canteenId=null
this.stallOptions = []
this.queryParams.shopstallId=null
this.queryParams.stallId=null
});
},
handleAreaChange2(e){
@ -1113,7 +1033,7 @@
this.canteenOptions2=response.rows||[]
this.baseForm.canteenId=null
this.stallOptions2 = []
this.baseForm.shopstallId=null
this.baseForm.stallId=null
});
},
handleCanteenChange(e){
@ -1122,7 +1042,7 @@
}
getStallByCanteenApi(param).then((response) => {
this.stallOptions=response.rows||[]
this.queryParams.shopstallId=null
this.queryParams.stallId=null
});
},
handleCanteenChange2(e){
@ -1131,7 +1051,7 @@
}
getStallByCanteenApi(param).then((response) => {
this.stallOptions2=response.rows||[]
this.baseForm.shopstallId=null
this.baseForm.stallId=null
});
},
/** 搜索按钮操作 */
@ -1156,7 +1076,7 @@
"pageNum": this.queryParams.pageNum,
"areaId": this.queryParams.areaId,
"canteenId": this.queryParams.canteenId,
"shopstallId": this.queryParams.shopstallId,
"stallId": this.queryParams.stallId,
"dishesName": this.queryParams.dishesName,
"typeIdList": this.$refs.typeTree.getCheckedKeys(),
}
@ -1166,40 +1086,13 @@
this.loading = false;
});
},
//
getAllSelectList(){
let param = {
"page":{"current":1,"size":-1},
"object":{}
}
getDishesTypeListApi({"key":'dishes_cook'}).then(response => {
this.dishesCookOptions = response.data;
});
getDishesTypeListApi({"key":"dishes_label"}).then(response => {
this.dishesLabelOptions = response.data;
});
getDishesTypeListApi({"key":"dishes_taste"}).then(response => {
this.dishesTasteOptions = response.data;
});
getDishesTypeListApi({"key":"dishes_effec"}).then(response => {
this.dishesEffectOptions = response.data;
});
getDishesTypeListApi({"key":"dishes_style"}).then(response => {
this.dishesStyleOptions = response.data;
});
getDishesTypeListApi({"key":"dishes_suitId"}).then(response => {
this.dishesSuitOptions = response.data;
});
},
resetDishDialog(){
this.baseForm = {
mealType:1,///
publicDishes: 2,
areaId:null,
canteenId:null,
shopstallId:null,
stallId:null,
dishesNum:null,
dishesName:null,
salesMode:1,
@ -1233,8 +1126,7 @@
handleAdd() {
this.fileList=[]
this.checkUrlList=[]
this.materialList=[]
this.getAllSelectList()
this.dishesMaterialList=[]
this.resetDishDialog()
this.activeName="1"
this.title = "新增";
@ -1243,7 +1135,7 @@
//
changeSalesMode(e){
console.log(e)
this.materialList=[]
this.dishesMaterialList=[]
this.$set(this.baseForm,"sizeType",'1')
this.$set(this.baseForm,"weight",100)
this.$set(this.baseForm,"price",null)
@ -1260,7 +1152,7 @@
},
changeSizeType(e){
console.log(e)
this.materialList=[]
this.dishesMaterialList=[]
this.$set(this.baseForm,"price",null)
this.$set(this.baseForm,"weight",null)
this.$set(this.baseForm,"littlePrice",null)
@ -1274,8 +1166,8 @@
handleUpdate(row) {
console.log(row)
menuDishesDetailApi({"dishesId":row.dishesId}).then(response => {
this.getAllSelectList()
this.resetDishDialog()
// this.baseForm = Object.assign({}, row)
this.baseForm = response.data
this.formTable = [this.baseForm]
getCanteenByAreaApi({areaId:this.baseForm.areaId,canteenType: 1}).then((response) => {
@ -1284,22 +1176,20 @@
getStallByCanteenApi({canteenId:this.baseForm.canteenId}).then((response) => {
this.stallOptions2=response.rows||[]
});
this.$set(this.baseForm,"salesMode",response.data.salesMode)
this.$set(this.baseForm,"sizeType",response.data.sizeType+'')
this.$set(this.baseForm,"mealType",response.data.mealType)
this.$set(this.baseForm,"salesMode",this.baseForm.salesMode)
this.$set(this.baseForm,"sizeType",this.baseForm.sizeType+'')
if(this.baseForm.sizeType==1){
this.$set(this.baseForm,"price",Number(response.data.price)/100)
this.$set(this.baseForm,"materialCost",Number(response.data.materialCost)/100)
this.$set(this,"materialList",response.data.materialList)
this.$set(this.baseForm,"price",Number(this.baseForm.price)/100)
this.$set(this.baseForm,"materialCost",Number(this.baseForm.materialCost)/100)
this.$set(this,"dishesMaterialList",this.baseForm.dishesMaterialList||[])
}else{
this.$set(this.baseForm,"littlePrice",Number(response.data.littlePrice)/100)
this.$set(this.baseForm,"largePrice",Number(response.data.largePrice)/100)
this.$set(this.baseForm,"littleMaterialCost",Number(response.data.littleMaterialCost)/100)
this.$set(this.baseForm,"materialCost",Number(response.data.materialCost)/100)
if(this.baseForm.materialList.length>0){
this.$set(this.baseForm,"littlePrice",Number(this.baseForm.littlePrice)/100)
this.$set(this.baseForm,"largePrice",Number(this.baseForm.largePrice)/100)
this.$set(this.baseForm,"littleMaterialCost",Number(this.baseForm.littleMaterialCost)/100)
this.$set(this.baseForm,"materialCost",Number(this.baseForm.materialCost)/100)
if(this.baseForm.dishesMaterialList.length>0){
let arr = []
this.baseForm.materialList.forEach((item,index)=>{
this.baseForm.dishesMaterialList.forEach((item,index)=>{
let obj = {
materialId: item.materialId,
materialName: item.materialName,
@ -1309,11 +1199,12 @@
}
arr.push(obj)
})
this.$set(this,"materialList",arr)
this.$set(this,"dishesMaterialList",arr)
}else{
this.$set(this,"materialList",[])
this.$set(this,"dishesMaterialList",[])
}
}
if(this.baseForm.imageUrl){
this.fileList=[{url:this.baseForm.imageUrl}]
this.checkUrlList=[this.baseForm.imageUrl]
@ -1321,7 +1212,8 @@
this.fileList=[]
this.checkUrlList=[]
}
this.$set(this,"materialOptions",response.data.materialList)
console.log(this.baseForm)
this.$set(this,"materialOptions",this.baseForm.dishesMaterialList)
this.materialOptions.forEach(item=>{
item.disabled = true
})
@ -1339,7 +1231,7 @@
materialType: null,
weight: null
}
this.materialList.push(obj)
this.dishesMaterialList.push(obj)
}else{
let obj = {
materialId: null,
@ -1347,13 +1239,13 @@
littleWeight: null,
largeWeight: null
}
this.materialList.push(obj)
this.dishesMaterialList.push(obj)
}
this.materialOptions = [];
},
//
delDishMaterial(index){
this.materialList.splice(index,1)
this.dishesMaterialList.splice(index,1)
},
//-
remoteMethod(query) {
@ -1370,7 +1262,7 @@
getMaterialListApi(param).then(response => {
this.materialOptions = response.rows;
this.materialOptions.forEach(item=>{
let ifIndex = this.materialList.findIndex(v=>v.materialId==item.materialId)
let ifIndex = this.dishesMaterialList.findIndex(v=>v.materialId==item.materialId)
if(ifIndex!=-1){
item.disabled = true
}else{
@ -1391,7 +1283,7 @@
//
setDisabled(){
this.materialOptions.forEach(item=>{
let index = this.materialList.findIndex(v=>v.materialId==item.materialId)
let index = this.dishesMaterialList.findIndex(v=>v.materialId==item.materialId)
if(index!=-1){
item.disabled = true
}else{
@ -1412,10 +1304,10 @@
if(param.sizeType==1){
param.price = Number(param.price)*100;
param.materialCost = Number(param.materialCost)*100;
param.materialList=[]
this.materialList.forEach(item=>{
param.dishesMaterialList=[]
this.dishesMaterialList.forEach(item=>{
if(item.materialId!=null){
param.materialList.push({
param.dishesMaterialList.push({
materialId: item.materialId,
materialType: item.materialType,
weight: Number(item.weight)
@ -1428,11 +1320,11 @@
param.largePrice = Number(param.largePrice)*100;
param.littleMaterialCost = Number(param.littleMaterialCost)*100;
param.materialCost = Number(param.materialCost)*100;
param.materialList=[]
param.dishesMaterialList=[]
param.littleMaterialList=[]
this.materialList.forEach(item=>{
this.dishesMaterialList.forEach(item=>{
if(item.materialId!=null){
param.materialList.push({
param.dishesMaterialList.push({
materialId: item.materialId,
materialType: item.materialType,
weight: item.largeWeight
@ -1446,7 +1338,7 @@
})
}
let sumWeight = 0
param.materialList.forEach(item=>{
param.dishesMaterialList.forEach(item=>{
sumWeight = item.weight+sumWeight;
})
if(sumWeight>param.weight){
@ -1479,7 +1371,7 @@
this.$modal
.confirm("是否确认删除数据项?")
.then(function () {
return removeMenuDishesApi({ids:[row.id]});
return removeMenuDishesApi({dishesId:row.dishesId});
})
.then(() => {
this.$modal.msgSuccess("删除成功");

View File

@ -126,11 +126,11 @@
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-select v-model="queryDish.typeId" style="width: 100%;" clearable @change="getDishesPage">
<el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
:key="item.dishesTypeId"
:label="item.dishesTypeName"
:value="item.dishesTypeId"
></el-option>
</el-select>
</div>
@ -158,7 +158,7 @@
<div class="dialog-center">
<div class="dialog-center-header">菜品分类</div>
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;">
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.typeName }}</el-button>
<el-button plain :class="dishesType==item.dishesTypeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
</div>
</div>
<div class="dialog-right">
@ -534,7 +534,7 @@ export default {
//
queryDish:{
salesMode:null,
typeId:null,
dishesTypeId:null,
dishesName:''
},
typeOptions:[],
@ -835,9 +835,9 @@ export default {
this.dishesList=item.dishesList;
this.dishesTypeList=[]
this.dishesList.forEach(dish=>{
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
let index = this.dishesTypeList.findIndex(v=>v.dishesTypeId==dish.dishesTypeId)
if(index==-1){
this.dishesTypeList.push({typeId:dish.typeId,typeName:dish.typeName})
this.dishesTypeList.push({dishesTypeId:dish.dishesTypeId,dishesTypeName:dish.dishesTypeName})
}
})
this.choseDishesType(this.dishesTypeList[0])
@ -851,7 +851,7 @@ export default {
"canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode,
"typeId":this.queryDish.typeId,
"dishesTypeId":this.queryDish.dishesTypeId,
"dishesName":this.queryDish.dishesName,
"pageNum":1,
"pageSize":100
@ -886,9 +886,9 @@ export default {
}
})
//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==obj.dishesTypeId)
if(typeIndex==-1){
this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName})
this.dishesTypeList.push({dishesTypeId:obj.dishesTypeId,dishesTypeName:obj.dishesTypeName})
}
}else{
this.dishesList.splice(index,1)
@ -904,15 +904,15 @@ export default {
},
//-
choseDishesType(item){
this.dishesType = item.typeId;
this.dishesType = item.dishesTypeId;
this.dishesTableList = []
this.dishesList.forEach(dish=>{
if(dish.typeId==item.typeId){
if(dish.dishesTypeId==item.dishesTypeId){
this.dishesTableList.push(dish)
}
})
if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId)
if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1)
}
@ -932,7 +932,7 @@ export default {
}
})
if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId)
if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1)
}

View File

@ -126,11 +126,11 @@
</div>
<div>
<div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
<el-select v-model="queryDish.typeId" style="width: 100%;" clearable @change="getDishesPage">
<el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
<el-option v-for="item in typeOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
:key="item.dishesTypeId"
:label="item.dishesTypeName"
:value="item.dishesTypeId"
></el-option>
</el-select>
</div>
@ -159,7 +159,7 @@
<div class="dialog-center">
<div class="dialog-center-header">菜品分类</div>
<div v-for="(item,index) in dishesTypeList" :key="index" style="width: 100%;text-align: center;margin: 10px 0;">
<el-button plain :class="dishesType==item.typeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.typeName }}</el-button>
<el-button plain :class="dishesType==item.dishesTypeId?'primary':''" style="width: 80%;" @click="choseDishesType(item)">{{ item.dishesTypeName }}</el-button>
</div>
</div>
<div class="dialog-right">
@ -536,7 +536,7 @@ export default {
//
queryDish:{
salesMode:null,
typeId:null,
dishesTypeId:null,
dishesName:''
},
typeOptions:[],
@ -1038,9 +1038,9 @@ export default {
this.dishesList=item.dishesList;
this.dishesTypeList=[]
this.dishesList.forEach(dish=>{
let index = this.dishesTypeList.findIndex(v=>v.typeId==dish.typeId)
let index = this.dishesTypeList.findIndex(v=>v.dishesTypeId==dish.dishesTypeId)
if(index==-1){
this.dishesTypeList.push({typeId:dish.typeId,typeName:dish.typeName})
this.dishesTypeList.push({dishesTypeId:dish.dishesTypeId,dishesTypeName:dish.dishesTypeName})
}
})
this.choseDishesType(this.dishesTypeList[0])
@ -1054,7 +1054,7 @@ export default {
"canteenId":this.baseInfo.canteenId,
"stallId":this.baseInfo.stallId,
"salesMode":this.queryDish.salesMode,
"typeId":this.queryDish.typeId,
"dishesTypeId":this.queryDish.dishesTypeId,
"dishesName":this.queryDish.dishesName,
"pageNum":1,
"pageSize":100
@ -1089,9 +1089,9 @@ export default {
}
})
//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==obj.dishesTypeId)
if(typeIndex==-1){
this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName})
this.dishesTypeList.push({dishesTypeId:obj.dishesTypeId,dishesTypeName:obj.dishesTypeName})
}
}else{
this.dishesList.splice(index,1)
@ -1107,15 +1107,15 @@ export default {
},
//-
choseDishesType(item){
this.dishesType = item.typeId;
this.dishesType = item.dishesTypeId;
this.dishesTableList = []
this.dishesList.forEach(dish=>{
if(dish.typeId==item.typeId){
if(dish.dishesTypeId==item.dishesTypeId){
this.dishesTableList.push(dish)
}
})
if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId)
if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1)
}
@ -1135,7 +1135,7 @@ export default {
}
})
if(this.dishesTableList.length==0){//
let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId)
let typeIndex = this.dishesTypeList.findIndex(v=>v.dishesTypeId==item.dishesTypeId)
if(typeIndex>-1){
this.dishesTypeList.splice(typeIndex,1)
}