1.完成业务流程

2.完成礼品管理
dev
曾超新 5 years ago
parent 71a4fc3f82
commit ddd4e9212b
  1. 5
      common/models/CarT.php
  2. 63
      common/models/GiftUseLogT.php
  3. 5
      common/models/InsurerCompanyT.php
  4. 22
      common/models/OrderT.php
  5. 9
      composer.json
  6. 755
      composer.lock
  7. 30
      frontend/controllers/CarController.php
  8. 1411
      frontend/controllers/CarController_bak.php
  9. 123
      frontend/controllers/GiftController.php
  10. 347
      frontend/controllers/InsurerController.php
  11. 23
      frontend/controllers/MarketingStrategyController.php
  12. 18
      frontend/views/appointment/all.php
  13. 18
      frontend/views/appointment/first.php
  14. 10
      frontend/views/appointment/today.php
  15. 40
      frontend/views/car-use/index.php
  16. 4
      frontend/views/car/info.php
  17. 99
      frontend/views/car/order-add.php
  18. 3
      frontend/views/common/index.php
  19. 4
      frontend/views/gift/edit.php
  20. 172
      frontend/views/gift/gift-use.php
  21. 142
      frontend/views/gift/ticket-use-edit.php
  22. 169
      frontend/views/gift/ticket-use.php
  23. 40
      frontend/views/insurer-company/index.php
  24. 8
      frontend/views/insurer-company2/edit.php
  25. 10
      frontend/views/insurer-company2/index.php
  26. 162
      frontend/views/insurer/my-list-info.php
  27. 120
      frontend/views/insurer/office-mng-edit.php
  28. 51
      frontend/views/insurer/office-mng.php
  29. 128
      frontend/views/insurer/original-mng-edit.php
  30. 36
      frontend/views/insurer/original-mng.php
  31. 24
      frontend/views/menu/edit.php
  32. BIN
      frontend/web/fonts/msyh.ttc
  33. BIN
      frontend/web/fonts/msyhbd.ttc
  34. BIN
      frontend/web/fonts/msyhl.ttc
  35. BIN
      frontend/web/fonts/symbol.ttf
  36. BIN
      frontend/web/images/gift.png
  37. 30731
      sql_db/car6_db.sql

@ -48,9 +48,6 @@ use Yii;
*/ */
class CarT extends \common\models\Base class CarT extends \common\models\Base
{ {
const MONTH = [1,2,3,4,5,6,7,8,9,10,11,12];
const DAYS = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
/** /**
* @inheritdoc * @inheritdoc
*/ */
@ -68,7 +65,7 @@ class CarT extends \common\models\Base
[['user_id', 'car_type_id', 'car_use_id'], 'required'], [['user_id', 'car_type_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','id_phone'], 'string', 'max' => 50],
[['car_year'], 'string', 'max' => 10], [['car_year'], 'string', 'max' => 10],
[['car_man','phone','remark','company','op_user1','op_user2','op_user3','weixin','from_src'], 'string', 'max' => 200], [['car_man','phone','remark','company','op_user1','op_user2','op_user3','weixin','from_src'], 'string', 'max' => 200],
]; ];

@ -0,0 +1,63 @@
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "car_log_t".
*
* @property integer $id
* @property integer $car_id
* @property string $op_man
* @property integer $op_time
* @property string $group_name
* @property integer $type
* @property string $remark
* @property string $info
* @property string $created_at
* @property string $updated_at
*/
class GiftUseLogT extends \common\models\Base
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'gift_use_log_t';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['gift_use_id', 'op_man', 'op_time'], 'required'],
[['gift_use_id', 'op_time','type'], 'integer'],
[['created_at', 'updated_at'], 'safe'],
[['op_man'], 'string', 'max' => 50],
[['group_name', 'remark','info'], 'string', 'max' => 100],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'gift_use_id' => 'Gift Use ID',
'op_man' => 'Op Man',
'op_time' => 'Op Time',
'group_name' => 'Group Name',
'type' => 'Type',
'remark' => 'Remark',
'info' => 'Info',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
}

@ -9,7 +9,6 @@ use Yii;
* *
* @property integer $id * @property integer $id
* @property string $name * @property string $name
* @property string $sam
* @property string $created_at * @property string $created_at
* @property string $updated_at * @property string $updated_at
*/ */
@ -30,9 +29,8 @@ class InsurerCompanyT extends \common\models\Base
{ {
return [ return [
[['name'], 'required'], [['name'], 'required'],
[['difc'], 'integer'],
[['created_at', 'updated_at'], 'safe'], [['created_at', 'updated_at'], 'safe'],
[['name','sam'], 'string', 'max' => 100], [['name'], 'string', 'max' => 100],
]; ];
} }
@ -44,7 +42,6 @@ class InsurerCompanyT extends \common\models\Base
return [ return [
'id' => 'ID', 'id' => 'ID',
'name' => 'Name', 'name' => 'Name',
'sam' => 'SAM',
'created_at' => 'Created At', 'created_at' => 'Created At',
'updated_at' => 'Updated At', 'updated_at' => 'Updated At',
]; ];

@ -36,15 +36,6 @@ use Yii;
* @property string $insurer2_end_date * @property string $insurer2_end_date
* @property string $send_date * @property string $send_date
* @property string $direction_id * @property string $direction_id
* @property string $range1_id
* @property string $city1_id
* @property string $district1_id
* @property string $send_address1
* @property string $direction2_id
* @property string $range2_id
* @property string $city2_id
* @property string $district2_id
* @property string $send_address2
* @property integer $pay_type_id * @property integer $pay_type_id
* @property string $pay_no * @property string $pay_no
* @property string $remark * @property string $remark
@ -110,9 +101,9 @@ class OrderT extends \common\models\Base
public function rules() public function rules()
{ {
return [ return [
[['car_id', 'user_id', 'company_id', 'company2_id', 'status_id', 'pay_type_id','lock_id','range1_id','send_city_id','send_district_id','direction2_id','range2_id','city2_id','district2_id','success_id','return_status_id','return_time','first_send','send_times','check_gift','gift_type1_id','gift_type8_id','gift_type2_id','gift_type3_id','gift_type4_id','gift_type5_id','gift_type6_id','gift_type7_id','business_group_id','op1_id','op2_id','shoufei_id','payer','payee_id','hk_status','payment_id','account_status','insurance_status','el_insurance','ord_scheme_id','non_num','addr_id'], 'integer'], [['car_id', 'user_id', 'company_id', 'company2_id', 'status_id', 'pay_type_id','lock_id','send_city_id','send_district_id','success_id','return_status_id','return_time','first_send','send_times','check_gift','gift_type1_id','gift_type8_id','gift_type2_id','gift_type3_id','gift_type4_id','gift_type5_id','gift_type6_id','gift_type7_id','business_group_id','op1_id','op2_id','shoufei_id','payer','payee_id','hk_status','payment_id','account_status','insurance_status','el_insurance','ord_scheme_id','non_num','addr_id'], 'integer'],
[['submit_date', 'insurer1_begin_date', 'insurer1_end_date', 'insurer2_begin_date', 'insurer2_end_date', 'send_date','print_date','zhifu_date', 'created_at', 'updated_at','insurer_date_start','insurer_date_end'], 'safe'], [['submit_date', 'insurer1_begin_date', 'insurer1_end_date', 'insurer2_begin_date', 'insurer2_end_date', 'send_date','print_date','zhifu_date', 'created_at', 'updated_at','insurer_date_start','insurer_date_end'], 'safe'],
[['gift_other', 'id_man', 'id_man_number', 'id_man_type', 'id_man_phone', 'link_man', 'link_man_phone', 'link_man_type', 'link_man_number', 'send_address','send_address2','car_frame_no','car_man','total1','total1_clear','total1_real','total1_dis','total1_percent','total1_rate','total2','total2_clear','total2_rate','total3','total_all','total_real','price_remark','money_no','money_bank','email','return_remark','piao_header','photo_back','photo_face','tijiang'], 'string', 'max' => 100], [['gift_other', 'id_man', 'id_man_number', 'id_man_type', 'id_man_phone', 'link_man', 'link_man_phone', 'link_man_type', 'link_man_number', 'send_address','car_frame_no','car_man','total1','total1_clear','total1_real','total1_dis','total1_percent','total1_rate','total2','total2_clear','total2_rate','total3','total_all','total_real','price_remark','money_no','money_bank','email','return_remark','piao_header','photo_back','photo_face','tijiang'], 'string', 'max' => 100],
[['car_no','engine_no','pay_no','insurer1_no','insurer2_no','identifying_code','money_man','insurer_non_no'], 'string', 'max' => 50], [['car_no','engine_no','pay_no','insurer1_no','insurer2_no','identifying_code','money_man','insurer_non_no'], 'string', 'max' => 50],
[['remark'], 'string', 'max' => 200], [['remark'], 'string', 'max' => 200],
]; ];
@ -145,15 +136,6 @@ class OrderT extends \common\models\Base
'insurer2_end_date' => 'Insurer2 End Date', 'insurer2_end_date' => 'Insurer2 End Date',
'send_date' => 'Send Date', 'send_date' => 'Send Date',
'direction_id' => 'Direction 1 ID', 'direction_id' => 'Direction 1 ID',
'range1_id' => 'Range 1 ID',
'city1_id' => 'City 1 ID',
'district1_id' => 'District 1 ID',
'send_address1' => 'Send Address 1',
'direction2_id' => 'Direction 2 ID',
'range2_id' => 'Range 2 ID',
'city2_id' => 'City 2 ID',
'district2_id' => 'District 2 ID',
'send_address2' => 'Send Address 2',
'pay_type_id' => 'Pay Type ID', 'pay_type_id' => 'Pay Type ID',
'pay_no' => 'Pay No', 'pay_no' => 'Pay No',
'remark' => 'Remark', 'remark' => 'Remark',

@ -19,7 +19,8 @@
"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"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "*", "yiisoft/yii2-debug": "*",
@ -34,5 +35,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/"
}
} }
} }

