Commit 294bfa0c by 宋祥

1.采购收货BUG修复

parent 2ed3b447
$(function () {
var inventRecordBoxBlockId = __eiInfo.getBlock("invent_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
......@@ -7,16 +8,15 @@ $(function () {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
columns: [{
field: "inventCode",
template: function (item) {
let template = item.inventCode;
if(item.inventCode){
for(let i=0;i<inventRecordBoxBlockId.length;i++){
if(item.inventCode === inventRecordBoxBlockId[i]['valueField']){
if (item.inventCode) {
for (let i = 0; i < inventRecordBoxBlockId.length; i++) {
if (item.inventCode === inventRecordBoxBlockId[i]['valueField']) {
template = inventRecordBoxBlockId[i]['valueField'];
}else{
} else {
template = item.inventCode;
}
}
......@@ -49,22 +49,20 @@ $(function () {
filter: "contains"
});
}
},
{
}, {
field: "primaryId",
template: function (item) {
item['primaryId'] =$("#inqu_status-0-primaryId").val();
item['primaryId'] = $("#inqu_status-0-primaryId").val();
return $("#inqu_status-0-primaryId").val();
}
}
],
}],
beforeEdit: function (e) {
var status = $("#status").val();
if(status != '0'){
if (status != '0') {
e.preventDefault();
}
var source = $("#source").val();
if(source === '0'){
if (source === '0') {
//选择合同的明细不能修改存货信息
for (let i = 0; i < e.sender.columns.length; i++) {
//指定的列不让修改
......@@ -77,7 +75,6 @@ $(function () {
}
}
}
},
loadComplete: function (grid) {
// 此grid对象
......@@ -170,23 +167,23 @@ $(window).load(function () {
* @param coefficient
*/
let calAmount = function (item) {
let price = item.price;
//计算方式为重量乘单价
if(item.calculationMethod == 1){
if(item.receiveWeight && item.price){
if (item.calculationMethod == 1) {
let receiveWeight = item.receiveWeight;
if (!isBlank(receiveWeight) && !isBlank(price)) {
// 重量*单价金额
let totalAmount = item.receiveWeight * item.price;
let totalAmount = parseFloat(receiveWeight) * parseFloat(price);
resultGrid.setCellValue(item, 'amount', totalAmount)
}
}else{
if(item.receiveQty && item.price){
if(item.receiveQty && item.price){
// 重量*单价金额
let totalAmount = item.receiveQty * item.price;
} else {
let receiveQty = item.receiveQty;
if (!isBlank(receiveQty) && !isBlank(price)) {
// 数量*单价金额
let totalAmount = parseFloat(receiveQty) * parseFloat(price);
resultGrid.setCellValue(item, 'amount', totalAmount)
}
}
}
}
/**
......
......@@ -51,7 +51,7 @@
sumType="page"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right" format="{0:N3}"
hidden="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center" required="true">
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="120" align="center" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod" />
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
......
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