优化商品模糊匹配的功能
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">名称:</label>
|
<label class="control-label">名称:</label>
|
||||||
<div class="control-inline">
|
<div class="control-inline">
|
||||||
<input type="text" id="searchName" name="searchName" value="" maxlength="100" class="width-120"/>
|
<input type="text" id="searchName" name="searchName" value="" maxlength="100" class="width-90"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -382,6 +382,7 @@
|
|||||||
url: "/material/getMaterialNameList",
|
url: "/material/getMaterialNameList",
|
||||||
valueField: 'value',
|
valueField: 'value',
|
||||||
textField: 'text',
|
textField: 'text',
|
||||||
|
hasDownArrow: false,
|
||||||
filter: function(q, row){
|
filter: function(q, row){
|
||||||
var opts = $(this).combobox('options');
|
var opts = $(this).combobox('options');
|
||||||
return row[opts.textField].indexOf(q) >-1;
|
return row[opts.textField].indexOf(q) >-1;
|
||||||
|
|||||||
@@ -31,13 +31,13 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">名称:</label>
|
<label class="control-label">名称:</label>
|
||||||
<div class="control-inline">
|
<div class="control-inline">
|
||||||
<input name="mName" id="mName" style="width:120px;"></input>
|
<input name="mName" id="mName" style="width:100px;"></input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">型号:</label>
|
<label class="control-label">型号:</label>
|
||||||
<div class="control-inline">
|
<div class="control-inline">
|
||||||
<input name="mModel" id="mModel" style="width:120px;"></input>
|
<input type="text" name="mModel" id="mModel" class="easyui-textbox" style="width:100px;"></input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -73,7 +73,6 @@
|
|||||||
initSystemData_depot();
|
initSystemData_depot();
|
||||||
initSelectInfo_depot();
|
initSelectInfo_depot();
|
||||||
initMaterialNameList();
|
initMaterialNameList();
|
||||||
initMaterialModelList();
|
|
||||||
initMProperty(); //初始化商品属性
|
initMProperty(); //初始化商品属性
|
||||||
initTableData();
|
initTableData();
|
||||||
ininPager();
|
ininPager();
|
||||||
@@ -174,20 +173,7 @@
|
|||||||
url: "/material/getMaterialNameList",
|
url: "/material/getMaterialNameList",
|
||||||
valueField: 'value',
|
valueField: 'value',
|
||||||
textField: 'text',
|
textField: 'text',
|
||||||
filter: function(q, row){
|
hasDownArrow: false,
|
||||||
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){
|
filter: function(q, row){
|
||||||
var opts = $(this).combobox('options');
|
var opts = $(this).combobox('options');
|
||||||
return row[opts.textField].indexOf(q) >-1;
|
return row[opts.textField].indexOf(q) >-1;
|
||||||
@@ -348,7 +334,7 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: ({
|
data: ({
|
||||||
name: $("#mName").combobox("getValue"),
|
name: $("#mName").combobox("getValue"),
|
||||||
model: $("#mModel").combobox("getValue")
|
model: $("#mModel").textbox("getValue")
|
||||||
}),
|
}),
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if(res && res.code === 200 && res.data) {
|
if(res && res.code === 200 && res.data) {
|
||||||
|
|||||||
@@ -482,26 +482,4 @@ public class MaterialController {
|
|||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品型号模糊匹配
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/getMaterialModelList")
|
|
||||||
public JSONArray getMaterialModelList() throws Exception {
|
|
||||||
JSONArray arr = new JSONArray();
|
|
||||||
try {
|
|
||||||
List<String> list = materialService.getMaterialModelList();
|
|
||||||
for (String s : list) {
|
|
||||||
JSONObject item = new JSONObject();
|
|
||||||
item.put("value", s);
|
|
||||||
item.put("text", s);
|
|
||||||
arr.add(item);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ public interface MaterialMapperEx {
|
|||||||
|
|
||||||
List<String> getMaterialNameList();
|
List<String> getMaterialNameList();
|
||||||
|
|
||||||
List<String> getMaterialModelList();
|
|
||||||
|
|
||||||
List<Material> findByOrder(@Param("name") String name,
|
List<Material> findByOrder(@Param("name") String name,
|
||||||
@Param("model") String model);
|
@Param("model") String model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -730,8 +730,4 @@ public class MaterialService {
|
|||||||
public List<String> getMaterialNameList() {
|
public List<String> getMaterialNameList() {
|
||||||
return materialMapperEx.getMaterialNameList();
|
return materialMapperEx.getMaterialNameList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getMaterialModelList() {
|
|
||||||
return materialMapperEx.getMaterialModelList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,13 +259,6 @@
|
|||||||
order by m.name asc
|
order by m.name asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaterialModelList" resultType="java.lang.String">
|
|
||||||
select m.Model from jsh_material m
|
|
||||||
where m.Model is not null and m.Model !='' and ifnull(m.delete_Flag,'0') !='1'
|
|
||||||
group by m.Model
|
|
||||||
order by m.Model asc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="findByOrder" resultType="com.jsh.erp.datasource.entities.Material">
|
<select id="findByOrder" resultType="com.jsh.erp.datasource.entities.Material">
|
||||||
select m.*
|
select m.*
|
||||||
FROM jsh_material m
|
FROM jsh_material m
|
||||||
|
|||||||
Reference in New Issue
Block a user