Commit 36a7f386 authored by 1650842865's avatar 1650842865

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

parent b4327560
......@@ -746,6 +746,28 @@ function getExtendedData(processAction) {
}
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();
//如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){
......@@ -877,11 +899,11 @@ function getZepItemNo() {
function businessJudgmentUnit() {
var isApply = isApplyProcUnit();
if (isApply) {
// $("#approvalMoney").hide();
// $("#financialAudit").hide();
// $("#financialAudit_sapReturn").hide();
// $("#capitalPost").hide();
// $("#paymentAccomplish_sapReturn").hide();
$("#approvalMoney").hide();
$("#financialAudit").hide();
$("#financialAudit_sapReturn").hide();
$("#capitalPost").hide();
$("#paymentAccomplish_sapReturn").hide();
return true;
}else {
UICtrl.setDisable($("#submitForm"));
......@@ -899,15 +921,15 @@ function nodeController(){
var subProcUnitId = getSubProcUnitId();
//财务审核
if ("financeNode" === subProcUnitId){
// $("#financialAudit_sapReturn").hide();
// $("#capitalPost").hide();
// $("#paymentAccomplish_sapReturn").hide();
$("#financialAudit_sapReturn").hide();
$("#capitalPost").hide();
$("#paymentAccomplish_sapReturn").hide();
}
//资金岗
if ("fundNode" === subProcUnitId){
// $("#financialAudit_sapReturn").hide();
// $("#paymentAccomplish_sapReturn").hide();
$("#financialAudit_sapReturn").hide();
$("#paymentAccomplish_sapReturn").hide();
}
}
......
......@@ -931,6 +931,27 @@ function getExtendedData(processAction) {
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();
//财务审核
......
......@@ -710,6 +710,27 @@ function getExtendedData(processAction) {
}
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();
//如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){
......
......@@ -807,6 +807,27 @@ function getExtendedData(processAction) {
}
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();
//如果没有收到SAP消息回执,不能提交归档
if ("file" === subProcUnitId){
......
var gridManager = null;
var orderItemGridManager = null;
var materialGridManager = null;
var gridManager = null;
......@@ -50,20 +49,10 @@ function loadOrderItemGrid() {
url: web_app.name + '/processOutsource/showAddAufnrDetail.load',
ok: function(d){
var _self = this;
var rows = gridManager.getSelectedRows();
var rows = detailGridManager.getSelectedRows();
for (var i = 0 ;i<rows.length;i++){
var row = rows[i];
var dates = orderItemGridManager.getData();
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({
UICtrl.addGridRow(orderItemGridManager,{
aufnr: row.AUFNR,
wempf: row.VORNR,
txz01: row.LTXA1,
......@@ -76,6 +65,7 @@ function loadOrderItemGrid() {
meinsName: row.MSEH3,
menge: row.GAMNG,
printLoss: row.ZLOSSC,
eeind: Public.formatDate(new Date(),'%Y-%M-%D'),
// 行号加一
sequence: (orderItemGridManager.getData().length + 1),
kpein: 1,
......@@ -261,9 +251,9 @@ function getOrderColumns(){
}
},);
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: {
type: "date", required: true
type: "text", required: true
}
},);
columns.push({
......@@ -387,7 +377,6 @@ function loadMaterialGrid() {
});
// 表格
materialGridManager = UICtrl.grid("#materialGrid", {
gridManager: null,
columns: [
{
display: "供给物品名称", name: "materialName", width: 300, minWidth: 60, type: "String", align: "left",
......@@ -466,6 +455,16 @@ function getExtendedData(processAction) {
if (!datas) {
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()){
for (let i = 0; i < datas.length; i++) {
var data = datas[i];
......@@ -504,6 +503,16 @@ function checkConstraints(){
if (!datas) {
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 ){
Public.tip("物料组件信息必填");
return false;
......
......@@ -3,17 +3,18 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<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'/>
</head>
<body>
<div class="container-fluid">
<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="sId"/>
<x:hidden name="applyType"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fillinDate"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
......@@ -24,21 +25,22 @@
<x:hidden name="personMemberId"/>
<x:hidden name="statusId"/>
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="werks"/>
<x:inputC name="werksName" label="工厂" labelCol="2" fieldCol="2" required="true" wrapper="select"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="werks"/>
<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 class="hg-form-row">
<x:textareaC name="situationDesc" label="情况说明" labelCol="2" fieldCol="10" required="true" rows="3"/>
</div>
</div>
<div class="blank_div clearfix"></div>
<x:title title="行项目" name="group"/>
<div id="orderItemGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="组件" name="group"/>
<div id="materialGrid" style="margin: 2px;"></div>
</form>
<div class="blank_div clearfix"></div>
<x:title title="行项目"/>
<div id="orderItemGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="组件"/>
<div id="materialGrid" style="margin: 2px;"></div>
</form>
</div>
</body>
</html>
var gridManager = null, refreshFlag = false;
var detailGridManager = null, refreshFlag = false;
$(document).ready(function () {
initUI();
initGrid();
......@@ -14,7 +14,7 @@ function initGrid() {
});
gridManager = UICtrl.grid('#aufnrgrid', {
detailGridManager = UICtrl.grid('#aufnrgrid', {
columns: [
{
display: "工单号", name: "AUFNR", width: "100", align: "left", type: "string",
......@@ -70,12 +70,12 @@ function initGrid() {
enableObjectBag: true,
}
);
UICtrl.setSearchAreaToggle(gridManager);
UICtrl.setSearchAreaToggle(detailGridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
UICtrl.gridSearch(detailGridManager, param);
}
function resetForm(obj) {
......
......@@ -36,4 +36,5 @@
<div id="maingrid"></div>
</form>
</div>
</body>
\ No newline at end of file
</body>
</html>
\ No newline at end of file
......@@ -77,7 +77,7 @@
<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="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="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
......
......@@ -69,7 +69,7 @@
<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="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="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
......
......@@ -138,6 +138,8 @@ public class ClientMaterialsApplicationImpl extends BaseApplication implements C
clientMaterialsDb.setPersonMemberId(org.getId());
clientMaterialsDb.setPersonMemberName(org.getName());
clientMaterialsDb.setFullId(org.getFullId());
}else {
clientMaterialsDb.setFullId(partner);
}
Map<String, Object> map = new HashMap<>();
map.put("id",org.getPerson().getId());
......
......@@ -2,6 +2,7 @@ package com.huigou.topsun.sap.costReimbursement.application.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
......@@ -80,12 +81,20 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
sapCostReimbursement = costReimbursementRepository.save(sapCostReimbursement);
List<SapCostReimbursementDetail> CRDetailAll = getBizEntities(SapCostReimbursementDetail.class, "CRDetail");
for (SapCostReimbursementDetail item : CRDetailAll) {
item.setReimbursementBaseInfoId(sapCostReimbursement.getId());
if (StringUtil.isBlank(item.getZpayStaus())){
item.setZpayStaus("未支付");
if (CRDetailAll.size() > 0) {
List<String> nos = new ArrayList<>();
for (SapCostReimbursementDetail item : CRDetailAll) {
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();
}
......
......@@ -39,7 +39,34 @@
<query name="processOutsourceOrderItems" label="订单明细" table="sap_process_outsource_order_item">
<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>
<condition column="process_outsource_id" name="processOutsourceId" type="java.lang.String" symbol="=" alias="t"/>
</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