下拉框联动
This commit is contained in:
parent
a49305a979
commit
21805a9bab
|
@ -292,11 +292,17 @@ export default class exchangedit extends React.Component {
|
|||
.catch((err) => {})
|
||||
}
|
||||
}
|
||||
|
||||
/* select事件 */
|
||||
onRankChange(e) {
|
||||
_.forEach(this.state.tempdata, (item) => {
|
||||
item.checked =
|
||||
e.findIndex((checks) => {
|
||||
if (item.type === 'addProduct') {
|
||||
return checks.key == item.product_id
|
||||
} else {
|
||||
return checks.key == item.batch_number
|
||||
}
|
||||
}) > -1
|
||||
})
|
||||
this.setState({ tempdata: this.state.tempdata })
|
||||
|
@ -1171,7 +1177,11 @@ export default class exchangedit extends React.Component {
|
|||
let arr = []
|
||||
_.map(selection, (res) => {
|
||||
let obj = {}
|
||||
if (res.type === 'addProduct') {
|
||||
obj.key = res.product_id
|
||||
} else {
|
||||
obj.key = res.batch_number
|
||||
}
|
||||
obj.text = res.product_name
|
||||
arr.push(obj)
|
||||
return obj
|
||||
|
|
Loading…
Reference in New Issue