liyinglin 3 years ago
parent 04f970e514
commit 32d122f798

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

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

Loading…
Cancel
Save