|
@@ -1,10 +1,10 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Modal, message, Spin, Input, Select, DatePicker, Button, Row, Col, Table, Form } from 'antd';
|
|
|
+import { Icon, Modal, message, Spin, Input, Select, DatePicker, Button, Row, Col, Table, Form, Upload } from 'antd';
|
|
|
import './comprehensive.less';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import { copyrightStateList } from '../../../dataDic.js';
|
|
|
-import { getCopyrightState, getTime } from '../../../tools.js';
|
|
|
+import { getCopyrightState, getTime, downloadFile, beforeUploadFile } from '../../../tools.js';
|
|
|
|
|
|
const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
@@ -12,11 +12,12 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
stateOption: [],
|
|
|
+ stateTable: [],
|
|
|
contactsOption: [],
|
|
|
stateColumns: [{
|
|
|
title: '申请状态',
|
|
|
- dataIndex: 'state',
|
|
|
- key: 'state',
|
|
|
+ dataIndex: 'status',
|
|
|
+ key: 'status',
|
|
|
render: (text) => { return getCopyrightState(text) }
|
|
|
}, {
|
|
|
title: '处理时间',
|
|
@@ -44,66 +45,105 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
<Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
|
|
|
)
|
|
|
});
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
- loadData(uid, cid, year) {
|
|
|
+ loadData(uid, id) {
|
|
|
+ debugger
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
|
$.when($.ajax({
|
|
|
- method: "post",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/cognizanceLog",
|
|
|
+ cache: false,
|
|
|
+ url: globalConfig.context + "/api/admin/copyright/logs",
|
|
|
data: {
|
|
|
- pid: this.state.xid
|
|
|
+ id: id || this.props.data.id
|
|
|
}
|
|
|
}), $.ajax({
|
|
|
- method: "get",
|
|
|
+ method: "post",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/getContacts"
|
|
|
+ cache: false,
|
|
|
+ url: globalConfig.context + "/api/admin/getContacts",
|
|
|
+ data: {
|
|
|
+ uid: uid || this.props.data.uid
|
|
|
+ }
|
|
|
}), $.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/getContacts",
|
|
|
+ cache: false,
|
|
|
+ url: globalConfig.context + "/api/admin/copyright/detail",
|
|
|
+ data: {
|
|
|
+ id: id || this.props.data.id
|
|
|
+ }
|
|
|
})).done((data1, data2, data3) => {
|
|
|
+ let _me = this;
|
|
|
//状态流转table
|
|
|
- if (data1[0].error.length) {
|
|
|
+ if (data1[0].error && data1[0].error.length) {
|
|
|
message.warning(data1[0].error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
- let _me = this;
|
|
|
this.state.stateTable = [];
|
|
|
- data1[0].data.map(function (item) {
|
|
|
- this.state.stateTable.push({
|
|
|
+ data1[0].data.map(function (item, i) {
|
|
|
+ _me.state.stateTable.push({
|
|
|
key: i,
|
|
|
recordTimeFormattedDate: item.recordTimeFormattedDate,
|
|
|
- state: item.state,
|
|
|
+ status: item.status,
|
|
|
principal: item.principal,
|
|
|
operator: item.operator,
|
|
|
comment: item.comment
|
|
|
});
|
|
|
});
|
|
|
//获取联系人
|
|
|
- if (data2[0].error.length) {
|
|
|
+ if (data2[0].error && data2[0].error.length) {
|
|
|
message.warning(data2[0].error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
this.state.contactsOption = [];
|
|
|
for (let item in data2[0].data) {
|
|
|
let theData = data2[0].data[item];
|
|
|
- contactsOption.push(
|
|
|
+ _me.state.contactsOption.push(
|
|
|
<Select.Option value={item} key={theData}>{theData}</Select.Option>
|
|
|
);
|
|
|
};
|
|
|
//获取详细数据
|
|
|
- if (data3[0].error.length || !data3[0].data) {
|
|
|
+ if (!data3[0].data && data3[0].error && data3[0].error.length) {
|
|
|
+ message.warning(data3[0].error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
- let thisdata = data3[0].data;
|
|
|
+ let detailData = data3[0].data;
|
|
|
this.setState({
|
|
|
-
|
|
|
+ id: detailData.id,
|
|
|
+ province: detailData.province,
|
|
|
+ unitName: detailData.unitName,
|
|
|
+ serialNumber: detailData.serialNumber,
|
|
|
+ createTime: detailData.createTime,
|
|
|
+ acceptTime: detailData.acceptTime,
|
|
|
+ principal: detailData.principal,
|
|
|
+ contact: detailData.contact,
|
|
|
+ copyrightName: detailData.copyrightName,
|
|
|
+ status: detailData.status,
|
|
|
+ comment: detailData.comment,
|
|
|
+ workIssue: detailData.workIssue,
|
|
|
+ outsource: detailData.outsource,
|
|
|
+ inUrgent: detailData.inUrgent,
|
|
|
+ authorizedDate: detailData.authorizedDate,
|
|
|
+ fisrtContact: detailData.fisrtContact,
|
|
|
+ secondContact: detailData.secondContact,
|
|
|
+ thirdContact: detailData.thirdContact,
|
|
|
+ city: detailData.city,
|
|
|
+ area: detailData.area,
|
|
|
+ postcode: detailData.postcode,
|
|
|
+ certificateUrl: detailData.certificateUrl,
|
|
|
+ applicationUrl: detailData.applicationUrl,
|
|
|
+ certificateUrlDownloadFileName: detailData.certificateUrlDownloadFileName,
|
|
|
+ applicationUrlDownloadFileName: detailData.applicationUrlDownloadFileName,
|
|
|
+ authorizedDateFormattedDate: detailData.authorizedDateFormattedDate,
|
|
|
+ createTimeFormattedDate: detailData.createTimeFormattedDate,
|
|
|
+ acceptTimeFormattedDate: detailData.acceptTimeFormattedDate,
|
|
|
});
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -112,10 +152,9 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- if (!this.state.visible && nextProps.showDesc) {
|
|
|
- this.loadData();
|
|
|
+ if (!this.props.visible && nextProps.visible) {
|
|
|
+ this.loadData(nextProps.data.uid, nextProps.data.id);
|
|
|
};
|
|
|
- this.state.visible = nextProps.showDesc;
|
|
|
},
|
|
|
handleSubmit(e) {
|
|
|
e.preventDefault();
|
|
@@ -132,29 +171,27 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/disposeCognizanceDetail",
|
|
|
+ url: globalConfig.context + "/api/admin/copyright/modify",
|
|
|
data: {
|
|
|
- id: this.props.data.cid,
|
|
|
- uid: this.props.data.uid,
|
|
|
- technicalField1: values.technicalField[0],
|
|
|
- technicalField2: values.technicalField[1],
|
|
|
- technicalField3: values.technicalField[2],
|
|
|
- basicResearchCost: values.basicResearchCost,
|
|
|
- contacts: values.contacts,
|
|
|
- accident: values.accident,
|
|
|
- certificateNumber: values.certificateNumber,
|
|
|
- recordTimeFormattedDate: values.recordTime ? values.recordTime.format("YYYY-MM-DD") : undefined,
|
|
|
- state: values.state,
|
|
|
- principal: values.principal,
|
|
|
- comment: values.comment,
|
|
|
+ "id": this.props.data.id,
|
|
|
+ "contact": values.contact, // 联系人, 1,2,3
|
|
|
+ //"copyrightInfo": values.copyrightInfo, // 软著简介,size 0-255
|
|
|
+ "copyrightName": values.copyrightName, // 软著名称, size 0-60
|
|
|
+ "outsource": values.outsource, // 外包公司, size 0-60
|
|
|
+ "workIssue": values.workIssue, // 派单信息, size 0-128
|
|
|
+ "inUrgent": values.inUrgent, // 加急天数,
|
|
|
+ "status": values.status, // 状态
|
|
|
+ "comment": values.comment, // 备注 size 0-128
|
|
|
+ "recordTime": values.recordTime ? values.recordTime.format("YYYY-MM-DD HH:mm:ss") : undefined, // 状态修改时间 yyyy-MM-dd HH:mm:ss
|
|
|
+ "principal": values.principal, // 负责人id
|
|
|
+ "": this.state.copyrightApplyUrl, //申请书
|
|
|
+ "": this.state.copyrightAuthUrl //证书
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
|
message.success('保存成功!');
|
|
|
this.props.clickOk();
|
|
|
this.props.form.resetFields();
|
|
|
- this.state.targetKeys = [];
|
|
|
- this.state.selectedKeys = [];
|
|
|
this.props.spinState(false);
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
@@ -167,8 +204,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
render() {
|
|
|
const FormItem = Form.Item;
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
- //const theData = this.state.data;
|
|
|
- const theData = {};
|
|
|
+ const theData = this.state;
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 6 },
|
|
|
wrapperCol: { span: 12 },
|
|
@@ -178,18 +214,18 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
<Form onSubmit={this.handleSubmit} id="CopyrightDesc-form">
|
|
|
<Row className="express-desc-row">
|
|
|
<Col span={4}>公司名称</Col>
|
|
|
- <Col span={4}>{theData.nuitName}</Col>
|
|
|
+ <Col span={4}>{theData.unitName}</Col>
|
|
|
<Col span={4}>公司组织机构代码</Col>
|
|
|
<Col span={4}>{theData.unitNumber}</Col>
|
|
|
</Row>
|
|
|
<Row className="express-desc-row">
|
|
|
<Col span={4}>公司地址</Col>
|
|
|
- <Col span={4}>{theData.address}</Col>
|
|
|
+ <Col span={4}>{theData.province}/{theData.city}/{theData.area}</Col>
|
|
|
<Col span={4}>联系人</Col>
|
|
|
<Col span={4}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
+ {getFieldDecorator('contact', {
|
|
|
rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
- initialValue: theData.contacts
|
|
|
+ initialValue: theData.contact
|
|
|
})(
|
|
|
<Select
|
|
|
style={{ display: 'inline-block', width: '200px' }}
|
|
@@ -201,11 +237,11 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
</Row>
|
|
|
<Row className="express-desc-row">
|
|
|
<Col span={4}>编号</Col>
|
|
|
- <Col span={4}>xxxxxx</Col>
|
|
|
+ <Col span={4}>{theData.serialNumber}</Col>
|
|
|
<Col span={4}>外包公司</Col>
|
|
|
<Col span={4}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
- initialValue: theData.contacts
|
|
|
+ {getFieldDecorator('outsource', {
|
|
|
+ initialValue: theData.outsource
|
|
|
})(
|
|
|
<Input placeholder="请输入外包公司" />
|
|
|
)}
|
|
@@ -214,20 +250,8 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
<Row className="express-desc-row">
|
|
|
<Col span={3}>派单详情</Col>
|
|
|
<Col span={16}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
- initialValue: theData.contacts
|
|
|
- })(
|
|
|
- <Input type="textarea"
|
|
|
- placeholder="多行输入"
|
|
|
- rows={6} />
|
|
|
- )}
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- <Row className="express-desc-row">
|
|
|
- <Col span={3}>备注</Col>
|
|
|
- <Col span={16}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
- initialValue: theData.contacts
|
|
|
+ {getFieldDecorator('workIssue', {
|
|
|
+ initialValue: theData.workIssue
|
|
|
})(
|
|
|
<Input type="textarea"
|
|
|
placeholder="多行输入"
|
|
@@ -238,23 +262,95 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
<Row className="express-desc-row">
|
|
|
<Col span={3}>软著名称</Col>
|
|
|
<Col span={6}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
- initialValue: theData.contacts
|
|
|
+ {getFieldDecorator('copyrightName', {
|
|
|
+ initialValue: theData.copyrightName
|
|
|
})(
|
|
|
<Input placeholder="请输入软著名称" />
|
|
|
)}
|
|
|
</Col>
|
|
|
</Row>
|
|
|
<Row className="express-desc-row">
|
|
|
- <Col span={3}>下证时间(预计)</Col>
|
|
|
+ <Col span={3}>加急天数</Col>
|
|
|
<Col span={6}>
|
|
|
- {getFieldDecorator('contacts', {
|
|
|
- initialValue: theData.contacts
|
|
|
+ {getFieldDecorator('inUrgent', {
|
|
|
+ initialValue: theData.inUrgent ? String(theData.inUrgent) : undefined
|
|
|
})(
|
|
|
- <DatePicker />
|
|
|
+ <Select
|
|
|
+ placeholder="请选择加急时间"
|
|
|
+ style={{ width: 120 }}>
|
|
|
+ <Select.Option value="0">不加急</Select.Option>
|
|
|
+ <Select.Option value="3">3天</Select.Option>
|
|
|
+ <Select.Option value="5">5天</Select.Option>
|
|
|
+ <Select.Option value="10">10天</Select.Option>
|
|
|
+ <Select.Option value="20">20天</Select.Option>
|
|
|
+ </Select>
|
|
|
)}
|
|
|
</Col>
|
|
|
</Row>
|
|
|
+ {theData.authorizedDateFormattedDate ? <Row className="express-desc-row">
|
|
|
+ <Col span={3}>下证时间</Col>
|
|
|
+ <Col span={6}>{theData.authorizedDateFormattedDate}</Col>
|
|
|
+ </Row> :
|
|
|
+ <Row className="express-desc-row">
|
|
|
+ <Col span={3}>下证时间(预计)</Col>
|
|
|
+ <Col span={6}>{theData.authorizedDateFormattedDate}</Col>
|
|
|
+ </Row>}
|
|
|
+ <div className="hrSituation-roster">
|
|
|
+ <Upload
|
|
|
+ name="copyright_apply"
|
|
|
+ action={globalConfig.context + "/api/admin/copyright/upload"}
|
|
|
+ data={{ 'sign': 'copyright_apply', id: this.props.data.id }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
+ 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.copyrightApplyUrl = info.file.response.data;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ message.error(`${info.file.name} 文件上传失败。`);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button><Icon type="upload" /> 上传软著申请书 </Button>
|
|
|
+ </Upload>
|
|
|
+ <p style={{ margin: '10px 0' }}>{theData.applicationUrl ? <a onClick={downloadFile.bind(null, theData.applicationUrl, theData.applicationUrlDownloadFileName)}>{theData.applicationUrlDownloadFileName}</a> : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ </div>
|
|
|
+ <div className="hrSituation-roster">
|
|
|
+ <Upload
|
|
|
+ name="copyright_auth"
|
|
|
+ action={globalConfig.context + "/api/admin/copyright/upload"}
|
|
|
+ data={{ 'sign': 'copyright_auth', id: this.props.data.id }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
+ 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.copyrightAuthUrl = info.file.response.data;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ message.error(`${info.file.name} 文件上传失败。`);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button><Icon type="upload" /> 上传软著证书 </Button>
|
|
|
+ </Upload>
|
|
|
+ <p style={{ margin: '10px 0' }}>{theData.certificateUrl ? <a onClick={downloadFile.bind(null, theData.certificateUrl, theData.certificateUrlDownloadFileName)}>{theData.certificateUrlDownloadFileName}</a> : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ </div>
|
|
|
<p>状态流转记录: </p>
|
|
|
<Table style={{ margin: '10px 0' }}
|
|
|
pagination={false}
|
|
@@ -265,7 +361,7 @@ const CopyrightDescForm = Form.create()(React.createClass({
|
|
|
{...formItemLayout}
|
|
|
label="状态流转"
|
|
|
>
|
|
|
- {getFieldDecorator('state')(
|
|
|
+ {getFieldDecorator('status')(
|
|
|
<Select placeholder="选择一个状态">{this.state.stateOption}</Select>
|
|
|
)}
|
|
|
</FormItem>
|