优化数据库字段

优化功能代码
完成车辆提成管理功能开发
dev
曾超新 5 years ago
parent 72d6e31c57
commit ae2e96ce3e
  1. 69
      common/models/CarT.php
  2. 2
      common/models/OrderT.php
  3. 8
      frontend/controllers/BusinessOrderController.php
  4. 177
      frontend/controllers/CarController.php
  5. 5321
      frontend/controllers/DatabaseController.php
  6. 748
      frontend/controllers/FinanceController.php
  7. 4
      frontend/controllers/FixCarController.php
  8. 2
      frontend/controllers/GiftController.php
  9. 1669
      frontend/controllers/InsurerController.php
  10. 9
      frontend/controllers/MarketingStrategyController.php
  11. 28
      frontend/controllers/PhoneController.php
  12. 3
      frontend/views/car/info-track.php
  13. 4
      frontend/views/car/info.php
  14. 74
      frontend/views/finance/sel-user-dlg.php
  15. 584
      frontend/views/finance/ticheng-jisuan.php

@ -183,65 +183,6 @@ class CarT extends \common\models\Base
}
// public function getLocation()
// {
// $name = '';
// switch($this->location) {
// case 1:
// $name = 'A库';
// break;
// case 2:
// $carb=CarBT::findOne(['id'=>$this->id]);
// if($carb->back==1){
// $name = 'B库(新保处理无效库)';
// }else{
// $name = 'B库';
// }
// break;
// case 3:
// $name = 'C库';
// break;
// case 4:
// $name = 'D库';
// $card=CarDT::findOne(['id'=>$this->id]);
// if($card->back==1){
// $name = 'D库(续保处理无效库)';
// }else{
// $name = 'D库';
// }
// break;
// case 5:
// $name = '无效库';
// break;
// case 6:
// $name = 'E库';
// break;
// case 7:
// $name = 'F库';
// break;
// case 8:
// $name = 'F1新保四大公司无效库';
// break;
// case 9:
// $name = 'F2新保其他小公司无效库';
// break;
// case 10:
// $name = 'F3新保正常无效库';
// break;
// case 11:
// $name = 'F4续保四大公司无效库';
// break;
// case 12:
// $name = 'F5续保其他小公司无效库';
// break;
// case 13:
// $name = 'F6续保正常无效库';
// break;
// default:
// $name = '';
// }
// return $name;
// }
public function getLocation()
{
$name = '';
@ -331,4 +272,14 @@ class CarT extends \common\models\Base
return $this->hasOne(CarFT::className(),['id'=>'id']);
return null;
}
public function getOp1()
{
return $this->hasOne(UserT::className(),['id'=>'op1_id']);
}
public function getOp2()
{
return $this->hasOne(UserT::className(),['id'=>'op2_id']);
}
}

