|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message,Calendar , DatePicker, Upload, Form ,Modal,Tabs,Card } from 'antd';
|
|
|
+import {Tag, Tooltip, Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message,Calendar , DatePicker, Upload, Form ,Modal,Tabs,Card } from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import Jquery from 'jquery/dist/jquery.js';
|
|
@@ -329,6 +329,12 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
+ businessScope: [],
|
|
|
+ inputVisible: false,
|
|
|
+ inputValue: '',
|
|
|
+ salesTarget: [],
|
|
|
+ inputVisible1: false,
|
|
|
+ inputValue1: '',
|
|
|
pages:1,
|
|
|
pdfUrl:'',
|
|
|
addressSearch: [],
|
|
@@ -396,14 +402,14 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
title: '资料完整度',
|
|
|
dataIndex: 'dataGrade',
|
|
|
key: 'dataGrade',
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
title: '行业',
|
|
|
dataIndex: 'industry',
|
|
|
key: 'industry'
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
title: '创建时间',
|
|
|
dataIndex: 'createTime',
|
|
@@ -435,7 +441,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
dataIndex: 'auditStatus',
|
|
|
key: 'auditStatus',
|
|
|
render: text => { return getTechAuditStatus(text) }
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
title: '是否精品',
|
|
|
dataIndex: 'boutique',
|
|
@@ -483,7 +489,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
return (
|
|
|
<div>
|
|
|
<Popconfirm title={'您将删除该条财务信息,请确认!'} onConfirm={(e)=>{this.deltalc(record)}} okText="确认" cancelText="取消">
|
|
|
- <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
|
|
|
+ <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
|
|
|
</Popconfirm>
|
|
|
</div>
|
|
|
)
|
|
@@ -499,7 +505,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
title: '年份',
|
|
|
dataIndex: 'year',
|
|
|
key: 'year',
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
title: '项目状态',
|
|
|
dataIndex: 'status',
|
|
@@ -517,7 +523,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
return (
|
|
|
<div>
|
|
|
<Popconfirm title={'您将删除该项目,请确认!'} onConfirm={(e)=>{this.deltalx(record)}} okText="确认" cancelText="取消">
|
|
|
- <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
|
|
|
+ <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
|
|
|
</Popconfirm>
|
|
|
</div>
|
|
|
)
|
|
@@ -527,6 +533,66 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
dataSourcex: [],
|
|
|
};
|
|
|
},
|
|
|
+ handleClose(removedTag){
|
|
|
+ const businessScope = this.state.businessScope.filter(tag => tag !== removedTag);
|
|
|
+ this.setState({ businessScope });
|
|
|
+ },
|
|
|
+
|
|
|
+ showInput(){
|
|
|
+ this.setState({ inputVisible: true }, () => this.input.focus());
|
|
|
+ },
|
|
|
+
|
|
|
+ handleInputChange(e){
|
|
|
+ this.setState({ inputValue: e.target.value });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleInputConfirm(){
|
|
|
+ const state = this.state;
|
|
|
+ const inputValue = state.inputValue;
|
|
|
+ let businessScope = state.businessScope;
|
|
|
+ if(inputValue.length > 16){
|
|
|
+ message.warning('标签字数不能超过16个字符')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (inputValue && businessScope.indexOf(inputValue) === -1) {
|
|
|
+ businessScope = [...businessScope, inputValue];
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ businessScope,
|
|
|
+ inputVisible: false,
|
|
|
+ inputValue: '',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose1(removedTag){
|
|
|
+ const salesTarget = this.state.salesTarget.filter(tag => tag !== removedTag);
|
|
|
+ this.setState({ salesTarget });
|
|
|
+ },
|
|
|
+
|
|
|
+ showInput1(){
|
|
|
+ this.setState({ inputVisible1: true }, () => this.input1.focus());
|
|
|
+ },
|
|
|
+
|
|
|
+ handleInputChange1(e){
|
|
|
+ this.setState({ inputValue1: e.target.value });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleInputConfirm1(){
|
|
|
+ const state = this.state;
|
|
|
+ const inputValue = state.inputValue1;
|
|
|
+ let salesTarget = state.salesTarget;
|
|
|
+ if(inputValue.length > 16){
|
|
|
+ message.warning('标签字数不能超过16个字符')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (inputValue && salesTarget.indexOf(inputValue) === -1) {
|
|
|
+ salesTarget = [...salesTarget, inputValue];
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ salesTarget,
|
|
|
+ inputVisible1: false,
|
|
|
+ inputValue1: '',
|
|
|
+ });
|
|
|
+ },
|
|
|
componentWillMount() {
|
|
|
//城市
|
|
|
let Province = [];
|
|
@@ -584,7 +650,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
this.state.researchAmount=undefined;//研发费用
|
|
|
this.state.salesAmount = undefined;//销售额
|
|
|
this.state.year = undefined;//年份清零
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
resetx() {
|
|
|
this.state.id=undefined;//年报ID
|
|
@@ -592,7 +658,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
this.state.status=undefined;//项目状态
|
|
|
this.state.remark = undefined;//备注
|
|
|
this.state.year = undefined;//年份清零
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
//列表详情
|
|
|
details(id) {
|
|
@@ -642,7 +708,8 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
international:thisDetail.international,//是否国际化
|
|
|
orgCode:thisDetail.orgCode,//社会统一机构
|
|
|
orgCodeUrl:thisDetail.orgCodeUrl? splitUrl(thisDetail.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],//社会统一机构地址
|
|
|
- businessScope:thisDetail.businessScope,//业务范围
|
|
|
+ businessScope:thisDetail.businessScope ? thisDetail.businessScope.split(',').filter((v)=> v) : [],//业务范围
|
|
|
+ salesTarget:thisDetail.salesTarget ? thisDetail.salesTarget.split(',').filter((v)=> v) : [],//销售目标企业
|
|
|
contacts:thisDetail.contacts,//主要联系人姓名
|
|
|
contactMobile:thisDetail.contactMobile,//主要联系人电话
|
|
|
investment:thisDetail.investment,//投资机构
|
|
@@ -661,7 +728,6 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
creditRating:thisDetail.creditRating?thisDetail.creditRating.toString():"",//信用等级
|
|
|
pojectApplicationUrl:thisDetail.pojectApplicationUrl,//文件地址
|
|
|
});
|
|
|
- console.log(this.state.ProvinceCity)
|
|
|
}}.bind(this),
|
|
|
}).always(function() {
|
|
|
this.setState({
|
|
@@ -688,10 +754,14 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
message.warning('请填写注册资本');
|
|
|
return false;
|
|
|
};
|
|
|
- if(!this.state.businessScope) {
|
|
|
+ if(this.state.businessScope.length <=0) {
|
|
|
message.warning('请填写公司主营产品');
|
|
|
return false;
|
|
|
};
|
|
|
+ if(this.state.salesTarget.length <=0) {
|
|
|
+ message.warning('请填写销售目标企业');
|
|
|
+ return false;
|
|
|
+ };
|
|
|
var reg = /^[1-9]\d*$|^0$/;
|
|
|
if(this.state.consultationPrice) {
|
|
|
if(this.state.consultationPrice.length > 6) {
|
|
@@ -766,7 +836,8 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
international:this.state.international,//是否国际化
|
|
|
orgCode:this.state.orgCode,//社会统一机构
|
|
|
orgCodeUrl: theorgCodeUrl.length != 0 ? theorgCodeUrl : '',//社会统一机构地址
|
|
|
- businessScope:this.state.businessScope,//业务范围
|
|
|
+ businessScope:this.state.businessScope.join(','),//业务范围
|
|
|
+ salesTarget:this.state.salesTarget.join(','),//销售目标企业
|
|
|
contacts:this.state.contacts,//主要联系人姓名
|
|
|
contactMobile:this.state.contactMobile,//主要联系人电话
|
|
|
investment:this.state.investment,//投资机构
|
|
@@ -917,9 +988,9 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
this.state.isXian=0;
|
|
|
this.details(record.id);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//指定转交人自动补全
|
|
|
- supervisor(e){
|
|
|
+ supervisor(e){
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
@@ -928,23 +999,23 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
data:{
|
|
|
adminName:e
|
|
|
},
|
|
|
- success: function (data) {
|
|
|
+ success: function (data) {
|
|
|
let thedata=data.data;
|
|
|
if (!thedata) {
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- thedata = {};
|
|
|
- };
|
|
|
+ };
|
|
|
+ thedata = {};
|
|
|
+ };
|
|
|
this.setState({
|
|
|
- customerArr:thedata,
|
|
|
+ customerArr:thedata,
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
|
- }.bind(this));
|
|
|
+ }.bind(this));
|
|
|
},
|
|
|
//输入转交人输入框失去焦点是判断客户是否存在
|
|
|
selectAuto(value,options){
|
|
@@ -960,7 +1031,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
if (item.name == e.toString()) {
|
|
|
theType = item.id;
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
this.setState({
|
|
|
theTypes:theType
|
|
@@ -969,8 +1040,8 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
//值改变时请求客户名称
|
|
|
httpChange(e){
|
|
|
if(e.length>=1){
|
|
|
- this.supervisor(e);
|
|
|
- }
|
|
|
+ this.supervisor(e);
|
|
|
+ }
|
|
|
this.setState({
|
|
|
auto:e
|
|
|
})
|
|
@@ -995,8 +1066,8 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
url: globalConfig.context + "/api/admin/customer/updateInformationMaintainerr",
|
|
|
data: {
|
|
|
id: id, //客户ID
|
|
|
- aid: this.state.theTypes, //指定转交人的ID
|
|
|
-
|
|
|
+ aid: this.state.theTypes, //指定转交人的ID
|
|
|
+
|
|
|
}
|
|
|
}).done(function(data) {
|
|
|
if(!data.error.length) {
|
|
@@ -1014,7 +1085,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
message.warning('请输入转交人姓名')
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//详情打开
|
|
|
visitOk(e) {
|
|
|
this.setState({
|
|
@@ -1045,14 +1116,14 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
visitModulx: false,
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//PDF打开
|
|
|
visitOk1(e) {
|
|
|
this.getPrevie(this.state.uid, 'techProject', 'organization_application');
|
|
|
this.setState({
|
|
|
visitModul1: true
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
//PDF关闭
|
|
|
visitCancel1(e) {
|
|
@@ -1099,7 +1170,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
handlePrevious (){
|
|
|
this.setState({ pagec: this.state.pagec - 1 });
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
handleNext (){
|
|
|
this.setState({ pagec: this.state.pagec + 1 });
|
|
|
},
|
|
@@ -1121,10 +1192,10 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
</nav>
|
|
|
);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//上面是做PDF分页的
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
getOrgCodeUrl(e) {
|
|
|
this.setState({ orgCodeUrl: e });
|
|
|
},
|
|
@@ -1239,7 +1310,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//删除财务信息
|
|
|
deltalc(record){
|
|
|
this.setState({
|
|
@@ -1346,12 +1417,13 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
const options = dataSources.map((group) =>
|
|
|
<Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
|
|
|
)
|
|
|
+ const { businessScope, inputVisible, inputValue,salesTarget, inputVisible1, inputValue1 } = this.state;
|
|
|
const intentionState = this.props.intentionState ||'';
|
|
|
const props = {
|
|
|
name: 'file',
|
|
|
multiple: true,
|
|
|
action: '/api/admin/techproject/upload',
|
|
|
-
|
|
|
+
|
|
|
onChange(info) {
|
|
|
const status = info.file.status;
|
|
|
if (status !== 'uploading') {
|
|
@@ -1362,9 +1434,11 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
message.error(`${info.file.name} file upload failed.`);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
};
|
|
|
let pdfUrl =this.state.pdfUrl||'';
|
|
|
+ this.saveInputRef = input => this.input = input
|
|
|
+ this.saveInputRef1 = input => this.input1 = input
|
|
|
return (
|
|
|
<div className="user-content">
|
|
|
<ShowModalDiv ShowModal={this.state.showModal} />
|
|
@@ -1642,20 +1716,70 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
wrapperCol={{ span: 20 }}
|
|
|
label="主营产品"
|
|
|
>
|
|
|
- <Input
|
|
|
- type="textarea"
|
|
|
- rows={2}
|
|
|
- value={this.state.businessScope}
|
|
|
- style={{ width: "95%" }}
|
|
|
- onChange={(e, pre) => {
|
|
|
- this.setState({ businessScope: e.target.value });
|
|
|
- }}
|
|
|
- />
|
|
|
- <span style={{ color: "red", marginLeft: "5px" }}>
|
|
|
- *
|
|
|
- </span>
|
|
|
+ <div>
|
|
|
+ {businessScope.map((tag, index) => {
|
|
|
+ const isLongTag = tag.length > 20;
|
|
|
+ const tagElem = (
|
|
|
+ <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
|
|
|
+ {isLongTag ? `${tag.slice(0, 20)}...` : tag}
|
|
|
+ </Tag>
|
|
|
+ );
|
|
|
+ return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
|
|
|
+ })}
|
|
|
+ {inputVisible && (
|
|
|
+ <Input
|
|
|
+ ref={this.saveInputRef}
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ style={{ width: 78 }}
|
|
|
+ value={inputValue}
|
|
|
+ onChange={this.handleInputChange}
|
|
|
+ onBlur={this.handleInputConfirm}
|
|
|
+ onPressEnter={this.handleInputConfirm}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {!inputVisible && <Button size="small" type="primary" onClick={this.showInput}>+ 新增主营产品</Button>}
|
|
|
+ <span style={{ color: "red", marginLeft: "5px" }}>
|
|
|
+ *
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 20 }}
|
|
|
+ label="销售目标企业"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ {salesTarget.map((tag, index) => {
|
|
|
+ const isLongTag = tag.length > 20;
|
|
|
+ const tagElem = (
|
|
|
+ <Tag closable key={tag} afterClose={() => this.handleClose1(tag)}>
|
|
|
+ {isLongTag ? `${tag.slice(0, 20)}...` : tag}
|
|
|
+ </Tag>
|
|
|
+ );
|
|
|
+ return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
|
|
|
+ })}
|
|
|
+ {inputVisible1 && (
|
|
|
+ <Input
|
|
|
+ ref={this.saveInputRef1}
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ style={{ width: 78 }}
|
|
|
+ value={inputValue1}
|
|
|
+ onChange={this.handleInputChange1}
|
|
|
+ onBlur={this.handleInputConfirm1}
|
|
|
+ onPressEnter={this.handleInputConfirm1}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {!inputVisible1 && <Button size="small" type="primary" onClick={this.showInput1}>+ 新增销售目标企业</Button>}
|
|
|
+ <span style={{ color: "red", marginLeft: "5px" }}>
|
|
|
+ *
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
<div
|
|
|
style={{
|
|
|
fontSize: "18px",
|
|
@@ -2151,7 +2275,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
>
|
|
|
<div>
|
|
|
{/*<Button type="primary" onClick={this.pdfShows(pdfUrl)}>点击查看</Button>
|
|
|
-
|
|
|
+
|
|
|
<div id="pdfContent" style={{height:"500px",width:"500px",marginLeft:"300px"}} >
|
|
|
</div>
|
|
|
onDocumentLoad={this.onDocumentComplete}
|
|
@@ -2373,4 +2497,4 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
);
|
|
|
}
|
|
|
}));
|
|
|
-export default IntentionCustomer;
|
|
|
+export default IntentionCustomer;
|