From e8b92f6a3a02f039751a3f532fabeb654f7d4554 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Thu, 15 May 2025 11:25:03 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A9=BE=E9=A9=B6=E5=91=98=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E9=A1=B5=E9=9D=A2=202=E3=80=81=E6=B4=BE?= =?UTF-8?q?=E8=BD=A6=E5=BD=95=E5=85=A5=E9=A9=BE=E9=A9=B6=E5=91=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=99=BD=E5=90=8D=E5=8D=95=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/init.json | 6 + js/car_basic/driver_white_list.js | 228 ++++++++++++++++++ .../child/choose_car_or_user_list.js | 21 +- page/car_basic/driver_white_list.html | 61 +++++ .../child/choose_car_or_user_list.html | 9 + 5 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 js/car_basic/driver_white_list.js create mode 100644 page/car_basic/driver_white_list.html diff --git a/api/init.json b/api/init.json index bc348d8..47d71f8 100644 --- a/api/init.json +++ b/api/init.json @@ -50,6 +50,12 @@ "href": "page/car_basic/driver_list.html", "icon": "fa fa-asterisk", "target": "_self" + }, + { + "title": "驾驶员白名单", + "href": "page/car_basic/driver_white_list.html", + "icon": "fa fa-asterisk", + "target": "_self" } ] }, diff --git a/js/car_basic/driver_white_list.js b/js/car_basic/driver_white_list.js new file mode 100644 index 0000000..da6334d --- /dev/null +++ b/js/car_basic/driver_white_list.js @@ -0,0 +1,228 @@ +let form, table, laydate; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table"], function () { + form = layui.form; + table = layui.table; + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let name = $('#name').val(); + let flag = checkValue(name); + if (flag) { + $('#name').val(''); + return layer.msg('姓名查询包含特殊字符,请重新输入', { icon: 2 }); + } + let supName = $('#supName').val(); + let flag2 = checkValue(supName); + if (flag2) { + $('#supName').val(''); + return layer.msg('供应商查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#name').val(''); + $('#supName').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(1); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'name': $('#name').val(), + 'supName': $('#supName').val(), + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/carDriver/getDriverPageWhiteList", + where: { + encryptedData: JSON.stringify({ + 'name': $('#name').val(), + 'supName': $('#supName').val(), + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if (res.code === 401) { + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '6.9%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "name", + width: '12%', + title: "姓名", + unresize: true, + align: "center", + sort:true, + }, + { + field: "phone", + width: '12%', + title: "联系方式", + unresize: true, + align: "center", + sort:true, + }, + { + field: "sfzNum", + width: '12%', + title: "身份证", + unresize: true, + align: "center", + sort:true, + templet: function (d) { + return ''+d.sfzNum+''; + }, + }, + { + field: "jszNum", + width: '12%', + title: "驾驶证", + unresize: true, + align: "center", + sort:true, + templet: function (d) { + return ''+d.jszNum+''; + }, + }, + { + field: "otherNum", + width: '12%', + title: "其他操作证", + unresize: true, + align: "center", + sort:true, + templet: function (d) { + return ''+d.otherNum+''; + }, + }, + { + field: "supName", + width: '20%', + title: "所属供应商", + unresize: true, + align: "center", + sort:true, + }, + { + title: "操作", + width: '13%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "详情"; + html += "