123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- import React,{ Component } from 'react';
- import {Button, DatePicker, Input, message, Select, Spin, Table, Tabs} from "antd";
- import {
- ShowModal
- } from "@/tools";
- import {ChooseList} from "../../order/orderNew/chooseList";
- import $ from "jquery/src/ajax";
- import moment from "moment";
- import {
- highTechColumns,
- invention,
- utilityModel,
- softWriting,
- otherTrademarks,
- } from './projecCountConfig';
- import {cityArr} from '@/dataDic.js';
- const {TabPane} = Tabs;
- const { RangePicker } = DatePicker;
- const { Option } = Select;
- class ProjecCount extends Component{
- constructor(props) {
- super(props);
- this.state={
- loading:false,
- changeList:[],
- columns: highTechColumns,
- 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: 0,
- province: '',
- depId: '',
- departmentArr:[],
- }
- 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);
- }
- 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,
- starTime: this.state.releaseDate[0], //开始时间
- endTime: this.state.releaseDate[1], //结束时间
- },
- 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: '',
- },()=>{
- this.loadData();
- })
- }
- exportPending() {
- window.open(globalConfig.context + "/api/admin/patent/exportPending")
- }
- componentWillMount() {
- this.loadData();
- this.departmentList();
- }
- render() {
- return (
- <div className="user-content">
- <div className="content-title">
- <span>项目统计</span>
- </div>
- <Tabs defaultActiveKey="1" className="test">
- <TabPane tab="搜索" key="1">
- <div className="user-search" style={{
- marginTop:'10px',
- marginLeft:'10px',
- marginRight:'10px'
- }}>
- <Input
- placeholder="订单编号"
- style={{ width: "150px",marginRight:'10px',marginBottom:'10px' }}
- value={this.state.searchOrderNo}
- onChange={e => {
- this.setState({ searchOrderNo: e.target.value });
- }}
- />
- <Input
- placeholder="合同编号"
- style={{ width: "150px",marginRight:'10px',marginBottom:'10px' }}
- value={this.state.searchContractNo}
- onChange={e => {
- this.setState({ searchContractNo: e.target.value });
- }}
- />
- <Input
- placeholder="企业名称"
- style={{ width: "150px",marginRight:'10px',marginBottom:'10px' }}
- value={this.state.searchEnterpriseName}
- onChange={e => {
- this.setState({ searchEnterpriseName: e.target.value });
- }}
- />
- <span style={{display:"inline-block"}}>
- <span style={{marginRight:'10px',marginBottom:'10px'}}>时报批次 :</span>
- <Select
- value={this.state.declarationBatch}
- placeholder="请选择批次"
- style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}
- onChange={(e) => {
- this.setState({
- declarationBatch: e,
- });
- }}
- >
- <Option value={1}>第一批</Option>
- <Option value={2}>第二批</Option>
- <Option value={3}>第三批</Option>
- <Option value={4}>第四批</Option>
- </Select>
- </span>
- <span style={{display: "inline-block",marginRight:'10px',marginBottom:'10px'}}>
- <span>派单省份:</span>
- <Select
- placeholder="请选择省份"
- style={{ width: 200,marginRight:'10px',marginLeft:'10px',marginBottom:'10px' }}
- value={this.state.province}
- onChange={e => {
- this.setState({ province: e });
- }}
- >
- {cityArr.map(function(item) {
- return (
- <Select.Option key={item.value}>{item.key}</Select.Option>
- );
- })}
- </Select>
- </span>
- <span style={{display: "inline-block",marginRight:'10px',marginBottom:'10px'}}>
- <span>负责部门:</span>
- <Select
- placeholder="请选择部门"
- style={{ width: 200,marginRight:'10px',marginLeft:'10px',marginBottom:'10px' }}
- value={this.state.depId}
- onChange={e => {
- this.setState({ depId: e });
- }}
- >
- {
- this.state.departmentArr.map(function (item) {
- return <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
- })
- }
- </Select>
- </span>
- <span style={{display:"inline-block"}}>
- <span style={{marginRight:'10px',marginBottom:'10px'}}>项目类别 :</span>
- <Select
- value={this.state.projectType}
- placeholder="请选择项目类别"
- style={{ width: 200,marginRight:'10px',marginBottom:'10px' }}
- onChange={(e) => {
- this.setState({
- columns:
- e === 0 ? highTechColumns :
- e === 1 ? invention :
- e === 2 ? utilityModel :
- e === 3 ? softWriting:
- e === 4 ? otherTrademarks : [],
- changeList: [],
- },()=>{
- this.resetAll();
- })
- this.setState({
- projectType: e,
- });
- }}
- >
- <Option value={0}>高新</Option>
- <Option value={1}>发明专利</Option>
- <Option value={2}>实用新型</Option>
- <Option value={3}>软件著作权</Option>
- <Option value={4}>其他商标</Option>
- </Select>
- </span>
- <span style={{display:"inline-block"}}>
- <span style={{marginRight:'10px',marginBottom:'10px'}}>派单时间 :</span>
- <RangePicker
- style={{marginRight:'10px',marginBottom:'10px'}}
- value={[
- this.state.releaseDate[0]
- ? moment(this.state.releaseDate[0])
- : null,
- this.state.releaseDate[1]
- ? moment(this.state.releaseDate[1])
- : null,
- ]}
- onChange={(data, dataString) => {
- this.setState({ releaseDate: dataString });
- }}
- />
- </span>
- <Button type="primary" onClick={this.loadData} style={{marginRight:'10px',marginBottom:'10px'}}>搜索</Button>
- <Button onClick={this.resetAll} style={{marginRight:'10px',marginBottom:'10px'}}>重置</Button>
- </div>
- </TabPane>
- <TabPane tab="更改表格显示数据" key="2">
- <div style={{ marginLeft: 10 }}>
- <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- margin={11}
- />
- </div>
- </TabPane>
- <TabPane tab="导出EXCEL" key="3">
- <Button type="primary" style={{margin: '10px'}} onClick={this.exportPending}>导出</Button>
- </TabPane>
- </Tabs>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- bordered
- size="middle"
- scroll={{ x: 2000, y: 0 }}
- columns={
- this.state.changeList.length > 0
- ? this.state.changeList
- : this.state.columns
- }
- dataSource={this.state.dataSource}
- pagination={this.state.pagination}
- />
- </Spin>
- </div>
- </div>
- )
- }
- }
- export default ProjecCount;
|