Browse Source

update 批量导入完成

yee 7 years ago
parent
commit
94de18c361

+ 6 - 6
js/component/DicIndustryList.js

@@ -765,22 +765,22 @@ const IndustryList = [{
     value: 589,
     label: "钒钛产业",
     children: [{
-        value: "590",
+        value: 590,
         label: "钒钛资源"
     }, {
-        value: "591",
+        value: 591,
         label: "钒钛冶金"
     }, {
-        value: "592",
+        value: 592,
         label: "钒钛化工"
     }, {
-        value: "593",
+        value: 593,
         label: "钒钛钢"
     }, {
-        value: "594",
+        value: 594,
         label: "钒钛新材料"
     }, {
-        value: "595",
+        value: 595,
         label: "其他"
     }]
 }]

+ 140 - 21
js/component/account/achievement/techAchievementDesc.jsx

@@ -1,11 +1,11 @@
 import React from 'react';
-import { Icon, Tooltip, Modal, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
+import { Icon, Tabs, Table, Tooltip, Modal, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
 import moment from 'moment';
 import './techAchievement.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory } from '../../tools.js';
+import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory, getDemandType } from '../../tools.js';
 
 const KeyWordTagGroup = React.createClass({
     getInitialState() {
@@ -151,7 +151,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + (window.userData.type == "1" ? "/api/user/achievement/orgDetail" : "/api/user/achievement/userDetail"),            
+            url: globalConfig.context + (window.userData.type == "1" ? "/api/user/achievement/orgDetail" : "/api/user/achievement/userDetail"),
             data: {
                 id: id
             },
@@ -1199,7 +1199,105 @@ const AchievementDetailForm = Form.create()(React.createClass({
 const AchievementDetail = React.createClass({
     getInitialState() {
         return {
-            visible: false
+            visible: false,
+            tabsKey: 1,
+            columns: [
+                {
+                    title: '编号',
+                    dataIndex: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '数据类型',
+                    dataIndex: 'dataCategory',
+                    key: 'dataCategory',
+                    render: text => {
+                        switch (text) {
+                            case "0":
+                                return <span>成果</span>;
+                            case "1":
+                                return <span>技术</span>;
+                            case "2":
+                                return <span>项目</span>;
+                        }
+                    }
+                }, {
+                    title: '名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                }, {
+                    title: '关键字',
+                    dataIndex: 'keyword',
+                    key: 'keyword',
+                }, {
+                    title: '类型',
+                    dataIndex: 'demandType',
+                    key: 'demandType',
+                    render: text => { return getDemandType(text); }
+                }, {
+                    title: '所有人名称',
+                    dataIndex: 'theName',
+                    key: 'theName',
+                }, {
+                    title: '发布时间',
+                    dataIndex: 'releaseDateFormattedDate',
+                    key: 'releaseDateFormattedDate',
+                }, {
+                    title: '有效期限',
+                    dataIndex: 'validityPeriodFormattedDate',
+                    key: 'validityPeriodFormattedDate',
+                },
+            ],
+            dataSource: [],
+        };
+    },
+    getTableList() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/achievement/achievementDemand",
+            data: { id: this.props.data.id },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else if (data.data.length) {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let thisdata = data.data[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            dataCategory: thisdata.dataCategory,
+                            name: thisdata.name,
+                            keyword: thisdata.keyword,
+                            demandType: thisdata.demandType,
+                            theName: thisdata.username || thisdata.unitName,
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
+                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
+                        });
+                    };
+                };
+                this.setState({
+                    dataSource: theArr,
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    tableRowClick(record, index) {
+        if (record.ownerType == "0") {
+            window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandOrg');
+        } else if (record.ownerType == "1") {
+            window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandUser')
         };
     },
     showModal() {
@@ -1220,33 +1318,54 @@ const AchievementDetail = React.createClass({
         this.props.closeDesc(false, true);
     },
     componentWillReceiveProps(nextProps) {
+        if (nextProps.showDesc) {
+            this.state.tabsKey = "1";
+            this.state.tabBool = true;
+        };
         this.state.visible = nextProps.showDesc;
     },
     render() {
         if (this.props.data) {
             return (
                 <div className="patent-desc">
-                    <Modal maskClosable={false} title="成果详情" visible={this.state.visible}
+                    <Modal maskClosable={false} visible={this.state.visible}
                         onOk={this.checkPatentProcess} onCancel={this.handleCancel}
                         width='1000px'
                         footer=''
                         className="admin-desc-content">
-                        {(() => {
-                            if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
-                                return <AchievementDetailShow
-                                    data={this.props.data}
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    handleOk={this.handleOk} />
-                            } else {
-                                return <AchievementDetailForm
-                                    data={this.props.data}
-                                    achievementCategoryOption={this.props.achievementCategoryOption}
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    handleOk={this.handleOk} />
-                            }
-                        })()}
+                        <Tabs activeKey={this.state.tabsKey}
+                            onChange={(e) => {
+                                this.setState({ tabsKey: e });
+                                if (e == "2" && this.state.tabBool) {
+                                    this.getTableList();
+                                    this.state.tabBool = false;
+                                };
+                            }} >
+                            <Tabs.TabPane tab="成果详情" key="1">
+                                {(() => {
+                                    if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
+                                        return <AchievementDetailShow
+                                            data={this.props.data}
+                                            closeDesc={this.handleCancel}
+                                            visible={this.state.visible}
+                                            handleOk={this.handleOk} />
+                                    } else {
+                                        return <AchievementDetailForm
+                                            data={this.props.data}
+                                            achievementCategoryOption={this.props.achievementCategoryOption}
+                                            closeDesc={this.handleCancel}
+                                            visible={this.state.visible}
+                                            handleOk={this.handleOk} />
+                                    }
+                                })()}
+                            </Tabs.TabPane>
+                            <Tabs.TabPane tab="匹配列表" key="2">
+                                <Table columns={this.state.columns}
+                                    dataSource={this.state.dataSource}
+                                    pagination={false}
+                                    onRowClick={this.tableRowClick} />
+                            </Tabs.TabPane>
+                        </Tabs>
                     </Modal>
                 </div>
             );

+ 154 - 39
js/component/account/demand/techDemandDesc.jsx

@@ -1,11 +1,11 @@
 import React from 'react';
-import { Icon, Tooltip, Modal, Popover, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
+import { Icon, Tabs, Table, Tooltip, Modal, Popover, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
 import moment from 'moment';
 import './techDemand.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getTechField, getDemandType } from '../../tools.js';
+import { beforeUploadFile, splitUrl, companySearch, getTechField, getDemandType, getAchievementCategory } from '../../tools.js';
 
 const KeyWordTagGroup = React.createClass({
     getInitialState() {
@@ -324,6 +324,10 @@ const DemandDetailShow = Form.create()(React.createClass({
                                         return <span>平台采集</span>;
                                     case "1":
                                         return <span>客户发布</span>;
+                                    case "2":
+                                        return <span>批量导入</span>;
+                                    case "3":
+                                        return <span>三方对接</span>;
                                 }
                             })()}
                         </FormItem>
@@ -535,7 +539,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         name: values.name,
                         keyword: this.state.tags ? this.state.tags.join(",") : [],
                         keywords: this.state.tags,
-                        infoSources: values.infoSources,
+                        infoSources: 1,
                         industryCategoryA: values.industryCategory ? values.industryCategory[0] : undefined,
                         industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
                         demandType: values.demandType,
@@ -699,21 +703,6 @@ const DemandDetailForm = Form.create()(React.createClass({
                             })()}
                         </FormItem>
                     </div>
-                    <div className="clearfix">
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="信息来源" >
-                            {getFieldDecorator('infoSources', {
-                                rules: [{ required: true, message: '此项为必填项!' }],
-                                initialValue: theData.infoSources
-                            })(
-                                <Radio.Group>
-                                    <Radio value="0">平台采集</Radio>
-                                    <Radio value="1">客户发布</Radio>
-                                </Radio.Group>
-                                )}
-                        </FormItem>
-                    </div>
                     <FormItem
                         labelCol={{ span: 3 }}
                         wrapperCol={{ span: 20 }}
@@ -925,7 +914,61 @@ const DemandDetail = React.createClass({
     getInitialState() {
         return {
             visible: false,
-            contactsObj: {}
+            contactsObj: {},
+            tabsKey: "1",
+            columns: [
+                {
+                    title: '编号',
+                    dataIndex: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '数据类型',
+                    dataIndex: 'dataCategory',
+                    key: 'dataCategory',
+                    render: text => {
+                        switch (text) {
+                            case "0":
+                                return <span>个人需求</span>;
+                            case "1":
+                                return <span>团体需求</span>;
+                        }
+                    }
+                }, {
+                    title: '名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                }, {
+                    title: '关键字',
+                    dataIndex: 'keyword',
+                    key: 'keyword',
+                }, {
+                    title: '类型',
+                    dataIndex: 'category',
+                    key: 'category',
+                    render: text => { return getAchievementCategory(text); }
+                }, {
+                    title: '所有人名称',
+                    dataIndex: 'theName',
+                    key: 'theName',
+                }, {
+                    title: '所有人类型',
+                    dataIndex: 'ownerType',
+                    key: 'ownerType',
+                    render: text => {
+                        switch (text) {
+                            case "0":
+                                return <span>个人</span>;
+                            case "1":
+                                return <span>组织</span>
+                        }
+                    }
+                }, {
+                    title: '发布时间',
+                    dataIndex: 'releaseDateFormattedDate',
+                    key: 'releaseDateFormattedDate',
+                }
+            ],
+            dataSource: [],
         };
     },
     getContactsList() {
@@ -955,6 +998,57 @@ const DemandDetail = React.createClass({
             }.bind(this),
         });
     },
+    getTableList() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/achievementDemand",
+            data: { id: this.props.data.id },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else if (data.data.length) {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let thisdata = data.data[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            dataCategory: thisdata.dataCategory,
+                            name: thisdata.name,
+                            keyword: thisdata.keyword,
+                            category: thisdata.category,
+                            ownerType: thisdata.ownerType,
+                            theName: thisdata.username || thisdata.unitName,
+                            releaseDate: thisdata.releaseDate,
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate
+                        });
+                    };
+                };
+                this.setState({
+                    dataSource: theArr,
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    tableRowClick(record, index) {
+        if (record.ownerType == "0") {
+            window.open(globalConfig.context + '/admin/achievement.html?rid=' + record.id + '#orgTechAchievement');
+        } else if (record.ownerType == "1") {
+            window.open(globalConfig.context + '/admin/achievement.html?rid=' + record.id + '#userTechAchievement')
+        };
+    },
     showModal() {
         this.setState({
             visible: true,
@@ -976,36 +1070,57 @@ const DemandDetail = React.createClass({
         this.getContactsList();
     },
     componentWillReceiveProps(nextProps) {
+        if (nextProps.showDesc) {
+            this.state.tabsKey = "1";
+            this.state.tabBool = true;
+        };
         this.state.visible = nextProps.showDesc;
     },
     render() {
         if (this.props.data) {
             return (
                 <div className="patent-desc">
-                    <Modal maskClosable={false} title="用户需求详情" visible={this.state.visible}
+                    <Modal maskClosable={false} visible={this.state.visible}
                         onOk={this.checkPatentProcess} onCancel={this.handleCancel}
                         width='1000px'
                         footer=''
                         className="admin-desc-content">
-                        {(() => {
-                            if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
-                                return <DemandDetailShow
-                                    data={this.props.data}
-                                    demandTypeOption={this.props.demandTypeOption}
-                                    contactsObj={this.state.contactsObj}
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    handleOk={this.handleOk} />
-                            } else {
-                                return <DemandDetailForm
-                                    data={this.props.data}
-                                    contactsOption={this.state.contactsOption}
-                                    demandTypeOption={this.props.demandTypeOption}
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    handleOk={this.handleOk} />
-                            }
-                        })()}
+                        <Tabs activeKey={this.state.tabsKey}
+                            onChange={(e) => {
+                                this.setState({ tabsKey: e });
+                                if (e == "2" && this.state.tabBool) {
+                                    this.getTableList();
+                                    this.state.tabBool = false;
+                                };
+                            }} >
+                            <Tabs.TabPane tab="需求详情" key="1">
+                                {(() => {
+                                    if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
+                                        return <DemandDetailShow
+                                            data={this.props.data}
+                                            demandTypeOption={this.props.demandTypeOption}
+                                            contactsObj={this.state.contactsObj}
+                                            closeDesc={this.handleCancel}
+                                            visible={this.state.visible}
+                                            handleOk={this.handleOk} />
+                                    } else {
+                                        return <DemandDetailForm
+                                            data={this.props.data}
+                                            contactsOption={this.state.contactsOption}
+                                            demandTypeOption={this.props.demandTypeOption}
+                                            closeDesc={this.handleCancel}
+                                            visible={this.state.visible}
+                                            handleOk={this.handleOk} />
+                                    }
+                                })()}
+                            </Tabs.TabPane>
+                            <Tabs.TabPane tab="匹配列表" key="2">
+                                <Table columns={this.state.columns}
+                                    dataSource={this.state.dataSource}
+                                    pagination={false}
+                                    onRowClick={this.tableRowClick} />
+                            </Tabs.TabPane>
+                        </Tabs>
                     </Modal>
                 </div>
             );

+ 14 - 14
js/component/login/loginContent.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Icon, Tabs,Spin } from 'antd';
+import { Icon, Tabs, Spin } from 'antd';
 import LoginForm from './loginForm.jsx';
 
 import loginqq from '../../../image/login_qq.png';
@@ -13,7 +13,7 @@ const LoginContent = React.createClass({
     getInitialState() {
         return {
             theKey: "0",
-            loading:false
+            loading: false
         };
     },
     tabChange(key) {
@@ -26,25 +26,25 @@ const LoginContent = React.createClass({
             loading: e
         });
     },
-    componentWillMount(){
-        if ( window.location.search === "?1" ) {
+    componentWillMount() {
+        if (window.location.search === "?1") {
             this.state.theKey = '1'
         }
     },
     render() {
         return (
-            <Spin spinning={this.state.loading} className='spin-box'>
-                <div className="content clearfix">
-                    <div className="login-left">
-                        <img src="" alt="" />
-                    </div>
-                    <div className="login-right">
+            <div className="content clearfix">
+                <div className="login-left">
+                    <img src="" alt="" />
+                </div>
+                <div className="login-right">
+                    <Spin spinning={this.state.loading} className='spin-box'>
                         <Tabs defaultActiveKey={this.state.theKey} onChange={this.tabChange} className="login-from">
                             <TabPane tab="个人登录" key="0">
-                                <LoginForm loginProp={this.state.theKey} spinState={this.spinChange}/>
+                                <LoginForm loginProp={this.state.theKey} spinState={this.spinChange} />
                             </TabPane>
                             <TabPane tab="公司登录" key="1" className="tabtwo">
-                                <LoginForm loginProp={this.state.theKey} spinState={this.spinChange}/>
+                                <LoginForm loginProp={this.state.theKey} spinState={this.spinChange} />
                             </TabPane>
                         </Tabs>
                         <div className="login-other clearfix">
@@ -55,9 +55,9 @@ const LoginContent = React.createClass({
                                 <li className="join"><img src={loginmore} alt="" /><p><a href="./signIn.html">立即注册</a></p></li>
                             </ul>
                         </div>
-                    </div>
+                    </Spin>
                 </div>
-            </Spin>
+            </div>
         )
     }
 });

+ 164 - 0
js/component/manageCenter/achievement/batchImport.jsx

@@ -0,0 +1,164 @@
+import React from 'react';
+import { Input, Modal, Button, message } from 'antd';
+import { achievementCategoryList } from '../../dataDic.js';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+
+const BatchImport = React.createClass({
+    getInitialState: function () {
+        return {
+            loading: false,
+            error: false
+        };
+    },
+    showModal() {
+        this.setState({
+            visible: true,
+        });
+    },
+    handleOk(e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    handleCancel(e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    //数据反向转化
+    getDataCategory(e, row) {
+        switch (e) {
+            case "成果":
+                return 0;
+            case "技术":
+                return 1;
+            case "项目":
+                return 2;
+            default:
+                message.warning("第 " + row + " 行中没有对应的数据类型!");
+                this.state.error = true;
+                break;
+        }
+    },
+    getOwnerType(e, row) {
+        switch (e) {
+            case "个人":
+                return 0;
+            case "组织":
+                return 1;
+            default:
+                message.warning("第 " + row + " 行中没有对应的所有人类型!");
+                this.state.error = true;
+                break;
+        }
+    },
+    getCategory(e, row) {
+        let theType = null, _me = this;
+        if (e) {
+            achievementCategoryList.map(function (item) {
+                if (item.key == e) {
+                    theType = Number(item.value);
+                };
+            });
+            if (theType == null) {
+                message.warning("第 " + row + " 行中没有对应的成果类型!");
+                _me.state.error = true;
+            }
+            return theType;
+        };
+    },
+    getCooperationMode(e, row) {
+        switch (e) {
+            case "技术转让":
+                return 0;
+            case "授权生产":
+                return 1;
+            default:
+                message.warning("第 " + row + " 行中没有对应的合作方式!");
+                this.state.error = true;
+                break;
+        }
+    },
+    //提交
+    handleSubmit() {
+        let rowsArr = this.state.inputValue.split(/[\r\n]/g);
+        let columnArr = [], _me = this;
+        if (!rowsArr.length) {
+            return;
+        };
+        let columnLength = 11;//定义数据正常长度
+        for (let i = 0; i < rowsArr.length; i++) {
+            if (_me.state.error) {
+                this.state.error = false;
+                return;
+            };
+            let theArr = rowsArr[i].split(/\t+/);
+            if (theArr.length == columnLength) {
+                columnArr.push({
+                    dataCategory: _me.getDataCategory(theArr[0], i + 1),
+                    name: theArr[1],
+                    keyword: theArr[2],
+                    category: _me.getCategory(theArr[3], i + 1),
+                    ownerName: theArr[4],
+                    ownerType: _me.getOwnerType(theArr[5], i + 1),
+                    ownerIdNumber: theArr[6],
+                    ownerMobile: theArr[7],
+                    ownerEmail: theArr[8],
+                    ownerPostalAddress: theArr[9],
+                    cooperationMode: _me.getCooperationMode(theArr[10], i + 1)
+                });
+            } else if (rowsArr[i].replace(/(^\s+)|(\s+$)/g, "").length) {
+                message.warning("第" + (i + 1) + "行数据长度错误!");
+                return;
+            };
+        };
+        if (columnArr.length > 1000) {
+            message.warning("数据条数不能多于1000条!");
+            return;
+        };
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/achievement/importAchievement',
+            data: {
+                data: JSON.stringify(columnArr)
+            }
+        }).done(function (data) {
+            this.setState({
+                loading: false
+            });
+            if (!data.error.length) {
+                message.success('导入成功!');
+                this.props.closeDesc(false, true);
+                this.handleOk();
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
+    render() {
+        return (
+            <div>
+                <Button type="primary" onClick={this.showModal}>批量导入</Button>
+                <Modal
+                    title="批量导入"
+                    visible={this.state.visible}
+                    onCancel={this.handleCancel}
+                    width='1000px'
+                    footer={[
+                        <Button key="ok" className="set-submit" type="primary" loading={this.state.loading} onClick={this.handleSubmit}>保存</Button>,
+                        <Button key="clancel" className="set-submit" type="ghost" onClick={this.handleCancel}>取消</Button>
+                    ]} >
+                    <Input type="textarea" rows={12} onChange={(e) => { this.state.inputValue = e.target.value; }} />
+                </Modal>
+            </div>
+        );
+    }
+});
+
+export default BatchImport;

+ 2 - 2
js/component/manageCenter/achievement/content.jsx

@@ -27,7 +27,7 @@ class Content extends Component {
                     this.setState({
                         component: TechAchievement,
                         listApiUrl: '/api/admin/achievement/orgList',
-                        detailApiUrl: '/api/admin/achievement/orgDemandDetail'
+                        detailApiUrl: '/api/admin/achievement/orgDetail'
                     });
                 });
                 break;
@@ -37,7 +37,7 @@ class Content extends Component {
                     this.setState({
                         component: TechAchievement,
                         listApiUrl: '/api/admin/achievement/userList',
-                        detailApiUrl: '/api/admin/achievement/userDemandDetail'
+                        detailApiUrl: '/api/admin/achievement/userDetail'
                     });
                 });
                 break;

+ 3 - 1
js/component/manageCenter/achievement/techAchievement.jsx

@@ -7,6 +7,7 @@ import './techAchievement.less';
 import TechAchievementDesc from './techAchievementDesc.jsx';
 import { provinceArr, achievementCategoryList, techAuditStatusList } from '../../dataDic.js';
 import { beforeUploadFile, companySearch, getAchievementCategory, getSearchUrl, getTechAuditStatus } from '../../tools.js';
+import BatchImport from './batchImport';
 
 const AchievementList = React.createClass({
     loadData(pageNo, apiUrl) {
@@ -160,7 +161,7 @@ const AchievementList = React.createClass({
             let theObj = getSearchUrl(window.location.search);
             if (theObj.rid) {
                 theObj.id = theObj.rid;
-                if (theObj.rid != 'null' && theObj.uid != 'null') {
+                if (theObj.rid != 'null') {
                     this.tableRowClick(theObj);
                 };
             };
@@ -284,6 +285,7 @@ const AchievementList = React.createClass({
                         </Upload>
                         <Button onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/downloadTemplate?sign=achievement_template') }}>下载批量导入模板</Button>
                         <Button type="primary" className="addButton" onClick={this.addClick}>发布成果<Icon type="plus" /></Button>
+                        <BatchImport closeDesc={this.closeDesc} />
                     </div>
                 </div>
                 <div className="user-search">

+ 119 - 166
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -5,7 +5,7 @@ import './techAchievement.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory } from '../../tools.js';
+import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory, getDemandType } from '../../tools.js';
 import throttle from '../../throttle.js';
 
 const KeyWordTagGroup = React.createClass({
@@ -489,91 +489,10 @@ const AchievementDetailShow = Form.create()(React.createClass({
                             label="成果所有人名称" >
                             <span>{theData.ownerName}</span>
                         </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所有人证件号" >
-                            <span>{theData.ownerIdNumber}</span>
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所有人联系电话" >
-                            <span>{theData.ownerMobile}</span>
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所有人电子邮箱" >
-                            <span>{theData.ownerEmail}</span>
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所有人通信地址" >
-                            <span>{theData.ownerPostalAddress}</span>
-                        </FormItem>
                     </div>
                     <div className="clearfix">
                         <FormItem className="half-item"
                             {...formItemLayout}
-                            label="所有人类型" >
-                            {(() => {
-                                switch (theData.ownerType) {
-                                    case "0":
-                                        return <span>个人</span>;
-                                    case "1":
-                                        return <span>组织</span>;
-                                }
-                            })()}
-                        </FormItem>
-                    </div>
-                    {theData.ownerType == "0" ? <div className="clearfix">
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所属组织名称" >
-                            {getFieldDecorator('orgName', {
-                                initialValue: theData.orgName
-                            })(
-                                <Input />
-                                )}
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所属组织地址" >
-                            {getFieldDecorator('orgAddress', {
-                                initialValue: theData.orgAddress
-                            })(
-                                <Input />
-                                )}
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所属组织邮箱" >
-                            {getFieldDecorator('orgEmail', {
-                                initialValue: theData.orgEmail
-                            })(
-                                <Input />
-                                )}
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所属组织联系人名称" >
-                            {getFieldDecorator('orgContacts', {
-                                initialValue: theData.orgContacts
-                            })(
-                                <Input />
-                                )}
-                        </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="所属组织联系人电话" >
-                            {getFieldDecorator('orgContactsMobile', {
-                                initialValue: theData.orgContactsMobile
-                            })(
-                                <Input />
-                                )}
-                        </FormItem>
-                    </div> : <div></div>}
-                    <div className="clearfix">
-                        <FormItem className="half-item"
-                            {...formItemLayout}
                             label="合作方式" >
                             {(() => {
                                 switch (theData.cooperationMode) {
@@ -758,6 +677,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
                     technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
                     maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
                 });
+                if (thisData.ownerType == "1") {
+                    this.getContactsList(thisData.ownerId);
+                };
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -765,6 +687,35 @@ const AchievementDetailForm = Form.create()(React.createClass({
             });
         }.bind(this));
     },
+    getContactsList(theUid) {
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/getContacts",
+            data: {
+                uid: theUid
+            },
+            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(
+                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                    );
+                };
+                this.setState({
+                    contactsOption: theOption
+                });
+            }.bind(this),
+        });
+    },
     getTagsArr(e) {
         this.setState({ tags: e });
     },
@@ -837,7 +788,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                 message.warning('关键词数量不能小于3个!');
                 return;
             };
-            if (!this.state.dataSourceObj[values.ownerId]) {
+            if (values.iOwnerName && this.state.dataSourceObj && !this.state.dataSourceObj[values.iOwnerName]) {
                 message.warning('请选择一个有效的公司!');
                 return;
             }
@@ -885,7 +836,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         maturityTextFileUrl: this.state.maturityTextFileUrl,
                         maturityVideoUrl: values.maturityVideoUrl,
                         innovation: values.innovation,
-                        ownerId: this.state.dataSourceObj[values.ownerId],
+                        ownerId: this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId,
                         ownerType: this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
                         cooperationMode: values.cooperationMode,
                         transferMode: values.transferMode,
@@ -1173,17 +1124,35 @@ const AchievementDetailForm = Form.create()(React.createClass({
                     <FormItem className="half-item"
                         {...formItemLayout}
                         label="成果所有人" >
-                        {getFieldDecorator('ownerId', {
+                        {getFieldDecorator('iOwnerName', {
                             rules: [{ required: true, message: '此项为必填项!' }],
-                            initialValue: theData.ownerId
+                            initialValue: theData.iOwnerName || ''
                         })(
                             <AutoComplete
                                 dataSource={this.state.dataSource}
                                 style={{ width: 200 }}
                                 onSearch={this.state.therottleSearch}
-                                placeholder="输入成果所有人" />
+                                placeholder="输入成果所有人"
+                                onSelect={(e) => {
+                                    this.getContactsList(this.state.dataSourceObj[e]);
+                                }} />
                             )}
                     </FormItem>
+                    {this.props.detailApiUrl.indexOf('org') >= 0 ? <FormItem className="half-item"
+                        {...formItemLayout}
+                        label="联系人" >
+                        {getFieldDecorator('contacts', {
+                            initialValue: theData.contacts
+                        })(
+                            <Select style={{ width: 260 }}
+                                placeholder="请选择联系人"
+                                notFoundContent="未获取到联系人列表"
+                                showSearch
+                                filterOption={companySearch}>
+                                {this.state.contactsOption}
+                            </Select>
+                            )}
+                    </FormItem> : <div></div>}
                 </div>
                 <div className="clearfix">
                     <FormItem className="half-item"
@@ -1381,13 +1350,28 @@ const AchievementDetail = React.createClass({
     getInitialState() {
         return {
             visible: false,
+            tabsKey: 1,
             columns: [
                 {
                     title: '编号',
                     dataIndex: 'serialNumber',
                     key: 'serialNumber',
                 }, {
-                    title: '需求名称',
+                    title: '数据类型',
+                    dataIndex: 'dataCategory',
+                    key: 'dataCategory',
+                    render: text => {
+                        switch (text) {
+                            case "0":
+                                return <span>成果</span>;
+                            case "1":
+                                return <span>技术</span>;
+                            case "2":
+                                return <span>项目</span>;
+                        }
+                    }
+                }, {
+                    title: '名称',
                     dataIndex: 'name',
                     key: 'name',
                 }, {
@@ -1395,73 +1379,23 @@ const AchievementDetail = React.createClass({
                     dataIndex: 'keyword',
                     key: 'keyword',
                 }, {
-                    title: '需求类型',
+                    title: '类型',
                     dataIndex: 'demandType',
                     key: 'demandType',
                     render: text => { return getDemandType(text); }
                 }, {
-                    title: '信息来源',
-                    dataIndex: 'infoSources',
-                    key: 'infoSources',
-                    render: text => {
-                        switch (text) {
-                            case "0":
-                                return <span>平台采集</span>;
-                            case "1":
-                                return <span>客户发布</span>
-                        }
-                    }
-                }, {
-                    title: '雇主名称',
-                    dataIndex: 'username',
-                    key: 'username',
-                }, {
-                    title: '审核状态',
-                    dataIndex: 'auditStatus',
-                    key: 'auditStatus',
-                    render: text => {
-                        switch (text) {
-                            case "0":
-                                return <span>未提交审核(草稿)</span>;
-                            case "1":
-                                return <span>提交审核</span>;
-                            case "2":
-                                return <span>审核中</span>;
-                            case "3":
-                                return <span>审核通过</span>;
-                            case "4":
-                                return <span>审核未通过</span>;
-                        }
-                    }
-                }, {
-                    title: '需求状态',
-                    dataIndex: 'status',
-                    key: 'status',
-                    render: text => {
-                        switch (text) {
-                            case "0":
-                                return <span>未解决</span>;
-                            case "1":
-                                return <span>已解决</span>;
-                        }
-                    }
-                }, {
-                    title: '有效期限',
-                    dataIndex: 'validityPeriodFormattedDate',
-                    key: 'validityPeriodFormattedDate',
+                    title: '所有人名称',
+                    dataIndex: 'theName',
+                    key: 'theName',
                 }, {
                     title: '发布时间',
                     dataIndex: 'releaseDateFormattedDate',
                     key: 'releaseDateFormattedDate',
                 }, {
-                    title: '管理员',
-                    dataIndex: 'principalId',
-                    key: 'principalId',
-                }, {
-                    title: '技术经纪人',
-                    dataIndex: 'techBrokerId',
-                    key: 'techBrokerId',
-                }
+                    title: '有效期限',
+                    dataIndex: 'validityPeriodFormattedDate',
+                    key: 'validityPeriodFormattedDate',
+                },
             ],
             dataSource: [],
         };
@@ -1499,7 +1433,7 @@ const AchievementDetail = React.createClass({
             });
         }.bind(this));
     },
-    getTableList(id) {
+    getTableList() {
         this.setState({
             loading: true
         });
@@ -1507,24 +1441,33 @@ const AchievementDetail = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/audit/techBroders",
-            data: { id: id || this.props.data.id },
+            url: globalConfig.context + "/api/admin/achievement/achievementDemand",
+            data: { id: this.props.data.id },
             success: function (data) {
+                let theArr = [];
                 if (!data.data) {
                     if (data.error && data.error.length) {
                         message.warning(data.error[0].message);
-                    }
-                    return;
-                };
-                let _me = this, theArr = [];
-                for (var item in data.data) {
-                    theArr.push(
-                        <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
-                    )
+                    };
+                } else if (data.data.length) {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let thisdata = data.data[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            dataCategory: thisdata.dataCategory,
+                            name: thisdata.name,
+                            keyword: thisdata.keyword,
+                            demandType: thisdata.demandType,
+                            theName: thisdata.username || thisdata.unitName,
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
+                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
+                        });
+                    };
                 };
                 this.setState({
-                    techBrodersOption: theArr,
-                    techBrodersObj: data.data
+                    dataSource: theArr,
                 });
             }.bind(this),
         }).always(function () {
@@ -1534,8 +1477,11 @@ const AchievementDetail = React.createClass({
         }.bind(this));
     },
     tableRowClick(record, index) {
-        this.state.RowData = record;
-        debugger
+        if (record.ownerType == "0") {
+            window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandOrg');
+        } else if (record.ownerType == "1") {
+            window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandUser')
+        };
     },
     handleCancel(e) {
         this.setState({
@@ -1551,13 +1497,13 @@ const AchievementDetail = React.createClass({
     },
     componentWillMount() {
         this.getTechBrodersList();
-        this.getTableList();
     },
     componentWillReceiveProps(nextProps) {
-        this.state.visible = nextProps.showDesc;
-        if (!this.props.showDesc && nextProps.showDesc) {
-            this.getTableList(nextProps.data.id);
+        if (nextProps.showDesc) {
+            this.state.tabsKey = "1";
+            this.state.tabBool = true;
         };
+        this.state.visible = nextProps.showDesc;
     },
     render() {
         if (this.props.data) {
@@ -1568,7 +1514,14 @@ const AchievementDetail = React.createClass({
                         width='1000px'
                         footer=''
                         className="admin-desc-content">
-                        <Tabs defaultActiveKey="1">
+                        <Tabs activeKey={this.state.tabsKey}
+                            onChange={(e) => {
+                                this.setState({ tabsKey: e });
+                                if (e == "2" && this.state.tabBool) {
+                                    this.getTableList();
+                                    this.state.tabBool = false;
+                                };
+                            }} >
                             <Tabs.TabPane tab="成果详情" key="1">
                                 {(() => {
                                     if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {

+ 136 - 0
js/component/manageCenter/demand/batchImport.jsx

@@ -0,0 +1,136 @@
+import React from 'react';
+import { Input, Modal, Button, message } from 'antd';
+import { demandTypeList } from '../../dataDic.js';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+
+const BatchImport = React.createClass({
+    getInitialState: function () {
+        return {
+            loading: false,
+            error: false
+        };
+    },
+    showModal() {
+        this.setState({
+            visible: true,
+        });
+    },
+    handleOk(e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    handleCancel(e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    //数据反向转化
+    getDataCategory(e, row) {
+        switch (e) {
+            case "个人需求":
+                return 0;
+            case "单位需求":
+                return 1;
+            default:
+                message.warning("第 " + row + " 行中没有对应的数据类型!");
+                this.state.error = true;
+                break;
+        }
+    },
+    getDemandType(e, row) {
+        let theType, _me = this;
+        if (e) {
+            demandTypeList.map(function (item) {
+                if (item.key == e) {
+                    theType = Number(item.value);
+                };
+            });
+            if (theType == null) {
+                message.warning("第 " + row + " 行中没有对应的需求类型!");
+                _me.state.error = true;
+            }
+            return theType;
+        };
+    },
+    //提交
+    handleSubmit() {
+        let rowsArr = this.state.inputValue.split(/[\r\n]/g);
+        let columnArr = [], _me = this;
+        if (!rowsArr.length) {
+            return;
+        };
+        let columnLength = 9;//定义数据正常长度
+        for (let i = 0; i < rowsArr.length; i++) {
+            if (_me.state.error) {
+                this.state.error = false;
+                return;
+            };
+            let theArr = rowsArr[i].split(/\t+/);
+            if (theArr.length == columnLength) {
+                columnArr.push({
+                    dataCategory: _me.getDataCategory(theArr[0], i + 1),
+                    name: theArr[1],
+                    keyword: theArr[2],
+                    demandType: _me.getDemandType(theArr[3], i + 1),
+                    problemDes: theArr[4],
+                    employerName: theArr[5],
+                    employerContacts: theArr[6],
+                    employerContactsMobile: theArr[7],
+                    employerContactsMailbox: theArr[8]
+                });
+            } else if (rowsArr[i].replace(/(^\s+)|(\s+$)/g, "").length) {
+                message.warning("第" + (i + 1) + "行数据长度错误!");
+                return;
+            };
+        };
+        if (columnArr.length > 1000) {
+            message.warning("数据条数不能多于1000条!");
+            return;
+        };
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/demand/importDemand',
+            data: {
+                data: JSON.stringify(columnArr)
+            }
+        }).done(function (data) {
+            this.setState({
+                loading: false
+            });
+            if (!data.error.length) {
+                message.success('导入成功!');
+                this.props.closeDesc(false, true);
+                this.handleOk();
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
+    render() {
+        return (
+            <div>
+                <Button type="primary" onClick={this.showModal}>批量导入</Button>
+                <Modal
+                    title="批量导入"
+                    visible={this.state.visible}
+                    onCancel={this.handleCancel}
+                    width='1000px'
+                    footer={[
+                        <Button key="ok" className="set-submit" type="primary" loading={this.state.loading} onClick={this.handleSubmit}>保存</Button>,
+                        <Button key="clancel" className="set-submit" type="ghost" onClick={this.handleCancel}>取消</Button>
+                    ]} >
+                    <Input type="textarea" rows={12} onChange={(e) => { this.state.inputValue = e.target.value; }} />
+                </Modal>
+            </div>
+        );
+    }
+});
+
+export default BatchImport;

+ 8 - 2
js/component/manageCenter/demand/techDemand.jsx

@@ -6,7 +6,8 @@ import moment from 'moment';
 import './techDemand.less';
 import TechDemandDesc from './techDemandDesc.jsx';
 import { demandTypeList } from '../../dataDic.js';
-import { companySearch, getDemandType, getSearchUrl,beforeUploadFile } from '../../tools.js';
+import { companySearch, getDemandType, getSearchUrl, beforeUploadFile } from '../../tools.js';
+import BatchImport from './batchImport';
 
 const DemandList = React.createClass({
     loadData(pageNo, apiUrl) {
@@ -129,7 +130,11 @@ const DemandList = React.createClass({
                             case "0":
                                 return <span>平台采集</span>;
                             case "1":
-                                return <span>客户发布</span>
+                                return <span>客户发布</span>;
+                            case "2":
+                                return <span>批量导入</span>
+                            case "3":
+                                return <span>三方对接</span>
                         }
                     }
                 }, {
@@ -394,6 +399,7 @@ const DemandList = React.createClass({
                         </Upload>
                         <Button onClick={() => { window.open(globalConfig.context + '/api/admin/demand/downloadTemplate?sign=demand_template') }}>下载批量导入模板</Button>
                         <Button type="primary" className="addButton" onClick={this.addClick}>新增需求<Icon type="plus" /></Button>
+                        <BatchImport closeDesc={this.closeDesc} />
                     </div>
                 </div>
                 <div className="user-search">

+ 49 - 50
js/component/manageCenter/demand/techDemandDesc.jsx

@@ -5,7 +5,7 @@ import './techDemand.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getTechField, getDemandType } from '../../tools.js';
+import { beforeUploadFile, splitUrl, companySearch, getTechField, getDemandType, getAchievementCategory } from '../../tools.js';
 
 const KeyWordTagGroup = React.createClass({
     getInitialState() {
@@ -413,6 +413,10 @@ const DemandDetailShow = Form.create()(React.createClass({
                                         return <span>平台采集</span>;
                                     case "1":
                                         return <span>客户发布</span>;
+                                    case "2":
+                                        return <span>批量导入</span>;
+                                    case "3":
+                                        return <span>三方对接</span>;
                                 }
                             })()}
                         </FormItem>
@@ -691,7 +695,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         name: values.name,
                         keyword: this.state.tags ? this.state.tags.join(",") : [],
                         keywords: this.state.tags,
-                        infoSources: values.infoSources,
+                        infoSources: 0,
                         industryCategoryA: values.industryCategory ? values.industryCategory[0] : undefined,
                         industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
                         demandType: values.demandType,
@@ -883,21 +887,6 @@ const DemandDetailForm = Form.create()(React.createClass({
                             })()}
                         </FormItem>
                     </div>
-                    <div className="clearfix">
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="信息来源" >
-                            {getFieldDecorator('infoSources', {
-                                rules: [{ required: true, message: '此项为必填项!' }],
-                                initialValue: theData.infoSources
-                            })(
-                                <Radio.Group>
-                                    <Radio value="0">平台采集</Radio>
-                                    <Radio value="1">客户发布</Radio>
-                                </Radio.Group>
-                                )}
-                        </FormItem>
-                    </div>
                     <FormItem
                         labelCol={{ span: 3 }}
                         wrapperCol={{ span: 20 }}
@@ -1110,12 +1099,25 @@ const DemandDetail = React.createClass({
         return {
             visible: false,
             techBrodersObj: {},
+            tabsKey: "1",
             columns: [
                 {
                     title: '编号',
                     dataIndex: 'serialNumber',
                     key: 'serialNumber',
                 }, {
+                    title: '数据类型',
+                    dataIndex: 'dataCategory',
+                    key: 'dataCategory',
+                    render: text => {
+                        switch (text) {
+                            case "0":
+                                return <span>个人需求</span>;
+                            case "1":
+                                return <span>团体需求</span>;
+                        }
+                    }
+                }, {
                     title: '名称',
                     dataIndex: 'name',
                     key: 'name',
@@ -1130,8 +1132,8 @@ const DemandDetail = React.createClass({
                     render: text => { return getAchievementCategory(text); }
                 }, {
                     title: '所有人名称',
-                    dataIndex: 'ownerName',
-                    key: 'ownerName',
+                    dataIndex: 'theName',
+                    key: 'theName',
                 }, {
                     title: '所有人类型',
                     dataIndex: 'ownerType',
@@ -1145,11 +1147,6 @@ const DemandDetail = React.createClass({
                         }
                     }
                 }, {
-                    title: '审核状态',
-                    dataIndex: 'auditStatus',
-                    key: 'auditStatus',
-                    render: text => { return getTechAuditStatus(text) }
-                }, {
                     title: '发布时间',
                     dataIndex: 'releaseDateFormattedDate',
                     key: 'releaseDateFormattedDate',
@@ -1191,7 +1188,7 @@ const DemandDetail = React.createClass({
             });
         }.bind(this));
     },
-    getTableList(id) {
+    getTableList() {
         this.setState({
             loading: true
         });
@@ -1199,17 +1196,17 @@ const DemandDetail = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/audit/techBroders",
-            data: { id: id },
+            url: globalConfig.context + "/api/admin/demand/achievementDemand",
+            data: { id: this.props.data.id },
             success: function (data) {
                 let theArr = [];
-                if (!data.data && !data.data.list) {
+                if (!data.data) {
                     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];
+                } else if (data.data.length) {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let thisdata = data.data[i];
                         theArr.push({
                             key: i,
                             id: thisdata.id,
@@ -1217,20 +1214,11 @@ const DemandDetail = React.createClass({
                             dataCategory: thisdata.dataCategory,
                             name: thisdata.name,
                             keyword: thisdata.keyword,
-                            infoSources: thisdata.infoSources,
-                            username: thisdata.username,
-                            demandType: thisdata.demandType,
-                            validityPeriod: thisdata.validityPeriod,
-                            employerName: thisdata.employerName,
-                            employerId: thisdata.employerId,
-                            province: thisdata.province,
-                            status: thisdata.status,
-                            releaseStatus: thisdata.releaseStatus,
+                            category: thisdata.category,
+                            ownerType: thisdata.ownerType,
+                            theName: thisdata.username || thisdata.unitName,
                             releaseDate: thisdata.releaseDate,
-                            principalId: thisdata.principalId,
-                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
-                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
-                            auditStatus: thisdata.auditStatus
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate
                         });
                     };
                 };
@@ -1245,8 +1233,11 @@ const DemandDetail = React.createClass({
         }.bind(this));
     },
     tableRowClick(record, index) {
-        this.state.RowData = record;
-        debugger
+        if (record.ownerType == "0") {
+            window.open(globalConfig.context + '/admin/achievement.html?rid=' + record.id + '#orgTechAchievement');
+        } else if (record.ownerType == "1") {
+            window.open(globalConfig.context + '/admin/achievement.html?rid=' + record.id + '#userTechAchievement')
+        };
     },
     handleCancel(e) {
         this.setState({
@@ -1264,10 +1255,11 @@ const DemandDetail = React.createClass({
         this.getTechBrodersList();
     },
     componentWillReceiveProps(nextProps) {
-        this.state.visible = nextProps.showDesc;
-        if (!this.props.showDesc && nextProps.showDesc) {
-            this.getTableList(nextProps.data.id);
+        if (nextProps.showDesc) {
+            this.state.tabsKey = "1";
+            this.state.tabBool = true;
         };
+        this.state.visible = nextProps.showDesc;
     },
     render() {
         if (this.props.data) {
@@ -1278,7 +1270,14 @@ const DemandDetail = React.createClass({
                         width='1000px'
                         footer=''
                         className="admin-desc-content">
-                        <Tabs defaultActiveKey="1">
+                        <Tabs activeKey={this.state.tabsKey}
+                            onChange={(e) => {
+                                this.setState({ tabsKey: e });
+                                if (e == "2" && this.state.tabBool) {
+                                    this.getTableList();
+                                    this.state.tabBool = false;
+                                };
+                            }} >
                             <Tabs.TabPane tab="需求详情" key="1">
                                 {(() => {
                                     if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {

+ 2 - 2
js/component/manageCenter/topTab.jsx

@@ -68,9 +68,9 @@ const MessageModal = React.createClass({
                             case 9:
                                 return <a href={globalConfig.context + "/admin/demand.html?rid=" + record.rid + "&uid=" + record.uid + "#techDemandOrg"}> {record.noticeTypeName} </a >;
                             case 10:
-                                return <a href={globalConfig.context + "/admin/achievement.html?rid=" + record.rid + "&uid=" + record.uid + "#techAchievement"}> {record.noticeTypeName} </a >;
+                                return <a href={globalConfig.context + "/admin/achievement.html?rid=" + record.rid + "#orgTechAchievement"}> {record.noticeTypeName} </a >;
                             case 11:
-                                return <a href={globalConfig.context + "/admin/achievement.html?rid=" + record.rid + "&uid=" + record.uid + "#techAchievement"}> {record.noticeTypeName} </a >;
+                                return <a href={globalConfig.context + "/admin/achievement.html?rid=" + record.rid + "#userTechAchievement"}> {record.noticeTypeName} </a >;
                         }
                     }
                 }, {