6/22完善引入,
This commit is contained in:
@@ -11,50 +11,50 @@
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div class="CarinfoBox">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfoBox">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">投诉类型</div>
|
||||
<div class="main">{{ form.type }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">投诉人姓名</div>
|
||||
<div class="main">{{ form.complaintName }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">手机号码</div>
|
||||
<div class="main">{{ form.phone }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">投诉时间</div>
|
||||
<div class="main">{{ form.createTime }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">处理状态</div>
|
||||
<div class="main">
|
||||
<DictTag :options="com_complaint_status" :value="form.status"></DictTag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="CarinfoBox signle">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfoBox signLe">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">问题描述</div>
|
||||
<div class="main">{{ form.problemDes }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="CarinfoBox signle">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfoBox signLe">
|
||||
<div class="carInfo_item">
|
||||
<div class="label">问题照片</div>
|
||||
<div class="main">
|
||||
<el-image
|
||||
v-for="(item, index) in problemIamgeUrllist"
|
||||
v-for="(item, index) in problemImageUrlList"
|
||||
:key="index"
|
||||
:src="item"
|
||||
:preview-teleported="true"
|
||||
:preview-src-list="problemIamgeUrllist"
|
||||
:preview-src-list="problemImageUrlList"
|
||||
style="width: 120px; height: 120px; margin-right: 10px"
|
||||
></el-image>
|
||||
</div>
|
||||
@@ -71,7 +71,7 @@
|
||||
<span>处理情况</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="formbox">
|
||||
<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">
|
||||
@@ -103,11 +103,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import DictTag from '@/components/DictTag/index.vue';
|
||||
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';
|
||||
import { ResidentVO } from '@/api/system/resident/type';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_complaint_status } = toRefs<any>(proxy?.useDict('com_complaint_status'));
|
||||
|
||||
@@ -121,7 +123,7 @@ const form = ref({
|
||||
'problemDes': '',
|
||||
'complaintName': '',
|
||||
'phone': '',
|
||||
'problemIamgeUrl': '',
|
||||
'problemImageUrl': '',
|
||||
'status': '1', // 投诉状态 0待处理 1已处理
|
||||
'handleId': '',
|
||||
'handleName': '',
|
||||
@@ -133,7 +135,7 @@ const rules = {
|
||||
handleContent: [{ required: true, message: '投诉处理内容不能为空', trigger: 'blur' }]
|
||||
};
|
||||
const userid = ref();
|
||||
const problemIamgeUrllist = ref([]);
|
||||
const problemImageUrlList = ref([]);
|
||||
// ! 投诉 ====================================================================================================
|
||||
async function init() {
|
||||
const res2 = await listComplaintType();
|
||||
@@ -142,7 +144,7 @@ async function init() {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
problemIamgeUrllist.value = res.data.problemImageUrl ? res.data.problemImageUrl.split(',') : [];
|
||||
problemImageUrlList.value = res.data.problemImageUrl ? res.data.problemImageUrl.split(',') : [];
|
||||
form.value.status = '1';
|
||||
const find = res2.rows.find((item) => item.id === form.value.typeId);
|
||||
if (find) {
|
||||
@@ -156,8 +158,7 @@ if (route.query.id) {
|
||||
init();
|
||||
}
|
||||
|
||||
function handleChange(pop) {
|
||||
console.log(pop);
|
||||
function handleChange(pop: ResidentVO) {
|
||||
form.value.handleId = pop.userId;
|
||||
form.value.handleName = pop.nickName;
|
||||
}
|
||||
@@ -195,14 +196,14 @@ function handleBack() {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
|
||||
.CarinfoBox {
|
||||
.carInfoBox {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(2, 1fr);
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.carinfo_item {
|
||||
.carInfo_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.label {
|
||||
@@ -211,13 +212,13 @@ function handleBack() {
|
||||
}
|
||||
}
|
||||
|
||||
&.signle {
|
||||
&.signLe {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
grid-template-rows: repeat(1, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.formbox {
|
||||
.formBox {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<el-form ref="queryFormRef" label-width="120px" :model="queryParams" :inline="true">
|
||||
<el-form-item label="投诉类型" prop="typeId">
|
||||
<el-select v-model="queryParams.typeId" placeholder="请选择投诉类型" style="width: 240px">
|
||||
<el-option :disabled="item.status === '1'" v-for="item in complaintyTyplist" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option :disabled="item.status === '1'" v-for="item in complainTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="投诉人姓名" prop="complaintName">
|
||||
@@ -36,7 +36,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['complaint:complaint:query']">查看详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-has-permi="['complaint:complaint:query']">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -45,9 +45,8 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<!-- complaint -->
|
||||
<script setup name="Complaint" lang="ts">
|
||||
import { listComplaint, getComplaint, delComplaint, addComplaint, updateComplaint } from '@/api/system/Complaint/index';
|
||||
import { listComplaint } from '@/api/system/Complaint';
|
||||
import { ComplaintVO, ComplaintQuery, ComplaintForm } from '@/api/system/Complaint/type';
|
||||
import { listComplaintType } from '@/api/system/ComplainType';
|
||||
|
||||
@@ -55,7 +54,6 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_complaint_status } = toRefs<any>(proxy?.useDict('com_complaint_status'));
|
||||
|
||||
const complaintList = ref<ComplaintVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
@@ -64,12 +62,6 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const complaintFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: ComplaintForm = {
|
||||
id: undefined,
|
||||
@@ -77,7 +69,7 @@ const initFormData: ComplaintForm = {
|
||||
problemDes: undefined,
|
||||
complaintName: undefined,
|
||||
phone: undefined,
|
||||
problemIamgeUrl: undefined,
|
||||
problemImageUrl: undefined,
|
||||
status: undefined,
|
||||
handleId: undefined,
|
||||
handleName: undefined,
|
||||
@@ -92,26 +84,25 @@ const data = reactive<PageData<ComplaintForm, ComplaintQuery>>({
|
||||
problemDes: undefined,
|
||||
complaintName: undefined,
|
||||
phone: undefined,
|
||||
problemIamgeUrl: undefined,
|
||||
problemImageUrl: undefined,
|
||||
status: undefined,
|
||||
handleId: undefined,
|
||||
handleName: undefined,
|
||||
handleContent: undefined,
|
||||
params: {}
|
||||
handleContent: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '投诉管理表id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
const complaintyTyplist = ref([]);
|
||||
const complainTypeList = ref([]);
|
||||
/** 查询投诉管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res2 = await listComplaintType();
|
||||
complaintyTyplist.value = res2.rows;
|
||||
complainTypeList.value = res2.rows;
|
||||
listComplaint(queryParams.value)
|
||||
.then((res) => {
|
||||
complaintList.value = res.rows;
|
||||
@@ -143,7 +134,7 @@ const handleSelectionChange = (selection: ComplaintVO[]) => {
|
||||
|
||||
const router = useRouter();
|
||||
/** 详情按钮操作 */
|
||||
const handleUpdate = async (row?: ComplaintVO) => {
|
||||
const handleUpdate = (row?: ComplaintVO) => {
|
||||
router.push({
|
||||
path: '/repair/complainMain',
|
||||
query: {
|
||||
@@ -152,43 +143,6 @@ const handleUpdate = async (row?: ComplaintVO) => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
complaintFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateComplaint(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addComplaint(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ComplaintVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
||||
await delComplaint(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'complaint/complaint/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`complaint_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user