@ -349,7 +349,7 @@ class OrderT extends \common\models\Base
public function getUsers()
{
return $this->hasMany(OrderUserT::class,['order_id'=>'id']);
return $this->hasMany(OrderUserT::className(),['order_id'=>'id']);
}
/**

@ -208,7 +208,7 @@ class BusinessOrderController extends FixCarBaseController
if ('' !== $car_no) $query = $query->andWhere(['like', 'car_no', $car_no]);
if ($status >= 0) $query = $query->andWhere('status = \'' . $status.'\'');
if ('' !== $id_man) $query = $query->andWhere(['like', 'id_man', $id_man]);
if ('' !== $id_phone) $query = $query->andWhere(['like', 'id_phone', $id_phone]);
if ('' !== $id_phone) $query = $query->andWhere(['like', 'id_man_phone', $id_phone]);
if ('' !== $link_man) $query = $query->andWhere(['like', 'link_man', $link_man]);
if ('' !== $link_phone) $query = $query->andWhere(['like', 'link_phone', $link_phone]);
if ('' !== $start_time && '' !== $end_time) $query = $query->andWhere('created_at >= \'' . $start_time . '\' AND created_at <=\'' . $end_time . '\'');
@ -245,7 +245,7 @@ class BusinessOrderController extends FixCarBaseController
if ('' !== $car_no) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.car_no', $car_no]);
if ('' !== $status) $query = $query->joinWith('fix')->andWhere('fix_car_t.status = ' . $status);
if ('' !== $id_man) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.id_man', $id_man]);
if ('' !== $id_phone) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.id_phone', $id_phone]);
if ('' !== $id_phone) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.id_man_phone', $id_phone]);
if ('' !== $link_man) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.link_man', $link_man]);
if ('' !== $link_phone) $query = $query->joinWith('fix')->andWhere(['like', 'fix_car_t.link_phone', $link_phone]);
if ('' !== $start_time && '' !== $end_time) $query = $query->joinWith('fix')->andWhere('fix_car_t.created_at >= \'' . $start_time . '\' AND fix_car_t.created_at <=\'' . $end_time . '\'');
@ -385,9 +385,9 @@ class BusinessOrderController extends FixCarBaseController
$info->engine_no = $car_info->engine_no;
$info->car_frame_no = $car_info->car_frame_no;
$info->id_man = $car_info->id_man;
$info->id_phone = $car_info->phone;
$info->id_man_phone = $car_info->car_man_phone;
$info->link_man = $car_info->car_man;
$info->link_phone = $car_info->phone;
$info->link_man_phone = $car_info->car_man_phone;
$info->company = $car_info->company;
$info->brand_id = $car_info->brand_id;
$info->series_id = $car_info->series_id;

@ -151,171 +151,6 @@ class CarController extends BaseController
$objWriter = \PHPExcel_IOFactory::createWriter($objectPHPExcel, 'Excel5');
$objWriter->save('php://output');
}
//查找平移数据问题
public function actionPingyi()
{
//SELECT * FROM `car_log_t` WHERE `remark` = '从3005(饶丽云) 平移车辆给 3011(柳明芳·)' and `op_time` <'1541548800' and `op_man` ='0002(魏媛)' and `op_time` >'1533081600' ORDER BY `op_time` asc
// ['like', 'name', 'tester']
// ['remark'=>'从3005(饶丽云) 平移车辆给 3011(柳明芳·)'])
$datas=CarLogT::find()->where(['like', 'remark', '平移车辆'])
->andWhere(['<', 'op_time', '1541548800'])
->andWhere(['>', 'op_time', '1533081600'])
->andWhere(['op_man' =>'0002(魏媛)']);
// ->limit(29);
//
$bnum=0;
$enum=0;
$enum1=0;
$enum9=0;
// echo '<pre>';
foreach($datas->each(29) as $b_info) {
//// print_r($b_info->car_id);
// print_r($b_info->remark);
// echo '<br>';
$car= CarT::findOne(['id'=>$b_info->car_id]);
//开始头字母
$bestr=substr($b_info->remark,3,1);
$bestr4=substr($b_info->remark,3,4);
// var_dump($bestr4);
// die;
//分配的工号
$endstr=substr($b_info->remark,35);
// echo '<br>';
// var_dump($bestr);
// echo '<br>';
// var_dump($endstr);
// echo '<br>';
if($bestr==3){
continue;
// $car->op_user3=$endstr;
// $this->addLog($car->id,'补全平移数据问题',1);
$bnum++;
}elseif($bestr==1){
continue;
// $car->op_user1=$endstr;
// $this->addLog($car->id,'补全平移数据问题',1);
$enum++;
}elseif($bestr==2){
// if($bestr4==2057){
// $car->op_user1=$endstr;
// }else{
// continue;
// }
continue;
$enum1++;
}elseif($bestr==9){
// continue;
$car->op_user3=$endstr;
$this->addLog($car->id,'补全平移数据问题',1);
$enum9++;
}else{
continue;
}
//
$car->save();
//// print_r($car);
//
}
var_dump($bnum);
echo '<br>';
var_dump($enum);
echo '<br>';
var_dump($enum1);
echo '<br>';
var_dump($enum9);
// echo $datas->createCommand()->rawSql;
// $datas->all();
// var_dump($datas) ;
// $$datas->all();
// var_dump($datas);
return $this->renderPartial('index');
}
//查找重复的数据
public function actionChongf()
{
//select car_no,count(*) as count from car_t group by car_no having count>1
$num=0;
$cnum=0;
$xnum=0;
$query=CarT::find()->select('car_no,count(*) count,id,location,hiddenes')->groupBy('car_no')->having(['>' ,'count',1])
->where('location=3');
// aa($query);
$data=$query->all();
foreach($data as $vs){
$carlogNum=CarLogT::find()->where(['car_id'=>$vs->id])
// ->andWhere(['remark'=> '从F库分配到C库'])
->andWhere(['or', 'remark="从A库分配到C库"', 'remark="从B库分配到C库"', 'remark="从E库分配到C库"', 'remark="从F库分配到C库"', 'remark="从无效库分配到C库"'])
->count();
if($carlogNum==1){
// dd($info);
$dear= CarT::findOne(['id'=>$vs->id]);
$dear->hiddenes=1;
// $sa=$info->id();
if($dear->save()){
$num++;
}
// echo $info->car_no;
}else{
// $xnum++;
continue;
//
}
}
// foreach($query->each(10) as $info) {
//// $carlogNum=CarLogT::find()->where(['car_id'=>$info->id])->count();
//// if($carlogNum>=1){
//// continue;
//// }else{
//// $num++;
//// }
//
//// if($info->location==3){
//// $cnum++;
//// }else{
//// continue;
//// }
//// ['or', 'id=1', 'id=2']
// $carlogNum=CarLogT::find()->where(['car_id'=>$info->id])
//// ->andWhere(['remark'=> '从F库分配到C库'])
// ->andWhere(['or', 'remark="从A库分配到C库"', 'remark="从B库分配到C库"', 'remark="从E库分配到C库"', 'remark="从F库分配到C库"', 'remark="从无效库分配到C库"'])
// ->count();
// if($carlogNum==1){
//// dd($info);
// $info->hiddenes=1;
//// $sa=$info->save();
// if($info->save()){
// $num++;
// }
//// echo $info->car_no;
//
// }else{
//// $xnum++;
// continue;
////
// }
//
//
//
//
//
// }
// $data= $query->count();
//
// aa($query);
// var_dump($data);
echo $num;
echo '<br>';
// echo $xnum;
// echo $cnum;
}
public function actionJsonData()
{
Yii::$app->response->format = Response::FORMAT_JSON;
@ -701,14 +536,6 @@ class CarController extends BaseController
$insurer_company2_items = InsurerCompany2T::find()->all();
$pay_type_items = PayTypeT::find()->all();
$car_use_items = CarUseT::find()->all();
$car_type_items = CarTypeT::find()->all();
$brand_items = BrandT::find()->all();
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
$direction_items = DirectionT::find()
->all();
$range_items = RangeT::find()
@ -748,10 +575,6 @@ class CarController extends BaseController
'list' => $list,
'pay_type_items' => $pay_type_items,
'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'direction_items' => $direction_items,
'range_items' => $range_items,
'city_items' => $city_items,

File diff suppressed because it is too large Load Diff

@ -6425,7 +6425,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$car_info->id_number = $id_number;
}
if($id_phone != ''){
$car_info->id_phone = $id_phone;
$car_info->id_man_phone = $id_phone;
}
if($seats != ''){
$car_info->seats = $seats;
@ -6434,7 +6434,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$car_info->car_man_number = $car_man_number;
}
if($car_man_phone != ''){
$car_info->phone = $car_man_phone;
$car_info->car_man_phone = $car_man_phone;
}
if(!$car_info->save(false)) {
throw new \Exception(print_r($car_info->getErrors(), true));
@ -6482,7 +6482,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$car_info->id_number = $id_number;
}
if($id_phone != ''){
$car_info->id_phone = $id_phone;
$car_info->id_man_phone = $id_phone;
}
if($seats != ''){
$car_info->seats = $seats;
@ -6491,7 +6491,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$car_info->car_man_number = $car_man_number;
}
if($car_man_phone != ''){
$car_info->phone = $car_man_phone;
$car_info->car_man_phone = $car_man_phone;
}
if(!$car_info->save(false)) {
throw new \Exception(print_r($car_info->getErrors(), true));
@ -6657,61 +6657,91 @@ class FinanceController extends \frontend\controllers\UserBaseController
return $result;
}
public function actionTichengJisuan()
{
public function actionSelUserDlg() {
$request = Yii::$app->request;
$begin_date = $request->get('begin_date',date('Y-m-d'));
$end_date = $request->get('end_date',date('Y-m-d'));
$begin_totalclear = $request->get('begin_totalclear');
$end_totalclear = $request->get('end_totalclear');
$car_no_type = $request->get('car_no_type');
$company_id = $request->get('company_id');
$user_names = $request->get('user_names');
$car_no = $request->get('car_no');
$insurer_type = $request->get('insurer_type',1);
$dz_group = $request->get('dz_group');
$dz_rate = $request->get('dz_rate');
$dz_names = $request->get('dz_names');
$base_rate = $request->get('base_rate');
$xiaoyi_rate1 = $request->get('xiaoyi_rate1');
$xiaoyi_rate2 = $request->get('xiaoyi_rate2');
$online_rate = $request->get('online_rate');
$yeji_rate = $request->get('yeji_rate');
$gift1 = $request->get('gift1');
$gift2 = $request->get('gift2');
$gift3 = $request->get('gift3');
$gift4 = $request->get('gift4');
$gift5 = $request->get('gift5');
$ticket1 = $request->get('ticket1');
$ticket2 = $request->get('ticket2');
$ticket3 = $request->get('ticket3');
$zhengben_ticheng = $request->get('zhengben_ticheng');
$hebao_ticheng = $request->get('hebao_ticheng');
$songdan_ticheng = $request->get('songdan_ticheng');
$genzong_ticheng = $request->get('genzong_ticheng');
$first_xinbao_rate = $request->get('first_xinbao_rate');
$xianzhong_rate = $request->get('xianzhong_rate');
$name = $request->get('name');
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1)
$group_items = GroupT::getTree();
$is_fan= $request->get('is_fan',0);
return $this->render('sel-user-dlg',[
'group_items' => $group_items,
'id_name' => $name
]);
}
public function actionSelUserSearch() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '操作失败';
$username = $request->get('username');
$group_id = $request->get('group_id', 0);
$page = $request->get('page',1);
if($page < 1) $page = 1;
$query = UserT::find()->where('is_delete=0')
->orderBy('username', 'asc');
if($group_id > 0) {
$group_items = GroupT::getTree($group_id);
$group_ids = [];
$group_ids[] = $group_id;
foreach($group_items as $group_item) {
$group_ids[] = $group_item->id;
}
$query->andWhere('group_id in ('.join(',',$group_ids).')');
}
if($username != '') {
$query->andWhere('username like "'.$username.'%"');
}
$items = $query->all();
foreach($items as $item) {
$row = [];
$row['id'] = $item->id;
$row['username'] = $item->username;
$row['name'] = $item->getShowName();
$result['users'][] = $row;
}
$result['success'] = true;
$result['msg'] = '操作成功';
return $result;
}
$group_id = $request->get('group_id');
public function actionTichengJisuan() {
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053')
if($this->my->id == 1)
$group_items = GroupT::getTree();
$group_ids[] = $group_id;
$company_items = InsurerCompany2T::find()->all();
return $this->render('ticheng-jisuan',[
'group_items' => $group_items,
'company_items' => $company_items
]);
}
public function actionTichengJisuanJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$user_names = $request->get('user_names');
$car_no_type = $request->get('car_no_type');
$company_id = $request->get('company_id');
$insurer_type = $request->get('insurer_type',1);
$car_no = $request->get('car_no');
$begin_date = $request->get('begin_date',date('Y-m-d'));
$end_date = $request->get('end_date',date('Y-m-d'));
$begin_totalclear = $request->get('begin_totalclear');
$end_totalclear = $request->get('end_totalclear');
$group_id = $request->get('group_id', 0);
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$group_ids = [];
if($group_id > 0) {
$items = GroupT::getTree($group_id);
$group_ids[] = $group_id;
foreach($items as $group_info) {
$group_ids[] = $group_info->id;
}
@ -6726,92 +6756,68 @@ class FinanceController extends \frontend\controllers\UserBaseController
if($user_names != '' && $user_names != 'null'){
$user_arr = explode(',',$user_names);
$user_ids = [];
foreach ($user_arr as $user){
$username = substr($user,0,strpos($user, '('));
foreach ($user_arr as $username){
$user = UserT::find()->where('is_delete=0')->andWhere('username="'.$username.'"')->one();
if($user)
$user_ids[] = $user->id;
}
if($is_fan == 1){
$query = $query->andWhere(['not in','caiwu_t.user_id',$user_ids]);
}else{
$query = $query->andWhere(['in','caiwu_t.user_id',$user_ids]);
}
$query->andWhere(['in','caiwu_t.user_id',$user_ids]);
}
if( $company_id > 0) {
$query = $query->andWhere('order_t.company_id='.$company_id);
$query->andWhere('order_t.company2_id='.$company_id);
}
if( $car_no != '') {
$query = $query->andWhere('order_t.car_no="'.$car_no.'"');
$query->andWhere('order_t.car_no="'.$car_no.'"');
}
if($car_no_type == 1){
$query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
$query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
}elseif($car_no_type == 2){
$query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
$query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
}
if($begin_totalclear != ''){
$query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
$query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
}
if($end_totalclear != ''){
$query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
$query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
}
if ($begin_date != "") {
$query = $query->andWhere('order_t.print_date>="' . $begin_date . '"');
$query->andWhere('order_t.print_date>="' . $begin_date . '"');
}
if ($end_date != "") {
$query = $query->andWhere('order_t.print_date<="' . $end_date . '"');
$query->andWhere('order_t.print_date<="' . $end_date . '"');
}
$user_items = $this->my->getChildren('');
if($this->my->username == '6002' || $this->my->username == '7053')
$user_items = $this->my->getChildren('',1);
$user_items[] = $this->my;
$row = array();
foreach($user_items as $user_info) {
// if ($user_info->is_leave == 1) continue;
// var_dump($user_info);
if ($group_id > 0) {
if (!in_array($user_info->group_id, $group_ids)) {
continue;
}
}
$row[] = $user_info->id;
}
// var_dump($row);
//加上级别筛选
if($group_id > 0){
if($is_fan == 1){
$query = $query->andWhere(['not in','caiwu_t.user_id',$row]);
}else{
$query = $query->andWhere(['in','caiwu_t.user_id',$row]);
}
$query->andWhere(['in','caiwu_t.user_id',$row]);
}
$query1 = clone $query;
if($insurer_type ==1){
$query = $query->andWhere('caiwu_t.insurer_type=1');
$query->andWhere('caiwu_t.insurer_type=1');
}
$items = $query->all();
//echo $query->createCommand()->rawSql;
$total2_clear_all = $query1->andWhere('caiwu_t.insurer_type=2')->sum('total_clear');
$yewu_ticheng_all = 0;
@ -6822,7 +6828,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$liquan_all = 0;
$yuangong_money_all = 0;
foreach($items as $index => $item) {
$order_caiwu_info = $item->orderCaiwu;
$order_info = $item->order;
@ -6839,101 +6844,514 @@ class FinanceController extends \frontend\controllers\UserBaseController
$yuangong_money_all += $yuangong_money;
}
// $sum_r_total = $query->sum('r_total');
// //商业净保费综合
// $sum_total_clear = $query->sum('total_clear'); //是错误的
//
// //商业总保费
// $sum_total = $query->sum('total');
//
// $sum_total_dis = $query->sum('total_dis');
// echo $query->createCommand()->rawSql;exit;
$total = $query->count();
$query->offset($offset)->limit($limit);
$items = $query->all();
$total = $query->count();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$row['company_name'] = $item->order->company2->name;
$row['print_date'] = $item->order->print_date;
$row['yeji_rate'] = $item->orderCaiwu->yeji_rate;
$row['yeji_ticheng'] = $item->orderCaiwu->yeji_ticheng;
$row['ticheng_zong_rate'] = $item->order->ticheng_zong_rate;
$row['ticheng_money'] = $item->order->ticheng_money;
$row['gift1_price'] = $item->order->getGiftPrice(1,1);
$row['gift2_price'] = $item->order->getGiftPrice(1,2);
$row['yuangong_money'] = $item->order->yuangong_money;
$row['yewu_ticheng'] = $item->orderCaiwu->yewu_ticheng;
if($item->order->car->op2_id > 0) {
$row['op_user'] = $item->order->car->op2->showName;
$row['op_user1'] = $item->order->car->op1->showName;
} else {
$row['op_user'] = $item->order->car->op1->showName;
$row['op_user1'] = '';
}
$row['first_xinbao_ticheng'] = $item->orderCaiwu->first_xinbao_ticheng;
$row['hebao_ticheng'] = $item->orderCaiwu->hebao_ticheng;
$row['op1_user'] = $item->order->op1->showName;
$row['zhengben_ticheng'] = $item->orderCaiwu->zhengben_ticheng;
$row['op2_user'] = $item->order->op2->showName;
$row['dz_ticheng1'] = $item->orderCaiwu->dz_ticheng1;
$row['dz_names1'] = $item->orderCaiwu->dz_names1;
$row['dz_ticheng2'] = $item->orderCaiwu->dz_ticheng2;
$row['dz_names2'] = $item->orderCaiwu->dz_names2;
$row['dz_ticheng3'] = $item->orderCaiwu->dz_ticheng3;
$row['dz_names3'] = $item->orderCaiwu->dz_names3;
$row['dz_ticheng4'] = $item->orderCaiwu->dz_ticheng4;
$row['dz_names4'] = $item->orderCaiwu->dz_names4;
$row['dz_ticheng5'] = $item->orderCaiwu->dz_ticheng5;
$row['dz_names5'] = $item->orderCaiwu->dz_names5;
$data['rows'][] = $row;
}
return $data;
}
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
$pagination->setPage($page-1);
public function actionTichengJisuanSave()
{
set_time_limit(0);
ini_set('memory_limit', '3072M');
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '操作失败';
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$begin_date = $request->post('begin_date');
$end_date = $request->post('end_date');
$user_names = $request->post('user_names');
$begin_totalclear = $request->post('begin_totalclear');
$end_totalclear = $request->post('end_totalclear');
$car_no_type = $request->post('car_no_type');
$company_id = $request->post('company_id');
$car_no = $request->post('car_no');
$insurer_type = $request->post('insurer_type');
$dz_group = $request->post('dz_group');
$dz_rate = $request->post('dz_rate');
$dz_names = $request->post('dz_names');
$yeji_rate = $request->post('yeji_rate');
$zhengben_ticheng = $request->post('zhengben_ticheng');
$hebao_ticheng = $request->post('hebao_ticheng');
$songdan_ticheng = $request->post('songdan_ticheng');
$genzong_ticheng = $request->post('genzong_ticheng');
$first_xinbao_rate = $request->post('first_xinbao_rate');
$group_id = $request->post('group_id');
$group_ids[] = $group_id;
if($group_id > 0) {
$items = GroupT::getTree($group_id);
foreach($items as $group_info) {
$group_ids[] = $group_info->id;
}
}
$query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
->where('order_t.status_id>1')
->orderBy('order_t.print_date DESC');
if($user_names != '' && $user_names != 'null'){
$user_arr = explode(',',$user_names);
$user_ids = [];
foreach ($user_arr as $username){
$user = UserT::find()->where('is_delete=0')->andWhere('username="'.$username.'"')->one();
if($user)
$user_ids[] = $user->id;
}
$query->andWhere(['in','caiwu_t.user_id',$user_ids]);
}
if($company_id > 0) {
$query->andWhere('order_t.company2_id='.$company_id);
}
if( $car_no != '') {
$query->andWhere('order_t.car_no="'.$car_no.'"');
}
if($car_no_type == 1){
$query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
}elseif($car_no_type == 2){
$query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
}
if($begin_totalclear != ''){
$query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
}
if($end_totalclear != ''){
$query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
}
if ($begin_date != "") {
$query->andWhere('order_t.print_date>="' . $begin_date . '"');
}
if ($end_date != "") {
$query->andWhere('order_t.print_date<="' . $end_date . '"');
}
$user_items = $this->my->getChildren('');
$user_items[] = $this->my;
$row = array();
foreach($user_items as $user_info) {
if ($group_id > 0) {
if (!in_array($user_info->group_id, $group_ids)) {
continue;
}
}
$row[] = $user_info->id;
}
//加上级别筛选
if($group_id > 0){
$query->andWhere(['in','caiwu_t.user_id',$row]);
}
if($insurer_type == 1){
$query->andWhere('caiwu_t.insurer_type=1');
}
// echo $query->createCommand()->rawSql;exit;
$query1 = clone $query;
$items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$item1s = $query1->all();
foreach($items as $item) {
//在计算之前检查数据是否匹配
$order = $item->order;
$car = $order->car;
$count = OrderT::find()->where('car_no="' . $car->car_no . '"')->andWhere('status_id>1')
->andWhere('insurance_status <>2')->count();
$orders = OrderT::find()->where('car_no="' . $car->car_no . '"')->andWhere('status_id>1')
->andWhere('insurance_status <>2')->orderBy('print_date ASC')->all();
if ($car->op2_id == 0 && $car->op1_id != $item->user_id ) {
$result['msg'] = '数据错误,车牌:' . $car->car_no . '是新保car_t的op1_id:'.$car->op1_id.'--实际order_t的user_id:'.$item->user_id;
return $result;
}
if ($car->op2_id > 0 && $car->op2_id != $item->user_id) {
$result['msg'] = '数据错误,车牌:' . $car->car_no . '是续保但是car_t的op2_id:'.$car->op2_id.'--实际order_t的user_id:'.$item->user_id;
return $result;
}
$company_items = InsurerCompanyT::find()->all();
if ($count > 1) {
$ord = $orders[0];
if (empty($ord->user)) {
continue;
}
if ($car->op1_id != $orders[0]->user_id) {
$result['msg'] = '数据错误,车牌:' . $car->car_no . '是续保但原新保的car_t的op1_id:'.$car->op1_id.'--实际原新保的order_t的user_id:'.$orders[0]->user_id;
return $result;
}
$user_items = UserT::find()
->where('is_delete=0')
->orderBy('username ASC')
->all();
//
// $insurer_ticheng_items = InsurerTichengT::find()->orderBy('id')->all();
// $gift_ticheng_items = InsurerTichengGiftT::find()->orderBy('id')->all();
$gift_items = GiftT::find()->where('type_id=1')->orderBy('id')->all();
$ticket_items = GiftT::find()->where('type_id=2')->orderBy('id')->all();
}
}
$dz_ids = [];
if($dz_names != '' && $dz_names != 'null'){
$user_arr = explode(',',$dz_names);
foreach ($user_arr as $user){
$username = substr($user,0,strpos($user, '('));
$user = UserT::find()->where('is_delete=0')->andWhere('username="'.$username.'"')->one();
if($user)
$dz_ids[] = $user->id;
}
}
$tran = OrderCaiwuT::getDb()->beginTransaction();
try {
foreach ($items as $item){
$order_caiwu_info = $item->orderCaiwu;
$order_info = $item->order;
if($order_caiwu_info){
if($yeji_rate != '')
$order_caiwu_info->yeji_rate = $yeji_rate;
if($dz_rate != ''){
if($dz_group == 1) {
$order_caiwu_info->dz_rate1 = $dz_rate;
}elseif ($dz_group == 2){
$order_caiwu_info->dz_rate2 = $dz_rate;
}elseif ($dz_group == 3){
$order_caiwu_info->dz_rate3 = $dz_rate;
}elseif ($dz_group == 4){
$order_caiwu_info->dz_rate4 = $dz_rate;
}elseif ($dz_group == 5){
$order_caiwu_info->dz_rate5 = $dz_rate;
}
}
if($dz_names != ''){
if($dz_group == 1) {
$order_caiwu_info->dz_names1 = $dz_names != 0 ? $dz_names : '';
}elseif ($dz_group == 2){
$order_caiwu_info->dz_names2 = $dz_names != 0 ? $dz_names : '';
}elseif ($dz_group == 3){
$order_caiwu_info->dz_names3 = $dz_names != 0 ? $dz_names : '';
}elseif ($dz_group == 4){
$order_caiwu_info->dz_names4 = $dz_names != 0 ? $dz_names : '';
}elseif ($dz_group == 5){
$order_caiwu_info->dz_names5 = $dz_names != 0 ? $dz_names : '';
}
}
if($first_xinbao_rate != '')
$order_caiwu_info->first_xinbao_rate = $first_xinbao_rate;
//商业净保费
$total_clear = $item->total_clear;
//业绩提成
if($yeji_rate != '')
$yeji_ticheng = $total_clear * $yeji_rate /100;
if($first_xinbao_rate != '')
$first_xinbao_ticheng = $first_xinbao_rate * $total_clear /100;
if($yeji_rate != '')
$order_caiwu_info->yeji_ticheng = $yeji_ticheng;
if($dz_rate != ''){
if($dz_group == 1) {
$order_caiwu_info->dz_ticheng1 = $total_clear * $dz_rate /100;
}elseif ($dz_group == 2){
$order_caiwu_info->dz_ticheng2 = $total_clear * $dz_rate /100;
}elseif ($dz_group == 3){
$order_caiwu_info->dz_ticheng3 = $total_clear * $dz_rate /100;
}elseif ($dz_group == 4){
$order_caiwu_info->dz_ticheng4 = $total_clear * $dz_rate /100;
}elseif ($dz_group == 5){
$order_caiwu_info->dz_ticheng5 = $total_clear * $dz_rate /100;
}
}
if($first_xinbao_rate != '')
$order_caiwu_info->first_xinbao_ticheng = $first_xinbao_ticheng;
$order_caiwu_info->ticheng_zong_rate = $order_info->ticheng_zong_rate;
$order_caiwu_info->ticheng_money = $order_info->ticheng_money;
$order_caiwu_info->yuangong_money = $order_info->yuangong_money;
$order_caiwu_info->celuo_id = $order_info->celuo_id;
$yuangong_money = $order_caiwu_info->yuangong_money >0 ? $order_caiwu_info->yuangong_money : 0;
$yewu_ticheng = $order_caiwu_info->yeji_ticheng + $order_caiwu_info->ticheng_money - $yuangong_money;
$yewu_ticheng -= $order_info->getGiftPrice(1,1);
$yewu_ticheng -= $order_info->getGiftPrice(1,2);
$order_caiwu_info->yewu_ticheng = $yewu_ticheng;
if(!$order_caiwu_info->save()) {
throw new \Exception(print_r($order_caiwu_info->getErrors(), true));
}
//处理新保、跟踪、续保提成
$order_info = $order_caiwu_info->order;
$car_info = $order_info->car;
//新保
if($car_info->op1_id > 0 && ($yeji_rate != '' || $first_xinbao_rate != '' || $yeji_rate === '0' || $first_xinbao_rate === '0')) {
$pay1_user = $car_info->op1;
if ($pay1_user && $pay1_user->is_delete == 0) {
$pay_order_user = PayOrderUserT::find()
->where('order_id='.$order_info->id)
->andWhere('user_id='.$pay1_user->id)
->andWhere('pay_date="'.$order_caiwu_info->pay_date.'"')
->andWhere('type=1')
->one();
if(!$pay_order_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $pay1_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 1; //新保
$pay_order_user->is_own = $car_info->op2_id > 0 ? 0 : 1;//现在用判断是原新保
$pay_order_user->pay_date = $order_caiwu_info->pay_date;
if(!$pay_order_user->save()) {
throw new \Exception(print_r($pay_order_user->getErrors(), true));
}
}
if($pay_order_user){
$pay_order_user->calPay();
if($pay_order_user->is_own == 0 && $first_xinbao_rate === '0'){
$pay_order_user->delete();
}elseif($pay_order_user->is_own == 1 && $yeji_rate === '0'){
$pay_order_user->delete();
}
}
}
}
//续保
if($car_info->op2_id > 0 && ($yeji_rate != '' || $yeji_rate === '0') ) {
$pay3_user = $car_info->op2;
if ($pay3_user && $pay3_user->is_delete==0) {
$pay_order_user = PayOrderUserT::find()
->where('order_id='.$order_info->id)
->andWhere('user_id='.$pay3_user->id)
->andWhere('pay_date="'.$order_caiwu_info->pay_date.'"')
->andWhere('type=3')
->one();
if(!$pay_order_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $pay3_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 3; //续保
$pay_order_user->is_own = 1;
$pay_order_user->pay_date = $order_caiwu_info->pay_date;
if(!$pay_order_user->save()) {
throw new \Exception(print_r($pay_order_user->getErrors(), true));
}
}
$pay_order_user->calPay();
if($yeji_rate === '0'){
$pay_order_user->delete();
}
}
}
foreach ($dz_ids as $id){
$pay_order_user = PayOrderUserT::find()
->where('order_id='.$order_info->id)
->andWhere('user_id='.$id)
->andWhere('pay_date="'.$order_caiwu_info->pay_date.'"')
->andWhere('type=10')
->one();
if(!$pay_order_user){
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 10; //团队长
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $order_caiwu_info->pay_date;
if(!$pay_order_user->save()) {
throw new \Exception(print_r($pay_order_user->getErrors(), true));
}
}
$pay_order_user->calPay($dz_group);
if($dz_rate === '0'){
$pay_order_user->delete();
}
}
}else{
$result['success'] = true;
$result['msg'] = '保存失败,order_caiwu_t不存在'.$item->id;
return $result;
}
}
foreach ($item1s as $item){
$order_caiwu_info = $item->orderCaiwu;
$order_info = $item->order;
if($order_caiwu_info){
if($hebao_ticheng != '')
$order_caiwu_info->hebao_ticheng = $hebao_ticheng;
if($zhengben_ticheng != '')
$order_caiwu_info->zhengben_ticheng = $zhengben_ticheng;
if($songdan_ticheng != '')
$order_caiwu_info->songdan_ticheng = $songdan_ticheng;
if($genzong_ticheng != '')
$order_caiwu_info->genzong_ticheng = $genzong_ticheng;
if(!$order_caiwu_info->save()) {
throw new \Exception(print_r($order_caiwu_info->getErrors(), true));
}
//处理新保、跟踪、续保提成
$order_info = $order_caiwu_info->order;
$car_info = $order_info->car;
//核保
if($order_info->op1 && ($hebao_ticheng != '' || $hebao_ticheng === '0') ){
$op11= substr($order_info->op1->getShowName(),0,strpos($order_info->op1->getShowName(),'('));
$op1_user = $order_info->op1;
if($op1_user && $op1_user->is_delete == 0) {
$pay_order_user = PayOrderUserT::find()
->where('order_id='.$order_info->id)
->andWhere('user_id='.$op1_user->id)
->andWhere('pay_date="'.$order_caiwu_info->pay_date.'"')
->andWhere('type=5')
->one();
if(!$pay_order_user){
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $op1_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 5; //核保
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $order_caiwu_info->pay_date;
if(!$pay_order_user->save()) {
throw new \Exception(print_r($pay_order_user->getErrors(), true));
}
}
$pay_order_user->calPay();
if($hebao_ticheng === '0'){
$pay_order_user->delete();
}
}
}
//正本
if($order_info->op2 && ($zhengben_ticheng != '' || $zhengben_ticheng === '0')){
$op22= substr($order_info->op2->getShowName(),0,strpos($order_info->op2->getShowName(),'('));
$op2_user = $order_info->op2;
if($op2_user && $op2_user->is_delete==0) {
$pay_order_user = PayOrderUserT::find()
->where('order_id='.$order_info->id)
->andWhere('user_id='.$op2_user->id)
->andWhere('pay_date="'.$order_caiwu_info->pay_date.'"')
->andWhere('type=6')
->one();
if(!$pay_order_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $op2_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 6; //正本
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $order_caiwu_info->pay_date;
if(!$pay_order_user->save()) {
throw new \Exception(print_r($pay_order_user->getErrors(), true));
}
}
$pay_order_user->calPay();
if($zhengben_ticheng === '0'){
$pay_order_user->delete();
}
}
}
}else{
$result['success'] = true;
$result['msg'] = '保存失败,order_caiwu_t不存在'.$item->id;
return $result;
}
}
$result['success'] = true;
$result['msg'] = '保存成功';
$tran->commit();
} catch(\Exception $e) {
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
return $result;
return $this->render('ticheng-jisuan', [
'items' => $items,
'page_info' => $page_info,
'begin_date' => $begin_date,
'end_date' => $end_date,
// 'sum_r_total' => $sum_r_total,
// 'sum_total_clear' => $sum_total_clear,
// 'sum_total' => $sum_total,
// 'sum_total_dis' => $sum_total_dis,
'company_items' => $company_items,
'begin_totalclear' => $begin_totalclear,
'end_totalclear' => $end_totalclear,
'car_no_type' => $car_no_type,
'company_id' => $company_id,
'car_no' =>$car_no,
'is_fan' =>$is_fan,
'insurer_type' =>$insurer_type,
'user_names' =>$user_names,
'dz_group'=>$dz_group,
'dz_rate' =>$dz_rate,
'dz_names' =>$dz_names,
'group_id'=>$group_id,
'group_items'=>$group_items,
'base_rate' => $base_rate,
'xiaoyi_rate1' => $xiaoyi_rate1,
'xiaoyi_rate2' => $xiaoyi_rate2,
'online_rate' => $online_rate,
'yeji_rate' => $yeji_rate,
'gift1' => $gift1,
'gift2' => $gift2,
'gift3' => $gift3,
'gift4' => $gift4,
'gift5' => $gift5,
'ticket1' => $ticket1,
'ticket2' => $ticket2,
'ticket3' => $ticket3,
'zhengben_ticheng' => $zhengben_ticheng,
'hebao_ticheng' => $hebao_ticheng,
'songdan_ticheng' => $songdan_ticheng,
'genzong_ticheng' => $genzong_ticheng,
'first_xinbao_rate' => $first_xinbao_rate,
'xianzhong_rate' => $xianzhong_rate,
'user_items' => $user_items,
'gift_items'=>$gift_items,
'ticket_items'=>$ticket_items,
'ticheng_money_all'=>$ticheng_money_all,
'total1_clear_all'=>$total1_clear_all,
'total2_clear_all'=>$total2_clear_all,
'yewu_ticheng_all'=>$yewu_ticheng_all,
'yeji_ticheng_all'=>$yeji_ticheng_all,
'ticheng_money_all'=>$ticheng_money_all,
'lipin_all'=>$lipin_all,
'liquan_all'=>$liquan_all,
'yuangong_money_all'=>$yuangong_money_all,
// 'insurer_ticheng_items' => $insurer_ticheng_items,
// 'gift_ticheng_items' => $gift_ticheng_items
]);
}
/**
* 出纳工资列表
* @return string

@ -198,7 +198,7 @@ class FixCarController extends BaseController
$info->engine_no = $car_info->engine_no;
$info->car_frame_no = $car_info->car_frame_no;
$info->id_man = $car_info->id_man;
$info->id_phone = $car_info->phone;
$info->id_man_phone = $car_info->phone;
$info->link_man = $car_info->car_man;
$info->link_phone = $car_info->phone;
$info->company = $car_info->company;
@ -398,7 +398,7 @@ class FixCarController extends BaseController
$row->displacement_id = $displacement_id;
$row->car_year = $car_year;
$row->id_man = $id_man;
$row->id_phone = $id_phone;
$row->id_man_phone = $id_phone;
$row->link_man = $link_man;
$row->link_phone = $link_phone;
$row->company = $company;

@ -998,7 +998,7 @@ class GiftController extends \yii\web\Controller
$query = $query->andWhere('gift_ticket_t_use.type_id='.$type_id);
}
// echo $query->createCommand()->rawSql;
// echo $query->createCommand()->rawSql;exit;
$total = $query->count();
$items = $query->offset($offset)->limit($limit)->all();
$data = [];

File diff suppressed because it is too large Load Diff

@ -4,6 +4,7 @@
namespace frontend\controllers;
use common\models\CarT;
use common\models\GiftT;
use common\models\OrderGiftT;
use common\models\UserT;
@ -462,11 +463,17 @@ class MarketingStrategyController extends UserBaseController
$result['success'] = false;
$result['msg'] = '没有合适的策略';
$car_id = $request->post('car_id');
$total1_clear = $request->post('total1_clear', 0);
$car_no = $request->post('car_no');
$car_use_id = $request->post('car_use_id', 0);
$company2_id = $request->post('company2_id', 0);
$car_info = CarT::findOne($car_id);
if(!$car_info) {
$result['msg'] = '车辆信息不存在';
return $result;
}
//获取自己的所有策略
$items = ZhongjiUserT::find()
->where(['user_id'=>$this->my->id])
@ -519,7 +526,7 @@ class MarketingStrategyController extends UserBaseController
if($item->type_ids != '') {
$type_ids = explode(',',$item->type_ids);
$tmp_type_id = 1;
if($car_no->xubao_num > 0)
if($car_info->is_xubao > 0)
$tmp_type_id = 2;
if(in_array($tmp_type_id, $type_ids)) {
$flag = true;

@ -286,7 +286,6 @@ class PhoneController extends \yii\web\Controller
//$b = new GiftCreateImageErrorT();
$network_phone = NetworkPhoneT::findOne(['recorder_id'=>$recorder_id]);
if(!$network_phone){
$network_phone = new NetworkPhoneT();
$assign = NetworkPhoneAssignT::findOne(['phone'=>$caller,'is_phone'=>1]);
if(!$assign){
@ -372,33 +371,6 @@ class PhoneController extends \yii\web\Controller
}
return json_encode(['code' => 0,'message' => "成功"]);
$phone_items = NetworkPhoneT::find()->where('release_time>="'.$begin_time.'"')
->andWhere('release_time<="'.$end_time.'"')
->andWhere('call_result="ANSWERED"')
->andWhere('record_file_url is null or record_file_url = ""')
->andWhere('record_file_url_real is not null or record_file_url_real <> ""')
->all();
foreach ($phone_items as $item) {
if ($item->record_file_url == '') {
$url = '';
if ($item->record_file_url_real != '') {
$url = $this->phoneMp3($item->record_file_url_real);
}
if ($url != '') {
$item->record_file_url = $url;
$item->save(false);
}
}
}
return json_encode(['code' => 0,'message' => "成功"]);
}
function phoneMp3Bak($url) {

@ -49,7 +49,7 @@ use \common\libs\MyLib;
<th class="bg-warning">证件号码</th>
<td><?=$car_info->car_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$car_info->phone?></td>
<td><?=$car_info->car_man_phone?></td>
</tr>
<tr>
<th class="bg-warning" nowrap>商业起保日期</th>
@ -193,6 +193,7 @@ use \common\libs\MyLib;
o['car_id'] = '<?=$car_info->id?>';
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
});
return false;

@ -50,8 +50,8 @@ use \common\libs\MyLib;
</div>
<label class="col-sm-1 control-label">联系电话</label>
<div class="col-sm-3">
<label class="form-control-static"><?=$car_info->phone?></label>
<a class="btn btn-primary btn-bitbucket" onclick="sendMsg('ATD','<?=$car_info->phone?>')">
<label class="form-control-static"><?=$car_info->car_man_phone?></label>
<a class="btn btn-primary btn-bitbucket" onclick="sendMsg('ATD','<?=$car_info->car_man_phone?>')">
<i class="fa fa-phone"></i>
</a>
<a class="btn btn-danger btn-bitbucket" onclick="sendMsg('ATH')">

@ -0,0 +1,74 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-inline" id="searchFrm">
<div class="form-group">
<label for="username">搜索工号</label>
<input type="text" id="username" name="username" class="form-control" autocomplete="off">
</div>
<div class="form-group">
<label for="group_id">级别</label>
<select name="group_id" id="group_id" class="form-control">
<option value="0">全部</option>
<?php
foreach($group_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $group_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div>
<button type="button" onclick="search()" class="form-control">搜索</button>
</form>
<hr>
<form role="form" id="theFrm" class="form-horizontal">
<div class="form-group">
<div class="col-sm-12" id="users"></div>
</div>
<button type="button" class="col-sm-offset-2 btn btn-primary btn-save">添加</button>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var params = $('#searchFrm').serialize();
$('#users').html('');
$.get('/finance/sel-user-search?' + params, function(obj) {
if(obj.success) {
obj.users.forEach(function(item, index) {
var html = '<div class="checkbox checkbox-inline">';
html += '<input type="checkbox" id="user_' + item.id + '" name="ids[]" value="' + item.username + '">';
html += '<label for="user_' + item.id + '"> ' + item.name + ' </label>';
html += '</div>';
$('#users').html( $('#users').html() + html);
});
}
},'json');
}
$(function () {
search();
//提交按钮
$(".btn-save").click(function(){
var str = [];
$('input:checkbox:checked').each(function(index, item) {
str.push($(item).val());
});
parent.$('#<?=$id_name?>').val(str.join(','));
layer_close();
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,369 +1,239 @@
<?php
use \common\libs\MyLib;
use common\models\OrderGiftT;
?>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
<!--新增搜索项-->
<!--完成程度-->
业务员:<input name="user_names" id="user_names" user_ids="" type="text" style="width:60%;" value="<?=$user_names?>">
<br>模糊<input name="select_user" id="select_user" type="text" style="width:100px;" value="">
<input type="checkbox" id="all" value="1">全选&nbsp;&nbsp;
<input type="checkbox" id="no_num" value="1">非数字&nbsp;&nbsp;
<input type="button" class="act_btn" id="add-user" name="add-user" value="+工号">
<input type="checkbox" id="is_fan" value="1" <?=$is_fan==1?'checked':''?>>取反&nbsp;&nbsp;
<br>
车牌类型:<select name="car_no_type">
<option value="0" >所有类型</option>
<option value="1" <?= $car_no_type == 1 ? 'selected': ''?>>京牌</option>
<option value="2" <?= $car_no_type == 2 ? 'selected': ''?>>非京牌</option>
<option value="3" <?= $car_no_type == 3 ? 'selected': ''?>>特殊车辆</option>
</select>
险种类型:<select name="insurer_type">
<option value="1" <?= $insurer_type == 1 ? 'selected': ''?>>商业</option>
<option value="2" <?= $insurer_type == 2 ? 'selected': ''?>>商业+交强</option>
</select>
保险公司:<select name="company_id">
<option value="0">所有公司</option>
<?php
foreach($company_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
车牌号:<input name="car_no" type="text" value="<?=$car_no?>">
<!--日期-->
出单日期:
<input type="Text" class="Wdate" name="begin_date" onclick="WdatePicker()" value="<?= $begin_date ?>" autocomplete="off" />
--
<input type="Text" class="Wdate" name="end_date" onclick="WdatePicker()" value="<?= $end_date ?>" autocomplete="off"/>
&nbsp;&nbsp;<br>商业净保费:
<input type="Text" class="" name="begin_totalclear" " value="<?= $begin_totalclear ?>" />
--
<input type="Text" class="" name="end_totalclear" " value="<?= $end_totalclear?>" />
级别:<select name="group_id">
<option value="0">全部</option>
<?php
foreach($group_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $group_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="output-btn" name="output-btn" value="导出">
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="td_bg">
基本提成比例:<input name="yeji_rate" type="text" value="<?=$yeji_rate?>">%
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
团队长组:
<select name="dz_group">
<option value="0">请选择</option>
<option value="1" <?php if($dz_group == 1){echo 'selected';}?>>团队长组1</option>
<option value="2" <?php if($dz_group == 2){echo 'selected';}?>>团队长组2</option>
<option value="3" <?php if($dz_group == 3){echo 'selected';}?>>团队长组3</option>
<option value="4" <?php if($dz_group == 4){echo 'selected';}?>>团队长组4</option>
<option value="5" <?php if($dz_group == 5){echo 'selected';}?>>团队长组5</option>
</select>
团队长提成比例:<input name="dz_rate" type="text" value="<?=$dz_rate?>">%
&nbsp;&nbsp;
团队长:<input name="dz_names" id="dz_names" type="text" style="width:30%;" value="<?=$dz_names?>">
<input type="button" class="act_btn" id="add-dz" name="add-dz" value="+工号">
</td>
</tr>
<tr>
<td class="td_bg">
<!--新增搜索项-->
<!--完成程度-->
核保提成:<input name="hebao_ticheng" type="text" value="<?=$hebao_ticheng?>">&nbsp;&nbsp;
正本提成:<input name="zhengben_ticheng" type="text" value="<?=$zhengben_ticheng?>">&nbsp;&nbsp;
送单提成:<input name="songdan_ticheng" type="text" value="<?=$songdan_ticheng?>">&nbsp;&nbsp;
原新保提成比例:<input name="first_xinbao_rate" type="text" value="<?=$first_xinbao_rate?>">%
<input type="button" class="act_btn" id="jisuan-btn" name="jisuan-btn" value="计算">
<!-- <input type="button" class="act_btn" id="output-btn" name="output-btn" value="导出">-->
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="24" align="center" class="bg_tr">序号</td>
<td align="center" class="bg_tr">车牌号</td>
<td align="center" class="bg_tr">被保险人</td>
<td align="center" class="bg_tr">保险公司</td>
<td align="center" class="bg_tr">保单号</td>
<td align="center" class="bg_tr">出单日期</td>
<td align="center" class="bg_tr">商业净保费</td>
<td align="center" class="bg_tr">手续费比例</td>
<td align="center" class="bg_tr">基本提成比例</td>
<td align="center" class="bg_tr">基本提成</td>
<td align="center" class="bg_tr">加点提成比例</td>
<td align="center" class="bg_tr">加点提成</td>
<td align="center" class="bg_tr">自费礼品</td>
<td align="center" class="bg_tr">自费礼券</td>
<td align="center" class="bg_tr">自费减免金额</td>
<td align="center" class="bg_tr">提成</td>
<td align="center" class="bg_tr">业务员</td>
<td align="center" class="bg_tr">原新保提成</td>
<td align="center" class="bg_tr">原新保业务员</td>
<td align="center" class="bg_tr">核保提成</td>
<td align="center" class="bg_tr">核保业务员</td>
<td align="center" class="bg_tr">正本提成</td>
<td align="center" class="bg_tr">正本业务员</td>
<td align="center" class="bg_tr">送单提成</td>
<td align="center" class="bg_tr">送单人</td>
<td align="center" class="bg_tr">团队长组1提成</td>
<td align="center" class="bg_tr">团队长组1</td>
<td align="center" class="bg_tr">团队长组2提成</td>
<td align="center" class="bg_tr">团队长组2</td>
<td align="center" class="bg_tr">团队长组3提成</td>
<td align="center" class="bg_tr">团队长组3</td>
<td align="center" class="bg_tr">团队长组4提成</td>
<td align="center" class="bg_tr">团队长组4</td>
<td align="center" class="bg_tr">团队长组5提成</td>
<td align="center" class="bg_tr">团队长组5</td>
</tr>
<?php
foreach($items as $index => $item) {
$start_index = $index;
// $users=$item->user->group;
// $username=$item->user;
// $uname=$username['name'];
// $nams=$users['name'];
$total_real = $item->total * $item->total_rate/100;
$total_clear_real = $item->total_clear * $item->total_rate/100;
$total_dis = round($total_clear_real - $item->r_total,2);
$order_caiwu_info = $item->orderCaiwu;
$order_info = $item->order;
$car_info = $order_info->car;
$is_xinbao = $car_info->op_user3 == ''?1:0;
?>
<tr style="height:24px;" onMouseOver="overColor(this)" onMouseOut="outColor(this)">
<td align="center" class="td_bg" nowrap><?=$start_index+1?></td>
<td align="center" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="center" class="td_bg" nowrap><?=$item->id_man?></td>
<td align="center" class="td_bg" nowrap><?=$order_info && $order_info->company ? $order_info->company->name:''?></td>
<td align="center" class="td_bg" nowrap><?=$item->insurer_no?></td>
<td align="center" class="td_bg" nowrap><?=$order_info ? $order_info->print_date : ''?></td>
<td align="center" class="td_bg" nowrap><?=$item->total_clear?></td>
<td align="center" class="td_bg" nowrap><?=$item->total_rate?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->yeji_rate:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->yeji_ticheng:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info?$order_info->ticheng_zong_rate:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info?$order_info->ticheng_money:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info?$order_info->getGiftPrice(1,1):''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info?$order_info->getGiftPrice(1,2):''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info?$order_info->yuangong_money:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->yewu_ticheng:''?></td>
<?php if($is_xinbao ==1):?>
<td align="center" class="td_bg" nowrap><?=$car_info?$car_info->op_user1:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->first_xinbao_ticheng:''?></td>
<td align="center" class="td_bg" nowrap></td>
<?php else:?>
<td align="center" class="td_bg" nowrap><?=$car_info?$car_info->op_user3:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->first_xinbao_ticheng:''?></td>
<td align="center" class="td_bg" nowrap><?=$car_info?$car_info->op_user1:''?></td>
<?php endif;?>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->hebao_ticheng:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info->op1?$order_info->op1->getShowName():''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->zhengben_ticheng:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info->op2?$order_info->op2->getShowName():''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->songdan_ticheng:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_info->sendLog?$order_info->sendLog->user->getShowName():''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_ticheng1:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_names1:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_ticheng2:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_names2:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_ticheng3:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_names3:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_ticheng4:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_names4:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_ticheng5:''?></td>
<td align="center" class="td_bg" nowrap><?=$order_caiwu_info?$order_caiwu_info->dz_names5:''?></td>
</tr>
<?php
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>车险提成管理</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">业务员</label>
<div class="input-group">
<input type="text" id="user_names" name="user_names" class="form-control">
<a class="input-group-addon" onclick="selUserDlg('user_names')">+</a>
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">车牌类型</label>
<select name="car_no_type" class="form-control">
<option value="0" >所有类型</option>
<option value="1">京牌</option>
<option value="2">非京牌</option>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">保险公司</label>
<select name="company_id" class="form-control">
<option value="0">全部</option>
<?php
foreach($company_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">险种类型</label>
<select name="insurer_type" class="form-control">
<option value="1">商业</option>
<option value="2">商业+交强</option>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">出单日期</label>
<div class="input-group input-daterange" id="datepicker1">
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" id="end_date" name="end_date" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">商业净保费</label>
<div class="input-group">
<input type="text" id="begin_totalclear" name="begin_totalclear" class="form-control">
<div class="input-group-addon">-</div>
<input type="text" id="end_totalclear" name="end_totalclear" class="form-control">
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">级别</label>
<select name="group_id" class="form-control">
<option value="0">全部</option>
<?php
foreach($group_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
<button type="button" class="btn btn-primary mb-8">导出</button>
<hr>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">基本提成比例</label>
<input type="text" id="yeji_rate" name="yeji_rate" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">团队长组</label>
<select name="dz_group" class="form-control">
<option value="0">请选择</option>
<option value="1">团队长组1</option>
<option value="2">团队长组2</option>
<option value="3">团队长组3</option>
<option value="4">团队长组4</option>
<option value="5">团队长组5</option>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">团队长提成比例</label>
<input type="text" id="dz_rate" name="dz_rate" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">团队长</label>
<div class="input-group">
<input type="text" id="dz_names" name="dz_names" class="form-control">
<a class="input-group-addon" onclick="selUserDlg('dz_names')">+</a>
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">核保提成</label>
<input type="text" id="hebao_ticheng" name="hebao_ticheng" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">正本提成</label>
<input type="text" id="zhengben_ticheng" name="zhengben_ticheng" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">送单提成</label>
<input type="text" id="songdan_ticheng" name="songdan_ticheng" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">原新保提成比例</label>
<input type="text" id="first_xinbao_rate" name="first_xinbao_rate" class="form-control">
</div>
<button type="button" class="btn btn-primary mb-8 calc-btn">计算</button>
<hr>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th width="50" data-field="id">ID</th>
<th data-field="car_no">车牌号</th>
<th data-field="id_man">被保险人</th>
<th data-field="company_name">保险公司</th>
<th data-field="insurer_no">保单号</th>
<th data-field="print_date">出单日期</th>
<th data-field="total_clear">商业净保费</th>
<th data-field="total_rate">手续费比例</th>
<th data-field="yeji_rate">基本提成比例</th>
<th data-field="yeji_ticheng">基本提成</th>
<th data-field="ticheng_zong_rate">加点提成比例</th>
<th data-field="ticheng_money">加点提成</th>
<th data-field="gift1_price">自费礼品</th>
<th data-field="gift2_price">自费礼券</th>
<th data-field="yuangong_money">自费减免金额</th>
<th data-field="yewu_ticheng">提成</th>
<th data-field="op_user">业务员</th>
<th data-field="first_xinbao_ticheng">原新保提成</th>
<th data-field="op_user1">原新保业务员</th>
<th data-field="hebao_ticheng">核保提成</th>
<th data-field="op1_user">核保业务员</th>
<th data-field="zhengben_ticheng">正本提成</th>
<th data-field="op2_user">正本业务员</th>
<th data-field="dz_ticheng1">团队长组1提成</th>
<th data-field="dz_names1">团队长组1</th>
<th data-field="dz_ticheng2">团队长组2提成</th>
<th data-field="dz_names2">团队长组2</th>
<th data-field="dz_ticheng3">团队长组3提成</th>
<th data-field="dz_names3">团队长组3</th>
<th data-field="dz_ticheng4">团队长组4提成</th>
<th data-field="dz_names4">团队长组4</th>
<th data-field="dz_ticheng5">团队长组5提成</th>
<th data-field="dz_names5">团队长组5</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
var o = {};
function selUserDlg(name) {
title = '选择用户';
layer_show(title, '/finance/sel-user-dlg?name='+name);
}
?>
<tr>
<td align="center" class="td_bg" nowrap>合计</td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap>总合计保费</td>
<td align="center" class="td_bg" nowrap><?=number_format($total1_clear_all+$total2_clear_all,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($total1_clear_all,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($yeji_ticheng_all,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($ticheng_money_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($lipin_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($liquan_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($yuangong_money_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($yewu_ticheng_all,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
</tr>
<tr >
<td height="25" colspan="18" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
<link href="/css/fSelect.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.fileupload.js"></script>
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611">
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605">
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605">
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script>
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js?v=2019"></script><script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
<script src="/js/fSelect.js"></script>
<script type="text/javascript" language="javascript" src="/js/artDialog/artDialog.js?skin=default"></script>
<script type="text/javascript" language="javascript" src="/js/artDialog/plugins/iframeTools.source.js"></script>
<script type="text/javascript" language="javascript">
function edit(id) {
var params = $('#searchForm').serialize();
window.location.href = '/finance/receipt-info?id=' + id + '&back_params=' + encodeURIComponent(params);
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
$(function () {
//搜索
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize() + '&user_ids=' + $('.user_names').val() + '&is_fan=' + $('#is_fan:checked').val();
window.location.href = "/finance/ticheng-jisuan?" + params;
function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$("#output-btn").click(function () {
$('#page').val(0);
var params = $('#searchForm').serialize();
//window.location.href = "/finance/receipt-output?" + params;
var url = "/finance/receipt-ticheng-output";
$.get(url, params, function (obj) {
alert(obj.msg);
if (obj.success) {
window.location.href = obj.files[0].src;
}
}, 'json');
});
$("#jisuan-btn").click(function(){
var last_url = '/finance/jisuan-save';
var params = $("#searchForm").serialize() + '&user_ids=' + $('.user_names').val() + '&is_fan=' + $('#is_fan:checked').val();
$.get(last_url,params,function(obj){
alert(obj.msg);
if(obj.success){
window.location.href = "/finance/ticheng-jisuan?" + params;
}
},'json');
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/finance/ticheng-jisuan-json",
pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['offset'] = params['offset'];
o['limit'] = params['limit'];
return o;
}
});
return false;
}
//提交维修明细
$('#add-user').click(function(){
var params = $("#searchForm").serialize();
art.dialog.open('/finance/add-user?' + '&select_user=' + $('#select_user').val() + '&all=' + $('#all:checked').val() + '&no_num=' + $('#no_num:checked').val(),
{title: '增加工号', width: 1000, height: 350,
close: function () {
var user_names = art.dialog.data('user_names'); // 读取子窗口返回的数据
if( typeof user_names != 'undefined') {
var a = $('#user_names').val();
if (a != '') {
a = a + ',';
}
$('#user_names').val(a + user_names);
}
}
});
$(function() {
search();
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
//提交维修明细
$('#add-dz').click(function(){
var params = $("#searchForm").serialize();
art.dialog.open('/finance/add-user?'+ 'user_names=' + $('#dz_names').val() ,
{title: '增加工号', width: 1000, height: 350,
close: function () {
var user_names = art.dialog.data('user_names'); // 读取子窗口返回的数据
$('#dz_names').val(user_names);
}
});
$('.calc-btn').click(function(){
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
var params = $("#searchFrm").serialize();
$.post('/finance/ticheng-jisuan-save', params, function(obj) {
parent.layer.close(index);
parent.layer.msg(obj.msg);
if(obj.success) {
refreshList();
}
}, 'json');
});
})
</script>
});
</script>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save