755
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -2290,6 +2290,10 @@ class CarController extends BaseController
$seats = (int)$request->post('seats'); $seats = (int)$request->post('seats');
$register_date = $request->post('register_date'); $register_date = $request->post('register_date');
$car_use_id = $request->post('car_use_id'); $car_use_id = $request->post('car_use_id');
$purchase_price = $request->post('purchase_price');
$car_frame_no = $request->post('car_frame_no');
$engine_no = $request->post('engine_no');
$factory_model = $request->post('factory_model');
//策略信息 //策略信息
$celuo_id = $request->post('celuo_id'); $celuo_id = $request->post('celuo_id');
@ -2310,6 +2314,7 @@ class CarController extends BaseController
$link_man_number = $request->post('link_man_number'); $link_man_number = $request->post('link_man_number');
$link_man_type = $request->post('link_man_type'); $link_man_type = $request->post('link_man_type');
$link_man_phone = $request->post('link_man_phone'); $link_man_phone = $request->post('link_man_phone');
$pay_type_id = $request->post('pay_type_id');
//送单地址信息 //送单地址信息
$send_district_id = $request->post('send_district_id'); $send_district_id = $request->post('send_district_id');
@ -2319,12 +2324,10 @@ class CarController extends BaseController
//保单信息 //保单信息
$order_id = $request->post('id', 0); $order_id = $request->post('id', 0);
$email = $request->post('email'); $email = $request->post('email');
$send_date = $request->post('send_date');
$company2_id = $request->post('company2_id'); $company2_id = $request->post('company2_id');
$insurer1_begin_date = $request->post('insurer1_begin_date'); $insurer1_begin_date = $request->post('insurer1_begin_date');
$insurer2_begin_date = $request->post('insurer2_begin_date'); $insurer2_begin_date = $request->post('insurer2_begin_date');
$order_remark = $request->post('order_remark'); $order_remark = $request->post('order_remark');
$success_id = $request->post('success_id');
//报价信息 //报价信息
$total1_clear = $request->post('total1_clear'); $total1_clear = $request->post('total1_clear');
@ -2378,6 +2381,10 @@ class CarController extends BaseController
$car_info->car_man = $car_man; $car_info->car_man = $car_man;
$car_info->car_man_number = $car_man_number; $car_info->car_man_number = $car_man_number;
$car_info->car_use_id = $car_use_id; $car_info->car_use_id = $car_use_id;
$car_info->engine_no = $engine_no;
$car_info->car_frame_no = $car_frame_no;
$car_info->factory_model = $factory_model;
$car_info->purchase_price = $purchase_price;
if(!$car_info->save()) { if(!$car_info->save()) {
throw new \Exception(print_r($car_info->getErrors(), true)); throw new \Exception(print_r($car_info->getErrors(), true));
} }
@ -2385,8 +2392,10 @@ class CarController extends BaseController
//保单信息 //保单信息
$order_info->car_no = $car_no; $order_info->car_no = $car_no;
$order_info->seats = $seats; $order_info->seats = $seats;
$order_info->engine_no = $car_info->engine_no; $order_info->engine_no = $engine_no;
$order_info->car_frame_no = $car_info->car_frame_no; $order_info->car_frame_no = $car_frame_no;
$order_info->factory_model = $factory_model;
$order_info->purchase_price = $purchase_price;
$order_info->car_man = $car_man; $order_info->car_man = $car_man;
$order_info->car_man_phone = $car_man_phone; $order_info->car_man_phone = $car_man_phone;
$order_info->car_man_type = $car_man_type; $order_info->car_man_type = $car_man_type;
@ -2411,18 +2420,20 @@ class CarController extends BaseController
} }
} }
$order_info->submit_date = date('Y-m-d'); $order_info->submit_date = date('Y-m-d');
//商业保险日期
$order_info->insurer1_begin_date = $insurer1_begin_date; $order_info->insurer1_begin_date = $insurer1_begin_date;
$insurer1_end_date = ''; $insurer1_end_date = '';
if ($insurer1_begin_date != '') { if ($insurer1_begin_date != '') {
$insurer1_end_date = date('Y-m-d', strtotime(date('Y-m-d', strtotime($insurer1_begin_date . "+1 year")) . '-1 day')); $insurer1_end_date = date('Y-m-d', strtotime(date('Y-m-d', strtotime($insurer1_begin_date . "+1 year")) . '-1 day'));
} }
$order_info->insurer1_end_date = $insurer1_end_date; $order_info->insurer1_end_date = $insurer1_end_date;
//交强保险日期
$order_info->insurer2_begin_date = $insurer2_begin_date; $order_info->insurer2_begin_date = $insurer2_begin_date;
$insurer2_end_date = ''; $insurer2_end_date = '';
if ($insurer2_begin_date != '') if ($insurer2_begin_date != '')
$insurer2_end_date = date('Y-m-d', strtotime(date('Y-m-d', strtotime($insurer2_begin_date . "+1 year")) . '-1 day')); $insurer2_end_date = date('Y-m-d', strtotime(date('Y-m-d', strtotime($insurer2_begin_date . "+1 year")) . '-1 day'));
$order_info->insurer2_end_date = $insurer2_end_date; $order_info->insurer2_end_date = $insurer2_end_date;
$order_info->send_date = $send_date;
$order_info->send_district_id = $send_district_id; $order_info->send_district_id = $send_district_id;
$order_info->send_city_id = $send_city_id; $order_info->send_city_id = $send_city_id;
$order_info->send_address = $send_address; $order_info->send_address = $send_address;
@ -2441,6 +2452,7 @@ class CarController extends BaseController
$order_info->total_real = $total_real; $order_info->total_real = $total_real;
$order_info->price_remark = $price_remark; $order_info->price_remark = $price_remark;
$order_info->yuangong_money = $yuangong_money; $order_info->yuangong_money = $yuangong_money;
$order_info->pay_type_id = $pay_type_id;
$order_info->money_man = $money_man; $order_info->money_man = $money_man;
$order_info->money_bank = $money_bank; $order_info->money_bank = $money_bank;
@ -2484,9 +2496,10 @@ class CarController extends BaseController
} }
//处理预约 //处理预约
$result['msg'] = '保存成功';
if ($status_id > 1) { if ($status_id > 1) {
$tmp_row = AppointmentT::findOne(['car_id' => $car_info->id]); $tmp_row = AppointmentT::findOne(['car_id' => $car_info->id]);
if (!empty($tmp_row)) { if($tmp_row) {
$tmp_row->delete(); $tmp_row->delete();
} }
$tmp_status_info = StatusT::findOne(['id' => $status_id]); $tmp_status_info = StatusT::findOne(['id' => $status_id]);
@ -2495,9 +2508,9 @@ class CarController extends BaseController
$log_msg = '进入' . $tmp_status_info->name; $log_msg = '进入' . $tmp_status_info->name;
} }
$this->addLog($car_info->id, $log_msg, 1); $this->addLog($car_info->id, $log_msg, 1);
$result['msg'] = '提交成功';
} }
// 处理财务-如果是在线支付-生成财务分支 // 处理财务-如果是在线支付-生成财务分支-返现记录
if ($status_id > 1) { if ($status_id > 1) {
$order_caiwu = OrderCaiwuT::findOne(['order_id'=>$order_info->id]); $order_caiwu = OrderCaiwuT::findOne(['order_id'=>$order_info->id]);
@ -2563,7 +2576,6 @@ class CarController extends BaseController
} }
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功';
$tran->commit(); $tran->commit();
} catch (\Exception $e) { } catch (\Exception $e) {

File diff suppressed because it is too large Load Diff

@ -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();
@ -785,16 +784,16 @@ class GiftController extends \yii\web\Controller
return $data; return $data;
} }
public function actionGiftUse() { public function actionTicketUse() {
$type_items = GiftT::find() $type_items = GiftT::find()
->where(['type_id'=>2,'is_delete'=>0]) ->where(['type_id'=>2,'is_delete'=>0])
->all(); ->all();
return $this->render('gift-use', [ return $this->render('ticket-use', [
'type_items' => $type_items 'type_items' => $type_items
]); ]);
} }
public function actionGiftUseJson() public function actionTicketUseJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
@ -888,7 +887,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 +968,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));
}
}
} }

