Commit cab83b03 authored by 鲁鑫's avatar 鲁鑫

采购申请对订单字段进行控制

parent 3591efaf
......@@ -3,6 +3,7 @@ $(function () {
initializeCommonUI();
bindEvent();
initItemGrid();
initAufnr();
});
function initializeCommonUI() {
......@@ -15,17 +16,58 @@ 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;
column.editor.required = knttp == 'F'? true:false;
return true;
}
return false;
})
if ("K" == knttp){
var rows = itemGridManager.currentData.Rows;
rows.forEach(row =>{
itemGridManager.updateRow(row,{aufnr:""})
})
}
columns.splice(0,2)
UICtrl.setGridColumns(itemGridManager,columns);
}
function initItemGrid() {
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,
badat: fillinDate,
erdat: fillinDate
erdat: fillinDate,
knttp: $("#knttp").val()
});
}
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
......@@ -101,22 +143,22 @@ function getGridColumns() {
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: "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: {
......@@ -256,7 +298,7 @@ function getGridColumns() {
columns.push({display: "创建者", name: "ernam", width: "200", align: "left", type: "string"},);
columns.push({
display: "申请人", name: "afnam", width: "90", align: "left", type: "string",
editor: {type: 'text', required: false},
editor: {type: 'text', required: true},
},);
columns.push({
display: "预估单价", name: "preis", width: "100", align: "left", type: "string",
......@@ -309,31 +351,31 @@ function getGridColumns() {
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;
}
}
// 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;
}
}
// 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: "sakto", width: "100", align: "left", type: "string",
// editor: {type: 'text', required: true}
// },);
columns.push({
display: "成本中心", name: "kostl", width: "200", align: "left", type: "string",
editor: {
......
......@@ -29,6 +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="banfn" label="采购申请编号" readonly="true" labelCol="1" fieldCol="2" required="false"/>
</div>
</div>
......
......@@ -16,6 +16,17 @@ function initializeCommonUI() {
function bindEvent() {
fillinDate = $("#fillinDate").val();
$('#knttp').searchbox({
type: "system", name: "knttp",
getParam: function (item) {
return {
filterValue: $("#bsart").val()
}
},
onChange: function (value, data) {
$('#knttp').val(data.knttp);
}
});
}
function initItemGrid() {
......@@ -102,22 +113,22 @@ function getGridColumns() {
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: "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: {
......@@ -303,10 +314,10 @@ function getGridColumns() {
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({
// display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
// editor: {type: 'text', required: false}
// },);
columns.push({
display: "资产编号", name: "anln1", width: "200", align: "left", type: "string",
editor: {
......
......@@ -29,6 +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="banfn" label="采购申请编号" readonly="true" labelCol="1" fieldCol="2" required="false"/>
</div>
</div>
......
......@@ -159,6 +159,7 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
sapPurchaseItemList.forEach(sapPurchaseItem -> {
SapPurchaseItemVo sapPurchaseItemVo = new SapPurchaseItemVo();
BeanUtil.copyProperties(sapPurchaseItem,sapPurchaseItemVo);
sapPurchaseItemVo.setKnttp(sapPurchase.getKnttp());
sapPurchaseItemVo.setBillCode(sapPurchase.getBillCode());
sapPurchaseItemVo.setErnam(sapPurchase.getPersonMemberName());
if (sapPurchaseItem.getBadat() != null){
......
......@@ -35,6 +35,12 @@ public class SapPurchase extends FlowBillAbstractEntity {
@Column(name = "FRGDT")
private Date frgdt;
/**
* 科目分配类别
*/
@Column(name = "KNTTP")
private String knttp;
private static final long serialVersionUID = 1L;
@Override
......
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