bug修复

This commit is contained in:
cwchen 2024-11-20 18:05:53 +08:00
parent 8083f0e89a
commit ed19fd9fd6
7 changed files with 20 additions and 9 deletions

View File

@ -371,12 +371,17 @@ function delFitType() {
// 校验数据
function checkValue(that, type) {
let value = $(that).val();
let num = $(that).parents('td').prev().html();
if (type === 1) { // 报废数量
const regex = /^(0|[1-9]\d{0,6})$/;
if (!regex.test(value) && value) {
$(that).val(0);
$(that).parents('td').next().html(0);
return layer.msg('报废数量输入不合法最大输入6位数且为正整数请重新输入!', { icon: 5 })
} else if (value && parseInt(value) > parseInt(num)) {
$(that).val(0);
$(that).parents('td').next().html(0);
return layer.msg('报废数量不能超过库存量,请重新输入!', { icon: 5 })
} else if (value) {
let price = $(that).parents('td').prev().prev().html(); // 单价
$(that).parents('td').next().html(parseInt(value) * parseFloat(price));

View File

@ -40,7 +40,7 @@ function queryTable(type) {
reloadTable(1);
} else if (type === 2) {
$('#name').val('');
$('#module').val('');
$('#model').val('');
$('#type').val('');
layui.form.render();
reloadTable(1);

View File

@ -202,6 +202,12 @@ function initTable() {
obj.reedit();
return layer.msg('格式不正确最大输入6位数且为正整数', { icon: 7 })
}
// 获取累计领料数量
let num = obj.data.num ? obj.data.num : 0;
if (value > num) {
obj.reedit();
return layer.msg('报废量不能超过库存量', { icon: 7 })
}
}
} else if (field === 'remarks') { // 备注
if (value) {

View File

@ -122,7 +122,7 @@ function initTable() {
unresize: true,
align: "center",
templet: function (d) {
return '<p style="color:#409eff;">领:' + setNullNumValue(d.lyNum) + ' </p>';
return '<p style="color:#409eff;">' + setNullNumValue(d.lyNum) + ' </p>';
},
},
@ -133,7 +133,7 @@ function initTable() {
unresize: true,
align: "center",
templet: function (d) {
return '<p style="color:#409eff;">领:' + setNullNumValue(d.lyMoney) + ' </p>';
return '<p style="color:#409eff;">' + setNullNumValue(d.lyMoney) + ' </p>';
},
},
{

View File

@ -1,4 +1,4 @@
let objParam = JSON.stringify(decodeURIComponent(getUrlParam('obj')));
let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj')));
let form, table, element, tableIns, layer;
let pageNum = 1;
layui.use(["form", "table", 'element', 'layer'], function () {

View File

@ -169,8 +169,8 @@ function initTable() {
// 导出
function exportExcel() {
let params = {
'proName': $('#proName').val(),
'status': $('#status').val()
'keyWord': $('#keyWord').val(),
'auditStatus': $('#auditStatus').val()
}
let url = dataUrl + "backstage/planAudit/export";
exportExcelUtil(url, '计划申请审核', JSON.stringify(params));

View File

@ -38,8 +38,8 @@
<div class="layuimini-main">
<div class="layui-tab layui-tab-brief" lay-filter="demo-filter-tab">
<ul class="layui-tab-title">
<li value="" class="layui-this">全部</li>
<li value="1">待审核</li>
<li value="">全部</li>
<li value="1" class="layui-this">待审核</li>
<li value="2">已通过</li>
<li value="3">已驳回</li>
</ul>
@ -48,7 +48,7 @@
<legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px">
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
<input type="text" value="" id="auditStatus" name="auditStatus" hidden>
<input type="text" value="1" id="auditStatus" name="auditStatus" hidden>
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">