]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-5 Доработать фактический план по сотрудникам
authorMarina Zozirova <marina.zozirova@erp-flowers.ru>
Thu, 13 Jun 2024 11:32:36 +0000 (11:32 +0000)
committerAleksey Filippov <aleksey.filippov@erp-flowers.ru>
Thu, 13 Jun 2024 11:32:36 +0000 (11:32 +0000)
20 files changed:
erp24/actions/timetable/StartShiftStepOneAction.php
erp24/records/AdminCheckin.php
erp24/views/timetable-fact/index.php
erp24/views/timetable-fact/view.php
erp24/views/timetable/start_shift_step_one.php
erp24/web/images/Bell.png [new file with mode: 0644]
erp24/web/images/Bell.svg [new file with mode: 0644]
erp24/web/images/close.png [new file with mode: 0644]
erp24/web/images/components.png [new file with mode: 0644]
erp24/web/images/flower-closure.png [new file with mode: 0644]
erp24/web/images/icon-time.png [new file with mode: 0644]
erp24/web/images/icon-time.svg [new file with mode: 0644]
erp24/web/images/left-arrow.png [new file with mode: 0644]
erp24/web/images/left-arrow.svg [new file with mode: 0644]
erp24/web/images/loading.gif [new file with mode: 0644]
erp24/web/images/next.png [new file with mode: 0644]
erp24/web/images/opening-flower.jpg [new file with mode: 0644]
erp24/web/images/prev.png [new file with mode: 0644]
erp24/web/images/smile.jpg [new file with mode: 0644]
erp24/web/images/smile.png [new file with mode: 0644]

index 26ed5bee4178d10afeef335a548f0e82f3bfc023..116156ea4bdba7e3fa3dfce96acc66ebf417bd47 100755 (executable)
@@ -3,6 +3,7 @@ declare(strict_types=1);
 
 namespace yii_app\actions\timetable;
 
+use app\records\TimetableFactModel;
 use yii\base\Action;
 use yii\helpers\ArrayHelper;
 use yii_app\records\Admin;
@@ -49,11 +50,13 @@ class StartShiftStepOneAction extends Action
 
         if ($modelTypeId == AdminCheckin::TYPE_END) {
             $adminStores = CityStore::getNames([$lastCheckin->store_id]);
+            $lastCheckinFact = TimetableFactModel::findOne(['checkin_start_id' => $lastCheckin->id]);
+            $shiftArray = $lastCheckinFact ? ['id' => $lastCheckinFact->shift_id, 'name' => $lastCheckinFact->shift->name] : [];
         } else {
             $adminStores = ArrayHelper::map($userModel->getStores(), 'id', 'name');
+            $shiftArray = ArrayHelper::map(Shift::find()->andWhere(['not in', 'id', [3, 4, 6]])->all(), 'id', 'name');
         }
 
-        $shiftArray = ArrayHelper::map(Shift::find()->all(), 'id', 'name');
 
         return $this->controller->render('/timetable/start_shift_step_one.php', [
             'userModel' => $userModel,
index 8f11e0fe3b770ba3cd7f236c802714d83c406509..1d7b01785609e5bb7ef2df9dcf688aaee9d52edf 100755 (executable)
@@ -90,7 +90,7 @@ class AdminCheckin extends ActiveRecord
             [['lat', 'lon'], 'double'],
             [['comment', 'photo'], 'string'],
             [['date'], 'date', 'format' => 'yyyy-M-d'],
-            [['time'], 'date', 'format' => 'yyyy-M-d HH:mm:ss'],
+//            [['time'], 'date', 'format' => 'yyyy-M-d HH:mm:ss'],
             [['admin_id', 'type_id', 'status', 'date', 'time', 'device_id'], 'required'],
         ];
     }
index d76e5ee84f81a99a37b761fd895c540230fea5ca..11ddd103d40247bec6c35ab8555f9bc5fc150b1f 100644 (file)
@@ -80,7 +80,7 @@ $this->params['breadcrumbs'][] = $this->title;
                 'format' => 'raw',
                 'value' => function ($model) {
                     if (!empty($model->checkin_start_id)) {
-                        return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+                        return !empty($photo = $model->checkinStart->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
                     };
                 },
             ],
@@ -89,7 +89,7 @@ $this->params['breadcrumbs'][] = $this->title;
                 'format' => 'raw',
                 'value' => function ($model) {
                     if (!empty($model->checkin_end_id)) {
-                        return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+                        return !empty($photo = $model->checkinEnd->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
                     };
                 },
             ],
index 22084db99c8c5fd74ad0db5702d6f4de30de7b89..9b15140229bb5cde047935e4f3abe9d8ef3faef3 100644 (file)
@@ -149,7 +149,7 @@ $this->title = "Фактический табель #$model->id";
                 'format' => 'raw',
                 'value' => function ($model) {
                     if (!empty($model->checkin_start_id)) {
-                        return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+                        return !empty($photo = $model->checkinStart->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
                     };
                 },
             ],
