v1.1 后台-充值账单相关-bugfix查询按钮触发表单提交

This commit is contained in:
2022-10-25 11:20:27 +08:00
parent 91176c177b
commit 0137700f63
3 changed files with 26 additions and 47 deletions

View File

@@ -3,25 +3,15 @@ package com.accompany.admin.controller.user;
import com.accompany.admin.base.Pagination;
import com.accompany.admin.controller.BaseController;
import com.accompany.admin.service.user.BillRecordAdminService;
import com.accompany.admin.vo.BillRecordVo;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.result.BusiResult;
import com.accompany.core.model.Users;
import com.accompany.core.service.user.UsersBaseService;
import com.accompany.core.util.ExcelUtils;
import com.accompany.sharding.model.BillRecord;
import com.accompany.sharding.vo.BillRecordGroupVo;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
@@ -34,7 +24,6 @@ import java.util.*;
*/
@Controller
@RequestMapping("/admin/billRecordCheck")
@ResponseBody
public class BillRecordAdminController extends BaseController {
@Autowired
private BillRecordAdminService billRecordAdminService;
@@ -70,10 +59,8 @@ public class BillRecordAdminController extends BaseController {
* @param endDate
*/
@RequestMapping("listGroup")
public void listGroup(@RequestParam("erbanNo") Long erbanNo,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startDate,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endDate,
@RequestParam(value = "billType",required = false) Byte billType) {
@ResponseBody
public void listGroup(Long erbanNo, Date startDate, Date endDate, Byte billType) {
List<BillRecordGroupVo> voList = billRecordAdminService.listByGroupType(erbanNo, startDate, endDate,billType);
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", voList.size());

View File

@@ -29,9 +29,11 @@
<label for="endDate">结束时间:</label>
<input type="text" class="form-control" name="endDate" id="endDate">
</div>
<button id="btnSearch" class="btn btn-default">查询</button>
<button id="btnExport" class="btn btn-default">导出</button>
</form>
<div class="btn-group">
<button id="btnSearch" type="button" class="btn btn-default">查询</button>
<button id="btnExport" type="button" class="btn btn-default">导出</button>
</div>
</div>
<div id="table"></div>
</section>
@@ -44,12 +46,12 @@
const now = new Date()
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
format: "yyyy-mm-dd hh:ii:ss",
autoclose: true
})
picker1.datetimepicker("setDate", new Date(new Date(now.toLocaleDateString()).getTime()))
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
format: "yyyy-mm-dd hh:ii:ss",
autoclose:true
})
picker2.datetimepicker("setDate", now)
@@ -62,9 +64,6 @@
picker1.datetimepicker('setEndDate',date);
});
let tableLoaded = false;
let currParams = {};
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
@@ -103,7 +102,7 @@
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
return {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
@@ -111,27 +110,24 @@
startDate: $('#startDate').val(),
endDate: $('#endDate').val()
};
currParams = param;
return param;
},
uniqueId: 'code',
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/billRecordCheck/getList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
tableLoaded = true;
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
tableLoaded = false;
}
})
$('#btnSearch').on('click',function () {
// if(!$('#erbanNo').val() || !$('#startDate').val() || !$('#endDate').val()){
// $("#tipMsg").text("请输入必填的信息");
// $("#tipModal").modal('show');
// return;
// }
if(!$('#erbanNo').val() || !$('#startDate').val() || !$('#endDate').val()){
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
if ($('#startDate').val() && $('#endDate').val()) {
var dateStart = new Date($('#startDate').val().replace(/\-/g, "/"));
var dateEnd = new Date($('#endDate').val().replace(/\-/g, "/"));
@@ -143,11 +139,7 @@
return;
}
}
if (tableLoaded || currParams.pageNumber > 1) {
TableHelper.doRefreshAndToPage1('#table');
} else {
TableHelper.doRefresh('#table');
}
TableHelper.doRefresh('#table');
})
// 导出excel
@@ -183,7 +175,6 @@
async : false,
datatype : 'json',
success : function(res) {
console.log(res);
if(res){
var data = res.data;
var options =[];

View File

@@ -28,9 +28,11 @@
<label for="endDate">结束时间:</label>
<input type="text" class="form-control" name="endDate" id="endDate">
</div>
<button id="btnSearch" class="btn btn-default">查询</button>
<button id="btnExport" class="btn btn-default">导出</button>
</form>
<div class="btn-group">
<button id="btnSearch" type="button" class="btn btn-default">查询</button>
<button id="btnExport" type="button" class="btn btn-default">导出</button>
</div>
</div>
<div id="table"></div>
</section>
@@ -55,15 +57,14 @@
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
return {
erbanNo: $('#erbanNo').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
billType:$('#billType').val()
billType: $('#billType').val()
};
return param;
},
uniqueId: 'code',
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/billRecordCheck/listGroup.action',
onLoadSuccess: function () { //加载成功时执行
@@ -91,11 +92,11 @@
TableHelper.doRefresh('#table');
})
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
format: 'yyyy-mm-dd hh:ii:ss',
autoclose:true
})
picker1.on('changeDate', function () {