diff --git a/api/init.json b/api/init.json index 026fb66..8e9ede4 100644 --- a/api/init.json +++ b/api/init.json @@ -86,6 +86,12 @@ "href": "page/accessory/accessory_out_bound_list.html", "icon": "fa fa-tachometer", "target": "_self" + }, + { + "title": "配件退回", + "href": "page/accessory/accessory_return_list.html", + "icon": "fa fa-tachometer", + "target": "_self" } ] } diff --git a/js/accessory/accessory_return_list.js b/js/accessory/accessory_return_list.js new file mode 100644 index 0000000..1db452b --- /dev/null +++ b/js/accessory/accessory_return_list.js @@ -0,0 +1,204 @@ +let form, table, laydate; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table", 'laydate'], function () { + form = layui.form; + table = layui.table; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDay', '#endDay'], + rangeLinked: true + }); + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + $('#startDate').val(''); + $('#endDate').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadData(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/partInput/findByPage", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').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: "code", + width: '15%', + title: "入库编号", + unresize: true, + align: "center", + }, + { + field: "inputUser", + width: '10%', + title: "入库人", + unresize: true, + align: "center", + }, + { + field: "inputNum", + width: '10%', + title: "入库数量", + unresize: true, + align: "center", + }, + { + field: "allPrice", + width: '10%', + title: "成本价格(元)", + unresize: true, + align: "center", + }, + { + field: "inputDay", + width: '10%', + title: "入库时间", + unresize: true, + align: "center", + }, + { + field: "remark", + width: '19.9%', + title: "备注", + unresize: true, + align: "center", + }, + { + field: "isFlag", + width: '10%', + title: "单价是否录入", + unresize: true, + align: "center", + templet: function (d) { + return setStatusColor(d.isFlag); + }, + }, + { + title: "操作", + width: '10%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "详情"; + html += "
|
修改"; + return html; + }, + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + +// 状态颜色 +function setStatusColor(value) { + value = value ? parseInt(value) : 0; + let color = ""; + let name = '' + if (value === '0') { + color = "#f56c6c"; + name = '否'; + } else { + name = '是'; + } + return '' + name + ""; +} + +// 导出 +function exportExcel() { + let params = { + 'proName': $('#proName').val(), + 'status': $('#status').val() + } + let url = dataUrl + "backstage/export/exportFhList"; + exportExcelUtil(url, '配件入库数据', JSON.stringify(params)); +} + +// 配件入库 +function accessoryStore(type, obj) { + obj.type = type; + openIframeByParamObj("accessory_store", "配件到货入库", "../accessory/child/accessory_store_form.html", "92%", "95%", obj); +} + +// 配件入库详情 +function accessoryStoreDetail(obj) { + openIframeByParamObj("accessory_store_detail", "配件到货入库", "../accessory/child/accessory_store_detail.html", "92%", "95%", obj); +} + +// 配件入库编辑 +function accessoryStoreEdit(obj) { + openIframeByParamObj("accessory_store_edit", "配件到货入库编辑", "../accessory/child/accessory_store_edit_form.html", "92%", "95%", obj); +} \ No newline at end of file diff --git a/page/accessory/accessory_return_list.html b/page/accessory/accessory_return_list.html new file mode 100644 index 0000000..d46e528 --- /dev/null +++ b/page/accessory/accessory_return_list.html @@ -0,0 +1,68 @@ + + + + + + 配件退回 + + + + + + + + + +
+
+
+ 搜索信息 +
+
+
+
+
+ +
+
+
+
+
+ +
+
-
+
+ +
+
+
+
+ + + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file