Commit 0bdac9e0 authored by 鲁鑫's avatar 鲁鑫

采购申请

parent db2b27d3
...@@ -41,7 +41,7 @@ function initItemGrid() { ...@@ -41,7 +41,7 @@ function initItemGrid() {
dataAction: 'server', dataAction: 'server',
url: web_app.name + '/sapPurchaseItem/querySapPurchaseItems.ajax', url: web_app.name + '/sapPurchaseItem/querySapPurchaseItems.ajax',
parms:{sapPurchaseId:getId()}, parms:{sapPurchaseId:getId()},
height: '99.6%', height: '95%',
heightDiff: -4, heightDiff: -4,
sortName: 'id', sortName: 'id',
sortOrder: 'asc', sortOrder: 'asc',
...@@ -51,8 +51,24 @@ function initItemGrid() { ...@@ -51,8 +51,24 @@ function initItemGrid() {
enabledEdit: true, enabledEdit: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true,
//autoApplyNextEditor:false, autoApplyNextEditor:false,
toolbar: toolbarOptions, toolbar: toolbarOptions,
onBeforeEdit: function (editParm) {
var c = editParm.column, data = editParm.record;
//仅适用于KNTTP=K时
if (data.knttp !== "K" && c.name === 'kostl') {
return false;
}
//仅适用于KNTTP=F时
if (data.knttp !== "F" && c.name === 'aufnr') {
return false;
}
//仅适用于KNTTP=A时
// 仅适用于KNTTP=A时
if (data.knttp !== 'A' && (c.name === 'anln1' || c.name === 'anln2')){
return false;
}
},
} }
); );
UICtrl.setSearchAreaToggle(itemGridManager); UICtrl.setSearchAreaToggle(itemGridManager);
...@@ -78,6 +94,7 @@ function getGridColumns() { ...@@ -78,6 +94,7 @@ function getGridColumns() {
knttp: "knttp" knttp: "knttp"
} }
}, },
onChange() {}
} }
}, },
{display: "工厂", name: "werks", width: "100", align: "left", type: "string", {display: "工厂", name: "werks", width: "100", align: "left", type: "string",
...@@ -112,7 +129,7 @@ function getGridColumns() { ...@@ -112,7 +129,7 @@ function getGridColumns() {
}, },
back: { back: {
MATNR: "matnr", MATNR: "matnr",
MAKTX: "maktx", MAKTX: "txz01",
MATKL: "matkl", MATKL: "matkl",
WGBEZ: "matklName", WGBEZ: "matklName",
EKGRP: "ekgrp", EKGRP: "ekgrp",
...@@ -120,7 +137,7 @@ function getGridColumns() { ...@@ -120,7 +137,7 @@ function getGridColumns() {
PEINH: "peinh", PEINH: "peinh",
MEINS: "meins", MEINS: "meins",
MSEHL: "meinsName", MSEHL: "meinsName",
LGORT: "lgort", LGFSB: "lgort",
LGOBE: "lgobe" LGOBE: "lgobe"
} }
}, },
...@@ -277,63 +294,91 @@ function getGridColumns() { ...@@ -277,63 +294,91 @@ function getGridColumns() {
editor: {type: 'text'}, editor: {type: 'text'},
render:function (item){ render:function (item){
//申购项次为消耗性采购时,从1开始步长为1自动编号,最大99 //申购项次为消耗性采购时,从1开始步长为1自动编号,最大99
if (item.knttp != ''){ // if (item.knttp != ''){
ZEBKN_NUM = ZEBKN_NUM + 1; // ZEBKN_NUM = ZEBKN_NUM + 1;
} // }
return item.zebkn = ZEBKN_NUM; return item.zebkn = item.menge;
} }
}, },
{display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string", {display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string",
//editor: {type: 'text'}, //editor: {type: 'text'},
render : function (item) { render : function (item) {
var bsart =$("#bsart").val();
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (bsart == "A" && item.menge > 1){ if (item.knttp == "A" && item.menge > 1){
return item.vrtkz = 1; return item.vrtkz = 1;
} }
} }
}, },
{display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string", {display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string",
editor: {type: 'text'}, editor: {type: 'text'},
/*render : function (item) { render : function (item) {
var bsart =$("#bsart").val();
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (bsart == "ZNE1" && item.menge > 1){ if (item.knttp == "A" && item.menge > 1){
return item.twrkz = 1; return item.twrkz = 1;
} }
}*/ }
}, },
{display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string", {display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string",
editor: {type: 'text'} editor: {type: 'text'}
}, },
{ {
display: "总账科目", name: "sakto", width: "100", align: "left", type: "string", display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
editor: {type: 'text'} editor: {type: 'text',required: true}
}, },
{ {
display: "成本中心", name: "kostl", width: "100", align: "left", type: "string", display: "成本中心", name: "kostl", width: "200", align: "left", type: "string",
/*editor: { editor: {
required: false, type: "select", required: false, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "KOSTL"} return {fieldName: "KOSTL"}
}, },
back: { back: {
KOSTL: "kostl" KOSTL: "kostl"
} }
}, },
}*/ }
editor: {required: false, type: "text"}
}, },
{ {
display: "订单号", name: "aufnr", width: "100", align: "left", type: "string", display: "订单号", name: "aufnr", width: "200", align: "left", type: "string",
editor: {type: 'text'} //editor: {type: 'text'}
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "getCompanyOrders",
getParam: function (item) {
return {
BUKRS: '1000'
}
},
back: {
AUFNR: "aufnr",
KTEXT: "ktext"
}
},
}
}, },
{ {
display: "主资产号", name: "anln1", width: "100", align: "left", type: "string", display: "主资产号", name: "anln1", width: "200", align: "left", type: "string",
editor: {type: 'text'} editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {
fieldName: "ANLN1",
filterValue: '1000'
}
},
back: {
ANLN1: "anln1"
}
},
}
}, },
{ {
display: "子资产号", name: "anln2", width: "100", align: "left", type: "string", display: "子资产号", name: "anln2", width: "100", align: "left", type: "string",
......
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