You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/Dispatch/Views/Dispatch/FeeList.aspx

128 lines
4.5 KiB
Plaintext

<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Dispatch/Views/Shared/MP.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Body" runat="server">
<%
%>
<header class='demos-header'>
<h2 class="demos-title">费用账单</h2>
</header>
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__hd">
<label class="weui-label">开始月份</label>
</div>
<div class="weui-cell__bd">
<input class="weui-input" id="dateStart" type="text" value="<%=DateTime.Today.ToString("yyyy年MM月") %>" data-values="<%=DateTime.Today.ToString("yyyyMM") %>">
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label class="weui-label">结束月份</label>
</div>
<div class="weui-cell__bd">
<input class="weui-input" id="dateEnd" type="text" value="<%=DateTime.Today.ToString("yyyy年MM月") %>" data-values="<%=DateTime.Today.ToString("yyyyMM") %>">
</div>
</div>
</div>
<div class="weui-btn-area">
<a class="weui-btn weui-btn_primary" href="javascript:" id="btnLoadData">查询</a>
</div>
<div class="weui-panel">
<div class="weui-panel__bd" id="listContainer">
</div>
</div>
<div class='demos-content-padded'>
<div class="weui-loadmore" id="loadingTip">
<i class="weui-loading"></i>
<span class="weui-loadmore__tips">正在加载</span>
</div>
<div class="weui-loadmore weui-loadmore_line" id="noMoreTip">
<span class="weui-loadmore__tips">没有更多数据</span>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FooterScript" runat="server">
<script>
var months =<%=ViewData["MonthList"]%>;
var openid = '<%=ViewData["openid"].ToString()%>';
var loading = false;
$(function () {
$("#dateStart").select({
title: "起始月份",
items: months
});
$("#dateEnd").select({
title: "结束月份",
items: months
});
$("#btnLoadData").on('click', function () {
if ($("#dateStart").data("values") > $("#dateEnd").data("values")) {
$.alert("开始月份不能大于结束月份");
return;
}
loadData();
});
$("#loadingTip").hide();
$("#noMoreTip").hide();
})
function loadData() {
if (loading)
return;
loading = true;
$("#loadingTip").show();
$("#noMoreTip").hide();
$("#listContainer").empty();
$.ajax({
type: "POST",
url: "/Dispatch/Dispatch/FeeListData?openid=" + openid + "&monthStart=" + $("#dateStart").data("values") + "&monthEnd=" + $("#dateEnd").data("values"),
dataType: "json",
success: function (data) {
loading = false;
showList(data);
$("#loadingTip").hide();
$("#noMoreTip").show();
}
});
}
function showList(list) {
for (var idx = 0; idx < list.length; idx++) {
var html = '<div class="weui-form-preview" onclick="goDispatchList(\'' + list[idx].Month + '\')">'
+ '<div class="weui-form-preview__bd">'
+ ' <div class="weui-form-preview__item">'
+ ' <label class="weui-form-preview__label">月份</label>'
+ ' <span class="weui-form-preview__value">' + list[idx].MonthStr + '</span>'
+ ' </div>'
+ ' <div class="weui-form-preview__item">'
+ ' <label class="weui-form-preview__label">费用合计</label>'
+ ' <span class="weui-form-preview__value">' + list[idx].Sum + '</span>'
+ ' </div>'
+ '</div>'
$("#listContainer").append(html);
}
}
function goDispatchList(month) {
location.href = "/Dispatch/Dispatch/DispatchListMonth?openid=" + openid + "&month=" + month;
}
</script>
</asp:Content>