diff --git a/css/accessory/accessory_store_form.css b/css/accessory/accessory_store_form.css index 3854f54..a6b21d8 100644 --- a/css/accessory/accessory_store_form.css +++ b/css/accessory/accessory_store_form.css @@ -1,3 +1,17 @@ +.layout { + display: flex; + align-items: center; + justify-content: center; +} + +#no_data_title { + width: 100%; + height: 200px; + flex-direction: column; + justify-content: space-evenly; + margin-top: 2%; +} + #search-info { border-width: 1px; margin-bottom: 10px; diff --git a/images/no_data_icon.png b/images/no_data_icon.png new file mode 100644 index 0000000..125f984 Binary files /dev/null and b/images/no_data_icon.png differ diff --git a/js/accessory/child/accessory_store_form.js b/js/accessory/child/accessory_store_form.js index 8947a77..7a78952 100644 --- a/js/accessory/child/accessory_store_form.js +++ b/js/accessory/child/accessory_store_form.js @@ -50,7 +50,6 @@ function setParams(obj) { }); } }); - initTable(); }); } // 设置文件类型 @@ -107,6 +106,25 @@ function saveData2() { $('#formSubmit').trigger('click') } +// 复选框全选 +function selectAll(selectStatus) {//传入参数(全选框的选中状态) + //根据name属性获取到单选框的input,使用each方法循环设置所有单选框的选中状态 + if (selectStatus) { + $("input[name='check']").each(function (i, n) { + n.checked = true; + $(n).parent().parent().find('td').eq(2).find('input').prop('readonly', false).removeAttr('style').val('0'); + }); + } else { + $("input[name='check']").each(function (i, n) { + n.checked = false; + $(n).parent().parent().find('td').eq(2).find('input').prop('readonly', true).css({ + 'background-color': '#f0f0f0', + 'border': '1px solid #d9d9d9' + }).val(''); + }); + } +} + function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量 let color = '#66b1ff'; if (type === 1) { @@ -194,20 +212,14 @@ function handleNum(value) { return null; } -// 详情 -function openDetail() { - openIframeByParamObj("view_plan", "需求计划", "./demand_plan_detail_list.html", "92%", "95%", objParam); -} -// 新增需求计划外机具 -function addJjData() { - let params = { - 'proId': idParam - }; - if (jjDataArr && jjDataArr.length > 0) { +// 选择入库配件类型 +function chooseFitType() { + let params = {}; + /* if (jjDataArr && jjDataArr.length > 0) { params.jjDataArrStr = JSON.stringify(jjDataArr); - } - openIframeByParamObj("addJjData", '新增需求计划外机具', "./add_jj_data.html", '72%', '80%', params); + } */ + openIframeByParamObj("choose_fit_type", '选择入库配件类型', "./choose_fit_type_list.html", '82%', '90%', params); } function addJjDatas(data) { diff --git a/js/accessory/child/choose_fit_type_list.js b/js/accessory/child/choose_fit_type_list.js new file mode 100644 index 0000000..7e75541 --- /dev/null +++ b/js/accessory/child/choose_fit_type_list.js @@ -0,0 +1,180 @@ +let objParam; +let form, table, element, tableIns, layer; +let pageNum = 1; +function setParams(obj) { + objParam = JSON.parse(obj); + console.log(objParam); + $('#proName').html(objParam.proName); + layui.use(["form", "table", 'element', 'layer'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + initTable(); + }); +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#keyWord').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(), + 'proId': objParam.proId + }), + }, + }, + ); +} + +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-180", + url: dataUrl + "backstage/planOut/getProPlanListByProId", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'proId': objParam.proId + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '9.9%', + title: "序号", + align: "center", + unresize: true, + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "code", + width: '15%', + title: "计划编号", + unresize: true, + align: "center", + }, + { + field: "proName", + width: '20%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "needTime", + width: '10%', + title: "需用日期", + unresize: true, + align: "center", + }, + { + field: "creator", + width: '10%', + title: "申请人 ", + unresize: true, + align: "center", + }, + { + field: "createTime", + width: '10%', + title: "申请时间", + unresize: true, + align: "center", + }, + { + field: "remark", + width: '15%', + title: "计划说明 ", + unresize: true, + align: "center", + }, + { + width: '10%', + title: "操作 ", + unresize: true, + align: "center", + templet: function (d) { + let 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; + element.render(); + table.resize("currentTableId"); + }, + }); +} + +// 数量颜色 1.需要量 2.已发货量 3.待发货量 +function setNumColor(value, type) { + let color = "#409Eff"; + if (type === 1) { + color = "#409Eff"; + } else if (type === 2) { + color = "#19be6b"; + } else if (type === 3) { + color = "#f56c6c"; + } + return '' + value + ""; +} + + +// 导出 +function exportExcel() { + let params = { + 'keyWord': $('#keyWord').val(), + 'proId': objParam.proId + } + let url = dataUrl + "backstage/export/export"; + exportExcelUtil(url, '需求计划', JSON.stringify(params)); +} + +// 需求计划编号 +function addFitTypeData() { + openIframeByParamObj2("add_fit_type_data", "配件类型", "../../../page/basic/fit_type_list.html", "82%", "90%", {}); +} \ No newline at end of file diff --git a/js/basic/fit_type_list.js b/js/basic/fit_type_list.js index 4005452..a9b1378 100644 --- a/js/basic/fit_type_list.js +++ b/js/basic/fit_type_list.js @@ -1,4 +1,10 @@ let form, layer, dtree, fitTypeTree, util, dtreeData = [], jsonData = null; +function setParams() { + // 配件入库页面跳转 + $('body').css({ 'margin': '0 15px 15px 15px' }); + $('.layuimini-container').css({ 'height': '99%' }); + +}; layui.config({ base: "../../lib/layui-v2.9.18/layui/dtree/", //此处路径请自行处理, 可以使用绝对路径 }).extend({ diff --git a/page/accessory/child/accessory_store_form.html b/page/accessory/child/accessory_store_form.html index eb7433e..3529bd8 100644 --- a/page/accessory/child/accessory_store_form.html +++ b/page/accessory/child/accessory_store_form.html @@ -59,6 +59,13 @@ ▋
入库配件明细
+ +您还没选择入库配件类型
+需要添加配件类型后才能执行入库操作
+ +