Merge branch 'wanfang' into dev

* wanfang: (63 commits)
  完善保单查询条件搜索
  修复无法退回操作
  修复显示全部通话记录bug
  测试
  修改BUG
  在我的通话功能中,添加只显示用户自己信息标志
  用户通时记录查询时间,添加初始时间为当天
  修复更改车船税时,没法参与计算BUG
  完成补点匹配功能开发
  完成补点设置功能开发
  完成返现管理功能开发
  no message
  修复正本提交时报错。
  修复正本生成报错
  修复拨号回调问题
  修复生成短信时,没有包括车船BUG
  test2
  test1
  完善通时统计
  完善通时统计
  ...

# Conflicts:
#	common/libs/MyLib.php
#	composer.json
#	composer.lock
#	frontend/controllers/CarController.php
#	frontend/controllers/GiftController.php
#	frontend/controllers/InsurerController.php
#	frontend/views/car/order-add.php
#	frontend/views/gift/gift-use.php
#	frontend/views/insurer/search.php
dev
曾超新 5 years ago
commit d738d32857
  1. 155
      common/libs/MyLib.php
  2. 2
      common/models/CarT.php
  3. 2
      common/models/OrderGiftT.php
  4. 201
      common/models/UserT.php
  5. 10
      composer.json
  6. 856
      composer.lock
  7. 2
      frontend/controllers/BaseController.php
  8. 1084
      frontend/controllers/CarController.php
  9. 237
      frontend/controllers/FinanceController.php
  10. 591
      frontend/controllers/Gift2Controller.php
  11. 254
      frontend/controllers/GiftController.php
  12. 141
      frontend/controllers/GiftGroupController.php
  13. 298
      frontend/controllers/GiftTypeController.php
  14. 979
      frontend/controllers/InsurerController.php
  15. 16
      frontend/controllers/MarketingStrategyController.php
  16. 63
      frontend/controllers/PhoneCenterController.php
  17. 53
      frontend/controllers/PhoneController.php
  18. 35
      frontend/views/car/edit.php
  19. 13
      frontend/views/car/info.php
  20. 67
      frontend/views/car/invalid-car.php
  21. 111
      frontend/views/car/order-add.php
  22. 4
      frontend/views/common/index.php
  23. 4
      frontend/views/common/login.php
  24. 96
      frontend/views/finance/budian-list.php
  25. 12
      frontend/views/finance/car-update-frame.php
  26. 158
      frontend/views/finance/receipt-info.php
  27. 16
      frontend/views/finance/receipt.php
  28. 93
      frontend/views/finance/receipt2-import.php
  29. 321
      frontend/views/finance/receipt2.php
  30. 84
      frontend/views/gift-group/edit.php
  31. 79
      frontend/views/gift-group/index.php
  32. 42
      frontend/views/gift-type/edit.php
  33. 64
      frontend/views/gift-type/index.php
  34. 42
      frontend/views/gift-type/type2-edit.php
  35. 64
      frontend/views/gift-type/type2-list.php
  36. 65
      frontend/views/gift-type/type3-edit.php
  37. 70
      frontend/views/gift-type/type3-list.php
  38. 83
      frontend/views/gift/gift-use.php
  39. 4
      frontend/views/gift/index.php
  40. 835
      frontend/views/insurer/finance-mng-edit.php
  41. 46
      frontend/views/insurer/finance-mng.php
  42. 125
      frontend/views/insurer/search.php
  43. 2
      frontend/views/marketing-strategy/select-fanxian.php
  44. 14
      frontend/views/phone-center/call-records.php
  45. 8
      frontend/views/phone-center/usercall-index.php
  46. BIN
      frontend/web/favicon.ico

@ -8,8 +8,6 @@
namespace common\libs; namespace common\libs;
use common\models\PriceT;
/** /**
* Description of MyLib * Description of MyLib
* *
@ -281,114 +279,67 @@ class MyLib {
return $result; return $result;
} }
/** static public function phoneCenterStatus($cx){
* 批量处理信息 if($cx=='ANSWERED') {
* @param $type $cn='通话成功';
* @param $data1 }elseif($cx=='BUSY') {
* @param null $data2 $cn = '被叫忙';
* @return array }elseif($cx=='NO_ANSWER') {
*/ $cn = '被叫无应答';
public static function GetInfosResponse($type, $data1, $data2 = null) }elseif($cx=='REJECT') {
{ $cn = '被叫拒接';
switch ($type){ }elseif($cx=='HANGUP') {
case 'car': // $data1=>$car_info $cn = '主叫提前挂机';
$funcname = 'GetCarInfoResponse';break; }elseif($cx=='INVALID_NUMBER') {
case 'order': // $data1=>$orders_info $cn = '空号';
$funcname = 'GetOrderInfoResponse';break; }elseif($cx=='POWER_OFF') {
case 'insurer_type': // $data1=>$insurer_types_info, $data2=>$order_id $cn = '关机';
$funcname = 'GetInsurerTypeInfoResponse';break; }elseif($cx=='UNAVAILABLE') {
case 'gift': // $data1=>$order_gifts_info $cn = '暂时无法接听';
$funcname = 'GetGiftInfoResponse';break; }elseif($cx=='SUSPEND') {
case 'history': // $data1=>$car_log_info $cn = '停机';
$funcname = 'GetCarLogResponse';break; }elseif($cx=='TP_NO_BINDING') {
} $cn = '无绑定关系';
$infos = []; }elseif($cx=='TP_TIMEOUT') {
foreach ($data1 as $item){ $cn = '号码查询接口超时';
$infos[] = self::$funcname($item,$data2); }elseif($cx=='BLACK') {
} $cn = '黑名单号码';
return $infos; }elseif($cx=='TP_ERROR') {
$cn = '号码查询接口解析错误';
}elseif($cx=='CALLED_BLACK') {
$cn = '被叫不支持';
}elseif($cx=='CALL_FORWARD') {
$cn = '呼叫转移';
}elseif($cx=='OTHER') {
$cn = '其他失败情形';
} }
return $cn;
/**
* 处理车辆信息(将id字段转换为对应文本)
* @param $car_info @结果集
* @return array
*/
public static function GetCarInfoResponse($car_info)
{
$car_info_arr = $car_info->toArray();
$car_info_arr['brand_txt'] = $car_info->brand ? $car_info->brand->name : '';
$car_info_arr['car_type_txt'] = $car_info->carType ? $car_info->carType->name : '';
$car_info_arr['car_use_txt'] = $car_info->carUse ? $car_info->carUse->name : '';
$car_info_arr['car_use_txt'] = $car_info->carUse ? $car_info->carUse->name : '';
$car_info_arr['series_txt'] = $car_info->series ? $car_info->series->name : '';
$car_info_arr['displacement_txt'] = $car_info->displacement ? $car_info->displacement->name : '';
$car_info_arr['location_txt'] = $car_info->location == 3 ? '本区' : ($car_info->location == 6 ? '外区' : '未知');
return $car_info_arr;
} }
/** static public function HMSByTime($time){
* 处理订单信息(将id字段转换为对应文本) $h=$i=$s=0;
* @param $order_info @结果集 if($time >= 3600){
* @return array $h = floor($time/3600);
*/ $time = ($time%3600);
public static function GetOrderInfoResponse($order_info)
{
$order_info_arr = $order_info->toArray();
$order_info_arr['business_group_name'] = $order_info->businessGroup ? $order_info->businessGroup->name : '';
$order_info_arr['company_name'] = $order_info->company ? $order_info->company->name : '';
$order_info_arr['pay_type_txt'] = ($order_info->shoufei_id?MyLib::zhifufs($order_info->shoufei_id).'-':'').($order_info->payType?$order_info->payType->name:'');
$order_info_arr['payee_name'] = $order_info->payee_id?$order_info->payee->name:'';
$order_info_arr['payer_name'] = $order_info->payer? MyLib::payers($order_info->payer):'';
$order_info_arr['payment_name'] = $order_info->payment_id?$order_info->payment->name:'';
$order_info_arr['receiver_addr_txt'] = $order_info->receiver_province.
$order_info->receiver_city.
$order_info->receiver_county.
$order_info->receiver_address;
return $order_info_arr;
} }
if($time >= 60){
/** $i = floor($time/60);
* 处理险种信息 $time = ($time%60);
* @param $insurer_type_info
* @param $order_id
* @return array
*/
public static function GetInsurerTypeInfoResponse($insurer_type_info,$order_id)
{
$price_info = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$insurer_type_info->id)
->one();
$insurer_type_info_arr = $insurer_type_info->toArray();
$insurer_type_info_arr['show_name'] = $insurer_type_info->name.'('.$insurer_type_info->code.')';
$insurer_type_info_arr['show_content'] = $price_info->val;
$insurer_type_info_arr['is_nopay_txt'] = $price_info->is_nopay==1?'是': '否';
return $insurer_type_info_arr;
} }
$s = floor($time);
/** return $h.':'.$i.':'.$s;
* 处理礼品信息
* @param $order_gift
* @return array
*/
public static function GetGiftInfoResponse($order_gift)
{
$gift_info = $order_gift->toArray();
$gift_info['gift_name'] = $order_gift->gift->name;
$gift_info['group_name'] = $order_gift->group->name;
return $gift_info;
} }
/** static public function HMSByTimeBuy($time)
* 处理操作记录
* @param $log
* @return array
*/
public static function GetCarLogResponse($log)
{ {
$log_info = $log->toArray(); $i = 0;
$log_info['op_time_txt'] = date('Y-m-d H:i:s',$log->op_time); if($time > 0 && $time <60){
return $log_info; $i = 1;
}elseif($time >= 60){
$i = ceil($time/60);
}
return $i;
} }
} }

