公司/分部联查部门 新增
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 = () => {
|
init = () => {
|
||||||
const { companyExtend,company } = this.props;
|
const { companyExtend,company } = this.props;
|
||||||
//const {id} = company;
|
//const {id} = company;
|
||||||
const {hash} = window.location;
|
let {hash} = window.location;
|
||||||
let id = hash.replace("[^/]+(?=/$|$)");
|
hash = hash.split("?")[0];
|
||||||
console.log("id",id)
|
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||||
companyExtend.init();
|
companyExtend.init();
|
||||||
companyExtend.setId(id);
|
companyExtend.setId(id);
|
||||||
companyExtend.getData();
|
companyExtend.getData();
|
||||||
|
|
@ -221,7 +221,7 @@ export default class CompanyExtend extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { companyExtend } = this.props;
|
const { companyExtend } = this.props;
|
||||||
const { loading, detailSelectedKey, tabInfo,topTab,selectedKey } = companyExtend;
|
const { loading, detailSelectedKey, tabInfo,topTab,selectedKey,date } = companyExtend;
|
||||||
|
|
||||||
// if(!hasRight && !loading){
|
// if(!hasRight && !loading){
|
||||||
// return (
|
// 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 React from 'react'
|
||||||
import * as mobx from 'mobx'
|
import * as mobx from 'mobx'
|
||||||
import {
|
import {
|
||||||
|
|
@ -30,7 +37,9 @@ import {
|
||||||
|
|
||||||
import '../../style/common.less';
|
import '../../style/common.less';
|
||||||
|
|
||||||
|
import NewTableDialog from '../NewTableDialog';
|
||||||
import NewAndEditDialog from '../NewAndEditDialog';
|
import NewAndEditDialog from '../NewAndEditDialog';
|
||||||
|
import { renderLoading } from '../../util'; // 从util文件引入公共的方法
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -110,10 +119,23 @@ export default class Company extends React.Component {
|
||||||
company
|
company
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
// company.setNeDialogTitle(i18n.label.newcompany());
|
company.setNeDialogTitle(i18n.label.companyName());
|
||||||
// company.setIsNew(true);
|
company.setNewVisible(true);
|
||||||
// company.setVisible(true);
|
//company.getTable();
|
||||||
// company.getForm();
|
company.setDialogLoadingStatus(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//联查部门
|
||||||
|
select() {
|
||||||
|
const {
|
||||||
|
company
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
company.setNeDialogTitle(i18n.label.companyName());
|
||||||
|
company.setVisible(true);
|
||||||
|
//company.getTable();
|
||||||
|
company.setDialogLoadingStatus(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
batchDelete() {
|
batchDelete() {
|
||||||
|
|
@ -201,8 +223,6 @@ export default class Company extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///spa/organization/static/index.html#/main/organization/companyExtend
|
|
||||||
reRenderColumns(columns) {
|
reRenderColumns(columns) {
|
||||||
const {
|
const {
|
||||||
company
|
company
|
||||||
|
|
@ -217,10 +237,20 @@ export default class Company extends React.Component {
|
||||||
if (c.dataIndex == 'compName') {
|
if (c.dataIndex == 'compName') {
|
||||||
c.render = function (text, record) {
|
c.render = function (text, record) {
|
||||||
return <a onClick={() => {
|
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>
|
}}>{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;
|
return columns;
|
||||||
}
|
}
|
||||||
|
|
@ -240,17 +270,12 @@ export default class Company extends React.Component {
|
||||||
this.showConfirm('del');
|
this.showConfirm('del');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
handleSave() {
|
|
||||||
// const {
|
|
||||||
// company
|
|
||||||
// } = this.props;
|
|
||||||
// const {
|
|
||||||
// isNew
|
|
||||||
// } = company;
|
|
||||||
|
|
||||||
// isNew && company.save();
|
handleSave() {
|
||||||
// !isNew && company.edit();
|
const {
|
||||||
|
company
|
||||||
|
} = this.props;
|
||||||
|
company.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTabBtn() {
|
getTabBtn() {
|
||||||
|
|
@ -334,8 +359,9 @@ export default class Company extends React.Component {
|
||||||
company
|
company
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, companyName, conditionNum, visible, condition, form,
|
isPanelShow, companyName, conditionNum, visible, condition, form,
|
||||||
tableStore, dataSource, columns,loading
|
tableStore, dataSource, columns, loading, date,nEdialogTitle,dialogLoading,
|
||||||
|
form1,isEdit,newVisible
|
||||||
} = company;
|
} = company;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -376,17 +402,43 @@ export default class Company extends React.Component {
|
||||||
onSearch={() => company.getTableInfo()}
|
onSearch={() => company.getTableInfo()}
|
||||||
onSearchChange={val => this.onSearchChange(val)}
|
onSearchChange={val => this.onSearchChange(val)}
|
||||||
/>
|
/>
|
||||||
<WeaTable rowKey={record => record.id}
|
{
|
||||||
dataSource={dataSource} childrenColumnName="children"
|
loading ? <div className='hrm-loading-center-small'>
|
||||||
columns={this.reRenderColumns(columns)}
|
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||||
rowSelection={rowSelection}
|
</div> :
|
||||||
indentSize={15}
|
<WeaTable rowKey={record => record.id}
|
||||||
defaultExpandedRowKeys={[1,2]}
|
dataSource={dataSource} childrenColumnName="children"
|
||||||
loading={loading}
|
columns={this.reRenderColumns(columns)}
|
||||||
/>
|
rowSelection={rowSelection}
|
||||||
|
indentSize={15}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
</WeaTop>
|
</WeaTop>
|
||||||
</WeaRightMenu>
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ export default class Group extends React.Component {
|
||||||
group
|
group
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey
|
nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey,date
|
||||||
} = group;
|
} = group;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ export default class JobGrade extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||||
} = jobGrade;
|
} = jobGrade;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ export default class JobLevel extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||||
} = jobLevel;
|
} = jobLevel;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
import * as mobx from 'mobx'
|
import * as mobx from 'mobx'
|
||||||
import {
|
import {
|
||||||
inject,
|
inject,
|
||||||
observer,
|
observer
|
||||||
} from 'mobx-react'
|
} from 'mobx-react'
|
||||||
import {
|
import {
|
||||||
WeaTop,
|
WeaTop,
|
||||||
|
|
@ -340,7 +340,7 @@ export default class RankScheme extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||||
form,dialogLoading,isEdit
|
form,dialogLoading,isEdit,date
|
||||||
} = rankScheme;
|
} = rankScheme;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ export default class Sequence extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date
|
||||||
} = sequence;
|
} = sequence;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ const {
|
||||||
TableStore
|
TableStore
|
||||||
} = WeaTableNew;
|
} = WeaTableNew;
|
||||||
|
|
||||||
|
|
||||||
export class CompanyStore {
|
export class CompanyStore {
|
||||||
@observable topMenu = []
|
@observable topMenu = []
|
||||||
@observable rightMenu = [];
|
@observable rightMenu = [];
|
||||||
|
|
@ -30,15 +31,21 @@ export class CompanyStore {
|
||||||
@observable columns = [];
|
@observable columns = [];
|
||||||
@observable tableStore = new TableStore();
|
@observable tableStore = new TableStore();
|
||||||
@observable loading = true;
|
@observable loading = true;
|
||||||
|
@observable dialogLoading = true;
|
||||||
|
@observable isEdit = true;
|
||||||
|
@observable nEdialogTitle = '';
|
||||||
@observable searchCondition = [];
|
@observable searchCondition = [];
|
||||||
|
@observable condition = [];
|
||||||
@observable isPanelShow = false; //高级搜索面板
|
@observable isPanelShow = false; //高级搜索面板
|
||||||
@observable form = new WeaForm();
|
@observable form = new WeaForm();
|
||||||
|
@observable form1 = new WeaForm(); //新增主表表单
|
||||||
@observable companyName = '';
|
@observable companyName = '';
|
||||||
@observable conditionNum = 8;
|
@observable conditionNum = 8;
|
||||||
@observable ids = ''; //选择行id
|
@observable ids = ''; //选择行id
|
||||||
@observable id = ''; //页面跳转参数id
|
@observable id = ''; //页面跳转参数id
|
||||||
@observable searchConditionLoading = true;
|
@observable searchConditionLoading = true;
|
||||||
@observable visible = false;
|
@observable visible = false;
|
||||||
|
@observable newVisible = false; //新增弹窗
|
||||||
@observable companyId = '';
|
@observable companyId = '';
|
||||||
@observable selectedRowKeys = '';
|
@observable selectedRowKeys = '';
|
||||||
@observable date = '';
|
@observable date = '';
|
||||||
|
|
@ -52,6 +59,7 @@ export class CompanyStore {
|
||||||
params = {
|
params = {
|
||||||
...this.form.getFormParams(),
|
...this.form.getFormParams(),
|
||||||
//companyName: this.companyName,
|
//companyName: this.companyName,
|
||||||
|
pageSize:20
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
params = {
|
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
|
@action
|
||||||
getHasRight() {
|
getHasRight() {
|
||||||
|
|
@ -198,10 +248,12 @@ export class CompanyStore {
|
||||||
|
|
||||||
setVisible(bool) {
|
setVisible(bool) {
|
||||||
this.visible = bool;
|
this.visible = bool;
|
||||||
this.formReset();
|
|
||||||
!bool && this.dialogLoadingReset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDialogLoadingStatus(bool) {
|
||||||
|
this.dialogLoading = bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setSearchCondition(searchCondition) {
|
setSearchCondition(searchCondition) {
|
||||||
this.searchCondition = searchCondition;
|
this.searchCondition = searchCondition;
|
||||||
|
|
@ -239,4 +291,16 @@ export class CompanyStore {
|
||||||
this.loading = bool;
|
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 topTab = [];
|
||||||
@observable buttons = {};
|
@observable buttons = {};
|
||||||
@observable id = ''; //分部id
|
@observable id = ''; //分部id
|
||||||
@observable date;
|
@observable date = '';
|
||||||
@observable personalEditTables;
|
@observable personalEditTables;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ export class RankSchemeStore {
|
||||||
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
getHasRight() {
|
getHasRight() {
|
||||||
Api.getHasRight().then(res => {
|
Api.getHasRight().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||||
|
|
@ -292,6 +292,7 @@ export class RankSchemeStore {
|
||||||
this.schemeId = schemeId;
|
this.schemeId = schemeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
setDate(date) {
|
setDate(date) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue