"Gestion complète des compositions de kits"

This commit is contained in:
2017-10-28 11:22:59 +02:00
parent 45e7968544
commit 76cf51831b
14 changed files with 448 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr" dir="ltr">
<head>
<title>Référentiel Infrastructure Tetalab - {% block title %}How The Fuck{% endblock %}</title>
<title>Tetastock</title>
<meta name="viewport" content="initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="/static/style/style.css" />
@@ -10,8 +10,8 @@
<body>
<div class='main_wrapper'>
<div class='center'>
<div class='banner' title='Référentiel infrastrusture Tetalab'>
Référentiel Infrastructure Tetalab
<div class='banner' title='Tetastock'>
Tetastock
</div>
<div class='top_menu'>
<span class='top_menu_item' onclick='javascript:document.location="/";'>Retour</span>

View File

@@ -1,4 +1,7 @@
{% extends "index.html" %}
{% block bodyheader %}
<body onload="update_kit_composition({{ kit.id }});">
{% endblock %}
{% block title %}Éditer un kit{% endblock %}
{% block top_menu %}
<span class='top_menu_item' onclick='javascript:document.location="/providers";'>Gérer les kits</span>
@@ -44,4 +47,8 @@
value='{{ kit.designation }}' />
</div>
</div>
<div id='kit_composition' class='main_block'>
</div>
{% endblock %}

View File

@@ -0,0 +1,67 @@
<div class='main_block border_bottom'>
<text style='margin-top: 10px;'>Nombre maximum de kits: {{ max_kit }}</text>
<text style='margin-top: 10px;'>Composition:</text>
<div class='row_block border_bottom'>
<label style='width: 200px;'>Référence</label>
<label class='border_left' style='width: 499px;'>Désignation</label>
<label class='border_left' style='width: 99px;'>Quantité</label>
<label class='border_left' style='width: 99px;'>Disponible</label>
<label class='border_left' style='width: 99px;' style='cursor: default;'>Action</label>
</div>
{% set row_class = cycler('odd', 'even') %}
{% for componant in kit_composition %}
{% set qclass='' %}
{% if componant.needed > componant.quantity %}
{% set qclass='red' %}
{% endif %}
<div class='row_block {{ row_class.next() }}'>
<text style='width: 190px;'>{{ componant.reference }}</text>
<text class='border_left' style='width: 489px;'>{{ componant.designation }}</text>
<text class='num border_left {{ qclass }}' style='width: 89px;'>{{ componant.needed }}</text>
<text class='num border_right border_left {{ qclass }}' style='width: 89px;'>{{ componant.quantity }}</text>
<div class='action_bar_block border_left' style='width: 89px;'>
<input
type='image'
src='/static/images/edit.png'
title='Éditer'
onclick='javascript:edit_kit_composition({{ kit_id }}, {{ componant.id }});'/>
<input
type='image'
src='/static/images/trash.png'
title='Supprimer'
onclick='javascript:confirm_componant_remove("{{ componant.designation }}")?document.location="/kits/remove/{{ kit_id }}/{{ componant.id }}":false;'/>
</div>
</div>
{% endfor %}
</div>
<div class='main_block'>
<text style='margin-top: 10px;'>Ajouter un composant:</text>
<div class='input_block'>
<label>Référence</label>
<input
id='reference'
type='text'
onkeyup='javascript:search_kit_componants_by_reference(this, {{ kit_id }});'
maxlength='20'
title='Référence interne unique (max. 20)'
placeholder='Référence interne unique (max. 20)'
value='{{ reference }}' />
</div>
<div class='input_block'>
<label>Désignation</label>
<input
id='designation'
type='text'
onkeyup='javascript:search_kit_componants_by_designation(this, {{ kit_id }});'
maxlength='50'
title='Désignation (max. 50)'
placeholder='Désignation (max. 50)'
value='{{ designation }}' />
</div>
</div>
<!-- ----------------------------------------------------
Resultat
----------------------------------------------------- -->
<div id='result_container' class='main_block'>
</div>

View File

@@ -2,7 +2,7 @@
{% block bodyheader %}
<body onload="javascript:update_kits();">
{% endblock %}
{% block title %}Liste des fournisseurs{% endblock %}
{% block title %}Liste des Kits{% endblock %}
{% block top_menu %}
<span class='top_menu_item_selected' onclick='javascript:document.location="/kits";'>Gérer les kits</span>
{% endblock %}

View File

@@ -1,5 +1,5 @@
<div class='main_block'>
<text>Résultat:
<text style='margin-top: 10px;'>Résultat:
{% set ss='' %}
{% if row_count > 1 %}
{% set ss='s' %}

View File

@@ -0,0 +1,26 @@
<div class='main_block'>
<text style='margin-top: 10px;'>Résultat:</text>
<div class='row_block border_bottom'>
<label style='width: 200px;'>Référence</label>
<label class='border_left' style='width: 449px;'>Désignation</label>
<label class='border_left' style='width: 99px;'>Quantité</label>
<label class='border_left' style='width: 149px;'>Emplacement</label>
<label class='border_left' style='width: 99px; cursor: default;'>Action</label>
</div>
{% set row_class = cycler('odd', 'even') %}
{% for componant in componants %}
<div class='row_block {{ row_class.next() }}'>
<text style='width: 190px;'>{{ componant.reference }}</text>
<text class='border_left' style='width: 439px;'>{{ componant.designation }}</text>
<text class='num border_left' style='width: 89px;'>{{ componant.quantity }}</text>
<text class='num border_right border_left' style='width: 139px;'>{{ componant.place }}</text>
<div class='action_bar_block border_left' style='width: 89px;'>
<input
type='image'
src='/static/images/add.png'
title='Ajouter au kit'
onclick='javascript:add_kit_componant({{ kit_id }}, {{ componant.id }});'/>
</div>
</div>
{% endfor %}
</div>

View File

@@ -1,5 +1,5 @@
<div class='main_block'>
<text>Résultat:
<text style='margin-top: 10px;'>Résultat:
{% set ss='' %}
{% if row_count > 1 %}
{% set ss='s' %}