新增岗位配置管理、部门新增部门号
parent
7813cb2100
commit
e2f3612e00
|
|
@ -0,0 +1,42 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// 岗位配置 VO
|
||||
export interface StationVO {
|
||||
id: number // 唯一标识符
|
||||
stationCode: string // 岗位代码
|
||||
stationName: string // 岗位名称
|
||||
professionalSequence: string // 岗位序列
|
||||
}
|
||||
|
||||
// 岗位配置 API
|
||||
export const StationApi = {
|
||||
// 查询岗位配置分页
|
||||
getStationPage: async (params: any) => {
|
||||
return await request.get({ url: `/salary/station/page`, params })
|
||||
},
|
||||
|
||||
// 查询岗位配置详情
|
||||
getStation: async (id: number) => {
|
||||
return await request.get({ url: `/salary/station/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增岗位配置
|
||||
createStation: async (data: StationVO) => {
|
||||
return await request.post({ url: `/salary/station/create`, data })
|
||||
},
|
||||
|
||||
// 修改岗位配置
|
||||
updateStation: async (data: StationVO) => {
|
||||
return await request.put({ url: `/salary/station/update`, data })
|
||||
},
|
||||
|
||||
// 删除岗位配置
|
||||
deleteStation: async (id: number) => {
|
||||
return await request.delete({ url: `/salary/station/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出岗位配置 Excel
|
||||
exportStation: async (params) => {
|
||||
return await request.download({ url: `/salary/station/export-excel`, params })
|
||||
},
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ import request from '@/config/axios'
|
|||
export interface DeptVO {
|
||||
id?: number
|
||||
name: string
|
||||
orgNo: string
|
||||
parentId: number
|
||||
status: number
|
||||
sort: number
|
||||
|
|
|
|||
|
|
@ -243,4 +243,5 @@ export enum DICT_TYPE {
|
|||
|
||||
// ===================人力资源模块======================
|
||||
ARCB_EMP_STATUS = 'arcb_emp_status', //员工状态
|
||||
ARCB_POSITION_CATEGORY = 'arcb_position_category' //岗位序列
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,13 +17,37 @@
|
|||
<el-input v-model="formData.empNo" placeholder="请输入工号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位" prop="station">
|
||||
<el-input v-model="formData.station" placeholder="请输入岗位" />
|
||||
<el-select
|
||||
v-model="formData.station"
|
||||
placeholder="请选择岗位"
|
||||
size="large"
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stationOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡号" prop="bankNo">
|
||||
<el-input v-model="formData.bankNo" placeholder="请输入银行卡号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属机构" prop="orgNo">
|
||||
<el-input v-model="formData.orgNo" placeholder="请输入所属机构" />
|
||||
<el-select
|
||||
v-model="formData.orgNo"
|
||||
placeholder="请选择所属机构"
|
||||
size="large"
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.orgNo"
|
||||
:label="item.name"
|
||||
:value="item.orgNo"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业年金帐号" prop="annuityNo">
|
||||
<el-input v-model="formData.annuityNo" placeholder="请输入企业年金帐号" />
|
||||
|
|
@ -50,7 +74,7 @@
|
|||
<el-radio
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.ARCB_EMP_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
:value="dict.value"
|
||||
>
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
|
|
@ -66,6 +90,8 @@
|
|||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { EmployeeApi, EmployeeVO } from '@/api/arcb/salary/employee'
|
||||
import {StationApi,StationVO} from '@/api/arcb/salary/station'
|
||||
import {DeptVO, getDeptPage} from "@/api/system/dept";
|
||||
|
||||
/** 员工花名册 表单 */
|
||||
defineOptions({ name: 'EmployeeForm' })
|
||||
|
|
@ -77,6 +103,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
let stationOptions = ref([])
|
||||
let deptOptions = ref([])
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
empName: undefined,
|
||||
|
|
@ -112,6 +140,8 @@ const formRef = ref() // 表单 Ref
|
|||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
await getStationOptions()
|
||||
await getOrgNo()
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
|
|
@ -126,6 +156,28 @@ const open = async (type: string, id?: number) => {
|
|||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
// 获取岗位下拉框
|
||||
const getStationOptions = async () =>{
|
||||
stationOptions.value = (await StationApi.getStationPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
})).list.map((item: StationVO) => {
|
||||
return {
|
||||
label: item.stationName,
|
||||
value: item.stationCode
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getOrgNo = async () =>{
|
||||
getDeptPage({
|
||||
pageNo: 1,
|
||||
pageSize: 200
|
||||
}).then(res => {
|
||||
deptOptions.value = res
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
|
|
|
|||
|
|
@ -8,15 +8,6 @@
|
|||
:inline="true"
|
||||
label-width="109px"
|
||||
>
|
||||
<el-form-item label="姓名" prop="empName">
|
||||
<el-input
|
||||
v-model="queryParams.empName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idNo">
|
||||
<el-input
|
||||
v-model="queryParams.idNo"
|
||||
|
|
@ -36,22 +27,20 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位" prop="station">
|
||||
<el-input
|
||||
<el-select
|
||||
v-model="queryParams.station"
|
||||
placeholder="请输入岗位"
|
||||
placeholder="请选择岗位"
|
||||
size="large"
|
||||
style="width: 240px"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡号" prop="bankNo">
|
||||
<el-input
|
||||
v-model="queryParams.bankNo"
|
||||
placeholder="请输入银行卡号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stationOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属机构" prop="orgNo">
|
||||
<el-input
|
||||
|
|
@ -62,42 +51,6 @@
|
|||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业年金帐号" prop="annuityNo">
|
||||
<el-input
|
||||
v-model="queryParams.annuityNo"
|
||||
placeholder="请输入企业年金帐号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社保账号" prop="socialSecurityNo">
|
||||
<el-input
|
||||
v-model="queryParams.socialSecurityNo"
|
||||
placeholder="请输入社保账号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="养老金帐号" prop="pensionNo">
|
||||
<el-input
|
||||
v-model="queryParams.pensionNo"
|
||||
placeholder="请输入养老金帐号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="住房公积金账号" prop="housingFundNo">
|
||||
<el-input
|
||||
v-model="queryParams.housingFundNo"
|
||||
placeholder="请输入住房公积金账号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-260px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参加工作时间" prop="workTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.workTime"
|
||||
|
|
@ -163,7 +116,17 @@
|
|||
<el-table-column label="姓名" align="center" prop="empName" />
|
||||
<el-table-column label="身份证号" align="center" prop="idNo" />
|
||||
<el-table-column label="工号" align="center" prop="empNo" />
|
||||
<el-table-column label="岗位" align="center" prop="station" />
|
||||
<el-table-column label="岗位" align="center" prop="station" >
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-for="item in stationOptions.filter(option => option.value === scope.row.station)"
|
||||
:key="item.value"
|
||||
:type="item.value === scope.row.station ? 'primary' : 'info'"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="银行卡号" align="center" prop="bankNo" />
|
||||
<el-table-column label="所属机构" align="center" prop="orgNo" />
|
||||
<el-table-column label="企业年金帐号" align="center" prop="annuityNo" />
|
||||
|
|
@ -218,6 +181,7 @@ import download from '@/utils/download'
|
|||
import { EmployeeApi, EmployeeVO } from '@/api/arcb/salary/employee'
|
||||
import EmployeeForm from './EmployeeForm.vue'
|
||||
import EmpImportForm from './EmployeeImportForm.vue'
|
||||
import {StationApi, StationVO} from "@/api/arcb/salary/station";
|
||||
|
||||
/** 员工花名册 列表 */
|
||||
defineOptions({ name: 'Employee' })
|
||||
|
|
@ -246,12 +210,14 @@ const queryParams = reactive({
|
|||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
let stationOptions = ref([])
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await EmployeeApi.getEmployeePage(queryParams)
|
||||
await getStationOptions()
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
|
@ -259,6 +225,18 @@ const getList = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const getStationOptions = async () =>{
|
||||
stationOptions.value = (await StationApi.getStationPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
})).list.map((item: StationVO) => {
|
||||
return {
|
||||
label: item.stationName,
|
||||
value: item.stationCode
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="岗位代码" prop="stationCode">
|
||||
<el-input v-model="formData.stationCode" placeholder="请输入岗位代码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位名称" prop="stationName">
|
||||
<el-input v-model="formData.stationName" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位序列" prop="professionalSequence">
|
||||
<el-select v-model="formData.professionalSequence" placeholder="请选择岗位序列">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.ARCB_POSITION_CATEGORY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { StationApi, StationVO } from '@/api/arcb/salary/station'
|
||||
|
||||
/** 岗位配置 表单 */
|
||||
defineOptions({ name: 'StationForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
stationCode: undefined,
|
||||
stationName: undefined,
|
||||
professionalSequence: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
stationCode: [
|
||||
{ required: true, message: '岗位代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
stationName: [
|
||||
{ required: true, message: '岗位名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
professionalSequence: [
|
||||
{ required: true, message: '岗位序列不能为空', trigger: 'blur' },
|
||||
]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await StationApi.getStation(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as StationVO
|
||||
if (formType.value === 'create') {
|
||||
await StationApi.createStation(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await StationApi.updateStation(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
stationCode: undefined,
|
||||
stationName: undefined,
|
||||
professionalSequence: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,220 @@
|
|||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="岗位代码" prop="stationCode">
|
||||
<el-input
|
||||
v-model="queryParams.stationCode"
|
||||
placeholder="请输入岗位代码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位名称" prop="stationName">
|
||||
<el-input
|
||||
v-model="queryParams.stationName"
|
||||
placeholder="请输入岗位名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位序列" prop="professionalSequence">
|
||||
<el-select
|
||||
v-model="queryParams.professionalSequence"
|
||||
placeholder="请选择岗位序列"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.ARCB_POSITION_CATEGORY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['salary:station:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['salary:station:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<!-- <el-table-column label="通道层级" align="center" prop="id" />-->
|
||||
<el-table-column label="岗位代码" align="center" prop="stationCode" />
|
||||
<el-table-column label="岗位名称" align="center" prop="stationName" />
|
||||
<el-table-column label="岗位序列" align="center" prop="professionalSequence">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.ARCB_POSITION_CATEGORY" :value="scope.row.professionalSequence" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['salary:station:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['salary:station:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<StationForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { StationApi, StationVO } from '@/api/arcb/salary/station'
|
||||
import StationForm from './StationForm.vue'
|
||||
|
||||
/** 岗位配置 列表 */
|
||||
defineOptions({ name: 'Station' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<StationVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
stationCode: undefined,
|
||||
stationName: undefined,
|
||||
professionalSequence: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await StationApi.getStationPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await StationApi.deleteStation(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await StationApi.exportStation(queryParams)
|
||||
download.excel(data, '岗位配置.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -21,6 +21,9 @@
|
|||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门号" prop="orgNo">
|
||||
<el-input v-model="formData.orgNo" placeholder="请输入部门号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :min="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
|
|
@ -79,6 +82,7 @@ const formData = ref({
|
|||
title: '',
|
||||
parentId: undefined,
|
||||
name: undefined,
|
||||
orgNo: undefined,
|
||||
sort: undefined,
|
||||
leaderUserId: undefined,
|
||||
phone: undefined,
|
||||
|
|
@ -88,6 +92,7 @@ const formData = ref({
|
|||
const formRules = reactive<FormRules>({
|
||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
||||
orgNo: [{ required: true, message: '部门号不能为空', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
|
||||
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
|
||||
phone: [
|
||||
|
|
@ -154,6 +159,7 @@ const resetForm = () => {
|
|||
title: '',
|
||||
parentId: undefined,
|
||||
name: undefined,
|
||||
orgNo: undefined,
|
||||
sort: undefined,
|
||||
leaderUserId: undefined,
|
||||
phone: undefined,
|
||||
|
|
|
|||
Loading…
Reference in New Issue