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