var data_statistics_service = '/api/be-oces-finance-service/v1';//数据统计服务
var get_lcenter_list_url = '/common/v1/organize/learncenters/province';
var get_export='/refund/settlementBill/export'
var indexUri = Cookies.get('localUri');
var get_credit_url = '/refund/leaveSchoolApply';//获取列表
var delete_credit_url = '/credit/delete';//删除
var dataList = [];//临时iframe交互数据
var management = {
init : function(){
var that = this;
that.panelResize();
that.showDatagridView();//加载表格数据
that.changeBodyHeight();
},
changeBodyHeight :function(){
var windowHeight = $(window).height();
$('body').css({'min-height':windowHeight});
},
panelExpand : function(){
var that = this;
var status = $('.search-expand-btn').data('expand');
if (status == 1) {
$('#toolbar').parents('.easyui-panel').panel('collapse');
$('.search-expand-btn').data('expand','0').find('span').text('展开');
$('.search-expand-btn').find('i').removeClass('fa-long-arrow-up').addClass('fa-long-arrow-down');
}else if(status == 0){
$('#toolbar').parents('.easyui-panel').panel('expand');
$('.search-expand-btn').data('expand','1').find('span').text('收起');;
$('.search-expand-btn').find('i').removeClass('fa-long-arrow-down').addClass('fa-long-arrow-up');
}
common.virtualScrollShow('table');//虚拟滚动条展示
},
panelResize : function(){
$(window).resize(function () {
var bodyHeight = $('body').height();
var windowHeight = $(window).height();
var warpWidth = $('.datagrid-view2').width();
var innerWidth = $('.datagrid-view2').find('.datagrid-btable').width();
if (bodyHeight < windowHeight || innerWidth < warpWidth) {
$('.virtual-scroll').hide();
}else{
common.virtualScrollShow('table');//虚拟滚动条展示
}
$('body').css({'min-height':windowHeight});
});
},
initializeData : function(){
$('#lcenterCode').combobox('loadData', [{lcenterName:'全部',lcenterCode: ''}]);
},
changeProvince : function(newValue, oldValue){
if (newValue == '') {
$('#lcenterCode').combobox('clear');
$('#lcenterCode').combobox('loadData', [{lcenterName:'全部',lcenterCode: ''}]);
$('#lcenterCode').combobox('setValue','');
}
},
getData: function(param, success, error){
var opts = $(this).datagrid('options');
if (!opts.url) return false;
var ajax = {
type: opts.method,
url: opts.url,
data: param,
dataType: 'json',
success: function(data){
success(data);
},
error: function(){
error.apply(this, arguments);
}
};
agent(ajax);
},
loadSuccess : function(data){
management.updateChangeStyle();
var pager = $('#table').datagrid('getPager');
if(data.total == 0){
$(pager).pagination({
displayMsg: '共 0 条记录'
});
$('.virtual-scroll').hide();
}else{
$(pager).pagination({
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
common.virtualScrollShow('table');//虚拟滚动条展示
$('.easyui-menubutton').menubutton({
plain:false,
});
}
System.init();
},
loadError : function(){
management.updateChangeStyle();
var pager = $('#table').datagrid('getPager');
$(pager).pagination({
displayMsg: '共 0 条记录'
});
$.messager.alert('提示','<div style="padding:20px 10px;text-align: center;">获取数据失败</div>');
},
loadDataFilter : function(data){
var tempList = {};
if(data.data.content){
tempList = {
total:data.data.totalRecords,
rows:data.data.content
};
dataList = data.data.content;
}else{
tempList = {
total:0,
rows:[]
};
}
return tempList;
},
operationFormatter : function(value,rowData,rowIndex){
var infoButton=""
var printButton='<a target="_Blank" style="margin-left: 10px;" href="'+Cookies.get('localUri')+'/admin/base/basic/univededuct/quit-study-paymentform/print.html?studentCode='+rowData.studentCode+'&changeId='+rowData.changeId+'" class="easyui-linkbutton button-blue-model button-xs l-btn l-btn-small" title="打印" close="true" id="additional-print'+rowData.balanceRefundmentCollectId+'"><span class="l-btn-left"><span class="l-btn-text">打印</span></span></a>';
if(rowData.auditStatus=="0"){
infoButton='<a href="javaScript:void(0)" class="easyui-linkbutton button-blue-model button-xs l-btn l-btn-small" title="退费审批" id="additional-style'+rowData.id+'" onclick="management.update(\''+rowData.studentCode+'\',\''+rowData.applyDate+'\',\''+rowData.loginName+'\',\''+rowData.statusType+'\',\''+rowData.batchCode+'\',\''+rowData.status+'\',\''+rowData.realName+'\',\''+rowData.changeId+'\',\''+rowData.applyId+'\',\''+rowData.studentSourceName+'\',\''+rowData.discountAmount+'\')"><span class="l-btn-left"><span class="l-btn-text">退费审批</span></span></a>';
}else if(rowData.auditStatus=="1"){
infoButton='<a href="javaScript:void(0)" class="easyui-linkbutton button-blue-model button-xs l-btn l-btn-small" title="退费审批" style="background: #ccc!important;cursor: not-allowed;">退费审批</span></span></a>';
}
return infoButton+printButton
},
update : function(studentCode,applyDate,loginName,statusType,batchCode,status,realName,changeId,applyId,studentSourceName,discountAmount){//班级学生管理
var that = this;
$.iframe.win({
title: '退学退费审批',
url:'./detail.html?id='+studentCode+'&applyDate='+encodeURI(encodeURI(applyDate))+'&loginName='+encodeURI(encodeURI(loginName))+'&statusType='+encodeURI(encodeURI(statusType))+'&batchCode='+encodeURI(encodeURI(batchCode))+'&status='+encodeURI(encodeURI(statusType))+'&realName='+encodeURI(encodeURI(realName))+'&changeId='+encodeURI(encodeURI(changeId))+'&applyId='+applyId+"&studentSourceName="+encodeURI(encodeURI(studentSourceName))+'&discountAmount='+discountAmount,
maximizable: false,
width: 830,
height:550,
modal: true
});
var evt = window.event || arguments.callee.caller.arguments[0]; // 获取event对象兼容ff
evt.stopPropagation();//防止触发onClickRow事件
return false;
},
enterPress : function (e) { //传入 event
var that = this;
if (e.keyCode == 13) {
that.searchData();
}
},
searchData : function() {
// var lcenterName=$("#lcenterCode").combobox("getText");
var lcenterCode=$("#lcenterCode").combobox("getValue");
var statusChangeType=$("#statusChangeType").combobox("getValue");
var auditStatus=$("#auditStatus").combobox("getValue");
var realName=$("#realName").val();
var studentCode=$("#studentCode").val();
var universityStuNo=$("#universityStuNo").val();
var applyStartDate = $('#applyStartDate').val()||"";
var applyEndDate = $('#applyEndDate').val()||"";
$('#table').datagrid('load',{
lcenterName:"",
lcenterCode:lcenterCode,
statusChangeType:statusChangeType,
auditStatus:auditStatus,
realName:realName,
studentCode:studentCode,
universityStuNo:universityStuNo,
applyStartDate:applyStartDate,
applyEndDate:applyEndDate
})
},
resetSearch : function(){
$("#lcenterCode").combobox("setValue","");
$("#statusChangeType").combobox("setValue","");
$("#auditStatus").combobox("setValue","0");
$("#realName").textbox("setValue","");
$("#studentCode").textbox("setValue","");
$("#universityStuNo").textbox("setValue","");
$('#applyStartDate').datebox("setValue","");
$('#applyEndDate').datebox("setValue","");
management.searchData();
},
resizeVirtualScroll : function (){
var innerWidth = $('.datagrid-view2').find('.datagrid-btable').width();
$('.virtual-scroll').find('div').width(innerWidth + 20);
},
changeStyle : function(){
var tempData = $('#table').datagrid('getSelections');
if (tempData.length > 0) {
$('#deleteCredit').removeClass('l-btn-disabled').addClass('button-red');
$('#deleteCredit').linkbutton('enable');
}else{
$('#deleteCredit').removeClass('button-red').addClass('l-btn-disabled');
$('#deleteCredit').linkbutton('disable');
}
},
updateChangeStyle : function(){
$('#deleteCredit').removeClass('button-red').addClass('l-btn-disabled');
$('#deleteCredit').linkbutton('disable');
},
showDatagridView : function(){
var that = this;
var parameter = {
lcenterName:'',
lcenterCode:'',
statusChangeType:'',
auditStatus:'0',
realName:'',
studentCode:'',
universityStuNo:'',
applyStartDate:'',
applyEndDate:''
};
$('#table').datagrid({
width:'100%',
singleSelect:false,
collapsible:true,
pagination:true,
fitColumns:true,
selectOnCheck:true,
rownumbers: true,
striped:true,
scrollbarSize:0,
pageSize:10,
nowrap:true,
view:emptyView,
emptyMsg:"暂无相关数据",
loader:that.getData,
url:data_statistics_service + get_credit_url,
method:'get',
queryParams:parameter,
onLoadSuccess:that.loadSuccess,
onLoadError:that.loadError,
loadFilter:that.loadDataFilter,
onResizeColumn:that.resizeVirtualScroll,
onSelect: that.changeStyle,
onUnselect: that.changeStyle,
onCheckAll: that.changeStyle,
onUncheckAll: that.changeStyle,
onBeforeLoad:that.onBeforeLoad,
toolbar:'#tools',
columns:[[
{field:'ck',checkbox:true},
{field:'studentCode',width:'',title:'报名编号',align:'center'},
{field:'batchCode',width:'',title:'入学批次',align:'center'},
{field:'loginName',width:'',title:'用户名',align:'center'},
{field:'realName',width:'',title:'姓名',align:'center'},
{field:'lcenterName',width:'',title:'学习中心',align:'center'},
{field:'statusType',width:'',title:'异动类型',align:'center'},
{field:'applyDate',width:'',title:'申请时间',align:'center'},
{field:'feeBalance',width:'',title:'费用余额',align:'center'},
{field:'auditStatus',width:'',title:'审批状态',align:'center',formatter:that.auditStatusFormatter},
{field:' ', width:'200px',title:'操作',align:'center',formatter:that.operationFormatter}
]]
});
},
//修改默认分页参数
onBeforeLoad:function (params) {
params["pageSize"] = params.rows;
params["currentPage"] = params.page;
delete params.rows;
delete params.page;
},
auditStatusFormatter:function(value,rowData,rowIndex){
var msg=""
if(rowData.auditStatus=="0"){
msg="退费待审批"
}else if(rowData.auditStatus=="1"){
msg="退费审批通过"
}
else if(rowData.auditStatus=="2"){
msg="退费审批不通过"
}
return msg;
},
deleteItem : function(ids,type){
var ids = ids;
var tempData = $('#table').datagrid('getSelections');
var ids = [];
for(var i in tempData){
ids.push(tempData[i].id);
}
var parameter = ids;
var ajax = {
type:'DELETE',
url:data_statistics_service + delete_credit_url,
dataType:'text',
data:JSON.stringify(parameter),
contentType:'application/json;charset=UTF-8',
error:function(XMLHttpRequest,valStatus,errorThrown) { //失败
$.messager.alert('提示',$.parseJSON(XMLHttpRequest.responseText).message, 'info');
},
success:function(data,valStatus) {
if (data.length == 0) {
management.reloadData();
$.messager.alert('提示','操作成功', 'info');
} else{
management.reloadData();
$.messager.alert('提示',$.parseJSON(data).message, 'info');
}
}
};
$.messager.confirm('删除', '确认删除这些记录信息' , function(r){
if (r){
agent(ajax);
}
});
var evt = window.event || arguments.callee.caller.arguments[0]; // 获取event对象兼容ff
evt.stopPropagation();//防止触发onClickRow事件
return false;
},
getQueryString : function(name){
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
},
showComoboxPanel:function(){
},
exportCart:function () {
var studyType = $('#studyType').combobox('getValue')||"";
var universityCode = $('#universityCode').combobox('getValue')||"";
var recruitBatchCode = $('#recruitBatchCode').combobox('getValue')||"";
var province = $('#province').combobox('getValue')||"";
var refundType = $('#refundType').combobox('getValue')||"";
var arrivalStatus = $('#arrivalStatus').combobox('getValue')||"";
var makePay = $('#makePay').combobox('getValue')||"";
var applyStartDate = $('#applyStartDate').val()||"";
var applyEndDate = $('#applyEndDate').val()||"";
var stuName = $('#stuName').val()||"";
var stuCode = $('#stuCode').val()||"";
window.location.href=data_statistics_service+get_export+"?studyType="+studyType
+"&universityCode="+universityCode
+"&recruitBatchId="+recruitBatchCode
+"&province="+province
+"&refundType="+refundType
+"&arrivalStatus="+arrivalStatus
+"&makePay="+makePay
+"&applyStartDate="+applyStartDate
+"&applyEndDate="+applyEndDate
+"&stuName="+stuName
+"&stuCode="+stuCode
},
//确认通过
getPaymentforms:function () {
var payBillName=$("#payBillName").val();
var payBillRemark=$("#payBillRemark").val();
if(payBillName==""){
$.messager.alert('提示',"支付单名称不能为空", 'info');
return false;
}
var tempData = $('#table').datagrid('getSelections');
var ids = [];
for(var i in tempData){
ids.push(tempData[i]+",");
}
var parameter = {
collectIds:ids
};
var ajax = {
type:'POST',
url:data_statistics_service + get_createPayBill,
dataType:'json',
data:JSON.stringify(parameter),
contentType:'application/x-www-form-urlencoded',
error:function(XMLHttpRequest,valStatus,errorThrown) { //失败
$.messager.alert('提示',$.parseJSON(XMLHttpRequest.responseText).message, 'info');
},
success:function(data,valStatus) {
if (data.length == 0) {
management.reloadData();
$.messager.alert('提示','操作成功', 'info');
} else{
management.reloadData();
$.messager.alert('提示',$.parseJSON(data).message, 'info');
}
}
};
$.messager.confirm('删除', '确认要确认通过吗?' , function(r){
if (r){
agent(ajax);
}
});
var evt = window.event || arguments.callee.caller.arguments[0]; // 获取event对象兼容ff
evt.stopPropagation();//防止触发onClickRow事件
return false;
},
//取消通过
getCancel:function () {
var payBillName=$("#payBillName").val();
var payBillRemark=$("#payBillRemark").val();
if(payBillName==""){
$.messager.alert('提示',"支付单名称不能为空", 'info');
return false;
}
var tempData = $('#table').datagrid('getSelections');
var ids = [];
for(var i in tempData){
ids.push(tempData[i]+",");
}
var parameter = {
collectIds:ids
};
var ajax = {
type:'POST',
url:data_statistics_service + get_createPayBill,
dataType:'json',
data:JSON.stringify(parameter),
contentType:'application/x-www-form-urlencoded',
error:function(XMLHttpRequest,valStatus,errorThrown) { //失败
$.messager.alert('提示',$.parseJSON(XMLHttpRequest.responseText).message, 'info');
},
success:function(data,valStatus) {
if (data.length == 0) {
management.reloadData();
$.messager.alert('提示','操作成功', 'info');
} else{
management.reloadData();
$.messager.alert('提示',$.parseJSON(data).message, 'info');
}
}
};
$.messager.confirm('删除', '确认要确认通过吗?' , function(r){
if (r){
agent(ajax);
}
});
var evt = window.event || arguments.callee.caller.arguments[0]; // 获取event对象兼容ff
evt.stopPropagation();//防止触发onClickRow事件
return false;
},
//获取学习中心列表
getLcenter: function(){
var ajax = {
type:'GET',
url:commondata_service_url + get_lcenter_list_url,
dataType:'json',
data:{
provinceCode:''
},
error:function(XMLHttpRequest,textStatus,errorThrown) { //失败
$.messager.alert('提示',$.parseJSON(XMLHttpRequest.responseText).message, 'info');
},
success:function(data,valStatus) {
if (data.code != undefined) {
$.messager.alert('提示',data.message, 'info');
}else{
var allOption = {
lcenterCode:'',
lcenterName: '全部'
};
var list = data;
list.unshift(allOption);
$('#lcenterCode').combobox('loadData',list);
$('#lcenterCode').combobox('setValue','');
}
}
};
agent(ajax);
},
}
management.init();
//页面点击事件
$(function(){
management.getLcenter();
management.initializeData();
management.showComoboxPanel();
});
}
jqeuryEasyUI快速构建正常改查页面
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- **目标场景**分类管理 技术点读取分类列表 点击某分类进入编辑页,操作编辑与删除 点击列表页底部按钮,跳转添加,...