爱~海~爱海爱海~右
3 days ago
22 changed files with 2988 additions and 2291 deletions
@ -1,145 +1,167 @@
|
||||
import request from '@/utils/request' |
||||
import request from "@/utils/request"; |
||||
import { parseStrEmpty } from "@/utils/ruoyi"; |
||||
|
||||
// 查询用户列表
|
||||
export function listUser(query) { |
||||
return request({ |
||||
url: '/system/user/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
url: "/system/user/list", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
} |
||||
|
||||
// 查询用户列表
|
||||
export function listDeptUser(query) { |
||||
return request({ |
||||
url: '/system/user/listDeptUser', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
url: "/system/user/listDeptUser", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
} |
||||
|
||||
// 查询用户详细
|
||||
export function getUser(userId) { |
||||
return request({ |
||||
url: '/system/user/' + parseStrEmpty(userId), |
||||
method: 'get' |
||||
}) |
||||
url: "/system/user/" + parseStrEmpty(userId), |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
// 新增用户
|
||||
export function addUser(data) { |
||||
return request({ |
||||
url: '/system/user', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
url: "/system/user", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) { |
||||
return request({ |
||||
url: '/system/user', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
url: "/system/user", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) { |
||||
return request({ |
||||
url: '/system/user/' + userId, |
||||
method: 'delete' |
||||
}) |
||||
url: "/system/user/" + userId, |
||||
method: "delete", |
||||
}); |
||||
} |
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(userId, password) { |
||||
const data = { |
||||
userId, |
||||
password |
||||
} |
||||
password, |
||||
}; |
||||
return request({ |
||||
url: '/system/user/resetPwd', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
url: "/system/user/resetPwd", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(userId, status) { |
||||
const data = { |
||||
userId, |
||||
status |
||||
} |
||||
status, |
||||
}; |
||||
return request({ |
||||
url: '/system/user/changeStatus', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
url: "/system/user/changeStatus", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() { |
||||
return request({ |
||||
url: '/system/user/profile', |
||||
method: 'get' |
||||
}) |
||||
url: "/system/user/profile", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) { |
||||
return request({ |
||||
url: '/system/user/profile', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
url: "/system/user/profile", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) { |
||||
const data = { |
||||
oldPassword, |
||||
newPassword |
||||
} |
||||
newPassword, |
||||
}; |
||||
return request({ |
||||
url: '/system/user/profile/updatePwd', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
url: "/system/user/profile/updatePwd", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) { |
||||
return request({ |
||||
url: '/system/user/profile/avatar', |
||||
method: 'post', |
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, |
||||
data: data |
||||
}) |
||||
url: "/system/user/profile/avatar", |
||||
method: "post", |
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
// 查询授权角色
|
||||
export function getAuthRole(userId) { |
||||
return request({ |
||||
url: '/system/user/authRole/' + userId, |
||||
method: 'get' |
||||
}) |
||||
url: "/system/user/authRole/" + userId, |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
// 保存授权角色
|
||||
export function updateAuthRole(data) { |
||||
return request({ |
||||
url: '/system/user/authRole', |
||||
method: 'put', |
||||
params: data |
||||
}) |
||||
url: "/system/user/authRole", |
||||
method: "put", |
||||
params: data, |
||||
}); |
||||
} |
||||
|
||||
// 查询部门下拉树结构
|
||||
export function deptTreeSelect() { |
||||
return request({ |
||||
url: '/system/user/deptTree', |
||||
method: 'get' |
||||
}) |
||||
url: "/system/user/deptTree", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询审核列表 |
||||
*/ |
||||
export function getExamieList(query) { |
||||
return request({ |
||||
url: "/system/user/auditList", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 审核用户 |
||||
*/ |
||||
export function examineUser(data) { |
||||
return request({ |
||||
url: "/system/user/auditUser", |
||||
method: "put", |
||||
data, |
||||
}); |
||||
} |
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request' |
||||
|
||||
/** |
||||
* 查询任务列表 |
||||
* @param query |
||||
* @returns {*} |
||||
*/ |
||||
export function getTaskList(query) { |
||||
return request({ |
||||
url: '/system/enterprises/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
/** |
||||
* 创建任务 |
||||
* @param id |
||||
* @returns {*} |
||||
*/ |
||||
export function createTask(id) { |
||||
return request({ |
||||
url: '/system/enterprises/' + id, |
||||
method: 'post' |
||||
}) |
||||
} |
||||
|
@ -0,0 +1,171 @@
|
||||
<template> |
||||
<el-dialog :title="title" v-model="show" width="600px" append-to-body> |
||||
<el-form |
||||
ref="enterprisesRef" |
||||
:model="form" |
||||
:rules="rules" |
||||
label-width="auto" |
||||
> |
||||
<el-form-item label="名称" prop="enterprisesName"> |
||||
<el-input v-model="form.enterprisesName" placeholder="请输入企业名称" /> |
||||
</el-form-item> |
||||
<el-form-item label="类型" prop="type"> |
||||
<el-select v-model="form.type" placeholder="请输入所属区域"> |
||||
<el-option |
||||
v-for="dict in enterprise_type" |
||||
:key="dict.value" |
||||
:lable="dict.value" |
||||
:value="dict.label" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="所属区域" prop="region"> |
||||
<el-select v-model="form.region" placeholder="请输入所属区域"> |
||||
<el-option |
||||
v-for="dict in sys_region" |
||||
:key="dict.value" |
||||
:lable="dict.value" |
||||
:value="dict.label" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="地址" prop="address"> |
||||
<el-input |
||||
v-model="form.address" |
||||
type="textarea" |
||||
placeholder="请输入内容" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="注册号" prop="registrationNumber"> |
||||
<el-input |
||||
v-model="form.registrationNumber" |
||||
placeholder="请输入企业注册号" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="成立时间" prop="establishmentDate"> |
||||
<el-date-picker |
||||
clearable |
||||
v-model="form.establishmentDate" |
||||
type="date" |
||||
value-format="YYYY-MM-DD" |
||||
placeholder="请选择企业成立时间" |
||||
style="width: 100%" |
||||
> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</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> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { |
||||
addEnterprises, |
||||
updateEnterprises, |
||||
getEnterprises, |
||||
} from "@/api/system/enterprises/enterprises"; |
||||
const { proxy } = getCurrentInstance(); |
||||
const { enterprise_type, sys_region } = proxy.useDict( |
||||
"enterprise_type", |
||||
"sys_region", |
||||
); |
||||
const title = ref(""); |
||||
const show = ref(false); |
||||
const emits = defineEmits(["success"]); |
||||
const data = reactive({ |
||||
form: {}, |
||||
rules: { |
||||
type: [{ required: true, message: "企业类型", trigger: "change" }], |
||||
region: [{ required: true, message: "企业所属区域", trigger: "blur" }], |
||||
enterprisesName: [ |
||||
{ |
||||
required: true, |
||||
message: "企业名称不能为空", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
createTime: [ |
||||
{ |
||||
required: true, |
||||
message: "创建时间不能为空", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
updateTime: [ |
||||
{ |
||||
required: true, |
||||
message: "更新时间不能为空", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
}); |
||||
const { form, rules } = toRefs(data); |
||||
|
||||
/** 提交按钮 */ |
||||
function submitForm() { |
||||
proxy.$refs["enterprisesRef"].validate((valid) => { |
||||
if (valid) { |
||||
if (form.value.id != null) { |
||||
updateEnterprises(form.value).then((response) => { |
||||
proxy.$modal.msgSuccess("修改成功"); |
||||
emits('success') |
||||
open.value = false; |
||||
}); |
||||
} else { |
||||
addEnterprises(form.value).then((response) => { |
||||
proxy.$modal.msgSuccess("新增成功"); |
||||
emits('success') |
||||
open.value = false; |
||||
|
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
function open(id) { |
||||
reset(); |
||||
if (id) { |
||||
title.value = "修改企业基本信息"; |
||||
getEnterprises(id).then((res) => { |
||||
form.value = res.data; |
||||
}); |
||||
} else { |
||||
title.value = "新增企业基本信息"; |
||||
} |
||||
show.value = true; |
||||
} |
||||
// 表单重置 |
||||
function reset() { |
||||
form.value = { |
||||
id: null, |
||||
departmentId: null, |
||||
userId: null, |
||||
type: null, |
||||
region: null, |
||||
enterprisesName: null, |
||||
address: null, |
||||
environmentalContactName: null, |
||||
environmentalContactPhone: null, |
||||
registrationNumber: null, |
||||
introduction: null, |
||||
establishmentDate: null, |
||||
creator: null, |
||||
createTime: null, |
||||
updateTime: null, |
||||
updater: null, |
||||
deleted: null, |
||||
}; |
||||
proxy.resetForm("enterprisesRef"); |
||||
} |
||||
defineExpose({ open }); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,53 @@
|
||||
<template> |
||||
<el-dialog title="图文介绍" v-model="show" width="780px" append-to-body> |
||||
<el-form ref="noticeRef" :model="form"> |
||||
<el-form-item label="介绍"> |
||||
<editor v-model="form.introduction" :min-height="192" /> |
||||
</el-form-item> |
||||
</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> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { |
||||
addEnterprises, |
||||
updateEnterprises, |
||||
getEnterprises, |
||||
} from "@/api/system/enterprises/enterprises"; |
||||
const form = ref({ |
||||
introduction: null, |
||||
id: null, |
||||
}); |
||||
|
||||
const { proxy } = getCurrentInstance(); |
||||
const show = ref(false); |
||||
|
||||
function open(id) { |
||||
form.value.id = id; |
||||
getEnterprises(id).then((res) => { |
||||
form.value = res.data; |
||||
}); |
||||
show.value = true; |
||||
} |
||||
|
||||
function submitForm() { |
||||
updateEnterprises(form.value).then((response) => { |
||||
proxy.$modal.msgSuccess("修改成功"); |
||||
show.value = false; |
||||
}); |
||||
} |
||||
|
||||
function cancel() { |
||||
show.value = false; |
||||
} |
||||
|
||||
defineExpose({ open }); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,319 @@
|
||||
<template> |
||||
<div class="app-container"> |
||||
<el-form |
||||
:model="queryParams" |
||||
ref="queryRef" |
||||
:inline="true" |
||||
v-show="showSearch" |
||||
> |
||||
<el-form-item label="专管员" prop="userId"> |
||||
<el-input |
||||
v-model="queryParams.userId" |
||||
placeholder="请输入专管员" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="类型" prop="type"> |
||||
<el-select |
||||
v-model="queryParams.type" |
||||
clearable |
||||
placeholder="请选择所属区域" |
||||
@change="handleQuery" |
||||
style="width: 150px" |
||||
> |
||||
<el-option |
||||
v-for="dict in enterprise_type" |
||||
:key="dict.value" |
||||
:lable="dict.value" |
||||
:value="dict.label" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="所属区域" prop="region"> |
||||
<el-select |
||||
v-model="queryParams.region" |
||||
clearable |
||||
placeholder="请选择所属区域" |
||||
@select="handleQuery" |
||||
style="width: 150px" |
||||
> |
||||
<el-option |
||||
v-for="dict in sys_region" |
||||
:key="dict.value" |
||||
:lable="dict.value" |
||||
:value="dict.label" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="企业名称" prop="enterprisesName"> |
||||
<el-input |
||||
v-model="queryParams.enterprisesName" |
||||
placeholder="请输入企业名称" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="环保负责人" prop="environmentalContactName"> |
||||
<el-input |
||||
v-model="queryParams.environmentalContactName" |
||||
placeholder="请输入企业环保负责人姓名" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="注册号" prop="registrationNumber"> |
||||
<el-input |
||||
v-model="queryParams.registrationNumber" |
||||
placeholder="请输入企业注册号" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="创建人" prop="creator"> |
||||
<el-input |
||||
v-model="queryParams.creator" |
||||
placeholder="请输入创建人" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</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-row :gutter="10" class="mb8"> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="primary" |
||||
plain |
||||
icon="Plus" |
||||
@click="handleAdd" |
||||
v-hasPermi="['system:enterprises:add']" |
||||
> |
||||
新增 |
||||
</el-button> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="warning" |
||||
plain |
||||
icon="Download" |
||||
@click="handleExport" |
||||
v-hasPermi="['system:enterprises:export']" |
||||
>导出</el-button |
||||
> |
||||
</el-col> |
||||
<right-toolbar |
||||
v-model:showSearch="showSearch" |
||||
@queryTable="getList" |
||||
></right-toolbar> |
||||
</el-row> |
||||
|
||||
<el-table v-loading="loading" :data="enterprisesList"> |
||||
<el-table-column |
||||
label="名称" |
||||
align="center" |
||||
prop="enterprisesName" |
||||
show-overflow-tooltip |
||||
> |
||||
<template #default="scope"> |
||||
<section class="name"> |
||||
<DictTag :options="enterprise_type" :value="scope.row.region" /> |
||||
<span>{{ scope.row.enterprisesName }}</span> |
||||
</section> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="所属区域" align="center" prop="region"> |
||||
<template #default="scope"> |
||||
<DictTag :options="sys_region" :value="scope.row.region" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column |
||||
label="地址" |
||||
align="center" |
||||
prop="address" |
||||
show-overflow-tooltip |
||||
/> |
||||
<el-table-column label="环保负责人" align="center" prop="" /> |
||||
<el-table-column |
||||
label="专管员" |
||||
align="center" |
||||
prop="environmentalContactName" |
||||
/> |
||||
<el-table-column |
||||
label="注册号" |
||||
align="center" |
||||
prop="registrationNumber" |
||||
/> |
||||
<el-table-column |
||||
label="成立时间" |
||||
align="center" |
||||
prop="establishmentDate" |
||||
width="180" |
||||
> |
||||
<template #default="scope"> |
||||
<span> |
||||
{{ parseTime(scope.row.establishmentDate, "{y}-{m}-{d}") }} |
||||
</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column |
||||
label="操作" |
||||
align="center" |
||||
class-name="small-padding fixed-width" |
||||
width="300px" |
||||
> |
||||
<template #default="scope"> |
||||
<el-button link type="primary" icon="Collection"> 详情 </el-button> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
icon="Document" |
||||
@click="introduce(scope.row)" |
||||
v-hasPermi="['system:enterprises:remove']" |
||||
> |
||||
图文介绍 |
||||
</el-button> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
icon="Delete" |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['system:enterprises: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" |
||||
/> |
||||
<EnterprisesFrom ref="enterprisesFromRef" @success="handleQuery" /> |
||||
<IntroduceForm ref="introduceFormRef" /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Enterprises"> |
||||
import EnterprisesFrom from "./component/form.vue"; |
||||
import IntroduceForm from "./component/introduce.vue"; |
||||
import { |
||||
listEnterprises, |
||||
delEnterprises, |
||||
} from "@/api/system/enterprises/enterprises"; |
||||
import DictTag from "@/components/DictTag/index.vue"; |
||||
const { proxy } = getCurrentInstance(); |
||||
const { enterprise_type, sys_region } = proxy.useDict( |
||||
"enterprise_type", |
||||
"sys_region", |
||||
); |
||||
const enterprisesList = ref([]); |
||||
const loading = ref(true); |
||||
const showSearch = ref(true); |
||||
const ids = ref([]); |
||||
const total = ref(0); |
||||
const enterprisesFromRef = ref(); |
||||
const data = reactive({ |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
departmentId: null, |
||||
userId: null, |
||||
type: null, |
||||
region: null, |
||||
enterprisesName: null, |
||||
address: null, |
||||
environmentalContactName: null, |
||||
environmentalContactPhone: null, |
||||
registrationNumber: null, |
||||
introduction: null, |
||||
establishmentDate: null, |
||||
creator: null, |
||||
updater: null, |
||||
deleted: null, |
||||
}, |
||||
}); |
||||
const { queryParams } = toRefs(data); |
||||
const introduceFormRef = ref(); |
||||
/** 查询企业列表 */ |
||||
function getList() { |
||||
loading.value = true; |
||||
listEnterprises(queryParams.value).then((response) => { |
||||
enterprisesList.value = response.rows; |
||||
total.value = response.total; |
||||
loading.value = false; |
||||
}); |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
function handleQuery() { |
||||
queryParams.value.pageNum = 1; |
||||
getList(); |
||||
} |
||||
|
||||
/** 重置按钮操作 */ |
||||
function resetQuery() { |
||||
proxy.resetForm("queryRef"); |
||||
handleQuery(); |
||||
} |
||||
|
||||
/** 新增按钮操作 */ |
||||
function handleAdd() { |
||||
unref(enterprisesFromRef).open(); |
||||
} |
||||
|
||||
/** 删除按钮操作 */ |
||||
function handleDelete(row) { |
||||
const _ids = row.id || ids.value; |
||||
proxy.$modal |
||||
.confirm('是否确认删除企业编号为"' + _ids + '"的数据项?') |
||||
.then(function () { |
||||
return delEnterprises(_ids); |
||||
}) |
||||
.then(() => { |
||||
getList(); |
||||
proxy.$modal.msgSuccess("删除成功"); |
||||
}) |
||||
.catch(() => {}); |
||||
} |
||||
|
||||
/** 导出按钮操作 */ |
||||
function handleExport() { |
||||
proxy.download( |
||||
"system/enterprises/export", |
||||
{ |
||||
...queryParams.value, |
||||
}, |
||||
`enterprises_${new Date().getTime()}.xlsx`, |
||||
); |
||||
} |
||||
|
||||
|
||||
/** 图文介绍按钮操作 */ |
||||
function introduce(row){ |
||||
unref(introduceFormRef).open(row.id); |
||||
} |
||||
getList(); |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.name { |
||||
display: flex; |
||||
width: fit-content; |
||||
gap: 10px; |
||||
} |
||||
</style> |
@ -1,92 +0,0 @@
|
||||
<template> |
||||
<el-dialog :title="title" v-model="visible" width="500px" append-to-body> |
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px"> |
||||
<el-form-item label="企业名称" prop="enterprisesName"> |
||||
<el-input v-model="form.enterprisesName" placeholder="请输入企业名称" /> |
||||
</el-form-item> |
||||
<el-form-item label="企业地址" prop="address"> |
||||
<el-input v-model="form.address" placeholder="请输入企业地址" /> |
||||
</el-form-item> |
||||
<el-form-item label="企业成立时间" prop="establishmentDate"> |
||||
<el-date-picker |
||||
clearable |
||||
v-model="form.establishmentDate" |
||||
type="date" |
||||
value-format="YYYY-MM-DD" |
||||
placeholder="请选择企业成立时间" |
||||
/> |
||||
</el-form-item> |
||||
<!-- 更多表单项 --> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
<el-button @click="close">取 消</el-button> |
||||
</template> |
||||
</el-dialog> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { ref } from "vue"; |
||||
|
||||
// Props |
||||
const props = defineProps({ |
||||
title: { |
||||
type: String, |
||||
default: "添加/修改企业", |
||||
}, |
||||
rules: { |
||||
type: Object, |
||||
default: () => ({}), |
||||
}, |
||||
}); |
||||
|
||||
// Emit |
||||
const emit = defineEmits(["submit", "cancel"]); |
||||
|
||||
// 控制对话框显示 |
||||
const visible = ref(false); |
||||
|
||||
// 表单数据 |
||||
const form = ref({ |
||||
enterprisesName: "", |
||||
address: "", |
||||
establishmentDate: "", |
||||
}); |
||||
|
||||
// 表单引用 |
||||
const formRef = ref(null); |
||||
|
||||
// 打开对话框方法 |
||||
function open(data) { |
||||
Object.assign(form.value, data || {}); |
||||
visible.value = true; |
||||
} |
||||
|
||||
// 关闭对话框方法 |
||||
function close() { |
||||
visible.value = false; |
||||
emit("cancel"); |
||||
} |
||||
|
||||
// 提交表单 |
||||
function submit() { |
||||
formRef.value.validate((valid) => { |
||||
if (valid) { |
||||
emit("submit", form.value); |
||||
close(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 暴露方法 |
||||
defineExpose({ |
||||
open, |
||||
}); |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.dialog-footer { |
||||
text-align: right; |
||||
} |
||||
</style> |
||||
|
@ -1,589 +0,0 @@
|
||||
<template> |
||||
<div class="app-container"> |
||||
<!-- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
||||
<el-form-item label="所属部门ID" prop="departmentId"> |
||||
<el-input |
||||
v-model="queryParams.departmentId" |
||||
placeholder="请输入所属部门ID" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="管辖人员ID" prop="userId"> |
||||
<el-input |
||||
v-model="queryParams.userId" |
||||
placeholder="请输入管辖人员ID" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业所属区域:1.东区、2.西区、3.北区、4.南区" prop="region"> |
||||
<el-input |
||||
v-model="queryParams.region" |
||||
placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业名称" prop="enterprisesName"> |
||||
<el-input |
||||
v-model="queryParams.enterprisesName" |
||||
placeholder="请输入企业名称" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业环保负责人姓名" prop="environmentalContactName"> |
||||
<el-input |
||||
v-model="queryParams.environmentalContactName" |
||||
placeholder="请输入企业环保负责人姓名" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业环保负责人联系电话" prop="environmentalContactPhone"> |
||||
<el-input |
||||
v-model="queryParams.environmentalContactPhone" |
||||
placeholder="请输入企业环保负责人联系电话" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业注册号" prop="registrationNumber"> |
||||
<el-input |
||||
v-model="queryParams.registrationNumber" |
||||
placeholder="请输入企业注册号" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="企业成立时间" prop="establishmentDate"> |
||||
<el-date-picker clearable |
||||
v-model="queryParams.establishmentDate" |
||||
type="date" |
||||
value-format="YYYY-MM-DD" |
||||
placeholder="请选择企业成立时间"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item label="创建人" prop="creator"> |
||||
<el-input |
||||
v-model="queryParams.creator" |
||||
placeholder="请输入创建人" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="修改人" prop="updater"> |
||||
<el-input |
||||
v-model="queryParams.updater" |
||||
placeholder="请输入修改人" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="是否删除" prop="deleted"> |
||||
<el-input |
||||
v-model="queryParams.deleted" |
||||
placeholder="请输入是否删除" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</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-row |
||||
:gutter="10" |
||||
class="mb8" |
||||
> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="primary" |
||||
plain |
||||
icon="Plus" |
||||
@click="handleAdd" |
||||
v-hasPermi="['system:enterprises:add']" |
||||
>新增</el-button |
||||
> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="success" |
||||
plain |
||||
icon="Edit" |
||||
:disabled="single" |
||||
@click="handleUpdate" |
||||
v-hasPermi="['system:enterprises:edit']" |
||||
>修改</el-button |
||||
> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="danger" |
||||
plain |
||||
icon="Delete" |
||||
:disabled="multiple" |
||||
@click="handleDelete" |
||||
v-hasPermi="['system:enterprises:remove']" |
||||
>删除</el-button |
||||
> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="warning" |
||||
plain |
||||
icon="Download" |
||||
@click="handleExport" |
||||
v-hasPermi="['system:enterprises:export']" |
||||
>导出</el-button |
||||
> |
||||
</el-col> |
||||
<right-toolbar |
||||
v-model:showSearch="showSearch" |
||||
@queryTable="getList" |
||||
></right-toolbar> |
||||
</el-row> |
||||
|
||||
<el-table |
||||
v-loading="loading" |
||||
:data="enterprisesList" |
||||
@selection-change="handleSelectionChange" |
||||
> |
||||
<el-table-column |
||||
type="selection" |
||||
width="55" |
||||
align="center" |
||||
/> |
||||
<!-- <el-table-column label="企业ID,主键" align="center" prop="id" /> --> |
||||
<!-- <el-table-column label="所属部门ID" align="center" prop="departmentId" /> --> |
||||
<!-- <el-table-column label="管辖人员ID" align="center" prop="userId" /> --> |
||||
<el-table-column |
||||
label="企业类型" |
||||
align="center" |
||||
prop="type" |
||||
/> |
||||
<el-table-column |
||||
label="企业所属区域" |
||||
align="center" |
||||
prop="region" |
||||
/> |
||||
<el-table-column |
||||
label="企业名称" |
||||
align="center" |
||||
prop="enterprisesName" |
||||
/> |
||||
<el-table-column |
||||
label="企业地址" |
||||
align="center" |
||||
prop="address" |
||||
/> |
||||
<el-table-column |
||||
label="企业环保负责人姓名" |
||||
align="center" |
||||
prop="environmentalContactName" |
||||
/> |
||||
<el-table-column |
||||
label="企业注册号" |
||||
align="center" |
||||
prop="registrationNumber" |
||||
/> |
||||
<el-table-column |
||||
label="企业图文介绍" |
||||
align="center" |
||||
prop="introduction" |
||||
/> |
||||
<el-table-column |
||||
label="企业成立时间" |
||||
align="center" |
||||
prop="establishmentDate" |
||||
width="180" |
||||
> |
||||
<template #default="scope"> |
||||
<span>{{ |
||||
parseTime(scope.row.establishmentDate, '{y}-{m}-{d}') |
||||
}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column |
||||
label="创建人" |
||||
align="center" |
||||
prop="creator" |
||||
/> |
||||
<el-table-column |
||||
label="修改人" |
||||
align="center" |
||||
prop="updater" |
||||
/> |
||||
<el-table-column |
||||
label="操作" |
||||
align="center" |
||||
class-name="small-padding fixed-width" |
||||
> |
||||
<template #default="scope"> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
icon="Edit" |
||||
@click="handleUpdate(scope.row)" |
||||
v-hasPermi="['system:enterprises:edit']" |
||||
>修改</el-button |
||||
> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
icon="Delete" |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['system:enterprises: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="800px" |
||||
append-to-body |
||||
> |
||||
<el-form |
||||
ref="enterprisesRef" |
||||
:model="form" |
||||
:rules="rules" |
||||
label-width="150px" |
||||
> |
||||
<!-- <el-form-item label="所属部门ID" prop="departmentId"> |
||||
<el-input v-model="form.departmentId" placeholder="请输入所属部门ID" /> |
||||
</el-form-item> |
||||
<el-form-item label="管辖人员ID" prop="userId"> |
||||
<el-input v-model="form.userId" placeholder="请输入管辖人员ID" /> |
||||
</el-form-item> --> |
||||
<el-form-item |
||||
label="企业所属区域" |
||||
prop="region" |
||||
> |
||||
<!-- <el-input v-model="form.region" placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区" /> --> |
||||
<el-select |
||||
v-model="form.region" |
||||
placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区" |
||||
> |
||||
<el-option |
||||
v-for="dict in enterprise_type" |
||||
:key="dict.value" |
||||
:lable="dict.value" |
||||
:value="dict.label" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item |
||||
label="企业名称" |
||||
prop="enterprisesName" |
||||
> |
||||
<el-input |
||||
v-model="form.enterprisesName" |
||||
placeholder="请输入企业名称" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item |
||||
label="企业地址" |
||||
prop="address" |
||||
> |
||||
<el-input |
||||
v-model="form.address" |
||||
type="textarea" |
||||
placeholder="请输入内容" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item |
||||
label="企业环保负责人姓名" |
||||
prop="environmentalContactName" |
||||
> |
||||
<el-select |
||||
v-model="value" |
||||
:empty-values="[null, undefined]" |
||||
:value-on-clear="null" |
||||
clearable |
||||
placeholder="Select" |
||||
style="width: 240px" |
||||
@clear="handleClear" |
||||
> |
||||
<el-option |
||||
v-for="item in options" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item |
||||
label="企业注册号" |
||||
prop="registrationNumber" |
||||
> |
||||
<el-input |
||||
v-model="form.registrationNumber" |
||||
placeholder="请输入企业注册号" |
||||
/> |
||||
</el-form-item> |
||||
|
||||
<el-form-item |
||||
label="企业成立时间" |
||||
prop="establishmentDate" |
||||
> |
||||
<el-date-picker |
||||
clearable |
||||
v-model="form.establishmentDate" |
||||
type="date" |
||||
value-format="YYYY-MM-DD" |
||||
placeholder="请选择企业成立时间" |
||||
> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item |
||||
label="企业图文介绍" |
||||
prop="introduction" |
||||
> |
||||
<el-input |
||||
v-model="form.introduction" |
||||
type="textarea" |
||||
placeholder="请输入内容" |
||||
/> |
||||
</el-form-item> |
||||
</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> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Enterprises"> |
||||
import { |
||||
listEnterprises, |
||||
getEnterprises, |
||||
delEnterprises, |
||||
addEnterprises, |
||||
updateEnterprises, |
||||
} from '@/api/system/enterprises/enterprises' |
||||
import { listDeptUser } from '@/api/system/user' |
||||
const { proxy } = getCurrentInstance() |
||||
const { enterprise_type } = proxy.useDict('enterprise_type') |
||||
const enterprisesList = ref([]) |
||||
const open = ref(false) |
||||
const loading = ref(true) |
||||
const showSearch = ref(true) |
||||
const ids = ref([]) |
||||
const single = ref(true) |
||||
const multiple = ref(true) |
||||
const total = ref(0) |
||||
const title = ref('') |
||||
|
||||
const data = reactive({ |
||||
form: {}, |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
departmentId: null, |
||||
userId: null, |
||||
type: null, |
||||
region: null, |
||||
enterprisesName: null, |
||||
address: null, |
||||
environmentalContactName: null, |
||||
environmentalContactPhone: null, |
||||
registrationNumber: null, |
||||
introduction: null, |
||||
establishmentDate: null, |
||||
creator: null, |
||||
updater: null, |
||||
deleted: null, |
||||
}, |
||||
rules: { |
||||
type: [ |
||||
{ required: true, message: '企业类型', trigger: 'change' }, |
||||
], |
||||
region: [ |
||||
{ required: true, message: '企业所属区域', trigger: 'blur' }, |
||||
], |
||||
enterprisesName: [ |
||||
{ |
||||
required: true, |
||||
message: '企业名称不能为空', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
createTime: [ |
||||
{ |
||||
required: true, |
||||
message: '创建时间不能为空', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
updateTime: [ |
||||
{ |
||||
required: true, |
||||
message: '更新时间不能为空', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
}) |
||||
|
||||
const { queryParams, form, rules } = toRefs(data) |
||||
|
||||
/** 查询企业列表 */ |
||||
function getList() { |
||||
loading.value = true |
||||
listEnterprises(queryParams.value).then(response => { |
||||
enterprisesList.value = response.rows |
||||
total.value = response.total |
||||
loading.value = false |
||||
}) |
||||
} |
||||
|
||||
// 取消按钮 |
||||
function cancel() { |
||||
open.value = false |
||||
reset() |
||||
} |
||||
|
||||
// 表单重置 |
||||
function reset() { |
||||
form.value = { |
||||
id: null, |
||||
departmentId: null, |
||||
userId: null, |
||||
type: null, |
||||
region: null, |
||||
enterprisesName: null, |
||||
address: null, |
||||
environmentalContactName: null, |
||||
environmentalContactPhone: null, |
||||
registrationNumber: null, |
||||
introduction: null, |
||||
establishmentDate: null, |
||||
creator: null, |
||||
createTime: null, |
||||
updateTime: null, |
||||
updater: null, |
||||
deleted: null, |
||||
} |
||||
proxy.resetForm('enterprisesRef') |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
function handleQuery() { |
||||
queryParams.value.pageNum = 1 |
||||
getList() |
||||
} |
||||
|
||||
/** 重置按钮操作 */ |
||||
function resetQuery() { |
||||
proxy.resetForm('queryRef') |
||||
handleQuery() |
||||
} |
||||
|
||||
// 多选框选中数据 |
||||
function handleSelectionChange(selection) { |
||||
ids.value = selection.map(item => item.id) |
||||
single.value = selection.length != 1 |
||||
multiple.value = !selection.length |
||||
} |
||||
|
||||
/** 新增按钮操作 */ |
||||
function handleAdd() { |
||||
reset() |
||||
userList() |
||||
open.value = true |
||||
title.value = '添加企业' |
||||
} |
||||
|
||||
/** 修改按钮操作 */ |
||||
function handleUpdate(row) { |
||||
reset() |
||||
const _id = row.id || ids.value |
||||
getEnterprises(_id).then(response => { |
||||
form.value = response.data |
||||
open.value = true |
||||
title.value = '修改企业' |
||||
}) |
||||
} |
||||
|
||||
/** 提交按钮 */ |
||||
function submitForm() { |
||||
proxy.$refs['enterprisesRef'].validate(valid => { |
||||
if (valid) { |
||||
if (form.value.id != null) { |
||||
updateEnterprises(form.value).then(response => { |
||||
proxy.$modal.msgSuccess('修改成功') |
||||
open.value = false |
||||
getList() |
||||
}) |
||||
} else { |
||||
addEnterprises(form.value).then(response => { |
||||
proxy.$modal.msgSuccess('新增成功') |
||||
open.value = false |
||||
getList() |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
/** 删除按钮操作 */ |
||||
function handleDelete(row) { |
||||
const _ids = row.id || ids.value |
||||
proxy.$modal |
||||
.confirm('是否确认删除企业编号为"' + _ids + '"的数据项?') |
||||
.then(function () { |
||||
return delEnterprises(_ids) |
||||
}) |
||||
.then(() => { |
||||
getList() |
||||
proxy.$modal.msgSuccess('删除成功') |
||||
}) |
||||
.catch(() => {}) |
||||
} |
||||
|
||||
/** 导出按钮操作 */ |
||||
function handleExport() { |
||||
proxy.download( |
||||
'system/enterprises/export', |
||||
{ |
||||
...queryParams.value, |
||||
}, |
||||
`enterprises_${new Date().getTime()}.xlsx` |
||||
) |
||||
} |
||||
|
||||
|
||||
function userList() { |
||||
listDeptUser().then(res => { |
||||
// enterprisesList.value = response.rows; |
||||
// total.value = response.total; |
||||
// loading.value = false; |
||||
console.log('res', res) |
||||
}) |
||||
} |
||||
|
||||
getList() |
||||
</script> |
@ -0,0 +1,43 @@
|
||||
<template> |
||||
<el-dialog v-model="show"> |
||||
<el-descriptions |
||||
title="Width vertical list" |
||||
direction="vertical" |
||||
border |
||||
style="margin-top: 20px" |
||||
> |
||||
<el-descriptions-item |
||||
:rowspan="2" |
||||
:width="140" |
||||
label="Photo" |
||||
align="center" |
||||
> |
||||
<el-image |
||||
style="width: 100px; height: 100px" |
||||
src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" |
||||
/> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item label="Username">kooriookami</el-descriptions-item> |
||||
<el-descriptions-item label="Telephone">18100000000</el-descriptions-item> |
||||
<el-descriptions-item label="Place">Suzhou</el-descriptions-item> |
||||
<el-descriptions-item label="Remarks"> |
||||
<el-tag size="small">School</el-tag> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item label="Address"> |
||||
No.1188, Wuzhong Avenue, Wuzhong District, Suzhou, Jiangsu Province |
||||
</el-descriptions-item> |
||||
</el-descriptions> |
||||
</el-dialog> |
||||
</template> |
||||
|
||||
<script setup> |
||||
const show = ref(false); |
||||
|
||||
function open(id) { |
||||
show.value = true; |
||||
} |
||||
|
||||
defineExpose({ open }); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,197 @@
|
||||
<template> |
||||
<section class="app-container"> |
||||
<el-form |
||||
:model="queryParams" |
||||
ref="queryRef" |
||||
:inline="true" |
||||
v-show="showSearch" |
||||
label-width="68px" |
||||
> |
||||
<el-form-item label="用户名称" prop="userName"> |
||||
<el-input |
||||
v-model="queryParams.userName" |
||||
placeholder="请输入用户名称" |
||||
clearable |
||||
style="width: 240px" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="创建时间" style="width: 308px"> |
||||
<el-date-picker |
||||
v-model="dateRange" |
||||
value-format="YYYY-MM-DD" |
||||
type="daterange" |
||||
range-separator="-" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="审批状态" style="width: 308px"> |
||||
<el-select placeholder="请选择审批状态" v-model="queryParams.audit"> |
||||
<el-option |
||||
v-for="dict in user_status" |
||||
:key="dict.value" |
||||
:label="dict.label" |
||||
:value="dict.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-row :gutter="10" class="mb8"> |
||||
<right-toolbar |
||||
v-model:showSearch="showSearch" |
||||
@queryTable="getList" |
||||
></right-toolbar> |
||||
</el-row> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="userList" |
||||
@selection-change="handleSelectionChange" |
||||
> |
||||
<el-table-column |
||||
label="姓名" |
||||
align="center" |
||||
key="realName" |
||||
prop="realName" |
||||
:show-overflow-tooltip="true" |
||||
/> |
||||
<el-table-column |
||||
label="手机号码" |
||||
align="center" |
||||
key="phonenumber" |
||||
prop="phonenumber" |
||||
/> |
||||
<el-table-column align="center" key="audit" prop="audit" label="申请角色"> |
||||
<template #default="scope"> |
||||
<DictTag :options="user_type" :value="scope.row.userType" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="创建时间" align="center" prop="createTime"> |
||||
<template #default="scope"> |
||||
<span>{{ parseTime(scope.row.createTime) }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="审批状态" align="center" key="audit" prop="audit"> |
||||
<template #default="scope"> |
||||
<dict-tag :options="user_status" :value="scope.row.audit" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column |
||||
label="审批内容" |
||||
align="center" |
||||
key="content" |
||||
prop="content" |
||||
/> |
||||
<el-table-column |
||||
label="操作" |
||||
align="center" |
||||
width="250" |
||||
class-name="small-padding fixed-width" |
||||
> |
||||
<template #default="scope"> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
v-if="scope.row.userType === '01'" |
||||
@click="showDetail" |
||||
> |
||||
<el-icon style="margin-right: 5px"><OfficeBuilding /></el-icon> |
||||
公司信息 |
||||
</el-button> |
||||
<el-button |
||||
link |
||||
type="danger" |
||||
@click="examine(scope.row)" |
||||
v-if="scope.row.audit == 1" |
||||
> |
||||
<el-icon style="margin-right: 5px"><Stamp /></el-icon> |
||||
审核 |
||||
</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" |
||||
/> |
||||
</section> |
||||
<ExamineForm ref="examineFormRef" @success="handleQuery" /> |
||||
<EnterprisesDetail ref="enterprisesDetailRef" /> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { getExamieList } from "@/api/system/user.js"; |
||||
import ExamineForm from "./examineform.vue"; |
||||
import EnterprisesDetail from "./enterprisesDetail.vue"; |
||||
|
||||
const userList = ref([]); |
||||
const loading = ref(true); |
||||
const total = ref(0); |
||||
const { proxy } = getCurrentInstance(); |
||||
const { user_status, user_type } = proxy.useDict("user_status", "user_type"); |
||||
const examineFormRef = ref(); |
||||
const enterprisesDetailRef = ref(); |
||||
|
||||
const data = reactive({ |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
deptId: undefined, |
||||
}, |
||||
}); |
||||
const { queryParams } = toRefs(data); |
||||
const dateRange = ref([]); |
||||
const showSearch = ref(true); |
||||
|
||||
/** 查询用户列表 */ |
||||
function getList() { |
||||
loading.value = true; |
||||
getExamieList(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; |
||||
getList(); |
||||
} |
||||
|
||||
/** 重置按钮操作 */ |
||||
function resetQuery() { |
||||
dateRange.value = []; |
||||
handleQuery(); |
||||
} |
||||
|
||||
/** |
||||
* 查看企业信息 |
||||
* @param id |
||||
*/ |
||||
function showDetail(id) { |
||||
unref(enterprisesDetailRef).open(id); |
||||
} |
||||
|
||||
/** |
||||
* 审核用户 |
||||
*/ |
||||
function examine(row) { |
||||
unref(examineFormRef).open(row); |
||||
} |
||||
|
||||
getList(); |
||||
</script> |
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,58 @@
|
||||
<template> |
||||
<el-dialog |
||||
v-model="show" |
||||
title="审核用户" |
||||
width="400px" |
||||
style="margin-top: 15vh" |
||||
> |
||||
<el-input |
||||
v-model="form.content" |
||||
type="textarea" |
||||
:autosize="{ |
||||
minRows: 4, |
||||
}" |
||||
placeholder="请输入审核意见" |
||||
/> |
||||
<template #footer> |
||||
<el-button type="success" @click="submit(2)"> |
||||
<el-icon style="margin-right: 5px"><Select /></el-icon> |
||||
通过 |
||||
</el-button> |
||||
<el-button type="danger" @click="submit(3)"> |
||||
<el-icon style="margin-right: 5px"><Close /></el-icon> |
||||
不通过 |
||||
</el-button> |
||||
</template> |
||||
</el-dialog> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { examineUser } from "@/api/system/user.js"; |
||||
|
||||
const { proxy } = getCurrentInstance(); |
||||
const emits = defineEmits(["success"]); |
||||
const show = ref(false); |
||||
const form = ref({ |
||||
content: "", |
||||
userId: undefined, |
||||
audit: undefined, |
||||
}); |
||||
|
||||
function open(param) { |
||||
form.value.userId = param.userId; |
||||
show.value = true; |
||||
} |
||||
|
||||
function submit(type) { |
||||
form.value.audit = type; |
||||
examineUser(form.value).then((res) => { |
||||
proxy.$modal.msgSuccess("审批成功"); |
||||
emits("success"); |
||||
show.value = false; |
||||
}); |
||||
} |
||||
|
||||
defineExpose({ open }); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
Loading…
Reference in new issue