From 4c2ff27e467b0d0600e196bcb985659321e33f2f Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 23 May 2022 17:28:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=8F=B8/=E5=88=86=E9=83=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/company.js | 86 +- .../organization/components/NewTableDialog.js | 18 +- .../components/company/CompanyExtend.js | 14 +- .../components/company/company.js | 50 +- pc4mobx/organization/stores/company.js | 164 ++- pc4mobx/organization/stores/companyextend.js | 1098 ++--------------- 6 files changed, 282 insertions(+), 1148 deletions(-) diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index 5fa5238..6fb261f 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -15,43 +15,55 @@ export const getSearchList = (params) => { }) } +export const getDeptListByPid = (params) => { + return fetch('/api/bs/hrmorganization/dept/getDeptListByPid', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} -// export const deleteTableData = (params) => { -// return fetch('/api/bs/hrmorganization/level/deleteByIds', { -// method: 'POST', -// mode: 'cors', -// headers: { -// 'Content-Type': 'application/json' -// }, -// body: JSON.stringify(params) -// }) -// } + +export const deleteTableData = (params) => { + return fetch('/api/bs/hrmorganization/comp/deleteByIds', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getSearchCondition', 'GET', params); } -// export const add = (params) => { -// return fetch('/api/bs/hrmorganization/level/saveLevel', { -// method: 'POST', -// mode: 'cors', -// headers: { -// 'Content-Type': 'application/json' -// }, -// body: JSON.stringify(params) -// }) -// } +export const add = (params) => { + return fetch('/api/bs/hrmorganization/comp/saveBaseComp', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} -// export const edit = (params) => { -// return fetch('/api/bs/hrmorganization/level/updateLevel', { -// method: 'POST', -// mode: 'cors', -// headers: { -// 'Content-Type': 'application/json' -// }, -// body: JSON.stringify(params) -// }) -// } +export const editResource = (params) => { + // return fetch('/api/bs/hrmorganization/comp/updateComp', { + // method: 'POST', + // mode: 'cors', + // headers: { + // 'Content-Type': 'application/json' + // }, + // body: JSON.stringify(params) + // }) + return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params); +} export const updateForbiddenTag = (params) => { return fetch('/api/bs/hrmorganization/comp/updateForbiddenTagById', { @@ -64,13 +76,15 @@ export const updateForbiddenTag = (params) => { }) } -// export const getLevelForm = (params) => { -// return WeaTools.callApi('/api/bs/hrmorganization/level/getLevelForm', 'GET', params); -// } +export const getCompanyForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params); +} + + +export const getCompanyExtendForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params); +} -// export const getTabInfo = (params) => { -// return WeaTools.callApi('/api/bs/hrmorganization/level/getTabInfo', 'GET', params); -// } export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getHasRight', 'GET', params); diff --git a/pc4mobx/organization/components/NewTableDialog.js b/pc4mobx/organization/components/NewTableDialog.js index bd7d2dc..ff7f1da 100644 --- a/pc4mobx/organization/components/NewTableDialog.js +++ b/pc4mobx/organization/components/NewTableDialog.js @@ -60,17 +60,13 @@ export default class NewTableDialog extends React.Component { buttons={buttons} style={{ width: width, height: height }} > - { - loading ?
- -
- : record.id} - dataSource={dataSource} childrenColumnName="children" - columns={columns} - indentSize={15} - defaultExpandedRowKeys={[1, 2]} - /> - } + record.id} + dataSource={dataSource} childrenColumnName="children" + columns={columns} + indentSize={15} + loading={loading} + defaultExpandedRowKeys={[1, 2]} + /> ) } diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index 291fb27..5ce6162 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -33,17 +33,17 @@ export default class CompanyExtend extends React.Component { getTabChildren = () => { const { companyExtend } = this.props; - let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys } = companyExtend; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend; let tabChildren = []; tableInfo = toJS(tableInfo); tableInfo && tableInfo.map((t, i) => { - if (tabkey == i) { + if (detailSelectedKey == i) { tabChildren.push( companyExtend.setPersonalEditTables(ref)} + ref={(ref)=>companyExtend.setPersonalEditTables(ref)} showTitle={isEditor} // title={'列表信息'} - // addFirstRow={isEditor} + //addFirstRow={isEditor} columns={t.tabinfo.columns} datas={t.tabinfo.datas} onChange={this.tableEditChange} @@ -131,10 +131,10 @@ export default class CompanyExtend extends React.Component { tableEditChange = (data) => { const { companyExtend } = this.props; - let { tabkey = '0', tableInfo } = companyExtend; + let { detailSelectedKey = '0', tableInfo } = companyExtend; tableInfo = toJS(tableInfo); let d = cloneDeep(tableInfo); - d[Number(tabkey)].tabinfo.datas = data; + d[Number(detailSelectedKey)].tabinfo.datas = data; companyExtend.updateTableInfo(d); } @@ -221,7 +221,7 @@ export default class CompanyExtend extends React.Component { render() { const { companyExtend } = this.props; - const { loading, detailSelectedKey, tabInfo,topTab,selectedKey,date } = companyExtend; + const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = companyExtend; // if(!hasRight && !loading){ // return ( diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 7549a7a..d3ac210 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-05-19 15:00:16 + * @LastEditTime: 2022-05-23 16:55:22 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -121,20 +121,19 @@ export default class Company extends React.Component { company.setNeDialogTitle(i18n.label.companyName()); company.setNewVisible(true); - //company.getTable(); - company.setDialogLoadingStatus(false); + company.getCompanyForm(); } //联查部门 - select() { + select(id) { const { company } = this.props; company.setNeDialogTitle(i18n.label.companyName()); company.setVisible(true); - //company.getTable(); + company.getDeptTable(id); company.setDialogLoadingStatus(false); } @@ -143,10 +142,9 @@ export default class Company extends React.Component { company } = this.props; const { - tableStore + selectedRowKeys } = company; - - let keys = toJS(tableStore.selectedRowKeys).toString(); + let keys = toJS(selectedRowKeys).toString(); company.setIds(keys); this.showConfirm('batchDel'); } @@ -246,7 +244,7 @@ export default class Company extends React.Component { return { _this.doDel(record.id) }}>删除 - { _this.select() }}>联查部门 + { _this.select(record.id) }}>联查部门 } } @@ -360,15 +358,27 @@ export default class Company extends React.Component { } = this.props; const { isPanelShow, companyName, conditionNum, visible, condition, form, - tableStore, dataSource, columns, loading, date,nEdialogTitle,dialogLoading, - form1,isEdit,newVisible + tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, + form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total } = company; const rowSelection = { onChange(selectedRowKeys, selectedRows) { company.setSelectedRowKeys(selectedRowKeys); + }, + }; + const pagination = { + total: total, + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange(current, pageSize) { + // company.setCurrent(current); + // company.setPageSize(pageSize); + }, + onChange(current) { + //company.setCurrent(current); }, }; @@ -410,6 +420,12 @@ export default class Company extends React.Component { dataSource={dataSource} childrenColumnName="children" columns={this.reRenderColumns(columns)} rowSelection={rowSelection} + pagination={pagination} + onChange={(pagination, filters, sorter) => { + company.setCurrent(pagination.current); + company.setPageSize(pagination.pageSize); + company.getTableInfo(); + }} indentSize={15} /> } @@ -420,12 +436,12 @@ export default class Company extends React.Component { title={nEdialogTitle} visible={visible} loading={dialogLoading} - height={450} - dataSource = {dataSource} //联查部门数据 - columns= {columns} + height={400} + dataSource={deptDataSource} //联查部门数据 + columns={deptColumns} onCancel={() => company.setVisible(false)} - /> - + this.handleSave()} onCancel={() => company.setNewVisible(false)} enable={false} //是否开启字段联动 - /> + /> ) } diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 768c606..d5dd07f 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -29,6 +29,8 @@ export class CompanyStore { @observable rightMenu = []; @observable dataSource = []; @observable columns = []; + @observable deptDataSource = []; + @observable deptColumns = []; @observable tableStore = new TableStore(); @observable loading = true; @observable dialogLoading = true; @@ -49,20 +51,29 @@ export class CompanyStore { @observable companyId = ''; @observable selectedRowKeys = ''; @observable date = ''; + @observable total = 0; + @observable current = 1; + @observable pageSize = 10; + @action getTableInfo() { - let params; + this.setLoading(true); + let params = { + current:this.current, + pageSize:this.pageSize + } if (this.isEmptyObject(this.form.getFormParams())) { params = { + ...params, ...this.form.getFormParams(), - //companyName: this.companyName, - pageSize:20 + compName: this.companyName, }; } else { params = { + ...params, ...this.form.getFormParams(), }; } @@ -72,6 +83,7 @@ export class CompanyStore { if (res.code === 200) { res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); + res.data.pageInfo.total && this.setTotal(res.data.pageInfo.total ) this.setLoading(false); } else { message.warning(res.msg); @@ -81,6 +93,30 @@ export class CompanyStore { }) + + + + } + + @action("联查部门") + getDeptTable(id) { + let params = { + parentComp:id + } + this.setLoading(true); + Api.getDeptListByPid(params).then(response => { + return response.json() + }).then(res => { + if (res.code === 200) { + res.data.list && this.setDeptDataSource(res.data.list); + res.data.columns && this.setDeptColumns(res.data.columns); + this.setLoading(false); + } else { + message.warning(res.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } //删除 @@ -88,18 +124,18 @@ export class CompanyStore { let params = { ids: this.ids }; - // Api.deleteTableData(params).then(response => { - // return response.json() - // }).then(data => { - // if (data.code === 200) { - // message.success(i18n.message.deleteSuccess()); - // this.getTableInfo(); - // } else { - // message.warning(data.msg); - // } - // }).catch(error => { - // message.warning(error.msg); - // }) + Api.deleteTableData(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } updateForbiddenTag(checked, id) { @@ -136,46 +172,47 @@ 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); - // }) + getCompanyForm() { + let params = {}; + 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()); - // } - // }); + let params = { + ...this.form1.getFormParams() + }; + this.form1.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.setNewVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); } @@ -195,7 +232,7 @@ save() { updateFields(val) { this.form.updateFields({ - companyName: { + compName: { value: val } }); @@ -242,7 +279,7 @@ save() { formReset() { - this.form = new WeaForm(); + this.form1 = new WeaForm(); } @@ -279,10 +316,18 @@ save() { this.dataSource = dataSource; } + setDeptDataSource(deptDataSource) { + this.deptDataSource = deptDataSource; + } + setColumns(columns) { this.columns = columns } + setDeptColumns(deptColumns) { + this.deptColumns = deptColumns + } + setSelectedRowKeys(selectedRowKeys) { this.selectedRowKeys = selectedRowKeys; } @@ -300,7 +345,20 @@ save() { } setNewVisible(bool) { + this.formReset(); this.newVisible = bool; } + setTotal(total) { + this.total = total; + } + + setCurrent(current) { + this.current = current; + } + + setPageSize(pageSize) { + this.pageSize = pageSize; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index d9b5d30..8b317a2 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -4,6 +4,7 @@ import isEmpty from 'lodash/isEmpty' import { WeaTableNew } from "comsMobx"; import { Modal, message } from "antd"; import { i18n } from "../public/i18n"; +import forEach from 'lodash/forEach' import * as Api from '../apis/company'; // 引入API接口文件 @@ -15,13 +16,14 @@ export class CompanyExtendStore { @observable isNew = true; @observable loading = true; @observable tabInfo = []; - @observable selectedKey = 0; - @observable detailSelectedKey = 0; + @observable selectedKey = '0'; + @observable detailSelectedKey = '0'; @observable topTab = []; @observable buttons = {}; @observable id = ''; //分部id @observable date = ''; @observable personalEditTables; + @observable tabkey = '0' @observable selectedRowKeys = []; @@ -42,10 +44,12 @@ export class CompanyExtendStore { this.getData(); this.getTabInfo(); //this.tabkey = '0'; + this.detailSelectedKey = '0' } init = () => { //this.tabkey = '0'; + this.detailSelectedKey = '0' this.isEditor = false; } @@ -56,9 +60,8 @@ export class CompanyExtendStore { this.form.validateForm().then(f => { if (f.isValid) { if (this.personalEditTables) { - // const targetDatas = this.tableInfo[this.tabkey].tabinfo.datas, - // isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true - let isPass = true; + const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, + isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true if (isPass) { this.editResource() } else { @@ -77,28 +80,25 @@ export class CompanyExtendStore { editResource = () => { let pDatas = this.form.getFormParams(); - - // API.editResource({ ...{ - // operation: 'editpersonalinfo', - // id: this.hrmId - // }, - // ...pDatas, - // ...this.getTableEditParams() - // }). - // then(data => { - // if (data.status == '1') { - // message.success(i18n.message.saveSuccess()); - // this.init(); - // this.getData(); - // this.selectedRowKeys = []; - // } else { - // message.warning(data.message); - // } - // this.loading = false; - // }, error => { - // message.warning(error.message); - // this.loading = false; - // }) + Api.editResource({ ...{ + id: this.id + }, + ...pDatas, + ...this.getTableEditParams() + }).then(data => { + if (data.code == 200) { + message.success(i18n.message.saveSuccess()); + this.init(); + this.getData(); + this.selectedRowKeys = []; + } else { + message.warning(data.message); + } + this.loading = false; + }, error => { + message.warning(error.message); + this.loading = false; + }) } getTableEditParams = () => { @@ -119,1002 +119,31 @@ export class CompanyExtendStore { - getData = (params) => { - this.loading = true; - params = { - ...params, - viewAttr: this.isEditor ? 2 : 1 + getData = () => { + this.setLoading(true); + let params = { + viewAttr: this.isEditor ? 2 : 1, + id: this.id } - let data = { - "result": { - "tables": [ - { - "tabinfo": { - "rownum": "rownum", - "columns": [ - { - "com": [ - { - "key": "member", - "label": "", - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "quickSearch": false, - "type": "INPUT", - "viewAttr": 1, - "width": "80%" - } - ], - "dataIndex": "member", - "width": "80%%", - "title": "成员", - "key": "member" - }, - { - "com": [ - { - "key": "title", - "label": "", - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "quickSearch": false, - "type": "INPUT", - "viewAttr": 1, - "width": "80%" - } - ], - "dataIndex": "title", - "width": "80%%", - "title": "称谓", - "key": "title" - }, - { - "com": [ - { - "key": "company", - "label": "", - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "quickSearch": false, - "type": "INPUT", - "viewAttr": 1, - "width": "80%" - } - ], - "dataIndex": "company", - "width": "80%%", - "title": "工作单位", - "key": "company" - }, - { - "com": [ - { - "key": "jobtitle", - "label": "", - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "quickSearch": false, - "type": "INPUT", - "viewAttr": 1, - "width": "80%" - } - ], - "dataIndex": "jobtitle", - "width": "80%%", - "title": "职务", - "key": "jobtitle" - }, - { - "com": [ - { - "key": "address", - "label": "", - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "quickSearch": false, - "type": "INPUT", - "viewAttr": 1, - "width": "80%" - } - ], - "dataIndex": "address", - "width": "80%%", - "title": "地址", - "key": "address" - } - ], - "datas": [ - { - "address": "", - "jobtitle": "1", - "member": "1", - "company": "1", - "title": "1" - } - ] - }, - "hide": false, - "tabname": "家庭情况" - } - ], - "buttons": { - "hasSave": true, - "hasEdit": true - }, - "id": "22", - "conditions": [ - { - "hide": false, - "title": "个人信息", - "defaultshow": true, - "items": [ - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "DATEPICKER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "birthday" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "出生日期", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "folk" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "民族", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "nativeplace" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "籍贯", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "regresidentplace" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "户口", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "certificatenum" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "身份证号码", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "SELECT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "maritalstatus" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "key": "0", - "label": "婚姻状况", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "options": [ - { - "disabled": false, - "key": "0", - "selected": true, - "showname": "未婚", - "visible": true - }, - { - "disabled": false, - "key": "1", - "selected": false, - "showname": "已婚", - "visible": true - }, - { - "disabled": false, - "key": "2", - "selected": false, - "showname": "离异", - "visible": true - } - ], - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "0", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "policy" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "政治面貌", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "DATEPICKER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "bememberdate" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "入团日期", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "DATEPICKER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "bepartydate" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "入党日期", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "SELECT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "islabouunion" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "key": "1", - "label": "工会会员", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "options": [ - { - "disabled": false, - "key": "1", - "selected": true, - "showname": "是", - "visible": true - }, - { - "disabled": false, - "key": "0", - "selected": false, - "showname": "否", - "visible": true - } - ], - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "1", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "browserConditionParam": { - "asynLoadAll": false, - "checkStrictly": true, - "completeParams": {}, - "conditionDataParams": {}, - "dataParams": {}, - "defaultCheckStrictly": true, - "defaultExpandedLevel": 0, - "destDataParams": {}, - "expandfirstnode": false, - "handleTypes": "", - "hasAddBtn": false, - "hasAdvanceSerach": true, - "hasBorder": false, - "hasTabConditions": false, - "hideAdvanceSearch": false, - "hideVirtualOrg": false, - "icon": "icon-coms-hrm", - "iconBgcolor": "#217346", - "idSeparator": ",", - "isAutoComplete": 1, - "isDetail": 0, - "isMultCheckbox": false, - "isSingle": true, - "linkUrl": "/spa/hrm/engine.html#/hrmengine/edu?id=", - "mobileLinkUrl": "", - "noOperate": true, - "otherParams": {}, - "pageSize": 10, - "quickSearchName": "", - "replaceDatas": [], - "replaceNotCtrl": false, - "scrollx": false, - "searchParams": {}, - "searchPlaceholder": "", - "showCheckStrictly": true, - "title": "学历", - "type": "30", - "viewAttr": 1 - }, - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "BROWSER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "educationlevel" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "学历", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "degree" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "学位", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "SELECT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "healthinfo" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "key": "0", - "label": "健康状况", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "options": [ - { - "disabled": false, - "key": "0", - "selected": true, - "showname": "优秀", - "visible": true - }, - { - "disabled": false, - "key": "1", - "selected": false, - "showname": "良好", - "visible": true - }, - { - "disabled": false, - "key": "2", - "selected": false, - "showname": "一般", - "visible": true - }, - { - "disabled": false, - "key": "3", - "selected": false, - "showname": "较差", - "visible": true - } - ], - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "0", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUTNUMBER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "height" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "身高(cm)", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "0", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUTNUMBER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "weight" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "体重(kg)", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "0", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "residentplace" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "现居住地", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "homeaddress" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "家庭联系方式", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "tempresidentnumber" - ], - "entSearch": false, - "fieldcol": 12, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "暂住证号码", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "otherParams": { - "inputType": "multilang", - "isBase64": true - }, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "", - "valueList": [], - "viewAttr": 1 - } - ] - } - ], - "topTab": [ - { - "title": "总部信息", - "viewCondition": "1" - } - ] - } - } - // API.getResourceCard(params).then((data) => { - // this.loading = false; - // this.form.initFormFields(data.result.conditions); - // this.conditions = data.result.conditions; - // this.tableInfo = this.handleTable(data.result.tables); - // this.getTabInfo(); - // this.buttons = data.result.buttons; - // this.hrmId = data.result.id; + Api.getCompanyExtendForm(params).then((res) => { + if (res.code === 200) { + res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); + res.data.result.conditions && this.setConditions(res.data.result.conditions); + this.tableInfo = this.handleTable(res.data.result.tables); + this.getTabInfo(); + res.data.result.buttons && this.setButtons(res.data.result.buttons); + res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); + this.isEditor && this.getSelectedRows(); + this.setLoading(false); - // this.isEditor && this.getSelectedRows(); - // }) - this.loading = false; - this.form.initFormFields(data.result.conditions); - this.conditions = data.result.conditions; - this.tableInfo = this.handleTable(data.result.tables); - this.getTabInfo(); - this.buttons = data.result.buttons; - this.setTopTab(data.result.topTab); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } @@ -1140,18 +169,27 @@ export class CompanyExtendStore { }) } }) - if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + //if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; } setLoading(val) { - this.loading(false); + this.loading = val; } - updateDetailSelectedKey = (key) => { + updateTabKey = (key) => { + this.tabKey = key; + } + + updateDetailSelectedKey =(key) => { this.detailSelectedKey = key; } + updateTableInfo = (data) => { + this.tableInfo = data + } + setSelectedKey = (key) => { this.selectedKey = key; } @@ -1183,5 +221,17 @@ export class CompanyExtendStore { this.id = id; } + setPersonalEditTables = (ref) => { + this.personalEditTables = ref; + } + + setConditions(conditions) { + this.conditions = conditions; + } + + setButtons(buttons) { + this.buttons = buttons; + } + }