use yii_app\records\Products1c;
use yii_app\records\ProductsClass;
use yii_app\records\Sales;
+use yii_app\records\StoreStaffing;
use yii_app\records\StoreVisitors;
use yii_app\records\WriteOffs;
use yii_app\records\WriteOffsErp;
*/
private function getStoreStaffingSkillScore($storeId)
{
- $staffing = \yii_app\records\StoreStaffing::find()
+ $staffing = StoreStaffing::find()
->alias('ss')
->innerJoin('employee_position ep', 'ep.id = ss.employee_position_id')
->where(['ss.store_id' => $storeId])
$admins = Admin::find()
->select(['id', 'employee_position_id', 'group_id'])
->where(['id' => $adminIds])
+ ->andWhere(['<>', 'group_id', AdminGroup::GROUP_FIRED])
->indexBy('id')
->asArray()
->all();
</div>
<?php
-$this->registerJs(<<<JS
- // При изменении должности обновляем грейд
- document.getElementById('position-id').addEventListener('change', function() {
- let positionId = this.value;
-
- if (positionId) {
- // Найдем информацию о должности через AJAX
- fetch('index.php?r=store-staffing/get-position-posit&position_id=' + positionId)
- .then(response => response.json())
- .then(data => {
- document.getElementById('position-posit').textContent = data.posit || '-';
- });
- } else {
- document.getElementById('position-posit').textContent = '-';
- }
- });
-
- // Инициализируем при загрузке страницы
- if (document.getElementById('position-id').value) {
- document.getElementById('position-id').dispatchEvent(new Event('change'));
- }
-JS
-);
+// Подключаем JavaScript файл для формы
+$this->registerJsFile('@web/js/store-staffing/form.js', ['depends' => [\yii\web\JqueryAsset::class]]);
?>