diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/CheckUpTypeController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/CheckUpTypeController.php new file mode 100644 index 0000000..cada066 --- /dev/null +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/CheckUpTypeController.php @@ -0,0 +1,17 @@ +where(['is_del'=>0,'status'=>1])->get(); + return \Yz::Return(true,'查询完成',['list'=>$list]); + } +} diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php new file mode 100644 index 0000000..e579e28 --- /dev/null +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php @@ -0,0 +1,55 @@ + isset($Info['name']) ? $Info['name'] : null, + 'is_vip' => isset($Info['is_vip']) ? $Info['is_vip'] : null, + 'use_type' => isset($Info['use_type']) ? $Info['use_type'] : null, + 'sex' => isset($Info['sex']) ? $Info['sex'] : null, + 'checkup_type_id' => isset($Info['checkup_type_id']) ? json_encode($Info['checkup_type_id']) : null, + 'amount_limit1' => isset($Info['amount_limit1']) ? $Info['amount_limit1'] : 0, + 'amount_limit2' => isset($Info['amount_limit2']) ? $Info['amount_limit2'] : 0, + ]; + $requiredFields = ['name'=>'姓名','is_vip'=>'vip类型','use_type'=>'个检/团检类型','checkup_type_id'=>'体检类型']; +// 判断是否为空 + foreach ($requiredFields as $key=> $field) { + if (!isset($params[$key]) || $params[$key] === null) { + return \Yz::echoError1('参数 ' . $field . ' 不能为空'); + } + } + $do=false; + $table=DB::table('plan_type'); + if($Info['id']==0){ + $do=$table->insert($params); + } + if($Info['id']>0){ + $do=$table->update($params); + } + if($do){ + return \Yz::Return(true,'操作成功',[]); + }else{ + return \Yz::echoError1('操作失败'); + } + + } + public function GetList() + { + $page =request('page'); + $pageSize =request('pageSize'); + $searchInfo=request('searchInfo'); + $list=DB::table('plan_type')->where(['is_del'=>0]); + $count=$list->count(); + $list=$list ->get(); + return \Yz::Return(true,'查询完成',['list'=>$list,'count'=>$count]); + } +} diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php index 2c9d0b8..98c4320 100644 --- a/Laravel/routes/api.php +++ b/Laravel/routes/api.php @@ -50,6 +50,9 @@ Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () { Route::post('admin/CalendarGetList','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@getList'); //admin后台获取日历列表 Route::post('admin/CalendarListDel','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@Del'); //admin后台删除日历 Route::post('admin/CalendarChangeInfo','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@ChangeInfo'); //admin后台更新日历 + Route::post('admin/PlanTypeGetList','App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetList');//号源类型列表 + Route::post('admin/PlanTypeSave','App\Http\Controllers\API\Admin\YeWu\PlanTypeController@Save');//号源类型保存 + Route::post('admin/CheckUpTypeGetEnableList','App\Http\Controllers\API\Admin\YeWu\CheckUpTypeController@GetEnableList');//可用体检类型列表 }); diff --git a/admin/src/api/api.js b/admin/src/api/api.js index 423e198..a9643ed 100644 --- a/admin/src/api/api.js +++ b/admin/src/api/api.js @@ -111,4 +111,16 @@ export const SystemLogGetList = (data={}) => { //获取日志表名 export const GetLogTableName = (data={}) => { return axios({url:import.meta.env.VITE_APP_API+'v1/admin/GetLogTableName',data:data}) +} +//获取号源类型列表 +export const PlanTypeGetList = (data={}) => { + return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PlanTypeGetList',data:data}) +} +//可用体检类型列表 +export const CheckUpTypeGetEnableList = (data={}) => { + return axios({url:import.meta.env.VITE_APP_API+'v1/admin/CheckUpTypeGetEnableList',data:data}) +} +//号源类型保存 +export const PlanTypeSave = (data={}) => { + return axios({url:import.meta.env.VITE_APP_API+'v1/admin/PlanTypeSave',data:data}) } \ No newline at end of file diff --git a/admin/src/router/index.js b/admin/src/router/index.js index 308e500..fcb2cf1 100644 --- a/admin/src/router/index.js +++ b/admin/src/router/index.js @@ -106,6 +106,13 @@ const router = createRouter({ meta: { title: '系统日志' } + },{ + path: '/planMngr/plantype', + name: 'PlanMngrPlantype', + component: () => import('../views/PlanMngr/PlanType.vue'), + meta: { + title: '号源类型' + } }] }, diff --git a/admin/src/views/PlanMngr/PlanType.vue b/admin/src/views/PlanMngr/PlanType.vue new file mode 100644 index 0000000..49283c5 --- /dev/null +++ b/admin/src/views/PlanMngr/PlanType.vue @@ -0,0 +1,183 @@ + + + + + \ No newline at end of file