From e4f085bb328b03c6d19577629fafef8c9a5356af Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Mon, 10 Mar 2025 13:10:54 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=9C=80=E6=B1=82=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=EF=BC=8C=E9=9C=80=E7=94=A8=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=80=80=E8=BF=98=E6=97=A5=E6=9C=9F=202?= =?UTF-8?q?=E3=80=81=E8=AE=BE=E5=A4=87=E5=8F=91=E8=B4=A7=EF=BC=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=AE=9E=E9=99=85=E5=8F=91=E8=B4=A7=E9=87=8F=E9=99=90?= =?UTF-8?q?=E5=88=B6=203=E3=80=81=E8=AE=BE=E5=A4=87=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/aq_demand_plan/child/apply_plan_detail.js | 11 +++--- .../child/apply_plan_edit_form.js | 24 ++++++++----- js/aq_demand_plan/child/apply_plan_form.js | 24 ++++++++----- js/aq_demand_plan/child/choose_type_list.js | 34 +++++++++++++++---- js/aq_demand_plan/child/send_out_edit_form.js | 6 ++-- .../child/send_out_edit_form_table.js | 16 ++++----- js/aq_demand_plan/child/send_out_form.js | 6 ++-- .../child/send_out_form_table.js | 16 ++++----- js/aq_demand_plan/send_out_list.js | 20 +++++++++-- .../child/apply_plan_edit_form.html | 2 +- .../aq_demand_plan/child/apply_plan_form.html | 2 +- page/aq_demand_plan/send_out_list.html | 11 ++++++ 12 files changed, 117 insertions(+), 55 deletions(-) diff --git a/js/aq_demand_plan/child/apply_plan_detail.js b/js/aq_demand_plan/child/apply_plan_detail.js index 2585455..5315147 100644 --- a/js/aq_demand_plan/child/apply_plan_detail.js +++ b/js/aq_demand_plan/child/apply_plan_detail.js @@ -182,16 +182,15 @@ function initTable() { }, }, { - field: "needDay", + field: "backDate", width: '10%', - title: "需用天数", + title: "退还日期", unresize: true, align: "center", - sort:true, + sort: true, templet: function (d) { - return setNumColor(d.needDay); - }, - + return d.backDate ? d.backDate : ''; + } }, { field: "remark", diff --git a/js/aq_demand_plan/child/apply_plan_edit_form.js b/js/aq_demand_plan/child/apply_plan_edit_form.js index dc8ca7e..194e49c 100644 --- a/js/aq_demand_plan/child/apply_plan_edit_form.js +++ b/js/aq_demand_plan/child/apply_plan_edit_form.js @@ -99,7 +99,7 @@ function getPlanDetailListNoPage() { $.each(obj, function (index, item) { let obj = Object.assign({}, item); obj.unitName = item.unit; - obj.times = item.needDay; + obj.times = item.backDate; obj.remarks = item.remark; obj.dataId = item.id; obj.id = item.modelId; @@ -141,9 +141,9 @@ function submitApply(data) { if (parseInt(list[i].needNum) === 0) { return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用量', { icon: 7 }); } - if (parseInt(list[i].needDay) === 0) { - return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用天数', { icon: 7 }); - } + // if (parseInt(list[i].needDay) === 0) { + // return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用天数', { icon: 7 }); + // } } data.field.id = objParam.id; data.field.jsonData = JSON.stringify(list); @@ -213,7 +213,7 @@ function getBaseTableData() { model: $(this).find('td').eq(4).html(), unit: $(this).find('td').eq(5).html(), needNum: needNum ? needNum : 0, - needDay: times ? times : 0, + backDate: times, remark: $(this).find('td').eq(8).find('input[name="remarks"]').val(), }) }) @@ -309,7 +309,7 @@ function setTableData(results) { html += "" + l.model + ""; html += "" + l.unitName + ""; html += "" + setFormInput(l.needNum, 1) + ""; - html += "" + setFormInput(l.times == null ? 0 : l.times, 2) + ""; + html += "" + setFormInput(l.times == null ? '' : l.times, 2) + ""; html += "" + setFormInput(l.remarks, 3) + ""; html += ""; } @@ -317,6 +317,13 @@ function setTableData(results) { html += "没有相关数据"; } $("#baseTable tbody").empty().append(html); + // 渲染日期选择器 + $('.refund-date').each(function(){ + laydate.render({ + elem: this, // 指定元素 + type: 'date' // 可选,指定为日期类型,默认即是'date' + }); + }); layui.form.render(); } @@ -324,8 +331,9 @@ function setFormInput(value, type) { let html = '
'; if (type === 1) { // 需用量 html += ''; - } else if (type === 2) { // 需用天数 - html += ''; + } else if (type === 2) { // 退还日期 + // html += ''; + html += ''; } else if (type === 3) { // 备注 html += ''; } diff --git a/js/aq_demand_plan/child/apply_plan_form.js b/js/aq_demand_plan/child/apply_plan_form.js index 34ca521..c2bb837 100644 --- a/js/aq_demand_plan/child/apply_plan_form.js +++ b/js/aq_demand_plan/child/apply_plan_form.js @@ -76,9 +76,9 @@ function submitApply(data) { if (parseInt(list[i].needNum) === 0) { return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用量', { icon: 7 }); } - if (parseInt(list[i].needDay) === 0) { - return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用天数', { icon: 7 }); - } + // if (parseInt(list[i].needDay) === 0) { + // return layer.msg('安全工器具明细数据' + (i + 1) + '行,未填写需用天数', { icon: 7 }); + // } } data.field.jsonData = JSON.stringify(list); let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' }); @@ -121,7 +121,7 @@ function getBaseTableData() { model: $(this).find('td').eq(4).html(), unit: $(this).find('td').eq(5).html(), needNum: needNum ? needNum : 0, - needDay: times ? times : 0, + backDate: times, remark: $(this).find('td').eq(8).find('input[name="remarks"]').val(), }) }) @@ -215,7 +215,7 @@ function setTableData(results) { html += "" + l.model + ""; html += "" + l.unitName + ""; html += "" + setFormInput(l.needNum, 1) + ""; - html += "" + setFormInput(l.times == null ? 0 : l.times, 2) + ""; + html += "" + setFormInput(l.times, 2) + ""; html += "" + setFormInput(l.remarks, 3) + ""; html += ""; } @@ -223,6 +223,14 @@ function setTableData(results) { html += "没有相关数据"; } $("#baseTable tbody").empty().append(html); + + // 渲染日期选择器 + $('.refund-date').each(function(){ + laydate.render({ + elem: this, // 指定元素 + type: 'date' // 可选,指定为日期类型,默认即是'date' + }); + }); layui.form.render(); } @@ -230,8 +238,8 @@ function setFormInput(value, type) { let html = '
'; if (type === 1) { // 需用量 html += ''; - } else if (type === 2) { // 需用天数 - html += ''; + } else if (type === 2) { // 退还日期 + html += ''; } else if (type === 3) { // 备注 html += ''; } @@ -352,7 +360,7 @@ function goOnAddData() { // 校验数据 function checkValue(that, type, name) { let value = $(that).val(); - if (type === 1 || type === 2) { // 需用量 / 需用天数 + if (type === 1) { // 需用量 / 需用天数 const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value) && value) { layer.msg('' + name + '输入有误,请重新输入!', { icon: 5 }) diff --git a/js/aq_demand_plan/child/choose_type_list.js b/js/aq_demand_plan/child/choose_type_list.js index a5fe253..c174e9b 100644 --- a/js/aq_demand_plan/child/choose_type_list.js +++ b/js/aq_demand_plan/child/choose_type_list.js @@ -8,12 +8,13 @@ let cjList = []; let jjDetailArr = []; // 入库配件类型数据 function setParams(obj) { objParam = JSON.parse(obj); - layui.use(["form", "table", 'element', 'layer', 'util'], function () { + layui.use(["form", "table", 'element', 'layer', 'util', 'laydate'], function () { form = layui.form; table = layui.table; element = layui.element; layer = layui.layer; util = layui.util; + laydate = layui.laydate; initTable(); }); } @@ -155,12 +156,17 @@ function initTable() { }, { field: "times", - width: '15%', - title: " * 需用天数", + width: "15%", + title: "退还日期", unresize: true, align: "center", - edit: 'text', - style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;', + templet: (d) => + '
', + style: "outline: 1px solid #e6e6e6;outline-offset: -5px;", }, { field: "remarks", @@ -195,6 +201,22 @@ function initTable() { } } } + + // 初始化日期选择器 + res.data.forEach((item) => { + laydate.render({ + elem: "#date_" + item.id, + done: (value) => { + // 更新数据 + const data = {} + data.id = item.id + data.times = value + item.times = data.times + updateOrAddObject(item.id, item) + }, + }) + }) + //设置全选checkbox的选中状态,只有改变LAY_CHECKED的值, table.checkStatus才能抓取到选中的状态 let checkStatus = table.checkStatus('currentTableId');//这里的lightTable是指分页中的id if (checkStatus.isAll) {//是否全选 @@ -207,7 +229,7 @@ function initTable() { table.on('edit(currentTableId2)', function (obj) { var field = obj.field; // 得到修改的字段 var value = obj.value // 得到修改后的值 - if (field === 'needNum' || field === 'times') { // 需用量 / 需用天数 + if (field === 'needNum') { // 需用量 / 需用天数 if (value) { const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value)) { diff --git a/js/aq_demand_plan/child/send_out_edit_form.js b/js/aq_demand_plan/child/send_out_edit_form.js index e502957..48a9be8 100644 --- a/js/aq_demand_plan/child/send_out_edit_form.js +++ b/js/aq_demand_plan/child/send_out_edit_form.js @@ -229,9 +229,9 @@ function beforeSubmitApply() { return layer.msg('序号为' + (i + 1) + '的数据,未选择检验日期', { icon: 7 }); } } - if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量 - return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 }); - } + // if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量 + // return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 }); + // } } openIframeByParamObj("quickAddForm", "采购发货确认", "./send_out_confirm.html", "92%", "92%", dataList); } diff --git a/js/aq_demand_plan/child/send_out_edit_form_table.js b/js/aq_demand_plan/child/send_out_edit_form_table.js index 864d522..dfd4020 100644 --- a/js/aq_demand_plan/child/send_out_edit_form_table.js +++ b/js/aq_demand_plan/child/send_out_edit_form_table.js @@ -92,14 +92,14 @@ function checkValue(that, type) { $(that).val(0); return layer.msg('采购量输入有误,请重新输入!', { icon: 5 }) } - if (value) { - // 采购量不能大于需要量 - let needNum = $(that).parents('td').prev().html(); - if (parseInt(value) > parseInt(needNum)) { - $(that).val(0); - return layer.msg('采购量不能大于需要量,请重新输入!', { icon: 5 }) - } - } + // if (value) { + // // 采购量不能大于需要量 + // let needNum = $(that).parents('td').prev().html(); + // if (parseInt(value) > parseInt(needNum)) { + // $(that).val(0); + // return layer.msg('采购量不能大于需要量,请重新输入!', { icon: 5 }) + // } + // } } else if (type === 2) { // 利库量 const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value) && value) { diff --git a/js/aq_demand_plan/child/send_out_form.js b/js/aq_demand_plan/child/send_out_form.js index c9b2f7b..a2f1a67 100644 --- a/js/aq_demand_plan/child/send_out_form.js +++ b/js/aq_demand_plan/child/send_out_form.js @@ -160,9 +160,9 @@ function beforeSubmitApply() { return layer.msg('序号为' + (i + 1) + '的数据,未选择检验日期', { icon: 7 }); } } - if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量 - return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 }); - } + // if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量 + // return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 }); + // } } openIframeByParamObj("quickAddForm", "采购发货确认", "./send_out_confirm.html", "92%", "92%", dataList); } diff --git a/js/aq_demand_plan/child/send_out_form_table.js b/js/aq_demand_plan/child/send_out_form_table.js index 25a74ee..3d2ac06 100644 --- a/js/aq_demand_plan/child/send_out_form_table.js +++ b/js/aq_demand_plan/child/send_out_form_table.js @@ -74,14 +74,14 @@ function checkValue(that, type) { $(that).val(0); return layer.msg('采购量输入有误,请重新输入!', { icon: 5 }) } - if (value) { - // 采购量不能大于需要量 - let needNum = $(that).parents('td').prev().html(); - if (parseInt(value) > parseInt(needNum)) { - $(that).val(0); - return layer.msg('采购量不能大于需要量,请重新输入!', { icon: 5 }) - } - } + // if (value) { + // // 采购量不能大于需要量 + // let needNum = $(that).parents('td').prev().html(); + // if (parseInt(value) > parseInt(needNum)) { + // $(that).val(0); + // return layer.msg('采购量不能大于需要量,请重新输入!', { icon: 5 }) + // } + // } } else if (type === 2) { // 利库量 const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value) && value) { diff --git a/js/aq_demand_plan/send_out_list.js b/js/aq_demand_plan/send_out_list.js index e8b535e..c352ae7 100644 --- a/js/aq_demand_plan/send_out_list.js +++ b/js/aq_demand_plan/send_out_list.js @@ -5,6 +5,12 @@ layui.use(["form", "table", 'element'], function () { form = layui.form; table = layui.table; element = layui.element; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startTime', '#endTime'], + rangeLinked: true + }); /* // 动态插入进度条元素 $("#num-progress").after(`
@@ -81,6 +87,8 @@ function queryTable(type) { } else if (type === 2) { $('#proName').val(''); $('#status').val(''); + $('#startTime').val(''); + $('#endTime').val(''); layui.form.render(); reloadTable(1); } @@ -101,7 +109,9 @@ function reloadTable(pageNum) { where: { encryptedData: JSON.stringify({ 'proName': $('#proName').val(), - 'status': $('#status').val() + 'status': $('#status').val(), + 'startTime': $('#startTime').val(), + 'endTime': $('#endTime').val() }), }, }, @@ -121,7 +131,9 @@ function initTable() { where: { encryptedData: JSON.stringify({ 'proName': $('#proName').val(), - 'status': $('#status').val() + 'status': $('#status').val(), + 'startTime': $('#startTime').val(), + 'endTime': $('#endTime').val() }), }, request: { @@ -346,7 +358,9 @@ function schedule(d) { function exportExcel() { let params = { 'proName': $('#proName').val(), - 'status': $('#status').val() + 'status': $('#status').val(), + 'startTime': $('#startTime').val(), + 'endTime': $('#endTime').val() } let url = dataUrl + "backstage/purchase/export"; exportExcelUtil(url, '采购发货', JSON.stringify(params)); diff --git a/page/aq_demand_plan/child/apply_plan_edit_form.html b/page/aq_demand_plan/child/apply_plan_edit_form.html index d72efd6..922ecb0 100644 --- a/page/aq_demand_plan/child/apply_plan_edit_form.html +++ b/page/aq_demand_plan/child/apply_plan_edit_form.html @@ -114,7 +114,7 @@ 规格 单位 *需用量 - *需用天数 + 退还日期 备注 diff --git a/page/aq_demand_plan/child/apply_plan_form.html b/page/aq_demand_plan/child/apply_plan_form.html index 1a358fc..aee8c9d 100644 --- a/page/aq_demand_plan/child/apply_plan_form.html +++ b/page/aq_demand_plan/child/apply_plan_form.html @@ -114,7 +114,7 @@ 规格 单位 *需用量 - *需用天数 + 退还日期 备注 diff --git a/page/aq_demand_plan/send_out_list.html b/page/aq_demand_plan/send_out_list.html index fc79845..d290f9e 100644 --- a/page/aq_demand_plan/send_out_list.html +++ b/page/aq_demand_plan/send_out_list.html @@ -94,6 +94,17 @@
+
+
+ +
+
-
+
+ +
+