Open chenjianou opened 3 years ago
<--Table组件 -->
<FormItem prop={`sku`} rules={ { required: this.editIndex === index, message: 'sku不能为空' }}>
{
this.editIndex === index && !row.id ? <Select transfer filterable clearable onOn-clear={() => {
this.rowEdit.sku = '';
console.log('clear')
this.rowEdit.pdId = '';
this.rowEdit.pdName = '';
}} value={this.rowEdit.sku} onOn-change={ (sku) => {
if(sku) {
this.rowEdit.sku = sku;
this.rowEdit.pdId = this.skuMap.get(sku).pdId;
this.rowEdit.pdName = this.spuMap.get(this.skuMap.get(sku).pdId).pdName;
}
}}>
{this.getAllSku.filter(item => item.pdName === this.rowEdit.pdName).length ? this.getAllSku.filter(item => item.pdName === this.rowEdit.pdName).map( (item) => {
return <Option disabled={ this.data.find(row => row.sku === item.sku ) } value={ `${item.sku}` } label={ `${item.sku}/${item.weight}` }></Option>
}) : this.getAllSku.map( (item) => {
return <Option disabled={ this.data.find(row => row.sku === item.sku ) } value={ `${item.sku}` } label={ `${item.sku}/${item.weight}` }></Option>
})
}
</Select>: row.sku
}
</FormItem>