fixed 完善商品类目及平台与商户权限
This commit is contained in:
parent
db710fdb9c
commit
77f821a84b
@ -7,7 +7,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
// 登录背景图
|
// 登录背景图
|
||||||
// background-image: url('@/assets/images/login-bg.jpg');
|
background-image: url('@/assets/images/login-bg.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,59 +7,57 @@
|
|||||||
* @LastEditTime: (2023-06-15)
|
* @LastEditTime: (2023-06-15)
|
||||||
-->
|
-->
|
||||||
<template>
|
<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-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-row :gutter="20">
|
||||||
|
|
||||||
<el-col :lg="24">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
|
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
|
||||||
<el-cascader
|
<el-cascader class="w100" :options="dataList"
|
||||||
class="w100"
|
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||||
:options="dataList"
|
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
|
||||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
<template #default="{ node, data }">
|
||||||
placeholder="请选择上级菜单"
|
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||||
clearable
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
v-model="formData.shopGoodsCategoryParentGuid">
|
</template>
|
||||||
<template #default="{ node, data }">
|
</el-cascader>
|
||||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
</el-form-item>
|
||||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
|
||||||
</template>
|
|
||||||
</el-cascader>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-col :lg="12">
|
|
||||||
<el-form-item :label-width="labelWidth" label="店铺guid" prop="shopGuid">
|
<el-row>
|
||||||
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
|
<el-col :lg="24">
|
||||||
</el-form-item>
|
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
|
||||||
</el-col>
|
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
|
||||||
<el-col :lg="12">
|
</el-form-item>
|
||||||
<el-form-item :label-width="labelWidth" label="父级guid" prop="shopGoodsCategoryParentGuid">
|
</el-col>
|
||||||
<el-input v-model="formData.shopGoodsCategoryParentGuid" placeholder="请输入父级guid" />
|
<el-col :lg="24">
|
||||||
</el-form-item>
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
|
||||||
</el-col>
|
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
|
||||||
<el-col :lg="12">
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
<el-form-item :label-width="labelWidth" label="祖级guid" prop="shopGoodsCategoryAncestralGuid">
|
item.dictLabel }}</el-radio>
|
||||||
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" placeholder="请输入祖级guid" />
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="12">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
|
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
|
||||||
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
|
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -71,6 +69,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 选择店铺 -->
|
||||||
|
<ChooseShopDialog v-model="ChooseShopDialogVisible" :data="ChooseShopDialogRow"></ChooseShopDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@ -78,22 +79,29 @@
|
|||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import modal from '@/plugins/modal.js'
|
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 () => {
|
const openDialog = async () => {
|
||||||
|
formData.shopName = props.data?.shopName
|
||||||
|
formData.shopGuid = props.data?.shopGuid
|
||||||
|
formData.shopGoodsCategoryParentGuid = props.data?.shopGoodsCategoryGuid
|
||||||
|
|
||||||
await getdisplay_status()
|
await getdisplay_status()
|
||||||
|
await getTreeList()
|
||||||
await getTreeList()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -业务参数
|
// -业务参数
|
||||||
|
const userid = useUserStore().userId
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
// 显示状态字典选项列表
|
// 显示状态字典选项列表
|
||||||
const display_status = 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 labelWidth = 100;
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const emits = defineEmits(["update:modelValue"]);
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
const formData = reactive({
|
|
||||||
});
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: Boolean,
|
modelValue: Boolean,
|
||||||
done: Function,
|
done: Function,
|
||||||
|
data: Object
|
||||||
|
});
|
||||||
|
const formData = reactive({
|
||||||
|
shopName: "",
|
||||||
|
shopGuid: "",
|
||||||
|
shopGoodsCategoryParentGuid: "",
|
||||||
|
shopGoodsCategoryDisplayStatus: 1,
|
||||||
|
shopGoodsCategorySort: 100
|
||||||
});
|
});
|
||||||
const imgData = ref({
|
const imgData = ref({
|
||||||
fileDir: "ShopGoodsCategory"
|
fileDir: "ShopGoodsCategory"
|
||||||
@ -122,13 +140,10 @@ const imgData = ref({
|
|||||||
|
|
||||||
// 验证
|
// 验证
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryParentGuid: [{ required: true, message: "上级菜单不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||||
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
|
shopGoodsCategorySort: [{ 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" }],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// -基础方法
|
// -基础方法
|
||||||
@ -160,9 +175,15 @@ const handleAddClick = async (formEl) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
|
formData.shopName = ""
|
||||||
|
formData.shopGuid = ""
|
||||||
|
formData.shopGoodsCategoryParentGuid = ""
|
||||||
|
console.log(formData);
|
||||||
|
|
||||||
handleResetClick(formRef.value);
|
handleResetClick(formRef.value);
|
||||||
props.done();
|
props.done();
|
||||||
emits("update:modelValue", false);
|
emits("update:modelValue", false);
|
||||||
|
emits("update:data", {});
|
||||||
};
|
};
|
||||||
const handleResetClick = async (formEl) => {
|
const handleResetClick = async (formEl) => {
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
|
@ -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>
|
||||||
|
|
@ -6,74 +6,53 @@
|
|||||||
* @LastEditors: (黎文豪)
|
* @LastEditors: (黎文豪)
|
||||||
* @LastEditTime: (2023-06-15)
|
* @LastEditTime: (2023-06-15)
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="props.modelValue" title="店铺商品类目信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
<el-dialog v-model="props.modelValue" title="店铺商品类目信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
<el-form ref="formRef" :model="formData" :disabled="true">
|
<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-row :gutter="20">
|
||||||
|
|
||||||
<el-col :lg="24">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
|
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
|
||||||
<el-cascader
|
<el-cascader class="w100" :options="dataList"
|
||||||
class="w100"
|
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||||
:options="dataList"
|
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
|
||||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
<template #default="{ node, data }">
|
||||||
placeholder="请选择上级菜单"
|
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||||
clearable
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
v-model="formData.shopGoodsCategoryParentGuid">
|
</template>
|
||||||
<template #default="{ node, data }">
|
</el-cascader>
|
||||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
</el-form-item>
|
||||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
|
||||||
</template>
|
|
||||||
</el-cascader>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :lg="24">
|
||||||
<el-col :lg="12">
|
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
|
||||||
<el-form-item :label-width="labelWidth" label="店铺guid" >
|
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
|
||||||
<el-input v-model="formData.shopGuid" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
|
||||||
<el-col :lg="12">
|
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
|
||||||
<el-form-item :label-width="labelWidth" label="父级guid" >
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
<el-input v-model="formData.shopGoodsCategoryParentGuid" />
|
item.dictLabel }}</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :lg="12">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="祖级guid" >
|
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
|
||||||
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" />
|
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-form>
|
</el-form>
|
||||||
@ -83,14 +62,15 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
import { shopGoodsCategoryTreeList } from "@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js";
|
import { shopGoodsCategoryTreeList } from "@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js";
|
||||||
|
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
const openDialog = async () => {
|
const openDialog = async () => {
|
||||||
await getdisplay_status()
|
await getdisplay_status()
|
||||||
|
|
||||||
await getTreeList()
|
await getTreeList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@ -101,6 +81,7 @@ watch(props, async (v) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// -业务参数
|
// -业务参数
|
||||||
|
const userid = useUserStore().userId
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
// 显示状态字典选项列表
|
// 显示状态字典选项列表
|
||||||
const display_status = ref([]);
|
const display_status = ref([]);
|
||||||
|
@ -7,72 +7,52 @@
|
|||||||
* @LastEditTime: (2023-06-15)
|
* @LastEditTime: (2023-06-15)
|
||||||
-->
|
-->
|
||||||
<template>
|
<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-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"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
|
||||||
<el-col :lg="24">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="上级菜单" prop="ShopGoodsCategoryParentGuid">
|
<el-form-item :label-width="labelWidth" label="上级类目" prop="ShopGoodsCategoryParentGuid">
|
||||||
<el-cascader
|
<el-cascader class="w100" :options="dataList"
|
||||||
class="w100"
|
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
||||||
:options="dataList"
|
placeholder="请选择上级类目" clearable v-model="formData.shopGoodsCategoryParentGuid">
|
||||||
:props="{ checkStrictly: true, value: 'shopGoodsCategoryGuid', label: 'shopGoodsCategoryName', emitPath: false }"
|
<template #default="{ node, data }">
|
||||||
placeholder="请选择上级菜单"
|
<span>{{ data.shopGoodsCategoryName }}</span>
|
||||||
clearable
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
v-model="formData.shopGoodsCategoryParentGuid">
|
</template>
|
||||||
<template #default="{ node, data }">
|
</el-cascader>
|
||||||
<span>{{ data.shopGoodsCategoryName }}</span>
|
</el-form-item>
|
||||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
|
||||||
</template>
|
|
||||||
</el-cascader>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :lg="24">
|
||||||
<el-col :lg="12">
|
<el-form-item :label-width="labelWidth" label="名称" prop="shopGoodsCategoryName">
|
||||||
<el-form-item :label-width="labelWidth" label="店铺guid" prop="shopGuid">
|
<el-input v-model="formData.shopGoodsCategoryName" placeholder="请输入名称" />
|
||||||
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="shopGoodsCategoryDisplayStatus">
|
||||||
<el-col :lg="12">
|
<el-radio-group v-model="formData.shopGoodsCategoryDisplayStatus">
|
||||||
<el-form-item :label-width="labelWidth" label="父级guid" prop="shopGoodsCategoryParentGuid">
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
<el-input v-model="formData.shopGoodsCategoryParentGuid" placeholder="请输入父级guid" />
|
item.dictLabel }}</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :lg="12">
|
<el-col :lg="24">
|
||||||
<el-form-item :label-width="labelWidth" label="祖级guid" prop="shopGoodsCategoryAncestralGuid">
|
<el-form-item :label-width="labelWidth" label="排序" prop="shopGoodsCategorySort">
|
||||||
<el-input v-model="formData.shopGoodsCategoryAncestralGuid" placeholder="请输入祖级guid" />
|
<el-input-number v-model.number="formData.shopGoodsCategorySort" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -90,14 +70,15 @@
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import { reactive, ref, watch } from "vue";
|
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 () => {
|
const openDialog = async () => {
|
||||||
await getdisplay_status()
|
await getdisplay_status()
|
||||||
|
|
||||||
await getTreeList()
|
await getTreeList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@ -109,6 +90,7 @@ watch(props, async (v) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 业务参数
|
// 业务参数
|
||||||
|
const userid = useUserStore().userId
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
// 显示状态字典选项列表
|
// 显示状态字典选项列表
|
||||||
const display_status = ref([]);
|
const display_status = ref([]);
|
||||||
@ -140,13 +122,13 @@ const imgData = ref({
|
|||||||
|
|
||||||
// 验证
|
// 验证
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
|
shopGuid: [{ required: true, message: "店铺guid不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
|
shopGoodsCategoryAncestralGuid: [{ required: true, message: "祖级guid不能为空", trigger: "blur" }],
|
||||||
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
shopGoodsCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||||
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategoryDisplayStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
|
||||||
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
shopGoodsCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||||
});
|
});
|
||||||
|
|
||||||
// -基础方法
|
// -基础方法
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
||||||
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
|
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
|
||||||
@submit.prevent>
|
@submit.prevent>
|
||||||
<el-form-item label="名称" prop="shopGoodsCategoryName">
|
<el-form-item v-if="userid == 1" label="店铺名称" prop="shopName">
|
||||||
<el-input v-model="queryParams.shopGoodsCategoryName" placeholder="请输入名称" clearable @keyup.enter="handleQuery"/>
|
<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>
|
||||||
<el-form-item label="显示状态" prop="shopGoodsCategoryDisplayStatus">
|
<el-form-item label="显示状态" prop="shopGoodsCategoryDisplayStatus">
|
||||||
<el-radio-group v-model="queryParams.shopGoodsCategoryDisplayStatus">
|
<el-radio-group v-model="queryParams.shopGoodsCategoryDisplayStatus">
|
||||||
@ -33,7 +36,7 @@
|
|||||||
<el-button type="info" plain icon="sort" @click="toggleExpandAll">展开/折叠</el-button>
|
<el-button type="info" plain icon="sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<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') }}
|
{{ $t('btn.add') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -44,7 +47,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Upload" @click="UploadDialogVisible = true"
|
<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>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['business:shopgoodscategory:export']">
|
<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 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 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">
|
<el-table-column prop="shopGoodsCategoryDisplayStatus" label="显示状态" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options=" display_status " :value="scope.row.shopGoodsCategoryDisplayStatus" />
|
<dict-tag :options=" display_status " :value="scope.row.shopGoodsCategoryDisplayStatus" />
|
||||||
@ -69,7 +73,9 @@
|
|||||||
<el-table-column label="操作" width="350" fixed="right">
|
<el-table-column label="操作" width="350" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
<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)"
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['business:shopgoodscategory:delete']">删除</el-button>
|
v-hasPermi="['business:shopgoodscategory:delete']">删除</el-button>
|
||||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||||
@ -80,7 +86,7 @@
|
|||||||
</div>
|
</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>
|
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||||
<!-- 详情 -->
|
<!-- 详情 -->
|
||||||
@ -91,6 +97,7 @@
|
|||||||
<script setup name="shopgoodscategory">
|
<script setup name="shopgoodscategory">
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
import { exportShopGoodsCategory, shopGoodsCategoryTreeList , delShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js'
|
import { exportShopGoodsCategory, shopGoodsCategoryTreeList , delShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js'
|
||||||
import AddDialog from "./components/AddDialog.vue";
|
import AddDialog from "./components/AddDialog.vue";
|
||||||
import EditDialog from "./components/EditDialog.vue";
|
import EditDialog from "./components/EditDialog.vue";
|
||||||
@ -98,6 +105,7 @@ import DetailDialog from "./components/DetailDialog.vue";
|
|||||||
import UploadDialog from "./components/UploadDialog.vue";
|
import UploadDialog from "./components/UploadDialog.vue";
|
||||||
|
|
||||||
const AddDialogVisible = ref(false);
|
const AddDialogVisible = ref(false);
|
||||||
|
const AddDialogRow = ref({});
|
||||||
const EditDialogVisible = ref(false);
|
const EditDialogVisible = ref(false);
|
||||||
const EditDialogRow = ref({});
|
const EditDialogRow = ref({});
|
||||||
const DetailDialogVisible = ref(false);
|
const DetailDialogVisible = ref(false);
|
||||||
@ -132,6 +140,7 @@ const data = reactive({
|
|||||||
const { queryParams } = toRefs(data)
|
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) {
|
function handleUpdate(row) {
|
||||||
|
Loading…
Reference in New Issue
Block a user