@@ -158,7 +158,7 @@ $this->title = "Фактический табель #$model->id";
                 'format' => 'raw',
                 'value' => function ($model) {
                     if (!empty($model->checkin_end_id)) {
-                        return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+                        return !empty($photo = $model->checkinEnd->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
                     };
                 },
             ]
index 598e345a00c21c1a1093dbe34a8e4450f5129456..ad702cfd97779bbd22b504eee06bf128fe5cf02d 100644 (file)
@@ -117,14 +117,23 @@ use yii_app\forms\timetable\StartForm;
 \r
               </div>\r
 \r
-                <div class="col-lg-3">\r
-                    <div class="text-secondary mb-1">Тип смены</div>\r
-                    <?= Html::dropDownList('shift_id', null,  $shiftArray, [\r
-                        'class' => "form-select",\r
-                        'aria-label' => "Пример выбора по умолчанию",\r
-                    ]) ?>\r
-                </div>\r
-              <div class="col-lg-6 d-flex justify-content-end align-items-end">\r
+                    <div class="col-lg-3">\r
+                        <div class="text-secondary mb-1">Тип смены</div>\r
+                        <?php\r
+                        if (empty($lastCheckin->type_id) || $lastCheckin->isEnd() || $userModel->adminGroup->isRoaming()) {\r
+                            echo Html::dropDownList('shift_id', null, $shiftArray, [\r
+                                'class' => "form-select",\r
+                                'aria-label' => "Пример выбора по умолчанию",\r
+                            ]);\r
+                        } else {\r
+                            echo $shiftArray['name'];\r
+                            echo Html::hiddenInput('shift_id', $shiftArray['id']);\r
+                        }\r
+\r
+                        ?>\r
+\r
+                    </div>\r
+                    <div class="col-lg-6 d-flex justify-content-end align-items-end">\r
 \r
                   <?= Html::submitButton($textButton, ['class' => 'btn btn-bd-primary ps-3 pe-3 mt-2']); ?>\r
 \r
