优化组织和员工岗位不一致问题

Signed-off-by: java110 <928255095@qq.com>
This commit is contained in:
java110 2024-06-21 09:46:17 +00:00 committed by Gitee
parent 099ce05556
commit b6d38eac71
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -9,6 +9,7 @@
data: { data: {
orgManageInfo: { orgManageInfo: {
staffs: [], staffs: [],
relCds:[],
orgName: '', orgName: '',
conditions: { conditions: {
orgId: '', orgId: '',
@ -16,18 +17,22 @@
} }
} }
}, },
_initMethod: function() {}, _initMethod: function() {
vc.getDict('u_org_staff_rel', "rel_cd", function (_data) {
$that.orgManageInfo.relCds = _data;
});
},
_initEvent: function() { _initEvent: function() {
vc.on('org', 'switchOrg', function(_param) { vc.on('org', 'switchOrg', function(_param) {
$that.orgManageInfo.conditions.orgId = _param.orgId; $that.orgManageInfo.conditions.orgId = _param.orgId;
$that.orgManageInfo.orgName = _param.orgName; $that.orgManageInfo.orgName = _param.orgName;
vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
}); });
vc.on('orgManage', 'notice', function() { vc.on('orgManage', 'notice', function() {
vc.component._listStaffs(1, DEFAULT_ROWS); $that._listStaffs(1, DEFAULT_ROWS);
}); });
vc.on('pagination', 'page_event', function(_currentPage) { vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listStaffs(_currentPage, DEFAULT_ROWS); $that._listStaffs(_currentPage, DEFAULT_ROWS);
}); });
}, },
methods: { methods: {
@ -44,13 +49,22 @@
vc.http.apiGet('/query.staff.infos', vc.http.apiGet('/query.staff.infos',
param, param,
function(json, res) { function(json, res) {
var _orgManageInfo = JSON.parse(json); let _json = JSON.parse(json);
vc.component.orgManageInfo.total = _orgManageInfo.total; $that.orgManageInfo.total = _json.total;
vc.component.orgManageInfo.records = _orgManageInfo.records; $that.orgManageInfo.records = _json.records;
vc.component.orgManageInfo.staffs = _orgManageInfo.staffs; let staffList = _json.staffs;
let relCdsList = $that.orgManageInfo.relCds;
staffList.forEach((staff) => {
relCdsList.forEach((rel) => {
if (staff.relCd == rel.statusCd) {
staff.relCdName = rel.name;
}
})
})
$that.orgManageInfo.staffs = staffList;
vc.emit('pagination', 'init', { vc.emit('pagination', 'init', {
total: vc.component.orgManageInfo.records, total: $that.orgManageInfo.records,
dataCount: vc.component.orgManageInfo.total, dataCount: $that.orgManageInfo.total,
currentPage: _page currentPage: _page
}); });
}, },
@ -61,18 +75,18 @@
}, },
//查询 //查询
_queryOrgMethod: function() { _queryOrgMethod: function() {
vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
}, },
//重置 //重置
_resetOrgMethod: function() { _resetOrgMethod: function() {
vc.component.orgManageInfo.conditions.staffName = ""; $that.orgManageInfo.conditions.staffName = "";
vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
}, },
_moreCondition: function() { _moreCondition: function() {
if (vc.component.orgManageInfo.moreCondition) { if ($that.orgManageInfo.moreCondition) {
vc.component.orgManageInfo.moreCondition = false; $that.orgManageInfo.moreCondition = false;
} else { } else {
vc.component.orgManageInfo.moreCondition = true; $that.orgManageInfo.moreCondition = true;
} }
}, },
_openOrgRelStaff: function() { _openOrgRelStaff: function() {