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

新增凭证选择

上级 6c094dd2
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
showGrid({
id: "showForm",
url: reqBasePath + "ifsVoucher001",
params: getTableParams(),
pagination: true,
pagesize: 18,
template: $("#beanTemplate").html(),
ajaxSendLoadBefore: function(hdb){
hdb.registerHelper("compare1", function(v1, options){
var fileExt = sysFileUtil.getFileExt(v1);
if($.inArray(fileExt[0], imageType) >= 0){
return fileBasePath + v1;
}
return '../../assets/images/doc.png';
});
hdb.registerHelper("compare2", function(v1, options){
if(v1 == 1){
return '<a class="layui-btn layui-btn-xs choose">选择</a>';
}
return '';
});
hdb.registerHelper("compare3", function(v1, options){
if(v1 == 1){
return "<span class='state-down'>未整理</span>";
}
return "<span class='state-up'>已整理</span>";
});
},
options: {'click .sel': function(index, row){
var fileExt = sysFileUtil.getFileExt(row.voucherPath);
if($.inArray(fileExt[0], imageType) >= 0){
systemCommonUtil.showPicImg(fileBasePath + row.voucherPath);
}else{
sysFileUtil.download(row.voucherPath, row.fileName);
}
},
'click .choose': function(i, row){
parent.sysIfsUtil.chooseVoucherMation = row;
parent.refreshCode = '0';
parent.layer.close(index);
}
},
ajaxSendAfter:function(json){
matchingLanguage();
}
});
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
refreshGrid("showForm", {params: getTableParams()});
}
return false;
});
// 刷新数据
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
refreshGrid("showForm", {params: getTableParams()});
}
function getTableParams(){
return {
state: $("#state").val(),
};
}
exports('ifsVoucherListChoose', {});
});
var userReturnList = new Array();//选择用户返回的集合或者进行回显的集合
var chooseOrNotMy = "1";//人员列表中是否包含自己--1.包含;其他参数不包含
var chooseOrNotEmail = "2";//人员列表中是否必须绑定邮箱--1.必须;其他参数没必要
var checkType = "2";//人员选择类型,1.多选;其他。单选
layui.config({ layui.config({
base: basePath, base: basePath,
version: skyeyeVersion version: skyeyeVersion
...@@ -141,7 +136,10 @@ layui.config({ ...@@ -141,7 +136,10 @@ layui.config({
// 人员选择 // 人员选择
$("body").on("click", "#toHandsPersonSelPeople", function(e){ $("body").on("click", "#toHandsPersonSelPeople", function(e){
userReturnList = [].concat(handsPersonList); systemCommonUtil.userReturnList = [].concat(handsPersonList);
systemCommonUtil.chooseOrNotMy = "2"; // 人员列表中是否包含自己--1.包含;其他参数不包含
systemCommonUtil.chooseOrNotEmail = "2"; // 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要
systemCommonUtil.checkType = "2"; // 人员选择类型,1.多选;其他。单选
systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList){ systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList){
// 移除所有tag // 移除所有tag
var tags = $('#handsPersonId').tagEditor('getTags')[0].tags; var tags = $('#handsPersonId').tagEditor('getTags')[0].tags;
...@@ -213,6 +211,15 @@ layui.config({ ...@@ -213,6 +211,15 @@ layui.config({
}); });
}); });
// 选择凭证
$("body").on("click", ".chooseVoucherBtn", function(e){
var _this = $(this);
sysIfsUtil.openIfsVoucherChoosePage(function (chooseVoucherMation){
_this.parent().find("input").attr("voucher", JSON.stringify(chooseVoucherMation));
_this.parent().find("input").val(chooseVoucherMation.fileName);
});
});
$("body").on("click", "#cancle", function() { $("body").on("click", "#cancle", function() {
parent.layer.close(index); parent.layer.close(index);
}); });
......
<!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" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">状态</label>
<div class="layui-input-inline">
<select id="state" name="state" lay-filter="state" lay-search="">
<option value="1">未整理</option>
<option value="2">已整理</option>
</select>
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<div class="layui-col-xs12" id="showForm">
</div>
</div>
<script type="text/x-handlebars-template" id="beanTemplate">
{{#each rows}}
<div class="layui-col-xs2 pic-item" title="文件名: {{fileName}}&#10;上传日期: {{createTime}}">
<div class="layui-col-xs12 pic-item-div-top">
<img class="win-bg-pic sel" src="{{#compare1 voucherPath}}{{/compare1}}" />
</div>
<div class="layui-col-xs12 pic-item-div">
<div style="text-align: left">
状态{{#compare3 state}}{{/compare3}}
</div>
</div>
<div class="layui-col-xs12 pic-item-div">
<div>
{{#compare2 state}}{{/compare2}}
</div>
</div>
</div>
{{/each}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/ifsVoucher/'}).use('ifsVoucherListChoose');
</script>
</body>
</html>
\ No newline at end of file
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<td><input type="text" class="layui-input rkMoney" id="{{initemMoney}}" win-verify="required|money"/></td> <td><input type="text" class="layui-input rkMoney" id="{{initemMoney}}" win-verify="required|money"/></td>
<td> <td>
<input type="text" id="{{voucherId}}" name="{{voucherId}}" placeholder="请选择凭证" class="layui-input" readonly="readonly"/> <input type="text" id="{{voucherId}}" name="{{voucherId}}" placeholder="请选择凭证" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i> <i class="fa fa-plus-circle input-icon chooseVoucherBtn" style="top: 12px;"></i>
</td> </td>
<td> <td>
<input type="text" id="{{accountSubjectId}}" name="{{accountSubjectId}}" placeholder="请选择会计科目" class="layui-input" readonly="readonly"/> <input type="text" id="{{accountSubjectId}}" name="{{accountSubjectId}}" placeholder="请选择会计科目" class="layui-input" readonly="readonly"/>
......
...@@ -7,6 +7,11 @@ var sysIfsUtil = { ...@@ -7,6 +7,11 @@ var sysIfsUtil = {
*/ */
chooseAccountSubjectMation: {}, chooseAccountSubjectMation: {},
/**
* 已经选择的凭证信息
*/
chooseVoucherMation: {},
/** /**
* 会计科目选择页面 * 会计科目选择页面
* *
...@@ -29,4 +34,26 @@ var sysIfsUtil = { ...@@ -29,4 +34,26 @@ var sysIfsUtil = {
}}); }});
}, },
/**
* 凭证选择页面
*
* @param callback 回调函数
*/
openIfsVoucherChoosePage: function (callback){
_openNewWindows({
url: "../../tpl/ifsVoucher/ifsVoucherListChoose.html",
title: "凭证选择",
pageId: "ifsVoucherListChoose",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
if(typeof(callback) == "function") {
callback(sysIfsUtil.chooseVoucherMation);
}
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
}
}});
},
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册