Commit 779749e9 authored by 鲁鑫's avatar 鲁鑫

采购申请页面控制

parent 404d8c98
......@@ -44,6 +44,16 @@ function initAufnr(knttp){
}
return false;
})
columns.some(column => {
if (column.name == "kostlName"){
//column.hide = knttp == 'F'? false:true;
if (isApplyProcUnit()){
column.editor.required = knttp == 'K'? true:false;
}
return true;
}
return false;
})
if ("K" == knttp){
if (Public.isNotBlank(itemGridManager.currentData)){
var rows = itemGridManager.currentData.Rows;
......@@ -142,7 +152,7 @@ function getGridColumns() {
var columns = [];
columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
//editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
},);
columns.push({display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string", hide: true},);
// columns.push({
......@@ -183,34 +193,34 @@ function getGridColumns() {
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"}
});
columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "sapMaterialSelect",
getParam: function (item) {
return {
filterValue: item.werks
}
},
back: {
MATNR: "matnr",
MAKTX: "txz01",
MATKL: "matkl",
WGBEZ: "matklName",
EKGRP: "ekgrp",
EKNAM: "ekgrpName",
PEINH: "peinh",
MEINS: "meins",
MSEHL: "meinsName",
LGFSB: "lgort",
LGOBE: "lgobe"
}
},
}
});
// columns.push({
// display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
// editor: {
// required: false, type: "select",
// data: {
// type: 'system',
// name: "sapMaterialSelect",
// getParam: function (item) {
// return {
// filterValue: item.werks
// }
// },
// back: {
// MATNR: "matnr",
// MAKTX: "txz01",
// MATKL: "matkl",
// WGBEZ: "matklName",
// EKGRP: "ekgrp",
// EKNAM: "ekgrpName",
// PEINH: "peinh",
// MEINS: "meins",
// MSEHL: "meinsName",
// LGFSB: "lgort",
// LGOBE: "lgobe"
// }
// },
// }
// });
columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
editor: {
......@@ -244,7 +254,10 @@ function getGridColumns() {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "MATKL"}
return {
fieldName: "MATKL",
filterValue: "C00"
}
},
back: {
MATKL: "matkl",
......@@ -343,49 +356,10 @@ function getGridColumns() {
}
//editor: {type: 'text'}
},);
// columns.push({
// display: "会计分配序号", name: "zebkn", width: "100", align: "left", type: "string",
// editor: {type: 'text'},
// render: function (item) {
// //申购项次为消耗性采购时,从1开始步长为1自动编号,最大99
// // if (item.knttp != ''){
// // ZEBKN_NUM = ZEBKN_NUM + 1;
// // }
// return item.zebkn = item.menge;
// }
// },);
// columns.push({
// display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string",
// //editor: {type: 'text'},
// // render: function (item) {
// // //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
// // if (item.knttp == "A" && item.menge > 1) {
// // return item.vrtkz = 1;
// // }
// // }
// },);
// columns.push({
// display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string",
// editor: {type: 'text'},
// // render: function (item) {
// // //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
// // if (item.knttp == "A" && item.menge > 1) {
// // return item.twrkz = 1;
// // }
// // }
// },);
// columns.push({
// display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string",
// editor: {type: 'text'}
// },);
// columns.push({
// display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
// editor: {type: 'text', required: true}
// },);
columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
editor: {
required: true, type: "select",
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
......
......@@ -16,7 +16,8 @@ function initializeCommonUI() {
function bindEvent() {
fillinDate = $("#fillinDate").val();
$('#knttp').searchbox({
$('#knttp').val("A");
/*$('#knttp').searchbox({
type: "system", name: "knttp",
getParam: function (item) {
return {
......@@ -26,7 +27,7 @@ function bindEvent() {
onChange: function (value, data) {
$('#knttp').val(data.knttp);
}
});
});*/
}
function initItemGrid() {
......@@ -110,25 +111,9 @@ function getGridColumns() {
var columns = [];
columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
//editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
},);
columns.push({display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string", hide: true},);
// columns.push({
// display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string",
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "knttp",
// getParam: function (item) {
// return {filterValue: $("#bsart").val()}
// },
// back: {
// knttp: "knttp"
// }
// },
// }
// },);
columns.push({
display: "工厂", name: "werks", width: "100", align: "left", type: "string",
editor: {
......@@ -149,7 +134,7 @@ function getGridColumns() {
},);
columns.push({
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"}
//editor: {required: false, type: "text"}
});
columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
......@@ -282,45 +267,8 @@ function getGridColumns() {
}
//editor: {type: 'text'}
},);
// columns.push({
// display: "会计分配序号", name: "zebkn", width: "100", align: "left", type: "string",
// editor: {type: 'text'},
// render: function (item) {
// //申购项次为消耗性采购时,从1开始步长为1自动编号,最大99
// // if (item.knttp != ''){
// // ZEBKN_NUM = ZEBKN_NUM + 1;
// // }
// return item.zebkn = item.menge;
// }
// },);
// columns.push({
// display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string",
// //editor: {type: 'text'},
// // render: function (item) {
// // //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
// // if (item.knttp == "A" && item.menge > 1) {
// // return item.vrtkz = 1;
// // }
// // }
// },);
// columns.push({
// display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string",
// editor: {type: 'text'},
// render: function (item) {
// //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
// if (item.knttp == "A" && item.menge > 1) {
// return item.twrkz = 1;
// }
// }
// },);
// columns.push({
// display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string",
// editor: {type: 'text'}
// },);
// columns.push({
// display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
// editor: {type: 'text', required: false}
// },);
//财务部填写
if ("financeNode" == getSubProcUnitId()){
columns.push({
display: "资产编号", name: "anln1", width: "200", align: "left", type: "string",
editor: {
......@@ -340,10 +288,7 @@ function getGridColumns() {
},
}
},);
// columns.push({
// display: "审批处理状态", name: "banpr", width: "100", align: "left", type: "string",
// //editor: {type: 'text'}
// },);
}
columns.push({
display: "申请日期", name: "badat", width: "100", align: "left", type: "string",
editor: {required: false, type: "date"}
......
......@@ -29,7 +29,7 @@
<div class="hg-form-cols">
<div class="hg-form-row">
<x:selectC name="bsart" label="pr类型" disabled="true" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="knttp" label="科目分配类别" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:inputC name="knttp" label="科目分配类别" readonly="true" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="banfn" label="采购申请编号" readonly="true" labelCol="1" fieldCol="2" required="false"/>
</div>
</div>
......
......@@ -44,9 +44,19 @@ function initAufnr(knttp){
}
return true;
}
return false;
})
columns.some(column => {
if (column.name == "kostlName"){
//column.hide = knttp == 'F'? false:true;
if (isApplyProcUnit()){
column.editor.required = knttp == 'K'? true:false;
}
return true;
}
return false;
})
if ("K" == knttp){
if (Public.isNotBlank(itemGridManager.currentData)){
var rows = itemGridManager.currentData.Rows;
......@@ -165,9 +175,9 @@ function getGridColumns() {
columns.push({
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
});
columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
});
// columns.push({
// display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
// });
columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
},);
......@@ -246,7 +256,7 @@ function getGridColumns() {
}else {
columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
//editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
},);
columns.push({display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string", hide: true},);
columns.push({
......@@ -271,34 +281,34 @@ function getGridColumns() {
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"}
});
columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "sapMaterialSelect",
getParam: function (item) {
return {
filterValue: item.werks
}
},
back: {
MATNR: "matnr",
MAKTX: "txz01",
MATKL: "matkl",
WGBEZ: "matklName",
EKGRP: "ekgrp",
EKNAM: "ekgrpName",
PEINH: "peinh",
MEINS: "meins",
MSEHL: "meinsName",
LGFSB: "lgort",
LGOBE: "lgobe"
}
},
}
});
// columns.push({
// display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
// editor: {
// required: false, type: "select",
// data: {
// type: 'system',
// name: "sapMaterialSelect",
// getParam: function (item) {
// return {
// filterValue: item.werks
// }
// },
// back: {
// MATNR: "matnr",
// MAKTX: "txz01",
// MATKL: "matkl",
// WGBEZ: "matklName",
// EKGRP: "ekgrp",
// EKNAM: "ekgrpName",
// PEINH: "peinh",
// MEINS: "meins",
// MSEHL: "meinsName",
// LGFSB: "lgort",
// LGOBE: "lgobe"
// }
// },
// }
// });
columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
editor: {
......@@ -332,7 +342,10 @@ function getGridColumns() {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "MATKL"}
return {
fieldName: "MATKL",
noContain: "C00"
}
},
back: {
MATKL: "matkl",
......@@ -434,7 +447,7 @@ function getGridColumns() {
columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
editor: {
required: true, type: "select",
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
......
......@@ -57,7 +57,8 @@ public class ResourceSearchController {
Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
List<QuerySchemeField> fields =
Arrays.asList(new QuerySchemeField("科目分配类别", "knttp", "string", 100L));
Arrays.asList(new QuerySchemeField("科目分配类别", "knttp", "string", 100L),
new QuerySchemeField("科目分配类别描述", "text", "string", 100L));
EasySearchParse easySearchParse = new EasySearchParse();
easySearchParse.setFields(fields);
easySearchParse.setWidth(450L);
......@@ -67,6 +68,12 @@ public class ResourceSearchController {
knttp.forEach((key, value) -> {
Map<String, Object> map = new HashMap<>();
map.put("knttp", value);
if ("F".equals(key)){
map.put("text","内部订单");
}
if ("K".equals(key)){
map.put("text","成本中心");
}
if ("ZFW".equals(filterValue)) {
if ("F".equals(key) || "K".equals(key)) {
mapList.add(map);
......@@ -266,6 +273,7 @@ public class ResourceSearchController {
String param = sdo.getString("paramValue");
String fieldName = sdo.getString("fieldName");
String filterValue = sdo.getString("filterValue");
String noContain = sdo.getString("noContain");
List<Map<String, String>> mapList = new ArrayList<>();
mapList = sapDictionaryApplication.getSapDictionary(fieldName);
List<QuerySchemeField> fields = new ArrayList<>();
......@@ -281,6 +289,16 @@ public class ResourceSearchController {
.collect(Collectors.toList());
}
}
if (StringUtil.isNotBlank(noContain)){//固定条件过滤,不包含
String[] split = noContain.split(",");
for (String s : split) {
mapList = mapList
.stream()
.filter(map -> map.values().stream().noneMatch(value->value.contains(s)))
//.filter(map -> map.containsValue(filterValue))
.collect(Collectors.toList());
}
}
if (StringUtil.isNotBlank(param)){//输入查询条件过滤
mapList = mapList
.stream()
......
......@@ -283,6 +283,10 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
sapPurchaseApprovalItems.add(sapPurchaseApprovalItem);
sapPurchaseApproval.setKnttp(approvalItemVo.getKnttp());//科目分配类别
sapPurchaseApproval.setEkgrp(approvalItemVo.getEkgrp());//采购组
}
//knttp审批要素没有值时,赋值0,防止发起流程时报错
if (StringUtil.isBlank(sapPurchaseApproval.getKnttp())){
sapPurchaseApproval.setKnttp("0");
}
// String nextCode = codeGenerator.getNextCode("sapPurchaseApproval");
// sapPurchaseApproval.setBillCode(nextCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment