提交 fcaf1605 编写于 作者: Skyeye云's avatar Skyeye云

新增财务单据类型选择功能

上级 b6daf5c7
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'form', 'fsCommon', 'fsTree'], function (exports) {
var index = parent.layer.getFrameIndex(window.name);
winui.renderColor();
var $ = layui.$,
form = layui.form,
fsTree = layui.fsTree,
fsCommon = layui.fsCommon;
var firstTypeCode = GetUrlParam("firstTypeCode");
/********* tree 处理 start *************/
var orderType = "";
var ztree = null;
fsTree.render({
id: "treeDemo",
url: "dsFormObjectRelation007?userToken=" + getCookie('userToken') + "&loginPCIp=" + returnCitySN["cip"] + "&firstTypeCode=" + firstTypeCode + "&language=" + languageType,
clickCallback: onClickTree,
onDblClick: onClickTree
}, function(id){
ztree = $.fn.zTree.getZTreeObj(id);
});
var chooseNode = null;
// 异步加载的方法
function onClickTree(event, treeId, treeNode) {
if(treeNode == undefined) {
orderType = "";
} else {
if(treeNode.isParent != 0){
return;
}
chooseNode = treeNode;
}
}
/********* tree 处理 end *************/
matchingLanguage();
form.render();
form.on('submit(formChooseBean)', function(data) {
if(winui.verifyForm(data.elem)) {
if(isNull(chooseNode)){
winui.window.msg("请选择单据类型.", {icon: 2, time: 2000});
return false;
}
parent.dsFormUtil.dsFormObjectRelationChoose = chooseNode;
parent.layer.close(index);
parent.refreshCode = '0';
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
exports('dsFormObjectRelationChooseByFirstTypeCode', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/contextMenu/jquery.contextMenu.min.css" rel="stylesheet" />
</head>
<body>
<div style="margin: 0 auto; padding: 20px;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<div style="width: 100%; float: left;">
<ul id="treeDemo" class="ztree fsTree" method="get" isRoot="1" treeIdKey="id" inputs="parentId" treePIdKey="pId" clickCallbackInputs="parentId:$id" treeName="name"></ul>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formChooseBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript" src="../../assets/lib/layui/lay/modules/jquery-min.js"></script>
<script type="text/javascript" src="../../assets/lib/layui/lay/modules/contextMenu/jquery.contextMenu.min.js"></script>
<script type="text/javascript" src="../../assets/lib/layui/lay/modules/ztree/js/jquery.ztree.all.min.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/dsFormObjectRelation/'}).use('dsFormObjectRelationChooseByFirstTypeCode');
</script>
</body>
</html>
\ No newline at end of file
......@@ -119,6 +119,14 @@ layui.config({
});
});
// 选择单据类型
$("body").on("click", "#chooseOrderTypeBtn", function(e){
var _this = $(this);
dsFormUtil.openDsFormObjectRelationChooseByFirstTypeCodeChoosePage("IFS", function (dsFormObjectRelationChoose){
_this.parent().find("input").val(dsFormObjectRelationChoose.name);
});
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
......
......@@ -30,6 +30,13 @@
<i class="fa fa-plus-circle input-icon" id="chooseSetOfBooksBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">单据类型<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="orderType" name="orderType" win-verify="required" placeholder="请选择单据类型" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="chooseOrderTypeBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">列表项<i class="red">*</i></label>
<div class="layui-input-block">
......
......@@ -350,6 +350,30 @@ var dsFormUtil = {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: false});
}
},
/**
* 业务逻辑与动态表单的关联关系类型,也可叫单据类型
*
* @param firstTypeCode 所属一级分类的code
* @param callback 回调函数
*/
dsFormObjectRelationChoose: {}, // 已经选择的单据类型
openDsFormObjectRelationChooseByFirstTypeCodeChoosePage: function (firstTypeCode, callback){
_openNewWindows({
url: "../../tpl/dsFormObjectRelation/dsFormObjectRelationChooseByFirstTypeCode.html?firstTypeCode=" + firstTypeCode,
title: "单据类型",
pageId: "dsFormObjectRelationChooseByFirstTypeCode",
area: ['480px', '500px'],
callBack: function(refreshCode){
if (refreshCode == '0') {
if(typeof(callback) == "function") {
callback(dsFormUtil.dsFormObjectRelationChoose);
}
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
}
}});
},
};
\ No newline at end of file
......@@ -56,6 +56,26 @@ var voucherUtil = {
voucherUtil.initClickEvent();
},
initData: function (boxId, data){
$("#" + boxId).html(voucherUtil.tableHtmlDom);
for(var i = 0; i < data.length; i++){
voucherUtil.addItem();
var _this = $("#useTable").find("tr")[i];
_this.find(".col_summary").find("textarea").val(); // 摘要
_this.find(".col_voucher").find(".cell_val").attr("dataId"); // 凭证
_this.find(".col_voucher").find(".cell_val").html();
_this.find(".col_subject").find(".cell_val").attr("dataId", ""); // 会计科目
_this.find(".col_subject").find(".cell_val").html();
_this.find(".col_debite").find(".cell_val").html(); // 借方金额
_this.find(".col_credit").find(".cell_val").html(); // 贷方金额
}
voucherUtil.initClickEvent();
},
initClickEvent: function (){
$("body").on("click", "td[data-edit]", function(){
var _this = $(this);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册