210 lines
4.0 KiB
JavaScript
210 lines
4.0 KiB
JavaScript
/*
|
|
* @Author: zwq
|
|
* @Date: 2020-12-29 16:00:14
|
|
* @LastEditors: zwq
|
|
* @LastEditTime: 2021-01-12 15:38:59
|
|
* @Description:
|
|
*/
|
|
import request from '@/utils/request'
|
|
|
|
/**
|
|
* 获取班组分页列表
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} data.size
|
|
* @param {number} [data.enabled]
|
|
* @param {string} [data.key]
|
|
* @param {number|string} [data.teamId]
|
|
*/
|
|
export function list(data) {
|
|
return request({
|
|
url: '/basic/team/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取班组单条数据
|
|
* @param {number|string} id
|
|
*/
|
|
export function detail(id) {
|
|
return request({
|
|
url: '/basic/team/get',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新班组单条数据
|
|
* @param {object} data
|
|
* @param {string} data.code
|
|
* @param {string} [data.description]
|
|
* @param {number} data.id
|
|
* @param {string} data.name
|
|
* @param {string} [data.teamLeader]
|
|
* @param {string} [data.teamLeaderId]
|
|
* @param {number} [data.teamNumber]
|
|
* @param {number} [data.workStatus]
|
|
*/
|
|
export function update(data) {
|
|
return request({
|
|
url: '/basic/team/update',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 新增班组单条数据
|
|
* @param {object} data
|
|
* @param {string} data.code
|
|
* @param {string} [data.description]
|
|
* @param {number} [data.id]
|
|
* @param {string} data.name
|
|
* @param {string} [data.teamLeader]
|
|
* @param {string} [data.teamLeaderId]
|
|
* @param {number} [data.teamNumber]
|
|
* @param {number} [data.workStatus]
|
|
*/
|
|
export function add(data) {
|
|
return request({
|
|
url: '/basic/team/add',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取班组code
|
|
*/
|
|
export function getCode() {
|
|
return request({
|
|
url: '/basic/team/get-code',
|
|
method: 'post'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 删除班组单条数据
|
|
* @param {number} id
|
|
*/
|
|
export function del(id) {
|
|
return request({
|
|
url: '/basic/team/delete',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 启停班组
|
|
* @param {object} data
|
|
* @param {number} data.enabled
|
|
* @param {number} data.id
|
|
*/
|
|
export function toggleEnabled(data) {
|
|
return request({
|
|
url: '/basic/team/enabled',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取部门列表
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} data.size
|
|
* @param {number} [data.enabled]
|
|
* @param {string} [data.key] 查询关键字
|
|
*/
|
|
export function getDepartmentList(data) {
|
|
return request({
|
|
url: '/basic/department/list',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取员工列表
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} [data.status]
|
|
* @param {string} [data.code]
|
|
* @param {string} [data.name]
|
|
* @param {number} data.size
|
|
*/
|
|
export function getStaffList(data) {
|
|
return request({
|
|
url: '/basic/worker/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取分页班组成员
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} [data.enabled]
|
|
* @param {number} [data.key]
|
|
* @param {number} data.size
|
|
* @param {number} [data.teamId]
|
|
* @param {string} [data.workerId]
|
|
*/
|
|
export function getCrewList(data) {
|
|
return request({
|
|
url: '/basic/team-det/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 删除班组单条数据
|
|
* @param {object} data
|
|
* @param {string} data.description
|
|
* @param {number} data.id
|
|
* @param {string} data.teamId
|
|
* @param {string} data.workerId
|
|
* @param {string} data.workerName
|
|
* @param {number} [data.workshopId]
|
|
*/
|
|
export function deleteCrew(data) {
|
|
return request({
|
|
url: '/basic/team-det/delete',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取组员详情
|
|
* @param {number} id
|
|
*/
|
|
export function getCrewDetail(id) {
|
|
return request({
|
|
url: '/basic/team-det/get',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取员工单条数据
|
|
* 组员既是员工
|
|
* 但是组员的接口和员工的接口不一样
|
|
* 员工的接口返回的数据更详细
|
|
* @param {number} id
|
|
*/
|
|
export function getStaffDetail(id) {
|
|
return request({
|
|
url: '/basic/worker/get',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|