yee 7 lat temu
rodzic
commit
24268491e0

Plik diff jest za duży
+ 1165 - 1139
js/component/DicProvinceList.js


+ 2 - 2
js/component/account/achievement/techAchievement.jsx

@@ -232,8 +232,8 @@ const AchievementList = React.createClass({
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {
                 this.setState({
-                    selectedRows: selectedRows,
-                    selectedRowKeys: selectedRowKeys
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
                 });
             }
         };

+ 7 - 0
js/component/account/achievement/techAchievement.less

@@ -81,4 +81,11 @@
     .modal-submit {
         margin-left: 20px;
     }
+}
+.ant-table-thead {
+    .ant-table-selection-column {
+        .ant-checkbox-wrapper{
+            display: none;
+        }
+    }
 }

+ 2 - 2
js/component/account/demand/techDemand.jsx

@@ -245,8 +245,8 @@ const DemandList = React.createClass({
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {
                 this.setState({
-                    selectedRows: selectedRows,
-                    selectedRowKeys: selectedRowKeys
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
                 });
             }
         };

+ 8 - 0
js/component/account/demand/techDemand.less

@@ -81,4 +81,12 @@
     .modal-submit {
         margin-left: 20px;
     }
+}
+
+.ant-table-thead {
+    .ant-table-selection-column {
+        .ant-checkbox-wrapper {
+            display: none;
+        }
+    }
 }

+ 4 - 4
js/component/account/index/collection.jsx

