Commit 00498be4 authored by 鲁鑫's avatar 鲁鑫

费用报销,员工借款,预付款页面

parent 72132bbc
var tableArray = [
{
parms: {},
node: "reimbursementApplierGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "计划内外付款标识", name: "zepPlan", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "计划内外标识名称",
name: "zepPlanname",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "BP标识", name: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP账号名称", name: "koinh", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP联行号", name: "bankl", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP银行账号", name: "bankn", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "SWIFT/BIC", name: "swift", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "采购订单号", name: "ebeln", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "采购订单行", name: "ebelp", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "采购订单行信息", name: "zekpoItem", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "币别", name: "waers", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "汇率", name: "kursf", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额", name: "kzwi1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "税码", name: "mwskz", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(本位币)", name: "kzwi11", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
}, {
parms: {},
node: "financialAuditGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "原因代码", name: "rstgr", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(审批)",
name: "zepPtdamount1",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(审批-本位币)",
name: "zepPtdamount",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "是否付款", name: "zepPay", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款方式代码", name: "zlsch", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款方式名称", name: "zlschText1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "直联付款标识", name: "zepBank", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
},
{
parms: {},
node: "financialAudit_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "记账凭证编号", name: "belnr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证财年", name: "gjahr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账过账日期", name: "budat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证日期", name: "bldat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回状态", name: "msgty", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回消息", name: "msgtx", width: 120, minwidth: 120, type: "string", align: "left"},
]
},
{
parms: {},
node: "capitalPostGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "付款银行账号", name: "bankn1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款银行账号名称",
name: "zt012kText1",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "付款附言", name: "zepTxt1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
}
, {
parms: {},
node: "paymentAccomplish_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "付款凭证编号", name: "belnr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款凭证财年", name: "gjahr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款状态", name: "zpayStaus", width: 120, minwidth: 120, type: "string", align: "left"}
]
}
]
//创建表格(参数、列、插入的节点、数据源)
function loadGrid(obj) {
var toolbarOptions = null;
// if(obj.node=="reimbursementApplierGrid") {//只有第一个表格含工具栏
toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
tableArray.forEach((item) => {
UICtrl.addGridRow(item.gridManager, {zepItemno: getZepItemNo()});
});
},
deleteHandler: function () {
tableArray.forEach((item) => {
item.gridManager.deleteSelectedRow();
});
}
});
// }
obj.gridManager = UICtrl.grid("#" + obj.node, {
columns: obj.columns,
dataAction: "local",
data: obj.data,
parms: obj.parms,
pageSize: 20,
toolbar: toolbarOptions,
usePager: false,
enabledEdit: true,
// width: "100%",
// height: 300,
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onBeforeCheckRow: function (checked, data) {
debugger
//同时选定或取消所有表格中的对应行
tableArray.forEach((item) => {
let rows = item.gridManager.rows;
let row = {};
rows.forEach((temp) => {
if (temp.zepItemno === data.zepItemno) {
row = temp;
}
})
checked ? item.gridManager.select(row) : item.gridManager.unselect(row);
})
return false;//阻止默认事件、防止某个表格的对应行被多次选中
},
onBeforeCheckAllRow: function (a, b) {
// console.log(b)
// $(b).addClass("l-checked")
// debugger
//同时全选、同时取消全选
// tableArray.forEach((item) => {
// let hrow=$(item.gridManager.element);//全选框
// console.log(hrow)
// console.log(item.gridManager.element)
//
// let checked= !hrow.hasClass("l-checked");
// $(hrow).toggleClass("l-checked",checked);
// let rows = item.gridManager.selected;
// rows.forEach((row) => {
// checked?item.gridManager.select(row):item.gridManager.unselect(row);
// })
// })
return false;//阻止默认事件
}
});
UICtrl.setSearchAreaToggle(obj.gridManager);
}
$(document).ready(function () {
initialize();
});
function initialize() {
//获取数据源初始化表格
Public.ajax(web_app.name + '/sapCostReimbursement/slicedSapCostReimbursementDetailList.ajax', {id: getId()}, function (data) {
//根据定义列拆除实体对象,封装成每个table对应的数据集
tableArray.forEach(obj => {
obj.data = {
Rows: data.map(item => {
let row = {};
obj.columns.forEach(col => {
if (item.hasOwnProperty(col.name)) {
row[col.name] = item[col.name];
}
});
return row;
})
};
});
useArrayTable(loadGrid);
})
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(id) {
$("#id").val(id);
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
return $("#id").val() || "";
}
function getExtendedData(processAction) {
tableArray.forEach((item) => {
console.log(item)
});
debugger
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
let resultArray = useArrayTable(getTableDataAll);
//根据zepItemno将各列表属性合并为一个完整实体
const result = resultArray[0].map((obj1) => {
const mergedObj = {...obj1};
for (let i = 1; i < resultArray.length; i++) {
const currentArr = resultArray[i];
const currentObj = currentArr.find((obj) => obj.zepItemno === obj1.zepItemno);
if (currentObj) {
Object.assign(mergedObj, currentObj);
}
}
return mergedObj;
});
let extendedData = {};
extendedData.CRDetail = Public.encodeJSONURI(result);
return extendedData;
}
function getTableDataAll(obj) {
let result = DataUtil.getGridData({
gridManager: obj.gridManager,
isAllData: true
});
return result;
}
//调用数组
function useArrayTable(func, ...data) {
debugger
const results = tableArray.map((item) => {
return func(item, ...data);
});
return results;
}
//获取最新子序号(维护实体的标识)
function getZepItemNo() {
let result = getTableDataAll(tableArray[tableArray.length - 1]);
let zepItemNo = "001";
if (result.length > 0) {
//获取上一个节点的子序值
let wornNo = parseInt(result[result.length - 1]["zepItemno"], 10);
zepItemNo = ("00" + (wornNo + 1)).slice(-3);
}
return zepItemNo;
}
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/costReimbursement/advancePayment.js'/>
</head>
<body>
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="预付款申请" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="zepNo" required="false" readonly="true" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" readonly="true" wrapper="date" label="付款申请创建日期" labelCol="2"
fieldCol="2"/>
<x:inputC name="zepFtype" required="false" readonly="true" label="EP付款申请类别" labelCol="2" maxLength="64"
fieldCol="2"
/>
<x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64"
fieldCol="2"/>
<x:inputC name="bukrs" required="false" label="公司代码" labelCol="2" fieldCol="2"/>
<x:inputC name="butxt" required="false" label="公司代码名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepart" required="false" readonly="true" label="EP部门代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepartname" required="false" readonly="true" label="EP部门名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppli" required="false" readonly="true" label="EP流程申请人代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppliname" required="false" readonly="true" label="EP流程申请人" labelCol="2" fieldCol="2"/>
<x:inputC name="zepTxt" required="false" label="付款申请内容" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount" required="false" label="申请总金额(本位币)" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount1" required="false" label="申请总金额" labelCol="2" fieldCol="2"/>
<x:inputC name="zepPtamount" required="false" label="审批总金额(本位币)" labelCol="2" fieldCol="2"/>
<x:inputC name="zepPtamount1" required="false" label="审批总金额" labelCol="2" fieldCol="2"/>
</div>
</div>
<div class="blank_div clearfix"></div>
<x:title title="报销人填写" name="group"/>
<div id="reimbursementApplierGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务审核填写" name="group"/>
<div id="financialAuditGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务已审核、sap回执" name="group"/>
<div id="financialAudit_sapReturnGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="资金岗填写" name="group"/>
<div id="capitalPostGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="付款完成、sap回执" name="group"/>
<div id="paymentAccomplish_sapReturnGrid" style="margin: 2px;">
</div>
</div>
</form>
</body>
</html>
......@@ -316,7 +316,23 @@ var tableArray = [
}
},
]
}, {
}
, {
parms: {},
node: "financialAudit_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "记账凭证编号", name: "belnr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证财年", name: "gjahr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账过账日期", name: "budat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证日期", name: "bldat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回状态", name: "msgty", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回消息", name: "msgtx", width: 120, minwidth: 120, type: "string", align: "left"},
]
}
, {
parms: {},
node: "capitalPostGrid",
gridManager: null,
......@@ -351,21 +367,6 @@ var tableArray = [
},
]
}
, {
parms: {},
node: "financialAudit_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "记账凭证编号", name: "belnr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证财年", name: "gjahr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账过账日期", name: "budat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证日期", name: "bldat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回状态", name: "msgty", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回消息", name: "msgtx", width: 120, minwidth: 120, type: "string", align: "left"},
]
}
, {
parms: {},
node: "paymentAccomplish_sapReturnGrid",
......@@ -374,6 +375,7 @@ var tableArray = [
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "付款凭证编号", name: "belnr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款凭证财年", name: "gjahr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款状态", name: "zpayStaus", width: 120, minwidth: 120, type: "string", align: "left"}
]
}
......
......@@ -25,22 +25,20 @@
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="zepNo" required="false" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" wrapper="date" label="付款申请创建日期" labelCol="2"
<x:inputC name="zepNo" required="false" readonly="true" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" readonly="true" wrapper="date" label="付款申请创建日期" labelCol="2"
fieldCol="2"/>
<x:inputC name="zepFtype" required="false" label="EP付款申请类别" labelCol="2" maxLength="64"
<x:inputC name="zepFtype" required="false" readonly="true" label="EP付款申请类别" labelCol="2" maxLength="64"
fieldCol="2"
/>
<x:inputC name="zepFtypename" required="false" label="EP付款申请类别名称" labelCol="2" maxLength="64"
<x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64"
fieldCol="2"/>
<x:inputC name="bukrs" required="false" label="公司代码" labelCol="2" fieldCol="2"/>
<x:inputC name="butxt" required="false" label="公司代码名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepart" required="false" label="EP部门代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepartname" required="false" label="EP部门名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppli" required="false" label="EP流程申请人代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppliname" required="false" label="EP流程申请人" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFcrdate" wrapper="date" required="false" label="付款申请创建日期" labelCol="2"
fieldCol="2"/>
<x:inputC name="zepDepart" required="false" readonly="true" label="EP部门代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepartname" required="false" readonly="true" label="EP部门名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppli" required="false" readonly="true" label="EP流程申请人代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppliname" required="false" readonly="true" label="EP流程申请人" labelCol="2" fieldCol="2"/>
<x:inputC name="zepTxt" required="false" label="付款申请内容" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount" required="false" label="申请总金额(本位币)" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFttax" required="false" label="申请总税额(本位币)" labelCol="2" fieldCol="2"/>
......
var tableArray = [
{
parms: {},
node: "reimbursementApplierGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "计划内外付款标识", name: "zepPlan", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "计划内外标识名称",
name: "zepPlanname",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "BP标识", name: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP账号名称", name: "koinh", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP联行号", name: "bankl", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "BP银行账号", name: "bankn", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "SWIFT/BIC", name: "swift", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "费用类型代码", name: "zepExtype", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "计划付款日期", name: "zepFpldate", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'date'
}
},
{
display: "币别", name: "waers", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "汇率", name: "kursf", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额", name: "kzwi1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(本位币)", name: "kzwi11", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
}, {
parms: {},
node: "financialAuditGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "原因代码", name: "rstgr", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(审批)",
name: "zepPtdamount1",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "含税金额(审批-本位币)",
name: "zepPtdamount",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "是否付款", name: "zepPay", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款方式代码", name: "zlsch", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款方式名称", name: "zlschText1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "直联付款标识", name: "zepBank", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
}, {
parms: {},
node: "capitalPostGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "付款银行账号", name: "bankn1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "付款银行账号名称",
name: "zt012kText1",
width: 120,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "付款附言", name: "zepTxt1", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
]
}
, {
parms: {},
node: "financialAudit_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "记账凭证编号", name: "belnr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证财年", name: "gjahr", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账过账日期", name: "budat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "记账凭证日期", name: "bldat", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回状态", name: "msgty", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "返回消息", name: "msgtx", width: 120, minwidth: 120, type: "string", align: "left"},
]
}
, {
parms: {},
node: "paymentAccomplish_sapReturnGrid",
gridManager: null,
data: null,
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "付款凭证编号", name: "belnr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款凭证财年", name: "gjahr1", width: 120, minwidth: 120, type: "string", align: "left"},
{display: "付款状态", name: "zpayStaus", width: 120, minwidth: 120, type: "string", align: "left"}
]
}
]
//创建表格(参数、列、插入的节点、数据源)
function loadGrid(obj) {
var toolbarOptions = null;
// if(obj.node=="reimbursementApplierGrid") {//只有第一个表格含工具栏
toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
tableArray.forEach((item) => {
UICtrl.addGridRow(item.gridManager, {zepItemno: getZepItemNo()});
});
},
deleteHandler: function () {
tableArray.forEach((item) => {
item.gridManager.deleteSelectedRow();
});
}
});
// }
obj.gridManager = UICtrl.grid("#" + obj.node, {
columns: obj.columns,
dataAction: "local",
data: obj.data,
parms: obj.parms,
pageSize: 20,
toolbar: toolbarOptions,
usePager: false,
enabledEdit: true,
// width: "100%",
// height: 300,
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onBeforeCheckRow: function (checked, data) {
debugger
//同时选定或取消所有表格中的对应行
tableArray.forEach((item) => {
let rows = item.gridManager.rows;
let row = {};
rows.forEach((temp) => {
if (temp.zepItemno === data.zepItemno) {
row = temp;
}
})
checked ? item.gridManager.select(row) : item.gridManager.unselect(row);
})
return false;//阻止默认事件、防止某个表格的对应行被多次选中
},
onBeforeCheckAllRow: function (a, b) {
// console.log(b)
// $(b).addClass("l-checked")
// debugger
//同时全选、同时取消全选
// tableArray.forEach((item) => {
// let hrow=$(item.gridManager.element);//全选框
// console.log(hrow)
// console.log(item.gridManager.element)
//
// let checked= !hrow.hasClass("l-checked");
// $(hrow).toggleClass("l-checked",checked);
// let rows = item.gridManager.selected;
// rows.forEach((row) => {
// checked?item.gridManager.select(row):item.gridManager.unselect(row);
// })
// })
return false;//阻止默认事件
}
});
UICtrl.setSearchAreaToggle(obj.gridManager);
}
$(document).ready(function () {
initialize();
});
function initialize() {
//获取数据源初始化表格
Public.ajax(web_app.name + '/sapCostReimbursement/slicedSapCostReimbursementDetailList.ajax', {id: getId()}, function (data) {
//根据定义列拆除实体对象,封装成每个table对应的数据集
tableArray.forEach(obj => {
obj.data = {
Rows: data.map(item => {
let row = {};
obj.columns.forEach(col => {
if (item.hasOwnProperty(col.name)) {
row[col.name] = item[col.name];
}
});
return row;
})
};
});
useArrayTable(loadGrid);
})
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(id) {
$("#id").val(id);
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
return $("#id").val() || "";
}
function getExtendedData(processAction) {
tableArray.forEach((item) => {
console.log(item)
});
debugger
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
let resultArray = useArrayTable(getTableDataAll);
//根据zepItemno将各列表属性合并为一个完整实体
const result = resultArray[0].map((obj1) => {
const mergedObj = {...obj1};
for (let i = 1; i < resultArray.length; i++) {
const currentArr = resultArray[i];
const currentObj = currentArr.find((obj) => obj.zepItemno === obj1.zepItemno);
if (currentObj) {
Object.assign(mergedObj, currentObj);
}
}
return mergedObj;
});
let extendedData = {};
extendedData.CRDetail = Public.encodeJSONURI(result);
return extendedData;
}
function getTableDataAll(obj) {
let result = DataUtil.getGridData({
gridManager: obj.gridManager,
isAllData: true
});
return result;
}
//调用数组
function useArrayTable(func, ...data) {
debugger
const results = tableArray.map((item) => {
return func(item, ...data);
});
return results;
}
//获取最新子序号(维护实体的标识)
function getZepItemNo() {
let result = getTableDataAll(tableArray[tableArray.length - 1]);
let zepItemNo = "001";
if (result.length > 0) {
//获取上一个节点的子序值
let wornNo = parseInt(result[result.length - 1]["zepItemno"], 10);
zepItemNo = ("00" + (wornNo + 1)).slice(-3);
}
return zepItemNo;
}
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/costReimbursement/employeeLoan.js'/>
</head>
<body>
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="员工借款申请" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="zepNo" required="false" readonly="true" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" readonly="true" wrapper="date" label="付款申请创建日期" labelCol="2"
fieldCol="2"/>
<x:inputC name="zepFtype" required="false" readonly="true" label="EP付款申请类别" labelCol="2" maxLength="64"
fieldCol="2"
/>
<x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64"
fieldCol="2"/>
<x:inputC name="bukrs" required="false" label="公司代码" labelCol="2" fieldCol="2"/>
<x:inputC name="butxt" required="false" label="公司代码名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepart" required="false" readonly="true" label="EP部门代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepartname" required="false" readonly="true" label="EP部门名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppli" required="false" readonly="true" label="EP流程申请人代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppliname" required="false" readonly="true" label="EP流程申请人" labelCol="2" fieldCol="2"/>
<x:inputC name="zepTxt" required="false" label="付款申请内容" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount" required="false" label="申请总金额(本位币)" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount1" required="false" label="申请总金额" labelCol="2" fieldCol="2"/>
<x:inputC name="zepPtamount" required="false" label="审批总金额(本位币)" labelCol="2" fieldCol="2"/>
<x:inputC name="zepPtamount1" required="false" label="审批总金额" labelCol="2" fieldCol="2"/>
</div>
</div>
<div class="blank_div clearfix"></div>
<x:title title="报销人填写" name="group"/>
<div id="reimbursementApplierGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务审核填写" name="group"/>
<div id="financialAuditGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务已审核、sap回执" name="group"/>
<div id="financialAudit_sapReturnGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="资金岗填写" name="group"/>
<div id="capitalPostGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="付款完成、sap回执" name="group"/>
<div id="paymentAccomplish_sapReturnGrid" style="margin: 2px;">
</div>
</div>
</form>
</body>
</html>
......@@ -21,6 +21,7 @@ import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -49,22 +50,36 @@ public class SapCostReimbursementController extends CommonController {
this.putAttribute("procUnitId", "Apply");//定义流程环节的id
SDO sdo = this.getSDO();
String type= sdo.getProperty("type").toString();
SapCostReimbursement sapCostReimbursement = new SapCostReimbursement();
sapCostReimbursement.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();//获取当前操作员的详情信息
sapCostReimbursement.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
sapCostReimbursement.setZepNo(sapCostReimbursement.getBillCode());
sapCostReimbursement.setZepDepart(operator.getDeptCode());
sapCostReimbursement.setZepDepartname(operator.getDeptName());
sapCostReimbursement.setZepAppli(operator.getLoginName());
sapCostReimbursement.setZepAppliname(operator.getName());
sapCostReimbursement.setZepFcrdate(new Date());
switch (type) {
case "cost":
sapCostReimbursement.setZepFtype("A");
sapCostReimbursement.setZepFtypename("费用报销流程");
return forward("costReimbursement",sapCostReimbursement);
case "borrow":
return forward("costReimbursement",sapCostReimbursement);
sapCostReimbursement.setZepFtype("B");
sapCostReimbursement.setZepFtypename("员工借款流程");
return forward("employeeLoan",sapCostReimbursement);
case "advance":
return forward("costReimbursement",sapCostReimbursement);
sapCostReimbursement.setZepFtype("D");
sapCostReimbursement.setZepFtypename("预付款申请流程");
return forward("advancePayment",sapCostReimbursement);
case "pay":
sapCostReimbursement.setZepFtype("C");
sapCostReimbursement.setZepFtypename("付款申请流程");
return forward("payApply",sapCostReimbursement);
case "refund":
sapCostReimbursement.setZepFtype("E");
sapCostReimbursement.setZepFtypename("客户退款申请流程");
return forward("refundApply",sapCostReimbursement);
}
return null;
......@@ -94,8 +109,21 @@ public class SapCostReimbursementController extends CommonController {
String id = sdo.getBizId();
String isDetailPage = sdo.getString("isDetailPage");
if("true".equals(isDetailPage))this.putAttribute("isReadOnly","true");
SapCostReimbursement costReimbursement = costReimbursementApplication.loadSapCostReimbursementById(id);
return forward("costReimbursement",costReimbursement);
SapCostReimbursement sapCostReimbursement = costReimbursementApplication.loadSapCostReimbursementById(id);
String zepFtype = sapCostReimbursement.getZepFtype();
switch (zepFtype) {
case "A":
return forward("costReimbursement",sapCostReimbursement);
case "B":
return forward("employeeLoan",sapCostReimbursement);
case "D":
return forward("advancePayment",sapCostReimbursement);
case "C":
return forward("payApply",sapCostReimbursement);
case "E":
return forward("refundApply",sapCostReimbursement);
}
return null;
}
public String deleteStatsIndicators(){
......
......@@ -151,6 +151,24 @@ public class SapCostReimbursementDetail implements Serializable {
@Column(name = "KTEXT1")
private String ktext1;
/**
* 采购订单号
*/
@Column(name = "EBELN")
private String ebeln;
/**
* 采购订单行
*/
@Column(name = "EBELP")
private Integer ebelp;
/**
* 采购订单行信息
*/
@Column(name = "ZEKPO_ITEM")
private String zekpoItem;
/**
* 内部订单
*/
......
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