feat 添加店铺收货地址,修改登录界面
This commit is contained in:
parent
84183cb217
commit
686161264a
46
src/api/business/ShopManager/ShopAddresss/shopaddress.js
Normal file
46
src/api/business/ShopManager/ShopAddresss/shopaddress.js
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @Descripttion: 店铺地址Api接口
|
||||
* @version: (1.0)
|
||||
* @Author: (黎文豪)
|
||||
* @Date: (2023-06-15)
|
||||
* @LastEditors: (黎文豪)
|
||||
* @LastEditTime: (2023-06-15)
|
||||
*/
|
||||
|
||||
// 店铺地址分页查询列表
|
||||
export function shopAddressList(query) {
|
||||
return request({
|
||||
url: '/business/ShopAddress/getShopAddressList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 店铺地址新增或修改
|
||||
export function addOrUpdateShopAddress(data) {
|
||||
return request({
|
||||
url: '/business/ShopAddress/addOrUpdateShopAddress',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 店铺地址删除
|
||||
export function delShopAddress(ids) {
|
||||
return request({
|
||||
url: '/business/ShopAddress/'+ ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 店铺地址导出
|
||||
export function exportShopAddress(query) {
|
||||
return request({
|
||||
url: 'business/ShopAddress/exportShopAddress',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
BIN
src/assets/images/login-bg.jpg
Normal file
BIN
src/assets/images/login-bg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
src/assets/images/login_img.png
Normal file
BIN
src/assets/images/login_img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 208 KiB |
@ -6,10 +6,29 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
// 登录背景图
|
||||
// background-image: url('@/assets/images/login-bg.jpg');
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.login-img-box{
|
||||
margin-right: 10%;
|
||||
width: 835px;
|
||||
height: 776px;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.login-img-box img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@media (max-width:1200px) {
|
||||
.login-img-box{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
|
@ -19,7 +19,7 @@ $panGreen: #30b08f;
|
||||
--base-tags-height: 34px;
|
||||
--base-header-height: 50px;
|
||||
//登录框宽度
|
||||
--base-login-width: 280px;
|
||||
--base-login-width: 300px;
|
||||
}
|
||||
|
||||
/***侧边栏深色配置***/
|
||||
|
@ -113,7 +113,6 @@ function handleCascaderChange(selectedValues) {
|
||||
formData.customerAddressProvinceId = selectedValues[0]
|
||||
formData.customerAddressCityId = selectedValues[1]
|
||||
formData.customerAddressAreaId = selectedValues[2]
|
||||
console.log(formData, '表单');
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:customeraddress:addOrUpdateKey']" plain icon="plus"
|
||||
<el-button type="primary" v-hasPermi="['business:customeraddress:addOrUpdate']" plain icon="plus"
|
||||
@click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
@ -73,7 +73,7 @@
|
||||
<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:customeraddress:addOrUpdateKey']">编辑</el-button>
|
||||
v-hasPermi="['business:customeraddress:addOrUpdate']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customeraddress:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
|
@ -45,7 +45,7 @@
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:customer:addOrUpdateKey']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
<el-button type="primary" v-hasPermi="['business:customer:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
@ -95,7 +95,7 @@
|
||||
<el-table-column label="操作" width="250" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:customer:addOrUpdateKey']">编辑</el-button>
|
||||
v-hasPermi="['business:customer:addOrUpdate']">编辑</el-button>
|
||||
<!-- <el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customer:delete']">删除</el-button> -->
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
|
@ -31,7 +31,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:region:addOrUpdateKey']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
<el-button type="primary" v-hasPermi="['business:region:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -59,7 +59,7 @@
|
||||
<!-- <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:region:addOrUpdateKey']">编辑</el-button>
|
||||
v-hasPermi="['business:region:addOrUpdate']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:region:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
|
@ -38,7 +38,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:goodscategory:addOrUpdateKey']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
<el-button type="primary" v-hasPermi="['business:goodscategory:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -82,7 +82,7 @@
|
||||
<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:goodscategory:addOrUpdateKey']">编辑</el-button>
|
||||
v-hasPermi="['business:goodscategory:addOrUpdate']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:goodscategory:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
|
@ -0,0 +1,174 @@
|
||||
<!--
|
||||
* @Descripttion: (店铺地址/tb_shop_address 添加弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (黎文豪)
|
||||
* @Date: (2023-06-15)
|
||||
* @LastEditors: (黎文豪)
|
||||
* @LastEditTime: (2023-06-15)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="添加店铺地址信息" width="900px" @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="shopAddressType">
|
||||
<el-radio-group v-model="formData.shopAddressType">
|
||||
<el-radio v-for="item in shop_address_type " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||
item.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="所在地区" prop="districtId">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: false, value: 'regionId', label: 'regionName', emitPath: true }"
|
||||
placeholder="请选择所在地区" clearable v-model="formData.districtId" @change="handleCascaderChange">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.regionName }}</span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系人姓名" prop="shopAddressContactName">
|
||||
<el-input v-model="formData.shopAddressContactName" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系电话" prop="shopAddressContactNumber">
|
||||
<el-input v-model="formData.shopAddressContactNumber" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="详细地址" prop="shopAddressDetailedAddress">
|
||||
<el-input v-model="formData.shopAddressDetailedAddress" type="textarea" :rows="5" placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="shopAddressSort">
|
||||
<el-input-number v-model.number="formData.shopAddressSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div key="dialog-footer">
|
||||
<el-button type="primary" @click="handleAddClick(formRef)">添加</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { addOrUpdateShopAddress } from '@/api/business/ShopManager/ShopAddresss/shopAddress.js';
|
||||
import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
await getTreeList()
|
||||
await getshop_address_type()
|
||||
|
||||
}
|
||||
|
||||
// -业务参数
|
||||
const dataList = ref([])
|
||||
|
||||
// 地址类型字典选项列表
|
||||
const shop_address_type = ref([]);
|
||||
|
||||
|
||||
// -业务方法
|
||||
// 字典获取
|
||||
async function getshop_address_type() {
|
||||
await proxy.getDicts('shop_address_type').then((res) => {
|
||||
shop_address_type.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取省市区数据
|
||||
async function getTreeList() {
|
||||
regionTreeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 处理所在地区,省市区传值
|
||||
function handleCascaderChange(selectedValues) {
|
||||
formData.provinceId = selectedValues[0]
|
||||
formData.cityId = selectedValues[1]
|
||||
formData.districtId = selectedValues[2]
|
||||
}
|
||||
|
||||
|
||||
// -基础参数
|
||||
const labelWidth = 100;
|
||||
const formRef = ref();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const formData = reactive({
|
||||
shopAddressSort: 100
|
||||
});
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
done: Function,
|
||||
});
|
||||
const imgData = ref({
|
||||
fileDir: "ShopAddress"
|
||||
})
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
shopAddressType: [{ required: true, message: "地址类型不能为空", trigger: "blur", type: "number" }],
|
||||
districtId: [{ required: true, message: "所在地区不能为空", trigger: "blur", type: "number" }],
|
||||
shopAddressContactName: [{ required: true, message: "联系人姓名不能为空", trigger: "blur" }],
|
||||
shopAddressContactNumber: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
||||
shopAddressDetailedAddress: [{ required: true, message: "详细地址不能为空", trigger: "blur" }],
|
||||
shopAddressSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
|
||||
// 提交
|
||||
const handleAddClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const { code } = await addOrUpdateShopAddress(formData);
|
||||
if (code == 200) {
|
||||
modal.msgSuccess('添加成功')
|
||||
closeDialog();
|
||||
}
|
||||
});
|
||||
};
|
||||
const closeDialog = () => {
|
||||
handleResetClick(formRef.value);
|
||||
props.done();
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
};
|
||||
</script>
|
@ -0,0 +1,130 @@
|
||||
<!--
|
||||
* @Descripttion: (店铺地址/tb_shop_address 详情弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (黎文豪)
|
||||
* @Date: (2023-06-15)
|
||||
* @LastEditors: (黎文豪)
|
||||
* @LastEditTime: (2023-06-15)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="店铺地址信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="地址类型" prop="shopAddressType">
|
||||
<el-radio-group v-model="formData.shopAddressType">
|
||||
<el-radio v-for="item in shop_address_type " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||
item.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="所在地区" prop="districtId">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: false, value: 'regionId', label: 'regionName', emitPath: true }"
|
||||
placeholder="请选择所在地区" clearable v-model="formData.districtId" @change="handleCascaderChange">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.regionName }}</span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系人姓名" prop="shopAddressContactName">
|
||||
<el-input v-model="formData.shopAddressContactName" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系电话" prop="shopAddressContactNumber">
|
||||
<el-input v-model="formData.shopAddressContactNumber" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="详细地址" prop="shopAddressDetailedAddress">
|
||||
<el-input v-model="formData.shopAddressDetailedAddress" type="textarea" :rows="5" placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="shopAddressSort">
|
||||
<el-input-number v-model.number="formData.shopAddressSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
await getTreeList()
|
||||
await getshop_address_type()
|
||||
|
||||
}
|
||||
|
||||
const formData = ref({
|
||||
...props.data,
|
||||
});
|
||||
watch(props, async (v) => {
|
||||
formData.value = v.data;
|
||||
});
|
||||
|
||||
// -业务参数
|
||||
const dataList = ref([])
|
||||
|
||||
// 地址类型字典选项列表
|
||||
const shop_address_type = ref([]);
|
||||
|
||||
// -业务方法
|
||||
// 字典获取
|
||||
async function getshop_address_type() {
|
||||
await proxy.getDicts('shop_address_type').then((res) => {
|
||||
shop_address_type.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取省市区数据
|
||||
async function getTreeList() {
|
||||
regionTreeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 基础参数
|
||||
const formRef = ref();
|
||||
const labelWidth = 100;
|
||||
const { proxy } = getCurrentInstance()
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
done: Function,
|
||||
});
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
|
||||
|
||||
// -基础方法
|
||||
const closeDialog = () => {
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
</script>
|
@ -0,0 +1,178 @@
|
||||
<!--
|
||||
* @Descripttion: (店铺地址/tb_shop_address 编辑弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (黎文豪)
|
||||
* @Date: (2023-06-15)
|
||||
* @LastEditors: (黎文豪)
|
||||
* @LastEditTime: (2023-06-15)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="修改店铺地址信息" width="900px" @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="shopAddressType">
|
||||
<el-radio-group v-model="formData.shopAddressType">
|
||||
<el-radio v-for="item in shop_address_type " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||
item.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="所在地区" prop="districtId">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: false, value: 'regionId', label: 'regionName', emitPath: true }"
|
||||
placeholder="请选择所在地区" clearable v-model="formData.districtId" @change="handleCascaderChange">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.regionName }}</span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系人姓名" prop="shopAddressContactName">
|
||||
<el-input v-model="formData.shopAddressContactName" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="联系电话" prop="shopAddressContactNumber">
|
||||
<el-input v-model="formData.shopAddressContactNumber" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="详细地址" prop="shopAddressDetailedAddress">
|
||||
<el-input v-model="formData.shopAddressDetailedAddress" type="textarea" :rows="5" placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="shopAddressSort">
|
||||
<el-input-number v-model.number="formData.shopAddressSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { addOrUpdateShopAddress } from "@/api/business/ShopManager/ShopAddresss/shopAddress.js";
|
||||
import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
await getTreeList()
|
||||
await getshop_address_type()
|
||||
|
||||
}
|
||||
|
||||
const formData = ref({
|
||||
...props.data,
|
||||
});
|
||||
watch(props, async (v) => {
|
||||
formData.value = v.data;
|
||||
|
||||
});
|
||||
|
||||
// 业务参数
|
||||
const dataList = ref([])
|
||||
|
||||
// 地址类型字典选项列表
|
||||
const shop_address_type = ref([]);
|
||||
|
||||
// -业务方法
|
||||
//字典获取
|
||||
async function getshop_address_type() {
|
||||
await proxy.getDicts('shop_address_type').then((res) => {
|
||||
shop_address_type.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取省市区数据
|
||||
async function getTreeList() {
|
||||
regionTreeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 处理所在地区,省市区传值
|
||||
function handleCascaderChange(selectedValues) {
|
||||
formData.data.provinceId = selectedValues[0]
|
||||
formData.data.cityId = selectedValues[1]
|
||||
formData.data.districtId = selectedValues[2]
|
||||
}
|
||||
|
||||
|
||||
// -基础参数
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
done: Function,
|
||||
});
|
||||
|
||||
const labelWidth = 100;
|
||||
const formRef = ref();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const imgData = ref({
|
||||
fileDir: "ShopAddress"
|
||||
})
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
shopAddressType: [{ required: true, message: "地址类型不能为空", trigger: "blur", type: "number" }],
|
||||
districtId: [{ required: true, message: "所在地区不能为空", trigger: "blur", type: "number" }],
|
||||
shopAddressContactName: [{ required: true, message: "联系人姓名不能为空", trigger: "blur" }],
|
||||
shopAddressContactNumber: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
||||
shopAddressDetailedAddress: [{ required: true, message: "详细地址不能为空", trigger: "blur" }],
|
||||
shopAddressSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
// 提交
|
||||
const handleEditClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const { code } = await addOrUpdateShopAddress(formData.value);
|
||||
if (code == 200) {
|
||||
modal.msgSuccess('修改成功')
|
||||
closeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
}
|
||||
const closeDialog = () => {
|
||||
props.done();
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
</script>
|
242
src/views/business/ShopManager/ShopAddresss/index.vue
Normal file
242
src/views/business/ShopManager/ShopAddresss/index.vue
Normal file
@ -0,0 +1,242 @@
|
||||
<!--
|
||||
* @Descripttion: (店铺地址/tb_shop_address)
|
||||
* @version: (1.0)
|
||||
* @Author: (黎文豪)
|
||||
* @Date: (2023-06-15)
|
||||
* @LastEditors: (黎文豪)
|
||||
* @LastEditTime: (2023-06-15)
|
||||
-->
|
||||
<template>
|
||||
<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"
|
||||
@submit.prevent>
|
||||
<el-form-item label="地址类型" prop="shopAddressType">
|
||||
<el-radio-group v-model="queryParams.shopAddressType">
|
||||
<el-radio v-for="item in shop_address_type " :key="item.dictValue"
|
||||
:label="item.dictValue">{{ item.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
</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:shopaddress:addOrUpdate']" 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:shopaddress:delete']" plain icon="delete"
|
||||
@click="handleDelete">
|
||||
{{ $t('btn.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="download" @click="handleExport"
|
||||
v-hasPermi="['business:shopaddress:export']">
|
||||
{{ $t('btn.export') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格渲染 prop="对应的字段"-->
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column prop="shopName" label="店铺名称" align="center" />
|
||||
<el-table-column prop="shopAddressType" label="地址类型" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="shop_address_type" :value="scope.row.shopAddressType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="addressName" label="所在地区" align="center" />
|
||||
<el-table-column prop="shopAddressContactName" label="联系人姓名" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopAddressContactNumber" label="联系电话" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopAddressDetailedAddress" label="详细地址" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="shopAddressSort" label="排序" align="center" sortable />
|
||||
|
||||
<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:shopaddress:addOrUpdate']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:shopaddress:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<!-- 添加 -->
|
||||
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||
<!-- 编辑 -->
|
||||
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||
<!-- 详情 -->
|
||||
<DetailDialog v-model="DetailDialogVisible" :data="DetailDialogRow" :done="() => resetQuery()"></DetailDialog>
|
||||
</template>
|
||||
<script setup name="shopaddress">
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { exportShopAddress, shopAddressList, delShopAddress } from '@/api/business/ShopManager/ShopAddresss/shopAddress.js'
|
||||
import AddDialog from "./components/AddDialog.vue";
|
||||
import EditDialog from "./components/EditDialog.vue";
|
||||
import DetailDialog from "./components/DetailDialog.vue";
|
||||
|
||||
const AddDialogVisible = ref(false);
|
||||
const EditDialogVisible = ref(false);
|
||||
const EditDialogRow = ref({});
|
||||
const DetailDialogVisible = ref(false);
|
||||
const DetailDialogRow = ref({});
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
// 选中categoryId数组数组
|
||||
const ids = ref([])
|
||||
// 非单选禁用
|
||||
const single = ref(true)
|
||||
// 非多个禁用
|
||||
const multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
const showSearch = ref(true)
|
||||
// 数据列表
|
||||
const dataList = ref([])
|
||||
// 总记录数
|
||||
const total = ref(0)
|
||||
// 是否加载
|
||||
const loading = ref(true)
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
})
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
// 业务参数
|
||||
|
||||
|
||||
// 业务方法
|
||||
|
||||
// 字典获取
|
||||
const shop_address_type = ref([]);
|
||||
async function getshop_address_type() {
|
||||
await proxy.getDicts('shop_address_type').then((res) => {
|
||||
shop_address_type.value = res.data
|
||||
})
|
||||
}
|
||||
getshop_address_type()
|
||||
|
||||
|
||||
|
||||
|
||||
//基础方法
|
||||
|
||||
// 查询数据
|
||||
function getList() {
|
||||
loading.value = true
|
||||
|
||||
|
||||
shopAddressList(queryParams.value).then((res) => {
|
||||
if (res.code == 200) {
|
||||
loading.value = false;
|
||||
dataList.value = res.data.result;
|
||||
total.value = res.data.totalNum;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.shopAddressId)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 重置查询操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryForm')
|
||||
handleQuery()
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList()
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const Ids = row.shopAddressId || ids.value
|
||||
|
||||
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return delShopAddress(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
handleQuery()
|
||||
modal.msgSuccess("删除成功")
|
||||
})
|
||||
.catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport(row) {
|
||||
const Ids = row.shopAddressId || ids.value
|
||||
const name = ref("所有")
|
||||
|
||||
if (Ids.length != 0) {
|
||||
let str = ''
|
||||
for (const key in Ids) {
|
||||
str += Ids[key] + ','
|
||||
}
|
||||
str = str.slice(0, str.length - 1)
|
||||
queryParams.value.ids = str
|
||||
name.value = "选中"
|
||||
}
|
||||
|
||||
ElMessageBox.confirm('是否确认导出' + name.value + '数据?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(function () {
|
||||
return exportShopAddress(queryParams.value)
|
||||
})
|
||||
.then((response) => {
|
||||
proxy.download(response.data.path)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改
|
||||
function handleUpdate(row) {
|
||||
EditDialogVisible.value = true
|
||||
EditDialogRow.value = row
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
DetailDialogVisible.value = true
|
||||
DetailDialogRow.value = row
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
</script>
|
@ -31,7 +31,7 @@
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:shop:addOrUpdateKey']" plain icon="plus"
|
||||
<el-button type="primary" v-hasPermi="['business:shop:addOrUpdate']" plain icon="plus"
|
||||
@click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
@ -96,7 +96,7 @@
|
||||
<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>
|
||||
@click="handleUpdate(scope.row)" v-hasPermi="['business:shop:addOrUpdate']">编辑</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>
|
||||
|
@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<starBackground></starBackground>
|
||||
<div class="login">
|
||||
<div class="login-img-box">
|
||||
<img src="@/assets/images/login_img.png" alt="">
|
||||
</div>
|
||||
|
||||
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">{{ title }}</h3>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user