@ -26,9 +26,11 @@ use common\models\ExpressT;
use common\models\GiftGroupT; use common\models\GiftGroupT;
use common\models\GiftT; use common\models\GiftT;
use common\models\GiftTicketT; use common\models\GiftTicketT;
use common\models\GiftTicketTUse;
use common\models\GiftType2T; use common\models\GiftType2T;
use common\models\GiftType3T; use common\models\GiftType3T;
use common\models\GroupT; use common\models\GroupT;
use common\models\InsurerCompany2T;
use common\models\InsurerCompanyT; use common\models\InsurerCompanyT;
use common\models\InsurerTypeT; use common\models\InsurerTypeT;
use common\models\InvalidT; use common\models\InvalidT;
@ -50,8 +52,10 @@ use common\models\SeriesT;
use common\models\UserT; use common\models\UserT;
use common\models\CaiwuStatusT; use common\models\CaiwuStatusT;
use common\models\ZhongjiGiftT; use common\models\ZhongjiGiftT;
use Faker\Provider\Image;
use Yii; use Yii;
use yii\data\Pagination; use yii\data\Pagination;
use yii\helpers\FileHelper;
use yii\web\Response; use yii\web\Response;
use yii\web\User; use yii\web\User;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
@ -470,54 +474,6 @@ class InsurerController extends BaseController
return $data; return $data;
} }
// public function actionMyListInfo()
// {
// $request = Yii::$app->request;
// $id = $request->get('id',0);
// $order_info = OrderT::findOne(['id'=>$id]);
// $car_info = $order_info->car;
//
// //快递
// $ems_items = EmsT::find()
// ->where(['car_id'=>$car_info->id,'order_id'=>$order_info->id])
// ->orderBy('id ASC')
// ->all();
// //礼品
// $gift_items = GiftT::find()
// ->where('type_id=1')
// ->all();
// //礼品
// $gift_group_items = GiftGroupT::find()->all();
// //获取礼品数据
// $sel_gifts = array();
// $tmp_items = OrderGiftT::find()
// ->where('order_id='.$order_info->id)
// ->all();
// foreach($tmp_items as $item) {
// $sel_gifts[$item->group_id] = $item;
// }
//
// $insurer_type_items = InsurerTypeT::find()
// ->all();
//
// //登陆用户ID
// $uid = $this->my->role_id;
// //转账信息
// $caiwu_status = CaiwuStatusT::find()->asArray()->all();
// $caiwu_status= ArrayHelper::map($caiwu_status,'id', 'name');
//
// return $this->render('my-list-info',[
// 'car_info' => $car_info,
// 'caiwu_status' => $caiwu_status,
// 'insurer_type_items' => $insurer_type_items,
// 'order_info' => $order_info,
// 'ems_items' => $ems_items,
// 'uid' => $uid,
// 'gift_items' => $gift_items,
// 'gift_group_items' => $gift_group_items,
// 'sel_gifts' => $sel_gifts,
// ]);
// }
public function actionMyListInfo() public function actionMyListInfo()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -557,6 +513,7 @@ class InsurerController extends BaseController
//登陆用户ID //登陆用户ID
$uid = $this->my->role_id; $uid = $this->my->role_id;
$my_id = $this->my->id;
//转账信息 //转账信息
$caiwu_status = CaiwuStatusT::find()->asArray()->all(); $caiwu_status = CaiwuStatusT::find()->asArray()->all();
$caiwu_status= ArrayHelper::map($caiwu_status,'id', 'name'); $caiwu_status= ArrayHelper::map($caiwu_status,'id', 'name');
@ -569,6 +526,7 @@ class InsurerController extends BaseController
'ems_items' => $ems_items, 'ems_items' => $ems_items,
'ems_items1' => $ems_items1, 'ems_items1' => $ems_items1,
'uid' => $uid, 'uid' => $uid,
'my_id' => $my_id,
'gift_items' => $gift_items, 'gift_items' => $gift_items,
'gift_group_items' => $gift_group_items, 'gift_group_items' => $gift_group_items,
'sel_gifts' => $sel_gifts, 'sel_gifts' => $sel_gifts,
@ -670,29 +628,44 @@ class InsurerController extends BaseController
* @return string * @return string
*/ */
public function actionOfficeMng() { public function actionOfficeMng() {
return $this->render('office-mng'); $insurer_company_items = InsurerCompanyT::find()->all();
return $this->render('office-mng',[
'insurer_company_items' => $insurer_company_items
]);
} }
public function actionOfficeMngJson() public function actionOfficeMngJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$type = $request->get('type');
$car_man = $request->get('car_man'); $car_man = $request->get('car_man');
$phone = $request->get('phone'); $phone = $request->get('phone');
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
$company2_id = $request->get('company2_id');
$offset = $request->get('offset', 0); $offset = $request->get('offset', 0);
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
$query = OrderT::find() $query = OrderT::find()
->where('status_id=2') ->where('status_id=2')
->orderBy('submit_date DESC, id DESC'); ->orderBy('submit_date DESC, id DESC');
if($type == 1) {
$query->andWhere('lock_id=0');
}
if($type == 2) {
$query->andWhere('lock_id>0');
}
if($car_man != '') { if($car_man != '') {
$query = $query->andWhere('car_man="'.$car_man.'"'); $query->andWhere('car_man="'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('link_phone="'.$phone.'"'); $query->andWhere('car_man_phone like :phone1 or id_man_phone like :phone2 or link_man_phone like :phone3',[':phone1'=>$phone,':phone2'=>$phone,':phone3'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere('car_no="'.$car_no.'"'); $query->andWhere('car_no="'.$car_no.'"');
}
if($company2_id > 0) {
$query->andWhere('company2_id=:company2_id',[':company2_id'=>$company2_id]);
} }
$query = $query->orderBy('updated_at asc'); $query = $query->orderBy('updated_at asc');
$total = $query->count(); $total = $query->count();
@ -754,7 +727,7 @@ class InsurerController extends BaseController
$insurer_type_items = InsurerTypeT::find() $insurer_type_items = InsurerTypeT::find()
->all(); ->all();
$insurer_company_items = InsurerCompanyT::find() $insurer_company2_items = InsurerCompany2T::find()
->all(); ->all();
$payee_items=PayeeT::find()->all(); $payee_items=PayeeT::find()->all();
$payment_items=Payment::find()->all(); $payment_items=Payment::find()->all();
@ -763,10 +736,9 @@ class InsurerController extends BaseController
'car_info' => $car_info, 'car_info' => $car_info,
'insurer_type_items' => $insurer_type_items, 'insurer_type_items' => $insurer_type_items,
'order_info' => $order_info, 'order_info' => $order_info,
'insurer_company_items' => $insurer_company_items, 'insurer_company2_items' => $insurer_company2_items,
'payee_items' => $payee_items, 'payee_items' => $payee_items,
'payment_items' => $payment_items, 'payment_items' => $payment_items,
'type_items' => $type_items
]); ]);
} }
/** /**
@ -856,57 +828,22 @@ class InsurerController extends BaseController
$result['msg'] = '保单错误!'; $result['msg'] = '保单错误!';
return $result; return $result;
} }
//更新车辆车牌号
$car_info = $order_info->car;
$car_info->car_no = $order_info->car_no;
$car_info->save();
$old_status_id = $order_info->status_id; $old_status_id = $order_info->status_id;
$order_info->total1_rate = $total1_rate; $order_info->total1_rate = $total1_rate;
$order_info->total2_rate = $total2_rate; $order_info->total2_rate = $total2_rate;
$order_info->company_id = $company_id; $order_info->company_id = $company_id;
$order_info->payee_id = $payee_id;
$order_info->payment_id = $payment_id;
$order_info->zhifu_date = date('Y-m-d');
$order_info->pay_no = $pay_no; $order_info->pay_no = $pay_no;
$order_info->status_id = $status_id; $order_info->status_id = $status_id;
//如果是在线支付和自上门,更改订单状态 $result['msg'] = '保存成功';
// echo '<pre>';
// print_r($old_status_id);
// echo '<hr>';
// print_r($status_id);
// die;
if($status_id > $old_status_id) { if($status_id > $old_status_id) {
// if($order_info->shoufei_id ==2 || $order_info->shoufei_id ==3){
//
// $order_info->status_id = 5;
// }
$order_info->op1_id = $this->my->id; $order_info->op1_id = $this->my->id;
// echo '<hr>'; // $order_info->lock_id = 0;
$order_info->lock_id = 0; $result['msg'] = '提交成功';
// if($order_info->shoufei_id ==2){ $this->addLog($car_id,'核保结束,进入正本生成',1);
// $this->addLog($car_id,'核保结束,在线支付,直接进入正本生成',1);
//// echo 1;
// }elseif( $order_info->shoufei_id ==3){
// $this->addLog($car_id,'核保结束,客户自上门,直接进入正本生成',1);
//// echo 2;
// } else{
$this->addLog($car_id,'核保结束,进入正本生成',1);
// echo 3;
// }
// echo '<hr>';
// print_r($order_info->status_id);
// print_r($status_id);
// print_r($old_status_id);
// die;
//处理操作人员状态 //处理操作人员状态
$order_user_info = OrderUserT::findOne(['order_id'=>$order_info->id,'user_id'=>$this->my->id,'type_id'=>$old_status_id,'status'=>0]); $order_user_info = OrderUserT::findOne(['order_id'=>$order_info->id,'user_id'=>$this->my->id,'type_id'=>$old_status_id,'status'=>0]);
@ -915,17 +852,16 @@ class InsurerController extends BaseController
$order_user_info->save(); $order_user_info->save();
} }
} }
$order_info->save(); if(!$order_info->save()) {
throw new \Exception(print_r($order_info->getErrors(), true));
}
$result['success'] = true;
$tran->commit(); $tran->commit();
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
$result['success'] = true;
$result['msg'] = '保存成功';
} }
return $result; return $result;
} }
@ -1182,7 +1118,11 @@ class InsurerController extends BaseController
* @return string * @return string
*/ */
public function actionOriginalMng() { public function actionOriginalMng() {
return $this->render('original-mng'); $pay_type_items = PayTypeT::find()->all();
return $this->render('original-mng',[
'pay_type_items' => $pay_type_items
]);
} }
public function actionOriginalMngJson() public function actionOriginalMngJson()
{ {
@ -1191,9 +1131,7 @@ class InsurerController extends BaseController
$id_man = $request->get('id_man'); $id_man = $request->get('id_man');
$phone = $request->get('phone'); $phone = $request->get('phone');
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
$send_date = $request->get('send_date'); $pay_type_id = $request->get('pay_type_id');
$payee_id = $request->get('payee_id');
$payment_id = $request->get('payment_id');
$offset = $request->get('offset',0); $offset = $request->get('offset',0);
$limit = $request->get('limit',10); $limit = $request->get('limit',10);
@ -1201,27 +1139,21 @@ class InsurerController extends BaseController
->where('status_id=5') ->where('status_id=5')
->orderBy('submit_date DESC, id DESC'); ->orderBy('submit_date DESC, id DESC');
if($id_man != '') { if($id_man != '') {
$query = $query->andWhere('id_man="'.$id_man.'"'); $query->andWhere('id_man="'.$id_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('link_phone="'.$phone.'"'); $query->andWhere('car_man_phone like :phone1 or id_man_phone like :phone2 or link_man_phone like :phone3',[':phone1'=>$phone,':phone2'=>$phone,':phone3'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere('car_no="'.$car_no.'"'); $query->andWhere('car_no=:car_no',[':car_no'=>$car_no]);
} }
if($send_date != '') { if($pay_type_id > 0) {
$query = $query->andWhere('send_date="'.$send_date.'"'); $query->andWhere('pay_type_id=:pay_type_id',[':pay_type_id'=>$pay_type_id]);
} }
if($payee_id != '') { $query->orderBy('updated_at ASC');
$query = $query->andWhere('payee_id="'.$payee_id.'"');
}
if($payment_id != '') {
$query = $query->andWhere('payment_id="'.$payment_id.'"');
}
$query = $query->orderBy('updated_at ASC');
$total = $query->count(); $total = $query->count();
$query = $query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$data = []; $data = [];
@ -5119,6 +5051,37 @@ class InsurerController extends BaseController
} }
return $result; return $result;
} }
public function actionGiftUnSave()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '取消失败';
if ($request->isPost) {
$id = $request->post('order_id', 0);
$order_info = OrderT::findOne($id);
$tran = OrderT::getDb()->beginTransaction();
try {
$order_info->gift_status = 0;
if(!$order_info->save()) {
throw new \Exception(print_r($order_info->getErrors(), true));
}
$result['success'] = true;
$result['msg'] = '取消成功';
$tran->commit();
} catch (\Exception $e) {
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
}
return $result;
}
public function actionGiftSave() public function actionGiftSave()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
@ -5154,6 +5117,7 @@ class InsurerController extends BaseController
$zhongjigift_item = ZhongjiGiftT::findOne(['id'=>$tmp[0]]); $zhongjigift_item = ZhongjiGiftT::findOne(['id'=>$tmp[0]]);
$gift_id = $tmp[1]; $gift_id = $tmp[1];
$gift_item = GiftT::findOne(['id'=>$gift_id]); $gift_item = GiftT::findOne(['id'=>$gift_id]);
$order_gift_id = 0;
if($zhongjigift_item && $gift_item) { if($zhongjigift_item && $gift_item) {
$row = new OrderGiftT(); $row = new OrderGiftT();
$row->order_id = $order_info->id; $row->order_id = $order_info->id;
@ -5168,6 +5132,11 @@ class InsurerController extends BaseController
if (!$row->save()) { if (!$row->save()) {
throw new \Exception(print_r($row->getErrors(), true)); throw new \Exception(print_r($row->getErrors(), true));
} }
$order_gift_id = $row->id;
}
//生成礼品图片
if($gift_item) {
$this->getGift(0, $gift_id, $order_info->car_no, $order_info, $order_gift_id);
} }
} }
//礼券 //礼券
@ -5176,6 +5145,7 @@ class InsurerController extends BaseController
$zhongjigift_item = ZhongjiGiftT::findOne(['id'=>$tmp[0]]); $zhongjigift_item = ZhongjiGiftT::findOne(['id'=>$tmp[0]]);
$gift_id = $tmp[1]; $gift_id = $tmp[1];
$gift_item = GiftT::findOne(['id'=>$gift_id]); $gift_item = GiftT::findOne(['id'=>$gift_id]);
$order_gift_id = 0;
if($zhongjigift_item && $gift_item) { if($zhongjigift_item && $gift_item) {
$row = new OrderGiftT(); $row = new OrderGiftT();
$row->order_id = $order_info->id; $row->order_id = $order_info->id;
@ -5190,6 +5160,11 @@ class InsurerController extends BaseController
if (!$row->save()) { if (!$row->save()) {
throw new \Exception(print_r($row->getErrors(), true)); throw new \Exception(print_r($row->getErrors(), true));
} }
$order_gift_id = $row->id;
}
//生成礼券图片
if($gift_item) {
$this->getGift(0, $gift_id, $order_info->car_no, $order_info, $order_gift_id);
} }
} }
$order_info->gift_status = 1; $order_info->gift_status = 1;
@ -5207,5 +5182,143 @@ class InsurerController extends BaseController
} }
return $result; return $result;
} }
public function getGift($k, $v, $car_no, $order_info, $order_gift_id)
{
$result = array();
$result['tishi'] = true;
$result['teshu'] = false;
$gift_info = GiftT::findOne(['id' => $v]);
if($order_gift_id == 0) {
return;
}
$bianhao = '';
$endDate = '';
//礼券
if ($gift_info && $gift_info->type_id == 2) {
$pinyin_arr = explode(' ', $gift_info->pinyin_name);
// dd($pinyin_arr);
$liquan_str = 'ch';
//获取礼券拼音首字母
foreach ($pinyin_arr as $first) {
$liquan_str .= substr($first, 0, 1);
}
$liquan_str = strtolower($liquan_str);
//获取提单日期
$liquan_str .= date('Ymd', strtotime($order_info->print_date));
//获取该礼券下的最后一条记录
$gift_use = GiftTicketTUse::find()->where(['type_id' => $v, 'status' => 1])->orderBy('created_at desc')->one();
//礼券的使用
$new_gift_use = new GiftTicketTUse();
if ($gift_use) {
$liquan_str .= sprintf("%04d", $gift_use->gift_shuzi + 1);
$new_gift_use->gift_shuzi = $gift_use->gift_shuzi + 1;
$new_gift_use->code = $liquan_str;
} else {
$liquan_str .= sprintf("%04d", 1);
$new_gift_use->gift_shuzi = 1;
$new_gift_use->code = strtoupper($liquan_str);
}
$new_gift_use->op_id = $this->my->id;
$new_gift_use->type_id = $v; //礼券ID
$new_gift_use->input_date = date('Y-m-d H:i:s');
$new_gift_use->car_no = $car_no;
$new_gift_use->order_id = $order_info->id;
$new_gift_use->status = 1;
$new_gift_use->end_date = $order_info->insurer1_end_date;
if(!$new_gift_use->save()) {
throw new \Exception(print_r($new_gift_use->getErrors(), true));
}
//表头
$bianhao = strtoupper($liquan_str); //转换成大写编号
$endDate = '有效期' . $order_info->insurer1_end_date;
}
//礼品的使用
if ($gift_info && $gift_info->type_id == 1) {
$shiwu_use = GiftTicketTUse::find()->where(['type_id' => $v, 'status' => 1])->orderBy('created_at desc')->one();
$new_shiwu = new GiftTicketTUse();
if ($shiwu_use) {
$new_shiwu->gift_shuzi = $shiwu_use->gift_shuzi + 1;
$new_shiwu->code = sprintf("%04d", $gift_use->gift_shuzi + 1);
} else {
$new_shiwu->gift_shuzi = 1;
$new_shiwu->code = sprintf("%04d", 1);
}
$new_shiwu->op_id = $this->my->id;
$new_shiwu->type_id = $v;
$new_shiwu->input_date = date('Y-m-d H:i:s');
$new_shiwu->car_no = $car_no;
$new_shiwu->status = 1;
$new_shiwu->order_id = $order_info->id;
$new_shiwu->end_date = $order_info->insurer1_end_date;
if(!$new_shiwu->save()) {
throw new \Exception(print_r($new_shiwu->getErrors(), true));
}
//表头
$bianhao = '';
$endDate = '';
}
$gift_name = $gift_info->name;
//生成png文件
$gift_src = '';
$panduan = (object)array();
$datetime = date('YmdHis');
$name = md5(rand(100, 200));
$imgstr = '@frontend/web/upload/images/'.date('Ym');
$imgstr .= '/gift' . $name . '' . $datetime . '.png';
FileHelper::createDirectory(dirname(str_replace('@frontend/web/', '',$imgstr)));
//生成新的图片
if ($gift_info && $gift_info->type_id == 1) { // 实物
\yii\imagine\Image::thumbnail('@frontend/web/images/gift.png', 400, 252)
->save(Yii::getAlias($imgstr),
['quality' => 100]);//生成缩略图的质量
//图片打水印
\yii\imagine\Image::text('@frontend/web/images/gift.png', $bianhao, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [15, 15], ['color' => '000000', 'size' => 12])
->save(Yii::getAlias($imgstr));
\yii\imagine\Image::text($imgstr, $gift_name, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [20, 50], ['color' => '000000', 'size' => 20])
->save(Yii::getAlias($imgstr));
\yii\imagine\Image::text($imgstr, $car_no, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [20, 120], ['color' => '000000', 'size' => 20])
->save(Yii::getAlias($imgstr));
$panduan = \yii\imagine\Image::text($imgstr, $endDate, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [20, 200], ['color' => '000000', 'size' => 20])
->save(Yii::getAlias($imgstr));
} elseif ($gift_info && $gift_info->type_id == 2) {
$liquanSrc = '@frontend/web' . $gift_info->original_img;
\yii\imagine\Image::thumbnail($liquanSrc, 1097, 979)
->save(Yii::getAlias($imgstr),
['quality' => 100]);//生成缩略图的质量
//图片打水印
$bianhao = '券号:' . $bianhao;
\yii\imagine\Image::text($liquanSrc, $bianhao, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [325, 85], ['color' => 'ffffff', 'size' => 14])
->save(Yii::getAlias($imgstr));
\yii\imagine\Image::text($imgstr, $car_no, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [900, 400], ['color' => 'ffffff', 'size' => 16])
->save(Yii::getAlias($imgstr));
$panduan = \yii\imagine\Image::text($imgstr, $endDate, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [850, 440], ['color' => 'ffffff', 'size' => 16])
->save(Yii::getAlias($imgstr));
}
$gift_src = str_replace('@frontend/web', '', $imgstr);
//保存order_gift_t表里png文件地址
$order_gift_info = OrderGiftT::findOne(['id' => $order_gift_id]);
$order_gift_info->gift_src = $gift_src;
if(!$order_gift_info->save()) {
throw new \Exception(print_r($order_gift_info->getErrors(), true));
}
}
} }

