简阳编制增加详情

This commit is contained in:
Chengliang 2023-12-19 09:52:00 +08:00
parent fc6f1a0838
commit 09ee6dbd3a
6 changed files with 60 additions and 9 deletions

View File

@ -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);
}

View File

@ -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 ? <div className='hrm-loading-center-small'>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
</div>
: conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
</WeaDialog>

View File

@ -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 <a href='javascript:void(0);' onClick={() => {
window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${record.id}`);
}}>{text}</a>
}
};
})
}
render() {
const {
title,
@ -44,7 +58,6 @@ export default class NewWeaTableDialog extends React.Component {
} = this.state;
const buttons = [
//(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.save()}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
];
@ -62,6 +75,7 @@ export default class NewWeaTableDialog extends React.Component {
>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
getColumns={c => this.reRenderColumns(c)}
hasOrder={true}
needScroll={true}
/>

View File

@ -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 {
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@7muhhb`} isNew={true} showLeft={true} leftCom={this.getTree()}>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
searchType={['base', 'advanced']}
searchType={['advanced']}
showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? staffName : form2.getFormParams().staffName}
setShowSearchAd={bool => staff.setPanelStatus(bool)}
@ -538,6 +549,13 @@ export default class Staff extends React.Component {
</WeaLeftRightLayout>
</WeaTop>
</WeaRightMenu>
<NewWeaTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`}
title={nEdialogTitle}
visible={tvisible}
height={400}
tableStore={ttableStore}
onCancel={() => staff.tvisible = false}
/>
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
title={nEdialogTitle}
visible={visible}

View File

@ -53,6 +53,24 @@ export class StaffStore {
@observable planId = '';
@observable selectTreeNodeInfo;
@observable tvisible = false;
@observable ttableStore = new TableStore();
@action("详情") getHrmTable(id) {
let params = {
jobId: id
}
this.ttableStore = new TableStore();
Api.getHrmListByJobId(params).then(res => {
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 = {

View File

@ -1,6 +1,6 @@
/* 公共样式 */
.hrm-loading-center-small {
position: absolute;
position: relative;
top: 50%;
left: 50%;
margin-left: -8px;