完成投诉管理
This commit is contained in:
206
src/views/system/Complaint/complainMain.vue
Normal file
206
src/views/system/Complaint/complainMain.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div class="ResidentMainBox p-2 w-full">
|
||||
<PageHeader title="投诉详情"></PageHeader>
|
||||
<div class="ResidentMainBody">
|
||||
<!-- 投诉信息 -->
|
||||
<div class="mb-10">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>投诉信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="w-full h-full CarinfoBox">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">投诉类型</div>
|
||||
<div class="main">{{ form.type }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">问题描述</div>
|
||||
<div class="main">{{ form.problemDes }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">投诉人姓名</div>
|
||||
<div class="main">{{ form.complaintName }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">手机号码</div>
|
||||
<div class="main">{{ form.phone }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">投诉时间</div>
|
||||
<div class="main">{{ form.orderDate }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">处理状态</div>
|
||||
<div class="main">
|
||||
<DictTag :options="com_complaint_status" :value="form.status"></DictTag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<!-- 处理情况 -->
|
||||
<div class="mb-10">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>处理情况</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="formbox">
|
||||
<el-form ref="formRef" :rules="rules" class="m-auto" :inline="false" label-width="100px" :model="form">
|
||||
<el-form-item label="处理状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="(item, index) in com_complaint_status" :key="index" :value="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理人员" prop="handleId">
|
||||
<repairUser :userid="form.handleId" returnvalue="value" @change="handleChange"></repairUser>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理描述" prop="handleContent">
|
||||
<el-input type="textarea" :rows="5" v-model="form.handleContent"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import repairUser from '@/components/Holder/repairUser.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getComplaint, updateComplaint } from '@/api/system/Complaint';
|
||||
import { listComplaintType } from '@/api/system/ComplainType';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_complaint_status } = toRefs<any>(proxy?.useDict('com_complaint_status'));
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const form = ref({
|
||||
'id': null,
|
||||
'type': '',
|
||||
'typeId': null,
|
||||
'problemDes': '',
|
||||
'complaintName': '',
|
||||
'phone': '',
|
||||
'problemIamgeUrl': '',
|
||||
'status': '1', // 投诉状态 0待处理 1已处理
|
||||
'handleId': '',
|
||||
'handleName': '',
|
||||
'handleContent': ''
|
||||
});
|
||||
const rules = {
|
||||
status: [{ required: true, message: '选择投诉处理状态', trigger: 'blur' }]
|
||||
};
|
||||
const userid = ref();
|
||||
const complaintyTyplist = ref([]);
|
||||
// ! 投诉 ====================================================================================================
|
||||
async function init() {
|
||||
const res2 = await listComplaintType();
|
||||
getComplaint(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
console.log(form.value);
|
||||
const find = res2.rows.find((item) => item.id === form.value.typeId);
|
||||
if (find) {
|
||||
form.value.type = find.name;
|
||||
}
|
||||
console.log(form.value);
|
||||
});
|
||||
}
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
init();
|
||||
}
|
||||
|
||||
function handleChange(pop) {
|
||||
form.value.handleId = pop.userId;
|
||||
form.value.handleName = pop.nickName;
|
||||
}
|
||||
|
||||
// 提交
|
||||
|
||||
const formRef = ref();
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
updateComplaint(form.value).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
handleBack();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 返回
|
||||
function handleBack() {
|
||||
router.push({
|
||||
path: '/repair/complaint'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.ResidentMainBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.ResidentMainBody {
|
||||
margin-top: 20px;
|
||||
flex: 1;
|
||||
|
||||
.CarinfoBox {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(2, 1fr);
|
||||
gap: 20px;
|
||||
.carinfo_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.label {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.formbox {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
&:deep(div.el-step__head.is-process) {
|
||||
& > div.el-step__line {
|
||||
width: 0;
|
||||
border: 1px dashed gray;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
&:deep(.el-step.is-vertical .el-step__line) {
|
||||
top: 20px;
|
||||
}
|
||||
&:deep(div.el-step__head.is-finish) {
|
||||
& > div.el-step__line {
|
||||
width: 0;
|
||||
border: 1px solid var(--el-color-primary);
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user