Commit cab83b03 authored by 鲁鑫's avatar 鲁鑫

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

parent 3591efaf
...@@ -3,6 +3,7 @@ $(function () { ...@@ -3,6 +3,7 @@ $(function () {
initializeCommonUI(); initializeCommonUI();
bindEvent(); bindEvent();
initItemGrid(); initItemGrid();
initAufnr();
}); });
function initializeCommonUI() { function initializeCommonUI() {
...@@ -15,17 +16,58 @@ function initializeCommonUI() { ...@@ -15,17 +16,58 @@ function initializeCommonUI() {
} }
function bindEvent() { function bindEvent() {
fillinDate = $("#fillinDate").val(); 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() { function initItemGrid() {
var toolbar = UICtrl.getDefaultToolbarOptions({ var toolbar = UICtrl.getDefaultToolbarOptions({
addHandler: function () { addHandler: function () {
UICtrl.addGridRow(itemGridManager, { if (Public.isBlank($("#knttp").val())){
bnfpo: (itemGridManager.getData().length + 1) * 10, Public.tip("请先选择科目分配类别");
pstyp: pstyp, }else {
badat: fillinDate, UICtrl.addGridRow(itemGridManager, {
erdat: fillinDate bnfpo: (itemGridManager.getData().length + 1) * 10,
}); pstyp: pstyp,
badat: fillinDate,
erdat: fillinDate,
knttp: $("#knttp").val()
});
}
}, },
deleteHandler: function () { deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid'); var _grid = UICtrl.getGridManager('#maingrid');
...@@ -101,22 +143,22 @@ function getGridColumns() { ...@@ -101,22 +143,22 @@ function getGridColumns() {
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({
display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string", // display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string",
editor: { // editor: {
required: true, type: "select", // required: true, type: "select",
data: { // data: {
type: 'system', // type: 'system',
name: "knttp", // name: "knttp",
getParam: function (item) { // getParam: function (item) {
return {filterValue: $("#bsart").val()} // return {filterValue: $("#bsart").val()}
}, // },
back: { // back: {
knttp: "knttp" // 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: {
...@@ -256,7 +298,7 @@ function getGridColumns() { ...@@ -256,7 +298,7 @@ function getGridColumns() {
columns.push({display: "创建者", name: "ernam", width: "200", align: "left", type: "string"},); columns.push({display: "创建者", name: "ernam", width: "200", align: "left", type: "string"},);
columns.push({ columns.push({
display: "申请人", name: "afnam", width: "90", align: "left", type: "string", display: "申请人", name: "afnam", width: "90", align: "left", type: "string",
editor: {type: 'text', required: false}, editor: {type: 'text', required: true},
},); },);
columns.push({ columns.push({
display: "预估单价", name: "preis", width: "100", align: "left", type: "string", display: "预估单价", name: "preis", width: "100", align: "left", type: "string",
...@@ -309,31 +351,31 @@ function getGridColumns() { ...@@ -309,31 +351,31 @@ function getGridColumns() {
columns.push({ columns.push({
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) {
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 // //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (item.knttp == "A" && item.menge > 1) { // if (item.knttp == "A" && item.menge > 1) {
return item.vrtkz = 1; // return item.vrtkz = 1;
} // }
} // }
},); },);
columns.push({ columns.push({
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) {
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 // //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (item.knttp == "A" && item.menge > 1) { // if (item.knttp == "A" && item.menge > 1) {
return item.twrkz = 1; // return item.twrkz = 1;
} // }
} // }
},); },);
columns.push({ columns.push({
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'}
},); },);
columns.push({ // columns.push({
display: "总账科目", name: "sakto", width: "100", align: "left", type: "string", // display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
editor: {type: 'text', required: true} // editor: {type: 'text', required: true}
},); // },);
columns.push({ columns.push({
display: "成本中心", name: "kostl", width: "200", align: "left", type: "string", display: "成本中心", name: "kostl", width: "200", align: "left", type: "string",
editor: { editor: {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +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="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>
......
...@@ -16,6 +16,17 @@ function initializeCommonUI() { ...@@ -16,6 +16,17 @@ function initializeCommonUI() {
function bindEvent() { function bindEvent() {
fillinDate = $("#fillinDate").val(); 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() { function initItemGrid() {
...@@ -102,22 +113,22 @@ function getGridColumns() { ...@@ -102,22 +113,22 @@ function getGridColumns() {
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({
display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string", // display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string",
editor: { // editor: {
required: true, type: "select", // required: true, type: "select",
data: { // data: {
type: 'system', // type: 'system',
name: "knttp", // name: "knttp",
getParam: function (item) { // getParam: function (item) {
return {filterValue: $("#bsart").val()} // return {filterValue: $("#bsart").val()}
}, // },
back: { // back: {
knttp: "knttp" // 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: {
...@@ -303,10 +314,10 @@ function getGridColumns() { ...@@ -303,10 +314,10 @@ function getGridColumns() {
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'}
},); },);
columns.push({ // columns.push({
display: "总账科目", name: "sakto", width: "100", align: "left", type: "string", // display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
editor: {type: 'text', required: false} // 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: {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +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="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>
......
...@@ -159,6 +159,7 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas ...@@ -159,6 +159,7 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
sapPurchaseItemList.forEach(sapPurchaseItem -> { sapPurchaseItemList.forEach(sapPurchaseItem -> {
SapPurchaseItemVo sapPurchaseItemVo = new SapPurchaseItemVo(); SapPurchaseItemVo sapPurchaseItemVo = new SapPurchaseItemVo();
BeanUtil.copyProperties(sapPurchaseItem,sapPurchaseItemVo); BeanUtil.copyProperties(sapPurchaseItem,sapPurchaseItemVo);
sapPurchaseItemVo.setKnttp(sapPurchase.getKnttp());
sapPurchaseItemVo.setBillCode(sapPurchase.getBillCode()); sapPurchaseItemVo.setBillCode(sapPurchase.getBillCode());
sapPurchaseItemVo.setErnam(sapPurchase.getPersonMemberName()); sapPurchaseItemVo.setErnam(sapPurchase.getPersonMemberName());
if (sapPurchaseItem.getBadat() != null){ if (sapPurchaseItem.getBadat() != null){
......
...@@ -35,6 +35,12 @@ public class SapPurchase extends FlowBillAbstractEntity { ...@@ -35,6 +35,12 @@ public class SapPurchase extends FlowBillAbstractEntity {
@Column(name = "FRGDT") @Column(name = "FRGDT")
private Date frgdt; private Date frgdt;
/**
* 科目分配类别
*/
@Column(name = "KNTTP")
private String knttp;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override @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