|
@@ -277,13 +277,16 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
<tr>
|
|
|
<th width="8%">客户选择</th>
|
|
|
<td>
|
|
|
- <div style="display: inline-block; width: 60%;" class="customerinput">
|
|
|
- <input type="text" class="customer-search fastsearch" placeholder="输入客户编码或名称搜索..." style="width: 100%;" value="<?= htmlspecialcharsFix(isset($order['cs_code']) && $order['cs_code'] ? $order['cs_code'] . ' - ' . $order['cs_company'] : $order['cs_company']) ?>">
|
|
|
- <div class="customerlist" style="display: none; position: absolute; background: white; border: 1px solid #ccc; max-height: 200px; overflow-y: auto; width: 100%; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.2);">
|
|
|
- <ul style="list-style: none; padding: 0; margin: 0;"></ul>
|
|
|
+ <div style="display: flex; width: 60%; position: relative; align-items: center;" class="customerinput">
|
|
|
+ <div style="flex: 1; position: relative;">
|
|
|
+ <input type="text" class="customer-search fastsearch" placeholder="输入客户编码或名称搜索..." style="width: 100%;" value="<?= htmlspecialcharsFix(isset($order['cs_code']) && $order['cs_code'] ? $order['cs_code'] . ' - ' . $order['cs_company'] : $order['cs_company']) ?>">
|
|
|
+ <div class="customerlist" style="display: none; position: absolute; background: white; border: 1px solid #ccc; max-height: 200px; overflow-y: auto; width: 100%; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.2);">
|
|
|
+ <ul style="list-style: none; padding: 0; margin: 0;"></ul>
|
|
|
+ </div>
|
|
|
+ <input type="hidden" name="customer_id" id="customer_id" value="<?= $order['customer_id'] ?>">
|
|
|
+ <div class="selected-customer-info" style="margin-top: 5px; font-weight: bold;"></div>
|
|
|
</div>
|
|
|
- <input type="hidden" name="customer_id" id="customer_id" value="<?= $order['customer_id'] ?>">
|
|
|
- <div class="selected-customer-info" style="margin-top: 5px; font-weight: bold;"></div>
|
|
|
+ <span class="delete-customer" style="margin-left: 10px; color: #e74c3c; font-weight: bold; font-size: 18px; cursor: pointer; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%;">×</span>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -425,6 +428,22 @@ if (!empty($id) && is_numeric($id)) {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ // 添加客户删除按钮事件
|
|
|
+ $('.delete-customer').on('click', function() {
|
|
|
+ // if(confirm('确定要清除当前选择的客户吗?')) {
|
|
|
+ // 清空客户ID和客户名称
|
|
|
+ $('#customer_id').val('');
|
|
|
+ $('.customer-search').val('').focus();
|
|
|
+ $('.selected-customer-info').text('');
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 添加样式到客户删除按钮
|
|
|
+ $('.delete-customer').hover(
|
|
|
+ function() { $(this).css('background-color', '#e74c3c').css('color', 'white'); },
|
|
|
+ function() { $(this).css('background-color', '').css('color', '#e74c3c'); }
|
|
|
+ );
|
|
|
+
|
|
|
// 添加产品行按钮点击事件
|
|
|
$('#add-product-btn').on('click', function() {
|
|
|
addEmptyProductRow();
|