@ -65,7 +65,7 @@ class CarT extends \common\models\Base
public function rules() public function rules()
{ {
return [ return [
[['user_id', 'car_type_id', 'car_use_id'], 'required'], [['user_id', 'car_use_id'], 'required'],
[['user_id', 'car_type_id', 'car_use_id','seats','brand_id','series_id','displacement_id','location','invalid_id','invalid_flag','is_track','times','biaozhu','hiddenes'], 'integer'], [['user_id', 'car_type_id', 'car_use_id','seats','brand_id','series_id','displacement_id','location','invalid_id','invalid_flag','is_track','times','biaozhu','hiddenes'], 'integer'],
[['register_date', 'insurer1_date', 'insurer2_date','id_man','id_number','print_date','car_man_number', 'created_at', 'updated_at'], 'safe'], [['register_date', 'insurer1_date', 'insurer2_date','id_man','id_number','print_date','car_man_number', 'created_at', 'updated_at'], 'safe'],
[['car_no', 'factory_model', 'car_model', 'engine_no', 'car_frame_no','old_user','phone1','id_phone'], 'string', 'max' => 50], [['car_no', 'factory_model', 'car_model', 'engine_no', 'car_frame_no','old_user','phone1','id_phone'], 'string', 'max' => 50],

@ -84,6 +84,6 @@ class OrderGiftT extends \common\models\Base
public function getGift() public function getGift()
{ {
return $this->hasOne(GiftType3T::className(),['id'=>'gift_id']); return $this->hasOne(GiftT::className(),['id'=>'gift_id']);
} }
} }

@ -2,6 +2,7 @@
namespace common\models; namespace common\models;
use common\libs\MyLib;
use Yii; use Yii;
/** /**
@ -288,4 +289,204 @@ class UserT extends \common\models\Base
return $pay_chexian + $pay_nochexian + $pay_dz; return $pay_chexian + $pay_nochexian + $pay_dz;
} }
public function totalCallNum($begin_date,$end_date)
{
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
return $query->count();
}
static public function totalCallTotallNum($begin_date,$end_date,$company_id,$user_id)
{
$query = NetworkPhoneT::find()
->leftJoin('user_t','user_t.id=network_phone_t.user_id');
if($begin_date != ''){
$query = $query->andWhere('network_phone_t.begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('network_phone_t.begin_date<="'.$end_date.'"');
}
if($company_id != 0){
$query = $query->andWhere('user_t.company_id='.$company_id);
}
if($user_id != 0){
$query = $query->andWhere('user_t.id='.$user_id);
}
return $query->count();
}
public function totalCallTime($begin_date,$end_date)
{
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
$time = $query->sum('call_duration');
return MyLib::HMSByTime($time);
}
public function totalCallTimeOut($begin_date,$end_date)
{
$query = NetworkPhoneT::find()->where('user_id='.$this->id)->andWhere('is_called=0 or is_called is null');
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
$time = $query->sum('call_duration');
return MyLib::HMSByTime($time);
}
static public function allCallTime($begin_date,$end_date,$company_id,$user_id)
{
$query = NetworkPhoneT::find()
->leftJoin('user_t','user_t.id=network_phone_t.user_id');
if($begin_date != ''){
$query = $query->andWhere('network_phone_t.begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('network_phone_t.begin_date<="'.$end_date.'"');
}
if($company_id != 0){
$query = $query->andWhere('user_t.company_id='.$company_id);
}
if($user_id != 0){
$query = $query->andWhere('user_t.id='.$user_id);
}
$time = $query->sum('network_phone_t.call_duration');
return MyLib::HMSByTime($time);
}
static public function allCallTimeOut($begin_date,$end_date,$company_id,$user_id)
{
$query = NetworkPhoneT::find()->where('is_called=0')
->leftJoin('user_t','user_t.id=network_phone_t.user_id');
if($begin_date != ''){
$query = $query->andWhere('network_phone_t.begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('network_phone_t.begin_date<="'.$end_date.'"');
}
if($company_id != 0){
$query = $query->andWhere('user_t.company_id='.$company_id);
}
if($user_id != 0){
$query = $query->andWhere('user_t.id='.$user_id);
}
$time = $query->sum('network_phone_t.call_duration');
return MyLib::HMSByTime($time);
}
static public function allCallTimeOutBuy($begin_date,$end_date,$company_id,$user_id)
{
$query = NetworkPhoneT::find()
->leftJoin('user_t','user_t.id=network_phone_t.user_id');
if($begin_date != ''){
$query = $query->andWhere('network_phone_t.begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('network_phone_t.begin_date<="'.$end_date.'"');
}
if($company_id != 0){
$query = $query->andWhere('user_t.company_id='.$company_id);
}
if($user_id != 0){
$query = $query->andWhere('user_t.id='.$user_id);
}
$items = $query->all();
$i_all = 0;
foreach ($items as $item){
$i = $item->call_duration;
$i_all += MyLib::HMSByTimeBuy($i);
}
return $i_all;
}
public function callInTotalNum($begin_date,$end_date)
{
$t = NetworkPhoneAssignT::find()->where('user_id='.$this->id)->one();
$phone = $t?$t->phone:0;
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
return $query->andWhere('is_called=1')->count();
}
public function callInSucNum($begin_date,$end_date)
{
$t = NetworkPhoneAssignT::find()->where('user_id='.$this->id)->one();
$phone = $t?$t->phone:0;
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
return $query->andWhere('is_called=1')->andWhere('call_result="ANSWERED"')->count();
}
public function callOutTotalNum($begin_date,$end_date)
{
$t = NetworkPhoneAssignT::find()->where('user_id='.$this->id)->one();
$phone = $t?$t->phone:0;
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
// return $query->andWhere('caller="'.$phone.'"')->count();
return $query->andWhere('is_called=0 or is_called is null')->count();
}
public function callOutSucNum($begin_date,$end_date)
{
$t = NetworkPhoneAssignT::find()->where('user_id='.$this->id)->one();
$phone = $t?$t->phone:0;
$query = NetworkPhoneT::find()->where('user_id='.$this->id);
if($begin_date != ''){
$query = $query->andWhere('begin_date>="'.$begin_date.'"');
}
if($end_date != ''){
$query = $query->andWhere('begin_date<="'.$end_date.'"');
}
return $query->andWhere('is_called=0 or is_called is null')->andWhere('call_result="ANSWERED"')->count();
}
public function getPhoneStatus()
{
return $this->hasOne(NetworkPhoneAssignT::className(),['user_id'=>'id']);
}
} }

@ -19,7 +19,9 @@
"yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*", "yiisoft/yii2-swiftmailer": "*",
"phpoffice/phpspreadsheet": "^1.9", "phpoffice/phpspreadsheet": "^1.9",
"codeception/codeception": "^3.1" "codeception/codeception": "^3.1",
"yiisoft/yii2-imagine": "^2.2",
"phpoffice/phpexcel": "^1.8"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "*", "yiisoft/yii2-debug": "*",
@ -34,5 +36,11 @@
"npm-asset-library": "vendor/npm", "npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower" "bower-asset-library": "vendor/bower"
} }
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://mirrors.aliyun.com/composer/"
}
} }
} }

856
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -61,7 +61,7 @@ class BaseController extends \yii\web\Controller
$log_info->remark = $info; $log_info->remark = $info;
$log_info->info = ''; $log_info->info = '';
if(!$log_info->save()) { if(!$log_info->save()) {
var_dump($log_info->errors); throw new \Exception(print_r($log_info->getErrors(), true));
} }
} }
public function addNonLog($non_id,$info,$type) public function addNonLog($non_id,$info,$type)

File diff suppressed because it is too large Load Diff

@ -30,6 +30,7 @@ use common\models\GiftType3T;
use common\models\GroupT; use common\models\GroupT;
use common\models\Gz2T; use common\models\Gz2T;
use common\models\GzT; use common\models\GzT;
use common\models\InsurerCompany2T;
use common\models\InsurerCompanyT; use common\models\InsurerCompanyT;
use common\models\InsurerTypeT; use common\models\InsurerTypeT;
use common\models\OrderCaiwuT; use common\models\OrderCaiwuT;
@ -213,7 +214,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['group'] = $item->user->group->name; $row['group'] = $item->user->group->name;
$row['company_name'] = $item->order->company->name; $row['company_name'] = $item->order->company2->name;
$row['username'] = $item->user->getShowName(); $row['username'] = $item->user->getShowName();
$row['submit_date'] = $item->order->submit_date; $row['submit_date'] = $item->order->submit_date;
$row['print_date'] = $item->order->print_date; $row['print_date'] = $item->order->print_date;
@ -226,6 +227,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
public function actionReceiptImport() { public function actionReceiptImport() {
return $this->render('receipt-import'); return $this->render('receipt-import');
} }
public function actionReceipt2Import() {
return $this->render('receipt2-import');
}
public function actionEmsReceipt() public function actionEmsReceipt()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -3607,8 +3612,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
return $this->render('receipt-info', [ return $this->render('receipt-info', [
'caiwu_info' => $caiwu_info, 'caiwu_info' => $caiwu_info
'back_params' => $back_params,
]); ]);
} }
public function actionEmsReceiptInfo() public function actionEmsReceiptInfo()
@ -3864,10 +3868,17 @@ class FinanceController extends \frontend\controllers\UserBaseController
return $result; return $result;
} }
public function actionReceipt2() public function actionReceipt2() {
$insurer_company_items = InsurerCompany2T::find()->all();
return $this->render('receipt2', [
'insurer_company_items' => $insurer_company_items
]);
}
public function actionReceipt2Json()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$page = $request->get('page', 1);
$begin_date = $request->get('begin_date'); $begin_date = $request->get('begin_date');
$end_date = $request->get('end_date'); $end_date = $request->get('end_date');
$r_begin_date = $request->get('r_begin_date'); $r_begin_date = $request->get('r_begin_date');
@ -3878,43 +3889,14 @@ class FinanceController extends \frontend\controllers\UserBaseController
$sort_key = $request->get('sort_key'); $sort_key = $request->get('sort_key');
$sort_value = $request->get('sort_value'); $sort_value = $request->get('sort_value');
$company_id = $request->get('company_id'); $company_id = $request->get('company_id');
if ($page < 1) $page = 1; $insurer_type = $request->get('insurer_type');
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
// $query = OrderCaiwuT::find()
// ->where('budian_rate>0');
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderCaiwuT::tableName(), "order_caiwu_t.order_id=caiwu_t.order_id") ->leftJoin(OrderCaiwuT::tableName(), "order_caiwu_t.order_id=caiwu_t.order_id")
->leftJoin(OrderT::tableName(), "order_caiwu_t.order_id=order_t.id") ->leftJoin(OrderT::tableName(), "order_caiwu_t.order_id=order_t.id")
->where('order_caiwu_t.budian_rate > 0'); ->where('caiwu_t.budian_rate > 0');
// ->orderBy('order_t.print_date DESC');
// switch ($sort_key) {
// case 'total':
// $sort = 'caiwu_t.total ';
// break;
// case 'total_clear':
// $sort = 'caiwu_t.total_clear ';
// break;
// case 'total_rate':
// $sort = 'caiwu_t.total_rate ';
// break;
// case 'print_date'://默认按照print_date排序
// default:
// $sort = 'order_t.print_date ';
// break;
// }
// switch ($sort_value) {
// case 'ASC':
// $sort .= 'ASC';
// break;
// case 'DESC':
// default:
// $sort .= 'DESC';
// break;
// }
// $query = $query->orderBy($sort);
if( $company_id > 0) { if( $company_id > 0) {
$query = $query->andWhere('order_t.company_id='.$company_id); $query = $query->andWhere('order_t.company_id='.$company_id);
} }
@ -3926,10 +3908,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
} }
if ($status > 0) { if ($status > 0) {
if ($status == 1) { if ($status == 1) {
$query = $query->andWhere('r_date=""'); $query = $query->andWhere('b1_date is null');
} }
if ($status == 2) { if ($status == 2) {
$query = $query->andWhere('r_date<>""'); $query = $query->andWhere('b1_date is not null');
} }
} }
if ($begin_date != "") { if ($begin_date != "") {
@ -3944,43 +3926,38 @@ class FinanceController extends \frontend\controllers\UserBaseController
if ($r_end_date != "") { if ($r_end_date != "") {
$query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"'); $query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"');
} }
if($insurer_type != 0){
$query = $query->andWhere('caiwu_t.insurer_type =' . $insurer_type);
}
// echo $query->createCommand()->rawSql; // echo $query->createCommand()->rawSql;
$total = $query->count(); $total = $query->count();
$pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); $query->offset($offset)->limit($limit);
$pagination->setPage($page - 1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all(); $items = $query->all();
// $sum_r_total = $query->sum('r_total'); $data = [];
//商业净保费综合 $data['total'] = $total;
// $sum_total_clear = $query->sum('total_clear'); $data['rows'] = [];
foreach($items as $item) {
//商业总保费 $row = $item->toArray();
// $sum_total = $query->sum('total'); $row['company_name'] = $item->order->company2->name;
$row['print_date'] = $item->order->print_date;
$row['total_real'] = round($item->total_clear,2);
$row['budian_rate'] = $item->budian_rate;
$row['budian_money'] = $item->budian_money;
$row['b1_total'] = $item->b1_total;
$row['b1_date'] = $item->b1_date;
$row['b2_total'] = $item->b2_total;
$row['b2_date'] = $item->b2_date;
$row['b3_total'] = $item->b3_total;
$row['b3_date'] = $item->b3_date;
$row['b_total'] = round($row['b1_total']+$row['b2_total']+$row['b3_total'],2);
$row['un_b_total'] = round($row['budian_money'] - $row['b_total'],2);
$data['rows'][] = $row;
}
$page_info = MyLib::getPageInfo($pagination); return $data;
$company_items = InsurerCompanyT::find()->all();
return $this->render('receipt2', [
'items' => $items,
'page' => $page,
'car_no' => $car_no,
'insurer_no' => $insurer_no,
'status' => $status,
'begin_date' => $begin_date,
'end_date' => $end_date,
'r_begin_date' => $r_begin_date,
'r_end_date' => $r_end_date,
'page_info' => $page_info,
'sort_key' => $sort_key,
'company_items' => $company_items,
'company_id' => $company_id,
'sort_value' => $sort_value
// 'sum_r_total' => $sum_r_total,
// 'sum_total_clear' => $sum_total_clear,
// 'sum_total' => $sum_total,
]);
} }
public function actionReceipt2Output() public function actionReceipt2Output()
{ {
@ -4139,22 +4116,13 @@ class FinanceController extends \frontend\controllers\UserBaseController
$insurer_total = $cell->getValue();//$data[$i][6]; $insurer_total = $cell->getValue();//$data[$i][6];
$cell = $currentSheet->getCellByColumnAndRow(7, $i); $cell = $currentSheet->getCellByColumnAndRow(7, $i);
$insurer_date = $cell->getFormattedValue(); $insurer_date = $cell->getFormattedValue();
// $insurer_date = \PHPExcel_Shared_Date::ExcelToPHP($cell->getValue());//$data[$i][7];
$cell = $currentSheet->getCellByColumnAndRow(8, $i); $cell = $currentSheet->getCellByColumnAndRow(8, $i);
$car_no = $cell->getValue();//$data[$i][8]; $car_no = $cell->getValue();//$data[$i][8];
// if($insurer_no == 'PDAA201811010000089441') {
// echo $insurer_no.'='.$policy_man.'='.$total_real.'='.$total_rate.'=';
// echo $pay_total.'='.$insurer_total.'='.date('Y-m-d',$insurer_date).'='.$car_no."\r\n";
// exit;
// }
// $row = CaiwuT::findOne(['car_no' => $car_no, 'insurer_no' => $insurer_no]);
$row = CaiwuT::findOne(['insurer_no' => $insurer_no]); $row = CaiwuT::findOne(['insurer_no' => $insurer_no]);
if ($row) { if ($row) {
CaiwuErrorT::deleteAll(['insurer_no' => $insurer_no]); CaiwuErrorT::deleteAll(['insurer_no' => $insurer_no]);
// echo $insurer_no.'='.$policy_man.'='.$total_real.'='.$total_rate.'=';
// echo $pay_total.'='.$insurer_total.'='.date('Y-m-d',$insurer_date).'='.$car_no."\r\n";
if($bdlx == 1) { if($bdlx == 1) {
$row->b1_total = $insurer_total; $row->b1_total = $insurer_total;
$row->b1_date = $insurer_date; $row->b1_date = $insurer_date;
@ -6356,7 +6324,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$result['msg'] = '操作失败'; $result['msg'] = '操作失败';
$web_path = Yii::$app->getBasePath() . '/../frontend/web'; $web_path = Yii::$app->getBasePath() . '/../frontend/web';
$filename = $web_path . $request->post('urlfile'); $filename = $web_path . $request->post('file');
$base_filename=$request->post('file'); $base_filename=$request->post('file');
//读取Excel 2007 //读取Excel 2007
@ -6379,19 +6347,19 @@ class FinanceController extends \frontend\controllers\UserBaseController
for ($i = 2; $i <= $rowCount; $i++) { for ($i = 2; $i <= $rowCount; $i++) {
// echo $i.'/'.$rowCount."..."; // echo $i.'/'.$rowCount."...";
$cell = $currentSheet->getCellByColumnAndRow(0, $i); $cell = $currentSheet->getCellByColumnAndRow(0, $i);
$car_no = $cell->getValue(); $car_no = $cell->getFormattedValue();
// $cell = $currentSheet->getCellByColumnAndRow(1, $i); // $cell = $currentSheet->getCellByColumnAndRow(1, $i);
// $car_man = $cell->getValue(); // $car_man = $cell->getValue();
$cell = $currentSheet->getCellByColumnAndRow(1, $i); $cell = $currentSheet->getCellByColumnAndRow(1, $i);
$factory_model = $cell->getValue();//$data[$i][3]; $factory_model = $cell->getFormattedValue();//$data[$i][3];
$cell = $currentSheet->getCellByColumnAndRow(2, $i); $cell = $currentSheet->getCellByColumnAndRow(2, $i);
$engine_no = $cell->getValue();//$data[$i][2]; $engine_no = $cell->getFormattedValue();//$data[$i][2];
// var_dump($cars); // var_dump($cars);
$cell = $currentSheet->getCellByColumnAndRow(3, $i); $cell = $currentSheet->getCellByColumnAndRow(3, $i);
$car_frame_no = $cell->getValue();//$data[$i][1]; $car_frame_no = $cell->getFormattedValue();//$data[$i][1];
// var_dump($car_frame_no); // var_dump($car_frame_no);
$cell = $currentSheet->getCellByColumnAndRow(4, $i); $cell = $currentSheet->getCellByColumnAndRow(4, $i);
$register_date = $cell->getValue();//$data[$i][8]; $register_date = $cell->getFormattedValue();
$cell = $currentSheet->getCellByColumnAndRow(5, $i); $cell = $currentSheet->getCellByColumnAndRow(5, $i);
$company = $cell->getValue();//$data[$i][8]; $company = $cell->getValue();//$data[$i][8];
$cell = $currentSheet->getCellByColumnAndRow(6, $i); $cell = $currentSheet->getCellByColumnAndRow(6, $i);
@ -6413,11 +6381,11 @@ class FinanceController extends \frontend\controllers\UserBaseController
$cell = $currentSheet->getCellByColumnAndRow(14, $i); $cell = $currentSheet->getCellByColumnAndRow(14, $i);
$id_phone = $cell->getFormattedValue(); $id_phone = $cell->getFormattedValue();
if($car_no == '' && $engine_no == '' && $car_frame_no == '') continue;
$car_info = CarT::findOne(['car_frame_no' => $car_frame_no]); $car_info = CarT::findOne(['car_frame_no' => $car_frame_no]);
if ($car_info) { if ($car_info) {
if($car_no != ''){ if($car_no != ''){
$car_info->car_no = $car_no; $car_info->car_no = $car_no;
} }
@ -6464,17 +6432,11 @@ class FinanceController extends \frontend\controllers\UserBaseController
if($car_man_phone != ''){ if($car_man_phone != ''){
$car_info->phone = $car_man_phone; $car_info->phone = $car_man_phone;
} }
// $car_info->save();
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
var_dump($car_info->errors); var_dump($car_info->errors);
exit; exit;
} }
$insert_total++; $insert_total++;
} }
@ -6528,9 +6490,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
if($car_man_phone != ''){ if($car_man_phone != ''){
$car_info->phone = $car_man_phone; $car_info->phone = $car_man_phone;
} }
// $car_info->save();
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
var_dump($car_info->errors); var_dump($car_info->errors);
exit; exit;
@ -6539,13 +6498,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
} }
} }
// $log = new ImportLogT();
// $datacount=$rowCount;
// $log->filename = $base_filename;
// $log->total = $datacount;
// $log->success = $insert_total;
// $log->success_rate = ($insert_total/$datacount) * 100;
// $log->save();
$result['success'] = true; $result['success'] = true;
$result['msg'] = '操作成功'; $result['msg'] = '操作成功';
@ -6555,7 +6507,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
} }
public function actionBudianList() { public function actionBudianList() {
return $this->render('budian-list'); $company_items = InsurerCompany2T::find()->all();
return $this->render('budian-list',[
'company_items' => $company_items
]);
} }
public function actionBudianListJson() public function actionBudianListJson()
{ {
@ -6569,29 +6524,18 @@ class FinanceController extends \frontend\controllers\UserBaseController
$company_id = $request->get('company_id'); $company_id = $request->get('company_id');
$insurer_type = $request->get('insurer_type'); $insurer_type = $request->get('insurer_type');
$budian_rate = $request->get('budian_rate');
$offset = $request->get('offset',0); $offset = $request->get('offset',0);
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
->orderBy('order_t.print_date DESC'); ->orderBy('order_t.print_date DESC');
if( $insurer_type > 0) { if( $insurer_type > 0) {
$query->andWhere('caiwu_t.insurer_type='.$insurer_type); $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
} }
if( $company_id > 0) { if( $company_id > 0) {
$query->andWhere('order_t.company_id='.$company_id); $query->andWhere('order_t.company2_id='.$company_id);
} }
if($car_no_type == 1){ if($car_no_type == 1){
$query->andWhere('caiwu_t.car_no like "' . '京' . '%"'); $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
}elseif($car_no_type == 2){ }elseif($car_no_type == 2){
@ -6605,17 +6549,12 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
} }
if ($begin_date != "") { if ($begin_date != "") {
$query->andWhere('order_t.print_date>="' . $begin_date . '"'); $query->andWhere('order_t.print_date>="' . $begin_date . '"');
} }
if ($end_date != "") { if ($end_date != "") {
$query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
$total1_clear_all = $query->sum('total_clear');
$total_money_all = $query->sum('budian_money');
$total = $query->count(); $total = $query->count();
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
@ -6626,6 +6565,11 @@ class FinanceController extends \frontend\controllers\UserBaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['company_name'] = $item->order->company2->name;
$row['print_date'] = $item->order->print_date;
$row['insurer_type'] = '商业';
if($item->insurer_type != 1)
$row['insurer_type'] = '交强';
$row['user'] = $item->user?$item->user->getShowName():''; $row['user'] = $item->user?$item->user->getShowName():'';
$data['rows'][] = $row; $data['rows'][] = $row;
} }
@ -6642,84 +6586,65 @@ class FinanceController extends \frontend\controllers\UserBaseController
$result['success'] = false; $result['success'] = false;
$result['msg'] = '操作失败'; $result['msg'] = '操作失败';
$begin_date = $request->get('begin_date',date('Y-m-d'));
$begin_date = $request->get('begin_date'); $end_date = $request->get('end_date',date('Y-m-d'));
$end_date = $request->get('end_date');
$user_names = $request->get('user_names');
$begin_totalclear = $request->get('begin_totalclear'); $begin_totalclear = $request->get('begin_totalclear');
$end_totalclear = $request->get('end_totalclear'); $end_totalclear = $request->get('end_totalclear');
$car_no_type = $request->get('car_no_type'); $car_no_type = $request->get('car_no_type');
$company_id = $request->get('company_id'); $company_id = $request->get('company_id');
$insurer_type = $request->get('insurer_type'); $insurer_type = $request->get('insurer_type');
$budian_rate = $request->get('budian_rate'); $budian_rate = $request->get('budian_rate');
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
// ->where('caiwu_t.insurer_type=1')
->orderBy('order_t.print_date DESC'); ->orderBy('order_t.print_date DESC');
if( $insurer_type > 0) { if( $insurer_type > 0) {
$query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
} }
if( $company_id > 0) { if( $company_id > 0) {
$query = $query->andWhere('order_t.company_id='.$company_id); $query->andWhere('order_t.company2_id='.$company_id);
} }
if($car_no_type == 1){ 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){ }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 != ''){ if($begin_totalclear != ''){
$query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear); $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
} }
if($end_totalclear != ''){ if($end_totalclear != ''){
$query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
} }
if ($begin_date != "") { if ($begin_date != "") {
$query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); $query->andWhere('order_t.print_date>="' . $begin_date . '"');
} }
if ($end_date != "") { if ($end_date != "") {
$query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
$items = $query->all(); $items = $query->all();
$tran = OrderCaiwuT::getDb()->beginTransaction(); $tran = OrderCaiwuT::getDb()->beginTransaction();
try { try {
foreach ($items as $item){ foreach ($items as $item){
// $order_caiwu_info = $item->orderCaiwu;
// $order_info = $item->order;
if($budian_rate != '') { if($budian_rate != '') {
$item->budian_rate = $budian_rate; $item->budian_rate = $budian_rate;
$item->budian_money = $item->total_clear * $budian_rate / 100; $item->budian_money = $item->total_clear * $budian_rate / 100;
} }
$item->save(); if(!$item->save()) {
throw new \Exception(print_r($item->getErrors(), true));
} }
}
$tran->commit();
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功'; $result['msg'] = '保存成功';
$tran->commit();
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
return $result; return $result;
} }

@ -1,591 +0,0 @@
<?php
namespace frontend\controllers;
use common\libs\MyLib;
use common\models\CarGiftT;
use common\models\EmsT;
use common\models\Gift2T;
use common\models\GiftGroupT;
use common\models\GiftT;
use common\models\GiftTicket2T;
use common\models\GiftTicketT;
use common\models\GiftType2T;
use common\models\GiftTypeT;
use common\models\GroupT;
use common\models\InsurerTypeT;
use common\models\OrderT;
use common\models\StrategyT;
use common\models\UserT;
use Yii;
use yii\data\Pagination;
use yii\web\Response;
class Gift2Controller extends \yii\web\Controller
{
public $my = null;
public function init()
{
parent::init();
$cookie = Yii::$app->request->cookies;
$user_id = MyLib::encrypt($cookie->get('aid'),'DECODE');
if($user_id != 0)
{
$this->my = UserT::findOne(['id'=>$user_id]);
} else {
Yii::$app->response->redirect('/common/login')->send();
exit;
}
}
public function actionGift1Index()
{
$request = Yii::$app->request;
$code = $request->get('code');
$car_no = $request->get('car_no');
$status = $request->get('status',6);
$type_id = $request->get('type_id',0);
$page = $request->get('page',1);
if($page < 1) $page = 1;
$query = GiftTicketT::find()
->orderBy('id DESC');
if($code != '') {
$query = $query->andWhere('code="'.$code.'"');
}
if($car_no != '') {
$query = $query->andWhere('car_no like "'.$car_no.'"');
}
if($status != '' && $status != 6) {
$query = $query->andWhere('status='.$status);
}
if($type_id > 0) {
$query = $query->andWhere('type_id='.$type_id);
}
// echo $query->createCommand()->rawSql;
$total = $query->count();
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
$pagination->setPage($page-1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all();
$type_items = GiftType2T::find()->all();
$page_info = MyLib::getPageInfo($pagination);
return $this->render('gift1-index',[
'items' => $items,
'code' => $code,
'car_no' => $car_no,
'page' => $page,
'page_info' => $page_info,
'status' => $status,
'type_items' => $type_items,
'type_id' => $type_id,
]);
}
public function actionGift2Index()
{
return $this->render('gift2-index');
}
public function actionIndex()
{
$request = Yii::$app->request;
$code = $request->get('code');
$car_no = $request->get('car_no');
$page = $request->get('page',1);
if($page < 1) $page = 1;
$query = GiftTicketT::find()
->orderBy('id DESC');
if($code != '') {
$query = $query->andWhere('code="'.$code.'"');
}
if($car_no != '') {
$query = $query->andWhere('car_no="'.$car_no.'"');
}
// echo $query->createCommand()->rawSql;
$total = $query->count();
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
$pagination->setPage($page-1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
return $this->render('index',[
'items' => $items,
'code' => $code,
'car_no' => $car_no,
'page' => $page,
'page_info' => $page_info
]);
}
public function actionAdd()
{
$request = Yii::$app->request;
$type_items = GiftType2T::find()->all();
return $this->render('add',[
'type_items' => $type_items,
]);
}
public function actionAddSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$min_code = $request->post('min_code');
$max_code = $request->post('max_code');
$type_id = $request->post('type_id');
if($min_code == '') {
$result['msg'] = '请输入开始编号!';
return $result;
}
if($max_code == '') {
$result['msg'] = '请输入结束编号!';
return $result;
}
if($type_id == 0) {
$result['msg'] = '请选择类型!';
return $result;
}
$row = null;
for($i = $min_code; $i <= $max_code; $i++) {
$row = GiftTicketT::findOne(['code'=>$i,'type_id'=>$type_id]);
if(!$row) {
$row = new GiftTicketT();
$row->code = $i;
$row->type_id = $type_id;
$row->input_date = date('Y-m-d H:i:s');
$row->op_id = $this->my->id;
$row->status = 0;
$row->save();
}
}
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionOutput()
{
$request = Yii::$app->request;
$type_items = GiftType2T::find()->all();
$gift_group_items = GiftGroupT::find()->all();
return $this->render('output',[
'type_items' => $type_items,
'gift_group_items' => $gift_group_items,
]);
}
public function actionOutputSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$codes = $request->post('codes',array());
$types = $request->post('types',array());
$car_no = $request->post('car_no');
$tran = GiftTicketT::getDb()->beginTransaction();
try {
foreach($types as $index => $type_id) {
if($type_id == 0) continue;
$ticket_info = GiftTicketT::findOne(['code'=>$codes[$index],'type_id'=>$type_id]);
if(!$ticket_info) {
$result['msg'] = '第'.($index+1).'组礼品编号不存在!';
return $result;
}
if($ticket_info->status != 0) {
$result['msg'] = '第'.($index+1).'组礼品编号已经出库!';
return $result;
}
$ticket_info->group_id = 0;
$ticket_info->car_no = $car_no;
$ticket_info->status = 1;
$ticket_info->use_date = date('Y-m-d H:i:s');
$ticket_info->op_id = $this->my->id;
if(!$ticket_info->save()) {
var_dump($ticket_info->errors);
}
}
$tran->commit();
} catch(\Exception $e) {
$tran->rollBack();
throw $e;
}
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionEdit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
$back_params = $request->get('back_params');
if($id > 0) {
$info = GiftTicketT::findOne(['id'=>$id]);
} else {
$info = new GiftTicketT();
}
$type_items = GiftTypeT::find()->all();
return $this->render('edit',[
'info' => $info,
'type_items' => $type_items,
'back_params' => $back_params,
]);
}
public function actionSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id');
$status = $request->post('status');
$car_no = $request->post('car_no');
$ticket_info = GiftTicketT::findOne(['id'=>$id]);
if(!$ticket_info) {
$result['msg'] = '礼品券不存在!';
return $result;
}
$ticket_info->car_no = $car_no;
$ticket_info->status = $status;
$ticket_info->use_date = date('Y-m-d H:i:s');
$ticket_info->op_id = $this->my->id;
$ticket_info->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionDelete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = GiftTicketT::findOne(['id'=>$id]);
if($row->status == 0) {
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
}
return $result;
}
public function actionTicket2List()
{
$request = Yii::$app->request;
$code = $request->get('code');
$car_no = $request->get('car_no');
$type_id = $request->get('type_id',0);
$page = $request->get('page',1);
if($page < 1) $page = 1;
$query = GiftTicketT::find()
->where('status=1')
->orderBy('id DESC');
if($code != '') {
$query = $query->andWhere('code="'.$code.'"');
}
if($car_no != '') {
$query = $query->andWhere('car_no like "'.$car_no.'"');
}
if($type_id > 0) {
$query = $query->andWhere('type_id='.$type_id);
}
// echo $query->createCommand()->rawSql;
$total = $query->count();
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
$pagination->setPage($page-1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all();
$type_items = GiftType2T::find()->all();
$page_info = MyLib::getPageInfo($pagination);
return $this->render('ticket2-list',[
'items' => $items,
'code' => $code,
'car_no' => $car_no,
'page' => $page,
'page_info' => $page_info,
'type_items' => $type_items,
'type_id' => $type_id,
]);
}
public function actionTicket2Output()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id == 0) {
echo '无效礼券';
exit;
}
$ticket_info = GiftTicketT::findOne(['id'=>$id]);
$gift_items = Gift2T::find()->all();
$type_items = GiftType2T::find()->all();
return $this->render('ticket2-output',[
'ticket_info' => $ticket_info,
'gift_items' => $gift_items,
'type_items' => $type_items
]);
}
public function actionTicket2OutputSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$ticket_id = $request->post('ticket_id');
$gift_id = (int)$request->post('gift_id');
$send_type = $request->post('send_type');
$send_no = $request->post('send_no');
$ticket_info = GiftTicketT::findOne(['id'=>$ticket_id]);
if(!$ticket_info) {
$result['msg'] = '礼品编号不存在!';
return $result;
}
if($gift_id == 0) {
$result['msg'] = '请选择礼品!';
return $result;
}
$ticket2_info = new GiftTicket2T();
$ticket2_info->ticket_id = $ticket_info->id;
$ticket2_info->gift_id = $gift_id;
$ticket2_info->send_type = $send_type;
$ticket2_info->send_no = $send_no;
$ticket2_info->status = 1;
$ticket2_info->op_id = $this->my->id;
$ticket2_info->use_date = date('Y-m-d H:i:s');
$ticket2_info->save();
$ticket_info->status = 2;
$ticket_info->use_date;
$ticket_info->op_id = $this->my->id;
$ticket_info->save();
//礼品
$gift_info = Gift2T::findOne(['id'=>$gift_id]);
$gift_info->total = $gift_info->total - 1;
$gift_info->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionTicket2Edit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id > 0) {
$info = GiftTicket2T::findOne(['id'=>$id]);
} else {
$info = new GiftTicket2T();
}
$gift_items = GiftT::find()->all();
$type_items = GiftTypeT::find()->all();
return $this->render('ticket2-edit',[
'info' => $info,
'gift_items' => $gift_items,
'type_items' => $type_items
]);
}
public function actionTicket2Save()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id',0);
$status = (int)$request->post('status');
$row = GiftTicket2T::findOne(['id'=>$id]);
$gift_info = $row->gift;
$gift_info->total = $gift_info->total + 1;
$gift_info->save();
$row->status = 3;
$row->use_date = date('Y-m-d H:i:s');
$row->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionGift2List()
{
$request = Yii::$app->request;
$name = $request->get('name');
$query = Gift2T::find();
if($name != '') {
$query = $query->andWhere(['like','name',$name]);
}
$items = $query->all();
return $this->render('gift2-list',[
'items' => $items,
'name' => $name
]);
}
public function actionGift2Edit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id > 0) {
$info = Gift2T::findOne(['id'=>$id]);
} else {
$info = new GiftT();
}
return $this->render('gift2-edit',[
'info' => $info
]);
}
public function actionGift2Save()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id',0);
$name = $request->post('name');
$price = $request->post('price');
$remark = $request->post('remark');
$total = (int)$request->post('total');
if($name == '') {
$result['msg'] = '请输入名称!';
return $result;
}
$row = null;
if($id > 0) {
$row = Gift2T::findOne(['id'=>$id]);
} else {
$row = new Gift2T();
}
$row->name = $name;
$row->price = $price;
$row->remark = $remark;
$row->total = $total;
$row->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionGift2Delete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = Gift2T::findOne(['id'=>$id]);
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
return $result;
}
public function actionStastics()
{
$gift_type_items = GiftType2T::find()->all();
$gift_items = Gift2T::find()->all();
return $this->render('stastics',[
'gift_type_items' => $gift_type_items,
'gift_items' => $gift_items,
]);
}
}

@ -8,6 +8,7 @@ use common\models\EmsT;
use common\models\GiftT; use common\models\GiftT;
use common\models\GiftTicketTUse; use common\models\GiftTicketTUse;
use common\models\GiftTypeT; use common\models\GiftTypeT;
use common\models\GiftUseLogT;
use common\models\GroupT; use common\models\GroupT;
use common\models\InsurerTypeT; use common\models\InsurerTypeT;
use common\models\OrderT; use common\models\OrderT;
@ -111,7 +112,6 @@ class GiftController extends \yii\web\Controller
$img = $request->post('img'); $img = $request->post('img');
$price = $request->post('price'); $price = $request->post('price');
$remark = $request->post('remark'); $remark = $request->post('remark');
$total = (int)$request->post('total');
$use_num = (int)$request->post('use_num'); $use_num = (int)$request->post('use_num');
if($name == '') { if($name == '') {
@ -132,7 +132,6 @@ class GiftController extends \yii\web\Controller
$row->price = $price; $row->price = $price;
$row->original_img = $img; $row->original_img = $img;
$row->remark = $remark; $row->remark = $remark;
$row->total = $total;
$row->use_num = $use_num; $row->use_num = $use_num;
$row->pinyin_name = $pin_name; $row->pinyin_name = $pin_name;
$row->save(); $row->save();
@ -787,7 +786,7 @@ class GiftController extends \yii\web\Controller
public function actionGiftUse() { public function actionGiftUse() {
$type_items = GiftT::find() $type_items = GiftT::find()
->where(['type_id'=>2,'is_delete'=>0]) ->where(['type_id'=>1,'is_delete'=>0])
->all(); ->all();
return $this->render('gift-use', [ return $this->render('gift-use', [
'type_items' => $type_items 'type_items' => $type_items
@ -799,7 +798,9 @@ class GiftController extends \yii\web\Controller
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$code = $request->get('code'); $code = $request->get('code');
$car_id = $request->get('car_id',0);
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
$order_id = $request->get('order_id');
$username = $request->get('username'); $username = $request->get('username');
$s_begin_date = $request->get('s_begin_date'); $s_begin_date = $request->get('s_begin_date');
$s_end_date = $request->get('s_end_date'); $s_end_date = $request->get('s_end_date');
@ -820,19 +821,144 @@ class GiftController extends \yii\web\Controller
->where('gift_t.type_id=2') ->where('gift_t.type_id=2')
->orderBy('id DESC'); ->orderBy('id DESC');
if($code != '') { if($code != '') {
$query = $query->andWhere('gift_ticket_t_use.code="'.$code.'"'); $query->andWhere('gift_ticket_t_use.code="'.$code.'"');
}
if($car_id > 0) {
$query->andWhere('order_t.car_id='.$car_id);
}
if($order_id > 0) {
$query->andWhere('order_t.id='.$order_id);
} }
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere('gift_ticket_t_use.car_no like "'.$car_no.'"'); $query->andWhere('gift_ticket_t_use.car_no like "'.$car_no.'"');
}
if($username != ''){
$user = UserT::find()->where('username="'.$username.'"')->andWhere('is_delete=0')->one();
$query->andWhere('gift_ticket_t_use.op_id='.$user->id);
} }
if($s_begin_date != ''){
$query->andWhere('order_t.submit_date>="'.$s_begin_date.'"');
}
if($s_end_date != ''){
$query = $query->andWhere('order_t.submit_date<="'.$s_begin_date.'"');
}
if($p_begin_date != ''){
$query = $query->andWhere('order_t.print_date>="'.$p_begin_date.'"');
}
if($p_end_date != ''){
$query = $query->andWhere('order_t.print_date<="'.$p_begin_date.'"');
}
if ($status == 1) {//礼券未使用
$query = $query->andWhere('gift_t.type_id=2 and gift_ticket_t_use.status=1');
} elseif ($status == 2) {//礼券使用中
$query = $query->andWhere('gift_t.type_id=2 and gift_ticket_t_use.status=2');
}
if ($status == 3) {//礼券使用完
$query = $query->andWhere('gift_t.type_id=2 and gift_ticket_t_use.status=3');
}
if ($status == 4) {//礼品未出库
$query = $query->andWhere('gift_t.type_id=1 and gift_ticket_t_use.status=1');
}
if ($status == 5) {//礼品已出库
$query = $query->andWhere('gift_t.type_id=1 and gift_ticket_t_use.status=3');
}
if($frame_no != '') {
$query = $query->andWhere('order_t.car_frame_no="'.$frame_no.'"');
}
if($engine_no != '') {
$query = $query->andWhere('order_t.engine_no="'.$engine_no.'"');
}
if($insurer1_no != '') {
$query = $query->andWhere('order_t.insurer1_no='.$insurer1_no);
}
if($type_id > 0) {
$query = $query->andWhere('gift_ticket_t_use.type_id='.$type_id);
}
// echo $query->createCommand()->rawSql;
$total = $query->count();
$items = $query->offset($offset)->limit($limit)->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$order_info = $item->order;
$gift_info = $item->typeNew;
$row = $item->toArray();
$row['name'] = $gift_info->name;
$row['car_no'] = $item->car_no;
$row['car_frame_no'] = $order_info->car_no;
$row['op'] = $item->op?$item->op->getShowName():'';
$row['finished_date'] = $item->finished_date != '0000-00-00'?$item->finished_date:'';
$row['username'] = ($item->user && $item->status > 0)?$item->user->getShowName():'';
$row['submit_user'] = $order_info->user ? $order_info->user->getShowName():'';
$row['status'] = $item->getStatus();
$row['use_num'] = $gift_info->use_num;
$data['rows'][] = $row;
}
return $data;
}
public function actionTicketUse() {
$type_items = GiftT::find()
->where(['type_id'=>2,'is_delete'=>0])
->all();
return $this->render('ticket-use', [
'type_items' => $type_items
]);
}
public function actionTicketUseJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$code = $request->get('code');
$car_id = $request->get('car_id',0);
$car_no = $request->get('car_no');
$order_id = $request->get('order_id');
$username = $request->get('username');
$s_begin_date = $request->get('s_begin_date');
$s_end_date = $request->get('s_end_date');
$p_begin_date = $request->get('p_begin_date');
$p_end_date = $request->get('p_end_date');
$status = $request->get('status');
$frame_no = $request->get('frame_no');
$engine_no = $request->get('engine_no');
$insurer1_no = $request->get('insurer1_no');
$type_id = $request->get('type_id');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = GiftTicketTUse::find()
->leftJoin('order_t','order_t.id=gift_ticket_t_use.order_id')
->leftJoin('gift_t','gift_t.id=gift_ticket_t_use.type_id')
->leftJoin('user_t','user_t.id=gift_ticket_t_use.user_id')
->where('gift_t.type_id=2')
->orderBy('id DESC');
if($code != '') {
$query->andWhere('gift_ticket_t_use.code="'.$code.'"');
}
if($car_id > 0) {
$query->andWhere('order_t.car_id='.$car_id);
}
if($order_id > 0) {
$query->andWhere('order_t.id='.$order_id);
}
if($car_no != '') {
$query->andWhere('gift_ticket_t_use.car_no like "'.$car_no.'"');
}
if($username != ''){ if($username != ''){
$user = UserT::find()->where('username="'.$username.'"')->andWhere('is_delete=0')->one(); $user = UserT::find()->where('username="'.$username.'"')->andWhere('is_delete=0')->one();
$query = $query->andWhere('gift_ticket_t_use.op_id='.$user->id); $query->andWhere('gift_ticket_t_use.op_id='.$user->id);
} }
if($s_begin_date != ''){ if($s_begin_date != ''){
$query = $query->andWhere('order_t.submit_date>="'.$s_begin_date.'"'); $query->andWhere('order_t.submit_date>="'.$s_begin_date.'"');
} }
if($s_end_date != ''){ if($s_end_date != ''){
$query = $query->andWhere('order_t.submit_date<="'.$s_begin_date.'"'); $query = $query->andWhere('order_t.submit_date<="'.$s_begin_date.'"');
@ -888,7 +1014,8 @@ class GiftController extends \yii\web\Controller
$row['car_frame_no'] = $order_info->car_no; $row['car_frame_no'] = $order_info->car_no;
$row['op'] = $item->op?$item->op->getShowName():''; $row['op'] = $item->op?$item->op->getShowName():'';
$row['finished_date'] = $item->finished_date != '0000-00-00'?$item->finished_date:''; $row['finished_date'] = $item->finished_date != '0000-00-00'?$item->finished_date:'';
$row['user'] = ($item->user && $item->status > 0)?$item->user->getShowName():''; $row['username'] = ($item->user && $item->status > 0)?$item->user->getShowName():'';
$row['submit_user'] = $order_info->user ? $order_info->user->getShowName():'';
$row['status'] = $item->getStatus(); $row['status'] = $item->getStatus();
$row['use_num'] = $gift_info->use_num; $row['use_num'] = $gift_info->use_num;
$data['rows'][] = $row; $data['rows'][] = $row;
@ -968,4 +1095,115 @@ class GiftController extends \yii\web\Controller
return $data; return $data;
} }
public function actionTicketUseEdit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
$back_params = $request->get('back_params');
if($id > 0) {
$info = GiftTicketTUse::findOne(['id'=>$id]);
} else {
$info = new GiftTicketTUse();
}
return $this->render('ticket-use-edit',[
'info' => $info
]);
}
public function actionHistoryLogJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('id');
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$query = GiftUseLogT::find()
->where('gift_use_id='.$id)
->orderBy('op_time DESC');
$total = $query->count();
$query->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$row['op_time'] = date('Y-m-d H:i:s', $item->op_time);
$data['rows'][] = $row;
}
return $data;
}
public function actionUseSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id');
$remark = $request->post('remark');
$tran = GiftTicketTUse::getDb()->beginTransaction();
try {
$ticket_info = GiftTicketTUse::findOne(['id'=>$id]);
if(!$ticket_info) {
$result['msg'] = '礼品券不存在!';
return $result;
}
$use_num = $ticket_info->typeNew->use_num;
$finished_num = $ticket_info->finished_num + 1;
$ticket_info->user_id = $this->my->id;
$ticket_info->finished_num = $finished_num;
$ticket_info->finished_date = date('Y-m-d');
$ticket_info->use_date = date('Y-m-d H:i:s');
if($finished_num < $use_num){
$ticket_info->status = 2;
}elseif ($finished_num >= $use_num){
$ticket_info->status = 3;
}
if(!$ticket_info->save()) {
throw new \Exception(print_r($ticket_info->getErrors(), true));
}
$this->addGiftUseLog($id,'使用了一次',$remark);
$result['success'] = true;
$result['msg'] = '保存成功';
$tran->commit();
} catch (\Exception $e) {
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
}
return $result;
}
public function addGiftUseLog($id,$info,$remark,$type=1)
{
$log_info = new GiftUseLogT();
$log_info->gift_use_id = $id;
$log_info->op_time = time();
$log_info->op_man = $this->my->getShowName();
$log_info->group_name = $this->my->group?$this->my->group->getPath():'';
$log_info->type = $type;
$log_info->remark = $remark;
$log_info->info = $info;
if(!$log_info->save()) {
throw new \Exception(print_r($log_info->getErrors(), true));
}
}
} }

@ -1,141 +0,0 @@
<?php
namespace frontend\controllers;
use common\libs\MyLib;
use common\models\GiftGroupT;
use common\models\GiftType2T;
use common\models\GiftType3T;
use common\models\GiftTypeT;
use common\models\UserT;
use Yii;
use yii\web\Response;
class GiftGroupController extends \yii\web\Controller
{
public $my = null;
public function init()
{
parent::init();
$cookie = Yii::$app->request->cookies;
$user_id = MyLib::encrypt($cookie->get('aid'),'DECODE');
if($user_id != 0)
{
$this->my = UserT::findOne(['id'=>$user_id]);
} else {
Yii::$app->response->redirect('/common/login')->send();
exit;
}
}
public function actionIndex()
{
$request = Yii::$app->request;
$name = $request->get('name');
$query = GiftGroupT::find()
->orderBy('id ASC')
->where('id>0');
if($name != '') {
$query = $query->andWhere('name like "'.$name.'%"');
}
$total = $query->count();
$items = $query->all();
return $this->render('index',[
'items' => $items,
'name' => $name
]);
}
public function actionEdit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
$info = GiftGroupT::findOne(['id'=>$id]);
if(!$info)
$info = new GiftGroupT();
$gifts = $info->gifts;
$gift_ids = array();
if($gifts) {
foreach($gifts as $gift) {
$gift_ids[] = $gift->id;
}
}
$gift_items = GiftType3T::find()->all();
return $this->render('edit',[
'info'=>$info,
'gift_ids'=>$gift_ids,
'gift_items'=>$gift_items
]);
}
public function actionSave() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
if($request->isPost) {
$id = intval($request->post('id'));
$name = $request->post('name');
$is_free = $request->post('is_free',0);
$is_damage = $request->post('is_damage',0);
$gift_ids = $request->post('gift_ids');
$gift_str = join(',',$gift_ids);
$min_money = $request->post('min_money');
$max_money = $request->post('max_money');
$group_ids = $request->post('group_ids');
$row = null;
if($id > 0) {
$row = GiftGroupT::findOne(['id'=>$id]);
} else {
$row = new GiftGroupT();
}
$row->name = $name;
$row->is_free = $is_free;
$row->is_damage = $is_damage;
$row->gift_ids = $gift_str;
$row->min_money = $min_money;
$row->max_money = $max_money;
$row->group_ids = $group_ids;
if(!$row->save()) {
var_dump($row->errors);
}
$result['success'] = true;
$result['msg'] = '操作成功';
return $result;
}
$result['success'] = false;
$reuslt['msg'] = '操作失败';
return $result;
}
public function actionDelete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = GiftGroupT::findOne(['id'=>$id]);
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
return $result;
}
}

@ -1,298 +0,0 @@
<?php
namespace frontend\controllers;
use common\libs\MyLib;
use common\models\GiftType2T;
use common\models\GiftType3T;
use common\models\GiftTypeT;
use common\models\UserT;
use Yii;
use yii\web\Response;
class GiftTypeController extends \yii\web\Controller
{
public $my = null;
public function init()
{
parent::init();
$cookie = Yii::$app->request->cookies;
$user_id = MyLib::encrypt($cookie->get('aid'),'DECODE');
if($user_id != 0)
{
$this->my = UserT::findOne(['id'=>$user_id]);
} else {
Yii::$app->response->redirect('/common/login')->send();
exit;
}
}
public function actionIndex()
{
$request = Yii::$app->request;
$name = $request->get('name');
$query = GiftTypeT::find();
if($name != '') {
$query = $query->andWhere(['like','name',$name]);
}
$items = $query->all();
return $this->render('index',[
'items' => $items,
'name' => $name
]);
}
public function actionEdit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id > 0) {
$info = GiftTypeT::findOne(['id'=>$id]);
} else {
$info = new GiftTypeT();
}
return $this->render('edit',[
'info' => $info
]);
}
public function actionSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id',0);
$name = $request->post('name');
if($name == '') {
$result['msg'] = '请输入名称!';
return $result;
}
$row = null;
if($id > 0) {
$row = GiftTypeT::findOne(['id'=>$id]);
} else {
$row = new GiftTypeT();
}
$row->name = $name;
$row->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionDelete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = GiftTypeT::findOne(['id'=>$id]);
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
return $result;
}
public function actionType2List()
{
$request = Yii::$app->request;
$name = $request->get('name');
$query = GiftType2T::find();
if($name != '') {
$query = $query->andWhere(['like','name',$name]);
}
$items = $query->all();
return $this->render('type2-list',[
'items' => $items,
'name' => $name
]);
}
public function actionType2Edit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id > 0) {
$info = GiftType2T::findOne(['id'=>$id]);
} else {
$info = new GiftType2T();
}
return $this->render('type2-edit',[
'info' => $info
]);
}
public function actionType2Save()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id',0);
$name = $request->post('name');
if($name == '') {
$result['msg'] = '请输入名称!';
return $result;
}
$row = null;
if($id > 0) {
$row = GiftType2T::findOne(['id'=>$id]);
} else {
$row = new GiftType2T();
}
$row->name = $name;
$row->save();
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionType2Delete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = GiftType2T::findOne(['id'=>$id]);
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
return $result;
}
public function actionType3List()
{
$request = Yii::$app->request;
$name = $request->get('name');
$query = GiftType3T::find();
if($name != '') {
$query = $query->andWhere(['like','name',$name]);
}
$items = $query->all();
return $this->render('type3-list',[
'items' => $items,
'name' => $name
]);
}
public function actionType3Edit()
{
$request = Yii::$app->request;
$id = $request->get('id',0);
if($id > 0) {
$info = GiftType3T::findOne(['id'=>$id]);
} else {
$info = new GiftType3T();
}
return $this->render('type3-edit',[
'info' => $info
]);
}
public function actionType3Save()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if($request->isPost) {
$id = $request->post('id',0);
$name = $request->post('name');
$price = $request->post('price',0);
$total = $request->post('total',-1);
$type = $request->post('type',0);
if($name == '') {
$result['msg'] = '请输入名称!';
return $result;
}
$row = null;
if($id > 0) {
$row = GiftType3T::findOne(['id'=>$id]);
} else {
$row = new GiftType3T();
}
$row->name = $name;
$row->price = $price;
$row->total = $total;
$row->type = $type;
if(!$row->save()) {
var_dump($row->errors);
}
$result['success'] = true;
$result['msg'] = '保存成功';
}
return $result;
}
public function actionType3Delete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
if($request->isPost) {
$id = $request->post('id',0);
if($id > 0) {
$row = GiftType3T::findOne(['id'=>$id]);
$row->delete();
$result['success'] = true;
$result['msg'] = '删除成功';
}
}
return $result;
}
}

File diff suppressed because it is too large Load Diff

@ -467,16 +467,26 @@ class MarketingStrategyController extends UserBaseController
$car_use_id = $request->post('car_use_id', 0); $car_use_id = $request->post('car_use_id', 0);
$company2_id = $request->post('company2_id', 0); $company2_id = $request->post('company2_id', 0);
//获取自己的所有策略
$items = ZhongjiUserT::find()
->where(['user_id'=>$this->my->id])
->all();
$celuo_ids = [];
foreach($items as $item) {
$celuo_ids[] = $item->celuo_id;
}
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$yingxiao_item = ZhongjiYingxiao::find() $query = ZhongjiYingxiao::find()
->where('begin_date<=:begin_date and end_date>=:end_date',[':begin_date'=>$date,':end_date'=>$date]) ->where('begin_date<=:begin_date and end_date>=:end_date',[':begin_date'=>$date,':end_date'=>$date])
->orderBy('id desc') ->andWhere(['in','id',$celuo_ids])
->one(); ->orderBy('id desc');
$yingxiao_item = $query->one();
if(!$yingxiao_item) { if(!$yingxiao_item) {
return $result; return $result;
} }
$items = ZhongjiTiaojian::find() $items = ZhongjiTiaojian::find()
->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id]) ->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id])
->andWhere(['<','baofei', $total1_clear])
->all(); ->all();
$ids = []; $ids = [];
foreach($items as $item) { foreach($items as $item) {

@ -48,7 +48,12 @@ class PhoneCenterController extends BaseController
public $layout = 'blue-main'; public $layout = 'blue-main';
public function actionCallRecords() { public function actionCallRecords() {
return $this->render('call-records'); $request = Yii::$app->request;
$company_type = $request->get('company_type',0);
return $this->render('call-records', [
'company_type' => $company_type
]);
} }
public function actionCallRecordsJson(){ public function actionCallRecordsJson(){
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
@ -67,14 +72,6 @@ class PhoneCenterController extends BaseController
$company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北 $company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北
if($company_type == 1){
$company_id=2;
}elseif ($company_type == 2){
$company_id=3;
}else {
$company_id=0;
}
$query = NetworkPhoneT::find() $query = NetworkPhoneT::find()
->leftJoin('user_t','user_t.id=network_phone_t.user_id') ->leftJoin('user_t','user_t.id=network_phone_t.user_id')
->where('user_t.is_delete=0 and user_t.is_leave=0'); ->where('user_t.is_delete=0 and user_t.is_leave=0');
@ -111,10 +108,7 @@ class PhoneCenterController extends BaseController
if($username != ''){ if($username != ''){
$query->andWhere('user_t.username="'.$username.'"'); $query->andWhere('user_t.username="'.$username.'"');
} }
if($company_id > 0) { // echo $query->createCommand()->rawSql;
$query->andWhere('user_t.company_id='.$company_id);
}
$total = $query->count(); $total = $query->count();
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
@ -512,7 +506,11 @@ public function actionDownload(){
} }
public function actionUsercallIndex() { public function actionUsercallIndex() {
return $this->render('usercall-index'); $request = Yii::$app->request;
$company_type = $request->get('company_type',0);
return $this->render('usercall-index',[
'company_type' => $company_type
]);
} }
public function actionUsercallIndexJson(){ public function actionUsercallIndexJson(){
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
@ -530,12 +528,6 @@ public function actionDownload(){
$user_id = 0; $user_id = 0;
if($company_type == 1){
$company_id=2;
}elseif ($company_type == 2){
$company_id=3;
}
$query = UserT::find() $query = UserT::find()
->rightJoin('network_phone_assign_t','`network_phone_assign_t`.`user_id`=`user_t`.`id`'); ->rightJoin('network_phone_assign_t','`network_phone_assign_t`.`user_id`=`user_t`.`id`');
@ -547,9 +539,6 @@ public function actionDownload(){
if($caller != ''){ if($caller != ''){
$query->andWhere('user_t.username="'.$caller.'"'); $query->andWhere('user_t.username="'.$caller.'"');
} }
if($company_id > 0) {
$query->andWhere('user_t.company_id='.$company_id);
}
$query->andWhere('user_t.is_delete=0 and user_t.is_leave=0')->orderBy('user_t.username'); $query->andWhere('user_t.is_delete=0 and user_t.is_leave=0')->orderBy('user_t.username');
@ -563,16 +552,6 @@ public function actionDownload(){
$total = $query->count(); $total = $query->count();
// foreach($items as $value){
// $car_data= CarT::findOne(['id'=>$value->car_id]);
// $value->car_no=$car_data->car_no;
// $value->save();
// }
// dd($items);
// die;
$query = $query->offset($offset)->limit($limit); $query = $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
@ -582,6 +561,24 @@ public function actionDownload(){
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['total_call_num'] = $item->totalCallNum($begin_date,$end_date);
$row['total_call_time_out'] = $item->totalCallTimeOut($begin_date,$end_date);
$row['total_call_time'] = $item->totalCallTime($begin_date,$end_date);
$row['call_in_total_num'] = $item->callInTotalNum($begin_date,$end_date);
$row['call_in_suc_num'] = $item->callInSucNum($begin_date,$end_date);
$row['call_in_suc_num_rate'] = number_format($item->callInTotalNum($begin_date,$end_date)? $item->callInSucNum($begin_date,$end_date)/$item->callInTotalNum($begin_date,$end_date) :0,2);
$row['call_out_total_num'] = $item->callOutTotalNum($begin_date,$end_date);
$row['call_out_suc_num'] = $item->callOutSucNum($begin_date,$end_date);
$row['call_out_suc_num_rate'] = number_format($item->callOutTotalNum($begin_date,$end_date)?$item->callOutSucNum($begin_date,$end_date)/$item->callOutTotalNum($begin_date,$end_date):0,2) ;
if($item->phoneStatus) {
if($item->phoneStatus->is_phone==1) {
$row['phone_status'] = '<div style="background: #00B83F;width: 50px;">通话中</div>';
} else {
$row['phone_status'] = '<div style="background: #b03d3d;width: 50px;">未通话</div>';
}
} else {
$row['phone_status'] = '<div style="background: #b03d3d;width: 50px;">未通话</div>';
}
$data['rows'][] = $row; $data['rows'][] = $row;
} }

@ -248,7 +248,8 @@ class PhoneController extends \yii\web\Controller
} }
} }
public function actionPushApi()
public function actionPushApi()
{ {
// header("Content-type: text/html; charset=utf-8"); // header("Content-type: text/html; charset=utf-8");
// Yii::$app->response->format = Response::FORMAT_JSON; // Yii::$app->response->format = Response::FORMAT_JSON;
@ -275,8 +276,14 @@ public function actionPushApi()
$called_area=$request->post('called_area'); $called_area=$request->post('called_area');
$extend=$request->post('extend'); $extend=$request->post('extend');
$item = NetworkPhoneAssignT::find()
->where('phone=:phone1 or phone=:phone2',[':phone1'=>$caller,':phone2'=>$called])
->one();
if(!$item) {
return json_encode(['code' => 400,'message' => "失败"]);;
}
// file_put_contents('/tmp/'.time().rand(100,999).'.log', print_r($request->post(), true));
//$b = new GiftCreateImageErrorT(); //$b = new GiftCreateImageErrorT();
$network_phone = NetworkPhoneT::findOne(['recorder_id'=>$recorder_id]); $network_phone = NetworkPhoneT::findOne(['recorder_id'=>$recorder_id]);
if(!$network_phone){ if(!$network_phone){
@ -330,13 +337,6 @@ public function actionPushApi()
$network_phone->extend=$extend; $network_phone->extend=$extend;
$network_phone->begin_date=date('Y-m-d'); $network_phone->begin_date=date('Y-m-d');
$network_phone->is_called=$is_called; $network_phone->is_called=$is_called;
$res = $network_phone->save(false); $res = $network_phone->save(false);
@ -352,8 +352,6 @@ public function actionPushApi()
->andWhere('record_file_url is null or record_file_url = ""') ->andWhere('record_file_url is null or record_file_url = ""')
->andWhere('record_file_url_real is not null or record_file_url_real <> ""') ->andWhere('record_file_url_real is not null or record_file_url_real <> ""')
->all(); ->all();
// $b->error = 222;
// $b->save();
foreach ($phone_items as $item) { foreach ($phone_items as $item) {
if ($item->record_file_url == '') { if ($item->record_file_url == '') {
$url = ''; $url = '';
@ -373,14 +371,34 @@ public function actionPushApi()
} }
} }
// $b->error = 333;
// $b->save();
// if($res){
return json_encode(['code' => 0,'message' => "成功"]); return json_encode(['code' => 0,'message' => "成功"]);
// }else{
// return ['code' => 400,'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) { function phoneMp3Bak($url) {
@ -474,7 +492,6 @@ public function actionPushApi()
} }
public function actionCallApi() public function actionCallApi()
{ {
header("Content-type: application/json;charset=UTF-8"); header("Content-type: application/json;charset=UTF-8");

@ -31,9 +31,12 @@ use \common\libs\MyLib;
<div class="col-sm-3"> <div class="col-sm-3">
<input type="text" name="car_man" value="<?=$info->car_man?>" class="form-control"> <input type="text" name="car_man" value="<?=$info->car_man?>" class="form-control">
</div> </div>
<label class="col-sm-1 control-label">联系电话</label> <label class="col-sm-1 control-label">证件类型</label>
<div class="col-sm-3"> <div class="col-sm-3">
<input type="text" name="phone" value="<?=$info->phone?>" class="form-control"> <select name="car_man_type" class="form-control">
<option value="身份证">身份证</option>
<option value="营业执照">营业执照</option>
</select>
</div> </div>
<label class="col-sm-1 control-label">证件号码</label> <label class="col-sm-1 control-label">证件号码</label>
<div class="col-sm-3"> <div class="col-sm-3">
@ -41,6 +44,10 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-1 control-label">联系电话</label>
<div class="col-sm-3">
<input type="text" name="phone" value="<?=$info->phone?>" class="form-control">
</div>
<label class="col-sm-1 control-label">厂牌型号</label> <label class="col-sm-1 control-label">厂牌型号</label>
<div class="col-sm-3"> <div class="col-sm-3">
<input type="text" name="factory_model" value="<?=$info->factory_model?>" class="form-control"> <input type="text" name="factory_model" value="<?=$info->factory_model?>" class="form-control">
@ -49,27 +56,13 @@ use \common\libs\MyLib;
<div class="col-sm-3"> <div class="col-sm-3">
<input type="text" name="register_date" value="<?=$info->register_date?>" class="form-control date" autocomplete="off"> <input type="text" name="register_date" value="<?=$info->register_date?>" class="form-control date" autocomplete="off">
</div> </div>
<label class="col-sm-1 control-label">座位数</label>
<div class="col-sm-3">
<input type="text" name="seats" value="<?=$info->seats?>" class="form-control">
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-1 control-label">车辆类型</label> <label class="col-sm-1 control-label">座位数</label>
<div class="col-sm-3"> <div class="col-sm-3">
<select name="car_type_id" class="form-control"> <input type="text" name="seats" value="<?=$info->seats?>" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($car_type_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->car_type_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div> </div>
<label class="col-sm-1 control-label">运营性质</label> <label class="col-sm-1 control-label">使用性质</label>
<div class="col-sm-3"> <div class="col-sm-3">
<select name="car_use_id" class="form-control"> <select name="car_use_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -83,6 +76,10 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<label class="col-sm-1 control-label">购置价</label>
<div class="col-sm-3">
<input type="text" name="purchase_price" value="<?=$info->purchase_price?>" class="form-control">
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-1 control-label">备注</label> <label class="col-sm-1 control-label">备注</label>

@ -22,7 +22,7 @@ use \common\libs\MyLib;
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="opDlg()"> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="opDlg()">
<i class="fa fa-history"></i> 操作记录 <i class="fa fa-history"></i> 操作记录
</a> </a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="history.go(-1)"> <a class="btn btn-primary btn-xs history-btn" data-id="0" href="javascript:void(0);" onclick="history.go(-1)">
<i class="fa fa-backward"></i> 返回 <i class="fa fa-backward"></i> 返回
</a> </a>
</div> </div>
@ -168,6 +168,9 @@ use \common\libs\MyLib;
<div class="ibox-title"> <div class="ibox-title">
<h5>预约记录</h5> <h5>预约记录</h5>
<div class="ibox-tools"> <div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="invalidDlg()">
<i class="fa fa-ban"></i> 无效数据
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="appointmentDlg()"> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="appointmentDlg()">
<i class="fa fa-calendar"></i> 预约 <i class="fa fa-calendar"></i> 预约
</a> </a>
@ -207,6 +210,10 @@ use \common\libs\MyLib;
title = '投保'; title = '投保';
layer_show(title, '/car/order-add?car_id=<?=$car_info->id?>'); layer_show(title, '/car/order-add?car_id=<?=$car_info->id?>');
} }
function invalidDlg() {
title = '无效数据';
layer_show(title, '/car/invalid-car?car_id=<?=$car_info->id?>');
}
function appointmentDlg() { function appointmentDlg() {
title = '添加预约'; title = '添加预约';
layer_show(title, '/appointment/add?car_id=<?=$car_info->id?>'); layer_show(title, '/appointment/add?car_id=<?=$car_info->id?>');
@ -363,7 +370,7 @@ use \common\libs\MyLib;
var number_one = phone; var number_one = phone;
$.get('/phone/ax-out',{'phone':number_one,'user_id':'<?=$my->id?>'},function(obj){ $.get('/phone/ax-out',{'phone':number_one,'user_id':'<?=$user_id?>'},function(obj){
if(obj.success) { if(obj.success) {
@ -512,7 +519,5 @@ use \common\libs\MyLib;
ws.send(val); ws.send(val);
console.log("数据已发送"); console.log("数据已发送");
} }
</script> </script>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>

@ -0,0 +1,67 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="car_id" value="<?=intval($car_id)?>">
<div class="form-group">
<label class="col-sm-2 control-label">无效理由</label>
<div class="col-sm-7">
<select name="invalid_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
</div>
<div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong>提 交</strong>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/car/invalid-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success) {
parent.history.go(-1);
layer_close();
}
},'json');
}, function(){
//
});
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -11,8 +11,8 @@ use common\models\PriceT;
<form class="form-horizontal" id="orderFrm"> <form class="form-horizontal" id="orderFrm">
<input type="hidden" name="car_id" value="<?=$order_info->car_id?>"> <input type="hidden" name="car_id" value="<?=$order_info->car_id?>">
<input type="hidden" name="id" value="<?=$order_info->id?>"> <input type="hidden" name="id" value="<?=$order_info->id?>">
<input type="hidden" name="celuo_id" id="celuo_id" value=""> <input type="hidden" name="celuo_id" id="celuo_id" value="<?=$order_info->celuo_id?>">
<input type="hidden" name="fanxian_id" id="fanxian_id" value=""> <input type="hidden" name="fanxian_id" id="fanxian_id" value="<?=$order_info->fanxian_id?>">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>保单信息</h5> <h5>保单信息</h5>
@ -23,12 +23,22 @@ use common\models\PriceT;
<th class="bg-warning">车牌号</th> <th class="bg-warning">车牌号</th>
<td><input name="car_no" class="form-control" style="width:100%;" type="text" value="<?=$order_info->car_no!='' ? $order_info->car_no:$car_info->car_no?>"></td> <td><input name="car_no" class="form-control" style="width:100%;" type="text" value="<?=$order_info->car_no!='' ? $order_info->car_no:$car_info->car_no?>"></td>
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><input name="register_date" class="form-control" style="width:100%;" type="text" value="<?=$car_info->register_date?>"></td> <td><input name="register_date" class="form-control date" style="width:100%;" type="text" value="<?=$car_info->register_date?>"></td>
<th class="bg-warning" nowrap>座位数</th> <th class="bg-warning" nowrap>座位数</th>
<td><input name="seats" class="form-control" style="width:100%;" type="text" value="<?=$order_info->seats ? $order_info->seats:$car_info->seats?>"></td> <td><input name="seats" class="form-control" style="width:100%;" type="text" value="<?=$order_info->seats ? $order_info->seats:$car_info->seats?>"></td>
<th class="bg-warning" nowrap>电子邮件</th> <th class="bg-warning" nowrap>电子邮件</th>
<td><input name="email" class="form-control" style="width:100%;" type="text" value="<?=$order_info->email?>"></td> <td><input name="email" class="form-control" style="width:100%;" type="text" value="<?=$order_info->email?>"></td>
</tr> </tr>
<tr>
<th class="bg-warning">车架号</th>
<td><input name="car_frame_no" class="form-control" style="width:100%;" type="text" value="<?=$order_info->car_frame_no!='' ? $order_info->car_frame_no:$car_info->car_frame_no?>"></td>
<th class="bg-warning" nowrap>发动机号</th>
<td><input name="engine_no" class="form-control date" style="width:100%;" type="text" value="<?=$order_info->engine_no!='' ? $order_info->engine_no:$car_info->engine_no?>"></td>
<th class="bg-warning" nowrap>厂牌型号</th>
<td><input name="factory_model" class="form-control" style="width:100%;" type="text" value="<?=$order_info->factory_model!='' ? $order_info->factory_model:$car_info->factory_model?>"></td>
<th class="bg-warning" nowrap>新车购置价</th>
<td><input name="purchase_price" class="form-control" style="width:100%;" type="text" value="<?=$order_info->purchase_price!='' ? $order_info->purchase_price:$car_info->purchase_price?>"></td>
</tr>
<tr> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>
<td><input name="car_man" class="form-control" style="width:100%;" type="text" value="<?=$order_info->car_man!='' ? $order_info->car_man:$car_info->car_man?>"></td> <td><input name="car_man" class="form-control" style="width:100%;" type="text" value="<?=$order_info->car_man!='' ? $order_info->car_man:$car_info->car_man?>"></td>
@ -77,20 +87,20 @@ use common\models\PriceT;
<tr> <tr>
<th class="bg-warning" nowrap>商业起保日期</th> <th class="bg-warning" nowrap>商业起保日期</th>
<td> <td>
<input type="text" id="insurer1_begin_date" name="insurer1_begin_date" class="form-control" value="<?=$order_info->insurer1_begin_date?>" autocomplete="off"> <input type="text" id="insurer1_begin_date" name="insurer1_begin_date" class="form-control date" value="<?=$order_info->insurer1_begin_date?>" autocomplete="off">
</td> </td>
<th class="bg-warning" nowrap>交强起保日期</th> <th class="bg-warning" nowrap>交强起保日期</th>
<td> <td>
<input type="text" id="insurer2_begin_date" name="insurer2_begin_date" class="form-control" value="<?=$order_info->insurer2_begin_date?>" autocomplete="off"> <input type="text" id="insurer2_begin_date" name="insurer2_begin_date" class="form-control date" value="<?=$order_info->insurer2_begin_date?>" autocomplete="off">
</td> </td>
<th class="bg-warning">保险公司</th> <th class="bg-warning">保险公司</th>
<td> <td>
<select name="company2_id" id="company2_id" class="form-control"> <select name="company_id" id="company_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
<?php <?php
foreach($insurer_company_items as $item) { foreach($insurer_company_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'"';
if($item->id == $order_info->company2_id) if($item->id == $order_info->company_id)
echo ' selected '; echo ' selected ';
echo '>'.$item->name.'</option>'; echo '>'.$item->name.'</option>';
} }
@ -140,7 +150,7 @@ use common\models\PriceT;
<?php <?php
if($item->content != '') { if($item->content != '') {
$tmp_items = explode(',',$item->content); $tmp_items = explode(',',$item->content);
echo '<select name="types['.$item->id.']" class="form-control">'; echo '<select name="types['.$item->id.']" class="form-control insurer-select" data-id="'.$item->id.'">';
$tmp_items = explode(',',$item->content); $tmp_items = explode(',',$item->content);
foreach($tmp_items as $tmp_item) { foreach($tmp_items as $tmp_item) {
echo '<option'; echo '<option';
@ -150,7 +160,7 @@ use common\models\PriceT;
} }
echo '</select>'; echo '</select>';
} else { } else {
echo '<input name="types['.$item->id.']" class="form-control" style="width:100px;" type="text"'; echo '<input name="types['.$item->id.']" class="form-control insurer-input" data-id="'.$item->id.'" style="width:100px;" type="text"';
if(!empty($tmp_row)) if(!empty($tmp_row))
echo ' value="'.$tmp_row->val.'" '; echo ' value="'.$tmp_row->val.'" ';
echo '>'; echo '>';
@ -158,10 +168,12 @@ use common\models\PriceT;
?> ?>
</td> </td>
<td> <td>
<?php if($item->has_nopay == 1) { ?>
<div class="checkbox checkbox-inline"> <div class="checkbox checkbox-inline">
<input type="checkbox" name="nopays[<?=$item->id?>]" id="nopays_<?=$item->id?>" value="1" <?=(!empty($tmp_row) && $tmp_row->is_nopay == 1)?'checked':''?>> <input type="checkbox" name="nopays[<?=$item->id?>]" id="nopays_<?=$item->id?>" value="1" <?=(!empty($tmp_row) && $tmp_row->is_nopay == 1)?'checked':''?>>
<label for="nopays_<?=$item->id?>"> 不计免赔 </label> <label for="nopays_<?=$item->id?>"> 不计免赔 </label>
</div> </div>
<?php } ?>
</td> </td>
<?php <?php
if(($i+1)%3==0) { if(($i+1)%3==0) {
@ -214,8 +226,20 @@ use common\models\PriceT;
<td><input name="total_all" id="total_all" class="form-control" style="width:120px;" type="text" value="<?=$order_info->total_all?>"></td> <td><input name="total_all" id="total_all" class="form-control" style="width:120px;" type="text" value="<?=$order_info->total_all?>"></td>
<th class="bg-warning">应收</th> <th class="bg-warning">应收</th>
<td><input name="total_real" id="total_real" class="form-control" style="width:120px;" type="text" value="<?=$order_info->total_real?>"></td> <td><input name="total_real" id="total_real" class="form-control" style="width:120px;" type="text" value="<?=$order_info->total_real?>"></td>
<th class="bg-warning">&nbsp;</th> <th class="bg-warning">支付方式</th>
<td>&nbsp;</td> <td>
<select name="pay_type_id" id="pay_type_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($pay_type_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $order_info->pay_type_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
@ -313,27 +337,19 @@ use common\models\PriceT;
<?php $this->beginBlock('footer_js'); ?> <?php $this->beginBlock('footer_js'); ?>
<script> <script>
layui.use(['laydate'], function(){
var laydate = layui.laydate;
laydate.render({
elem:'#insurer1_begin_date',
format: 'yyyy-MM-dd'
});
laydate.render({
elem:'#insurer2_begin_date',
format: 'yyyy-MM-dd'
});
});
var o = {}; var o = {};
var fanxian_rate = 0, max_fanxian = 0; var fanxian_rate = 0, max_fanxian = 0;
//获取策略
function getYingXiao() { function getYingXiao() {
parent.layer.msg('操作成功');
var params = $('#orderFrm').serialize(); var params = $('#orderFrm').serialize();
$.post('/marketing-strategy/get-yingxiao', params, function(obj) { $.post('/marketing-strategy/get-yingxiao', params, function(obj) {
if(obj.success) { if(obj.success) {
$('#celuo_id').val(obj.celuo_id); $('#celuo_id').val(obj.celuo_id);
// if(obj.num > 1) {
layer_show('选择策略', '/marketing-strategy/select-fanxian?ids=' + obj.ids); layer_show('选择策略', '/marketing-strategy/select-fanxian?ids=' + obj.ids);
// } else {
// selectFanxian(obj.ids);
// }
} else { } else {
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
} }
@ -351,6 +367,7 @@ use common\models\PriceT;
}, 'json'); }, 'json');
} }
function getGifts(fanxian_id) { function getGifts(fanxian_id) {
$('#gifts').html('');
$.get('/marketing-strategy/get-gifts?type=1&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){ $.get('/marketing-strategy/get-gifts?type=1&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){
if(obj.success) { if(obj.success) {
var html = '<div class="ibox float-e-margins">'; var html = '<div class="ibox float-e-margins">';
@ -372,6 +389,7 @@ use common\models\PriceT;
html += ' checked '; html += ' checked ';
html += '>'; html += '>';
html += '<label for="gift_' + item.id + '_' + sub_item.id + '">' + sub_item.name + '</label>'; html += '<label for="gift_' + item.id + '_' + sub_item.id + '">' + sub_item.name + '</label>';
html += '&nbsp;<a href="' + sub_item.original_img + '" target="_blank" title="预览"> <i class="fa fa-image"></i> </a>';
html += '</div>'; html += '</div>';
}); });
html += '</td>'; html += '</td>';
@ -382,9 +400,10 @@ use common\models\PriceT;
html += '</div>'; html += '</div>';
$('#gifts').html(html); $('#gifts').html(html);
} else { } else {
parent.layer.msg(obj.msg); // parent.layer.msg(obj.msg);
} }
}, 'json'); }, 'json');
$('#quans').html('');
$.get('/marketing-strategy/get-gifts?type=2&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){ $.get('/marketing-strategy/get-gifts?type=2&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){
if(obj.success) { if(obj.success) {
var html = '<div class="ibox float-e-margins">'; var html = '<div class="ibox float-e-margins">';
@ -406,6 +425,7 @@ use common\models\PriceT;
html += ' checked '; html += ' checked ';
html += '>'; html += '>';
html += '<label for="gift_' + item.id + '_' + sub_item.id + '">' + sub_item.name + '</label>'; html += '<label for="gift_' + item.id + '_' + sub_item.id + '">' + sub_item.name + '</label>';
html += '&nbsp;<a href="' + sub_item.original_img + '" target="_blank" title="预览"> <i class="fa fa-image"></i> </a>';
html += '</div>'; html += '</div>';
}); });
html += '</td>'; html += '</td>';
@ -416,7 +436,7 @@ use common\models\PriceT;
html += '</div>'; html += '</div>';
$('#quans').html(html); $('#quans').html(html);
} else { } else {
parent.layer.msg(obj.msg); //parent.layer.msg(obj.msg);
} }
}, 'json'); }, 'json');
} }
@ -466,6 +486,35 @@ use common\models\PriceT;
} }
$(function() { $(function() {
//绑定日期控件
$('.date').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true
});
//险种选择框事件
$('.insurer-select').change(function() {
var id = $(this).data('id');
var val = $(this).val();
if(val !== '否') {
$('#nopays_' + id).prop('checked', 'checked');
} else {
$('#nopays_' + id).prop('checked', '');
}
});
//险种输入框事件
$('.insurer-input').change(function() {
var id = $(this).data('id');
var val = $(this).val();
if(val !== '') {
$('#nopays_' + id).prop('checked', 'checked');
} else {
$('#nopays_' + id).prop('checked', '');
}
});
getGifts(<?=$order_info->fanxian_id?>); getGifts(<?=$order_info->fanxian_id?>);
$('#total1_clear').blur(function(){ $('#total1_clear').blur(function(){
$('#total1').val(($(this).val() * 1.06).toFixed(2)); $('#total1').val(($(this).val() * 1.06).toFixed(2));
@ -486,11 +535,13 @@ use common\models\PriceT;
$('#yuangong_money').blur(function(){ $('#yuangong_money').blur(function(){
calc(); calc();
}); });
$('#total3').blur(function(){
calc();
});
//生成短信内容 //生成短信内容
$('.sms-make-btn').click(function(){ $('.sms-make-btn').click(function(){
var params = $('#orderFrm').serialize(); var params = $('#orderFrm').serialize();
var baoxiangs=$('#company2_id').val(); var baoxiangs=$('#company_id').val();
var smstel=$('#sms-tel').val(); var smstel=$('#sms-tel').val();
if(isNull(smstel)){ if(isNull(smstel)){
@ -514,7 +565,7 @@ use common\models\PriceT;
$('.sms-send-btn').click(function(){ $('.sms-send-btn').click(function(){
var tel = $('#sms-tel').val(); var tel = $('#sms-tel').val();
var msg = $('#sms-msg').val(); var msg = $('#sms-msg').val();
var baoxiangs=$('#company2_id').val(); var baoxiangs=$('#company_id').val();
var smstel=$('#sms-tel').val(); var smstel=$('#sms-tel').val();
var smsmsg=$('#sms-msg').val(); var smsmsg=$('#sms-msg').val();
@ -532,7 +583,7 @@ use common\models\PriceT;
} }
// return; // return;
$.post('/car/sms-send',{tel:tel,msg:msg,company2_id:baoxiangs},function(obj){ $.post('/car/sms-send',{tel:tel,msg:msg,company_id:baoxiangs},function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
},'json'); },'json');
}); });

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>汇盈车险业务系统 - 主页</title> <title>万方车险业务系统 - 主页</title>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;/ie.html" /> <meta http-equiv="refresh" content="0;/ie.html" />
<![endif]--> <![endif]-->
@ -70,7 +70,7 @@
</button> </button>
<nav class="page-tabs J_menuTabs"> <nav class="page-tabs J_menuTabs">
<div class="page-tabs-content"> <div class="page-tabs-content">
<a href="javascript:;" class="active J_menuTab" data-id="index_v1.html">首页</a> <a href="javascript:;" class="active J_menuTab" data-id="/">首页</a>
</div> </div>
</nav> </nav>
<button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i> <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>

@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>登录 - 汇盈车险业务系统</title> <title>登录 - 万方车险业务系统</title>
<link href="/assets/css/bootstrap.min.css" rel="stylesheet"> <link href="/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="/assets/css/font-awesome.css?v=4.4.0" rel="stylesheet"> <link href="/assets/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="/assets/css/animate.css" rel="stylesheet"> <link href="/assets/css/animate.css" rel="stylesheet">
@ -30,7 +30,7 @@
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
<form method="post"> <form method="post">
<h2 class="m-t-md text-center" style="color: #000;">汇盈车险业务系统</h2> <h2 class="m-t-md text-center" style="color: #000;">万方车险业务系统</h2>
<input type="text" id="username" name="username" class="form-control uname" placeholder="用户名" /> <input type="text" id="username" name="username" class="form-control uname" placeholder="用户名" />
<input type="password" id="password" name="password" class="form-control pword m-b" placeholder="密码" /> <input type="password" id="password" name="password" class="form-control pword m-b" placeholder="密码" />
<button id="login" class="btn btn-danger btn-block">登录</button> <button id="login" class="btn btn-danger btn-block">登录</button>

@ -16,12 +16,65 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();"> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="name">补点比例</label> <label for="name">保险类型</label>
<input type="text" id="name" name="name" class="form-control"> <select name="insurer_type" class="form-control">
<option value="0" >所有类型</option>
<option value="1">商业险</option>
<option value="2">交强险</option>
</select>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">计算</button> <div class="form-group" style="margin-bottom: 8px;">
<label for="name">车牌类型</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="name">保险公司</label>
<select name="company_id" class="form-control">
<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>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="name">出单日期</label>
<div class="input-daterange input-group">
<input type="text" id="begin_date" name="begin_date" class="form-control date" value="<?=date('Y-m-d')?>" autocomplete="off">
<div class="input-group-addon">-</div>
<input type="text" id="end_date" name="end_date" class="form-control date" value="<?=date('Y-m-d')?>" autocomplete="off">
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="name">商业净保费</label>
<div class="input-group">
<input type="text" id="begin_totalclear" name="begin_totalclear" class="form-control">
<div class="input-group-addon"></div>
<div class="input-group-addon">-</div>
<input type="text" id="end_totalclear" name="end_totalclear" class="form-control">
<div class="input-group-addon"></div>
</div>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
<br>
<div class="form-group" style="margin-bottom: 8px;">
<label for="name">设置补点比例</label>
<div class="input-group">
<input type="text" id="budian_rate" name="budian_rate" class="form-control">
<div class="input-group-addon">%</div>
</div>
</div>
<button type="button" class="btn btn-primary mb-8 btn-save">保存</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@ -53,20 +106,26 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.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 src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script> <script>
var o = {};
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }
function search() { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy'); $('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({ $('#listTable').bootstrapTable({
url: "/finance/budian-list-json", url: "/finance/budian-list-json",
pagination: true, pagination: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
params.type_id = $('#type_id').val(); o['offset'] = params['offset'];
params.name = $('#name').val(); o['limit'] = params['limit'];
return params; return o;
} }
}); });
return false; return false;
@ -74,6 +133,29 @@ use \common\libs\MyLib;
$(function() { $(function() {
search(); search();
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
$(".btn-save").click(function(){
layer.confirm('是否保存当前条件下的所有记录补点比例?', {
btn: ['保存','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var last_url = '/finance/budian-save';
var params = $("#searchFrm").serialize();
$.get(last_url,params,function(obj){
layer.msg(obj.msg);
if(obj.success){
refreshList();
}
},'json');
}, function(){
//
});
});
}); });
</script> </script>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>

@ -62,16 +62,6 @@ use \common\libs\MyLib;
}); });
}); });
$(function () { $(function () {
//上传
$('#fileupload').fileupload({
url: '/finance/receipt-upload',
dataType: 'json',
done: function (e, data) {
var file_info = data.result.files[0];
$('#urlfile').val(file_info.url);
$('#submit-btn').removeAttr('disabled');
}
});
//提交按钮 //提交按钮
$(".btn-save").click(function(){ $(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', { parent.layer.confirm('是否确认提交?', {
@ -80,7 +70,7 @@ use \common\libs\MyLib;
}, function(){ }, function(){
var params = $("#theFrm").serialize(); var params = $("#theFrm").serialize();
$.post('/finance/car-update-frame-info',params,function(obj){ $.post('/finance/car-update-frame-info',params,function(obj){
parent.layer.msg(data.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); window.location.reload();
} }

@ -1,79 +1,105 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php
<form id="theFrm"> use \common\libs\MyLib;
<input type="hidden" name="id" value="<?=$caiwu_info->id?>"> ?>
<tr> <?php $this->beginBlock('header_css'); ?>
<td width="100" height="25" class="td_bg">车牌号</td> <link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<td colspan="3" height="25" class="td_bg"> <?php $this->endBlock(); ?>
<?=$caiwu_info->car_no?>
</td> <div class="wrapper wrapper-content animated fadeInRight">
</tr> <div class="ibox float-e-margins">
<tr> <div class="ibox-content">
<td width="100" height="25" class="td_bg">保险公司</td> <div class="row">
<td height="25" class="td_bg"> <div class="col-sm-12">
<?=$caiwu_info->company?> <form role="form" class="form-horizontal data-from" id="theFrm">
</td> <input type="hidden" name="id" value="<?=intval($caiwu_info->id)?>">
<td width="100" height="25" class="td_bg">保单号</td> <div class="form-group">
<td height="25" class="td_bg"> <label class="col-sm-2 control-label">无效理由</label>
<input name="insurer_no" type="text" id="insurer_no" value="<?=$caiwu_info->insurer_no?>" style="width:300px;"/> <div class="col-sm-3">
</td> <p class="form-control-static"><?=$caiwu_info->car_no?></p>
</tr> </div>
<tr> </div>
<td width="100" height="25" class="td_bg">总保费</td> <div class="form-group">
<td height="25" class="td_bg"> <label class="col-sm-2 control-label">保险公司</label>
<?=$caiwu_info->total?> <div class="col-sm-3">
</td> <p class="form-control-static"><?=$caiwu_info->order->company2->name?></p>
<td width="100" height="25" class="td_bg">净保费</td> </div>
<td height="25" class="td_bg"> <label class="col-sm-2 control-label">保单号</label>
<?=$caiwu_info->total_clear?> <div class="col-sm-3">
</td> <input type="text" name="insurer_no" value="<?=$caiwu_info->insurer_no?>" class="form-control">
</tr> </div>
<tr> </div>
<td width="100" height="25" class="td_bg">手续费比例</td> <div class="form-group">
<td colspan="3" height="25" class="td_bg"> <label class="col-sm-2 control-label">总保费</label>
<input name="total_rate" type="text" id="total_rate" value="<?=$caiwu_info->total_rate?>" style="width:100px;"/>% <div class="col-sm-3">
</td> <p class="form-control-static"><?=$caiwu_info->total?></p>
</tr> </div>
<tr> <label class="col-sm-2 control-label">净保费</label>
<td width="100" height="25" class="td_bg">回款金额</td> <div class="col-sm-3">
<td height="25" class="td_bg"> <p class="form-control-static"><?=$caiwu_info->total_clear?></p>
<input name="r_total" type="text" id="r_total" value="<?=$caiwu_info->r_total?>" style="width:100px;"/> </div>
</td> </div>
<td width="100" height="25" class="td_bg">回款日期</td> <div class="form-group">
<td height="25" class="td_bg"> <label class="col-sm-2 control-label">手续费比例</label>
<input name="r_date" type="text" id="r_date" class="Wdate" value="<?=$caiwu_info->r_date?>" style="width:100px;" onclick="WdatePicker()"/> <div class="col-sm-3">
</td> <div class="input-group">
</tr> <input type="text" name="total_rate" value="<?=$caiwu_info->total_rate?>" class="form-control">
<div class="input-group-addon">%</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">回款金额</label>
<div class="col-sm-3">
<input type="text" name="r_total" value="<?=$caiwu_info->r_total?>" class="form-control">
</div>
<label class="col-sm-2 control-label">回款日期</label>
<div class="col-sm-3">
<input type="text" name="r_date" id="r_date" value="<?=$caiwu_info->r_date?>" class="form-control" autocomplete="off">
</div>
</div>
<div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong>提 交</strong>
</button>
</div>
</div>
</div>
</form> </form>
<tr> </div>
<td height="22" colspan="4" align="center" class="td_bg"> </div>
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> </div>
&nbsp;&nbsp; </div>
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> </div>
</td>
</tr> <?php $this->beginBlock('footer_js'); ?>
</table> <script src="/assets/js/plugins/layer/laydate/laydate.js"></script>
<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/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(function () { $(function () {
laydate({
elem:'#r_date',
format: 'YYYY-MM-DD'
});
//提交按钮 //提交按钮
$("#submit-btn").click(function(){ $(".btn-save").click(function(){
if(confirm('是否确认提交?')) { parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize(); var params = $("#theFrm").serialize();
$.post('/finance/receipt-save',params,function(obj){ $.post('/finance/receipt-save',params,function(obj){
alert(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); parent.refreshList();
layer_close();
} }
},'json'); },'json');
} }, function(){
//
}); });
//返回按钮
$('#back-btn').click(function(){
window.location.href='/finance/receipt?<?=$back_params?>';
}); });
}) })
</script> </script>
<?php $this->endBlock('footer_js'); ?>

@ -19,7 +19,7 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();"> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="name">匹配程度</label> <label for="name">匹配程度</label>
<select name="status" class="form-control"> <select name="status" class="form-control">
@ -91,7 +91,7 @@ use \common\libs\MyLib;
<th data-field="total_clear_real">实得金额</th> <th data-field="total_clear_real">实得金额</th>
<th data-field="total_tax_real">税差</th> <th data-field="total_tax_real">税差</th>
<th data-field="r_total">回款金额</th> <th data-field="r_total">回款金额</th>
<th data-field="r_total_dis">回款差额</th> <th data-field="total_dis">回款差额</th>
<th data-field="r_date">回款日期</th> <th data-field="r_date">回款日期</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
@ -109,6 +109,7 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.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 src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script> <script>
var o = {};
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
@ -130,15 +131,20 @@ use \common\libs\MyLib;
} }
function search() { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy'); $('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({ $('#listTable').bootstrapTable({
url: "/finance/receipt-json", url: "/finance/receipt-json",
pagination: true, pagination: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
params.type_id = $('#type_id').val(); o['offset'] = params['offset'];
params.name = $('#name').val(); o['limit'] = params['limit'];
return params; return o;
} }
}); });
return false; return false;

@ -0,0 +1,93 @@
<?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">
<div class="row">
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<div class="form-group">
<label class="control-label col-sm-2">批次</label>
<div class="col-sm-6">
<select name="bdlx" class="form-control">
<option value="1">补点1</option>
<option value="2">补点2</option>
<option value="3">补点3</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">导入文件</label>
<div class="col-sm-6">
<div class="input-group">
<input type="text" name="urlfile" id="urlfile" class="form-control" value="">
<a href="javascript:void(0);" class="input-group-addon" id="upload">
上传文件
</a>
</div>
</div>
</div>
<div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong>导 入</strong>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
layui.use(['upload'], function(){
var upload = layui.upload;
var uploadInst = upload.render({
elem: '#upload' //绑定元素
,url: '/common/upload' //上传接口
,accept: 'file'
,done: function(res){
//上传完毕回调
if(res.status == 'SUCCESS') {
$('#urlfile').val(res.fileUrl);
}
}
,error: function(){
//请求异常回调
}
});
});
$(function () {
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/finance/receipt2-process',params,function(obj){
if(obj.success) {
parent.layer.msg('保存成功');
parent.refreshList();
layer_close();
} else {
parent.layer.msg(data.msg);
}
},'json');
}, function(){
//
});
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,222 +1,141 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<link rel="stylesheet" href="/js/fileupload/css/jquery.fileupload.css"> <?php $this->beginBlock('header_css'); ?>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<form id="theFrm"> <?php $this->endBlock(); ?>
<tr>
<td align="center" width="100" height="25" class="td_bg">导入类型</td> <div class="wrapper wrapper-content animated fadeInRight">
<td height="25" class="td_bg"> <div class="ibox float-e-margins">
<select name="bdlx"> <div class="ibox-title">
<option value="1">补点1</option> <h5>回单匹配</h5>
<option value="2">补点2</option> <div class="ibox-tools">
<option value="3">补点3</option> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="importDlg()">
</select> <i class="fa fa-plus"></i> 补点导入
</td> </a>
</tr> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<tr> <i class="fa fa-refresh"></i> 刷新
<td align="center" width="100" height="25" class="td_bg">批对日期</td> </a>
<td height="25" class="td_bg"> </div>
<input type="text" name="urlfile" id="urlfile" style="width: 300px;"> </div>
<input id="fileupload" type="file" name="file"> <div class="ibox-content">
</td> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
</tr> <div class="form-group" style="margin-bottom: 8px;">
</form> <label for="name">匹配程度</label>
<tr> <select name="status" class="status" class="form-control">
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input type="button" class="ACT_btn" name="Submit3" value=" 刷新 " onclick="window.location.reload();">
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
<!--新增搜索项-->
<!--完成程度-->
<select name="status" class="status">
<option value=0>全部</option> <option value=0>全部</option>
<option value=1 <?= $status==1?'selected':'' ?>>未匹配</option> <option value=1>未匹配</option>
<option value=2 <?= $status==2?'selected':'' ?>>已完成</option> <option value=2>已完成</option>
</select> </select>
保单号:<input name="insurer_no" type="text" value="<?=$insurer_no?>"> </div>
车牌:<input name="car_no" type="text" value="<?=$car_no?>"> <div class="form-group" style="margin-bottom: 8px;">
<!--日期--> <label for="name">保单号</label>
出单日期: <input type="text" id="insurer_no" name="insurer_no" class="form-control">
<input type="Text" class="Wdate" name="begin_date" onclick="WdatePicker()" value="<?= $begin_date ?>" /> </div>
-- <div class="form-group" style="margin-bottom: 8px;">
<input type="Text" class="Wdate" name="end_date" onclick="WdatePicker()" value="<?= $end_date ?>" /> <label for="name">车牌</label>
回单日期: <input type="text" id="car_no" name="car_no" class="form-control">
<input type="Text" class="Wdate" name="r_begin_date" onclick="WdatePicker()" value="<?= $r_begin_date ?>" /> </div>
-- <div class="form-group" style="margin-bottom: 8px;">
<input type="Text" class="Wdate" name="r_end_date" onclick="WdatePicker()" value="<?= $r_end_date ?>" /> <label for="name">出单日期</label>
保险公司:<select name="company_id"> <div class="input-group">
<option value="0">全部</option> <input type="text" id="begin_date" name="begin_date" class="form-control date">
<div class="input-group-addon">-</div>
<input type="text" id="end_date" name="end_date" class="form-control date">
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="name">回单日期</label>
<div class="input-group">
<input type="text" id="r_begin_date" name="r_begin_date" class="form-control date">
<div class="input-group-addon">-</div>
<input type="text" id="r_end_date" name="r_end_date" class="form-control date">
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="name">保险公司</label>
<select name="company_id" id="company_id" class="form-control">
<option value="0">---请选择---</option>
<?php <?php
foreach($company_items as $item) { foreach($insurer_company_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'">'.$item->name.'</option>';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
} }
?> ?>
</select> </select>
排序: </div>
<select name="sort_key"> <div class="form-group" style="margin-bottom: 8px;">
<option value="0">请选择</option> <label for="name">级别</label>
<option value="print_date" <?= $sort_key == 'print_date' ? 'selected' : ''?>>出单日期</option> <input type="text" id="name" name="name" class="form-control">
<option value="total" <?= $sort_key == 'total' ? 'selected' : ''?>>商业总保费</option> </div>
<option value="total_clear" <?= $sort_key == 'total_clear' ? 'selected' : ''?>>商业净保费</option> <button type="submit" class="btn btn-primary mb-8">搜索</button>
<option value="total_rate" <?= $sort_key == 'total_rate' ? 'selected' : ''?>>手续费比例</option>
</select>
<select name="sort_value">
<option value="0">请选择</option>
<option value="ASC" <?= $sort_value == 'ASC' ? 'selected' : ''?>>正序</option>
<option value="DESC" <?= $sort_value == 'DESC' ? 'selected' : ''?>>倒序</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>
</form> </form>
</table> <div class="row">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> <div class="col-md-12">
<tr> <table id="listTable">
<td width="24" align="center" class="bg_tr">序号</td> <thead>
<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">已回金额</td>
<td align="center" class="bg_tr">未回金额</td>
</tr>
<?php
foreach($items as $index => $item) {
$start_index = ($page-1)*20+$index;
$order = $item->order;
$caiwu = $order->caiwu;
// $caiwu = $order->caiwu;
// $rate = $caiwu ? $caiwu->budian_rate : 0;
if($item->insurer_type==2){
$caiwu->budian_rate=0;
}
$total_clear = round($item->total_clear * $caiwu->budian_rate/100,2);
$b_total = $item->b1_total+$item->b2_total+$item->b3_total;
// $total_clear_real = $item->total_clear * $rate/100;
// $total_dis = round($total_clear_real - $item->r_total,2);
?>
<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><?=$order->car_no?></td>
<td align="center" class="td_bg" nowrap><?=$order && $order->company ? $order->company->name:''?></td>
<td align="center" class="td_bg" nowrap><?=$item->insurer_no?></td>
<td align="center" class="td_bg" nowrap><?=$order->print_date?></td>
<td align="center" class="td_bg" nowrap><?=$item->total_clear?></td>
<td align="center" class="td_bg" nowrap><?=$caiwu->budian_rate?></td>
<td align="center" class="td_bg" nowrap><?=$total_clear?></td>
<td align="center" class="td_bg" nowrap><?=$item->b1_total?></td>
<td align="center" class="td_bg" nowrap><?=$item->b1_date?></td>
<td align="center" class="td_bg" nowrap><?=$item->b2_total?></td>
<td align="center" class="td_bg" nowrap><?=$item->b2_date?></td>
<td align="center" class="td_bg" nowrap><?=$item->b3_total?></td>
<td align="center" class="td_bg" nowrap><?=$item->b3_date?></td>
<td align="center" class="td_bg" nowrap><?=$b_total?></td>
<td align="center" class="td_bg" nowrap><?=$total_clear-$b_total?></td>
</tr>
<?php
}
?>
<tr> <tr>
<td align="center" class="bg_tr" nowrap></td> <th data-field="id">ID</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="car_no">车牌号</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="company_name">保险公司</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="insurer_no">保单号</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="print_date">出单日期</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="total_clear">商业净保费</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="budian_rate">补点比例</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="budian_money">应得金额</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b1_total">补点1回款</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b1_date">补点1日期</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b2_total">补点2回款</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b2_date">补点2日期</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b3_total">补点3回款</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b3_date">补点3日期</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="b_total">已回金额</th>
<td align="center" class="bg_tr" nowrap></td> <th data-field="un_b_total">未回金额</th>
</tr> </tr>
<tr > </thead>
<td height="25" colspan="16" align="center" class="td_bg"><?=$page_info?></td> </table>
</tr> </div>
</table> </div>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> </div>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> </div>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/vendor/jquery.ui.widget.js"></script> </div>
<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>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//上传按钮
$('#upload-btn').click(function(){
$('#fileupload').click();
});
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var urlfile = $("#urlfile").val();
var import_type = $(".import_type").val();
if(urlfile == ''){ <?php $this->beginBlock('footer_js'); ?>
alert('请先选择文件!'); <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
return false; <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>
var last_url = '/finance/receipt2-process'; <script>
var params = $("#theFrm").serialize(); var o = {};
function importDlg(id) {
$.post(last_url,params,function(obj){ var title = '手续费导入';
alert(obj.msg); layer_show(title, '/finance/receipt2-import');
if(obj.success){
$('#theFrm')[0].reset();
window.location.reload();
} }
},'json'); function refreshList() {
$('#listTable').bootstrapTable('refresh');
} }
function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
}); });
//上传 $('#listTable').bootstrapTable('destroy');
$('#fileupload').fileupload({ $('#listTable').bootstrapTable({
url: '/finance/receipt-upload', url: "/finance/receipt2-json",
dataType: 'json', pagination: true,
done: function (e, data) { sidePagination: 'server',
var file_info = data.result.files[0]; queryParams: function(params) {
$('#urlfile').val(file_info.url); o['offset'] = params['offset'];
$('#submit-btn').removeAttr('disabled'); o['limit'] = params['limit'];
return o;
} }
}); });
//搜索 return false;
$("#search-btn").click(function(){ }
$('#page').val(0);
var params = $('#searchForm').serialize(); $(function() {
window.location.href = "/finance/receipt2?" + params; search();
});
//导出
$("#output-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/finance/receipt2-output?" + params;
}); });
})
</script> </script>
<?php $this->endBlock(); ?>

@ -1,84 +0,0 @@
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">分组名称</td>
<td height="25" class="td_bg"><input class="Ainput" name="name" type="text" id="name" value="<?=$info->name?>" style="width:300px;"/></td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">针对岗位</td>
<td height="25" class="td_bg">
<input class="Ainput" name="group_ids" type="text" id="group_ids" value="<?=$info->group_ids?>" style="width:300px;"/>
注:如果针对全部岗位,则保持空。多个岗位之间用逗号间隔。
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">是否免费</td>
<td height="25" class="td_bg">
<label>
<input name="is_free" type="checkbox" id="is_free" value="1" <?=$info->is_free==1?'checked':''?>/>
</label>
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">是否需要车损险</td>
<td height="25" class="td_bg">
<label>
<input name="is_damage" type="checkbox" id="is_damage" value="1" <?=$info->is_damage==1?'checked':''?>/>
</label>
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">最低额度</td>
<td height="25" class="td_bg"><input class="Ainput" name="min_money" type="text" id="min_money" value="<?=$info->min_money?>" style="width:300px;"/></td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">最高额度</td>
<td height="25" class="td_bg"><input class="Ainput" name="max_money" type="text" id="max_money" value="<?=$info->max_money?>" style="width:300px;"/></td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">包含礼品</td>
<td height="25" class="td_bg">
<?php
foreach($gift_items as $item) {
echo '<label><input type="checkbox" name="gift_ids[]" value="'.$item->id.'"';
if(in_array($item->id,$gift_ids))
echo ' checked ';
echo '>'.$item->name.'</label>';
}
?>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/gift-group/save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/gift-group/index';
});
})
</script>

@ -1,79 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
window.location.href = '/gift-group/edit?id=' + id;
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/gift-group/delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
}
$(function(){
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/gift-group/index?" + params;
});
$('#add-btn').click(function(){
edit(0);
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
名称:<input name="name" type="text" value="<?=$name?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr">ID</td>
<td width="150" align="center" align="center" class="bg_tr">分类名称</td>
<td width="50" align="center" align="center" class="bg_tr">是否免费</td>
<td width="50" align="center" align="center" class="bg_tr">是否车损险</td>
<td width="100" align="center" align="center" class="bg_tr">最低额度</td>
<td width="100" align="center" align="center" class="bg_tr">最高额度</td>
<td width="300" align="center" align="center" class="bg_tr">包含礼品</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><?=$item->id?></td>
<td align="left" class="td_bg"nowrap ><?=$item->name?></td>
<td align="center" class="td_bg"nowrap ><?=$item->is_free==1?'是':''?></td>
<td align="center" class="td_bg"nowrap ><?=$item->is_damage==1?'是':''?></td>
<td align="center" class="td_bg"nowrap ><?=$item->min_money==0?'无限制':$item->min_money.'元'?></td>
<td align="center" class="td_bg"nowrap ><?=$item->max_money==0?'无限制':$item->max_money.'元'?></td>
<td align="left" class="td_bg"nowrap ><?php
if($item->gifts) foreach($item->gifts as $gift) {
echo $gift->name.', ';
}
?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -1,42 +0,0 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">名称</td>
<td height="25" class="td_bg">
<input name="name" type="text" id="name" value="<?=$info->name?>" style="width:400px;"/>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/gift-type/save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/gift-type/index';
});
})
</script>

@ -1,64 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
window.location.href = '/gift-type/edit?id=' + id;
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/gift-type/delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
}
$(function(){
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/gift-type/index?" + params;
});
$('#add-btn').click(function(){
edit(0);
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
名称:<input name="name" type="text" value="<?=$name?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td width="80%" align="center" align="center" class="bg_tr">名称</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->name?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -1,42 +0,0 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">名称</td>
<td height="25" class="td_bg">
<input name="name" type="text" id="name" value="<?=$info->name?>" style="width:400px;"/>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/gift-type/type2-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/gift-type/type2-list';
});
})
</script>

@ -1,64 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
window.location.href = '/gift-type/type2-edit?id=' + id;
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/gift-type/type2-delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
}
$(function(){
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/gift-type/type2-list?" + params;
});
$('#add-btn').click(function(){
edit(0);
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
名称:<input name="name" type="text" value="<?=$name?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td width="80%" align="center" align="center" class="bg_tr">名称</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->name?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -1,65 +0,0 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">名称</td>
<td height="25" class="td_bg">
<input name="name" type="text" id="name" value="<?=$info->name?>" style="width:400px;"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">价格</td>
<td height="25" class="td_bg">
<input name="price" type="text" id="price" value="<?=$info->price?>" style="width:100px;"/>小于零时,为百分比。
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">数量</td>
<td height="25" class="td_bg">
<input name="total" type="text" id="total" value="<?=$info->total?>" style="width:100px;"/>-1为无限数量。
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">类型</td>
<td height="25" class="td_bg">
<label>
<input type="radio" name="type" value="0" <?=$info->type==0?'checked':''?>> 实物
</label>
<label>
<input type="radio" name="type" value="1" <?=$info->type==1?'checked':''?>> 礼券
</label>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/gift-type/type3-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/gift-type/type3-list';
});
})
</script>

@ -1,70 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
window.location.href = '/gift-type/type3-edit?id=' + id;
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/gift-type/type3-delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
}
$(function(){
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/gift-type/type3-list?" + params;
});
$('#add-btn').click(function(){
edit(0);
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
名称:<input name="name" type="text" value="<?=$name?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td width="70%" align="center" align="center" class="bg_tr">名称</td>
<td width="50" align="center" class="bg_tr">价格</td>
<td width="50" align="center" class="bg_tr">数量</td>
<td width="50" align="center" class="bg_tr">类型</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->price?><?=$item->price<0?'%':'元'?></td>
<td align="center" class="td_bg" nowrap><?=$item->total<0?'无限':$item->total?></td>
<td align="center" class="td_bg" nowrap><?=$item->type==0?'实物':'礼券'?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -8,7 +8,7 @@ use \common\libs\MyLib;
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>券使用</h5> <h5>品出库</h5>
<div class="ibox-tools"> <div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> <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> 刷新 <i class="fa fa-refresh"></i> 刷新
@ -16,37 +16,35 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-horizontal" onsubmit="return search();"> <form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label class="control-label col-md-1">礼券编号</label> <label for="code">礼品编号</label>
<div class="col-md-2">
<input type="text" id="code" name="code" class="form-control"> <input type="text" id="code" name="code" class="form-control">
</div> </div>
<label class="control-label col-md-1">车牌</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="car_no">车牌</label>
<input type="text" id="car_no" name="car_no" class="form-control"> <input type="text" id="car_no" name="car_no" class="form-control">
</div> </div>
<label class="control-label col-md-1">车架号</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="frame_no">车架号</label>
<input type="text" id="frame_no" name="frame_no" class="form-control"> <input type="text" id="frame_no" name="frame_no" class="form-control">
</div> </div>
<label class="control-label col-md-1">发动机号</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="engine_no">发动机号</label>
<input type="text" id="engine_no" name="engine_no" class="form-control"> <input type="text" id="engine_no" name="engine_no" class="form-control">
</div> </div>
</div> <div class="form-group" style="margin-bottom: 8px;">
<div class="form-group"> <label for="status">状态</label>
<label class="control-label col-md-1">状态</label> <select name="status" id="status" class="form-control">
<div class="col-md-2">
<select name="status" class="form-control">
<option value="0" >全部</option> <option value="0" >全部</option>
<option value="4">未出库</option> <option value="1">未使用</option>
<option value="5">已出库</option> <option value="2">使用中</option>
<option value="3">使用完</option>
</select> </select>
</div> </div>
<label class="control-label col-md-1">分类</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="type_id">分类</label>
<select name="type_id" class="form-control"> <select name="type_id" id="type_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
<?php <?php
foreach($type_items as $item) { foreach($type_items as $item) {
@ -56,36 +54,31 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<label class="control-label col-md-1">业务工号</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="username">业务工号</label>
<input type="text" id="username" name="username" class="form-control"> <input type="text" id="username" name="username" class="form-control">
</div> </div>
<label class="control-label col-md-1">商业保单号</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="insurer1_no">商业保单号</label>
<input type="text" id="insurer1_no" name="insurer1_no" class="form-control"> <input type="text" id="insurer1_no" name="insurer1_no" class="form-control">
</div> </div>
</div> <div class="form-group" style="margin-bottom: 8px;">
<div class="form-group"> <label for="datepicker1">提单日期</label>
<label class="control-label col-md-1">提单日期</label> <div class="input-daterange input-group" id="datepicker1">
<div class="col-md-2">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" id="s_start_date" name="s_start_date" autocomplete="off" value="" /> <input type="text" class="input-sm form-control" id="s_start_date" name="s_start_date" autocomplete="off" value="" />
<span class="input-group-addon"></span> <span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" id="s_end_date" name="s_end_date" autocomplete="off" value="" /> <input type="text" class="input-sm form-control" id="s_end_date" name="s_end_date" autocomplete="off" value="" />
</div> </div>
</div> </div>
<label class="control-label col-md-1">正本日期</label> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <label for="datepicker2">正本日期</label>
<div class="input-daterange input-group" id="datepicker"> <div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="p_start_date" name="p_start_date" autocomplete="off" value="" /> <input type="text" class="input-sm form-control" id="p_start_date" name="p_start_date" autocomplete="off" value="" />
<span class="input-group-addon"></span> <span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" id="p_end_date" name="p_end_date" autocomplete="off" value="" /> <input type="text" class="input-sm form-control" id="p_end_date" name="p_end_date" autocomplete="off" value="" />
</div> </div>
</div> </div>
<div class="col-md-3"> <button type="submit" class="btn btn-primary mb-8">搜索</button>
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@ -93,16 +86,14 @@ use \common\libs\MyLib;
<thead> <thead>
<tr> <tr>
<th width="50" data-field="id">ID</th> <th width="50" data-field="id">ID</th>
<th data-field="code">编号</th> <th data-field="code">编号</th>
<th data-field="name">礼品</th> <th data-field="name">礼品</th>
<th data-field="car_no">车牌号</th> <th data-field="car_no">车牌号</th>
<th data-field="car_frame_no">车架号</th> <th data-field="car_frame_no">车架号</th>
<th data-field="use_total">发放日期</th> <th data-field="submit_user">提单人</th>
<th data-field="use_total">有效期日期</th> <th data-field="use_date">出库日期</th>
<th data-field="use_total">提单人</th> <th data-field="status">状态</th>
<th data-field="use_total">使用日期</th> <th data-field="username">操作员</th>
<th data-field="use_total">状态</th>
<th data-field="use_total">操作员</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -131,6 +122,10 @@ use \common\libs\MyLib;
return opStr.join(' '); return opStr.join(' ');
} }
function edit(id) {
title = '礼品核销';
layer_show(title, '/gift/gift-use-edit?id='+id);
}
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }

@ -22,8 +22,8 @@ use \common\libs\MyLib;
<form role="form" class="form-inline" onsubmit="return search();"> <form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="free_type">礼品类型</label> <label for="free_type">礼品类型</label>
<select id="is_leave" name="is_leave" class="form-control"> <select id="type_id" name="type_id" class="form-control">
<option value="">全部</option> <option value="0">全部</option>
<option value="1">实名礼品</option> <option value="1">实名礼品</option>
<option value="2">礼券</option> <option value="2">礼券</option>
</select> </select>

@ -1,268 +1,235 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
use \common\models\PriceT; use common\models\PriceT;
?> ?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css"> <?php $this->beginBlock('header_css'); ?>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<tr> <?php $this->endBlock(); ?>
<td height="22" colspan="2" class="td_bg">
<form id="orderFrm"> <div class="wrapper wrapper-content animated fadeInRight">
<table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable"> <form class="form-horizontal" id="orderFrm">
<tr> <input type="hidden" name="car_id" value="<?=$order_info->car_id?>">
<td height="120" valign="top" class="td_bg">
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(1) name="navcell">▼车辆信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb1 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="car_id" value="<?=$car_info->id?>">
<tr>
<td width="100" height="25" class="bg_tr">车牌号</td>
<td height="25" class="td_bg"><?=$car_info->car_no?></td>
<td width="100" height="25" class="bg_tr">厂牌型号</td>
<td height="25" class="td_bg"><?=$car_info->factory_model?></td>
<td width="60" height="25" class="bg_tr">品牌</td>
<td width="120" height="25" class="td_bg"><?=$car_info->brand?$car_info->brand->name:''?></td>
<td width="60" height="25" class="bg_tr">车系</td>
<td height="25" class="td_bg"><?=$car_info->series?$car_info->series->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">发动机号</td>
<td height="25" class="td_bg"><?=$car_info->engine_no?></td>
<td width="100" height="25" class="bg_tr">车架号</td>
<td height="25" class="td_bg"><?=$car_info->car_frame_no?></td>
<td width="60" height="25" class="bg_tr">初登日期</td>
<td height="25" class="td_bg"><?=$car_info->register_date?></td>
<td width="60" height="25" class="bg_tr">排量</td>
<td height="25" class="td_bg"><?=$car_info->displacement?$car_info->displacement->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车辆类型</td>
<td height="25" class="td_bg"><?=$car_info->carType?$car_info->carType->name:''?></td>
<td width="100" height="25" class="bg_tr">运营性质</td>
<td height="25" class="td_bg"><?=$car_info->carUse?$car_info->carUse->name:''?></td>
<td width="60" height="25" class="bg_tr">座位数</td>
<td height="25" class="td_bg"><?=$car_info->seats?></td>
<td width="60" height="25" class="bg_tr">年份</td>
<td height="25" class="td_bg"><?=$car_info->car_year?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车主</td>
<td height="25" class="td_bg"><?=$car_info->car_man?></td>
<td width="100" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg"><?=$car_info->phone?></td>
<td width="60" height="25" class="bg_tr">证件号码</td>
<td colspan="3" height="25" class="td_bg"><?=$car_info->car_man_number?></td>
</tr>
<tr>
<td width="60" height="25" class="bg_tr">备注</td>
<td colspan="3" height="25" class="td_bg"><?=$car_info->remark?></td>
<td width="100" height="25" class="bg_tr">业务员</td>
<td height="25" class="td_bg"><?=$order_info->user?$order_info->user->getShowName():''?></td>
<td width="60" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg"><?=$order_info->user?$order_info->user->phone:''?></td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<!--保单信息-->
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(2) name="navcell">▼保单信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb2 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="order_id" value="<?=$order_info->id?>"> <input type="hidden" name="order_id" value="<?=$order_info->id?>">
<tr> <input type="hidden" name="celuo_id" value="<?=$order_info->celuo_id?>">
<td class="bg_tr">被保险人</td> <input type="hidden" name="fanxian_id" value="<?=$order_info->fanxian_id?>">
<td class="td_bg"><?=$order_info->id_man?></td> <div class="ibox float-e-margins">
<td class="bg_tr">证件号码</td> <div class="ibox-title">
<td class="td_bg"><?=$order_info->id_number?></td> <h5>保单信息</h5>
<td width="60" class="bg_tr">联系人</td> </div>
<td class="td_bg"><?=$order_info->link_man?></td> <div class="ibox-content">
<td width="60" class="bg_tr">联系电话</td> <table class="table table-bordered">
<td class="td_bg"><?=$order_info->link_phone?></td> <tr>
</tr> <th class="bg-warning">车牌号</th>
<tr> <td><?=$order_info->car_no?></td>
<td class="bg_tr">保险公司</td> <th class="bg-warning" nowrap>初登日期</th>
<td class="td_bg"><?=$order_info->company?$order_info->company->name:''?></td> <td><?=$car_info->register_date?></td>
<td class="bg_tr">付款方式</td> <th class="bg-warning" nowrap>座位数</th>
<td class="td_bg"><?=$order_info->shoufei_id?MyLib::zhifufs($order_info->shoufei_id).'-':''?><?=$order_info->payType?$order_info->payType->name:''?></td> <td><?=$order_info->seats?></td>
<td class="bg_tr">电子邮件</td> <th class="bg-warning" nowrap>电子邮件</th>
<td class="td_bg"><?=$order_info->email?></td> <td><?=$order_info->email?></td>
</tr> </tr>
<tr> <tr>
<td class="bg_tr">商业起保日期</td> <th class="bg-warning">车型</th>
<td class="td_bg"><?=$order_info->insurer1_begin_date?></td> <td><?=$order_info->factory_model?></td>
<td class="bg_tr">交强起保日期</td> <th class="bg-warning" nowrap>发动机号</th>
<td class="td_bg"><?=$order_info->insurer2_begin_date?></td> <td><?=$order_info->engine_no?></td>
<td class="bg_tr">缴费单号</td> <th class="bg-warning" nowrap>车架号</th>
<td colspan="3" class="td_bg"><?=$order_info->pay_no?></td> <td><?=$order_info->car_frame_no?></td>
</tr> <th class="bg-warning" nowrap>新车购置价</th>
<tr> <td><?=$order_info->purchase_price?></td>
<td class="bg_tr">商业保单号</td> </tr>
<td class="td_bg"><?=$order_info->insurer1_no?></td> <tr>
<td class="bg_tr">交强保单号</td> <th class="bg-warning">车主</th>
<td class="td_bg"><?=$order_info->insurer2_no?></td> <td><?=$order_info->car_man?></td>
<td rowspan="3" class="bg_tr" valign="center">备注</td> <th class="bg-warning">证件类型</th>
<td colspan="3" rowspan="3" valign="top" class="td_bg"><?=$order_info->remark?></td> <td><?=$order_info->car_man_type?></td>
</tr> <th class="bg-warning">证件号码</th>
<tr> <td><?=$order_info->car_man_number?></td>
<td class="bg_tr">送单地址</td> <th class="bg-warning">联系电话</th>
<td colspan="3" class="td_bg"> <td><?=$order_info->car_man_phone?></td>
<?=$order_info->send_address?> </tr>
<tr>
<th class="bg-warning">被投保人</th>
<td><?=$order_info->id_man?></td>
<th class="bg-warning">证件类型</th>
<td><?=$order_info->id_man_type?></td>
<th class="bg-warning">证件号码</th>
<td><?=$order_info->id_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$order_info->id_man_phone?></td>
</tr>
<tr>
<th class="bg-warning">投保人</th>
<td><?=$order_info->link_man?></td>
<th class="bg-warning">证件类型</th>
<td><?=$order_info->link_man_type?></td>
<th class="bg-warning">证件号码</th>
<td><?=$order_info->link_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$order_info->link_man_phone?></td>
</tr>
<tr>
<th class="bg-warning" nowrap>商业起保日期</th>
<td><?=$order_info->insurer1_begin_date?></td>
<th class="bg-warning" nowrap>交强起保日期</th>
<td><?=$order_info->insurer2_begin_date?></td>
<th class="bg-warning">保险公司</th>
<td><?=$order_info->company->name?></td>
<th class="bg-warning">车辆使用性质</th>
<td><?=$order_info->car->carUse->name?></td>
</tr>
<tr>
<th class="bg-warning" nowrap>商业保单号</th>
<td><?=$order_info->insurer1_no?></td>
<th class="bg-warning" nowrap>商业PDF文件</th>
<td>
<?php if($order_info->shangye_src != '') { ?>
<a href="<?=$order_info->shangye_src?>"><i class="fa fa-image">保单</i></a>
<?php } ?>
<?php if($order_info->fapiao_src != '') { ?>
<a href="<?=$order_info->fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<?php } ?>
</td>
<th class="bg-warning">交强保单号</th>
<td><?=$order_info->insurer2_no?></td>
<th class="bg-warning">交强PDF文件</th>
<td>
<?php if($order_info->jiaoqiang_src != '') { ?>
<a href="<?=$order_info->jiaoqiang_src?>"><i class="fa fa-image">保单</i></a>
<?php } ?>
<?php if($order_info->jq_fapiao_src != '') { ?>
<a href="<?=$order_info->jq_fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<?php } ?>
</td> </td>
</tr> </tr>
</table> </table>
</TD> </div>
</TR> </div>
</TABLE> <div class="ibox float-e-margins">
<table> <div class="ibox-title">
<tbody> <h5>险种</h5>
<tr> </div>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(3) name="navcell">▼险种信息</TD> <div class="ibox-content">
</tr> <table class="table table-bordered">
</tbody>
</table>
<TABLE id=tb3 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<tr> <tr>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;">
<?php <?php
$xianzhong = '<tr><td class="bg_tr">险种</td>'; $len = count($insurer_type_items);
$neirong = '<tr><td class="bg_tr">内容</td>'; $index = 0;
$bujimianpei = '<tr><td class="bg_tr">不计免赔</td>'; for($i = 0; $i < $len; $i++) {
foreach ($new_array as $k=>$v){ $item = $insurer_type_items[$i];
$xianzhong .= "<td align='center' class='bg_tr'>".$v['zl']."</td>"; $order_id = $order_info->id;
$neirong .= "<td align='center' class='td_bg'>".$v['neir']."</td>"; if(!$order_id)
$bujimianpei .= "<td align='center' class='td_bg'>".$v['bjmp']."</td>"; $order_id = 0;
$tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id)
->one();
if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
?>
<th class="bg-warning">
<?=$item->name?>(<?=$item->code?>)
</th>
<td><?=$tmp_row->val?></td>
<td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
<?php
if(($index+1)%3==0) {
echo '</tr>';
echo '<tr>';
}
$index++;
} }
echo $xianzhong.'</tr>'.$neirong.'</tr>'.$bujimianpei.'</tr>';
?> ?>
</table>
</td>
</tr>
</TABLE>
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(4) name="navcell">▼保费信息</TD>
</tr> </tr>
</tbody>
</table> </table>
<TABLE id=tb4 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb"> </div>
<tr> </div>
<td valign="top"> <div class="ibox float-e-margins">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;"> <div class="ibox-title">
<tr> <h5>保费信息</h5>
<td class="bg_tr">商业总净保费</td> </div>
<td class="td_bg"><?=$order_info->total1_clear?></td> <div class="ibox-content">
<td class="bg_tr">商业含税总保费</td> <table class="table table-bordered">
<td class="td_bg"><?=$order_info->total1?></td> <tr>
<td class="bg_tr">交强总净保费</td> <th class="bg-warning">商业总净保费</th>
<td class="td_bg"><?=$order_info->total2_clear?></td> <td><?=$order_info->total1_clear?></td>
<td class="bg_tr">交强含税总保费</td> <th class="bg-warning">商业含税总保费</th>
<td class="td_bg"><?=$order_info->total2?></td> <td><?=$order_info->total1?></td>
</tr> <th class="bg-warning">车船税</th>
<tr> <td><?=$order_info->total3?></td>
<td class="bg_tr">车船税</td> </tr>
<td class="td_bg"><?=$order_info->total3?></td> <tr>
<td class="bg_tr">共计签单</td> <th class="bg-warning">交强总净保费</th>
<td class="td_bg"><?=$order_info->total_all?></td> <td><?=$order_info->total2_clear?></td>
<td class="bg_tr">折扣后商业净保费</td> <th class="bg-warning">交强含税总保费</th>
<td class="td_bg"><?=$order_info->total1_real?></td> <td><?=$order_info->total2?></td>
<td class="bg_tr">减免金额</td> <th class="bg-warning">业务自付金额</th>
<td class="td_bg"><?=$order_info->total1_dis?></td> <td><?=$order_info->yuangong_money?></td>
</tr> </tr>
<tr> <tr>
<td class="bg_tr">商业折扣率</td> <th class="bg-warning">折扣后商业净保费</th>
<td class="td_bg"><?=$order_info->total1_percent?></td> <td><?=$order_info->total1_real?></td>
<td class="bg_tr">应收</td> <th class="bg-warning">减免金额</th>
<td class="td_bg"><?=$order_info->total_real?></td> <td><?=$order_info->total1_dis?></td>
<td class="bg_tr">商业手续费</td> <th class="bg-warning">商业折扣率</th>
<td class="td_bg"><?=$order_info->total1_rate?></td> <td><?=$order_info->total1_percent?></td>
<td class="bg_tr">交强手续费</td> </tr>
<td class="td_bg"><?=$order_info->total2_rate?></td> <tr>
</tr> <th class="bg-warning">共计签单</th>
<tr> <td><?=$order_info->total_all?></td>
<td class="bg_tr">备注</td> <th class="bg-warning">应收</th>
<td colspan="7" class="td_bg"><?=$order_info->price_remark?></td> <td><?=$order_info->total_real?></td>
</tr> <th class="bg-warning">支付方式</th>
</table> <td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> </tr>
<tr> <tr>
<td class="bg_tr">商业补点比例</td> <th class="bg-warning">备注</th>
<td class="td_bg"><input type="Text" name="budian_rate" id="budian_rate" value="<?=$caiwu_info->budian_rate?>" class="supplement_proportion" onblur="cal_money('budian_rate','<?=$order_info->total1_clear?>','budian_money');"/>%</td> <td colspan="5"><?=$order_info->price_remark?></td>
<td class="bg_tr">商业补点手续费</td>
<td class="td_bg"><input type="Text" name="budian_money" id="budian_money" value="<?=$caiwu_info->budian_money?>" readonly class="supplement_servicecharge" /></td>
<td class="bg_tr"></td>
<td class="td_bg"></td>
<td class="bg_tr"></td>
<td class="td_bg"></td>
</tr>
<tr>
<td class="bg_tr">商业退保保费</td>
<td class="td_bg"><input type="Text" name="business_back_money" id="business_back_money" value="<?=$caiwu_info->business_back_money?>" class="sy_tb_retreat" onblur="cal_money2('business_back_money','business_back_rate','business_back_routine');"/></td>
<td class="bg_tr">退保手续费比例</td>
<td class="td_bg"><input type="Text" name="business_back_rate" id="business_back_rate" value="<?=$caiwu_info->business_back_rate?>" class="sy_tb_bili" onblur="cal_money2('business_back_money','business_back_rate','business_back_routine');"/>%</td>
<td class="bg_tr">商业退保手续费</td>
<td class="td_bg"><input type="Text" name="business_back_routine" id="business_back_routine" value="<?=$caiwu_info->business_back_routine?>" class="jq_tb_routine" readonly /></td>
<td class="bg_tr">商业退保日期</td>
<td class="td_bg"><input type="Text" name="business_back_date" id="business_back_date" value="<?=$caiwu_info->business_back_date?>" class="Wdate" onClick="WdatePicker()" /></td>
</tr>
<tr>
<td class="bg_tr">交强退保保费</td>
<td class="td_bg"><input type="Text" name="force_back_money" id="force_back_money" value="<?=$caiwu_info->force_back_money?>" class="jq_tb_retreat" onblur="cal_money2('force_back_money','force_back_rate','force_back_routine');"/></td>
<td class="bg_tr">退保手续费比例</td>
<td class="td_bg"><input type="Text" name="force_back_rate" id="force_back_rate" value="<?=$caiwu_info->force_back_rate?>" class="jq_tb_bili" onblur="cal_money2('force_back_money','force_back_rate','force_back_routine');"/>%</td>
<td class="bg_tr">交强退保手续费</td>
<td class="td_bg"><input type="Text" name="force_back_routine" id="force_back_routine" value="<?=$caiwu_info->force_back_routine?>" class="jq_tb_routine" readonly /></td>
<td class="bg_tr">交强退保日期</td>
<td class="td_bg"><input type="Text" name="force_back_date" id="force_back_date" value="<?=$caiwu_info->force_back_date?>" class="Wdate" onClick="WdatePicker()" /></td>
</tr> </tr>
</table> </table>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>返现信息</h5>
</div>
<div class="ibox-content">
<table class="table table-bordered">
<tr>
<th class="bg-warning">应免金额</th>
<td><?=$order_info->total1_dis?></td>
<th class="bg-warning">业务自付金额</th>
<td><?=$order_info->yuangong_money?></td>
<th class="bg-warning">实返金额</th>
<td><?=number_format($order_info->total1_dis + $order_info->yuangong_money,2)?></td>
<th class="bg-warning"></th>
<td></td>
</tr>
<tr>
<th class="bg-warning">领款人</th>
<td>
<input type="text" name="money_man" value="<?=$caiwu_info->money_man?>" class="form-control">
</td>
<th class="bg-warning">开户行</th>
<td>
<input type="text" name="money_bank" value="<?=$caiwu_info->money_bank?>" class="form-control">
</td>
<th class="bg-warning">银行账号</th>
<td>
<input type="text" name="money_no" value="<?=$caiwu_info->money_no?>" class="form-control">
</td>
<th class="bg-warning">转账日期</th>
<td>
<input type="text" name="transfer_date" id="transfer_date" value="<?=$caiwu_info->transfer_date?>" class="form-control">
</td> </td>
</tr>
</TABLE>
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-on id=navcell onclick=open_up(5) name="navcell">▼财务信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb5 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<tr>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;">
<tr>
<td class="bg_tr"><span style="color:#ff0000">*</span>领款人</td>
<td class="td_bg"><input name="money_man" id="money_man" type="text" value="<?=$caiwu_info->money_man?>" style="width:120px;"></td>
<td class="bg_tr"><span style="color:#ff0000">*</span>银行账号</td>
<td class="td_bg"><input name="money_no" id="money_no" type="text" value="<?=$caiwu_info->money_no?>" style="width:120px;"></td>
<td class="bg_tr"><span style="color:#ff0000">*</span>开户行</td>
<td class="td_bg"><input name="money_bank" id="money_bank" type="text" value="<?=$caiwu_info->money_bank?>" style="width:120px;"></td>
</tr> </tr>
<tr> <tr>
<td class="bg_tr">转账日期</td> <th class="bg-warning">转账金额</th>
<td class="td_bg"><input class="Wdate" name="transfer_date" id="transfer_date" type="text" value="<?=$caiwu_info->transfer_date?>" style="width:120px;" onClick="WdatePicker()"></td> <td>
<td class="bg_tr">转账金额</td> <input type="text" name="transfer_money" value="<?=$caiwu_info->transfer_money>0?$caiwu_info->transfer_money:round($order_info->total1_dis+$order_info->yuangong_money,2)?>" class="form-control">
<td class="td_bg"><input name="transfer_money" id="transfer_money" type="text" value="<?=$caiwu_info->transfer_money>0?$caiwu_info->transfer_money:$order_info->total1_dis?>" style="width:120px;"></td> </td>
<td class="bg_tr">转账银行</td> <th class="bg-warning">转账银行</th>
<td class="td_bg"> <td>
<select name="transfer_bank_id"> <select name="transfer_bank_id" class="form-control">
<?php <?php
foreach($banks as $bank) { foreach($banks as $bank) {
echo '<option value="'.$bank->id.'"'; echo '<option value="'.$bank->id.'"';
@ -273,13 +240,13 @@ use \common\models\PriceT;
?> ?>
</select> </select>
</td> </td>
</tr> <th class="bg-warning">银行流水号</th>
<tr> <td>
<td class="bg_tr">银行流水号</td> <input type="text" name="transfer_bank_no" value="<?=$caiwu_info->transfer_bank_no?>" class="form-control">
<td colspan="3" class="td_bg"><input name="transfer_bank_no" id="transfer_bank_no" type="text" value="<?=$caiwu_info->transfer_bank_no?>" style="width:200px;"></td> </td>
<td class="bg_tr">转账状态</td> <th class="bg-warning">转账状态</th>
<td class="td_bg"> <td>
<select name="caiwu_status_id"> <select name="caiwu_status_id" class="form-control">
<?php <?php
echo '<option value="0">无操作</option>'; echo '<option value="0">无操作</option>';
foreach($caiwu_status as $item){ foreach($caiwu_status as $item){
@ -292,280 +259,124 @@ use \common\models\PriceT;
</td> </td>
</tr> </tr>
</table> </table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <div>
<tr> <div class="row">
<td class="bg_tr" align="center">新保:<?=$car_info->op_user1?></td> <div class="col-sm-12 text-center">
<?php <button type="button" class="btn btn-primary btn-cancel" type="button">
if($car_info->op_user3 != '') { <strong>放弃处理</strong>
?> </button>
<td class="bg_tr" align="center">跟踪:<?=$car_info->op_user2?></td> <button type="button" class="btn btn-primary btn-save" type="button">
<td class="bg_tr" align="center">续保:<?=$car_info->op_user3?></td> <strong>保 存</strong>
<?php </button>
} <button type="button" class="btn btn-primary btn-submit" type="button">
?> <strong>提 交</strong>
<td class="bg_tr" align="center">送单费:<?=$order_info->sendLog?$order_info->sendLog->user->getShowName():''?></td> </button>
<?php </div>
if($order_info->op1_id > 0) { </div>
echo '<td class="bg_tr" align="center">核保:'.$order_info->op1->getShowName().'</td>'; </div>
} </div>
if($order_info->op2_id > 0) { </div>
echo '<td class="bg_tr" align="center">正本:'.$order_info->op2->getShowName().'</td>'; <div class="ibox float-e-margins">
} <div class="ibox-title">
?> <h5>操作记录</h5>
</tr> <div class="ibox-tools">
<tr> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#logTable').bootstrapTable('refresh');">
<td class="bg_tr" align="center">新保比例</td> <i class="fa fa-refresh"></i> 刷新
<?php </a>
if($car_info->op_user3 != '') { </div>
?> </div>
<td class="bg_tr" align="center">跟踪比例</td> <div class="ibox-content">
<td class="bg_tr" align="center">续保比例</td> <table id="logTable">
<?php <thead>
} <tr>
?> <th data-field="op_man">操作者</th>
<td class="bg_tr" align="center">送单比例</td> <th data-field="op_time">操作时间</th>
<?php if($order_info->op1_id > 0) { ?> <th data-field="remark">操作内容</th>
<td class="bg_tr" align="center">核保比例</td> </tr>
<?php } ?> </thead>
<?php if($order_info->op2_id > 0) { ?>
<td class="bg_tr" align="center">正本比例</td>
<?php } ?>
</tr>
<tr>
<?php
if($car_info->op_user3 != '') {
?>
<td class="td_bg" align="center"><input name="rate1" id="rate1" type="text" value="<?=$caiwu_info->rate1?>" style="width:50px;" onblur="cal_money('rate1','<?=$order_info->total1_clear?>','money1','0')">%</td>
<td class="td_bg" align="center"><input name="rate2" id="rate2" type="text" value="<?=$caiwu_info->rate2?>" style="width:50px;" onblur="cal_money('rate2','<?=$order_info->total1_clear?>','money2','0')">%</td>
<td class="td_bg" align="center"><input name="rate3" id="rate3" type="text" value="<?=$caiwu_info->rate3?>" style="width:50px;" onblur="cal_money('rate3','<?=$order_info->total1_clear?>','money3','<?=$order_info->total1_dis?>')">%</td>
<?php
} else {
?>
<td class="td_bg" align="center"><input name="rate1" id="rate1" type="text" value="<?=$caiwu_info->rate1?>" style="width:50px;" onblur="cal_money('rate1','<?=$order_info->total1_clear?>','money1','<?=$order_info->total1_dis?>')">%</td>
<?php
}
?>
<td class="td_bg" align="center"><input name="send_rate" id="send_rate" type="text" value="<?=$caiwu_info->send_rate?>" style="width:100px;" readonly>%</td>
<?php if($order_info->op1_id > 0) { ?>
<td class="td_bg" align="center"><input name="rate4" id="rate4" type="text" value="<?=$caiwu_info->rate4?>" style="width:100px;" onblur="cal_money('rate4','<?=$order_info->total1_clear?>','money4','0')">%</td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="td_bg" align="center"><input name="rate5" id="rate5" type="text" value="<?=$caiwu_info->rate5?>" style="width:100px;" onblur="cal_money('rate5','<?=$order_info->total1_clear?>','money5','0')">%</td>
<?php } ?>
</tr>
<tr>
<td class="bg_tr" align="center">新保提成</td>
<?php
if($car_info->op_user3 != '') {
?>
<td class="bg_tr" align="center">跟踪提成</td>
<td class="bg_tr" align="center">续保提成</td>
<?php
}
?>
<td class="bg_tr" align="center">送单提成</td>
<?php if($order_info->op1_id > 0) { ?>
<td class="bg_tr" align="center">核保提成</td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="bg_tr" align="center">正本提成</td>
<?php } ?>
</tr>
<tr>
<?php
if($car_info->op_user3 != '') {
?>
<td class="td_bg" align="center"><input name="money1" id="money1" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate1)?>" style="width:100px;" readonly></td>
<td class="td_bg" align="center"><input name="money2" id="money2" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate2)?>" style="width:100px;" readonly></td>
<td class="td_bg" align="center"><input name="money3" id="money3" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate3)?>" style="width:100px;" readonly></td>
<?php
} else {
?>
<td class="td_bg" align="center"><input name="money1" id="money1" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate1)?>" style="width:100px;" readonly></td>
<?php
}
?>
<td class="td_bg" align="center"><input name="send_money" id="send_money" type="text" value="<?=$caiwu_info->send_money?>" style="width:100px;" onblur="cal_rate('send_money','<?=$order_info->total1_clear?>','send_rate','0')"></td>
<?php if($order_info->op1_id > 0) { ?>
<td class="td_bg" align="center"><input name="money4" id="money4" type="text" value="<?=$caiwu_info->money4?>" style="width:100px;" onblur="cal_rate('money4','<?=$order_info->total1_clear?>','rate4','0')"></td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="td_bg" align="center"><input name="money5" id="money5" type="text" value="<?=$caiwu_info->money5?>" style="width:100px;" onblur="cal_rate('money5','<?=$order_info->total1_clear?>','rate5','0')"></td>
<?php } ?>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="6" class="bg_tr">实物</td>
</tr>
<tr>
<?php
$index = 0;
foreach($sel_gifts as $order_gift) {
if($order_gift->gift->type == 1) continue;
if($index > 0 && $index%3 == 0) {
echo '</tr><tr>';
}
?>
<td width="250" class="bg_tr"><?=$order_gift->gift->name?></td>
<td class="td_bg">
<input type="hidden" name="gift_ids[]" value="<?=$order_gift->id?>">
<input type="hidden" name="gift_rates[]" value="0">
<input name="gift_prices[]" type="text" value="<?=$order_gift->price?>" style="width:60px;">
</td>
<?php
$index++;
}
if($index>0) {
while($index%3!=0) {
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
$index++;
}
}
?>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="9" class="bg_tr">礼券</td>
</tr>
<tr>
<?php
$index = 0;
foreach($sel_gifts as $order_gift) {
if($order_gift->gift->type == 0) continue;
if($index > 0 && $index%3 == 0) {
echo '</tr><tr>';
}
$index++;
?>
<td width="150" class="bg_tr"><?=$order_gift->gift->name?></td>
<td class="td_bg">
<input type="hidden" name="gift_ids[]" value="<?=$order_gift->id?>">
<input name="gift_rates[]" id="gift_rates_<?=$order_gift->id?>" type="text" value="<?=$order_gift->rate?>" style="width:60px;" onblur="cal_money('gift_rates_<?=$order_gift->id?>','<?=$order_info->total1_clear?>','gift_prices_<?=$order_gift->id?>','0')">%
</td>
<td class="td_bg">
<input name="gift_prices[]" id="gift_prices_<?=$order_gift->id?>" type="text" value="<?=$order_gift->price?>" style="width:60px;" readonly>
</td>
<?php
}
if($index>0) {
while($index%3!=0) {
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
$index++;
}
}
?>
</tr>
</table>
</td>
</tr>
</TABLE>
<!--操作记录-->
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(6) name="navcell">▲操作记录</TD>
</tr>
</tbody>
</table>
<TABLE id=tb6 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<div id="car_history_list"></div>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table> </table>
</div>
</div>
</form> </form>
</td> </div>
</tr>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="cancel-btn" type=button class="ACT_btn" name=Submit4 value=" 放弃处理 "/>
&nbsp;&nbsp;
<input id="save-btn" type=button class="ACT_btn" name=Submit1 value=" 保存 "/>
&nbsp;&nbsp;
<input id="submit-btn" type=button class="ACT_btn" name=Submit2 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit3" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/common2.js"></script> <script>
<script type="text/javascript" language="javascript"> var o = {};
//计算提成 //判断是否填写了选项
function cal_money(obj1,val,obj2) { function isNull(data){
var total = Number($('#' + obj1).val())/100 * Number(val); if(data == "" || data == undefined || data == null){
$('#' + obj2).val(total.toFixed(2)); return true;
}else{
return false;
} }
//计算
function cal_money2(obj1,obj2,obj3,dis) {
var total = Number($('#'+obj2).val())/100 * Number($('#' + obj1).val());
$('#' + obj3).val(total.toFixed(2));
} }
function cal_rate(obj1,val,obj3,dis) { //保存订单
if(Number(val) == 0) { function saveOrder(status_id) {
$('#' + obj3).val('0.00'); var params = $('#orderFrm').serialize();
return; params = params + '&status_id=' + status_id;
$.post('/insurer/finance-mng-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success && status_id==10) {
parent.refreshList();
layer_close();
} }
var rate = (Number($('#' + obj1).val()))/Number(val) * 100 ; },'json');
$('#' + obj3).val(rate.toFixed(2));
} }
//保单处理 //操作记录
function SaveOrder(status_id) { function searchOps() {
var param = $('#orderFrm').serialize(); $('#logTable').bootstrapTable('destroy');
param = param + '&status_id=' + status_id; $('#logTable').bootstrapTable({
$.post('/insurer/finance-mng-save',param,function(obj){ url: "/car/history-json",
if(obj.success) { pagination: true,
if(status_id == 13) sidePagination: 'server',
$('#back-btn').click(); multipleSelectRow: true,
else queryParams: function(params) {
alert(obj.msg); o['car_id'] = '<?=$order_info->car_id?>';
} else { o['limit'] = params['limit'];
alert(obj.msg); o['offset'] = params['offset'];
return o;
} }
},'json'); });
} }
$(function(){
//操作历史 $(function() {
gotoPage('/car/ajax-history-index-xubao?car_id=<?=$car_info->id?>&page=1','car_history_list'); searchOps();
//放弃处理 $('#transfer_date').datepicker({
$('#cancel-btn').click(function(){ todayBtn: "linked",
if(confirm('是否确认放弃处理?')) { keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true
});
$('.btn-cancel').click(function(){
parent.layer.confirm('是否确认放弃处理?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/insurer/finance-cancel-save',{order_id:<?=$order_info->id?>},function(obj){ $.post('/insurer/finance-cancel-save',{order_id:<?=$order_info->id?>},function(obj){
parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); parent.refreshList();
} else { layer_close();
alert(obj.msg);
} }
},'json'); },'json');
} }, function(){
//
}); });
//保存
$('#save-btn').click(function(){
SaveOrder(12);
}); });
//提交 $('.btn-save').click(function(){
$('#submit-btn').click(function(){ saveOrder(12);
if(confirm('是否提交此保单?')) {
SaveOrder(13);
}
}); });
$('.btn-submit').click(function(){
//返回 saveOrder(10);
$('#back-btn').click(function(){
window.location.href = '/insurer/finance-mng?<?=$back_params?>';
}); });
}); });
</script> </script>
<?php $this->endBlock(); ?>

@ -34,22 +34,23 @@ use \common\libs\MyLib;
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th width="50" data-field="id">ID</th> <th data-width="50" data-field="id">ID</th>
<th data-field="id_man">被保险人</th> <th data-field="id_man">被保险人</th>
<th data-field="link_man_phone">联系电话</th> <th data-field="id_man_phone">联系电话</th>
<th data-field="company_name">保险公司</th> <th data-field="company_name">保险公司</th>
<th data-field="car_no">车牌号</th> <th data-field="car_no">车牌号</th>
<th data-field="print_date">正本日期</th> <th data-field="print_date">正本日期</th>
<th data-field="insurer1_no">商业保单号</th> <th data-field="path">级别</th>
<th data-field="insurer2_no">交强保单号</th>
<th data-field="total_all">共计签单</th>
<th data-field="$nams">级别</th>
<th data-field="user_name">销售座席</th> <th data-field="user_name">销售座席</th>
<th data-field="total1_clear">商业净保费</th>
<th data-field="total1_dis">公司返金额</th>
<th data-field="yuangong_money">业务自付</th>
<th data-field="total_user_real">实返现金额</th>
<th data-field="transfer_date">转账时间</th>
<th data-field="caiwu_status_name">转账状态</th>
<th data-field="status_name">状态</th> <th data-field="status_name">状态</th>
<th data-field="caiwu_status">转账状态</th> <th data-field="lock_man">当前操作</th>
<th data-field="pay_type">支付方式</th> <th data-formatter="opFormatter" data-width="150">操作</th>
<th data-field="lock_name">当前操作</th>
<th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -68,14 +69,33 @@ use \common\libs\MyLib;
var o = {}; var o = {};
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="view(' + row.id + ')">'); if(row.lock_man != '') {
opStr.push('<a href="javascript:void(0);" onclick="unlock(' + row.id + ')">');
opStr.push('<i class="fa fa-unlock" title="解锁"></i>');
opStr.push('</a>');
}
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-file-o" title="详情"></i>'); opStr.push('<i class="fa fa-file-o" title="详情"></i>');
opStr.push('</a>'); opStr.push('</a>');
return opStr.join(' '); return opStr.join(' ');
} }
function view(id) { function info(id) {
window.location.href = '/insurer/finance-mng-edit?id=' + id; title = '详情';
layer_show(title, '/insurer/finance-mng-edit?id='+id);
}
function unlock(id) {
parent.layer.confirm('是否确认解锁?', {
btn: ['解锁','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/insurer/unlocked',{id:id},function(data) {
parent.layer.msg(data.msg);
refreshList();
}, 'json');
}, function(){
//
});
} }
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');

@ -16,66 +16,57 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" id="search" class="form-inline" onsubmit="return search();"> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="username">车主</label> <label for="username">车主</label>
<input type="text" id="car_man" name="car_man" class="form-control"> <input type="text" id="car_man" name="car_man" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="phone">被保险人</label> <label for="id_man">被保险人</label>
<input type="text" id="id_man" name="id_man" class="form-control"> <input type="text" id="id_man" name="id_man" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label> <label for="phone">电话</label>
<input type="text" id="phone" name="phone" class="form-control"> <input type="text" id="phone" name="phone" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label> <label for="car_no">车牌</label>
<input type="text" id="car_no" name="car_no" class="form-control"> <input type="text" id="car_no" name="car_no" class="form-control">
</div> </div>
<div class="form-group col-md-6" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">提单日期</label> <label for="datepicker1">初登日期</label>
<div class="input-group" id="datepicker1"> <div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="date_begin" name="date_begin" value="" autocomplete="off" /> <input type="text" class="form-control" id="date_begin" name="date_begin" autocomplete="off" />
<span class="input-group-addon"></span> <div class="input-group-addon">-</div>
<input type="text" class="form-control" id="date_end" name="date_end" value="" autocomplete="off" /> <input type="text" class="form-control" id="date_end" name="date_end" autocomplete="off" />
</div> </div>
</div> </div>
<div class="form-group col-md-6" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker2">正本日期</label> <label for="datepicker3">正本日期</label>
<div class="input-group" id="datepicker2">
<input type="text" class="form-control" id="date2_begin" name="date2_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date2_end" name="date2_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker3">起保日期</label>
<div class="input-group" id="datepicker3"> <div class="input-group" id="datepicker3">
<input type="text" class="form-control" id="date3_begin" name="date3_begin" value="" autocomplete="off" /> <input type="text" class="form-control" id="date2_begin" name="date2_begin" autocomplete="off" />
<span class="input-group-addon"></span> <div class="input-group-addon">-</div>
<input type="text" class="form-control" id="date3_end" name="date3_end" value="" autocomplete="off" /> <input type="text" class="form-control" id="date2_end" name="date2_end" autocomplete="off" />
</div> </div>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label> <label for="datepicker2">起保日期</label>
<select name="company_id" id="company_info" class="form-control"> <div class="input-group" id="datepicker2">
</select> <input type="text" class="form-control" id="date3_begin" name="date3_begin" autocomplete="off" />
<div class="input-group-addon">-</div>
<input type="text" class="form-control" id="date3_end" name="date3_end" autocomplete="off" />
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> </div>
<label class="control-label">险种类型</label> <div class="form-group" style="margin-bottom: 8px;">
<select name="insurance_status" id="insurance_status_info" class="form-control"> <label for="car_no">状态</label>
<option value="">全部</option> <select name="status" id="status" class="form-control">
<option value="1">车险</option> <option value="0">全部</option>
<option value="2">非车险</option> <option value="1">未完成</option>
<option value="3">车险和非车险</option> <option value="2">已完成</option>
</select> </select>
</div> </div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
</div>
</form> </form>
<hr>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<table id="listTable"> <table id="listTable">
@ -85,16 +76,15 @@ use \common\libs\MyLib;
<th data-field="car_man">车主</th> <th data-field="car_man">车主</th>
<th data-field="id_man">被保险人</th> <th data-field="id_man">被保险人</th>
<th data-field="submit_date">提单日期</th> <th data-field="submit_date">提单日期</th>
<th data-field="send_date">送单日期</th>
<th data-field="car_no">车牌号</th> <th data-field="car_no">车牌号</th>
<th data-field="car_factory_model">品牌</th> <th data-field="factory_model">厂牌型号</th>
<th data-field="total_all">共计签单</th> <th data-field="total_all">共计签单</th>
<th data-field="total_real">应收</th> <th data-field="total_real">应收</th>
<th data-field="status_txt">状态</th> <th data-field="status">状态</th>
<th data-field="show_name">业务员</th> <th data-field="username">业务员</th>
<th data-field="company_name">保险公司</th> <th data-field="company_name">保险公司</th>
<th data-field="upload_status_txt">上传状态</th> <th data-field="file_status">上传状态</th>
<th data-field="lock_show_name">当前操作</th> <th data-field="lock_name">当前操作</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -110,26 +100,18 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.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 src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script> <script>
var o = {};
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
if (row.insurance_status == 1 || row.insurance_status == 3) {
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>'); opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>');
opStr.push('</a>'); opStr.push('</a>');
} else if (row.insurance_status == 2) {
opStr.push('<a href="javascript:void(0);" onclick="infos(' + row.non_id + ',' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="非车险详情">&nbsp;非车险详情</i>');
opStr.push('</a>');
}
return opStr.join(' '); return opStr.join(' ');
} }
function info(id) { function info(id) {
layer_show('保单信息','/insurer/info?id=' + id); window.open('/insurer/info?id=' + id);
}
function infos(id,oid) {
layer_show('保单信息','/non-auto-insurance/bd-info-search?id=' + id +'&oid=' + oid);
} }
function refreshList() { function refreshList() {
@ -137,42 +119,25 @@ use \common\libs\MyLib;
} }
function search() { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy'); $('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({ $('#listTable').bootstrapTable({
url: "/insurer/search-json", url: "/insurer/search-json",
pagination: true, pagination: true,
showFooter: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
$('#search').find(':input:not(input[type=button],input[type=submit],button)').each(function(index,item){ o['limit'] = params['limit'];
params[$(item).attr('name')] = $(item).val(); o['offset'] = params['offset'];
}); return o;
return params;
},
responseHandler: function (res) {
console.log(res);
$('.fixed-table-footer').html('<div style="height: 100%;line-height: 37px;text-align: right;padding-right: 2rem;">' +
' <label class="">净保费总和:</label>' +
' <span style="color:red;">'+ res.sum +'</span>' +
' </div>');
selectInfoInit('company',res['company_info']);
return res
} }
}); });
return false; return false;
} }
// 品牌选项初始化
function selectInfoInit(selectName,options,default_val,data){
var html = '<option value="'+ (default_val?default_val:'') +'">---请选择---</option>';
$.each(options,function(i,item){
var val = item['code']?item['code']:item['id'];
var selected = data && data[selectName + '_id'] && data[selectName + '_id'] == val? 'selected': '';
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>'
});
$('#'+ selectName + '_info').html(html);
}
$(function() { $(function() {
search(); search();
}); });

@ -18,7 +18,7 @@ use \common\libs\MyLib;
<select name="fanxian_id" id="fanxian_id" class="form-control"> <select name="fanxian_id" id="fanxian_id" class="form-control">
<?php <?php
foreach($items as $item) { foreach($items as $item) {
echo '<option value="'.$item->id.'">客户返现:'.$item->fanxian_rate.'%,最高返现:'.$item->max_cashback.'</option>'; echo '<option value="'.$item->id.'">客户返现:'.$item->fanxian_rate.'%,最高返现:'.$item->max_cashback.',保费:'.$item->tiaojian->baofei.'</option>';
} }
?> ?>
</select> </select>

@ -17,10 +17,13 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();"> <form role="form" class="form-inline" onsubmit="return search();">
<input type="hidden" name="company_type" id="company_type" value="<?=$company_type?>">
<?php if($company_type == 3) { ?>
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="username">工号</label> <label for="username">工号</label>
<input type="text" id="username" name="username" class="form-control"> <input type="text" id="username" name="username" class="form-control">
</div> </div>
<?php } ?>
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker">通话时间</label> <label for="datepicker">通话时间</label>
<div class="input-group" id="datepicker"> <div class="input-group" id="datepicker">
@ -119,7 +122,11 @@ use \common\libs\MyLib;
<script> <script>
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="play(' + row.record_file_url + ')">'); if(row.record_file_url !== null) {
opStr.push('<a href="javascript:void(0);" onclick="play(\'' + row.record_file_url + '\')">');
} else {
opStr.push('<a href="javascript:void(0);" onclick="play(\'' + row.record_file_url_real + '\')">');
}
opStr.push('<i class="fa fa-play" title="播放"></i>'); opStr.push('<i class="fa fa-play" title="播放"></i>');
opStr.push('</a>'); opStr.push('</a>');
@ -127,8 +134,8 @@ use \common\libs\MyLib;
} }
function play(url) { function play(url) {
var body = '<audio controls>'; var body = '<audio controls>';
body += '<source src="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3" type="audio/mp3">'; body += '<source src="' + url + '" type="audio/mp3">';
body += '您的浏览器不支持在线播放,请<a href="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3">下载</a>'; body += '您的浏览器不支持在线播放,请<a href="' + url + '">下载</a>';
body += '</audio>'; body += '</audio>';
parent.layer.open({ parent.layer.open({
type: 1, type: 1,
@ -158,6 +165,7 @@ use \common\libs\MyLib;
params.duration_begin = $('#duration_begin').val(); params.duration_begin = $('#duration_begin').val();
params.duration_end = $('#duration_end').val(); params.duration_end = $('#duration_end').val();
params.is_called = $('#is_called').val(); params.is_called = $('#is_called').val();
params.company_type = $('#company_type').val();
return params; return params;
} }
}); });

@ -17,16 +17,19 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();"> <form role="form" class="form-inline" onsubmit="return search();">
<input type="hidden" name="company_type" id="company_type" value="<?=$company_type?>">
<?php if($company_type == 3) { ?>
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="username">坐席人员</label> <label for="username">坐席人员</label>
<input type="text" id="caller" name="caller" class="form-control"> <input type="text" id="caller" name="caller" class="form-control">
</div> </div>
<?php } ?>
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker">通话时间</label> <label for="datepicker">通话时间</label>
<div class="input-group" id="datepicker"> <div class="input-group" id="datepicker">
<input type="text" class="form-control" id="begin_date" name="begin_date" value="" autocomplete="off" /> <input type="text" class="form-control" id="begin_date" name="begin_date" value="<?=date('Y-m-d')?>" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon"></span>
<input type="text" class="form-control" id="end_date" name="end_date" value="" autocomplete="off" /> <input type="text" class="form-control" id="end_date" name="end_date" value="<?=date('Y-m-d')?>" autocomplete="off" />
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
@ -91,6 +94,7 @@ use \common\libs\MyLib;
params.duration_begin = $('#duration_begin').val(); params.duration_begin = $('#duration_begin').val();
params.duration_end = $('#duration_end').val(); params.duration_end = $('#duration_end').val();
params.is_called = $('#is_called').val(); params.is_called = $('#is_called').val();
params.company_type = $('#company_type').val();
return params; return params;
} }
}); });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 4.2 KiB

Loading…
Cancel
Save