fixed 完善店铺 列表
This commit is contained in:
parent
72ef192bba
commit
a85394f214
@ -1,7 +1,7 @@
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
VITE_APP_API_HOST = 'http://localhost:8888'
|
||||
VITE_APP_API_HOST = 'http://192.168.1.102:8888'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
|
@ -18,6 +18,33 @@ export function shopList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取未绑定的用户列表
|
||||
export function getUserWithOutBindList(query) {
|
||||
return request({
|
||||
url: '/business/Shop/getUserWithOutBindList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取未绑定的客户列表
|
||||
export function getCustomerWithOutBindList(query) {
|
||||
return request({
|
||||
url: '/business/Shop/getCustomerWithOutBindList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取经营类目列表(一级类目)
|
||||
export function getFirstGoodsCategoryList(query) {
|
||||
return request({
|
||||
url: '/business/Shop/getFirstGoodsCategoryList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 店铺新增或修改
|
||||
export function addOrUpdateShop(data) {
|
||||
return request({
|
||||
|
@ -62,7 +62,7 @@
|
||||
<el-table-column prop="goodsCategoryName" label="名称" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="goodsCategoryImg" label="图片" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.goodsCategoryImg.split(',')[0]" :preview-src-list="scope.row.goodsCategoryImg.split(',')">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.goodsCategoryImg?.split(',')[0]" :preview-src-list="scope.row.goodsCategoryImg?.split(',')">
|
||||
<div><el-icon :size="15"><document /></el-icon></div>
|
||||
</el-image>
|
||||
</template>
|
||||
|
@ -13,18 +13,29 @@
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="用户id" prop="shopUserId">
|
||||
<el-input v-model="formData.shopUserId" placeholder="请输入用户id" />
|
||||
<el-form-item :label-width="labelWidth" label="用户" prop="userName">
|
||||
<el-input v-model='formData.userName' disabled type="text" placeholder='点击选择用户'>
|
||||
<template #append>
|
||||
<div @click="handleChooseUser">选择</div>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="客户guid" prop="shopCustomerGuid">
|
||||
<el-input v-model="formData.shopCustomerGuid" placeholder="请输入客户guid" />
|
||||
<el-form-item :label-width="labelWidth" label="客户" prop="customerNickname">
|
||||
<el-input v-model='formData.customerNickname' disabled type="text" placeholder='点击选择客户'>
|
||||
<template #append>
|
||||
<div @click="handleChooseCustomer">选择</div>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="经营类目guid" prop="shopBusinessCategoryGuid">
|
||||
<el-input v-model="formData.shopBusinessCategoryGuid" placeholder="请输入经营类目guid" />
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="经营类目" prop="shopBusinessCategoryGuid">
|
||||
<el-select v-model="formData.shopBusinessCategoryGuid" placeholder="请选择经营类目">
|
||||
<el-option v-for="item in dataList " :key="item.goodsCategoryGuid" :label="item.goodsCategoryName"
|
||||
:value="parseInt(item.goodsCategoryGuid)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
@ -59,19 +70,6 @@
|
||||
<el-input-number v-model.number="formData.shopSalesOrderCount" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="审核状态" prop="shopAuditStatus">
|
||||
<el-select v-model="formData.shopAuditStatus" placeholder="请选择审核状态">
|
||||
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||
:value="parseInt(item.dictValue)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="审核人" prop="shopAuditUserGuid">
|
||||
<el-input v-model="formData.shopAuditUserGuid" placeholder="请输入审核人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -83,6 +81,11 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 选择用户 -->
|
||||
<ChooseUserDialog v-model="ChooseUserDialogVisible" :data="ChooseUserDialogRow"></ChooseUserDialog>
|
||||
<!-- 选择客户 -->
|
||||
<ChooseCustomerDialog v-model="ChooseCustomerDialogVisible" :data="ChooseCustomerDialogRow"></ChooseCustomerDialog>
|
||||
</template>
|
||||
|
||||
|
||||
@ -90,12 +93,15 @@
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { addOrUpdateShop } from '@/api/business/ShopManager/Shops/shop.js';
|
||||
import { addOrUpdateShop,getFirstGoodsCategoryList } from '@/api/business/ShopManager/Shops/shop.js';
|
||||
import ChooseCustomerDialog from './ChooseCustomerDialog.vue';
|
||||
import ChooseUserDialog from './ChooseUserDialog.vue';
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
await getTreeList()
|
||||
await getaudit_status()
|
||||
|
||||
}
|
||||
@ -103,6 +109,16 @@ const openDialog = async () => {
|
||||
// -业务参数
|
||||
// 审核状态字典选项列表
|
||||
const audit_status = ref([]);
|
||||
// 经营类树形列表
|
||||
const dataList = ref([])
|
||||
|
||||
// 选择用户弹窗参数
|
||||
const ChooseUserDialogVisible = ref(false);
|
||||
const ChooseUserDialogRow = ref({});
|
||||
// 选择客户弹窗参数
|
||||
const ChooseCustomerDialogVisible = ref(false);
|
||||
const ChooseCustomerDialogRow = ref({});
|
||||
|
||||
|
||||
|
||||
// -业务方法
|
||||
@ -113,6 +129,26 @@ async function getaudit_status() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取经营类树形列表
|
||||
async function getTreeList() {
|
||||
getFirstGoodsCategoryList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 打开选择用户弹窗
|
||||
const handleChooseUser = () => {
|
||||
ChooseUserDialogVisible.value = true
|
||||
ChooseUserDialogRow.value = formData
|
||||
}
|
||||
|
||||
// 打开选择客户弹窗
|
||||
const handleChooseCustomer = () => {
|
||||
ChooseCustomerDialogVisible.value = true
|
||||
ChooseCustomerDialogRow.value = formData
|
||||
}
|
||||
|
||||
|
||||
// -基础参数
|
||||
@ -134,6 +170,8 @@ const imgData = ref({
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
userName: [{ required: true, message: "用户不能为空", trigger: "blur" }],
|
||||
customerNickname: [{ required: true, message: "客户不能为空", trigger: "blur" }],
|
||||
shopBusinessCategoryGuid: [{ required: true, message: "经营类目guid不能为空", trigger: "blur" }],
|
||||
shopLogo: [{ required: true, message: "图标不能为空", trigger: "blur" }],
|
||||
shopBusinessLicense: [{ required: true, message: "营业执照不能为空", trigger: "blur" }],
|
||||
@ -141,8 +179,6 @@ const rules = reactive({
|
||||
shopIntro: [{ required: true, message: "简介不能为空", trigger: "blur" }],
|
||||
shopSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
shopSalesOrderCount: [{ required: true, message: "销售单量不能为空", trigger: "blur", type: "number" }],
|
||||
shopAuditStatus: [{ required: true, message: "审核状态不能为空", trigger: "change", type: "number" }],
|
||||
shopAuditUserGuid: [{ required: true, message: "审核人不能为空", trigger: "blur"}],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
|
@ -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.customerNickname' 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="customersList" ref="tableRef" border highlight-current-row
|
||||
@row-click="handleRowClick">
|
||||
<el-table-column prop="customerNickname" label="客户名称" align="left" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getCustomerListFun" />
|
||||
|
||||
<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 { getCustomerWithOutBindList } from '@/api/business/ShopManager/Shops/shop.js';
|
||||
|
||||
// 业务参数
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
|
||||
// 基础参数
|
||||
const tableRef = ref(null);
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
customerNickname: "",
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:modelValue']);
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
});
|
||||
const formData = ref({
|
||||
...props.data
|
||||
});
|
||||
|
||||
let customersList = ref([]);
|
||||
// 打开窗口时运行
|
||||
const openDialog = async () => {
|
||||
await getCustomerListFun()
|
||||
}
|
||||
|
||||
const getCustomerListFun = async () => {
|
||||
loading.value = true
|
||||
await getCustomerWithOutBindList(queryParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
customersList.value = res.data.result
|
||||
total.value = res.totalNum
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(props, (v) => {
|
||||
formData.value = v.data;
|
||||
});
|
||||
|
||||
// -业务方法
|
||||
let customerNickname = ref("");
|
||||
let customerGuid = ref("");
|
||||
|
||||
|
||||
// -基础方法
|
||||
|
||||
// 点击行
|
||||
const handleRowClick = (row) => {
|
||||
customerNickname.value = row.customerNickname
|
||||
customerGuid.value = row.customerGuid
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
customerNickname.value = ""
|
||||
emits('update:modelValue', false);
|
||||
};
|
||||
|
||||
// 提交
|
||||
const handleEditClick = async () => {
|
||||
if (customerNickname.value !== "") {
|
||||
|
||||
formData.value.customerNickname = customerNickname.value
|
||||
formData.value.shopCustomerGuid = customerGuid.value
|
||||
if (formData.value.customerNickname != null) {
|
||||
closeDialog();
|
||||
}
|
||||
} else {
|
||||
ElMessage.error("请选择客户")
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const handleResetClick = async formEl => {
|
||||
|
||||
};
|
||||
</script>
|
||||
|
@ -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.userName' 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="usersList" ref="tableRef" border highlight-current-row
|
||||
@row-click="handleRowClick">
|
||||
<el-table-column prop="userName" label="用户名称" align="left" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getUserListFun" />
|
||||
|
||||
<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 { getUserWithOutBindList } from '@/api/business/ShopManager/Shops/shop.js';
|
||||
|
||||
// 业务参数
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
|
||||
// 基础参数
|
||||
const tableRef = ref(null);
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
userName: "",
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:modelValue']);
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
});
|
||||
const formData = ref({
|
||||
...props.data
|
||||
});
|
||||
|
||||
let usersList = ref([]);
|
||||
// 打开窗口时运行
|
||||
const openDialog = async () => {
|
||||
await getUserListFun()
|
||||
}
|
||||
|
||||
const getUserListFun = async () => {
|
||||
loading.value = true
|
||||
await getUserWithOutBindList(queryParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
usersList.value = res.data.result
|
||||
total.value = res.totalNum
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(props, (v) => {
|
||||
formData.value = v.data;
|
||||
});
|
||||
|
||||
// -业务方法
|
||||
let userName = ref("");
|
||||
let userId = ref("");
|
||||
|
||||
|
||||
// -基础方法
|
||||
|
||||
// 点击行
|
||||
const handleRowClick = (row) => {
|
||||
userName.value = row.userName
|
||||
userId.value = row.userId
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
userName.value = ""
|
||||
emits('update:modelValue', false);
|
||||
};
|
||||
|
||||
// 提交
|
||||
const handleEditClick = async () => {
|
||||
if (userName.value !== "") {
|
||||
|
||||
formData.value.userName = userName.value
|
||||
formData.value.shopUserId = userId.value
|
||||
if (formData.value.userName != null) {
|
||||
closeDialog();
|
||||
}
|
||||
} else {
|
||||
ElMessage.error("请选择用户")
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const handleResetClick = async formEl => {
|
||||
|
||||
};
|
||||
</script>
|
||||
|
@ -11,86 +11,65 @@
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="用户id" prop="shopUserId">
|
||||
<el-input v-model="formData.shopUserId" placeholder="请输入用户id" />
|
||||
<el-form-item :label-width="labelWidth" label="用户" prop="userName">
|
||||
<el-input v-model='formData.userName' disabled type="text" placeholder='点击选择用户'>
|
||||
<template #append>
|
||||
<div @click="handleChooseUser">选择</div>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="客户guid" prop="shopCustomerGuid">
|
||||
<el-input v-model="formData.shopCustomerGuid" placeholder="请输入客户guid" />
|
||||
<el-form-item :label-width="labelWidth" label="客户" prop="customerNickname">
|
||||
<el-input v-model='formData.customerNickname' disabled type="text" placeholder='点击选择客户'>
|
||||
<template #append>
|
||||
<div @click="handleChooseCustomer">选择</div>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="经营类目guid" prop="shopBusinessCategoryGuid">
|
||||
<el-input v-model="formData.shopBusinessCategoryGuid" placeholder="请输入经营类目guid" />
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="经营类目" prop="GoodsCategoryParentGuid">
|
||||
<el-select v-model="formData.customerGender" placeholder="请选择经营类目">
|
||||
<el-option v-for="item in dataList " :key="item.goodsCategoryId" :label="item.goodsCategoryName"
|
||||
:value="parseInt(item.goodsCategoryGuid)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="图标" prop="shopLogo">
|
||||
<UploadImage ref="uploadRef" v-model="formData.shopLogo" :data=imgData :limit="1" :fileSize="5"
|
||||
:drag="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="营业执照" prop="shopBusinessLicense">
|
||||
<UploadImage ref="uploadRef" v-model="formData.shopBusinessLicense" :data=imgData :limit="1" :fileSize="5"
|
||||
:drag="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="名称" prop="shopName">
|
||||
<el-input v-model="formData.shopName" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="简介" prop="shopIntro">
|
||||
<el-input v-model="formData.shopIntro" type="textarea" :rows="5" placeholder="请输入简介" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="shopSort">
|
||||
<el-input-number v-model.number="formData.shopSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="销售单量" prop="shopSalesOrderCount">
|
||||
<el-input-number v-model.number="formData.shopSalesOrderCount" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="审核状态" prop="shopAuditStatus">
|
||||
<el-select v-model="formData.shopAuditStatus" placeholder="请选择审核状态">
|
||||
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||
:value="parseInt(item.dictValue)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="审核人" prop="shopAuditUserGuid">
|
||||
<el-input v-model="formData.shopAuditUserGuid" placeholder="请输入审核人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
@ -101,17 +80,24 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 选择用户 -->
|
||||
<ChooseUserDialog v-model="ChooseUserDialogVisible" :data="ChooseUserDialogRow"></ChooseUserDialog>
|
||||
<!-- 选择客户 -->
|
||||
<ChooseCustomerDialog v-model="ChooseCustomerDialogVisible" :data="ChooseCustomerDialogRow"></ChooseCustomerDialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { addOrUpdateShop } from "@/api/business/ShopManager/Shops/shop.js";
|
||||
|
||||
import { addOrUpdateShop,getFirstGoodsCategoryList } from '@/api/business/ShopManager/Shops/shop.js';
|
||||
import ChooseCustomerDialog from './ChooseCustomerDialog.vue';
|
||||
import ChooseUserDialog from './ChooseUserDialog.vue';
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
await getTreeList()
|
||||
await getaudit_status()
|
||||
|
||||
}
|
||||
@ -128,6 +114,18 @@ watch(props, async (v) => {
|
||||
// 审核状态字典选项列表
|
||||
const audit_status = ref([]);
|
||||
|
||||
// 经营类树形列表
|
||||
const dataList = ref([])
|
||||
|
||||
// 选择用户弹窗参数
|
||||
const ChooseUserDialogVisible = ref(false);
|
||||
const ChooseUserDialogRow = ref({});
|
||||
// 选择客户弹窗参数
|
||||
const ChooseCustomerDialogVisible = ref(false);
|
||||
const ChooseCustomerDialogRow = ref({});
|
||||
|
||||
|
||||
|
||||
// -业务方法
|
||||
//字典获取
|
||||
async function getaudit_status() {
|
||||
@ -136,6 +134,27 @@ async function getaudit_status() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取经营类树形列表
|
||||
async function getTreeList() {
|
||||
getFirstGoodsCategoryList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 打开选择用户弹窗
|
||||
const handleChooseUser = () => {
|
||||
ChooseUserDialogVisible.value = true
|
||||
ChooseUserDialogRow.value = formData
|
||||
}
|
||||
|
||||
// 打开选择客户弹窗
|
||||
const handleChooseCustomer = () => {
|
||||
ChooseCustomerDialogVisible.value = true
|
||||
ChooseCustomerDialogRow.value = formData
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -基础参数
|
||||
@ -155,6 +174,8 @@ const imgData = ref({
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
userName: [{ required: true, message: "用户不能为空", trigger: "blur" }],
|
||||
customerNickname: [{ required: true, message: "客户不能为空", trigger: "blur" }],
|
||||
shopBusinessCategoryGuid: [{ required: true, message: "经营类目guid不能为空", trigger: "blur" }],
|
||||
shopLogo: [{ required: true, message: "图标不能为空", trigger: "blur" }],
|
||||
shopBusinessLicense: [{ required: true, message: "营业执照不能为空", trigger: "blur" }],
|
||||
@ -162,8 +183,6 @@ const rules = reactive({
|
||||
shopIntro: [{ required: true, message: "简介不能为空", trigger: "blur" }],
|
||||
shopSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
shopSalesOrderCount: [{ required: true, message: "销售单量不能为空", trigger: "blur", type: "number" }],
|
||||
shopAuditStatus: [{ required: true, message: "审核状态不能为空", trigger: "change", type: "number" }],
|
||||
shopAuditUserGuid: [{ required: true, message: "审核人不能为空", trigger: "blur" }],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
|
@ -10,32 +10,35 @@
|
||||
<div class="app-container">
|
||||
<el-row :gutter="24">
|
||||
<!-- 搜索框 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>
|
||||
<el-form-item label="名称" prop="shopName">
|
||||
<el-input v-model="queryParams.shopName" placeholder="请输入名称" clearable @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="shopAuditStatus">
|
||||
<el-select v-model="queryParams.shopAuditStatus" placeholder="请选择审核状态" clearable @change="handleQuery">
|
||||
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="shopName">
|
||||
<el-input v-model="queryParams.shopName" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="shopAuditStatus">
|
||||
<el-select v-model="queryParams.shopAuditStatus" placeholder="请选择审核状态" clearable @change="handleQuery">
|
||||
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||
:value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:shop:addOrUpdateKey']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
<el-button type="primary" v-hasPermi="['business:shop:addOrUpdateKey']" plain icon="plus"
|
||||
@click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:shop:delete']" plain icon="delete" @click="handleDelete">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:shop:delete']" plain icon="delete"
|
||||
@click="handleDelete">
|
||||
{{ $t('btn.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -52,40 +55,43 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 表格渲染 prop="对应的字段"-->
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" highlight-current-row
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column prop="shopUserId" label="用户id" align="center" />
|
||||
<el-table-column prop="shopLogo" label="图标" align="center">
|
||||
<el-table-column prop="userName" label="用户" align="center" />
|
||||
<el-table-column prop="customerNickname" label="客户" align="center" />
|
||||
<el-table-column prop="shopBusinessCategoryName" label="经营类目" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.shopLogo.split(',')[0]" :preview-src-list="scope.row.shopLogo.split(',')">
|
||||
<div><el-icon :size="15"><document /></el-icon></div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shopBusinessLicense" label="营业执照" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.shopBusinessLicense.split(',')[0]" :preview-src-list="scope.row.shopBusinessLicense.split(',')">
|
||||
<div><el-icon :size="15"><document /></el-icon></div>
|
||||
</el-image>
|
||||
<el-tag>{{ scope.row.shopBusinessCategoryName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shopName" label="名称" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopIntro" label="简介" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopSort" label="排序" align="center" sortable />
|
||||
<el-table-column prop="shopSalesOrderCount" label="销售单量" align="center" sortable />
|
||||
<el-table-column prop="shopAuditStatus" label="审核状态" align="center">
|
||||
<el-table-column prop="shopLogo" label="图标" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options=" audit_status " :value="scope.row.shopAuditStatus" />
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain"
|
||||
:src="scope.row.shopLogo.split(',')[0]" :preview-src-list="scope.row.shopLogo.split(',')">
|
||||
<div><el-icon :size="15">
|
||||
<document />
|
||||
</el-icon></div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="shopSalesOrderCount" label="销售单量" align="center" sortable />
|
||||
<el-table-column prop="shopSort" label="排序" align="center" sortable />
|
||||
<el-table-column prop="shopAuditStatus" label="审核状态" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="audit_status" :value="scope.row.shopAuditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" />
|
||||
|
||||
<el-table-column label="操作" width="350" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="warning" v-if="scope.row.shopAuditStatus == 1" size="small" icon="check"
|
||||
@click="handleAudit(scope.row)" v-hasPermi="['business:shop:audit']">审核</el-button>
|
||||
<el-button type="primary" v-if="scope.row.shopAuditStatus == 2" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:shop:addOrUpdateKey']">编辑</el-button>
|
||||
<el-button type="primary" v-if="scope.row.shopAuditStatus == 2" size="small" icon="edit"
|
||||
@click="handleUpdate(scope.row)" v-hasPermi="['business:shop:addOrUpdateKey']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:shop:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
@ -107,7 +113,7 @@
|
||||
<script setup name="shop">
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { exportShop, audit, shopList , delShop } from '@/api/business/ShopManager/Shops/shop.js'
|
||||
import { exportShop, audit, shopList, delShop } from '@/api/business/ShopManager/Shops/shop.js'
|
||||
import AddDialog from "./components/AddDialog.vue";
|
||||
import EditDialog from "./components/EditDialog.vue";
|
||||
import DetailDialog from "./components/DetailDialog.vue";
|
||||
@ -198,11 +204,11 @@ function handleQuery() {
|
||||
function handleDelete(row) {
|
||||
const Ids = row.shopId || ids.value
|
||||
|
||||
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return delShop(Ids)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user