优化商品查询功能

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

@@ -43,7 +43,7 @@
<div class="form-group">
<label class="control-label">名称:</label>
<div class="control-inline">
<input type="text" id="searchName" name="searchName" value="" maxlength="100" class="easyui-textbox width-90"/>
<input type="text" id="searchName" name="searchName" value="" maxlength="100" class="width-120"/>
</div>
</div>
<div class="form-group">
@@ -241,6 +241,7 @@
initMProperty();
manyUnitFun();
priceKeyUp();//价格触发事件
initMaterialNameList();
initMPropertyShort(); //初始化商品属性
initTableData();
ininPager();
@@ -374,6 +375,20 @@
});
}
//初始化商品名称模糊匹配
function initMaterialNameList() {
$('#searchName').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 initMPropertyShort() {
$.ajax({
@@ -940,7 +955,7 @@
//导出数据
function setOutputFun() {
var name = $.trim($("#searchName").val());
var name = $.trim($("#searchName").combobox("getValue"));
var model = $.trim($("#searchModel").val());
window.location.href = "/material/exportExcel?browserType=" + getOs()
+ "&name=" + name + "&model=" + model + "&categoryIds=" + types;
@@ -1415,7 +1430,7 @@
function showMaterialDetails(pageNo, pageSize) {
var barCode = $.trim($("#searchBarCode").val());
var name = $.trim($("#searchName").val());
var name = $.trim($("#searchName").combobox("getValue"));
var standard = $.trim($("#searchStandard").val());
var model = $.trim($("#searchModel").val());
$.ajax({
@@ -1455,7 +1470,7 @@
$("#searchBarCode").textbox("clear");
$("#searchParentName").textbox("clear");
$("#searchParentId").val("");
$("#searchName").textbox("clear");
$("#searchName").combobox("clear");
$("#searchStandard").textbox("clear");
$("#searchModel").textbox("clear");
types = ""; //清空类别

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;