@ -521,6 +521,7 @@ class MarketingStrategyController extends UserBaseController
} }
$result['success'] = true; $result['success'] = true;
$result['ids'] = join(',',$ids); $result['ids'] = join(',',$ids);
$result['num'] = count($ids);
$result['celuo_id'] = $yingxiao_item->id; $result['celuo_id'] = $yingxiao_item->id;
return $result; return $result;
} }
@ -569,8 +570,10 @@ class MarketingStrategyController extends UserBaseController
->where(['order_id'=>$order_id,'gift_type'=>$type]) ->where(['order_id'=>$order_id,'gift_type'=>$type])
->all(); ->all();
$order_gift_ids = []; $order_gift_ids = [];
$order_gift_srcs = [];
foreach($order_gift_items as $order_gift_item) { foreach($order_gift_items as $order_gift_item) {
$order_gift_ids[] = $order_gift_item->gift_id; $order_gift_ids[] = $order_gift_item->gift_id;
$order_gift_srcs[$order_gift_item->gift_id] = $order_gift_item->gift_src;
} }
$gifts = ZhongjiGiftT::find() $gifts = ZhongjiGiftT::find()
->where(['fanxian_id'=>$fanxian_id,'gift_type'=>$type]) ->where(['fanxian_id'=>$fanxian_id,'gift_type'=>$type])
@ -584,6 +587,7 @@ class MarketingStrategyController extends UserBaseController
foreach($tmp_row['gifts'] as $index => $gift_info) { foreach($tmp_row['gifts'] as $index => $gift_info) {
if(in_array($gift_info['id'], $order_gift_ids)) { if(in_array($gift_info['id'], $order_gift_ids)) {
$tmp_row['gifts'][$index]['selected'] = 1; $tmp_row['gifts'][$index]['selected'] = 1;
$tmp_row['gifts'][$index]['gift_src'] = $order_gift_srcs[$gift_info['id']];
} else { } else {
$tmp_row['gifts'][$index]['selected'] = 0; $tmp_row['gifts'][$index]['selected'] = 0;
} }
@ -593,4 +597,23 @@ class MarketingStrategyController extends UserBaseController
} }
return $result; return $result;
} }
public function actionDelete() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result['success'] = false;
$result['msg'] = '删除失败';
$id = $request->post('id');
$info = ZhongjiYingxiao::findOne(['id'=>$id]);
if($info) {
$info->is_delete = 1;
$info->save();
}
$result['success'] = true;
$result['msg'] = '删除成功';
return $result;
}
} }

@ -17,17 +17,23 @@ 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();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label>车主</label> <label for="car_man">车主</label>
<input type="text" name="car_man" id="car_man" class="form-control"> <input type="text" name="car_man" id="car_man" class="form-control">
<label>电话</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
<label>车牌</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control"> <input type="text" name="car_no" id="car_no" class="form-control">
<label>被保险人</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="id_man">被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control"> <input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

@ -17,17 +17,23 @@ 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();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label>车主</label> <label for="car_man">车主</label>
<input type="text" name="car_man" id="car_man" class="form-control"> <input type="text" name="car_man" id="car_man" class="form-control">
<label>电话</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
<label>车牌</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control"> <input type="text" name="car_no" id="car_no" class="form-control">
<label>被保险人</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="id_man">被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control"> <input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

@ -17,17 +17,23 @@ 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();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label>车主</label> <label>车主</label>
<input type="text" name="car_man" id="car_man" class="form-control"> <input type="text" name="car_man" id="car_man" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label>电话</label> <label>电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label>车牌</label> <label>车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control"> <input type="text" name="car_no" id="car_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label>被保险人</label> <label>被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control"> <input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

