diff --git a/admin/src/addon/zhjw/api/follow_up_reminders.ts b/admin/src/addon/zhjw/api/follow_up_reminders.ts new file mode 100644 index 00000000..3d5a4da9 --- /dev/null +++ b/admin/src/addon/zhjw/api/follow_up_reminders.ts @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// USER_CODE_BEGIN -- zhjw_follow_up_reminders +/** + * 获取跟进提醒管理列表 + * @param params + * @returns + */ +export function getFollowUpRemindersList(params: Record) { + return request.get(`zhjw/follow_up_reminders`, {params}) +} + +/** + * 获取跟进提醒管理详情 + * @param id 跟进提醒管理id + * @returns + */ +export function getFollowUpRemindersInfo(id: number) { + return request.get(`zhjw/follow_up_reminders/${id}`); +} + +/** + * 添加跟进提醒管理 + * @param params + * @returns + */ +export function addFollowUpReminders(params: Record) { + return request.post('zhjw/follow_up_reminders', params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 编辑跟进提醒管理 + * @param id + * @param params + * @returns + */ +export function editFollowUpReminders(params: Record) { + return request.put(`zhjw/follow_up_reminders/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 删除跟进提醒管理 + * @param id + * @returns + */ +export function deleteFollowUpReminders(id: number) { + return request.delete(`zhjw/follow_up_reminders/${id}`, { showErrorMessage: true, showSuccessMessage: true }) +} + +export function getWithFollowUpLogsList(params: Record){ + return request.get('zhjw/follow_up_logs_all', {params}) +} + +// USER_CODE_END -- zhjw_follow_up_reminders diff --git a/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders.json b/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders.json new file mode 100644 index 00000000..bfa9be69 --- /dev/null +++ b/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders.json @@ -0,0 +1,19 @@ +{ + "id":"序号", + "followUpLogsId":"跟进日志表序号", + "followUpLogsIdPlaceholder":"全部", + "reminderTime":"任务提醒", + "reminderTimePlaceholder":"请输入任务提醒", + "reminderMethod":"提醒方式", + "reminderMethodPlaceholder":"请输入提醒方式", + "taskStatus":"定时任务执行状态", + "taskStatusPlaceholder":"请输入定时任务执行状态", + "errMsg":"执行失败原因", + "createTime":"添加时间", + "createTimePlaceholder":"请输入添加时间", + "addFollowUpReminders":"添加跟进提醒管理", + "updateFollowUpReminders":"编辑跟进提醒管理", + "followUpRemindersDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json b/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json new file mode 100644 index 00000000..81d5ab0e --- /dev/null +++ b/admin/src/addon/zhjw/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json @@ -0,0 +1,15 @@ +{ + "followUpLogsId":"跟进日志表序号", + "reminderTime":"任务提醒", + "reminderMethod":"提醒方式", + "taskStatus":"定时任务执行状态", + "errMsg":"执行失败原因", + "followUpLogsIdPlaceholder":"请选择跟进日志表序号", + "reminderTimePlaceholder":"请选择任务提醒", + "reminderMethodPlaceholder":"请选择提醒方式", + "taskStatusPlaceholder":"请选择定时任务执行状态", + "errMsgPlaceholder":"请输入执行失败原因", + "addFollowUpReminders":"添加跟进提醒管理", + "updateFollowUpReminders":"编辑跟进提醒管理", + "followUpRemindersDeleteTips":"确定要删除该跟进提醒管理吗?" +} \ No newline at end of file diff --git a/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders.vue b/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders.vue new file mode 100644 index 00000000..baa02b56 --- /dev/null +++ b/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders_edit.vue b/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders_edit.vue new file mode 100644 index 00000000..2778720b --- /dev/null +++ b/admin/src/addon/zhjw/views/follow_up_reminders/follow_up_reminders_edit.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/niucloud/addon/zhjw/admin/api/follow_up_reminders.ts b/niucloud/addon/zhjw/admin/api/follow_up_reminders.ts new file mode 100644 index 00000000..3d5a4da9 --- /dev/null +++ b/niucloud/addon/zhjw/admin/api/follow_up_reminders.ts @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// USER_CODE_BEGIN -- zhjw_follow_up_reminders +/** + * 获取跟进提醒管理列表 + * @param params + * @returns + */ +export function getFollowUpRemindersList(params: Record) { + return request.get(`zhjw/follow_up_reminders`, {params}) +} + +/** + * 获取跟进提醒管理详情 + * @param id 跟进提醒管理id + * @returns + */ +export function getFollowUpRemindersInfo(id: number) { + return request.get(`zhjw/follow_up_reminders/${id}`); +} + +/** + * 添加跟进提醒管理 + * @param params + * @returns + */ +export function addFollowUpReminders(params: Record) { + return request.post('zhjw/follow_up_reminders', params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 编辑跟进提醒管理 + * @param id + * @param params + * @returns + */ +export function editFollowUpReminders(params: Record) { + return request.put(`zhjw/follow_up_reminders/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 删除跟进提醒管理 + * @param id + * @returns + */ +export function deleteFollowUpReminders(id: number) { + return request.delete(`zhjw/follow_up_reminders/${id}`, { showErrorMessage: true, showSuccessMessage: true }) +} + +export function getWithFollowUpLogsList(params: Record){ + return request.get('zhjw/follow_up_logs_all', {params}) +} + +// USER_CODE_END -- zhjw_follow_up_reminders diff --git a/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders.json b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders.json new file mode 100644 index 00000000..bfa9be69 --- /dev/null +++ b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders.json @@ -0,0 +1,19 @@ +{ + "id":"序号", + "followUpLogsId":"跟进日志表序号", + "followUpLogsIdPlaceholder":"全部", + "reminderTime":"任务提醒", + "reminderTimePlaceholder":"请输入任务提醒", + "reminderMethod":"提醒方式", + "reminderMethodPlaceholder":"请输入提醒方式", + "taskStatus":"定时任务执行状态", + "taskStatusPlaceholder":"请输入定时任务执行状态", + "errMsg":"执行失败原因", + "createTime":"添加时间", + "createTimePlaceholder":"请输入添加时间", + "addFollowUpReminders":"添加跟进提醒管理", + "updateFollowUpReminders":"编辑跟进提醒管理", + "followUpRemindersDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json new file mode 100644 index 00000000..81d5ab0e --- /dev/null +++ b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_reminders.follow_up_reminders_edit.json @@ -0,0 +1,15 @@ +{ + "followUpLogsId":"跟进日志表序号", + "reminderTime":"任务提醒", + "reminderMethod":"提醒方式", + "taskStatus":"定时任务执行状态", + "errMsg":"执行失败原因", + "followUpLogsIdPlaceholder":"请选择跟进日志表序号", + "reminderTimePlaceholder":"请选择任务提醒", + "reminderMethodPlaceholder":"请选择提醒方式", + "taskStatusPlaceholder":"请选择定时任务执行状态", + "errMsgPlaceholder":"请输入执行失败原因", + "addFollowUpReminders":"添加跟进提醒管理", + "updateFollowUpReminders":"编辑跟进提醒管理", + "followUpRemindersDeleteTips":"确定要删除该跟进提醒管理吗?" +} \ No newline at end of file diff --git a/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders.vue b/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders.vue new file mode 100644 index 00000000..baa02b56 --- /dev/null +++ b/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders_edit.vue b/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders_edit.vue new file mode 100644 index 00000000..2778720b --- /dev/null +++ b/niucloud/addon/zhjw/admin/views/follow_up_reminders/follow_up_reminders_edit.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/niucloud/addon/zhjw/app/adminapi/controller/follow_up_reminders/FollowUpReminders.php b/niucloud/addon/zhjw/app/adminapi/controller/follow_up_reminders/FollowUpReminders.php new file mode 100644 index 00000000..8a4d0a7e --- /dev/null +++ b/niucloud/addon/zhjw/app/adminapi/controller/follow_up_reminders/FollowUpReminders.php @@ -0,0 +1,101 @@ +request->params([ + ["follow_up_logs_id",""], + ["reminder_time",["",""]], + ["reminder_method",""], + ["task_status",""], + ["create_time",["",""]] + ]); + return success((new FollowUpRemindersService())->getPage($data)); + } + + /** + * 跟进提醒管理详情 + * @param int $id + * @return \think\Response + */ + public function info(int $id){ + return success((new FollowUpRemindersService())->getInfo($id)); + } + + /** + * 添加跟进提醒管理 + * @return \think\Response + */ + public function add(){ + $data = $this->request->params([ + ["follow_up_logs_id",0], + ["reminder_time","2025-03-14 19:38:04"], + ["reminder_method",""], + ["task_status",""], + ["err_msg",""], + + ]); + $this->validate($data, 'addon\zhjw\app\validate\follow_up_reminders\FollowUpReminders.add'); + $id = (new FollowUpRemindersService())->add($data); + return success('ADD_SUCCESS', ['id' => $id]); + } + + /** + * 跟进提醒管理编辑 + * @param $id 跟进提醒管理id + * @return \think\Response + */ + public function edit(int $id){ + $data = $this->request->params([ + ["follow_up_logs_id",0], + ["reminder_time","2025-03-14 19:38:04"], + ["reminder_method",""], + ["task_status",""], + ["err_msg",""], + + ]); + $this->validate($data, 'addon\zhjw\app\validate\follow_up_reminders\FollowUpReminders.edit'); + (new FollowUpRemindersService())->edit($id, $data); + return success('EDIT_SUCCESS'); + } + + /** + * 跟进提醒管理删除 + * @param $id 跟进提醒管理id + * @return \think\Response + */ + public function del(int $id){ + (new FollowUpRemindersService())->del($id); + return success('DELETE_SUCCESS'); + } + + + public function getFollowUpLogsAll(){ + return success(( new FollowUpRemindersService())->getFollowUpLogsAll()); + } + +} diff --git a/niucloud/addon/zhjw/app/adminapi/route/route.php b/niucloud/addon/zhjw/app/adminapi/route/route.php index 9543fad7..afac5e9b 100644 --- a/niucloud/addon/zhjw/app/adminapi/route/route.php +++ b/niucloud/addon/zhjw/app/adminapi/route/route.php @@ -408,3 +408,27 @@ Route::group('zhjw', function () { AdminLog::class ]); // USER_CODE_END -- zhjw_follow_up_logs + +// USER_CODE_BEGIN -- zhjw_follow_up_reminders + +Route::group('zhjw', function () { + + //跟进提醒管理列表 + Route::get('follow_up_reminders', 'addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@lists'); + //跟进提醒管理详情 + Route::get('follow_up_reminders/:id', 'addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@info'); + //添加跟进提醒管理 + Route::post('follow_up_reminders', 'addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@add'); + //编辑跟进提醒管理 + Route::put('follow_up_reminders/:id', 'addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@edit'); + //删除跟进提醒管理 + Route::delete('follow_up_reminders/:id', 'addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@del'); + + Route::get('follow_up_logs_all','addon\zhjw\app\adminapi\controller\follow_up_reminders\FollowUpReminders@getFollowUpLogsAll'); + +})->middleware([ + AdminCheckToken::class, + AdminCheckRole::class, + AdminLog::class +]); +// USER_CODE_END -- zhjw_follow_up_reminders diff --git a/niucloud/addon/zhjw/app/model/follow_up_reminders/FollowUpReminders.php b/niucloud/addon/zhjw/app/model/follow_up_reminders/FollowUpReminders.php new file mode 100644 index 00000000..9ec6d943 --- /dev/null +++ b/niucloud/addon/zhjw/app/model/follow_up_reminders/FollowUpReminders.php @@ -0,0 +1,136 @@ +where("follow_up_logs_id", $value); + } + } + + /** + * 搜索器:跟进提醒管理任务提醒 + * @param $value + * @param $data + */ + public function searchReminderTimeAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["reminder_time", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["reminder_time", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["reminder_time", "<=", $end]]); + } + } + + /** + * 搜索器:跟进提醒管理提醒方式 + * @param $value + * @param $data + */ + public function searchReminderMethodAttr($query, $value, $data) + { + if ($value) { + $query->where("reminder_method", $value); + } + } + + /** + * 搜索器:跟进提醒管理定时任务执行状态 + * @param $value + * @param $data + */ + public function searchTaskStatusAttr($query, $value, $data) + { + if ($value) { + $query->where("task_status", $value); + } + } + + /** + * 搜索器:跟进提醒管理添加时间 + * @param $value + * @param $data + */ + public function searchCreateTimeAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["create_time", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["create_time", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["create_time", "<=", $end]]); + } + } + + + + + + + public function followUpLogs(){ + return $this->hasOne(FollowUpLogs::class, 'id', 'follow_up_logs_id')->joinType('left')->withField('id,id')->bind(['follow_up_logs_id_name'=>'id']); + } + +} diff --git a/niucloud/addon/zhjw/app/service/admin/follow_up_reminders/FollowUpRemindersService.php b/niucloud/addon/zhjw/app/service/admin/follow_up_reminders/FollowUpRemindersService.php new file mode 100644 index 00000000..68f34a91 --- /dev/null +++ b/niucloud/addon/zhjw/app/service/admin/follow_up_reminders/FollowUpRemindersService.php @@ -0,0 +1,105 @@ +model = new FollowUpReminders(); + } + + /** + * 获取跟进提醒管理列表 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $field = 'id,follow_up_logs_id,reminder_time,reminder_method,task_status,err_msg,is_deleted,create_time,update_time,created_by,created_role,updated_by,updated_role'; + $order = 'id desc'; + + $search_model = $this->model->withSearch(["follow_up_logs_id","reminder_time","reminder_method","task_status","create_time"], $where)->with(['followUpLogs'])->field($field)->order($order); + $list = $this->pageQuery($search_model); + return $list; + } + + /** + * 获取跟进提醒管理信息 + * @param int $id + * @return array + */ + public function getInfo(int $id) + { + $field = 'id,follow_up_logs_id,reminder_time,reminder_method,task_status,err_msg,is_deleted,create_time,update_time,created_by,created_role,updated_by,updated_role'; + + $info = $this->model->field($field)->where([['id', "=", $id]])->with(['followUpLogs'])->findOrEmpty()->toArray(); + return $info; + } + + /** + * 添加跟进提醒管理 + * @param array $data + * @return mixed + */ + public function add(array $data) + { + $res = $this->model->create($data); + return $res->id; + + } + + /** + * 跟进提醒管理编辑 + * @param int $id + * @param array $data + * @return bool + */ + public function edit(int $id, array $data) + { + + $this->model->where([['id', '=', $id]])->update($data); + return true; + } + + /** + * 删除跟进提醒管理 + * @param int $id + * @return bool + */ + public function del(int $id) + { + $model = $this->model->where([['id', '=', $id]])->find(); + $res = $model->delete(); + return $res; + } + + + public function getFollowUpLogsAll(){ + $followUpLogsModel = new FollowUpLogs(); + return $followUpLogsModel->select()->toArray(); + } + + +} diff --git a/niucloud/addon/zhjw/app/validate/follow_up_reminders/FollowUpReminders.php b/niucloud/addon/zhjw/app/validate/follow_up_reminders/FollowUpReminders.php new file mode 100644 index 00000000..22b8888e --- /dev/null +++ b/niucloud/addon/zhjw/app/validate/follow_up_reminders/FollowUpReminders.php @@ -0,0 +1,41 @@ + 'require', + 'reminder_time' => 'require', + 'reminder_method' => 'require', + 'task_status' => 'require', + ]; + + protected $message = [ + 'follow_up_logs_id.require' => ['common_validate.require', ['follow_up_logs_id']], + 'reminder_time.require' => ['common_validate.require', ['reminder_time']], + 'reminder_method.require' => ['common_validate.require', ['reminder_method']], + 'task_status.require' => ['common_validate.require', ['task_status']], + ]; + + protected $scene = [ + "add" => ['follow_up_logs_id', 'reminder_time', 'reminder_method', 'task_status', 'err_msg'], + "edit" => ['follow_up_logs_id', 'reminder_time', 'reminder_method', 'task_status', 'err_msg'] + ]; + +}