templates/shipping.html.twig line 1

Open in your IDE?
  1. {% set sub_title = "出荷手配依頼" %}
  2. {% extends 'inc/layout.html.twig' %}
  3. {% block header %}
  4. <section class="fixedHeader">
  5.   <header class="header" role="banner">
  6.     <div class="header-block">
  7.       <h1 class="header-title"><img src="img/icon/delivery.png" alt="">出荷手配依頼</h1>
  8.       <div class="header-refine">
  9.         <div class="header-refine-ctrl">
  10.         <!--
  11.           <input type="text" name="" value="{{ today }}" class="header-refine-input" readonly>
  12.         -->
  13.           <div class="js-flatpickr">
  14.             <div class="header-refine-ctrl">
  15.             <form action="" method="post">
  16.               <input type="text" name="today" value="{{ today }}" class="header-refine-input -changeable" readonly data-input onchange="this.form.submit()">
  17.             </form>
  18.             </div>
  19.           </div>
  20.         </div>
  21.       </div>
  22.     </div>
  23.     <div class="header-sub">
  24.       <p class="header-back"><a href="./">ダッシュボードへ</a></p>
  25.     </div>
  26.   </header>
  27.   <section class="upperSection">
  28.     <form method="post" id="search-form">
  29.       <input type="hidden" name="search_shipment_id" value="" >
  30.       <input type="hidden" name="search_keyword" value="" >
  31.       <input type="hidden" name="search_okinawa_flg" value="" >
  32.       <input type="hidden" name="search_category_key" value="" >
  33.       <input type="hidden" name="today" value="{{ today }}" >
  34.     </form>
  35.     <ul class="upperSection-link">
  36.       {% for shipment_id, shipment in shipment_list %}
  37.       {% if shipment_count[shipment_id] > 0 %}
  38.       <li><a href="#" data-shipping-id="{{ shipment_id }}" {% if search["shipment_id"] == shipment_id %} class="is-active" {% endif %}>{{ shipment_id }}</a></li>
  39.       {% endif %}
  40.       {% endfor %}
  41.     </ul>
  42.     <div class="upperSection-container">
  43.       <div class="upperSection-search">
  44.         <div class="upperSection-search-keyword">
  45.           <form>
  46.             <div class="upperSection-search-box">
  47.               <input type="search" name="keyword" value="{{ search["keyword"] }}" placeholder="キーワード検索" class="upperSection-search-input">
  48.             </div>
  49.             <div class="upperSection-search-check">
  50.             <label for="check-okinawa-flg-0">
  51.             <input type="radio" id="check-okinawa-flg-0" name="okinawa_flg" value="0" {% if search["okinawa_flg"] == "0" or  search["okinawa_flg"] == "" %} checked {% endif %}>全体合計
  52.             </label> 
  53.             <label for="check-okinawa-flg-2">
  54.             <input type="radio" id="check-okinawa-flg-2" name="okinawa_flg" value="2" {% if search["okinawa_flg"] == "1" %} checked {% endif %}>沖縄除く合計
  55.             </label> 
  56.             <label for="check-okinawa-flg-1">
  57.             <input type="radio" id="check-okinawa-flg-1" name="okinawa_flg" value="1" {% if search["okinawa_flg"] == "1" %} checked {% endif %}>沖縄のみ
  58.             </label> 
  59.             </div>
  60.             <button type="button" class="upperSection-search-submit" id="btn-search">検索</button>
  61.           </form>
  62.         </div>
  63.         <div class="upperSection-search-cat">
  64.           <select name="category" class="upperSection-search-select" id="select-search-category">
  65.             <option value="">▼カテゴリー</option>
  66.             {% for key, value in top_categories %}
  67.             <option value="{{ key }}" {% if search["category_key"] == key %}selected{% endif %}>{{ key }}</option>
  68.             {% endfor %}
  69.           </select>
  70.         </div>
  71.       </div>
  72.       <div class="upperSection-sub">
  73.         <ul class="upperSection-anchor">
  74.         {% for delivery_id, delivery in delivery_list %}
  75.           <li><a href="#anchor-{{ delivery_id }}">{{ delivery }}</a></li>
  76.         {% endfor %}
  77.         </ul>
  78.       </div>
  79.     </div>
  80.   </section>
  81. </section>
  82. {% endblock %}
  83. {% block main %}
  84. <main class="contents" role="main">
  85. <div style="overflow: auto;height: calc(100svh - 180px);">
  86. {% for shipment_id, shipment in shipment_list %}
  87. <section class="shipping" id="shipping-{{ shipment_id }}" data-shipping-id="{{ shipment_id}}" style="display:none;">
  88.   {% for delivery_id, delivery in delivery_list %}
  89.     {% if items[shipment_id][delivery] is defined %}
  90.     <section class="shipping-section" id="anchor-{{ delivery_id }}" data-shipment="{{ shipment }}" data-delivery="{{ delivery }}">
  91.     <h2 class="shipping-heading">{{ delivery }}</h2>
  92.     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="shipping-table">
  93.       <tbody>
  94.         {% for item_code, item in items[shipment_id][delivery] %}
  95.         {% if loop.index % 2 != 0 %}
  96.         <tr>
  97.         {% endif %}
  98.           <th scope="row">{{ item.name }}</th>
  99.           <td>
  100.             <div class="switch-checkbox">
  101.                 <input type="checkbox" value="1" data-key="{{ item.item_key }}" {% if item.checked %} checked {% endif %}>
  102.             </div>
  103.           </td>
  104.           <td>
  105.           <span class="total_qty">{{ item.qty }}</span>
  106.           <span class="okinawa_qty" style="display:none">{{ item.okinawa_qty }}</span>
  107.           <span class="not_okinawa_qty" style="display:none">{{ (item.qty - item.okinawa_qty) }}</span>
  108.           </td>
  109.         {% if loop.index % 2 == 0 %}
  110.         </tr>
  111.         {% endif %}
  112.         {% endfor %}
  113.         {% if (items[shipment_id][delivery]|length) % 2 != 0 %}
  114.         <th scope="row"></th><td></td>
  115.         </tr>
  116.         {% endif %}
  117.       </tbody>
  118.     </table>
  119.     </section>
  120.     {% endif %}
  121.   {% endfor %}
  122. </section>
  123. {% endfor %}
  124. {#
  125. <form action='{{ url('shipping_set_complete') }}' method="post">
  126. <input type="text" name="date" value="{{today}}">
  127. <input type="text" name="checked" value="1">
  128. <input type="text" name="key" value="1-西濃運輸-002-000000-29">
  129. <button>submit</button>
  130. </form>
  131. #}
  132. </div>
  133. </main>
  134. {% endblock %}
  135. {# スタイルシートの設定 #}
  136. {% block stylesheet %}
  137. <link rel="stylesheet" href="common/css/reset.css">
  138. <link rel="stylesheet" href="common/css/common.css">
  139. <link rel="stylesheet" href="common/css/contents.css">
  140. <link rel="stylesheet" href="common/css/flatpickr.min.css">
  141. <style>
  142. .shipping-table th:has(+ td >.switch-checkbox input:checked),
  143. .shipping-table td:has(.switch-checkbox input:checked),
  144. .shipping-table td:has(.switch-checkbox input:checked) + td
  145. {
  146.   background: #e4f0fb;
  147. }
  148. .switch-checkbox input[type=checkbox] {
  149.   position: relative;
  150.   cursor: pointer;
  151.   width: 4.5rem;
  152.   height: 2.1rem;
  153.   border-radius: 5px;
  154.   background-color: #aaa;
  155.   -webkit-appearance: none;
  156.   -moz-appearance: none;
  157.   appearance: none;
  158.   vertical-align: middle;
  159.   transition: .5s;
  160.   padding: 0.1em;
  161. }
  162. .switch-checkbox input[type=checkbox]:checked {
  163.   color: white;
  164. }
  165. .switch-checkbox input[type=checkbox]::before {
  166.   position: absolute;
  167.   top: 50%;
  168.   left: 2rem;
  169.   transform: translateY(-50%);
  170.   width: 2.6rem;
  171.   padding: 0.2rem 0rem;
  172.   background-color: #ddd;
  173.   text-align: center;
  174.   content: '未';
  175.   transition: .5s;
  176.   border-radius: 5px;
  177.   font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "游ゴシック Medium", "Yu Gothic Medium", 游ゴシック体, YuGothic, 游ゴシック, "Yu Gothic", sans-serif;
  178.   font-weight: 600;
  179. }
  180. .switch-checkbox input[type=checkbox]:checked::before {
  181.   background-color: #1b69b6;
  182.   left: 0rem;
  183.   content: '済';
  184. }
  185. </style>
  186. {% endblock %}
  187. {# JavaScriptの設定 #}
  188. {% block javascript %}
  189. <script src="common/js/jquery.js"></script>
  190. <script src="common/js/common.js"></script>
  191. <script src="common/js/utility.js"></script>
  192. <script src="common/js/page_shipping.js?v=1.01"></script>
  193. <script src="common/js/flatpickr.js"></script>
  194. <script>
  195. // 商品データをjsonでセットしておく
  196. const item_list = JSON.parse('{{ json_items|raw }}');
  197. //カテゴリをjsonでセットしておく
  198. const categories = JSON.parse('{{ json_top_categories|raw }}');
  199. const complete_url = '{{ url('shipping_set_complete') }}';
  200. const config = {
  201.   enableTime: false,
  202.   // mode: "range",
  203.   showMonths: 2,
  204.   // minDate: "today",
  205.   wrap: true,
  206.   locale: "ja",
  207.   dateFormat: "Y-m-d",
  208. }
  209. flatpickr('.js-flatpickr', config);
  210. </script>
  211. {% endblock %}