import React from 'react';
import { Icon, Form, Button, Input, Select, Spin, Table, DatePicker, message, Modal, Upload, Radio } from 'antd';
import { technologyStateList } from '../../../dataDic.js';
import { getTechnologyState, beforeUpload, beforeUploadFile, techDownloadFile, getPreview, companySearch } from '../../../tools.js';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
const ApplyChangeFrom = Form.create()(React.createClass({
loadData(id) {
this.setState({
loading: true
});
$.ajax({
method: "post",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/techproject/techProjectDetial",
data: {
pid: id || this.props.data.id
},
success: function (data) {
if (!data.data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
return;
};
this.state.data = data.data;
this.state.moneyType = undefined;
if (data.data.projectMode == 1) {
this.state.projectMode = data.data.projectMode;
this.setState({ moneyType: 2 });
};
if (data.data.subsidy == 1) {
this.state.subsidy = data.data.subsidy;
this.setState({ moneyType: 1 });
};
this.getContactsList();
}.bind(this),
}).always(function () {
this.setState({
loading: false
});
}.bind(this));
},
getStateData(id) {
this.setState({
loading: true
});
$.ajax({
method: "post",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/techproject/techProjectLog",
data: {
pid: id || this.props.data.id
},
success: function (data) {
if (!data.data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
return;
};
var myDate = new Date();
this.state.stateTable = [];
for (let i = 0; i < data.data.length; i++) {
this.state.stateTable.push({
key: i,
state: data.data[i].state,
recordTime: data.data[i].recordTime,
recordTimeFormattedDate: data.data[i].recordTimeFormattedDate,
principal: data.data[i].principal,
operator: data.data[i].operator,
comment: data.data[i].comment
});
};
}.bind(this),
}).always(function () {
this.setState({
loading: false
});
}.bind(this));
},
getContactsList(id) {
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/customer/findAllContacts",
data: { "uid": id || this.props.data.uid },
success: function (data) {
let theOption = [];
if (!data.data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
return;
};
for (let item in data.data) {
let theData = data.data[item];
theOption.push(