Commit 3e41c784 by ZP

feat(jcsj): 添加团队管理模块的API接口和数据模型

- 创建MesWorkTeam分页参数、返回值模型和结果类型定义
- 实现团队管理相关的增删改查API接口
- 添加分页查询、详情获取、新增、更新、删除等完整CRUD操作
- 集成基础HTTP请求工具和错误处理机制
- 定义团队管理模块的API端点枚举
- 提供批量删除功能支持
parent 0e0c2a92
import { RokeWorkTeamPageModel, RokeWorkTeamPageParams, RokeWorkTeamPageResult } from './model/BzxxModel'; import { MesWorkTeamPageModel, MesWorkTeamPageParams, MesWorkTeamPageResult } from './model/TeamManagementModel';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
enum Api { enum Api {
Page = '/jcsj/bzxx/page', Page = '/jcsj/teammanagement/page',
List = '/jcsj/bzxx/list', List = '/jcsj/teammanagement/list',
Info = '/jcsj/bzxx/info', Info = '/jcsj/teammanagement/info',
RokeWorkTeam = '/jcsj/bzxx', MesWorkTeam = '/jcsj/teammanagement',
} }
/** /**
* @description: 查询RokeWorkTeam分页列表 * @description: 查询MesWorkTeam分页列表
*/ */
export async function getRokeWorkTeamPage(params: RokeWorkTeamPageParams, mode: ErrorMessageMode = 'modal') { export async function getMesWorkTeamPage(params: MesWorkTeamPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeWorkTeamPageResult>( return defHttp.get<MesWorkTeamPageResult>(
{ {
url: Api.Page, url: Api.Page,
params, params,
...@@ -29,10 +29,10 @@ export async function getRokeWorkTeamPage(params: RokeWorkTeamPageParams, mode: ...@@ -29,10 +29,10 @@ export async function getRokeWorkTeamPage(params: RokeWorkTeamPageParams, mode:
} }
/** /**
* @description: 获取RokeWorkTeam信息 * @description: 获取MesWorkTeam信息
*/ */
export async function getRokeWorkTeam(id: String, mode: ErrorMessageMode = 'modal') { export async function getMesWorkTeam(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeWorkTeamPageModel>( return defHttp.get<MesWorkTeamPageModel>(
{ {
url: Api.Info, url: Api.Info,
params: { id }, params: { id },
...@@ -44,13 +44,13 @@ export async function getRokeWorkTeam(id: String, mode: ErrorMessageMode = 'moda ...@@ -44,13 +44,13 @@ export async function getRokeWorkTeam(id: String, mode: ErrorMessageMode = 'moda
} }
/** /**
* @description: 新增RokeWorkTeam * @description: 新增MesWorkTeam
*/ */
export async function addRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMessageMode = 'modal') { export async function addMesWorkTeam(mesWorkTeam: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.RokeWorkTeam, url: Api.MesWorkTeam,
params: rokeWorkTeam, params: mesWorkTeam,
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode,
...@@ -59,13 +59,13 @@ export async function addRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMessa ...@@ -59,13 +59,13 @@ export async function addRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMessa
} }
/** /**
* @description: 更新RokeWorkTeam * @description: 更新MesWorkTeam
*/ */
export async function updateRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMessageMode = 'modal') { export async function updateMesWorkTeam(mesWorkTeam: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>( return defHttp.put<boolean>(
{ {
url: Api.RokeWorkTeam, url: Api.MesWorkTeam,
params: rokeWorkTeam, params: mesWorkTeam,
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode,
...@@ -74,12 +74,12 @@ export async function updateRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMe ...@@ -74,12 +74,12 @@ export async function updateRokeWorkTeam(rokeWorkTeam: Recordable, mode: ErrorMe
} }
/** /**
* @description: 删除RokeWorkTeam(批量删除) * @description: 删除MesWorkTeam(批量删除)
*/ */
export async function deleteRokeWorkTeam(ids: string[], mode: ErrorMessageMode = 'modal') { export async function deleteMesWorkTeam(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>( return defHttp.delete<boolean>(
{ {
url: Api.RokeWorkTeam, url: Api.MesWorkTeam,
data: ids, data: ids,
}, },
{ {
......
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/** /**
* @description: RokeWorkTeam分页参数 模型 * @description: MesWorkTeam分页参数 模型
*/ */
export interface RokeWorkTeamPageParams extends BasicPageParams { export interface MesWorkTeamPageParams extends BasicPageParams {
code: string; code: string;
name: string; name: string;
...@@ -16,9 +16,9 @@ export interface RokeWorkTeamPageParams extends BasicPageParams { ...@@ -16,9 +16,9 @@ export interface RokeWorkTeamPageParams extends BasicPageParams {
} }
/** /**
* @description: RokeWorkTeam分页返回值模型 * @description: MesWorkTeam分页返回值模型
*/ */
export interface RokeWorkTeamPageModel { export interface MesWorkTeamPageModel {
id: string; id: string;
code: string; code: string;
...@@ -35,6 +35,6 @@ export interface RokeWorkTeamPageModel { ...@@ -35,6 +35,6 @@ export interface RokeWorkTeamPageModel {
0; 0;
/** /**
* @description: RokeWorkTeam分页返回值结构 * @description: MesWorkTeam分页返回值结构
*/ */
export type RokeWorkTeamPageResult = BasicFetchResult<RokeWorkTeamPageModel>; export type MesWorkTeamPageResult = BasicFetchResult<MesWorkTeamPageModel>;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import { reactive, ref, onMounted, nextTick, watch } from 'vue'; import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config'; import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue'; import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addRokeWorkTeam, getRokeWorkTeam, updateRokeWorkTeam } from '/@/api/jcsj/bzxx'; import { addMesWorkTeam, getMesWorkTeam, updateMesWorkTeam } from '/@/api/jcsj/teammanagement';
import { cloneDeep, isString } from 'lodash-es'; import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types'; import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) { async function setFormDataFromId(rowId) {
try { try {
const record = await getRokeWorkTeam(rowId); const record = await getMesWorkTeam(rowId);
setFieldsValue(record); setFieldsValue(record);
state.formModel = record; state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, await getFormDataEvent(formEventConfigs, state.formModel,
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
try { try {
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateRokeWorkTeam(values); let saveVal = await updateMesWorkTeam(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
async function add(values) { async function add(values) {
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addRokeWorkTeam(values); let saveVal = await addMesWorkTeam(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
......
...@@ -22,16 +22,16 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -22,16 +22,16 @@ export const searchFormSchema: FormSchema[] = [
componentProps: { componentProps: {
datasourceType: 'api', datasourceType: 'api',
apiConfig: { apiConfig: {
path: '/bmxx/getEmployeeList', path: '/bmxx/getUserList',
method: 'GET', method: 'GET',
apiId: 'copy1765432049337d61208', apiId: '4a32e7b049c54b6fa7e88ef1cb04cbb8',
apiParams: [ apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] }, { key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] }, { key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select *,id as value,name as label from roke_employee where active = 1 and delete_mark = 0";\r\nreturn db.select(sql);', 'var sql="select id as value,name as label from xjr_user";\r\nreturn db.select(sql);',
}, },
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
...@@ -57,7 +57,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -57,7 +57,7 @@ export const searchFormSchema: FormSchema[] = [
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select id as value,name as label from roke_work_team";\r\nreturn db.select(sql);', 'var sql="select id as value,name as label from mes_work_team";\r\nreturn db.select(sql);',
}, },
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
...@@ -79,13 +79,13 @@ export const columns: BasicColumn[] = [ ...@@ -79,13 +79,13 @@ export const columns: BasicColumn[] = [
resizable: true, resizable: true,
dataIndex: 'code', dataIndex: 'code',
title: '编号', title: '编号',
componentType: 'input', componentType: 'auto-code',
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: undefined,
}, },
{ {
...@@ -112,7 +112,6 @@ export const columns: BasicColumn[] = [ ...@@ -112,7 +112,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
customRender: ({ record }) => record.managerName || record.managerId,
}, },
{ {
...@@ -126,7 +125,6 @@ export const columns: BasicColumn[] = [ ...@@ -126,7 +125,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
customRender: ({ record }) => record.parentName || record.parentId,
}, },
{ {
...@@ -225,35 +223,24 @@ export const formProps: FormProps = { ...@@ -225,35 +223,24 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '74656a9a548a4ebf8eea9833e58c9751', key: '89f7e227ec084427bd58504cf7184d06',
field: 'code', field: 'code',
label: '编号', label: '编号',
type: 'input', type: 'auto-code',
component: 'Input', component: 'AutoCodeRule',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '',
placeholder: '自动生成', placeholder: '自动生成',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true, showLabel: true,
autoCodeRule: 'BZ',
required: false, required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
...@@ -318,22 +305,22 @@ export const formProps: FormProps = { ...@@ -318,22 +305,22 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null, defaultSelect: '',
datasourceType: 'api', datasourceType: 'api',
params: null, params: null,
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: '/bmxx/getEmployeeList', path: '/bmxx/getUserList',
method: 'GET', method: 'GET',
apiId: 'copy1765432049337d61208', apiId: '4a32e7b049c54b6fa7e88ef1cb04cbb8',
apiParams: [ apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] }, { key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] }, { key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select *,id as value,name as label from roke_employee where active = 1 and delete_mark = 0";\r\nreturn db.select(sql);', 'var sql="select id as value,name as label from xjr_user";\r\nreturn db.select(sql);',
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
...@@ -366,7 +353,7 @@ export const formProps: FormProps = { ...@@ -366,7 +353,7 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null, defaultSelect: '',
datasourceType: 'api', datasourceType: 'api',
params: null, params: null,
labelField: 'label', labelField: 'label',
...@@ -381,7 +368,7 @@ export const formProps: FormProps = { ...@@ -381,7 +368,7 @@ export const formProps: FormProps = {
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select id as value,name as label from roke_work_team";\r\nreturn db.select(sql);', 'var sql="select id as value,name as label from mes_work_team";\r\nreturn db.select(sql);',
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
...@@ -412,9 +399,16 @@ export const formProps: FormProps = { ...@@ -412,9 +399,16 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
codeType: 'api', codeType: 'api',
apiConfig: { apiConfig: {
path: 'CodeGeneration/qr-code', path: '/gjzj/qrCode',
method: 'GET', method: 'GET',
apiId: '8aad311cb2b248b39e9227d4bad94c9b', apiId: '',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'// 力软平台专属:不使用encodeURIComponent,直接拼接文本\r\nvar workTeamId = "";\r\ntry {\r\n workTeamId = @id; // 取当前班组ID\r\n} catch(e) {\r\n workTeamId = "";\r\n}\r\n\r\n// 拼接班组信息(直接用纯文本,组件会自动生成对应二维码)\r\nvar qrContent = "暂无班组信息";\r\nif (workTeamId) {\r\n var teamSql = "SELECT code, name FROM mes_work_team WHERE id = ?";\r\n var teamInfo = db.selectOne(teamSql, [workTeamId]);\r\n if (teamInfo) {\r\n // 直接拼接纯文本,不需要编码\r\n qrContent = "班组编号:" + (teamInfo.code || "无") + "\\n班组名称:" + (teamInfo.name || "无");\r\n } else {\r\n qrContent = "班组ID:" + workTeamId + "\\n信息不存在";\r\n }\r\n}\r\n\r\n// 关键:直接返回纯文本(力软组件会自动将文本转为二维码)\r\nreturn qrContent;',
}, },
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: {}, style: {},
...@@ -485,20 +479,20 @@ export const formProps: FormProps = { ...@@ -485,20 +479,20 @@ export const formProps: FormProps = {
conImageUrl: '', conImageUrl: '',
list: [ list: [
{ {
key: '203371e1507844af97e5b82500bfc0c8', key: '38d17aefe9d04436afcb089f13a0a5a3',
label: '', label: '',
field: 'rokeWorkTeamEmployeeRelList', field: 'mesWorkTeamUserRelList',
type: 'form', type: 'form',
component: 'SubForm', component: 'SubForm',
required: true, required: true,
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
mainKey: 'rokeWorkTeamEmployeeRelList', mainKey: 'mesWorkTeamUserRelList',
columns: [ columns: [
{ {
key: '41c418f3422e411fba4025e1ba607791', key: '6cbbc9e327df4cccb22c7bdb74bbc001',
title: '班组id', title: 'id',
dataIndex: 'workTeamId', dataIndex: 'userId',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -524,12 +518,13 @@ export const formProps: FormProps = { ...@@ -524,12 +518,13 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'user_id',
}, },
}, },
{ {
key: '1beafaffe43343a0b16f99b251346fea', key: '5cca541858134efc997cfdf98bfe5f32',
title: '班组成员', title: '班组成员',
dataIndex: 'danXingWenBen1923', dataIndex: 'name',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -542,25 +537,26 @@ export const formProps: FormProps = { ...@@ -542,25 +537,26 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'member_name',
}, },
}, },
{ {
key: '6788a481e9e7433b9c36e8dad4eeccdd', key: '55598eb1e4324950ae9fcfb6302f6538',
title: '编号', title: '编号',
dataIndex: 'danXingWenBen7962', dataIndex: 'code',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -573,25 +569,26 @@ export const formProps: FormProps = { ...@@ -573,25 +569,26 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'user_code',
}, },
}, },
{ {
key: '7b9f6f042ea340d09409b007adf681db', key: 'abfc9b9517684121bfbbe019011b6b87',
title: '工号', title: '工号',
dataIndex: 'gongHao4014', dataIndex: 'jobNumber',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -604,25 +601,26 @@ export const formProps: FormProps = { ...@@ -604,25 +601,26 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'user_code',
}, },
}, },
{ {
key: '9170dea64ef8410597607c96057b7eeb', key: 'b595d86fee7944b38a37be605b7b117a',
title: '电话', title: '电话',
dataIndex: 'dianHua7940', dataIndex: 'mobile',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -635,25 +633,26 @@ export const formProps: FormProps = { ...@@ -635,25 +633,26 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'mobile',
}, },
}, },
{ {
key: '526f26d97e2e4b1f9800348c295d0d7d', key: '21de2c57b40e4a539b51bed6bb4ae019',
title: '职位', title: '职位',
dataIndex: 'zhiWei8331', dataIndex: 'positionId',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -666,56 +665,26 @@ export const formProps: FormProps = { ...@@ -666,56 +665,26 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'position_name',
}, },
}, },
{ {
key: 'f95aab6e4e4a46b2ba2e6b679f3521d8', key: 'a665bb78d37c409fb4d1a7cb888f1872',
title: '部门', title: '部门',
dataIndex: 'danXingWenBen7768', dataIndex: 'departmentId',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '03da44c148cb46c988a63c5d1f9f173e',
title: '技能等级',
dataIndex: 'jiNenDengJi2532',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -728,30 +697,51 @@ export const formProps: FormProps = { ...@@ -728,30 +697,51 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: true, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: true, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'department_name',
}, },
}, },
{ title: '操作', key: 'action', fixed: 'right', width: '50px' }, { title: '操作', key: 'action', fixed: 'right', width: '50px' },
], ],
span: '24', span: '24',
preloadType: 'api', preloadType: 'api',
apiConfig: {}, apiConfig: {
path: '/bmxx/getbzcyList',
method: 'GET',
apiId: '540d7cbc36af4f299bb6cee5251ce8a8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = `\r\nSELECT\r\n u.id AS value,\r\n u.name AS label,\r\n\r\n u.name AS member_name, -- 班组成员\r\n u.code AS user_code, -- 编号\r\n IFNULL(rel.job_number,'') AS job_number, -- 工号\r\n u.mobile AS mobile, -- 电话\r\n\r\n IFNULL(pos.name,'') AS position_name, -- 职位\r\n IFNULL(dept.name,'') AS department_name -- 部门\r\nFROM xjr_user u\r\nLEFT JOIN mes_work_team_user_rel rel\r\n ON rel.user_id = u.id\r\nLEFT JOIN roke_position_dict pos\r\n ON pos.id = rel.position_id\r\nLEFT JOIN xjr_department dept\r\n ON dept.id = rel.department_id\r\nWHERE u.enabled_mark = 1\r\n AND u.delete_mark = 0\r\n AND u.id NOT IN (\r\n SELECT user_id\r\n FROM mes_work_team_user_rel\r\n WHERE work_team_id = '#work_team_id#'\r\n )\r\nORDER BY u.name\r\n`;\r\n\r\nreturn db.select(sql);\r\n\r\n\r\n\r\n\r\n// var sql = `\r\n// SELECT\r\n// u.id AS value,\r\n// u.name AS label,\r\n\r\n// u.name AS member_name, -- 班组成员\r\n// u.code AS user_code, -- 编号\r\n// rel.job_number AS job_number, -- 工号\r\n// u.mobile AS mobile, -- 电话\r\n\r\n// pos.name AS position_name, -- 职位\r\n// dept.name AS department_name -- 部门\r\n\r\n// FROM xjr_user u\r\n// LEFT JOIN mes_work_team_user_rel rel\r\n// ON rel.user_id = u.id\r\n// LEFT JOIN roke_position_dict pos\r\n// ON pos.id = rel.position_id\r\n// LEFT JOIN xjr_department dept\r\n// ON dept.id = rel.department_id\r\n\r\n// WHERE u.enabled_mark = 1\r\n// AND u.delete_mark = 0\r\n// `;\r\n// return db.select(sql);\r\n",
outputParams: [
{ tableTitle: 'ID', name: 'user_id' },
{ tableTitle: '班组成员', name: 'member_name' },
{ tableTitle: '编号', name: 'user_code' },
{ tableTitle: '工号', name: 'user_code' },
{ tableTitle: '电话', name: 'mobile' },
{ tableTitle: '职位', name: 'position_name' },
{ name: 'department_name', tableTitle: '部门' },
],
},
itemId: '', itemId: '',
dicOptions: [], dicOptions: [],
useSelectButton: false, useSelectButton: true,
buttonName: '选择数据', buttonName: '新增',
showLabel: true, showLabel: true,
showComponentBorder: true, showComponentBorder: true,
showBorder: false, showBorder: false,
...@@ -768,7 +758,7 @@ export const formProps: FormProps = { ...@@ -768,7 +758,7 @@ export const formProps: FormProps = {
isDeleteSelected: false, isDeleteSelected: false,
isListView: false, isListView: false,
viewList: [], viewList: [],
isShowAdd: true, isShowAdd: false,
isShowDelete: true, isShowDelete: true,
hasCheckedCol: false, hasCheckedCol: false,
events: {}, events: {},
......
...@@ -3,18 +3,17 @@ export const permissionList = [ ...@@ -3,18 +3,17 @@ export const permissionList = [
required: false, required: false,
view: true, view: true,
edit: false, edit: false,
disabled: false, disabled: true,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '编号', fieldName: '编号',
fieldId: 'code', fieldId: 'code',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'auto-code',
key: '74656a9a548a4ebf8eea9833e58c9751', key: '89f7e227ec084427bd58504cf7184d06',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: true, required: true,
...@@ -106,11 +105,11 @@ export const permissionList = [ ...@@ -106,11 +105,11 @@ export const permissionList = [
disabled: false, disabled: false,
isSubTable: true, isSubTable: true,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '', fieldName: '',
fieldId: 'rokeWorkTeamEmployeeRelList', fieldId: 'mesWorkTeamUserRelList',
type: 'form', type: 'form',
key: '203371e1507844af97e5b82500bfc0c8', key: '38d17aefe9d04436afcb089f13a0a5a3',
children: [ children: [
{ {
required: true, required: true,
...@@ -120,11 +119,11 @@ export const permissionList = [ ...@@ -120,11 +119,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '班组id', fieldName: 'id',
fieldId: 'workTeamId', fieldId: 'userId',
type: 'Input', type: 'Input',
key: '41c418f3422e411fba4025e1ba607791', key: '6cbbc9e327df4cccb22c7bdb74bbc001',
children: [], children: [],
}, },
{ {
...@@ -135,11 +134,11 @@ export const permissionList = [ ...@@ -135,11 +134,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '班组成员', fieldName: '班组成员',
fieldId: 'danXingWenBen1923', fieldId: 'name',
type: 'Input', type: 'Input',
key: '1beafaffe43343a0b16f99b251346fea', key: '5cca541858134efc997cfdf98bfe5f32',
children: [], children: [],
}, },
{ {
...@@ -150,11 +149,11 @@ export const permissionList = [ ...@@ -150,11 +149,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '编号', fieldName: '编号',
fieldId: 'danXingWenBen7962', fieldId: 'code',
type: 'Input', type: 'Input',
key: '6788a481e9e7433b9c36e8dad4eeccdd', key: '55598eb1e4324950ae9fcfb6302f6538',
children: [], children: [],
}, },
{ {
...@@ -165,11 +164,11 @@ export const permissionList = [ ...@@ -165,11 +164,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '工号', fieldName: '工号',
fieldId: 'gongHao4014', fieldId: 'jobNumber',
type: 'Input', type: 'Input',
key: '7b9f6f042ea340d09409b007adf681db', key: 'abfc9b9517684121bfbbe019011b6b87',
children: [], children: [],
}, },
{ {
...@@ -180,11 +179,11 @@ export const permissionList = [ ...@@ -180,11 +179,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '电话', fieldName: '电话',
fieldId: 'dianHua7940', fieldId: 'mobile',
type: 'Input', type: 'Input',
key: '9170dea64ef8410597607c96057b7eeb', key: 'b595d86fee7944b38a37be605b7b117a',
children: [], children: [],
}, },
{ {
...@@ -195,11 +194,11 @@ export const permissionList = [ ...@@ -195,11 +194,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '职位', fieldName: '职位',
fieldId: 'zhiWei8331', fieldId: 'positionId',
type: 'Input', type: 'Input',
key: '526f26d97e2e4b1f9800348c295d0d7d', key: '21de2c57b40e4a539b51bed6bb4ae019',
children: [], children: [],
}, },
{ {
...@@ -210,26 +209,11 @@ export const permissionList = [ ...@@ -210,26 +209,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList', tableName: 'mesWorkTeamUserRelList',
fieldName: '部门', fieldName: '部门',
fieldId: 'danXingWenBen7768', fieldId: 'departmentId',
type: 'Input',
key: 'f95aab6e4e4a46b2ba2e6b679f3521d8',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeWorkTeamEmployeeRelList',
fieldName: '技能等级',
fieldId: 'jiNenDengJi2532',
type: 'Input', type: 'Input',
key: '03da44c148cb46c988a63c5d1f9f173e', key: 'a665bb78d37c409fb4d1a7cb888f1872',
children: [], children: [],
}, },
], ],
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<BzxxModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/> <TeamManagementModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getRokeWorkTeamPage, deleteRokeWorkTeam} from '/@/api/jcsj/bzxx'; import { getMesWorkTeamPage, deleteMesWorkTeam} from '/@/api/jcsj/teammanagement';
import { ResizePageWrapper } from '/@/components/Page'; import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
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';
...@@ -84,7 +83,7 @@ ...@@ -84,7 +83,7 @@
import BzxxModal from './components/BzxxModal.vue'; import TeamManagementModal from './components/TeamManagementModal.vue';
...@@ -167,8 +166,8 @@ ...@@ -167,8 +166,8 @@
const [registerTable, { reload, }] = useTable({ const [registerTable, { reload, }] = useTable({
title: 'Bzxx列表', title: 'TeamManagement列表',
api: getRokeWorkTeamPage, api: getMesWorkTeamPage,
rowKey: 'id', rowKey: 'id',
columns: filterColumns, columns: filterColumns,
pagination: { pagination: {
...@@ -185,55 +184,12 @@ ...@@ -185,55 +184,12 @@
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' } pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value; return pageParamsInfo.value;
}, },
afterFetch: async (res) => { afterFetch: (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,
...@@ -313,7 +269,7 @@ ...@@ -313,7 +269,7 @@
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk() { onOk() {
deleteRokeWorkTeam(ids).then((_) => { deleteMesWorkTeam(ids).then((_) => {
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
...@@ -334,7 +290,7 @@ ...@@ -334,7 +290,7 @@
return { return {
ondblclick: () => { ondblclick: () => {
if (record.isCanEdit && hasPermission("bzxx:edit")) { if (record.isCanEdit && hasPermission("teammanagement:edit")) {
handleEdit(record); handleEdit(record);
} }
}, },
...@@ -388,7 +344,7 @@ ...@@ -388,7 +344,7 @@
actionsList.push({ actionsList.push({
...button, ...button,
auth: `bzxx:${button.code}`, auth: `teammanagement:${button.code}`,
label: button?.name, label: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
...@@ -397,7 +353,7 @@ ...@@ -397,7 +353,7 @@
if (!['edit', 'delete'].includes(button.code)) { if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({ actionsList.push({
auth: `bzxx:${button.code}`, auth: `teammanagement:${button.code}`,
label: button?.name, label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
}); });
...@@ -426,4 +382,4 @@ ...@@ -426,4 +382,4 @@
</style> </style>
\ No newline at end of file
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