公司/分部联查部门 新增
This commit is contained in:
parent
669f92dbf2
commit
de7e0d50c6
|
|
@ -0,0 +1,77 @@
|
|||
import {
|
||||
WeaDialog,
|
||||
WeaFormItem,
|
||||
WeaNewScroll,
|
||||
WeaSearchGroup,
|
||||
WeaMoreButton,
|
||||
WeaTable
|
||||
} from 'ecCom'
|
||||
|
||||
import {
|
||||
Spin,
|
||||
Button,
|
||||
} from 'antd'
|
||||
|
||||
import {
|
||||
WeaSwitch
|
||||
} from 'comsMobx'
|
||||
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
export default class NewTableDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
width: 800,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
title,
|
||||
visible,
|
||||
onCancel,
|
||||
loading,
|
||||
height,
|
||||
dataSource,
|
||||
columns
|
||||
} = this.props, {
|
||||
width,
|
||||
} = 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`} />)
|
||||
];
|
||||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
|
||||
title={title}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
visible={visible}
|
||||
closable={true}
|
||||
hasScroll={true}
|
||||
onCancel={() => onCancel()}
|
||||
buttons={buttons}
|
||||
style={{ width: width, height: height }}
|
||||
>
|
||||
{
|
||||
loading ? <div className='hrm-loading-center-small'>
|
||||
<Spin spinning={loading}></Spin>
|
||||
</div>
|
||||
: <WeaTable rowKey={record => record.id}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={columns}
|
||||
indentSize={15}
|
||||
defaultExpandedRowKeys={[1, 2]}
|
||||
/>
|
||||
}
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -23,9 +23,9 @@ export default class CompanyExtend extends React.Component {
|
|||
init = () => {
|
||||
const { companyExtend,company } = this.props;
|
||||
//const {id} = company;
|
||||
const {hash} = window.location;
|
||||
let id = hash.replace("[^/]+(?=/$|$)");
|
||||
console.log("id",id)
|
||||
let {hash} = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
companyExtend.init();
|
||||
companyExtend.setId(id);
|
||||
companyExtend.getData();
|
||||
|
|
@ -221,7 +221,7 @@ export default class CompanyExtend extends React.Component {
|
|||
|
||||
render() {
|
||||
const { companyExtend } = this.props;
|
||||
const { loading, detailSelectedKey, tabInfo,topTab,selectedKey } = companyExtend;
|
||||
const { loading, detailSelectedKey, tabInfo,topTab,selectedKey,date } = companyExtend;
|
||||
|
||||
// if(!hasRight && !loading){
|
||||
// return (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-05-19 15:00:16
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
import React from 'react'
|
||||
import * as mobx from 'mobx'
|
||||
import {
|
||||
|
|
@ -30,7 +37,9 @@ import {
|
|||
|
||||
import '../../style/common.less';
|
||||
|
||||
import NewTableDialog from '../NewTableDialog';
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import { renderLoading } from '../../util'; // 从util文件引入公共的方法
|
||||
|
||||
|
||||
|
||||
|
|
@ -110,10 +119,23 @@ export default class Company extends React.Component {
|
|||
company
|
||||
} = this.props;
|
||||
|
||||
// company.setNeDialogTitle(i18n.label.newcompany());
|
||||
// company.setIsNew(true);
|
||||
// company.setVisible(true);
|
||||
// company.getForm();
|
||||
company.setNeDialogTitle(i18n.label.companyName());
|
||||
company.setNewVisible(true);
|
||||
//company.getTable();
|
||||
company.setDialogLoadingStatus(false);
|
||||
|
||||
}
|
||||
|
||||
//联查部门
|
||||
select() {
|
||||
const {
|
||||
company
|
||||
} = this.props;
|
||||
|
||||
company.setNeDialogTitle(i18n.label.companyName());
|
||||
company.setVisible(true);
|
||||
//company.getTable();
|
||||
company.setDialogLoadingStatus(false);
|
||||
}
|
||||
|
||||
batchDelete() {
|
||||
|
|
@ -201,8 +223,6 @@ export default class Company extends React.Component {
|
|||
}
|
||||
|
||||
|
||||
|
||||
///spa/organization/static/index.html#/main/organization/companyExtend
|
||||
reRenderColumns(columns) {
|
||||
const {
|
||||
company
|
||||
|
|
@ -217,10 +237,20 @@ export default class Company extends React.Component {
|
|||
if (c.dataIndex == 'compName') {
|
||||
c.render = function (text, record) {
|
||||
return <a onClick={() => {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${record.id}`,"_blank")
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${record.id}`, "_blank")
|
||||
}}>{text}</a>
|
||||
}
|
||||
}
|
||||
if (c.dataIndex == 'operate') {
|
||||
c.render = function (text, record) {
|
||||
return <span>
|
||||
<a onClick={() => { _this.doDel(record.id) }}>删除</a>
|
||||
<span className="ant-divider"></span>
|
||||
<a onClick={() => { _this.select() }}>联查部门</a>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
|
@ -240,17 +270,12 @@ export default class Company extends React.Component {
|
|||
this.showConfirm('del');
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
// const {
|
||||
// company
|
||||
// } = this.props;
|
||||
// const {
|
||||
// isNew
|
||||
// } = company;
|
||||
|
||||
// isNew && company.save();
|
||||
// !isNew && company.edit();
|
||||
handleSave() {
|
||||
const {
|
||||
company
|
||||
} = this.props;
|
||||
company.save();
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
|
|
@ -334,8 +359,9 @@ export default class Company extends React.Component {
|
|||
company
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow, companyName, conditionNum, visible, condition, form,
|
||||
tableStore, dataSource, columns,loading
|
||||
isPanelShow, companyName, conditionNum, visible, condition, form,
|
||||
tableStore, dataSource, columns, loading, date,nEdialogTitle,dialogLoading,
|
||||
form1,isEdit,newVisible
|
||||
} = company;
|
||||
|
||||
|
||||
|
|
@ -376,17 +402,43 @@ export default class Company extends React.Component {
|
|||
onSearch={() => company.getTableInfo()}
|
||||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
<WeaTable rowKey={record => record.id}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={this.reRenderColumns(columns)}
|
||||
rowSelection={rowSelection}
|
||||
indentSize={15}
|
||||
defaultExpandedRowKeys={[1,2]}
|
||||
loading={loading}
|
||||
/>
|
||||
{
|
||||
loading ? <div className='hrm-loading-center-small'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
</div> :
|
||||
<WeaTable rowKey={record => record.id}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={this.reRenderColumns(columns)}
|
||||
rowSelection={rowSelection}
|
||||
indentSize={15}
|
||||
/>
|
||||
}
|
||||
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
<NewTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={visible}
|
||||
loading={dialogLoading}
|
||||
height={450}
|
||||
dataSource = {dataSource} //联查部门数据
|
||||
columns= {columns}
|
||||
onCancel={() => company.setVisible(false)}
|
||||
/>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={newVisible}
|
||||
condition={toJS(condition)}
|
||||
form={form1}
|
||||
isFormInit={form1.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={300}
|
||||
conditionLen={4}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => company.setNewVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ export default class Group extends React.Component {
|
|||
group
|
||||
} = this.props;
|
||||
const {
|
||||
nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey
|
||||
nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey,date
|
||||
} = group;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ export default class JobGrade extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||
} = jobGrade;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ export default class JobLevel extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||
} = jobLevel;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import * as mobx from 'mobx'
|
||||
import {
|
||||
inject,
|
||||
observer,
|
||||
observer
|
||||
} from 'mobx-react'
|
||||
import {
|
||||
WeaTop,
|
||||
|
|
@ -340,7 +340,7 @@ export default class RankScheme extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit
|
||||
form,dialogLoading,isEdit,date
|
||||
} = rankScheme;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ export default class Sequence extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||
} = sequence;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const {
|
|||
TableStore
|
||||
} = WeaTableNew;
|
||||
|
||||
|
||||
export class CompanyStore {
|
||||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
|
|
@ -30,15 +31,21 @@ export class CompanyStore {
|
|||
@observable columns = [];
|
||||
@observable tableStore = new TableStore();
|
||||
@observable loading = true;
|
||||
@observable dialogLoading = true;
|
||||
@observable isEdit = true;
|
||||
@observable nEdialogTitle = '';
|
||||
@observable searchCondition = [];
|
||||
@observable condition = [];
|
||||
@observable isPanelShow = false; //高级搜索面板
|
||||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm(); //新增主表表单
|
||||
@observable companyName = '';
|
||||
@observable conditionNum = 8;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable id = ''; //页面跳转参数id
|
||||
@observable searchConditionLoading = true;
|
||||
@observable visible = false;
|
||||
@observable newVisible = false; //新增弹窗
|
||||
@observable companyId = '';
|
||||
@observable selectedRowKeys = '';
|
||||
@observable date = '';
|
||||
|
|
@ -52,6 +59,7 @@ export class CompanyStore {
|
|||
params = {
|
||||
...this.form.getFormParams(),
|
||||
//companyName: this.companyName,
|
||||
pageSize:20
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
|
|
@ -128,6 +136,48 @@ export class CompanyStore {
|
|||
}
|
||||
|
||||
|
||||
getForm() {
|
||||
// this.setDialogLoadingStatus(true);
|
||||
// Api.getCompanyForm(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setDialogLoadingStatus(false);
|
||||
// res.data.condition && this.setCondition(res.data.condition);
|
||||
// res.data.condition && this.form1.initFormFields(res.data.condition);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
save() {
|
||||
// let params = {
|
||||
// ...this.form1.getFormParams()
|
||||
// };
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.add(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
|
|
@ -198,10 +248,12 @@ export class CompanyStore {
|
|||
|
||||
setVisible(bool) {
|
||||
this.visible = bool;
|
||||
this.formReset();
|
||||
!bool && this.dialogLoadingReset();
|
||||
}
|
||||
|
||||
setDialogLoadingStatus(bool) {
|
||||
this.dialogLoading = bool;
|
||||
}
|
||||
|
||||
|
||||
setSearchCondition(searchCondition) {
|
||||
this.searchCondition = searchCondition;
|
||||
|
|
@ -239,4 +291,16 @@ export class CompanyStore {
|
|||
this.loading = bool;
|
||||
}
|
||||
|
||||
setNeDialogTitle(title) {
|
||||
this.nEdialogTitle = title
|
||||
}
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
setNewVisible(bool) {
|
||||
this.newVisible = bool;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ export class CompanyExtendStore {
|
|||
@observable topTab = [];
|
||||
@observable buttons = {};
|
||||
@observable id = ''; //分部id
|
||||
@observable date;
|
||||
@observable date = '';
|
||||
@observable personalEditTables;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ export class RankSchemeStore {
|
|||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
|
|
@ -292,6 +292,7 @@ export class RankSchemeStore {
|
|||
this.schemeId = schemeId;
|
||||
}
|
||||
|
||||
@action
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue