测试问题修改

This commit is contained in:
Chengliang 2022-06-24 17:58:51 +08:00
parent b9d63ec406
commit 58b118ebe3
6 changed files with 74 additions and 119 deletions

View File

@ -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) => { export const getCompanyForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', 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) => { export const getCompanyExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params);
} }

View File

@ -63,7 +63,7 @@ export default class NewAndEditDialog extends React.Component {
bindChangeEnvent(data.planYear.value); bindChangeEnvent(data.planYear.value);
} }
if(moduleName == 'department' && data.parent_comp ){ if(moduleName == 'department' && data.parent_comp ){
bindChangeEnvent(data); bindChangeEnvent(data.parent_comp.value);
} }
if(moduleName == 'job' && (data.sequence_id)){ if(moduleName == 'job' && (data.sequence_id)){
bindChangeEnvent(data); bindChangeEnvent(data);

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-18 16:23:32 * @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-06-24 14:15:51 * @LastEditTime: 2022-06-24 16:47:53
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/ */
@ -79,6 +79,7 @@ export default class Company extends React.Component {
} = this.props; } = this.props;
company.getTableInfo(); company.getTableInfo();
company.getHasRight(); company.getHasRight();
company.getMoveForm();
} }
getTopMenuBtns() { getTopMenuBtns() {

View File

@ -60,11 +60,10 @@ export class CompanyStore {
saveAndSetting = false; saveAndSetting = false;
@observable form2 = new WeaForm(); //转移表单 @observable form2 = new WeaForm(); //转移表单
@observable transferCondition = [];
@action transfer(id) {
debugger
}
@action @action
getTableInfo() { getTableInfo() {
@ -95,9 +94,6 @@ export class CompanyStore {
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
this.setLoading(false); this.setLoading(false);
this.setInit(false); this.setInit(false);
//form2
this.form2.initFormFields(this.transferCondition);
} else { } else {
message.warning(res.msg); 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() { save() {
let params = { let params = {
...this.form1.getFormParams() ...this.form1.getFormParams()
@ -390,101 +418,10 @@ export class CompanyStore {
this.saveAndSetting = bool; this.saveAndSetting = bool;
} }
/********************* form2 *********************/ setTransferCondition(transferCondition) {
this.transferCondition = transferCondition;
}
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": "基本信息"
}
]
} }

View File

@ -17,6 +17,9 @@ import {
import { import {
i18n i18n
} from '../public/i18n'; } from '../public/i18n';
import {
findIndex
} from 'lodash';
const toJS = mobx.toJS; const toJS = mobx.toJS;
const { const {
@ -377,12 +380,26 @@ export class DepartmentStore {
}) })
} }
updateConditions(data) { key = '';
updateConditions(val) {
this.form1.updateFields({ this.form1.updateFields({
parent_dept: { parent_dept: {
value: '' 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) { updateFields(val) {

View File

@ -280,21 +280,6 @@ export class JobGradeStore {
let currenttime = Date.now(); let currenttime = Date.now();
let key = `schemId_${currenttime}`; let key = `schemId_${currenttime}`;
const lastKey = this.key; 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) Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams,lastKey)
this.setKey(key); this.setKey(key);
this.condition[0].items[4].browserConditionParam.dataParams = { this.condition[0].items[4].browserConditionParam.dataParams = {