Commit f69c6930 by ZP

feat(jcsj/bzxx): 更新班组信息组件配置和数据获取逻辑

- 更改API路径从CodeGeneration/selection到/bmxx/getEmployeeList和/bmxx/getworkteamList
- 更新API配置包括新的apiId、apiParams和SQL查询脚本
- 添加自定义渲染函数处理managerName和parentName显示
- 修改字段配置将placeholder设为自动生成,禁用自动编号字段
- 重构子表单配置将rokeEmployeeList更改为rokeWorkTeamEmployeeRelList
- 添加班组id和班组成员等新字段配置并设置为禁用状态
- 更新权限配置同步字段名称变更
- 实现afterFetch钩子异步获取员工和班组信息并映射到对应字段
parent 2fcdcc8a
export const permissionList = [ export const permissionList = [
{ {
required: true, required: false,
view: true, view: true,
edit: true, edit: false,
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
...@@ -106,9 +106,9 @@ export const permissionList = [ ...@@ -106,9 +106,9 @@ export const permissionList = [
disabled: false, disabled: false,
isSubTable: true, isSubTable: true,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '', fieldName: '',
fieldId: 'rokeEmployeeList', fieldId: 'rokeWorkTeamEmployeeRelList',
type: 'form', type: 'form',
key: '203371e1507844af97e5b82500bfc0c8', key: '203371e1507844af97e5b82500bfc0c8',
children: [ children: [
...@@ -120,11 +120,26 @@ export const permissionList = [ ...@@ -120,11 +120,26 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '班组id',
fieldId: 'workTeamId',
type: 'Input',
key: '41c418f3422e411fba4025e1ba607791',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '班组成员', fieldName: '班组成员',
fieldId: 'name', fieldId: 'danXingWenBen1923',
type: 'Input', type: 'Input',
key: '62efed4085cf4e368a702b2f8f76eabc', key: '1beafaffe43343a0b16f99b251346fea',
children: [], children: [],
}, },
{ {
...@@ -135,11 +150,11 @@ export const permissionList = [ ...@@ -135,11 +150,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '编号', fieldName: '编号',
fieldId: 'code', fieldId: 'danXingWenBen7962',
type: 'Input', type: 'Input',
key: 'e975697cbcf24c8a92cab2801ff637a0', key: '6788a481e9e7433b9c36e8dad4eeccdd',
children: [], children: [],
}, },
{ {
...@@ -150,11 +165,11 @@ export const permissionList = [ ...@@ -150,11 +165,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '工号', fieldName: '工号',
fieldId: 'jobNumber', fieldId: 'gongHao4014',
type: 'Input', type: 'Input',
key: '24544b2861214e55aca40e9963bbf656', key: '7b9f6f042ea340d09409b007adf681db',
children: [], children: [],
}, },
{ {
...@@ -165,11 +180,11 @@ export const permissionList = [ ...@@ -165,11 +180,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '电话', fieldName: '电话',
fieldId: 'phone', fieldId: 'dianHua7940',
type: 'Input', type: 'Input',
key: '744dd16ab5a142168c82096ea8a6ef27', key: '9170dea64ef8410597607c96057b7eeb',
children: [], children: [],
}, },
{ {
...@@ -180,11 +195,11 @@ export const permissionList = [ ...@@ -180,11 +195,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '职位', fieldName: '职位',
fieldId: 'positionId', fieldId: 'zhiWei8331',
type: 'Input', type: 'Input',
key: '57acb3998b07400e9661dfadff3debc3', key: '526f26d97e2e4b1f9800348c295d0d7d',
children: [], children: [],
}, },
{ {
...@@ -195,11 +210,11 @@ export const permissionList = [ ...@@ -195,11 +210,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '部门', fieldName: '部门',
fieldId: 'departmentId', fieldId: 'danXingWenBen7768',
type: 'Input', type: 'Input',
key: '4369fd57584d4ffc9b1d1392302b4348', key: 'f95aab6e4e4a46b2ba2e6b679f3521d8',
children: [], children: [],
}, },
{ {
...@@ -210,11 +225,11 @@ export const permissionList = [ ...@@ -210,11 +225,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeEmployeeList', tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '技能等级', fieldName: '技能等级',
fieldId: 'skillLevelId', fieldId: 'jiNenDengJi2532',
type: 'Input', type: 'Input',
key: 'ebc9d43a5f654f00b3d9e4414a715dfd', key: '03da44c148cb46c988a63c5d1f9f173e',
children: [], children: [],
}, },
], ],
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置 import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { defHttp } from '/@/utils/http/axios';
...@@ -184,12 +185,55 @@ ...@@ -184,12 +185,55 @@
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' } pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value; return pageParamsInfo.value;
}, },
afterFetch: (res) => { afterFetch: async (res) => {
if (res && res.items && res.items.length > 0) {
const managerIds = [...new Set(res.items.map(item => item.managerId).filter(Boolean))];
const parentIds = [...new Set(res.items.map(item => item.parentId).filter(Boolean))];
const managerMap = new Map();
const parentMap = new Map();
if (managerIds.length > 0) {
try {
const managerRes = await defHttp.get({
url: '/bmxx/getEmployeeList',
params: { ids: managerIds.join(',') },
});
if (managerRes && managerRes.length > 0) {
managerRes.forEach(item => {
managerMap.set(item.id, item.name);
});
}
} catch (error) {
console.error('获取班组长信息失败:', error);
}
}
if (parentIds.length > 0) {
try {
const parentRes = await defHttp.get({
url: '/bmxx/getworkteamList',
params: { ids: parentIds.join(',') },
});
if (parentRes && parentRes.length > 0) {
parentRes.forEach(item => {
parentMap.set(item.id, item.name);
});
}
} catch (error) {
console.error('获取上级班组信息失败:', error);
}
}
res.items.forEach(item => {
if (item.managerId) {
item.managerName = managerMap.get(item.managerId) || item.managerId;
}
if (item.parentId) {
item.parentName = parentMap.get(item.parentId) || item.parentId;
}
});
}
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment