修复充值明细页面-分页加载问题

This commit is contained in:
chenruiye
2025-04-25 16:38:37 +08:00
parent bd59f9e22f
commit 66d35f787c

View File

@@ -53,7 +53,7 @@
<input type="text" class="form-control" name="appChannel" id="qAppChannel" />
</div>
<div class="form-group">
<label for="regionId" >国家</label>
<label for="regionId">国家</label>
<select name="regionId" id="regionId" class="form-control"></select>
</div>
</form>
@@ -90,6 +90,7 @@ export default {
format: "yyyy-mm-dd hh:ii:00",
autoclose: true,
});
$('#table').bootstrapTable('destroy');
// 初始化表格,但不设置 `ajax` 方法,也不绑定 `url`,只提供列配置
$("#table").bootstrapTable({
@@ -177,6 +178,67 @@ export default {
sidePagination: "server",
queryParamsType: "undefined",
data: [], // 初始化为空数据
queryParams: function queryParams(params) {
//设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $("#qErbanNo").val(),
channel: $("#qChannel").val(),
startTime: $("#qStartTime").val(),
endTime: $("#qEndTime").val(),
status: $("#qStatus").val(),
newUser: $("#qNewUser").val(),
appChannel: $("#qAppChannel").val(),
regionId: $("#regionId").val(),
};
return param;
},
uniqueId: 'id',
toolbar: "#toolbar",
url: "/admin/chargeRecord/list",
onLoadSuccess: function (res) {
console.log('load success');
$("#table").bootstrapTable("load", {
rows: res.data.rows,
total: res.data.total,
});
$("#mapObjHtml span").remove();
const totalMap = res.data.totalMap;
let str = "";
const sortedKeys = Object.keys(totalMap).sort((keyA, keyB) => {
return keyA === "总充值{USD}"
? -1
: keyB === "总充值{USD}"
? 1
: 0;
});
console.log(sortedKeys, '-------sortedKeys');
// for (const key of sortedKeys) {
// str += `
// <span style="margin-right:10px;display: inline-block;font-size: 18px;color: #2049a9;" type="text">${key}: ${totalMap[key]}, </span>
// `;
// }
// 处理第二项和最后一项
sortedKeys.forEach((key, index) => {
let value = totalMap[key];
if (index === 1) {
key = `包括(${key}`;
}
if (index === sortedKeys.length - 1) {
value = `${value})`;
}
str += `
<span style="margin-right:10px;display: inline-block;font-size: 18px;color: #2049a9;" type="text">${key}: ${value}</span>
`;
});
$("#mapObjHtml").append(str);
},
onLoadError: function (err) {
console.log('load fail');
serverError(err);
}
});
// 查询刷新
@@ -218,14 +280,14 @@ export default {
? 1
: 0;
});
console.log(sortedKeys,'-------sortedKeys');
// for (const key of sortedKeys) {
// str += `
// <span style="margin-right:10px;display: inline-block;font-size: 18px;color: #2049a9;" type="text">${key}: ${totalMap[key]}, </span>
// `;
// }
// 处理第二项和最后一项
sortedKeys.forEach((key, index) => {
console.log(sortedKeys, '-------sortedKeys');
// for (const key of sortedKeys) {
// str += `
// <span style="margin-right:10px;display: inline-block;font-size: 18px;color: #2049a9;" type="text">${key}: ${totalMap[key]}, </span>
// `;
// }
// 处理第二项和最后一项
sortedKeys.forEach((key, index) => {
let value = totalMap[key];
if (index === 1) {
key = `包括(${key}`;
@@ -277,19 +339,19 @@ export default {
},
initRegionInfoList() {
regionInfoList().then(res => {
let data = res.data;
buildSelectOption(
"#regionId",
null,
data.map((v) => {
return {
value: v.id,
text: v.regionDesc,
};
})
);
});
},
let data = res.data;
buildSelectOption(
"#regionId",
null,
data.map((v) => {
return {
value: v.id,
text: v.regionDesc,
};
})
);
});
},
},
};
</script>