Commit 92afc429 by 宋祥

1.fixBug:按税率计算金额错误问题修复

parent 60e6b5de
...@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase {
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2); HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2);
} }
} }
} }
/** /**
...@@ -244,7 +242,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -244,7 +242,7 @@ public class ServiceHGCG002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 数据校验 * 数据校验
* *
...@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase {
String contractNo = fCg002.getContractNo(); String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002AMap.get(contractNo); HGCG002 dbCg002 = dbCg002AMap.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo)); AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getSupName()), String.format("合同[%s]供应商为空", contractNo)); AssertUtils.isEmpty(dbCg002.getSupName(), String.format("合同[%s]供应商为空", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getPurUserName()), String.format("合同[%s]采购员为空", contractNo)); AssertUtils.isEmpty(dbCg002.getPurUserName(), String.format("合同[%s]采购员为空", contractNo));
AssertUtils.isNotEquals(HGConstant.CgContractStatus.S_0, dbCg002.getStatus(), AssertUtils.isNotEquals(HGConstant.CgContractStatus.S_0, dbCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo)); String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
AssertUtils.isTrue(fCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo)); AssertUtils.isTrue(dbCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0,
AssertUtils.isTrue(fCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo)); String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo));
AssertUtils.isTrue(dbCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0,
String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo));
} }
} }
/** /**
* 提交数据 * 提交数据
* *
......
...@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase {
Long id = fCg002B.getId(); Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id); HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重 // 总重
BigDecimal bcReceiveQty = fCg002B.getBcReceiveQty();
BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight(); BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight();
if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) { if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) {
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight())); fCg002B.setReceiveWeight(bcReceiveQty.multiply(dbCg002b.getPurUnitWeight()));
fCg002B.setPurUnitWeight(dbCg002b.getPurUnitWeight());
} else { } else {
fCg002B.setReceiveWeight(bcReceiveWeight); fCg002B.setReceiveWeight(bcReceiveWeight);
fCg002B.setPurUnitWeight(bcReceiveWeight.divide(bcReceiveQty, 3, RoundingMode.HALF_UP));
} }
// 含税总金额 // 含税总金额
BigDecimal amount; BigDecimal amount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) { if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice()); amount = bcReceiveWeight.multiply(dbCg002b.getPrice());
} else { } else {
amount = fCg002B.getBcReceiveQty().multiply(dbCg002b.getPrice()); amount = bcReceiveQty.multiply(dbCg002b.getPrice());
} }
// 如果税率不为空,总金额减去税额 // 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) { if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100"))); BigDecimal taxRate = dbCg002b.getTaxRate().multiply(new BigDecimal("0.01")).add(BigDecimal.ONE);
amount = amount.divide(taxRate, 2, RoundingMode.HALF_UP);
} }
fCg002B.setAmount(amount); fCg002B.setAmount(amount);
} }
......
...@@ -2,11 +2,50 @@ ...@@ -2,11 +2,50 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002A"> <sqlMap namespace="HGCG002A">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
</sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id"> <include refid="idCondition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -117,6 +156,18 @@ ...@@ -117,6 +156,18 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="primaryIds">
PRIMARY_ID IN <iterate open="(" close=")" conjunction="," property="primaryIds">#primaryIds[]#</iterate>
</isNotEmpty>
</sql>
<!-- 公共修改字段 --> <!-- 公共修改字段 -->
<sql id="updateRevise"> <sql id="updateRevise">
UPDATED_BY = #updatedBy#, UPDATED_BY = #updatedBy#,
...@@ -124,75 +175,29 @@ ...@@ -124,75 +175,29 @@
UPDATED_TIME = #updatedTime# UPDATED_TIME = #updatedTime#
</sql> </sql>
<sql id="idCondition"> <sql id="orderBy">
<isNotEmpty prepend=" AND " property="id"> <dynamic prepend="ORDER BY">
ID = #id# <isNotEmpty property="orderBy">
</isNotEmpty> $orderBy$
<isNotEmpty prepend=" AND " property="ids"> </isNotEmpty>
ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate> <isEmpty property="orderBy">
</isNotEmpty> ID asc
<isNotEmpty prepend=" AND " property="primaryIds"> </isEmpty>
PRIMARY_ID IN <iterate open="(" close=")" conjunction="," property="primaryIds">#primaryIds[]#</iterate> </dynamic>
</isNotEmpty> </sql>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B"> <select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT SELECT
ID as "id", <include refid="column"/>
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> FROM ${hggpSchema}.HGCG002A WHERE 1=1
DEP_CODE as "depCode", <!-- 部门编码 --> <include refid="condition"/>
CREATED_BY as "createdBy", <!-- 记录创建者 --> <include refid="orderBy"/>
CREATED_NAME as "createdName", <!-- 记录创建名称 --> </select>
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" />
<include refid="idCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG002A WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGCG002A (ID, INSERT INTO ${hggpSchema}.HGCG002A (ID,
...@@ -292,60 +297,59 @@ ...@@ -292,60 +297,59 @@
<include refid="idCondition"/> <include refid="idCondition"/>
</update> </update>
<select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B"> <select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT SELECT
a.ID as "id", a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 --> a.DEP_CODE as "depCode", <!-- 部门编码 -->
a.CREATED_BY as "createdBy", <!-- 记录创建者 --> a.CREATED_BY as "createdBy", <!-- 记录创建者 -->
a.CREATED_NAME as "createdName", <!-- 记录创建名称 --> a.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
a.CREATED_TIME as "createdTime", <!-- 记录创建时间 --> a.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
a.UPDATED_BY as "updatedBy", <!-- 记录修改者 --> a.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
a.UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> a.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
a.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 --> a.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
a.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 --> a.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
a.COMPANY_CODE as "companyCode", <!-- 公司编码 --> a.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
a.COMPANY_NAME as "companyName", <!-- 公司名称 --> a.COMPANY_NAME as "companyName", <!-- 公司名称 -->
a.INVENT_TYPE as "inventType", <!-- 存货类型 --> a.INVENT_TYPE as "inventType", <!-- 存货类型 -->
a.INVENT_CODE as "inventCode", <!-- 存货编码 --> a.INVENT_CODE as "inventCode", <!-- 存货编码 -->
a.INVENT_NAME as "inventName", <!-- 存货名称 --> a.INVENT_NAME as "inventName", <!-- 存货名称 -->
a.SPEC as "spec", <!-- 规格 --> a.SPEC as "spec", <!-- 规格 -->
a.MATERIAL as "material", <!-- 材质 --> a.MATERIAL as "material", <!-- 材质 -->
a.UNIT as "unit", <!-- 单位 --> a.UNIT as "unit", <!-- 单位 -->
a.LENGTH as "length", <!-- 长度 --> a.LENGTH as "length", <!-- 长度 -->
a.WIDTH as "width", <!-- 宽度 --> a.WIDTH as "width", <!-- 宽度 -->
a.THICK as "thick", <!-- 厚度 --> a.THICK as "thick", <!-- 厚度 -->
a.PUR_QTY as "purQty", <!-- 采购数量 --> a.PUR_QTY as "purQty", <!-- 采购数量 -->
a.PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 --> a.PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
a.PUR_WEIGHT as "purWeight", <!-- 采购重量 --> a.PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
a.RECEIVE_QTY as "receiveQty", <!-- 收货数量 --> a.RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
a.RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 --> a.RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
a.PRICE as "price", <!-- 单价 --> a.PRICE as "price", <!-- 单价 -->
a.AMOUNT as "amount", <!-- 金额(不含税金额) --> a.AMOUNT as "amount", <!-- 金额(不含税金额) -->
a.TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 --> a.TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
a.TAX_AMOUNT as "taxAmount", <!-- 税额 --> a.TAX_AMOUNT as "taxAmount", <!-- 税额 -->
a.TAX_RATE as "taxRate", <!-- 税率 --> a.TAX_RATE as "taxRate", <!-- 税率 -->
a.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 --> a.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
a.PRIMARY_ID as "primaryId", <!-- 主表id --> a.PRIMARY_ID as "primaryId", <!-- 主表id -->
(a.PUR_QTY - a.RECEIVE_QTY) as "bcMaxReceiveQty", (a.PUR_QTY - a.RECEIVE_QTY) as "bcMaxReceiveQty",
(a.PUR_WEIGHT - a.RECEIVE_WEIGHT) as "bcMaxReceiveWeight", (a.PUR_WEIGHT - a.RECEIVE_WEIGHT) as "bcMaxReceiveWeight",
a.PROJ_CODE as "projCode", <!-- 项目编码 --> a.PROJ_CODE as "projCode", <!-- 项目编码 -->
a.PROJ_NAME as "projName", <!-- 项目名称 --> a.PROJ_NAME as "projName", <!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 --> a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
a.STATUS as "status", <!-- 状态 --> a.STATUS as "status", <!-- 状态 -->
b.CONTRACT_DATE as "contractDate", <!-- 合同日期 --> b.CONTRACT_DATE as "contractDate", <!-- 合同日期 -->
b.CONTRACT_NO as "contractNo", <!-- 合同号 --> b.CONTRACT_NO as "contractNo", <!-- 合同号 -->
b.PLAN_NO as "planNo", <!-- 计划单号 --> b.PLAN_NO as "planNo", <!-- 计划单号 -->
b.SUP_CODE as "supCode", <!-- 供应商编码 --> b.SUP_CODE as "supCode", <!-- 供应商编码 -->
b.SUP_NAME as "supName", <!-- 供应商名称 --> b.SUP_NAME as "supName", <!-- 供应商名称 -->
b.PUR_USER_ID as "purUserId", <!-- 采购员 --> b.PUR_USER_ID as "purUserId", <!-- 采购员 -->
b.PUR_USER_NAME as "purUserName" <!-- 采购员名称 --> b.PUR_USER_NAME as "purUserName" <!-- 采购员名称 -->
FROM ${hggpSchema}.HGCG002A a FROM ${hggpSchema}.HGCG002A a
LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id
WHERE 1=1 WHERE 1=1
AND a.DELETE_FLAG = 0 AND a.DELETE_FLAG = 0
AND b.DELETE_FLAG = 0 AND b.DELETE_FLAG = 0
AND (a.PUR_QTY - a.RECEIVE_QTY) > 0 AND (a.PUR_QTY - a.RECEIVE_QTY) > 0
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
a.ID = #id# a.ID = #id#
......
...@@ -9,68 +9,69 @@ $(function () { ...@@ -9,68 +9,69 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
columns: [ columns: [{
{ field: "operator",
field: "operator", title: "操作",
title: "操作", template: function (item) {
width: 120, let template = '';
template: function (item) { if (!isBlank(item.id)) {
let template = ''; template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
if (!isBlank(item.id)){ + 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source
+ ')" >详情</a>';
}
if (!isBlank(item.id)) {
//审核通过的,可以进行合同变更
if (item.status == 2) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source + ')" >详情</a>'; + 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, '
+ item.source + ')" >合同变更</a>';
} }
if (!isBlank(item.id)){ }
//审核通过的,可以进行合同变更 return template;
if(item.status == 2) }
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' }, {
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, ' + item.source + ')" >合同变更</a>'; field: "companyCode",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode'];
} }
return template;
} }
}, { return dataItem["companyCode"];
field: "companyCode", }
title: "公司编码", }, {
template: function (dataItem) { field: "projCode",
for (let i = 0; i < companyCodeBox.length; i++) { title: "项目编码",
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) { template: function (dataItem) {
return companyCodeBox[i]['companyCode']; for (let i = 0; i < projCodeBox.length; i++) {
} if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['valueField'];
} }
return dataItem["companyCode"];
} }
}, { return dataItem["projCode"] == null ? "" : dataItem["projCode"];
field: "projCode", },
title: "项目编码", editor: function (container, options) {
template: function (dataItem) { let inInfo = new EiInfo();
for (let i = 0; i < projCodeBox.length; i++) { inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
if (projCodeBox[i]['valueField'] === dataItem['projCode']) { inInfo.set("inqu_status-0-approvalStatus", 2);
dataItem['projName'] = projCodeBox[i]['textField'] inInfo.set("field", options.field);
return projCodeBox[i]['valueField']; EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
} onSuccess: function (ei) {
projCodeBox = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
} }
return dataItem["projCode"]; }, {async: false});
}, var input = $('<input />');
editor: function (container, options) { input.attr("name", options.field);
let inInfo = new EiInfo(); input.attr("id", options.field);
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]); input.appendTo(container);
inInfo.set("inqu_status-0-approvalStatus", 2); input.kendoDropDownList({
inInfo.set("field", options.field); dataSource: projCodeBox,
EiCommunicator.send("HGSC003", "projComboBox", inInfo, { minLength: 0,
onSuccess: function (ei) { dataTextField: "textField",
projCodeBox = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: projCodeBox,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#",
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="110" align="center"/>
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1"> <EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/> <EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="200" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" width="100" align="center" required="true"/> <EF:EFColumn ename="projCode" cname="项目编码" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date" <EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" 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