From 09ee6dbd3a76ce0a99a4e824e448de6910cfe115 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 19 Dec 2023 09:52:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E9=98=B3=E7=BC=96=E5=88=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/staff.js | 4 ++++ .../components/NewAndEditDialog.js | 7 ++---- .../components/NewWeaTableDialog.js | 16 +++++++++++++- .../organization/components/staff/Staff.js | 22 +++++++++++++++++-- pc4mobx/organization/stores/staff.js | 18 +++++++++++++++ pc4mobx/organization/style/common.less | 2 +- 6 files changed, 60 insertions(+), 9 deletions(-) diff --git a/pc4mobx/organization/apis/staff.js b/pc4mobx/organization/apis/staff.js index adc688e..bfa80e0 100644 --- a/pc4mobx/organization/apis/staff.js +++ b/pc4mobx/organization/apis/staff.js @@ -50,4 +50,8 @@ export const getForm = (params) => { export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/staff/getHasRight', 'GET', params); +} + +export const getHrmListByJobId = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 51a984e..35e2fad 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -21,7 +21,6 @@ import { } from '../public/i18n'; import AttachToNumberField from './NewNumberField'; - export default class NewAndEditDialog extends React.Component { constructor(props) { super(props); @@ -154,13 +153,11 @@ export default class NewAndEditDialog extends React.Component { onCancel={() => onCancel()} buttons={isEdit ? buttons : buttons.slice(1, 2)} style={{ width: width, height: height }} + loading={loading} initLoadCss > { - loading ?
- -
- : conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()} + conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()} diff --git a/pc4mobx/organization/components/NewWeaTableDialog.js b/pc4mobx/organization/components/NewWeaTableDialog.js index 5cb513c..f5426c7 100644 --- a/pc4mobx/organization/components/NewWeaTableDialog.js +++ b/pc4mobx/organization/components/NewWeaTableDialog.js @@ -32,6 +32,20 @@ export default class NewWeaTableDialog extends React.Component { } } + + reRenderColumns(columns) { + let _this = this; + columns.forEach((c, index) => { + if (c.dataIndex == 'lastname') { + c.render = function (text, record) { + return { + window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${record.id}`); + }}>{text} + } + }; + }) + } + render() { const { title, @@ -44,7 +58,6 @@ export default class NewWeaTableDialog extends React.Component { } = this.state; const buttons = [ - //(), () ]; @@ -62,6 +75,7 @@ export default class NewWeaTableDialog extends React.Component { > this.reRenderColumns(c)} hasOrder={true} needScroll={true} /> diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 5988595..aa81104 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -32,6 +32,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import NewWeaTableDialog from '../NewWeaTableDialog'; import ImportDialog from '../ImportDialog'; import { renderNoright } from '../../util'; import SelectTag from '../SelectTag' @@ -359,6 +360,16 @@ export default class Staff extends React.Component { (index == '0') && this.doEdit(record.randomFieldId); (index == '1') && this.doDel(record.randomFieldId); (index == '2') && this.doChange(record.randomFieldId); + (index == '3') && this.doDetail(record.job_id); + } + + doDetail(id) { + const { + staff + } = this.props; + staff.setNeDialogTitle("详情"); + staff.tvisible = true; + staff.getHrmTable(id); } doEdit(id) { @@ -487,7 +498,7 @@ export default class Staff extends React.Component { } = this.props; const { isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, date, hasRight + form, dialogLoading, isEdit, date, hasRight,tvisible,ttableStore } = staff; const {importVisible} = importDialog; @@ -514,7 +525,7 @@ export default class Staff extends React.Component { staff.setPanelStatus(bool)} @@ -538,6 +549,13 @@ export default class Staff extends React.Component { + staff.tvisible = false} + /> { + if (res.code === 200) { + res.data.datas && this.ttableStore.getDatas(res.data.datas, 1); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } @action getTableInfo(isOnChange = false) { let params = { diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 2ab8156..8538067 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -1,6 +1,6 @@ /* 公共样式 */ .hrm-loading-center-small { - position: absolute; + position: relative; top: 50%; left: 50%; margin-left: -8px;