|
@@ -56,10 +56,10 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
url: globalConfig.context + "/api/admin/activityCost",
|
|
|
data: {
|
|
|
id: this.props.data.id,
|
|
|
- aid: this.props.data.aid,
|
|
|
+ aid: this.props.data.aid || this.state.aid,
|
|
|
uid: this.props.uid,
|
|
|
activityNumber: this.state.activityNumber,
|
|
|
- year: this.state.year,
|
|
|
+ year: this.props.data.year || this.state.year,
|
|
|
|
|
|
internalLaborCost: values.internalLaborCost,
|
|
|
internalDirectCost: values.internalDirectCost,
|
|
@@ -71,8 +71,8 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
|
|
|
externalTotalCost: values.externalTotalCost,
|
|
|
externalAbroadCost: values.externalAbroadCost,
|
|
|
- enterpriseFiller: values.enterpriseFiller,
|
|
|
- signDateFormattedDate: values.signDate.format('YYYY-MM-DD'),
|
|
|
+ //enterpriseFiller: values.enterpriseFiller,
|
|
|
+ //signDateFormattedDate: values.signDate.format('YYYY-MM-DD'),
|
|
|
sortNumber: values.sortNumber,
|
|
|
accountUrl: this.state.accountUrl
|
|
|
}
|
|
@@ -113,7 +113,10 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
</Select>
|
|
|
}
|
|
|
<p className="activityCost-title">费用年份</p>
|
|
|
- <div><YearSelect defValue={this.state.year} handleyear={(e) => { this.state.year = e; }} /></div>
|
|
|
+ {
|
|
|
+ theData.year ? <span>{theData.year}</span> :
|
|
|
+ <YearSelect handleyear={(e) => { this.state.year = e; }} />
|
|
|
+ }
|
|
|
<p className="activityCost-title">内部研究开发费用(万元)</p>
|
|
|
<div className="clearfix activityCost-box">
|
|
|
<FormItem className="half-item"
|
|
@@ -241,28 +244,6 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
|
{...formItemLayout}
|
|
|
- label="企业填报人"
|
|
|
- >
|
|
|
- {getFieldDecorator('enterpriseFiller', {
|
|
|
- rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
- initialValue: theData.enterpriseFiller
|
|
|
- })(
|
|
|
- <Input />
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-item"
|
|
|
- {...formItemLayout}
|
|
|
- label="企业填报人签字日期"
|
|
|
- >
|
|
|
- {getFieldDecorator('signDate', {
|
|
|
- rules: [{ type: "object", required: true, message: '此项为必填项!' }],
|
|
|
- initialValue: theData.signDate ? moment(theData.signDate) : null
|
|
|
- })(
|
|
|
- <DatePicker onChange={(date, dateString) => { this.state.signDateFormattedDate = dateString }} />
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-item"
|
|
|
- {...formItemLayout}
|
|
|
label="排序号"
|
|
|
>
|
|
|
{getFieldDecorator('sortNumber', {
|
|
@@ -304,7 +285,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
<span className="download-file">
|
|
|
<a onClick={newDownloadFile.bind(null, this.props.data.id, 'activity_cost_account', '/api/admin/downloadActivityCost')}>{theData.accountDownloadFileName}</a>
|
|
|
<a onClick={() => {
|
|
|
- getPreview(theData.id, 'activityCost', 'activity_cost_account', function (data) { window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + globalConfig.context + "/open/preview?" + data)) });
|
|
|
+ var newTab = window.open('about:blank'); getPreview(theData.id, 'activityCost', 'activity_cost_account', function (data) { newTab.location.href = data; });
|
|
|
}}><Icon style={{ fontSize: '16px' }} type="eye-o" /></a>
|
|
|
</span>
|
|
|
: <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
@@ -401,66 +382,70 @@ const Activity = React.createClass({
|
|
|
})).done((data1, data2) => {
|
|
|
let data = data1[0];
|
|
|
let activityNumber = data2[0];
|
|
|
- if (data.error.length || !data.data || !data.data.list) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- return;
|
|
|
- };
|
|
|
- if (activityNumber.error.length || !activityNumber.data) {
|
|
|
- message.warning(activityNumber.error[0].message);
|
|
|
- return;
|
|
|
- };
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- this.state.data.push({
|
|
|
- key: i,
|
|
|
- id: thisdata.id,
|
|
|
- uid: thisdata.uid,
|
|
|
- aid: thisdata.aid,
|
|
|
- activityNumber: thisdata.activityNumber,
|
|
|
- year: thisdata.year,
|
|
|
- startDate: thisdata.startDate,
|
|
|
- endDate: thisdata.endDate,
|
|
|
+ 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];
|
|
|
+ this.state.data.push({
|
|
|
+ key: i,
|
|
|
+ id: thisdata.id,
|
|
|
+ uid: thisdata.uid,
|
|
|
+ aid: thisdata.aid,
|
|
|
+ activityNumber: thisdata.activityNumber,
|
|
|
+ year: thisdata.year,
|
|
|
+ startDate: thisdata.startDate,
|
|
|
+ endDate: thisdata.endDate,
|
|
|
|
|
|
- internalAllCost:
|
|
|
- thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
- thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
- thisdata.internalEquipmentCost + thisdata.internalOtherCost,
|
|
|
+ internalAllCost:
|
|
|
+ thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
+ thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
+ thisdata.internalEquipmentCost + thisdata.internalOtherCost,
|
|
|
|
|
|
- internalLaborCost: thisdata.internalLaborCost,
|
|
|
- internalDirectCost: thisdata.internalDirectCost,
|
|
|
- internalDepreciationCost: thisdata.internalDepreciationCost,
|
|
|
- internalAmortizationCost: thisdata.internalAmortizationCost,
|
|
|
- internalDesignCost: thisdata.internalDesignCost,
|
|
|
- internalEquipmentCost: thisdata.internalEquipmentCost,
|
|
|
- internalOtherCost: thisdata.internalOtherCost,
|
|
|
+ internalLaborCost: thisdata.internalLaborCost,
|
|
|
+ internalDirectCost: thisdata.internalDirectCost,
|
|
|
+ internalDepreciationCost: thisdata.internalDepreciationCost,
|
|
|
+ internalAmortizationCost: thisdata.internalAmortizationCost,
|
|
|
+ internalDesignCost: thisdata.internalDesignCost,
|
|
|
+ internalEquipmentCost: thisdata.internalEquipmentCost,
|
|
|
+ internalOtherCost: thisdata.internalOtherCost,
|
|
|
|
|
|
- externalTotalCost: thisdata.externalTotalCost,
|
|
|
- externalAbroadCost: thisdata.externalAbroadCost,
|
|
|
+ externalTotalCost: thisdata.externalTotalCost,
|
|
|
+ externalAbroadCost: thisdata.externalAbroadCost,
|
|
|
|
|
|
- allCost:
|
|
|
- thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
- thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
- thisdata.internalEquipmentCost + thisdata.internalOtherCost + thisdata.externalTotalCost,
|
|
|
+ allCost:
|
|
|
+ thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
|
|
|
+ thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
|
|
|
+ thisdata.internalEquipmentCost + thisdata.internalOtherCost + thisdata.externalTotalCost,
|
|
|
|
|
|
- enterpriseFiller: thisdata.enterpriseFiller,
|
|
|
- signDate: thisdata.signDate,
|
|
|
- signDateFormattedDate: thisdata.signDateFormattedDate,
|
|
|
+ //enterpriseFiller: thisdata.enterpriseFiller,
|
|
|
+ //signDate: thisdata.signDate,
|
|
|
+ //signDateFormattedDate: thisdata.signDateFormattedDate,
|
|
|
|
|
|
- sortNumber: thisdata.sortNumber,
|
|
|
+ sortNumber: thisdata.sortNumber,
|
|
|
|
|
|
- startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
- endDateFormattedDate: thisdata.endDateFormattedDate,
|
|
|
- accountDownloadFileName: thisdata.accountDownloadFileName,
|
|
|
- accountUrl: thisdata.accountUrl
|
|
|
+ startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
+ endDateFormattedDate: thisdata.endDateFormattedDate,
|
|
|
+ accountDownloadFileName: thisdata.accountDownloadFileName,
|
|
|
+ accountUrl: thisdata.accountUrl
|
|
|
+ });
|
|
|
+ };
|
|
|
+ this.state.pagination.current = data.data.pageNo;
|
|
|
+ this.state.pagination.total = data.data.totalCount;
|
|
|
+ this.setState({
|
|
|
+ dataSource: this.state.data,
|
|
|
+ pagination: this.state.pagination
|
|
|
});
|
|
|
};
|
|
|
- this.state.activityNumberList = activityNumber.data;
|
|
|
- this.state.pagination.current = data.data.pageNo;
|
|
|
- this.state.pagination.total = data.data.totalCount;
|
|
|
- this.setState({
|
|
|
- dataSource: this.state.data,
|
|
|
- pagination: this.state.pagination
|
|
|
- });
|
|
|
+ if (!activityNumber.data) {
|
|
|
+ if (activityNumber.error && activityNumber.error.length) {
|
|
|
+ message.warning(activityNumber.error[0].message);
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ this.state.activityNumberList = activityNumber.data;
|
|
|
+ };
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
|
loading: false
|
|
@@ -540,14 +525,6 @@ const Activity = React.createClass({
|
|
|
dataIndex: 'allCost',
|
|
|
key: 'allCost'
|
|
|
}, {
|
|
|
- title: '企业填报人',
|
|
|
- dataIndex: 'enterpriseFiller',
|
|
|
- key: 'enterpriseFiller'
|
|
|
- }, {
|
|
|
- title: '企业填报人签字日期',
|
|
|
- dataIndex: 'signDateFormattedDate',
|
|
|
- key: 'signDateFormattedDate'
|
|
|
- }, {
|
|
|
title: '排序号',
|
|
|
dataIndex: 'sortNumber',
|
|
|
key: 'sortNumber'
|