import React,{ Component } from 'react';
import {AutoComplete, Button, DatePicker, Input, message, Select, Spin, Table, Tabs} from "antd";
import {
ShowModal,
getNewDiccityArr
} from "@/tools";
import { citySelect } from '../../../NewDicProvinceList';
import {ChooseList} from "../../order/orderNew/chooseList";
import $ from "jquery/src/ajax";
import moment from "moment";
import {
highTechColumns,
invention,
utilityModel,
softWriting,
otherTrademarks,
currency,
} from './projecCountConfig';
const {TabPane} = Tabs;
const { RangePicker } = DatePicker;
const { Option } = Select;
class ProjecCount extends Component{
constructor(props) {
super(props);
this.state={
loading:false,
changeList:[],
columns: currency,
pagination: {
defaultCurrent: 1,
defaultPageSize: 10,
showQuickJumper: true,
pageSize: 10,
onChange: function(page) {
this.loadData(page);
}.bind(this),
showTotal: function(total) {
return "共" + total + "条数据";
}
},
dataSource: [],
releaseDate:[],
searchOrderNo: '',
searchContractNo: '',
searchEnterpriseName: '',
declarationBatch: '',
projectType: '',
projectStatus: '',
province: '',
depId: '',
departmentArr:[],
contactsOption: [],
contactsOptionData: [],
customerArr: [],
commodityName: '',
kid: '',
}
this.loadData = this.loadData.bind(this);
this.resetAll = this.resetAll.bind(this);
this.changeList = this.changeList.bind(this);
this.departmentList = this.departmentList.bind(this);
this.exportPending = this.exportPending.bind(this);
this.selectSuperId = this.selectSuperId.bind(this);
this.supervisorCui = this.supervisorCui.bind(this);
this.httpChangeCui = this.httpChangeCui.bind(this);
this.selectAuto = this.selectAuto.bind(this);
}
changeList(arr) {
const newArr = [];
this.state.columns.forEach(item => {
arr.forEach(val => {
if (val === item.title) {
newArr.push(item);
}
});
});
this.setState({
changeList: newArr
});
}
loadData(pageNo) {
this.state.data = [];
this.setState({
page: pageNo,
loading: true
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/newOrder/orderNewList",
data: {
pageNo: pageNo || 1,
pageSize: this.state.pagination.pageSize,
startDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[0]: undefined, //开始时间
endDate: this.state.releaseDate.length > 0 ? this.state.releaseDate[1]: undefined, //结束时间
projectStatus: this.state.projectStatus || undefined,//项目类别
projectType: typeof this.state.projectType === 'number' ? this.state.projectType : undefined,//项目分类
status: this.state.status,
},
success: function(data) {
ShowModal(this);
let theArr = [];
if (!data.data || !data.data.list) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
}
} else {
for (let i = 0; i < data.data.list.length; i++) {
let thisdata = data.data.list[i];
thisdata.key=i;
theArr.push(thisdata);
}
}
this.state.pagination.current = data.data.pageNo;
this.state.pagination.total = data.data.totalCount;
if (data.data && data.data.list && !data.data.list.length) {
this.state.pagination.current = 0;
this.state.pagination.total = 0;
}
this.setState({
dataSource: theArr,
pagination: this.state.pagination
});
}.bind(this)
}).always(
function() {
this.setState({
loading: false
});
}.bind(this)
);
}
//部门
departmentList() {
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/organization/selectSuperId",
data: {},
success: function (data) {
let thedata = data.data;
let theArr = [];
if (!thedata) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
}
} else {
thedata.map(function (item, index) {
theArr.push({
key: index,
name: item.name,
id: item.id,
});
});
}
this.setState({
departmentArr: theArr,
});
}.bind(this),
})
}
resetAll() {
this.setState({
releaseDate: [],
searchOrderNo: '',
searchContractNo: '',
searchEnterpriseName: '',
declarationBatch: '',
province: '',
depId: '',
projectType: '',
projectStatus: '',
},()=>{
this.loadData();
})
}
exportPending() {
window.open(globalConfig.context + "/api/admin/patent/exportPending")
}
//项目类别
selectSuperId() {
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/ProjectSize/getAllCname",
data: {
flag: 0
},
success: function(data) {
let theArr = [];
let thedata = data.data;
if (!thedata) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
}
}
for (let i = 0; i < data.data.length; i++) {
let theData = data.data[i];
theArr.push(