优化商品选择界面的查询逻辑

This commit is contained in:
季圣华
2022-01-24 21:32:14 +08:00
parent 2d04006561
commit c0e67ee3bf

View File

@@ -40,7 +40,7 @@
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button type="primary" @click="loadData(1)">查询</a-button> <a-button type="primary" @click="loadMaterialData(1)">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button> <a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button>
</a-col> </a-col>
</span> </span>
@@ -164,8 +164,6 @@
created() { created() {
// 该方法触发屏幕自适应 // 该方法触发屏幕自适应
this.resetScreenSize() this.resetScreenSize()
this.loadTreeData()
this.getDepotList()
}, },
methods: { methods: {
initBarCode() { initBarCode() {
@@ -176,13 +174,13 @@
this.$emit('initComp', '') this.$emit('initComp', '')
} }
}, },
async loadData(arg) { loadMaterialData(arg) {
if (arg === 1) { if (arg === 1) {
this.ipagination.current = 1; this.ipagination.current = 1;
} }
this.loading = true this.loading = true
let params = this.getQueryParams()//查询条件 let params = this.getQueryParams()//查询条件
await getMaterialBySelect(params).then((res) => { getMaterialBySelect(params).then((res) => {
if (res) { if (res) {
this.dataSource = res.rows this.dataSource = res.rows
this.ipagination.total = res.total this.ipagination.total = res.total
@@ -225,8 +223,10 @@
this.title = '选择商品' this.title = '选择商品'
this.queryParam.q = barCode this.queryParam.q = barCode
this.$nextTick(() => this.$refs.material.focus()); this.$nextTick(() => this.$refs.material.focus());
this.loadTreeData()
this.getDepotList()
this.initDepotSelect() this.initDepotSelect()
this.loadData(); this.loadMaterialData();
this.form.resetFields(); this.form.resetFields();
}, },
getQueryParams() { getQueryParams() {
@@ -247,7 +247,7 @@
let that = this; let that = this;
if (num !== 0) { if (num !== 0) {
that.queryParam = {}; that.queryParam = {};
that.loadData(1); that.loadMaterialData(1);
} }
that.selectedRowKeys = []; that.selectedRowKeys = [];
that.selectMaterialIds = []; that.selectMaterialIds = [];
@@ -262,7 +262,7 @@
this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'; this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
} }
this.ipagination = pagination; this.ipagination = pagination;
this.loadData(); this.loadMaterialData();
}, },
handleSubmit() { handleSubmit() {
let that = this; let that = this;
@@ -317,14 +317,14 @@
this.selectedRowKeys = arr this.selectedRowKeys = arr
this.handleSubmit() this.handleSubmit()
} else { } else {
this.loadData(1) this.loadMaterialData(1)
} }
} else { } else {
this.loadData(1) this.loadMaterialData(1)
} }
}, },
modalFormOk() { modalFormOk() {
this.loadData() this.loadMaterialData()
}, },
rowAction(record, index) { rowAction(record, index) {
return { return {