diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index 6fb261f..d90adc4 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -76,11 +76,26 @@ export const updateForbiddenTag = (params) => { }) } +export const move = (params) => { + return fetch('/api/bs/hrmorganization/comp/moveCompany', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + export const getCompanyForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params); } +export const getMoveForm = () => { + return WeaTools.callApi('/api/bs/hrmorganization/comp/getMoveForm', 'GET'); +} + export const getCompanyExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params); } diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 8f4ea36..cd2ba9f 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -63,7 +63,7 @@ export default class NewAndEditDialog extends React.Component { bindChangeEnvent(data.planYear.value); } if(moduleName == 'department' && data.parent_comp ){ - bindChangeEnvent(data); + bindChangeEnvent(data.parent_comp.value); } if(moduleName == 'job' && (data.sequence_id)){ bindChangeEnvent(data); diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 2783ea4..002cbfa 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-06-24 14:15:51 + * @LastEditTime: 2022-06-24 16:47:53 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -79,6 +79,7 @@ export default class Company extends React.Component { } = this.props; company.getTableInfo(); company.getHasRight(); + company.getMoveForm(); } getTopMenuBtns() { diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 500af3e..40f0e1e 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -60,11 +60,10 @@ export class CompanyStore { saveAndSetting = false; @observable form2 = new WeaForm(); //转移表单 + @observable transferCondition = []; - @action transfer(id) { - debugger - } + @action getTableInfo() { @@ -95,9 +94,6 @@ export class CompanyStore { res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); this.setLoading(false); this.setInit(false); - - //form2 - this.form2.initFormFields(this.transferCondition); } else { message.warning(res.msg); } @@ -198,6 +194,38 @@ export class CompanyStore { } + getMoveForm() { + Api.getMoveForm().then(res => { + if (res.code === 200) { + res.data && this.setTransferCondition(res.data); + res.data && this.form2.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action transfer(id) { + let params = { + id: id, + ...this.form2.getFormParams(), + }; + Api.move(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + save() { let params = { ...this.form1.getFormParams() @@ -390,101 +418,10 @@ export class CompanyStore { this.saveAndSetting = bool; } - /********************* form2 *********************/ - - transferCondition = [ - { - "defaultshow": true, - "items": [ - { - "belong": "PC", - "browserConditionParam": { - "asynLoadAll": false, - "checkStrictly": true, - "completeParams": { - "type": 161, - "fielddbtype": "browser.compBrowser" - }, - "conditionDataParams": { - "type": "browser.compBrowser" - }, - "dataParams": { - "currenttime": new Date(), - "type": "browser.compBrowser" - }, - "defaultCheckStrictly": true, - "defaultExpandedLevel": 0, - "destDataParams": { - "type": "browser.compBrowser" - }, - "expandfirstnode": false, - "handleTypes": "", - "hasAddBtn": false, - "hasAdvanceSerach": false, - "hasBorder": false, - "hasTabConditions": false, - "hideAdvanceSearch": false, - "hideVirtualOrg": false, - "icon": "icon-coms-integration", - "iconColor": "#1a57a0", - "idSeparator": ",", - "isAutoComplete": 1, - "isDetail": 0, - "isMultCheckbox": false, - "isSingle": true, - "linkUrl": "", - "noOperate": true, - "otherParams": {}, - "pageSize": -1, - "quickSearchName": "", - "replaceDatas": [], - "replaceNotCtrl": false, - "scrollx": true, - "searchParams": {}, - "searchPlaceholder": "", - "showCheckStrictly": true, - "title": "公司分部浏览按钮", - "type": "161", - "viewAttr": 2 - }, - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "BROWSER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "parent_company" - ], - "entSearch": false, - "fieldcol": 16, - "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": 2 - }, - ], - "title": "基本信息" - } - ] + setTransferCondition(transferCondition) { + this.transferCondition = transferCondition; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 22bac93..408d22b 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -17,6 +17,9 @@ import { import { i18n } from '../public/i18n'; +import { + findIndex +} from 'lodash'; const toJS = mobx.toJS; const { @@ -377,12 +380,26 @@ export class DepartmentStore { }) } - updateConditions(data) { + key = ''; + updateConditions(val) { this.form1.updateFields({ parent_dept: { value: '' } }); + const label = "上级部门" + let index = findIndex(this.condition[0].items, { label }); + let currenttime = Date.now(); + let key = `parentComp_${currenttime}`; + const lastKey = this.key; + Reflect.deleteProperty(this.condition[0].items[index].browserConditionParam.dataParams, lastKey) + this.key = key; + this.condition[0].items[index].browserConditionParam.dataParams = { + [key]: val, + ...this.condition[0].items[index].browserConditionParam.dataParams, + currenttime: currenttime + } + } updateFields(val) { diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 11a6e8e..ab9b623 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -280,21 +280,6 @@ export class JobGradeStore { let currenttime = Date.now(); let key = `schemId_${currenttime}`; const lastKey = this.key; - // let conditions = []; - // this.condition[0].items.map(item => { - // if(item.domkey[0] === 'levelId') { - // Reflect.deleteProperty(item.browserConditionParam.dataParams,lastKey) - // this.setKey(key); - // //completeParams conditionDataParams - // item.browserConditionParam.dataParams = { - // [key]:val, - // ...item.browserConditionParam.dataParams, - // currenttime: currenttime - // } - // } - // conditions.push(item); - // }) - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams,lastKey) this.setKey(key); this.condition[0].items[4].browserConditionParam.dataParams = {