From 697608b5bb415202f70970b97a32491e3676e28b Mon Sep 17 00:00:00 2001
From: hky <1499449886@qq.com>
Date: Fri, 3 Jan 2025 19:31:42 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=91=98=E5=B7=A5=E8=8A=B1?=
=?UTF-8?q?=E5=90=8D=E5=86=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/arcb/salary/station/index.ts | 86 ++++++-------
.../arcb/salary/employee/EmployeeForm.vue | 106 +++++++++++++---
src/views/arcb/salary/employee/index.vue | 118 ++++++++++++++----
src/views/arcb/salary/station/StationForm.vue | 16 +++
src/views/arcb/salary/station/index.vue | 4 +
5 files changed, 246 insertions(+), 84 deletions(-)
diff --git a/src/api/arcb/salary/station/index.ts b/src/api/arcb/salary/station/index.ts
index fba2fdc3e..66010ee20 100644
--- a/src/api/arcb/salary/station/index.ts
+++ b/src/api/arcb/salary/station/index.ts
@@ -1,42 +1,44 @@
-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 })
- },
-}
\ No newline at end of file
+import request from '@/config/axios'
+
+// 岗位配置 VO
+export interface StationVO {
+ id: number // 唯一标识符
+ channelHierarchy: string, //通道层级
+ stationCode: string // 岗位代码
+ stationName: string // 岗位名称
+ professionalSequence: string // 岗位序列
+ accordingToQls: 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 })
+ },
+}
diff --git a/src/views/arcb/salary/employee/EmployeeForm.vue b/src/views/arcb/salary/employee/EmployeeForm.vue
index 05d0392b2..ce5e3eacb 100644
--- a/src/views/arcb/salary/employee/EmployeeForm.vue
+++ b/src/views/arcb/salary/employee/EmployeeForm.vue
@@ -17,19 +17,23 @@
-
-
+
+
+
+
+ {{ item.label }}({{ getSequenceLabel(item.key) }})
+ 比照区联社: {{ item.accordingToQls }}
+
+
+
@@ -173,16 +177,60 @@ 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 getStationOptions = async () => {
- stationOptions.value = (await StationApi.getStationPage({
+ const response = await StationApi.getStationPage({
pageNo: 1,
pageSize: 100
- })).list.map((item: StationVO) => {
- return {
- label: item.stationName,
- value: item.stationCode
+ });
+ const stationList = response.list;
+
+ const groupedStations = stationList.reduce((acc, item: StationVO) => {
+ const group = item.channelHierarchy;
+ if (!acc[group]) {
+ acc[group] = [];
}
- })
+ acc[group].push({
+ label: item.stationName,
+ value: item.stationCode,
+ key: item.professionalSequence,
+ accordingToQls: item.accordingToQls
+ });
+ return acc;
+ }, {} as Record);
+
+ stationOptions.value = Object.keys(groupedStations).map(group => ({
+ label: `通道层级: ${group}`,
+ options: groupedStations[group].map(option => ({
+ ...option,
+ key: option.key,
+ accordingToQls: option.accordingToQls
+ }))
+ }));
+}
+
+/** 根据 professionalSequence 获取序列标签 */
+const getSequenceLabel = (sequence: string): string => {
+ switch (sequence) {
+ case '0':
+ return '管理序列';
+ case '1':
+ return '专业序列';
+ case '2':
+ return '非领导职务';
+ default:
+ return '未知序列';
+ }
}
const getOrgNo = async () => {
@@ -237,4 +285,22 @@ const resetForm = () => {
}
formRef.value?.resetFields()
}
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/src/views/arcb/salary/employee/index.vue b/src/views/arcb/salary/employee/index.vue
index 1eef10b7c..d35d93278 100644
--- a/src/views/arcb/salary/employee/index.vue
+++ b/src/views/arcb/salary/employee/index.vue
@@ -27,19 +27,23 @@
/>
-
-
+
+
+
+
+ {{ item.label }}({{ getSequenceLabel(item.key) }})
+ 比照区联社: {{ item.accordingToQls }}
+
+
+
@@ -132,11 +136,13 @@
- {{ item.label }}
+ {{ item.label }}({{ getSequenceLabel(item.key) }})(比照区联社:{{item.accordingToQls}})
@@ -241,18 +247,68 @@ 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 getStationOptions = async () => {
- stationOptions.value = (await StationApi.getStationPage({
+ const response = await StationApi.getStationPage({
pageNo: 1,
pageSize: 100
- })).list.map((item: StationVO) => {
- return {
- label: item.stationName,
- value: item.stationCode
+ });
+ const stationList = response.list;
+
+ const groupedStations = stationList.reduce((acc, item: StationVO) => {
+ const group = item.channelHierarchy;
+ if (!acc[group]) {
+ acc[group] = [];
}
- })
+ acc[group].push({
+ label: item.stationName,
+ value: item.stationCode,
+ key: item.professionalSequence,
+ accordingToQls: item.accordingToQls
+ });
+ return acc;
+ }, {} as Record);
+
+ stationOptions.value = Object.keys(groupedStations).map(group => ({
+ label: `通道层级: ${group}`,
+ options: groupedStations[group].map(option => ({
+ ...option,
+ key: option.key,
+ accordingToQls: option.accordingToQls
+ }))
+ }));
}
+/** 根据 professionalSequence 获取序列标签 */
+const getSequenceLabel = (sequence: string): string => {
+ switch (sequence) {
+ case '0':
+ return '管理序列';
+ case '1':
+ return '专业序列';
+ case '2':
+ return '非领导职务';
+ default:
+ return '未知序列';
+ }
+}
+// const getSequenceLabel = (sequence: string): string => {
+// const dictOptions = getStrDictOptions(DICT_TYPE.ARCB_POSITION_CATEGORY);
+// const dictOption = dictOptions.find(option => option.value === sequence);
+// return dictOption ? dictOption.label : '未知序列';
+// }
+
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
@@ -309,4 +365,22 @@ const handleExport = async () => {
onMounted(() => {
getList()
})
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/src/views/arcb/salary/station/StationForm.vue b/src/views/arcb/salary/station/StationForm.vue
index f69b10766..9857d075c 100644
--- a/src/views/arcb/salary/station/StationForm.vue
+++ b/src/views/arcb/salary/station/StationForm.vue
@@ -7,6 +7,9 @@
label-width="100px"
v-loading="formLoading"
>
+
+
+
@@ -23,6 +26,9 @@
/>
+
+
+
确 定
@@ -46,11 +52,16 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formData = ref({
id: undefined,
+ channelHierarchy: undefined,
stationCode: undefined,
stationName: undefined,
professionalSequence: undefined,
+ accordingToQls: undefined
})
const formRules = reactive({
+ channelHierarchy: [
+ { required: true, message: '通道层级不能为空', trigger: 'blur' }
+ ],
stationCode: [
{ required: true, message: '岗位代码不能为空', trigger: 'blur' }
],
@@ -59,6 +70,9 @@ const formRules = reactive({
],
professionalSequence: [
{ required: true, message: '岗位序列不能为空', trigger: 'blur' },
+ ],
+ accordingToQls: [
+ { required: true, message: '比照区联社不能为空', trigger: 'blur' }
]
})
const formRef = ref() // 表单 Ref
@@ -110,9 +124,11 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: undefined,
+ channelHierarchy: undefined,
stationCode: undefined,
stationName: undefined,
professionalSequence: undefined,
+ accordingToQls: undefined
}
formRef.value?.resetFields()
}
diff --git a/src/views/arcb/salary/station/index.vue b/src/views/arcb/salary/station/index.vue
index c0889a0f9..e41e6f1e9 100644
--- a/src/views/arcb/salary/station/index.vue
+++ b/src/views/arcb/salary/station/index.vue
@@ -93,6 +93,7 @@
+
@@ -100,6 +101,7 @@
:value="scope.row.professionalSequence"/>
+