Commit 7f725784 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 61c814cc e92f2072
......@@ -123,6 +123,9 @@ public class ServiceHGCG003A extends ServiceBase {
AssertUtils.isTrue(!(HGConstant.CgContractStatus.S_2.equals(cg001.getStatus())
|| HGConstant.CgContractStatus.S_4.equals(cg001.getStatus())),
String.format("合同[%s]状态不是\"审核通过\"或\"收货中\",不允许操作", cg001.getContractNo()));
AssertUtils.isGe(BigDecimal.ZERO, fCg002B.getBcReceiveQty(),
String.format("合同[%s]本次收货数量(%s)必须大于0", cg001.getContractNo(),
fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty()));
AssertUtils.isGt(fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty(),
String.format("合同[%s]本次收货数量(%s)不能大于本次最大收货数量(%s)", cg001.getContractNo(),
fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty()));
......
......@@ -108,9 +108,8 @@ public class ServiceHGCW008 extends ServiceBase {
hgcw008.setReviewStatus(2);
hgcw008.setContractDate(DateUtils.formatShort(hgcw008.getContractDate()));
hgcw008.setRemainingAmount(hgcw008.getThisPriceTax());
// 反写金额
// 反写剩余金额
HGCWTools.HgCw008.remainingAmount(hgcw008.getContractNumber(), hgcw008.getThisPriceTax());
this.add(hgcw008);
// 写入其他数据
HGCWTools.HgCw009.save(detail1Rows,settlementNumber,hgcw008);
......@@ -127,6 +126,8 @@ public class ServiceHGCW008 extends ServiceBase {
HGCWTools.HgCw002.updateBalanceStatus(hgcw008.getContractNumber(),hgcw008.getSettlementType() + 1);
//更新金额
HGCWTools.HgCw009.calculateAmount(hgcw008.getSettlementNumber());
// 更新累计金额
HGCWTools.HgCw008.updateCumulativeSettlement(hgcw008.getContractNumber());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
......@@ -178,6 +179,8 @@ public class ServiceHGCW008 extends ServiceBase {
// 反写金额
HGCWTools.HgCw008.remainingAmount(hgcw008.getContractNumber(), hgcw008.getThisPriceTax().negate());
DaoUtils.update(HGCW008.DELETE, hgcw008);
// 更新累计金额
HGCWTools.HgCw008.updateCumulativeSettlement(hgcw008.getContractNumber());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-22 13:50:20
Version : 1.0
schema : hggp
tableName : HGCW008
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
CONTRACT_NAME VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
SETTLEMENT_TYPE TINYINT,
CONTRACT_DATE VARCHAR,
TAX_POINTS INTEGER,
PRICE_TAX_SEPARATION INTEGER,
THIS_SETTLEMENT_AMOUNT DECIMAL,
THIS_SETTLEMENT_TAX DECIMAL,
THIS_PRICE_TAX DECIMAL,
TOTAL_CONTRACT_PRICE DECIMAL,
CUMULATIVE_SETTLEMENT_AMOUNT DECIMAL,
CUMULATIVE_SETTLEMENT_TAX DECIMAL,
CUMULATIVE_PRICE_TAX DECIMAL,
REVIEW_STATUS TINYINT,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCW008">
<sql id="condition">
......@@ -182,93 +149,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME = #contractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementType">
SETTLEMENT_TYPE = #settlementType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractDate">
CONTRACT_DATE = #contractDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="priceTaxSeparation">
PRICE_TAX_SEPARATION = #priceTaxSeparation#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisPriceTax">
THIS_PRICE_TAX = #thisPriceTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPrice">
TOTAL_CONTRACT_PRICE = #totalContractPrice#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cumulativeSettlementAmount">
CUMULATIVE_SETTLEMENT_AMOUNT = #cumulativeSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cumulativeSettlementTax">
CUMULATIVE_SETTLEMENT_TAX = #cumulativeSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cumulativePriceTax">
CUMULATIVE_PRICE_TAX = #cumulativePriceTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW008 (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
......@@ -337,13 +217,15 @@
ID = #id#
</update>
<select id="queryCalculateAmount" resultClass="java.util.HashMap">
SELECT
IFNULL(SUM( CUMULATIVE_SETTLEMENT_AMOUNT ),0) as "sumCumulativeSettlementAmount",
IFNULL(SUM( CUMULATIVE_SETTLEMENT_TAX ),0) as "sumCumulativeSettlementTax"
IFNULL(SUM(THIS_SETTLEMENT_AMOUNT), 0) as "thisSettlementAmount",
IFNULL(SUM(THIS_SETTLEMENT_TAX), 0) as "thisSettlementTax",
IFNULL(SUM(THIS_PRICE_TAX), 0) as "thisPriceTax",
IFNULL(SUM(CUMULATIVE_SETTLEMENT_AMOUNT), 0) as "sumCumulativeSettlementAmount",
IFNULL(SUM(CUMULATIVE_SETTLEMENT_TAX), 0) as "sumCumulativeSettlementTax"
FROM ${hggpSchema}.HGCW008 WHERE 1=1
<include refid="condition" />
<include refid="condition"/>
</select>
<update id="submit">
......@@ -368,4 +250,19 @@
WHERE
ID = #id#
</update>
<!-- 更新累计结算金额 -->
<update id="updateCumulativeSettlement">
UPDATE ${hggpSchema}.HGCW008
SET
CUMULATIVE_SETTLEMENT_AMOUNT = #cumulativeSettlementAmount#,
CUMULATIVE_SETTLEMENT_TAX = #cumulativeSettlementTax#,
CUMULATIVE_PRICE_TAX = #cumulativePriceTax#,
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE CONTRACT_NUMBER = #contractNumber#
</update>
</sqlMap>
......@@ -433,8 +433,28 @@ public class HGCWTools {
}
}
/**
* 结算单
*
* @author:songx
* @date:2024/9/19,17:16
*/
public static class HgCw008 {
/**
* 查询统计金额
*
* @param contractNumber
* @return
*/
public static Map queryCalculateAmount(String contractNumber) {
AssertUtils.isEmpty(contractNumber, "合同号不能为空");
Map paramMap = new HashMap();
paramMap.put("contractNumber", contractNumber);
List<Map> results = DaoBase.getInstance().query("HGCW008.queryCalculateAmount", paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
public static HGCW008 getId(String id) {
AssertUtils.isNull(id, "结算单ID不能为空!");
List<HGCW008> results = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
......@@ -555,12 +575,36 @@ public class HGCWTools {
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("本次开票金额加累计开票金额超出销售合同金额20%,超出20%需要业务新增补充协议!");
}
HGCW002 hgcw002 = hgcw002s.get(0);
BigDecimal remainingCount = new BigDecimal(decimalFormat.format(hgcw002.getRemainingAmount().subtract(deductionAmount)));
BigDecimal remainingAmountTemp = hgcw002.getRemainingAmount() == null
? BigDecimal.ZERO : hgcw002.getRemainingAmount();
BigDecimal remainingCount = remainingAmountTemp.subtract(deductionAmount)
.setScale(3, RoundingMode.HALF_UP);
hgcw002.setRemainingAmount(remainingCount);
DaoUtils.update("HGCW002.updateDeductionAmount", hgcw002);
}
/**
* 更新累计金额
*
* @param contractNumber
*/
public static void updateCumulativeSettlement(String contractNumber) {
Map calcAmountMap = queryCalculateAmount(contractNumber);
Map paramMap = new HashMap();
paramMap.put("contractNumber", contractNumber);
if (MapUtils.isEmpty(calcAmountMap)) {
paramMap.put("cumulativeSettlementAmount", BigDecimal.ZERO);
paramMap.put("cumulativeSettlementTax", BigDecimal.ZERO);
paramMap.put("cumulativePriceTax", BigDecimal.ZERO);
} else {
paramMap.put("cumulativeSettlementAmount", calcAmountMap.get("thisSettlementAmount"));
paramMap.put("cumulativeSettlementTax", calcAmountMap.get("thisSettlementTax"));
paramMap.put("cumulativePriceTax", calcAmountMap.get("thisPriceTax"));
}
DaoUtils.update("HGCW008.updateCumulativeSettlement", paramMap);
}
}
public static class HgCw009 {
......
......@@ -30,6 +30,8 @@ public class HgWdSqlConstant {
public static final String MODULE = "HGWD003.";
// 修改信息
public static final String UPDATE_INFO = MODULE + "updateInfo";
// 批量写入
public static final String BATCH_INSERT = MODULE + "batchInsert";
}
/**
......
......@@ -2,20 +2,18 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
......@@ -24,13 +22,13 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
* 复制授权用户
*
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGWD003B extends ServiceEPBase {
private EiBlockMeta eiMetadata = null;
/**
* 画面初始化
*
......@@ -80,7 +78,7 @@ public class ServiceHGWD003B extends ServiceEPBase {
AssertUtils.isNull(dbWd001, String.format("【%s】文档目录不存在", mainFileId));
// 获取FILE_ID授权信息
List<HGWD003> dbMainWd003s = HGWDTools.HgWd003.listByFile(mainFileId);
AssertUtils.isEmpty(dbMainWd003s, String.format("文档目录【%s】还未进行授权,请授权后再进行复制", dbWd001.getFileName()));
AssertUtils.isEmpty(dbMainWd003s, String.format("文档目录【%s】还未授权用户,请授权后再进行复制", dbWd001.getFileName()));
// 复制授权信息
List<HGWD001> fWd001s = MapUtils.toDaoEPBases(inInfo, HGWD001.class);
this.copyAuthUser(fWd001s, dbMainWd003s);
......@@ -116,7 +114,7 @@ public class ServiceHGWD003B extends ServiceEPBase {
return dbMainWd003;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(filterWd003s)) {
DaoUtils.insertBatch(HGWD003.INSERT, filterWd003s);
DaoUtils.batchInsert(HgWdSqlConstant.HgWd003.BATCH_INSERT, filterWd003s);
}
}
}
......
......@@ -116,6 +116,19 @@
)
</insert>
<!-- 批量写入 -->
<insert id="batchInsert">
INSERT INTO ${hggpSchema}.HGWD003 (
ACCOUNT_CODE, DEP_CODE, CREATED_BY, CREATED_NAME, CREATED_TIME,
FILE_ID, USER_ID, REMARK, EXT_ID, IS_PROJECT_MANAGER
) VALUES
<iterate open="(" conjunction="), (" close=")" property="rows">
#rows[].accountCode#, #rows[].depCode#, #rows[].createdBy#, #rows[].createdName#,
#rows[].createdTime#, #rows[].fileId#, #rows[].userId#, #rows[].remark#, #rows[].extId#,
#rows[].isProjectManager#
</iterate>
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hggpSchema}.HGWD003 SET DELETE_FLAG = 1 WHERE ID = #id#
......
......@@ -3,6 +3,8 @@ package com.baosight.xservices.xs.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -231,6 +233,7 @@ public class ServiceXS40 extends ServiceEPBase {
final String companyPrefix = dbPz009 == null ? "" : dbPz009.getLoginPrefix() + "_";
for (int i = 0; i < eiBlock.getRowCount(); ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
AssertUtils.isEmpty(MapUtils.getString(inInfoRowMap, "groupEname"), "角色英文名不能为空");
inInfoRowMap.remove("groupId");
inInfoRowMap.put("groupEname", companyPrefix + inInfoRowMap.get("groupEname"));
inInfoRowMap.put("accountCode", accountCode);
......
......@@ -98,6 +98,21 @@ function windowCallback() {
JSColorbox.close();
}
/**
* 回调
*
* @param res
*/
function windowNewCallback(res) {
if (res.status < 0) {
return;
}
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW008C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW008",
......
......@@ -37,6 +37,10 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="single row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="170" align="center"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
......@@ -51,10 +55,6 @@
<EF:EFColumn ename="thisSettlementTax" cname="本次结算税金" align="right" enable="false" format="{0:C3}"/>
<EF:EFColumn ename="thisPriceTax" cname="本次结算含税金额" align="right" enable="false" format="{0:C3}"/>
<EF:EFColumn ename="contractDate" cname="结算日期" align="center" enable="false" editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......
......@@ -15,13 +15,22 @@ $(function() {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
],
columns: [{
field: "totalPrice",
template: function (item) {
let thisEngineeringQuantity = item.thisEngineeringQuantity;
let unitPrice = item.unitPrice;
if(!isBlank(thisEngineeringQuantity) && !isBlank(unitPrice)){
return parseFloat(thisEngineeringQuantity) * parseFloat(unitPrice);
}
return isBlank(item.totalPrice) ? "" : item.totalPrice;
}
}],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
grid.dataSource.bind("change", function(e) {
if (e.field == "thisEngineeringQuantity") {
var tr,index;
var tr, index;
// 获取此model元素信息
var item = e.items[0];
var inventoryId = item.inventoryId;
......@@ -29,14 +38,12 @@ $(function() {
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var totalPrice = thisEngineeringQuantity * unitPrice; // 总价
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
queryCumulativeEngineeringQuantity(inventoryId,item);
queryCumulativeEngineeringQuantity(inventoryId, item);
// 计算总金额
setTimeout(function () {
calculateAmount(detail1Grid.getDataItems());
}, 200);
}
});
grid.dataSource.bind("change", function(e) {
if (e.field == "unitPrice") {
var tr,index;
// 获取此model元素信息
......@@ -49,6 +56,18 @@ $(function() {
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
if (e.field == "totalPrice") {
var tr, index;
// 获取此model元素信息
var item = e.items[0];
var totalPrice = parseFloat(item.totalPrice) || 0; // 总价
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var thisEngineeringQuantity = totalPrice / unitPrice; // 工程量
detail1Grid.setCellValue(item, 'thisEngineeringQuantity', parseFloat(thisEngineeringQuantity));
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
});
},
beforeAdd :function (e) {
......@@ -203,7 +222,7 @@ function choiceFunc() {
"&inqu_status-0-appentIds=" + appentIds.join(","),
title: "<div style='text-align: center;'>合同清单</div>",
width: "80%",
height: "80%",
height: "90%",
dispaly: "flex",
callbackName: choiceCallbackFunc
});
......@@ -306,7 +325,11 @@ function btnSaveFunc() {
fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1", "HGCW008", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
JSUtils.submitGridsData("detail1", "HGCW008", "save", false,
function (res) {
parent.windowNewCallback(res);
}
);
}
});
}
......
......@@ -66,15 +66,16 @@
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center" />
<EF:EFColumn ename="taskName" cname="任务名称" align="center" />
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center" />
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center"/>
<EF:EFColumn ename="taskName" cname="任务名称" align="center"/>
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center"/>
<EF:EFColumn ename="thisEngineeringQuantity" cname="本次结算工程量" format="{0:N3}" align="right"/>
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="right" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="right"
enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="right"/>
<EF:EFColumn ename="totalPrice" cname="合价" enable="false" format="{0:N3}" align="right"/>
<EF:EFColumn ename="remarks" cname="备注" align="center" />
<EF:EFColumn ename="totalPrice" cname="合价" format="{0:N3}" align="right"/>
<EF:EFColumn ename="remarks" cname="备注" align="center"/>
<EF:EFColumn ename="inventoryId" cname="清单id" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -13,15 +13,24 @@ $(function() {
IPLATUI.EFGrid.detail1 = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [
],
columns: [{
field: "totalPrice",
template: function (item) {
let thisEngineeringQuantity = item.thisEngineeringQuantity;
let unitPrice = item.unitPrice;
if (!isBlank(thisEngineeringQuantity) && !isBlank(unitPrice)) {
return parseFloat(thisEngineeringQuantity) * parseFloat(unitPrice);
}
return isBlank(item.totalPrice) ? "" : item.totalPrice;
}
}],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
grid.dataSource.bind("change", function(e) {
$("#BTN_CHOICE").on("click", choiceFunc);
grid.dataSource.bind("change", function (e) {
if (e.field == "thisEngineeringQuantity") {
var tr,index;
var tr, index;
// 获取此model元素信息
var item = e.items[0];
var inventoryId = item.inventoryId;
......@@ -29,16 +38,14 @@ $(function() {
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var totalPrice = thisEngineeringQuantity * unitPrice; // 总价
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
queryCumulativeEngineeringQuantity(inventoryId,item);
queryCumulativeEngineeringQuantity(inventoryId, item);
// 计算总金额
setTimeout(function () {
calculateAmount(detail1Grid.getDataItems());
}, 200);
}
});
grid.dataSource.bind("change", function(e) {
if (e.field == "unitPrice") {
var tr,index;
var tr, index;
// 获取此model元素信息
var item = e.items[0];
var inventoryId = item.inventoryId;
......@@ -49,6 +56,17 @@ $(function() {
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
if (e.field == "totalPrice") {
var tr, index;
// 获取此model元素信息
var item = e.items[0];
var totalPrice = parseFloat(item.totalPrice) || 0; // 总价
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var thisEngineeringQuantity = totalPrice / unitPrice; // 工程量
detail1Grid.setCellValue(item, 'thisEngineeringQuantity', parseFloat(thisEngineeringQuantity));
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
});
setTimeout(function() {
initDate();
......@@ -207,11 +225,11 @@ function choiceFunc() {
if (contractType == "1" || contractType == "3") {
JSColorbox.open({
href: "HGCW008D?methodName=initLoad&inqu_status-0-contractNumber=" + contractNumber +
"&inqu_status-0-inventoryIds=" + inventoryIds.join(",")+
"&inqu_status-0-inventoryIds=" + inventoryIds.join(",") +
"&inqu_status-0-appentIds=" + appentIds.join(","),
title: "<div style='text-align: center;'>合同清单</div>",
width: "80%",
height: "80%",
height: "90%",
dispaly: "flex",
callbackName: choiceCallbackFunc
});
......@@ -247,6 +265,7 @@ function choiceCallbackFunc(result1, result2) {
detail1Grid.setCellValue(0, "taskName", item.inventory);
detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPriceExcludingTax);
detail1Grid.setCellValue(0, "totalPrice", item.provisionalQuantity * item.unitPriceExcludingTax);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
......
......@@ -73,7 +73,7 @@
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="right" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="right"/>
<EF:EFColumn ename="totalPrice" cname="合价" enable="false" format="{0:N3}" align="right"/>
<EF:EFColumn ename="totalPrice" cname="合价" format="{0:N3}" align="right"/>
<EF:EFColumn ename="remarks" cname="备注" align="center" />
<EF:EFColumn ename="inventoryId" cname="清单id" hidden="true"/>
</EF:EFGrid>
......
......@@ -43,12 +43,12 @@
<EF:EFInput ename="result-0-thisPriceTax" cname="本次结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPrice" cname="合同金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementAmount" cname="累计结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementTax" cname="累计结算税金(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativePriceTax" cname="累计结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-cumulativePriceTax" cname="累计结算价税合计金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalContractPrice" cname="合同金额(元)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
......
......@@ -19,7 +19,7 @@ $(function () {
/**
* 取消
*/
$('#cancel').on('click', function () {
$('#CANCEL').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
......@@ -27,7 +27,7 @@ $(function () {
/**
* 确认
*/
$('#confirm').on('click', function () {
$('#CONFIRM').on('click', function () {
let allRows = new Array();
let result3Row = new Array();
allRows = resultGrid.getCheckedRows();
......
......@@ -10,7 +10,7 @@
<EF:EFInput cname="IDS" ename="inventoryIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="AIDS" ename="appentIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFRegion id="result" title="合同清单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="35vh">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" enable="false"/>
......@@ -23,8 +23,8 @@
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result3" title="签证单">
<EF:EFGrid blockId="result3" autoDraw="override" isFloat="true" queryMethod="query3">
<EF:EFRegion id="result3" title="签证单" fitHeight="true">
<EF:EFGrid blockId="result3" autoDraw="override" isFloat="true" checkMode="row" queryMethod="query3">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
......@@ -37,9 +37,5 @@
<EF:EFColumn ename="signingDate" cname="签订日期" align="center" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
......@@ -258,17 +258,18 @@ let showDownloadRecord = function (fileId, docId) {
* 预览
*/
let preview = function () {
let params = {
"inqu_status-0-fileId": $("#inqu_status-0-fileId").val()
}
JSColorbox.open({
href: "HGWD002A",
title: "<div style='text-align: center;'>文件预览</div>",
width: "90%",
height: "95%",
params: params
});
let url = "HGWD002A?inqu_status-0-fileId" + $("#inqu_status-0-fileId").val();
window.open(url, '_blank');
// let params = {
// "inqu_status-0-fileId": $("#inqu_status-0-fileId").val()
// }
// JSColorbox.open({
// href: "HGWD002A",
// title: "<div style='text-align: center;'>文件预览</div>",
// width: "90%",
// height: "95%",
// params: params
// });
// let rows = resultGrid.getCheckedRows();
// if (rows.length < 1) {
// message("请选择数据");
......
......@@ -240,6 +240,7 @@ let copyUser = function () {
* 授权回调
*/
let copyUserCallback = function (res) {
}
/**
......
......@@ -47,7 +47,6 @@ let copyUser = function () {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003B", "copyUser",
false, function (res) {
message(res.msg);
if (res.status !== -1) {
parent.JSColorbox.setValueCallback(res);
}
......
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