Commit 7122eb0a authored by 1650842865's avatar 1650842865

非资产消耗性采购取科目分配类别是F;采购订单增加明细的备注字段

parent c5c6763c
......@@ -17,60 +17,8 @@ function initializeCommonUI() {
function bindEvent() {
fillinDate = $("#fillinDate").val();
$('#knttp').searchbox({
type: "system", name: "knttp",
getParam: function (item) {
return {
filterValue: $("#bsart").val()
}
},
onChange: function (value, data) {
initAufnr(data.knttp)
$('#knttp').val(data.knttp);
}
});
}
function initAufnr(knttp){
if (Public.isBlank(knttp)){
knttp = $('#knttp').val();
}
var columns = itemGridManager.columns;
//内部订单
columns.some(column => {
if (column.name == "aufnr"){
column.hide = knttp == 'F'? false:true;
if (typeof(getSubProcUnitId) =='function'&&"financeNode" == getSubProcUnitId()){
column.editor.required = knttp == 'F'? true:false;
}
return true;
}
return false;
})
//成本中心
columns.some(column => {
if (column.name == "kostlName"){
column.hide = knttp == 'F'? true:false;
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;
rows.forEach(row =>{
itemGridManager.updateRow(row,{aufnr:""})
})
}
}
columns.splice(0,2)
UICtrl.setGridColumns(itemGridManager,columns);
}
function initItemGrid() {
var canEdit = true;
if( typeof(isApplyProcUnit) =='function') {
......@@ -78,16 +26,9 @@ function initItemGrid() {
canEdit = false;
}
}
if( typeof(getSubProcUnitId) =='function') {
if ("financeNode" == getSubProcUnitId()) {
canEdit = true;
}
}
var toolbar = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
if (Public.isBlank($("#knttp").val())){
Public.tip("请先选择科目分配类别");
}else {
UICtrl.addGridRow(itemGridManager, {
bnfpo: (itemGridManager.getData().length + 1) * 10,
pstyp: pstyp,
......@@ -100,7 +41,6 @@ function initItemGrid() {
waersName: "人民币",
waers: "CNY"
});
}
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
......@@ -148,36 +88,8 @@ function initItemGrid() {
autoApplyNextEditor: false,
toolbar: toolbar,
onBeforeEdit: function (editParm) {
// var c = editParm.column, data = editParm.record;
// //非资产类消耗性采购申请类型当“科目分配类型”选择K后“物料编号”字段调整为非必须输入项;“成本中心”、“总账科目”字段调整为必须输入项。订单号不可编辑。
// if ("ZNE2" == bsart && (data.knttp == "K"|| data.knttp == "F" ) && c.name === 'kostl') {
// return true;
// }else {
// return false;
// }
// //仅适用于KNTTP=F时
// if (("ZFW" == bsart || "ZNE2" == bsart) && data.knttp == "F" && c.name === 'aufnr') {
// return true;
// }else {
// return false;
// }
// //仅适用于KNTTP=A时
// if (data.knttp == 'A' && c.name === 'anln1') {
// return true;
// }else {
// return false;
// }
},
onAfterEdit: function (editParm) {
// if (editParm.record.knttp === "K") {
// var colums = itemGridManager.columns;
// colums.forEach(colum => {
// if (colum.name == "matnr") {
// colum.editor.required = false;
// itemGridManager.columns = colums
// }
// })
// }
}
}
);
......@@ -186,97 +98,6 @@ function initItemGrid() {
function getGridColumns() {
var columns = [];
if (typeof(getSubProcUnitId) =='function'&&"financeNode" == getSubProcUnitId()){
columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
},);
columns.push({display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string", hide: true},);
columns.push({
display: "工厂", name: "werks", width: "100", align: "left", type: "string",
},);
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: "lgort", width: "100", align: "left", type: "string",
},);
columns.push({
display: "库存地点名称", name: "lgobe", width: "200", align: "left", type: "string",
},);
columns.push({
display: "短文本", name: "txz01", width: "200", align: "left", type: "string",
},);
columns.push({
display: "物料组", name: "matklName", width: "100", align: "left", type: "string",
},);
columns.push({
display: "申购数量", name: "menge", width: 150, minWidth: 60, type: "string", align: "center",
},);
columns.push({
display: "申购数量单位", name: "meinsName", width: 150, minWidth: 60, type: "string", align: "center",
},);
columns.push({
display: "采购组", name: "ekgrpName", width: 150, minWidth: 60, type: "string", align: "center",
},);
columns.push({
display: "批准日期", name: "frgdt", width: "100", align: "left", type: "string",
},);
columns.push({
display: "要求交货日期", name: "lfdat", width: "100", align: "left", type: "string",
},);
columns.push({display: "创建者", name: "ernam", width: "200", align: "left", type: "string"},);
columns.push({
display: "申请人", name: "afnam", width: "90", align: "left", type: "string",
},);
columns.push({
display: "预估单价", name: "preis", width: "100", align: "left", type: "string",
},);
columns.push({
display: "价格基数", name: "ebanPeinh", width: "100", align: "left", type: "string",
},);
columns.push({
display: "币种", name: "waersName", width: "100", align: "left", type: "string",
},);
columns.push({
display: "评估金额", name: "ebanNetwr", width: "100", align: "left", type: "string",
},);
columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
},);
//填订单类型是Z01或者Z02的
columns.push({
display: "订单号", name: "aufnr", width: "200", align: "left", type: "string",
editor: {type: 'text', required: true,}
});
// columns.push({
// display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "dictionary",
// getParam: function (item) {
// return {
// fieldName: "SAKTO",
// filterValue:'6600'
// }
// },
// back: {
// SAKNR:'sakto',
// }
// },
// }
// },);
columns.push({
display: "申请日期", name: "badat", width: "100", align: "left", type: "string",
},);
columns.push({
display: "创建日期", name: "erdat", width: "100", align: "left", type: "string",
},);
}else {
columns.push({
display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
//editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
......@@ -304,34 +125,6 @@ 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: "lgort", width: "100", align: "left", type: "string",
editor: {
......@@ -358,7 +151,6 @@ function getGridColumns() {
},);
columns.push({
display: "库存地点名称", name: "lgobe", width: "200", align: "left", type: "string",
//editor: {required: false, type: "text"}
},);
columns.push({
display: "短文本", name: "txz01", width: "200", align: "left", type: "string",
......@@ -497,7 +289,7 @@ function getGridColumns() {
columns.push({
display: "成本中心", name: "kostlName", width: "200", align: "left", type: "string",
editor: {
required: false, type: "select",
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
......@@ -511,37 +303,13 @@ function getGridColumns() {
},
}
},);
columns.push({
display: "订单号", name: "aufnr", width: "200", align: "left", type: "string",
});
// columns.push({
// display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "dictionary",
// getParam: function (item) {
// return {
// fieldName: "SAKTO",
// filterValue:'6600'
// }
// },
// back: {
// SAKNR:'sakto',
// }
// },
// }
// },);
columns.push({
display: "申请日期", name: "badat", width: "100", align: "left", type: "string",
editor: {required: false, type: "date"}
},);
columns.push({
display: "创建日期", name: "erdat", width: "100", align: "left", type: "string",
//editor: {required: false, type: "date"}
},);
}
return columns;
}
......@@ -568,16 +336,6 @@ function getExtendedData(processAction) {
Public.tip("采购项次不能为空");
return false;
}
var checked6 = false;
datas.forEach(data => {
if ("F" == data.knttp && Public.isBlank(data.aufnr)){
checked6 = true;
}
})
// if (checked6) {
// Public.tip("订单号不能为空")
// return false;
// }
extendedData.sapPurchaseItems = Public.encodeJSONURI(datas);
}
return extendedData;
......@@ -606,20 +364,6 @@ function getGridData() {
return datas;
}
//UICtrl中校验是否允许编辑
function businessJudgmentUnit() {
var isApply = isApplyProcUnit();
if (isApply) {
return true;
}else {
//财务节点
if (typeof(getSubProcUnitId) =='function'&&"financeNode" === getSubProcUnitId()){
UICtrl.disable("#knttp");
return true;
}
return false;
}
return true;
}
//UICtrl中校验是否允许编
......@@ -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="科目分配类别" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="banfn" label="采购申请编号" readonly="true" labelCol="1" fieldCol="2" required="false"/>
</div>
</div>
......
......@@ -220,9 +220,8 @@ function loadSuppliersItemPeriodListGrid() {
{
// 行号加一
sequence: (sapSuppliersItemPeriodGridManager.getData().length + 1)*10,
ltsnr: (sapSuppliersItemPeriodGridManager.getData().length + 1)*10,
webre:"X",
waers:"CNY",
waersTextView:"CNY-人民币",
kalsk:"Z1",
telf1: $("#buGroup").val() == "Z005" ? $("#mobNumber").val():""
......@@ -265,6 +264,9 @@ function loadSuppliersItemPeriodListGrid() {
if (c.name == 'telf1' && $("#buGroup").val() == "Z005") {
$("#mobNumber").val(data.telf1)
}
if (c.name == 'waersTextView' ) {
sapSuppliersItemPeriodGridManager.updateRow(data,{ltsbz:data.ltsnr+"-"+ data.waersTextView});
}
},
});
UICtrl.setSearchAreaToggle(sapSuppliersItemPeriodGridManager);
......@@ -276,13 +278,26 @@ function getItemPeriodColumns(){
display: "行号", name: "sequence", width: 80, minWidth: 60, type: "String", align: "left",
//editor: {type: 'spinner', min: 1, max: 100, mask: 'nnn'}
},)
columns.push({
display: "采购组织", name: "ekorgTextView", width: 200, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'ekorg'},
textField: 'ekorgTextView',
valueField: 'ekorg',
required: true,
render: function (item) {
return item.ekorgTextView;
}
},
},)
columns.push({
display: "供应商子范围", name: "ltsnr", width: 100, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: true}
//editor: {type: 'text', required: true}
},)
columns.push({
display: "供应商子范围描述", name: "ltsbz", width: 120, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: true}
//editor: {type: 'text', required: true}
},)
// columns.push({
// display: "工厂", name: "werks", width: 100, minWidth: 60, type: "String", align: "left",
......
......@@ -97,7 +97,7 @@ public class ResourceSearchController {
mapList.add(map);
}
} else if ("ZNE2".equals(filterValue)) {
if ("F".equals(key) || "K".equals(key)) {
if ("K".equals(key)) {
mapList.add(map);
}
}
......
......@@ -187,14 +187,13 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
String execute = httpClient.execute(sapPurchaseVo, url);
List<SapResult> resultList = JSONObject.parseArray(execute, SapResult.class);
SapResult sapResult = resultList.get(0);
resultMap.put("TYPE", sapResult.getTYPE());
resultMap.put("MESSAGE", sapResult.getMESSAGE());
if (!"S".equals(sapResult.getTYPE())){
List<String> messages = resultList
.stream()
.map(SapResult::getMESSAGE).collect(Collectors.toList());
throw new RuntimeException("数据传输失败,"+ String.join(";",messages));
} else {
resultMap.put("TYPE", sapResult.getTYPE());
resultMap.put("MESSAGE", sapResult.getMESSAGE());
}
sapPurchase.setBanfn(sapResult.getMESSAGE_V1());//SAP采购申请编号
sapPurchaseRepository.save(sapPurchase);
......
......@@ -89,6 +89,7 @@ public class SapPurchaseController extends CommonController {
case "ZFW"://服务类采购申请
return forward("sapPurchaseDetail",sapPurchase);
case "ZNE2"://非资产类消耗性采购申请
sapPurchase.setKnttp("K");
return forward("sapZNE2PurchaseDetail",sapPurchase);
}
return null;
......
......@@ -30,4 +30,12 @@ public class SapPurchaseVo implements Serializable {
public void setItemVos(List<SapPurchaseItemVo> itemVos) {
this.itemVos = itemVos;
}
public String getBsart() {
return bsart;
}
public List<SapPurchaseItemVo> getItemVos() {
return itemVos;
}
}
......@@ -495,6 +495,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
String zpacknum = purchaseOrderItem.getZpackrequnum();
String zpackunit = purchaseOrderItem.getZpackunit();
String zlosspack = purchaseOrderItem.getZlosspack();
String ltext = purchaseOrderItem.getLtext();
if (StringUtil.isNotBlank(zpackrequ)){
strList.add(zpackrequ);
}
......@@ -507,6 +508,9 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
if (StringUtil.isNotBlank(zlosspack)){
strList.add(zlosspack);
}
if (StringUtil.isNotBlank(ltext)){
strList.add(ltext);
}
if (StringUtil.isNotBlank(vbeln)){
headText2 = headText2 + vbeln + ":"+ String.join(";", strList);
}
......
......@@ -280,4 +280,9 @@ public class SapPurchaseOrderItem extends AbstractEntity {
@Column(name="ZLOSSPACK")
private String zlosspack;
/**
* 备注
*/
@Column(name = "LTEXT")
private String ltext;
}
\ No newline at end of file
......@@ -181,4 +181,10 @@ public class SapPurchaseOrderItemVo {
@JsonProperty("ZLOSSPACK")
private String zlosspack;
/**
* 备注
*/
@JsonProperty("LTEXT")
private String ltext;
}
\ No newline at end of file
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