Commit c5d4f9f8 authored by 1650842865's avatar 1650842865

打样工序外协审批流程;统计外协数量和总金额

parent fa51b078
......@@ -97,8 +97,9 @@ function loadOrderItemGrid() {
idFieldName: 'id',
onSuccess: function () {
orderItemGridManager.loadData();
}
},
});
amountChange();
}
});
......@@ -132,15 +133,46 @@ function loadOrderItemGrid() {
orderItemGridManager.updateRow(item.record,{
kbetr:data.unitPrice,
purchaseMwskzTextView:data.purchaseMwskzTextView,
purchaseMwskz:data.purchaseMwskz
purchaseMwskz:data.purchaseMwskz,
amount: data.unitPrice * item.record.menge
})
amountChange();
})
}
if(item.column.name == "kbetr" || item.column.name == "menge"){
orderItemGridManager.updateRow(item.record,{
amount: item.record.kbetr * item.record.menge
})
amountChange();
}
},
onAfterShowData:function (item) {
amountChange();
}
});
UICtrl.setSearchAreaToggle(orderItemGridManager);
}
/**
* 计算数量和金额
*/
function amountChange(){
var _grid = UICtrl.getGridManager('#orderItemGrid');
if (_grid != null ){
var datas = _grid.rows;
if (datas.length > 0 ){
var mengs = 0,//总数量
amount = 0;//总价合计
$.each(datas, function (i, data) {
mengs = MathUtil.add(mengs,data.menge);
amount = MathUtil.add(amount,data.amount);
});
$("#mengs").val(mengs);
$("#amount").val(amount);
}
}
}
function getOrderColumns(){
var columns = [];
columns.push({display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"});
......@@ -283,6 +315,9 @@ function getOrderColumns(){
type: "text", mask: '9999999.999', required: true
}
},);
columns.push({
display: "总价", name: "amount", width: 140, minWidth: 60, type: "money", align: "left",
},);
columns.push({
display: "定价基数", name: "kpein", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
......@@ -339,6 +374,9 @@ function getOrderColumns(){
columns.push({
display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left",
},);
columns.push({
display: "总价", name: "amount", width: 140, minWidth: 60, type: "money", align: "left",
},);
columns.push({
display: "定价基数", name: "kpein", width: 140, minWidth: 60, type: "string", align: "left",
},);
......@@ -455,17 +493,6 @@ function getExtendedData(processAction) {
if (!datas) {
return false;
}
if (isApplyProcUnit()){
for (let i = 0; i < datas.length; i++) {
var data = datas[i];
var regex = /^\d{4}-\d{2}-\d{2}$/;
var regex2 = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
if (!regex.test(data.eeind) && !regex2.test(data.eeind)) {
Public.tip("序号为:"+data.sequence+" 的行项目需求日期格式应为:年-月-日");
return false; // 格式不匹配
}
}
}
if ("outer" == getSubProcUnitId()){
for (let i = 0; i < datas.length; i++) {
var data = datas[i];
......@@ -519,17 +546,6 @@ function checkConstraints(){
if (!orderItemdatas) {
return false;
}
if (isApplyProcUnit()){
for (let i = 0; i < orderItemdatas.length; i++) {
var data = orderItemdatas[i];
var regex = /^\d{4}-\d{2}-\d{2}$/;
var regex2 = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
if (!regex.test(data.eeind) && !regex2.test(data.eeind)) {
Public.tip("序号为:"+data.sequence+" 的行项目需求日期格式应为:年-月-日");
return false; // 格式不匹配
}
}
}
if (isApplyProcUnit() && orderItemdatas.length == 0){
Public.tip("订单行项目信息必填");
return false;
......
......@@ -28,7 +28,10 @@
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="werks"/>
<x:inputC name="werksName" label="工厂" labelCol="2" fieldCol="2" required="true" wrapper="select"/>
<x:inputC name="werksName" label="工厂" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:selectC name="processOutType" label="工序外协类别" labelCol="1" fieldCol="2" required="true" dictionary="processOutType"/>
<x:inputC name="mengs" label="数量" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="amount" label="金额" labelCol="1" fieldCol="2" readonly="true"/>
</div>
<div class="hg-form-row">
<x:textareaC name="situationDesc" label="情况说明" labelCol="2" fieldCol="10" required="true" rows="3"/>
......
......@@ -29,6 +29,14 @@ public class ProcessOutsource extends FlowBillAbstractEntity {
@Column(name = "situation_desc")
private String situationDesc;
/**
* 工序外协类别
* normal 常规
* proofing 打样
*/
@Column(name = "process_out_type")
private String processOutType;
@Override
protected String getCodeRuleId() {
return "processOutsource";
......
......@@ -173,4 +173,10 @@ public class ProcessOutsourceOrderItem extends AbstractEntity {
@Column(name = "PRODUCT_TYPE_NAME")
private String productTypeName;
/**
* 总价
*/
@Column(name = "amount")
private BigDecimal amount;
}
......@@ -56,6 +56,7 @@
t.LIFNR,
t.LIFNR_NAME,
t.KBETR,
t.AMOUNT,
t.PURCHASE_MWSKZ,
t.KPEIN,
t.WAERS,
......
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