Commit c13e830a by yukang

合同管理

parent 6c8f42bf
...@@ -267,9 +267,6 @@ public class HGCW002 extends DaoEPBase { ...@@ -267,9 +267,6 @@ public class HGCW002 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TAX_POINTS); eiColumn = new EiColumn(FIELD_TAX_POINTS);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("税点"); eiColumn.setDescName("税点");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -96,6 +96,9 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -96,6 +96,9 @@ public class ServiceHGCW002 extends ServiceBase {
HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO); HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId()); HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId());
} else { } else {
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.modify(HGCW002); this.modify(HGCW002);
} }
} }
......
...@@ -38,14 +38,10 @@ public class ServiceHGCW002B extends ServiceBase { ...@@ -38,14 +38,10 @@ public class ServiceHGCW002B extends ServiceBase {
@OperationLogAnnotation(operModul = "修改合同",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "修改合同",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
String id = inInfo.getString("id"); String id = inInfo.getString("id");
HGCW002 HGCW002 = HGCWTools.HgCw002.getId(id); HGCW002 HGCW002 = HGCWTools.HgCw002.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW002); inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW002);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){
{put("projCode",HGCW002.getProjCode());}
}, false);
//获取清单 //获取清单
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(HGCW002.getContractNumber()); List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(HGCW002.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw003List); inInfo.addBlock("detail1").addRows(hgcw003List);
......
...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW003; import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -67,25 +68,29 @@ public class ServiceHGCW003 extends ServiceBase { ...@@ -67,25 +68,29 @@ public class ServiceHGCW003 extends ServiceBase {
*/ */
@OperationLogAnnotation(operModul = "合同清单",operType = "保存",operDesc = "保存") @OperationLogAnnotation(operModul = "合同清单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003(); HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i)); HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
if (HGCW003.getId() == null || HGCW003.getId() == 0) { if (HGCW003.getId() == null || HGCW003.getId() == 0) {
this.add(HGCW003); this.add(HGCW003);
} else { } else {
this.modify(HGCW003); this.modify(HGCW003);
} }
} }
// inInfo = this.query(inInfo); List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); eiInfo.addBlock("detail1").addRows(hgcw003List);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败"); LogUtils.setDetailMsg(inInfo, e, "保存失败");
} }
return inInfo; return eiInfo;
} }
/** /**
...@@ -108,54 +113,8 @@ public class ServiceHGCW003 extends ServiceBase { ...@@ -108,54 +113,8 @@ public class ServiceHGCW003 extends ServiceBase {
DaoUtils.update("HGCW003.update", HGCW003); DaoUtils.update("HGCW003.update", HGCW003);
} }
/** public void deleteEntity(HGCW003 HGCW003) {
* 新增操作 DaoUtils.update("HGCW003.delete", HGCW003);
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
DaoUtils.insert("HGCW003.insert", HGCW003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
DaoUtils.update("HGCW003.update", HGCW003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
} }
/** /**
...@@ -166,18 +125,25 @@ public class ServiceHGCW003 extends ServiceBase { ...@@ -166,18 +125,25 @@ public class ServiceHGCW003 extends ServiceBase {
*/ */
@OperationLogAnnotation(operModul = "合同清单",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "合同清单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW003.delete", resultRows.get(i)); HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
this.deleteEntity(HGCW003);
} }
inInfo = this.query(inInfo); List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); eiInfo.addBlock("detail1").addRows(hgcw003List);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败"); LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo; return eiInfo;
} }
/** /**
......
...@@ -3,7 +3,9 @@ package com.baosight.hggp.hg.cw.service; ...@@ -3,7 +3,9 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.ds.domain.HGDS002; import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.util.FileUtils; import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -89,6 +91,16 @@ public class ServiceHGCW999 extends ServiceEPBase { ...@@ -89,6 +91,16 @@ public class ServiceHGCW999 extends ServiceEPBase {
return inInfo; return inInfo;
} }
public void add(HGCW999 HGCW999) {
DaoUtils.insert("HGCW999.insert", HGCW999);
}
public void deleteEntity(HGCW999 HGCW999) {
DaoUtils.update("HGCW999.delete", HGCW999);
}
/** /**
* 新增操作 * 新增操作
* *
...@@ -98,19 +110,24 @@ public class ServiceHGCW999 extends ServiceEPBase { ...@@ -98,19 +110,24 @@ public class ServiceHGCW999 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作") @OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作")
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try { try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999(); HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i)); fSc002A.fromMap(resultRows.get(i));
DaoUtils.insert(HGCW999.INSERT, fSc002A); matId = fSc002A.getMatId();
this.add(fSc002A);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!"); eiInfo.addBlock("detail2").addRows(hgcw999List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败"); LogUtils.setDetailMsg(eiInfo, e, "新增失败");
} }
return inInfo; return eiInfo;
} }
/** /**
...@@ -121,23 +138,24 @@ public class ServiceHGCW999 extends ServiceEPBase { ...@@ -121,23 +138,24 @@ public class ServiceHGCW999 extends ServiceEPBase {
*/ */
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作") @OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); Long matId = null;
List<Map> resultRows = inInfo.getBlock("detail2").getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999(); HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i)); fSc002A.fromMap(resultRows.get(i));
DaoUtils.update(HGCW999.DELETE, fSc002A); matId = fSc002A.getMatId();
// if (!fSc002A.getDocId().isEmpty()) { this.deleteEntity(fSc002A);
// this.delectDoc(fSc002A.getDocId()); }
// } List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
} eiInfo.addBlock("detail2").addRows(hgcw999List);
inInfo = this.query(inInfo); eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败"); LogUtils.setDetailMsg(eiInfo, e, "删除失败");
} }
return inInfo; return eiInfo;
} }
/** /**
......
...@@ -33,10 +33,10 @@ $(function() { ...@@ -33,10 +33,10 @@ $(function() {
var totalPriceIncluding = 0; var totalPriceIncluding = 0;
var valueAddedTax = 0; var valueAddedTax = 0;
allRows.forEach(function (row, index) { allRows.forEach(function (row, index) {
totalPriceExcluding += row.totalPriceExcluding; totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += row.totalPriceIncluding; totalPriceIncluding += parseFloat(row.totalPriceIncluding);
}); });
valueAddedTax = totalPriceIncluding - totalPriceExcluding; valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3)) $("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3)) $("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3)) $("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
...@@ -230,10 +230,10 @@ function uploadFileFunc() { ...@@ -230,10 +230,10 @@ function uploadFileFunc() {
* *
* @param docId * @param docId
*/ */
function uploadFileCallback(docId) { function uploadFileCallback(data) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-docId", docId); inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val()); inEiInfo.set("result-0-bizType", data.bizType);
EiCommunicator.send('HGCW999', 'insert', inEiInfo, { EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(response) { onSuccess(response) {
if (response.status === 0) { if (response.status === 0) {
......
$(function() { $(function() {
initDate();
$("#cancel").on("click", function () { $("#cancel").on("click", function () {
cancelFunc(); cancelFunc();
}); });
...@@ -24,32 +22,31 @@ $(function() { ...@@ -24,32 +22,31 @@ $(function() {
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
// 计算总金额 // 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() : 0; var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax; var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints)); var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding); detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding); detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
console.log(grid.dataSource._data); calculateAmount();
console.log(detail1Grid.getDataItems());
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += row.totalPriceExcluding;
totalPriceIncluding += row.totalPriceIncluding;
});
valueAddedTax = totalPriceIncluding - totalPriceExcluding;
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
} }
}); });
setTimeout(function() {
initDate();
}, 1000);
},
onAdd: function (e) {
var contractNumber = $("#result-0-contractNumber").val();
$.each(e.items, function (index, item) {
item['contractNumber'] = contractNumber;
});
}, },
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
saveResult1Func(); let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveResult1Func(btnNode);
}, },
onDelete: function (e) { onDelete: function (e) {
// 阻止默认请求,使用自定义删除 // 阻止默认请求,使用自定义删除
...@@ -63,6 +60,9 @@ $(function() { ...@@ -63,6 +60,9 @@ $(function() {
}); });
$("#DELETE_FILE").on("click", function () { $("#DELETE_FILE").on("click", function () {
// let btnNode = $(this);
//禁用按钮
// btnNode.attr("disabled", true);
deleteFileFunc(); deleteFileFunc();
}); });
IPLATUI.EFGrid.detail2 = { IPLATUI.EFGrid.detail2 = {
...@@ -215,9 +215,9 @@ $(function() { ...@@ -215,9 +215,9 @@ $(function() {
}) })
}); });
function initDate() { function initDate() {
setTimeout(function() {
var projCode = $("#result-0-projCode").val(); var projCode = $("#result-0-projCode").val();
$("#projCodeBox").val(projCode) $("#projCodeBox").data("kendoDropDownList").value(projCode);
var contractCategory = $("#result-0-contractCategory").val() var contractCategory = $("#result-0-contractCategory").val()
if (contractCategory == "1" || contractCategory == "3") { if (contractCategory == "1" || contractCategory == "3") {
$("#contractCategoryName").val("收入"); $("#contractCategoryName").val("收入");
...@@ -226,17 +226,59 @@ function initDate() { ...@@ -226,17 +226,59 @@ function initDate() {
} else { } else {
$("#contractCategoryName").val(""); $("#contractCategoryName").val("");
} }
}, 3000); var partyA = $("#result-0-partyA").val();
var partyB = $("#result-0-partyB").val();
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
} }
function saveResult1Func() { function saveResult1Func(btn) {
let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW003", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
NotificationUtil(response.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//释放禁用按钮
btn.attr("disabled", false);
}
});
} }
function uploadFileFunc() { function uploadFileFunc() {
var id = $("#result-0-id").val();
JSColorbox.open({ JSColorbox.open({
href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=HT", href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件上传</div>", title: "<div style='text-align: center;'>附件上传</div>",
width: "60%", width: "60%",
height: "50%", height: "50%",
...@@ -248,35 +290,30 @@ function uploadFileFunc() { ...@@ -248,35 +290,30 @@ function uploadFileFunc() {
* *
* @param docId * @param docId
*/ */
function uploadFileCallback(docId) { function uploadFileCallback(data) {
debugger;
console.log("uploadFileCallback")
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-docId", docId); inEiInfo.set("result-0-matId", data.matId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val()); inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-bizType", data.bizType);
EiCommunicator.send('HGCW999', 'insert', inEiInfo, { EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(response) { onSuccess(ei) {
if (response.status === 0) { if (ei.status === 0) {
EiCommunicator.send('HGCW999', 'queryDoc', inEiInfo, { try {
onSuccess(e) { NotificationUtil(ei.msg);
console.log(e); } catch (e) {
if (e.status === 0) { // TODO: handle exception
let data = e.extAttr.data;
detail2Grid.dataSource.insert();
detail2Grid.setCellValue(0, "rowNo", 0);
detail2Grid.setCellValue(0, "id", data.id);
detail2Grid.setCellValue(0, "docId", data.docId);
detail2Grid.setCellValue(0, "docName", data.docName);
detail2Grid.setCellValue(0, "createdTime", data.createdTime);
detail2Grid.refresh();
} else {
NotificationUtil("执行失败!", "error");
} }
}, if (IPLAT.isAvailable("detail2")) {
onFail(errorMessage, status, e) { window['detail2Grid'].setEiInfo(ei);
NotificationUtil("执行失败!", "error"); }
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
} }
}, {
async: false
});
} else { } else {
NotificationUtil("执行失败!", "error"); NotificationUtil("执行失败!", "error");
} }
...@@ -297,7 +334,7 @@ function cancelFunc() { ...@@ -297,7 +334,7 @@ function cancelFunc() {
function btnSaveFunc() { function btnSaveFunc() {
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback}); JSUtils.submitGrid("result", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
} }
}); });
} }
...@@ -307,10 +344,41 @@ function deleteFileFunc() { ...@@ -307,10 +344,41 @@ function deleteFileFunc() {
message("请选择数据"); message("请选择数据");
return; return;
} }
rows.forEach(function (row) { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
detail2Grid.removeRows([rows.rowNo]);// 刷新行号 ok: function () {
}) var info = new EiInfo();
refreshRowNo(); info.addBlock(JSUtils.checkedRows2Block("detail2"));
EiCommunicator.send("HGCW999", "delete", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
NotificationUtil(ei.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail2")) {
window['detail2Grid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//释放禁用按钮
// btn.attr("disabled", false);
}
});
} }
function deleteResult1Func() { function deleteResult1Func() {
let rows = detail1Grid.getCheckedRows(); let rows = detail1Grid.getCheckedRows();
...@@ -318,22 +386,54 @@ function deleteResult1Func() { ...@@ -318,22 +386,54 @@ function deleteResult1Func() {
message("请选择数据"); message("请选择数据");
return; return;
} }
rows.forEach(function (row) { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除1\"操作? ", {
detail1Grid.removeRows([rows.rowNo]);// 刷新行号 ok: function () {
}) var info = new EiInfo();
refreshRowNo(); info.addBlock(JSUtils.checkedRows2Block("detail1"));
} EiCommunicator.send("HGCW003", "delete", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
NotificationUtil(response.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei);
calculateAmount();
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
let refreshRowNo = function () { },
let allRows = detail1Grid.getDataItems(); onFail: function (ei) {
for (let i = 0; i < allRows.length; i++) { // 发生异常
detail1Grid.setCellValue(i, "rowNo", i); NotificationUtil("操作失败,原因[" + ei + "]", "error");
detail1Grid.refresh();
} }
});
}
});
} }
$(window).load(function () { function calculateAmount() {
refreshRowNo();
});
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
<EF:EFPage title="修改合同"> <EF:EFPage title="修改合同">
<EF:EFRegion id="inqu1" title="基本信息"> <EF:EFRegion id="inqu1" title="基本信息">
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions <EF:EFOptions
...@@ -111,8 +113,8 @@ ...@@ -111,8 +113,8 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单"> <EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="contractNumber" cname="合同号" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" /> <EF:EFColumn ename="inventory" cname="清单" align="center" />
<EF:EFColumn ename="unit" cname="单位" align="center" /> <EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center"/> <EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center"/>
...@@ -126,8 +128,8 @@ ...@@ -126,8 +128,8 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息"> <EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="matId" cname="matId" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
......
...@@ -10,10 +10,19 @@ $(function () { ...@@ -10,10 +10,19 @@ $(function () {
} }
$("#fileDocId").val(docId); $("#fileDocId").val(docId);
NotificationUtil("附件上传成功"); NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val();
var bizType = $("#inqu_status-0-bizType").val();
console.log($("#fileDocId").val()) console.log($("#fileDocId").val())
console.log($("#inqu_status-0-matId").val())
console.log($("#inqu_status-0-bizType").val())
var data = {
docId: docId,
matId: matId,
bizType: bizType
}
// saveTemp(e); // saveTemp(e);
try { try {
parent.JSColorbox.setValueCallback(docId); parent.JSColorbox.setValueCallback(data);
} catch (e){ } catch (e){
} }
}, },
......
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