接口对接(营养-原料)

This commit is contained in:
zzyuan 2025-04-16 13:25:19 +08:00
parent 690a8c6be4
commit cbf468d0cb
26 changed files with 122 additions and 109 deletions

View File

@ -72,12 +72,12 @@ export function removeMenuDishesTypeApi(typeId) {
// 菜品列表-分页
export function getMenuDishesListApi(data) {
return request({
url: '/smart-canteen/api/v2/menudishes/page',
method: 'post',
url: '/smart-canteen/menu_dishes/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
data: data
params: data
})
}
// 菜品列表-新增
@ -94,7 +94,7 @@ export function addMenuDishesApi(data) {
// 菜品列表-修改
export function editMenuDishesApi(data) {
return request({
url: '/smart-canteen/api/v2/menudishes/edit',
url: '/smart-canteen/menu_dishes/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@ -115,14 +115,14 @@ export function menuDishesDetailApi(data) {
}
// 菜品列表-删除
export function removeMenuDishesApi(dishesId) {
export function removeMenuDishesApi(data) {
return request({
url: '/smart-canteen/api/v2/menudishes/remove/'+dishesId,
url: '/smart-canteen/menu_dishes/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
// data: data
data: data
})
}

View File

@ -118,7 +118,7 @@ export function batchUpdateMaterialApi(data) {
//{current: 1, size: -1, ifListUse: 1, areaId: '421488254718578688'}
export function getDrpUnitListApi(data) {
return request({
url: '/smart-canteen/api/v1/drpunit/page',
url: '/smart-canteen/menu_material/getDrpUnit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",

View File

@ -49,9 +49,9 @@ export function listNutrition(query) {
// 查询详细
export function getNutrition(data) {
return request({
url: '/smart-canteen/menu_nutrition_type/getInfo',
method: 'get',
params: data
url: '/smart-canteen/menu_nutrition/getInfo',
method: 'post',
data: data
})
}
@ -86,17 +86,17 @@ export function delNutrition(data) {
// 获取所有营养信息
export function nutritionAllListApi(data) {
return request({
url: '/smart-canteen/api/v1/menunutrition/all/list',
url: '/smart-canteen/menu_nutrition/getListByCategoryId',
method: 'post',
data: data
})
}
// 获取营养信息-详细数据
export function nutritionDetailApi(nutritionId) {
return request({
url: '/smart-canteen/api/v1/menumaterial/nutrition/detail/'+nutritionId,
method: 'post',
// data: data
})
}
// // 获取营养信息-详细数据
// export function nutritionDetailApi(nutritionId) {
// return request({
// url: '/smart-canteen/api/v1/menumaterial/nutrition/detail/'+nutritionId,
// method: 'post',
// // data: data
// })
// }

View File

@ -122,7 +122,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
</el-table>
<pagination

View File

@ -121,7 +121,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
@ -262,7 +262,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -329,7 +329,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -122,7 +122,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
</el-table>
<pagination

View File

@ -80,7 +80,7 @@
<el-table-column label="用户编号" align="center" prop="userId" :show-overflow-tooltip="true" />
<el-table-column label="用户姓名" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户手机号" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="组织全称" align="center" prop="deptFullName" :show-overflow-tooltip="true" />
<el-table-column label="所属组织" align="center" prop="deptFullName" :show-overflow-tooltip="true" />
<el-table-column label="操作员" align="center" prop="createBy" :show-overflow-tooltip="true" />
<el-table-column label="操作员事件" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="操作时间" align="center" prop="createTime" :show-overflow-tooltip="true" />

View File

@ -87,7 +87,7 @@
</template>
</el-table-column> -->
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
@ -258,7 +258,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -79,7 +79,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope" v-if="scope.$index!=10">
<el-button
@ -217,7 +217,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -403,7 +403,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -485,7 +485,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -281,7 +281,7 @@
<el-form-item label="用户类别">
<el-select v-model="queryParams4.psnTypeList" multiple style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -379,7 +379,7 @@
import { accSubsidyRechargePageApi,repealSubsidyRechargeApi,batchRepealSubsidyRechargeApi,accSubsidyClearPageApi,accSubsidyRepealPageApi,accSubsidyHandReceivePageApi,accSubsidyHandReceiveBatchGrantApi,batchAccSubsidyRepealApi } from "@/api/accountCenter/butie";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -26,7 +26,7 @@
<el-form-item label="用户类别" v-if="activeName=='psn'">
<el-select v-model="queryParams.psnTypeList" multiple style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -116,7 +116,7 @@
import { accountSubsidyCustPageApi } from "@/api/accountCenter/butie";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -32,7 +32,7 @@
<el-form-item label="用户类别" v-if="activeName=='psn'">
<el-select v-model="queryParams.psnTypeList" multiple style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -123,7 +123,7 @@
import { accountConsumeCustPageApi,accountConsumePsnPageApi,accountConsumeOrganizationPageApi } from "@/api/accountCenter/consume";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -32,7 +32,7 @@
<el-form-item label="用户类别" v-if="activeName!='organization'">
<el-select v-model="queryParams.psnTypeList" multiple style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -114,7 +114,7 @@
import { walletConsumeCustPageApi,walletConsumePsnPageApi,walletConsumeOrganizationPageApi } from "@/api/accountCenter/consume";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -73,7 +73,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
@ -240,7 +240,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -423,7 +423,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -38,7 +38,7 @@
<el-form-item label="用户类别">
<el-select v-model="queryParams.psnTypeList" multiple style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -163,7 +163,7 @@
import { accountFlowPageApi } from "@/api/accountCenter/consume";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -79,7 +79,7 @@
</template>
</el-table-column>
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope" v-if="scope.$index!=10">
<el-button
@ -227,7 +227,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -408,7 +408,7 @@
<el-form-item label="" prop="psnType">
<el-select v-model="dialogParams.psnType" placeholder="用户类别" style="width: 240px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -477,7 +477,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -99,7 +99,7 @@
import { accFrozenPageApi } from "@/api/accountCenter/freeze";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -102,7 +102,7 @@
import { accUnfrozenPageApi } from "@/api/accountCenter/freeze";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -1026,9 +1026,9 @@
queryParams: {
pageNum: 1,
pageSize: 10,
areaIds: [],
canteenIds: [],
stallIds: [],
areaId: null,
canteenId: null,
stallId: null,
dishesName: "",
typeIdList: []
},
@ -1306,17 +1306,17 @@
console.log(this.$refs.typeTree.getCheckedKeys())
this.loading = true;
let params= {
"size": this.queryParams.pageSize,
"current": this.queryParams.pageNum,
"areaIds": this.queryParams.areaIds,
"canteenIds": this.queryParams.canteenIds,
"stallIds": this.queryParams.stallIds,
"pageSize": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"areaId": this.queryParams.areaId,
"canteenId": this.queryParams.canteenId,
"shopstallId": this.queryParams.stallId,
"dishesName": this.queryParams.dishesName,
"typeIdList": this.$refs.typeTree.getCheckedKeys(),
// "typeIdList": this.$refs.typeTree.getCheckedKeys(),
}
getMenuDishesListApi(params).then((response) => {
this.tableList = response.data.records;
this.total = Number(response.data.total);
this.tableList = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},

View File

@ -288,7 +288,7 @@
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { systemMaterialTreeApi,getDrpUnitListApi } from "@/api/dish/material";
import { nutritionTypeListApi,nutritionAllListApi,nutritionDetailApi } from "@/api/dish/nutritionInfo";
import { nutritionTypeListApi,nutritionAllListApi,getNutrition } from "@/api/dish/nutritionInfo";
export default {
name: "MaterialDialog",
props: {
@ -416,7 +416,7 @@ export default {
created() {
this.getAreaTreeData();//
this.getTypeTreeData();//
// this.getDrpUnitList();//
this.getDrpUnitList();//
this.getNutritionType()//
},
methods: {
@ -432,7 +432,7 @@ export default {
console.log(this.form)
this.form.categoryId=null
this.getTypeTreeData()
// this.getDrpUnitList()
this.getDrpUnitList()
},
//
getTypeTreeData() {
@ -448,21 +448,22 @@ export default {
//
getDrpUnitList() {
let param = {
areaId: this.form.areaId||"",
ifListUse: 1,
current: 1,
size: -1
weighType:this.form.salesMode,
// areaId: this.form.areaId||""
// ifListUse: 1,
// current: 1,
// size: -1
}
this.form.unitId=null
getDrpUnitListApi(param).then((response) => {
this.unitOptions = [];
if(response.data.records.length>0){
response.data.records.forEach(item => {
if(item.weighType==this.form.salesMode){
this.unitOptions.push(item)
}
});
}
this.unitOptions = response.data;
// if(response.data.records.length>0){
// response.data.records.forEach(item => {
// if(item.weighType==this.form.salesMode){
// this.unitOptions.push(item)
// }
// });
// }
});
},
//
@ -513,7 +514,8 @@ export default {
//
chosenNutrition(){
console.log("选中营养信息",this.form.nutritionId)
nutritionDetailApi(this.form.nutritionId).then((response) => {
getNutrition({nutritionId: this.form.nutritionId}).then((response) => {
this.form.menuMaterialNutritionDTO = response.data
});
},

View File

@ -181,17 +181,17 @@
<el-row>
<el-col :span="12">
<el-form-item label="营养信息类别" prop="nutritionCategory">
<el-form-item label="营养信息类别" prop="categoryId">
<el-cascader
v-model="form.nutritionCategory"
v-model="form.categoryId"
:options="cascaderOptions"
:props="{
emitPath: true,// falseid
emitPath: false,// falseid
checkStrictly: false,//
value:'label',label:'label'
value:'value',label:'label'
}"
placeholder="请选择营养信息类别"
clearable
clearable @change="chosenType"
style="width: 100%;"
/>
</el-form-item>
@ -595,7 +595,7 @@ export default {
},
//
form: {
nutritionCategory: [], //
categoryId: undefined, //
nutritionName: undefined, //
nutritionCode: undefined, //
processingTime: undefined, //
@ -628,7 +628,7 @@ export default {
},
//
rules: {
nutritionCategory: [
categoryId: [
{ required: true, message: "请选择营养信息类别", trigger: "change" }
],
nutritionName: [
@ -698,6 +698,7 @@ export default {
children: item.littleTypeList.map(subItem => ({
value: subItem.id,//value#
label: subItem.bigType,
bigType: item.bigType,
parentId:item.id,
level:2
}))
@ -816,7 +817,7 @@ export default {
//
reset() {
this.form = {
nutritionCategory: [], //
categoryId: undefined, //
nutritionName: undefined, //
nutritionCode: undefined, //
processingTime: undefined, //
@ -877,31 +878,41 @@ export default {
this.reset();
// const id = row.nutritionId;
var data = {
id: row.id
nutritionId: row.nutritionId
}
getNutrition(data).then(response => {
this.form = response.data;
//
if (response.data.bigType && response.data.littleType) {
this.$set(this.form,"nutritionCategory",[response.data.bigType,response.data.littleType])
}
this.form = response.data;
this.$set(this.form,"categoryId",Number(response.data.categoryId))
this.open = true;
this.title = "修改营养信息";
});
},
//
getParentCategoryName(Id) {
const findNode = (nodes) => {
for (let node of nodes) {
if (node.value === Id) {
return node;
}
if (node.children) {
const result = findNode(node.children);
if (result) return result;
}
}
return "";
};
return findNode(this.cascaderOptions);
},
chosenType(e){
let obj = this.getParentCategoryName(e)
this.form.bigType = obj.bigType
this.form.littleType = obj.label
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
const formData = { ...this.form };
console.log(formData)
//
if (formData.nutritionCategory && formData.nutritionCategory.length >= 2) {
formData.bigType = formData.nutritionCategory[0];
formData.littleType = formData.nutritionCategory[1];
}
delete formData.nutritionCategory; //
if (formData.id != undefined) {
updateNutrition(formData).then(response => {
this.$modal.msgSuccess("修改成功");

View File

@ -98,7 +98,7 @@
<el-form-item label="用户类别">
<el-select v-model="queryParams.psnType" style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -534,7 +534,7 @@
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -108,7 +108,7 @@
<el-form-item label="用户类别">
<el-select v-model="queryParams.psnType" style="width: 220px" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -539,7 +539,7 @@ import { orderPageListApi,orderDetailInfoApi,refundOrderPartApi,refundOrderApi,w
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -161,7 +161,7 @@
<el-form-item label="用户类别" prop="psnTypeList">
<el-select v-model="baseForm.psnTypeList" multiple style="width: 100%" clearable>
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
@ -307,7 +307,7 @@
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -408,7 +408,7 @@
import { orderPageListApi,orderDetailInfoApi,refundOrderPartApi,refundOrderApi,writeOffOrderApi,syncOrderPayStateApi } from "@/api/superStore/superOrder";
export default {
name: "",
dicts: ['user_psn_type'],
dicts: ['sys_user_type'],
data() {
return {
//

View File

@ -469,7 +469,7 @@
<el-form-item label="用户类别">
<el-select v-model="form.psnType" placeholder="请选择用户类别">
<el-option
v-for="dict in dict.type.user_psn_type"
v-for="dict in dict.type.sys_user_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -646,7 +646,7 @@ export default {
dicts: [
'sys_normal_disable',
'sys_user_sex',
'user_psn_type',
'sys_user_type',
'sys_login_type',
'sys_user_permanent',
],