]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-272] скролл к столу, min к намбер origin/feautre-smirnov_erp-272_shorten_table_min_value
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 15 Jan 2025 14:35:00 +0000 (17:35 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 15 Jan 2025 14:35:00 +0000 (17:35 +0300)
erp24/views/sales-write-offs-plan/index.php

index 76cca00af7a10eca2d70e333325cb7ce80153325..3cc7603d4f190f30596f3222c0fdb7a21081893a 100644 (file)
@@ -17,6 +17,12 @@ use yii_app\records\SalesWriteOffsPlan;
 
 $this->registerJsFile('/js/sales-write-offs-plan/index.js', ['position' => \yii\web\View::POS_END]);
 
+$this->registerCss('
+input[type=number], [name=total_sales_plan] {
+  max-width: 100px;
+}
+');
+
 function colorScheme1($p) {
     $p = round(100 * $p);
     if ($p <= 90) { return 'red'; }
@@ -53,6 +59,7 @@ function colorScheme2($p) {
 
     <?php ActiveForm::end() ?>
 
+    <div class="table-responsive">
     <table id="storePlans">
         <thead>
             <tr><th rowspan="3" class="text-center align-middle border">Магазины</th><th colspan="4" class="text-center border">Total</th><th colspan="2" class="text-center border">Оффлайн торговля</th><th colspan="4" class="text-center border">Онлайн торговля</th></tr>
@@ -80,32 +87,32 @@ function colorScheme2($p) {
                 ?>
                 <tr>
                     <td><?= $store->name ?><?= Html::hiddenInput('store_id', $store->id) ?></td>
-                    <td><?= Html::textInput('total_sales_plan', $total_sales_plan, ['type' => 'number', 'readonly' => true]) ?></td>
+                    <td><?= Html::textInput('total_sales_plan', $total_sales_plan, ['readonly' => true, 'style' => 'background: lightgray;']) ?></td>
                     <td>
                         <?= Html::hiddenInput('total_sales_fact', $total_sales_fact) ?>
                         <span style="color:<?= colorScheme1($p1) ?>">
                             <?= number_format(round($p1 * 100), 0, '.', ' ') ?>
                         </span>%
                     </td>
-                    <td><?= Html::textInput('write_offs_plan', $write_offs_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+                    <td><?= Html::textInput('write_offs_plan', $write_offs_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
                     <td>
                         <span style="color:<?= colorScheme2($p2) ?>">
                             <?= number_format(round($p2 * 100), 1, '.', ' ') ?>
                         </span>%
                     </td>
-                    <td><?= Html::textInput('offline_sales_plan', $offline_sales_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+                    <td><?= Html::textInput('offline_sales_plan', $offline_sales_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
                     <td>
                         <span style="color:<?= colorScheme1($p3) ?>">
                             <?= number_format(round($p3 * 100), 0, '.', ' ') ?>
                         </span>%
                     </td>
-                    <td><?= Html::textInput('online_sales_shop_plan', $online_sales_shop_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+                    <td><?= Html::textInput('online_sales_shop_plan', $online_sales_shop_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
                     <td>
                         <span style="color:<?= colorScheme1($p4) ?>">
                             <?= number_format(round($p4 * 100), 0, '.', ' ') ?>
                         </span>%
                     </td>
-                    <td><?= Html::textInput('online_sales_marketplace_plan', $online_sales_marketplace_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+                    <td><?= Html::textInput('online_sales_marketplace_plan', $online_sales_marketplace_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
                     <td>
                         <span style="color:<?= colorScheme1($p5) ?>">
                             <?= number_format(round($p5 * 100), 0, '.', ' ') ?>
@@ -115,4 +122,5 @@ function colorScheme2($p) {
             <?php endforeach; ?>
         </tbody>
     </table>
+    </div>
 </div>