liyinglin 3 years ago
parent 1261780160
commit 1b79df0f5d

@ -102,10 +102,10 @@ class ProjectController extends CommonController
$headList = Admin::whereIn('id', $adminIds)->get();
// 获取病区选中的护工
foreach ($headList as $item) {
$item->checked = false;
$item->selected = '';
if ($areaId) {
$has = AdminAreaLink::where('area_id', $areaId)->where('admin_id', $item->id)->count();
if ($has) $item->checked = true;
if ($has) $item->selected = 'selected';
}
}
return $this->ajaxResponse($headList);

@ -293,7 +293,7 @@
console.log(res)
for (var i = 0; i < res.length; i++) {
$("#head_option").append('<option selected="' + res[i].checked + '" value="' + res[i].id + '">' + res[i].name + '</option>');
$("#head_option").append('<option selected="' + res[i].selected + '" value="' + res[i].id + '">' + res[i].name + '</option>');
}
});

Loading…
Cancel
Save