@ -8,11 +8,8 @@ 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="create(0)">
<i class="fa fa-plus"></i> 添加
</a>
<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> 刷新
</a> </a>
@ -24,9 +21,8 @@ use \common\libs\MyLib;
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th width="50" data-field="id">ID</th> <th data-field="id" data-width="50">ID</th>
<th data-field="name">名称</th> <th data-field="name">名称</th>
<th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -42,38 +38,6 @@ 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>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function create() {
title = '新增运营性质';
layer_show(title, '/car-use/edit?id=0');
}
function edit(id) {
var title = '编辑运营性质';
layer_show(title, '/car-use/edit?id=' + id);
}
function del(id) {
parent.layer.confirm('是否确认删除?', {
btn: ['删除','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/car-use/delete',{id:id},function(data) {
parent.layer.msg(data.msg);
refreshList();
}, 'json');
}, function(){
//
});
}
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }

@ -78,9 +78,9 @@ use \common\libs\MyLib;
</div> </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">
<label class="form-control-static"><?=$car_info->carType?$car_info->carType->name:''?></label> <label class="form-control-static"><?=$car_info->purchase_price?></label>
</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">

@ -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,11 +87,11 @@ 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>
@ -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);
layer_show('选择策略', '/marketing-strategy/select-fanxian?ids=' + obj.ids); if(obj.num > 1) {
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));

@ -91,6 +91,9 @@
</ul> </ul>
</div> </div>
<a href="/common/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a> <a href="/common/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
<a class="navbar-minimalize minimalize-styl-2 btn btn-success roll-right" href="#" style="position:fixed;bottom:40px;">
<i class="fa fa-bars"></i>
</a>
</div> </div>
<div class="row J_mainContent" id="content-main"> <div class="row J_mainContent" id="content-main">
<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/common/welcome" frameborder="0" data-id="index_v1.html" seamless></iframe> <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/common/welcome" frameborder="0" data-id="index_v1.html" seamless></iframe>

@ -49,10 +49,6 @@ use \common\libs\MyLib;
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" name="use_num" value="<?=$info->use_num?>" class="form-control"> <input type="text" name="use_num" value="<?=$info->use_num?>" class="form-control">
</div> </div>
<label class="col-sm-1 control-label">总数量</label>
<div class="col-sm-2">
<input type="text" name="total" value="<?=$info->total?>" 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>

@ -1,172 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>礼券使用</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-horizontal" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-md-1">礼券编号</label>
<div class="col-md-2">
<input type="text" id="code" name="code" class="form-control">
</div>
<label class="control-label col-md-1">车牌</label>
<div class="col-md-2">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-md-1">车架号</label>
<div class="col-md-2">
<input type="text" id="frame_no" name="frame_no" class="form-control">
</div>
<label class="control-label col-md-1">发动机号</label>
<div class="col-md-2">
<input type="text" id="engine_no" name="engine_no" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-1">状态</label>
<div class="col-md-2">
<select name="status" class="form-control">
<option value="0" >全部</option>
<option value="4">未出库</option>
<option value="5">已出库</option>
</select>
</div>
<label class="control-label col-md-1">分类</label>
<div class="col-md-2">
<select name="type_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($type_items as $item) {
echo '<option value="'.$item->id.'"';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div>
<label class="control-label col-md-1">业务工号</label>
<div class="col-md-2">
<input type="text" id="username" name="username" class="form-control">
</div>
<label class="control-label col-md-1">商业保单号</label>
<div class="col-md-2">
<input type="text" id="insurer1_no" name="insurer1_no" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-1">提单日期</label>
<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="" />
<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="" />
</div>
</div>
<label class="control-label col-md-1">正本日期</label>
<div class="col-md-2">
<div class="input-daterange input-group" id="datepicker">
<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>
<input type="text" class="input-sm form-control" id="p_end_date" name="p_end_date" autocomplete="off" value="" />
</div>
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th width="50" data-field="id">ID</th>
<th data-field="code">礼券编号</th>
<th data-field="name">礼品</th>
<th data-field="car_no">车牌号</th>
<th data-field="car_frame_no">车架号</th>
<th data-field="use_total">发放日期</th>
<th data-field="use_total">有效期日期</th>
<th data-field="use_total">提单人</th>
<th data-field="use_total">使用日期</th>
<th data-field="use_total">状态</th>
<th data-field="use_total">操作员</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
if(row.use_num > row.finish_num) {
opStr.push('<i class="fa fa-edit" title="出库"></i>');
} else {
opStr.push('<i class="fa fa-file-o" title="详情"></i>');
}
opStr.push('</a>');
return opStr.join(' ');
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/gift/gift-use-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
params.code = $('#code').val();
params.car_no = $('#car_no').val();
params.frame_no = $('#frame_no').val();
params.engine_no = $('#engine_no').val();
params.status = $('#status').val();
params.type_id = $('#type_id').val();
params.username = $('#username').val();
params.insurer1_no = $('#insurer1_no').val();
params.s_start_date = $('#s_start_date').val();
params.s_end_date = $('#s_end_date').val();
params.p_start_date = $('#p_start_date').val();
params.p_end_date = $('#p_end_date').val();
return params;
}
});
return false;
}
$(function() {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
search();
});
</script>
<?php $this->endBlock(); ?>

@ -0,0 +1,142 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group">
<label class="col-sm-2 control-label">编号</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->code?></p>
</div>
<label class="col-sm-2 control-label">车牌号</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->car_no?></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">车架号</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->order->car_frame_no?></p>
</div>
<label class="col-sm-2 control-label">发动机号</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->order->engine_no?></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">商业保单号</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->order->insurer1_no?></p>
</div>
<label class="col-sm-2 control-label">有效期时间</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->end_date?></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">共使用数</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->typeNew->use_num?></p>
</div>
<label class="col-sm-2 control-label">剩余使用次数</label>
<div class="col-sm-4">
<p class="form-control-static"><?=$info->typeNew->use_num - $info->finished_num?></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">备注</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<?php if($info->typeNew->use_num > $info->finished_num) {?>
<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>
<?php } ?>
</form>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>操作记录</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="id">序号</th>
<th data-field="op_man">操作者</th>
<th data-field="op_time">操作时间</th>
<th data-field="info">操作内容</th>
<th data-field="remark">备注</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" language="javascript">
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/gift/history-log-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
params.id = <?=$info->id?>;
return params;
}
});
return false;
}
$(function () {
search();
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
params += '&status=2';
$.post('/gift/use-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success) {
parent.refreshList();
layer_close();
}
},'json');
}, function(){
//
});
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -0,0 +1,169 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>礼券使用</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="code">礼券编号</label>
<input type="text" id="code" name="code" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="frame_no">车架号</label>
<input type="text" id="frame_no" name="frame_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">发动机号</label>
<input type="text" id="engine_no" name="engine_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="status">状态</label>
<select name="status" id="status" class="form-control">
<option value="0" >全部</option>
<option value="1">未使用</option>
<option value="2">使用中</option>
<option value="3">使用完</option>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="type_id">分类</label>
<select name="type_id" id="type_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($type_items as $item) {
echo '<option value="'.$item->id.'"';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">业务工号</label>
<input type="text" id="username" name="username" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="insurer1_no">商业保单号</label>
<input type="text" id="insurer1_no" name="insurer1_no" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">提单日期</label>
<div class="input-daterange input-group" id="datepicker1">
<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>
<input type="text" class="input-sm form-control" id="s_end_date" name="s_end_date" autocomplete="off" value="" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker2">正本日期</label>
<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="" />
<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="" />
</div>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th width="50" data-field="id">ID</th>
<th data-field="code">礼券编号</th>
<th data-field="name">礼品</th>
<th data-field="car_no">车牌号</th>
<th data-field="car_frame_no">车架号</th>
<th data-field="input_date">发放日期</th>
<th data-field="end_date">有效期日期</th>
<th data-field="submit_user">提单人</th>
<th data-field="use_date">使用日期1</th>
<th data-field="status">状态</th>
<th data-field="username">操作员</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
if(row.use_num > row.finish_num) {
opStr.push('<i class="fa fa-edit" title="出库"></i>');
} else {
opStr.push('<i class="fa fa-file-o" title="详情"></i>');
}
opStr.push('</a>');
return opStr.join(' ');
}
function edit(id) {
title = '礼品核销';
layer_show(title, '/gift/ticket-use-edit?id='+id);
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/gift/ticket-use-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
params.code = $('#code').val();
params.car_no = $('#car_no').val();
params.frame_no = $('#frame_no').val();
params.engine_no = $('#engine_no').val();
params.status = $('#status').val();
params.type_id = $('#type_id').val();
params.username = $('#username').val();
params.insurer1_no = $('#insurer1_no').val();
params.s_start_date = $('#s_start_date').val();
params.s_end_date = $('#s_end_date').val();
params.p_start_date = $('#p_start_date').val();
params.p_end_date = $('#p_end_date').val();
return params;
}
});
return false;
}
$(function() {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
search();
});
</script>
<?php $this->endBlock(); ?>

@ -8,11 +8,8 @@ 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="create(0)">
<i class="fa fa-plus"></i> 添加
</a>
<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> 刷新
</a> </a>
@ -24,9 +21,8 @@ use \common\libs\MyLib;
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th data-field="id">ID</th> <th data-field="id" data-width="50">ID</th>
<th data-field="name">公司名称</th> <th data-field="name">公司名称</th>
<th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -42,38 +38,6 @@ 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>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function create() {
title = '新增保险公司';
layer_show(title, '/insurer-company/edit?id=0');
}
function edit(id) {
var title = '编辑保险公司';
layer_show(title, '/insurer-company/edit?id=' + id);
}
function del(id) {
parent.layer.confirm('是否确认删除?', {
btn: ['删除','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/insurer-company/delete',{id:id},function(data) {
parent.layer.msg(data.msg);
refreshList();
}, 'json');
}, function(){
//
});
}
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }

@ -9,18 +9,18 @@ use \common\libs\MyLib;
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm"> <form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>"> <input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group"> <div class="form-group">
<label class="col-md-1 control-label">名称</label> <label class="col-sm-1 control-label">名称</label>
<div class="col-md-6"> <div class="col-sm-6">
<input type="text" name="name" value="<?=$info->name?>" class="form-control"> <input type="text" name="name" value="<?=$info->name?>" class="form-control">
</div> </div>
</div> </div>
<div> <div>
<div class="row"> <div class="row">
<div class="col-md-5 col-md-offset-5"> <div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button"> <button class="btn btn-primary btn-save" type="button">
<strong><?=$info ? '保 存':'添 加'?></strong> <strong><?=$info ? '保 存':'添 加'?></strong>
</button> </button>

