import {Button,Row,Col,Icon,message,Modal} from 'antd'; import {WeaNewScroll,WeaTextarea,WeaSearchGroup ,WeaRichText,WeaFormItem ,WeaBrowser,WeaUpload,WeaTab,WeaTools,WeaLocaleProvider} from 'ecCom'; import {inject, observer} from "mobx-react"; import {toJS} from 'mobx'; import ExchangeLogs from './exchangeLogs' import {Condition} from '../list/listCondition'; const getLabel = WeaLocaleProvider.getLabel; @observer export default class RelateExchange extends React.Component { constructor(props) { super(props); this.state ={ showGroup:false, value:"", "doc":"", "task":"", "crm":"", "workflow":"", "project":"", file:"", key:0 } } componentWillUnmount(){ this.setState({ showGroup:false, value:"", "doc":"", "task":"", "crm":"", "workflow":"", "project":"", file:"", key:0 }) } render() { const {contentStore} = this.props; const {showSearchAd ,exchangeContent,exchangeform } = contentStore; const formParams = exchangeform.getFormParams() || {}; const {showGroup,value,key} = this.state; const formItemLayout = { labelCol: { span:5 }, wrapperCol: { span: 14 }, }; return (
{/* {contentStore.setShowSearchAd(bool)}} hideSearchAd={()=> contentStore.setShowSearchAd(false)} searchsAd={
} showSearchAd={showSearchAd} onSearch={v=>{contentStore.getRelateExchangeInfo()}} onSearchChange={v=>{contentStore.setFormFields({remark:{value:v}})}} /> */} {this.saveValue(v)}} />
{getLabel(83273,"附加信息")} this.setState({showGroup:!showGroup})}/>
{this.getFormItem()} { (exchangeContent.showacc || false) &&
) } getFormItem(){ const {contentStore} = this.props; const { exchangeContent } = contentStore; const items =[ {label:getLabel(857,"相关文档"),title:getLabel(857,"文档"),type:37,key:"doc",show:exchangeContent.showdoc || false}, {label:getLabel(1044,"相关流程"),title:getLabel(18015,"流程"),type:152,key:"wf",show:exchangeContent.showwf || false}, {label:getLabel(783,"相关客户"),title:getLabel(136,"客户"),type:18,key:"crm",show:exchangeContent.showcrm || false}, {label:getLabel(782,"相关项目"),title:getLabel(101,"项目"),type:135,key:"prj",show:exchangeContent.showprj || false}, {label:getLabel(33414,"相关任务"),title:getLabel(1332,"任务"),type:'prjtsk',key:"task",show:exchangeContent.showtask || false}, ]; const formItemLayout = { labelCol: { span:5 }, wrapperCol: { span: 14 }, }; let group =[]; items.map((item,i)=>{ if(item.show){ group.push( this.docOnchange(item.key,ids, names, datas)} /> ) }else{ return; } }) return group; } docOnchange=(type,ids, names, datas)=>{ if(type =="doc"){ this.setState({doc:ids}) }else if(type == "wf"){ this.setState({workflow:ids}) }else if(type == "crm"){ this.setState({crm:ids}) }else if(type == "task"){ this.setState({task:ids}) }else if(type == "prj"){ this.setState({project:ids}) } } fileUploadBack=(arr)=>{ this.setState({file:arr}) } saveValue=(v)=>{ this.setState({value:v}) } handleSubmitExchange=()=>{ const { value,doc,task,crm,workflow, project, file,key} = this.state; const {targetid,discusstype} = this.props.contentStore; if(value){ let params = { id:targetid, discusstype:discusstype, remark:value.replace(/(^\s*)|(\s*$)/g,"").replace(/\n/g,'
'), relateddoc:doc, relatedwf:workflow, relatedcrm:crm, relatedprj:project, relatedtsk:task, relatedacc:`${file}`, } WeaTools.callApi('/api/proj/prjutil/doDiscussOpt', 'POST', params).then(data=>{ typeof this.props.callBack == "function" && this.props.callBack(); this.setState({ value:"", "doc":"", "task":"", "crm":"", "workflow":"", "project":"", file:"", key:key+1 }) }); }else{ Modal.info({ title: getLabel(15172,"系统提示"), content: getLabel(83900,"请填写交流信息"), }); } } getAdButtons = () => { const {contentStore} = this.props; const {setShowSearchAd,clearFormFields,getRelateExchangeInfo} = contentStore; return [ (), (), () ]; } pageNoChange=(index)=>{ const {contentStore} = this.props; const {getRelateExchangeInfo} = contentStore; getRelateExchangeInfo({pageIndex:index}); } }