Commit e3c69a01 by liuyang

2024-08-31 扣款单选择发货单

parent fdbbb9d5
......@@ -46,6 +46,7 @@ public class HGCW005 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String FIELD_DELIVERY_CODE = "deliveryCode"; /* 发货单号*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -99,6 +100,7 @@ public class HGCW005 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private String deliveryCode = " "; /* 发货单号*/
/**
* initialize the metadata.
......@@ -194,6 +196,9 @@ public class HGCW005 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVERY_CODE);
eiColumn.setDescName("发货单号");
eiMetadata.addMeta(eiColumn);
}
......@@ -540,6 +545,15 @@ public class HGCW005 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public String getDeliveryCode() {
return deliveryCode;
}
public void setDeliveryCode(String deliveryCode) {
this.deliveryCode = deliveryCode;
}
/**
* get the value from Map.
*
......@@ -569,6 +583,7 @@ public class HGCW005 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setDeliveryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_CODE)), deliveryCode));
}
/**
......@@ -599,6 +614,7 @@ public class HGCW005 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_DELIVERY_CODE, StringUtils.toString(deliveryCode, eiMetadata.getMeta(FIELD_DELIVERY_CODE)));
return map;
}
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW005;
import com.baosight.hggp.hg.cw.domain.HGCW005A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/31
* @description 选择发货单
*/
public class ServiceHGCW005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(inInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
}}, false);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGCW005A.QUERY,new HGCW005A());
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "扣款单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
//List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCW005A> hgcw005AList = MapUtils.toDaoEPBases(inInfo, HGCW005A.class);
Map<String, List<HGCW005A>> hgcw005Map = Optional.ofNullable(hgcw005AList).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(HGCW005A::getDeliveryCode,Collectors.toList()));
Set<String> deliveryCodeSet = hgcw005Map.keySet();
for (String deliveryCode : deliveryCodeSet) {
List<HGCW005A> hgcw005As = hgcw005Map.get(deliveryCode);
BigDecimal totalContractPriceIncluding =hgcw005As.stream().map(HGCW005A::getTotalContractPriceIncluding).reduce(BigDecimal.ZERO, BigDecimal::add);
HGCW005 hgcw005 = new HGCW005();
hgcw005.setDeliveryCode(deliveryCode);
hgcw005.setCompanyCode(hgcw005As.get(0).getCompanyCode());
hgcw005.setCompanyName(hgcw005As.get(0).getCompanyName());
hgcw005.setProjCode(hgcw005As.get(0).getProjCode());
hgcw005.setProjName(hgcw005As.get(0).getProjName());
hgcw005.setPartyA(hgcw005As.get(0).getReceCode()+"-"+hgcw005As.get(0).getReceName());
hgcw005.setPartyB(hgcw005As.get(0).getCompanyCode()+"-"+hgcw005As.get(0).getCompanyName());
hgcw005.setContractContent("发货单扣款");
hgcw005.setSigningDate(DateUtils.date());
hgcw005.setReviewStatus(0);
hgcw005.setTotalContractPriceIncluding(totalContractPriceIncluding);
DaoUtils.insert(HGCW005.INSERT, hgcw005);
for (HGCW005A hgcw005A : hgcw005As) {
if (hgcw005A.getId() == null || hgcw005A.getId() == 0) {
hgcw005A.setParentId(hgcw005.getId().toString());
this.add(hgcw005A);
} else {
this.modify(hgcw005A);
}
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgcw005AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param hgcw005A
* @return
*/
public void add(HGCW005A hgcw005A) {
DaoUtils.insert(HGCW005A.INSERT, hgcw005A);
}
/**
* 修改操作
*
* @param hgcw005A
* @return
*/
public void modify(HGCW005A hgcw005A) {
DaoUtils.update(HGCW005A.UPDATE, hgcw005A);
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW005A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
* @author LiuYang
* @version 1.0 2024/8/31
* @description 发货明细
*/
public class ServiceHGCW005B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, new HGCW005A());
try {
outInfo = super.query(inInfo, HGCW005A.QUERY_HGYX001, new HGCW005A());
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGCW005A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
}catch (Exception e){
LogUtils.setDetailMsg(outInfo, e, "初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGCW005A.QUERY_HGYX001,new HGCW005A());
}
}
......@@ -98,6 +98,9 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deliveryCode">
DELIVERY_CODE like CONCAT('%',#deliveryCode#,'%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -123,7 +126,8 @@
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
DELIVERY_CODE as "deliveryCode"
FROM ${hggpSchema}.HGCW005 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -131,7 +135,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
SIGNING_DATE desc ,ID desc
</isEmpty>
</dynamic>
......@@ -229,9 +233,13 @@
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
DEP_CODE, <!-- 部门编码 -->
DELIVERY_CODE
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #contractNumber#, #contractName#, #signingDate#, #partyA#, #partyB#, #reviewStatus#, #contractContent#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #contractNumber#, #contractName#, #signingDate#, #partyA#, #partyB#, #reviewStatus#, #contractContent#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #deliveryCode#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGCW005
</selectKey>
</insert>
<delete id="delete">
......@@ -261,7 +269,8 @@
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
DELIVERY_CODE = #deliveryCode#
WHERE
ID = #id#
</update>
......
......@@ -22,6 +22,10 @@ $(function() {
let auditStatus = item.status;
let template = '';
if (item.id) {
if (item.deliveryCode){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailFunc(' + item.id + ',\'' + item.deliveryCode + '\')">扣款明细</a>';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')" >附件上传</a>';
}
......@@ -41,7 +45,16 @@ $(function() {
init: function (e, options) {
console.log(e);
},
},{
field: "signingDate",
editor: "date",
init: function (e, options) {
console.log(e);
},
defaultValue: function (e, options) {
return currDate()
},
}
],
onSave: function (e) {
......@@ -58,6 +71,7 @@ $(function() {
loadComplete: function (e) {
$("#BTN_SUBMIT").on("click",submitFunc);
$("#BTN_SELECT").on("click",selectFunc)
},
onSuccess: function (e) {
......@@ -68,15 +82,7 @@ $(function() {
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
downKeyUp();
});
$(window).load(function () {
......@@ -276,3 +282,48 @@ function fileDetailFunc(id) {
height: "80%",
});
}
/**
* 选择发货单
*/
function selectFunc() {
JSColorbox.open({
href: "HGCW005B?methodName=initLoad",
title: "<div style='text-align: center;'>选择发货单</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
/**
*
* @param deliveryCode 发货单
*/
function detailFunc(id,deliveryCode) {
/*let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].reviewStatus == "3") {
message("已经审核的单据不能修改");
return;
}*/
JSColorbox.open({
href: "HGCW005A?methodName=initLoad&inqu_status-0-parentId=" + id + "&inqu_status-0-deliveryCode=" + deliveryCode + "&efParentFormEname=HGCW005",
title: "<div style='text-align: center;'>扣款明细</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
function windowCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="主合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" colWidth="3"/>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......@@ -33,7 +34,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFColumn ename="companyName" cname="所属公司" width="120" enable="false" readonly="true" align="center"/>
<EF:EFPopupColumn ename="projCode" cname="项目编号" width="200"
serviceName="HGCW002" methodName="projectComboBox"
......@@ -43,8 +44,7 @@
columnCnames="项目编码,项目名称,合同号,合同名称,甲方名称,乙方名称"
backFillColumnIds="projCode,projName,contractNumber,contractName,partyA,partyB"
backFillFieldIds="projCode,projName,contractNumber,contractName,partyA,partyB"
popupTitle="所属公司" popupWidth="800">
</EF:EFPopupColumn>
popupTitle="所属公司" popupWidth="800"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="主合同号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractName" cname="主合同名称" width="120" enable="false" readonly="true" align="center"/>
......@@ -54,6 +54,7 @@
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="扣款日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......
$(function() {
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows();
var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "companyCode",
template: function (row) {
for (let i = 0; i < companyBox.length; i++) {
if (companyBox[i]['companyCode'] === row['companyCode']){
row['inventName'] = companyBox[i]['companyName']
return companyBox[i]['companyName'];
}
}
return row["companyCode"];
}
}, {
field: "projCode",
title: "存货名称",
template: function (row) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === row['projCode']){
row['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return row["projCode"];
}
}, {
field: "receCode",
template: function (row) {
for (let i = 0; i < customerAllBox.length; i++) {
if (customerAllBox[i]['valueField'] === row['receCode']){
row['receName'] = customerAllBox[i]['textField']
return customerAllBox[i]['textField'];
}
}
return row["receCode"];
}
}, {
field: "inventCode",
template: function (row) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === row['inventCode']){
row['inventName'] = inventCodedBox[i]['textField']
return inventCodedBox[i]['textField'];
}
}
return row["inventCode"];
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "quantity"){
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity*unitWeight;
resultGrid.setCellValue(e.items[i],"weight",weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
});
},
onSuccess: function (e) {
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function(e) {
},
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let spec= item.get("spec");
let quantity= item.get("quantity");
if(isBlank(inventType)){
message("选中的第" + (index + 1) + "行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventCode)){
message("选中的第" + (index + 1) + "行\"存货编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(spec)){
message("选中的第" + (index + 1) + "行\"规格\",不能为空!");
flag = false;
return false;
}
if(isBlank(quantity) || parseInt(quantity) <= 0){
message("选中的第" + (index + 1) + "行\"数量\",必须是数值并且数量必须大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW005A", "save", true);
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/31
Time: 12:11
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="扣款单明细s">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" readonly="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" cname="收货方" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoBind="true" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="200" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="receCode" cname="收货方" enable="true" width="160" required="true"
blockName="customer_record_all_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
maxLength="16" readonly="true" align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" required="true"
filter="contains"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows();
var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "companyCode",
template: function (row) {
for (let i = 0; i < companyBox.length; i++) {
if (companyBox[i]['companyCode'] === row['companyCode']){
row['inventName'] = companyBox[i]['companyName']
return companyBox[i]['companyName'];
}
}
return row["companyCode"];
}
}, {
field: "projCode",
template: function (row) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === row['projCode']){
row['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return row["projCode"];
}
}, {
field: "receCode",
template: function (row) {
for (let i = 0; i < customerAllBox.length; i++) {
if (customerAllBox[i]['valueField'] === row['receCode']){
row['receName'] = customerAllBox[i]['textField']
return customerAllBox[i]['textField'];
}
}
return row["receCode"];
}
}, {
field: "inventCode",
template: function (row) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === row['inventCode']){
row['inventName'] = inventCodedBox[i]['textField']
return inventCodedBox[i]['textField'];
}
}
return row["inventCode"];
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "quantity"){
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity*unitWeight;
resultGrid.setCellValue(e.items[i],"weight",weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
});
},
onSuccess: function (e) {
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function(e) {
},
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
if(isBlank(totalContractPriceIncluding) || parseInt(totalContractPriceIncluding) <= 0){
message("选中的第" + (index + 1) + "行\"扣款金额\",必须是数值并且数量必须大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW005A", "save", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback(e);
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/31
Time: 14:36
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="选择发货单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" cname="收货方" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" enable="false" cname="公司名称" width="200" align="center"
filter="contains" readonly="true" required="false">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" enable="false"
maxLength="16" readonly="true" width="160" required="false"
align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="receCode" cname="收货方" enable="false" width="160" required="false"
blockName="customer_record_all_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
maxLength="16" readonly="true" align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" required="false"
filter="contains"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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