yee 7 years ago
parent
commit
a92c0cb567

+ 5 - 3
js/component/account/services/copyright/comPatentChange.jsx

@@ -5,7 +5,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import { copyrightStateList } from '../../../dataDic.js';
-import { getCopyrightState, getTime, copyrightDownloadFile, beforeUploadFile, getInUrgentTime } from '../../../tools.js';
+import { getCopyrightState, getTime, copyrightDownloadFile, beforeUploadFile, getVacations, getInUrgentTime } from '../../../tools.js';
 
 const CopyrightDescForm = Form.create()(React.createClass({
     getInitialState() {
@@ -15,6 +15,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
             stateOption: [],
             stateTable: [],
             contactsOption: [],
+            vacations: [],
             stateColumns: [{
                 title: '申请状态',
                 dataIndex: 'status',
@@ -46,6 +47,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
                 <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
             )
         });
+        getVacations((data) => { this.setState({ vacations: data }); });
         this.loadData();
     },
     loadData(id) {
@@ -309,9 +311,9 @@ const CopyrightDescForm = Form.create()(React.createClass({
                             {(() => {
                                 if (theData.expectTime && theData.expectTime[0]) {
                                     if (theData.expectTime[1]) {
-                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), theData.expectTime[1]))
+                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), theData.expectTime[1], this.state.vacations))
                                     } else {
-                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), 45))
+                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), 45, this.state.vacations))
                                     };
                                 };
                             })()}

+ 5 - 3
js/component/account/services/copyright/copyright.jsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader, Switch } from 'antd';
 import { copyrightStateList } from '../../../dataDic.js';
-import { getTime, companySearch, getCopyrightState, getInUrgentTime } from '../../../tools.js';
+import { getTime, companySearch, getCopyrightState, getInUrgentTime, getVacations } from '../../../tools.js';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import PatentAdd from './comPatentAdd.jsx';
@@ -102,6 +102,7 @@ const copyright = React.createClass({
                     return '共' + total + '条数据';
                 }
             },
