菜谱管理
This commit is contained in:
		
							parent
							
								
									ef744252b9
								
							
						
					
					
						commit
						c4c987a8b9
					
				| 
						 | 
					@ -126,13 +126,21 @@
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div>
 | 
					                    <div>
 | 
				
			||||||
                        <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
 | 
					                        <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
 | 
				
			||||||
                        <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
 | 
					                        <el-cascader v-model="queryDish.dishesTypeId"
 | 
				
			||||||
 | 
					                            :options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
 | 
				
			||||||
 | 
					                            :props="{ 
 | 
				
			||||||
 | 
					                                emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
 | 
				
			||||||
 | 
					                                checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
 | 
				
			||||||
 | 
					                                value:'dishesTypeId',label:'dishesTypeName'
 | 
				
			||||||
 | 
					                            }" clearable @change="getDishesPage">
 | 
				
			||||||
 | 
					                        </el-cascader>
 | 
				
			||||||
 | 
					                        <!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
 | 
				
			||||||
                            <el-option v-for="item in typeOptions"
 | 
					                            <el-option v-for="item in typeOptions"
 | 
				
			||||||
                                :key="item.dishesTypeId"
 | 
					                                :key="item.dishesTypeId"
 | 
				
			||||||
                                :label="item.dishesTypeName"
 | 
					                                :label="item.dishesTypeName"
 | 
				
			||||||
                                :value="item.dishesTypeId" 
 | 
					                                :value="item.dishesTypeId" 
 | 
				
			||||||
                            ></el-option>
 | 
					                            ></el-option>
 | 
				
			||||||
                        </el-select>
 | 
					                        </el-select> -->
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div>
 | 
					                    <div>
 | 
				
			||||||
                        <div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
 | 
					                        <div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
 | 
				
			||||||
| 
						 | 
					@ -182,9 +190,9 @@
 | 
				
			||||||
                                <el-input  v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
 | 
					                                <el-input  v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
 | 
				
			||||||
                            </template>
 | 
					                            </template>
 | 
				
			||||||
                        </el-table-column>
 | 
					                        </el-table-column>
 | 
				
			||||||
                        <el-table-column label="最大供应量" align="center" prop="remanentNum">
 | 
					                        <el-table-column label="最大供应量" align="center" prop="supplyNum">
 | 
				
			||||||
                            <template slot-scope="scope">
 | 
					                            <template slot-scope="scope">
 | 
				
			||||||
                                <el-input  v-model="scope.row.remanentNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.remanentNum=v.replace(/[^\d]/g,''))"/>
 | 
					                                <el-input  v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
 | 
				
			||||||
                            </template>
 | 
					                            </template>
 | 
				
			||||||
                        </el-table-column>
 | 
					                        </el-table-column>
 | 
				
			||||||
                        <el-table-column label="每人限购数" align="center" prop="limitNum">
 | 
					                        <el-table-column label="每人限购数" align="center" prop="limitNum">
 | 
				
			||||||
