fixed 完善商品类目及平台与商户权限

This commit is contained in:
lwh 2023-06-16 19:37:24 +08:00
parent db710fdb9c
commit 77f821a84b
6 changed files with 321 additions and 205 deletions

View File

@ -7,7 +7,7 @@
align-items: center;
height: 100%;
// 登录背景图
// background-image: url('@/assets/images/login-bg.jpg');
background-image: url('@/assets/images/login-bg.jpg');
background-size: cover;
}

View File

@ -7,59 +7,57 @@
* @LastEditTime: (2023-06-15)
-->
<template>
<el-dialog v-model="props.modelValue" title="添加店铺商品类目信息" width="900px" @closed="closeDialog" @open="openDialog">
<el-dialog v-model="props.modelValue" title="添加商品类目信息" width="600px" @closed="closeDialog" @open="openDialog">
<el-form ref="formRef" :model="formData" :rules="rules">
<el-row v-if="userid == 1">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
<el-input v-model='formData.shopName' disabled type="text" placeholder='点击选择店铺'>
<template #append>
<div @click="handleChooseShop">选择</div>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
<el-cascader
class="w100"
:options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级菜单"
clearable
v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
<el-cascader class="w100" :options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="店铺guid" prop="shopGuid">
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="父级guid" prop="shopGoodsCategoryParentGuid">
<el-input v-model="formData.shopGoodsCategoryParentGuid" placeholder="请输入父级guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="祖级guid" prop="shopGoodsCategoryAncestralGuid">
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" placeholder="请输入祖级guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{item.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
<el-row>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
item.dictLabel }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -71,6 +69,9 @@
</div>
</template>
</el-dialog>
<!-- 选择店铺 -->
<ChooseShopDialog v-model="ChooseShopDialogVisible" :data="ChooseShopDialogRow"></ChooseShopDialog>
</template>
@ -78,22 +79,29 @@
import { reactive, ref, watch } from "vue";
import { ElMessage } from 'element-plus'
import modal from '@/plugins/modal.js'
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js';
import useUserStore from '@/store/modules/user'
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js';
import ChooseShopDialog from './ChooseShopDialog.vue';
//
const openDialog = async () => {
formData.shopName = props.data?.shopName
formData.shopGuid = props.data?.shopGuid
formData.shopGoodsCategoryParentGuid = props.data?.shopGoodsCategoryGuid
await getdisplay_status()
await getTreeList()
await getdisplay_status()
await getTreeList()
}
// -
const userid = useUserStore().userId
const dataList = ref([])
//
const display_status = ref([]);
//
const ChooseShopDialogVisible = ref(false);
const ChooseShopDialogRow = ref({});
// -
//
@ -103,18 +111,28 @@ async function getdisplay_status() {
})
}
//
const handleChooseShop = () => {
ChooseShopDialogVisible.value = true
ChooseShopDialogRow.value = formData
}
// -
const labelWidth = 100;
const formRef = ref();
const { proxy } = getCurrentInstance()
const emits = defineEmits(["update:modelValue"]);
const formData = reactive({
});
const props = defineProps({
modelValue: Boolean,
done: Function,
data: Object
});
const formData = reactive({
shopName: "",
shopGuid: "",
shopGoodsCategoryParentGuid: "",
shopGoodsCategoryDisplayStatus: 1,
shopGoodsCategorySort: 100
});
const imgData = ref({
fileDir: "ShopGoodsCategory"
@ -122,13 +140,10 @@ const imgData = ref({
//
const rules = reactive({
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryParentGuid: [{ required: true, message: "上级菜单不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
});
// -
@ -140,7 +155,7 @@ async function getTreeList() {
})
}
watch(props, async (v) => {
});
//
@ -160,9 +175,15 @@ const handleAddClick = async (formEl) => {
});
};
const closeDialog = () => {
formData.shopName = ""
formData.shopGuid = ""
formData.shopGoodsCategoryParentGuid = ""
console.log(formData);
handleResetClick(formRef.value);
props.done();
emits("update:modelValue", false);
emits("update:data", {});
};
const handleResetClick = async (formEl) => {
if (!formEl) return;

View File

@ -0,0 +1,117 @@
<template>
<el-dialog v-model="props.modelValue" title="选择店铺" width="900px" @closed="closeDialog" @open="openDialog">
<el-form inline :model="queryParams">
<el-form-item label="店铺名称">
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
搜索
</el-button>
</el-form-item>
</el-form>
<!-- 表格渲染 prop="对应的字段"-->
<el-table v-loading="loading" :data="shopsList" ref="tableRef" border highlight-current-row
@row-click="handleRowClick">
<el-table-column prop="shopName" label="店铺名称" align="left" :show-overflow-tooltip="true" />
</el-table>
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getShopListFun" />
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="handleEditClick()">添加</el-button>
<el-button @click="handleResetClick()">重置</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { reactive, ref, watch, nextTick } from 'vue';
import { ElMessage } from 'element-plus'
import { shopList } from '@/api/business/ShopManager/Shops/shop.js'
//
const total = ref(0)
const loading = ref(false)
//
const tableRef = ref(null);
//
const queryParams = reactive({
shopName: "",
pageNum: 1,
pageSize: 10
});
const emits = defineEmits(['update:modelValue']);
const props = defineProps({
modelValue: Boolean,
data: Object,
});
const formData = ref({
...props.data
});
let shopsList = ref([]);
//
const openDialog = async () => {
await getShopListFun()
}
const getShopListFun = async () => {
loading.value = true
await shopList(queryParams).then((res) => {
if (res.code == 200) {
shopsList.value = res.data.result
total.value = res.totalNum
loading.value = false
}
})
}
watch(props, (v) => {
formData.value = v.data;
});
// -
let shopName = ref("");
let shopGuid = ref("");
// -
//
const handleRowClick = (row) => {
shopName.value = row.shopName
shopGuid.value = row.shopGuid
}
const closeDialog = () => {
shopName.value = ""
emits('update:modelValue', false);
};
//
const handleEditClick = async () => {
if (shopName.value !== "") {
formData.value.shopName = shopName.value
formData.value.shopGuid = shopGuid.value
if (formData.value.shopName != null) {
closeDialog();
}
} else {
ElMessage.error("请选择店铺")
return;
}
};
const handleResetClick = async formEl => {
};
</script>

View File

@ -6,74 +6,53 @@
* @LastEditors: (黎文豪)
* @LastEditTime: (2023-06-15)
-->
<template>
<template>
<el-dialog v-model="props.modelValue" title="店铺商品类目信息详情" width="900px" @closed="closeDialog" @open="openDialog">
<el-form ref="formRef" :model="formData" :disabled="true">
<el-row v-if="userid == 1">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
<el-input v-model='formData.shopName' disabled type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
<el-cascader
class="w100"
:options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级菜单"
clearable
v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
<el-cascader class="w100" :options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="店铺guid" >
<el-input v-model="formData.shopGuid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="父级guid" >
<el-input v-model="formData.shopGoodsCategoryParentGuid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="祖级guid" >
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="名称" >
<el-input v-model="formData.shopGoodsCategoryName" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="显示状态" >
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{item.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="排序" >
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :precision="2" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
item.dictLabel }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -83,14 +62,15 @@
<script setup>
import { ElMessage } from 'element-plus'
import { reactive, ref, watch } from "vue";
import useUserStore from '@/store/modules/user'
import { shopGoodsCategoryTreeList } from "@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js";
//
const openDialog = async () => {
await getdisplay_status()
await getdisplay_status()
await getTreeList()
await getTreeList()
}
const formData = ref({
@ -101,6 +81,7 @@ watch(props, async (v) => {
});
// -
const userid = useUserStore().userId
const dataList = ref([])
//
const display_status = ref([]);

View File

@ -7,72 +7,52 @@
* @LastEditTime: (2023-06-15)
-->
<template>
<el-dialog v-model="props.modelValue" title="修改店铺商品类目信息" width="900px" @closed="closeDialog" @open="openDialog">
<el-dialog v-model="props.modelValue" title="修改商品类目信息" width="600px" @closed="closeDialog" @open="openDialog">
<el-form ref="formRef" :model="formData" :rules="rules">
<el-row :gutter="20">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
<el-cascader
class="w100"
:options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级菜单"
clearable
v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-row v-if="userid == 1">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
<el-input v-model='formData.shopName' disabled type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="店铺guid" prop="shopGuid">
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="父级guid" prop="shopGoodsCategoryParentGuid">
<el-input v-model="formData.shopGoodsCategoryParentGuid" placeholder="请输入父级guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="祖级guid" prop="shopGoodsCategoryAncestralGuid">
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" placeholder="请输入祖级guid" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{item.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
<el-row :gutter="20">
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
<el-cascader class="w100" :options="dataList"
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
<template #default="{ node, data }">
<span>{{ data.shopGoodsCategoryName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
item.dictLabel }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -90,14 +70,15 @@
import { ElMessage } from 'element-plus'
import modal from '@/plugins/modal.js'
import { reactive, ref, watch } from "vue";
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from "@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js";
import useUserStore from '@/store/modules/user'
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from "@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js";
//
const openDialog = async () => {
await getdisplay_status()
await getdisplay_status()
await getTreeList()
await getTreeList()
}
const formData = ref({
@ -109,6 +90,7 @@ watch(props, async (v) => {
});
//
const userid = useUserStore().userId
const dataList = ref([])
//
const display_status = ref([]);
@ -140,13 +122,13 @@ const imgData = ref({
//
const rules = reactive({
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
});
// -

View File

@ -12,8 +12,11 @@
<!-- 搜索框 queryParams.需要搜索的字段 -->
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
@submit.prevent>
<el-form-item label="名称" prop="shopGoodsCategoryName">
<el-input v-model="queryParams.shopGoodsCategoryName" placeholder="请输入名称" clearable @keyup.enter="handleQuery"/>
<el-form-item v-if="userid == 1" label="店铺名称" prop="shopName">
<el-input v-model="queryParams.shopName" placeholder="店铺名称" clearable @keyup.enter="handleQuery"/>
</el-form-item>
<el-form-item label="商品类目名称" prop="shopGoodsCategoryName">
<el-input v-model="queryParams.shopGoodsCategoryName" placeholder="商品类目名称" clearable @keyup.enter="handleQuery"/>
</el-form-item>
<el-form-item label="显示状态" prop="shopGoodsCategoryDisplayStatus">
<el-radio-group v-model="queryParams.shopGoodsCategoryDisplayStatus">
@ -33,7 +36,7 @@
<el-button type="info" plain icon="sort" @click="toggleExpandAll">展开/折叠</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['business:shopgoodscategory:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
<el-button type="primary" v-hasPermi="['business:shopgoodscategory:addOrUpdate']" plain icon="plus" @click="handleAdd()">
{{ $t('btn.add') }}
</el-button>
</el-col>
@ -44,7 +47,7 @@
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Upload" @click="UploadDialogVisible = true"
v-hasPermi="['business:student:import']">导入</el-button>
v-hasPermi="['business:shopgoodscategory:import']">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['business:shopgoodscategory:export']">
@ -58,7 +61,8 @@
<el-table v-loading="loading" :data="dataList" ref="tableRef" highlight-current-row @selection-change="handleSelectionChange" v-if="refreshTable" :default-expand-all="isExpandAll" row-key="shopGoodsCategoryGuid" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="shopGoodsCategoryName" label="名称" align="center" :show-overflow-tooltip="true" />
<el-table-column v-if="userid == 1" prop="shopName" label="店铺名称" align="left" :show-overflow-tooltip="true" />
<el-table-column prop="shopGoodsCategoryName" label="名称" align="left" :show-overflow-tooltip="true" />
<el-table-column prop="shopGoodsCategoryDisplayStatus" label="显示状态" align="center">
<template #default="scope">
<dict-tag :options=" display_status " :value="scope.row.shopGoodsCategoryDisplayStatus" />
@ -69,7 +73,9 @@
<el-table-column label="操作" width="350" fixed="right">
<template #default="scope">
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
v-hasPermi="['business:shopgoodscategory:addOrUpdateKey']">编辑</el-button>
v-hasPermi="['business:shopgoodscategory:addOrUpdate']">编辑</el-button>
<el-button type="primary" size="small" icon="plus" @click="handleAdd(scope.row)"
v-hasPermi="['business:shopgoodscategory:addOrUpdate']">添加</el-button>
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
v-hasPermi="['business:shopgoodscategory:delete']">删除</el-button>
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
@ -80,7 +86,7 @@
</div>
<!-- 添加 -->
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()" :data="AddDialogRow"></AddDialog>
<!-- 编辑 -->
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
<!-- 详情 -->
@ -91,6 +97,7 @@
<script setup name="shopgoodscategory">
import { ElMessageBox } from 'element-plus'
import modal from '@/plugins/modal.js'
import useUserStore from '@/store/modules/user'
import { exportShopGoodsCategory, shopGoodsCategoryTreeList , delShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js'
import AddDialog from "./components/AddDialog.vue";
import EditDialog from "./components/EditDialog.vue";
@ -98,6 +105,7 @@ import DetailDialog from "./components/DetailDialog.vue";
import UploadDialog from "./components/UploadDialog.vue";
const AddDialogVisible = ref(false);
const AddDialogRow = ref({});
const EditDialogVisible = ref(false);
const EditDialogRow = ref({});
const DetailDialogVisible = ref(false);
@ -132,6 +140,7 @@ const data = reactive({
const { queryParams } = toRefs(data)
//
const userid = useUserStore().userId
//
@ -258,6 +267,12 @@ function handleExport(row) {
})
}
//
function handleAdd(row) {
AddDialogRow.value = null
AddDialogVisible.value = true
AddDialogRow.value = row
}
//
function handleUpdate(row) {