修复权限

This commit is contained in:
huangdeliang 2021-03-03 16:43:58 +08:00
parent 333f930b8c
commit b8fad6218f
3 changed files with 283 additions and 263 deletions

View File

@ -14,7 +14,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['orderPause:pause:add']"
v-hasPermi="['recipes:pause:add']"
>新增</el-button
>
</el-col>
@ -24,7 +24,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['orderPause:pause:export']"
v-hasPermi="['recipes:pause:export']"
>导出</el-button
>
</el-col>
@ -96,7 +96,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['orderPause:pause:edit']"
v-hasPermi="['recipes:pause:edit']"
>修改</el-button
>
<el-button
@ -104,7 +104,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['orderPause:pause:remove']"
v-hasPermi="['recipes:pause:remove']"
>删除</el-button
>
</template>

View File

@ -247,17 +247,10 @@
:summary-method="getSummaries"
style="width: 100%"
>
<el-table-column prop="name" label="食材"></el-table-column>
<el-table-column label="通俗计量">
<el-table-column prop="name" label="食材" align="center" />
<el-table-column label="通俗计量" align="center">
<template slot-scope="scope">
<span class="cus-unit">
<!-- <el-input-number
v-model="scope.row.cusWeight"
size="mini"
controls-position="right"
step="0.5"
:min="0.5"
/> -->
<el-select size="mini" v-model="scope.row.cusWeight">
<el-option
v-for="dict in cusWeightOptions"
@ -277,7 +270,7 @@
</span>
</template>
</el-table-column>
<el-table-column prop="weight" label="重量(g)">
<el-table-column prop="weight" label="重量(g)" align="center">
<template slot-scope="scope">
<el-input-number
class="weight"
@ -290,11 +283,31 @@
/>
</template>
</el-table-column>
<el-table-column prop="proteinRatio" label="蛋白质/100g">
</el-table-column>
<el-table-column prop="fatRatio" label="脂肪/100g">
</el-table-column>
<el-table-column prop="carbonRatio" label="碳水/100g">
<el-table-column
prop="proteinRatio"
label="蛋白质/100g"
align="center"
/>
<el-table-column
prop="fatRatio"
label="脂肪/100g"
align="center"
/>
<el-table-column
prop="carbonRatio"
label="碳水/100g"
align="center"
/>
<el-table-column label="热量/100g" align="center">
<template slot-scope="scope">
{{
`${(
scope.row.proteinRatio * 4 +
scope.row.fatRatio * 9 +
scope.row.carbonRatio * 4
).toFixed(1)} kcal`
}}
</template>
</el-table-column>
</el-table>
</el-form-item>

View File

@ -97,12 +97,10 @@
size="mini"
@click="handleQuery"
>搜索
</el-button
>
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置
</el-button
>
</el-button>
</el-form-item>
</el-form>
@ -179,6 +177,17 @@
align="center"
prop="carbonRatio"
/>
<el-table-column label="每百克热量(千卡)" align="center" width="120">
<template slot-scope="scope">
{{
(
scope.row.proteinRatio * 4 +
scope.row.fatRatio * 9 +
scope.row.carbonRatio * 4
).toFixed(1)
}}
</template>
</el-table-column>
<el-table-column
label="地域"
align="center"
@ -192,15 +201,15 @@
width="120"
>
<template slot-scope="scope">
<autohideinfo :data="string2Arr(scope.row.notRec)"/>
<autohideinfo :data="string2Arr(scope.row.notRec)" />
</template>
</el-table-column>
<el-table-column label="推荐人群" align="center" prop="rec" width="120">
<template slot-scope="scope">
<autohideinfo :data="string2Arr(scope.row.rec)"/>
<autohideinfo :data="string2Arr(scope.row.rec)" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
@ -241,7 +250,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12">
<el-form-item label="食材名称" prop="name" label-width="90px">
<el-input v-model="form.name" placeholder="请输入食材名称"/>
<el-input v-model="form.name" placeholder="请输入食材名称" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -376,20 +385,20 @@
</template>
<script>
import {
import {
addIngredient,
delIngredient,
exportIngredient,
getIngredient,
listIngredient,
updateIngredient,
} from "@/api/custom/ingredient";
} from "@/api/custom/ingredient";
import AutoHideInfo from "@/components/AutoHideInfo";
import AutoHideInfo from "@/components/AutoHideInfo";
import {listPhysicalSigns} from "@/api/custom/physicalSigns";
import { listPhysicalSigns } from "@/api/custom/physicalSigns";
export default {
export default {
name: "Ingredient",
components: {
autohideinfo: AutoHideInfo,
@ -591,8 +600,7 @@
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {
});
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
@ -608,12 +616,11 @@
.then((response) => {
this.download(response.msg);
})
.catch(function () {
});
.catch(function () {});
},
string2Arr(str) {
return str ? str.split(',') : []
}
return str ? str.split(",") : [];
},
};
},
};
</script>