|
@@ -186,63 +186,81 @@ const Organization=Form.create()(React.createClass({
|
|
|
if(!(superOne==superText)){
|
|
|
if(confirm('上级组织已修改,是否保存?')){
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url:globalConfig.context + '/api/admin/organization/updateOrganization',
|
|
|
- data:{
|
|
|
- name:this.state.editName,//组织名称
|
|
|
- type:this.state.editType, //组织类型
|
|
|
- managerId:this.state.theTypes?this.state.theTypes:this.state.managerIdOrganizationId,//负责人ID
|
|
|
- superId:this.state.editSuperId,//上级组织
|
|
|
- status:this.state.editStatus,//组织状态
|
|
|
- remarks:remarksText,//组织职能说明
|
|
|
- id:this.state.editId,//组织ID
|
|
|
- updateOrganization:this.state.updateOrganization,
|
|
|
- abbreviation:this.state.abbreviation
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.edithandleCancel();
|
|
|
- this.selectSuperId();
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url:
|
|
|
+ globalConfig.context +
|
|
|
+ "/api/admin/organization/updateOrganization",
|
|
|
+ data: {
|
|
|
+ name: this.state.editName, //组织名称
|
|
|
+ type: this.state.editType, //组织类型
|
|
|
+ managerId: this.state.theTypes
|
|
|
+ ? this.state.theTypes
|
|
|
+ : this.state.managerIdOrganizationId, //负责人ID
|
|
|
+ financeId: this.state.theTypes2
|
|
|
+ ? this.state.theTypes2
|
|
|
+ : this.state.financeId, //负责人ID
|
|
|
+ superId: this.state.editSuperId, //上级组织
|
|
|
+ status: this.state.editStatus, //组织状态
|
|
|
+ remarks: remarksText, //组织职能说明
|
|
|
+ id: this.state.editId, //组织ID
|
|
|
+ updateOrganization: this.state.updateOrganization,
|
|
|
+ abbreviation: this.state.abbreviation
|
|
|
+ }
|
|
|
+ }).done(
|
|
|
+ function(data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("保存成功!");
|
|
|
+ this.edithandleCancel();
|
|
|
+ this.selectSuperId();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
return false
|
|
|
}
|
|
|
}else {
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url:globalConfig.context + '/api/admin/organization/updateOrganization',
|
|
|
- data:{
|
|
|
- name:this.state.editName,//组织名称
|
|
|
- type:this.state.editType, //组织类型
|
|
|
- managerId:this.state.theTypes?this.state.theTypes:this.state.managerIdOrganizationId,//负责人ID
|
|
|
- superId:oldId,//上级组织
|
|
|
- status:this.state.editStatus,//组织状态
|
|
|
- remarks:remarksText,//组织职能说明
|
|
|
- id:this.state.editId,//组织ID
|
|
|
- abbreviation:this.state.abbreviation
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.edithandleCancel();
|
|
|
- this.selectSuperId();
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url:
|
|
|
+ globalConfig.context +
|
|
|
+ "/api/admin/organization/updateOrganization",
|
|
|
+ data: {
|
|
|
+ name: this.state.editName, //组织名称
|
|
|
+ type: this.state.editType, //组织类型
|
|
|
+ managerId: this.state.theTypes
|
|
|
+ ? this.state.theTypes
|
|
|
+ : this.state.managerIdOrganizationId, //负责人ID
|
|
|
+ financeId: this.state.theTypes2
|
|
|
+ ? this.state.theTypes2
|
|
|
+ : this.state.financeId, //负责人ID
|
|
|
+ superId: oldId, //上级组织
|
|
|
+ status: this.state.editStatus, //组织状态
|
|
|
+ remarks: remarksText, //组织职能说明
|
|
|
+ id: this.state.editId, //组织ID
|
|
|
+ abbreviation: this.state.abbreviation
|
|
|
+ }
|
|
|
+ }).done(
|
|
|
+ function(data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("保存成功!");
|
|
|
+ this.edithandleCancel();
|
|
|
+ this.selectSuperId();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
@@ -250,63 +268,81 @@ const Organization=Form.create()(React.createClass({
|
|
|
if(confirm('上级组织已修改,是否保存?')){
|
|
|
console.log(this.state.editSuperId);
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url:globalConfig.context + '/api/admin/organization/updateOrganization',
|
|
|
- data:{
|
|
|
- name:this.state.editName,//组织名称
|
|
|
- type:this.state.editType, //组织类型
|
|
|
- managerId:this.state.theTypes?this.state.theTypes:this.state.managerIdOrganizationId,//负责人ID
|
|
|
- superId:this.state.editSuperId,//上级组织
|
|
|
- status:this.state.editStatus,//组织状态
|
|
|
- remarks:remarksText,//组织职能说明
|
|
|
- id:this.state.editId,//组织ID
|
|
|
- abbreviation:this.state.abbreviation
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.edithandleCancel();
|
|
|
- this.selectSuperId();
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url:
|
|
|
+ globalConfig.context +
|
|
|
+ "/api/admin/organization/updateOrganization",
|
|
|
+ data: {
|
|
|
+ name: this.state.editName, //组织名称
|
|
|
+ type: this.state.editType, //组织类型
|
|
|
+ managerId: this.state.theTypes
|
|
|
+ ? this.state.theTypes
|
|
|
+ : this.state.managerIdOrganizationId, //负责人ID
|
|
|
+ financeId: this.state.theTypes2
|
|
|
+ ? this.state.theTypes2
|
|
|
+ : this.state.financeId, //负责人ID
|
|
|
+ superId: this.state.editSuperId, //上级组织
|
|
|
+ status: this.state.editStatus, //组织状态
|
|
|
+ remarks: remarksText, //组织职能说明
|
|
|
+ id: this.state.editId, //组织ID
|
|
|
+ abbreviation: this.state.abbreviation
|
|
|
+ }
|
|
|
+ }).done(
|
|
|
+ function(data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("保存成功!");
|
|
|
+ this.edithandleCancel();
|
|
|
+ this.selectSuperId();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
return false
|
|
|
}
|
|
|
}else {
|
|
|
console.log(this.state.editSuperId);
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url:globalConfig.context + '/api/admin/organization/updateOrganization',
|
|
|
- data:{
|
|
|
- name:this.state.editName,//组织名称
|
|
|
- type:this.state.editType, //组织类型
|
|
|
- managerId:this.state.theTypes?this.state.theTypes:this.state.managerIdOrganizationId,//负责人ID
|
|
|
- superId:oldId,//上级组织
|
|
|
- status:this.state.editStatus,//组织状态
|
|
|
- remarks:remarksText,//组织职能说明
|
|
|
- id:this.state.editId,//组织ID
|
|
|
- abbreviation:this.state.abbreviation
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.edithandleCancel();
|
|
|
- this.selectSuperId();
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url:
|
|
|
+ globalConfig.context +
|
|
|
+ "/api/admin/organization/updateOrganization",
|
|
|
+ data: {
|
|
|
+ name: this.state.editName, //组织名称
|
|
|
+ type: this.state.editType, //组织类型
|
|
|
+ managerId: this.state.theTypes
|
|
|
+ ? this.state.theTypes
|
|
|
+ : this.state.managerIdOrganizationId, //负责人ID
|
|
|
+ financeId: this.state.theTypes2
|
|
|
+ ? this.state.theTypes2
|
|
|
+ : this.state.financeId, //负责人ID
|
|
|
+ superId: oldId, //上级组织
|
|
|
+ status: this.state.editStatus, //组织状态
|
|
|
+ remarks: remarksText, //组织职能说明
|
|
|
+ id: this.state.editId, //组织ID
|
|
|
+ abbreviation: this.state.abbreviation
|
|
|
+ }
|
|
|
+ }).done(
|
|
|
+ function(data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("保存成功!");
|
|
|
+ this.edithandleCancel();
|
|
|
+ this.selectSuperId();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -336,33 +372,36 @@ const Organization=Form.create()(React.createClass({
|
|
|
};
|
|
|
} else {
|
|
|
theArr.push({
|
|
|
- editId: thisdata.id,//每一条记录的ID
|
|
|
- editName:thisdata.name,//组织名称
|
|
|
- editManagerId:thisdata.managerId,//负责人
|
|
|
- editType:thisdata.type,//组织类型
|
|
|
- editStatus:thisdata.status,//组织状态
|
|
|
- editSuperId:thisdata.superId,//上级组织
|
|
|
- editDepNo: thisdata.depNo,//组织编号
|
|
|
- editCreateId:thisdata.createId,//创建人
|
|
|
- editTime:thisdata.createTime,//创建时间
|
|
|
- editRemarks:thisdata.remarks,//组织职能说明
|
|
|
+ editId: thisdata.id, //每一条记录的ID
|
|
|
+ editName: thisdata.name, //组织名称
|
|
|
+ editManagerId: thisdata.managerId, //负责人
|
|
|
+ editType: thisdata.type, //组织类型
|
|
|
+ editStatus: thisdata.status, //组织状态
|
|
|
+ editSuperId: thisdata.superId, //上级组织
|
|
|
+ editDepNo: thisdata.depNo, //组织编号
|
|
|
+ editCreateId: thisdata.createId, //创建人
|
|
|
+ editTime: thisdata.createTime, //创建时间
|
|
|
+ editRemarks: thisdata.remarks, //组织职能说明
|
|
|
+ financeId: thisdata.financeId
|
|
|
});
|
|
|
|
|
|
};
|
|
|
this.setState({
|
|
|
- editId: thisdata.id,//每一条记录的ID
|
|
|
- editName:thisdata.name,//组织名称
|
|
|
- managerIdOrganization:thisdata.managerName,//负责人名字
|
|
|
- managerIdOrganizationId:thisdata.managerId,//负责人idmanagerName
|
|
|
- editType:thisdata.type,//组织类型
|
|
|
- editStatus:thisdata.status,//组织状态
|
|
|
- editSuperId:thisdata.superId,//上级组织
|
|
|
- editDepNo: thisdata.depNo,//组织编号
|
|
|
- editCreateId:thisdata.createId,//创建人
|
|
|
- editTime:thisdata.createTime,//创建时间
|
|
|
- editRemarks: thisdata.remarks,//组织职能说明
|
|
|
- editDataSource: theArr,
|
|
|
- abbreviation:thisdata.abbreviation
|
|
|
+ editId: thisdata.id, //每一条记录的ID
|
|
|
+ financeId: thisdata.financeId,
|
|
|
+ financeName: thisdata.financeName,
|
|
|
+ editName: thisdata.name, //组织名称
|
|
|
+ managerIdOrganization: thisdata.managerName, //负责人名字
|
|
|
+ managerIdOrganizationId: thisdata.managerId, //负责人idmanagerName
|
|
|
+ editType: thisdata.type, //组织类型
|
|
|
+ editStatus: thisdata.status, //组织状态
|
|
|
+ editSuperId: thisdata.superId, //上级组织
|
|
|
+ editDepNo: thisdata.depNo, //组织编号
|
|
|
+ editCreateId: thisdata.createId, //创建人
|
|
|
+ editTime: thisdata.createTime, //创建时间
|
|
|
+ editRemarks: thisdata.remarks, //组织职能说明
|
|
|
+ editDataSource: theArr,
|
|
|
+ abbreviation: thisdata.abbreviation
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function (data) {
|
|
@@ -501,6 +540,23 @@ const Organization=Form.create()(React.createClass({
|
|
|
theTypes:theType
|
|
|
})
|
|
|
},
|
|
|
+ selectAuto2(value,options){
|
|
|
+ this.setState({
|
|
|
+ financeId:value
|
|
|
+ })
|
|
|
+ let theType='';
|
|
|
+ let contactLists=this.state.customerArr||[];
|
|
|
+ if (value) {
|
|
|
+ contactLists.map(function (item) {
|
|
|
+ if (item.name == value.toString()) {
|
|
|
+ theType = item.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ theTypes2:theType
|
|
|
+ })
|
|
|
+ },
|
|
|
//失去焦点时
|
|
|
blurChange(e){
|
|
|
|
|
@@ -514,10 +570,20 @@ const Organization=Form.create()(React.createClass({
|
|
|
managerIdOrganization:e
|
|
|
})
|
|
|
},
|
|
|
+ httpChange2(e){
|
|
|
+ if(e.length>=1){
|
|
|
+ this.supervisor(e);
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ financeName:e
|
|
|
+ })
|
|
|
+ },
|
|
|
addClick() {
|
|
|
this.state.theTypes='';
|
|
|
this.state.nameOrganization='';//组织名称清零
|
|
|
this.state.managerIdOrganization= '';//负责人ID清零
|
|
|
+ this.state.financeId = "";//负责人ID清零
|
|
|
+ this.state.financeName = "";//负责人ID清零
|
|
|
this.state.typeOrganization= undefined; //组织类型清零
|
|
|
this.state.upOrganization= undefined;//上级组织清零
|
|
|
this.state.remarksOrganization= '';//组织职能说明清零
|
|
@@ -583,6 +649,9 @@ const Organization=Form.create()(React.createClass({
|
|
|
const options = dataSources.map((group,index) =>
|
|
|
<Option key={index} value={group.name}>{group.name}</Option>
|
|
|
)
|
|
|
+ const options2 = dataSources.map((group,index) =>
|
|
|
+ <Option key={index} value={group.name}>{group.name}</Option>
|
|
|
+ )
|
|
|
return (
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
@@ -824,6 +893,30 @@ const Organization=Form.create()(React.createClass({
|
|
|
onChange={(e)=>{this.setState({abbreviation:e.target.value})}}/>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 7 }}
|
|
|
+ wrapperCol={{ span: 12}}
|
|
|
+ label="财务负责人"
|
|
|
+ >
|
|
|
+ <AutoComplete
|
|
|
+ className="certain-category-search"
|
|
|
+ dropdownClassName="certain-category-search-dropdown"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ dataSource={options2}
|
|
|
+ placeholder="输入名称"
|
|
|
+ value={this.state.financeName}
|
|
|
+ onChange={this.httpChange2}
|
|
|
+ filterOption={true}
|
|
|
+ onBlur={this.blurChange}
|
|
|
+ onSelect={this.selectAuto2}
|
|
|
+ style={{width:'95%'}}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </AutoComplete>
|
|
|
+ <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
labelCol={{ span: 7 }}
|