修改物料搜索页面
This commit is contained in:
parent
88b445daf3
commit
141f70dec1
@ -63,6 +63,15 @@
|
||||
|
||||
<el-card class="select-card" shadow="never">
|
||||
<div class="select-row">
|
||||
<div style="margin-right: 1%; font-size: 15px; font-weight: bold;">
|
||||
<el-checkbox v-model="useAutonomous" style="font-size: 15px; font-weight: bold;">自主查询</el-checkbox>
|
||||
<el-tooltip class="item" effect="dark" placement="top-start">
|
||||
<div slot="content">
|
||||
<span style="color:#f56c6c;">勾选自主查询后,可自行输入查询格式统一的物料编码或物料名称</span>
|
||||
</div>
|
||||
<i class="el-icon-warning-outline"/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<label class="select-label">指定物料</label>
|
||||
<el-radio-group v-model="searchMode" size="mini" class="search-mode">
|
||||
<el-radio-button label="code">按编码</el-radio-button>
|
||||
@ -74,6 +83,7 @@
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:allow-create="useAutonomous"
|
||||
collapse-tags
|
||||
:placeholder="searchMode === 'code' ? '可选:搜索并多选物料后查询库存' : '可选:按名称搜索并多选'"
|
||||
:remote-method="remoteSearchMaterial"
|
||||
@ -93,7 +103,7 @@
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="clearSelection">清除指定</el-button>
|
||||
</div>
|
||||
<div v-if="selectedMaterials.length" class="selected-tags">
|
||||
<div v-if="selectedMaterials.length && !useAutonomous" class="selected-tags">
|
||||
<el-tag
|
||||
v-for="m in selectedMaterials"
|
||||
:key="m.materialCode"
|
||||
@ -206,6 +216,7 @@ export default {
|
||||
},
|
||||
materialLoading: false,
|
||||
searchMode: 'code',
|
||||
useAutonomous:false,
|
||||
selectedMaterials: [],
|
||||
materialOptions: [],
|
||||
/** 是否处于「指定物料查询」模式(无分页) */
|
||||
@ -283,6 +294,7 @@ export default {
|
||||
this.selectedMode = false;
|
||||
this.loading = true;
|
||||
const reqSeq = ++this.inventoryReqSeq;
|
||||
this.queryParams.useAutonomous = this.useAutonomous
|
||||
listMaterial_index(this.queryParams)
|
||||
.then(async (response) => {
|
||||
const rows = response.rows || [];
|
||||
@ -331,12 +343,18 @@ export default {
|
||||
clearSelection() {
|
||||
this.selectedMaterials = [];
|
||||
this.materialOptions = [];
|
||||
this.queryParams.materialCode = ""
|
||||
this.queryParams.materialName = ""
|
||||
this.queryParams.pageNum = 0
|
||||
this.getList();
|
||||
},
|
||||
/** 指定物料:一次批量查库存 */
|
||||
async handleQueryInventory() {
|
||||
if (!this.selectedMaterials.length) {
|
||||
this.$message.info("未指定物料,已按默认列表查询");
|
||||
this.queryParams.materialCode = ""
|
||||
this.queryParams.materialName = ""
|
||||
this.queryParams.pageNum = 0
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
@ -344,6 +362,17 @@ export default {
|
||||
this.$message.warning("单次最多查询 50 个物料");
|
||||
return;
|
||||
}
|
||||
//使用自主查询
|
||||
if(this.useAutonomous){
|
||||
if(this.searchMode === 'code'){
|
||||
this.queryParams.materialCode = this.selectedMaterials.join(',')
|
||||
}else{
|
||||
this.queryParams.materialName = this.selectedMaterials.join(',')
|
||||
}
|
||||
this.queryParams.pageNum = 0
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.selectedMode = true;
|
||||
const reqSeq = ++this.inventoryReqSeq;
|
||||
const codes = this.selectedMaterials.map(m => m.materialCode).filter(Boolean);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user