api.ms.organization.post.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/post/list.do",data
).then(func, (err) => {
console.log(err)
})
}
/**
* 保存岗位管理
* @param data
* @param func
* @returns
*/
function save(data,func) {
ms.http.post(ms.base + "/people/organization/post/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.post(ms.base + "/people/organization/post/update.do",data,{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(func, (err) => {
console.log(err)
})
}
/**
* 通过postId查询岗位管理实体
* @param data
* @param func
* @returns
*/
function get(data,func) {
ms.http.get(ms.base + "/people/organization/post/get.do",data
).then(func, (err) => {
console.log(err)
})
}
/**
* 根据编号删除
* @param data
* @param func
* @returns
*/
function del(data,func) {
ms.http.post(ms.base + "/people/organization/post/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 post = {
list:list,
saveOrUpdate:saveOrUpdate,
save:save,
update:update,
get:get,
del:del
}
window.ms.people.organization.post = post;
}());