Commit 1c18d295 by liuyang

2024-05-31 销售出库单接口优化

parent 845601a8
...@@ -103,7 +103,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -103,7 +103,7 @@ public class HGKC004A extends DaoEPBase {
private BigDecimal length = new BigDecimal("0"); /* 长*/ private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/ private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/ private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private BigDecimal quantity = new BigDecimal(0.000); /* 数量*/ private BigDecimal quantity = new BigDecimal(0); /* 数量*/
private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/ private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/ private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private Long parentId = new Long(0); /* 销售出库单ID*/ private Long parentId = new Long(0); /* 销售出库单ID*/
...@@ -208,7 +208,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -208,7 +208,7 @@ public class HGKC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_QUANTITY); eiColumn = new EiColumn(FIELD_QUANTITY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -83,7 +83,7 @@ public class ServiceHGKC004 extends ServiceEPBase { ...@@ -83,7 +83,7 @@ public class ServiceHGKC004 extends ServiceEPBase {
hgkc004.fromMap(resultRow); hgkc004.fromMap(resultRow);
if (hgkc004.getId() == null || hgkc004.getId() == 0) { if (hgkc004.getId() == null || hgkc004.getId() == 0) {
this.add(hgkc004); this.add(hgkc004);
List<HGKC004> list = this.dao.query(HGKC004A.QUERY,hgkc004); List<HGKC004> list = this.dao.query("HGKC004.queryList",hgkc004.toMap());
if (CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)){
throw new PlatException("保存失败,请刷新后重试!"); throw new PlatException("保存失败,请刷新后重试!");
} }
......
...@@ -254,6 +254,58 @@ ...@@ -254,6 +254,58 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, INVENT_CODE, SUB_INVENT_CODE,FACTORY_CODE,FACTORY_NAME GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, INVENT_CODE, SUB_INVENT_CODE,FACTORY_CODE,FACTORY_NAME
</select> </select>
<select id="queryList" parameterClass="HashMap" resultClass="HGKC004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC004 WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleOutCode">
SALE_OUT_CODE = #saleOutCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIPT_DATE DESC,CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<!-- <!--
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
......
...@@ -13,7 +13,7 @@ $(function () { ...@@ -13,7 +13,7 @@ $(function () {
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ')" >销售出库单详情</a>'; + 'onclick="showDetail(' + item.id + ', ' + item.status + ')" >销售出库单详情</a>';
if (auditStatus == 0) { if (auditStatus == 0) {
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="updateStatus(' + item.id + ',1)" >提交</a>'; 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
} else if (auditStatus == -1) { } else if (auditStatus == -1) {
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="updateStatus(' + item.id + ',0)" >未提交</a>'; 'onclick="updateStatus(' + item.id + ',0)" >未提交</a>';
......
...@@ -69,20 +69,6 @@ $(function() { ...@@ -69,20 +69,6 @@ $(function() {
template: function (options) { template: function (options) {
return options.thick == 0 ? "-" : options.thick; return options.thick == 0 ? "-" : options.thick;
} }
}, {
field: "price",
template: function (options) {
options.amount = options.quantity*options.price;
return options.price
}
}, {
field: "amount",
template: function (options) {
if (options.quantity != 0){
options.price = options.amount/options.quantity;
}
return options.amount;
}
}], }],
loadComplete: function(grid) { loadComplete: function(grid) {
// 此 grid 对象 // 此 grid 对象
...@@ -90,7 +76,8 @@ $(function() { ...@@ -90,7 +76,8 @@ $(function() {
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field == "price") { if (e.field == "price") {
loadChange(grid,e,"amount"); let amount = e.items[0].quantity*e.items[0].price;
resultGrid.setCellValue(e.items[0],"amount",amount);
}else if (e.field == "amount") { }else if (e.field == "amount") {
if (e.items[0].price==0){ if (e.items[0].price==0){
loadChange(grid,e,"price"); loadChange(grid,e,"price");
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/> <EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/> <EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/> <EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" enable="true" readonly="true" width="100" format="{0:N3}" editType="text" <EF:EFColumn ename="quantity" cname="数量" enable="true" readonly="true" width="100" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0" displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0" displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="amount" cname="金额" width="100" enable="true" format="{0:N3}" editType="text" <EF:EFColumn ename="amount" cname="金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0" displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......
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