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

采购申请页面控制

parent 404d8c98
...@@ -44,6 +44,16 @@ function initAufnr(knttp){ ...@@ -44,6 +44,16 @@ function initAufnr(knttp){
} }
return false; 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 ("K" == knttp){
if (Public.isNotBlank(itemGridManager.currentData)){ if (Public.isNotBlank(itemGridManager.currentData)){
var rows = itemGridManager.currentData.Rows; var rows = itemGridManager.currentData.Rows;
...@@ -142,7 +152,7 @@ function getGridColumns() { ...@@ -142,7 +152,7 @@ function getGridColumns() {
var columns = []; var columns = [];
columns.push({ columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string", 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: "pstyp", width: "100", align: "left", type: "string", hide: true},);
// columns.push({ // columns.push({
...@@ -183,34 +193,34 @@ function getGridColumns() { ...@@ -183,34 +193,34 @@ function getGridColumns() {
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string", display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"} editor: {required: false, type: "text"}
}); });
columns.push({ // columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string", // display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
editor: { // editor: {
required: false, type: "select", // required: false, type: "select",
data: { // data: {
type: 'system', // type: 'system',
name: "sapMaterialSelect", // name: "sapMaterialSelect",
getParam: function (item) { // getParam: function (item) {
return { // return {
filterValue: item.werks // filterValue: item.werks
} // }
}, // },
back: { // back: {
MATNR: "matnr", // MATNR: "matnr",
MAKTX: "txz01", // MAKTX: "txz01",
MATKL: "matkl", // MATKL: "matkl",
WGBEZ: "matklName", // WGBEZ: "matklName",
EKGRP: "ekgrp", // EKGRP: "ekgrp",
EKNAM: "ekgrpName", // EKNAM: "ekgrpName",
PEINH: "peinh", // PEINH: "peinh",
MEINS: "meins", // MEINS: "meins",
MSEHL: "meinsName", // MSEHL: "meinsName",
LGFSB: "lgort", // LGFSB: "lgort",
LGOBE: "lgobe" // LGOBE: "lgobe"
} // }
}, // },
} // }
}); // });
columns.push({ columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string", display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
editor: { editor: {
...@@ -244,7 +254,10 @@ function getGridColumns() { ...@@ -244,7 +254,10 @@ function getGridColumns() {
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {fieldName: "MATKL"} return {
fieldName: "MATKL",
filterValue: "C00"
}
}, },
back: { back: {
MATKL: "matkl", MATKL: "matkl",
...@@ -343,49 +356,10 @@ function getGridColumns() { ...@@ -343,49 +356,10 @@ function getGridColumns() {
} }
//editor: {type: 'text'} //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({ columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string", display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: false, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
......
...@@ -16,7 +16,8 @@ function initializeCommonUI() { ...@@ -16,7 +16,8 @@ function initializeCommonUI() {
function bindEvent() { function bindEvent() {
fillinDate = $("#fillinDate").val(); fillinDate = $("#fillinDate").val();
$('#knttp').searchbox({ $('#knttp').val("A");
/*$('#knttp').searchbox({
type: "system", name: "knttp", type: "system", name: "knttp",
getParam: function (item) { getParam: function (item) {
return { return {
...@@ -26,7 +27,7 @@ function bindEvent() { ...@@ -26,7 +27,7 @@ function bindEvent() {
onChange: function (value, data) { onChange: function (value, data) {
$('#knttp').val(data.knttp); $('#knttp').val(data.knttp);
} }
}); });*/
} }
function initItemGrid() { function initItemGrid() {
...@@ -110,25 +111,9 @@ function getGridColumns() { ...@@ -110,25 +111,9 @@ function getGridColumns() {
var columns = []; var columns = [];
columns.push({ columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string", 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: "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({ columns.push({
display: "工厂", name: "werks", width: "100", align: "left", type: "string", display: "工厂", name: "werks", width: "100", align: "left", type: "string",
editor: { editor: {
...@@ -149,7 +134,7 @@ function getGridColumns() { ...@@ -149,7 +134,7 @@ function getGridColumns() {
},); },);
columns.push({ columns.push({
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string", display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"} //editor: {required: false, type: "text"}
}); });
columns.push({ columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string", display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
...@@ -282,45 +267,8 @@ function getGridColumns() { ...@@ -282,45 +267,8 @@ function getGridColumns() {
} }
//editor: {type: 'text'} //editor: {type: 'text'}
},); },);
// columns.push({ //财务部填写
// display: "会计分配序号", name: "zebkn", width: "100", align: "left", type: "string", if ("financeNode" == getSubProcUnitId()){
// 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}
// },);
columns.push({ columns.push({
display: "资产编号", name: "anln1", width: "200", align: "left", type: "string", display: "资产编号", name: "anln1", width: "200", align: "left", type: "string",
editor: { editor: {
...@@ -340,10 +288,7 @@ function getGridColumns() { ...@@ -340,10 +288,7 @@ function getGridColumns() {
}, },
} }
},); },);
// columns.push({ }
// display: "审批处理状态", name: "banpr", width: "100", align: "left", type: "string",
// //editor: {type: 'text'}
// },);
columns.push({ columns.push({
display: "申请日期", name: "badat", width: "100", align: "left", type: "string", display: "申请日期", name: "badat", width: "100", align: "left", type: "string",
editor: {required: false, type: "date"} editor: {required: false, type: "date"}
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:selectC name="bsart" label="pr类型" disabled="true" labelCol="1" fieldCol="2" required="true"/> <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"/> <x:inputC name="banfn" label="采购申请编号" readonly="true" labelCol="1" fieldCol="2" required="false"/>
</div> </div>
</div> </div>
......
...@@ -44,9 +44,19 @@ function initAufnr(knttp){ ...@@ -44,9 +44,19 @@ function initAufnr(knttp){
} }
return true; return true;
} }
return false; 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 ("K" == knttp){
if (Public.isNotBlank(itemGridManager.currentData)){ if (Public.isNotBlank(itemGridManager.currentData)){
var rows = itemGridManager.currentData.Rows; var rows = itemGridManager.currentData.Rows;
...@@ -165,9 +175,9 @@ function getGridColumns() { ...@@ -165,9 +175,9 @@ function getGridColumns() {
columns.push({ columns.push({
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string", display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
}); });
columns.push({ // columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string", // display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
}); // });
columns.push({ columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string", display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
},); },);
...@@ -246,7 +256,7 @@ function getGridColumns() { ...@@ -246,7 +256,7 @@ function getGridColumns() {
}else { }else {
columns.push({ columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string", 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: "pstyp", width: "100", align: "left", type: "string", hide: true},);
columns.push({ columns.push({
...@@ -271,34 +281,34 @@ function getGridColumns() { ...@@ -271,34 +281,34 @@ function getGridColumns() {
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string", display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"} editor: {required: false, type: "text"}
}); });
columns.push({ // columns.push({
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string", // display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
editor: { // editor: {
required: false, type: "select", // required: false, type: "select",
data: { // data: {
type: 'system', // type: 'system',
name: "sapMaterialSelect", // name: "sapMaterialSelect",
getParam: function (item) { // getParam: function (item) {
return { // return {
filterValue: item.werks // filterValue: item.werks
} // }
}, // },
back: { // back: {
MATNR: "matnr", // MATNR: "matnr",
MAKTX: "txz01", // MAKTX: "txz01",
MATKL: "matkl", // MATKL: "matkl",
WGBEZ: "matklName", // WGBEZ: "matklName",
EKGRP: "ekgrp", // EKGRP: "ekgrp",
EKNAM: "ekgrpName", // EKNAM: "ekgrpName",
PEINH: "peinh", // PEINH: "peinh",
MEINS: "meins", // MEINS: "meins",
MSEHL: "meinsName", // MSEHL: "meinsName",
LGFSB: "lgort", // LGFSB: "lgort",
LGOBE: "lgobe" // LGOBE: "lgobe"
} // }
}, // },
} // }
}); // });
columns.push({ columns.push({
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string", display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
editor: { editor: {
...@@ -332,7 +342,10 @@ function getGridColumns() { ...@@ -332,7 +342,10 @@ function getGridColumns() {
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {fieldName: "MATKL"} return {
fieldName: "MATKL",
noContain: "C00"
}
}, },
back: { back: {
MATKL: "matkl", MATKL: "matkl",
...@@ -434,7 +447,7 @@ function getGridColumns() { ...@@ -434,7 +447,7 @@ function getGridColumns() {
columns.push({ columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string", display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: false, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
......
...@@ -57,7 +57,8 @@ public class ResourceSearchController { ...@@ -57,7 +57,8 @@ public class ResourceSearchController {
Integer pageSize = sdo.getInteger("pageSize",10); Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize); PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
List<QuerySchemeField> fields = 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 easySearchParse = new EasySearchParse();
easySearchParse.setFields(fields); easySearchParse.setFields(fields);
easySearchParse.setWidth(450L); easySearchParse.setWidth(450L);
...@@ -67,6 +68,12 @@ public class ResourceSearchController { ...@@ -67,6 +68,12 @@ public class ResourceSearchController {
knttp.forEach((key, value) -> { knttp.forEach((key, value) -> {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("knttp", value); map.put("knttp", value);
if ("F".equals(key)){
map.put("text","内部订单");
}
if ("K".equals(key)){
map.put("text","成本中心");
}
if ("ZFW".equals(filterValue)) { if ("ZFW".equals(filterValue)) {
if ("F".equals(key) || "K".equals(key)) { if ("F".equals(key) || "K".equals(key)) {
mapList.add(map); mapList.add(map);
...@@ -266,6 +273,7 @@ public class ResourceSearchController { ...@@ -266,6 +273,7 @@ public class ResourceSearchController {
String param = sdo.getString("paramValue"); String param = sdo.getString("paramValue");
String fieldName = sdo.getString("fieldName"); String fieldName = sdo.getString("fieldName");
String filterValue = sdo.getString("filterValue"); String filterValue = sdo.getString("filterValue");
String noContain = sdo.getString("noContain");
List<Map<String, String>> mapList = new ArrayList<>(); List<Map<String, String>> mapList = new ArrayList<>();
mapList = sapDictionaryApplication.getSapDictionary(fieldName); mapList = sapDictionaryApplication.getSapDictionary(fieldName);
List<QuerySchemeField> fields = new ArrayList<>(); List<QuerySchemeField> fields = new ArrayList<>();
...@@ -281,6 +289,16 @@ public class ResourceSearchController { ...@@ -281,6 +289,16 @@ public class ResourceSearchController {
.collect(Collectors.toList()); .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)){//输入查询条件过滤 if (StringUtil.isNotBlank(param)){//输入查询条件过滤
mapList = mapList mapList = mapList
.stream() .stream()
......
...@@ -283,6 +283,10 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa ...@@ -283,6 +283,10 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
sapPurchaseApprovalItems.add(sapPurchaseApprovalItem); sapPurchaseApprovalItems.add(sapPurchaseApprovalItem);
sapPurchaseApproval.setKnttp(approvalItemVo.getKnttp());//科目分配类别 sapPurchaseApproval.setKnttp(approvalItemVo.getKnttp());//科目分配类别
sapPurchaseApproval.setEkgrp(approvalItemVo.getEkgrp());//采购组 sapPurchaseApproval.setEkgrp(approvalItemVo.getEkgrp());//采购组
}
//knttp审批要素没有值时,赋值0,防止发起流程时报错
if (StringUtil.isBlank(sapPurchaseApproval.getKnttp())){
sapPurchaseApproval.setKnttp("0");
} }
// String nextCode = codeGenerator.getNextCode("sapPurchaseApproval"); // String nextCode = codeGenerator.getNextCode("sapPurchaseApproval");
// sapPurchaseApproval.setBillCode(nextCode); // 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