120 lines
4.7 KiB
JavaScript
120 lines
4.7 KiB
JavaScript
|
|
import {Form, Input, Button, } from 'antd';
|
|
import {WeaDialog ,WeaTools,WeaFormItem,WeaSearchGroup,WeaLocaleProvider} from 'ecCom';
|
|
import {WeaSwitch} from "comsMobx"
|
|
import {inject, observer} from "mobx-react";
|
|
import {toJS} from 'mobx';
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
|
|
|
@observer
|
|
class RelateCrmDialog extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state={
|
|
visible:false,
|
|
conditioninfo: [
|
|
{
|
|
"items": [
|
|
{
|
|
"conditionType": "BROWSER",
|
|
'rules': 'required|string', // 校验规则
|
|
"labelcol": 6,
|
|
"colSpan": 2,
|
|
"viewAttr": 3,
|
|
"value": "1",
|
|
"domkey": [
|
|
"crmid"
|
|
],
|
|
"fieldcol": 16,
|
|
"label": getLabel(136,"客户"),
|
|
"browserConditionParam": {
|
|
"isAutoComplete": 1,
|
|
"isDetail": 0,
|
|
"title": getLabel(136,"客户"),
|
|
"linkUrl": "/crm/data/ViewCustomer.jsp?CustomerID=",
|
|
"isMultCheckbox": false,
|
|
"hasAdd": false,
|
|
"viewAttr": 2,
|
|
"dataParams": {},
|
|
"hasAdvanceSerach": true,
|
|
"isSingle": true,
|
|
"replaceDatas": [],
|
|
"type": "7"
|
|
}
|
|
},{
|
|
"conditionType": "INPUT",
|
|
"labelcol":6,
|
|
"colSpan": 2,
|
|
"viewAttr": 2,
|
|
"value": "",
|
|
"domkey": [
|
|
"reasondesc"
|
|
],
|
|
"fieldcol": 16,
|
|
"label": getLabel(433,"描述"),
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
componentDidMount(){
|
|
|
|
const {relateCrmform} = this.props.contentStore;
|
|
relateCrmform.initFormFields(this.state.conditioninfo);
|
|
|
|
}
|
|
|
|
render() {
|
|
const {contentStore,} = this.props;
|
|
const {crmType,crmVisible,handleRelateCrmDialog} = contentStore;
|
|
return (
|
|
<div>
|
|
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1otdig`}
|
|
title={crmType=="add" ?getLabel(83878,"添加相关客户"):getLabel(83879,"编辑相关客户")}
|
|
visible={crmVisible}
|
|
buttons={this.getButtons()}
|
|
icon="icon-coms-project"
|
|
iconBgcolor="#217346"
|
|
onCancel={()=>{handleRelateCrmDialog(false)}}
|
|
style={{width:'500px', height:'220px'}}
|
|
>
|
|
{this.getSearchs()}
|
|
</WeaDialog>
|
|
|
|
</div>)
|
|
}
|
|
|
|
getButtons(){
|
|
const {contentStore,} = this.props;
|
|
let btnArr = [];
|
|
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@uo1mr6`} type="primary" onClick={()=>{contentStore.saveRelateCrm()}}>{getLabel(86,"保存")}</Button>)
|
|
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5tfnm0`} type="primary" onClick={()=>contentStore.handleRelateCrmDialog(false)}>{getLabel(309,"关闭")}</Button>)
|
|
return btnArr;
|
|
}
|
|
getSearchs() {
|
|
const { relateCrmform } = this.props.contentStore;
|
|
const {isFormInit} = relateCrmform;
|
|
let group = [];
|
|
isFormInit && this.state.conditioninfo.map((c,i) =>{
|
|
let items = [];
|
|
c.items.map((field,index) => {
|
|
items.push({
|
|
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@3r9f2r@${index}`}
|
|
label={`${field.label}`}
|
|
labelCol={{span: `${field.labelcol}`}}
|
|
error={relateCrmform.getError(field)}
|
|
wrapperCol={{span: `${field.fieldcol}`}}>
|
|
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@eirw1z@${index}`} fieldConfig={field} form={relateCrmform} />
|
|
</WeaFormItem>),
|
|
colSpan:1
|
|
})
|
|
});
|
|
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@aajm14@${i}`} needTigger={true} title={getLabel(1361,"基本信息")} col={1} showGroup={true} items={items}/>)
|
|
});
|
|
return group;
|
|
}
|
|
|
|
}
|
|
|
|
export default RelateCrmDialog; |