@ -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="create(0)"> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
@ -24,9 +24,9 @@ use \common\libs\MyLib;
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th width="50" data-field="id">ID</th> <th data-field="id" data-width="50">ID</th>
<th data-field="name">名称</th> <th data-field="name">名称</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter" data-width="100">操作</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -54,11 +54,11 @@ use \common\libs\MyLib;
return opStr.join(' '); return opStr.join(' ');
} }
function create() { function create() {
title = '新增业务保险公司'; title = '新增内勤保险公司';
layer_show(title, '/insurer-company2/edit?id=0'); layer_show(title, '/insurer-company2/edit?id=0');
} }
function edit(id) { function edit(id) {
var title = '编辑业务保险公司'; var title = '编辑内勤保险公司';
layer_show(title, '/insurer-company2/edit?id=' + id); layer_show(title, '/insurer-company2/edit?id=' + id);
} }
function del(id) { function del(id) {

@ -21,73 +21,63 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">车牌号</th> <th class="bg-warning">车牌号</th>
<td><label><?=$order_info->car_no?></label></td> <td><?=$order_info->car_no?></td>
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><label><?=$car_info->register_date?></label></td> <td><?=$car_info->register_date?></td>
<th class="bg-warning" nowrap>座位数</th> <th class="bg-warning" nowrap>座位数</th>
<td><label><?=$order_info->seats?></label></td> <td><?=$order_info->seats?></td>
<th class="bg-warning" nowrap>电子邮件</th> <th class="bg-warning" nowrap>电子邮件</th>
<td><label><?=$order_info->email?></label></td> <td><?=$order_info->email?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车型</th> <th class="bg-warning">车型</th>
<td><label><?=$car_info->factory_model?></label></td> <td><?=$car_info->factory_model?></td>
<th class="bg-warning" nowrap>发动机号</th> <th class="bg-warning" nowrap>发动机号</th>
<td><label><?=$order_info->engine_no?></label></td> <td><?=$order_info->engine_no?></td>
<th class="bg-warning" nowrap>车架号</th> <th class="bg-warning" nowrap>车架号</th>
<td><label><?=$order_info->car_frame_no?></label></td> <td><?=$order_info->car_frame_no?></td>
<th class="bg-warning" nowrap>&nbsp;</th> <th class="bg-warning" nowrap>新车购置价</th>
<td>&nbsp;</td> <td><?=$order_info->purchase_price?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>
<td><label><?=$order_info->car_man?></label></td> <td><?=$order_info->car_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->car_man_type?></label> <td><?=$order_info->car_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->car_man_number?></label></td> <td><?=$order_info->car_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->car_man_phone?></label></td> <td><?=$order_info->car_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">被投保人</th> <th class="bg-warning">被投保人</th>
<td><label><?=$order_info->id_man?></label></td> <td><?=$order_info->id_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->id_man_type?></label> <td><?=$order_info->id_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->id_man_number?></label></td> <td><?=$order_info->id_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->id_man_phone?></label></td> <td><?=$order_info->id_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">投保人</th> <th class="bg-warning">投保人</th>
<td><label><?=$order_info->link_man?></label></td> <td><?=$order_info->link_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->link_man_type?></label> <td><?=$order_info->link_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->link_man_number?></label></td> <td><?=$order_info->link_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->link_man_phone?></label></td> <td><?=$order_info->link_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning" nowrap>商业起保日期</th> <th class="bg-warning" nowrap>商业起保日期</th>
<td> <td><?=$order_info->insurer1_begin_date?></td>
<label><?=$order_info->insurer1_begin_date?></label>
</td>
<th class="bg-warning" nowrap>交强起保日期</th> <th class="bg-warning" nowrap>交强起保日期</th>
<td> <td><?=$order_info->insurer2_begin_date?></td>
<label><?=$order_info->insurer2_begin_date?></label>
</td>
<th class="bg-warning">保险公司</th> <th class="bg-warning">保险公司</th>
<td> <td><?=$order_info->company2->name?></td>
<label><?=$order_info->company->name?></label> <th class="bg-warning">车辆使用性质</th>
</td> <td><?=$order_info->car->carUse->name?></td>
<th class="bg-warning">车辆使用类型</th>
<td class="form-inline" nowrap>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -110,13 +100,13 @@ use common\models\PriceT;
$tmp_row = PriceT::find() $tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id) ->where('order_id='.$order_id.' and type_id='.$item->id)
->one(); ->one();
if($tmp_row->val == '') continue; if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
?> ?>
<th class="bg-warning"> <th class="bg-warning">
<?=$item->name?>(<?=$item->code?>) <?=$item->name?>(<?=$item->code?>)
</th> </th>
<td><label><?=$tmp_row->val?></label></td> <td><?=$tmp_row->val?></td>
<td><label><?=(!empty($tmp_row) && $tmp_row->is_nopay == 1)?'不计免赔':''?></label></td> <td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
<?php <?php
if(($index+1)%3==0) { if(($index+1)%3==0) {
echo '</tr>'; echo '</tr>';
@ -137,39 +127,39 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">商业总净保费</th> <th class="bg-warning">商业总净保费</th>
<td><label><?=$order_info->total1_clear?></label></td> <td><?=$order_info->total1_clear?></td>
<th class="bg-warning">商业含税总保费</th> <th class="bg-warning">商业含税总保费</th>
<td><label><?=$order_info->total1?></label></td> <td><?=$order_info->total1?></td>
<th class="bg-warning">车船税</th> <th class="bg-warning">车船税</th>
<td><label><?=$order_info->total3?></label></td> <td><?=$order_info->total3?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">交强总净保费</th> <th class="bg-warning">交强总净保费</th>
<td><label><?=$order_info->total2_clear?></label></td> <td><?=$order_info->total2_clear?></td>
<th class="bg-warning">交强含税总保费</th> <th class="bg-warning">交强含税总保费</th>
<td><label><?=$order_info->total2?></label></td> <td><?=$order_info->total2?></td>
<th class="bg-warning">&nbsp;</th> <th class="bg-warning">业务自付金额</th>
<td>&nbsp;</td> <td><?=$order_info->yuangong_money?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">折扣后商业净保费</th> <th class="bg-warning">折扣后商业净保费</th>
<td><label><?=$order_info->total1_real?></label></td> <td><?=$order_info->total1_real?></td>
<th class="bg-warning">减免金额</th> <th class="bg-warning">减免金额</th>
<td><label><?=$order_info->total1_dis?></label></td> <td><?=$order_info->total1_dis?></td>
<th class="bg-warning">商业折扣率</th> <th class="bg-warning">商业折扣率</th>
<td><label><?=$order_info->total1_percent?></label></td> <td><?=$order_info->total1_percent?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">共计签单</th> <th class="bg-warning">共计签单</th>
<td><label><?=$order_info->total_all?></label></td> <td><?=$order_info->total_all?></td>
<th class="bg-warning">应收</th> <th class="bg-warning">应收</th>
<td><label><?=$order_info->total_real?></label></td> <td><?=$order_info->total_real?></td>
<th class="bg-warning">&nbsp;</th> <th class="bg-warning">支付方式</th>
<td>&nbsp;</td> <td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="5"><label><?=$order_info->price_remark?></label></td> <td colspan="5"><?=$order_info->price_remark?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -186,23 +176,23 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">领款人</th> <th class="bg-warning">领款人</th>
<td><label><?=$order_info->money_man?></label></td> <td><?=$order_info->money_man?></td>
<th class="bg-warning">开户行</th> <th class="bg-warning">开户行</th>
<td><label><?=$order_info->money_bank?></label></td> <td><?=$order_info->money_bank?></td>
<th class="bg-warning">银行账号</th> <th class="bg-warning">银行账号</th>
<td><label><?=$order_info->money_no?></label></td> <td><?=$order_info->money_no?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">送单地址</th> <th class="bg-warning">送单地址</th>
<td colspan="5" class="form-inline"> <td colspan="5" class="form-inline">
<label><?=$order_info->sendCity->name?></label> <?=$order_info->sendCity->name?>
<label><?=$order_info->sendDistrict->name?></label> <?=$order_info->sendDistrict->name?>
<label><?=$order_info->send_address?></label> <?=$order_info->send_address?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="5"><label><?=$order_info->remark?></label></td> <td colspan="5"><?=$order_info->remark?></td>
</tr> </tr>
</table> </table>
<div> <div>
@ -212,6 +202,10 @@ use common\models\PriceT;
<button type="button" class="btn btn-primary btn-save" type="button"> <button type="button" class="btn btn-primary btn-save" type="button">
<strong>确认礼品</strong> <strong>确认礼品</strong>
</button> </button>
<?php } else if($my_id == 1) { ?>
<button type="button" class="btn btn-primary btn-gift" type="button">
<strong>取消确认礼品</strong>
</button>
<?php } ?> <?php } ?>
<button type="button" class="btn btn-primary btn-back" type="button"> <button type="button" class="btn btn-primary btn-back" type="button">
<strong>返 回</strong> <strong>返 回</strong>
@ -250,10 +244,14 @@ 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>';
<?php } else { ?> <?php } else { ?>
if(sub_item.selected == 1) if(sub_item.selected == 1) {
html += '<div class="col-sm-4">' + sub_item.name + '</div>'; html += '<div class="col-sm-4">' + sub_item.name;
html += '&nbsp;<a href="' + sub_item.gift_src + '" target="_blank" title="预览"> <i class="fa fa-image"></i> </a>';
html += '</div>';
}
<?php } ?> <?php } ?>
}); });
html += '</td>'; html += '</td>';
@ -264,7 +262,7 @@ 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');
$.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){
@ -289,10 +287,14 @@ 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>';
<?php } else { ?> <?php } else { ?>
if(sub_item.selected == 1) if(sub_item.selected == 1) {
html += '<div class="col-sm-4">' + sub_item.name + '</div>'; html += '<div class="col-sm-4">' + sub_item.name;
html += '&nbsp;<a href="' + sub_item.gift_src + '" target="_blank" title="预览"> <i class="fa fa-image"></i> </a>';
html += '</div>';
}
<?php } ?> <?php } ?>
}); });
html += '</td>'; html += '</td>';
@ -303,7 +305,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');
} }
@ -324,6 +326,25 @@ use common\models\PriceT;
}); });
getGifts(<?=$order_info->fanxian_id?>); getGifts(<?=$order_info->fanxian_id?>);
$('.btn-gift').click(function() {
parent.layer.confirm('是否取消礼品确认?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $('#orderFrm').serialize();
var waiting = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/insurer/gift-un-save',params,function(data) {
parent.layer.close(waiting);
parent.layer.msg(data.msg);
if(data.success)
window.location.reload();
}, 'json');
}, function(){
//
});
});
$('.btn-save').click(function () { $('.btn-save').click(function () {
parent.layer.confirm('注意:一旦确认礼品修改,则无法修改更换礼品??', { parent.layer.confirm('注意:一旦确认礼品修改,则无法修改更换礼品??', {
btn: ['确认','取消'], //按钮 btn: ['确认','取消'], //按钮
@ -334,9 +355,14 @@ use common\models\PriceT;
shade: false //不显示遮罩 shade: false //不显示遮罩
}, function(){ }, function(){
var params = $('#orderFrm').serialize(); var params = $('#orderFrm').serialize();
var waiting = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/insurer/gift-save',params,function(data) { $.post('/insurer/gift-save',params,function(data) {
parent.layer.close(waiting);
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
window.location.reload(); if(data.success)
window.location.reload();
}, 'json'); }, 'json');
}, function(){ }, function(){
// //

@ -21,74 +21,63 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">车牌号</th> <th class="bg-warning">车牌号</th>
<td><label><?=$order_info->car_no?></label></td> <td><?=$order_info->car_no?></td>
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><label><?=$car_info->register_date?></label></td> <td><?=$car_info->register_date?></td>
<th class="bg-warning" nowrap>座位数</th> <th class="bg-warning" nowrap>座位数</th>
<td><label><?=$order_info->seats?></label></td> <td><?=$order_info->seats?></td>
<th class="bg-warning" nowrap>电子邮件</th> <th class="bg-warning" nowrap>电子邮件</th>
<td><label><?=$order_info->email?></label></td> <td><?=$order_info->email?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车型</th> <th class="bg-warning">车型</th>
<td><label><?=$car_info->factory_model?></label></td> <td><?=$car_info->factory_model?></td>
<th class="bg-warning" nowrap>发动机号</th> <th class="bg-warning" nowrap>发动机号</th>
<td><label><?=$order_info->engine_no?></label></td> <td><?=$order_info->engine_no?></td>
<th class="bg-warning" nowrap>车架号</th> <th class="bg-warning" nowrap>车架号</th>
<td><label><?=$order_info->car_frame_no?></label></td> <td><?=$order_info->car_frame_no?></td>
<th class="bg-warning" nowrap>&nbsp;</th> <th class="bg-warning" nowrap>新车购置价</th>
<td>&nbsp;</td> <td><?=$order_info->purchase_price?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>
<td><label><?=$order_info->car_man?></label></td> <td><?=$order_info->car_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->car_man_type?></label> <td><?=$order_info->car_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->car_man_number?></label></td> <td><?=$order_info->car_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->car_man_phone?></label></td> <td><?=$order_info->car_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">被投保人</th> <th class="bg-warning">被投保人</th>
<td><label><?=$order_info->id_man?></label></td> <td><?=$order_info->id_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->id_man_type?></label> <td><?=$order_info->id_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->id_man_number?></label></td> <td><?=$order_info->id_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->id_man_phone?></label></td> <td><?=$order_info->id_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">投保人</th> <th class="bg-warning">投保人</th>
<td><label><?=$order_info->link_man?></label></td> <td><?=$order_info->link_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->link_man_type?></label> <td><?=$order_info->link_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->link_man_number?></label></td> <td><?=$order_info->link_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->link_man_phone?></label></td> <td><?=$order_info->link_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning" nowrap>商业起保日期</th> <th class="bg-warning" nowrap>商业起保日期</th>
<td> <td><?=$order_info->insurer1_begin_date?></td>
<label><?=$order_info->insurer1_begin_date?></label>
</td>
<th class="bg-warning" nowrap>交强起保日期</th> <th class="bg-warning" nowrap>交强起保日期</th>
<td> <td><?=$order_info->insurer2_begin_date?></td>
<label><?=$order_info->insurer2_begin_date?></label>
</td>
<th class="bg-warning">保险公司</th> <th class="bg-warning">保险公司</th>
<td> <td><?=$order_info->company2->name?></td>
<label><?=$order_info->company->name?></label>
</td>
<th class="bg-warning">车辆使用性质</th> <th class="bg-warning">车辆使用性质</th>
<td> <td><?=$order_info->car->carUse->name?></td>
<label><?=$order_info->car->carUse->name?></label>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -111,13 +100,13 @@ use common\models\PriceT;
$tmp_row = PriceT::find() $tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id) ->where('order_id='.$order_id.' and type_id='.$item->id)
->one(); ->one();
if($tmp_row->val == '') continue; if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
?> ?>
<th class="bg-warning"> <th class="bg-warning">
<?=$item->name?>(<?=$item->code?>) <?=$item->name?>(<?=$item->code?>)
</th> </th>
<td><label><?=$tmp_row->val?></label></td> <td><?=$tmp_row->val?></td>
<td><label><?=(!empty($tmp_row) && $tmp_row->is_nopay == 1)?'不计免赔':''?></label></td> <td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
<?php <?php
if(($index+1)%3==0) { if(($index+1)%3==0) {
echo '</tr>'; echo '</tr>';
@ -138,39 +127,39 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">商业总净保费</th> <th class="bg-warning">商业总净保费</th>
<td><label><?=$order_info->total1_clear?></label></td> <td><?=$order_info->total1_clear?></td>
<th class="bg-warning">商业含税总保费</th> <th class="bg-warning">商业含税总保费</th>
<td><label><?=$order_info->total1?></label></td> <td><?=$order_info->total1?></td>
<th class="bg-warning">车船税</th> <th class="bg-warning">车船税</th>
<td><label><?=$order_info->total3?></label></td> <td><?=$order_info->total3?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">交强总净保费</th> <th class="bg-warning">交强总净保费</th>
<td><label><?=$order_info->total2_clear?></label></td> <td><?=$order_info->total2_clear?></td>
<th class="bg-warning">交强含税总保费</th> <th class="bg-warning">交强含税总保费</th>
<td><label><?=$order_info->total2?></label></td> <td><?=$order_info->total2?></td>
<th class="bg-warning">业务自付金额</th> <th class="bg-warning">业务自付金额</th>
<td><label><?=$order_info->yuangong_money?></label></td> <td><?=$order_info->yuangong_money?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">折扣后商业净保费</th> <th class="bg-warning">折扣后商业净保费</th>
<td><label><?=$order_info->total1_real?></label></td> <td><?=$order_info->total1_real?></td>
<th class="bg-warning">减免金额</th> <th class="bg-warning">减免金额</th>
<td><label><?=$order_info->total1_dis?></label></td> <td><?=$order_info->total1_dis?></td>
<th class="bg-warning">商业折扣率</th> <th class="bg-warning">商业折扣率</th>
<td><label><?=$order_info->total1_percent?></label></td> <td><?=$order_info->total1_percent?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">共计签单</th> <th class="bg-warning">共计签单</th>
<td><label><?=$order_info->total_all?></label></td> <td><?=$order_info->total_all?></td>
<th class="bg-warning">应收</th> <th class="bg-warning">应收</th>
<td><label><?=$order_info->total_real?></label></td> <td><?=$order_info->total_real?></td>
<th class="bg-warning">&nbsp;</th> <th class="bg-warning">支付方式</th>
<td>&nbsp;</td> <td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="5"><label><?=$order_info->price_remark?></label></td> <td colspan="5"><?=$order_info->price_remark?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -183,26 +172,23 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">领款人</th> <th class="bg-warning">领款人</th>
<td><label><?=$order_info->money_man?></label></td> <td><?=$order_info->money_man?></td>
<th class="bg-warning">开户行</th> <th class="bg-warning">开户行</th>
<td><label><?=$order_info->money_bank?></label></td> <td><?=$order_info->money_bank?></td>
<th class="bg-warning">银行账号</th> <th class="bg-warning">银行账号</th>
<td><label><?=$order_info->money_no?></label></td> <td><?=$order_info->money_no?></td>
<th class="bg-warning" nowrap></th>
<td>
</td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">送单地址</th> <th class="bg-warning">送单地址</th>
<td colspan="7" class="form-inline"> <td colspan="5" class="form-inline">
<label><?=$order_info->sendCity->name?></label> <?=$order_info->sendCity->name?>
<label><?=$order_info->sendDistrict->name?></label> <?=$order_info->sendDistrict->name?>
<label><?=$order_info->send_address?></label> <?=$order_info->send_address?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="7"><label><?=$order_info->remark?></label></td> <td colspan="5"><?=$order_info->remark?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -225,7 +211,7 @@ use common\models\PriceT;
<select name="company_id" id="company_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_company2_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'"';
if($item->id == $order_info->company_id) if($item->id == $order_info->company_id)
echo ' selected '; echo ' selected ';
@ -293,7 +279,7 @@ use common\models\PriceT;
$.post('/insurer/office-mng-save',params,function(obj){ $.post('/insurer/office-mng-save',params,function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success && status_id>2) { if(obj.success && status_id>2) {
$('.btn-back') $('.btn-back').click();
} }
},'json'); },'json');
} }
@ -312,7 +298,7 @@ use common\models\PriceT;
},function(obj){ },function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); $('.btn-back').click();
} }
},'json'); },'json');
}); });

