公告,活动,投诉接口对接完成
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="ResidentMainBox p-2 w-full">
|
||||
<PageHeader title="投诉类型"></PageHeader>
|
||||
<PageHeader title="活动"></PageHeader>
|
||||
<div class="ResidentMainBody">
|
||||
<el-card>
|
||||
<template #header>
|
||||
@@ -9,14 +9,26 @@
|
||||
<div class="addBuildingFormBody">
|
||||
<div class="formbox">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="投诉类型名称" prop="name">
|
||||
<el-input v-model.trim="form.name" placeholder="请输入投诉类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="投诉类型状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="(item, index) in com_repair_project_status" :key="index" :value="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动标题" prop="titile">
|
||||
<el-input v-model.trim="form.titile" placeholder="请输入活动标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作者" prop="author">
|
||||
<el-input v-model.trim="form.author" placeholder="请输入作者" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="活动详情" prop="content">
|
||||
<editor v-model="form.content" :height="500" :min-height="300" :read-only="false" :file-size="5" :type="'url'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
@@ -31,7 +43,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { addComplaintType, getComplaintType, updateComplaintType } from '@/api/system/ComplainType';
|
||||
import { addActivity, getActivity, updateActivity } from '@/api/system/Activity';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
|
||||
|
||||
@@ -40,17 +52,21 @@ const router = useRouter();
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
'id': null,
|
||||
'name': '',
|
||||
'titile': '',
|
||||
'author': '',
|
||||
'content': '',
|
||||
'status': '0'
|
||||
});
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入投诉类型名称', trigger: 'blur' }]
|
||||
titile: [{ required: true, message: '请输入活动标题', trigger: 'blur' }],
|
||||
author: [{ required: true, message: '请输入作者', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
||||
};
|
||||
const userid = ref();
|
||||
|
||||
// ! 投诉 ====================================================================================================
|
||||
function init() {
|
||||
getComplaintType(userid.value).then((res) => {
|
||||
getActivity(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
@@ -69,12 +85,12 @@ const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
updateComplaintType(form.value).then(() => {
|
||||
updateActivity(form.value).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
handleBack();
|
||||
});
|
||||
} else {
|
||||
addComplaintType(form.value).then(() => {
|
||||
addActivity(form.value).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
handleBack();
|
||||
});
|
||||
@@ -86,7 +102,7 @@ const submitForm = () => {
|
||||
// 返回
|
||||
function handleBack() {
|
||||
router.push({
|
||||
path: '/repair/complaintType'
|
||||
path: '/repair/Activity'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -100,7 +116,7 @@ function handleBack() {
|
||||
flex: 1;
|
||||
|
||||
.formbox {
|
||||
width: 500px;
|
||||
width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
&:deep(div.el-step__head.is-process) {
|
||||
|
||||
Reference in New Issue
Block a user