yee 7 年之前
父節點
當前提交
568f081955

+ 52 - 0
js/component/account/achievement/techAchievementDesc.jsx

@@ -249,6 +249,11 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         </FormItem>
                         <FormItem className="half-item"
                             {...formItemLayout}
+                            label="联系人" >
+                            <span>{this.props.contactsObj[theData.contacts]}</span>
+                        </FormItem>
+                        <FormItem className="half-item"
+                            {...formItemLayout}
                             label="数据类别" >
                             {(() => {
                                 switch (theData.dataCategory) {
@@ -706,6 +711,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         dataCategory: values.dataCategory,
                         serialNumber: this.props.data.serialNumber,
                         name: values.name,
+                        contacts: values.contacts,
                         keyword: this.state.tags ? this.state.tags.join(",") : [],
                         keywords: this.state.tags,
                         category: values.category,
@@ -803,6 +809,18 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         </FormItem>
                         <FormItem className="half-item"
                             {...formItemLayout}
+                            label="联系人" >
+                            {getFieldDecorator('contacts', {
+                                rules: [{ required: true, message: '此项为必填项!' }],
+                                initialValue: theData.contacts
+                            })(
+                                <Select placeholder="选择联系人" style={{ width: 260 }} >
+                                    {this.props.contactsOption}
+                                </Select>
+                                )}
+                        </FormItem>
+                        <FormItem className="half-item"
+                            {...formItemLayout}
                             label="数据类别" >
                             {getFieldDecorator('dataCategory', {
                                 rules: [{ required: true, message: '此项为必填项!' }],
@@ -1201,6 +1219,7 @@ const AchievementDetail = React.createClass({
         return {
             visible: false,
             tabsKey: 1,
+            contactsObj: {},
             columns: [
                 {
                     title: '编号',
@@ -1299,6 +1318,37 @@ const AchievementDetail = React.createClass({
         });
         this.props.closeDesc(false, true);
     },
+    componentWillMount() {
+        this.getContactsOption();
+    },
+    getContactsOption() {
+        let theOption = [], theObj = {};
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/getContacts',
+            success: function (data) {
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let item in data.data) {
+                        let theData = data.data[item];
+                        theOption.push(
+                            <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        );
+                    };
+                    theObj = data.data;
+                };
+                this.setState({
+                    contactsOption: theOption,
+                    contactsObj: theObj
+                });
+            }.bind(this)
+        });
+    },
     componentWillReceiveProps(nextProps) {
         if (nextProps.showDesc) {
             this.state.tabsKey = "1";
@@ -1330,12 +1380,14 @@ const AchievementDetail = React.createClass({
                                             data={this.props.data}
                                             closeDesc={this.handleCancel}
                                             visible={this.state.visible}
+                                            contactsObj={this.state.contactsObj}
                                             handleOk={this.handleOk} />
                                     } else {
                                         return <AchievementDetailForm
                                             data={this.props.data}
                                             achievementCategoryOption={this.props.achievementCategoryOption}
                                             closeDesc={this.handleCancel}
+                                            contactsOption={this.state.contactsOption}
                                             visible={this.state.visible}
                                             handleOk={this.handleOk} />
                                     }

+ 22 - 1
js/component/account/services/patentAdd.jsx

@@ -12,7 +12,28 @@ const PatentAddFrom = Form.create()(React.createClass({
         };
     },
     componentWillMount() {
-        this.state.contactsOption = setUserContactsList();
+        let theOption = [];
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/getContacts',
+            success: function (data) {
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    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 });
     },
     handleSubmit(e) {
         e.preventDefault();

+ 43 - 19
js/component/manageCenter/achievement/techAchievement.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
+import { Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
@@ -25,6 +25,9 @@ const AchievementList = React.createClass({
                 pageSize: this.state.pagination.pageSize,
                 serialNumber: this.state.serialNumber, //编号
                 name: this.state.name, //名称
+                ownerName: this.state.searchType == 1 ? this.state.searchName : undefined,
+                username: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('org') == -1 ? this.state.searchName : undefined,
+                unitName: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('user') == -1 ? this.state.searchName : undefined,
                 keyword: this.state.keyword, // 关键词
                 category: this.state.category, //类型(0--专利, 2--软著, 3--项目, 4--版权, 5--工业设计, 6--配方, 7--非标)
                 releaseDateStartDate: this.state.releaseDate[0],
@@ -76,6 +79,7 @@ const AchievementList = React.createClass({
     getInitialState() {
         return {
             searchMore: true,
+            searchType: 0,
             validityPeriodDate: [],
             releaseDate: [],
             selectedRowKeys: [],
@@ -158,9 +162,19 @@ const AchievementList = React.createClass({
     },
     componentWillReceiveProps(nextProps) {
         if (this.props['data-listApiUrl'] != nextProps['data-listApiUrl']) {
-            this.loadData(null, nextProps['data-listApiUrl']);
             this.state.selectedRowKeys = [];
             this.state.selectedRows = [];
+            this.state.serialNumber = undefined;
+            this.state.name = undefined;
+            this.state.keyword = undefined;
+            this.state.category = undefined;
+            this.state.ownerType = undefined;
+            this.state.releaseStatus = undefined;
+            this.state.auditStatus = undefined;
+            this.state.searchName = undefined;
+            this.state.searchType = 0;
+            this.state.releaseDate = [];
+            this.loadData(null, nextProps['data-listApiUrl']);
         };
     },
     tableRowClick(record, index) {
@@ -224,6 +238,7 @@ const AchievementList = React.createClass({
         this.state.ownerType = undefined;
         this.state.releaseStatus = undefined;
         this.state.auditStatus = undefined;
+        this.state.searchName = undefined;
         this.state.releaseDate = [];
         this.loadData();
     },
@@ -286,23 +301,15 @@ const AchievementList = React.createClass({
                     <Input placeholder="关键字"
                         value={this.state.keyword}
                         onChange={(e) => { this.setState({ keyword: e.target.value }); }} />
-                    <Select placeholder="选择类型" style={{ width: 160 }}
-                        value={this.state.category}
-                        onChange={(e) => { this.setState({ category: e }) }}>
-                        {this.state.achievementCategoryOption}
-                    </Select>
-                    <Select placeholder="选择审核状态"
-                        style={{ width: 160 }}
-                        value={this.state.auditStatus}
-                        onChange={(e) => { this.setState({ auditStatus: e }) }}>
-                        {this.state.auditStatusOption}
-                    </Select>
-                    <Select placeholder="选择是否发布" style={{ width: 120 }}
-                        value={this.state.releaseStatus}
-                        onChange={(e) => { this.setState({ releaseStatus: e }) }}>
-                        <Select.Option value="0" >未发布</Select.Option>
-                        <Select.Option value="1" >已发布</Select.Option>
-                    </Select>
+                    <Input placeholder="所有人名称"
+                        value={this.state.searchName}
+                        onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
+                    <Radio.Group value={this.state.searchType} onChange={(e) => {
+                        this.setState({ searchType: e.target.value })
+                    }}>
+                        <Radio value={0}>认证用户</Radio>
+                        <Radio value={1}>非认证用户</Radio>
+                    </Radio.Group>
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>
                     <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
@@ -310,6 +317,23 @@ const AchievementList = React.createClass({
                         onClick={this.delectRow}>删除<Icon type="minus" /></Button>
                     <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                     <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                        <Select placeholder="选择类型" style={{ width: 160 }}
+                            value={this.state.category}
+                            onChange={(e) => { this.setState({ category: e }) }}>
+                            {this.state.achievementCategoryOption}
+                        </Select>
+                        <Select placeholder="选择审核状态"
+                            style={{ width: 160 }}
+                            value={this.state.auditStatus}
+                            onChange={(e) => { this.setState({ auditStatus: e }) }}>
+                            {this.state.auditStatusOption}
+                        </Select>
+                        <Select placeholder="选择是否发布" style={{ width: 120 }}
+                            value={this.state.releaseStatus}
+                            onChange={(e) => { this.setState({ releaseStatus: e }) }}>
+                            <Select.Option value="0" >未发布</Select.Option>
+                            <Select.Option value="1" >已发布</Select.Option>
+                        </Select>
                         <span>发布时间 :</span>
                         <RangePicker
                             value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,

+ 28 - 1
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -136,6 +136,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
         return {
             loading: false,
             buttonLoading: false,
+            contactsObj: {},
             data: {},
             tags: [],
             technicalPictureUrl: [],
@@ -173,6 +174,9 @@ const AchievementDetailShow = Form.create()(React.createClass({
                     technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
                     maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
                 });
+                if (thisData.ownerId) {
+                    this.getContactsList(thisData.ownerId);
+                };
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -276,6 +280,29 @@ const AchievementDetailShow = 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) {
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                        return;
+                    };
+                } else {
+                    this.setState({
+                        contactsObj: data.data || {}
+                    });
+                };
+            }.bind(this),
+        });
+    },
     componentWillMount() {
         this.loadData(this.props.data.id, this.props.detailApiUrl);
     },
@@ -491,7 +518,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                                 <FormItem className="half-item"
                                     {...formItemLayout}
                                     label="联系电话" >
-                                    <span>{theData.iOwnerMobile}</span>
+                                    <span>{this.state.contactsObj[theData.contacts]}</span>
                                 </FormItem>
                                 <FormItem className="half-item"
                                     {...formItemLayout}

+ 60 - 34
js/component/manageCenter/demand/techDemand.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
+import { Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
@@ -35,7 +35,10 @@ const DemandList = React.createClass({
                 validityPeriodEndDate: this.state.validityPeriodDate[1],
                 releaseDateStartDate: this.state.releaseDate[0],
                 releaseDateEndDate: this.state.releaseDate[1],
-                auditStatus: this.state.auditStatus
+                auditStatus: this.state.auditStatus,
+                employerName: this.state.searchType == 1 ? this.state.searchName : undefined,
+                username: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('org') == -1 ? this.state.searchName : undefined,
+                unitName: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('user') == -1 ? this.state.searchName : undefined,
             },
             success: function (data) {
                 let theArr = [];
@@ -87,6 +90,7 @@ const DemandList = React.createClass({
     getInitialState() {
         return {
             searchMore: true,
+            searchType: 0,
             validityPeriodDate: [],
             releaseDate: [],
             selectedRowKeys: [],
@@ -276,9 +280,21 @@ const DemandList = React.createClass({
     },
     componentWillReceiveProps(nextProps) {
         if (this.props['data-listApiUrl'] != nextProps['data-listApiUrl']) {
-            this.loadData(null, nextProps['data-listApiUrl']);
             this.state.selectedRowKeys = [];
             this.state.selectedRows = [];
+            this.state.serialNumber = undefined;
+            this.state.name = undefined;
+            this.state.keyword = undefined;
+            this.state.infoSources = undefined;
+            this.state.demandType = undefined;
+            this.state.searchName = undefined;
+            this.state.searchType = 0;
+            this.state.status = undefined;
+            this.state.releaseStatus = undefined;
+            this.state.auditStatus = undefined;
+            this.state.validityPeriodDate = [];
+            this.state.releaseDate = [];
+            this.loadData(null, nextProps['data-listApiUrl']);
         };
     },
     tableRowClick(record, index) {
@@ -340,7 +356,8 @@ const DemandList = React.createClass({
         this.state.keyword = undefined;
         this.state.infoSources = undefined;
         this.state.demandType = undefined;
-        this.state.username = undefined;
+        this.state.searchName = undefined;
+        this.state.searchType = 0;
         this.state.status = undefined;
         this.state.releaseStatus = undefined;
         this.state.auditStatus = undefined;
@@ -407,36 +424,15 @@ const DemandList = React.createClass({
                     <Input placeholder="关键字"
                         value={this.state.keyword}
                         onChange={(e) => { this.setState({ keyword: e.target.value }); }} />
-                    <Select placeholder="选择信息来源" style={{ width: 120 }}
-                        value={this.state.infoSources}
-                        onChange={(e) => { this.setState({ infoSources: e }) }}>
-                        <Select.Option value="0" >平台采集</Select.Option>
-                        <Select.Option value="1" >客户发布</Select.Option>
-                        <Select.Option value="2" >批量导入</Select.Option>
-                        <Select.Option value="3" >三方对接</Select.Option>
-                    </Select>
-                    <Select placeholder="选择需求类型"
-                        style={{ width: 120 }}
-                        value={this.state.demandType}
-                        onChange={(e) => { this.setState({ demandType: e }) }}>
-                        {this.state.demandTypeOption}
-                    </Select>
-                    <Select placeholder="选择需求状态" style={{ width: 120 }}
-                        value={this.state.status}
-                        onChange={(e) => { this.setState({ status: e }) }}>
-                        <Select.Option value="0" >进行中</Select.Option>
-                        <Select.Option value="1" >未解决</Select.Option>
-                        <Select.Option value="2" >已解决</Select.Option>
-                    </Select>
-                    <Select placeholder="选择审核状态" style={{ width: 160 }}
-                        value={this.state.auditStatus}
-                        onChange={(e) => { this.setState({ auditStatus: e }) }}>
-                        <Select.Option value="0" >未提交审核(草稿)</Select.Option>
-                        <Select.Option value="1" >提交审核</Select.Option>
-                        <Select.Option value="2" >审核中</Select.Option>
-                        <Select.Option value="3" >审核通过</Select.Option>
-                        <Select.Option value="4" >审核未通过</Select.Option>
-                    </Select>
+                    <Input placeholder="雇主名称"
+                        value={this.state.searchName}
+                        onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
+                    <Radio.Group value={this.state.searchType} onChange={(e) => {
+                        this.setState({ searchType: e.target.value })
+                    }}>
+                        <Radio value={0}>认证用户</Radio>
+                        <Radio value={1}>非认证用户</Radio>
+                    </Radio.Group>
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>
                     <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
@@ -444,6 +440,36 @@ const DemandList = React.createClass({
                         onClick={this.delectRow}>删除<Icon type="minus" /></Button>
                     <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                     <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                        <Select placeholder="选择信息来源" style={{ width: 120 }}
+                            value={this.state.infoSources}
+                            onChange={(e) => { this.setState({ infoSources: e }) }}>
+                            <Select.Option value="0" >平台采集</Select.Option>
+                            <Select.Option value="1" >客户发布</Select.Option>
+                            <Select.Option value="2" >批量导入</Select.Option>
+                            <Select.Option value="3" >三方对接</Select.Option>
+                        </Select>
+                        <Select placeholder="选择需求类型"
+                            style={{ width: 120 }}
+                            value={this.state.demandType}
+                            onChange={(e) => { this.setState({ demandType: e }) }}>
+                            {this.state.demandTypeOption}
+                        </Select>
+                        <Select placeholder="选择需求状态" style={{ width: 120 }}
+                            value={this.state.status}
+                            onChange={(e) => { this.setState({ status: e }) }}>
+                            <Select.Option value="0" >进行中</Select.Option>
+                            <Select.Option value="1" >未解决</Select.Option>
+                            <Select.Option value="2" >已解决</Select.Option>
+                        </Select>
+                        <Select placeholder="选择审核状态" style={{ width: 160 }}
+                            value={this.state.auditStatus}
+                            onChange={(e) => { this.setState({ auditStatus: e }) }}>
+                            <Select.Option value="0" >未提交审核(草稿)</Select.Option>
+                            <Select.Option value="1" >提交审核</Select.Option>
+                            <Select.Option value="2" >审核中</Select.Option>
+                            <Select.Option value="3" >审核通过</Select.Option>
+                            <Select.Option value="4" >审核未通过</Select.Option>
+                        </Select>
                         <Select placeholder="选择是否发布" style={{ width: 120 }}
                             value={this.state.releaseStatus}
                             onChange={(e) => { this.setState({ releaseStatus: e }) }}>