|
@@ -317,7 +317,7 @@ if ($customerId > 0) {
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<th width="8%" nowrap>销售订单号</th>
|
|
|
- <td><input type="text" id="order_code" name="order_code" value="" class="txt1" placeholder="请输入销售订单号 (多个用 / 分隔) " /></td>
|
|
|
+ <td><input type="text" id="order_code" name="order_code" value="" class="txt1" placeholder="请输入销售订单号 (多个用 / 分隔) " maxlength="100" /></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th width="8%" nowrap>客户选择</th>
|
|
@@ -824,6 +824,7 @@ if ($customerId > 0) {
|
|
|
var hasProducts = false;
|
|
|
var allTotalPricesValid = true;
|
|
|
var firstInvalidField = null;
|
|
|
+ var hasUnselectedProducts = false;
|
|
|
|
|
|
// 检查是否有产品行
|
|
|
if ($('.product-row').length === 0) {
|
|
@@ -837,11 +838,21 @@ if ($customerId > 0) {
|
|
|
var totalPriceInput = $(this).find('.total-price-input');
|
|
|
var totalPrice = parseFloat(totalPriceInput.val()) || 0;
|
|
|
var productSearch = $(this).find('.product-search');
|
|
|
+ var searchValue = productSearch.val().trim();
|
|
|
|
|
|
// 检查产品是否已选择
|
|
|
if (!productId) {
|
|
|
- if (!firstInvalidField) {
|
|
|
- firstInvalidField = productSearch;
|
|
|
+ if (searchValue) {
|
|
|
+ // 如果有搜索内容但未选择产品
|
|
|
+ hasUnselectedProducts = true;
|
|
|
+ if (!firstInvalidField) {
|
|
|
+ firstInvalidField = productSearch;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果既没有选择产品也没有搜索内容
|
|
|
+ if (!firstInvalidField) {
|
|
|
+ firstInvalidField = productSearch;
|
|
|
+ }
|
|
|
}
|
|
|
return true; // continue
|
|
|
}
|
|
@@ -885,6 +896,14 @@ if ($customerId > 0) {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ if (hasUnselectedProducts) {
|
|
|
+ alert('请从搜索结果中选择产品,不能直接提交未选择的产品');
|
|
|
+ if (firstInvalidField) {
|
|
|
+ firstInvalidField.focus();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
if (!allTotalPricesValid) {
|
|
|
alert('请为所有产品输入有效的总价');
|