|
@@ -70,6 +70,42 @@ class newEditProject extends Component {
|
|
|
this.setValue();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取高新会员勾选类型
|
|
|
+ * @param {Array} checkTypeList 当前勾选的列表
|
|
|
+ * @returns {Array} newCheckType
|
|
|
+ */
|
|
|
+ getCheckTypeList(checkTypeList) {
|
|
|
+ let newCheckType = [];
|
|
|
+ // 高新会员
|
|
|
+ let htMember = 0;
|
|
|
+ // 加计扣除
|
|
|
+ let additionalDeduction = 0;
|
|
|
+ // 研发补助
|
|
|
+ let rdAwardsubsidy = 0;
|
|
|
+ checkTypeList.map(item => {
|
|
|
+ if (item.htMember == 1) {
|
|
|
+ htMember = 1;
|
|
|
+ }
|
|
|
+ if (item.additionalDeduction == 1) {
|
|
|
+ additionalDeduction = 1;
|
|
|
+ }
|
|
|
+ if (item.rdAwardsubsidy == 1) {
|
|
|
+ rdAwardsubsidy = 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (htMember) {
|
|
|
+ newCheckType.push(1);
|
|
|
+ }
|
|
|
+ if (additionalDeduction) {
|
|
|
+ newCheckType.push(2);
|
|
|
+ }
|
|
|
+ if (rdAwardsubsidy) {
|
|
|
+ newCheckType.push(3);
|
|
|
+ }
|
|
|
+ return newCheckType;
|
|
|
+ }
|
|
|
+
|
|
|
setValue() {
|
|
|
const { dataInfor, children = "splitList", type = "", readOnly } = this.props;
|
|
|
if (!(dataInfor && Object.keys(dataInfor).length > 0)) { return; }
|
|
@@ -114,18 +150,18 @@ class newEditProject extends Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let newCheckType = []
|
|
|
- if (dataInfor.projectType == 1) {
|
|
|
- if (dataInfor.htMember == 1) {
|
|
|
- newCheckType.push(1)
|
|
|
- }
|
|
|
- if (dataInfor.additionalDeduction == 1) {
|
|
|
- newCheckType.push(2)
|
|
|
- }
|
|
|
- if (dataInfor.rdAwardsubsidy == 1) {
|
|
|
- newCheckType.push(3)
|
|
|
- }
|
|
|
- }
|
|
|
+ let newCheckType = this.getCheckTypeList([dataInfor]);
|
|
|
+ // if (dataInfor.projectType == 1) {
|
|
|
+ // if (dataInfor.htMember == 1) {
|
|
|
+ // newCheckType.push(1)
|
|
|
+ // }
|
|
|
+ // if (dataInfor.additionalDeduction == 1) {
|
|
|
+ // newCheckType.push(2)
|
|
|
+ // }
|
|
|
+ // if (dataInfor.rdAwardsubsidy == 1) {
|
|
|
+ // newCheckType.push(3)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.setState({
|
|
|
jid: dataInfor.id, //项目ID
|
|
|
kid: dataInfor.commodityId, //商品ID
|
|
@@ -402,9 +438,12 @@ class newEditProject extends Component {
|
|
|
for (var j = 0; j < splList.length; j++) {
|
|
|
splList[j].type != 3 && hlist.push(splList[j].serviceYear)
|
|
|
}
|
|
|
+ let newCheckType = this.getCheckTypeList(splList);
|
|
|
+
|
|
|
this.setState({
|
|
|
splitList: splList,
|
|
|
histYear: hlist,
|
|
|
+ checkType: newCheckType,
|
|
|
})
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|