12309
This commit is contained in:
parent
6628970dde
commit
d703bd2a4a
@ -1,51 +1,87 @@
|
||||
import request from '@/utils/request'
|
||||
import { parseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询 列表
|
||||
export function BAApplyList(data,query) {
|
||||
return request({
|
||||
url: '/bussiness/Apply/list',
|
||||
method: 'post',
|
||||
params: query,
|
||||
data: data,
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
// 查询详情
|
||||
export function getBAApplyInfo(query) {
|
||||
return request({
|
||||
url: '/bussiness/Apply/info?id=' + query,
|
||||
method: 'get',
|
||||
// params: query
|
||||
})
|
||||
// 获取列表数据
|
||||
export const getVisitList = (data, params) => {
|
||||
return request({
|
||||
url: '/visiting/visit/list',
|
||||
method: 'post',
|
||||
params,
|
||||
data,
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
|
||||
export function createBAApply(data) {
|
||||
return request({
|
||||
url: '/bussiness/Apply/add',
|
||||
method: 'post',
|
||||
data: data,
|
||||
isEncrypt: false
|
||||
})
|
||||
// 新增访问记录
|
||||
export const addVisit = (data) => {
|
||||
return request({
|
||||
url: '/visiting/visit/add',
|
||||
method: 'post',
|
||||
data,
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function editBAApply(data) {
|
||||
return request({
|
||||
url: '/bussiness/Apply/edit',
|
||||
method: 'post',
|
||||
data: data,
|
||||
isEncrypt: false
|
||||
})
|
||||
// 获取访问详情
|
||||
export const getVisitInfo = (id) => {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/visiting/visit/info',
|
||||
params: {
|
||||
id: id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteBAApply(id) {
|
||||
return request({
|
||||
url: '/bussiness/Apply/remove?ids=' + id,
|
||||
method: 'post',
|
||||
isEncrypt: false
|
||||
})
|
||||
// 更新访问内容
|
||||
export const updateVisit = (data) => {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/visiting/visit/edit',
|
||||
data: data,
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消访问记录
|
||||
export const deleteVisit = (id) => {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/visiting/visit/remove',
|
||||
params: {
|
||||
ids: id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取来访登记列表
|
||||
export const getRegisterList = () => {
|
||||
return request({
|
||||
url: '/visiting/visit/list_register_visitors',
|
||||
method: 'get',
|
||||
params: {
|
||||
// since: dayjs().format('YYYY-MM-DD')
|
||||
since: '2024-12-24'
|
||||
},
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
// 获取历史上访列表
|
||||
export const getHistoryList = (code) => {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/visiting/visit/list_visitor_history',
|
||||
params: {
|
||||
id_card: code
|
||||
},
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
// 导出访问记录
|
||||
export const exportVisit = () => {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/visiting/visit/export'
|
||||
})
|
||||
}
|
@ -38,7 +38,8 @@ export function addMenu(data) {
|
||||
return request({
|
||||
url: '/system/menu',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data,
|
||||
isEncrypt:false
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name:'DividerHeader'
|
||||
})
|
||||
const {title} = defineProps(['title'])
|
||||
</script>
|
||||
|
||||
|
@ -1,249 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 表单区域 -->
|
||||
<el-form ref="queryParamsRef" :inline="true" :model="queryParams">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="相关领域">
|
||||
<el-select v-model="queryParams.casetype" style="width: 15vw;" @change="getLists" clearable>
|
||||
<el-option
|
||||
v-for="item in nj_anjian_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="来访类别">
|
||||
<el-select v-model="queryParams.casetype" style="width: 15vw;" @change="getLists" clearable>
|
||||
<el-option
|
||||
v-for="item in nj_anjian_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="级别">
|
||||
<el-select v-model="queryParams.casetype" style="width: 15vw;" @change="getLists" clearable>
|
||||
<el-option
|
||||
v-for="item in nj_anjian_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getLists">
|
||||
<el-icon class="me-1">
|
||||
<Search />
|
||||
</el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleRest(queryParamsRef)">
|
||||
<el-icon class="me-1">
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider class="mt-0" />
|
||||
|
||||
<el-row class="mb-3" :gutter="10">
|
||||
<el-col :span="1.5">
|
||||
<el-space>
|
||||
<el-button plain type="primary" @click="AddEditRegistVisitRef.showAddCase()">
|
||||
<el-icon class="me-2">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</el-space>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="uploadRef.showupload()">导入</el-button>
|
||||
<Upload ref="uploadRef" @getList="getLists" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<el-table
|
||||
ref="CaseTableRef"
|
||||
v-loading="loading"
|
||||
:data="CaseTables"
|
||||
@row-dblclick="handleRowDblClick"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<el-table-column label="日期" prop="name" />
|
||||
<el-table-column label="上访人" prop="name" />
|
||||
<el-table-column label="电话" prop="casetype" />
|
||||
<el-table-column label="身份证号码" prop="unitname" />
|
||||
<el-table-column label="反映事项" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="nj_anjian_status" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否重点对象" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="nj_anjian_status" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="级别" prop="state" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="nj_anjian_status" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理情况" prop="depname"/>
|
||||
<el-table-column fixed="right" align="center" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<!-- <el-button link size="small" type="warning">
|
||||
<el-icon class="me-1">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
上访人管理
|
||||
</el-button> -->
|
||||
<el-button link size="small" type="primary" @click="AddEditRegistVisitRef.showEditCase(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<Edit />
|
||||
</el-icon>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link size="small" type="warning" @click="AddEditRegistVisitRef.showEditCase(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<Edit />
|
||||
</el-icon>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link size="small" type="danger" @click="deleteCase(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<Delete />
|
||||
</el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="paging.pageNum"
|
||||
v-model:limit="paging.pageSize"
|
||||
@pagination="getLists"
|
||||
/>
|
||||
<AddEditRegistVisit ref="AddEditRegistVisitRef" @getList="getLists" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import AddEditRegistVisit from "./components/AddEditRegistVisit.vue";
|
||||
import Upload from "./components/upload.vue"; // 引入上传组件
|
||||
import { getCurrentInstance } from "vue";
|
||||
|
||||
import PageEnum from "@/enum/PageEnum.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { nj_anjian_type, nj_anjian_status } = proxy.useDict("nj_anjian_type", "nj_anjian_status");
|
||||
|
||||
const isShow = ref(true);
|
||||
const queryParamsRef = ref();
|
||||
const deleteStatus = ref(true);
|
||||
const AddEditRegistVisitRef = ref();
|
||||
const uploadRef = ref();
|
||||
const upload = ref({});
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
const paging = ref({
|
||||
pageNum: 1,
|
||||
pageSize: PageEnum.SIZE,
|
||||
});
|
||||
const queryParams = ref({
|
||||
name: "",
|
||||
casecode: "",
|
||||
brief: "",
|
||||
state: "1,2",
|
||||
});
|
||||
|
||||
const total = ref(0);
|
||||
const CaseTables = ref([
|
||||
{
|
||||
name: "1",
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
getLists();
|
||||
});
|
||||
|
||||
// 获取案件列表
|
||||
const getLists = async () => {
|
||||
// loading.value = true
|
||||
// await getCaseInfoList(queryParams.value, paging.value).then(res => {
|
||||
// CaseTables.value = res.rows
|
||||
// total.value = res.total
|
||||
// loading.value = false
|
||||
// })
|
||||
};
|
||||
|
||||
// 双击行时的事件处理函数
|
||||
const handleRowDblClick = (row) => {
|
||||
console.log("双击的行数据:", row);
|
||||
AddEditRegistVisitRef.value.showAddCase(row)
|
||||
// 在这里可以进行进一步的处理,比如打开编辑框或查看详情等
|
||||
};
|
||||
|
||||
const deleteCase = async (row) => {
|
||||
ElMessageBox.confirm("确定删除?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
// deleteCaseInfo(row.caseCaseinfoId).then((res) => {
|
||||
// getLists();
|
||||
// });
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
// proxy.download("system/user/export", {
|
||||
// ...queryParams.value,
|
||||
// }, `user_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
// 重置搜索调解
|
||||
const handleRest = (formEl) => {
|
||||
queryParams.value = {
|
||||
name: "",
|
||||
casecode: "",
|
||||
brief: "",
|
||||
state: "1,2",
|
||||
};
|
||||
getLists();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="isShow"
|
||||
title="来访登记"
|
||||
:destroy-on-close="true"
|
||||
size="50%"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<template
|
||||
v-if="showRegistrationList"
|
||||
>
|
||||
<el-button type="primary" @click="showFormHandle">新增来访登记</el-button>
|
||||
<div class="el-collapse">
|
||||
<div class="items" v-for="item in registerList" :key="item.jwCheckinloginId">
|
||||
<span>{{ item.name }} - {{ item.sfzId }}</span>
|
||||
<div>
|
||||
<el-button :icon="ArrowRight" circle @click="carryHandle(item)"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="queryParamsRef"
|
||||
:model="queryParams"
|
||||
label-width="auto"
|
||||
label-position="left"
|
||||
require-asterisk-position="right"
|
||||
:rules="rules"
|
||||
:disabled="isView"
|
||||
v-if="showRegistration"
|
||||
>
|
||||
<DividerHeader title="基本信息"/>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" required prop="visitorName">
|
||||
<el-input placeholder="请填写上访人姓名" v-model="queryParams.visitorName"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上访时间">
|
||||
<el-date-picker
|
||||
v-model="queryParams.visitTime"
|
||||
type="datetime"
|
||||
placeholder="请选择上访时间"
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话">
|
||||
<el-input placeholder="请填写上访人电话号码" v-model="queryParams.visitorMobile"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作单位或住址">
|
||||
<el-input placeholder="请填写上访人工作单位或住址" v-model="queryParams.visitorContact"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="19">
|
||||
<el-form-item label="身份证号码">
|
||||
<el-input
|
||||
placeholder="请填写上访人身份证号码"
|
||||
v-model="queryParams.visitorCode"
|
||||
type="number"
|
||||
@change="idCardChangeHandle"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<!-- @click="visitHistoryRef.showVisitHistory(queryForm.sfzId)" -->
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="viewHistoryDisable"
|
||||
@click="visitHistoryRef.showVisitHistory(queryParams.visitorCode)"
|
||||
>
|
||||
历史信访记录
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<DividerHeader title="上访情况"/>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="来访类型" required prop="type">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择来访类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in visit_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12"></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="反映事项" required label-position="top" prop="demand">
|
||||
<el-input
|
||||
placeholder="请填写反映事项"
|
||||
type="textarea"
|
||||
v-model="queryParams.demand"
|
||||
:autosize="{ minRows: 3, maxRows: 9999 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="答复口径" required label-position="top" prop="reply">
|
||||
<el-input
|
||||
placeholder="请填写答复口径"
|
||||
type="textarea"
|
||||
v-model="queryParams.reply"
|
||||
:autosize="{ minRows: 3, maxRows: 9999 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="相关领域" label-position="top">
|
||||
<el-select
|
||||
v-model="queryParams.field"
|
||||
placeholder="请选择领域"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in visit_field"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="答复形式" label-position="top">
|
||||
<el-select
|
||||
v-model="queryParams.replyType"
|
||||
placeholder="请选择答复形式"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in visit_reply_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否重点人员" label-position="top">
|
||||
<el-radio-group v-model="queryParams.isKeyPerson">
|
||||
<el-radio-button
|
||||
v-for="item in boolean_yes_no"
|
||||
:value="item.value"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="级别" label-position="top">
|
||||
<el-select
|
||||
v-model="queryParams.level"
|
||||
placeholder="请选择来访级别"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in visit_level"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="updateHandle(queryParamsRef)" v-if="isEdit">提交</el-button>
|
||||
<el-button type="primary" @click="createHandle(queryParamsRef)" v-if="isCreate">提交</el-button>
|
||||
<el-button @click="changeShowStatus">关闭</el-button>
|
||||
</template>
|
||||
</el-drawer>
|
||||
|
||||
<VisitHistory ref="visitHistoryRef"/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance, useTemplateRef} from 'vue';
|
||||
import {addVisit, getRegisterList, getVisitInfo, updateVisit} from '@/api/RegistVisitApi/RegistVisitApi.js';
|
||||
import dayjs from 'dayjs';
|
||||
import DividerHeader from '@/components/DividerHeader/DividerHeader.vue';
|
||||
import {ArrowRight} from '@element-plus/icons-vue';
|
||||
import VisitHistory from '@/views/PoliceWork/RegisterVisit/components/VisitHistory.vue';
|
||||
|
||||
defineOptions({
|
||||
name: 'AddEditRegisterVisit'
|
||||
})
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
const {
|
||||
boolean_yes_no,
|
||||
visit_level,
|
||||
visit_reply_type,
|
||||
visit_field,
|
||||
visit_type,
|
||||
} = proxy.useDict('boolean_yes_no', 'visit_level', 'visit_field', 'visit_type', 'visit_reply_type')
|
||||
|
||||
const emit = defineEmits(['refresh'])
|
||||
|
||||
const queryParamsRef = useTemplateRef('queryParamsRef')
|
||||
const visitHistoryRef = useTemplateRef('visitHistoryRef')
|
||||
|
||||
const isShow = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const isView = ref(false)
|
||||
const isCreate = ref(false)
|
||||
const showRegistrationList = ref(true)
|
||||
const showRegistration = ref(false)
|
||||
|
||||
// 控制查看历史数据按钮状态
|
||||
const viewHistoryDisable = ref(true)
|
||||
|
||||
const defaultParams = {
|
||||
// 姓名
|
||||
visitorName: '',
|
||||
// 上访时间
|
||||
visitTime: '',
|
||||
// 电话
|
||||
visitorMobile: '',
|
||||
// 工作单位或住址
|
||||
visitorContact: '',
|
||||
// 身份证号码
|
||||
visitorCode: '',
|
||||
// 反映事项
|
||||
demand: '',
|
||||
// 来访类型
|
||||
type: '',
|
||||
// 相关领域
|
||||
field: '',
|
||||
// 答复口径
|
||||
reply: '',
|
||||
// 答复形式
|
||||
replyType: '',
|
||||
// 是否重点人员
|
||||
isKeyPerson: '1',
|
||||
// 级别
|
||||
level: ''
|
||||
}
|
||||
const queryParams = ref({...defaultParams})
|
||||
const registerList = ref([])
|
||||
|
||||
const rules = reactive({
|
||||
visitorName: [{required: true, message: '请填写来访人姓名', trigger: 'blur'}],
|
||||
type: [{required: true, message: '请填写电话', trigger: 'blur'}],
|
||||
demand: {required: true, message: '请填写反映事项', trigger: 'blur'},
|
||||
reply: {required: true, message: '请填写答复口径', trigger: 'blur'}
|
||||
})
|
||||
|
||||
// 变更显示状态
|
||||
const changeShowStatus = () => {
|
||||
isShow.value = !isShow.value
|
||||
if (!isShow.value) {
|
||||
queryParams.value = {...defaultParams}
|
||||
isEdit.value = false;
|
||||
isView.value = false;
|
||||
isCreate.value = false;
|
||||
showRegistrationList.value = true;
|
||||
showRegistration.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 显示新增来访登记抽屉
|
||||
const showAddRegisterVisit = async () => {
|
||||
changeShowStatus()
|
||||
await getRegisterVisitList()
|
||||
}
|
||||
|
||||
// 显示编辑来访登记抽屉
|
||||
const showEditRegisterVisit = async (row) => {
|
||||
changeShowStatus()
|
||||
showRegistrationList.value = false;
|
||||
showRegistration.value = true;
|
||||
isEdit.value = true;
|
||||
await getDetail(row)
|
||||
}
|
||||
|
||||
// 显示详情
|
||||
const showDetail = async (row) => {
|
||||
changeShowStatus()
|
||||
showRegistrationList.value = false;
|
||||
showRegistration.value = true;
|
||||
isView.value = true;
|
||||
await getDetail(row)
|
||||
}
|
||||
defineExpose({showAddRegisterVisit, showEditRegisterVisit, showDetail})
|
||||
|
||||
const showFormHandle = () => {
|
||||
isCreate.value = true;
|
||||
showRegistrationList.value = false;
|
||||
showRegistration.value = true;
|
||||
}
|
||||
|
||||
const carryHandle = (row) => {
|
||||
isCreate.value = true;
|
||||
showRegistrationList.value = false;
|
||||
showRegistration.value = true;
|
||||
queryParams.value = {
|
||||
...queryParams.value,
|
||||
visitorName: row.name,
|
||||
visitorCode: row.sfzId,
|
||||
visitTime: dayjs().format('YYYY-MM-DD hh:mm:ss'),
|
||||
visitorContact: row.address
|
||||
}
|
||||
idCardChangeHandle(row.sfzId)
|
||||
}
|
||||
|
||||
// 获取来访登记列表
|
||||
const getRegisterVisitList = async () => {
|
||||
const res = await getRegisterList()
|
||||
registerList.value = res.data
|
||||
console.log(res.data)
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const getDetail = async (row) => {
|
||||
const res = await getVisitInfo(row.visitId)
|
||||
queryParams.value = res.data;
|
||||
queryParams.value.visitTime = dayjs(res.data.visitTime).format('YYYY-MM-DD hh:mm:ss')
|
||||
idCardChangeHandle(res.data.visitorCode)
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
// 新增来访登记
|
||||
const createHandle = async (elForm) => {
|
||||
if (!elForm) return
|
||||
await elForm.validate(async (valid, fields) => {
|
||||
if (valid) {
|
||||
await addVisit(queryParams.value)
|
||||
changeShowStatus()
|
||||
emit('refresh')
|
||||
console.log(queryParams.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 修改来访登记
|
||||
const updateHandle = async (elForm) => {
|
||||
if (!elForm) return
|
||||
await elForm.validate(async (valid, fields) => {
|
||||
if (valid) {
|
||||
await updateVisit(queryParams.value)
|
||||
changeShowStatus()
|
||||
emit('refresh')
|
||||
console.log(queryParams.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 身份证输入框失去焦点后的事件
|
||||
const idCardChangeHandle = (value) => {
|
||||
viewHistoryDisable.value = !value;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-collapse {
|
||||
.items {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid var(--el-collapse-border-color);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="isShow"
|
||||
title="历史上访记录"
|
||||
:destroy-on-close="true"
|
||||
size="50%"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table-column label="接待场所" prop="policeareaId" width="180"/>
|
||||
<el-table-column label="执勤法警" prop="adduserId" width="180"/>
|
||||
<el-table-column label="来访人" prop="name" width="180"/>
|
||||
<el-table-column label="来访日期" prop="checkintime" width="180"/>
|
||||
<el-table-column label="信访情况" prop="checkininfo" width="180"/>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="changeShowStatus">关闭</el-button>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getHistoryList} from '@/api/RegistVisitApi/RegistVisitApi.js';
|
||||
|
||||
defineOptions({
|
||||
name: 'VisitHistory'
|
||||
})
|
||||
|
||||
const isShow = ref(false);
|
||||
const loading = ref(false)
|
||||
|
||||
const visitorCode = ref('')
|
||||
const tableData = ref([])
|
||||
// 变更显示状态
|
||||
const changeShowStatus = () => {
|
||||
isShow.value = !isShow.value
|
||||
if (!isShow.value) {
|
||||
visitorCode.value = '';
|
||||
tableData.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
const showVisitHistory = async (code) => {
|
||||
changeShowStatus()
|
||||
visitorCode.value = code;
|
||||
const res = await getHistoryList(code)
|
||||
console.log(res)
|
||||
tableData.value = res.data
|
||||
}
|
||||
|
||||
defineExpose({showVisitHistory});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<el-dialog :title="upload.title" v-model="isShow" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
@ -9,21 +10,22 @@
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
name="importFile"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled />
|
||||
<upload-filled/>
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<div class="el-upload__tip">
|
||||
<el-checkbox v-model="upload.updateSupport" />
|
||||
是否更新已经存在的用户数据
|
||||
</div>
|
||||
<!-- <div class="el-upload__tip">-->
|
||||
<!-- <el-checkbox v-model="upload.updateSupport"/>-->
|
||||
<!-- 是否更新已经存在的用户数据-->
|
||||
<!-- </div>-->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板
|
||||
@click="importTemplate">下载模板
|
||||
</el-link>
|
||||
</div>
|
||||
</template>
|
||||
@ -38,14 +40,20 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref, defineProps} from 'vue';
|
||||
import {getCurrentInstance, ref} from 'vue';
|
||||
import {getToken} from '@/utils/auth.js';
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
const emit = defineEmits(['refresh'])
|
||||
const uploadRef = ref('')
|
||||
|
||||
const isShow = ref(false); // 控制弹窗显示/隐藏
|
||||
const fileList = ref([])
|
||||
const upload = ref({
|
||||
title: '用户导入',
|
||||
url: 'upload_url_here', // 文件上传的API接口
|
||||
url: import.meta.env.VITE_APP_BASE_API + '/visiting/visit/import', // 文件上传的API接口
|
||||
isUploading: false,
|
||||
headers: {}, // 如果需要传递额外的headers
|
||||
headers: {Authorization: 'Bearer ' + getToken()}, // 如果需要传递额外的headers
|
||||
updateSupport: false, // 更新现有用户
|
||||
});
|
||||
const TemplateDownUrl = ref('/导入模版.xlsx'); // 控制弹窗显示/隐藏
|
||||
@ -59,23 +67,27 @@ const showupload = () => {
|
||||
defineExpose({showupload})
|
||||
// 提交上传的表单
|
||||
const submitFileForm = () => {
|
||||
console.log("提交文件...");
|
||||
console.log('提交文件...');
|
||||
// 上传逻辑:你可以在这里触发上传文件的逻辑
|
||||
proxy.$refs['uploadRef'].submit();
|
||||
isShow.value = false; // 上传后关闭弹窗
|
||||
};
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
window.open(TemplateDownUrl.value, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
// 进度回调
|
||||
const handleFileUploadProgress = (progressEvent) => {
|
||||
console.log("上传进度:", progressEvent);
|
||||
console.log('上传进度:', progressEvent);
|
||||
};
|
||||
|
||||
// 上传成功的回调
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
console.log("上传成功:", response);
|
||||
console.log('上传成功:', response);
|
||||
// 上传成功后,可以触发父组件的事件来刷新数据
|
||||
emit('getList');
|
||||
proxy.$refs['uploadRef'].handleRemove(file);
|
||||
emit('refresh');
|
||||
};
|
||||
</script>
|
164
src/views/PoliceWork/RegisterVisit/index.vue
Normal file
164
src/views/PoliceWork/RegisterVisit/index.vue
Normal file
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-row class="mb-3">
|
||||
<el-col :span="24">
|
||||
<el-space>
|
||||
<el-button type="primary" plain @click="AddEditRegisterVisitRef.showAddRegisterVisit()">
|
||||
<el-icon class="me-2">
|
||||
<Plus/>
|
||||
</el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="warning" plain @click="handleExport()">
|
||||
<el-icon class="me-2">
|
||||
<Download/>
|
||||
</el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
<el-button type="info" plain @click="uploadRef.showupload()">
|
||||
<el-icon class="me-2">
|
||||
<Upload/>
|
||||
</el-icon>
|
||||
导入
|
||||
</el-button>
|
||||
<upload ref="uploadRef" @refresh="getLists" />
|
||||
</el-space>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<el-table
|
||||
ref="tableDataRef"
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<el-table-column label="日期" prop="visitTime" width="230">
|
||||
<template #default="scope">
|
||||
{{ dayjs(scope.row.visitTime).format('YYYY-MM-DD hh:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上访人" prop="visitorName" width="150"/>
|
||||
<el-table-column label="电话" prop="visitorMobile" width="200"/>
|
||||
<el-table-column label="工作单位或住址" prop="visitorContact" width="230"/>
|
||||
<el-table-column label="身份证号码" prop="visitorCode" width="230"/>
|
||||
<el-table-column label="反映事项" prop="demand" width="230"/>
|
||||
<el-table-column label="历史信访" prop="state" width="230"/>
|
||||
<el-table-column label="处理情况" prop="reply" width="230"/>
|
||||
<el-table-column label="答复形式" prop="replyType" width="230">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="visit_reply_type" :value="scope.row.replyType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" width="230"/>
|
||||
<el-table-column fixed="right" align="center" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" type="primary"
|
||||
@click="AddEditRegisterVisitRef.showEditRegisterVisit(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<Edit/>
|
||||
</el-icon>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link size="small" type="warning"
|
||||
@click="AddEditRegisterVisitRef.showDetail(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<View/>
|
||||
</el-icon>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link size="small" type="danger" @click="deleteHandle(scope.row)">
|
||||
<el-icon class="me-1">
|
||||
<Delete/>
|
||||
</el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="paging.pageNum"
|
||||
v-model:limit="paging.pageSize"
|
||||
@pagination="getLists"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AddEditRegisterVisit ref="AddEditRegisterVisitRef" @refresh="getLists"/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance, useTemplateRef} from 'vue';
|
||||
import PageEnum from '@/enum/PageEnum.js';
|
||||
import {ElMessageBox} from 'element-plus';
|
||||
import AddEditRegisterVisit from '@/views/PoliceWork/RegisterVisit/components/AddEditRegisterVisit.vue';
|
||||
import {deleteVisit, exportVisit, getVisitList} from '@/api/RegistVisitApi/RegistVisitApi.js';
|
||||
import DictTag from '@/components/DictTag/index.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import Upload from '@/views/PoliceWork/RegisterVisit/components/upload.vue';
|
||||
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
const {visit_reply_type} = proxy.useDict('visit_reply_type');
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
const paging = ref({
|
||||
pageNum: 1,
|
||||
pageSize: PageEnum.SIZE,
|
||||
});
|
||||
const queryParams = ref({
|
||||
name: '',
|
||||
});
|
||||
|
||||
const tableDataRef = useTemplateRef('tableDataRef')
|
||||
const AddEditRegisterVisitRef = useTemplateRef('AddEditRegisterVisitRef')
|
||||
const uploadRef = useTemplateRef('uploadRef')
|
||||
|
||||
const total = ref(0);
|
||||
const tableData = ref([
|
||||
{
|
||||
name: '1'
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getLists();
|
||||
});
|
||||
|
||||
// 获取案件列表
|
||||
const getLists = async () => {
|
||||
const res = await getVisitList(queryParams.value, paging.value)
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total
|
||||
};
|
||||
|
||||
const deleteHandle = (row) => {
|
||||
ElMessageBox.confirm('确定取消?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteVisit(row.visitId)
|
||||
await getLists()
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleExport = async () => {
|
||||
// await exportVisit()
|
||||
proxy.download('visiting/visit/export', {
|
||||
...queryParams.value,
|
||||
}, `user_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -1,16 +1,9 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 使用修改密码弹框组件 -->
|
||||
<ChangePasswordDialog
|
||||
ref="showDialogBtnRef"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ChangePasswordDialog from '@/components/ChangePassword/ChangePasswordDialog.vue';
|
||||
import {PasswordIsOverTime} from "@/api/system/user";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
|
||||
@ -18,11 +11,6 @@ const showDialogBtnRef = ref()
|
||||
|
||||
const form = ref({})
|
||||
onMounted(() => {
|
||||
PasswordIsOverTime().then(res => {
|
||||
if(res.data){
|
||||
showDialogBtnRef.value.showDialog()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
@ -31,9 +31,9 @@
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="88px">
|
||||
<el-form-item label="姓名" prop="userName">
|
||||
<el-form-item label="姓名" prop="nickName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@ -65,7 +65,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- v-hasRole="['admin']" -->
|
||||
<el-form-item label="是否已删除" prop="delFlag">
|
||||
<el-form-item label="是否已删除" prop="delFlag">
|
||||
<el-select
|
||||
v-model="queryParams.delFlag"
|
||||
placeholder="是否已删除"
|
||||
@ -73,8 +73,8 @@
|
||||
style="width: 240px"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option value="0" label="否"></el-option>
|
||||
<el-option value="2" label="是"></el-option>
|
||||
<el-option value="0" label="否"></el-option>
|
||||
<el-option value="2" label="是"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 328px;">
|
||||
@ -167,7 +167,7 @@
|
||||
v-if="columns[0].visible"/>
|
||||
<el-table-column label="姓名" align="center" key="userName" prop="userName"
|
||||
v-if="columns[1].visible" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="登录账号" align="center" key="loginName" prop="loginName"
|
||||
<el-table-column label="登录账号" align="center" key="userName" prop="userName"
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单位" align="center" key="unitName" prop="unitName"
|
||||
v-if="columns[3].visible" :show-overflow-tooltip="true"/>
|
||||
@ -197,11 +197,13 @@
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.userId !== 1 && queryParams.delFlag !== '2'">
|
||||
<el-tooltip content="删除" placement="top"
|
||||
v-if="scope.row.userId !== 1 && queryParams.delFlag !== '2'">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="彻底删除" placement="top" v-if="scope.row.userId !== 1 && queryParams.delFlag === '2'">
|
||||
<el-tooltip content="彻底删除" placement="top"
|
||||
v-if="scope.row.userId !== 1 && queryParams.delFlag === '2'">
|
||||
<el-button link type="danger" icon="Delete" @click="handleBackDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
@ -227,18 +229,18 @@
|
||||
</el-row>
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<!-- <el-drawer :title="title" v-model="open" width="600px" append-to-body> -->
|
||||
<el-drawer :title="title" v-model="open"
|
||||
size="50%"
|
||||
:destroy-on-close="true"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<el-drawer :title="title" v-model="open"
|
||||
size="50%"
|
||||
:destroy-on-close="true"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<el-form :model="form" :rules="rules" ref="userRef" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12" v-if="form.userId == undefined">
|
||||
<el-form-item label="登录账号" prop="loginName">
|
||||
<el-input v-model="form.loginName" placeholder="请输入登录账号" maxlength="30"/>
|
||||
<el-form-item label="登录账号" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入登录账号" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.userId == undefined">
|
||||
@ -248,8 +250,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入姓名" maxlength="30"/>
|
||||
<el-form-item label="姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入姓名" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -277,7 +279,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId" required>
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
@ -291,7 +293,7 @@
|
||||
<el-col :span="12">
|
||||
<!-- prop="identityCard" required -->
|
||||
<el-form-item label="身份证号">
|
||||
<el-input v-model="form.identityCard" placeholder="请输入身份证号" />
|
||||
<el-input v-model="form.identityCard" placeholder="请输入身份证号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -302,34 +304,34 @@
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色" required prop="roleIds">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.roleId"
|
||||
:label="item.roleName"
|
||||
:value="item.roleId"
|
||||
:disabled="item.status == 1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" required prop="postIds">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId"
|
||||
:label="item.postName"
|
||||
:value="item.postId"
|
||||
:disabled="item.status == 1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="角色" required prop="roleIds">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.roleId"
|
||||
:label="item.roleName"
|
||||
:value="item.roleId"
|
||||
:disabled="item.status == 1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" required prop="postIds">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId"
|
||||
:label="item.postName"
|
||||
:value="item.postId"
|
||||
:disabled="item.status == 1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<!-- prop="email" required -->
|
||||
<el-col :span="12">
|
||||
<!-- prop="email" required -->
|
||||
<el-form-item label="人员编号">
|
||||
<el-input v-model="form.email" placeholder="请输入人员编号" maxlength="50"/>
|
||||
</el-form-item>
|
||||
@ -346,16 +348,17 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<span style="font-size: 14px;color:red">提示:</span>
|
||||
<span style="font-size: 14px;">法警归属部门必须选法警部,辅警归属部门必须选辅警部,法警负责人角色必须选法警(辅警)负责人,分管领导角色必须选单位领导</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<span style="font-size: 14px;color:red">提示:</span>
|
||||
<span
|
||||
style="font-size: 14px;">法警归属部门必须选法警部,辅警归属部门必须选辅警部,法警负责人角色必须选法警(辅警)负责人,分管领导角色必须选单位领导</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -405,72 +408,70 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup name="User">
|
||||
import {getToken} from "@/utils/auth";
|
||||
import { listDept} from "@/api/system/dept";
|
||||
import { getUserProfile } from "@/api/system/user";
|
||||
|
||||
import {
|
||||
changeUserStatus,
|
||||
listUser,
|
||||
listDelUser,
|
||||
DelrealRemove,
|
||||
resetUserPwd,
|
||||
delUser,
|
||||
getUser,
|
||||
updateUser,
|
||||
<script setup>
|
||||
import {getToken} from '@/utils/auth';
|
||||
import {listDept} from '@/api/system/dept';
|
||||
import {
|
||||
addUser,
|
||||
deptTreeSelect
|
||||
} from "@/api/system/user";
|
||||
import {Plus} from "@element-plus/icons-vue";
|
||||
import {ElMessage} from "element-plus";
|
||||
import PageEnum from "@/enum/PageEnum.js";
|
||||
changeUserStatus,
|
||||
DelrealRemove,
|
||||
delUser,
|
||||
deptTreeSelect,
|
||||
getUser,
|
||||
getUserProfile,
|
||||
listDelUser,
|
||||
listUser,
|
||||
resetUserPwd,
|
||||
updateUser
|
||||
} from '@/api/system/user';
|
||||
import PageEnum from '@/enum/PageEnum.js';
|
||||
import {useRouter} from 'vue-router';
|
||||
|
||||
const router = useRouter();
|
||||
const {proxy} = getCurrentInstance();
|
||||
const {sys_normal_disable, sys_user_sex} = proxy.useDict("sys_normal_disable", "sys_user_sex");
|
||||
const router = useRouter();
|
||||
const {proxy} = getCurrentInstance();
|
||||
const {sys_normal_disable, sys_user_sex} = proxy.useDict('sys_normal_disable', 'sys_user_sex');
|
||||
|
||||
const userList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const usernames = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const deptName = ref("");
|
||||
const deptOptions = ref(undefined);
|
||||
const deptOptionsEdit = ref(undefined);
|
||||
const userList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const usernames = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const dateRange = ref([]);
|
||||
const deptName = ref('');
|
||||
const deptOptions = ref(undefined);
|
||||
const deptOptionsEdit = ref(undefined);
|
||||
|
||||
const defaultexpandedkeys = ref([])
|
||||
const defaultexpandedkeys = ref([])
|
||||
|
||||
const UnitOptions = ref(undefined);
|
||||
const UnitOptions = ref(undefined);
|
||||
|
||||
const initPassword = ref(undefined);
|
||||
const postOptions = ref([]);
|
||||
const roleOptions = ref([]);
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
const initPassword = ref(undefined);
|
||||
const postOptions = ref([]);
|
||||
const roleOptions = ref([]);
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: {Authorization: "Bearer " + getToken()},
|
||||
headers: {Authorization: 'Bearer ' + getToken()},
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData"
|
||||
});
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData'
|
||||
});
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{key: 0, label: `用户编号`, visible: true},
|
||||
{key: 1, label: `用户名称`, visible: true},
|
||||
{key: 2, label: `姓名`, visible: true},
|
||||
@ -478,268 +479,271 @@
|
||||
{key: 4, label: `手机号码`, visible: true},
|
||||
{key: 5, label: `状态`, visible: true},
|
||||
{key: 6, label: `创建时间`, visible: true}
|
||||
]);
|
||||
]);
|
||||
|
||||
const data = reactive({
|
||||
const data = reactive({
|
||||
form: {
|
||||
unitId:null
|
||||
unitId: null
|
||||
},
|
||||
queryParams: {
|
||||
unitId:undefined,
|
||||
unitId: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: PageEnum.SIZE,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
delFlag: undefined,
|
||||
deptId:undefined,
|
||||
|
||||
deptId: undefined,
|
||||
nickName: undefined,
|
||||
},
|
||||
rules: {
|
||||
userName: [{required: true, message: "姓名不能为空", trigger: "blur"}, {
|
||||
userName: [{required: true, message: '姓名不能为空', trigger: 'blur'}, {
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: "姓名长度必须介于 2 和 20 之间",
|
||||
trigger: "blur"
|
||||
message: '姓名长度必须介于 2 和 20 之间',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
loginName: [{required: true, message: "登录账号不能为空", trigger: "blur"}],
|
||||
unitId: [{required: true, message: "所属单位不能为空", trigger: "blur"}],
|
||||
deptId: [{required: true, message: "归属部门不能为空", trigger: "blur"}],
|
||||
password: [{required: true, message: "登录密码不能为空", trigger: "blur"}, {
|
||||
loginName: [{required: true, message: '登录账号不能为空', trigger: 'blur'}],
|
||||
unitId: [{required: true, message: '所属单位不能为空', trigger: 'blur'}],
|
||||
deptId: [{required: true, message: '归属部门不能为空', trigger: 'blur'}],
|
||||
password: [{required: true, message: '登录密码不能为空', trigger: 'blur'}, {
|
||||
min: 5,
|
||||
max: 20,
|
||||
message: "登录密码长度必须介于 5 和 20 之间",
|
||||
trigger: "blur"
|
||||
}, {pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur"}],
|
||||
email: [{required: true, message: "人员编号不能为空", trigger: ["blur"]}],
|
||||
postIds: [{required: true, message: "岗位不能为空", trigger: ["change"]}],
|
||||
roleIds:[{required: true, message: "角色不能为空", trigger: "blur"}],
|
||||
phonenumber: [{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}],
|
||||
identityCard:[
|
||||
{
|
||||
required: true,
|
||||
message: "身份证号不能为空",
|
||||
trigger: "blur"
|
||||
},
|
||||
{
|
||||
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||
message: "请输入正确的身份证号",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
message: '登录密码长度必须介于 5 和 20 之间',
|
||||
trigger: 'blur'
|
||||
}, {pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur'}],
|
||||
email: [{required: true, message: '人员编号不能为空', trigger: ['blur']}],
|
||||
postIds: [{required: true, message: '岗位不能为空', trigger: ['change']}],
|
||||
roleIds: [{required: true, message: '角色不能为空', trigger: 'blur'}],
|
||||
phonenumber: [{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur'}],
|
||||
identityCard: [
|
||||
{
|
||||
required: true,
|
||||
message: '身份证号不能为空',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||
message: '请输入正确的身份证号',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
/** 根据名称筛选部门树 */
|
||||
watch(deptName, val => {
|
||||
proxy.$refs["deptTreeRef"].filter(val);
|
||||
});
|
||||
};
|
||||
/** 根据名称筛选部门树 */
|
||||
watch(deptName, val => {
|
||||
proxy.$refs['deptTreeRef'].filter(val);
|
||||
});
|
||||
|
||||
|
||||
// 获取个s人信息
|
||||
const getUserInfo = async () => {
|
||||
await getUserProfile().then(res => {
|
||||
form.value.unitId = res.data.unitId
|
||||
handleUnitChange(form.value.unitId)
|
||||
})
|
||||
}
|
||||
// 获取个s人信息
|
||||
const getUserInfo = async () => {
|
||||
await getUserProfile().then(res => {
|
||||
form.value.unitId = res.data.unitId
|
||||
handleUnitChange(form.value.unitId)
|
||||
})
|
||||
}
|
||||
|
||||
function handleUnitChange(data) {
|
||||
form.value.deptId = ''
|
||||
listDept().then(res => {
|
||||
deptOptionsEdit.value = res.data.filter(
|
||||
item => item.parentId === data
|
||||
);
|
||||
deptOptionsEdit.value = deptOptionsEdit.value.filter(
|
||||
item => item.isUnit === false
|
||||
);
|
||||
function handleUnitChange(data) {
|
||||
form.value.deptId = ''
|
||||
listDept().then(res => {
|
||||
deptOptionsEdit.value = res.data.filter(
|
||||
item => item.parentId === data
|
||||
);
|
||||
deptOptionsEdit.value = deptOptionsEdit.value.filter(
|
||||
item => item.isUnit === false
|
||||
);
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询部门下拉树结构 */
|
||||
function getDeptTree() {
|
||||
/** 查询部门下拉树结构 */
|
||||
function getDeptTree() {
|
||||
deptTreeSelect().then(response => {
|
||||
deptOptions.value = response.data;
|
||||
defaultexpandedkeys.value = []
|
||||
defaultexpandedkeys.value = deptOptions.value.map(item => item.id);
|
||||
});
|
||||
}
|
||||
/** 查询部门列表 */
|
||||
function getDeptList() {
|
||||
listDept().then(res => {
|
||||
UnitOptions.value = res.data.filter(
|
||||
item => item.isUnit === true
|
||||
);
|
||||
const data = proxy.handleTree(UnitOptions.value, "deptId");
|
||||
UnitOptions.value = data
|
||||
// console.log(UnitOptions.value)
|
||||
// const buildHierarchy = (data, parentId = 0) => {
|
||||
// return data
|
||||
// .filter(item => item.parentId === parentId) // 过滤出直接子部门
|
||||
// .map(item => {
|
||||
// const children = buildHierarchy(data, item.deptId); // 递归查找子部门
|
||||
// return {
|
||||
// ...item, // 保留当前部门的所有属性
|
||||
// children, // 添加子部门
|
||||
// };
|
||||
// });
|
||||
// };
|
||||
// UnitOptions.value = buildHierarchy(data)
|
||||
}
|
||||
|
||||
/** 查询部门列表 */
|
||||
function getDeptList() {
|
||||
listDept().then(res => {
|
||||
UnitOptions.value = res.data.filter(
|
||||
item => item.isUnit === true
|
||||
);
|
||||
const data = proxy.handleTree(UnitOptions.value, 'deptId');
|
||||
UnitOptions.value = data
|
||||
// console.log(UnitOptions.value)
|
||||
// const buildHierarchy = (data, parentId = 0) => {
|
||||
// return data
|
||||
// .filter(item => item.parentId === parentId) // 过滤出直接子部门
|
||||
// .map(item => {
|
||||
// const children = buildHierarchy(data, item.deptId); // 递归查找子部门
|
||||
// return {
|
||||
// ...item, // 保留当前部门的所有属性
|
||||
// children, // 添加子部门
|
||||
// };
|
||||
// });
|
||||
// };
|
||||
// UnitOptions.value = buildHierarchy(data)
|
||||
});
|
||||
}
|
||||
/** 查询用户列aa表 */
|
||||
function getList() {
|
||||
if (!queryParams.value.unitId) {
|
||||
getUserProfile().then(res => {
|
||||
queryParams.value.unitId = res.data.unitId;
|
||||
// 确保 unitId 赋值后再执行下面的逻辑
|
||||
loading.value = true;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// deptId 已经存在的情况下,直接执行请求
|
||||
loading.value = true;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
if(data.isUnit){
|
||||
queryParams.value.deptId = undefined;
|
||||
queryParams.value.unitId = data.id;
|
||||
console.log(queryParams.value)
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}else{
|
||||
queryParams.value.unitId = undefined;
|
||||
queryParams.value.deptId = data.id;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
/** 查询用户列aa表 */
|
||||
function getList() {
|
||||
if (!queryParams.value.unitId) {
|
||||
getUserProfile().then(res => {
|
||||
queryParams.value.unitId = res.data.unitId;
|
||||
// 确保 unitId 赋值后再执行下面的逻辑
|
||||
loading.value = true;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// deptId 已经存在的情况下,直接执行请求
|
||||
loading.value = true;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
if (data.isUnit) {
|
||||
queryParams.value.deptId = undefined;
|
||||
queryParams.value.unitId = data.id;
|
||||
console.log(queryParams.value)
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
} else {
|
||||
queryParams.value.unitId = undefined;
|
||||
queryParams.value.deptId = data.id;
|
||||
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
if(queryParams.value.delFlag === '2'){
|
||||
listDelUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
}else{
|
||||
if (queryParams.value.delFlag === '2') {
|
||||
listDelUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
|
||||
loading.value = false;
|
||||
userList.value = res.rows;
|
||||
total.value = res.total;
|
||||
});
|
||||
} else {
|
||||
getList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
proxy.resetForm('queryRef');
|
||||
queryParams.value.unitId = undefined;
|
||||
proxy.$refs.deptTreeRef.setCurrentKey(null);
|
||||
handleQuery();
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const userIds = row.userId || ids.value;
|
||||
const userName = row.userName || usernames.value;
|
||||
proxy.$modal.confirm('是否确认删除用户姓名为"' + userName + '"的数据项?').then(function () {
|
||||
return delUser(userIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
/** 撤销删除按钮操作 */
|
||||
function handleBackDelete(row) {
|
||||
}
|
||||
|
||||
/** 撤销删除按钮操作 */
|
||||
function handleBackDelete(row) {
|
||||
const userIds = row.userId;
|
||||
const userName = row.userName || usernames.value;
|
||||
proxy.$modal.confirm('用户有业务数据,是否确认彻底删除用户姓名为"' + userName + '"的数据项?删除后将删除此用户所有关联业务数据').then(function () {
|
||||
DelrealRemove(userIds).then(response => {
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
open.value = false;
|
||||
handleQuery();
|
||||
});
|
||||
DelrealRemove(userIds).then(response => {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
open.value = false;
|
||||
handleQuery();
|
||||
});
|
||||
}).then(() => {
|
||||
handleQuery();
|
||||
handleQuery();
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/user/export", {
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('system/user/export', {
|
||||
...queryParams.value,
|
||||
}, `user_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
|
||||
/** 用户状态修改 */
|
||||
function handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用";
|
||||
/** 用户状态修改 */
|
||||
function handleStatusChange(row) {
|
||||
let text = row.status === '0' ? '启用' : '停用';
|
||||
proxy.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function () {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess(text + "成功");
|
||||
proxy.$modal.msgSuccess(text + '成功');
|
||||
}).catch(function () {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
row.status = row.status === '0' ? '1' : '0';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 更多操作 */
|
||||
function handleCommand(command, row) {
|
||||
/** 更多操作 */
|
||||
function handleCommand(command, row) {
|
||||
switch (command) {
|
||||
case "handleResetPwd":
|
||||
case 'handleResetPwd':
|
||||
handleResetPwd(row);
|
||||
break;
|
||||
case "handleAuthRole":
|
||||
case 'handleAuthRole':
|
||||
handleAuthRole(row);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 跳转角色分配 */
|
||||
function handleAuthRole(row) {
|
||||
/** 跳转角色分配 */
|
||||
function handleAuthRole(row) {
|
||||
const userId = row.userId;
|
||||
router.push("/system/user-auth/role/" + userId);
|
||||
}
|
||||
router.push('/system/user-auth/role/' + userId);
|
||||
}
|
||||
|
||||
/** 重置密码按钮操作 */
|
||||
function handleResetPwd(row) {
|
||||
proxy.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
/** 重置密码按钮操作 */
|
||||
function handleResetPwd(row) {
|
||||
proxy.$prompt('请输入"' + row.userName + '"的新密码', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
closeOnClickModal: false,
|
||||
inputPattern: /^.{5,20}$/,
|
||||
inputErrorMessage: "登录密码长度必须介于 5 和 20 之间",
|
||||
inputErrorMessage: '登录密码长度必须介于 5 和 20 之间',
|
||||
// inputValidator: (value) => {
|
||||
// if (/<|>|"|'|\||\\/.test(value)) {
|
||||
// return "不能包含非法字符:< > \" ' \\\ |"
|
||||
@ -748,7 +752,7 @@
|
||||
inputValidator: (value) => {
|
||||
// 检查非法字符
|
||||
if (/<|>|"|'|\||\\/.test(value)) {
|
||||
return "不能包含非法字符:< > \" ' \\\ |";
|
||||
return '不能包含非法字符:< > " \' \\\ |';
|
||||
}
|
||||
|
||||
// 检查密码强度:是否包含字母、数字和特殊字符
|
||||
@ -757,63 +761,63 @@
|
||||
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value);
|
||||
|
||||
if (!hasLetter || !hasNumber || !hasSpecialChar) {
|
||||
return "密码必须包含英文、数字、特殊字符!";
|
||||
return '密码必须包含英文、数字、特殊字符!';
|
||||
}
|
||||
|
||||
return true; // 返回true,表示验证通过
|
||||
},
|
||||
}).then(({value}) => {
|
||||
const rowdata = {
|
||||
userId:row.userId,
|
||||
loginName:row.loginName
|
||||
userId: row.userId,
|
||||
userName: row.userName
|
||||
}
|
||||
resetUserPwd(rowdata, value).then(response => {
|
||||
// proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.userId);
|
||||
usernames.value = selection.map(item => item.userName);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
}
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = "用户导入";
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = '用户导入';
|
||||
upload.open = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download("system/user/importTemplate", {}, `user_template_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
|
||||
proxy.$refs['uploadRef'].handleRemove(file);
|
||||
proxy.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true});
|
||||
getList();
|
||||
};
|
||||
};
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
}
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs['uploadRef'].submit();
|
||||
}
|
||||
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
userId: undefined,
|
||||
deptId: undefined,
|
||||
@ -823,22 +827,22 @@
|
||||
phonenumber: undefined,
|
||||
email: undefined,
|
||||
sex: undefined,
|
||||
status: "0",
|
||||
status: '0',
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: []
|
||||
};
|
||||
proxy.resetForm("userRef");
|
||||
}
|
||||
proxy.resetForm('userRef');
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
getUserInfo()
|
||||
@ -846,13 +850,13 @@
|
||||
postOptions.value = response.posts;
|
||||
roleOptions.value = response.roles;
|
||||
|
||||
title.value = "添加用户";
|
||||
title.value = '添加用户';
|
||||
form.value.password = initPassword.value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const userId = row.userId || ids.value;
|
||||
getUser(userId).then(response => {
|
||||
@ -862,50 +866,55 @@
|
||||
form.value.postIds = response.postIds;
|
||||
form.value.roleIds = response.roleIds;
|
||||
open.value = true;
|
||||
title.value = "修改用户";
|
||||
form.password = "";
|
||||
title.value = '修改用户';
|
||||
form.password = '';
|
||||
|
||||
listDept().then(res => {
|
||||
deptOptionsEdit.value = res.data.filter(
|
||||
item => item.isUnit === false
|
||||
);
|
||||
deptOptionsEdit.value = deptOptionsEdit.value.filter(
|
||||
item => item.parentId === form.value.unitId
|
||||
);
|
||||
deptOptionsEdit.value = res.data.filter(
|
||||
item => item.isUnit === false
|
||||
);
|
||||
deptOptionsEdit.value = deptOptionsEdit.value.filter(
|
||||
item => item.parentId === form.value.unitId
|
||||
);
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["userRef"].validate(valid => {
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['userRef'].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.userId != undefined) {
|
||||
form.value.password = null
|
||||
form.value.password = null
|
||||
updateUser(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addUser(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getDeptTree();
|
||||
getDeptList();
|
||||
getList();
|
||||
getDeptTree();
|
||||
getDeptList();
|
||||
getList();
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
:deep().el-select__selected-item{margin-right: 10px;}
|
||||
:deep().el-tag{max-width: 300px!important;}
|
||||
</style>
|
||||
:deep().el-select__selected-item {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
:deep().el-tag {
|
||||
max-width: 300px !important;
|
||||
}
|
||||
</style>
|
@ -45,7 +45,7 @@ export default defineConfig(({mode, command}) => {
|
||||
'/dev-api': {
|
||||
// target: 'http://192.168.3.10:18066', //耗子本地
|
||||
|
||||
target: 'http://106.15.139.36:18066', //36 VPN 转发到 3 上
|
||||
target: 'http://106.15.139.36:18067', //36 VPN 转发到 3 上
|
||||
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user