From b6d38eac7193d394a75bda18bc1e122d57a66fbb Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Fri, 21 Jun 2024 09:46:17 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=84=E7=BB=87=E5=92=8C?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=B2=97=E4=BD=8D=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- public/pages/frame/orgManage/orgManage.js | 46 +++++++++++++++-------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/public/pages/frame/orgManage/orgManage.js b/public/pages/frame/orgManage/orgManage.js index 0b08b315e..561fd70a2 100644 --- a/public/pages/frame/orgManage/orgManage.js +++ b/public/pages/frame/orgManage/orgManage.js @@ -9,6 +9,7 @@ data: { orgManageInfo: { staffs: [], + relCds:[], orgName: '', conditions: { 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() { vc.on('org', 'switchOrg', function(_param) { $that.orgManageInfo.conditions.orgId = _param.orgId; $that.orgManageInfo.orgName = _param.orgName; - vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); + $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('orgManage', 'notice', function() { - vc.component._listStaffs(1, DEFAULT_ROWS); + $that._listStaffs(1, DEFAULT_ROWS); }); vc.on('pagination', 'page_event', function(_currentPage) { - vc.component._listStaffs(_currentPage, DEFAULT_ROWS); + $that._listStaffs(_currentPage, DEFAULT_ROWS); }); }, methods: { @@ -44,13 +49,22 @@ vc.http.apiGet('/query.staff.infos', param, function(json, res) { - var _orgManageInfo = JSON.parse(json); - vc.component.orgManageInfo.total = _orgManageInfo.total; - vc.component.orgManageInfo.records = _orgManageInfo.records; - vc.component.orgManageInfo.staffs = _orgManageInfo.staffs; + let _json = JSON.parse(json); + $that.orgManageInfo.total = _json.total; + $that.orgManageInfo.records = _json.records; + 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', { - total: vc.component.orgManageInfo.records, - dataCount: vc.component.orgManageInfo.total, + total: $that.orgManageInfo.records, + dataCount: $that.orgManageInfo.total, currentPage: _page }); }, @@ -61,18 +75,18 @@ }, //查询 _queryOrgMethod: function() { - vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); + $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); }, //重置 _resetOrgMethod: function() { - vc.component.orgManageInfo.conditions.staffName = ""; - vc.component._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); + $that.orgManageInfo.conditions.staffName = ""; + $that._listStaffs(DEFAULT_PAGE, DEFAULT_ROWS); }, _moreCondition: function() { - if (vc.component.orgManageInfo.moreCondition) { - vc.component.orgManageInfo.moreCondition = false; + if ($that.orgManageInfo.moreCondition) { + $that.orgManageInfo.moreCondition = false; } else { - vc.component.orgManageInfo.moreCondition = true; + $that.orgManageInfo.moreCondition = true; } }, _openOrgRelStaff: function() {