+            vacations: [],
             columns: [
                 {
                     title: '编号',
@@ -161,9 +162,9 @@ const copyright = React.createClass({
                     render: (text) => {
                         if (text[0]) {
                             if (text[1]) {
-                                return getTime(getInUrgentTime(moment(text[0]), text[1],function(data){ debugger;}))
+                                return getTime(getInUrgentTime(moment(text[0]), text[1], this.state.vacations))
                             } else {
-                                return getTime(getInUrgentTime(moment(text[0]), 45,function(data){ debugger;}))
+                                return getTime(getInUrgentTime(moment(text[0]), 45, this.state.vacations))
                             }
                         };
                         return;
@@ -184,6 +185,7 @@ const copyright = React.createClass({
                 <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
             )
         });
+        getVacations((data) => { this.setState({ vacations: data }); });
         this.loadData();
     },
     tableRowClick(record, index) {

+ 1 - 1
js/component/manageCenter/servicesManage/contract/contract.jsx

@@ -2,7 +2,7 @@ import React from 'react';
 import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader, Switch, Modal } from 'antd';
 import { contractStateList, contractTypeList } from '../../../dataDic.js';
 import { provinceSelect, getProvince } from '../../../NewDicProvinceList';
-import { getTime, companySearch, getContractState, getContractType, getInUrgentTime, getSearchUrl } from '../../../tools.js';
+import { companySearch, getContractState, getContractType, getSearchUrl } from '../../../tools.js';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import ContractAdd from './contractAdd.jsx';

+ 1 - 1
js/component/manageCenter/servicesManage/contract/contractAdd.jsx

@@ -283,7 +283,7 @@ const ContractAddFrom = Form.create()(React.createClass({
                         {...formItemLayout}
                         label={"高企申请"} >
                         {getFieldDecorator('cognizanceYear', {
-                            initialValue: theData.cognizanceYear || undefined
+                            initialValue: theData.cognizanceYear ? String(theData.cognizanceYear) : null
                         })(
                             <Select placeholder="请选择年份"
                                 style={{ width: 120 }}

+ 5 - 3
js/component/manageCenter/servicesManage/copyright/comPatentChange.jsx

@@ -5,7 +5,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import { copyrightStateList } from '../../../dataDic.js';
-import { companySearch, getCopyrightState, getTime, copyrightDownloadFile, beforeUploadFile, getInUrgentTime, getPreview } from '../../../tools.js';
+import { companySearch, getCopyrightState, getTime, copyrightDownloadFile, beforeUploadFile, getInUrgentTime, getVacations, getPreview } from '../../../tools.js';
 
 const CopyrightDescForm = Form.create()(React.createClass({
     getInitialState() {
@@ -15,6 +15,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
             stateOption: [],
             stateTable: [],
             contactsOption: [],
+            vacations:[],
             stateColumns: [{
                 title: '申请状态',
                 dataIndex: 'status',
@@ -41,6 +42,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
     },
     componentWillMount() {
         this.loadData();
+        getVacations((data) => { this.setState({ vacations: data }); });
     },
     loadData(uid, id) {
         this.setState({
@@ -351,9 +353,9 @@ const CopyrightDescForm = Form.create()(React.createClass({
                             {(() => {
                                 if (theData.expectTime && theData.expectTime[0]) {
                                     if (theData.expectTime[1]) {
-                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), theData.expectTime[1]))
+                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), theData.expectTime[1],this.state.vacations))
                                     } else {
-                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), 45))
+                                        return getTime(getInUrgentTime(moment(theData.expectTime[0]), 45,this.state.vacations))
                                     };
                                 };
                             })()}

+ 94 - 91
js/component/manageCenter/servicesManage/copyright/copyright.jsx

@@ -2,7 +2,7 @@ import React from 'react';
 import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader, Switch, Modal } from 'antd';
 import { copyrightStateList } from '../../../dataDic.js';
 import { provinceSelect, getProvince } from '../../../NewDicProvinceList';
-import { getTime, companySearch, getCopyrightState, getInUrgentTime, getSearchUrl } from '../../../tools.js';
+import { getTime, companySearch, getCopyrightState, getInUrgentTime, getVacations, getSearchUrl } from '../../../tools.js';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import PatentAdd from './comPatentAdd.jsx';
@@ -10,6 +10,7 @@ import PatentChange from './comPatentChange.jsx';
 
 import moment from 'moment';
 import './copyright.less';
+const vacations = getVacations();
 
 const copyright = React.createClass({
     loadData(pageNo) {
@@ -234,95 +235,7 @@ const copyright = React.createClass({
                     return '共' + total + '条数据';
                 }
             },
-            columns: [
-                {
-                    title: '编号',
-                    dataIndex: 'serialNumber',
-                    key: 'serialNumber',
-                }, {
-                    title: '省份',
-                    dataIndex: 'province',
-                    key: 'province',
-                    render: text => { return getProvince(text); }
-                }, {
-                    title: '合同编号',
-                    dataIndex: 'contractNumber',
-                    key: 'contractNumber',
-                }, {
-                    title: '公司名称',
-                    dataIndex: 'unitName',
-                    key: 'unitName',
-                }, {
-                    title: '认证状态',
-                    dataIndex: 'status',
-                    key: 'status',
-                    render: (text) => { return getCopyrightState(text) }
-                }, {
-                    title: '软著名称',
-                    dataIndex: 'copyrightName',
-                    key: 'copyrightName',
-                }, {
-                    title: '加急天数',
-                    dataIndex: 'inUrgent',
-                    key: 'inUrgent',
-                    render: (text) => {
-                        switch (text) {
-                            case 0:
-                                return '不加急(45个工作日)';
-                            case 3:
-                                return '3个工作日';
-                            case 5:
-                                return '5个工作日';
-                            case 10:
-                                return '6-10个工作日';
-                            case 15:
-                                return '11-15个工作日';
-                            case 20:
-                                return '16-20个工作日';
-                            case 25:
-                                return '21-25个工作日';
-                            case 30:
-                                return '26-30个工作日';
-                            case 35:
-                                return '31-35个工作日';
-                        }
-                    }
-                }, {
-                    title: '负责人',
-                    dataIndex: 'principal',
-                    key: 'principal',
-                }, {
-                    title: '派单日',
-                    dataIndex: 'createTimeFormattedDate',
-                    key: 'createTimeFormattedDate',
-                }, {
-                    title: '受理日',
-                    dataIndex: 'acceptTimeFormattedDate',
-                    key: 'acceptTimeFormattedDate',
-                }, {
-                    title: '(预计)下证时间',
-                    dataIndex: 'expectTime',
-                    key: 'expectTime',
-                    render: (text) => {
-                        if (text[0]) {
-                            if (text[1]) {
-                                return getTime(getInUrgentTime(moment(text[0]), text[1]))
-                            } else {
-                                return getTime(getInUrgentTime(moment(text[0]), 45))
-                            }
-                        };
-                        return;
-                    }
-                }, {
-                    title: '创建人',
-                    dataIndex: 'founder',
-                    key: 'founder'
-                }, {
-                    title: '技术员',
-                    dataIndex: 'techPrincipal',
-                    key: 'techPrincipal',
-                }
-            ],
+            vacations: [],
             dataSource: []
         };
     },
@@ -371,6 +284,7 @@ const copyright = React.createClass({
         this.getCompanyList();
         this.getStateList();
         this.getContractList();
+        getVacations((data) => { this.setState({ vacations: data }); });
         if (window.location.search) {
             let theObj = getSearchUrl(window.location.search);
             if (theObj.rid) {
@@ -512,6 +426,95 @@ const copyright = React.createClass({
         this.setState({ visible: false });
     },
     render() {
+        const columns = [
+            {
+                title: '编号',
+                dataIndex: 'serialNumber',
+                key: 'serialNumber',
+            }, {
+                title: '省份',
+                dataIndex: 'province',
+                key: 'province',
+                render: text => { return getProvince(text); }
+            }, {
+                title: '合同编号',
+                dataIndex: 'contractNumber',
+                key: 'contractNumber',
+            }, {
+                title: '公司名称',
+                dataIndex: 'unitName',
+                key: 'unitName',
+            }, {
+                title: '认证状态',
+                dataIndex: 'status',
+                key: 'status',
+                render: (text) => { return getCopyrightState(text) }
+            }, {
+                title: '软著名称',
+                dataIndex: 'copyrightName',
+                key: 'copyrightName',
+            }, {
+                title: '加急天数',
+                dataIndex: 'inUrgent',
+                key: 'inUrgent',
+                render: (text) => {
+                    switch (text) {
+                        case 0:
+                            return '不加急(45个工作日)';
+                        case 3:
+                            return '3个工作日';
+                        case 5:
+                            return '5个工作日';
+                        case 10:
+                            return '6-10个工作日';
+                        case 15:
+                            return '11-15个工作日';
+                        case 20:
+                            return '16-20个工作日';
+                        case 25:
+                            return '21-25个工作日';
+                        case 30:
+                            return '26-30个工作日';
+                        case 35:
+                            return '31-35个工作日';
+                    }
+                }
+            }, {
+                title: '负责人',
+                dataIndex: 'principal',
+                key: 'principal',
+            }, {
+                title: '派单日',
+                dataIndex: 'createTimeFormattedDate',
+                key: 'createTimeFormattedDate',
+            }, {
+                title: '受理日',
+                dataIndex: 'acceptTimeFormattedDate',
+                key: 'acceptTimeFormattedDate',
+            }, {
+                title: '(预计)下证时间',
+                dataIndex: 'expectTime',
+                key: 'expectTime',
+                render: (text) => {
+                    if (text[0]) {
+                        if (text[1]) {
+                            return getTime(getInUrgentTime(moment(text[0]), text[1], this.state.vacations))
+                        } else {
+                            return getTime(getInUrgentTime(moment(text[0]), 45, this.state.vacations))
+                        }
+                    };
+                    return;
+                }
+            }, {
+                title: '创建人',
+                dataIndex: 'founder',
+                key: 'founder'
+            }, {
+                title: '技术员',
+                dataIndex: 'techPrincipal',
+                key: 'techPrincipal',
+            }
+        ];
         const rowSelection = {
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {
@@ -586,7 +589,7 @@ const copyright = React.createClass({
                     </div>
                     <div className="foster-table">
                         <Spin spinning={this.state.loading}>
-                            <Table columns={this.state.columns}
+                            <Table columns={columns}
                                 rowSelection={rowSelection}
                                 dataSource={this.state.dataSource}
                                 pagination={this.state.pagination}

+ 1 - 8
js/component/portal/search/achievement.jsx

@@ -1,10 +1,9 @@
 import React from 'react';
-import { Rate, Icon, message, Row, Col, Radio, Checkbox, Input, InputNumber, Button, Pagination, Spin, Carousel } from 'antd';
+import { Rate, Icon, message, Row, Col, Radio, Checkbox, Input, InputNumber, Button, Pagination, Spin } from 'antd';
 import '../portal.less';
 
 import logoImg from '../../../../image/logo.png';
 import searchImg from '../../../../image/search.png';
-import slideImg from '../../../../image/slide_img_1.png';
 
 
 import demand_ico_5 from '../../../../image/demand_ico_5.png';
@@ -234,12 +233,6 @@ const Content = React.createClass({
                         </Button>
                     </div>
                 </div>
-                <Carousel autoplay className="portal-carousel">
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                </Carousel>
                 <div className="portal-content">
                     <Row className="search-criteria">
                         <Col className="search-title" span={2}>

+ 1 - 8
js/component/portal/search/demand.jsx

@@ -1,10 +1,9 @@
 import React from 'react';
-import { Carousel, Pagination, Icon, message, Row, Col, Radio, Checkbox, Input, InputNumber, Button, Table, Spin } from 'antd';
+import { Pagination, Icon, message, Row, Col, Radio, Checkbox, Input, InputNumber, Button, Table, Spin } from 'antd';
 import '../portal.less';
 
 import logoImg from '../../../../image/logo.png';
 import searchImg from '../../../../image/search.png';
-import slideImg from '../../../../image/slide_img_1.png';
 
 import demand_sup from '../../../../image/demand_sup.png';
 import demand_ico_5 from '../../../../image/demand_ico_5.png';
@@ -214,12 +213,6 @@ const Content = React.createClass({
                         </Button>
                     </div>
                 </div>
-                <Carousel autoplay className="portal-carousel">
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                </Carousel>
                 <div className="portal-content">
                     <Row className="search-criteria">
                         <Col className="search-title" span={2}>

+ 1 - 8
js/component/portal/search/subscriber.jsx

@@ -1,10 +1,9 @@
 import React from 'react';
-import { Carousel, Icon, message, Row, Col, Select, Radio, Checkbox, Input, InputNumber, Button, Table, Spin, Pagination } from 'antd';
+import { Icon, message, Row, Col, Select, Radio, Checkbox, Input, InputNumber, Button, Table, Spin, Pagination } from 'antd';
 import '../portal.less';
 
 import logoImg from '../../../../image/logo.png';
 import searchImg from '../../../../image/search.png';
-import slideImg from '../../../../image/slide_img_1.png';
 
 import { techFieldList, getTechField } from '../../DicTechFieldList';
 import { provinceList, getProvince } from '../../NewDicProvinceList';
@@ -219,12 +218,6 @@ const SubContent = React.createClass({
                         </Button>
                     </div>
                 </div>
-                <Carousel autoplay className="portal-carousel">
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                    <div className="slide-box"><img src={slideImg} alt="" /></div>
-                </Carousel>
                 <div className="portal-content clearfix" >
                     <Row className="search-criteria">
                         <Col className="search-title" span={2}>

+ 15 - 12
js/component/tools.js

@@ -293,31 +293,34 @@ module.exports = {
     companySearch(input, option) {
         return option.props.children.indexOf(input) >= 0
     },
-    getInUrgentTime(date, inUrgent,callback) {
-        let now = new Date(date);
+    getVacations(callback){
+        let now = new Date();
         let theYear = now.getFullYear();
         $.ajax({
-            type: "POST",
+            type: "get",
             dataType: "json",
             crossDomain: false,
             url: globalConfig.context + '/open/html/json/vacations' + theYear,
-            success: (result)=>{
+            success: (data)=>{
                 if (!data.data) {
                     if ( data.error && data.error.length ) {
                         message.warning(data.error[0].message);
                     };
                 } else {
-                    for (var i = 1; i <= inUrgent;) {
-                        now.setDate(now.getDate() + 1);
-                        if (!vocations[getKey(now)]) {
-                            i++;
-                        };
-                    };
-                    callback(now);
+                    callback(data.data);
                 };
             }
         });
-
+    },
+    getInUrgentTime(date, inUrgent,vocations) {
+        let now = new Date(date);
+        for (var i = 1; i <= inUrgent;) {
+            now.setDate(now.getDate() + 1);
+            if (!vocations[getKey(now)]) {
+                i++;
+            };
+        };
+        return now;
         function getKey(date) {
             var year = date.getFullYear(),
                 month = date.getMonth() + 1,