This commit is contained in:
2025-02-18 16:30:26 +07:00
parent 66344ad5c6
commit dbeda7da6d
20 changed files with 655 additions and 599 deletions

View File

@@ -1,6 +1,5 @@
<div class="w-[100%]">
<div
class="m-[15px_0_15px_15px] px-[15px] py-[20px] rounded-[15px] bg-white shadow-[0_1px_1px_0_rgba(0,0,0,0.1)] overflow-x-auto">
<div class="m-[15px_0_15px_15px] px-[15px] py-[20px] rounded-[15px] bg-white shadow-[0_1px_1px_0_rgba(0,0,0,0.1)]">
<h1 class="text-2xl font-[700] mb-3">Danh sách sản phẩm ({{ page.total | format_number }})</h1>
<div class="flex flex-wrap justify-between items-center mt-[20px]">
<div class="btn-left flex items-center mb-[15px]">
@@ -32,165 +31,168 @@
</a>
</div>
</div>
<table class="w-[100%] mt-[20px] table">
<thead class="bg-[#f6f6f6] text-[#000] text-[14px]">
<tr>
<th class="whitespace-nowrap">STT</th>
<th>Ảnh</th>
<th class="text-left">Sản phẩm (Tổng số: {{page.total}})</th>
<th class="whitespace-nowrap text-left w-[350px]">Thông tin bán hàng</th>
<th class="w-[200px]">
<select id=""
class="block w-[230px] h-[32px] px-[5px] bg-white border-[1px] border-[#D8D8D8] font-[400] h-[30px] mt-[5px] rounded-[4px] shadow-[0_2px_4px_0_#0000001F]"
onchange="location.href=this.value">
<option value="/admin/product?">Lọc sản phẩm</option>
<option value="/admin/product?hotType=new">Mới</option>
<option value="/admin/product?hotType=hot">HOT (hỏi nhiều)</option>
<option value="/admin/product?hotType=bestsale">Bán chạy</option>
<option value="/admin/product?hotType=saleoff">Xả hàng (sale-off)</option>
<option value="/admin/product?hotType=online-only">Chỉ bán online</option>
</select>
</th>
<th class="text-left ">Công cụ</th>
</tr>
</thead>
<tbody>
{% assign counter = 0 %}
{% for item in page.item_list %}
{% increment counter %}
<tr>
<td>{{ counter }}</td>
<td>
<img class="block mx-auto my-0 w-[70px] h-[50px]" src="{{item.image.thumb}}" alt="">
<span class="text-center block">{{item.image_count}} ảnh</span>
</td>
<td>
<a href="/admin/product/form?id={{item.id}}">[#{{item.id}}]
<span class="text-[#0041E8]">-
{{item.title}}</span>
</a>
{% if item.config_count > 0 %}<p class="text-[#FFC700] text-[12px]">[Có cấu hình]</p>{% endif %}
<div class="flex items-center my-[5px]">
<span>Danh mục:</span>
<b class="mx-[10px]">Màn hình Máy tính</b>
</div>
<div class="flex items-center my-[5px]">
<span>Mã kho</span>
<b class="px-[5px]">{{item.sku}}</b>
<span class="text-[#000] font-[500]">|</span>
<span class="px-[5px]">Hãng</span>
<p class="text-[#0041E8]">{{item.model}}</p>
</div>
<div class="overflow-x-auto">
<table class="w-[100%] mt-[20px] table">
<thead class="bg-[#f6f6f6] text-[#000] text-[14px]">
<tr>
<th class="whitespace-nowrap">STT</th>
<th>Ảnh</th>
<th class="text-left">Sản phẩm (Tổng số: {{page.total}})</th>
<th class="whitespace-nowrap text-left w-[350px]">Thông tin bán hàng</th>
<th class="w-[200px]">
<select id=""
class="block w-[230px] h-[32px] px-[5px] bg-white border-[1px] border-[#D8D8D8] font-[400] h-[30px] mt-[5px] rounded-[4px] shadow-[0_2px_4px_0_#0000001F]"
onchange="location.href=this.value">
<option value="/admin/product?">Lọc sản phẩm</option>
<option value="/admin/product?hotType=new">Mới</option>
<option value="/admin/product?hotType=hot">HOT (hỏi nhiều)</option>
<option value="/admin/product?hotType=bestsale">Bán chạy</option>
<option value="/admin/product?hotType=saleoff">Xả hàng (sale-off)</option>
<option value="/admin/product?hotType=online-only">Chỉ bán online</option>
</select>
</th>
<th class="text-left ">Công cụ</th>
</tr>
</thead>
<tbody>
{% assign counter = 0 %}
{% for item in page.item_list %}
{% increment counter %}
<tr>
<td>{{ counter }}</td>
<td>
<img class="block mx-auto my-0 w-[70px] h-[50px]" src="{{item.image.thumb}}" alt="">
<span class="text-center block">{{item.image_count}} ảnh</span>
</td>
<td>
<a href="/admin/product/form?id={{item.id}}">[#{{item.id}}]
<span class="text-[#0041E8]">-
{{item.title}}</span>
</a>
{% if item.config_count > 0 %}<p class="text-[#FFC700] text-[12px]">[Có cấu hình]</p>{%
endif %}
<div class="flex items-center my-[5px]">
<span>Danh mục:</span>
<b class="mx-[10px]">Màn hình Máy tính</b>
</div>
<div class="flex items-center my-[5px]">
<span>Mã kho</span>
<b class="px-[5px]">{{item.sku}}</b>
<span class="text-[#000] font-[500]">|</span>
<span class="px-[5px]">Hãng</span>
<p class="text-[#0041E8]">{{item.model}}</p>
</div>
{% assign date_now = "now" | date: format %}
{% assign date_last = item.last_update %}
{% assign time_conlai = date_now | minus: date_last %}
{% assign date_now = "now" | date: format %}
{% assign date_last = item.last_update %}
{% assign time_conlai = date_now | minus: date_last %}
<p class="mb-[7px]">Cập nhật: {{item.last_update | date: "Y-m-d h:i" }} <span
class="text-[#E00000]">(
{{ time_conlai | divided_by: 86400 | round}}
ngày)</span></p>
<p>Người cập nhật : {{item.last_update_by}}</p>
</td>
<td>
<div class="flex flex-wrap items-center mb-[1px]">
<span class="">Giá bán:</span>
<b class="text-[#E00000] ml-[3px] whitespace-nowrap">
{% if item.price > 0 %}
{{item.price | format_price }} vnd
<p class="mb-[7px]">Cập nhật: {{item.last_update | date: "Y-m-d h:i" }} <span
class="text-[#E00000]">(
{{ time_conlai | divided_by: 86400 | round}}
ngày)</span></p>
<p>Người cập nhật : {{item.last_update_by}}</p>
</td>
<td>
<div class="flex flex-wrap items-center mb-[1px]">
<span class="">Giá bán:</span>
<b class="text-[#E00000] ml-[3px] whitespace-nowrap">
{% if item.price > 0 %}
{{item.price | format_price }} vnd
{% else %}
{{item.price }} vnd
{% endif %}
</b>
</div>
<div class="flex items-center mb-[1px]">
<span class="whitespace-nowrap">Giá thị trường:</span>
<b class="text-[#E00000] ml-[3px] whitespace-nowrap">
{% if item.market_price > 0 %} {{item.market_price | format_price }} vnd {% else %}
0 vnd {% endif %}
</b>
</div>
<p>Bảo hành: {{item.warranty}}</p>
<p>Khuyến mại: {{item.special_offer}}</p>
<div class="flex items-center">
<span>SL tổng:</span>
<b class="ml-[3px]">{{item.quantity}}</b>
</div>
</td>
<td class="align-text-top">
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="new" {% if item.hot_type=="new" %}checked="checked" {%
endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px] whitespace-nowrap">Mới Hot (Hỏi nhiều)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="hot" {% if item.hot_type=="hot" %}checked="checked" {%
endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px] whitespace-nowrap">Hot (Hỏi nhiều)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="bestsale" {% if item.hot_type=="bestsale"
%}checked="checked" {% endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px] whitespace-nowrap">Bán
chạy</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="saleoff" {% if item.hot_type=="saleoff" %}checked="checked"
{% endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px] whitespace-nowrap">Xả
hàng (sale-off)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="online-only" {% if item.hot_type=="online-only"
%}checked="checked" {% endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px] whitespace-nowrap">Chỉ bán online</span>
</label>
<div id="js-status-hottype-{{item.id}}" class="flex items-center mt-[5px]"></div>
</td>
<td class="align-text-top">
<div class="list-btn flex items-center w-[150px]">
<a href="/admin/product/form?id={{item.id}}" title="Form sản phẩm"
class="w-[32px] h-[32px] border-[1px] border-[#0041e8] rounded-[4px] text-center leading-[32px] flex items-center justify-center mr-[5px]">
<i class="icons icon-edit"></i>
</a>
<a href="{{item.request_path}}" title="Xem tại web" target="_blank"
class="w-[32px] h-[32px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-view"></i>
</a>
{% if item.status == 0 %}
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="fa-regular fa-eye-slash text-[#9E9E9E]"></i>
</a>
{% else %}
{{item.price }} vnd
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px] bg-white">
<i class="fa-regular fa-eye text-[#0041E8]"></i>
</a>
{% endif %}
</b>
</div>
<div class="flex items-center mb-[1px]">
<span class="whitespace-nowrap">Giá thị trường:</span>
<b class="text-[#E00000] ml-[3px] whitespace-nowrap">
{% if item.market_price > 0 %} {{item.market_price | format_price }} vnd {% else %}
0 vnd {% endif %}
</b>
</div>
<p>Bảo hành: {{item.warranty}}</p>
<p>Khuyến mại: {{item.special_offer}}</p>
<div class="flex items-center">
<span>SL tổng:</span>
<b class="ml-[3px]">{{item.quantity}}</b>
</div>
</td>
<td class="align-text-top">
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-delete"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="new" {% if item.hot_type=="new" %}checked="checked" {% endif %}
class="checkbox checkbox-success" />
<span class="label-text ml-[5px]">Mới Hot (Hỏi nhiều)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="hot" {% if item.hot_type=="hot" %}checked="checked" {% endif %}
class="checkbox checkbox-success" />
<span class="label-text ml-[5px]">Hot (Hỏi nhiều)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="bestsale" {% if item.hot_type=="bestsale" %}checked="checked"
{% endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px]">Bán
chạy</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="saleoff" {% if item.hot_type=="saleoff" %}checked="checked" {%
endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px]">Xả
hàng (sale-off)</span>
</label>
<label class="cursor-pointer flex items-center mb-[7px]"
onclick="AdminFunction.update_product_hot({{item.id}})">
<input type="checkbox" name="online-only" {% if item.hot_type=="online-only"
%}checked="checked" {% endif %} class="checkbox checkbox-success" />
<span class="label-text ml-[5px]">Chỉ bán online</span>
</label>
<div id="js-status-hottype-{{item.id}}" class="flex items-center mt-[5px]"></div>
</td>
<td class="align-text-top">
<div class="list-btn flex items-center w-[150px]">
<a href="/admin/product/form?id={{item.id}}" title="Form sản phẩm"
class="w-[32px] h-[32px] border-[1px] border-[#0041e8] rounded-[4px] text-center leading-[32px] flex items-center justify-center mr-[5px]">
<i class="icons icon-edit"></i>
</a>
<a href="{{item.request_path}}" title="Xem tại web" target="_blank"
class="w-[32px] h-[32px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-view"></i>
</a>
{% if item.status == 0 %}
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="fa-regular fa-eye-slash text-[#9E9E9E]"></i>
</a>
{% else %}
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px] bg-white">
<i class="fa-regular fa-eye text-[#0041E8]"></i>
</a>
{% endif %}
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-delete"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</tbody>
</table>
</div>
<div class="paging">
{% for paging in page.pagination.collection %}