|
@@ -1,6 +1,7 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import style from './index.less';
|
|
|
import {ConfirmModal} from '@commonComp';
|
|
|
+import Notify from '@commonComp/Notify';
|
|
|
|
|
|
class DiagnosticItem extends Component{
|
|
|
constructor(props){
|
|
@@ -45,7 +46,13 @@ class DiagnosticItem extends Component{
|
|
|
// this.setState({
|
|
|
// visible: false,
|
|
|
// },()=>{
|
|
|
- const { addDiagnostic, clearInput, hideSearch } = this.props;
|
|
|
+ const { diagnosticList, addDiagnostic, clearInput, hideSearch } = this.props;
|
|
|
+ for (let i = 0; i < diagnosticList.length; i++) {
|
|
|
+ if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
|
|
|
+ Notify.info('该诊断已存在');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
addDiagnostic&&addDiagnostic(item);
|
|
|
clearInput&&clearInput();
|
|
|
hideSearch&&hideSearch()
|