大客流信息概览界面UI调整
This commit is contained in:
parent
9036bb3b6b
commit
f2f1ef582e
|
|
@ -0,0 +1,564 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="学员" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.noticeTitle"
|
||||
placeholder="请输入学员"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="考生资料类型" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="考生资料类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查时间" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="检查时间"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查状态" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="检查状态"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="状态"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否必须" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="是否必须"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" size="mini" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
size="mini"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="noticeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="学员"
|
||||
align="center"
|
||||
prop="noticeTitle"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="考生资料类型"
|
||||
align="center"
|
||||
prop="noticeType"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:options="dict.sys_notice_type"
|
||||
:value="scope.row.noticeType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
width="160"
|
||||
>
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:options="dict.sys_notice_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查时间"
|
||||
align="center"
|
||||
prop="createBy"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="uplate(scope.row)"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>上传</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="jiancha(scope.row)"
|
||||
v-hasPermi="['system:notice: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-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名或考试" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="请输入报名或考试"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级或个人" prop="noticeType">
|
||||
<el-select
|
||||
v-model="form.noticeType"
|
||||
placeholder="请选择班级或个人"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考试类型" prop="noticeTitle">
|
||||
<el-input v-model="form.noticeTitle" placeholder="考试类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位类别" prop="noticeType">
|
||||
<el-select v-model="form.noticeType" placeholder="岗位类别">
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="资料类型" prop="noticeTitle">
|
||||
<el-input v-model="form.noticeTitle" placeholder="资料类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否必须" prop="noticeType">
|
||||
<el-select v-model="form.noticeType" placeholder="是否必须">
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="序号" prop="noticeTitle">
|
||||
<el-input v-model="form.noticeTitle" placeholder="序号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="资料要求描述" prop="noticeType">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="资料要求描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 检查对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-model="jianchaOpen"
|
||||
width="480px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查状态" prop="noticeTitle">
|
||||
<el-radio-group v-model="Cradio">
|
||||
<el-radio :value="0">通过</el-radio>
|
||||
<el-radio :value="1">未通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查描述" prop="noticeType">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="检查描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="jianchaOpen = false"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="jianchaOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 上传的弹窗 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-model="uplateopen"
|
||||
width="480px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="学员" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="学员"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证号码" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="身份证号码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="考生资料类型" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="考生资料类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查状态" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="检查状态"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查时间" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="检查时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="状态"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="是否必须" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="是否必须"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="资料" prop="noticeType">
|
||||
<el-input
|
||||
v-model="form.noticeTitle"
|
||||
placeholder="资料"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="uplateopen = false"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="uplateopen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import {
|
||||
listNotice,
|
||||
getNotice,
|
||||
delNotice,
|
||||
addNotice,
|
||||
updateNotice,
|
||||
} from "@/api/system/notice";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 字典数据
|
||||
const dict = {
|
||||
sys_notice_status: [],
|
||||
sys_notice_type: [],
|
||||
};
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const noticeList = ref([]);
|
||||
const title = ref("");
|
||||
const open = ref(false);
|
||||
const jianchaOpen = ref(false);
|
||||
const uplateopen = ref(false);
|
||||
const Cradio = ref(0);
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
});
|
||||
|
||||
const form = reactive({
|
||||
noticeId: undefined,
|
||||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0",
|
||||
});
|
||||
|
||||
const rules = reactive({
|
||||
noticeTitle: [
|
||||
{ required: true, message: "公告标题不能为空", trigger: "blur" },
|
||||
],
|
||||
noticeType: [
|
||||
{ required: true, message: "公告类型不能为空", trigger: "change" },
|
||||
],
|
||||
});
|
||||
|
||||
// 表单引用
|
||||
const queryForm = ref(null);
|
||||
const formRef = ref(null);
|
||||
|
||||
// 方法
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
listNotice(queryParams).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
open.value = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
form.noticeId = undefined;
|
||||
form.noticeTitle = undefined;
|
||||
form.noticeType = undefined;
|
||||
form.noticeContent = undefined;
|
||||
form.status = "0";
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
};
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const resetQuery = () => {
|
||||
if (queryForm.value) {
|
||||
queryForm.value.resetFields();
|
||||
}
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (selection) => {
|
||||
ids.value = selection.map((item) => item.noticeId);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加资料模板";
|
||||
};
|
||||
|
||||
const handleUpdate = (row) => {
|
||||
reset();
|
||||
const noticeId = row.noticeId || ids.value;
|
||||
getNotice(noticeId).then((response) => {
|
||||
Object.assign(form, response.data);
|
||||
open.value = true;
|
||||
title.value = "修改公告";
|
||||
});
|
||||
};
|
||||
|
||||
const jiancha = (row) => {
|
||||
jianchaOpen.value = true;
|
||||
};
|
||||
const uplate = (row) => {
|
||||
uplateopen.value = true
|
||||
}
|
||||
const submitForm = () => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.noticeId != undefined) {
|
||||
updateNotice(form).then((response) => {
|
||||
ElMessage.success("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addNotice(form).then((response) => {
|
||||
ElMessage.success("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
const noticeIds = row.noticeId || ids.value;
|
||||
ElMessageBox.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
|
||||
.then(() => {
|
||||
return delNotice(noticeIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue