|
@@ -281,9 +281,13 @@ class NewAddProject extends Component {
|
|
|
let flag = true;
|
|
|
let errorText = '';
|
|
|
for (let i=0; i<this.state.subProList.length; i++) {
|
|
|
- if (!this.state.subProList[i].serviceYear) {
|
|
|
+ let subItem = this.state.subProList[i];
|
|
|
+ if (!subItem.serviceYear) {
|
|
|
flag = false;
|
|
|
- errorText = "派单年份不能为空!"
|
|
|
+ errorText = "派单年份不能为空!";
|
|
|
+ } else if (!subItem.newCheck || (subItem.newCheck && !subItem.newCheck.length)) {
|
|
|
+ flag = false;
|
|
|
+ errorText = `${subItem.serviceYear}的会员类型不能为空!`;
|
|
|
}
|
|
|
}
|
|
|
if (!flag) {
|
|
@@ -1652,7 +1656,7 @@ class NewAddProject extends Component {
|
|
|
className="half-middle"
|
|
|
>
|
|
|
{ this.state.subProList && this.state.subProList.length ? (
|
|
|
- <div>
|
|
|
+ <div style={{display: 'flex', marginLeft: '-25%'}}>
|
|
|
<Button
|
|
|
className="submitSave"
|
|
|
type="primary"
|
|
@@ -1671,6 +1675,14 @@ class NewAddProject extends Component {
|
|
|
</Button>
|
|
|
<Button
|
|
|
className="submitSave"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({ subProList: [] });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 清空派单信息
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ className="submitSave"
|
|
|
type="primary"
|
|
|
onClick={() => {
|
|
|
this.onSubmit();
|
|
@@ -1680,7 +1692,7 @@ class NewAddProject extends Component {
|
|
|
</Button>
|
|
|
</div>
|
|
|
) : (
|
|
|
- <div>
|
|
|
+ <div style={{display: 'flex', marginLeft: '-5%'}}>
|
|
|
<Button
|
|
|
className="submitSave"
|
|
|
type="primary"
|
|
@@ -1689,7 +1701,8 @@ class NewAddProject extends Component {
|
|
|
subProList.push({});
|
|
|
this.setState({ subProList });
|
|
|
}}
|
|
|
- >
|
|
|
+ disabled={!this.state.serviceLife.length}
|
|
|
+ >
|
|
|
+ 添加本次派单
|
|
|
</Button>
|
|
|
<Button
|