@ -16,19 +16,43 @@ 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"> <input type="hidden" name="type" id="type" value="0">
<label>车主</label> <div class="form-group" style="margin-bottom: 8px;">
<label for="car_man">车主</label>
<input type="text" name="car_man" id="car_man" class="form-control"> <input type="text" name="car_man" id="car_man" class="form-control">
<label>电话</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
<label>车牌</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control"> <input type="text" name="car_no" id="car_no" class="form-control">
<label>被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label>保险公司</label>
<select name="company2_id" id="company2_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($insurer_company_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $order_info->company2_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row mb-8">
<div class="btn-group" role="group">
<button class="btn btn-white btn-type" data-type="0" type="button">全部</button>
<button class="btn btn-white btn-type" data-type="1" type="button">待审核</button>
<button class="btn btn-white btn-type" data-type="2" type="button">已审核,待付款</button>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<table id="listTable"> <table id="listTable">
@ -78,6 +102,11 @@ 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/office-mng-json", url: "/insurer/office-mng-json",
@ -95,6 +124,12 @@ use \common\libs\MyLib;
$(function() { $(function() {
search(); search();
$('.btn-type').click(function() {
var type = $(this).data('type');
$('#type').val(type);
search();
});
}); });
</script> </script>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>

@ -21,74 +21,63 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">车牌号</th> <th class="bg-warning">车牌号</th>
<td><label><?=$order_info->car_no?></label></td> <td><?=$order_info->car_no?></td>
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><label><?=$car_info->register_date?></label></td> <td><?=$car_info->register_date?></td>
<th class="bg-warning" nowrap>座位数</th> <th class="bg-warning" nowrap>座位数</th>
<td><label><?=$order_info->seats?></label></td> <td><?=$order_info->seats?></td>
<th class="bg-warning" nowrap>电子邮件</th> <th class="bg-warning" nowrap>电子邮件</th>
<td><label><?=$order_info->email?></label></td> <td><?=$order_info->email?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车型</th> <th class="bg-warning">车型</th>
<td><label><?=$car_info->factory_model?></label></td> <td><?=$car_info->factory_model?></td>
<th class="bg-warning" nowrap>发动机号</th> <th class="bg-warning" nowrap>发动机号</th>
<td><label><?=$order_info->engine_no?></label></td> <td><?=$order_info->engine_no?></td>
<th class="bg-warning" nowrap>车架号</th> <th class="bg-warning" nowrap>车架号</th>
<td><label><?=$order_info->car_frame_no?></label></td> <td><?=$order_info->car_frame_no?></td>
<th class="bg-warning" nowrap>&nbsp;</th> <th class="bg-warning" nowrap>新车购置价</th>
<td>&nbsp;</td> <td><?=$order_info->purchase_price?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>
<td><label><?=$order_info->car_man?></label></td> <td><?=$order_info->car_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->car_man_type?></label> <td><?=$order_info->car_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->car_man_number?></label></td> <td><?=$order_info->car_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->car_man_phone?></label></td> <td><?=$order_info->car_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">被投保人</th> <th class="bg-warning">被投保人</th>
<td><label><?=$order_info->id_man?></label></td> <td><?=$order_info->id_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->id_man_type?></label> <td><?=$order_info->id_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->id_man_number?></label></td> <td><?=$order_info->id_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->id_man_phone?></label></td> <td><?=$order_info->id_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">投保人</th> <th class="bg-warning">投保人</th>
<td><label><?=$order_info->link_man?></label></td> <td><?=$order_info->link_man?></td>
<th class="bg-warning">证件类型</th> <th class="bg-warning">证件类型</th>
<td><label><?=$order_info->link_man_type?></label> <td><?=$order_info->link_man_type?></td>
</td>
<th class="bg-warning">证件号码</th> <th class="bg-warning">证件号码</th>
<td><label><?=$order_info->link_man_number?></label></td> <td><?=$order_info->link_man_number?></td>
<th class="bg-warning">联系电话</th> <th class="bg-warning">联系电话</th>
<td><label><?=$order_info->link_man_phone?></label></td> <td><?=$order_info->link_man_phone?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning" nowrap>商业起保日期</th> <th class="bg-warning" nowrap>商业起保日期</th>
<td> <td><?=$order_info->insurer1_begin_date?></td>
<label><?=$order_info->insurer1_begin_date?></label>
</td>
<th class="bg-warning" nowrap>交强起保日期</th> <th class="bg-warning" nowrap>交强起保日期</th>
<td> <td><?=$order_info->insurer2_begin_date?></td>
<label><?=$order_info->insurer2_begin_date?></label>
</td>
<th class="bg-warning">保险公司</th> <th class="bg-warning">保险公司</th>
<td> <td><?=$order_info->company2->name?></td>
<label><?=$order_info->company->name?></label>
</td>
<th class="bg-warning">车辆使用性质</th> <th class="bg-warning">车辆使用性质</th>
<td> <td><?=$order_info->car->carUse->name?></td>
<label><?=$order_info->car->carUse->name?></label>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -111,13 +100,13 @@ use common\models\PriceT;
$tmp_row = PriceT::find() $tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id) ->where('order_id='.$order_id.' and type_id='.$item->id)
->one(); ->one();
if($tmp_row->val == '') continue; if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
?> ?>
<th class="bg-warning"> <th class="bg-warning">
<?=$item->name?>(<?=$item->code?>) <?=$item->name?>(<?=$item->code?>)
</th> </th>
<td><label><?=$tmp_row->val?></label></td> <td><?=$tmp_row->val?></td>
<td><label><?=(!empty($tmp_row) && $tmp_row->is_nopay == 1)?'不计免赔':''?></label></td> <td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
<?php <?php
if(($index+1)%3==0) { if(($index+1)%3==0) {
echo '</tr>'; echo '</tr>';
@ -138,39 +127,39 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">商业总净保费</th> <th class="bg-warning">商业总净保费</th>
<td><label><?=$order_info->total1_clear?></label></td> <td><?=$order_info->total1_clear?></td>
<th class="bg-warning">商业含税总保费</th> <th class="bg-warning">商业含税总保费</th>
<td><label><?=$order_info->total1?></label></td> <td><?=$order_info->total1?></td>
<th class="bg-warning">车船税</th> <th class="bg-warning">车船税</th>
<td><label><?=$order_info->total3?></label></td> <td><?=$order_info->total3?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">交强总净保费</th> <th class="bg-warning">交强总净保费</th>
<td><label><?=$order_info->total2_clear?></label></td> <td><?=$order_info->total2_clear?></td>
<th class="bg-warning">交强含税总保费</th> <th class="bg-warning">交强含税总保费</th>
<td><label><?=$order_info->total2?></label></td> <td><?=$order_info->total2?></td>
<th class="bg-warning">业务自付金额</th> <th class="bg-warning">业务自付金额</th>
<td><label><?=$order_info->yuangong_money?></label></td> <td><?=$order_info->yuangong_money?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">折扣后商业净保费</th> <th class="bg-warning">折扣后商业净保费</th>
<td><label><?=$order_info->total1_real?></label></td> <td><?=$order_info->total1_real?></td>
<th class="bg-warning">减免金额</th> <th class="bg-warning">减免金额</th>
<td><label><?=$order_info->total1_dis?></label></td> <td><?=$order_info->total1_dis?></td>
<th class="bg-warning">商业折扣率</th> <th class="bg-warning">商业折扣率</th>
<td><label><?=$order_info->total1_percent?></label></td> <td><?=$order_info->total1_percent?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">共计签单</th> <th class="bg-warning">共计签单</th>
<td><label><?=$order_info->total_all?></label></td> <td><?=$order_info->total_all?></td>
<th class="bg-warning">应收</th> <th class="bg-warning">应收</th>
<td><label><?=$order_info->total_real?></label></td> <td><?=$order_info->total_real?></td>
<th class="bg-warning">&nbsp;</th> <th class="bg-warning">支付方式</th>
<td>&nbsp;</td> <td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="5"><label><?=$order_info->price_remark?></label></td> <td colspan="5"><?=$order_info->price_remark?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -183,26 +172,23 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">领款人</th> <th class="bg-warning">领款人</th>
<td><label><?=$order_info->money_man?></label></td> <td><?=$order_info->money_man?></td>
<th class="bg-warning">开户行</th> <th class="bg-warning">开户行</th>
<td><label><?=$order_info->money_bank?></label></td> <td><?=$order_info->money_bank?></td>
<th class="bg-warning">银行账号</th> <th class="bg-warning">银行账号</th>
<td><label><?=$order_info->money_no?></label></td> <td><?=$order_info->money_no?></td>
<th class="bg-warning" nowrap></th>
<td>
</td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">送单地址</th> <th class="bg-warning">送单地址</th>
<td colspan="7" class="form-inline"> <td colspan="5" class="form-inline">
<label><?=$order_info->sendCity->name?></label> <?=$order_info->sendCity->name?>
<label><?=$order_info->sendDistrict->name?></label> <?=$order_info->sendDistrict->name?>
<label><?=$order_info->send_address?></label> <?=$order_info->send_address?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">备注</th> <th class="bg-warning">备注</th>
<td colspan="7"><label><?=$order_info->remark?></label></td> <td colspan="5"><?=$order_info->remark?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -215,16 +201,15 @@ use common\models\PriceT;
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th class="bg-warning">商业手续费</th> <th class="bg-warning">商业手续费</th>
<td><label><?=$order_info->total1_rate?></label></td> <td><?=$order_info->total1_rate?>%</td>
<th class="bg-warning">交强手续费</th> <th class="bg-warning">交强手续费</th>
<td><label><?=$order_info->total2_rate?></label></td> <td><?=$order_info->total2_rate?>%</td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">内勤保险公司</th> <th class="bg-warning">内勤保险公司</th>
<td><label><?=$order_info->company->name?></label> <td><?=$order_info->company->name?></td>
</td>
<th class="bg-warning">缴费单号</th> <th class="bg-warning">缴费单号</th>
<td><label><?=$order_info->pay_no?></label></td> <td><?=$order_info->pay_no?></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -398,7 +383,7 @@ use common\models\PriceT;
$.post('/insurer/original-mng-save',params,function(obj){ $.post('/insurer/original-mng-save',params,function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success && status_id>5) { if(obj.success && status_id>5) {
$('.btn-back') $('.btn-back').click();
} }
},'json'); },'json');
} }
@ -417,7 +402,7 @@ use common\models\PriceT;
},function(obj){ },function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); $('.btn-back').click();
} }
},'json'); },'json');
}); });
@ -431,7 +416,6 @@ use common\models\PriceT;
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('.btn-back').click(); $('.btn-back').click();
} else {
} }
},'json'); },'json');
}, function(){ }, function(){

@ -16,18 +16,31 @@ 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"> <div class="form-group" style="margin-bottom: 8px;">
<label>车主</label> <label for="id_man">被保险人</label>
<input type="text" name="car_man" id="car_man" class="form-control"> <input type="text" name="id_man" id="id_man" class="form-control">
<label>电话</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
<label>车牌</label> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control"> <input type="text" name="car_no" id="car_no" class="form-control">
<label>被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="pay_type_id">支付方式</label>
<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.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@ -77,6 +90,11 @@ 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/original-mng-json", url: "/insurer/original-mng-json",

@ -9,16 +9,16 @@ use \common\libs\MyLib;
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm"> <form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>"> <input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group"> <div class="form-group">
<label class="col-md-1 control-label">菜单名称</label> <label class="col-sm-1 control-label">菜单名称</label>
<div class="col-md-3"> <div class="col-sm-3">
<input type="text" name="name" value="<?=$info->name?>" class="form-control"> <input type="text" name="name" value="<?=$info->name?>" class="form-control">
</div> </div>
<label class="col-md-1 control-label">上级菜单</label> <label class="col-sm-1 control-label">上级菜单</label>
<div class="col-md-3"> <div class="col-sm-3">
<select name="parent_id" class="form-control"> <select name="parent_id" class="form-control">
<option value="0"></option> <option value="0"></option>
<?php <?php
@ -33,24 +33,24 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-1 control-label">图标</label> <label class="col-sm-1 control-label">图标</label>
<div class="col-md-3"> <div class="col-sm-3">
<input type="text" name="icon" value="<?=$info->icon?>" class="form-control"> <input type="text" name="icon" value="<?=$info->icon?>" class="form-control">
</div> </div>
<label class="col-md-1 control-label">路径</label> <label class="col-sm-1 control-label">路径</label>
<div class="col-md-3"> <div class="col-sm-3">
<input type="text" name="path" value="<?=$info->path?>" class="form-control"> <input type="text" name="path" value="<?=$info->path?>" class="form-control">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-1 control-label">排序</label> <label class="col-sm-1 control-label">排序</label>
<div class="col-md-3"> <div class="col-sm-3">
<input type="text" name="order_id" value="<?=$info->order_id?>" class="form-control"> <input type="text" name="order_id" value="<?=$info->order_id?>" class="form-control">
</div> </div>
</div> </div>
<div> <div>
<div class="row"> <div class="row">
<div class="col-md-5 col-md-offset-5"> <div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button"> <button class="btn btn-primary btn-save" type="button">
<strong><?=$info ? '保 存':'添 加'?></strong> <strong><?=$info ? '保 存':'添 加'?></strong>
</button> </button>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save