@@ -86,7 +86,7 @@ const Content = React.createClass({
                         theArr.push({
                             key: i,
                             interestId: thisdata.id,
-                            id: thisdata.demandtId,
+                            id: thisdata.demandId,
                             createTime: thisdata.createTime,
                             keyword: thisdata.keyword,
                             name: thisdata.name,
@@ -134,7 +134,7 @@ const Content = React.createClass({
                     dataIndex: 'serialNumber',
                     key: 'serialNumber',
                 }, {
-                    title: '需求名称',
+                    title: '成果名称',
                     dataIndex: 'name',
                     key: 'name',
                 }, {
@@ -148,7 +148,7 @@ const Content = React.createClass({
                     render: (text, record) => {
                         if (record.deletedSign == 1) {
                             return "已删除"
-                        } else if (record.auditStatus !== 3) {
+                        } else if (record.auditStatus != 3) {
                             return "已下架"
                         } else {
                             return "正常"
@@ -193,7 +193,7 @@ const Content = React.createClass({
                     render: (text, record) => {
                         if (record.deletedSign == 1) {
                             return "已删除"
-                        } else if (record.auditStatus !== 3) {
+                        } else if (record.auditStatus != 3) {
                             return "已下架"
                         } else if (record.status == 0) {
                             return "未解决"

+ 8 - 0
js/component/account/index/content.jsx

@@ -35,6 +35,14 @@ class Content extends Component {
                     });
                 });
                 break;
+            case 'orderList':
+                require.ensure([], () => {
+                    const OrderList = require('./orderList').default;
+                    this.setState({
+                        component: OrderList
+                    });
+                });
+                break;
         };
         window.location.hash = key;
     }

+ 3 - 0
js/component/account/index/leftTab.jsx

@@ -41,6 +41,9 @@ const LeftTab = React.createClass({
                 <Menu.Item key="collection">
                     我的收藏
                 </Menu.Item>
+                <Menu.Item key="orderList">
+                    我的订单
+                </Menu.Item>
             </Menu>
         );
     },

+ 320 - 0
js/component/account/index/orderList.jsx

@@ -0,0 +1,320 @@
+import React from 'react';
+import { Spin, Button, Tabs, Table } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+import DemandDesc from '../../portal/search/demandDesc';
+import AchievementDesc from '../../portal/search/achievementDesc';
+import { getOrderStatus } from '../../tools';
+
+import './content.less';
+
+const TabPane = Tabs.TabPane;
+
+const Content = React.createClass({
+    achievementLoadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/portal/order/achievementOrderList",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.achievementPagination.pageSize
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data && !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        theArr.push({
+                            key: i,
+                            orderId: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            id: thisdata.achievementId,
+                            createTime: thisdata.createTime,
+                            status: thisdata.status,
+                            intentionMoney: thisdata.intentionMoney,
+                            contractMoney: thisdata.contractMoney,
+                            commission: thisdata.commission,
+                            serviceMoney: thisdata.serviceMoney,
+                            name: thisdata.name,
+                            achievementSerialNumber: thisdata.achievementSerialNumber,
+                            deletedSign: thisdata.deletedSign,
+                            auditStatus: thisdata.auditStatus,
+                            createTimeFormattedDate: thisdata.createTimeFormattedDate
+                        });
+                    };
+                }
+                this.state.achievementPagination.current = data.data.pageNo;
+                this.state.achievementPagination.total = data.data.totalCount;
+                this.setState({
+                    achievementDataSource: theArr,
+                    achievementPagination: this.state.achievementPagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    demandLoadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/portal/order/demandOrderList",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.demandPagination.pageSize
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data && !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        theArr.push({
+                            key: i,
+                            orderId: thisdata.id,
+                            name: thisdata.name,
+                            demandSerialNumber: thisdata.demandSerialNumber,
+                            id: thisdata.demandId,
+                            createTime: thisdata.createTime,
+                            createTimeFormattedDate: thisdata.createTimeFormattedDate,
+                            serialNumber: thisdata.serialNumber,
+                            status: thisdata.status,
+                            auditStatus: thisdata.auditStatus,
+                            deletedSign: thisdata.deletedSign,
+                            intentionMoney: thisdata.intentionMoney,  //意向金
+                            contractMoney: thisdata.contractMoney,  //合同金
+                            commission: thisdata.commission,  //佣金
+                            serviceMoney: thisdata.serviceMoney  //服务金
+                        });
+                    };
+                }
+                this.state.demandPagination.current = data.data.pageNo;
+                this.state.demandPagination.total = data.data.totalCount;
+                this.setState({
+                    demandDataSource: theArr,
+                    demandPagination: this.state.demandPagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            loading: false,
+            demandShowDesc: false,
+            achievementShowDesc: false,
+            achievementPagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.achievementLoadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            achievementColumns: [
+                {
+                    title: '编号',
+                    dataIndex: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '成果名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                }, {
+                    title: '订单状态',
+                    dataIndex: 'auditStatus',
+                    key: 'auditStatus',
+                    render: (text, record) => {
+                        if (record.deletedSign == 1) {
+                            return "已删除"
+                        } else if (record.auditStatus != 3) {
+                            return "已下架"
+                        } else {
+                            return "正常"
+                        }
+                    }
+                }, {
+                    title: '流程状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: (text, record) => { return getOrderStatus(text); }
+                }, {
+                    title: '意向金',
+                    dataIndex: 'intentionMoney',
+                    key: 'intentionMoney',
+                }, {
+                    title: '合同金',
+                    dataIndex: 'contractMoney',
+                    key: 'contractMoney',
+                }, {
+                    title: '佣金',
+                    dataIndex: 'commission',
+                    key: 'commission',
+                }, {
+                    title: '服务金',
+                    dataIndex: 'serviceMoney',
+                    key: 'serviceMoney',
+                }, {
+                    title: '接单时间',
+                    dataIndex: 'createTimeFormattedDate',
+                    key: 'createTimeFormattedDate',
+                }
+            ],
+            achievementDataSource: [],
+            demandPagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.demandLoadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            demandColumns: [
+                {
+                    title: '编号',
+                    dataIndex: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '需求名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                }, {
+                    title: '订单状态',
+                    dataIndex: 'auditStatus',
+                    key: 'auditStatus',
+                    render: (text, record) => {
+                        if (record.deletedSign == 1) {
+                            return "已删除"
+                        } else if (record.auditStatus != 3) {
+                            return "已下架"
+                        } else {
+                            return "正常"
+                        }
+                    }
+                }, {
+                    title: '流程状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: (text, record) => { return getOrderStatus(text); }
+                }, {
+                    title: '意向金',
+                    dataIndex: 'intentionMoney',
+                    key: 'intentionMoney',
+                }, {
+                    title: '合同金',
+                    dataIndex: 'contractMoney',
+                    key: 'contractMoney',
+                }, {
+                    title: '佣金',
+                    dataIndex: 'commission',
+                    key: 'commission',
+                }, {
+                    title: '服务金',
+                    dataIndex: 'serviceMoney',
+                    key: 'serviceMoney',
+                }, {
+                    title: '接单时间',
+                    dataIndex: 'createTimeFormattedDate',
+                    key: 'createTimeFormattedDate',
+                }
+            ],
+            demandDataSource: [],
+        };
+    },
+    componentWillMount() {
+        this.achievementLoadData();
+        this.demandLoadData();
+    },
+    tabChange(key) {
+
+    },
+    demandRowClick(record, index) {
+        this.state.demandRowData = record;
+        if (record.deletedSign != 1 && record.auditStatus == 3) {
+            this.setState({
+                demandShowDesc: true
+            });
+        };
+    },
+    achievementRowClick(record, index) {
+        this.state.achievementRowData = record;
+        if (record.deletedSign != 1 && record.auditStatus == 3) {
+            this.setState({
+                achievementShowDesc: true
+            });
+        };
+    },
+    demandCloseDesc(e) {
+        this.setState({
+            demandShowDesc: e
+        });
+        this.demandLoadData();
+    },
+    achievementCloseDesc(e) {
+        this.setState({
+            achievementShowDesc: e
+        });
+        this.achievementLoadData();
+    },
+    render() {
+        return (
+            <div className="collection">
+                <Spin spinning={this.state.loading} >
+                    <Tabs defaultActiveKey="1" onChange={this.tabChange}>
+                        <TabPane tab="我的成果订单" key="1">
+                            <Table columns={this.state.achievementColumns}
+                                dataSource={this.state.achievementDataSource}
+                                pagination={this.state.achievementPagination}
+                                onRowClick={this.achievementRowClick} />
+                        </TabPane>
+                        <TabPane tab="我的需求订单" key="2">
+                            <Table columns={this.state.demandColumns}
+                                dataSource={this.state.demandDataSource}
+                                pagination={this.state.demandPagination}
+                                onRowClick={this.demandRowClick} />
+                        </TabPane>
+                    </Tabs>
+                </Spin>
+                <DemandDesc data={this.state.demandRowData}
+                    showDesc={this.state.demandShowDesc}
+                    closeDesc={this.demandCloseDesc} />
+                <AchievementDesc data={this.state.achievementRowData}
+                    showDesc={this.state.achievementShowDesc}
+                    closeDesc={this.achievementCloseDesc} />
+            </div>
+        )
+    }
+});
+
+export default Content;

+ 4 - 5
js/component/account/set/content.jsx

@@ -43,11 +43,10 @@ const Content = React.createClass({
         return (
             <div className="acc-content">
                 {(() => {
-                    switch (userData.type || this.state.userType) {
-                        case '0':
-                            return <LeftTab handlekey={this.handlekey} />;
-                        case '1':
-                            return <GroupLeftTab handlekey={this.handlekey} />;
+                    if (userData.type == 1) {
+                        return <GroupLeftTab handlekey={this.handlekey} />;
+                    } else {
+                        return <LeftTab handlekey={this.handlekey} />;
                     };
                 })()}
                 <div className="content-right">

+ 28 - 0
js/component/dataDic.js

@@ -737,5 +737,33 @@ module.exports = {
             value: "5",
             key: "国际领先"
         }
+    ],
+    //订单状态列表
+    orderStatusList:[
+        {
+            value: "0",
+            key: "初始意向"
+        }, {
+            value: "1",
+            key: "交付意向金"
+        }, {
+            value: "2",
+            key: "签订合同"
+        }, {
+            value: "3",
+            key: "交付合同金"
+        }, {
+            value: "4",
+            key: "交付佣金"
+        }, {
+            value: "5",
+            key: "交付服务金"
+        }, {
+            value: "6",
+            key: "关闭(未签合同)"
+        }, {
+            value: "7",
+            key: "关闭(已签合同)"
+        }
     ]
 };

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

@@ -136,6 +136,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
         return {
             visible: false,
             loading: false,
+            buttonLoading: false,
             textFileList: [],
             techPlanFileList: [],
             businessPlanFileList: [],
@@ -251,6 +252,29 @@ const AchievementDetailShow = Form.create()(React.createClass({
             };
         });
     },
+    buildMatchList() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/achievement/matchDemand',
+            data: {
+                id: this.props.data.id,
+            }
+        }).done(function (data) {
+            this.setState({
+                buttonLoading: false
+            });
+            if (!data.error.length) {
+                message.success('匹配完成!匹配到' + data.data + '条记录');
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
     componentWillMount() {
         if (this.props.data.id) {
             this.loadData(this.props.data.id);
@@ -622,6 +646,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                     <FormItem wrapperCol={{ span: 12, offset: 4 }}>
                         {theData.auditStatus == 2 ? <Button className="set-submit" type="primary" htmlType="submit">保存</Button> : <span></span>}
                         <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
+                        {window.showAuditStatus ? <Button className="set-submit" loading={this.state.buttonLoading} type="primary" onClick={this.buildMatchList}>生成匹配列表</Button> : <span></span>}
                     </FormItem>
                     <Modal maskClosable={false} title="确认"
                         visible={this.state.formSubmitVisible}
@@ -680,7 +705,7 @@ 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") {
+                if (thisData.ownerType == "1" && thisData.ownerId) {
                     this.getContactsList(thisData.ownerId);
                 };
             }.bind(this),
@@ -834,6 +859,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         technicalPictureUrl: theTechnicalPictureUrl,
                         fieldA: values.field ? values.field[0] : undefined,
                         fieldB: values.field ? values.field[1] : undefined,
+                        contacts: values.contacts,
                         maturity: values.maturity,
                         maturityPictureUrl: theMaturityPictureUrl,
                         maturityTextFileUrl: this.state.maturityTextFileUrl,

+ 28 - 4
js/component/manageCenter/demand/techDemandDesc.jsx

@@ -279,6 +279,29 @@ const DemandDetailShow = Form.create()(React.createClass({
             };
         });
     },
+    buildMatchList() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/demand/matchAchievement',
+            data: {
+                id: this.props.data.id,
+            }
+        }).done(function (data) {
+            this.setState({
+                buttonLoading: false
+            });
+            if (!data.error.length) {
+                message.success('匹配完成!匹配到' + data.data + '条记录');
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
     componentWillMount() {
         if (this.props.data.id) {
             this.loadData(this.props.data.id, this.props.detailApiUrl);
@@ -562,6 +585,7 @@ const DemandDetailShow = Form.create()(React.createClass({
                     <FormItem wrapperCol={{ span: 12, offset: 3 }}>
                         {theData.auditStatus == 2 ? <Button className="set-submit" type="primary" htmlType="submit">保存</Button> : <span></span>}
                         <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
+                        {window.showAuditStatus ? <Button className="set-submit" loading={this.state.buttonLoading} type="primary" onClick={this.buildMatchList}>生成匹配列表</Button> : <span></span>}
                     </FormItem>
                     <Modal maskClosable={false} title="确认"
                         visible={this.state.formSubmitVisible}
@@ -723,13 +747,13 @@ const DemandDetailForm = Form.create()(React.createClass({
                     this.state.auditStatus = 0;
                     if (!data.error.length) {
                         message.success('保存成功!');
-                        this.setState({
-                            visible: false
-                        });
                         this.props.handleOk();
                     } else {
                         message.warning(data.error[0].message);
-                    }
+                    };
+                    this.setState({
+                        loading: false
+                    });
                 }.bind(this));
             }
         });

+ 4 - 1
js/component/portal/portal.less

@@ -101,8 +101,11 @@
         margin-bottom: 16px;
     }
     .interest {
-        a,button {
+        a,
+        button {
             float: right;
+            padding-right: 50px;
+            line-height: 18px;
             i {
                 vertical-align: middle;
             }

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

@@ -229,6 +229,7 @@ const Content = React.createClass({
         this.state.categoryRadio = theCategoryArr;
         this.state.transferModeRadio = theTransferModeArr;
         this.state.maturityRadio = theMaturityArr;
+        this.loadData();
     },
     industryChange(e) {
         let theArr = [];

+ 160 - 15
js/component/portal/search/achievementDesc.jsx

@@ -1,10 +1,10 @@
 import React from 'react';
-import { Icon, Modal, message, Spin, Button, Row, Col, Upload, Tooltip, Tag } from 'antd';
+import { Icon, Modal, message, Spin, Button, Row, Col, Upload, Tooltip, Tag, Table, Input } from 'antd';
 import '../portal.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { getIndustryCategory } from '../../DicIndustryList.js';
-import { getAchievementCategory, getMaturity, getInnovation } from '../../tools.js';
+import { getAchievementCategory, getMaturity, getInnovation, getOrderStatus, beforeUploadFile } from '../../tools.js';
 
 
 const AchievementDetail = React.createClass({
@@ -12,9 +12,28 @@ const AchievementDetail = React.createClass({
         return {
             visible: false,
             loading: false,
+            buttonLoading: false,
+            dataSourse: [],
+            orderVisible: false,
             tags: [],
             technicalPictureUrl: [],
             maturityPictureUrl: [],
+            columns: [
+                {
+                    title: '状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: (text) => { return getOrderStatus(text) }
+                }, {
+                    title: '处理时间',
+                    dataIndex: 'recordTimeFormattedDate',
+                    key: 'recordTimeFormattedDate',
+                }, {
+                    title: '备注',
+                    dataIndex: 'comment',
+                    key: 'comment',
+                }
+            ]
         };
     },
     handleCancel(e) {
@@ -53,6 +72,45 @@ const AchievementDetail = React.createClass({
             });
         }.bind(this));
     },
+    loadLogsData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/achievementOrderLog',
+            data: {
+                achievementOrderId: id
+            },
+            success: function (data) {
+                let thisData = data.data, theArr = [];
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    thisData.map(function (item, i) {
+                        theArr.push({
+                            key: i,
+                            recordTime: item.recordTime,
+                            recordTimeFormattedDate: item.recordTimeFormattedDate,
+                            status: item.status,
+                            comment: item.comment
+                        })
+                    });
+                };
+                this.setState({
+                    dataSourse: theArr
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
     interestClick() {
         this.setState({
             loading: true
@@ -103,10 +161,63 @@ const AchievementDetail = React.createClass({
             });
         }.bind(this));;
     },
+    handleSubmit() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/orderAchievement',
+            data: {
+                achievementId: this.state.data.id,
+                comment: this.state.comment
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else { message.success("提交成功!") };
+            }.bind(this),
+        }).always(function () {
+            this.loadData(this.state.data.id);
+            this.setState({
+                orderVisible: false,
+                buttonLoading: false
+            });
+        }.bind(this));
+    },
+    cancelSubmit() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/achievementShutdown',
+            data: {
+                id: this.state.data.achievementOrderId
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else { message.success("撤销成功!") };
+            }.bind(this),
+        }).always(function () {
+            this.loadData(this.state.data.id);
+            this.setState({
+                buttonLoading: false
+            });
+        }.bind(this));
+    },
     componentWillReceiveProps(nextProps) {
         if (!this.props.showDesc && nextProps.showDesc) {
             if (nextProps.data.id) {
                 this.loadData(nextProps.data.id);
+                if (nextProps.data.orderId) {
+                    this.loadLogsData(nextProps.data.orderId)
+                }
             } else {
                 this.state.data = {};
                 this.state.tags = [];
@@ -119,14 +230,18 @@ const AchievementDetail = React.createClass({
         const theData = this.state.data || {};
         if (this.props.data) {
             return (
-                <Spin spinning={this.state.loading} className="portal-desc">
-                    <Modal maskClosable={false}
-                        visible={this.props.showDesc}
-                        onCancel={this.handleCancel}
-                        title={"成果详情"}
-                        width='1000px'
-                        footer=''
-                        className="portal-desc-content">
+                <Modal maskClosable={false}
+                    visible={this.props.showDesc}
+                    onCancel={this.handleCancel}
+                    title={<div className="interest clearfix">
+                        <span>成果详情</span>
+                        {theData.achievementInterestId ? <a onClick={this.cancelInterestClick}><Icon type="heart" /> 不感兴趣</a>
+                            : <a onClick={this.interestClick}><Icon type="heart-o" /> 感兴趣</a>}
+                    </div>}
+                    width='1000px'
+                    footer=''
+                    className="portal-desc-content">
+                    <Spin spinning={this.state.loading} className="portal-desc">
                         <Row>
                             <Col span={4}>编号</Col>
                             <Col span={8}>{theData.serialNumber}</Col>
@@ -316,12 +431,42 @@ const AchievementDetail = React.createClass({
                                     : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}
                             </Col>
                         </Row>
-                        <div className="interest clearfix">
-                            {theData.achievementInterestId ? <a onClick={this.cancelInterestClick}><Icon type="heart" /> 不感兴趣</a>
-                                : <a onClick={this.interestClick}><Icon type="heart-o" /> 感兴趣</a>}
+                        {this.props.data.orderId ? <div>
+                            <p>状态流转记录: </p>
+                            <Table style={{ margin: '10px 0', background: "#eee" }}
+                                pagination={false}
+                                dataSource={this.state.dataSource}
+                                columns={this.state.columns} />
+                        </div> : <div></div>}
+                        <div>
+                            {theData.achievementOrderId ? <Button type="ghost" loading={this.state.buttonLoading}
+                                disabled={Boolean(theData.orderStatus != "0")}
+                                onClick={this.cancelSubmit}>我要撤销</Button>
+                                : <Button type="primary" onClick={() => {
+                                    if (window.userData.number) {
+                                        this.setState({ orderVisible: true });
+                                    } else {
+                                        message.warning("请先登录!");
+                                    }
+                                }}>我要购买</Button>}
+                            <Modal maskClosable={false}
+                                title="我要购买"
+                                width={600}
+                                style={{ 'top': '160px' }}
+                                visible={this.state.orderVisible}
+                                footer={null}
+                                onCancel={() => { this.setState({ orderVisible: false }); }}>
+                                <Row>
+                                    <Col span={2}>备注 : </Col>
+                                    <Col span={22}>
+                                        <Input type="textarea" rows={4} onChange={(e) => { this.state.comment = e.target.value }} />
+                                    </Col>
+                                </Row>
+                                <Button loading={this.state.buttonLoading} style={{ marginTop: '20px' }} type="primary" onClick={this.handleSubmit}>提交</Button>
+                            </Modal>
                         </div>
-                    </Modal>
-                </Spin>
+                    </Spin>
+                </Modal>
             );
         } else {
             return <div></div>

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

@@ -195,6 +195,7 @@ const Content = React.createClass({
         });
         this.state.industryRadioA = theArr;
         this.state.demandTypeRadio = demandArr;
+        this.loadData();
     },
     industryChange(e) {
         let theArr = [];

+ 190 - 15
js/component/portal/search/demandDesc.jsx

@@ -1,10 +1,10 @@
 import React from 'react';
-import { Icon, Modal, message, Spin, Button, Row, Col, Upload, Tooltip, Tag } from 'antd';
+import { Icon, Modal, message, Spin, Button, Row, Col, Upload, Tooltip, Tag, Input, Table } from 'antd';
 import '../portal.less';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { getIndustryCategory } from '../../DicIndustryList.js';
-import { getDemandType } from '../../tools.js';
+import { getDemandType, beforeUploadFile, getOrderStatus } from '../../tools.js';
 
 
 const DemandDetail = React.createClass({
@@ -12,8 +12,28 @@ const DemandDetail = React.createClass({
         return {
             visible: false,
             loading: false,
+            buttonLoading: false,
+            dataSourse: [],
+            orderVisible: false,
+            fileList: false,
             tags: [],
             pictureUrl: [],
+            columns: [
+                {
+                    title: '状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: (text) => { return getOrderStatus(text) }
+                }, {
+                    title: '处理时间',
+                    dataIndex: 'recordTimeFormattedDate',
+                    key: 'recordTimeFormattedDate',
+                }, {
+                    title: '备注',
+                    dataIndex: 'comment',
+                    key: 'comment',
+                }
+            ]
         };
     },
     handleCancel(e) {
@@ -51,6 +71,45 @@ const DemandDetail = React.createClass({
             });
         }.bind(this));
     },
+    loadLogsData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/demandOrderLog',
+            data: {
+                demandOrderId: id
+            },
+            success: function (data) {
+                let thisData = data.data, theArr = [];
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    thisData.map(function (item, i) {
+                        theArr.push({
+                            key: i,
+                            recordTime: item.recordTime,
+                            recordTimeFormattedDate: item.recordTimeFormattedDate,
+                            status: item.status,
+                            comment: item.comment
+                        })
+                    });
+                };
+                this.setState({
+                    dataSourse: theArr
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
     interestClick() {
         this.setState({
             loading: true
@@ -101,10 +160,64 @@ const DemandDetail = React.createClass({
             });
         }.bind(this));;
     },
+    handleSubmit() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/orderDemand',
+            data: {
+                demandId: this.state.data.id,
+                enclosureUrl: this.state.enclosureUrl,
+                comment: this.state.comment
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else { message.success("提交成功!") };
+            }.bind(this),
+        }).always(function () {
+            this.loadData(this.state.data.id);
+            this.setState({
+                orderVisible: false,
+                buttonLoading: false
+            });
+        }.bind(this));
+    },
+    cancelSubmit() {
+        this.setState({
+            buttonLoading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/portal/order/demandShutdown',
+            data: {
+                id: this.state.data.demandOrderId
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else { message.success("撤销成功!") };
+            }.bind(this),
+        }).always(function () {
+            this.loadData(this.state.data.id);
+            this.setState({
+                buttonLoading: false
+            });
+        }.bind(this));
+    },
     componentWillReceiveProps(nextProps) {
         if (!this.props.showDesc && nextProps.showDesc) {
             if (nextProps.data.id) {
                 this.loadData(nextProps.data.id);
+                if (nextProps.data.orderId) {
+                    this.loadLogsData(nextProps.data.orderId)
+                }
             } else {
                 this.state.data = {};
                 this.state.tags = [];
@@ -116,14 +229,18 @@ const DemandDetail = React.createClass({
         const theData = this.state.data || {};
         if (this.props.data) {
             return (
-                <Spin spinning={this.state.loading} className="portal-desc">
-                    <Modal maskClosable={false}
-                        visible={this.props.showDesc}
-                        onCancel={this.handleCancel}
-                        title="需求详情"
-                        width='1000px'
-                        footer=''
-                        className="portal-desc-content">
+                <Modal maskClosable={false}
+                    visible={this.props.showDesc}
+                    onCancel={this.handleCancel}
+                    title={<div className="interest clearfix">
+                        <span>需求详情</span>
+                        {theData.demandInterestId ? <a onClick={this.cancelInterestClick}><Icon type="heart" /> 不感兴趣</a>
+                            : <a onClick={this.interestClick}><Icon type="heart-o" /> 感兴趣</a>}
+                    </div>}
+                    width='1000px'
+                    footer=''
+                    className="portal-desc-content">
+                    <Spin spinning={this.state.loading} className="portal-desc">
                         <Row>
                             <Col span={4}>编号</Col>
                             <Col span={8}>{theData.serialNumber}</Col>
@@ -221,12 +338,70 @@ const DemandDetail = React.createClass({
                             <Col span={4}>固定方案</Col>
                             <Col span={20}>{theData.fixedScheme}</Col>
                         </Row>
-                        <div className="interest clearfix">
-                            {theData.demandInterestId ? <a onClick={this.cancelInterestClick}><Icon type="heart" /> 不感兴趣</a>
-                                : <a onClick={this.interestClick}><Icon type="heart-o" /> 感兴趣</a>}
+                        {this.props.data.orderId ? <div>
+                            <p>状态流转记录: </p>
+                            <Table style={{ margin: '10px 0', background: "#eee" }}
+                                pagination={false}
+                                dataSource={this.state.dataSource}
+                                columns={this.state.columns} />
+                        </div> : <div></div>}
+                        <div>
+                            {theData.demandOrderId ? <Button type="ghost" loading={this.state.buttonLoading}
+                                disabled={Boolean(theData.orderStatus != "0")}
+                                onClick={this.cancelSubmit}>我要撤销</Button>
+                                : <Button type="primary" onClick={() => {
+                                    if (window.userData.number) {
+                                        this.setState({ orderVisible: true });
+                                    } else {
+                                        message.warning("请先登录!");
+                                    }
+                                }}>我要接单</Button>}
+                            <Modal maskClosable={false}
+                                title="我要接单"
+                                width={600}
+                                style={{ 'top': '160px' }}
+                                visible={this.state.orderVisible}
+                                footer={null}
+                                onCancel={() => { this.setState({ orderVisible: false }); }}>
+                                <Row>
+                                    <Col span={2}>附件 : </Col>
+                                    <Col span={8}>
+                                        <Upload action={globalConfig.context + "/api/user/portal/order/demandUpload"}
+                                            data={{ 'sign': 'demand_order_file' }}
+                                            beforeUpload={beforeUploadFile}
+                                            fileList={this.state.fileList}
+                                            onChange={(info) => {
+                                                if (info.file.status !== 'uploading') {
+                                                    console.log(info.file, info.fileList);
+                                                }
+                                                if (info.file.status === 'done') {
+                                                    if (!info.file.response.error.length) {
+                                                        message.success(`${info.file.name} 文件上传成功!`);
+                                                    } else {
+                                                        message.warning(info.file.response.error[0].message);
+                                                        return;
+                                                    };
+                                                    this.state.enclosureUrl = info.file.response.data;
+                                                } else if (info.file.status === 'error') {
+                                                    message.error(`${info.file.name} 文件上传失败。`);
+                                                };
+                                                this.setState({ fileList: info.fileList.slice(-1) });
+                                            }} >
+                                            <Button><Icon type="upload" /> 上传相关资质附件 </Button>
+                                        </Upload>
+                                    </Col>
+                                </Row>
+                                <Row style={{ marginTop: '20px' }} >
+                                    <Col span={2}>备注 : </Col>
+                                    <Col span={22}>
+                                        <Input type="textarea" rows={4} onChange={(e) => { this.state.comment = e.target.value }} />
+                                    </Col>
+                                </Row>
+                                <Button loading={this.state.buttonLoading} style={{ marginTop: '20px' }} type="primary" onClick={this.handleSubmit}>提交</Button>
+                            </Modal>
                         </div>
-                    </Modal>
-                </Spin>
+                    </Spin>
+                </Modal>
             );
         } else {
             return <div></div>

+ 4 - 2
js/component/portal/top.jsx

@@ -1,6 +1,8 @@
 import React from 'react';
 import './portal.less';
 import logo from '../../../image/logo.jpg';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
 
 const LoginTop = React.createClass({
     logOut() {
@@ -23,9 +25,9 @@ const LoginTop = React.createClass({
                         <span className="text">科技{this.props.searchType}搜索</span>
                         <span className="alink">
                             <a href={globalConfig.context + "/user/account/index.html"}>返回首页</a>
-                            {window.userData ?
+                            {window.userData.nickname ?
                                 <span>
-                                    <a href={globalConfig.context + "/user/account/index"}>尊敬的{userData.nickname || userData.number || this.state.username}</a>
+                                    <a href={globalConfig.context + "/user/account/index"}>尊敬的{userData.nickname || userData.number}</a>
                                     <a href="./index.html">交易管理中心</a>
                                     <a href="./index.html">消息</a>
                                 </span>

+ 14 - 1
js/component/tools.js

@@ -26,7 +26,8 @@ import {
     techAuditStatusList,
     maturityList,
     transferModeList,
-    innovationList
+    innovationList,
+    orderStatusList,
 } from './dataDic.js';
 import { provinceList } from './DicProvinceList.js';
 import { techFieldList } from './DicTechFieldList.js'
@@ -727,5 +728,17 @@ module.exports = {
             });
             return theType;
         }
+    },
+    //获取创新度状态
+    getOrderStatus: function (e) {
+        if (e) {
+            let theType = '';
+            orderStatusList.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
     }
 }

+ 1 - 1
package.json

@@ -13,7 +13,7 @@
     "buildtest": "webpack --progress --colors --env.deploy test",
     "buildstage": "webpack --progress --colors --env.deploy stage",
     "pro": "webpack --progress --colors --env.deploy prod",
-    "dev": "webpack-dev-server --port 8088 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
+    "dev": "webpack-dev-server --port 80 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
   },
   "repository": {
     "type": "git",

+ 24 - 24
webpack/entry.config.js

@@ -29,103 +29,103 @@ module.exports = {
     'admin/achievement': './js/admin/achievement.js'
   },
   watch: {
-    'user/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/index.js'
     ],
-    'user/login': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/login.js'
     ],
-    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/signIn.js'
     ],
-    'user/certify': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/certify': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/certify.js'
     ],
-    'user/groupCertify': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/groupCertify': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/groupCertify.js'
     ],
     //user-account
-    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/index.js'
     ],
-    'user/account/set': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/account/set': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/set.js'
     ],
-    'user/account/services': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/account/services': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/services.js'
     ],
-    'user/account/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/account/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/achievement.js'
     ],
-    'user/account/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'user/account/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/demand.js'
     ],
     //admin
-    'admin/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/index.js'
     ],
-    'admin/login': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/login.js'
     ],
-    'admin/userManage': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/userManage': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/userManage.js'
     ],
-    'admin/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/demand.js'
     ],
-    'admin/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/achievement.js'
     ],
-    'admin/set': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/set': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/set.js'
     ],
     //admin-servicesManage
-    'admin/servicesManage/contract': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/contract': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/contract.js'
     ],
-    'admin/servicesManage/patent': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/patent': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/patent.js'
     ],
-    'admin/servicesManage/copyright': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/copyright': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/copyright.js'
     ],
-    'admin/servicesManage/highTech': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/highTech': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/highTech.js'
     ],
-    'admin/servicesManage/highTechInfo': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/highTechInfo': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/highTechInfo.js'
     ],
-    'admin/servicesManage/technology': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'admin/servicesManage/technology': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/technology.js'
     ],
     //portal  门户
-    'portal/search/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'portal/search/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/portal/search/demand.js'
     ],
-    'portal/search/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
+    'portal/search/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/portal/search/achievement.js'
     ],