diff --git a/common/models/PayT.php b/common/models/PayT.php
index 5602672..c010eac 100644
--- a/common/models/PayT.php
+++ b/common/models/PayT.php
@@ -166,21 +166,7 @@ class PayT extends \common\models\Base
}
$ext_day_pay = 0;
-// if($group_info) {
-// $ext_day_pay = ($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay)/$worktype;
-// } else {
-// $ext_day_pay = $user_info->ext_pay / $worktype;
-// }
$ext_day_pay = $this->formal_pay / $worktype;
-// var_dump($workday);
-// var_dump($this->formal_pay);
-// var_dump($worktype);
-// var_dump($this->attendance_days);
-
-
-
-// die;
-// $try_day_pay = $user_info->try_pay / $worktype;
$try_day_pay = $this->try_pay / $worktype;
$should_pay = 0;
@@ -196,12 +182,6 @@ class PayT extends \common\models\Base
$should_pay += $this->bonus;
$should_pay += $this->get_pass_time_pay;
$should_pay += $this->get_full_attendance_pay;
-//echo $should_pay;
-// $should_pay += $this->turnover;
-
-// if($group_info){
-// $should_pay += $group_info->base_pay + $group_info->job_pay + $group_info->station_pay;
-// }
$this->should_pay = $should_pay;
$real_pay = $should_pay - $this->late_pay;
diff --git a/frontend/controllers/PersonnelController.php b/frontend/controllers/PersonnelController.php
index e7294be..43cd827 100644
--- a/frontend/controllers/PersonnelController.php
+++ b/frontend/controllers/PersonnelController.php
@@ -17,6 +17,8 @@ use common\models\CompanyT;
class PersonnelController extends \frontend\controllers\UserBaseController
{
public $my = null;
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
public function init()
{
@@ -38,79 +40,74 @@ class PersonnelController extends \frontend\controllers\UserBaseController
* 人事工资列表
* @return string
*/
- public function actionPayList()
+ public function actionPayList() {
+ $group_items = GroupT::getTree();
+ $company_items = CompanyT::find()->all();
+ return $this->render('pay-list',[
+ 'group_items' => $group_items,
+ 'company_items' => $company_items
+ ]);
+ }
+
+ public function actionPayListJson()
{
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$username = $request->get('username');
$name = $request->get('name');
$pay_date = $request->get('pay_date',date('Y-m'));
$group_id = $request->get('group_id',0);
$company_id = $request->get('company_id');
- $page = $request->get('page',1);
$is_leave = $request->get('is_leave',0);
-
$status_id = $request->get('status_id',0);
+ $offset = $request->get('offset', 0);
+ $limit = $request->get('limit', 10);
+
$query = UserT::find()
->leftJoin('pay_t','pay_t.user_id=user_t.id')
->where('user_t.group_id>0 and is_delete=0');
if($username != '') {
- $query = $query->andWhere('user_t.username like "'.$username.'"');
+ $query->andWhere('user_t.username like "'.$username.'"');
}
if($name != '') {
- $query = $query->andWhere('user_t.name like "'.$name.'"');
+ $query->andWhere('user_t.name like "'.$name.'"');
}
if($is_leave != ''){
- $query = $query->andWhere(['user_t.is_leave' => $is_leave]);
+ $query->andWhere(['user_t.is_leave' => $is_leave]);
}
if($company_id > 0) {
- $query = $query->andWhere('user_t.company_id='.$company_id);
+ $query->andWhere('user_t.company_id='.$company_id);
}
if($group_id > 0) {
- $query = $query->andWhere('user_t.group_id='.$group_id);
+ $query->andWhere('user_t.group_id='.$group_id);
}
if($status_id > 0) {
- $query = $query->andWhere('pay_t.status_id='.$status_id);
+ $query->andWhere('pay_t.status_id='.$status_id);
}
- $query = $query->orderBy('user_t.username ASC,user_t.id ASC');
+ $query->orderBy('user_t.username ASC,user_t.id ASC');
$total = $query->count();
- $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
- $pagination->setPage($page-1);
-
- $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $query->offset($offset)->limit($limit);
$items = $query->all();
- $page_info = MyLib::getPageInfo($pagination);
-
$group_items = GroupT::getTree();
- $return_count = UserT::find()
- ->leftJoin('pay_t','pay_t.user_id=user_t.id')
- ->where('user_t.group_id>0 and is_delete=0')
- ->andWhere('pay_t.pay_date="'.$pay_date.'"')
- ->andWhere('pay_t.status_id=7')
- ->count();
-
-
- $company_items = CompanyT::find()->all();
-
- return $this->render('pay-list',[
- 'group_items' => $group_items,
- 'items' => $items,
- 'page_info' => $page_info,
- 'page' => $page,
- 'username' => $username,
- 'name' => $name,
- 'pay_date' => $pay_date,
- 'group_id' => $group_id,
- 'company_id' => $company_id,
- 'status_id' => $status_id,
- 'is_leave' => $is_leave,
- 'company_items' => $company_items,
+ $data = [];
+ $data['total'] = count($items);
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $row = $item->toArray();
+ $row['pay_date'] = $pay_date;
+ $row['group_name'] = $item->group ? $item->group->path : '';
+ $row['is_leave'] = $item->is_leave ? '已离职':'';
+ $pay_info = $item->getPay($pay_date);
+ $row['status_name'] = $pay_info ? $pay_info->getStatus($pay_info->status_id) : '';
+ $row['real_pay'] = $pay_info ? $pay_info->base_real_pay : 0 ;
+ $data['rows'][] = $row;
+ }
- 'return_count' => $return_count
- ]);
+ return $data;
}
/**
diff --git a/frontend/views/insurer/non-finance-mng-edit.php b/frontend/views/insurer/non-finance-mng-edit.php
deleted file mode 100644
index 12d6f20..0000000
--- a/frontend/views/insurer/non-finance-mng-edit.php
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/views/insurer/non-finance-mng.php b/frontend/views/insurer/non-finance-mng.php
deleted file mode 100644
index 6b05a32..0000000
--- a/frontend/views/insurer/non-finance-mng.php
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
- 序号 |
- 被保险人 |
- 保险公司 |
- 正本日期 |
- 非车险保单号 |
- 销售座席 |
- 状态 |
- 当前操作 |
- 操作 |
-
- $item) {
- $start_index = ($page - 1) * 20 + $index;
- $caiwu = $item->caiwu1;
- ?>
-
- =$start_index+1?> |
- =MyLib::substr_cut($item->id_man,20)?> |
- 人保 |
- =$item->print_date?> |
- =$item->insurer_non_no?> |
- =$item->user?$item->user->getShowName():''?> |
- =$caiwu->status->name?> |
- =$caiwu->lock?$caiwu->lock->getShowName():''?> |
-
- status_id == 12){ ?>
- [解锁]
- [详情]
-
- |
-
-
-
- =$page_info?> |
-
-
diff --git a/frontend/views/insurer/non-financial-settlement-detail.php b/frontend/views/insurer/non-financial-settlement-detail.php
deleted file mode 100644
index 88bf2a3..0000000
--- a/frontend/views/insurer/non-financial-settlement-detail.php
+++ /dev/null
@@ -1,283 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/views/insurer/non-financial-settlement-list.php b/frontend/views/insurer/non-financial-settlement-list.php
deleted file mode 100644
index 1ceb94c..0000000
--- a/frontend/views/insurer/non-financial-settlement-list.php
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
- 序号 |
- 被保险人 |
- 保险公司 |
- 正本日期 |
- 非车险保单号 |
- 销售座席 |
- 状态 |
- 当前操作 |
- 操作 |
-
- $item) {
- $start_index = ($page - 1) * 20 + $index;
- $caiwu = $item->caiwu1;
- ?>
-
- =$start_index+1?> |
- =MyLib::substr_cut($item->id_man,20)?> |
- 人保 |
- =$item->print_date?> |
- =$item->insurer_non_no?> |
- =$item->user?$item->user->getShowName():''?> |
- =$caiwu->status->name?> |
- =$caiwu->lock?$caiwu->lock->getShowName():''?> |
-
-
- [解锁]
- [详情]
-
- |
-
-
-
- =$page_info?> |
-
-
diff --git a/frontend/views/insurer/non-my-return-list.php b/frontend/views/insurer/non-my-return-list.php
deleted file mode 100644
index 9be3fa3..0000000
--- a/frontend/views/insurer/non-my-return-list.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
- 序号 |
- 车牌号 |
- 被保险人 |
- 证件号码 |
- 退回时间 |
- 备注 |
- 操作 |
-
- $item) {
- $start_index = ($page - 1) * 20 + $index;
- ?>
-
- =$start_index + 1?> |
- =$item->car_no?> |
- =$item->id_man?> |
- =$item->id_number?> |
- =date('Y-m-d H:i:s',$item->return_time)?> |
- =$item->return_remark?> |
-
- [详情]
-
- |
-
-
-
- =$page_info?> |
-
-
diff --git a/frontend/views/insurer/print-mng-edit.php b/frontend/views/insurer/print-mng-edit.php
deleted file mode 100644
index c7fcb90..0000000
--- a/frontend/views/insurer/print-mng-edit.php
+++ /dev/null
@@ -1,382 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/views/insurer/print-mng.php b/frontend/views/insurer/print-mng.php
deleted file mode 100644
index 961cf49..0000000
--- a/frontend/views/insurer/print-mng.php
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
- 序号 |
- 被保险人 |
- 联系电话 |
- 车牌号 |
- 保险公司 |
- 商业保单号 |
- 交强保单号 |
- 销售座席 |
- 状态 |
- 当前操作 |
- 操作 |
-
- $item) {
- $start_index = ($page-1)*20 + $index;
- ?>
-
- =$index+1?> |
- =MyLib::substr_cut($item->id_man,30)?> |
- =$item->link_phone?> |
- =$item->car_no?> |
- =$item->company?$item->company->name:''?> |
- =$item->insurer1_no?> |
- =$item->insurer2_no?> |
- =$item->user?$item->user->getShowName():''?> |
- =$item->status->name?> |
- =$item->lock?$item->lock->getShowName():''?> |
-
- [详情]
- |
-
-
-
- =$page_info?> |
-
-
diff --git a/frontend/views/personnel/pay-info.php b/frontend/views/personnel/pay-info.php
index 81b1280..b214edb 100644
--- a/frontend/views/personnel/pay-info.php
+++ b/frontend/views/personnel/pay-info.php
@@ -1,166 +1,300 @@
+
+beginBlock('header_css'); ?>
+
+endBlock(); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+beginBlock('footer_js'); ?>
+endBlock('footer_js'); ?>
diff --git a/frontend/views/personnel/pay-list.php b/frontend/views/personnel/pay-list.php
index 68b0f69..3b2379f 100644
--- a/frontend/views/personnel/pay-list.php
+++ b/frontend/views/personnel/pay-list.php
@@ -1,203 +1,145 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 工号 |
- 真实姓名 |
- 工资月份 |
- 所属岗位 |
-
-
- 工资 |
- 是否离职 |
- 状态 |
- 操作 |
-
-
-
- =$page_info?> |
-
-
-
-
-
-
-
+
+
+
+endBlock(); ?>