合同清单导入校验

master
wangjiuyun 2025-05-26 16:25:01 +08:00
parent 38f2930d61
commit a81589744a
2 changed files with 15 additions and 11 deletions

View File

@ -184,6 +184,8 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-order-add').serialize()); $.operate.save(prefix + "/add", $('#form-order-add').serialize());
}else{
$.modal.alertWarning("请完善表单必填项");
} }
} }
@ -218,7 +220,7 @@
align: 'center', align: 'center',
title: 'BOM编码', title: 'BOM编码',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].productCode' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].productCode' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -227,7 +229,7 @@
align: 'center', align: 'center',
title: '产品名称', title: '产品名称',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].productName' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].productName' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -236,7 +238,7 @@
align: 'center', align: 'center',
title: '数量', title: '数量',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control quantity' type='number' name='orderListList[%s].quantity' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control quantity' type='number' name='orderListList[%s].quantity' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -245,7 +247,7 @@
align: 'center', align: 'center',
title: '单价', title: '单价',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control price' type='number' name='orderListList[%s].price' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control price' type='number' name='orderListList[%s].price' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -255,7 +257,7 @@
title: '折扣', title: '折扣',
width: 90, width: 90,
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.0001' max='1' min='0'>", index, value); var html = $.common.sprintf("<input readonly class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.0001' max='1' min='0' required>", index, value);
return html; return html;
} }
}, },
@ -264,7 +266,7 @@
align: 'center', align: 'center',
title: '总价', title: '总价',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control amount' type='number' name='orderListList[%s].amount' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control amount' type='number' name='orderListList[%s].amount' value='%s' required>", index, value);
return html; return html;
} }
}, },

View File

@ -192,6 +192,8 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
}else{
$.modal.alertWarning("请完善表单必填项");
} }
} }
@ -272,7 +274,7 @@
return; return;
} }
$('[name="orderPartnerCode"]').val(rows[0].partnerCode); $('[name="orderPartnerCode"]').val(rows[0].partnerCode);
$('[name="orderPartnerName"]').val(rows[0].partnerCode); $('[name="orderPartnerName"]').val(rows[0].partnerName);
$.modal.close(index); $.modal.close(index);
@ -408,7 +410,7 @@
align: 'center', align: 'center',
title: '数量', title: '数量',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control quantity' type='text' name='orderListList[%s].quantity' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control quantity' type='text' name='orderListList[%s].quantity' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -417,7 +419,7 @@
align: 'center', align: 'center',
title: '单价', title: '单价',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control price' type='text' name='orderListList[%s].price' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control price' type='text' name='orderListList[%s].price' value='%s' required>", index, value);
return html; return html;
} }
}, },
@ -427,7 +429,7 @@
title: '折扣', title: '折扣',
width:90, width:90,
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.0001' max='1' min='0'>", index, value); var html = $.common.sprintf("<input readonly class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.0001' max='1' min='0' required>", index, value);
return html; return html;
} }
}, },
@ -437,7 +439,7 @@
align: 'center', align: 'center',
title: '总价', title: '总价',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control amount' type='text' name='orderListList[%s].amount' value='%s'>", index, value); var html = $.common.sprintf("<input readonly class='form-control amount' type='text' name='orderListList[%s].amount' value='%s' required>", index, value);
return html; return html;
} }
}, },