diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index 8c55b59..fc06b9c 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -45,6 +45,10 @@ export const add = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params); } +export const version = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', params); +} + export const editResource = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params); } diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index 812b8c0..c0f15eb 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -41,6 +41,10 @@ export const getMergeForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params); } +export const version = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params); +} + export const getTransferForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params); } diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index 6199217..f90612d 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -39,6 +39,10 @@ export const getResourceExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params); } +export const version = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params); +} + export const exportResource = (ids) => { diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index c2d8a78..97c53b7 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 14:52:39 - * @LastEditTime: 2022-10-12 18:01:56 + * @LastEditTime: 2022-12-09 11:08:06 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ @@ -9,7 +9,7 @@ import { Button, Modal, message, Row, Col, Spin } from 'antd'; import isEmpty from 'lodash/isEmpty' import cloneDeep from 'lodash/cloneDeep' import forEach from 'lodash/forEach' -import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop,WeaSlideModal } from 'ecCom' import { WeaSwitch } from 'comsMobx'; import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; @@ -30,9 +30,9 @@ export default class CompanyExtend extends React.Component { this.init(); } init = () => { - const { companyExtend,company } = this.props; + const { companyExtend, company } = this.props; //const {id} = company; - let {hash} = window.location; + let { hash } = window.location; hash = hash.split("?")[0]; let id = hash.match("[^/]+(?=/$|$)")[0]; companyExtend.init(); @@ -42,14 +42,14 @@ export default class CompanyExtend extends React.Component { getTabChildren = () => { const { companyExtend } = this.props; - let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = companyExtend; let tabChildren = []; tableInfo = toJS(tableInfo); tableInfo && tableInfo.map((t, i) => { if (detailSelectedKey == i) { tabChildren.push( companyExtend.setPersonalEditTables(ref)} + ref={(ref) => companyExtend.setPersonalEditTables(ref)} showTitle={isEditor} // title={'列表信息'} //addFirstRow={isEditor} @@ -128,7 +128,7 @@ export default class CompanyExtend extends React.Component { labelCol={{ span: `${field.labelcol}` }} wrapperCol={{ span: `${field.fieldcol}` }}> - {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } ), colSpan: 1 }); @@ -179,6 +179,13 @@ export default class CompanyExtend extends React.Component { onClick: key => { this.editCard(); } + }, { + icon: , + content: i18n.button.version(), + key: 'view', + onClick: key => { + this.editCard(); + } } ] } @@ -193,6 +200,7 @@ export default class CompanyExtend extends React.Component { const save = ; const back = ; const edit = ; + const view = ; const btns = []; try { if (isEditor) { @@ -203,6 +211,7 @@ export default class CompanyExtend extends React.Component { } else { if (buttons.hasEdit) { btns.push(edit); + btns.push(view); } } } catch (e) { } @@ -223,66 +232,88 @@ export default class CompanyExtend extends React.Component { this.init(); } + view = () => { + const { companyExtend } = this.props; + companyExtend.open = true; + } + + onClose = () => { + const { companyExtend } = this.props; + companyExtend.open = false; + } + changeData(key) { const { companyExtend } = this.props; companyExtend.changeData(key); -} + } render() { const { companyExtend } = this.props; - const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open } = companyExtend; - try { - return ( -
- + + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} > - } - iconBgcolor='#217346' - buttons={this.getTopButtons()} - showDropIcon={true} - dropMenuDatas={this.getRightMenu()} - > - - - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - companyExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } -
-
-
+ + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + companyExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
+ + + -
- ) - } - catch (e) { - return -
{i18n.message.authFailed()}
-
- } + + + console.log('onAnimationEnd')}/> + + + ) + //} + // catch (e) { + // return + //
{i18n.message.authFailed()}
+ //
+ // } } } diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index dee4201..9736dd3 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-12-08 14:09:12 + * @LastEditTime: 2022-12-09 11:36:44 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -174,6 +174,24 @@ export default class Company extends React.Component { }); } + version(record) { + const { + company + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: `确认将{${record.subCompanyDesc}}存为新版本?`, + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + company.version(record); + }, + onCancel() { + return false; + }, + }); + } + getTransferForm() { const { company @@ -348,6 +366,9 @@ export default class Company extends React.Component { { _this.transfer(record.id) }}>转移 + + { _this.version(record) }}>另存为版本 + ) return diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 0cc5704..62b9228 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-12-08 14:02:45 + * @LastEditTime: 2022-12-09 11:47:53 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -338,6 +338,25 @@ export default class Department extends React.Component { !this.isEmptyObject(form.getFormParams()) && department.updateFields(val); } + version(record) { + const { + department + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: `确认将{${record.departmentMark}}存为新版本?`, + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + department.version(record); + }, + onCancel() { + return false; + }, + }); + } + + reRenderColumns(columns) { const { @@ -382,6 +401,9 @@ export default class Department extends React.Component { { _this.copy(record.id) }}>复制 + + { _this.version(record) }}>另存为版本 + ) return diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 58ca03e..fffa35a 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -335,12 +335,31 @@ export default class Resource extends React.Component { index } = operate; (index == '0') && this.view(record.randomFieldId); + (index == '1') && this.version(record); } view(id) { window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${id}`); } + version(record) { + const { + resource + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: `确认将{${record.lastname}}存为新版本?`, + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + resource.version(record); + }, + onCancel() { + return false; + }, + }); + } + handleSave() { const { resource diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index f7c6c57..6cd5a65 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -873,6 +873,7 @@ export const i18n = { createType: () => getLabel(30131, '新建类型'), editTypeInfo: () => getLabel(32732, '编辑类型'), nextStep:() => getLabel(30131, '下一步'), + version:() => getLabel(30131, '查看历史版本'), batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 55c43fd..813a65e 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -265,6 +265,18 @@ export class CompanyStore { }) } + @action("另存为版本") version(record) { + Api.version(record).then(res => { + if (res.code === 200) { + message.success(res.msg); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + updateFields(val) { this.form.updateFields({ subCompanyDesc: { diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index e68f188..7729e26 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -23,7 +23,9 @@ export class CompanyExtendStore { @observable id = ''; //分部id @observable date = ''; @observable personalEditTables; - @observable tabkey = '0' + @observable tabkey = '0'; + + @observable open = false; @observable selectedRowKeys = []; diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 60992fe..b3808b1 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -374,6 +374,18 @@ export class DepartmentStore { }) } + @action("另存为版本") version(record) { + Api.version(record).then(res => { + if (res.code === 200) { + message.success(res.msg); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + updateFields(val) { this.form.updateFields({ diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 90c45af..0b0dc6f 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -167,6 +167,18 @@ const { this.tableStore.selectedRowKeys = []; } + @action("另存为版本") version(record) { + Api.version(record).then(res => { + if (res.code === 200) { + message.success(res.msg); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + updateFields(val) { this.form2.updateFields({ lastName: {