更新投诉

This commit is contained in:
weipengfei 2023-09-23 17:49:07 +08:00
parent 24393cc887
commit 7a782102aa

View File

@ -1,130 +1,161 @@
<template> <template>
<div> <div>
<el-card class="!border-none mb-4" shadow="never"> <el-card class="!border-none mb-4" shadow="never">
<el-form <el-form class="mb-[-16px]" :model="queryParams" inline>
class="mb-[-16px]" <el-form-item label="公司" prop="company_id">
:model="queryParams" <el-input
inline class="w-[280px]"
> v-model="queryParams.company_id"
<el-form-item label="公司" prop="company_id"> clearable
<el-input class="w-[280px]" v-model="queryParams.company_id" clearable placeholder="请输入公司" /> placeholder="请输入公司"
</el-form-item> />
<el-form-item label="内容" prop="content"> </el-form-item>
<el-input class="w-[280px]" v-model="queryParams.content" clearable placeholder="请输入内容" /> <el-form-item label="内容" prop="content">
</el-form-item> <el-input
<el-form-item> class="w-[280px]"
<el-button type="primary" @click="resetPage">查询</el-button> v-model="queryParams.content"
<el-button @click="resetParams">重置</el-button> clearable
</el-form-item> placeholder="请输入内容"
</el-form> />
</el-card> </el-form-item>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['company_complaint_feedback/add']" type="primary" @click="handleAdd"> <el-form-item>
<template #icon> <el-button type="primary" @click="resetPage">查询</el-button>
<icon name="el-icon-Plus" /> <el-button @click="resetParams">重置</el-button>
</template> </el-form-item>
新增 </el-form>
</el-button> </el-card>
<el-button <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button
v-perms="['company_complaint_feedback/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['company_complaint_feedback/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column
label="id"
prop="id"
width="120"
show-overflow-tooltip
/>
<el-table-column
label="公司"
prop="company_id"
width="220"
show-overflow-tooltip
/>
<el-table-column label="内容" prop="content" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['company_complaint_feedback/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['company_complaint_feedback/delete']" v-perms="['company_complaint_feedback/delete']"
:disabled="!selectData.length" type="danger"
@click="handleDelete(selectData)" link
> @click="handleDelete(row.id)"
>
删除 删除
</el-button> </el-button>
<div class="mt-4"> </template>
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> </el-table-column>
<el-table-column type="selection" width="55" /> </el-table>
<el-table-column label="公司" prop="company_id" show-overflow-tooltip /> </div>
<el-table-column label="内容" prop="content" show-overflow-tooltip /> <div class="flex mt-4 justify-end">
<el-table-column label="操作" width="120" fixed="right"> <pagination v-model="pager" @change="getLists" />
<template #default="{ row }"> </div>
<el-button </el-card>
v-perms="['company_complaint_feedback/edit']" <edit-popup
type="primary" v-if="showEdit"
link ref="editRef"
@click="handleEdit(row)" :dict-data="dictData"
> @success="getLists"
编辑 @close="showEdit = false"
</el-button> />
<el-button </div>
v-perms="['company_complaint_feedback/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template> </template>
<script lang="ts" setup name="companyComplaintFeedbackLists"> <script lang="ts" setup name="companyComplaintFeedbackLists">
import { usePaging } from '@/hooks/usePaging' import { usePaging } from "@/hooks/usePaging";
import { useDictData } from '@/hooks/useDictOptions' import { useDictData } from "@/hooks/useDictOptions";
import { apiCompanyComplaintFeedbackLists, apiCompanyComplaintFeedbackDelete } from '@/api/company_complaint_feedback' import {
import { timeFormat } from '@/utils/util' apiCompanyComplaintFeedbackLists,
import feedback from '@/utils/feedback' apiCompanyComplaintFeedbackDelete,
import EditPopup from './edit.vue' } from "@/api/company_complaint_feedback";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>() const editRef = shallowRef<InstanceType<typeof EditPopup>>();
// //
const showEdit = ref(false) const showEdit = ref(false);
// //
const queryParams = reactive({ const queryParams = reactive({
company_id: '', company_id: "",
content: '', content: "",
}) });
// //
const selectData = ref<any[]>([]) const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id) selectData.value = val.map(({ id }) => id);
} };
// //
const { dictData } = useDictData('') const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCompanyComplaintFeedbackLists, fetchFun: apiCompanyComplaintFeedbackLists,
params: queryParams params: queryParams,
}) });
// //
const handleAdd = async () => { const handleAdd = async () => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('add') editRef.value?.open("add");
} };
// //
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('edit') editRef.value?.open("edit");
editRef.value?.setFormData(data) editRef.value?.setFormData(data);
} };
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await apiCompanyComplaintFeedbackDelete({ id }) await apiCompanyComplaintFeedbackDelete({ id });
getLists() getLists();
} };
getLists() getLists();
</script> </script>