From 624b4dd553663e104619bdada71680fcffb50a8b Mon Sep 17 00:00:00 2001 From: qinzexin <“731344816@qq.com”> Date: Mon, 26 May 2025 18:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=A1=A8=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/score/Employee.php | 72 ++++++++++ application/admin/controller/score/Event.php | 39 ++++++ application/admin/controller/score/Log.php | 74 ++++++++++ application/admin/controller/score/Team.php | 37 +++++ .../admin/lang/zh-cn/score/employee.php | 18 +++ application/admin/lang/zh-cn/score/event.php | 39 ++++++ application/admin/lang/zh-cn/score/log.php | 21 +++ application/admin/lang/zh-cn/score/team.php | 7 + application/admin/model/score/Employee.php | 59 ++++++++ application/admin/model/score/Event.php | 91 ++++++++++++ application/admin/model/score/Log.php | 62 +++++++++ application/admin/model/score/Team.php | 40 ++++++ application/admin/validate/score/Employee.php | 27 ++++ application/admin/validate/score/Event.php | 27 ++++ application/admin/validate/score/Log.php | 27 ++++ application/admin/validate/score/Team.php | 27 ++++ .../admin/view/score/employee/add.html | 39 ++++++ .../admin/view/score/employee/edit.html | 39 ++++++ .../admin/view/score/employee/index.html | 46 +++++++ application/admin/view/score/event/add.html | 87 ++++++++++++ application/admin/view/score/event/edit.html | 87 ++++++++++++ application/admin/view/score/event/index.html | 46 +++++++ .../admin/view/score/event/recyclebin.html | 25 ++++ application/admin/view/score/log/add.html | 65 +++++++++ application/admin/view/score/log/edit.html | 65 +++++++++ application/admin/view/score/log/index.html | 29 ++++ .../admin/view/score/log/recyclebin.html | 25 ++++ application/admin/view/score/team/add.html | 15 ++ application/admin/view/score/team/edit.html | 15 ++ application/admin/view/score/team/index.html | 29 ++++ public/assets/js/backend/score/employee.js | 60 ++++++++ public/assets/js/backend/score/event.js | 126 +++++++++++++++++ public/assets/js/backend/score/log.js | 129 ++++++++++++++++++ public/assets/js/backend/score/team.js | 53 +++++++ public/assets/js/backend/user/user.js | 30 ++++ 35 files changed, 1677 insertions(+) create mode 100644 application/admin/controller/score/Employee.php create mode 100644 application/admin/controller/score/Event.php create mode 100644 application/admin/controller/score/Log.php create mode 100644 application/admin/controller/score/Team.php create mode 100644 application/admin/lang/zh-cn/score/employee.php create mode 100644 application/admin/lang/zh-cn/score/event.php create mode 100644 application/admin/lang/zh-cn/score/log.php create mode 100644 application/admin/lang/zh-cn/score/team.php create mode 100644 application/admin/model/score/Employee.php create mode 100644 application/admin/model/score/Event.php create mode 100644 application/admin/model/score/Log.php create mode 100644 application/admin/model/score/Team.php create mode 100644 application/admin/validate/score/Employee.php create mode 100644 application/admin/validate/score/Event.php create mode 100644 application/admin/validate/score/Log.php create mode 100644 application/admin/validate/score/Team.php create mode 100644 application/admin/view/score/employee/add.html create mode 100644 application/admin/view/score/employee/edit.html create mode 100644 application/admin/view/score/employee/index.html create mode 100644 application/admin/view/score/event/add.html create mode 100644 application/admin/view/score/event/edit.html create mode 100644 application/admin/view/score/event/index.html create mode 100644 application/admin/view/score/event/recyclebin.html create mode 100644 application/admin/view/score/log/add.html create mode 100644 application/admin/view/score/log/edit.html create mode 100644 application/admin/view/score/log/index.html create mode 100644 application/admin/view/score/log/recyclebin.html create mode 100644 application/admin/view/score/team/add.html create mode 100644 application/admin/view/score/team/edit.html create mode 100644 application/admin/view/score/team/index.html create mode 100644 public/assets/js/backend/score/employee.js create mode 100644 public/assets/js/backend/score/event.js create mode 100644 public/assets/js/backend/score/log.js create mode 100644 public/assets/js/backend/score/team.js diff --git a/application/admin/controller/score/Employee.php b/application/admin/controller/score/Employee.php new file mode 100644 index 0000000..a5209e3 --- /dev/null +++ b/application/admin/controller/score/Employee.php @@ -0,0 +1,72 @@ +model = new \app\admin\model\score\Employee; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['user','team']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['nickname','mobile','avatar']); + $row->getRelation('team')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/score/Event.php b/application/admin/controller/score/Event.php new file mode 100644 index 0000000..6086b86 --- /dev/null +++ b/application/admin/controller/score/Event.php @@ -0,0 +1,39 @@ +model = new \app\admin\model\score\Event; + $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("frequencyList", $this->model->getFrequencyList()); + $this->view->assign("wayList", $this->model->getWayList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/score/Log.php b/application/admin/controller/score/Log.php new file mode 100644 index 0000000..b4009ba --- /dev/null +++ b/application/admin/controller/score/Log.php @@ -0,0 +1,74 @@ +model = new \app\admin\model\score\Log; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['scoreevent','employee','user','team']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('scoreevent')->visible(['name']); + $row->getRelation('employee')->visible(['name']); + $row->getRelation('user')->visible(['nickname','mobile','avatar']); + $row->getRelation('team')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/score/Team.php b/application/admin/controller/score/Team.php new file mode 100644 index 0000000..a2c7341 --- /dev/null +++ b/application/admin/controller/score/Team.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\score\Team; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/lang/zh-cn/score/employee.php b/application/admin/lang/zh-cn/score/employee.php new file mode 100644 index 0000000..98a37d2 --- /dev/null +++ b/application/admin/lang/zh-cn/score/employee.php @@ -0,0 +1,18 @@ + '前端登錄用戶', + 'Name' => '姓名', + 'Team_id' => '队伍id', + 'Status' => '状态', + 'Status entry' => '入职', + 'Set status to entry'=> '设为入职', + 'Status exit' => '离职', + 'Set status to exit'=> '设为离职', + 'Createtime' => '创建时间', + 'Updatetime' => '更新时间', + 'User.nickname' => '昵称', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Team.name' => '队伍名' +]; diff --git a/application/admin/lang/zh-cn/score/event.php b/application/admin/lang/zh-cn/score/event.php new file mode 100644 index 0000000..82408cc --- /dev/null +++ b/application/admin/lang/zh-cn/score/event.php @@ -0,0 +1,39 @@ + '积分标识', + 'Status' => '状态值', + 'Status attendance' => '考勤', + 'Set status to attendance' => '设为考勤', + 'Status morning_meeting_hosting' => '早会主持', + 'Set status to morning_meeting_hosting'=> '设为早会主持', + 'Status safety_environment' => '安全与环境', + 'Set status to safety_environment'=> '设为安全与环境', + 'Status appearance_demeanor' => '仪容仪表', + 'Set status to appearance_demeanor'=> '设为仪容仪表', + 'Status thorough_summarization' => '总结到位', + 'Set status to thorough_summarization'=> '设为总结到位', + 'Status good_people_deeds' => '好人好事', + 'Set status to good_people_deeds'=> '设为好人好事', + 'Status customer_service' => '客户服务', + 'Set status to customer_service' => '设为客户服务', + 'Status corporate_culture' => '企业文化', + 'Set status to corporate_culture'=> '设为企业文化', + 'Name' => '具体项目', + 'Desc' => '操作标准及说明', + 'Score' => '分值', + 'Frequency' => '频率', + 'Frequency month' => '月', + 'Frequency day' => '天', + 'Frequency week' => '周', + 'Frequency once' => '次', + 'Max_times' => '最高次数(0为不限制)', + 'Monthly_highest_score' => '月度最高分(0为不限制)', + 'Way' => '得分方式(多选)', + 'Way free' => '自由申请', + 'Way direct' => '直接奖励', + 'Weigh' => '权重', + 'Createtime' => '创建时间', + 'Updatetime' => '更新时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/admin/lang/zh-cn/score/log.php b/application/admin/lang/zh-cn/score/log.php new file mode 100644 index 0000000..ce95d80 --- /dev/null +++ b/application/admin/lang/zh-cn/score/log.php @@ -0,0 +1,21 @@ + '积分事件id', + 'Score_employee_id' => '员工id', + 'User_id' => '用户id', + 'Score_team_id' => '队伍id', + 'Name' => '具体项目', + 'Score' => '分值', + 'Images' => '多图', + 'Desc' => '备注', + 'Createtime' => '创建时间', + 'Updatetime' => '更新时间', + 'Deletetime' => '删除时间', + 'Event.name' => '具体项目', + 'Employee.name' => '姓名', + 'User.nickname' => '昵称', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Team.name' => '队伍名' +]; diff --git a/application/admin/lang/zh-cn/score/team.php b/application/admin/lang/zh-cn/score/team.php new file mode 100644 index 0000000..1bc4700 --- /dev/null +++ b/application/admin/lang/zh-cn/score/team.php @@ -0,0 +1,7 @@ + '队伍名', + 'Createtime' => '创建时间', + 'Updatetime' => '更新时间' +]; diff --git a/application/admin/model/score/Employee.php b/application/admin/model/score/Employee.php new file mode 100644 index 0000000..3efd409 --- /dev/null +++ b/application/admin/model/score/Employee.php @@ -0,0 +1,59 @@ + __('Status entry'), 'exit' => __('Status exit')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ?: ($data['status'] ?? ''); + $list = $this->getStatusList(); + return $list[$value] ?? ''; + } + + + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function team() + { + return $this->belongsTo('Team', 'team_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/score/Event.php b/application/admin/model/score/Event.php new file mode 100644 index 0000000..e4370be --- /dev/null +++ b/application/admin/model/score/Event.php @@ -0,0 +1,91 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['attendance' => __('Status attendance'), 'morning_meeting_hosting' => __('Status morning_meeting_hosting'), 'safety_environment' => __('Status safety_environment'), 'appearance_demeanor' => __('Status appearance_demeanor'), 'thorough_summarization' => __('Status thorough_summarization'), 'good_people_deeds' => __('Status good_people_deeds'), 'customer_service' => __('Status customer_service'), 'corporate_culture' => __('Status corporate_culture')]; + } + + public function getFrequencyList() + { + return ['month' => __('Frequency month'), 'day' => __('Frequency day'), 'week' => __('Frequency week'), 'once' => __('Frequency once')]; + } + + public function getWayList() + { + return ['free' => __('Way free'), 'direct' => __('Way direct')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ?: ($data['status'] ?? ''); + $list = $this->getStatusList(); + return $list[$value] ?? ''; + } + + + public function getFrequencyTextAttr($value, $data) + { + $value = $value ?: ($data['frequency'] ?? ''); + $list = $this->getFrequencyList(); + return $list[$value] ?? ''; + } + + + public function getWayTextAttr($value, $data) + { + $value = $value ?: ($data['way'] ?? ''); + $valueArr = explode(',', $value); + $list = $this->getWayList(); + return implode(',', array_intersect_key($list, array_flip($valueArr))); + } + + protected function setWayAttr($value) + { + return is_array($value) ? implode(',', $value) : $value; + } + + +} diff --git a/application/admin/model/score/Log.php b/application/admin/model/score/Log.php new file mode 100644 index 0000000..f2c239e --- /dev/null +++ b/application/admin/model/score/Log.php @@ -0,0 +1,62 @@ +belongsTo('Event', 'score_event_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function employee() + { + return $this->belongsTo('Employee', 'score_employee_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function team() + { + return $this->belongsTo('Team', 'score_team_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/score/Team.php b/application/admin/model/score/Team.php new file mode 100644 index 0000000..efd4e34 --- /dev/null +++ b/application/admin/model/score/Team.php @@ -0,0 +1,40 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/score/Event.php b/application/admin/validate/score/Event.php new file mode 100644 index 0000000..1701b59 --- /dev/null +++ b/application/admin/validate/score/Event.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/score/Log.php b/application/admin/validate/score/Log.php new file mode 100644 index 0000000..f56b8b7 --- /dev/null +++ b/application/admin/validate/score/Log.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/score/Team.php b/application/admin/validate/score/Team.php new file mode 100644 index 0000000..1ef9ce3 --- /dev/null +++ b/application/admin/validate/score/Team.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/score/employee/add.html b/application/admin/view/score/employee/add.html new file mode 100644 index 0000000..495cb94 --- /dev/null +++ b/application/admin/view/score/employee/add.html @@ -0,0 +1,39 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+ +
diff --git a/application/admin/view/score/employee/edit.html b/application/admin/view/score/employee/edit.html new file mode 100644 index 0000000..ace30ae --- /dev/null +++ b/application/admin/view/score/employee/edit.html @@ -0,0 +1,39 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+ +
diff --git a/application/admin/view/score/employee/index.html b/application/admin/view/score/employee/index.html new file mode 100644 index 0000000..569f611 --- /dev/null +++ b/application/admin/view/score/employee/index.html @@ -0,0 +1,46 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+
+ + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/score/event/add.html b/application/admin/view/score/event/add.html new file mode 100644 index 0000000..e4d6603 --- /dev/null +++ b/application/admin/view/score/event/add.html @@ -0,0 +1,87 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/score/event/edit.html b/application/admin/view/score/event/edit.html new file mode 100644 index 0000000..0acd23e --- /dev/null +++ b/application/admin/view/score/event/edit.html @@ -0,0 +1,87 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/score/event/index.html b/application/admin/view/score/event/index.html new file mode 100644 index 0000000..8861a10 --- /dev/null +++ b/application/admin/view/score/event/index.html @@ -0,0 +1,46 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+
+ + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + {:__('Recycle bin')} +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/score/event/recyclebin.html b/application/admin/view/score/event/recyclebin.html new file mode 100644 index 0000000..80f0c2e --- /dev/null +++ b/application/admin/view/score/event/recyclebin.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/admin/view/score/log/add.html b/application/admin/view/score/log/add.html new file mode 100644 index 0000000..0efe9b7 --- /dev/null +++ b/application/admin/view/score/log/add.html @@ -0,0 +1,65 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+
    +
    +
    +
    + +
    + +
    +
    + +
    diff --git a/application/admin/view/score/log/edit.html b/application/admin/view/score/log/edit.html new file mode 100644 index 0000000..0b77330 --- /dev/null +++ b/application/admin/view/score/log/edit.html @@ -0,0 +1,65 @@ +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + + +
    + +
    +
      +
      +
      +
      + +
      + +
      +
      + +
      diff --git a/application/admin/view/score/log/index.html b/application/admin/view/score/log/index.html new file mode 100644 index 0000000..d0e872d --- /dev/null +++ b/application/admin/view/score/log/index.html @@ -0,0 +1,29 @@ +
      + {:build_heading()} + +
      + +
      +
      diff --git a/application/admin/view/score/log/recyclebin.html b/application/admin/view/score/log/recyclebin.html new file mode 100644 index 0000000..efbc52b --- /dev/null +++ b/application/admin/view/score/log/recyclebin.html @@ -0,0 +1,25 @@ +
      + {:build_heading()} + +
      +
      +
      + +
      + +
      +
      +
      diff --git a/application/admin/view/score/team/add.html b/application/admin/view/score/team/add.html new file mode 100644 index 0000000..132ac6e --- /dev/null +++ b/application/admin/view/score/team/add.html @@ -0,0 +1,15 @@ +
      + +
      + +
      + +
      +
      + +
      diff --git a/application/admin/view/score/team/edit.html b/application/admin/view/score/team/edit.html new file mode 100644 index 0000000..4f011e8 --- /dev/null +++ b/application/admin/view/score/team/edit.html @@ -0,0 +1,15 @@ +
      + +
      + +
      + +
      +
      + +
      diff --git a/application/admin/view/score/team/index.html b/application/admin/view/score/team/index.html new file mode 100644 index 0000000..74483a6 --- /dev/null +++ b/application/admin/view/score/team/index.html @@ -0,0 +1,29 @@ +
      + {:build_heading()} + +
      +
      +
      + +
      + +
      +
      +
      diff --git a/public/assets/js/backend/score/employee.js b/public/assets/js/backend/score/employee.js new file mode 100644 index 0000000..86b1611 --- /dev/null +++ b/public/assets/js/backend/score/employee.js @@ -0,0 +1,60 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'score/employee/index' + location.search, + add_url: 'score/employee/add', + edit_url: 'score/employee/edit', + del_url: 'score/employee/del', + multi_url: 'score/employee/multi', + import_url: 'score/employee/import', + table: 'score_employee', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'team_id', title: __('Team_id')}, + {field: 'status', title: __('Status'), searchList: {"entry":__('Status entry'),"exit":__('Status exit')}, formatter: Table.api.formatter.status}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'team.name', title: __('Team.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/score/event.js b/public/assets/js/backend/score/event.js new file mode 100644 index 0000000..f1e1c11 --- /dev/null +++ b/public/assets/js/backend/score/event.js @@ -0,0 +1,126 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'score/event/index' + location.search, + add_url: 'score/event/add', + edit_url: 'score/event/edit', + del_url: 'score/event/del', + multi_url: 'score/event/multi', + import_url: 'score/event/import', + table: 'score_event', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'weigh', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + + {field: 'status', title: __('Status'), searchList: {"attendance":__('Status attendance'),"morning_meeting_hosting":__('Status morning_meeting_hosting'),"safety_environment":__('Status safety_environment'),"appearance_demeanor":__('Status appearance_demeanor'),"thorough_summarization":__('Status thorough_summarization'),"good_people_deeds":__('Status good_people_deeds'),"customer_service":__('Status customer_service'),"corporate_culture":__('Status corporate_culture')}, formatter: Table.api.formatter.status}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'score', title: __('Score'), operate: false}, + {field: 'frequency', title: __('Frequency'), searchList: {"month":__('Frequency month'),"day":__('Frequency day'),"week":__('Frequency week'),"once":__('Frequency once')}, formatter: Table.api.formatter.normal}, + {field: 'max_times', title: __('Max_times')}, + {field: 'monthly_highest_score', title: __('Monthly_highest_score')}, + {field: 'way', title: __('Way'), searchList: {"free":__('Way free'),"direct":__('Way direct')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}, + {field: 'event_name', title: __('Event_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'score/event/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), align: 'left'}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'score/event/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'score/event/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/score/log.js b/public/assets/js/backend/score/log.js new file mode 100644 index 0000000..87c8504 --- /dev/null +++ b/public/assets/js/backend/score/log.js @@ -0,0 +1,129 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'score/log/index' + location.search, + add_url: 'score/log/add', + edit_url: 'score/log/edit', + del_url: 'score/log/del', + multi_url: 'score/log/multi', + import_url: 'score/log/import', + table: 'score_log', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'score_event_id', title: __('Score_event_id')}, + {field: 'score_employee_id', title: __('Score_employee_id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'score_team_id', title: __('Score_team_id')}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'score', title: __('Score')}, + {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, + {field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'scoreevent.name', title: __('Event.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'employee.name', title: __('Employee.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'team.name', title: __('Team.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'score/log/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), align: 'left'}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'score/log/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'score/log/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/score/team.js b/public/assets/js/backend/score/team.js new file mode 100644 index 0000000..6beafb2 --- /dev/null +++ b/public/assets/js/backend/score/team.js @@ -0,0 +1,53 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'score/team/index' + location.search, + add_url: 'score/team/add', + edit_url: 'score/team/edit', + del_url: 'score/team/del', + multi_url: 'score/team/multi', + import_url: 'score/team/import', + table: 'score_team', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index 1ee1a74..6e2ac15 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -50,6 +50,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 为表格绑定事件 Table.api.bindevent(table); + /** + * 发放y预约订单 + * cc + * 2020年8月5日 + */ + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + } + }; + Fast.api.open(url,title,options); + }); + + + }, add: function () { Controller.api.bindevent(); @@ -57,6 +81,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + changeuser: function(){ + $("#changeuser").on('click', function() { + $("#changeuser-form").attr("action",'user/user/changeuser').submit(); + }); + Controller.api.bindevent(); + }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]"));