-
+
提示:层级最多3级,一级配件类型,二级配件名称,三级规格型号
+diff --git a/api/init.json b/api/init.json index 62f4f82..6f9d95d 100644 --- a/api/init.json +++ b/api/init.json @@ -68,6 +68,20 @@ "target": "_self" } ] + }, + { + "title": "配件管理", + "href": "", + "icon": "fa fa-home", + "target": "_self", + "child": [ + { + "title": "配件入库", + "href": "page/accessory/accessory_store_list.html", + "icon": "fa fa-tachometer", + "target": "_self" + } + ] } ] } diff --git a/js/accessory/accessory_store_list.js b/js/accessory/accessory_store_list.js new file mode 100644 index 0000000..2b49576 --- /dev/null +++ b/js/accessory/accessory_store_list.js @@ -0,0 +1,204 @@ +let form, table, element; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table"], function () { + form = layui.form; + table = layui.table; + element = layui.element; + element.render(); + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#proName').val(''); + $('#status').val('0'); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadData(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'proName': $('#proName').val(), + 'status': $('#status').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/planOut/getProPlanPage", + where: { + encryptedData: JSON.stringify({ + 'proName': $('#proName').val(), + 'status': $('#status').val() + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '5%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "proName", + width: '15%', + title: "入库编号", + unresize: true, + align: "center", + }, + { + field: "proName", + width: '10%', + title: "入库人", + unresize: true, + align: "center", + }, + { + field: "proName", + width: '10%', + title: "入库数量", + unresize: true, + align: "center", + }, + { + field: "lastDay", + width: '10%', + title: "成本价格(元)", + unresize: true, + align: "center", + }, + { + field: "lastDay", + width: '10%', + title: "入库时间", + unresize: true, + align: "center", + }, + { + field: "lastDay", + width: '19.9%', + title: "备注", + unresize: true, + align: "center", + }, + { + field: "lastDay", + width: '10%', + title: "单价是否录入", + unresize: true, + align: "center", + templet: function (d) { + return setStatusColor(d.status); + }, + }, + { + title: "操作", + width: '10%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "详情"; + html += "
提示:层级最多3级,一级配件类型,二级配件名称,三级规格型号
+