diff --git a/erp24/web/images/Bell.png b/erp24/web/images/Bell.png
new file mode 100644 (file)
index 0000000..133f330
Binary files /dev/null and b/erp24/web/images/Bell.png differ
diff --git a/erp24/web/images/Bell.svg b/erp24/web/images/Bell.svg
new file mode 100644 (file)
index 0000000..0f9317c
--- /dev/null
@@ -0,0 +1,3 @@
+<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M29 27V28H11V27L13 25V19C13 15.9 15.03 13.17 18 12.29V12C18 11.4696 18.2107 10.9609 18.5858 10.5858C18.9609 10.2107 19.4696 10 20 10C20.5304 10 21.0391 10.2107 21.4142 10.5858C21.7893 10.9609 22 11.4696 22 12V12.29C24.97 13.17 27 15.9 27 19V25L29 27ZM22 29C22 29.5304 21.7893 30.0391 21.4142 30.4142C21.0391 30.7893 20.5304 31 20 31C19.4696 31 18.9609 30.7893 18.5858 30.4142C18.2107 30.0391 18 29.5304 18 29" fill="#CAC4D0"/>
+</svg>
diff --git a/erp24/web/images/close.png b/erp24/web/images/close.png
new file mode 100644 (file)
index 0000000..20baa1d
Binary files /dev/null and b/erp24/web/images/close.png differ
diff --git a/erp24/web/images/components.png b/erp24/web/images/components.png
new file mode 100644 (file)
index 0000000..c6c30a8
Binary files /dev/null and b/erp24/web/images/components.png differ
diff --git a/erp24/web/images/flower-closure.png b/erp24/web/images/flower-closure.png
new file mode 100644 (file)
index 0000000..b2ee4db
Binary files /dev/null and b/erp24/web/images/flower-closure.png differ
diff --git a/erp24/web/images/icon-time.png b/erp24/web/images/icon-time.png
new file mode 100644 (file)
index 0000000..3351a0f
Binary files /dev/null and b/erp24/web/images/icon-time.png differ
diff --git a/erp24/web/images/icon-time.svg b/erp24/web/images/icon-time.svg
new file mode 100644 (file)
index 0000000..14eef4c
--- /dev/null
@@ -0,0 +1,17 @@
+<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_242_4447)">
+<rect width="14" height="14" fill="white" fill-opacity="0.01"/>
+<g clip-path="url(#clip1_242_4447)">
+<path d="M6.99963 3.06152C6.99963 2.94549 6.95354 2.83421 6.87149 2.75216C6.78945 2.67012 6.67817 2.62402 6.56213 2.62402C6.4461 2.62402 6.33482 2.67012 6.25277 2.75216C6.17073 2.83421 6.12463 2.94549 6.12463 3.06152V7.87402C6.12466 7.95114 6.14507 8.02688 6.18379 8.09357C6.22251 8.16026 6.27817 8.21552 6.34513 8.25377L9.40763 10.0038C9.50813 10.0581 9.62589 10.0709 9.73575 10.0396C9.8456 10.0082 9.93882 9.93513 9.9955 9.83595C10.0522 9.73676 10.0678 9.61934 10.0391 9.50878C10.0103 9.39821 9.93945 9.30328 9.84163 9.24427L6.99963 7.62027V3.06152Z" fill="#6C757D"/>
+<path d="M6.99963 13.999C8.85615 13.999 10.6366 13.2615 11.9494 11.9488C13.2621 10.636 13.9996 8.85554 13.9996 6.99902C13.9996 5.14251 13.2621 3.36203 11.9494 2.04928C10.6366 0.736521 8.85615 -0.000976562 6.99963 -0.000976562C5.14312 -0.000976562 3.36264 0.736521 2.04989 2.04928C0.737132 3.36203 -0.000366211 5.14251 -0.000366211 6.99902C-0.000366211 8.85554 0.737132 10.636 2.04989 11.9488C3.36264 13.2615 5.14312 13.999 6.99963 13.999ZM13.1246 6.99902C13.1246 8.62348 12.4793 10.1814 11.3307 11.3301C10.182 12.4787 8.62409 13.124 6.99963 13.124C5.37518 13.124 3.81727 12.4787 2.6686 11.3301C1.51994 10.1814 0.874634 8.62348 0.874634 6.99902C0.874634 5.37457 1.51994 3.81665 2.6686 2.66799C3.81727 1.51933 5.37518 0.874023 6.99963 0.874023C8.62409 0.874023 10.182 1.51933 11.3307 2.66799C12.4793 3.81665 13.1246 5.37457 13.1246 6.99902Z" fill="#6C757D"/>
+</g>
+</g>
+<defs>
+<clipPath id="clip0_242_4447">
+<rect width="14" height="14" fill="white"/>
+</clipPath>
+<clipPath id="clip1_242_4447">
+<rect width="14" height="14" fill="white"/>
+</clipPath>
+</defs>
+</svg>
diff --git a/erp24/web/images/left-arrow.png b/erp24/web/images/left-arrow.png
new file mode 100644 (file)
index 0000000..0c0aa0b
Binary files /dev/null and b/erp24/web/images/left-arrow.png differ
diff --git a/erp24/web/images/left-arrow.svg b/erp24/web/images/left-arrow.svg
new file mode 100644 (file)
index 0000000..60a16e1
--- /dev/null
@@ -0,0 +1,5 @@
+<svg width="37" height="45" viewBox="0 0 37 45" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="36" y="1" width="43" height="35" rx="9" transform="rotate(90 36 1)" fill="white"/>
+<path d="M21.7191 31.7602L14.2199 23.5788C14.1502 23.5029 14.0949 23.4126 14.0572 23.3133C14.0194 23.214 14 23.1075 14 23C14 22.8925 14.0194 22.786 14.0572 22.6867C14.0949 22.5874 14.1502 22.4971 14.2199 22.4212L21.7191 14.2398C21.8598 14.0862 22.0507 14 22.2497 14C22.4487 14 22.6395 14.0862 22.7802 14.2398C22.9209 14.3933 23 14.6015 23 14.8186C23 15.0357 22.9209 15.2439 22.7802 15.3974L15.8107 23L22.7802 30.6026C22.8499 30.6786 22.9052 30.7688 22.9429 30.8681C22.9806 30.9675 23 31.0739 23 31.1814C23 31.2889 22.9806 31.3953 22.9429 31.4947C22.9052 31.594 22.8499 31.6842 22.7802 31.7602C22.7106 31.8363 22.6278 31.8965 22.5368 31.9377C22.4458 31.9788 22.3482 32 22.2497 32C22.1511 32 22.0536 31.9788 21.9625 31.9377C21.8715 31.8965 21.7888 31.8363 21.7191 31.7602Z" fill="#4E46B4"/>
+<rect x="36" y="1" width="43" height="35" rx="9" transform="rotate(90 36 1)" stroke="#4E46B4" stroke-width="2"/>
+</svg>
diff --git a/erp24/web/images/loading.gif b/erp24/web/images/loading.gif
new file mode 100644 (file)
index 0000000..5087c2a
Binary files /dev/null and b/erp24/web/images/loading.gif differ
diff --git a/erp24/web/images/next.png b/erp24/web/images/next.png
new file mode 100644 (file)
index 0000000..08365ac
Binary files /dev/null and b/erp24/web/images/next.png differ
diff --git a/erp24/web/images/opening-flower.jpg b/erp24/web/images/opening-flower.jpg
new file mode 100644 (file)
index 0000000..1275c98
Binary files /dev/null and b/erp24/web/images/opening-flower.jpg differ
diff --git a/erp24/web/images/prev.png b/erp24/web/images/prev.png
new file mode 100644 (file)
index 0000000..329fa98
Binary files /dev/null and b/erp24/web/images/prev.png differ
diff --git a/erp24/web/images/smile.jpg b/erp24/web/images/smile.jpg
new file mode 100644 (file)
index 0000000..70b4388
Binary files /dev/null and b/erp24/web/images/smile.jpg differ
diff --git a/erp24/web/images/smile.png b/erp24/web/images/smile.png
new file mode 100644 (file)
index 0000000..c5b3260
Binary files /dev/null and b/erp24/web/images/smile.png differ