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 @@ @@ -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 @@ /> + + +