api.ms.organization.employee.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ms-morganization Show documentation
Show all versions of ms-morganization Show documentation
ms-morganization tools Library
/**
*员工管理
*/
(function() {
/**
* 员工管理列表
* @param data
* @param func
* @returns
*/
function list(data,func) {
ms.http.get(ms.base + "/people/organization/employee/list.do",data
).then(func, (err) => {
console.log(err)
})
}
/**
* 保存员工管理
* @param data
* @param func
* @returns
*/
function save(data,func) {
ms.http.employee(ms.base + "/people/organization/employee/save.do",data,{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(func, (err) => {
console.log(err)
})
}
/**
* 更新员工管理
* @param data
* @param func
* @returns
*/
function update(data,func) {
ms.http.employee(ms.base + "/people/organization/employee/update.do",data,{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(func, (err) => {
console.log(err)
})
}
/**
* 通过employeeId查询员工管理实体
* @param data
* @param func
* @returns
*/
function get(data,func) {
ms.http.get(ms.base + "/people/organization/employee/get.do",data
).then(func, (err) => {
console.log(err)
})
}
/**
* 根据编号删除
* @param data
* @param func
* @returns
*/
function del(data,func) {
ms.http.employee(ms.base + "/people/organization/employee/delete.do",data
).then(func, (err) => {
console.log(err)
})
}
/**
* 保存或更新
* @param data
* @param func
* @returns
*/
function saveOrUpdate(data,func) {
if(data.id > 0){
this.update(data,func);
}else{
this.save(data,func);
}
}
let employee = {
list:list,
saveOrUpdate:saveOrUpdate,
save:save,
update:update,
get:get,
del:del
}
window.ms.people.organization.employee = employee;
}());