接口联调

This commit is contained in:
cwchen 2025-05-16 10:37:51 +08:00
parent c9c946ae78
commit 3dc972b3f8
3 changed files with 15 additions and 17 deletions

View File

@ -159,7 +159,7 @@ function moreData() {
} }
}); */ }); */
/* window.addEventListener('beforeunload', async function (event) { window.addEventListener('beforeunload', async function (event) {
// 阻止默认行为以延迟页面卸载 // 阻止默认行为以延迟页面卸载
event.preventDefault(); event.preventDefault();
try { try {
@ -183,4 +183,4 @@ async function saveImportantData() {
destroyPlugin(); destroyPlugin();
resolve(); resolve();
}); });
} */ }

View File

@ -1,5 +1,5 @@
let form, laydate, table, layer; let form, laydate, table, layer, tableIns;
let pageNum = 1, pageSize = 30; // 定义分页 let pageNum = 1; // 定义分页
layui.use(["form", 'laydate', 'table', 'layer'], function () { layui.use(["form", 'laydate', 'table', 'layer'], function () {
form = layui.form; form = layui.form;
laydate = layui.laydate; laydate = layui.laydate;
@ -38,8 +38,8 @@ function reloadTable(pageNum) {
} }
function initTable(bidCode) { function initTable(bidCode) {
const url = commonUrl + "screen/largeScreen/dataAnalysis/getListByType"; const url = commonUrl + "screen/largeScreen/workReport/getWorkLists";
table.render({ tableIns = table.render({
elem: '#demo2', elem: '#demo2',
id: 'currentTableId', id: 'currentTableId',
url: url, url: url,
@ -52,25 +52,27 @@ function initTable(bidCode) {
}, },
where: { where: {
bidCode: bidCode, bidCode: bidCode,
startDate: $('#startDate').val(), startTime: $('#startDate').val(),
endDate: $('#endDate').val(), endTime: $('#endDate').val(),
}, },
cols: [[ cols: [[
{ type: 'numbers', title: '序号', width: '10%' }, // 添加序号列 { type: 'numbers', title: '序号', width: '10%' }, // 添加序号列
{ field: 'date', title: '日期', align: 'center', width: '20%' }, { field: 'workDate', title: '日期', align: 'center', width: '20%' },
{ field: 'warnContent', title: '计划工作内容', align: 'center', width: '30%' }, { field: 'completionStatus', title: '计划工作内容', align: 'center', width: '30%' },
{ field: 'photo', title: '工作内容完成情况', align: 'center', width: '30%' }, { field: 'photo', title: '工作内容完成情况', align: 'center', width: '30%' },
{ {
field: 'status', title: '操作', align: 'center', width: '10%', field: 'status', title: '操作', align: 'center', width: '10%',
templet: function (d) { templet: function (d) {
let html = ""; let html = "";
if (d.fillStatus === '0') {
html += "<a onclick='fillWorkSituation(" + JSON.stringify(d) + ")'>填报工作情况</a>"; html += "<a onclick='fillWorkSituation(" + JSON.stringify(d) + ")'>填报工作情况</a>";
}
return html; return html;
}, },
} }
]], ]],
done: function (res, curr, count, origin) { done: function (res, curr, count, origin) {
// console.log(res); console.log(res);
pageNum = tableIns.config.page.curr; pageNum = tableIns.config.page.curr;
table.resize("currentTableId"); table.resize("currentTableId");
} }

View File

@ -44,13 +44,9 @@
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<button class="layui-btn" onclick="queryTable(1)"><i class="layui-icon"></i> <button class="layui-btn" onclick="reloadTable(1)"><i class="layui-icon"></i>
搜 索</button> 搜 索</button>
</div> </div>
<div class="layui-inline">
<button class="layui-btn" onclick="fillWorkSituation({})"><i class="layui-icon"></i>
搜 索2</button>
</div>
</div> </div>
</form> </form>
</div> </div>