公告,活动,投诉接口对接完成
This commit is contained in:
187
src/views/system/Decoration/index.vue
Normal file
187
src/views/system/Decoration/index.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<Pageheader title="装修管理"></Pageheader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form label-width="120px" ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="申请人姓名" prop="applyName">
|
||||
<el-input v-model="queryParams.applyName" placeholder="请输入申请人姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装修验收结果" prop="inspectionResult">
|
||||
<el-select v-model="queryParams.typeId" placeholder="请选择装修验收结果" style="width: 240px">
|
||||
<el-option v-for="item in com_decoration_status" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['decoration:decoration:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['decoration:decoration:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['decoration:decoration:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="decorationList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="所属小区" align="center" prop="villageId" />
|
||||
<el-table-column label="所属房屋" align="center" prop="houseId" />
|
||||
<el-table-column label="申请人姓名" align="center" prop="applyName" />
|
||||
<el-table-column label="装修公司" align="center" prop="decorationCompany" />
|
||||
<el-table-column label="装修内容" align="center" prop="decorationContent" />
|
||||
<el-table-column label="装修押金" align="center" prop="decorationDeposit" />
|
||||
<el-table-column label="装修验收结果" align="center" prop="inspectionResult">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_decoration_status" :value="scope.row.inspectionResult"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center" prop="inspectionName" />
|
||||
<el-table-column label="验收人" align="center" prop="inspectionName" />
|
||||
<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="['decoration:decoration:edit']">验收</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['decoration:decoration:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Decoration" lang="ts">
|
||||
import { listDecoration, delDecoration } from '@/api/system/Decoration/index';
|
||||
import { DecorationVO, DecorationQuery, DecorationForm } from '@/api/system/Decoration/type';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_decoration_status } = toRefs<any>(proxy?.useDict('com_decoration_status'));
|
||||
|
||||
const decorationList = ref<DecorationVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const decorationFormRef = ref<ElFormInstance>();
|
||||
|
||||
const initFormData: DecorationForm = {
|
||||
id: undefined,
|
||||
villageId: undefined,
|
||||
houseId: undefined,
|
||||
applyName: undefined,
|
||||
decorationCompany: undefined,
|
||||
decorationContent: undefined,
|
||||
decorationDeposit: undefined,
|
||||
inspectionResult: undefined,
|
||||
remark: undefined,
|
||||
inspectionName: undefined
|
||||
};
|
||||
const data = reactive<PageData<DecorationForm, DecorationQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
villageId: undefined,
|
||||
houseId: undefined,
|
||||
applyName: undefined,
|
||||
decorationCompany: undefined,
|
||||
decorationContent: undefined,
|
||||
decorationDeposit: undefined,
|
||||
inspectionResult: undefined,
|
||||
inspectionName: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '装修管理表id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询装修管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDecoration(queryParams.value);
|
||||
decorationList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DecorationVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
path: '/repair/addDecoration'
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DecorationVO) => {
|
||||
router.push({
|
||||
path: '/repair/addDecoration',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DecorationVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
||||
await delDecoration(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user