Commit 36a7f386 authored by 1650842865's avatar 1650842865

费用报销相关行项目编号重复时提醒;工序外协选择日期改为手动填写日期

parent b4327560
...@@ -746,6 +746,28 @@ function getExtendedData(processAction) { ...@@ -746,6 +746,28 @@ function getExtendedData(processAction) {
} }
return mergedObj; return mergedObj;
}); });
var _reimbursementGrid = UICtrl.getGridManager('#reimbursementApplierGrid');
var reimbursementDatas = DataUtil.getGridData({
gridManager: _reimbursementGrid,
isAllData: isAllData,
onCheck: function () {
return true;
}
});
if (!reimbursementDatas) {
return false;
}
var nos = [];
for (var i = 0; i < reimbursementDatas.length; i++) {
var item = reimbursementDatas[i];
if (nos.indexOf(item.zepItemno) < 0) {
Public.tip("EP流程子序号不能重复")
return false;
}else {
nos.push(item.zepItemno);
}
}
var subProcUnitId = getSubProcUnitId(); var subProcUnitId = getSubProcUnitId();
//如果没有收到SAP消息回执,不能提交归档 //如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){ if ("file" === subProcUnitId){
...@@ -877,11 +899,11 @@ function getZepItemNo() { ...@@ -877,11 +899,11 @@ function getZepItemNo() {
function businessJudgmentUnit() { function businessJudgmentUnit() {
var isApply = isApplyProcUnit(); var isApply = isApplyProcUnit();
if (isApply) { if (isApply) {
// $("#approvalMoney").hide(); $("#approvalMoney").hide();
// $("#financialAudit").hide(); $("#financialAudit").hide();
// $("#financialAudit_sapReturn").hide(); $("#financialAudit_sapReturn").hide();
// $("#capitalPost").hide(); $("#capitalPost").hide();
// $("#paymentAccomplish_sapReturn").hide(); $("#paymentAccomplish_sapReturn").hide();
return true; return true;
}else { }else {
UICtrl.setDisable($("#submitForm")); UICtrl.setDisable($("#submitForm"));
...@@ -899,15 +921,15 @@ function nodeController(){ ...@@ -899,15 +921,15 @@ function nodeController(){
var subProcUnitId = getSubProcUnitId(); var subProcUnitId = getSubProcUnitId();
//财务审核 //财务审核
if ("financeNode" === subProcUnitId){ if ("financeNode" === subProcUnitId){
// $("#financialAudit_sapReturn").hide(); $("#financialAudit_sapReturn").hide();
// $("#capitalPost").hide(); $("#capitalPost").hide();
// $("#paymentAccomplish_sapReturn").hide(); $("#paymentAccomplish_sapReturn").hide();
} }
//资金岗 //资金岗
if ("fundNode" === subProcUnitId){ if ("fundNode" === subProcUnitId){
// $("#financialAudit_sapReturn").hide(); $("#financialAudit_sapReturn").hide();
// $("#paymentAccomplish_sapReturn").hide(); $("#paymentAccomplish_sapReturn").hide();
} }
} }
......
...@@ -931,6 +931,27 @@ function getExtendedData(processAction) { ...@@ -931,6 +931,27 @@ function getExtendedData(processAction) {
return mergedObj; return mergedObj;
}); });
var _reimbursementGrid = UICtrl.getGridManager('#reimbursementApplierGrid');
var reimbursementDatas = DataUtil.getGridData({
gridManager: _reimbursementGrid,
isAllData: isAllData,
onCheck: function () {
return true;
}
});
if (!reimbursementDatas) {
return false;
}
var nos = [];
for (var i = 0; i < reimbursementDatas.length; i++) {
var item = reimbursementDatas[i];
if (nos.indexOf(item.zepItemno) < 0) {
Public.tip("EP流程子序号不能重复")
return false;
}else {
nos.push(item.zepItemno);
}
}
//原因代码、是否付款、直联付款标识必输,且如果为多行的话,这三个字段的值必须相同,不相同报错提示,不允许提交 //原因代码、是否付款、直联付款标识必输,且如果为多行的话,这三个字段的值必须相同,不相同报错提示,不允许提交
var subProcUnitId = getSubProcUnitId(); var subProcUnitId = getSubProcUnitId();
//财务审核 //财务审核
......
...@@ -710,6 +710,27 @@ function getExtendedData(processAction) { ...@@ -710,6 +710,27 @@ function getExtendedData(processAction) {
} }
return mergedObj; return mergedObj;
}); });
var _reimbursementGrid = UICtrl.getGridManager('#reimbursementApplierGrid');
var reimbursementDatas = DataUtil.getGridData({
gridManager: _reimbursementGrid,
isAllData: isAllData,
onCheck: function () {
return true;
}
});
if (!reimbursementDatas) {
return false;
}
var nos = [];
for (var i = 0; i < reimbursementDatas.length; i++) {
var item = reimbursementDatas[i];
if (nos.indexOf(item.zepItemno) < 0) {
Public.tip("EP流程子序号不能重复")
return false;
}else {
nos.push(item.zepItemno);
}
}
var subProcUnitId = getSubProcUnitId(); var subProcUnitId = getSubProcUnitId();
//如果没有收到SAP消息回执,不能提交归档 //如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){ if ("file" === subProcUnitId){
......
...@@ -807,6 +807,27 @@ function getExtendedData(processAction) { ...@@ -807,6 +807,27 @@ function getExtendedData(processAction) {
} }
return mergedObj; return mergedObj;
}); });
var _reimbursementGrid = UICtrl.getGridManager('#reimbursementApplierGrid');
var reimbursementDatas = DataUtil.getGridData({
gridManager: _reimbursementGrid,
isAllData: isAllData,
onCheck: function () {
return true;
}
});
if (!reimbursementDatas) {
return false;
}
var nos = [];
for (var i = 0; i < reimbursementDatas.length; i++) {
var item = reimbursementDatas[i];
if (nos.indexOf(item.zepItemno) < 0) {
Public.tip("EP流程子序号不能重复")
return false;
}else {
nos.push(item.zepItemno);
}
}
var subProcUnitId = getSubProcUnitId(); var subProcUnitId = getSubProcUnitId();
//如果没有收到SAP消息回执,不能提交归档 //如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){ if ("file" === subProcUnitId){
......
var gridManager = null;
var orderItemGridManager = null; var orderItemGridManager = null;
var materialGridManager = null; var materialGridManager = null;
var gridManager = null; var gridManager = null;
...@@ -50,20 +49,10 @@ function loadOrderItemGrid() { ...@@ -50,20 +49,10 @@ function loadOrderItemGrid() {
url: web_app.name + '/processOutsource/showAddAufnrDetail.load', url: web_app.name + '/processOutsource/showAddAufnrDetail.load',
ok: function(d){ ok: function(d){
var _self = this; var _self = this;
var rows = gridManager.getSelectedRows(); var rows = detailGridManager.getSelectedRows();
for (var i = 0 ;i<rows.length;i++){ for (var i = 0 ;i<rows.length;i++){
var row = rows[i]; var row = rows[i];
var dates = orderItemGridManager.getData(); UICtrl.addGridRow(orderItemGridManager,{
if (dates != null && dates.length > 0){
for (let j = 0; j < dates.length; j++) {
var data = dates[j];
if (data.aufnr == row.AUFNR){
Public.tip("生产单号:"+row.AUFNR+" 已选择,请取消勾选!");
return false;
}
}
}
orderItemGridManager.addRow({
aufnr: row.AUFNR, aufnr: row.AUFNR,
wempf: row.VORNR, wempf: row.VORNR,
txz01: row.LTXA1, txz01: row.LTXA1,
...@@ -76,6 +65,7 @@ function loadOrderItemGrid() { ...@@ -76,6 +65,7 @@ function loadOrderItemGrid() {
meinsName: row.MSEH3, meinsName: row.MSEH3,
menge: row.GAMNG, menge: row.GAMNG,
printLoss: row.ZLOSSC, printLoss: row.ZLOSSC,
eeind: Public.formatDate(new Date(),'%Y-%M-%D'),
// 行号加一 // 行号加一
sequence: (orderItemGridManager.getData().length + 1), sequence: (orderItemGridManager.getData().length + 1),
kpein: 1, kpein: 1,
...@@ -261,9 +251,9 @@ function getOrderColumns(){ ...@@ -261,9 +251,9 @@ function getOrderColumns(){
} }
},); },);
columns.push({ columns.push({
display: "需求日期", name: "eeind", width: 140, minWidth: 60, type: "date", align: "left", display: "需求日期", name: "eeind", width: 140, minWidth: 60, type: "string", align: "left",
editor: { editor: {
type: "date", required: true type: "text", required: true
} }
},); },);
columns.push({ columns.push({
...@@ -387,7 +377,6 @@ function loadMaterialGrid() { ...@@ -387,7 +377,6 @@ function loadMaterialGrid() {
}); });
// 表格 // 表格
materialGridManager = UICtrl.grid("#materialGrid", { materialGridManager = UICtrl.grid("#materialGrid", {
gridManager: null,
columns: [ columns: [
{ {
display: "供给物品名称", name: "materialName", width: 300, minWidth: 60, type: "String", align: "left", display: "供给物品名称", name: "materialName", width: 300, minWidth: 60, type: "String", align: "left",
...@@ -466,6 +455,16 @@ function getExtendedData(processAction) { ...@@ -466,6 +455,16 @@ function getExtendedData(processAction) {
if (!datas) { if (!datas) {
return false; return false;
} }
if (isApplyProcUnit()){
for (let i = 0; i < datas.length; i++) {
var data = datas[i];
var regex = /^\d{4}-\d{2}-\d{2}$/;
if (!regex.test(data.eeind)) {
Public.tip("序号为:"+data.sequence+" 的行项目需求日期格式应为:年-月-日");
return false; // 格式不匹配
}
}
}
if ("outer" == getSubProcUnitId()){ if ("outer" == getSubProcUnitId()){
for (let i = 0; i < datas.length; i++) { for (let i = 0; i < datas.length; i++) {
var data = datas[i]; var data = datas[i];
...@@ -504,6 +503,16 @@ function checkConstraints(){ ...@@ -504,6 +503,16 @@ function checkConstraints(){
if (!datas) { if (!datas) {
return false; return false;
} }
if (isApplyProcUnit()){
for (let i = 0; i < datas.length; i++) {
var data = datas[i];
var regex = /^\d{4}-\d{2}-\d{2}$/;
if (!regex.test(data.eeind)) {
Public.tip("序号为:"+data.sequence+" 的行项目需求日期格式应为:年-月-日");
return false; // 格式不匹配
}
}
}
if (isApplyProcUnit() && datas.length == 0 ){ if (isApplyProcUnit() && datas.length == 0 ){
Public.tip("物料组件信息必填"); Public.tip("物料组件信息必填");
return false; return false;
......
...@@ -3,17 +3,18 @@ ...@@ -3,17 +3,18 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html> <html>
<head> <head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,attachment"/> <x:base include="layout,dialog,grid,tree,date,combox,attachment,commonTree,comboDialog"/>
<x:script src='/biz/topsun/sap/processOutsource/processOutsourceDetail.js'/> <x:script src='/biz/topsun/sap/processOutsource/processOutsourceDetail.js'/>
</head> </head>
<body> <body>
<div class="container-fluid">
<x:billTitle title="临时工序外协申请" needStatus="false" needPerson="true"/> <x:billTitle title="临时工序外协申请" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm"> <form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/> <x:hidden name="id"/>
<x:hidden name="sId"/> <x:hidden name="sId"/>
<x:hidden name="applyType"/> <x:hidden name="applyType"/>
<x:hidden name="billCode"/> <x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/> <x:hidden name="fillinDate"/>
<x:hidden name="fullId"/> <x:hidden name="fullId"/>
<x:hidden name="organId"/> <x:hidden name="organId"/>
<x:hidden name="organName"/> <x:hidden name="organName"/>
...@@ -24,21 +25,22 @@ ...@@ -24,21 +25,22 @@
<x:hidden name="personMemberId"/> <x:hidden name="personMemberId"/>
<x:hidden name="statusId"/> <x:hidden name="statusId"/>
<x:hidden name="personMemberName"/> <x:hidden name="personMemberName"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:hidden name="werks"/> <x:hidden name="werks"/>
<x:inputC name="werksName" label="工厂" labelCol="2" fieldCol="2" required="true" wrapper="select"/> <x:inputC name="werksName" label="工厂" labelCol="2" fieldCol="2" required="true" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:textareaC name="situationDesc" label="情况说明" labelCol="2" fieldCol="10" required="true" rows="3"/>
</div>
</div> </div>
<div class="hg-form-row"> <div class="blank_div clearfix"></div>
<x:textareaC name="situationDesc" label="情况说明" labelCol="2" fieldCol="10" required="true" rows="3"/> <x:title title="行项目"/>
</div> <div id="orderItemGrid" style="margin: 2px;"></div>
</div> <div class="blank_div clearfix"></div>
<div class="blank_div clearfix"></div> <x:title title="组件"/>
<x:title title="行项目" name="group"/> <div id="materialGrid" style="margin: 2px;"></div>
<div id="orderItemGrid" style="margin: 2px;"></div> </form>
<div class="blank_div clearfix"></div> </div>
<x:title title="组件" name="group"/>
<div id="materialGrid" style="margin: 2px;"></div>
</form>
</body> </body>
</html> </html>
var gridManager = null, refreshFlag = false; var detailGridManager = null, refreshFlag = false;
$(document).ready(function () { $(document).ready(function () {
initUI(); initUI();
initGrid(); initGrid();
...@@ -14,7 +14,7 @@ function initGrid() { ...@@ -14,7 +14,7 @@ function initGrid() {
}); });
gridManager = UICtrl.grid('#aufnrgrid', { detailGridManager = UICtrl.grid('#aufnrgrid', {
columns: [ columns: [
{ {
display: "工单号", name: "AUFNR", width: "100", align: "left", type: "string", display: "工单号", name: "AUFNR", width: "100", align: "left", type: "string",
...@@ -70,12 +70,12 @@ function initGrid() { ...@@ -70,12 +70,12 @@ function initGrid() {
enableObjectBag: true, enableObjectBag: true,
} }
); );
UICtrl.setSearchAreaToggle(gridManager); UICtrl.setSearchAreaToggle(detailGridManager);
} }
function query(obj) { function query(obj) {
var param = $(obj).formToJSON(); var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param); UICtrl.gridSearch(detailGridManager, param);
} }
function resetForm(obj) { function resetForm(obj) {
......
...@@ -36,4 +36,5 @@ ...@@ -36,4 +36,5 @@
<div id="maingrid"></div> <div id="maingrid"></div>
</form> </form>
</div> </div>
</body> </body>
\ No newline at end of file </html>
\ No newline at end of file
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu"/> <x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" match="email"/> <x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6"/> <x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" match="phone"/> <x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" />
<%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%> <%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/> <x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%> <%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu" disabled="true"/> <x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu" disabled="true"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" readonly="true" match="email"/> <x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" readonly="true" match="email"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6" readonly="true"/> <x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6" readonly="true"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true" match="phone"/> <x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%> <%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/> <x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%> <%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
......
...@@ -138,6 +138,8 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C ...@@ -138,6 +138,8 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C
clientMaterialsDb.setPersonMemberId(org.getId()); clientMaterialsDb.setPersonMemberId(org.getId());
clientMaterialsDb.setPersonMemberName(org.getName()); clientMaterialsDb.setPersonMemberName(org.getName());
clientMaterialsDb.setFullId(org.getFullId()); clientMaterialsDb.setFullId(org.getFullId());
}else {
clientMaterialsDb.setFullId(partner);
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id",org.getPerson().getId()); map.put("id",org.getPerson().getId());
......
...@@ -2,6 +2,7 @@ package com.huigou.topsun.sap.costReimbursement.application.impl; ...@@ -2,6 +2,7 @@ package com.huigou.topsun.sap.costReimbursement.application.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
...@@ -80,12 +81,20 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S ...@@ -80,12 +81,20 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
sapCostReimbursement = costReimbursementRepository.save(sapCostReimbursement); sapCostReimbursement = costReimbursementRepository.save(sapCostReimbursement);
List<SapCostReimbursementDetail> CRDetailAll = getBizEntities(SapCostReimbursementDetail.class, "CRDetail"); List<SapCostReimbursementDetail> CRDetailAll = getBizEntities(SapCostReimbursementDetail.class, "CRDetail");
for (SapCostReimbursementDetail item : CRDetailAll) { if (CRDetailAll.size() > 0) {
item.setReimbursementBaseInfoId(sapCostReimbursement.getId()); List<String> nos = new ArrayList<>();
if (StringUtil.isBlank(item.getZpayStaus())){ for (SapCostReimbursementDetail item : CRDetailAll) {
item.setZpayStaus("未支付"); item.setReimbursementBaseInfoId(sapCostReimbursement.getId());
if (StringUtil.isBlank(item.getZpayStaus())){
item.setZpayStaus("未支付");
}
if (nos.contains(item.getZepItemno())){
LOG.info("明细行数据:{}", JSON.toJSONString(CRDetailAll));
throw new RuntimeException("明细行项目编号重复");
}
nos.add(item.getZepItemno());
costReimbursementDetailRepository.save(item);
} }
costReimbursementDetailRepository.save(item);
} }
return sapCostReimbursement.getId(); return sapCostReimbursement.getId();
} }
......
...@@ -39,7 +39,34 @@ ...@@ -39,7 +39,34 @@
<query name="processOutsourceOrderItems" label="订单明细" table="sap_process_outsource_order_item"> <query name="processOutsourceOrderItems" label="订单明细" table="sap_process_outsource_order_item">
<sql-query> <sql-query>
select t.* from sap_process_outsource_order_item t where 1=1 select t.id,
t.version,
t.process_outsource_id,
t.EBELN,
t.EBELP,
t.sequence,
t.AUFNR,
t.WEMPF,
t.TXZ01,
t.ABLAD,
t.MENGE,
t.MEINS,
t.MEINS_NAME,
DATE_FORMAT(t.EEIND, '%Y-%m-%d') EEIND,
t.LIFNR,
t.LIFNR_NAME,
t.KBETR,
t.PURCHASE_MWSKZ,
t.KPEIN,
t.WAERS,
t.LGORT,
t.LGORT_NAME,
t.TXZ02,
t.PRINT_LOSS,
t.PRODUCT_CODE,
t.PRODUCT_NAME,
t.PRODUCT_TYPE,
t.PRODUCT_TYPE_NAME from sap_process_outsource_order_item t where 1=1
</sql-query> </sql-query>
<condition column="process_outsource_id" name="processOutsourceId" type="java.lang.String" symbol="=" alias="t"/> <condition column="process_outsource_id" name="processOutsourceId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
......
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