|
@@ -153,11 +153,11 @@ class newEditProject extends Component {
|
|
|
}
|
|
|
|
|
|
let newCheckType = [];
|
|
|
- if ([2, 3].indexOf(dataInfor.projectType) > -1) {
|
|
|
+ if ([0, 2, 3].indexOf(dataInfor.projectType) > -1) {
|
|
|
// 单边会员和简单会员
|
|
|
newCheckType = [1];
|
|
|
} else {
|
|
|
- newCheckType = this.getCheckTypeList([dataInfor]);
|
|
|
+ newCheckType = this.getCheckTypeList(dataInfor.splitList);
|
|
|
}
|
|
|
// if (dataInfor.projectType == 1) {
|
|
|
// if (dataInfor.htMember == 1) {
|
|
@@ -196,6 +196,7 @@ class newEditProject extends Component {
|
|
|
contractTerm: (!dataInfor.contractTerm || (dataInfor.contractTerm.indexOf("-") == -1)) ? [] : JSON.parse(dataInfor.contractTerm), // 合同期
|
|
|
serviceYear: dataInfor.cSort == 6 ? undefined : dataInfor.serviceYear,//本次派单
|
|
|
histYear: llist, // 本次已派单
|
|
|
+ oldSplitList: JSON.parse(JSON.stringify(dataInfor[children])),
|
|
|
splitList: dataInfor[children] || [],
|
|
|
tid: dataInfor.id, // 父级项目id
|
|
|
isMedit: readOnly ? 3 : dataInfor.cSort == 6 ? 0 : 1,// 会员项目默认0不可编辑 普通项目默认1可编辑
|
|
@@ -381,6 +382,7 @@ class newEditProject extends Component {
|
|
|
});
|
|
|
if (!data.error.length) {
|
|
|
message.success("保存成功!");
|
|
|
+ this.loopPostUpdateSubProject();
|
|
|
if (this.state.isVip == 6) {
|
|
|
text == "submit" &&
|
|
|
this.setState({
|
|
@@ -394,6 +396,9 @@ class newEditProject extends Component {
|
|
|
}
|
|
|
}.bind(this)
|
|
|
);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
getpatentTypeList() {
|
|
@@ -653,29 +658,64 @@ class newEditProject extends Component {
|
|
|
return [...new Set(newCheckType)]
|
|
|
}
|
|
|
|
|
|
+ // 获取修改过的高新会员子项目
|
|
|
+ getUpdatedSubProject() {
|
|
|
+ const updatedList = [];
|
|
|
+ const { splitList, oldSplitList } = this.state;
|
|
|
+ splitList.map(newSubItem => {
|
|
|
+ let oldSubItem = oldSplitList.find(item => item.id === newSubItem.id);
|
|
|
+ if (!!oldSubItem) {
|
|
|
+ if (newSubItem.htMember != oldSubItem.htMember
|
|
|
+ || newSubItem.additionalDeduction != oldSubItem.additionalDeduction
|
|
|
+ || newSubItem.rdAwardsubsidy != oldSubItem.rdAwardsubsidy) {
|
|
|
+ updatedList.push(newSubItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return updatedList;
|
|
|
+ }
|
|
|
+
|
|
|
+ loopPostUpdateSubProject() {
|
|
|
+ const updatedList = this.getUpdatedSubProject();
|
|
|
+ updatedList.map((item) => {
|
|
|
+ this.handleUpdateSubProject(item)
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 修改子项目
|
|
|
handleUpdateSubProject(item) {
|
|
|
+ const { type } = this.props;
|
|
|
let prams = {
|
|
|
- id: item.id,
|
|
|
+ [type === "change" ? "id" : "tid"]: item.id,
|
|
|
htMember: item.htMember,
|
|
|
additionalDeduction: item.additionalDeduction,
|
|
|
rdAwardsubsidy: item.rdAwardsubsidy,
|
|
|
taskComment: item.taskComment
|
|
|
};
|
|
|
+ let url = type == "change" ? "/api/admin/orderChange/updateMemberSonProject" : "/api/admin/orderProject/updateMemberSonProject"
|
|
|
+
|
|
|
$.ajax({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/orderChange/updateMemberSonProject",
|
|
|
+ url,
|
|
|
data: prams,
|
|
|
success: res => {
|
|
|
if (!res.error.length) {
|
|
|
- message.success("保存成功!");
|
|
|
+ const { splitList, oldSplitList } = this.state;
|
|
|
// 更新项目的会员类型
|
|
|
- let checkType = this.getCheckTypeList(this.state.splitList);
|
|
|
- this.setState({ checkType });
|
|
|
+ let checkType = this.getCheckTypeList(splitList);
|
|
|
+ // 更新初始的子项目列表
|
|
|
+ let oldSplitIdx = oldSplitList.findIndex(oldItem => oldItem.id === item.id)
|
|
|
+ if (oldSplitIdx > -1) {
|
|
|
+ oldSplitList[oldSplitIdx] = item;
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ checkType,
|
|
|
+ oldSplitList
|
|
|
+ });
|
|
|
} else {
|
|
|
- message.error("保存失败!");
|
|
|
+ message.error(res.error[0].message);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -685,14 +725,14 @@ class newEditProject extends Component {
|
|
|
let children = vipYear.map(its => (
|
|
|
<Option key={its}>{its}</Option>
|
|
|
));
|
|
|
- let plainOptions = this.state.projectType == 3
|
|
|
+ let plainOptions = [0, 3].indexOf(this.state.projectType) > -1
|
|
|
? [{ label: '仅提供单变会员', value: 1 },] : this.state.projectType == 2
|
|
|
? [{ label: '仅填报表,仅咨询,不出备查资料', value: 1 }] : this.state.projectType == 1
|
|
|
? [
|
|
|
{ label: '高新会员', value: 1 },
|
|
|
{ label: '加计扣除', value: 2 },
|
|
|
{ label: '研发奖补', value: 3 }
|
|
|
- ] : []
|
|
|
+ ] : this.state.projectType == 7 ? ["仅提供单边会员服务"] : []
|
|
|
const { RangePicker } = DatePicker;
|
|
|
const { readOnly } = this.props;
|
|
|
const { isVip, histYear, isMedit } = this.state
|
|
@@ -1498,11 +1538,11 @@ class newEditProject extends Component {
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
|
|
|
- { isMedit == 1 ? (
|
|
|
+ {/* { isMedit == 1 && this.state.projectType == 1 ? (
|
|
|
<div style={{textAlign: "center"}}>
|
|
|
<Button type="primary" onClick={() => this.handleUpdateSubProject(item)}>确认修改</Button>
|
|
|
</div>
|
|
|
- ) : null }
|
|
|
+ ) : null } */}
|
|
|
|
|
|
{/* {
|
|
|
(isMedit == 0 || isMedit == 2) &&
|
|
@@ -1719,7 +1759,7 @@ class newEditProject extends Component {
|
|
|
} else if (this.state.isGive == 1) {
|
|
|
newYear = newYear + "(赠)"
|
|
|
}
|
|
|
- slist.push(newYear)
|
|
|
+ slist = slist.concat(newYear)
|
|
|
this.setState({
|
|
|
serviceLife: slist,
|
|
|
commodityQuantity: slist.length,
|
|
@@ -1746,6 +1786,7 @@ class newEditProject extends Component {
|
|
|
}}
|
|
|
>
|
|
|
<Select
|
|
|
+ mode="tags"
|
|
|
style={{ width: '200px', marginRight: 50 }}
|
|
|
placeholder="请选择年份"
|
|
|
onChange={e => {
|