Browse Source

feat: add shipping_date

igb 20 hours ago
parent
commit
3f36f82d4f
5 changed files with 25 additions and 10 deletions
  1. 2 2
      order.php
  2. 6 2
      order_add.php
  3. 4 1
      order_details.php
  4. 8 2
      order_edit.php
  5. 5 3
      order_save.php

+ 2 - 2
order.php

@@ -202,7 +202,7 @@ $sqlStr .= " $fliterStr ORDER BY {$ordStr}o.created_at DESC";
     <div class="fastSelect clear">
         <H1>筛选条件</H1>
         <div class="selectItem">
-            <label>出货日期</label>
+            <label style="white-space:nowrap;">出货日期</label>
             <input type="date" name="fliterFromDate" class="date-input filterSearch" value="<?= $fliterFromDate ?>">
             <label>到</label>
             <input type="date" name="fliterToDate" class="date-input filterSearch" value="<?= $fliterToDate ?>">
@@ -225,7 +225,7 @@ $sqlStr .= " $fliterStr ORDER BY {$ordStr}o.created_at DESC";
             <div class="col3">销售开单号</div>
             <div class="col4">客户编码</div>
             <div class="col5">客户</div>
-            <div class="col7">出货日期</div>
+            <div class="col7">出货日期</div>
             <div class="col9">订单金额</div>
             <div class="col10">操作</div>
         </div>

+ 6 - 2
order_add.php

@@ -324,7 +324,7 @@ if ($customerId > 0) {
                 <td>
                     <div style="display: flex; gap: 20px;">
                         <label style="display: flex; align-items: center;">
-                            <input type="radio" name="order_type" id="order_type_1" value="1"> 普通订单
+                            <input type="radio" name="order_type" id="order_type_1" value="1"> 美特柏品牌订单
                         </label>
                         <label style="display: flex; align-items: center;">
                             <input type="radio" name="order_type" id="order_type_2" value="2"> 定制订单
@@ -358,9 +358,13 @@ if ($customerId > 0) {
                     <?php endif; ?>
                 </td>
             </tr>
+            <tr>
+                <th width="8%" nowrap>最新出货单日期</th>
+                <td><input type="date" id="order_date" name="order_date" value="<?= date('Y-m-d') ?>" class="txt1" style="width: 20%; min-width: 200px;"  /> <span style="color: red">注:当前出货最新出货单号日期</span></td>
+            </tr>
             <tr>
                 <th width="8%" nowrap>出货日期</th>
-                <td><input type="date" id="order_date" name="order_date" value="<?= date('Y-m-d') ?>" class="txt1" /></td>
+                <td><input type="date" id="shipping_date" name="shipping_date" value="<?= date('Y-m-d') ?>" class="txt1" style="width: 20%; min-width: 200px;"  /> <span style="color: red"></span></td>
             </tr>
             <tr>
                 <th width="8%" valign="top" nowrap>产品列表</th>

+ 4 - 1
order_details.php

@@ -220,7 +220,10 @@ if (!empty($id) && is_numeric($id)) {
 <!--            <span class="info-label">联系人:</span> --><?php //= htmlspecialcharsFix($order['contact_name']) ?>
 <!--        </div>-->
         <div class="info-row">
-            <span class="info-label">出货日期:</span> <?= date('Y-m-d', strtotime($order['order_date'])) ?>
+            <span class="info-label">最新出货单日期:</span> <?= date('Y-m-d', strtotime($order['order_date'])) ?>
+        </div>
+        <div class="info-row">
+            <span class="info-label">出货日期:</span> <?= date('Y-m-d', strtotime($order['shipping_date'])) ?>
         </div>
         <div class="info-row">
             <span class="info-label">创建时间:</span> <?= $order['created_at'] ?>

+ 8 - 2
order_edit.php

@@ -345,7 +345,7 @@ if (!empty($id) && is_numeric($id)) {
                 <td>
                     <div style="display: flex; gap: 20px;">
                         <label style="display: flex; align-items: center;">
-                            <input type="radio" name="order_type" id="order_type_1" value="1" <?= ($order['order_type'] == 1) ? 'checked' : '' ?>> 普通订单
+                            <input type="radio" name="order_type" id="order_type_1" value="1" <?= ($order['order_type'] == 1) ? 'checked' : '' ?>> 美特柏品牌订单
                         </label>
                         <label style="display: flex; align-items: center;">
                             <input type="radio" name="order_type" id="order_type_2" value="2" <?= ($order['order_type'] == 2) ? 'checked' : '' ?>> 定制订单
@@ -367,10 +367,16 @@ if (!empty($id) && is_numeric($id)) {
                     </div>
                 </td>
             </tr>
+            <tr>
+                <th width="8%">最新出货单日期</th>
+                <td>
+                    <input type="date" id="order_date" name="order_date" value="<?= substr($order['order_date'], 0, 10) ?>" class="txt1"style="width: 20%; min-width: 200px;"  /> <span style="color: red">注:当前出货最新出货单号日期</span>
+                </td>
+            </tr>
             <tr>
                 <th width="8%">出货日期</th>
                 <td>
-                    <input type="date" id="order_date" name="order_date" value="<?= substr($order['order_date'], 0, 10) ?>" class="txt1" />
+                    <input type="date" id="shipping_date" name="shipping_date" value="<?= substr($order['shipping_date'], 0, 10) ?>" class="txt1"style="width: 20%; min-width: 200px;"  /> <span style="color: red"></span>
                 </td>
             </tr>
             <tr>

+ 5 - 3
order_save.php

@@ -37,6 +37,7 @@ $customer_id = (int)$_POST['customer_id'];
 $contact_id = !empty($_POST['contact_id']) ? (int)$_POST['contact_id'] : "NULL";
 $employee_id = $_SESSION['employee_id'];
 $order_date = mysqli_real_escape_string($conn, $_POST['order_date']);
+$shipping_date = mysqli_real_escape_string($conn, $_POST['shipping_date']);
 $order_type = (int)$_POST['order_type'];
 
 // 设置已删除字段的默认值
@@ -150,7 +151,8 @@ if ($isedit) {
             customer_id = $customer_id, 
             contact_id = $contact_id, 
             employee_id = $employee_id, 
-            order_date = '$order_date', 
+            order_date = '$order_date',
+            shipping_date = '$shipping_date', 
             delivery_date = $delivery_date, 
             actual_delivery_date = $actual_delivery_date, 
             order_status = $order_status, 
@@ -201,13 +203,13 @@ if ($isedit) {
     // 创建新订单
     $sql = "INSERT INTO orders (
             order_code, order_type, customer_id, contact_id, employee_id, 
-            order_date, delivery_date, actual_delivery_date, 
+            order_date,shipping_date, delivery_date, actual_delivery_date, 
             order_status, payment_status, currency, 
             subtotal, discount_amount, total_amount, 
             notes, internal_notes, created_at, updated_at
         ) VALUES (
             '$order_code', $order_type, $customer_id, $contact_id, $employee_id, 
-            '$order_date', $delivery_date, $actual_delivery_date, 
+            '$order_date','$shipping_date', $delivery_date, $actual_delivery_date, 
             $order_status, $payment_status, '$currency', 
             $subtotal, $discount_amount, $total_amount, 
             '$notes', '$internal_notes', NOW(), NOW()