1) 修复营销计划分页过滤参数 2) 修复兑换编辑老数据不可选商品

This commit is contained in:
zhangds 2022-04-19 11:20:53 +08:00
parent dd0f867b44
commit 35b5baad0d
3 changed files with 21 additions and 10 deletions

View File

@ -124,7 +124,6 @@ export default class adduserinfo extends React.Component {
}
this.getProductInfo();
}
//获取直连天下商品映射信息
getProductInfo() {
let productList = sessionStorage.getItem("productsList");

View File

@ -160,6 +160,7 @@ export default class adduserinfo extends React.Component {
});
this.setState({ productOption: arr });
console.log("this.state.model.product_id =>", this.state.model.product_id);
if (this.state.model.product_id) {
let cur_product = arr.find((item) => {
return item.key == this.state.model.product_id;
@ -168,7 +169,8 @@ export default class adduserinfo extends React.Component {
console.log("cur_product ==>2", cur_product);
console.log("arr ==>", arr);
if (cur_product.in) {
if (cur_product && cur_product.in) {
this.setState({ isSelectGoods: true });
}
}

View File

@ -78,7 +78,7 @@ export default class acclist extends React.Component {
email: "",
email_radio: -1,
phone_radio: -1,
search: "",
key_word: "",
audit_visible: false,
cur_item: null,
@ -170,7 +170,10 @@ export default class acclist extends React.Component {
});
}
onCountChange(e) {
this.setState({ page: 1, limit: e });
this.setState({
page: 1,
limit: e,
});
setTimeout(() => {
this.getpageFn();
}, 200);
@ -182,6 +185,9 @@ export default class acclist extends React.Component {
status: this.state.status,
key_word: this.state.key_word,
};
if (data.key_word === "") {
delete data.key_word;
}
this.getPlanList(data);
}
@ -432,7 +438,11 @@ export default class acclist extends React.Component {
// 监听组件内部状态的变化:
componentDidUpdate(prevProps, prevState) {
// 参数分别为改变之前的数据状态对象
if (prevState.search != this.state.search && !this.state.search) {
if (
prevState.key_word != this.state.key_word &&
prevState.status != this.state.status
) {
this.iptsureFn();
}
}
@ -444,7 +454,7 @@ export default class acclist extends React.Component {
page: 1,
limit: 10,
status: this.state.status,
key_word: this.state.search,
key_word: this.state.key_word,
};
this.getPlanList(data);
}
@ -504,7 +514,7 @@ export default class acclist extends React.Component {
let params = {
page: 1,
limit: 10,
key_word: this.state.search,
key_word: this.state.key_word,
};
this.getPlanList(params);
}
@ -634,8 +644,8 @@ export default class acclist extends React.Component {
</Button>
{/* <Button type="info">批量操作</Button> */}
<Ipt
onChange={(e) => this.setState({ search: e })}
value={this.state.search}
onChange={(e) => this.setState({ key_word: e })}
value={this.state.key_word}
wordSearch={this.iptsureFn.bind(this)}
icon="search"
placeholder={"请输入营销计划名称、分销商名称查询"}
@ -643,7 +653,7 @@ export default class acclist extends React.Component {
height={"36px"}
width={"260px"}
onClearItem={(e) => {
this.setState({ search: "" });
this.setState({ key_word: "" });
let data = {
page: 1,
limit: 10,