原料菜品
This commit is contained in:
parent
e0c4750259
commit
690a8c6be4
|
|
@ -1,23 +1,31 @@
|
|||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// // 查询菜品灶类列表
|
||||
// export function getMenuDishesCookListApi(data) {
|
||||
// return request({
|
||||
// url: '/smart-canteen/api/v1/menudishescook/page',
|
||||
// method: 'get',
|
||||
// headers: {
|
||||
// "merchant-id":"378915229716713472",
|
||||
// },
|
||||
// params: data
|
||||
// })
|
||||
// }
|
||||
// 查询菜品灶类列表 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/api/v1/menudishestype/all/list',
|
||||
url: '/smart-canteen/menu_material/getAllMenuDishesTypeList',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -28,7 +36,7 @@ export function menuDishesTypeAllListApi(data) {
|
|||
// 菜品种类-新增 areaId typeName
|
||||
export function addMenuDishesTypeApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menudishestype/add',
|
||||
url: '/smart-canteen/menu_material/addMenuDishesType',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -60,6 +68,7 @@ export function removeMenuDishesTypeApi(typeId) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// 菜品列表-分页
|
||||
export function getMenuDishesListApi(data) {
|
||||
return request({
|
||||
|
|
@ -74,7 +83,7 @@ export function getMenuDishesListApi(data) {
|
|||
// 菜品列表-新增
|
||||
export function addMenuDishesApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v2/menudishes/add',
|
||||
url: '/smart-canteen/menu_dishes/addMenuDishes',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export function systemMaterialTreeApi(data) {
|
|||
// 新增原料类别
|
||||
export function addMaterialTypeApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterialcategory/add',
|
||||
url: '/smart-canteen/menu_material_category/add',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -25,7 +25,7 @@ export function addMaterialTypeApi(data) {
|
|||
//修改原料类别
|
||||
export function updateMaterialTypeApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterialcategory/edit',
|
||||
url: '/smart-canteen/menu_material_category/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -36,7 +36,7 @@ export function updateMaterialTypeApi(data) {
|
|||
//删除原料类别
|
||||
export function removeMaterialTypeApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterialcategory/remove',
|
||||
url: '/smart-canteen/menu_material_category/del',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -48,19 +48,19 @@ export function removeMaterialTypeApi(data) {
|
|||
// 查询原料列表
|
||||
export function getMaterialListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterial/page',
|
||||
method: 'post',
|
||||
url: '/smart-canteen/menu_material/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增原料
|
||||
export function addMaterialApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterial/add',
|
||||
url: '/smart-canteen/menu_material/addMessage',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -72,7 +72,7 @@ export function addMaterialApi(data) {
|
|||
// 编辑原料
|
||||
export function updateMaterialApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterial/edit',
|
||||
url: '/smart-canteen/menu_material/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
@ -84,11 +84,12 @@ export function updateMaterialApi(data) {
|
|||
// 删除原料
|
||||
export function removeMaterialApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/menumaterial/remove/'+data.materialId,
|
||||
url: '/smart-canteen/menu_material/del',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
}
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 批量删除原料
|
||||
|
|
@ -117,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/api/v1/drpunit/page',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
|
|
|
|||
|
|
@ -488,9 +488,9 @@
|
|||
<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.cookId"
|
||||
:label="item.cookName"
|
||||
:value="item.cookId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -499,9 +499,9 @@
|
|||
<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.labelId"
|
||||
:label="item.labelName"
|
||||
:value="item.labelId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -511,9 +511,9 @@
|
|||
<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.tasteId"
|
||||
:label="item.tasteName"
|
||||
:value="item.tasteId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -522,9 +522,9 @@
|
|||
<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.styleId"
|
||||
:label="item.styleName"
|
||||
:value="item.styleId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -545,9 +545,9 @@
|
|||
<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.effectId"
|
||||
:label="item.effectName"
|
||||
:value="item.effectId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -557,9 +557,9 @@
|
|||
<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.suitId"
|
||||
:label="item.suitName"
|
||||
:value="item.suitId"
|
||||
:key="item.value"
|
||||
:label="item.key"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -989,6 +989,7 @@
|
|||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { menuDishesTypeAllListApi,addMenuDishesTypeApi, editMenuDishesTypeApi, removeMenuDishesTypeApi} from "@/api/dish/dish";
|
||||
import { getMenuDishesListApi,addMenuDishesApi, editMenuDishesApi,menuDishesDetailApi,removeMenuDishesApi } from "@/api/dish/dish";
|
||||
import { getDishesTypeListApi } from "@/api/dish/dish";
|
||||
import { getMenuDishesCookListApi, getMenuDishesLabelListApi, getMenuDishesTasteListApi, getMenuDishesEffectListApi, getMenuDishesStyleListApi, getMenuDishesSuitListApi } from "@/api/dish/type"
|
||||
import { getMaterialListApi } from "@/api/dish/material";
|
||||
import { imgUpLoadTwo } from '@/api/system/upload'
|
||||
|
|
@ -1326,23 +1327,23 @@
|
|||
"page":{"current":1,"size":-1},
|
||||
"object":{}
|
||||
}
|
||||
getMenuDishesCookListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesCookOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":'dishes_cook'}).then(response => {
|
||||
this.dishesCookOptions = response.data;
|
||||
});
|
||||
getMenuDishesLabelListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesLabelOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":"dishes_label"}).then(response => {
|
||||
this.dishesLabelOptions = response.data;
|
||||
});
|
||||
getMenuDishesTasteListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesTasteOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":"dishes_taste"}).then(response => {
|
||||
this.dishesTasteOptions = response.data;
|
||||
});
|
||||
getMenuDishesEffectListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesEffectOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":"dishes_effec"}).then(response => {
|
||||
this.dishesEffectOptions = response.data;
|
||||
});
|
||||
getMenuDishesStyleListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesStyleOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":"dishes_style"}).then(response => {
|
||||
this.dishesStyleOptions = response.data;
|
||||
});
|
||||
getMenuDishesSuitListApi({"content":JSON.stringify(param)}).then(response => {
|
||||
this.dishesSuitOptions = response.data.records;
|
||||
getDishesTypeListApi({"key":"dishes_suitId"}).then(response => {
|
||||
this.dishesSuitOptions = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,11 @@
|
|||
<el-cascader
|
||||
v-model="form.str"
|
||||
:options="cascaderOptions"
|
||||
:props="{
|
||||
emitPath: true,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'label',label:'label'
|
||||
}"
|
||||
placeholder="请选择营养信息类别"
|
||||
clearable style="width: 100%;"
|
||||
@change="handleNutritionChange"
|
||||
|
|
@ -172,7 +177,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="是否需要检测" prop="ifNeedDetect">
|
||||
<el-select v-model="form.safeConfigDTO.ifNeedDetect" placeholder="请选择是否需要检测" style="width: 100%">
|
||||
<el-option label="是" value="1" />
|
||||
|
|
@ -205,10 +210,10 @@
|
|||
<el-select v-model="form.qualificationCert" placeholder="请选择供应资格证书" style="width: 100%">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加工方法" prop="firstProcessList">
|
||||
<div class="method-input-group">
|
||||
|
|
@ -244,7 +249,7 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
|
|
@ -283,7 +288,7 @@
|
|||
<script>
|
||||
import { systemAreaTreeApi } from "@/api/base/area";
|
||||
import { systemMaterialTreeApi,getDrpUnitListApi } from "@/api/dish/material";
|
||||
import { typeList,nutritionAllListApi,nutritionDetailApi } from "@/api/dish/nutritionInfo";
|
||||
import { nutritionTypeListApi,nutritionAllListApi,nutritionDetailApi } from "@/api/dish/nutritionInfo";
|
||||
export default {
|
||||
name: "MaterialDialog",
|
||||
props: {
|
||||
|
|
@ -322,14 +327,14 @@ export default {
|
|||
purPriceCeiling:'',//采购上限价格
|
||||
size:'',//原料规格
|
||||
taxRate:'',//原料税率
|
||||
safeConfigDTO:{
|
||||
ifNeedDetect: '2',//是否检测(1是2否)
|
||||
detectInstitution:'1',//检测机构(1自检,2供应商检,3自检或供应商检,4自检且供应商检)
|
||||
detectItem:"1",//
|
||||
},
|
||||
qualificationCert: '',
|
||||
firstProcessList: [''],
|
||||
cutProcessList: [''],
|
||||
// safeConfigDTO:{
|
||||
// ifNeedDetect: '2',//是否检测(1是2否)
|
||||
// detectInstitution:'1',//检测机构(1自检,2供应商检,3自检或供应商检,4自检且供应商检)
|
||||
// detectItem:"1",//
|
||||
// },
|
||||
// qualificationCert: '',
|
||||
// firstProcessList: [''],
|
||||
// cutProcessList: [''],
|
||||
//营养信息
|
||||
menuMaterialNutritionDTO: {
|
||||
edible: '',//可食部分(g/100g)
|
||||
|
|
@ -369,7 +374,7 @@ export default {
|
|||
areaId: [{ required: true, message: '请选择所属区域', trigger: 'change' }],
|
||||
categoryId: [{ required: true, message: '请选择原料类别', trigger: 'change' }],
|
||||
salesMode: [{ required: true, message: '请选择计量类型', trigger: 'change' }],
|
||||
unitId: [{ required: true, message: '请选择原料单位', trigger: 'change' }]
|
||||
// unitId: [{ required: true, message: '请选择原料单位', trigger: 'change' }]
|
||||
},
|
||||
nutritionFields: [
|
||||
{ label: '可食部分', prop: 'ediblePart', unit: 'g/100g' },
|
||||
|
|
@ -411,7 +416,7 @@ export default {
|
|||
created() {
|
||||
this.getAreaTreeData();//获取区域树
|
||||
this.getTypeTreeData();//获取原料类别树
|
||||
this.getDrpUnitList();//获取单位类型下拉
|
||||
// this.getDrpUnitList();//获取单位类型下拉
|
||||
this.getNutritionType()//获取营养信息类别树
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -427,7 +432,7 @@ export default {
|
|||
console.log(this.form)
|
||||
this.form.categoryId=null
|
||||
this.getTypeTreeData()
|
||||
this.getDrpUnitList()
|
||||
// this.getDrpUnitList()
|
||||
},
|
||||
//类型树
|
||||
getTypeTreeData() {
|
||||
|
|
@ -462,7 +467,7 @@ export default {
|
|||
},
|
||||
//获取营养类别
|
||||
getNutritionType() {
|
||||
typeList().then(response => {
|
||||
nutritionTypeListApi().then(response => {
|
||||
this.nutritionTypeTreeData = response.data;
|
||||
this.cascaderOptions = this.cascaderOptionsMethod();
|
||||
console.log(this.cascaderOptions)
|
||||
|
|
@ -477,11 +482,15 @@ export default {
|
|||
return [];
|
||||
}
|
||||
return this.nutritionTypeTreeData.map(item => ({
|
||||
value: item.bigType,
|
||||
value: item.id,
|
||||
label: item.bigType,
|
||||
parentId:0,
|
||||
level:1,
|
||||
children: item.littleTypeList.map(subItem => ({
|
||||
value: subItem,//父子类别value一致时选中识别不出来,加个#号区分
|
||||
label: subItem
|
||||
value: subItem.id,//父子类别value一致时选中识别不出来,加个#号区分
|
||||
label: subItem.bigType,
|
||||
parentId:item.id,
|
||||
level:2
|
||||
}))
|
||||
}));
|
||||
},
|
||||
|
|
@ -604,13 +613,13 @@ export default {
|
|||
this.$set(this.form,"size",row.size)
|
||||
this.$set(this.form,"taxRate",row.taxRate)
|
||||
|
||||
this.$set(this.form.safeConfigDTO,"ifNeedDetect",row.safeConfigDTO.ifNeedDetect+'')
|
||||
this.$set(this.form.safeConfigDTO,"detectInstitution",row.safeConfigDTO.detectInstitution+'')
|
||||
this.$set(this.form.safeConfigDTO,"detectItem",row.safeConfigDTO.detectItem+'')
|
||||
// this.$set(this.form.safeConfigDTO,"ifNeedDetect",row.safeConfigDTO.ifNeedDetect+'')
|
||||
// this.$set(this.form.safeConfigDTO,"detectInstitution",row.safeConfigDTO.detectInstitution+'')
|
||||
// this.$set(this.form.safeConfigDTO,"detectItem",row.safeConfigDTO.detectItem+'')
|
||||
|
||||
this.$set(this.form,"qualificationCert","")
|
||||
this.$set(this.form,"firstProcessList",row.firstProcessList)
|
||||
this.$set(this.form,"cutProcessList",row.cutProcessList)
|
||||
// this.$set(this.form,"qualificationCert","")
|
||||
// this.$set(this.form,"firstProcessList",row.firstProcessList)
|
||||
// this.$set(this.form,"cutProcessList",row.cutProcessList)
|
||||
|
||||
|
||||
if(row.bigType&&row.littleType){
|
||||
|
|
@ -735,14 +744,14 @@ export default {
|
|||
purPriceCeiling:'',//采购上限价格
|
||||
size:'',//原料规格
|
||||
taxRate:'',//原料税率
|
||||
safeConfigDTO:{
|
||||
ifNeedDetect: '2',//是否检测(1是2否)
|
||||
detectInstitution:'1',//检测机构(1自检,2供应商检,3自检或供应商检,4自检且供应商检)
|
||||
detectItem:"1",//
|
||||
},
|
||||
qualificationCert: '',
|
||||
firstProcessList: [''],
|
||||
cutProcessList: [''],
|
||||
// safeConfigDTO:{
|
||||
// ifNeedDetect: '2',//是否检测(1是2否)
|
||||
// detectInstitution:'1',//检测机构(1自检,2供应商检,3自检或供应商检,4自检且供应商检)
|
||||
// detectItem:"1",//
|
||||
// },
|
||||
// qualificationCert: '',
|
||||
// firstProcessList: [''],
|
||||
// cutProcessList: [''],
|
||||
//营养信息
|
||||
menuMaterialNutritionDTO: {
|
||||
edible: '',//可食部分(g/100g)
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
@click="handleBatchDel"
|
||||
>批量删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" plain
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
@click="importTemplate"
|
||||
>模板下载
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -292,7 +292,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isEditType">
|
||||
<!-- <el-row v-if="isEditType">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="原类别父节点" prop="superAreaName">
|
||||
<el-input
|
||||
|
|
@ -316,8 +316,8 @@
|
|||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
<el-button @click="open=false">取 消</el-button>
|
||||
|
|
@ -523,8 +523,8 @@ export default {
|
|||
this.resetForm("form");
|
||||
this.form = {
|
||||
...data,
|
||||
categoryId:data.id,
|
||||
superAreaName: data.parentId === "-1" ? "" : this.getParentCategoryName(data.parentId)
|
||||
// categoryId:data.id,
|
||||
// superAreaName: data.parentId === "-1" ? "" : this.getParentCategoryName(data.parentId)
|
||||
};
|
||||
console.log(this.form)
|
||||
console.log(this.treeOptions)
|
||||
|
|
@ -553,7 +553,7 @@ export default {
|
|||
this.$modal
|
||||
.confirm("是否确认删除数据项?")
|
||||
.then(function () {
|
||||
return removeMaterialTypeApi({"categoryId":data.id});
|
||||
return removeMaterialTypeApi({"ids":[data.id]});
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
@ -608,8 +608,8 @@ export default {
|
|||
console.log(this.$refs.typeTree.getCheckedKeys())
|
||||
this.loading = true;
|
||||
let params= {
|
||||
"size": this.queryParams.pageSize,
|
||||
"current": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"materialName": this.queryParams.materialName,
|
||||
"barCode": this.queryParams.barCode,
|
||||
|
|
@ -618,8 +618,8 @@ export default {
|
|||
"categoryIdList": this.$refs.typeTree.getCheckedKeys(),
|
||||
}
|
||||
getMaterialListApi(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;
|
||||
});
|
||||
},
|
||||
|
|
@ -668,7 +668,7 @@ export default {
|
|||
this.$modal
|
||||
.confirm("是否确认删除数据项?")
|
||||
.then(function () {
|
||||
return removeMaterialApi({"materialId":row.materialId});
|
||||
return removeMaterialApi({"ids":[row.id]});
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
|
|||
|
|
@ -68,6 +68,11 @@
|
|||
<el-cascader
|
||||
v-model="typeSelected" clearable
|
||||
:options="cascaderOptions"
|
||||
:props="{
|
||||
emitPath: true,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'label',label:'label'
|
||||
}"
|
||||
@change="handleChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
|
|
@ -180,6 +185,11 @@
|
|||
<el-cascader
|
||||
v-model="form.nutritionCategory"
|
||||
:options="cascaderOptions"
|
||||
:props="{
|
||||
emitPath: true,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'label',label:'label'
|
||||
}"
|
||||
placeholder="请选择营养信息类别"
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
|
|
@ -618,9 +628,9 @@ export default {
|
|||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
// nutritionCategory: [
|
||||
// { required: true, message: "请选择营养信息类别", trigger: "change" }
|
||||
// ],
|
||||
nutritionCategory: [
|
||||
{ required: true, message: "请选择营养信息类别", trigger: "change" }
|
||||
],
|
||||
nutritionName: [
|
||||
{ required: true, message: "营养信息名称不能为空", trigger: "blur" }
|
||||
],
|
||||
|
|
@ -782,7 +792,7 @@ export default {
|
|||
console.log(value)
|
||||
if (value && value.length >= 2) {
|
||||
this.queryParams.bigType = value[0];
|
||||
this.queryParams.littleType = value[1].split("#")[1];
|
||||
this.queryParams.littleType = value[1];
|
||||
} else {
|
||||
this.queryParams.bigType = undefined;
|
||||
this.queryParams.littleType = undefined;
|
||||
|
|
@ -873,7 +883,7 @@ export default {
|
|||
this.form = response.data;
|
||||
// 如果后端返回的是分开的大类小类,需要组合成数组
|
||||
if (response.data.bigType && response.data.littleType) {
|
||||
this.$set(this.form,"nutritionCategory",[response.data.bigType,'#'+response.data.littleType])
|
||||
this.$set(this.form,"nutritionCategory",[response.data.bigType,response.data.littleType])
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改营养信息";
|
||||
|
|
@ -884,10 +894,11 @@ export default {
|
|||
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].split("#")[1];
|
||||
formData.littleType = formData.nutritionCategory[1];
|
||||
}
|
||||
delete formData.nutritionCategory; // 删除多余的字段
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ module.exports = {
|
|||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://192.168.2.80:48380`,
|
||||
// target: `http://192.168.2.80:48380`,//旭
|
||||
// target: `http://192.168.0.44:48380`,
|
||||
// target: `http://192.168.0.176:48380`,
|
||||
target: `http://192.168.0.176:48380`,//鑫
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: '',
|
||||
|
|
|
|||
Loading…
Reference in New Issue