file:新增联系方式和用户留言模块
This commit is contained in:
parent
7a7966c427
commit
9183d26efa
199
src/pages/index/contact_us/contact_info/index.vue
Normal file
199
src/pages/index/contact_us/contact_info/index.vue
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 面包屑 -->
|
||||||
|
<el-breadcrumb>
|
||||||
|
<el-breadcrumb-item>联系我们</el-breadcrumb-item>
|
||||||
|
<el-breadcrumb-item to="/ContactInfo'">联系方式</el-breadcrumb-item>
|
||||||
|
</el-breadcrumb>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
:label-width="labelWidth"
|
||||||
|
label="客户微信"
|
||||||
|
prop="customer_service_wx"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="formData.customer_service_wx"
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入客户微信"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
:label-width="labelWidth"
|
||||||
|
label="联系电话"
|
||||||
|
prop="contact_info_phone"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="formData.contact_info_phone"
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入联系电话"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="纬度" prop="latitude">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.latitude"
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入纬度"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="经度" prop="longitude">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.longitude"
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入经度"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item
|
||||||
|
:label-width="labelWidth"
|
||||||
|
label="定位"
|
||||||
|
prop="contact_info_location"
|
||||||
|
>
|
||||||
|
<Map v-model="locationList" style="margin-top: 20px"></Map>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item
|
||||||
|
:label-width="labelWidth"
|
||||||
|
label="加盟简介"
|
||||||
|
prop="join_apply_content"
|
||||||
|
>
|
||||||
|
<RichText
|
||||||
|
v-model="formData.join_apply_content"
|
||||||
|
:min-height="196"
|
||||||
|
></RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-button type="primary" class="sus_button" @click="save(formRef)">
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { get } from 'lodash';
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { getContactInfo, editContactInfo } from '~/service/contact_info';
|
||||||
|
import { useLoginStore } from '~/store';
|
||||||
|
|
||||||
|
const store = useLoginStore();
|
||||||
|
const headers = {
|
||||||
|
Accept: 'application/json',
|
||||||
|
...store.headers
|
||||||
|
};
|
||||||
|
|
||||||
|
let formData = ref({});
|
||||||
|
const locationList = ref({});
|
||||||
|
|
||||||
|
const uoloadData = ref({
|
||||||
|
dirName: 'ContactInfo'
|
||||||
|
});
|
||||||
|
|
||||||
|
//验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
customer_service_wx: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '客户微信不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
contact_info_phone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '联系电话不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
join_apply_content: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '加盟简介不能为空'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const labelWidth = 200;
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
|
//获取
|
||||||
|
const getContent = async () => {
|
||||||
|
const { code, data } = await getContactInfo();
|
||||||
|
if (code == 0) {
|
||||||
|
formData.value = data;
|
||||||
|
|
||||||
|
if (formData.value.longitude) {
|
||||||
|
locationList.value.address = formData.value.contact_info_location;
|
||||||
|
locationList.value.longitude = formData.value.longitude;
|
||||||
|
locationList.value.latitude = formData.value.latitude;
|
||||||
|
}
|
||||||
|
console.log(locationList.value.address);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let mapCb = function () {
|
||||||
|
getContent();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//调用
|
||||||
|
function getInfo(){
|
||||||
|
getContent()
|
||||||
|
};
|
||||||
|
getInfo()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//保存
|
||||||
|
const save = async formEl => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async valid => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 地址处理
|
||||||
|
if (!locationList.value.address) {
|
||||||
|
ElMessage.error('请选择contact_info_location');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let locationData = locationList.value;
|
||||||
|
formData.contact_info_location = locationData.address;
|
||||||
|
formData.longitude = locationData.longitude;
|
||||||
|
formData.latitude = locationData.latitude;
|
||||||
|
|
||||||
|
const { code } = await editContactInfo(formData.value);
|
||||||
|
console.log(formData.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.sus_button {
|
||||||
|
width: 300px;
|
||||||
|
height: 50px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
.upLoadEl {
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
height: 200px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
:deep(.el-upload-list__item-thumbnail) {
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="dialogVisible" title="添加用户留言" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人名称" prop="leave_message_user_name">
|
||||||
|
<el-input v-model='formData.leave_message_user_name' type="text" placeholder='请输入留言人名称'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人手机号码" prop="leave_message_user_phone">
|
||||||
|
<el-input v-model='formData.leave_message_user_phone' type="text" placeholder='请输入留言人手机号码'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="留言受理状态" prop="leave_message_status">
|
||||||
|
<el-select v-model="formData.leave_message_status" clearable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in leave_message_status"
|
||||||
|
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||||
|
:value="item.dictionary_value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言内容" prop="leave_message_content">
|
||||||
|
<RichText v-model='formData.leave_message_content' :min-height='196'></RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleAddClick(formRef)">添加</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { addLeaveMessage , getDictionary } from "~/service/leave_message";
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const leave_message_status = ref([]);
|
||||||
|
async function get_leave_message_status() {
|
||||||
|
await getDictionary({ dictionary_value: 'leave_message_status'}).then((res) => {
|
||||||
|
leave_message_status.value = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
const store = useLoginStore();
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
...store.headers,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 90;
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const dialogVisible = ref(props.modelValue);
|
||||||
|
const formData = reactive({});
|
||||||
|
|
||||||
|
const uoloadData = ref({
|
||||||
|
dirName: "LeaveMessage"
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(props, (v) => {
|
||||||
|
dialogVisible.value = v.modelValue;
|
||||||
|
});
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
leave_message_content: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言内容不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_status: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言受理状态不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_user_name: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言人名称不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_user_phone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言人手机号码不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = () => {
|
||||||
|
get_leave_message_status()
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
handleResetClick(formRef.value);
|
||||||
|
dialogVisible.value = false;
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAddClick = async (formEl) => {
|
||||||
|
console.log(formData);
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { code } = await addLeaveMessage(formData);
|
||||||
|
if (code == 0) {
|
||||||
|
closeDialog();
|
||||||
|
props.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="用户留言详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人名称" prop="leave_message_user_name">
|
||||||
|
<el-input v-model='formData.leave_message_user_name' type="text" placeholder='请输入留言人名称'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人手机号码" prop="leave_message_user_phone">
|
||||||
|
<el-input v-model='formData.leave_message_user_phone' type="text" placeholder='请输入留言人手机号码'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="留言受理状态" prop="leave_message_status">
|
||||||
|
<el-select v-model="formData.leave_message_status" clearable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in leave_message_status"
|
||||||
|
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||||
|
:value="item.dictionary_value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言内容" prop="leave_message_content">
|
||||||
|
<RichText v-model='formData.leave_message_content' :min-height='196'></RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { isEmptyObject } from "~/utils/index";
|
||||||
|
import { getDictionary } from '~/service/leave_message';
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const leave_message_status = ref([]);
|
||||||
|
async function get_leave_message_status() {
|
||||||
|
await getDictionary({ dictionary_value: 'leave_message_status'}).then((res) => {
|
||||||
|
leave_message_status.value = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
watch(props, (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = () => {
|
||||||
|
|
||||||
|
get_leave_message_status()
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="编辑用户留言" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人名称" prop="leave_message_user_name">
|
||||||
|
<el-input v-model='formData.leave_message_user_name' type="text" placeholder='请输入留言人名称'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言人手机号码" prop="leave_message_user_phone">
|
||||||
|
<el-input v-model='formData.leave_message_user_phone' type="text" placeholder='请输入留言人手机号码'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="留言受理状态" prop="leave_message_status">
|
||||||
|
<el-select v-model="formData.leave_message_status" clearable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in leave_message_status"
|
||||||
|
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||||
|
:value="item.dictionary_value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="留言内容" prop="leave_message_content">
|
||||||
|
<RichText v-model='formData.leave_message_content' :min-height='196'></RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { editLeaveMessage , getDictionary } from "~/service/leave_message";
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const leave_message_status = ref([]);
|
||||||
|
async function get_leave_message_status() {
|
||||||
|
await getDictionary({ dictionary_value: 'leave_message_status'}).then((res) => {
|
||||||
|
leave_message_status.value = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
const store = useLoginStore();
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
...store.headers,
|
||||||
|
};
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
const uoloadData = ref({
|
||||||
|
dirName: "LeaveMessage"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
watch(props, (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = () => {
|
||||||
|
get_leave_message_status()
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
leave_message_content: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言内容不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_status: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言受理状态不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_user_name: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言人名称不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
leave_message_user_phone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '留言人手机号码不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleEditClick = async (formEl) => {
|
||||||
|
console.log(formData.value);
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { code } = await editLeaveMessage(formData.value);
|
||||||
|
if (code == 0) {
|
||||||
|
closeDialog();
|
||||||
|
props.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
235
src/pages/index/contact_us/leave_message/index.vue
Normal file
235
src/pages/index/contact_us/leave_message/index.vue
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 面包屑 -->
|
||||||
|
<el-breadcrumb>
|
||||||
|
<el-breadcrumb-item>联系我们</el-breadcrumb-item>
|
||||||
|
<el-breadcrumb-item to="/leave_message/list"
|
||||||
|
>用户留言列表</el-breadcrumb-item
|
||||||
|
>
|
||||||
|
</el-breadcrumb>
|
||||||
|
|
||||||
|
<el-space style="margin-bottom: 10px">
|
||||||
|
|
||||||
|
<!-- 导出 -->
|
||||||
|
<el-button icon="ElIconDocument" @click="exportExcel(params)"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- 下拉操作 -->
|
||||||
|
<el-dropdown v-if="selectionData.length">
|
||||||
|
<el-button type="primary">
|
||||||
|
批量操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="handleDelete(selectionData)">
|
||||||
|
批量删除
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-space>
|
||||||
|
<!-- 数据表格 -->
|
||||||
|
<DataTable
|
||||||
|
ref="tableRef"
|
||||||
|
style="width: 100%"
|
||||||
|
:onSelectionChange="data => (selectionData = data)"
|
||||||
|
:column="column"
|
||||||
|
:params="params"
|
||||||
|
:request="params => getLeaveMessageList(params)"
|
||||||
|
>
|
||||||
|
<template #leave_message_status="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="leave_message_status"
|
||||||
|
:value="scope.row.leave_message_status"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #chaoz="scope">
|
||||||
|
<el-space>
|
||||||
|
<el-button size="small" @click="handleStatusUpdate([scope.row])">
|
||||||
|
受理
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown @command="handleCommand">
|
||||||
|
<el-button type="primary" size="small">
|
||||||
|
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item :command="{ type: 'detail', row: scope.row }">
|
||||||
|
详情
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="{ type: 'delete', row: scope.row }">
|
||||||
|
删除
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-space>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
|
|
||||||
|
<!-- 添加用户留言 -->
|
||||||
|
<AddLeaveMessageDialog
|
||||||
|
v-model="addLeaveMessageDialogVisible"
|
||||||
|
:done="() => tableRef.reload()"
|
||||||
|
></AddLeaveMessageDialog>
|
||||||
|
<!-- 编辑用户留言 -->
|
||||||
|
<EditLeaveMessageDialog
|
||||||
|
v-model="EditLeaveMessageDialogVisible"
|
||||||
|
:data="EditLeaveMessageDialogRow"
|
||||||
|
:done="() => tableRef.reload()"
|
||||||
|
></EditLeaveMessageDialog>
|
||||||
|
<!-- 用户留言详情 -->
|
||||||
|
<DetailLeaveMessageDialog
|
||||||
|
v-model="DetailLeaveMessageDialogVisible"
|
||||||
|
:data="DetailLeaveMessageDialogRow"
|
||||||
|
></DetailLeaveMessageDialog>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ArrowDown } from '@element-plus/icons-vue';
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { useLoginStore } from '~/store';
|
||||||
|
import {
|
||||||
|
getLeaveMessageList,
|
||||||
|
deleteLeaveMessage,
|
||||||
|
getDictionary,
|
||||||
|
exportExcel,
|
||||||
|
handleleave_messageStatus
|
||||||
|
} from '~/service/leave_message';
|
||||||
|
import AddLeaveMessageDialog from './components/AddLeaveMessageDialog.vue';
|
||||||
|
import EditLeaveMessageDialog from './components/EditLeaveMessageDialog.vue';
|
||||||
|
import DetailLeaveMessageDialog from './components/DetailLeaveMessageDialog.vue';
|
||||||
|
|
||||||
|
const tableRef = ref();
|
||||||
|
const selectionData = ref([]);
|
||||||
|
const store = useLoginStore();
|
||||||
|
|
||||||
|
const addLeaveMessageDialogVisible = ref(false);
|
||||||
|
const EditLeaveMessageDialogVisible = ref(false);
|
||||||
|
const EditLeaveMessageDialogRow = ref({});
|
||||||
|
const DetailLeaveMessageDialogVisible = ref(false);
|
||||||
|
const DetailLeaveMessageDialogRow = ref({});
|
||||||
|
|
||||||
|
const headers = {
|
||||||
|
Accept: 'application/json',
|
||||||
|
...store.headers
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
const params = reactive({});
|
||||||
|
const column = [
|
||||||
|
{
|
||||||
|
fixed: true,
|
||||||
|
type: 'selection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'leave_message_user_name',
|
||||||
|
label: '留言人名称',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'leave_message_content',
|
||||||
|
label: '留言内容',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'leave_message_user_phone',
|
||||||
|
label: '留言人手机号码',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'leave_message_status',
|
||||||
|
label: '留言受理状态',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '操作',
|
||||||
|
prop: 'chaoz',
|
||||||
|
width: '250',
|
||||||
|
fixed: 'right'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleCommand = ({ type, row }) => {
|
||||||
|
switch (type) {
|
||||||
|
case 'detail':
|
||||||
|
handleDetail(row);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
handleDelete([row]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//受理
|
||||||
|
let loadingHandle = null;
|
||||||
|
const HandleLoading = () => {
|
||||||
|
loadingHandle = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: "正在受理中...",
|
||||||
|
background: "rgba(255, 255, 255, 0.7)",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeUploadLoading = () => loadingHandle.close();
|
||||||
|
const handleStatusUpdate = (data) => {
|
||||||
|
ElMessageBox.confirm(`您确定已对所选的在线报名处理了吗?`).then(async () => {
|
||||||
|
HandleLoading()
|
||||||
|
const { code, msg } = await handleleave_messageStatus({
|
||||||
|
leave_message_guid: data.map(v => v.leave_message_guid).join()
|
||||||
|
});
|
||||||
|
if (code == 0) {
|
||||||
|
ElMessageBox.alert(msg, "受理信息", {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
callback: () => {
|
||||||
|
tableRef.value.reload();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error(msg);
|
||||||
|
}
|
||||||
|
closeUploadLoading();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 删除数据
|
||||||
|
const handleDelete = data => {
|
||||||
|
ElMessageBox.confirm(`您确定要删除该用户留言吗?`).then(async () => {
|
||||||
|
const res = await deleteLeaveMessage({
|
||||||
|
leave_message_guid: data.map(v => v.leave_message_guid).join()
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
tableRef.value.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditLeaveMessageDialogVisible.value = true;
|
||||||
|
EditLeaveMessageDialogRow.value = row;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailLeaveMessageDialogVisible.value = true;
|
||||||
|
DetailLeaveMessageDialogRow.value = row;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const leave_message_status = ref([]);
|
||||||
|
async function get_leave_message_status() {
|
||||||
|
await getDictionary({ dictionary_value: 'leave_message_status' }).then(
|
||||||
|
res => {
|
||||||
|
leave_message_status.value = res;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
get_leave_message_status();
|
||||||
|
</script>
|
23
src/service/contact_info.js
Normal file
23
src/service/contact_info.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { api} from '~/utils/axios';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取联系方式内容
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function getContactInfo(data) {
|
||||||
|
return api.post('ContactUs.ContactInfo/getContactInfo', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑联系方式
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function editContactInfo(data) {
|
||||||
|
return api.post('ContactUs.ContactInfo/editContactInfo', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '编辑失败'
|
||||||
|
});
|
||||||
|
}
|
87
src/service/leave_message.js
Normal file
87
src/service/leave_message.js
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
import { api, downloadFile, createApiUrl } from '~/utils/axios';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出用户留言
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function exportExcel(data) {
|
||||||
|
downloadFile(createApiUrl('ContactUs.LeaveMessage/exportExcel'), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典值
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function getDictionary(data) {
|
||||||
|
return api.post('Dictionary.Dictionary/getDictionary', data, {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户留言列表
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function getLeaveMessageList(data) {
|
||||||
|
return api.post('ContactUs.LeaveMessage/getLeaveMessageList', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户留言
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function deleteLeaveMessage(data) {
|
||||||
|
return api.post('ContactUs.LeaveMessage/deleteLeaveMessage', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '删除失败'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户留言
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function addLeaveMessage(data) {
|
||||||
|
return api.post('ContactUs.LeaveMessage/addLeaveMessage', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '添加失败'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑用户留言
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function editLeaveMessage(data) {
|
||||||
|
return api.post('ContactUs.LeaveMessage/editLeaveMessage', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '编辑失败'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 受理用户留言
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function handleleave_messageStatus(data) {
|
||||||
|
return api.post('ContactUs.LeaveMessage/handleleave_messageStatus', data, {
|
||||||
|
// isTransformResponse: true,
|
||||||
|
// isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '受理失败'
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user