Browse Source

[fix]

工程管理 bom信息
修改添加bom页面选择料号下拉框绑定方法;
工程管理 物料信息
修改物料后端返回选择列表接口,输入框有值时返回查找列表;
dev
王晓迪 4 months ago
parent
commit
34d7cbed21
  1. 7
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 25
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html

7
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -416,8 +416,11 @@ public class ErpMaterialController extends BaseController
}
@RequestMapping("/getCateMaterialSelList")
@ResponseBody
public AjaxResult getCateMaterialSelList(){
return success(erpMaterialMapper.selectCateErpMaterialList());
public AjaxResult getCateMaterialSelList(@RequestParam(value = "q",defaultValue = "") String prefix){
if (prefix == null || prefix.isEmpty()){
return success(erpMaterialMapper.selectCateErpMaterialList());
}
return success(erpMaterialMapper.searchMaterialsByPrefix(prefix));
}
@GetMapping ("/getEngineerList")

25
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -185,25 +185,34 @@
url:ctx + "erp/material/getCateMaterialSelList",
dataType:"json",
delay:250,
timeout: 10000, // 设置超时时间为10秒
cache:true,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.data;
console.log(resultList);
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["materialNo"];
option.text = resultList[i]["materialNo"];
options.push(option);
// for(var i= 0, len=resultList.length;i<len;i++){
// var option = resultList[i];
// option.id = resultList[i]["materialNo"];
// option.text = resultList[i]["materialNo"];
// options.push(option);
// }
return {
results: resultList.map(function (item) {
return {
id: item.materialNo,
text: item.materialNo
};
})
}
}
};
return {
results: options
results: []
};
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 1
minimumInputLength: 1,
}
});
$('#materialNo').on('select2:select', function (e) {

Loading…
Cancel
Save