优化商品查询功能

This commit is contained in:
季圣华
2020-06-04 00:08:07 +08:00
parent d344771c92
commit 927f75850b
6 changed files with 158 additions and 11 deletions

View File

@@ -28,6 +28,18 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #95B8E7;border-radius:5px;"></select>
</div>
</div>
<div class="form-group">
<label class="control-label">名称:</label>
<div class="control-inline">
<input name="mName" id="mName" style="width:120px;"></input>
</div>
</div>
<div class="form-group">
<label class="control-label">型号:</label>
<div class="control-inline">
<input name="mModel" id="mModel" style="width:120px;"></input>
</div>
</div>
<div class="form-group">
<label class="control-label">月份:</label>
<div class="control-inline">
@@ -60,6 +72,8 @@
initSelectInfo_UB();
initSystemData_depot();
initSelectInfo_depot();
initMaterialNameList();
initMaterialModelList();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
@@ -153,6 +167,34 @@
}
}
//初始化商品名称模糊匹配
function initMaterialNameList() {
$('#mName').combobox({
method:"get",
url: "/material/getMaterialNameList",
valueField: 'value',
textField: 'text',
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
}
});
}
//初始化商品型号模糊匹配
function initMaterialModelList() {
$('#mModel').combobox({
method:"get",
url: "/material/getMaterialModelList",
valueField: 'value',
textField: 'text',
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
}
});
}
//初始化商品属性
function initMProperty() {
$.ajax({
@@ -304,6 +346,10 @@
type: "get",
url: "/material/findByOrder",
dataType: "json",
data: ({
name: $("#mName").combobox("getValue"),
model: $("#mModel").combobox("getValue")
}),
success: function (res) {
if(res && res.code === 200 && res.data) {
var mIds = res.data.mIds;