Merge branch 'master' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
@ -32,8 +32,18 @@ public class SysDishes extends BaseEntity
|
|||||||
@Excel(name = "做法")
|
@Excel(name = "做法")
|
||||||
private String methods;
|
private String methods;
|
||||||
|
|
||||||
|
private Integer isMain;
|
||||||
|
|
||||||
private String reviewStatus;
|
private String reviewStatus;
|
||||||
|
|
||||||
|
public Integer getIsMain() {
|
||||||
|
return isMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMain(Integer isMain) {
|
||||||
|
this.isMain = isMain;
|
||||||
|
}
|
||||||
|
|
||||||
public void setReviewStatus(String reviewStatus) {
|
public void setReviewStatus(String reviewStatus) {
|
||||||
this.reviewStatus = reviewStatus;
|
this.reviewStatus = reviewStatus;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="name" column="name" />
|
<result property="name" column="name" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
|
<result property="isMain" column="is_main" />
|
||||||
<result property="methods" column="methods" />
|
<result property="methods" column="methods" />
|
||||||
<result property="reviewStatus" column="review_status" />
|
<result property="reviewStatus" column="review_status" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
@ -32,7 +33,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysDishesVo">
|
<sql id="selectSysDishesVo">
|
||||||
select id, name, type, methods, create_by, create_time, update_by, update_time, review_status from sys_dishes
|
select id, name, type, is_main, methods, create_by, create_time, update_by, update_time, review_status from sys_dishes
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysDishesList" parameterType="SysDishes" resultMap="SysDishesResult">
|
<select id="selectSysDishesList" parameterType="SysDishes" resultMap="SysDishesResult">
|
||||||
@ -41,6 +42,7 @@
|
|||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
<if test="type != null and type != ''"> and FIND_IN_SET(#{type}, type)</if>
|
<if test="type != null and type != ''"> and FIND_IN_SET(#{type}, type)</if>
|
||||||
<if test="reviewStatus != null and type != ''"> and review_status = #{reviewStatus}</if>
|
<if test="reviewStatus != null and type != ''"> and review_status = #{reviewStatus}</if>
|
||||||
|
<if test="isMain != null and type != ''"> and is_main = #{isMain}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -86,6 +88,7 @@
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">name,</if>
|
<if test="name != null">name,</if>
|
||||||
<if test="type != null">type,</if>
|
<if test="type != null">type,</if>
|
||||||
|
<if test="isMain != null">is_main,</if>
|
||||||
<if test="methods != null">methods,</if>
|
<if test="methods != null">methods,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="reviewStatus != null">review_status</if>
|
<if test="reviewStatus != null">review_status</if>
|
||||||
@ -96,6 +99,7 @@
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">#{name},</if>
|
<if test="name != null">#{name},</if>
|
||||||
<if test="type != null">#{type},</if>
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="isMain != null">#{isMain},</if>
|
||||||
<if test="methods != null">#{methods},</if>
|
<if test="methods != null">#{methods},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="reviewStatus != null">#{reviewStatus}</if>
|
<if test="reviewStatus != null">#{reviewStatus}</if>
|
||||||
@ -110,6 +114,7 @@
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="name != null">name = #{name},</if>
|
<if test="name != null">name = #{name},</if>
|
||||||
<if test="type != null">type = #{type},</if>
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="isMain != null">is_main = #{isMain},</if>
|
||||||
<if test="methods != null">methods = #{methods},</if>
|
<if test="methods != null">methods = #{methods},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||||
|
2
stdiet-ui/src/assets/icons/svg/contract.svg
Normal file
2
stdiet-ui/src/assets/icons/svg/contract.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 92 KiB |
2
stdiet-ui/src/assets/icons/svg/dishes-menu.svg
Normal file
2
stdiet-ui/src/assets/icons/svg/dishes-menu.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 93 KiB |
2
stdiet-ui/src/assets/icons/svg/dishes.svg
Normal file
2
stdiet-ui/src/assets/icons/svg/dishes.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 91 KiB |
2
stdiet-ui/src/assets/icons/svg/ingredient.svg
Normal file
2
stdiet-ui/src/assets/icons/svg/ingredient.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 94 KiB |
2
stdiet-ui/src/assets/icons/svg/order-list.svg
Normal file
2
stdiet-ui/src/assets/icons/svg/order-list.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 92 KiB |
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="菜品名称" prop="name">
|
<el-form-item label="菜品名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
@ -11,7 +17,12 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜品类型" prop="type">
|
<el-form-item label="菜品类型" prop="type">
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择菜品类型" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择菜品类型"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in typeOptions"
|
v-for="dict in typeOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -35,8 +46,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -61,9 +80,16 @@
|
|||||||
>导出
|
>导出
|
||||||
</el-button>
|
</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="dishesList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dishesList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column label="审核状态" align="center" width="80">
|
<el-table-column label="审核状态" align="center" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag
|
||||||
@ -74,32 +100,35 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="菜品名称" align="center" prop="name"/>
|
<el-table-column label="菜品名称" align="center" prop="name" />
|
||||||
<el-table-column label="菜品类型" align="center" prop="type">
|
<el-table-column label="菜品类型" align="center" prop="type">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<autohideinfo :data="typeFormat(scope.row)"/>
|
<autohideinfo :data="typeFormat(scope.row)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="包含食材" align="center">
|
<el-table-column label="包含食材" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="igd in scope.row.igdList"
|
<div v-for="igd in scope.row.igdList" :key="igd.id">
|
||||||
:key="igd.id">
|
{{ igd.name }}
|
||||||
{{igd.name}}
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="推荐人群" align="center">
|
<el-table-column label="推荐人群" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<autohideinfo :data="scope.row.recTags"/>
|
<autohideinfo :data="scope.row.recTags" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="忌口人群" align="center">
|
<el-table-column label="忌口人群" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<autohideinfo :data="scope.row.notRecTags"/>
|
<autohideinfo :data="scope.row.notRecTags" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="做法" align="center" prop="methods"/>
|
<el-table-column label="做法" align="center" prop="methods" />
|
||||||
<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 slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -122,7 +151,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -132,12 +161,20 @@
|
|||||||
<!-- 添加或修改菜品对话框 -->
|
<!-- 添加或修改菜品对话框 -->
|
||||||
<el-drawer :title="title" :visible.sync="open" size="50%">
|
<el-drawer :title="title" :visible.sync="open" size="50%">
|
||||||
<div class="drawer_content">
|
<div class="drawer_content">
|
||||||
|
<el-row class="content_detail">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="菜品名称" prop="name">
|
<el-form-item label="菜品名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入菜品名称"/>
|
<el-input v-model="form.name" placeholder="请输入菜品名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="12">
|
||||||
<el-form-item label="菜品类型" prop="type">
|
<el-form-item label="菜品类型" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择菜品类型" multiple>
|
<el-select
|
||||||
|
v-model="form.type"
|
||||||
|
placeholder="请选择菜品类型"
|
||||||
|
multiple
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in typeOptions"
|
v-for="dict in typeOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -146,6 +183,16 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="是否主食" prop="type">
|
||||||
|
<el-radio-group v-model="form.isMain">
|
||||||
|
<el-radio :label="0">是</el-radio>
|
||||||
|
<el-radio :label="1">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="食材" prop="ingIds">
|
<el-form-item label="食材" prop="ingIds">
|
||||||
<el-transfer
|
<el-transfer
|
||||||
style="text-align: left; display: inline-block"
|
style="text-align: left; display: inline-block"
|
||||||
@ -167,16 +214,24 @@
|
|||||||
size="small"
|
size="small"
|
||||||
filterable
|
filterable
|
||||||
v-model="ingType"
|
v-model="ingType"
|
||||||
@change="handleOnTypeChange">
|
@change="handleOnTypeChange"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in ingTypeOptions"
|
v-for="dict in ingTypeOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"/>
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="transfer-footer" slot="right-footer" size="small"/>
|
<div
|
||||||
|
class="transfer-footer"
|
||||||
|
slot="right-footer"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
</el-transfer>
|
</el-transfer>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="分量" prop="weight">
|
<el-form-item label="分量" prop="weight">
|
||||||
<el-table
|
<el-table
|
||||||
:data="selTableData"
|
:data="selTableData"
|
||||||
@ -184,11 +239,9 @@
|
|||||||
show-summary
|
show-summary
|
||||||
size="mini"
|
size="mini"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
style="width: 100%">
|
style="width: 100%"
|
||||||
<el-table-column
|
>
|
||||||
prop="name"
|
<el-table-column prop="name" label="食材"> </el-table-column>
|
||||||
label="食材">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="通俗计量">
|
<el-table-column label="通俗计量">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="cus-unit">
|
<span class="cus-unit">
|
||||||
@ -197,11 +250,9 @@
|
|||||||
size="small"
|
size="small"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
step="0.5"
|
step="0.5"
|
||||||
:min="0.5"/>
|
:min="0.5"
|
||||||
<el-select
|
/>
|
||||||
size="small"
|
<el-select size="small" v-model="scope.row.cusUnit">
|
||||||
v-model="scope.row.cusUnit"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in cusUnitOptions"
|
v-for="dict in cusUnitOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -212,9 +263,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column prop="weight" label="重量(g)">
|
||||||
prop="weight"
|
|
||||||
label="重量(g)">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
class="weight"
|
class="weight"
|
||||||
@ -223,45 +272,46 @@
|
|||||||
controls-position="right"
|
controls-position="right"
|
||||||
@change="handleInputChange"
|
@change="handleInputChange"
|
||||||
:min="0"
|
:min="0"
|
||||||
step="50"/>
|
step="50"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column prop="proteinRatio" label="P/100g">
|
||||||
prop="proteinRatio"
|
|
||||||
label="P/100g">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column prop="fatRatio" label="F/100g">
|
||||||
prop="fatRatio"
|
|
||||||
label="F/100g">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column prop="carbonRatio" label="C/100g">
|
||||||
prop="carbonRatio"
|
|
||||||
label="C/100g">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column prop="remark" label="备注">
|
||||||
prop="remark"
|
|
||||||
label="备注">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="推荐人群">
|
<el-form-item label="推荐人群">
|
||||||
<el-tag
|
<el-tag
|
||||||
style="margin-right: 4px"
|
style="margin-right: 4px"
|
||||||
v-for="rec in selRec"
|
v-for="rec in selRec"
|
||||||
:key="rec"
|
:key="rec"
|
||||||
type="success">
|
type="success"
|
||||||
{{rec}}
|
>
|
||||||
|
{{ rec }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="忌口人群">
|
<el-form-item label="忌口人群">
|
||||||
<el-tag
|
<el-tag
|
||||||
style="margin-right: 4px"
|
style="margin-right: 4px"
|
||||||
v-for="notRec in selNotRec"
|
v-for="notRec in selNotRec"
|
||||||
:key="notRec"
|
:key="notRec"
|
||||||
type="danger">
|
type="danger"
|
||||||
{{notRec}}
|
>
|
||||||
|
{{ notRec }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="审核状态" prop="reviewStatus">
|
<el-form-item label="审核状态" prop="reviewStatus">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.reviewStatus"
|
v-model="form.reviewStatus"
|
||||||
@ -276,10 +326,19 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="24">
|
||||||
<el-form-item label="做法" prop="methods">
|
<el-form-item label="做法" prop="methods">
|
||||||
<el-input v-model="form.methods" type="textarea" placeholder="请输入内容" rows="4"/>
|
<el-input
|
||||||
|
v-model="form.methods"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
rows="4"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</el-row>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
@ -290,11 +349,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addDishes, delDishes, exportDishes, getDishes, listDishes, updateDishes} from "@/api/custom/dishes";
|
import {
|
||||||
import {listAllIngredient} from "@/api/custom/ingredient";
|
addDishes,
|
||||||
import AutoHideInfo from "@/components/AutoHideInfo";
|
delDishes,
|
||||||
|
exportDishes,
|
||||||
|
getDishes,
|
||||||
|
listDishes,
|
||||||
|
updateDishes,
|
||||||
|
} from "@/api/custom/dishes";
|
||||||
|
import { listAllIngredient } from "@/api/custom/ingredient";
|
||||||
|
import AutoHideInfo from "@/components/AutoHideInfo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Dishes",
|
name: "Dishes",
|
||||||
components: {
|
components: {
|
||||||
autohideinfo: AutoHideInfo,
|
autohideinfo: AutoHideInfo,
|
||||||
@ -321,7 +387,7 @@
|
|||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
ingType: '1',
|
ingType: "1",
|
||||||
// 食材类别字典
|
// 食材类别字典
|
||||||
ingTypeOptions: [],
|
ingTypeOptions: [],
|
||||||
// 远程数据缓存,预防新增的食材找不到
|
// 远程数据缓存,预防新增的食材找不到
|
||||||
@ -352,18 +418,18 @@
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {}
|
rules: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getDicts("cus_dishes_type").then(response => {
|
this.getDicts("cus_dishes_type").then((response) => {
|
||||||
this.typeOptions = response.data;
|
this.typeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("cus_ing_type").then(response => {
|
this.getDicts("cus_ing_type").then((response) => {
|
||||||
this.ingTypeOptions = response.data;
|
this.ingTypeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("cus_cus_unit").then(response => {
|
this.getDicts("cus_cus_unit").then((response) => {
|
||||||
this.cusUnitOptions = response.data;
|
this.cusUnitOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("cus_review_status").then((response) => {
|
this.getDicts("cus_review_status").then((response) => {
|
||||||
@ -374,39 +440,44 @@
|
|||||||
/** 查询菜品列表 */
|
/** 查询菜品列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDishes(this.queryParams).then(response => {
|
listDishes(this.queryParams).then((response) => {
|
||||||
this.dishesList = response.rows.map(d => {
|
this.dishesList = response.rows.map((d) => {
|
||||||
const recTags = [], notRecTags = [];
|
const recTags = [],
|
||||||
d.igdList.forEach(igd => {
|
notRecTags = [];
|
||||||
|
d.igdList.forEach((igd) => {
|
||||||
if (igd.rec) {
|
if (igd.rec) {
|
||||||
igd.rec.split(',').forEach(rec => {
|
igd.rec.split(",").forEach((rec) => {
|
||||||
if (!recTags.includes(rec)) {
|
if (!recTags.includes(rec)) {
|
||||||
recTags.push(rec)
|
recTags.push(rec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (igd.notRec) {
|
if (igd.notRec) {
|
||||||
igd.notRec.split(',').forEach(notRec => {
|
igd.notRec.split(",").forEach((notRec) => {
|
||||||
if (!notRecTags.includes(notRec)) {
|
if (!notRecTags.includes(notRec)) {
|
||||||
notRecTags.push(notRec)
|
notRecTags.push(notRec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return {
|
return {
|
||||||
...d,
|
...d,
|
||||||
recTags,
|
recTags,
|
||||||
notRecTags
|
notRecTags,
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
console.log(this.dishesList)
|
console.log(this.dishesList);
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 菜品类型字典翻译
|
// 菜品类型字典翻译
|
||||||
typeFormat(row, column) {
|
typeFormat(row, column) {
|
||||||
return !row.type ? '' : row.type.split(',').map(type => this.selectDictLabel(this.typeOptions, type));
|
return !row.type
|
||||||
|
? ""
|
||||||
|
: row.type
|
||||||
|
.split(",")
|
||||||
|
.map((type) => this.selectDictLabel(this.typeOptions, type));
|
||||||
},
|
},
|
||||||
cusUnitFormat(row, column) {
|
cusUnitFormat(row, column) {
|
||||||
return this.selectDictLabel(this.cusUnitOptions, row.type);
|
return this.selectDictLabel(this.cusUnitOptions, row.type);
|
||||||
@ -431,7 +502,8 @@
|
|||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
igdList: []
|
igdList: [],
|
||||||
|
isMain: 0
|
||||||
};
|
};
|
||||||
this.selIngIds = [];
|
this.selIngIds = [];
|
||||||
this.selIngList = [];
|
this.selIngList = [];
|
||||||
@ -439,7 +511,7 @@
|
|||||||
this.oriDataList = [];
|
this.oriDataList = [];
|
||||||
this.selRec = [];
|
this.selRec = [];
|
||||||
this.selNotRec = [];
|
this.selNotRec = [];
|
||||||
this.ingType = '1';
|
this.ingType = "1";
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -454,76 +526,76 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
listAllIngredient({type: this.ingType}).then(response => {
|
listAllIngredient({ type: this.ingType }).then((response) => {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加菜品";
|
this.title = "添加菜品";
|
||||||
this.oriDataList = response.rows;
|
this.oriDataList = response.rows;
|
||||||
this.ingDataList = this.oriDataList.map(obj => ({
|
this.ingDataList = this.oriDataList.map((obj) => ({
|
||||||
key: obj.id,
|
key: obj.id,
|
||||||
label: obj.name
|
label: obj.name,
|
||||||
}))
|
}));
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids;
|
||||||
getDishes(id).then(response => {
|
getDishes(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.form.type = this.form.type ? this.form.type.split(',') : null;
|
this.form.type = this.form.type ? this.form.type.split(",") : null;
|
||||||
this.form.igdList.forEach(obj => {
|
this.form.igdList.forEach((obj) => {
|
||||||
this.selIngIds.push(obj.id);
|
this.selIngIds.push(obj.id);
|
||||||
this.selIngList.push({
|
this.selIngList.push({
|
||||||
key: obj.id,
|
key: obj.id,
|
||||||
label: obj.name
|
label: obj.name,
|
||||||
});
|
});
|
||||||
this.selTableData.push(obj)
|
this.selTableData.push(obj);
|
||||||
if (obj.rec) {
|
if (obj.rec) {
|
||||||
obj.rec.split(',').forEach(rec => {
|
obj.rec.split(",").forEach((rec) => {
|
||||||
if (!this.selRec.includes(rec)) {
|
if (!this.selRec.includes(rec)) {
|
||||||
this.selRec.push(rec)
|
this.selRec.push(rec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (obj.notRec) {
|
if (obj.notRec) {
|
||||||
obj.notRec.split(',').forEach(notRec => {
|
obj.notRec.split(",").forEach((notRec) => {
|
||||||
if (!this.selNotRec.includes(notRec)) {
|
if (!this.selNotRec.includes(notRec)) {
|
||||||
this.selNotRec.push(notRec)
|
this.selNotRec.push(notRec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
listAllIngredient({type: this.ingType}).then(res => {
|
listAllIngredient({ type: this.ingType }).then((res) => {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改菜品";
|
this.title = "修改菜品";
|
||||||
this.oriDataList = res.rows;
|
this.oriDataList = res.rows;
|
||||||
this.ingDataList = this.oriDataList.reduce((arr, cur) => {
|
this.ingDataList = this.oriDataList.reduce((arr, cur) => {
|
||||||
if (!arr.some(({key}) => key === cur.id)) {
|
if (!arr.some(({ key }) => key === cur.id)) {
|
||||||
arr.push({
|
arr.push({
|
||||||
key: cur.id,
|
key: cur.id,
|
||||||
label: cur.name
|
label: cur.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}, this.selIngList.slice());
|
}, this.selIngList.slice());
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.igdList = this.selTableData;
|
this.form.igdList = this.selTableData;
|
||||||
this.form.type = this.form.type.join(',');
|
this.form.type = this.form.type.join(",");
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateDishes(this.form).then(response => {
|
updateDishes(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -531,7 +603,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDishes(this.form).then(response => {
|
addDishes(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -548,87 +620,97 @@
|
|||||||
this.$confirm('是否确认删除菜品编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除菜品编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return delDishes(ids);
|
return delDishes(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有菜品数据项?', "警告", {
|
this.$confirm("是否确认导出所有菜品数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportDishes(queryParams);
|
return exportDishes(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
handleChange(value, direction, movedKeys) {
|
handleChange(value, direction, movedKeys) {
|
||||||
// console.log({oriIgdList: this.oriDataList, selIgdList: this.form.igdList});
|
// console.log({oriIgdList: this.oriDataList, selIgdList: this.form.igdList});
|
||||||
const newTableData = [];
|
const newTableData = [];
|
||||||
this.selRec = [];
|
this.selRec = [];
|
||||||
this.selNotRec = [];
|
this.selNotRec = [];
|
||||||
this.selIngList = value.map(id => {
|
this.selIngList = value.map((id) => {
|
||||||
// 搜索table中的数据
|
// 搜索table中的数据
|
||||||
let tmpTableObj = this.selTableData.find(obj => obj.id === id);
|
let tmpTableObj = this.selTableData.find((obj) => obj.id === id);
|
||||||
if (tmpTableObj) {
|
if (tmpTableObj) {
|
||||||
newTableData.push(tmpTableObj);
|
newTableData.push(tmpTableObj);
|
||||||
} else {
|
} else {
|
||||||
// 搜索请求的缓存数据
|
// 搜索请求的缓存数据
|
||||||
tmpTableObj = this.oriDataList.find(obj => obj.id === id);
|
tmpTableObj = this.oriDataList.find((obj) => obj.id === id);
|
||||||
if (tmpTableObj) {
|
if (tmpTableObj) {
|
||||||
newTableData.push({...tmpTableObj, weight: 100, cusWeight: 1, cusUnit: 1})
|
newTableData.push({
|
||||||
|
...tmpTableObj,
|
||||||
|
weight: 100,
|
||||||
|
cusWeight: 1,
|
||||||
|
cusUnit: 1,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tmpTableObj) {
|
if (tmpTableObj) {
|
||||||
if (tmpTableObj.rec) {
|
if (tmpTableObj.rec) {
|
||||||
tmpTableObj.rec.split(',').forEach(rec => {
|
tmpTableObj.rec.split(",").forEach((rec) => {
|
||||||
if (!this.selRec.includes(rec)) {
|
if (!this.selRec.includes(rec)) {
|
||||||
this.selRec.push(rec)
|
this.selRec.push(rec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (tmpTableObj.notRec) {
|
if (tmpTableObj.notRec) {
|
||||||
tmpTableObj.notRec.split(',').forEach(notRec => {
|
tmpTableObj.notRec.split(",").forEach((notRec) => {
|
||||||
if (!this.selNotRec.includes(notRec)) {
|
if (!this.selNotRec.includes(notRec)) {
|
||||||
this.selNotRec.push(notRec)
|
this.selNotRec.push(notRec);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const tarObj = this.ingDataList.find(({key}) => key === id);
|
const tarObj = this.ingDataList.find(({ key }) => key === id);
|
||||||
return tarObj
|
return tarObj;
|
||||||
});
|
});
|
||||||
this.selTableData = newTableData;
|
this.selTableData = newTableData;
|
||||||
},
|
},
|
||||||
handleOnTypeChange(value) {
|
handleOnTypeChange(value) {
|
||||||
listAllIngredient({type: value}).then(res => {
|
listAllIngredient({ type: value }).then((res) => {
|
||||||
this.oriDataList = res.rows;
|
this.oriDataList = res.rows;
|
||||||
this.ingDataList = this.oriDataList.reduce((arr, cur) => {
|
this.ingDataList = this.oriDataList.reduce((arr, cur) => {
|
||||||
if (!arr.some(({key}) => key === cur.id)) {
|
if (!arr.some(({ key }) => key === cur.id)) {
|
||||||
arr.push({
|
arr.push({
|
||||||
key: cur.id,
|
key: cur.id,
|
||||||
label: cur.name
|
label: cur.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}, this.selIngList.slice());
|
}, this.selIngList.slice());
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleInputChange(val) {
|
handleInputChange(val) {
|
||||||
console.log({val, table: this.selTableData})
|
console.log({ val, table: this.selTableData });
|
||||||
},
|
},
|
||||||
getSummaries(param) {
|
getSummaries(param) {
|
||||||
const {columns, data} = param;
|
const { columns, data } = param;
|
||||||
return columns.reduce((arr, cur, idx) => {
|
return columns.reduce(
|
||||||
|
(arr, cur, idx) => {
|
||||||
if (idx > 1) {
|
if (idx > 1) {
|
||||||
if (idx === 6) {
|
if (idx === 6) {
|
||||||
// 备注
|
// 备注
|
||||||
@ -638,83 +720,86 @@
|
|||||||
if (idx === 2) {
|
if (idx === 2) {
|
||||||
return acc + parseFloat(dAcc.weight);
|
return acc + parseFloat(dAcc.weight);
|
||||||
}
|
}
|
||||||
return parseFloat((acc + dAcc[cur.property] * dAcc.weight / 100).toFixed(1));
|
return parseFloat(
|
||||||
|
(acc + (dAcc[cur.property] * dAcc.weight) / 100).toFixed(1)
|
||||||
|
);
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}, ['合计'])
|
},
|
||||||
}
|
["合计"]
|
||||||
}
|
);
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-transfer-panel__filter {
|
.el-transfer-panel__filter {
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit {
|
.cus-unit {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-input-number--small {
|
.cus-unit .el-input-number--small {
|
||||||
width: 38px;
|
width: 38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-input-number .el-input-number__decrease {
|
.cus-unit .el-input-number .el-input-number__decrease {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-input-number .el-input-number__increase {
|
.cus-unit .el-input-number .el-input-number__increase {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-input-number .el-input {
|
.cus-unit .el-input-number .el-input {
|
||||||
width: 38px;
|
width: 38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-input-number .el-input .el-input__inner {
|
.cus-unit .el-input-number .el-input .el-input__inner {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: unset;
|
border: unset;
|
||||||
border-bottom: 1px solid #DCDFE6;
|
border-bottom: 1px solid #dcdfe6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-select .el-input__suffix {
|
.cus-unit .el-select .el-input__suffix {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cus-unit .el-select .el-input__inner {
|
.cus-unit .el-select .el-input__inner {
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
border: unset;
|
border: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weight {
|
.weight {
|
||||||
width: 70px
|
width: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weight .el-input .el-input__inner {
|
.weight .el-input .el-input__inner {
|
||||||
padding: 0 32px 0 4px;
|
padding: 0 32px 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer_content {
|
.drawer_content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer_content .el-form {
|
.drawer_content .content_detail {
|
||||||
/*height: calc(100% - 45px);*/
|
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer_content > div {
|
.drawer_content .dialog-footer {
|
||||||
flex: 0 0 45px;
|
flex: 0 0 45px;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user