| 
						 | 
					@ -851,7 +859,7 @@ export default {
 | 
				
			||||||
                "canteenId":this.baseInfo.canteenId,
 | 
					                "canteenId":this.baseInfo.canteenId,
 | 
				
			||||||
                "stallId":this.baseInfo.stallId,
 | 
					                "stallId":this.baseInfo.stallId,
 | 
				
			||||||
                "salesMode":this.queryDish.salesMode,
 | 
					                "salesMode":this.queryDish.salesMode,
 | 
				
			||||||
                "dishesTypeId":this.queryDish.dishesTypeId,
 | 
					                "typeIds":[this.queryDish.dishesTypeId],
 | 
				
			||||||
                "dishesName":this.queryDish.dishesName, 
 | 
					                "dishesName":this.queryDish.dishesName, 
 | 
				
			||||||
                "pageNum":1,
 | 
					                "pageNum":1,
 | 
				
			||||||
                "pageSize":100
 | 
					                "pageSize":100
 | 
				
			||||||
| 
						 | 
					@ -876,7 +884,7 @@ export default {
 | 
				
			||||||
                let dish = Object.assign({}, obj)
 | 
					                let dish = Object.assign({}, obj)
 | 
				
			||||||
                this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
 | 
					                this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
 | 
				
			||||||
                this.$set(dish,'price',Number(dish.price/100)) 
 | 
					                this.$set(dish,'price',Number(dish.price/100)) 
 | 
				
			||||||
                this.$set(dish,'remanentNum',dish.remanentNum||99999)
 | 
					                this.$set(dish,'supplyNum',dish.supplyNum||99999)
 | 
				
			||||||
                this.$set(dish,'limitNum',dish.limitNum||99999)
 | 
					                this.$set(dish,'limitNum',dish.limitNum||99999)
 | 
				
			||||||
                this.dishesList.push(dish)
 | 
					                this.dishesList.push(dish)
 | 
				
			||||||
                //反显选中样式
 | 
					                //反显选中样式
 | 
				
			||||||
| 
						 | 
					@ -1095,7 +1103,7 @@ export default {
 | 
				
			||||||
                stallId:this.dialogQueryParams.stallId,
 | 
					                stallId:this.dialogQueryParams.stallId,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            getPageRecipeListApi(param).then((response) => {
 | 
					            getPageRecipeListApi(param).then((response) => {
 | 
				
			||||||
                this.recipeOptions = response.data||[]
 | 
					                this.recipeOptions = response.rows||[]
 | 
				
			||||||
                this.dialogQueryParams.recipeId = null
 | 
					                this.dialogQueryParams.recipeId = null
 | 
				
			||||||
                this.dialogQueryParams.recipeType = null;
 | 
					                this.dialogQueryParams.recipeType = null;
 | 
				
			||||||
                this.dialogQueryParams.applyDate = null;
 | 
					                this.dialogQueryParams.applyDate = null;
 | 
				
			||||||
| 
						 | 
					@ -1200,11 +1208,11 @@ export default {
 | 
				
			||||||
                    "recipeId": this.dialogQueryParams.recipeId
 | 
					                    "recipeId": this.dialogQueryParams.recipeId
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                getMenuRecipeTemplateDetailApi(param).then((response) => {
 | 
					                getMenuRecipeTemplateDetailApi(param).then((response) => {
 | 
				
			||||||
                    if(response.length>0){
 | 
					                    if(response.data.length>0){
 | 
				
			||||||
                        for (let i = 0; i < response.length; i++) {
 | 
					                        for (let i = 0; i < response.data.length; i++) {
 | 
				
			||||||
                            this.dialogDetailList.forEach(item=>{
 | 
					                            this.dialogDetailList.forEach(item=>{
 | 
				
			||||||
                                if(item.mealtimeType==response[i].mealtimeType){
 | 
					                                if(item.mealtimeType==response.data[i].mealtimeType){
 | 
				
			||||||
                                    item.dishesList = response[i].dishesList;
 | 
					                                    item.dishesList = response.data[i].dishesList;
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }) 
 | 
					                            }) 
 | 
				
			||||||
                        }  
 | 
					                        }  
 | 
				
			||||||
| 
						 | 
					@ -1246,11 +1254,11 @@ export default {
 | 
				
			||||||
                    "recipeId": this.dialogQueryParams.recipeId
 | 
					                    "recipeId": this.dialogQueryParams.recipeId
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                getMenuRecipeTemplateDetailApi(param).then((response) => {
 | 
					                getMenuRecipeTemplateDetailApi(param).then((response) => {
 | 
				
			||||||
                    if(response.length>0){
 | 
					                    if(response.data.length>0){
 | 
				
			||||||
                        for (let i = 0; i < response.length; i++) {
 | 
					                        for (let i = 0; i < response.data.length; i++) {
 | 
				
			||||||
                            this.dialogDetailList.forEach(item=>{
 | 
					                            this.dialogDetailList.forEach(item=>{
 | 
				
			||||||
                                if(item.mealtimeType==response[i].mealtimeType){
 | 
					                                if(item.mealtimeType==response.data[i].mealtimeType){
 | 
				
			||||||
                                    item.dishesList = response[i].dishesList;
 | 
					                                    item.dishesList = response.data[i].dishesList;
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }) 
 | 
					                            }) 
 | 
				
			||||||
                        }  
 | 
					                        }  
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,13 +126,21 @@
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div>
 | 
					                    <div>
 | 
				
			||||||
                        <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
 | 
					                        <div style="font-weight: bold;margin: 10px 0;">菜品分类</div>
 | 
				
			||||||
                        <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
 | 
					                        <el-cascader v-model="queryDish.dishesTypeId"
 | 
				
			||||||
 | 
					                            :options="typeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
 | 
				
			||||||
 | 
					                            :props="{ 
 | 
				
			||||||
 | 
					                                emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
 | 
				
			||||||
 | 
					                                checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
 | 
				
			||||||
 | 
					                                value:'dishesTypeId',label:'dishesTypeName'
 | 
				
			||||||
 | 
					                            }" clearable @change="getDishesPage">
 | 
				
			||||||
 | 
					                        </el-cascader>
 | 
				
			||||||
 | 
					                        <!-- <el-select v-model="queryDish.dishesTypeId" style="width: 100%;" clearable @change="getDishesPage">
 | 
				
			||||||
                            <el-option v-for="item in typeOptions"
 | 
					                            <el-option v-for="item in typeOptions"
 | 
				
			||||||
                                :key="item.dishesTypeId"
 | 
					                                :key="item.dishesTypeId"
 | 
				
			||||||
                                :label="item.dishesTypeName"
 | 
					                                :label="item.dishesTypeName"
 | 
				
			||||||
                                :value="item.dishesTypeId" 
 | 
					                                :value="item.dishesTypeId" 
 | 
				
			||||||
                            ></el-option>
 | 
					                            ></el-option>
 | 
				
			||||||
                        </el-select>
 | 
					                        </el-select> -->
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div>
 | 
					                    <div>
 | 
				
			||||||
                        <div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
 | 
					                        <div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
 | 
				
			||||||
| 
						 | 
					@ -183,9 +191,9 @@
 | 
				
			||||||
                                <el-input  v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
 | 
					                                <el-input  v-model="scope.row.salePrice" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g,''))"/>
 | 
				
			||||||
                            </template>
 | 
					                            </template>
 | 
				
			||||||
                        </el-table-column>
 | 
					                        </el-table-column>
 | 
				
			||||||
                        <el-table-column label="最大供应量" align="center" prop="remanentNum">
 | 
					                        <el-table-column label="最大供应量" align="center" prop="supplyNum">
 | 
				
			||||||
                            <template slot-scope="scope">
 | 
					                            <template slot-scope="scope">
 | 
				
			||||||
                                <el-input  v-model="scope.row.remanentNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.remanentNum=v.replace(/[^\d]/g,''))"/>
 | 
					                                <el-input  v-model="scope.row.supplyNum" placeholder="请输入" maxlength="30" clearable @input="(v)=>(scope.row.supplyNum=v.replace(/[^\d]/g,''))"/>
 | 
				
			||||||
                            </template>
 | 
					                            </template>
 | 
				
			||||||
                        </el-table-column>
 | 
					                        </el-table-column>
 | 
				
			||||||
                        <el-table-column label="每人限购数" align="center" prop="limitNum">
 | 
					                        <el-table-column label="每人限购数" align="center" prop="limitNum">
 | 
				
			||||||
| 
						 | 
					@ -1054,7 +1062,7 @@ export default {
 | 
				
			||||||
                "canteenId":this.baseInfo.canteenId,
 | 
					                "canteenId":this.baseInfo.canteenId,
 | 
				
			||||||
                "stallId":this.baseInfo.stallId,
 | 
					                "stallId":this.baseInfo.stallId,
 | 
				
			||||||
                "salesMode":this.queryDish.salesMode,
 | 
					                "salesMode":this.queryDish.salesMode,
 | 
				
			||||||
                "dishesTypeId":this.queryDish.dishesTypeId,
 | 
					                "typeIds":[this.queryDish.dishesTypeId],
 | 
				
			||||||
                "dishesName":this.queryDish.dishesName, 
 | 
					                "dishesName":this.queryDish.dishesName, 
 | 
				
			||||||
                "pageNum":1,
 | 
					                "pageNum":1,
 | 
				
			||||||
                "pageSize":100
 | 
					                "pageSize":100
 | 
				
			||||||
| 
						 | 
					@ -1079,7 +1087,7 @@ export default {
 | 
				
			||||||
                let dish = Object.assign({}, obj)  
 | 
					                let dish = Object.assign({}, obj)  
 | 
				
			||||||
                this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
 | 
					                this.$set(dish,'salePrice',Number(dish.price/100)||Number(dish.price/100))
 | 
				
			||||||
                this.$set(dish,'price',Number(dish.price/100)) 
 | 
					                this.$set(dish,'price',Number(dish.price/100)) 
 | 
				
			||||||
                this.$set(dish,'remanentNum',dish.remanentNum||99999)
 | 
					                this.$set(dish,'supplyNum',dish.supplyNum||99999)
 | 
				
			||||||
                this.$set(dish,'limitNum',dish.limitNum||99999) 
 | 
					                this.$set(dish,'limitNum',dish.limitNum||99999) 
 | 
				
			||||||
                this.dishesList.push(dish)
 | 
					                this.dishesList.push(dish)
 | 
				
			||||||
                //反显选中样式
 | 
					                //反显选中样式
 | 
				
			||||||
| 
						 | 
					@ -1300,7 +1308,7 @@ export default {
 | 
				
			||||||
                stallId:this.dialogQueryParams.stallId,
 | 
					                stallId:this.dialogQueryParams.stallId,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            getPageRecipeListApi(param).then((response) => {
 | 
					            getPageRecipeListApi(param).then((response) => {
 | 
				
			||||||
                this.recipeOptions = response.data||[]
 | 
					                this.recipeOptions = response.rows||[]
 | 
				
			||||||
                this.dialogQueryParams.recipeId = null
 | 
					                this.dialogQueryParams.recipeId = null
 | 
				
			||||||
                this.dialogQueryParams.recipeType = null;
 | 
					                this.dialogQueryParams.recipeType = null;
 | 
				
			||||||
                this.dialogQueryParams.applyDate = null;
 | 
					                this.dialogQueryParams.applyDate = null;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,7 +146,7 @@
 | 
				
			||||||
            <el-table-column label="菜品数量" align="center" prop="dishesCount" v-if="activeName=='pageRecipe'"/>
 | 
					            <el-table-column label="菜品数量" align="center" prop="dishesCount" v-if="activeName=='pageRecipe'"/>
 | 
				
			||||||
            <el-table-column label="菜谱生效日期" align="center" prop="applyDateStringList" v-if="activeName=='pageRecipe'">
 | 
					            <el-table-column label="菜谱生效日期" align="center" prop="applyDateStringList" v-if="activeName=='pageRecipe'">
 | 
				
			||||||
                <template slot-scope="scope">
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
                    <el-popover placement="top" width="400"> 
 | 
					                    <!-- <el-popover placement="top" width="400"> 
 | 
				
			||||||
                        <div style="width: 100%;padding: 10px;border-bottom: 1px solid #ccc;margin-bottom: 10px;">
 | 
					                        <div style="width: 100%;padding: 10px;border-bottom: 1px solid #ccc;margin-bottom: 10px;">
 | 
				
			||||||
                            {{currentMonth}}
 | 
					                            {{currentMonth}}
 | 
				
			||||||
                        </div> 
 | 
					                        </div> 
 | 
				
			||||||
| 
						 | 
					@ -157,7 +157,7 @@
 | 
				
			||||||
                            <div v-for="(item,index) in monthDaysList" :key="index" :class="scope.row.applyDateStringList.findIndex(v=>v==item)>-1 ? 'dateTable2' : 'dateTable'" class="" >{{item}}</div> 
 | 
					                            <div v-for="(item,index) in monthDaysList" :key="index" :class="scope.row.applyDateStringList.findIndex(v=>v==item)>-1 ? 'dateTable2' : 'dateTable'" class="" >{{item}}</div> 
 | 
				
			||||||
                        </div> 
 | 
					                        </div> 
 | 
				
			||||||
                    <div style="color: #1890ff;cursor: pointer;" slot="reference">查看详情</div> 
 | 
					                    <div style="color: #1890ff;cursor: pointer;" slot="reference">查看详情</div> 
 | 
				
			||||||
                    </el-popover>
 | 
					                    </el-popover> -->
 | 
				
			||||||
                </template>
 | 
					                </template>
 | 
				
			||||||
            </el-table-column>
 | 
					            </el-table-column>
 | 
				
			||||||
            <el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/>
 | 
					            <el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/>
 | 
				
			||||||
| 
						 | 
					@ -516,14 +516,14 @@
 | 
				
			||||||
            this.queryParams.pageNum = this.queryParams.pageNum
 | 
					            this.queryParams.pageNum = this.queryParams.pageNum
 | 
				
			||||||
            this.queryParams.pageSize = this.queryParams.pageSize
 | 
					            this.queryParams.pageSize = this.queryParams.pageSize
 | 
				
			||||||
            if(this.activeName=='currentRecipe'){ 
 | 
					            if(this.activeName=='currentRecipe'){ 
 | 
				
			||||||
                getCurrentRecipeListApi(this.queryParams).then(response => {
 | 
					                // getCurrentRecipeListApi(this.queryParams).then(response => {
 | 
				
			||||||
                    this.tableListData = response.rows;
 | 
					                //     this.tableListData = response.rows;
 | 
				
			||||||
                    this.total = Number(response.total);
 | 
					                //     this.total = Number(response.total);
 | 
				
			||||||
                    this.loading = false;
 | 
					                //     this.loading = false;
 | 
				
			||||||
                }); 
 | 
					                // }); 
 | 
				
			||||||
            }else if(this.activeName=='pageRecipe'){
 | 
					            }else if(this.activeName=='pageRecipe'){
 | 
				
			||||||
                getPageRecipeListApi(this.queryParams).then(response => {
 | 
					                getPageRecipeListApi(this.queryParams).then(response => {
 | 
				
			||||||
                    this.tableListData = response.data;
 | 
					                    this.tableListData = response.rows;
 | 
				
			||||||
                    this.total = Number(response.total);
 | 
					                    this.total = Number(response.total);
 | 
				
			||||||
                    this.loading = false;
 | 
					                    this.loading = false;
 | 
				
			||||||
                }); 
 | 
					                }); 
 | 
				
			||||||
| 
						 | 
					@ -537,14 +537,14 @@
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 修改按钮操作 */
 | 
					        /** 修改按钮操作 */
 | 
				
			||||||
        handleUpdate(row) {
 | 
					        handleUpdate(row) {
 | 
				
			||||||
            let param = { 
 | 
					        //     let param = { 
 | 
				
			||||||
                recipeId:row.recipeId
 | 
					        //         recipeId:row.recipeId
 | 
				
			||||||
            }
 | 
					        //     }
 | 
				
			||||||
            getPageRecipeListApi(param).then(response => {
 | 
					        //     getPageRecipeListApi(param).then(response => {
 | 
				
			||||||
                let obj = response.data[0]
 | 
					        //         let obj = response.rows[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                this.$router.push({ path: "/dish/menuEdit",query: {pageJson:JSON.stringify(obj)} }); 
 | 
					            this.$router.push({ path: "/dish/menuEdit",query: {pageJson:JSON.stringify(row)} }); 
 | 
				
			||||||
            }); 
 | 
					            // }); 
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 查看设备 */
 | 
					        /** 查看设备 */
 | 
				
			||||||
        handleDevice(row) {
 | 
					        handleDevice(row) {
 | 
				
			||||||
| 
						 | 
					@ -592,7 +592,7 @@
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            getPageRecipeListApi(param).then(response => {
 | 
					            getPageRecipeListApi(param).then(response => {
 | 
				
			||||||
                // console.log(response.records)
 | 
					                // console.log(response.records)
 | 
				
			||||||
                this.recipeOptionsData = response.data
 | 
					                this.recipeOptionsData = response.rows
 | 
				
			||||||
                this.resetForm("menuForm");
 | 
					                this.resetForm("menuForm");
 | 
				
			||||||
                this.openMenu=true
 | 
					                this.openMenu=true
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue