Commit ef9935cb by liangjianmin

优化过滤器逻辑,使用箭头函数简化代码,提高可读性

parent b0447f70
Showing with 6 additions and 7 deletions
......@@ -777,9 +777,9 @@
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id);
this.filter_id_warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
this.filter_id_stock_in_sn = filter_arr.map(i => this.list[i].stock_in_sn);
this.filter_id = filter_arr.map(item => item.stock_in_id);
this.filter_id_warehouse_id = filter_arr.map(item => item.warehouse_id);
this.filter_id_stock_in_sn = filter_arr.map(item => item.stock_in_sn);
},
/**
* 全选
......@@ -788,9 +788,9 @@
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.stock_in_id;
});
this.filter_id = this.list.map(item => item.stock_in_id);
this.filter_id_warehouse_id = this.list.map(item => item.warehouse_id);
this.filter_id_stock_in_sn = this.list.map(item => item.stock_in_sn);
} else {
this.filter_id = [];
}
......@@ -1160,7 +1160,6 @@
});
return false;
}
//深圳自营仓 + 寄售仓
if (this.filter_id_warehouse_id[0] == 9 || this.filter_id_warehouse_id[0] == 16) {
//先判断一下自营货品信息判断是否是第一次入库
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment