<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>交货确认与验收</title>
  <link rel="stylesheet" href="./semantic.min.css">
</head>
<body>
  <div class="ui container">
    <h1 class="ui dividing header">交货确认与验收</h1>
<pre><code>&lt;form class=&quot;ui form&quot;&gt;
  &lt;div class=&quot;field&quot;&gt;
    &lt;label&gt;配送单号&lt;/label&gt;
    &lt;input type=&quot;text&quot; placeholder=&quot;请输入配送单号&quot;&gt;
  &lt;/div&gt;

  &lt;div class=&quot;field&quot;&gt;
    &lt;label&gt;交货日期&lt;/label&gt;
    &lt;input type=&quot;date&quot; placeholder=&quot;请选择交货日期&quot;&gt;
  &lt;/div&gt;

  &lt;div class=&quot;field&quot;&gt;
    &lt;label&gt;接收人&lt;/label&gt;
    &lt;input type=&quot;text&quot; placeholder=&quot;请输入接收人姓名&quot;&gt;
  &lt;/div&gt;

  &lt;div class=&quot;field&quot;&gt;
    &lt;label&gt;验收结果&lt;/label&gt;
    &lt;select class=&quot;ui dropdown&quot;&gt;
      &lt;option value=&quot;&quot;&gt;请选择验收结果&lt;/option&gt;
      &lt;option value=&quot;pass&quot;&gt;合格&lt;/option&gt;
      &lt;option value=&quot;fail&quot;&gt;不合格&lt;/option&gt;
    &lt;/select&gt;
  &lt;/div&gt;

  &lt;div class=&quot;field&quot;&gt;
    &lt;label&gt;备注&lt;/label&gt;
    &lt;textarea rows=&quot;3&quot; placeholder=&quot;请输入备注&quot;&gt;&lt;/textarea&gt;
  &lt;/div&gt;

  &lt;button class=&quot;ui primary button&quot; type=&quot;submit&quot;&gt;确认验收&lt;/button&gt;
&lt;/form&gt;

&lt;div id=&quot;deliveryTasks&quot; style=&quot;margin-top: 2rem;&quot;&gt;
  &lt;h2 class=&quot;ui dividing header&quot;&gt;待确认验收任务&lt;/h2&gt;
  &lt;table class=&quot;ui celled table&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;配送单号&lt;/th&gt;
        &lt;th&gt;交货日期&lt;/th&gt;
        &lt;th&gt;接收人&lt;/th&gt;
        &lt;th&gt;操作&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;001&lt;/td&gt;
        &lt;td&gt;2022-01-01&lt;/td&gt;
        &lt;td&gt;张三&lt;/td&gt;
        &lt;td&gt;&lt;button class=&quot;ui primary button&quot;&gt;验收&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;002&lt;/td&gt;
        &lt;td&gt;2022-01-02&lt;/td&gt;
        &lt;td&gt;李四&lt;/td&gt;
        &lt;td&gt;&lt;button class=&quot;ui primary button&quot;&gt;验收&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;!-- 其他待确认验收的配送任务行 --&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;

&lt;div id=&quot;acceptedTasks&quot; style=&quot;display: none; margin-top: 2rem;&quot;&gt;
  &lt;h2 class=&quot;ui dividing header&quot;&gt;已验收任务&lt;/h2&gt;
  &lt;table class=&quot;ui celled table&quot; id=&quot;acceptedTasksTable&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;配送单号&lt;/th&gt;
        &lt;th&gt;交货日期&lt;/th&gt;
        &lt;th&gt;接收人&lt;/th&gt;
        &lt;th&gt;备注&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;!-- 已验收任务行 --&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
</code></pre>
  </div>
  <script src="./jquery.min.js"></script>
  <script src="./semantic.min.js"></script>
  <script>
    $(document).ready(function() {
      $('.ui.dropdown').dropdown();

      const form = document.querySelector('.ui.form');
      const confirmBtn = form.querySelector('.ui.primary.button');
      const deliveryTasksTable = document.querySelector('#deliveryTasks table');

      confirmBtn.addEventListener('click', function(event) {
        event.preventDefault();

        const deliveryNo = form.querySelector('input[type="text"]').value;

        if (!deliveryNo) {
          return;
        }

        // 执行验收操作,根据配送单号进行相应的处理

        // 示例:将待确认验收的配送任务移动到已验收的配送任务列表中
        const taskRow = deliveryTasksTable.querySelector(`tbody tr td:first-child:contains('${deliveryNo}')`).parentNode;
        const acceptedTasksTable = document.getElementById('acceptedTasksTable');
        acceptedTasksTable.querySelector('tbody').appendChild(taskRow.cloneNode(true));
        taskRow.parentNode.removeChild(taskRow);

        form.reset();
      });
    });
  </script>
</body>
</html>
食材供应链配送实时监管系统:交货确认与验收功能

原文地址: https://www.cveoy.top/t/topic/PjN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录