Merge branch 'master' of https://gitea.zianxin.com/zax/biz-pc-cloud
This commit is contained in:
commit
dbd05bb1d6
2 files changed
+29
-1
No files matched your search
@@ -26,6 +26,18 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="14" class="mb20">
|
||||
<el-form-item label="是否涨价" prop="isPriceIncreased">
|
||||
<el-switch
|
||||
v-model="form.isPriceIncreased"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="开启状态" prop="status">-->
|
||||
<!-- <el-radio-group v-model="form.status">-->
|
||||
@@ -69,6 +81,7 @@ const form = reactive({
|
||||
updater: "",
|
||||
deleted: "",
|
||||
deptId: "",
|
||||
isPriceIncreased: false,
|
||||
categoryType: [],
|
||||
})
|
||||
|
||||
@@ -122,7 +135,10 @@ const getcanteenCategoryData = (id: string) => {
|
||||
loading.value = true
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data, { categoryType: res.data.categoryType.split(",") })
|
||||
const data = res.data || {}
|
||||
// 兼容后端返回的布尔/1/0(或字符串)
|
||||
form.isPriceIncreased = data.isPriceIncreased === true || data.isPriceIncreased === 1 || data.isPriceIncreased === "1"
|
||||
Object.assign(form, data, { categoryType: (data.categoryType || "").split(",") })
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
|
||||
@@ -66,6 +66,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip min-width="100" />
|
||||
<el-table-column prop="isPriceIncreased" label="是否涨价" show-overflow-tooltip min-width="120">
|
||||
<template #default="scope">
|
||||
<span>{{
|
||||
formatYesNo(scope.row.isPriceIncreased)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="createBy" label="创建者" show-overflow-tooltip min-width="100" /> -->
|
||||
<!-- <el-table-column prop="updateBy" label="更新者" show-overflow-tooltip min-width="100" /> -->
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
|
||||
@@ -135,6 +142,11 @@ const exportExcel = () => {
|
||||
downBlobFile("/canteen/canteenCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "每日菜品分类.xlsx")
|
||||
}
|
||||
|
||||
// 兼容后端可能返回 true/false 或 1/0
|
||||
const formatYesNo = (value: any) => {
|
||||
return value === true || value === 1 || value === "1" ? "是" : "否"
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id)
|
||||
|
||||
Reference in new issue
Block a user