diff --git a/src/components/knockGold/index.jsx b/src/components/knockGold/index.jsx index da83e428..5db7aeda 100644 --- a/src/components/knockGold/index.jsx +++ b/src/components/knockGold/index.jsx @@ -214,9 +214,12 @@ export default class addKnockGold extends Component { model.usable_time = this.props.data.time_limit.use_time.type model.early_notifier = this.props.data.early_notifier?.map((item) => { return UserSelectList?.map((items) => { - if (item.mobile === items.key) return items + if (item?.mobile === items.key || item?.real_name === items.text) { + return items + } }).filter((item1) => item1)[0] }) + model.origin = this.props.data /* 以下操作 筛选出输入框的预警值并经行填充 */ const copy_early_per = this.props.data?.early_per || [] @@ -232,22 +235,23 @@ export default class addKnockGold extends Component { //获取预警人数据 getUserSelectList(cb) { - const model = this.state.model getVoucherWarningAccount().then((res) => handelResponse( res, (req, msg) => { - const defaultData = req.default.map((item) => item.real_name) + const defaultDataName = req.default.map((item) => item.real_name) + const defaultDataMobile = req.default.map((item) => item.mobile) const newData = req.data.map((item) => { - if (defaultData.indexOf(item.real_name) !== -1) { - const obj = { + if ( + defaultDataName.indexOf(item.real_name) !== -1 || + defaultDataMobile.indexOf(item.mobile) !== -1 + ) { + return { key: item.mobile, text: item.real_name, disabled: true, closable: false } - model.early_notifier.push(obj) - return obj } else { return { key: item.mobile, @@ -256,7 +260,7 @@ export default class addKnockGold extends Component { } } }) - this.setState({ userSelectList: newData, model: model }) + this.setState({ userSelectList: newData }) this.echoFun(newData) }, (err) => {