Merge branch 'dev' into webUi

# Conflicts:
#	frontend/views/appointment/all.php
#	frontend/views/appointment/first.php
#	frontend/views/appointment/today.php
#	frontend/views/car/search.php
#	frontend/views/database/a-index.php
#	frontend/views/database/b-index.php
#	frontend/views/database/c-index.php
#	frontend/views/database/d-index.php
#	frontend/views/database/invalid-index.php
#	frontend/views/finance/budian-list.php
#	frontend/views/finance/chuna-gongzi-list.php
#	frontend/views/finance/gongzi-all-list.php
#	frontend/views/finance/pay2-list.php
#	frontend/views/finance/receipt.php
#	frontend/views/finance/receipt2.php
#	frontend/views/finance/ticheng-jisuan.php
#	frontend/views/fix-car/my-list-finish.php
#	frontend/views/fix-car/my-list.php
#	frontend/views/fix-car/step1-list.php
#	frontend/views/gift/gift-tj.php
#	frontend/views/gift/gift-use.php
#	frontend/views/gift/index.php
#	frontend/views/gift/ticket-tj.php
#	frontend/views/insurer/finance-mng.php
#	frontend/views/insurer/my-list.php
#	frontend/views/insurer/my-return-list.php
#	frontend/views/insurer/office-mng.php
#	frontend/views/insurer/original-mng.php
#	frontend/views/insurer/search.php
#	frontend/views/personnel/pay-list.php
#	frontend/views/phone-center/call-records.php
#	frontend/views/phone-center/usercall-index.php
#	frontend/views/renewal/all.php
#	frontend/views/renewal/first.php
#	frontend/views/renewal/today.php
webUi
zhaocheng 5 years ago
commit 100894af44
  1. 2
      common/config/main.php
  2. 2
      common/libs/MyLib.php
  3. 5
      common/models/CaiwuT.php
  4. 6
      common/models/CarT.php
  5. 2
      common/models/GiftT.php
  6. 63
      common/models/GiftUseLogT.php
  7. 1
      common/models/SysIpT.php
  8. 3
      composer.json
  9. 25
      composer.lock
  10. 10
      frontend/config/params.php
  11. 8
      frontend/controllers/AppointmentController.php
  12. 368
      frontend/controllers/CarController.php
  13. 5
      frontend/controllers/CommonController.php
  14. 147
      frontend/controllers/DatabaseController.php
  15. 448
      frontend/controllers/FinanceController.php
  16. 3
      frontend/controllers/FixCarController.php
  17. 26
      frontend/controllers/GiftController.php
  18. 272
      frontend/controllers/InsurerController.php
  19. 75
      frontend/controllers/MarketingStrategyController.php
  20. 146
      frontend/controllers/PhoneCenterController.php
  21. 26
      frontend/controllers/PhoneController.php
  22. 8
      frontend/controllers/RenewalController.php
  23. 355
      frontend/controllers/StatisticsController.php
  24. 63
      frontend/controllers/SystemController.php
  25. 10
      frontend/views/appointment/all.php
  26. 10
      frontend/views/appointment/first.php
  27. 10
      frontend/views/appointment/today.php
  28. 8
      frontend/views/bank/edit.php
  29. 2
      frontend/views/bank/index.php
  30. 8
      frontend/views/car-type/edit.php
  31. 2
      frontend/views/car-type/index.php
  32. 2
      frontend/views/car-use/index.php
  33. 4
      frontend/views/car/edit.php
  34. 68
      frontend/views/car/info-track-edit.php
  35. 68
      frontend/views/car/info-track-info.php
  36. 2
      frontend/views/car/info-track.php
  37. 10
      frontend/views/car/info.php
  38. 208
      frontend/views/car/order-add.php
  39. 2
      frontend/views/car/search.php
  40. 8
      frontend/views/city/edit.php
  41. 2
      frontend/views/city/index.php
  42. 16
      frontend/views/common/call-phone.php
  43. 3
      frontend/views/common/index.php
  44. 75
      frontend/views/common/left.php
  45. 100
      frontend/views/common/top.php
  46. 24
      frontend/views/common/update-pwd.php
  47. 36
      frontend/views/database/a-index.php
  48. 233
      frontend/views/database/ad-clean-index.php
  49. 4
      frontend/views/database/b-index.php
  50. 4
      frontend/views/database/c-index.php
  51. 2
      frontend/views/database/d-index.php
  52. 94
      frontend/views/database/invalid-index-search.php
  53. 4
      frontend/views/database/invalid-index.php
  54. 16
      frontend/views/district/edit.php
  55. 2
      frontend/views/district/index.php
  56. 16
      frontend/views/finance/budian-list.php
  57. 4
      frontend/views/finance/car-update-frame.php
  58. 6
      frontend/views/finance/chuna-gongzi-info.php
  59. 14
      frontend/views/finance/chuna-gongzi-list.php
  60. 8
      frontend/views/finance/gongzi-all-info.php
  61. 14
      frontend/views/finance/gongzi-all-list.php
  62. 10
      frontend/views/finance/pay2-info.php
  63. 14
      frontend/views/finance/pay2-list.php
  64. 12
      frontend/views/finance/receipt-info.php
  65. 445
      frontend/views/finance/receipt-lirun.php
  66. 18
      frontend/views/finance/receipt.php
  67. 16
      frontend/views/finance/ticheng-jisuan.php
  68. 2
      frontend/views/fix-car/add-item.php
  69. 10
      frontend/views/fix-car/ajax-item-list.php
  70. 110
      frontend/views/fix-car/my-list-edit.php
  71. 2
      frontend/views/fix-car/my-search-result.php
  72. 2
      frontend/views/fix-car/my-search.php
  73. 2
      frontend/views/fix-car/step1-list-finish.php
  74. 2
      frontend/views/fix-car/step2-list.php
  75. 2
      frontend/views/fix-car/step3-list.php
  76. 2
      frontend/views/fix-car/step4-list.php
  77. 170
      frontend/views/gift/gift-out.php
  78. 50
      frontend/views/gift/gift-tj.php
  79. 127
      frontend/views/gift/gift-use-edit.php
  80. 2
      frontend/views/gift/index.php
  81. 400
      frontend/views/gift/mng-list-info.php
  82. 74
      frontend/views/gift/mng-list.php
  83. 65
      frontend/views/gift/stastics.php
  84. 54
      frontend/views/gift/ticket-tj.php
  85. 142
      frontend/views/gift/ticket-use-edit.php
  86. 169
      frontend/views/gift/ticket-use.php
  87. 24
      frontend/views/group/edit.php
  88. 2
      frontend/views/group/index.php
  89. 65
      frontend/views/group/permission.php
  90. 2
      frontend/views/insurer-company/edit.php
  91. 2
      frontend/views/insurer-company/index.php
  92. 8
      frontend/views/insurer-company2/edit.php
  93. 2
      frontend/views/insurer-company2/index.php
  94. 20
      frontend/views/insurer-type/edit.php
  95. 16
      frontend/views/insurer-type/index.php
  96. 26
      frontend/views/insurer/finance-mng.php
  97. 864
      frontend/views/insurer/info.php
  98. 47
      frontend/views/insurer/my-list-info.php
  99. 16
      frontend/views/insurer/my-list.php
  100. 12
      frontend/views/insurer/my-return-list.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -6,5 +6,5 @@ return [
'class' => 'yii\caching\FileCache', 'class' => 'yii\caching\FileCache',
], ],
], ],
'timeZone' => 'Asia/Chongqing', 'timeZone' => 'Asia/Shanghai',
]; ];

@ -214,7 +214,7 @@ class MyLib {
} }
} }
static public function zhifufs($cx){ static public function zhifufs($cx){
$cn = '未知';
if($cx==1) { if($cx==1) {
$cn='上门收费'; $cn='上门收费';
}elseif($cx==2){ }elseif($cx==2){

@ -125,4 +125,9 @@ class CaiwuT extends \common\models\Base
{ {
return $this->hasOne(OrderCaiwuT::className(),['order_id'=>'order_id']); return $this->hasOne(OrderCaiwuT::className(),['order_id'=>'order_id']);
} }
public function getPayOrderUser()
{
return $this->hasMany(PayOrderUserT::className(),['order_id'=>'order_id']);
}
} }

@ -175,11 +175,7 @@ class CarT extends \common\models\Base
switch($this->location) { switch($this->location) {
case 1: case 1:
$car=CarT::findOne(['id'=>$this->id]); $car=CarT::findOne(['id'=>$this->id]);
if($car->qiyong==2){ $name = 'A库';
$name = 'A库(永不启用)';
}else{
$name = 'A库';
}
break; break;
case 2: case 2:
$carb=CarBT::findOne(['id'=>$this->id]); $carb=CarBT::findOne(['id'=>$this->id]);

@ -62,7 +62,7 @@ class GiftT extends \common\models\Base
public function getShowType() public function getShowType()
{ {
if($this->type_id == 1) return '实礼品'; if($this->type_id == 1) return '实礼品';
if($this->type_id == 2) return '礼券'; if($this->type_id == 2) return '礼券';
return ''; return '';
} }

@ -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',
];
}
}

@ -57,7 +57,6 @@ class SysIpT extends \common\models\Base
static public function getIpArray(){ static public function getIpArray(){
$list = self::find() $list = self::find()
->where('status = 1')
->orderBy('id ASC') ->orderBy('id ASC')
->all(); ->all();

@ -21,7 +21,8 @@
"phpoffice/phpspreadsheet": "^1.9", "phpoffice/phpspreadsheet": "^1.9",
"codeception/codeception": "^3.1", "codeception/codeception": "^3.1",
"yiisoft/yii2-imagine": "^2.2", "yiisoft/yii2-imagine": "^2.2",
"phpoffice/phpexcel": "^1.8" "phpoffice/phpexcel": "^1.8",
"guzzlehttp/guzzle": "^6.4"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "*", "yiisoft/yii2-debug": "*",

25
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4e10a054c08f42ba7431449d509147d7", "content-hash": "f5d698a9c66d02defab335c7095a8982",
"packages": [ "packages": [
{ {
"name": "behat/gherkin", "name": "behat/gherkin",
@ -845,16 +845,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "6.3.3", "version": "6.4.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" "reference": "0895c932405407fd3a7368b6910c09a24d26db11"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "reference": "0895c932405407fd3a7368b6910c09a24d26db11",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -864,14 +864,15 @@
] ]
}, },
"require": { "require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.0", "guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4", "guzzlehttp/psr7": "^1.6.1",
"php": ">=5.5" "php": ">=5.5"
}, },
"require-dev": { "require-dev": {
"ext-curl": "*", "ext-curl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0" "psr/log": "^1.1"
}, },
"suggest": { "suggest": {
"psr/log": "Required for using the Log middleware" "psr/log": "Required for using the Log middleware"
@ -883,12 +884,12 @@
} }
}, },
"autoload": { "autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": { "psr-4": {
"GuzzleHttp\\": "src/" "GuzzleHttp\\": "src/"
} },
"files": [
"src/functions_include.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@ -912,7 +913,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2018-04-22T15:46:56+00:00" "time": "2019-10-23T15:58:00+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",

@ -1,4 +1,14 @@
<?php <?php
return [ return [
'adminEmail' => 'admin@example.com', 'adminEmail' => 'admin@example.com',
'userPanel' => [
'token' => 'ff7dc73536475c11981a1c52531f2ff7',
'phone_url' => 'http://user.banmacar.com/api/phone/op',
'sms_url' => 'http://user.banmacar.com/api/sms/single-send',
'myinfo_url' => 'http://user.banmacar.com/api/user/myinfo',
'search_car_url' => 'http://user.banmacar.com/api/car/search-car',
'car_info_url' => 'http://user.banmacar.com/api/car/car-info',
'post-precise-price' => 'http://user.banmacar.com/api/car/post-precise-price',
'get-precise-price' => 'http://user.banmacar.com/api/car/get-precise-price',
],
]; ];

@ -328,11 +328,9 @@ class AppointmentController extends BaseController
$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');
$page = $request->get('page',1);
$username = $request->get('username'); $username = $request->get('username');
$sort_key = $request->get('sort_key','appointment_t.pdate'); $sort_key = $request->get('sort_key','appointment_t.pdate');
$sort_value = $request->get('sort_value','ASC'); $sort_value = $request->get('sort_value','ASC');
$user_id = $request->get('user_id');
$offset = $request->get('offset',0); $offset = $request->get('offset',0);
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
@ -349,7 +347,7 @@ class AppointmentController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"'); $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"'); $query->andWhere('car_t.car_man_phone like "'.$phone.'"');
} }
if($car_no != '') { if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"'); $query->andWhere('car_t.car_no like "'.$car_no.'"');
@ -430,7 +428,7 @@ class AppointmentController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); $query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"'); $query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
} }
if($ptype > 0) { if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype); $query = $query->andWhere('appointment_t.ptype='.$ptype);
@ -507,7 +505,7 @@ class AppointmentController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); $query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"'); $query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
} }
if($ptype > 0) { if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype); $query = $query->andWhere('appointment_t.ptype='.$ptype);

@ -63,9 +63,11 @@ use common\models\OrderAddress;
use common\models\InvalidNew; use common\models\InvalidNew;
use common\models\InvalidRenewal; use common\models\InvalidRenewal;
use common\models\ZhongjiGiftT; use common\models\ZhongjiGiftT;
use GuzzleHttp\Client;
use Yii; use Yii;
use yii\data\Pagination; use yii\data\Pagination;
use yii\db\Exception; use yii\db\Exception;
use yii\web\Request;
use yii\web\Response; use yii\web\Response;
class CarController extends BaseController class CarController extends BaseController
@ -496,6 +498,313 @@ class CarController extends BaseController
return $result; return $result;
} }
public function actionBihuSearch()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('id',0);
$car_info = CarT::findOne(['id'=>$id]);
if($car_info) {
$url = Yii::$app->params['userPanel']['search_car_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'LicenseNo' => $car_info->car_no,
'EngineNo' => $car_info->engine_no,
'CarVin' => $car_info->car_frame_no,
'RegisterDate' => $car_info->register_date,
];
if($car_info->car_man_number != '' && substr($car_info->car_man_number, -6) != '') {
$params['SixDigitsAfterIdCard'] = substr($car_info->car_man_number, -6);
}
$client = new Client(['timeout'=> 120]);
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
return MyLib::ok3($obj);
}
return MyLib::error3($res->getBody());
}
return MyLib::error3('车辆信息不存在');
}
public function actionBihuCarinfo()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('id',0);
$car_info = CarT::findOne(['id'=>$id]);
if($car_info) {
$url = Yii::$app->params['userPanel']['car_info_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'LicenseNo' => $car_info->car_no,
'EngineNo' => $car_info->engine_no,
'CarVin' => $car_info->car_frame_no,
];
$client = new Client(['timeout'=> 120]);
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 200) {
if($obj->data && $obj->data->UserInfo && $obj->data->UserInfo->CarUsedType != '') {
$car_user_info = CarUseT::find()->where(['name'=>$obj->data->UserInfo->CarUsedType])->one();
if($car_user_info) {
$obj->data->UserInfo->CarUsedType = $car_user_info->id;
}
}
return MyLib::ok3($obj->data);
} else {
return MyLib::error3($obj->msg);
}
}
return MyLib::error3($res->getBody());
}
return MyLib::error3('车辆信息不存在');
}
public function actionPostPrecisePrice()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$url = Yii::$app->params['userPanel']['post-precise-price'];
$token = Yii::$app->params['userPanel']['token'];
$types = $request->post('types');
$nopays = $request->post('nopays');
$params = [
'token' => $token,
'LicenseNo' => $request->post('car_no'),
'CarOwnersName' => $request->post('car_man'),
'IdCard' => strtoupper($request->post('car_man_number')),
'OwnerIdCardType' => $request->post('car_man_type'), //
'QuoteGroup' => $request->post('company_id'), //
'InsuredName' => $request->post('id_man'),
'InsuredIdCard' => strtoupper($request->post('id_man_number')),
'InsuredIdType' => $request->post('id_man_type'), //
'HolderIdCard' => strtoupper($request->post('link_man_number')),
'HolderName' => $request->post('link_man'),
'HolderIdType' => $request->post('link_man_type'), //
'CarUsedType' => $request->post('car_use_id'),
'EngineNo' => strtoupper($request->post('engine_no')),
'CarVin' => strtoupper($request->post('car_frame_no')),
'RegisterDate' => $request->post('register_date'),
'MoldName' => $request->post('factory_model'),
'ForceTax' => 1,
'BizTimeStamp' => $request->post('insurer1_begin_date'),
'ForceTimeStamp' => $request->post('insurer2_begin_date'),
'BoLi' => 0,
'BuJiMianCheSun' => isset($nopays[1])?1:0,
'BuJiMianDaoQiang' => isset($nopays[3])?1:0,
'BuJiMianSanZhe' => isset($nopays[2])?1:0,
'BuJiMianChengKe' => isset($nopays[5])?1:0,
'BuJiMianSiJi' => isset($nopays[4])?1:0,
'BuJiMianHuaHen' => isset($nopays[7])?1:0,
'BuJiMianSheShui' => isset($nopays[8])?1:0,
'BuJiMianZiRan' => isset($nopays[9])?1:0,
'SheShui' => $types[8]=='是'?1:0,
'HuaHen' => $types[7],
'SiJi' => $types[4],
'ChengKe' => $types[5],
'CheSun' => floatval($types[1]),
'DaoQiang' => $types[3]=='是'?1:0,
'SanZhe' => $types[2],
'ZiRan' => $types[9]=='是'?1:0,
'SeatCount' => $request->post('seats'),
'HcSanFangTeYue' => $types[12]=='是'?1:0,
'PurchasePrice' => $request->post('purchase_price'),
'AutoMoldCode' => $request->post('auto_mold_code'),
'VehicleYear' => $request->post('vehicle_year'),
'AutoMoldCodeSource' => 3,
];
if($params['QuoteGroup'] == 0) {
return MyLib::error3('请选择保险公司');
}
if($params['CarUsedType'] == 0) {
return MyLib::error3('请选择车辆使用性质');
}
if($params['OwnerIdCardType'] == '身份证') $params['OwnerIdCardType'] = 1;
else $params['OwnerIdCardType'] = 9;
if($params['InsuredIdType'] == '身份证') $params['InsuredIdType'] = 1;
else $params['InsuredIdType'] = 9;
if($params['HolderIdType'] == '身份证') $params['HolderIdType'] = 1;
else $params['HolderIdType'] = 9;
$min_chesun = floatval($request->post('min_chesun'));
$max_chesun = floatval($request->post('max_chesun'));
if($params['CheSun'] > 0 && $min_chesun > 0 && $max_chesun > 0 && ($params['CheSun'] < $min_chesun || $params['CheSun'] > $max_chesun)) {
return MyLib::error3('车损只能填写:'.$min_chesun.' ~ '.$max_chesun.' 之间的值');
}
if($params['CheSun'] > 0 && $types[10] == '是' && $types[11] == '是') {
$params['ForceTax'] = 1;
}
if($params['CheSun'] == 0 && $types[10] == '是' && $types[11] == '是') {
$params['ForceTax'] = 2;
}
if($params['CheSun'] > 0 && $types[10] == '否' && $types[11] == '否') {
$params['ForceTax'] = 0;
}
if($types[6] == '国产') {
$params['BoLi'] = 1;
}
if($types[6] == '进口') {
$params['BoLi'] = 2;
}
switch($types[7]) {
case '2000元':
$params['HuaHen'] = 2000;
break;
case '5000元':
$params['HuaHen'] = 5000;
break;
case '10000元':
$params['HuaHen'] = 10000;
break;
case '20000元':
$params['HuaHen'] = 20000;
break;
default:
$params['HuaHen'] = 0;
}
switch($types[4]) {
case '1万':
$params['SiJi'] = 10000;
break;
case '2万':
$params['SiJi'] = 20000;
break;
case '3万':
$params['SiJi'] = 30000;
break;
case '4万':
$params['SiJi'] = 40000;
break;
case '5万':
$params['SiJi'] = 50000;
break;
case '10万':
$params['SiJi'] = 100000;
break;
default:
$params['SiJi'] = 0;
}
switch($types[5]) {
case '1万':
$params['ChengKe'] = 10000;
break;
case '2万':
$params['ChengKe'] = 20000;
break;
case '3万':
$params['ChengKe'] = 30000;
break;
case '4万':
$params['ChengKe'] = 40000;
break;
case '5万':
$params['ChengKe'] = 50000;
break;
case '10万':
$params['ChengKe'] = 100000;
break;
default:
$params['ChengKe'] = 0;
}
switch($types[2]) {
case '5万':
$params['SanZhe'] = 50000;
break;
case '10万':
$params['SanZhe'] = 100000;
break;
case '15万':
$params['SanZhe'] = 150000;
break;
case '20万':
$params['SanZhe'] = 200000;
break;
case '30万':
$params['SanZhe'] = 300000;
break;
case '50万':
$params['SanZhe'] = 500000;
break;
case '100万':
$params['SanZhe'] = 1000000;
break;
case '150万':
$params['SanZhe'] = 1500000;
break;
case '200万':
$params['SanZhe'] = 2000000;
break;
default:
$params['SanZhe'] = 0;
}
$client = new Client(['timeout'=> 120]);
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 200) {
if($obj->data && $obj->data->UserInfo && $obj->data->UserInfo->CarUsedType != '') {
$car_user_info = CarUseT::find()->where(['name'=>$obj->data->UserInfo->CarUsedType])->one();
if($car_user_info) {
$obj->data->UserInfo->CarUsedType = $car_user_info->id;
}
}
return MyLib::ok3($obj->data);
} else {
return MyLib::error3($obj->msg);
}
}
return MyLib::error3($res->getBody());
}
public function actionGetPrecisePrice()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$url = Yii::$app->params['userPanel']['get-precise-price'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'LicenseNo' => $request->post('car_no'),
'QuoteGroup' => $request->post('company_id'),
];
$client = new Client(['timeout'=> 120]);
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
// echo $url;
// var_dump($params);
// echo $res->getBody();
// exit;
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 200) {
if($obj->data && $obj->data->UserInfo && $obj->data->UserInfo->CarUsedType != '') {
$car_user_info = CarUseT::find()->where(['name'=>$obj->data->UserInfo->CarUsedType])->one();
if($car_user_info) {
$obj->data->UserInfo->CarUsedType = $car_user_info->id;
}
}
return MyLib::ok3($obj->data);
} else {
return MyLib::error3($obj->msg);
}
}
return MyLib::error3($res->getBody());
}
public function actionInfo() public function actionInfo()
{ {
@ -503,6 +812,7 @@ class CarController extends BaseController
$id = $request->get('id',0); $id = $request->get('id',0);
$car_info = CarT::findOne(['id'=>$id]); $car_info = CarT::findOne(['id'=>$id]);
$order_info = $car_info->getOrders()->orderBy('id DESC')->one(); $order_info = $car_info->getOrders()->orderBy('id DESC')->one();
if(!$order_info) { if(!$order_info) {
$user_id = 0; $user_id = 0;
@ -531,35 +841,6 @@ class CarController extends BaseController
$order_info->link_phone = $car_info->phone; $order_info->link_phone = $car_info->phone;
$order_info->save(); $order_info->save();
} }
$insurer_type_items = InsurerTypeT::find()->all();
$insurer_company_items = InsurerCompanyT::find()->all();
$insurer_company2_items = InsurerCompany2T::find()->all();
$pay_type_items = PayTypeT::find()->all();
$car_use_items = CarUseT::find()->all();
$direction_items = DirectionT::find()
->all();
$range_items = RangeT::find()
->all();
$city_items = CityT::find()
->all();
$district_items = DistrictT::find()
->orderBy('order_id ASC')
->all();
$gift_items = GiftT::find()
->where('type_id=1')
->all();
$success_items = InvalidT::getTree(1);
$failure_items = InvalidT::getTreeXinbaoNew(2);
$list = MeetT::getAllData(1);
$order_ad=OrderAddress::findOne(['id'=>$order_info->addr_id]);
$province = Region::find()->asArray()->where(['parent_id'=>0])->andWhere(['level'=>1])->all();
$c=[];
$d=[];
$e=[];
$linkMan_items = $car_info->getLinkmen() $linkMan_items = $car_info->getLinkmen()
->orderBy('created_at desc') ->orderBy('created_at desc')
->all(); ->all();
@ -568,25 +849,7 @@ class CarController extends BaseController
'user_id' => $this->my->id, 'user_id' => $this->my->id,
'car_info' => $car_info, 'car_info' => $car_info,
'link_men' => $linkMan_items, 'link_men' => $linkMan_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,
'list' => $list,
'pay_type_items' => $pay_type_items,
'car_use_items' => $car_use_items,
'direction_items' => $direction_items,
'range_items' => $range_items,
'city_items' => $city_items,
'district_items' => $district_items,
'gift_items' => $gift_items,
'success_items' => $success_items,
'failure_items' => $failure_items,
'province' => $province,
'city' =>$c,
'district' =>$d,
'twon' =>isset($e)?$e:[],
'order_ad' =>isset($order_ad)?$order_ad:[]
]); ]);
} }
/* /*
@ -1879,15 +2142,8 @@ class CarController extends BaseController
$order_info->link_man_number = $link_man_number; $order_info->link_man_number = $link_man_number;
$order_info->company_id = $company_id; $order_info->company_id = $company_id;
if($order_info->status_id != $status_id) { $order_info->status_id = $status_id;
if($order_info->return_status_id > 0) { $order_info->return_status_id = 0;
$order_info->status_id = $order_info->return_status_id;
$order_info->return_status_id = 0;
} else {
$order_info->status_id = $status_id;
$order_info->return_status_id = 0;
}
}
$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;

@ -385,6 +385,9 @@ class CommonController extends \yii\web\Controller
} }
public function actionCallPhone() { public function actionCallPhone() {
return $this->render('call-phone'); $user_info = $this->my;
return $this->render('call-phone',[
'user_info' => $user_info
]);
} }
} }

@ -207,7 +207,7 @@ class DatabaseController extends BaseController
} }
if($has_phone == 1) { if($has_phone == 1) {
$query->andWhere('phone<>""'); $query->andWhere('car_man_phone<>""');
} }
if($no_insurerdate == 1) { if($no_insurerdate == 1) {
$query->andWhere('insurer1_date="" or insurer1_date is null or insurer1_date="0000-00-00"'); $query->andWhere('insurer1_date="" or insurer1_date is null or insurer1_date="0000-00-00"');
@ -285,7 +285,7 @@ class DatabaseController extends BaseController
$car_info = CarT::findOne(['id'=>$id]); $car_info = CarT::findOne(['id'=>$id]);
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 2; $car_info->location = 2;
$car_info->xubao_num = 0; $car_info->is_xubao = 0;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }
@ -298,6 +298,12 @@ class DatabaseController extends BaseController
if(!$b_info->save(false)) { if(!$b_info->save(false)) {
throw new Exception(print_r($b_info->getFirstErrors(),true)); throw new Exception(print_r($b_info->getFirstErrors(),true));
} }
} else {
$b_info->user_id = 0;
if(!$b_info->save(false)) {
throw new Exception(print_r($b_info->getFirstErrors(),true));
}
$this->addLog($car_info->id,'从B库回收成未分配状态',1);
} }
$this->addLog($car_info->id,'从A库分配到B库',1); $this->addLog($car_info->id,'从A库分配到B库',1);
} }
@ -333,7 +339,7 @@ class DatabaseController extends BaseController
foreach($query->each(1000) as $car_info) { foreach($query->each(1000) as $car_info) {
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 2; $car_info->location = 2;
$car_info->xubao_num = 0; $car_info->is_xubao = 0;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }
@ -346,6 +352,12 @@ class DatabaseController extends BaseController
if(!$b_info->save(false)) { if(!$b_info->save(false)) {
throw new Exception(print_r($b_info->getFirstErrors(),true)); throw new Exception(print_r($b_info->getFirstErrors(),true));
} }
} else {
$b_info->user_id = 0;
if(!$b_info->save(false)) {
throw new Exception(print_r($b_info->getFirstErrors(),true));
}
$this->addLog($car_info->id,'从B库回收成未分配状态',1);
} }
$this->addLog($car_info->id,'从A库分配到B库',1); $this->addLog($car_info->id,'从A库分配到B库',1);
} }
@ -383,7 +395,7 @@ class DatabaseController extends BaseController
$car_info = CarT::findOne(['id'=>$id]); $car_info = CarT::findOne(['id'=>$id]);
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 3; $car_info->location = 3;
$car_info->xubao_num = 1; $car_info->is_xubao = 1;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }
@ -396,6 +408,12 @@ class DatabaseController extends BaseController
if(!$c_info->save(false)) { if(!$c_info->save(false)) {
throw new Exception(print_r($c_info->getFirstErrors(),true)); throw new Exception(print_r($c_info->getFirstErrors(),true));
} }
} else {
$c_info->user_id = 0;
if(!$c_info->save(false)) {
throw new Exception(print_r($c_info->getFirstErrors(),true));
}
$this->addLog($car_info->id,'从C库回收成未分配状态',1);
} }
$this->addLog($car_info->id,'从A库分配到C库',1); $this->addLog($car_info->id,'从A库分配到C库',1);
} }
@ -647,10 +665,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $b_info->car->car_man; $order_row->id_man = $b_info->car->car_man;
$order_row->id_man_number = $b_info->car->id_number; $order_row->id_man_number = $b_info->car->id_man_number;
$order_row->link_man = $b_info->car->car_man; $order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone; $order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number; $order_row->link_man_number = $b_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -824,7 +842,7 @@ class DatabaseController extends BaseController
$order_row->id_man = $b_info->car->car_man; $order_row->id_man = $b_info->car->car_man;
$order_row->link_man = $b_info->car->car_man; $order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone; $order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number; $order_row->link_man_number = $b_info->car->id_man_number;
$order_row->return_status_id = 0; $order_row->return_status_id = 0;
$order_row->return_remark = ''; $order_row->return_remark = '';
if(!$order_row->save()) { if(!$order_row->save()) {
@ -988,20 +1006,23 @@ class DatabaseController extends BaseController
} }
$b_info = CarBT::findOne(['id'=>$id]); $b_info = CarBT::findOne(['id'=>$id]);
if($b_info->user_id > 0) { if($b_info) {
//删除预约 if($b_info->user_id > 0) {
AppointmentT::deleteAll('car_id='.$b_info->id); //删除预约
AppointmentT::deleteAll('car_id='.$b_info->id);
//删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
//删除操作人员 //删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
$orders = OrderT::find() //删除操作人员
->where('car_id='.$b_info->id.' and status_id<5') $orders = OrderT::find()
->all(); ->where('car_id='.$b_info->id.' and status_id<5')
foreach($orders as $order_info) { ->all();
OrderUserT::deleteAll('order_id='.$order_info->id); foreach($orders as $order_info) {
//删除保单 OrderUserT::deleteAll('order_id='.$order_info->id);
$order_info->delete(); //删除保单
$order_info->delete();
}
} }
$b_info->delete();
} }
$this->addLog($car_info->id,'从B库移动到无效库',1); $this->addLog($car_info->id,'从B库移动到无效库',1);
} }
@ -1214,10 +1235,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man; $order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number; $order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man; $order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone; $order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number; $order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -1388,10 +1409,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $c_info->user_id; $order_row->user_id = $c_info->user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man; $order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number; $order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man; $order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone; $order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number; $order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -1555,6 +1576,12 @@ class DatabaseController extends BaseController
if(!$d_info->save(false)) { if(!$d_info->save(false)) {
throw new Exception(print_r($d_info->getFirstErrors(),true)); throw new Exception(print_r($d_info->getFirstErrors(),true));
} }
} else {
$d_info->user_id = 0;
if(!$d_info->save(false)) {
throw new Exception(print_r($d_info->getFirstErrors(),true));
}
$this->addLog($car_info->id,'从D库回收成未分配状态',1);
} }
$this->addLog($car_info->id,'从C库分配到D库',1); $this->addLog($car_info->id,'从C库分配到D库',1);
} }
@ -1601,6 +1628,12 @@ class DatabaseController extends BaseController
if(!$d_info->save(false)) { if(!$d_info->save(false)) {
throw new Exception(print_r($d_info->getFirstErrors(),true)); throw new Exception(print_r($d_info->getFirstErrors(),true));
} }
} else {
$d_info->user_id = 0;
if(!$d_info->save(false)) {
throw new Exception(print_r($d_info->getFirstErrors(),true));
}
$this->addLog($car_info->id,'从D库回收成未分配状态',1);
} }
$this->addLog($car_info->id,'从C库分配到D库',1); $this->addLog($car_info->id,'从C库分配到D库',1);
} }
@ -1659,20 +1692,23 @@ class DatabaseController extends BaseController
} }
$c_info = CarCT::findOne(['id'=>$id]); $c_info = CarCT::findOne(['id'=>$id]);
if($c_info->user_id > 0) { if($c_info) {
//删除预约 if($c_info->user_id > 0) {
AppointmentT::deleteAll('car_id='.$c_info->id); //删除预约
AppointmentT::deleteAll('car_id='.$c_info->id);
//删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
//删除操作人员 //删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
$orders = OrderT::find() //删除操作人员
->where('car_id='.$c_info->id.' and status_id<5') $orders = OrderT::find()
->all(); ->where('car_id='.$c_info->id.' and status_id<5')
foreach($orders as $order_info) { ->all();
OrderUserT::deleteAll('order_id='.$order_info->id); foreach($orders as $order_info) {
//删除保单 OrderUserT::deleteAll('order_id='.$order_info->id);
$order_info->delete(); //删除保单
$order_info->delete();
}
} }
$c_info->delete();
} }
$this->addLog($car_info->id,'从C库移动到无效库',1); $this->addLog($car_info->id,'从C库移动到无效库',1);
} }
@ -1889,10 +1925,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man; $order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number; $order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man; $order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone; $order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_number; $order_row->link_man_number = $d_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -2060,7 +2096,7 @@ class DatabaseController extends BaseController
$order_row->user_id = $d_info->user_id; $order_row->user_id = $d_info->user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man; $order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number; $order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man; $order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone; $order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_man_number; $order_row->link_man_number = $d_info->car->id_man_number;
@ -2236,20 +2272,23 @@ class DatabaseController extends BaseController
} }
$d_info = CarDT::findOne(['id'=>$id]); $d_info = CarDT::findOne(['id'=>$id]);
if($d_info->user_id > 0) { if($d_info) {
//删除预约 if($d_info->user_id > 0) {
AppointmentT::deleteAll('car_id='.$d_info->id); //删除预约
AppointmentT::deleteAll('car_id='.$d_info->id);
//删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
//删除操作人员 //删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
$orders = OrderT::find() //删除操作人员
->where('car_id='.$d_info->id.' and status_id<5') $orders = OrderT::find()
->all(); ->where('car_id='.$d_info->id.' and status_id<5')
foreach($orders as $order_info) { ->all();
OrderUserT::deleteAll('order_id='.$order_info->id); foreach($orders as $order_info) {
//删除保单 OrderUserT::deleteAll('order_id='.$order_info->id);
$order_info->delete(); //删除保单
$order_info->delete();
}
} }
$d_info->deletel();
} }
$this->addLog($car_info->id,'从C库移动到无效库',1); $this->addLog($car_info->id,'从C库移动到无效库',1);
} }
@ -2385,7 +2424,7 @@ class DatabaseController extends BaseController
$row['car_man'] = MyLib::substr_cut($car_info->car_man, 8); $row['car_man'] = MyLib::substr_cut($car_info->car_man, 8);
$row['op_user'] = $item->user?$item->user->getShowName():''; $row['op_user'] = $item->user?$item->user->getShowName():'';
$row['invalid_info'] = $item->invalid->getPath(); $row['invalid_info'] = $item->invalid->getPath();
$row['invalid_time'] = $item->invalid->created_at; $row['invalid_time'] = $item->created_at;
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;

@ -213,15 +213,22 @@ class FinanceController extends \frontend\controllers\UserBaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['group'] = $item->user->group->name; $row['group'] = $item->user && $item->user->group ? $item->user->group->name : '';
$row['company_name'] = $item->order->company2->name; $row['company_name'] = $item->order && $item->order->company2 ? $item->order->company2->name : 0;
$row['username'] = $item->user->getShowName(); $row['username'] = $item->user ? $item->user->getShowName() : 0;
$row['submit_date'] = $item->order->submit_date; $row['submit_date'] = $item->order ? $item->order->submit_date : '';
$row['print_date'] = $item->order->print_date; $row['print_date'] = $item->order ? $item->order->print_date : '';
$row['total_real'] = round($item->total_clear_real + $item->total_tax_real,2); $row['total_real'] = round($item->total_clear_real + $item->total_tax_real,2);
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$data['rows'][] = array(
['商业保总额', $sum_total],
['商业净保总额', $sum_total_clear],
['回款总额', $sum_r_total],
['回款差额', $sum_total_dis]
);
return $data; return $data;
} }
public function actionReceiptImport() { public function actionReceiptImport() {
@ -3264,18 +3271,18 @@ class FinanceController extends \frontend\controllers\UserBaseController
for ($i = 7; $i <= $rowCount; $i++) { for ($i = 7; $i <= $rowCount; $i++) {
$cell = $currentSheet->getCellByColumnAndRow(1, $i); $cell = $currentSheet->getCellByColumnAndRow(1, $i);
$insurer_no = $cell->getValue();//$data[$i][1]; $insurer_no = $cell->getFormattedValue();//$data[$i][1];
// var_dump($insurer_no); // var_dump($insurer_no);
$cell = $currentSheet->getCellByColumnAndRow(2, $i); $cell = $currentSheet->getCellByColumnAndRow(2, $i);
$policy_man = $cell->getValue();//$data[$i][2]; $policy_man = $cell->getFormattedValue();//$data[$i][2];
$cell = $currentSheet->getCellByColumnAndRow(3, $i); $cell = $currentSheet->getCellByColumnAndRow(3, $i);
$total_real = $cell->getValue();//$data[$i][3]; $total_real = $cell->getFormattedValue();//$data[$i][3];
$cell = $currentSheet->getCellByColumnAndRow(4, $i); $cell = $currentSheet->getCellByColumnAndRow(4, $i);
$total_rate = $cell->getValue();//$data[$i][4]; $total_rate = $cell->getFormattedValue();//$data[$i][4];
$cell = $currentSheet->getCellByColumnAndRow(5, $i); $cell = $currentSheet->getCellByColumnAndRow(5, $i);
$pay_total = $cell->getValue();//$data[$i][5]; $pay_total = $cell->getFormattedValue();//$data[$i][5];
$cell = $currentSheet->getCellByColumnAndRow(6, $i); $cell = $currentSheet->getCellByColumnAndRow(6, $i);
$insurer_total = $cell->getValue();//$data[$i][6]; $insurer_total = $cell->getFormattedValue();//$data[$i][6];
$cell = $currentSheet->getCellByColumnAndRow(7, $i); $cell = $currentSheet->getCellByColumnAndRow(7, $i);
$insurer_date = $cell->getFormattedValue(); $insurer_date = $cell->getFormattedValue();
// var_dump($insurer_date); // var_dump($insurer_date);
@ -5147,12 +5154,20 @@ class FinanceController extends \frontend\controllers\UserBaseController
$row['is_leave'] = $item->is_leave ? '已离职':''; $row['is_leave'] = $item->is_leave ? '已离职':'';
$pay_info = $item->getPay($pay_date); $pay_info = $item->getPay($pay_date);
$row['status_name'] = $pay_info ? $pay_info->getStatus($pay_info->status_id) : ''; $row['status_name'] = $pay_info ? $pay_info->getStatus($pay_info->status_id) : '';
$row['real_pay'] = $pay_info->base_real_pay; $row['real_pay'] = $pay_info ? $pay_info->base_real_pay : '';
$row['should_pay'] = $pay_info->ticheng_real_pay; $row['should_pay'] = $pay_info ? $pay_info->ticheng_real_pay : '';
$row['is_show'] = ($pay_info->renshi_status_id > 0 && $pay_info->chuna_status_id > 0 && $pay_info->status_id != 7 && $pay_info->status_id != 8) ? 1 : 0; $row['is_show'] = $pay_info && ($pay_info->renshi_status_id > 0 && $pay_info->chuna_status_id > 0 && $pay_info->status_id != 7 && $pay_info->status_id != 8) ? 1 : 0;
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$pay_chexian = PayT::find()
->where("pay_date='{$pay_date}'")
->sum('ticheng_real_pay');
$data['rows'][] = array(
['提成工资总额', number_format($pay_chexian,2)],
);
return $data; return $data;
} }
@ -6543,6 +6558,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
$total = $query->count(); $total = $query->count();
$sum_total1_clear = $query->sum('total1_clear');
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
@ -6561,6 +6577,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$data['rows'][] = array(
['商业净保总额', number_format($sum_total1_clear,2)],
);
return $data; return $data;
} }
@ -6718,19 +6738,14 @@ class FinanceController extends \frontend\controllers\UserBaseController
$group_ids = []; $group_ids = [];
if($group_id > 0) { if($group_id > 0) {
$items = GroupT::getTree($group_id); $items = GroupT::getTree($group_id);
$group_ids[] = $group_id; $group_ids[] = $group_id;
foreach($items as $group_info) { foreach($items as $group_info) {
$group_ids[] = $group_info->id; $group_ids[] = $group_info->id;
} }
} }
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
->where('order_t.status_id>1') ->where('order_t.status_id>1');
->orderBy('order_t.print_date DESC');
if($user_names != '' && $user_names != 'null'){ if($user_names != '' && $user_names != 'null'){
$user_arr = explode(',',$user_names); $user_arr = explode(',',$user_names);
$user_ids = []; $user_ids = [];
@ -6739,40 +6754,33 @@ class FinanceController extends \frontend\controllers\UserBaseController
if($user) if($user)
$user_ids[] = $user->id; $user_ids[] = $user->id;
} }
$query->andWhere(['in','caiwu_t.user_id',$user_ids]); $query->andWhere(['in','caiwu_t.user_id',$user_ids]);
} }
if( $company_id > 0) { if( $company_id > 0) {
$query->andWhere('order_t.company2_id='.$company_id); $query->andWhere('order_t.company2_id='.$company_id);
} }
if( $car_no != '') { if( $car_no != '') {
$query->andWhere('order_t.car_no="'.$car_no.'"'); $query->andWhere('order_t.car_no="'.$car_no.'"');
} }
if($car_no_type == 1){ if($car_no_type == 1){
$query->andWhere('caiwu_t.car_no like "' . '京' . '%"'); $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
}elseif($car_no_type == 2){ }elseif($car_no_type == 2){
$query->andWhere('caiwu_t.car_no not like "' . '京' . '%"'); $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
} }
if($begin_totalclear != ''){ if($begin_totalclear != ''){
$query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear); $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
} }
if($end_totalclear != ''){ if($end_totalclear != ''){
$query->andWhere('caiwu_t.total_clear <=' . $end_totalclear); $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
} }
if ($begin_date != "") { if ($begin_date != "") {
$query->andWhere('order_t.print_date>="' . $begin_date . '"'); $query->andWhere('order_t.print_date>="' . $begin_date . '"');
} }
if ($end_date != "") { if ($end_date != "") {
$query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
$user_items = $this->my->getChildren(''); $user_items = $this->my->getChildren('');
$user_items[] = $this->my; $user_items[] = $this->my;
$row = array(); $row = array();
foreach($user_items as $user_info) { foreach($user_items as $user_info) {
if ($group_id > 0) { if ($group_id > 0) {
@ -6782,58 +6790,46 @@ class FinanceController extends \frontend\controllers\UserBaseController
} }
$row[] = $user_info->id; $row[] = $user_info->id;
} }
//加上级别筛选 //加上级别筛选
if($group_id > 0){ if($group_id > 0){
$query->andWhere(['in','caiwu_t.user_id',$row]); $query->andWhere(['in','caiwu_t.user_id',$row]);
} }
$query1 = clone $query;
if($insurer_type ==1){ if($insurer_type ==1){
$query->andWhere('caiwu_t.insurer_type=1'); $query->andWhere('caiwu_t.insurer_type=1');
} }
$query1 = clone $query;
$sums = $query1
$items = $query->all(); ->leftJoin(OrderCaiwuT::tableName(), "order_t.id=order_caiwu_t.order_id")
->select([
$total2_clear_all = $query1->andWhere('caiwu_t.insurer_type=2')->sum('total_clear'); 'sum_total1_clear' => 'sum(order_t.total1_clear)',
'sum_total2_clear' => 'sum(order_t.total2_clear)',
$yewu_ticheng_all = 0; 'sum_yeji_ticheng' => 'sum(order_caiwu_t.yeji_ticheng)',
$total1_clear_all = 0; 'sum_ticheng_money' => 'sum(order_caiwu_t.ticheng_money)',
$yeji_ticheng_all = 0; 'sum_yuangong_money' => 'sum(order_caiwu_t.yuangong_money)',
$ticheng_money_all = 0; 'sum_yewu_ticheng' => 'sum(order_caiwu_t.yewu_ticheng)',
$lipin_all = 0; ])->asArray()->one();
$liquan_all = 0; $query2 = clone $query;
$yuangong_money_all = 0; $gift_sum = $query2
foreach($items as $index => $item) { ->leftJoin(OrderGiftT::tableName(), "order_gift_t.order_id=caiwu_t.order_id")
$order_caiwu_info = $item->orderCaiwu; ->leftJoin(GiftT::tableName(), "gift_t.id=order_gift_t.gift_id")
$order_info = $item->order; ->andWhere('order_gift_t.gift_type=1 && order_gift_t.is_free=2')
->sum('gift_t.price');
$total1_clear_all += $item->total_clear; $query2 = clone $query;
$yewu_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yewu_ticheng : 0; $voucher_sum = $query2
$yeji_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yeji_ticheng : 0; ->leftJoin(OrderGiftT::tableName(), "order_gift_t.order_id=caiwu_t.order_id")
$ticheng_money_all += $order_info ? $order_info->ticheng_money : 0; ->leftJoin(GiftT::tableName(), "gift_t.id=order_gift_t.gift_id")
$lipin_all += $order_info ? $order_info->getGiftPrice(1,1) : 0; ->andWhere('order_gift_t.gift_type=2 && order_gift_t.is_free=2')
$liquan_all += $order_info ? $order_info->getGiftPrice(1,2) : 0; ->sum('gift_t.price');
$yuangong_money = 0;
if($order_info){
$yuangong_money = $order_info->yuangong_money>0?$order_info->yuangong_money:0;
}
$yuangong_money_all += $yuangong_money;
}
// echo $query->createCommand()->rawSql;exit;
$total = $query->count(); $total = $query->count();
$query=$query->offset($offset)->limit($limit);
$query->offset($offset)->limit($limit); $items = $query->orderBy('order_t.print_date DESC')->all();
$items = $query->all();
$data = []; $data = [];
$data['total'] = $total; $data['total'] = $total;
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['company_name'] = $item->order->company2->name; $row['company_name'] = $item->order->company2?$item->order->company2->name:'';
$row['print_date'] = $item->order->print_date; $row['print_date'] = $item->order->print_date;
$row['yeji_rate'] = $item->orderCaiwu->yeji_rate; $row['yeji_rate'] = $item->orderCaiwu->yeji_rate;
$row['yeji_ticheng'] = $item->orderCaiwu->yeji_ticheng; $row['yeji_ticheng'] = $item->orderCaiwu->yeji_ticheng;
@ -6844,17 +6840,17 @@ class FinanceController extends \frontend\controllers\UserBaseController
$row['yuangong_money'] = $item->order->yuangong_money; $row['yuangong_money'] = $item->order->yuangong_money;
$row['yewu_ticheng'] = $item->orderCaiwu->yewu_ticheng; $row['yewu_ticheng'] = $item->orderCaiwu->yewu_ticheng;
if($item->order->car->op2_id > 0) { if($item->order->car->op2_id > 0) {
$row['op_user'] = $item->order->car->op2->showName; $row['op_user'] = $item->order->car->op2?$item->order->car->op2->showName:'';
$row['op_user1'] = $item->order->car->op1->showName; $row['op_user1'] = $item->order->car->op1?$item->order->car->op1->showName:'';
} else { } else {
$row['op_user'] = $item->order->car->op1->showName; $row['op_user'] = $item->order->car->op1?$item->order->car->op1->showName:'';
$row['op_user1'] = ''; $row['op_user1'] = '';
} }
$row['first_xinbao_ticheng'] = $item->orderCaiwu->first_xinbao_ticheng; $row['first_xinbao_ticheng'] = $item->orderCaiwu->first_xinbao_ticheng;
$row['hebao_ticheng'] = $item->orderCaiwu->hebao_ticheng; $row['hebao_ticheng'] = $item->orderCaiwu->hebao_ticheng;
$row['op1_user'] = $item->order->op1->showName; $row['op1_user'] = $item->order->op1?$item->order->op1->showName:'';
$row['zhengben_ticheng'] = $item->orderCaiwu->zhengben_ticheng; $row['zhengben_ticheng'] = $item->orderCaiwu->zhengben_ticheng;
$row['op2_user'] = $item->order->op2->showName; $row['op2_user'] = $item->order->op2?$item->order->op2->showName:'';
$row['dz_ticheng1'] = $item->orderCaiwu->dz_ticheng1; $row['dz_ticheng1'] = $item->orderCaiwu->dz_ticheng1;
$row['dz_names1'] = $item->orderCaiwu->dz_names1; $row['dz_names1'] = $item->orderCaiwu->dz_names1;
$row['dz_ticheng2'] = $item->orderCaiwu->dz_ticheng2; $row['dz_ticheng2'] = $item->orderCaiwu->dz_ticheng2;
@ -6867,6 +6863,16 @@ class FinanceController extends \frontend\controllers\UserBaseController
$row['dz_names5'] = $item->orderCaiwu->dz_names5; $row['dz_names5'] = $item->orderCaiwu->dz_names5;
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$data['rows'][] = array(
['保费总额', number_format($sums['sum_total1_clear'] + $sums['sum_total2_clear'],2)],
['商业净保总额', number_format($sums['sum_total1_clear'],2)],
['基本提成合计', number_format($sums['sum_yeji_ticheng'],2)],
['加点提成合计', number_format($sums['sum_ticheng_money'],2)],
['自费礼品合计', number_format($gift_sum,2)],
['自费礼券合计', number_format($voucher_sum,2)],
['自费减免合计', number_format($sums['sum_yuangong_money'],2)],
['提成合计', number_format($sums['sum_yewu_ticheng'],2)]
);
return $data; return $data;
} }
@ -7380,6 +7386,9 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query = $query->offset($offset)->limit($limit); $query = $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$pay_chexian = PayOrderUserT::find()
->where("pay_date='{$pay_date}'")
->sum('real_pay');
$data = []; $data = [];
$data['total'] = $total; $data['total'] = $total;
@ -7395,6 +7404,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$data['rows'][] = array(
['提成工资总额', number_format($pay_chexian,2)],
);
return $data; return $data;
} }
/** /**
@ -7586,7 +7599,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
$user_id = $this->my->id; $user_id = $this->my->id;
// var_dump($user_id);
$query = UserT::find() $query = UserT::find()
->leftJoin('pay_t','pay_t.user_id=user_t.id') ->leftJoin('pay_t','pay_t.user_id=user_t.id')
->where('group_id>0 and is_delete=0'); ->where('group_id>0 and is_delete=0');
@ -7611,10 +7623,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$group_items = GroupT::getTree();
$data = []; $data = [];
$data['total'] = $total; $data['total'] = $total;
$data['rows'] = []; $data['rows'] = [];
@ -7631,8 +7639,17 @@ class FinanceController extends \frontend\controllers\UserBaseController
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$pay_chexian = PayT::find()
->where("pay_date='{$pay_date}'")
->sum('ticheng_real_pay');
$data['rows'][] = array(
['提成工资总额', number_format($pay_chexian,2)],
);
return $data; return $data;
} }
/** /**
* 出纳工资-详情 * 出纳工资-详情
* @return string * @return string
@ -7759,12 +7776,26 @@ class FinanceController extends \frontend\controllers\UserBaseController
]); ]);
} }
public function actionReceiptLirun() public function actionReceiptLirun() {
$company_items = InsurerCompany2T::find()->all();
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1)
$group_items = GroupT::getTree();
return $this->render('receipt-lirun',[
'company_items' => $company_items,
'group_items' => $group_items
]);
}
public function actionReceiptLirunJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
set_time_limit(0); set_time_limit(0);
ini_set('memory_limit', '3072M'); ini_set('memory_limit', '3072M');
$request = Yii::$app->request; $request = Yii::$app->request;
$page = $request->get('page', 1); $offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$insurer_type = $request->get('insurer_type', 0); $insurer_type = $request->get('insurer_type', 0);
$begin_date = $request->get('begin_date',date('Y-m-d')); $begin_date = $request->get('begin_date',date('Y-m-d'));
$end_date = $request->get('end_date',date('Y-m-d')); $end_date = $request->get('end_date',date('Y-m-d'));
@ -7781,245 +7812,192 @@ class FinanceController extends \frontend\controllers\UserBaseController
$zbname = $request->get('zbname'); $zbname = $request->get('zbname');
//级别 //级别
$group_id = $request->get('group_id'); $group_id = $request->get('group_id');
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053')
$group_items = GroupT::getTree();
$group_ids[] = $group_id; $group_ids[] = $group_id;
if($group_id > 0) { if($group_id > 0) {
$items = GroupT::getTree($group_id); $items = GroupT::getTree($group_id);
foreach($items as $group_info) { foreach($items as $group_info) {
$group_ids[] = $group_info->id; $group_ids[] = $group_info->id;
} }
} }
// var_dump($group_ids);
if ($page < 1) $page = 1;
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
->where('order_t.status_id>1'); ->where('order_t.status_id>1');
// ->orderBy('order_t.print_date DESC');
switch ($sort_key) {
case 'total':
$sort = 'caiwu_t.total ';
break;
case 'total_clear':
$sort = 'caiwu_t.total_clear ';
break;
case 'total_rate':
$sort = 'caiwu_t.total_rate ';
break;
case 'print_date'://默认按照print_date排序
default:
$sort = 'order_t.print_date ';
break;
}
switch ($sort_value) {
case 'ASC':
$sort .= 'ASC';
break;
case 'DESC':
default:
$sort .= 'DESC';
break;
}
$query = $query->orderBy($sort);
if( $insurer_type != 0) { if( $insurer_type != 0) {
$query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
} }
if( $company_id > 0) { if( $company_id > 0) {
$query = $query->andWhere('order_t.company_id='.$company_id); $query->andWhere('order_t.company2_id='.$company_id);
} }
if ($username != "") { if ($username != "") {
// $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('caiwu_t.user_id = ' . $userdata->id . ''); $query->andWhere('caiwu_t.user_id = ' . $userdata->id . '');
} }
} }
if ($hebaoname != "") { if ($hebaoname != "") {
// $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('order_t.op1_id = ' . $userdata->id . ''); $query->andWhere('order_t.op1_id = ' . $userdata->id . '');
} }
} }
if ($zbname != "") { if ($zbname != "") {
// $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('order_t.op2_id = ' . $userdata->id . ''); $query->andWhere('order_t.op2_id = ' . $userdata->id . '');
} }
} }
if ($car_no != "") { if ($car_no != "") {
$query = $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"'); $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"');
} }
if ($insurer_no != "") { if ($insurer_no != "") {
$query = $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"'); $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"');
} }
if ($status > 0) { if ($status > 0) {
if ($status == 1) { if ($status == 1) {
$query = $query->andWhere('r_date="" or r_date is null'); $query->andWhere('r_date="" or r_date is null');
} }
if ($status == 2) { if ($status == 2) {
$query = $query->andWhere('r_date<>"" and total_dis=0'); $query->andWhere('r_date<>"" and total_dis=0');
} }
if($status == 3) { if($status == 3) {
$query = $query->andWhere('r_date<>"" and total_dis<>0'); $query->andWhere('r_date<>"" and total_dis<>0');
} }
} }
if ($begin_date != "") { if ($begin_date != "") {
$query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); $query->andWhere('order_t.print_date>="' . $begin_date . '"');
} }
if ($end_date != "") { if ($end_date != "") {
$query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
if ($r_begin_date != "") { if ($r_begin_date != "") {
$query = $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"'); $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"');
} }
if ($r_end_date != "") { if ($r_end_date != "") {
$query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"'); $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"');
} }
//找出$group_id 有多少在职的user_ids //找出$group_id 有多少在职的user_ids
// 现在的搜索条件 // 现在的搜索条件
$userSql = ''; $userSql = '';
// if($username != '') {
// $userSql = ' username like "'.$username.'" and ';
// }
//$userSql .= 'is_locked=0 and is_login=1';
$user_items = $this->my->getChildren($userSql); $user_items = $this->my->getChildren($userSql);
if($this->my->username == '6002' || $this->my->username == '7053')
$user_items = $this->my->getChildren($userSql,1);
$user_items[] = $this->my; $user_items[] = $this->my;
$row = array(); $row = array();
foreach($user_items as $user_info) { foreach($user_items as $user_info) {
// if ($user_info->is_leave == 1) continue;
// var_dump($user_info);
if ($group_id > 0) { if ($group_id > 0) {
if (!in_array($user_info->group_id, $group_ids)) { if (!in_array($user_info->group_id, $group_ids)) {
continue; continue;
} }
} }
$row[] = $user_info->id; $row[] = $user_info->id;
} }
// var_dump($row);
//加上级别筛选 //加上级别筛选
if($group_id > 0){ if($group_id > 0){
// $query = $query->andWhere('order_t.company_id='.$company_id); $query->andWhere(['in','caiwu_t.user_id',$row]);
$query = $query->andWhere(['in','caiwu_t.user_id',$row]);
// $query = $query->andWhere('caiwu_t.user_id ="' . $group_id . '"');
} }
$query1 = clone $query;
$item1s = $query1->all();
// echo $query->createCommand()->rawSql;
$total = $query->count(); $total = $query->count();
$sum_r_total = $query->sum('r_total'); $query1 = clone $query;
//商业净保费综合 $sums = $query1->select([
$sum_total_clear = $query->sum('total_clear'); //是错误的 'sum_total1' => 'sum(order_t.total1)',
'sum_r_total' => 'sum(caiwu_t.r_total)',
//商业总保费 'sum_total1_clear' => 'sum(order_t.total1_clear)',
$sum_total = $query->sum('total'); 'sum_budian' => 'sum(order_t.yuangong_money)',
'sum_r_budian' => 'sum(ifnull(caiwu_t.budian_rate,0)*total_clear/100)',
$sum_total_dis = $query->sum('total_dis'); 'sum_total1_dis' => 'sum(order_t.total1_dis)',
])->asArray()->one();
$query2 = clone $query;
$gift_sum = $query2
->leftJoin(OrderGiftT::tableName(), "order_gift_t.order_id=caiwu_t.order_id")
->leftJoin(GiftT::tableName(), "gift_t.id=order_gift_t.gift_id")
->andWhere('caiwu_t.insurer_type=1')
->andWhere('order_gift_t.gift_type=1 && order_gift_t.is_free=2')
->sum('gift_t.price');
$query2 = clone $query;
$voucher_sum = $query2
->leftJoin(OrderGiftT::tableName(), "order_gift_t.order_id=caiwu_t.order_id")
->leftJoin(GiftT::tableName(), "gift_t.id=order_gift_t.gift_id")
->andWhere('caiwu_t.insurer_type=1')
->andWhere('order_gift_t.gift_type=2 && order_gift_t.is_free=2')
->sum('gift_t.price');
$query2 = clone $query;
$gongzi_sum = $query2
->leftJoin(PayOrderUserT::tableName(), "pay_order_user_t.order_id=caiwu_t.order_id")
->andWhere('caiwu_t.insurer_type=1')
->sum('pay_order_user_t.real_pay');
$pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); switch ($sort_key) {
$pagination->setPage($page - 1); case 'total':
$sort = 'caiwu_t.total ';
break;
case 'total_clear':
$sort = 'caiwu_t.total_clear ';
break;
case 'total_rate':
$sort = 'caiwu_t.total_rate ';
break;
case 'print_date'://默认按照print_date排序
default:
$sort = 'order_t.print_date ';
break;
}
switch ($sort_value) {
case 'ASC':
$sort .= 'ASC';
break;
case 'DESC':
default:
$sort .= 'DESC';
break;
}
$query = $query->offset($pagination->offset)->limit($pagination->limit); $query = $query->orderBy($sort)->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$lirun_all = 0; $data = [];
$gongzi_all = 0; $data['total'] = $total;
$liwu_all = 0; $data['rows'] = [];
$total1_dis_all = 0; foreach($items as $item) {
$bu_dian_all = 0;
$r_bu_dian_all = 0;
foreach($item1s as $item){
$order_info = $item->order; $order_info = $item->order;
$user_info = $item->user;
$total_clear_real = $item->total_clear * $item->total_rate/100; $row = $item->toArray();
$total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0; $row['username'] = $user_info->username;
$row['company_name'] = $order_info ? $order_info->company2->name : '';
$gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0; $row['group_name'] = $user_info->group ? $user_info->group->path : '';
$row['submit_date'] = $order_info ? $order_info->submit_date : '';
$row['print_date'] = $order_info ? $order_info->print_date : '';
if($item->insurer_type == 1) {
$row['insurer_type'] = '商业';
} else {
$row['insurer_type'] = '交强';
}
$row['total_real'] = round($item->total * $item->total_rate/100,2);
$row['total_clear_real'] = round($item->total_clear * $item->total_rate/100,2);
$row['bu_dian'] = $item->budian_rate?round($item->budian_rate * $item->total_clear,2) / 100:0;
$row['r_bu_dian'] = $item->insurer_type == 1?round($item->b1_total+$item->b2_total+$item->b3_total,2):0;
$row['total1_dis'] = $item->insurer_type == 1?round($order_info->total1_dis + $order_info->yuangong_money,2):0;
$ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0; $ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0;
$gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0; $gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0;
$r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; $row['liwu'] = round($ticket + $gift,2);
$bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0; $row['gongzi'] = $item->insurer_type == 1?round($item->getPayOrderUser()->sum('real_pay'),2):0;
$liwu = $ticket + $gift; $row['lirun'] = round($row['total_clear_real'] + $row['bu_dian'] - $row['total1_dis'] - $row['gongzi'] - $row['liwu'],2);
$data['rows'][] = $row;
$lirun_all += $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu;
$gongzi_all += $gongzi;
$liwu_all += $liwu;
$total1_dis_all += $total1_dis;
$bu_dian_all += $bu_dian;
$r_bu_dian_all += $r_bu_dian;
} }
// var_dump($items); $data['rows'][] = array(
['商业保总额', number_format($sums['sum_total1'],2)],
$page_info = MyLib::getPageInfo($pagination); ['商业净保总额', number_format($sums['sum_total1_clear'],2)],
['回款总额', number_format($sums['sum_r_total'],2)],
$company_items = InsurerCompanyT::find()->all(); ['补点总额', number_format($sums['sum_budian'],2)],
['回款补点总额', number_format($sums['sum_r_budian'],2)],
['减免总额', number_format($sums['sum_total1_dis'],2)],
['礼品礼券自费总额', number_format($gift_sum + $voucher_sum,2)],
['工资总额', number_format($gongzi_sum,2)],
['利润总额', number_format($sums['sum_total1_clear'] + $sums['sum_budian'] - $sums['sum_total1_dis'] - $gongzi_sum - $gift_sum - $voucher_sum,2)],
);
return $this->render('receipt-lirun', [ return $data;
'items' => $items,
'username' => $username,
'hebaoname' => $hebaoname,
'zbname' => $zbname,
'page' => $page,
'car_no' => $car_no,
'insurer_no' => $insurer_no,
'status' => $status,
'begin_date' => $begin_date,
'end_date' => $end_date,
'r_begin_date' => $r_begin_date,
'r_end_date' => $r_end_date,
'page_info' => $page_info,
'sort_key' => $sort_key,
'sort_value' => $sort_value,
'sum_r_total' => $sum_r_total,
'sum_total_clear' => $sum_total_clear,
'sum_total' => $sum_total,
'sum_total_dis' => $sum_total_dis,
'company_items' => $company_items,
'group_id' => $group_id,
'group_items' => $group_items,
'company_id' => $company_id,
'insurer_type' => $insurer_type,
'lirun_all'=>$lirun_all,
'gongzi_all'=>$gongzi_all,
'liwu_all'=>$liwu_all,
'total1_dis_all'=>$total1_dis_all,
'bu_dian_all'=>$bu_dian_all,
'r_bu_dian_all'=>$r_bu_dian_all
]);
} }
public function actionGongziAllReturnSave() public function actionGongziAllReturnSave()

@ -207,9 +207,6 @@ class FixCarController extends BaseController
$info->displacement_id = $car_info->displacement_id; $info->displacement_id = $car_info->displacement_id;
$info->car_year = $car_info->car_year; $info->car_year = $car_info->car_year;
$info->status = $status; $info->status = $status;
// var_dump($car_info->car_year);
// var_dump($info->car_year);
// die;
} }
if($car_id == 0) { if($car_id == 0) {
$car_id = $info->car_id; $car_id = $info->car_id;

@ -59,7 +59,7 @@ class GiftController extends \yii\web\Controller
$query = GiftT::find() $query = GiftT::find()
->where('is_delete=0'); ->where('is_delete=0');
if($type_id > 0) { if($type_id > 0) {
$query = $query->andWhere('typeid='.$type_id); $query = $query->andWhere('type_id='.$type_id);
} }
if($name != '') { if($name != '') {
$query = $query->andWhere('name like "'.$name.'"'); $query = $query->andWhere('name like "'.$name.'"');
@ -75,7 +75,7 @@ class GiftController extends \yii\web\Controller
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['type'] = $item->getShowType(); $row['type'] = $item->showType;
$data['rows'][] = $row; $data['rows'][] = $row;
} }
@ -818,7 +818,7 @@ class GiftController extends \yii\web\Controller
->leftJoin('order_t','order_t.id=gift_ticket_t_use.order_id') ->leftJoin('order_t','order_t.id=gift_ticket_t_use.order_id')
->leftJoin('gift_t','gift_t.id=gift_ticket_t_use.type_id') ->leftJoin('gift_t','gift_t.id=gift_ticket_t_use.type_id')
->leftJoin('user_t','user_t.id=gift_ticket_t_use.user_id') ->leftJoin('user_t','user_t.id=gift_ticket_t_use.user_id')
->where('gift_t.type_id=2') ->where('gift_t.type_id=1')
->orderBy('id DESC'); ->orderBy('id DESC');
if($code != '') { if($code != '') {
$query->andWhere('gift_ticket_t_use.code="'.$code.'"'); $query->andWhere('gift_ticket_t_use.code="'.$code.'"');
@ -1095,6 +1095,25 @@ class GiftController extends \yii\web\Controller
return $data; return $data;
} }
public function actionGiftUseEdit()
{
$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('gift-use-edit',[
'info' => $info
]);
}
public function actionTicketUseEdit() public function actionTicketUseEdit()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -1114,7 +1133,6 @@ class GiftController extends \yii\web\Controller
} }
public function actionHistoryLogJson() public function actionHistoryLogJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->get('id'); $id = $request->get('id');

@ -131,20 +131,6 @@ class InsurerController extends BaseController
if($order_info->non_id){ if($order_info->non_id){
$nonitems=NonAutoInsurance::findOne(['id'=>$order_info->non_id]); $nonitems=NonAutoInsurance::findOne(['id'=>$order_info->non_id]);
} }
// dd($order_info->non_id);
//快递
// dd($car_info->id);
// $ems_items = EmsT::find()
// ->where(['car_id'=>$car_info->id,'order_id'=>$order_info->id])
// ->orderBy('id ASC')
// ->all();
// $ems_items1=(object)array();
// if(!$ems_items){
// $ems_items1 = ExpressT::find()
// ->where(['car_id'=>$car_info->id,'order_id'=>$order_info->id])
// ->orderBy('id ASC')
// ->all();
// }
//礼品 //礼品
$gift_free_group_items = GiftGroupT::find() $gift_free_group_items = GiftGroupT::find()
->where('is_free=1') ->where('is_free=1')
@ -177,8 +163,6 @@ class InsurerController extends BaseController
return $this->render('info',[ return $this->render('info',[
'order_info'=>$order_info, 'order_info'=>$order_info,
'car_info'=>$car_info, 'car_info'=>$car_info,
// 'ems_items' => $ems_items,
// 'ems_items1' => $ems_items1,
'money_man' => $money_man, 'money_man' => $money_man,
'money_no' => $money_no, 'money_no' => $money_no,
'money_bank' => $money_bank, 'money_bank' => $money_bank,
@ -613,6 +597,7 @@ class InsurerController extends BaseController
if($company2_id > 0) { if($company2_id > 0) {
$query->andWhere('company2_id=:company2_id',[':company2_id'=>$company2_id]); $query->andWhere('company2_id=:company2_id',[':company2_id'=>$company2_id]);
} }
// echo $query->createCommand()->rawSql;
$query = $query->orderBy('updated_at asc'); $query = $query->orderBy('updated_at asc');
$total = $query->count(); $total = $query->count();
@ -737,7 +722,7 @@ class InsurerController extends BaseController
$total1_rate = $request->post('total1_rate','0.00'); $total1_rate = $request->post('total1_rate','0.00');
$total2_rate = $request->post('total2_rate','0.00'); $total2_rate = $request->post('total2_rate','0.00');
$pay_no = $request->post('pay_no',0); $pay_no = $request->post('pay_no',0);
$company2_id = $request->post('company2_id',0); $company2_id = $request->post('company_id',0);
if($total1_rate == '') { if($total1_rate == '') {
$result['msg'] = '请输入商业跟单手续费!'; $result['msg'] = '请输入商业跟单手续费!';
@ -930,6 +915,26 @@ class InsurerController extends BaseController
$insurer2_no= trim($insurer2_no); $insurer2_no= trim($insurer2_no);
$insurer2_no=str_replace(" ","",$insurer2_no); $insurer2_no=str_replace(" ","",$insurer2_no);
if($insurer1_no == $insurer2_no) {
$result['msg'] = '商业保单号和交强保单号不能相同!';
return $result;
}
$tmp_count = OrderT::find()
->where('insurer1_no=:insurer1_no or insurer2_no=:insurer1_no', [':insurer1_no'=>$insurer1_no])
->andWhere('id<>'.$order_id)
->count();
if($tmp_count > 0) {
$result['msg'] = '商业保单号已经存在!';
return $result;
}
$tmp_count = OrderT::find()
->where('insurer1_no=:insurer2_no or insurer2_no=:insurer2_no', [':insurer2_no'=>$insurer2_no])
->andWhere('id<>'.$order_id)
->count();
if($tmp_count > 0) {
$result['msg'] = '交强保单号已经存在!';
return $result;
}
$tran = OrderT::getDb()->beginTransaction(); $tran = OrderT::getDb()->beginTransaction();
try { try {
@ -1122,17 +1127,14 @@ class InsurerController extends BaseController
if($group_id > 0) { if($group_id > 0) {
$items = GroupT::getTree($group_id); $items = GroupT::getTree($group_id);
foreach($items as $group_info) { foreach($items as $group_info) {
$group_ids[] = $group_info->id; $group_ids[] = $group_info->id;
} }
} }
$query = OrderT::find() $query = OrderT::find()
->leftJoin('order_caiwu_t','order_caiwu_t.order_id=order_t.id') ->leftJoin('order_caiwu_t','order_caiwu_t.order_id=order_t.id')
->where('order_caiwu_t.status_id>0') ->where('order_caiwu_t.status_id>0');
->orderBy('order_t.print_date asc');
if($car_man != '') { if($car_man != '') {
$query->andWhere('id_man="'.$car_man.'"'); $query->andWhere('id_man="'.$car_man.'"');
} }
@ -1195,9 +1197,7 @@ class InsurerController extends BaseController
continue; continue;
} }
} }
$row[] = $user_info->id; $row[] = $user_info->id;
} }
//加上级别筛选 //加上级别筛选
@ -1205,8 +1205,15 @@ class InsurerController extends BaseController
$query = $query->andWhere(['in','order_t.user_id',$row]); $query = $query->andWhere(['in','order_t.user_id',$row]);
} }
$total = $query->count(); $total = $query->count();
$query1 = clone $query;
$query = $query->offset($offset)->limit($limit); $sums = $query1->select([
'sum_total1' => 'sum(order_t.total1)',
'sum_total1_clear' => 'sum(order_t.total1_clear)',
'sum_yuangong_money' => 'sum(order_t.yuangong_money)',
'sum_non_total1_dis' => 'sum(order_t.non_total1_dis)',
'sum_total1_dis' => 'sum(order_t.total1_dis)',
])->asArray()->one();
$query = $query->orderBy('order_t.print_date asc')->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$data = []; $data = [];
@ -1214,18 +1221,26 @@ class InsurerController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['company_name'] = $item->company2->name; $row['company_name'] = $item->company2 ? $item->company2->name : '';
$row['path'] = ($item->user && $item->user->group) ? $item->user->group->getPath():''; $row['path'] = ($item->user && $item->user->group) ? $item->user->group->getPath() : '';
$row['user_name'] = $item->user?$item->user->getShowName():''; $row['user_name'] = $item->user ? $item->user->getShowName() : '';
$row['total_user_real'] = number_format($item->total1_dis + $item->yuangong_money,2); $row['total_user_real'] = number_format($item->total1_dis + $item->yuangong_money, 2);
$row['transfer_date'] = $item->caiwu->transfer_date; $row['transfer_date'] = $item->caiwu->transfer_date;
$row['caiwu_status_name'] = $item->caiwu->caiwuStatus->name; $row['caiwu_status_name'] = $item->caiwu && $item->caiwu->caiwuStatus ? $item->caiwu->caiwuStatus->name : '';
$row['shoufei_name'] = MyLib::zhifufs($item->shoufei_id); $row['shoufei_name'] = MyLib::zhifufs($item->shoufei_id);
$row['status_name'] = $item->caiwu->status->name; $row['status_name'] = $item->caiwu && $item->caiwu->status ? $item->caiwu->status->name : '';
$row['lock_man'] = $item->caiwu->lock?$item->caiwu->lock->getShowName():''; $row['lock_man'] = $item->caiwu->lock?$item->caiwu->lock->getShowName():'';
$data['rows'][] = $row; $data['rows'][] = $row;
} }
$data['rows'][] = array(
['商业保总额', number_format($sums['sum_total1'],2)],
['商业净保总额', number_format($sums['sum_total1_clear'],2)],
['业务自付', number_format($sums['sum_yuangong_money'],2)],
['公司代付非车险', number_format($sums['sum_non_total1_dis'],2)],
['公司返金额', number_format($sums['sum_total1_dis'],2)],
['实返现金额', number_format($sums['sum_yuangong_money'] + $sums['sum_total1_dis'],2)]
);
return $data; return $data;
} }
@ -2019,7 +2034,7 @@ class InsurerController extends BaseController
if($request->isPost) { if($request->isPost) {
$order_id = $request->post('order_id',0); $order_id = $request->post('order_id',0);
$return_status_id = $request->post('return_status_id',0); $return_status_id = $request->post('return_status_id',2);
$return_remark = $request->post('return_remark'); $return_remark = $request->post('return_remark');
$tran = OrderT::getDb()->beginTransaction(); $tran = OrderT::getDb()->beginTransaction();
@ -2031,7 +2046,8 @@ class InsurerController extends BaseController
} }
$row->status_id = 1; $row->status_id = 1;
$row->return_status_id = $return_status_id; $row->return_status_id = $row->status_id;
if($row->return_status_id == 0) $row->return_status_id = 2;
$row->return_remark = $return_remark; $row->return_remark = $return_remark;
$row->return_time = time(); $row->return_time = time();
// if($return_status_id == 2) { // if($return_status_id == 2) {
@ -2361,8 +2377,8 @@ class InsurerController extends BaseController
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
$query = OrderT::find() $query = OrderT::find()
->where('status_id>1') ->andWhere('status_id>1')
->orderBy('car_no desc,submit_date asc'); ->orderBy('status_id desc,car_no desc,submit_date asc');
if($id_man != '') { if($id_man != '') {
$query->andWhere(['like','id_man',$id_man]); $query->andWhere(['like','id_man',$id_man]);
} }
@ -2393,13 +2409,11 @@ class InsurerController extends BaseController
if($date3_end != '') { if($date3_end != '') {
$query->andWhere('insurer1_begin_date<=:end_date or insurer2_begin_date<=:end_date', [':end_date'=>$date3_end]); $query->andWhere('insurer1_begin_date<=:end_date or insurer2_begin_date<=:end_date', [':end_date'=>$date3_end]);
} }
if($status > 0) { if($status == 1) {
if($status == 1) { $query->andWhere('status_id>1 and status_id<10');
$query->andWhere('status_id>1 and status_id<10'); }
} if($status == 2) {
if($status == 2) { $query->andWhere('status_id=10');
$query->andWhere('status_id=10');
}
} }
$total = $query->count(); $total = $query->count();
@ -3475,12 +3489,69 @@ class InsurerController extends BaseController
$tran->commit(); $tran->commit();
} catch (\Exception $e) { } catch (\Exception $e) {
// var_dump($e->getTrace());
$tran->rollBack(); $tran->rollBack();
$result['msg'] = $e->getMessage(); $result['msg'] = $e->getMessage();
} }
} }
return $result; return $result;
} }
/**
* 礼品状态回退
* @return array
*/
public function actionGiftCancel()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->post('order_id');
$msg= $request->post('return_msg');
$result = array('success'=>false,'msg'=>'操作成功');
if(!$request->isPost){
$result['msg'] = '请求方式错误';
return $result;
}
if(!$this->my->id == 1){
$result['msg'] = '无此操作权限';
return $result;
}
if ($id < 0) {
$result['msg'] = '订单ID无效';
return $result;
}
if ($msg == '') {
$result['msg'] = '退单理由必须';
return $result;
}
$order_info = OrderT::findOne($id);
if (!$order_info) {
$result['msg'] = '订单不存在';
return $result;
}
$tran = OrderT::getDb()->beginTransaction();
try {
// 删除礼品/券库信息
GiftTicketTUse::deleteAll('order_id=' . $order_info->id);
// 修改订单礼品/券信息
OrderGiftT::updateAll(['gift_src' => ''], ['order_id' => $order_info->id]);
// 修改订单状态
$order_info->gift_status = 0;
$order_info->save();
$this->addLog($order_info->car_id, '回退礼品状态,理由:' . $msg, 1);
$tran->commit();
} catch (\Exception $e) {
$tran->rollBack();
$result['msg'] = '订单不存在';
$result['msg'] = $e->getMessage();
return $result;
}
$result['success'] = true;
return $result;
}
public function getGift($k, $v, $car_no, $order_info, $order_gift_id) public function getGift($k, $v, $car_no, $order_info, $order_gift_id)
{ {
$result = array(); $result = array();
@ -3495,8 +3566,7 @@ class InsurerController extends BaseController
//礼券 //礼券
if ($gift_info && $gift_info->type_id == 2) { if ($gift_info && $gift_info->type_id == 2) {
$pinyin_arr = explode(' ', $gift_info->pinyin_name); $pinyin_arr = explode(' ', $gift_info->pinyin_name);
// dd($pinyin_arr); $liquan_str = 'wf';
$liquan_str = 'ch';
//获取礼券拼音首字母 //获取礼券拼音首字母
foreach ($pinyin_arr as $first) { foreach ($pinyin_arr as $first) {
$liquan_str .= substr($first, 0, 1); $liquan_str .= substr($first, 0, 1);
@ -3513,13 +3583,12 @@ class InsurerController extends BaseController
if ($gift_use) { if ($gift_use) {
$liquan_str .= sprintf("%04d", $gift_use->gift_shuzi + 1); $liquan_str .= sprintf("%04d", $gift_use->gift_shuzi + 1);
$new_gift_use->gift_shuzi = $gift_use->gift_shuzi + 1; $new_gift_use->gift_shuzi = $gift_use->gift_shuzi + 1;
$new_gift_use->code = $liquan_str;
} else { } else {
$liquan_str .= sprintf("%04d", 1); $liquan_str .= sprintf("%04d", 1);
$new_gift_use->gift_shuzi = 1; $new_gift_use->gift_shuzi = 1;
$new_gift_use->code = strtoupper($liquan_str);
} }
$new_gift_use->code = strtoupper($liquan_str);
$new_gift_use->op_id = $this->my->id; $new_gift_use->op_id = $this->my->id;
$new_gift_use->type_id = $v; //礼券ID $new_gift_use->type_id = $v; //礼券ID
$new_gift_use->input_date = date('Y-m-d H:i:s'); $new_gift_use->input_date = date('Y-m-d H:i:s');
@ -3544,7 +3613,7 @@ class InsurerController extends BaseController
if ($shiwu_use) { if ($shiwu_use) {
$new_shiwu->gift_shuzi = $shiwu_use->gift_shuzi + 1; $new_shiwu->gift_shuzi = $shiwu_use->gift_shuzi + 1;
$new_shiwu->code = sprintf("%04d", $gift_use->gift_shuzi + 1); $new_shiwu->code = sprintf("%04d", $shiwu_use->gift_shuzi + 1);
} else { } else {
$new_shiwu->gift_shuzi = 1; $new_shiwu->gift_shuzi = 1;
$new_shiwu->code = sprintf("%04d", 1); $new_shiwu->code = sprintf("%04d", 1);
@ -3574,7 +3643,6 @@ class InsurerController extends BaseController
$imgstr = '@frontend/web/upload/images/'.date('Ym'); $imgstr = '@frontend/web/upload/images/'.date('Ym');
$imgstr .= '/gift' . $name . '' . $datetime . '.png'; $imgstr .= '/gift' . $name . '' . $datetime . '.png';
FileHelper::createDirectory(dirname(str_replace('@frontend/web/', '',$imgstr))); FileHelper::createDirectory(dirname(str_replace('@frontend/web/', '',$imgstr)));
//生成新的图片 //生成新的图片
if ($gift_info && $gift_info->type_id == 1) { // 实物 if ($gift_info && $gift_info->type_id == 1) { // 实物
\yii\imagine\Image::thumbnail('@frontend/web/images/gift.png', 400, 252) \yii\imagine\Image::thumbnail('@frontend/web/images/gift.png', 400, 252)
@ -3593,23 +3661,25 @@ class InsurerController extends BaseController
->save(Yii::getAlias($imgstr)); ->save(Yii::getAlias($imgstr));
} elseif ($gift_info && $gift_info->type_id == 2) { } elseif ($gift_info && $gift_info->type_id == 2) {
if($gift_info->original_img == '') {
throw new \Exception('礼券文件不存在');
}
$liquanSrc = '@frontend/web' . $gift_info->original_img; $liquanSrc = '@frontend/web' . $gift_info->original_img;
\yii\imagine\Image::thumbnail($liquanSrc, 1097, 979) \yii\imagine\Image::thumbnail($liquanSrc, 1097, 979)
->save(Yii::getAlias($imgstr), ->save(Yii::getAlias($imgstr),
['quality' => 100]);//生成缩略图的质量 ['quality' => 100]);//生成缩略图的质量
//图片打水印 //图片打水印
$bianhao = '券号:' . $bianhao; $bianhao = '券号:' . $bianhao;
\yii\imagine\Image::text($liquanSrc, $bianhao, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [325, 85], ['color' => 'ffffff', 'size' => 14]) \yii\imagine\Image::text($liquanSrc, $bianhao, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [20, 20], ['color' => '000000', 'size' => 14])
->save(Yii::getAlias($imgstr)); ->save(Yii::getAlias($imgstr));
\yii\imagine\Image::text($imgstr, $car_no, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [900, 400], ['color' => 'ffffff', 'size' => 16]) \yii\imagine\Image::text($imgstr, $car_no, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [425, 200], ['color' => '000000', 'size' => 16])
->save(Yii::getAlias($imgstr)); ->save(Yii::getAlias($imgstr));
$panduan = \yii\imagine\Image::text($imgstr, $endDate, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [850, 440], ['color' => 'ffffff', 'size' => 16]) $panduan = \yii\imagine\Image::text($imgstr, $endDate, Yii::getAlias('@frontend/web/fonts/msyh.ttc'), [425, 223], ['color' => '000000', 'size' => 16])
->save(Yii::getAlias($imgstr)); ->save(Yii::getAlias($imgstr));
} }
$gift_src = str_replace('@frontend/web', '', $imgstr); $gift_src = str_replace('@frontend/web', '', $imgstr);
//保存order_gift_t表里png文件地址 //保存order_gift_t表里png文件地址
@ -3620,4 +3690,100 @@ class InsurerController extends BaseController
} }
} }
} /**
* 退单操作(超管权限任意状态退单)
* @return array
* @throws \Exception
*/
public function actionSupperReturn()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '操作失败';
if($request->isPost) {
$order_id = $request->post('order_id',0);
$return_remark = $request->post('return_remark');
if ($order_id < 0) {
$result['msg'] = '订单ID无效';
return $result;
}
if($return_remark == ''){
$result['msg'] = '请填写退单理由!';
return $result;
}
$order_info = OrderT::findOne(['id'=>$order_id]);
if(empty($order_info)) {
$result['msg'] = '保单信息不存在!';
return $result;
}
// 订单信息更新
$order_info->return_status_id = $order_info->status_id;
if($order_info->return_status_id == 0) $order_info->return_status_id = 2;
$order_info->lock_id = 0;
$order_info->status_id = 1;
$order_info->return_remark = $return_remark;
$order_info->return_time = time();
$order_info->gift_status = 0;
// 车辆信息处理
$car_info = $order_info->car;
if ($car_info->op2_id > 0) { //续保
$car_info->location = 4;
}else {
$car_info->location = 2;
$car_info->is_xubao = 0;
}
// $car_info->user_id = $order_info->user_id;
$tran = OrderT::getDb()->beginTransaction();
try {
if(!$car_info->save()) {
throw new \Exception(print_r($car_info->getErrors(), true));
}
// 财务处理
CaiwuT::deleteAll(['order_id'=>$order_info->id]);
OrderCaiwuT::deleteAll(['order_id'=>$order_info->id]);
OrderUserT::deleteAll(['order_id'=>$order_info->id]);
// 车辆信息
CarCT::deleteAll(['id' => $order_info->car_id]);
// 检测车辆是否移库
if($car_info->op2_id > 0 && $car_info->location != 4){
$car_db_info = new CarDT(false);
$car_db_info->id = $order_info->car_id;
$car_db_info->user_id = $order_info->user_id;
if(!$car_db_info->save()) {
throw new \Exception(print_r($car_db_info->getErrors(), true));
}
}
if(!$order_info->car->op2_id && $order_info->car->location != 2){
$car_db_info = new CarBT(false);
$car_db_info->id = $order_info->car_id;
$car_db_info->user_id = $order_info->user_id;
if(!$car_db_info->save()) {
throw new \Exception(print_r($car_db_info->getErrors(), true));
}
}
// 礼品状态回退
GiftTicketTUse::deleteAll('order_id=' . $order_info->id);
OrderGiftT::updateAll(['gift_src' => ''], ['order_id' => $order_info->id]);
$this->addLog($order_info->car_id,'超管退单,理由是:'.$return_remark,1);
if(!$order_info->save()) {
throw new \Exception(print_r($order_info->getErrors(), true));
}
$tran->commit();
$result['success'] = true;
$result['msg'] = '操作成功';
} catch (\Exception $e) {
$tran->rollBack();
$result['msg'] = '操作失败,' . $e->getMessage();
}
}
return $result;
}
}

@ -110,6 +110,31 @@ class MarketingStrategyController extends UserBaseController
return $result; return $result;
} }
public function actionDelete() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
$id = $request->post('id',0);
if($id == 0)
return $result;
$tichengTypeT = ZhongjiYingxiao::findOne(['id'=>$id]);
if($tichengTypeT) {
$tichengTypeT->is_delete = 1;
$tichengTypeT->save();
}
$result['success'] = true;
$result['msg'] = '删除成功';
return $result;
}
public function actionUsers() { public function actionUsers() {
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->get('id'); $id = $request->get('id');
@ -467,7 +492,7 @@ class MarketingStrategyController extends UserBaseController
$total1_clear = $request->post('total1_clear', 0); $total1_clear = $request->post('total1_clear', 0);
$car_no = $request->post('car_no'); $car_no = $request->post('car_no');
$car_use_id = $request->post('car_use_id', 0); $car_use_id = $request->post('car_use_id', 0);
$company2_id = $request->post('company2_id', 0); $company_id = $request->post('company_id', 0);
$car_info = CarT::findOne($car_id); $car_info = CarT::findOne($car_id);
if(!$car_info) { if(!$car_info) {
@ -484,7 +509,7 @@ class MarketingStrategyController extends UserBaseController
} }
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$query = ZhongjiYingxiao::find() $query = ZhongjiYingxiao::find()
->where('begin_date<=:begin_date and end_date>=:end_date',[':begin_date'=>$date,':end_date'=>$date]) ->where('is_delete=0 and begin_date<=:begin_date and end_date>=:end_date',[':begin_date'=>$date,':end_date'=>$date])
->andWhere(['in','id',$celuo_ids]) ->andWhere(['in','id',$celuo_ids])
->orderBy('id desc'); ->orderBy('id desc');
$yingxiao_item = $query->one(); $yingxiao_item = $query->one();
@ -493,49 +518,73 @@ class MarketingStrategyController extends UserBaseController
} }
$items = ZhongjiTiaojian::find() $items = ZhongjiTiaojian::find()
->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id]) ->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id])
->andWhere(['<','baofei', $total1_clear]) ->andWhere(['<=','baofei', $total1_clear])
->all(); ->all();
$ids = []; $ids = [];
$flags = [];
foreach($items as $item) { foreach($items as $item) {
$flag = false;
//车牌 //车牌
$flags[0] = 0;
if($item->car_type_id != '') { if($item->car_type_id != '') {
$car_type_ids = explode(',',$item->car_type_id); $car_type_ids = explode(',',$item->car_type_id);
$tmp_type_id = 1; $tmp_type_id = 1;
if(mb_substr($car_no, 0, 1, 'utf-8') != '京') if(mb_substr($car_no, 0, 1, 'utf-8') != '京')
$tmp_type_id = 2; $tmp_type_id = 2;
if(in_array($tmp_type_id, $car_type_ids)) { if(in_array($tmp_type_id, $car_type_ids)) {
$flag = true; $flags[0] = 1;
} else {
$flags[0] = -1;
} }
} }
//保险公司 //保险公司
$flags[1] = 0;
if($item->company_ids != '') { if($item->company_ids != '') {
$company_ids = explode(',',$item->company_ids); $company_ids = explode(',',$item->company_ids);
if(in_array($company2_id, $company_ids)) { if(in_array($company_id, $company_ids)) {
$flag = true; $flags[1] = 1;
} else {
$flags[1] = -1;
} }
} }
//车辆使用类型 //车辆使用类型
$flags[2] = 0;
if($item->car_use_id != '') { if($item->car_use_id != '') {
$car_use_ids = explode(',',$item->car_use_id); $car_use_ids = explode(',',$item->car_use_id);
if(in_array($car_use_id, $car_use_ids)) { if(in_array($car_use_id, $car_use_ids)) {
$flag = true; $flags[2] = 1;
} else {
$flags[2] = -1;
} }
} }
//新保、续保 //新保、续保
$flags[3] = 0;
if($item->type_ids != '') { if($item->type_ids != '') {
$type_ids = explode(',',$item->type_ids); $type_ids = explode(',',$item->type_ids);
$tmp_type_id = 1; $tmp_type_id = 1;
if($car_info->is_xubao > 0) if($car_info->is_xubao > 0)
$tmp_type_id = 2; $tmp_type_id = 2;
if(in_array($tmp_type_id, $type_ids)) { if(in_array($tmp_type_id, $type_ids)) {
$flag = true; $flags[3] = 1;
} else {
$flags[3] = -1;
}
}
$flag = true;
foreach($flags as $tmp_flag) {
if($tmp_flag == 0) continue;
if($tmp_flag == -1) {
$flag = false;
break;
} }
} }
if($flag) { if($flag) {
$ids[] = $item->id; $ids[] = $item->id;
} }
} }
if(count($ids) == 0) {
return $result;
}
$result['success'] = true; $result['success'] = true;
$result['ids'] = join(',',$ids); $result['ids'] = join(',',$ids);
$result['celuo_id'] = $yingxiao_item->id; $result['celuo_id'] = $yingxiao_item->id;
@ -586,8 +635,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])
@ -601,6 +652,12 @@ 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_gift = GiftT::find()->where('id='.$gift_info['id'])->one();
if($tmp_gift && $tmp_gift->type_id == 2) {
$tmp_row['gifts'][$index]['img_src'] = $order_gift_srcs[$gift_info['id']];
} else {
$tmp_row['gifts'][$index]['img_src'] = '';
}
} else { } else {
$tmp_row['gifts'][$index]['selected'] = 0; $tmp_row['gifts'][$index]['selected'] = 0;
} }

@ -10,6 +10,7 @@ namespace frontend\controllers;
use common\models\FixCarT; use common\models\FixCarT;
use common\models\UserT; use common\models\UserT;
use GuzzleHttp\Client;
use yii\base\Controller; use yii\base\Controller;
use common\libs\MyLib; use common\libs\MyLib;
use common\models\AppointmentT; use common\models\AppointmentT;
@ -277,6 +278,10 @@ public function actionDownload(){
$data['rows'] = []; $data['rows'] = [];
foreach($sub_items as $item) { foreach($sub_items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['status'] = '';
if($item->bind_id != '') {
$row['status'] = '已绑定';
}
$data['rows'][] = $row; $data['rows'][] = $row;
} }
@ -315,7 +320,6 @@ public function actionDownload(){
$phone = $request->post('phone',''); $phone = $request->post('phone','');
$is_double = $request->post('is_double',0); $is_double = $request->post('is_double',0);
if($user_id == 0) { if($user_id == 0) {
$result['msg'] = '请输入人员名称!'; $result['msg'] = '请输入人员名称!';
return $result; return $result;
@ -326,14 +330,33 @@ public function actionDownload(){
return $result; return $result;
} }
$tran = NetworkPhoneAssignT::getDb()->beginTransaction(); $tran = NetworkPhoneAssignT::getDb()->beginTransaction();
try { try {
$row = null; $row = null;
if($id > 0) { if($id > 0) {
$row = NetworkPhoneAssignT::findOne(['id'=>$id]); $row = NetworkPhoneAssignT::findOne(['id'=>$id]);
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'edit',
'phone' => $phone,
'old_phone' => $row->phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
} else { } else {
if($is_double == 0) { if($is_double == 0) {
$t = NetworkPhoneAssignT::findOne(['phone' => $phone]); $t = NetworkPhoneAssignT::findOne(['phone' => $phone]);
@ -342,6 +365,26 @@ public function actionDownload(){
return $result; return $result;
} }
} }
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'add',
'phone' => $phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
$row = new NetworkPhoneAssignT(); $row = new NetworkPhoneAssignT();
} }
$row->user_id = $user_id; $row->user_id = $user_id;
@ -382,6 +425,27 @@ public function actionDownload(){
return $result; return $result;
} }
$row = NetworkPhoneAssignT::findOne(['id'=>$id]); $row = NetworkPhoneAssignT::findOne(['id'=>$id]);
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'delete',
'phone' => $row->phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
$row->delete(); $row->delete();
$result['success'] = true; $result['success'] = true;
@ -390,7 +454,7 @@ public function actionDownload(){
$tran->commit(); $tran->commit();
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
} }
} }
@ -408,7 +472,6 @@ public function actionDownload(){
$info = new NetworkPhoneSubT(); $info = new NetworkPhoneSubT();
} }
return $this->render('sub-edit',[ return $this->render('sub-edit',[
'info' => $info, 'info' => $info,
'assign_id'=>$assign_id 'assign_id'=>$assign_id
@ -430,13 +493,12 @@ public function actionDownload(){
$is_called = $request->post('is_called'); $is_called = $request->post('is_called');
$is_double = $request->post('is_double'); $is_double = $request->post('is_double');
if($phone == '') { if($phone == '') {
$result['msg'] = '请输入电话号码!'; $result['msg'] = '请输入电话号码!';
return $result; return $result;
} }
$phone_info = NetworkPhoneAssignT::findOne(['id'=>$assign_id]);
$tran = NetworkPhoneSubT::getDb()->beginTransaction(); $tran = NetworkPhoneSubT::getDb()->beginTransaction();
@ -444,6 +506,28 @@ public function actionDownload(){
$row = null; $row = null;
if($id > 0) { if($id > 0) {
$row = NetworkPhoneSubT::findOne(['id'=>$id]); $row = NetworkPhoneSubT::findOne(['id'=>$id]);
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'sub_edit',
'phone' => $phone_info->phone,
'sub_phone' => $phone,
'old_sub_phone' => $row->phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
} else { } else {
if($is_double == 0) { if($is_double == 0) {
$t = NetworkPhoneSubT $t = NetworkPhoneSubT
@ -453,6 +537,28 @@ public function actionDownload(){
return $result; return $result;
} }
} }
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'sub_add',
'phone' => $phone_info->phone,
'sub_phone' => $phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
$row = new NetworkPhoneSubT(); $row = new NetworkPhoneSubT();
} }
$row->assign_id = $assign_id; $row->assign_id = $assign_id;
@ -463,7 +569,7 @@ public function actionDownload(){
$tran->commit(); $tran->commit();
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
$result['success'] = true; $result['success'] = true;
@ -488,6 +594,26 @@ public function actionDownload(){
try { try {
$row = NetworkPhoneSubT::findOne(['id'=>$id]); $row = NetworkPhoneSubT::findOne(['id'=>$id]);
if($row->bind_id == ''){ if($row->bind_id == ''){
$url = Yii::$app->params['userPanel']['phone_url'];
$token = Yii::$app->params['userPanel']['token'];
$params = [
'token' => $token,
'op' => 'sub_delete',
'sub_phone' => $row->phone
];
$client = new Client();
$res = $client->request('POST', $url, [
'form_params' => $params,
'http_errors' => false,
]);
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody());
if($obj->code == 400) {
$result['msg'] = $obj->msg;
return $result;
}
}
$row->delete(); $row->delete();
$result['success'] = true; $result['success'] = true;
@ -498,7 +624,7 @@ public function actionDownload(){
$tran->commit(); $tran->commit();
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
} }
} }

@ -16,6 +16,7 @@ use common\models\NetworkPhoneAssignT;
use common\models\NetworkPhoneSubT; use common\models\NetworkPhoneSubT;
use common\models\NetworkPhoneT; use common\models\NetworkPhoneT;
use GuzzleHttp\Client;
use Yii; use Yii;
use yii\console\Request; use yii\console\Request;
use yii\web\Response; use yii\web\Response;
@ -723,11 +724,30 @@ class PhoneController extends \yii\web\Controller
$phone = $request->get('phone',''); $phone = $request->get('phone','');
$user_id = $request->get('user_id',0); $user_id = $request->get('user_id',0);
//检查通话剩余分钟
$url = Yii::$app->params['userPanel']['myinfo_url'];
$token = Yii::$app->params['userPanel']['token'];
$client = new Client();
$res = $client->request('GET', $url.'?token='.$token);
$phone_time = 0;
if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody(), true);
if($obj['code'] == 400) {
$result['msg'] = $obj['msg'];
return $result;
}
$phone_time = intval($obj['data']['phone_time']);
}
if($phone_time <= 0) {
$result['msg'] = '电话剩余话费不足,请联系管理员充值';
return $result;
}
$headers = array( $headers = array(
"Content-Type: application/json;charset=UTF-8", "Content-Type: application/json;charset=UTF-8",
"Accept:application/json", "Accept:application/json",
); );
$uri = "http://api.1ketong.com/ykt-pool/number/ax2/call_out"; $uri = "http://api.1ketong.com/ykt-pool/number/ax2/call_out";
$app_key = '0946239060682011'; $app_key = '0946239060682011';
@ -737,6 +757,7 @@ class PhoneController extends \yii\web\Controller
$assign = NetworkPhoneAssignT::find()->where('user_id='.$user_id)->one(); $assign = NetworkPhoneAssignT::find()->where('user_id='.$user_id)->one();
if(!$assign){ if(!$assign){
$result['msg'] = '该账号无绑定主叫号码';
return $result; return $result;
} }
@ -748,6 +769,7 @@ class PhoneController extends \yii\web\Controller
$count = count($total_ids); $count = count($total_ids);
if($count<= 0){ if($count<= 0){
$result['msg'] = '该主叫号码无绑定子号码';
return $result; return $result;
} }

@ -97,11 +97,9 @@ class RenewalController extends BaseController
$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');
$page = $request->get('page',1);
$username = $request->get('username'); $username = $request->get('username');
$sort_key = $request->get('sort_key','appointment_t.pdate'); $sort_key = $request->get('sort_key','appointment_t.pdate');
$sort_value = $request->get('sort_value','ASC'); $sort_value = $request->get('sort_value','ASC');
$user_id = $request->get('user_id');
$offset = $request->get('offset',0); $offset = $request->get('offset',0);
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
@ -118,7 +116,7 @@ class RenewalController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"'); $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"'); $query->andWhere('car_t.car_man_phone like "'.$phone.'"');
} }
if($car_no != '') { if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"'); $query->andWhere('car_t.car_no like "'.$car_no.'"');
@ -199,7 +197,7 @@ class RenewalController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); $query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"'); $query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
} }
if($ptype > 0) { if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype); $query = $query->andWhere('appointment_t.ptype='.$ptype);
@ -276,7 +274,7 @@ class RenewalController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); $query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"'); $query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
} }
if($ptype > 0) { if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype); $query = $query->andWhere('appointment_t.ptype='.$ptype);

@ -21,8 +21,21 @@ class StatisticsController extends BaseController
public $enableCsrfValidation = false; public $enableCsrfValidation = false;
public $layout = 'blue-main'; public $layout = 'blue-main';
public function actionWork() public function actionWork() {
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002')
$group_items = GroupT::getTree();
$company_items = InsurerCompanyT::find()
->all();
return $this->render('work',[
'group_items' => $group_items,
'company_items' => $company_items
]);
}
public function actionWorkJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$date_begin = $request->get('date_begin',date('Y-m-d')); $date_begin = $request->get('date_begin',date('Y-m-d'));
$date_end = $request->get('date_end',date('Y-m-d')); $date_end = $request->get('date_end',date('Y-m-d'));
@ -31,9 +44,7 @@ class StatisticsController extends BaseController
$username = $request->get('username'); $username = $request->get('username');
$group_id = $request->get('group_id'); $group_id = $request->get('group_id');
$company_id = $request->get('company_id'); $company_id = $request->get('company_id');
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002')
$group_items = GroupT::getTree();
$group_ids[] = $group_id; $group_ids[] = $group_id;
if($group_id > 0) { if($group_id > 0) {
$items = GroupT::getTree($group_id); $items = GroupT::getTree($group_id);
@ -42,12 +53,6 @@ class StatisticsController extends BaseController
} }
} }
// 原来的搜索条件
// $userSql = '';
// if($username != '') {
// $userSql = ' username like "'.$username.'"';
// }
// 现在的搜索条件 // 现在的搜索条件
$userSql = ''; $userSql = '';
if($username != '') { if($username != '') {
@ -58,8 +63,6 @@ class StatisticsController extends BaseController
$user_items = $this->my->getChildren($userSql); $user_items = $this->my->getChildren($userSql);
if($this->my->username == '6002') if($this->my->username == '6002')
$user_items = $this->my->getChildren($userSql,1); $user_items = $this->my->getChildren($userSql,1);
// $user_items[] = $this->my;
//var_dump($user_items);
$user_rows = array(); $user_rows = array();
$sum_total = array(); $sum_total = array();
$sum_total[0] = ''; $sum_total[0] = '';
@ -95,22 +98,21 @@ class StatisticsController extends BaseController
->where('user_id='.$user_info->id.' and status_id>1') ->where('user_id='.$user_info->id.' and status_id>1')
->andWhere('insurance_status=1 or insurance_status=3'); ->andWhere('insurance_status=1 or insurance_status=3');
if($date_begin != '') { if($date_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"'); $tmp_query->andWhere('submit_date>="'.$date_begin.'"');
} }
if($date_end != '') { if($date_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date_end.'"'); $tmp_query->andWhere('submit_date<="'.$date_end.'"');
} }
if($date2_begin != '') { if($date2_begin != '') {
$tmp_query = $tmp_query->andWhere('print_date>="'.$date2_begin.'"'); $tmp_query->andWhere('print_date>="'.$date2_begin.'"');
} }
if($date2_end != '') { if($date2_end != '') {
$tmp_query = $tmp_query->andWhere('print_date<="'.$date2_end.'"'); $tmp_query->andWhere('print_date<="'.$date2_end.'"');
} }
if($company_id > 0) { if($company_id > 0) {
$tmp_query = $tmp_query->andWhere('company_id='.$company_id); $tmp_query->andWhere('company_id='.$company_id);
} }
// exit;
foreach($tmp_query->each() as $item) { foreach($tmp_query->each() as $item) {
$total[0]++; $total[0]++;
//提单总数 //提单总数
@ -129,16 +131,16 @@ class StatisticsController extends BaseController
$tmp_query = FixCarT::find() $tmp_query = FixCarT::find()
->where('user_id='.$user_info->id.' and status>0'); ->where('user_id='.$user_info->id.' and status>0');
if($date_begin != '') { if($date_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"'); $tmp_query->andWhere('submit_date>="'.$date_begin.'"');
} }
if($date_end != '') { if($date_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date_end.'"'); $tmp_query->andWhere('submit_date<="'.$date_end.'"');
} }
if($date2_begin != '') { if($date2_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date2_begin.'"'); $tmp_query->andWhere('submit_date>="'.$date2_begin.'"');
} }
if($date2_end != '') { if($date2_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date2_end.'"'); $tmp_query->andWhere('submit_date<="'.$date2_end.'"');
} }
$total[7] = $tmp_query->count(); $total[7] = $tmp_query->count();
@ -146,7 +148,6 @@ class StatisticsController extends BaseController
$phone_time = ''; $phone_time = '';
$query = PhoneDayT::find() $query = PhoneDayT::find()
->where('user_id='.$user_info->id.' and call_date>="'.$date_begin.'" and call_date<="'.$date_end.'"'); ->where('user_id='.$user_info->id.' and call_date>="'.$date_begin.'" and call_date<="'.$date_end.'"');
// echo $query->createCommand()->rawSql;
$items = $query->all(); $items = $query->all();
$call_time = 0; $call_time = 0;
foreach($items as $item) { foreach($items as $item) {
@ -163,7 +164,6 @@ class StatisticsController extends BaseController
$row['total'] = $total; $row['total'] = $total;
$user_rows[] = $row; $user_rows[] = $row;
// $sum_total[0] += $total[0];
$sum_total[1] += $total[1]; $sum_total[1] += $total[1];
$sum_total[2] += $total[2]; $sum_total[2] += $total[2];
$sum_total[3] += $total[3]; $sum_total[3] += $total[3];
@ -173,23 +173,37 @@ class StatisticsController extends BaseController
$sum_total[7] += $total[7]; $sum_total[7] += $total[7];
} }
$company_items = InsurerCompanyT::find() $data = [];
->all(); $data['total'] = count($user_rows);
$data['rows'] = [];
return $this->render('work',[ foreach($user_rows as $item) {
'user_rows' => $user_rows, $row = $item;
'date_begin' => $date_begin, $row['total_0'] = $item['total'][0]!=''?$item['total'][0]:'';
'date_end' => $date_end, $row['total_7'] = $item['total'][7]>0?$item['total'][7]:'';
'date2_begin' => $date2_begin, $row['total_1'] = $item['total'][1]>0?$item['total'][1]:'';
'date2_end' => $date2_end, $row['total_2'] = $item['total'][2]>0?'¥'.number_format($item['total'][2],2):'';
'username' => $username, $row['total_3'] = $item['total'][3]>0?'¥'.number_format($item['total'][3],2):'';
'sum_total' => $sum_total, $row['total_4'] = $item['total'][4]>0?'¥'.number_format($item['total'][4],2):'';
'group_id' => $group_id, $row['total_5'] = $item['total'][5]>0?'¥'.number_format($item['total'][5],2):'';
'group_items' => $group_items, $row['total_6'] = $item['total'][6]>0?'¥'.number_format($item['total'][6],2):'';
'company_items' => $company_items, $row['op'] = 1;
'company_id' => $company_id $data['rows'][] = $row;
]); }
$row = [];
$row['username'] = '汇总';
$row['total_7'] = $sum_total[7]>0?$sum_total[7]:'';
$row['total_1'] = $sum_total[1]>0?$sum_total[1]:'';
$row['total_2'] = $sum_total[2]>0?'¥'.number_format($sum_total[2],2):'';
$row['total_3'] = $sum_total[3]>0?'¥'.number_format($sum_total[3],2):'';
$row['total_4'] = $sum_total[4]>0?'¥'.number_format($sum_total[4],2):'';
$row['total_5'] = $sum_total[5]>0?'¥'.number_format($sum_total[5],2):'';
$row['total_6'] = $sum_total[6]>0?'¥'.number_format($sum_total[6],2):'';
$row['op'] = 0;
$data['rows'][] = $row;
return $data;
} }
public function actionCleanWork() public function actionCleanWork()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -210,7 +224,6 @@ class StatisticsController extends BaseController
} }
} }
// 现在的搜索条件
$userSql = ''; $userSql = '';
if($username != '') { if($username != '') {
$userSql = ' username like "'.$username.'" and '; $userSql = ' username like "'.$username.'" and ';
@ -221,7 +234,7 @@ class StatisticsController extends BaseController
if($this->my->username == '6002') if($this->my->username == '6002')
$user_items = $this->my->getChildrenClean($userSql,1); $user_items = $this->my->getChildrenClean($userSql,1);
$user_items[] = $this->my; $user_items[] = $this->my;
//var_dump($user_items);
$user_rows = array(); $user_rows = array();
$sum_total = array(); $sum_total = array();
$sum_total[0] = 0; $sum_total[0] = 0;
@ -255,21 +268,6 @@ class StatisticsController extends BaseController
$tmp_query = $tmp_query->andWhere('company_id='.$company_id); $tmp_query = $tmp_query->andWhere('company_id='.$company_id);
} }
// exit;
// foreach($tmp_query->each() as $item) {
// $total[0]++;
// //提单总数
// if ($item->status_id > 0) {
// $total[1]++;
// $total[2] += $item->total1_clear;//提单总净保费
// $total[3] += $item->total2_clear;//交强总净保费
// if($item->status_id > 5) {
// $total[4] += $item->total1_clear;//商业已收净保费
// $total[5] += $item->total2_clear;//商业已收净保费
// }
// $total[6] += $item->total1_clear + $item->total2_clear;//总签单净保费
// }
// }
$total['right_num']=$tmp_query->sum('right_num'); $total['right_num']=$tmp_query->sum('right_num');
$total['wrong_num']=$tmp_query->sum('wrong_num'); $total['wrong_num']=$tmp_query->sum('wrong_num');
$total['yuyue_num']=$tmp_query->sum('yuyue_num'); $total['yuyue_num']=$tmp_query->sum('yuyue_num');
@ -285,11 +283,6 @@ class StatisticsController extends BaseController
$sum_total[1] += $total['wrong_num']; $sum_total[1] += $total['wrong_num'];
$sum_total[2] += $total['yuyue_num']; $sum_total[2] += $total['yuyue_num'];
// $sum_total[3] += $total[3];
// $sum_total[4] += $total[4];
// $sum_total[5] += $total[5];
// $sum_total[6] += $total[6];
} }
$company_items = InsurerCompanyT::find() $company_items = InsurerCompanyT::find()
@ -321,7 +314,7 @@ class StatisticsController extends BaseController
if($date_end != '') { if($date_end != '') {
$query = $query->andWhere('fenpei_date<="'.$date_end.'"'); $query = $query->andWhere('fenpei_date<="'.$date_end.'"');
} }
$CleanFenpei=$query ->count(); $CleanFenpei=$query ->count();
return $this->render('clean-work-zj',[ return $this->render('clean-work-zj',[
'CleanFenpei' => $CleanFenpei, 'CleanFenpei' => $CleanFenpei,
@ -510,198 +503,27 @@ class StatisticsController extends BaseController
'company_id' => $company_id 'company_id' => $company_id
]); ]);
} }
public function actionWorkInfo() {
public function actionWorkOutput()
{
$objectPHPExcel = new \PHPExcel();
$index = 1;
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$index,'工号');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$index,'真实姓名');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$index,'通时');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$index,'提车总数');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('E'.$index,'提单总数');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$index,'商业总净保费');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('G'.$index,'交强总净保费');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('H'.$index,'商业已收净保费');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('I'.$index,'交强已收净保费');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('J'.$index,'总签单净保费');
$request = Yii::$app->request; $request = Yii::$app->request;
$date_begin = $request->get('date_begin',date('Y-m-d')); $user_id = $request->get('user_id');
$date_end = $request->get('date_end',date('Y-m-d')); $date_begin = $request->get('date_begin');
$date_end = $request->get('date_end');
$date2_begin = $request->get('date2_begin'); $date2_begin = $request->get('date2_begin');
$date2_end = $request->get('date2_end'); $date2_end = $request->get('date2_end');
$username = $request->get('username'); $username = $request->get('username');
$group_id = $request->get('group_id');
$company_id = $request->get('company_id');
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002')
$group_items = GroupT::getTree();
$group_ids[] = $group_id;
if($group_id > 0) {
$items = GroupT::getTree($group_id);
foreach($items as $group_info) {
$group_ids[] = $group_info->id;
}
}
// 原来的搜索条件
// $userSql = '';
// if($username != '') {
// $userSql = ' username like "'.$username.'"';
// }
// 现在的搜索条件
$userSql = '';
if($username != '') {
$userSql = ' username like "'.$username.'" and ';
}
//$userSql .= 'is_locked=0 and is_login=1';
$user_items = $this->my->getChildren($userSql);
if($this->my->username == '6002')
$user_items = $this->my->getChildren($userSql,1);
$user_items[] = $this->my;
//var_dump($user_items);
$user_rows = array();
$sum_total = array();
$sum_total[0] = '';
$sum_total[1] = 0;
$sum_total[2] = 0;
$sum_total[3] = 0;
$sum_total[4] = 0;
$sum_total[5] = 0;
$sum_total[6] = 0;
$sum_total[7] = 0;
foreach($user_items as $user_info) {
if($user_info->is_leave == 1) continue;
if($group_id > 0) {
if(!in_array($user_info->group_id,$group_ids)) {
continue;
}
}
$total[0] = 0;
$total[1] = 0;
$total[2] = 0;
$total[3] = 0;
$total[4] = 0;
$total[5] = 0;
$total[6] = 0;
$total[7] = 0;
$row = array();
$row['id'] = $user_info->id;
$row['username'] = trim($user_info->username);
$row['truename'] = $user_info->name;
$tmp_query = OrderT::find()
->where('user_id='.$user_info->id.' and status_id>1');
if($date_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"');
}
if($date_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date_end.'"');
}
if($date2_begin != '') {
$tmp_query = $tmp_query->andWhere('print_date>="'.$date2_begin.'"');
}
if($date2_end != '') {
$tmp_query = $tmp_query->andWhere('print_date<="'.$date2_end.'"');
}
if($company_id > 0) {
$tmp_query = $tmp_query->andWhere('company_id='.$company_id);
}
$index++;
// exit;
foreach($tmp_query->each() as $item) {
$total[0]++;
//提单总数
if ($item->status_id > 0) {
$total[1]++;
$total[2] += $item->total1_clear;//提单总净保费
$total[3] += $item->total2_clear;//交强总净保费
if($item->status_id > 5) {
$total[4] += $item->total1_clear;//商业已收净保费
$total[5] += $item->total2_clear;//商业已收净保费
}
$total[6] += $item->total1_clear + $item->total2_clear;//总签单净保费
}
}
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$index,$row['username']);
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$index,$row['truename']);
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('E'.$index,$total[1]>0?$total[1]:'');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$index,$total[2]>0?'¥'.number_format($total[2],2):'');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('G'.$index,$total[3]>0?'¥'.number_format($total[3],2):'');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('H'.$index,$total[4]>0?'¥'.number_format($total[4],2):'');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('I'.$index,$total[5]>0?'¥'.number_format($total[5],2):'');
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('J'.$index,$total[6]>0?'¥'.number_format($total[6],2):'');
//提单总数
$tmp_query = FixCarT::find()
->where('user_id='.$user_info->id.' and status>0');
if($date_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"');
}
if($date_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date_end.'"');
}
if($date2_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date2_begin.'"');
}
if($date2_end != '') {
$tmp_query = $tmp_query->andWhere('submit_date<="'.$date2_end.'"');
}
$total[7] = $tmp_query->count();
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$index,$total[7]>0?$total[7]:'');
//通时
$phone_time = '';
$query = PhoneDayT::find()
->where('user_id='.$user_info->id.' and call_date>="'.$date_begin.'" and call_date<="'.$date_end.'"');
// echo $query->createCommand()->rawSql;
$items = $query->all();
$call_time = 0;
foreach($items as $item) {
$call_time += $item->call_time;
}
if($call_time > 0) {
$h = floor($call_time/3600);
$m = floor(($call_time - $h * 3600)/60);
$s = $call_time - $h * 3600 - $m * 60;
$phone_time = $h.':'.$m.':'.$s;
}
$total[0] = $phone_time;
$objectPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$index,$total[0]!=''?$total[0]:'');
$row['total'] = $total;
$user_rows[] = $row;
// $sum_total[0] += $total[0];
// $sum_total[1] += $total[1];
// $sum_total[2] += $total[2];
// $sum_total[3] += $total[3];
// $sum_total[4] += $total[4];
// $sum_total[5] += $total[5];
// $sum_total[6] += $total[6];
// $sum_total[7] += $total[7];
}
header('Content-Type: application/vnd.ms-excel;charset=utf-8');
header('Content-Disposition:attachment;filename="'.date("YmjHis").'.xls"');
header('Cache-Control: max-age=0');
$objWriter = \PHPExcel_IOFactory::createWriter($objectPHPExcel, 'Excel5');
$objWriter->save('php://output');
return $this->render('work-info',[
'user_id' => $user_id,
'date_begin' => $date_begin,
'date_end' => $date_end,
'date2_begin' => $date2_begin,
'date2_end' => $date2_end,
'username' => $username
]);
} }
public function actionWorkInfoJson()
public function actionWorkInfo()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$user_id = $request->get('user_id'); $user_id = $request->get('user_id');
$date_begin = $request->get('date_begin'); $date_begin = $request->get('date_begin');
@ -726,8 +548,7 @@ class StatisticsController extends BaseController
//提交单数 //提交单数
$tmp_query = OrderT::find() $tmp_query = OrderT::find()
->where('user_id='.$user_info->id.' and status_id>1') ->where('user_id='.$user_info->id.' and status_id>1');
->andWhere('insurance_status=1 or insurance_status=3');
if($date_begin != '') { if($date_begin != '') {
$tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"'); $tmp_query = $tmp_query->andWhere('submit_date>="'.$date_begin.'"');
} }
@ -763,17 +584,29 @@ class StatisticsController extends BaseController
$phone_time = ''; $phone_time = '';
$total[0] = $phone_time; $total[0] = $phone_time;
return $this->render('work-info',[ $data = [];
'user_info' => $user_info, $data['total'] = count($items);
'items' => $items, $data['rows'] = [];
'date_begin' => $date_begin, foreach($items as $item) {
'date_end' => $date_end, $row = $item->toArray();
'date2_begin' => $date2_begin, $row['total1_clear'] = '¥'.$item->total1_clear;
'date2_end' => $date2_end, $row['total1_real'] = '¥'.$item->total1_real;
'username' => $username, $row['total1_dis'] = '¥'.$item->total1_dis;
'total' => $total $row['total1_percent'] = '¥'.$item->total1_percent;
]); $row['status_name'] = '¥'.$item->status->name;
$row['op'] = 1;
$data['rows'][] = $row;
}
$row = [];
$row['id'] = '汇总';
$row['total1_clear'] = $total[2]?'¥'.number_format($total[2],2):'';
$row['total1_real'] = $total[8]?'¥'.number_format($total[8],2):'';
$row['total1_dis'] = $total[9]?'¥'.number_format($total[9],2):'';
$row['op'] = 0;
$data['rows'][] = $row;
return $data;
} }
public function actionFixWorkInfo() public function actionFixWorkInfo()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -1054,4 +887,4 @@ class StatisticsController extends BaseController
'total' => $total 'total' => $total
]); ]);
} }
} }

@ -19,7 +19,8 @@ class SystemController extends \yii\web\Controller
{ {
public $my = null; public $my = null;
public $web = null; public $web = null;
private $_STATE = 1; public $enableCsrfValidation = false;
public $layout = 'blue-main';
public function init() public function init()
{ {
@ -94,21 +95,27 @@ class SystemController extends \yii\web\Controller
* @author liukangle * @author liukangle
* *
*/ */
public function actionIp(){ public function actionIp() {
return $this->render('ip');
}
public function actionIpJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$name = $request->get('name');
$ips = SysIpT::find(); $ips = SysIpT::find()->orderBy('id ASC');
if($name != ''){ $total = $ips->count();
$ips = $ips->andWhere(['like','city_name',$name]); $items = $ips->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
} }
$ips = $ips->andWhere('status ='.$this->_STATE);
$data = $ips->orderBy('id ASC')->all();
return $this->render('ip',[ return $data;
'info' => $data,
'name' => $name,
]);
} }
/** /**
@ -119,7 +126,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle * @author liukangle
* *
*/ */
public function actionEdit() public function actionIpEdit()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -129,7 +136,7 @@ class SystemController extends \yii\web\Controller
} else { } else {
$info = new SysIpT(); $info = new SysIpT();
} }
return $this->render('edit',[ return $this->render('ip-edit',[
'info' => $info, 'info' => $info,
]); ]);
} }
@ -181,7 +188,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle * @author liukangle
* *
*/ */
public function actionDel() public function actionIpDelete()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
@ -194,14 +201,34 @@ class SystemController extends \yii\web\Controller
$id = $request->post('id'); $id = $request->post('id');
if($id > 0){ if($id > 0){
$row = SysIpT::findOne(['id'=>$id]); $row = SysIpT::findOne(['id'=>$id]);
$row->status = 0; if($row) {
$row->save(); $row->delete();
}
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功'; $result['msg'] = '删除成功';
} }
return $result; return $result;
} }
} }
public function actionTest() {
$items = OrderT::find()
->where('status_id=10')
->all();
foreach($items as $item) {
$car_info = $item->car;
if(!$car_info) {
echo 'error';
break;
}
$car_info->op1_id = $item->user_id;
if(!$car_info->save()) {
print_r($car_info->getErrors());
break;
}
}
return count($items);
}
} }

@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:30px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:30px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:30px;"> <div class="row" style="margin-top:30px;">
<div class="col-md-12"> <div class="col-md-12">
@ -80,6 +81,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: "/appointment/all-json", url: "/appointment/all-json",
@ -87,10 +93,6 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
multipleSelectRow: true, multipleSelectRow: true,
queryParams: function(params) { queryParams: function(params) {
o['car_man'] = $('#car_man').val();
o['phone'] = $('#phone').val();
o['car_no'] = $('#car_no').val();
o['id_man'] = $('#id_man').val();
o['limit'] = params['limit']; o['limit'] = params['limit'];
o['offset'] = params['offset']; o['offset'] = params['offset'];
return o; return o;

@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:30px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:30px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:30px;"> <div class="row" style="margin-top:30px;">
<div class="col-md-12"> <div class="col-md-12">
@ -80,6 +81,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: "/appointment/first-json", url: "/appointment/first-json",
@ -87,10 +93,6 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
multipleSelectRow: true, multipleSelectRow: true,
queryParams: function(params) { queryParams: function(params) {
o['car_man'] = $('#car_man').val();
o['phone'] = $('#phone').val();
o['car_no'] = $('#car_no').val();
o['id_man'] = $('#id_man').val();
o['limit'] = params['limit']; o['limit'] = params['limit'];
o['offset'] = params['offset']; o['offset'] = params['offset'];
return o; return o;

@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:20px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:20px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:30px;"> <div class="row" style="margin-top:30px;">
<div class="col-md-12"> <div class="col-md-12">
@ -80,6 +81,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: "/appointment/today-json", url: "/appointment/today-json",
@ -87,10 +93,6 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
multipleSelectRow: true, multipleSelectRow: true,
queryParams: function(params) { queryParams: function(params) {
o['car_man'] = $('#car_man').val();
o['phone'] = $('#phone').val();
o['car_no'] = $('#car_no').val();
o['id_man'] = $('#id_man').val();
o['limit'] = params['limit']; o['limit'] = params['limit'];
o['offset'] = params['offset']; o['offset'] = params['offset'];
return o; return o;

@ -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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -9,7 +9,7 @@ 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">
@ -89,7 +89,7 @@ use \common\libs\MyLib;
</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>

@ -34,92 +34,92 @@ use \common\libs\MyLib;
</div> </div>
<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-inline" id="carFrm"> <form role="form" class="form-inline" id="carFrm">
<input type="hidden" name="id" value="" class="form-control"> <input type="hidden" name="id" value="" class="form-control">
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label> <label class="control-label">车牌号</label>
<input type="text" name="car_no" value="" class="form-control"> <input type="text" name="car_no" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">厂牌型号</label> <label class="control-label">厂牌型号</label>
<input type="text" name="factory_model" value="" class="form-control"> <input type="text" name="factory_model" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label> <label class="control-label">品牌</label>
<select name="brand_id" id="brand_info" class="form-control"> <select name="brand_id" id="brand_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车系</label> <label class="control-label">车系</label>
<select name="series_id" id="series_info" class="form-control"> <select name="series_id" id="series_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">发动机号</label> <label class="control-label">发动机号</label>
<input type="text" name="engine_no" value="" class="form-control"> <input type="text" name="engine_no" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车架号</label> <label class="control-label">车架号</label>
<input type="text" name="car_frame_no" value="" <input type="text" name="car_frame_no" value=""
class="form-control"> class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">初登日期</label> <label class="control-label">初登日期</label>
<input type="text" class="input-date form-control" id="register_date" name="register_date" <input type="text" class="input-date form-control" id="register_date" name="register_date"
autocomplete="off" value=""/> autocomplete="off" value=""/>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">排量</label> <label class="control-label">排量</label>
<select name="displacement_id" id="displacement_info" class="form-control"> <select name="displacement_id" id="displacement_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车辆类型</label> <label class="control-label">车辆类型</label>
<select name="car_type_id" id="car_type_info" class="form-control"> <select name="car_type_id" id="car_type_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">运营性质</label> <label class="control-label">运营性质</label>
<select name="car_use_id" id="car_use_info" class="form-control"> <select name="car_use_id" id="car_use_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">座位数</label> <label class="control-label">座位数</label>
<input type="text" name="seats" value="" class="form-control"> <input type="text" name="seats" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">年份</label> <label class="control-label">年份</label>
<input type="text" name="car_year" value="" class="form-control"> <input type="text" name="car_year" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车主</label> <label class="control-label">车主</label>
<input type="text" name="car_man" value="" class="form-control"> <input type="text" name="car_man" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">联系电话</label> <label class="control-label">联系电话</label>
<input type="text" name="phone" value="" class="form-control"> <input type="text" name="phone" value="" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">证件号码</label> <label class="control-label">证件号码</label>
<input type="text" name="car_man_number" value="" <input type="text" name="car_man_number" value=""
class="form-control"> class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">商业止保日期</label> <label class="control-label">商业止保日期</label>
<input type="text" class="input-date form-control" id="insurer1_date" name="insurer1_date" <input type="text" class="input-date form-control" id="insurer1_date" name="insurer1_date"
autocomplete="off" value=""/> autocomplete="off" value=""/>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">交强止保日期</label> <label class="control-label">交强止保日期</label>
<input type="text" class="input-date form-control" id="insurer2_date" name="insurer2_date" <input type="text" class="input-date form-control" id="insurer2_date" name="insurer2_date"
autocomplete="off" value=""/> autocomplete="off" value=""/>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label> <label class="control-label">保险公司</label>
<input type="text" name="company" value="" class="form-control"> <input type="text" name="company" value="" class="form-control">
</div> </div>
<div class="form-group col-md-12" style="margin-bottom: 8px;"> <div class="form-group col-sm-12" style="margin-bottom: 8px;">
<label class="control-label">备注</label> <label class="control-label">备注</label>
<textarea class="form-control" name="remark" <textarea class="form-control" name="remark"
style="width: calc(100% - 155px);min-height: 100px;"></textarea> style="width: calc(100% - 155px);min-height: 100px;"></textarea>
@ -241,15 +241,15 @@ use \common\libs\MyLib;
</div> </div>
<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-inline clearfix" id="appointmentFrm"> <form role="form" class="form-inline clearfix" id="appointmentFrm">
<input type="hidden" name="car_id" class="car_id" value=""/> <input type="hidden" name="car_id" class="car_id" value=""/>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约日期</label> <label class="control-label">预约日期</label>
<input type="text" class="input-date form-control" id="pdate" name="pdate" autocomplete="off" <input type="text" class="input-date form-control" id="pdate" name="pdate" autocomplete="off"
value=""/> value=""/>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约时间</label> <label class="control-label">预约时间</label>
<select name="ptime" class="form-control"> <select name="ptime" class="form-control">
<option>08:00</option> <option>08:00</option>
@ -272,35 +272,35 @@ use \common\libs\MyLib;
<option>17:00</option> <option>17:00</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约类型</label> <label class="control-label">预约类型</label>
<select name="ptype" id="appointment_type_info" class="form-control"> <select name="ptype" id="appointment_type_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">当天预约人数</label> <label class="control-label">当天预约人数</label>
<input type="text" id="day_count" value="0" disabled class="form-control"> <input type="text" id="day_count" value="0" disabled class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">业务分组</label> <label class="control-label">业务分组</label>
<select name="business_group_id" id="business_group_info" class="form-control"></select> <select name="business_group_id" id="business_group_info" class="form-control"></select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约备注</label> <label class="control-label">预约备注</label>
<textarea class="form-control" name="remark"></textarea> <textarea class="form-control" name="remark"></textarea>
</div> </div>
<div class="form-group col-md-3" id="appointment_btn" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" id="appointment_btn" style="margin-bottom: 8px;">
<button type="button" class="btn btn-primary" onclick="appointmentSave()">预约保存</button> <button type="button" class="btn btn-primary" onclick="appointmentSave()">预约保存</button>
<button type="button" class="btn btn-primary" onclick="nextInfo()">下一个</button> <button type="button" class="btn btn-primary" onclick="nextInfo()">下一个</button>
<button type="button" class="btn btn-primary" onclick="goBack()">返回</button> <button type="button" class="btn btn-primary" onclick="goBack()">返回</button>
</div> </div>
<hr> <hr>
<div class="form-group col-md-13" style="margin-bottom: 8px;"> <div class="form-group col-sm-13" style="margin-bottom: 8px;">
<label class="control-label">无效数据</label> <label class="control-label">无效数据</label>
<select name="invalid_id" id="invalid_info" class="form-control"> <select name="invalid_id" id="invalid_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-13" style="margin-bottom: 8px;"> <div class="form-group col-sm-13" style="margin-bottom: 8px;">
<button type="button" class="btn btn-primary m-l" onclick="appointmentInvalid()">无效数据</button> <button type="button" class="btn btn-primary m-l" onclick="appointmentInvalid()">无效数据</button>
</div> </div>
</form> </form>
@ -335,7 +335,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="insurer_order_table"> <table id="insurer_order_table">
<thead> <thead>
<tr> <tr>
@ -367,7 +367,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="new_gift_table"> <table id="new_gift_table">
<thead> <thead>
<tr> <tr>
@ -381,7 +381,7 @@ use \common\libs\MyLib;
</table> </table>
</div> </div>
<hr> <hr>
<div class="col-md-12"> <div class="col-sm-12">
<table id="old_gift_table"> <table id="old_gift_table">
<thead> <thead>
<tr> <tr>
@ -412,7 +412,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="car_history_table"> <table id="car_history_table">
<thead> <thead>
<tr> <tr>

@ -30,83 +30,83 @@ use \common\libs\MyLib;
</div> </div>
<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-inline" id="carFrm"> <form role="form" class="form-inline" id="carFrm">
<input type="hidden" name="id" value="" class="form-control"> <input type="hidden" name="id" value="" class="form-control">
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label> <label class="control-label">车牌号</label>
<span class="car-info" data-name="car_no"></span> <span class="car-info" data-name="car_no"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">厂牌型号</label> <label class="control-label">厂牌型号</label>
<span class="car-info" data-name="factory_model"></span> <span class="car-info" data-name="factory_model"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label> <label class="control-label">品牌</label>
<span class="car-info" data-name="brand_txt"></span> <span class="car-info" data-name="brand_txt"></span>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车系</label> <label class="control-label">车系</label>
<span class="car-info" data-name="series_txt"></span> <span class="car-info" data-name="series_txt"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">发动机号</label> <label class="control-label">发动机号</label>
<span class="car-info" data-name="engine_no"></span> <span class="car-info" data-name="engine_no"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车架号</label> <label class="control-label">车架号</label>
<span class="car-info" data-name="car_frame_no"></span> <span class="car-info" data-name="car_frame_no"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">初登日期</label> <label class="control-label">初登日期</label>
<span class="car-info" data-name="register_date"></span> <span class="car-info" data-name="register_date"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">排量</label> <label class="control-label">排量</label>
<span class="car-info" data-name="displacement_txt"></span> <span class="car-info" data-name="displacement_txt"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车辆类型</label> <label class="control-label">车辆类型</label>
<span class="car-info" data-name="car_type_txt"></span> <span class="car-info" data-name="car_type_txt"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">运营性质</label> <label class="control-label">运营性质</label>
<span class="car-info" data-name="car_use_txt"></span> <span class="car-info" data-name="car_use_txt"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">座位数</label> <label class="control-label">座位数</label>
<span class="car-info" data-name="seats"></span> <span class="car-info" data-name="seats"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">年份</label> <label class="control-label">年份</label>
<span class="car-info" data-name="car_year"></span> <span class="car-info" data-name="car_year"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车主</label> <label class="control-label">车主</label>
<span class="car-info" data-name="car_man"></span> <span class="car-info" data-name="car_man"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">联系电话</label> <label class="control-label">联系电话</label>
<span class="car-info" data-name="phone"></span> <span class="car-info" data-name="phone"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">证件号码</label> <label class="control-label">证件号码</label>
<span class="car-info" data-name="car_man_number"></span> <span class="car-info" data-name="car_man_number"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">商业止保日期</label> <label class="control-label">商业止保日期</label>
<span class="car-info" data-name="insurer1_date"></span> <span class="car-info" data-name="insurer1_date"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">交强止保日期</label> <label class="control-label">交强止保日期</label>
<span class="car-info" data-name="insurer2_date"></span> <span class="car-info" data-name="insurer2_date"></span>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label> <label class="control-label">保险公司</label>
<span class="car-info" data-name="company"></span> <span class="car-info" data-name="company"></span>
</div> </div>
<div class="form-group col-md-12" style="margin-bottom: 8px;"> <div class="form-group col-sm-12" style="margin-bottom: 8px;">
<label class="control-label">备注</label> <label class="control-label">备注</label>
<span class="car-info" data-name="remark"></span> <span class="car-info" data-name="remark"></span>
</div> </div>
@ -227,15 +227,15 @@ use \common\libs\MyLib;
</div> </div>
<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-inline clearfix" id="appointmentFrm"> <form role="form" class="form-inline clearfix" id="appointmentFrm">
<input type="hidden" name="car_id" class="car_id" value=""/> <input type="hidden" name="car_id" class="car_id" value=""/>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约日期</label> <label class="control-label">预约日期</label>
<input type="text" class="input-date form-control" id="pdate" name="pdate" autocomplete="off" <input type="text" class="input-date form-control" id="pdate" name="pdate" autocomplete="off"
value=""/> value=""/>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约时间</label> <label class="control-label">预约时间</label>
<select name="ptime" class="form-control"> <select name="ptime" class="form-control">
<option>08:00</option> <option>08:00</option>
@ -258,35 +258,35 @@ use \common\libs\MyLib;
<option>17:00</option> <option>17:00</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约类型</label> <label class="control-label">预约类型</label>
<select name="ptype" id="appointment_type_info" class="form-control"> <select name="ptype" id="appointment_type_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">当天预约人数</label> <label class="control-label">当天预约人数</label>
<input type="text" id="day_count" value="0" disabled class="form-control"> <input type="text" id="day_count" value="0" disabled class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">业务分组</label> <label class="control-label">业务分组</label>
<select name="business_group_id" id="business_group_info" class="form-control"></select> <select name="business_group_id" id="business_group_info" class="form-control"></select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预约备注</label> <label class="control-label">预约备注</label>
<textarea class="form-control" name="remark"></textarea> <textarea class="form-control" name="remark"></textarea>
</div> </div>
<div class="form-group col-md-3" id="appointment_btn" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" id="appointment_btn" style="margin-bottom: 8px;">
<button type="button" class="btn btn-primary" onclick="appointmentSave()">预约保存</button> <button type="button" class="btn btn-primary" onclick="appointmentSave()">预约保存</button>
<button type="button" class="btn btn-primary" onclick="nextInfo()">下一个</button> <button type="button" class="btn btn-primary" onclick="nextInfo()">下一个</button>
<button type="button" class="btn btn-primary" onclick="goBack()">返回</button> <button type="button" class="btn btn-primary" onclick="goBack()">返回</button>
</div> </div>
<hr> <hr>
<div class="form-group col-md-13" style="margin-bottom: 8px;"> <div class="form-group col-sm-13" style="margin-bottom: 8px;">
<label class="control-label">无效数据</label> <label class="control-label">无效数据</label>
<select name="invalid_id" id="invalid_info" class="form-control"> <select name="invalid_id" id="invalid_info" class="form-control">
</select> </select>
</div> </div>
<div class="form-group col-md-13" style="margin-bottom: 8px;"> <div class="form-group col-sm-13" style="margin-bottom: 8px;">
<button type="button" class="btn btn-primary m-l" onclick="appointmentInvalid()">无效数据</button> <button type="button" class="btn btn-primary m-l" onclick="appointmentInvalid()">无效数据</button>
</div> </div>
</form> </form>
@ -321,7 +321,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="insurer_order_table"> <table id="insurer_order_table">
<thead> <thead>
<tr> <tr>
@ -353,7 +353,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="new_gift_table"> <table id="new_gift_table">
<thead> <thead>
<tr> <tr>
@ -367,7 +367,7 @@ use \common\libs\MyLib;
</table> </table>
</div> </div>
<hr> <hr>
<div class="col-md-12"> <div class="col-sm-12">
<table id="old_gift_table"> <table id="old_gift_table">
<thead> <thead>
<tr> <tr>
@ -398,7 +398,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="car_history_table"> <table id="car_history_table">
<thead> <thead>
<tr> <tr>

@ -39,7 +39,7 @@ use \common\libs\MyLib;
<th class="bg-warning" nowrap>车架号</th> <th class="bg-warning" nowrap>车架号</th>
<td><?=$car_info->car_frame_no?></td> <td><?=$car_info->car_frame_no?></td>
<th class="bg-warning" nowrap>车辆使用性质</th> <th class="bg-warning" nowrap>车辆使用性质</th>
<td><?=$car_info->carUse->name?></td> <td><?=$car_info->carUse?$car_info->carUse->name:''?></td>
</tr> </tr>
<tr> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>

@ -10,6 +10,7 @@ use \common\libs\MyLib;
<div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div> <div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div>
<input id="sendMsg" type="hidden" value='{"cmd":"LINK"}' style="width: 500px;"> <input id="sendMsg" type="hidden" value='{"cmd":"LINK"}' style="width: 500px;">
<input id="recMsg" type="hidden" value='' style="width: 500px;" >
<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">
@ -181,7 +182,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
@ -249,6 +250,9 @@ use \common\libs\MyLib;
$(function() { $(function() {
search(); search();
wsInit(); wsInit();
$.get('/car/bihu-search?id=<?=$car_info->id?>',function(obj) {
console.log(obj);
}, 'json');
}); });
</script> </script>
<script> <script>
@ -311,7 +315,7 @@ use \common\libs\MyLib;
} }
} else { } else {
// 浏览器不支持 WebSocket // 浏览器不支持 WebSocket
alert("您的浏览器不支持 WebSocket!"); parent.layer.msg("您的浏览器不支持 WebSocket!");
} }
} }
@ -381,7 +385,7 @@ use \common\libs\MyLib;
ws.send(val); ws.send(val);
console.log("数据已发送"); console.log("数据已发送");
} else { } else {
alert(obj.msg); parent.layer.msg(obj.msg);
} }
},'json'); },'json');

@ -5,6 +5,8 @@ use common\models\PriceT;
?> ?>
<?php $this->beginBlock('header_css'); ?> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="/assets/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
<link href="/assets/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
@ -13,6 +15,10 @@ use common\models\PriceT;
<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="<?=$order_info->celuo_id?>"> <input type="hidden" name="celuo_id" id="celuo_id" value="<?=$order_info->celuo_id?>">
<input type="hidden" name="fanxian_id" id="fanxian_id" value="<?=$order_info->fanxian_id?>"> <input type="hidden" name="fanxian_id" id="fanxian_id" value="<?=$order_info->fanxian_id?>">
<input type="hidden" name="auto_mold_code" id="auto_mold_code" value="">
<input type="hidden" name="vehicle_year" id="vehicle_year" value="">
<input type="hidden" name="min_chesun" id="min_chesun" value="">
<input type="hidden" name="max_chesun" id="max_chesun" value="">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>保单信息</h5> <h5>保单信息</h5>
@ -25,7 +31,7 @@ use common\models\PriceT;
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><input name="register_date" class="form-control date" 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" id="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>
@ -35,9 +41,9 @@ use common\models\PriceT;
<th class="bg-warning" nowrap>发动机号</th> <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> <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> <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> <td><input name="factory_model" id="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> <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> <td><input name="purchase_price" id="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> <tr>
<th class="bg-warning">车主</th> <th class="bg-warning">车主</th>
@ -128,6 +134,11 @@ use common\models\PriceT;
<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">
<button type="button" class="btn btn-primary btn-xs" data-id="0" onclick="getCarInfo();">
<i class="fa fa-gift"></i> 获取去年险种信息
</button>
</div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<table class="table table-bordered"> <table class="table table-bordered">
@ -150,7 +161,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 insurer-select" data-id="'.$item->id.'">'; echo '<select name="types['.$item->id.']" id="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';
@ -160,7 +171,7 @@ use common\models\PriceT;
} }
echo '</select>'; echo '</select>';
} else { } else {
echo '<input name="types['.$item->id.']" class="form-control insurer-input" data-id="'.$item->id.'" style="width:100px;" type="text"'; echo '<input name="types['.$item->id.']" id="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 '>';
@ -188,11 +199,17 @@ use common\models\PriceT;
</div> </div>
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>保费信息</h5> <h5>
保费信息
<span id="total_rate" class="text-danger"></span>
</h5>
<div class="ibox-tools"> <div class="ibox-tools">
<a class="btn btn-primary btn-xs" data-id="0" href="javascript:void(0);" onclick="getYingXiao();"> <button type="button" class="btn btn-primary btn-xs" onclick="getYingXiao();">
<i class="fa fa-gift"></i> 获取策略 <i class="fa fa-gift"></i> 获取策略
</a> </button>
<button type="button" class="btn btn-danger btn-xs" onclick="calInsurance();">
<i class="fa fa-calculator"></i> 获取算费结果
</button>
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
@ -319,7 +336,7 @@ use common\models\PriceT;
</table> </table>
<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 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>
@ -336,9 +353,182 @@ use common\models\PriceT;
<?php $this->beginBlock('footer_js'); ?> <?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
<script> <script>
var o = {}; var o = {};
var fanxian_rate = 0, max_fanxian = 0; var fanxian_rate = 0, max_fanxian = 0;
//获取险种信息
function getCarInfo() {
$.get('/car/bihu-carinfo?id=<?=$car_info->id?>',function(obj) {
console.log(obj);
if(obj.code == 200) {
if(obj.data && obj.data.UserInfo) {
if(obj.data.UserInfo.NextBusinessStartDate) {
$('#insurer1_begin_date').val(obj.data.UserInfo.NextBusinessStartDate);
}
if(obj.data.UserInfo.NextForceStartDate) {
$('#insurer2_begin_date').val(obj.data.UserInfo.NextForceStartDate);
}
if(obj.data.UserInfo.CarUsedType) {
$('#car_use_id').val(parseInt(obj.data.UserInfo.CarUsedType));
}
}
if(obj.data && obj.data.SaveQuote) {
if(obj.data.SaveQuote.BoLi) {
if(obj.data.SaveQuote.BoLi == '0') $('#types_6').val('');
if(obj.data.SaveQuote.BoLi == '1') $('#types_6').val('国产');
if(obj.data.SaveQuote.BoLi == '2') $('#types_6').val('进口');
}
if(obj.data.SaveQuote.BuJiMianCheSun) {
if(obj.data.SaveQuote.BuJiMianCheSun == "0") $('#nopays_1').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianCheSun == "1") $('#nopays_1').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianChengKe) {
if(obj.data.SaveQuote.BuJiMianChengKe == "0") $('#nopays_5').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianChengKe == "1") $('#nopays_5').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianDaoQiang) {
if(obj.data.SaveQuote.BuJiMianDaoQiang == "0") $('#nopays_3').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianDaoQiang == "1") $('#nopays_3').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianHuaHen) {
if(obj.data.SaveQuote.BuJiMianHuaHen == "0") $('#nopays_7').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianHuaHen == "1") $('#nopays_7').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianSanZhe) {
if(obj.data.SaveQuote.BuJiMianSanZhe == "0") $('#nopays_2').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianSanZhe == "1") $('#nopays_2').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianSheShui) {
if(obj.data.SaveQuote.BuJiMianSheShui == "0") $('#nopays_8').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianSheShui == "1") $('#nopays_8').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianSiJi) {
if(obj.data.SaveQuote.BuJiMianSiJi == "0") $('#nopays_4').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianSiJi == "1") $('#nopays_4').prop('checked', 'checked');
}
if(obj.data.SaveQuote.BuJiMianZiRan) {
if(obj.data.SaveQuote.BuJiMianZiRan == "0") $('#nopays_9').prop('checked', '');
if(obj.data.SaveQuote.BuJiMianZiRan == "1") $('#nopays_9').prop('checked', 'checked');
}
if(obj.data.SaveQuote.CheSun) {
$('#types_1').val(obj.data.SaveQuote.CheSun);
}
if(obj.data.SaveQuote.DaoQiang) {
if(parseInt(obj.data.SaveQuote.DaoQiang) > 0) $('#types_3').val('是');
else $('#types_3').val('否');
}
if(obj.data.SaveQuote.ChengKe) {
if(obj.data.SaveQuote.ChengKe == "10000") $('#types_5').val('1万');
if(obj.data.SaveQuote.ChengKe == "20000") $('#types_5').val('2万');
if(obj.data.SaveQuote.ChengKe == "30000") $('#types_5').val('3万');
if(obj.data.SaveQuote.ChengKe == "40000") $('#types_5').val('4万');
if(obj.data.SaveQuote.ChengKe == "50000") $('#types_5').val('5万');
if(obj.data.SaveQuote.ChengKe == "100000") $('#types_5').val('10万');
}
if(obj.data.SaveQuote.SiJi) {
if(obj.data.SaveQuote.SiJi == "10000") $('#types_4').val('1万');
if(obj.data.SaveQuote.SiJi == "20000") $('#types_4').val('2万');
if(obj.data.SaveQuote.SiJi == "30000") $('#types_4').val('3万');
if(obj.data.SaveQuote.SiJi == "40000") $('#types_4').val('4万');
if(obj.data.SaveQuote.SiJi == "50000") $('#types_4').val('5万');
if(obj.data.SaveQuote.SiJi == "100000") $('#types_4').val('10万');
}
if(obj.data.SaveQuote.HcSanFangTeYue) {
if(obj.data.SaveQuote.HcSanFangTeYue == "1") $('#types_12').val('是');
else $('#types_12').val('否');
}
if(obj.data.SaveQuote.HuaHen) {
if(obj.data.SaveQuote.HuaHen == "2000") $('#types_7').val('2000元');
if(obj.data.SaveQuote.HuaHen == "5000") $('#types_7').val('5000元');
if(obj.data.SaveQuote.HuaHen == "10000") $('#types_7').val('10000元');
if(obj.data.SaveQuote.HuaHen == "20000") $('#types_7').val('20000元');
}
if(obj.data.SaveQuote.SanZhe) {
if(obj.data.SaveQuote.SanZhe == "50000") $('#types_2').val('5万');
if(obj.data.SaveQuote.SanZhe == "100000") $('#types_2').val('10万');
if(obj.data.SaveQuote.SanZhe == "150000") $('#types_2').val('15万');
if(obj.data.SaveQuote.SanZhe == "200000") $('#types_2').val('20万');
if(obj.data.SaveQuote.SanZhe == "300000") $('#types_2').val('30万');
if(obj.data.SaveQuote.SanZhe == "500000") $('#types_2').val('50万');
if(obj.data.SaveQuote.SanZhe == "1000000") $('#types_2').val('100万');
if(obj.data.SaveQuote.SanZhe == "1500000") $('#types_2').val('150万');
if(obj.data.SaveQuote.SanZhe == "2000000") $('#types_2').val('200万');
}
if(obj.data.SaveQuote.SheShui) {
if(obj.data.SaveQuote.SheShui == "1") $('#types_8').val('是');
else $('#types_8').val('否');
}
if(obj.data.SaveQuote.ZiRan) {
if(parseInt(obj.data.SaveQuote.ZiRan) > 0) $('#types_9').val('是');
else $('#types_9').val('否');
}
}
if(obj.data && obj.data.VehicleItems && obj.data.VehicleItems[0]) {
if(obj.data.VehicleItems[0].VehicleNo) {
$('#auto_mold_code').val(obj.data.VehicleItems[0].VehicleNo);
}
if(obj.data.VehicleItems[0].VehicleYear) {
$('#vehicle_year').val(obj.data.VehicleItems[0].VehicleYear);
}
if(obj.data.VehicleItems[0].VehicleName) {
$('#factory_model').val(obj.data.VehicleItems[0].VehicleName);
}
if(obj.data.VehicleItems[0].PurchasePrice) {
$('#purchase_price').val(obj.data.VehicleItems[0].PurchasePrice);
}
if(obj.data.VehicleItems[0].DepreciationPrice) {
$('#types_1').val(obj.data.VehicleItems[0].DepreciationPrice);
$('#min_chesun').val(obj.data.VehicleItems[0].DownPrice);
$('#max_chesun').val(obj.data.VehicleItems[0].UpPrice);
}
if(obj.data.VehicleItems[0].VehicleSeat) {
$('#seats').val(obj.data.VehicleItems[0].VehicleSeat);
}
}
} else {
parent.layer.msg(obj.msg);
}
}, 'json');
}
//算费
function calInsurance() {
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
var params = $('#orderFrm').serialize();
$.post('/car/post-precise-price', params, function(obj) {
if(obj.code == 200) {
$.post('/car/get-precise-price', params, function(obj) {
console.log(obj);
parent.layer.close(index);
if(obj.code == 200) {
if(obj.data && obj.data.QuoteStatus > 0) {
parent.layer.msg('获取成功');
$('#total1').val(obj.data.BizTotal.toFixed(2));
$('#total1_clear').val(($('#total1').val()/1.06).toFixed(2));
$('#total2').val(obj.data.ForceTotal.toFixed(2));
$('#total2_clear').val(($('#total2').val()/1.06).toFixed(2));
$('#total3').val(obj.data.TaxTotal.toFixed(2));
$('#total_rate').html('折扣系数:' + (obj.data.TotalRate * 100).toFixed(2) + '%');
calc();
} else {
if(obj.data) {
parent.layer.msg(obj.data.QuoteResult);
} else {
parent.layer.msg('数据为空');
}
}
} else {
parent.layer.msg(obj.msg);
}
}, 'json');
} else {
parent.layer.close(index);
parent.layer.msg(obj.msg);
}
}, 'json');
}
//获取策略 //获取策略
function getYingXiao() { function getYingXiao() {
var params = $('#orderFrm').serialize(); var params = $('#orderFrm').serialize();

@ -46,7 +46,7 @@
<label for="caller">被保险人</label> <label for="caller">被保险人</label>
<input type="text" id="id_man" name="id_man" class="form-control"> <input type="text" id="id_man" name="id_man" class="form-control">
</div> </div>
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:20px;"> <div class="row" style="margin-top:20px;">
<div class="col-md-12"> <div class="col-md-12">

@ -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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -8,6 +8,7 @@ use \common\libs\MyLib;
<div id="txt-e" style=" color: red; font-size: 18px; display: none;"></div> <div id="txt-e" style=" color: red; font-size: 18px; display: none;"></div>
<div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div> <div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div>
<input id="sendMsg" type="hidden" value='{"cmd":"LINK"}' style="width: 500px;" > <input id="sendMsg" type="hidden" value='{"cmd":"LINK"}' style="width: 500px;" >
<input id="recMsg" type="hidden" value='' style="width: 500px;" >
<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">
@ -16,18 +17,18 @@ use \common\libs\MyLib;
</div> </div>
<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="<?=$user_info->id?>"> <input type="hidden" name="id" value="<?=$user_info->id?>">
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">呼叫电话</label> <label class="col-sm-2 control-label">呼叫电话</label>
<div class="col-md-5"> <div class="col-sm-5">
<input type="text" name="phone" id="phone" value="" class="form-control" autocomplete="off"> <input type="text" name="phone" id="phone" value="" class="form-control" autocomplete="off">
</div> </div>
</div> </div>
<div> <div>
<div class="row"> <div class="row">
<div class="col-md-5 col-md-offset-3"> <div class="col-sm-5 col-sm-offset-3">
<button class="btn btn-primary btn-call" type="button"> <button class="btn btn-primary btn-call" type="button">
<strong>呼叫</strong> <strong>呼叫</strong>
</button> </button>
@ -55,6 +56,7 @@ use \common\libs\MyLib;
$(".btn-stop").click(function(){ $(".btn-stop").click(function(){
sendMsg('ATH'); sendMsg('ATH');
}); });
wsInit();
}) })
</script> </script>
<script> <script>
@ -117,7 +119,7 @@ use \common\libs\MyLib;
} }
} else { } else {
// 浏览器不支持 WebSocket // 浏览器不支持 WebSocket
alert("您的浏览器不支持 WebSocket!"); parent.layer.msg("您的浏览器不支持 WebSocket!");
} }
} }
@ -180,7 +182,7 @@ use \common\libs\MyLib;
var number_one = phone; var number_one = phone;
$.get('/phone/ax-out',{'phone':number_one,'user_id':'1'},function(obj){ $.get('/phone/ax-out',{'phone':number_one,'user_id':'<?=$user_info->id?>'},function(obj){
if(obj.success) { if(obj.success) {
@ -191,7 +193,7 @@ use \common\libs\MyLib;
ws.send(val); ws.send(val);
console.log("数据已发送"); console.log("数据已发送");
} else { } else {
alert(obj.msg); parent.layer.msg(obj.msg);
} }
},'json'); },'json');

@ -94,6 +94,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">

@ -1,75 +0,0 @@
<?php
use yii\helpers\Html;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>车务管理系统</title>
<link href="/css/left_css.css" rel="stylesheet" type="text/css">
<?=Html::csrfMetaTags() ?>
</head>
<body bgcolor="16ACFF">
<table width="170" border="0" cellpadding="0" cellspacing="0" background="/images/tablemde.jpg">
<?php
foreach($menu_items as $item) {
?>
<tr>
<td height="5" background="/images/tableline_top.jpg" bgcolor="#16ACFF"></td>
</tr>
<tr>
<td>
<TABLE width="97%" border=0 align=right cellPadding=0 cellSpacing=0 class=leftframetable>
<TBODY>
<TR>
<TD height="25" style="background:url(/images/left_tt.gif) no-repeat">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<TD width="20"></TD>
<TD class=STYLE1 style="CURSOR: hand" onclick=showsubmenu(<?=$item['id']?>); height=25><?=$item['name']?></TD>
</tr>
</table>
</TD>
</TR>
<TR>
<TD>
<TABLE id="submenu<?=$item['id']?>" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<?php
if(isset($item['children'])) {
foreach($item['children'] as $sub_item) {
?>
<TR>
<TD width="2%"><IMG src="/images/closed.gif"></TD>
<TD height=23><A href="javascript:void(0);" onclick="parent.openTab({'id':<?=$sub_item['id']?>,'name':'<?=$sub_item['name']?>','path':'<?=$sub_item['path']?>'});"><?=$sub_item['name']?></A></TD>
</TR>
<?php
}}
?>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<tr>
<td height="5" background="/images/tableline_bottom.jpg" bgcolor="#9BC2ED"></td>
</tr>
<?php
}
?>
</table>
<SCRIPT language=JavaScript>
function showsubmenu(sid) {
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none") {
eval("submenu" + sid + ".style.display=\"\";");
}
else {
eval("submenu" + sid + ".style.display=\"none\";");
}
}
</SCRIPT>
</body>
</html>

@ -1,100 +0,0 @@
<?php
use yii\helpers\Html;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>车务管理系统</title>
<link href="/css/top_css.css" rel="stylesheet" type="text/css">
<?=Html::csrfMetaTags() ?>
</head>
<body bgcolor="#03A8F6">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="194" height="60" align="center" background="/images/top_logo.png"></td>
<td align="center" style="background:url(/images/top_bg.jpg) no-repeat">
<table cellspacing="0" cellpadding="0" border="0" width="100%" height="33">
<tbody>
<tr>
<td width="0" align="left">
</td>
<td align="right">
<!-- <button disabled>不需要签入、签出</button>-->
<!-- <input id="tpy_phone" name="tpy_phone" type="Text">-->
<!-- <button id="tpy_call_in" onclick="tpy_call_in()">拨号</button>-->
<!-- <button id="tpy_call_out" onclick="tpy_call_out()">挂断</button>-->
当前用户:<?=$this->context->my->getShowName()?>&nbsp;&nbsp;
</td>
</tr>
<tr>
<td colspan="2">
<div id="tip_info">
<!-- 今日提单数:0个 未处理退单数: 0个-->
</div>
</td>
</tr>
</tbody>
</table>
<table height="26" border="0" align="right" cellpadding="0" cellspacing="0" class="subbg" NAME=t1>
<tbody>
<tr align="middle">
<td width="71" align="center" valign="middle" background="/images/top_tt_bg.gif"><a href="javascript:void(0);" class="STYLE2" onclick="parent.openTab({'id':0,'name':'修改密码','path':'/common/update-pwd'});">修改密码</a></td>
<td width="71" align="center" valign="middle" background="/images/top_tt_bg.gif"><a href="javascript:void(0);" id="logout-btn" target="_top" class="STYLE2">退出登录</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr height="6">
<td bgcolor="#1F3A65" background="/images/top_bg.jpg"></td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript">
<!--
$(function(){
$("#logout-btn").click(function(){
window.top.location.href = "/common/logout";
});
});
//-->
//太平洋测试拨号挂断
function tpy_call_in(){
var tpy_phone = $("#tpy_phone").val();
alert(tpy_phone);
if(tpy_phone == ""){
alert("请输入号码");
return false;
}
var ext_phone = '<?= $this->context->my->ext_phone ?>';
$.post('/tpy-phone/call-to',{ext_phone:ext_phone,phone_num:tpy_phone},function(obj){
if(obj.success) {
//$('#tpy_call_in').attr('disabled',true);
//$('#tpy_call_out').removeAttr('disabled');
alert(obj.msg);
}else{
alert(obj.msg);
}
},'json');
}
//太平洋测试挂断电话
function tpy_call_out(){
var ext_phone = '<?= $this->context->my->ext_phone ?>';
$.post('/tpy-phone/hang-up',{ext_phone:ext_phone},function(obj){
if(obj.success) {
//$('#tpy_call_out').attr('disabled',true);
//$('#tpy_call_in').removeAttr('disabled');
alert(obj.msg);
}else{
alert(obj.msg);
}
},'json');
}
</script>
</body>
</html>

@ -11,42 +11,42 @@ use \common\libs\MyLib;
</div> </div>
<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="<?=$user_info->id?>"> <input type="hidden" name="id" value="<?=$user_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">
<label class="form-control-static"><?=$user_info->username?></label> <label class="form-control-static"><?=$user_info->username?></label>
</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-6"> <div class="col-sm-6">
<label class="form-control-static"><?=$user_info->name?></label> <label class="form-control-static"><?=$user_info->name?></label>
</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-6"> <div class="col-sm-6">
<label class="form-control-static"><?=$user_info->phone?></label> <label class="form-control-static"><?=$user_info->phone?></label>
</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-6"> <div class="col-sm-6">
<input type="password" name="pwd" value="" class="form-control"> <input type="password" name="pwd" value="" 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-6"> <div class="col-sm-6">
<input type="password" name="re_pwd" value="" class="form-control"> <input type="password" name="re_pwd" value="" 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>修改密码</strong> <strong>修改密码</strong>
</button> </button>

@ -48,7 +48,7 @@ use \common\libs\MyLib;
<label for="datepicker1">初登日期</label> <label for="datepicker1">初登日期</label>
<div class="input-group input-daterange" id="datepicker1"> <div class="input-group input-daterange" id="datepicker1">
<input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -56,7 +56,7 @@ use \common\libs\MyLib;
<label for="datepicker2">保险日期</label> <label for="datepicker2">保险日期</label>
<div class="input-group input-daterange" id="datepicker2"> <div class="input-group input-daterange" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -177,7 +177,11 @@ use \common\libs\MyLib;
btn: ['删除','取消'], //按钮 btn: ['删除','取消'], //按钮
shade: false //不显示遮罩 shade: false //不显示遮罩
}, function(){ }, function(){
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/car/delete',{id:id},function(data) { $.post('/car/delete',{id:id},function(data) {
parent.layer.close(index);
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
if(data.success == true) { if(data.success == true) {
refreshList(); refreshList();
@ -240,7 +244,11 @@ use \common\libs\MyLib;
rows.forEach(function(item,index,array){ rows.forEach(function(item,index,array){
params.push(item.id); params.push(item.id);
}); });
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/database/a-b', {ids:params.join(',')}, function(data) { $.post('/database/a-b', {ids:params.join(',')}, function(data) {
parent.layer.close(index);
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
if(data.success == true) { if(data.success == true) {
refreshList(); refreshList();
@ -248,15 +256,19 @@ use \common\libs\MyLib;
},'json'); },'json');
}); });
$('.btn-a-b-all').click(function() { $('.btn-a-b-all').click(function() {
layer.confirm('是否确认批量移动?', { parent.layer.confirm('是否确认批量移动?', {
btn: ['确认','取消'], //按钮 btn: ['确认','取消'], //按钮
shade: false //不显示遮罩 shade: false //不显示遮罩
}, function(){ }, function(){
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
var params = o; var params = o;
$.post('/database/a-b-all',params,function(obj){ $.post('/database/a-b-all',params,function(obj){
layer.msg(obj.msg); parent.layer.close(index);
parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
layer.msg('保存成功'); parent.layer.msg('保存成功');
search(); search();
} }
},'json'); },'json');
@ -270,7 +282,11 @@ use \common\libs\MyLib;
rows.forEach(function(item,index,array){ rows.forEach(function(item,index,array){
params.push(item.id); params.push(item.id);
}); });
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/database/a-c', {ids:params.join(',')}, function(data) { $.post('/database/a-c', {ids:params.join(',')}, function(data) {
parent.layer.close(index);
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
if(data.success == true) { if(data.success == true) {
refreshList(); refreshList();
@ -278,7 +294,7 @@ use \common\libs\MyLib;
},'json'); },'json');
}); });
$('.btn-a-invalid').click(function() { $('.btn-a-invalid').click(function() {
layer.confirm('是否确认移动?', { parent.layer.confirm('是否确认移动?', {
btn: ['确认','取消'], //按钮 btn: ['确认','取消'], //按钮
shade: false //不显示遮罩 shade: false //不显示遮罩
}, function(){ }, function(){
@ -288,10 +304,14 @@ use \common\libs\MyLib;
rows.forEach(function(item,index,array){ rows.forEach(function(item,index,array){
params.push(item.id); params.push(item.id);
}); });
var index = parent.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
$.post('/database/a-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){ $.post('/database/a-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){
layer.msg(obj.msg); parent.layer.close(index);
parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
layer.msg('保存成功'); parent.layer.msg('保存成功');
search(); search();
} }
},'json'); },'json');

@ -1,233 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
var params = $('#searchForm').serialize();
window.location.href = '/car/edit?id=' + id + '&back_params=' + encodeURIComponent(params);
}
//详情
function info(id) {
var params = $('#searchForm').serialize();
window.location.href = '/filtrationt/info?id=' + id + '&back_params=' + encodeURIComponent(params);
}
function getData() {
$.get('/database/ajax-a-data', function (obj) {
alert(obj.msg);
if (obj.success) {
window.location.reload();
}
}, 'json');
}
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/database/ad-clean-index?" + params;
});
$('#all-assign-btn').click(function(){
if(confirm('是否确认批量分配操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/b-all-assign',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('.invalid-btn').click(function(){
if(confirm('是否确认无效?')) {
var params = $('#listFrm').serialize();
var invalid_id = $('#invalid_id').val();
params = params + '&invalid_id=' + invalid_id;
$.post('/database/invalid',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#assign-btn').click(function(){
if(confirm('是否确认分配操作?')) {
var params = $('#listFrm').serialize();
var user_id = $('#user_id').val();
params = params + '&user_id=' + user_id;
$.post('/database/clean-assign',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#return-btn').click(function(){
var yuyue = $('#yuyue').val();
var fenpei = $('#fenpei').val();
if(yuyue!=1 || fenpei!=1){
alert('请先选择未预约选项和未分配选项');
return;
}
if(confirm('是否确认收回操作?')) {
var params = $('#listFrm').serialize();
$.post('/database/clean-return-a',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#return-all-btn').click(function(){
var yuyue = $('#yuyue').val();
var fenpei = $('#fenpei').val();
if(yuyue!=1 || fenpei!=1){
alert('请先选择未预约选项和未分配选项');
return;
}
if(confirm('是否确认收回操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/clean-return-all-a',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#all').click(function(){
if($(this).prop('checked')==true) {
$('input:checkbox').each(function() {
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width:100px;">
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width:100px;">
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width:100px;">
初登日期:从<input class="act_date" name="register_begin" type="text" value="<?=$register_begin?>" onclick="WdatePicker()"><input class="act_date" name="register_end" type="text" value="<?=$register_end?>" onclick="WdatePicker()">截止
保险公司:<input name="company" type="text" value="<?=$company?>" style="width:100px;">
</td>
</tr>
<style>
/*.day_date{*/
/*width: 10px;*/
/*}*/
</style>
<tr>
<td class="td_bg">
保险日期:从<input class="act_date" name="insurer1_begin" type="text" value="<?=$insurer1_begin?>" onclick="WdatePicker()"><input class="act_date" name="insurer1_end" type="text" value="<?=$insurer1_end?>" onclick="WdatePicker()">截止
预约状态:<select name="yuyue" id="yuyue">
<option value="">全部</option>
<option value="1" <?=$yuyue==1?'selected':''?>>未预约</option>
<option value="2" <?=$yuyue==2?'selected':''?>>已预约</option>
</select>
分配状态:<select name="status" id="fenpei">
<option value="3">全部</option>
<option value="1" <?=$status==1?'selected':''?>>未分配</option>
<option value="2" <?=$status==2?'selected':''?>>已分配</option>
</select>
导入状态:<select name="repeat">
<option value="0">全部</option>
<option value="1" <?=$repeat==1?'selected':''?>>原始导入</option>
<option value="2" <?=$repeat==2?'selected':''?>>二次导入</option>
</select>
<!-- 工号:<input name="username" type="text" value="--><?//=$username?><!--" style="width:50px;">-->
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
</td>
</tr>
<tr>
<td class="td_bg">
<!-- 业务员:<select name="user_id" id="user_id">-->
<!-- <option value="0">请选择</option>-->
<!-- --><?php
// foreach($user_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $user_id)
// echo ' selected ';
// echo '>'.$item->getShowName().'</option>';
// }
// ?>
<!-- </select>-->
<!-- <input type="button" class="act_btn" id="assign-btn" name="assign-btn" value="勾选分配">-->
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="勾选收回">
<input type="button" class="act_btn" id="return-all-btn" name="return-all-btn" value="批量收回">
<!-- 分配给业务员 <input id="assign_users" name="assign_users" type="text" value="" style="width:100px;">-->
<!-- 每个业务员分配 <input id="assign_count" name="assign_count" type="text" value="" style="width:50px;"> 条记录-->
<!-- <input type="button" class="act_btn" id="all-assign-btn" name="all-assign-btn" value="批量分配">-->
</td>
</tr>
</form>
<tr>
<td class="td_bg"><span>总任务数:<?=$carAcount?></span>&nbsp;&nbsp;<input class="act_btn" type="button" onclick="getData()" value="领取数据"></td>
</tr>
</table>
<form id="listFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车牌</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车型</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车主</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>联系电话</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>初登日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险公司</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>发动机号</td>
<td width="96" align="center" align="center" class="bg_tr" nowrap>车架号</td>
<td width="50" align="center" align="center" class="bg_tr" nowrap>操作员</td>
<!-- <td width="50" align="center" align="center" class="bg_tr" nowrap>详情</td>-->
</tr>
<?php
foreach($items as $index => $item) {
$car_info = $item->car;
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input type="checkbox" name="ids[]" value="<?=$car_info->id?>"></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_no?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($car_info->factory_model,10)?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($car_info->car_man,10)?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->phone?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->register_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->insurer1_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->company?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->engine_no?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_frame_no?></td>
<td align="left" class="td_bg"nowrap ><?=$item->user?$item->user->getShowName():''?></td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="11" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
</form>

@ -33,7 +33,7 @@ use \common\libs\MyLib;
<label for="datepicker1">初登日期</label> <label for="datepicker1">初登日期</label>
<div class="input-daterange input-group" id="datepicker1"> <div class="input-daterange input-group" id="datepicker1">
<input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -41,7 +41,7 @@ use \common\libs\MyLib;
<label for="datepicker2" style="margin-left: 20px;">保险日期</label> <label for="datepicker2" style="margin-left: 20px;">保险日期</label>
<div class="input-daterange input-group" id="datepicker2"> <div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div> </div>
</div> </div>

@ -33,7 +33,7 @@ use \common\libs\MyLib;
<label for="datepicker1">出单日期</label> <label for="datepicker1">出单日期</label>
<div class="input-daterange input-group" id="datepicker1"> <div class="input-daterange input-group" id="datepicker1">
<input type="text" class="input-sm form-control" id="print_begin" name="print_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="print_begin" name="print_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="print_end" name="print_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="print_end" name="print_end" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -41,7 +41,7 @@ use \common\libs\MyLib;
<label for="datepicker2">保险日期</label> <label for="datepicker2">保险日期</label>
<div class="input-daterange input-group" id="datepicker2"> <div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div> </div>
</div> </div>

@ -33,7 +33,7 @@ use \common\libs\MyLib;
<label for="datepicker2">保险日期</label> <label for="datepicker2">保险日期</label>
<div class="input-daterange input-group" id="datepicker2"> <div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div> </div>
</div> </div>

@ -1,94 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-sm-1">车牌</label>
<div class="col-sm-3">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-sm-1">车主</label>
<div class="col-sm-3">
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<label class="control-label col-sm-1">联系电话</label>
<div class="col-sm-3">
<input type="text" id="phone" name="phone" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">初登日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="register_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险公司</label>
<div class="col-sm-3">
<input type="text" id="company" name="company" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">无效理由</label>
<div class="col-sm-3">
<select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<label class="control-label col-sm-1">操作者</label>
<div class="col-sm-3">
<input type="text" id="username" name="username" class="form-control">
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-5">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
parent.o = o;
parent.refreshList();
layer_close();
}
$(function () {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -33,7 +33,7 @@ use \common\libs\MyLib;
<label for="datepicker1">初登日期</label> <label for="datepicker1">初登日期</label>
<div class="input-daterange input-group" id="datepicker1"> <div class="input-daterange input-group" id="datepicker1">
<input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -41,7 +41,7 @@ use \common\libs\MyLib;
<label for="datepicker2">保险日期</label> <label for="datepicker2">保险日期</label>
<div class="input-daterange input-group" id="datepicker2"> <div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div> </div>
</div> </div>

@ -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-5"> <div class="col-sm-5">
<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-5"> <div class="col-sm-5">
<select name="city_id" id="city_id" class="form-control"> <select name="city_id" id="city_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
<?php <?php
@ -33,14 +33,14 @@ 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-5"> <div class="col-sm-5">
<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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -40,8 +40,6 @@ use \common\libs\MyLib;
<?php <?php
foreach($company_items as $item) { foreach($company_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'"';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>'; echo '>'.$item->name.'</option>';
} }
?> ?>
@ -126,6 +124,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="18" class="text-left">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -12,7 +12,7 @@ use \common\libs\MyLib;
</div> </div>
<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">
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-1">文件</label> <label class="control-label col-sm-1">文件</label>
@ -27,7 +27,7 @@ use \common\libs\MyLib;
</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>提 交</strong> <strong>提 交</strong>
</button> </button>

@ -18,7 +18,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<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">
@ -46,7 +46,7 @@ use \common\libs\MyLib;
<?php if($pay_info->status_id < 4 || $pay_info->status_id == 8) { ?> <?php if($pay_info->status_id < 4 || $pay_info->status_id == 8) { ?>
<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>保 存</strong> <strong>保 存</strong>
</button> </button>
@ -64,7 +64,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<?php if($my_type1_query->count() > 0) { ?> <?php if($my_type1_query->count() > 0) { ?>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>

@ -125,6 +125,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="8" class="">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -15,7 +15,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<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">
@ -56,7 +56,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<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">
@ -84,7 +84,7 @@ use \common\libs\MyLib;
<?php if($pay_info->status_id < 5 || $pay_info->status_id == 8) { ?> <?php if($pay_info->status_id < 5 || $pay_info->status_id == 8) { ?>
<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-back" type="button"> <button class="btn btn-primary btn-back" type="button">
<strong>退 回</strong> <strong>退 回</strong>
</button> </button>
@ -215,7 +215,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<?php if($my_type1_query->count() > 0) { ?> <?php if($my_type1_query->count() > 0) { ?>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>

@ -128,6 +128,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="8" class="">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -15,7 +15,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<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">
@ -56,7 +56,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<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">
@ -84,14 +84,14 @@ use \common\libs\MyLib;
<?php if($pay_info->status_id < 4 || $pay_info->status_id == 8 || $pay_info->status_id == 10) { ?> <?php if($pay_info->status_id < 4 || $pay_info->status_id == 8 || $pay_info->status_id == 10) { ?>
<div> <div>
<div class="row"> <div class="row">
<div class="col-sm-1 col-md-offset-5"> <div class="col-sm-1 col-sm-offset-5">
<select name="status_id" id="status_id" class="form-control"> <select name="status_id" id="status_id" class="form-control">
<option value="0"></option> <option value="0"></option>
<option value="1">人事管理</option> <option value="1">人事管理</option>
<option value="2">出纳管理</option> <option value="2">出纳管理</option>
</select> </select>
</div> </div>
<div class="col-md-5"> <div class="col-sm-5">
<button class="btn btn-primary btn-back" type="button"> <button class="btn btn-primary btn-back" type="button">
<strong>退 回</strong> <strong>退 回</strong>
</button> </button>
@ -222,7 +222,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<?php if($my_type1_query->count() > 0) { ?> <?php if($my_type1_query->count() > 0) { ?>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>

@ -128,6 +128,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="8" class="">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -54,7 +54,7 @@ use \common\libs\MyLib;
</div> </div>
<label class="col-sm-2 control-label">回款日期</label> <label class="col-sm-2 control-label">回款日期</label>
<div class="col-sm-3"> <div class="col-sm-3">
<input type="text" name="r_date" id="r_date" value="<?=$caiwu_info->r_date?>" class="form-control" autocomplete="off"> <input type="text" name="r_date" id="r_date" value="<?=$caiwu_info->r_date?>" class="form-control date" autocomplete="off">
</div> </div>
</div> </div>
<div> <div>
@ -74,12 +74,14 @@ use \common\libs\MyLib;
</div> </div>
<?php $this->beginBlock('footer_js'); ?> <?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/layer/laydate/laydate.js"></script>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(function () { $(function () {
laydate({ $('.date').datepicker({
elem:'#r_date', todayBtn: "linked",
format: 'YYYY-MM-DD' keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true
}); });
//提交按钮 //提交按钮
$(".btn-save").click(function(){ $(".btn-save").click(function(){

@ -1,289 +1,176 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script src="/Myfile/lib/layui/layui.js"></script> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link rel="stylesheet" href="/js/fileupload/css/jquery.fileupload.css"> <?php $this->endBlock(); ?>
<table lay-size="sm" class="layui-table ">
<div class="wrapper wrapper-content animated fadeInRight">
<form id="searchForm"> <div class="ibox float-e-margins">
<input type="hidden" id="page" name="page" value="<?=$page?>"> <div class="ibox-title">
<tr> <h5>利润统计</h5>
<td class="td_bg"> <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> 刷新
<select name="insurer_type" class="insurer_type"> </a>
<option value=0>全部</option> </div>
<option value=1 <?= $insurer_type==1?'selected':'' ?>>商业</option> </div>
<option value=2 <?= $insurer_type==2?'selected':'' ?>>交强</option> <div class="ibox-content">
</select> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
保单号:<input name="insurer_no" type="text" value="<?=$insurer_no?>"> <div class="form-group" style="margin-bottom: 8px;">
车牌:<input name="car_no" type="text" value="<?=$car_no?>"> <label for="car_no">保险类型</label>
工号:<input name="username" type="text" value="<?=$username?>">&nbsp;&nbsp; <select name="insurer_type" class="form-control">
<!--日期--> <option value=0>全部</option>
出单日期: <option value=1>商业</option>
<input type="Text" class="Wdate" name="begin_date" onclick="WdatePicker()" value="<?= $begin_date ?>" /> <option value=2>交强</option>
-- </select>
<input type="Text" class="Wdate" name="end_date" onclick="WdatePicker()" value="<?= $end_date ?>" /> </div>
<br> <div class="form-group" style="margin-bottom: 8px;">
<br> <label for="engine_no">保单号</label>
回单日期: <input type="text" id="insurer_no" name="insurer_no" class="form-control">
<input type="Text" class="Wdate" name="r_begin_date" onclick="WdatePicker()" value="<?= $r_begin_date ?>" /> </div>
-- <div class="form-group" style="margin-bottom: 8px;">
<input type="Text" class="Wdate" name="r_end_date" onclick="WdatePicker()" value="<?= $r_end_date ?>" /> <label for="engine_no">车牌</label>
<br>保险公司:<select name="company_id"> <input type="text" id="car_no" name="car_no" class="form-control">
<option value="0">所有模型</option> </div>
<?php <div class="form-group" style="margin-bottom: 8px;">
foreach($company_items as $item) { <label for="engine_no">工号</label>
echo '<option value="'.$item->id.'"'; <input type="text" id="username" name="username" class="form-control">
if($item->id == $company_id) </div>
echo ' selected '; <div class="form-group" style="margin-bottom: 8px;">
echo '>'.$item->name.'</option>'; <label for="datepicker1">出单日期</label>
} <div class="input-group input-daterange" id="datepicker1">
?> <input type="text" class="input-sm form-control" id="begin_date" name="begin_date" value="" autocomplete="off" />
</select> <span class="input-group-addon">-</span>
级别:<select name="group_id"> <input type="text" class="input-sm form-control" id="end_date" name="end_date" value="" autocomplete="off" />
<option value="0">全部</option> </div>
<?php </div>
foreach($group_items as $item) { <div class="form-group" style="margin-bottom: 8px;">
echo '<option value="'.$item->id.'"'; <label for="datepicker1">回单日期</label>
if($item->id == $group_id) <div class="input-group input-daterange" id="datepicker1">
echo ' selected '; <input type="text" class="input-sm form-control" id="r_begin_date" name="r_begin_date" value="" autocomplete="off" />
echo '>'.$item->name.'</option>'; <span class="input-group-addon">-</span>
} <input type="text" class="input-sm form-control" id="r_end_date" name="r_end_date" value="" autocomplete="off" />
?> </div>
</select> </div>
排序: <div class="form-group" style="margin-bottom: 8px;">
<select name="sort_key"> <label for="engine_no">联系电话</label>
<option value="0">请选择</option> <input type="text" id="phone" name="phone" class="form-control">
<option value="print_date" <?= $sort_key == 'print_date' ? 'selected' : ''?>>出单日期</option> </div>
<option value="total" <?= $sort_key == 'total' ? 'selected' : ''?>>商业总保费</option> <div class="form-group" style="margin-bottom: 8px;">
<option value="total_clear" <?= $sort_key == 'total_clear' ? 'selected' : ''?>>商业净保费</option> <label for="engine_no">保险公司</label>
<option value="total_rate" <?= $sort_key == 'total_rate' ? 'selected' : ''?>>手续费比例</option> <select name="company_id" class="form-control">
</select> <option value="0">全部</option>
<select name="sort_value"> <?php
<option value="0">请选择</option> foreach($company_items as $item) {
<option value="ASC" <?= $sort_value == 'ASC' ? 'selected' : ''?>>正序</option> echo '<option value="'.$item->id.'">'.$item->name.'</option>';
<option value="DESC" <?= $sort_value == 'DESC' ? 'selected' : ''?>>倒序</option> }
</select> ?>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> </select>
<!-- <input type="button" class="act_btn" id="output-btn" name="output-btn" value="导出">--> </div>
</td> <div class="form-group" style="margin-bottom: 8px;">
</tr> <label for="engine_no">级别</label>
</form> <select name="group_id" class="form-control">
</table> <option value="0">全部</option>
<?php
<table width="100%" class="layui-elip layui-table" lay-filter="demo"> foreach($group_items as $item) {
<thead> echo '<option value="'.$item->id.'">'.$item->name.'</option>';
<tr> }
<th width="24" align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username1',width:30}">序号</th> ?>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username2'}">车牌号</th> </select>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username4'}">保险公司</th> </div>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username5'}">工号</th> <button type="submit" class="btn btn-primary mb-8">搜索</button>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username6'}">级别</th> </form>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username10',width:110}">保单号</th> <div class="row">
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username11'}">提单日期</th> <div class="col-sm-12">
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username12'}">出单日期</th> <table id="listTable">
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username13'}">保险类型</th> <thead>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username14'}">商业总保费</th> <tr>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username15'}">商业净保费</th> <th data-field="state" data-checkbox="true"></th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username16'}">手续费比例</th> <th width="50" data-field="id">ID</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username17'}">补点比例</th> <th data-field="car_no">车牌</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username18'}">应得金额</th> <th data-field="company_name">保险公司</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username19'}">实得金额</th> <th data-field="username">工号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username20'}">回款金额</th> <th data-field="group_name">级别</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username22'}">补点金额</th> <th data-field="insurer_no">保单号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username23'}">回款补点</th> <th data-field="submit_date">提单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username24'}">减免金额</th> <th data-field="print_date">出单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username25'}">礼品礼券</th> <th data-field="insurer_type">保险类型</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username26'}">工资</th> <th data-field="total">商业总保费</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username28'}">利润</th> <th data-field="total_clear">商业净保费</th>
</tr> <th data-field="total_rate">手续费比例</th>
</thead> <th data-field="budian_rate">补点比例</th>
<tbody> <th data-field="total_real">应得金额</th>
<th data-field="total_clear_real">实得金额</th>
<?php <th data-field="r_total">回款金额</th>
foreach($items as $index => $item) { <th data-field="bu_dian">补点金额</th>
$start_index = ($page-1)*20+$index; <th data-field="r_bu_dian">回款补点</th>
$order = $item->order; <th data-field="total1_dis">减免金额</th>
$users=$item->user->group; <th data-field="liwu">礼品礼券</th>
$username=$item->user; <th data-field="gongzi">工资</th>
$uname=$username['name']; <th data-field="lirun">利润</th>
$nams=$users['name']; </tr>
</thead>
$total_real = $item->total * $item->total_rate/100; </table>
$total_clear_real = $item->total_clear * $item->total_rate/100; </div>
$total_dis = round($total_clear_real - $item->r_total,2); </div>
</div>
$order_info = $item->order; </div>
</div>
$total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0;
$gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0; <?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
$ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0; <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
$gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0; <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
// $bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; var o = {};
$bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0; function refreshList() {
$('#listTable').bootstrapTable('refresh');
$r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0;
$liwu = $ticket + $gift;
$lirun = $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu;
?>
<tr style="height:24px;" onMouseOver="overColor(this)" onMouseOut="outColor(this)">
<td align="center" class="td_bg" style="font-size:12px;" ><?=$start_index+1?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->car_no?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order && $order->company ? $order->company->name:''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->user->username?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$uname?>-<?=$nams?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->insurer_no?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order ? $order->submit_date : ''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order ? $order->print_date : ''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->insurer_type==1?'商业':'交强'?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total_clear?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total_rate?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->budian_rate?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$total_real)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$total_clear_real)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->r_total?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$bu_dian)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$r_bu_dian)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$total1_dis?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$liwu?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$gongzi?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$lirun?></td>
</tr>
<?php
}
?>
<tr>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_total,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_total_clear,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_r_total,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($bu_dian_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($r_bu_dian_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($total1_dis_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($liwu_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($gongzi_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($lirun_all,2)?></td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td height="25" colspan="20" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</tbody>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.fileupload.js"></script>
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611">
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605">
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605">
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script>
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js?v=2019"></script><script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
var params = $('#searchForm').serialize();
window.location.href = '/finance/receipt-info?id=' + id + '&back_params=' + encodeURIComponent(params);
} }
$(function () { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
//提交按钮 $.each(params, function(index) {
$("#submit-btn").click(function(){ o[this['name']] = this['value'];
if(confirm('是否确认提交?')) {
var urlfile = $("#urlfile").val();
var import_type = $(".import_type").val();
if(urlfile == ''){
alert('请先选择文件!');
return false;
}
var last_url = '/finance/receipt-process';
var params = $("#theFrm").serialize();
$.post(last_url,params,function(obj){
alert(obj.msg);
if(obj.success){
$('#theFrm')[0].reset();
window.location.reload();
}
},'json');
}
}); });
//搜索 $('#listTable').bootstrapTable('destroy');
$("#search-btn").click(function(){ $('#listTable').bootstrapTable({
$('#page').val(0); url: "/finance/receipt-lirun-json",
var params = $('#searchForm').serialize(); pagination: true,
window.location.href = "/finance/receipt-lirun?" + params; sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['offset'] = params['offset'];
o['limit'] = params['limit'];
return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="22" class="">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
}
}); });
//导出 return false;
$("#output-btn").click(function(){ }
$('#page').val(0);
var params = $('#searchForm').serialize();
//window.location.href = "/finance/receipt-output?" + params;
var url = "/finance/receipt-output";
$.get(url,params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.href = obj.files[0].src;
}
},'json');
$(function() {
search();
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
}); });
}) });
</script> </script>
<style> <?php $this->endBlock(); ?>
input[type="text"] {
width: 134px;
}
</style>
<script>
console.log(layui)
layui.use('table',function(){
var table = layui.table;
var $ = layui.$;
//转换静态表格
table.init('demo', {
limit: 100
});
$('.layui-table-cell').css('padding','0')
$('td').css('padding','0')
})
</script>

@ -23,8 +23,8 @@ use \common\libs\MyLib;
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<label for="name">匹配程度</label> <label for="name">匹配程度</label>
<select name="status" class="form-control"> <select name="status" class="form-control">
<option value=0>全部</option> <option value=0 selected>全部</option>
<option value=1 selected>未匹配</option> <option value=1>未匹配</option>
<option value=2 >已完成</option> <option value=2 >已完成</option>
<option value=3 >匹配差额</option> <option value=3 >匹配差额</option>
</select> </select>
@ -145,6 +145,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="18" class="text-center">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -58,7 +58,7 @@ use \common\libs\MyLib;
<label for="datepicker1">出单日期</label> <label for="datepicker1">出单日期</label>
<div class="input-group input-daterange" id="datepicker1"> <div class="input-group input-daterange" id="datepicker1">
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="begin_date" name="begin_date" value="" autocomplete="off" />
<span class="input-group-addon"></span> <span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="end_date" name="end_date" value="" autocomplete="off" /> <input type="text" class="input-sm form-control" id="end_date" name="end_date" value="" autocomplete="off" />
</div> </div>
</div> </div>
@ -208,6 +208,20 @@ use \common\libs\MyLib;
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="33" class="">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -11,7 +11,7 @@ use \common\libs\MyLib;
</div> </div>
<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="fix_id" value="<?=$fix_info->id?>"> <input type="hidden" name="fix_id" value="<?=$fix_info->id?>">
<input type="hidden" name="_csrf" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>"> <input type="hidden" name="_csrf" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">

@ -11,7 +11,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="type1ListTable"> <table id="type1ListTable">
<thead> <thead>
<tr> <tr>
@ -38,7 +38,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="type2ListTable"> <table id="type2ListTable">
<thead> <thead>
<tr> <tr>
@ -65,7 +65,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="type3ListTable"> <table id="type3ListTable">
<thead> <thead>
<tr> <tr>
@ -92,7 +92,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="type4ListTable"> <table id="type4ListTable">
<thead> <thead>
<tr> <tr>
@ -119,7 +119,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="type5ListTable"> <table id="type5ListTable">
<thead> <thead>
<tr> <tr>

@ -29,23 +29,23 @@ use \common\libs\MyLib;
</div> </div>
<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-inline" id="theFrm"> <form role="form" class="form-inline" id="theFrm">
<input type="hidden" name="id" id="id" value="<?=$info->id?>" /> <input type="hidden" name="id" id="id" value="<?=$info->id?>" />
<input type="hidden" name="car_id" value="<?=$info->car_id?>" /> <input type="hidden" name="car_id" value="<?=$info->car_id?>" />
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label> <label class="control-label">车牌号</label>
<input type="text" name="car_no" value="<?=$info->car_no?>" class="form-control"> <input type="text" name="car_no" value="<?=$info->car_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">发动机号</label> <label class="control-label">发动机号</label>
<input type="text" name="engine_no" value="<?=$info->engine_no?>" class="form-control"> <input type="text" name="engine_no" value="<?=$info->engine_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车架号</label> <label class="control-label">车架号</label>
<input type="text" name="car_frame_no" value="<?=$info->car_frame_no?>" class="form-control"> <input type="text" name="car_frame_no" value="<?=$info->car_frame_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">事故类型</label> <label class="control-label">事故类型</label>
<select name="accident_type" id="accident_type" class="form-control"> <select name="accident_type" id="accident_type" class="form-control">
<option><?=$info->accident_type?></option> <option><?=$info->accident_type?></option>
@ -55,31 +55,31 @@ use \common\libs\MyLib;
<option>自费维修</option> <option>自费维修</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">被保险人</label> <label class="control-label">被保险人</label>
<input type="text" name="id_man" value="<?=$info->id_man?>" class="form-control"> <input type="text" name="id_man" value="<?=$info->id_man?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">电话</label> <label class="control-label">电话</label>
<input type="text" name="id_phone" value="<?=$info->id_phone?>" class="form-control"> <input type="text" name="id_phone" value="<?=$info->id_phone?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">联系人</label> <label class="control-label">联系人</label>
<input type="text" name="link_man" value="<?=$info->link_man?>" class="form-control"> <input type="text" name="link_man" value="<?=$info->link_man?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">电话</label> <label class="control-label">电话</label>
<input type="text" name="link_phone" value="<?=$info->link_phone?>" class="form-control"> <input type="text" name="link_phone" value="<?=$info->link_phone?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label> <label class="control-label">保险公司</label>
<input type="text" name="company" value="<?=$info->company?>" class="form-control"> <input type="text" name="company" value="<?=$info->company?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">接车日期</label> <label class="control-label">接车日期</label>
<input type="text" class="input-date form-control" id="receive_date" name="receive_date" autocomplete="off" value="<?=substr($info->receive_date,0,10)?>" /> <input type="text" class="input-date form-control" id="receive_date" name="receive_date" autocomplete="off" value="<?=substr($info->receive_date,0,10)?>" />
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">交车方式</label> <label class="control-label">交车方式</label>
<select name="receive_type" id="receive_type" class="form-control"> <select name="receive_type" id="receive_type" class="form-control">
<option><?=$info->receive_type?></option> <option><?=$info->receive_type?></option>
@ -87,7 +87,7 @@ use \common\libs\MyLib;
<option>客户自送</option> <option>客户自送</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">责任</label> <label class="control-label">责任</label>
<select name="responsibility" id="responsibility" class="form-control"> <select name="responsibility" id="responsibility" class="form-control">
<option><?=$info->responsibility?></option> <option><?=$info->responsibility?></option>
@ -97,7 +97,7 @@ use \common\libs\MyLib;
<option>次要责任</option> <option>次要责任</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label> <label class="control-label">品牌</label>
<select name="brand_id" id="brand_id" class="form-control"> <select name="brand_id" id="brand_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -111,7 +111,7 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">车系</label> <label class="control-label">车系</label>
<select name="series_id" id="series_id" class="form-control"> <select name="series_id" id="series_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -125,7 +125,7 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">排量</label> <label class="control-label">排量</label>
<select name="displacement_id" id="displacement_id" class="form-control"> <select name="displacement_id" id="displacement_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -139,27 +139,27 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">年份</label> <label class="control-label">年份</label>
<input type="text" name="car_year" value="<?=$info->car_year?>" class="form-control"> <input type="text" name="car_year" value="<?=$info->car_year?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">商业保单号</label> <label class="control-label">商业保单号</label>
<input type="text" name="insurer1_no" value="<?=$info->insurer1_no?>" class="form-control"> <input type="text" name="insurer1_no" value="<?=$info->insurer1_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">交强保单号</label> <label class="control-label">交强保单号</label>
<input type="text" name="insurer2_no" value="<?=$info->insurer2_no?>" class="form-control"> <input type="text" name="insurer2_no" value="<?=$info->insurer2_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">险项</label> <label class="control-label">险项</label>
<input type="text" name="insurer_type" class="form-control"> <input type="text" name="insurer_type" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">新车购置价</label> <label class="control-label">新车购置价</label>
<input type="text" name="new_price" value="<?=$info->new_price?>" class="form-control"> <input type="text" name="new_price" value="<?=$info->new_price?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">方位</label> <label class="control-label">方位</label>
<select name="direction_id" id="direction_id" class="form-control"> <select name="direction_id" id="direction_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -173,7 +173,7 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">范围</label> <label class="control-label">范围</label>
<select name="range_id" id="range_id" class="form-control"> <select name="range_id" id="range_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -187,11 +187,11 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">地址</label> <label class="control-label">地址</label>
<input type="text" name="address" value="<?=$info->address?>" class="form-control"> <input type="text" name="address" value="<?=$info->address?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">范围</label> <label class="control-label">范围</label>
<select name="range_id" id="range_id" class="form-control"> <select name="range_id" id="range_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -205,13 +205,13 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">代步车</label> <label class="control-label">代步车</label>
<select name="replace_car_id" id="replace_car_id" class="form-control"> <select name="replace_car_id" id="replace_car_id" class="form-control">
<option value="0">无代步车</option> <option value="0">无代步车</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">接车司机</label> <label class="control-label">接车司机</label>
<select name="driver_id" id="driver_id" class="form-control"> <select name="driver_id" id="driver_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
@ -225,95 +225,95 @@ use \common\libs\MyLib;
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">接车里程数</label> <label class="control-label">接车里程数</label>
<input type="text" name="receive_mileage" value="<?=$info->receive_mileage?>" class="form-control"> <input type="text" name="receive_mileage" value="<?=$info->receive_mileage?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">接车油表数</label> <label class="control-label">接车油表数</label>
<input type="text" name="receive_oil" value="<?=$info->receive_oil?>" class="form-control"> <input type="text" name="receive_oil" value="<?=$info->receive_oil?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">进厂里程数</label> <label class="control-label">进厂里程数</label>
<input type="text" name="factory_mileage" value="<?=$info->factory_mileage?>" class="form-control"> <input type="text" name="factory_mileage" value="<?=$info->factory_mileage?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">进厂油表数</label> <label class="control-label">进厂油表数</label>
<input type="text" name="factory_oil" value="<?=$info->factory_oil?>" class="form-control"> <input type="text" name="factory_oil" value="<?=$info->factory_oil?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">预计出厂时间</label> <label class="control-label">预计出厂时间</label>
<input type="text" class="input-date form-control" id="finish_date" name="finish_date" autocomplete="off" value="<?=substr($info->finish_date,0,10)?>" /> <input type="text" class="input-date form-control" id="finish_date" name="finish_date" autocomplete="off" value="<?=substr($info->finish_date,0,10)?>" />
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">报案号</label> <label class="control-label">报案号</label>
<input type="text" name="report_no" value="<?=$info->report_no?>" class="form-control"> <input type="text" name="report_no" value="<?=$info->report_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">报案人</label> <label class="control-label">报案人</label>
<input type="text" name="baoan_man" value="<?=$info->baoan_man?>" class="form-control"> <input type="text" name="baoan_man" value="<?=$info->baoan_man?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">报案时间</label> <label class="control-label">报案时间</label>
<input type="text" class="input-date form-control" id="baoan_time" name="baoan_time" autocomplete="off" value="<?=substr($info->baoan_time,0,10)?>" /> <input type="text" class="input-date form-control" id="baoan_time" name="baoan_time" autocomplete="off" value="<?=substr($info->baoan_time,0,10)?>" />
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">出险时间</label> <label class="control-label">出险时间</label>
<input type="text" class="input-date form-control" id="chuxian_time" name="chuxian_time" autocomplete="off" value="<?=substr($info->chuxian_time,0,10)?>" /> <input type="text" class="input-date form-control" id="chuxian_time" name="chuxian_time" autocomplete="off" value="<?=substr($info->chuxian_time,0,10)?>" />
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">出险地点</label> <label class="control-label">出险地点</label>
<input type="text" name="baoan_address" value="<?=$info->baoan_address?>" class="form-control"> <input type="text" name="baoan_address" value="<?=$info->baoan_address?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">事故描述</label> <label class="control-label">事故描述</label>
<input type="text" name="shigu_info" value="<?=$info->shigu_info?>" class="form-control"> <input type="text" name="shigu_info" value="<?=$info->shigu_info?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">理赔公司</label> <label class="control-label">理赔公司</label>
<input type="text" name="lipei_company" value="<?=$info->lipei_company?>" class="form-control"> <input type="text" name="lipei_company" value="<?=$info->lipei_company?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">主车定损金额</label> <label class="control-label">主车定损金额</label>
<input type="text" name="zhuche_money" value="<?=$info->zhuche_money?>" class="form-control"> <input type="text" name="zhuche_money" value="<?=$info->zhuche_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">三者外修</label> <label class="control-label">三者外修</label>
<input type="text" name="sanzhe_money" value="<?=$info->sanzhe_money?>" class="form-control"> <input type="text" name="sanzhe_money" value="<?=$info->sanzhe_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">物损</label> <label class="control-label">物损</label>
<input type="text" name="wusun_money" value="<?=$info->wusun_money?>" class="form-control"> <input type="text" name="wusun_money" value="<?=$info->wusun_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">拖车</label> <label class="control-label">拖车</label>
<input type="text" name="tuoche" value="<?=$info->tuoche?>" class="form-control"> <input type="text" name="tuoche" value="<?=$info->tuoche?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">拖车费用</label> <label class="control-label">拖车费用</label>
<input type="text" name="tuoche_money" value="<?=$info->tuoche_money?>" class="form-control"> <input type="text" name="tuoche_money" value="<?=$info->tuoche_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">定损工时费</label> <label class="control-label">定损工时费</label>
<input type="text" name="dingsun_hour_money" value="<?=$info->dingsun_hour_money?>" class="form-control"> <input type="text" name="dingsun_hour_money" value="<?=$info->dingsun_hour_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">定损换件费</label> <label class="control-label">定损换件费</label>
<input type="text" name="dingsun_huanjian_money" value="<?=$info->dingsun_huanjian_money?>" class="form-control"> <input type="text" name="dingsun_huanjian_money" value="<?=$info->dingsun_huanjian_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">赔付比例</label> <label class="control-label">赔付比例</label>
<input type="text" name="peifu_bili" value="<?=$info->peifu_bili?>" class="form-control"> <input type="text" name="peifu_bili" value="<?=$info->peifu_bili?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">赔付金额</label> <label class="control-label">赔付金额</label>
<input type="text" name="peifu_money" value="<?=$info->peifu_money?>" class="form-control"> <input type="text" name="peifu_money" value="<?=$info->peifu_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-sm-3" style="margin-bottom: 8px;">
<label class="control-label">客户自付</label> <label class="control-label">客户自付</label>
<input type="text" name="kehu_money" value="<?=$info->kehu_money?>" class="form-control"> <input type="text" name="kehu_money" value="<?=$info->kehu_money?>" class="form-control">
</div> </div>
<div class="form-group col-md-12" style="margin-bottom: 8px;"> <div class="form-group col-sm-12" style="margin-bottom: 8px;">
<label class="control-label">备注</label> <label class="control-label">备注</label>
<textarea class="form-control" name="remark" id="remark"><?=$info->remark?></textarea> <textarea class="form-control" name="remark" id="remark"><?=$info->remark?></textarea>
</div> </div>
@ -336,7 +336,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<form id="giftFrm" class="col-md-12"> <form id="giftFrm" class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
@ -384,7 +384,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable2"> <table id="listTable2">
<thead> <thead>
<tr> <tr>
@ -440,10 +440,10 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<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="otherFrm"> <form role="form" class="form-horizontal data-from" id="otherFrm">
<div class="form-group" style="margin-bottom: 8px;"> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-12"> <div class="col-sm-12">
<textarea class="form-control" name="sys_remark" id="sys_remark"></textarea> <textarea class="form-control" name="sys_remark" id="sys_remark"></textarea>
</div> </div>
</div> </div>
@ -530,7 +530,7 @@ use \common\libs\MyLib;
' </div>' + ' </div>' +
' <div class="ibox-content">' + ' <div class="ibox-content">' +
' <div class="row">' + ' <div class="row">' +
' <div class="col-md-12">' + ' <div class="col-sm-12">' +
' <table id="'+ id + '_' + name +'_table" data-name="'+ name +'">' + ' <table id="'+ id + '_' + name +'_table" data-name="'+ name +'">' +
' <thead>' + ' <thead>' +
' <tr>' + ' <tr>' +

@ -17,7 +17,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -11,7 +11,7 @@ use \common\libs\MyLib;
</div> </div>
<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" id="theFrm"> <form role="form" class="form-horizontal" id="theFrm">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">车牌号</label> <label class="col-sm-2 control-label">车牌号</label>

@ -24,7 +24,7 @@ use \common\libs\MyLib;
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -24,7 +24,7 @@ use \common\libs\MyLib;
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -24,7 +24,7 @@ use \common\libs\MyLib;
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -24,7 +24,7 @@ use \common\libs\MyLib;
<button type="submit" class="btn btn-primary">搜索</button> <button type="submit" class="btn btn-primary">搜索</button>
</form> </form>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>

@ -1,170 +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-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-out-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(); ?>

@ -16,28 +16,24 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-horizontal" onsubmit="return search();"> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label class="control-label col-md-1">范围</label> <label for="date_type">范围</label>
<div class="col-md-2"> <select id="date_type" name="date_type" class="form-control">
<select id="date_type" name="date_type" class="form-control"> <option value="0">全部</option>
<option value="0">全部</option> <option value="1">出库时间</option>
<option value="1">出库时间</option> <option value="2">正本生成时间</option>
<option value="2">正本生成时间</option> <option value="3">提单时间</option>
<option value="3">提单时间</option> </select>
</select> </div>
</div> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <div class="input-daterange input-group" id="datepicker">
<div class="input-daterange input-group" id="datepicker"> <input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" />
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" /> <span class="input-group-addon"></span>
<span class="input-group-addon"></span> <input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" />
<input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" />
</div>
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:30px;"> <div class="row" style="margin-top:30px;">
<div class="col-md-12"> <div class="col-md-12">
@ -46,7 +42,6 @@ use \common\libs\MyLib;
<tr> <tr>
<th width="50" data-field="id">ID</th> <th width="50" data-field="id">ID</th>
<th data-field="name">名称</th> <th data-field="name">名称</th>
<th data-field="total">库存</th>
<th data-field="unout_total">待出库</th> <th data-field="unout_total">待出库</th>
<th data-field="out_total">已出库</th> <th data-field="out_total">已出库</th>
</tr> </tr>
@ -64,21 +59,26 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script> <script>
var o = {};
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }
function search() { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy'); $('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({ $('#listTable').bootstrapTable({
url: "/gift/gift-tj-json", url: "/gift/gift-tj-json",
pagination: true, pagination: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
params.date_type = $('#date_type').val(); o['offset'] = params['offset'];
params.begin_date = $('#begin_date').val(); o['limit'] = params['limit'];
params.end_date = $('#end_date').val(); return o;
return params;
} }
}); });
return false; return false;

@ -0,0 +1,127 @@
<?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>
</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-sm-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="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'); ?>

@ -24,7 +24,7 @@ use \common\libs\MyLib;
<label for="free_type">礼品类型</label> <label for="free_type">礼品类型</label>
<select id="type_id" name="type_id" class="form-control"> <select id="type_id" name="type_id" class="form-control">
<option value="0">全部</option> <option value="0">全部</option>
<option value="1">礼品</option> <option value="1">礼品</option>
<option value="2">礼券</option> <option value="2">礼券</option>
</select> </select>
</div> </div>

@ -1,400 +0,0 @@
<?php
use \common\libs\MyLib;
use \common\models\PriceT;
?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="13" height="22" class="td_bg">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height="30" align="center" class=tab-on id=navcell onclick=switchCell(1) name="navcell">保单信息</TD>
<TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(2) name="navcell">快递信息</TD>
<TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(3) name="navcell">礼品信息</TD>
<TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(4) name="navcell">操作记录</TD>
<TD height="30" class=tab-none>&nbsp;</TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<tr>
<td height="22" colspan="2" class="td_bg">
<table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable">
<tr>
<td height="120" valign="top" class="td_bg">
<TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<form id="orderFrm">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="car_id" value="<?=$car_info->id?>">
<tr>
<td width="100" height="25" class="bg_tr">车牌号</td>
<td height="25" class="td_bg"><?=$car_info->car_no?></td>
<td width="100" height="25" class="bg_tr">厂牌型号</td>
<td height="25" class="td_bg"><?=$car_info->factory_model?></td>
<td width="60" height="25" class="bg_tr">品牌</td>
<td width="120" height="25" class="td_bg"><?=$car_info->brand?$car_info->brand->name:''?></td>
<td width="60" height="25" class="bg_tr">车系</td>
<td height="25" class="td_bg"><?=$car_info->series?$car_info->series->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">发动机号</td>
<td height="25" class="td_bg"><?=$car_info->engine_no?></td>
<td width="100" height="25" class="bg_tr">车架号</td>
<td height="25" class="td_bg"><?=$car_info->car_frame_no?></td>
<td width="60" height="25" class="bg_tr">初登日期</td>
<td height="25" class="td_bg"><?=$car_info->register_date?></td>
<td width="60" height="25" class="bg_tr">排量</td>
<td height="25" class="td_bg"><?=$car_info->displacement?$car_info->displacement->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车辆类型</td>
<td height="25" class="td_bg"><?=$car_info->carType?$car_info->carType->name:''?></td>
<td width="100" height="25" class="bg_tr">运营性质</td>
<td height="25" class="td_bg"><?=$car_info->carUse?$car_info->carUse->name:''?></td>
<td width="60" height="25" class="bg_tr">座位数</td>
<td height="25" class="td_bg"><?=$car_info->seats?></td>
<td width="60" height="25" class="bg_tr">年份</td>
<td height="25" class="td_bg"><?=$car_info->car_year?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车主</td>
<td height="25" class="td_bg"><?=$car_info->car_man?></td>
<td width="100" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg"><?=$car_info->phone?></td>
<td width="60" height="25" class="bg_tr">证件号码</td>
<td colspan="3" height="25" class="td_bg"><?=$car_info->car_man_number?></td>
</tr>
<tr>
<td width="60" height="25" class="bg_tr">备注</td>
<td colspan="7" height="25" class="td_bg"><?=$car_info->remark?></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="order_id" value="<?=$order_info->id?>">
<tr>
<td class="bg_tr">被保险人</td>
<td class="td_bg"><?=$order_info->id_man?></td>
<td class="bg_tr">证件号码</td>
<td class="td_bg"><?=$order_info->id_number?></td>
<td width="60" class="bg_tr">联系人</td>
<td class="td_bg"><?=$order_info->link_man?></td>
<td width="60" class="bg_tr">联系电话</td>
<td class="td_bg"><?=$order_info->link_phone?></td>
</tr>
<tr>
<td class="bg_tr">送单日期</td>
<td class="td_bg"><?=$order_info->send_date?></td>
<td class="bg_tr">保险公司</td>
<td class="td_bg"><?=$order_info->company?$order_info->company->name:''?></td>
<td class="bg_tr">付款方式</td>
<td class="td_bg"><?=$order_info->payType?$order_info->payType->name:''?></td>
<td class="bg_tr">电子邮件</td>
<td class="td_bg"><?=$order_info->email?></td>
</tr>
<tr>
<td class="bg_tr">商业起保日期</td>
<td class="td_bg"><?=$order_info->insurer1_begin_date?></td>
<td class="bg_tr">交强起保日期</td>
<td class="td_bg"><?=$order_info->insurer2_begin_date?></td>
<td class="bg_tr">缴费单号</td>
<td colspan="3" class="td_bg"><?=$order_info->pay_no?></td>
</tr>
<tr>
<td class="bg_tr">商业保单号</td>
<td class="td_bg"><?=$order_info->insurer1_no?></td>
<td class="bg_tr">交强保单号</td>
<td class="td_bg"><?=$order_info->insurer2_no?></td>
<td rowspan="3" class="bg_tr" valign="center">备注</td>
<td colspan="3" rowspan="3" valign="top" class="td_bg"><?=$order_info->remark?></td>
</tr>
<tr>
<td class="bg_tr">送单地址</td>
<td colspan="3" class="td_bg">
<?=$order_info->direction1?$order_info->direction1->name:''?>
<?=$order_info->range1?$order_info->range1->name:''?>
<?=$order_info->city1?$order_info->city1->name:''?>
<?=$order_info->district1?$order_info->district1->name:''?>
<?=$order_info->send_address1?>
</td>
</tr>
<tr>
<td class="bg_tr">正本送单地址</td>
<td colspan="3" class="td_bg">
<?=$order_info->direction2?$order_info->direction2->name:''?>
<?=$order_info->range2?$order_info->range2->name:''?>
<?=$order_info->city2?$order_info->city2->name:''?>
<?=$order_info->district2?$order_info->district2->name:''?>
<?=$order_info->send_address2?>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<tr>
<td width="40%" valign="top">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td align="center" class="bg_tr">险种</td>
<td align="center" class="bg_tr">内容</td>
<td align="center" class="bg_tr" nowrap>不计免赔</td>
</tr>
<?php
$len = count($insurer_type_items);
for($i = 0; $i < $len; $i++) {
$item = $insurer_type_items[$i];
$order_id = $order_info->id;
if(!$order_id)
$order_id = 0;
$tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id)
->one();
if($tmp_row->val == '' || $tmp_row->val == '0' || $tmp_row->val == '否' || $tmp_row->val == '无') continue;
?>
<tr>
<td class="bg_tr" nowrap><?=$item->name?>(<?=$item->code?>)</td>
<td class="td_bg"><?=$tmp_row->val?></td>
<td align="center" class="td_bg"><?php
if($tmp_row->is_nopay == 1) {
echo '是';
}
?>
</td>
</tr>
<?php
}
?>
</table>
</td>
<td width="10px;">&nbsp;</td>
<td width="60%" valign="top">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="bg_tr">商业总净保费</td>
<td class="td_bg"><?=$order_info->total1_clear?></td>
<td class="bg_tr">商业含税总保费</td>
<td class="td_bg"><?=$order_info->total1?></td>
</tr>
<tr>
<td class="bg_tr">交强总净保费</td>
<td class="td_bg"><?=$order_info->total2_clear?></td>
<td class="bg_tr">交强含税总保费</td>
<td class="td_bg"><?=$order_info->total2?></td>
</tr>
<tr>
<td class="bg_tr">车船税</td>
<td class="td_bg"><?=$order_info->total3?></td>
<td class="bg_tr">共计签单</td>
<td class="td_bg"><?=$order_info->total_all?></td>
</tr>
<tr>
<td class="bg_tr">折扣后商业净保费</td>
<td class="td_bg"><?=$order_info->total1_real?></td>
<td class="bg_tr">减免金额</td>
<td class="td_bg"><?=$order_info->total1_dis?></td>
</tr>
<tr>
<td class="bg_tr">商业折扣率</td>
<td class="td_bg"><?=$order_info->total1_percent?></td>
<td class="bg_tr">应收</td>
<td class="td_bg"><?=$order_info->total_real?></td>
</tr>
<tr>
<td class="bg_tr">备注</td>
<td colspan="3" class="td_bg"><?=$order_info->price_remark?></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td width="100" class="bg_tr">领款人</td>
<td class="td_bg"><?=$order_info->money_man?></td>
</tr>
<tr>
<td class="bg_tr">银行账号</td>
<td class="td_bg"><?=$order_info->money_no?></td>
</tr>
<tr>
<td class="bg_tr">开户行</td>
<td class="td_bg"><?=$order_info->money_bank?></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</TD>
</TR>
</TABLE>
<TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<form id="emsFrm">
<input type="hidden" name="car_id" value="<?=$car_info->id?>">
<input type="hidden" name="order_id" value="<?=$order_info->id?>">
<tr>
<td width="100" align="right" class="bg_tr">快递公司:</td>
<td class="td_bg">
<select name="ems_company">
<option>德邦</option>
</select>
</td>
<td width="100" align="right" class="bg_tr">快递单号:</td>
<td class="td_bg">
<input name="ems_no" type="text" value=""/>
</td>
<td width="100" align="right" class="bg_tr">配送员电话:</td>
<td class="td_bg">
<input name="ems_phone" type="text" value=""/>
</td>
</tr>
<tr>
<td width="100" align="right" class="bg_tr">描述:</td>
<td colspan="5" class="td_bg">
<input name="ems_remark" type="text" value="" style="width:600px;"/>
</td>
</tr>
<tr>
<td height="22" colspan="6" align="center" class="td_bg">
<input id="ems-save-btn" type=button class="ACT_btn" name="ems-save-btn" value=" 添加快递 "/>
</td>
</tr>
</form>
</table>
<div id="ems_list"></div>
</TD>
</TR>
</TABLE>
<TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<input type="button" class="ACT_btn ok-btn" name="Submit1" value=" 出库 ">
<input type="button" class="ACT_btn cancel-btn" name="Submit2" value=" 退回 ">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" style="table-layout: fixed;">
<form id="listFrm">
<input type="hidden" name="order_id" id="order_id" value="<?=$order_info->id?>">
<tr>
<td width="50" align="center" class="bg_tr" nowrap><input type="checkbox" id="all">选择</td>
<td width="150" align="center" class="bg_tr" nowrap>礼品名称</td>
<td width="80" align="center" class="bg_tr" nowrap>类型</td>
<td width="50%" align="center" class="bg_tr" nowrap>描述</td>
<td width="80" align="center" class="bg_tr" nowrap>分类</td>
<td width="80" align="center" class="bg_tr" nowrap>添加者</td>
<td width="130" align="center" class="bg_tr" nowrap>操作时间</td>
<td width="50" align="center" class="bg_tr" nowrap>状态</td>
</tr>
<?php
foreach($gift_items as $index => $item) {
if(!$item->gift) continue;
?>
<tr>
<td align="center" class="td_bg"nowrap ><?php
if($item->status == 0 || $item->status == 2) {
echo '<input type="checkbox" name="gift_ids[]" value="'.$item->id.'">';
} else {
echo '';
}
?></td>
<td class="td_bg" style="word-break: break-all;"><?=$item->gift->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->gift->type->name?></td>
<td class="td_bg" style="word-break: break-all;"><?=$item->gift->remark?></td>
<td align="center" class="td_bg" nowrap><?=$item->strategy_id>0?'公司礼品':'自费礼品'?></td>
<td class="td_bg" nowrap><?=$item->user?$item->user->getShowName():''?></td>
<td align="center" class="td_bg" nowrap><?=date('Y-m-d H:i:s',$item->submit_time)?></td>
<td align="center" class="td_bg" nowrap>
<?php
if($item->status == 0) echo '未出库';
if($item->status == 1) echo '已出库';
if($item->status == 2) echo '正在退换';
?>
</td>
</tr>
<?php
}
?>
</form>
</table>
</TD>
</TR>
</TABLE>
<TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<div id="car_history_list"></div>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="back-btn" type="button" class="ACT_btn" name="Submit3" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
//操作历史
gotoPage('/car/ajax-history-index?car_id=<?=$car_info->id?>&page=1&t='+Math.random(),'car_history_list');
//返回
$('#back-btn').click(function(){
window.location.href = '/gift/mng-list';
});
$('#all').click(function(){
if($(this).prop('checked')==true) {
$('input:checkbox').each(function() {
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
});
//添加EMS
$('#ems-save-btn').click(function(){
var params = $('#emsFrm').serialize();
$.post('/ems/save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#emsFrm')[0].reset();
gotoPage('/ems/ajax-car-index?car_id=<?=$car_info->id?>&order_id=<?=$order_info->id?>&t='+Math.random(),'ems_list');
}
},'json');
});
gotoPage('/ems/ajax-car-index?car_id=<?=$car_info->id?>&order_id=<?=$order_info->id?>&t='+Math.random(),'ems_list');
//出库
$('.ok-btn').click(function(){
var params = $('#listFrm').serialize();
if(confirm('是否出库选择礼品?')) {
$.post('/gift/ok-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
//退库
$('.cancel-btn').click(function(){
var params = $('#listFrm').serialize();
if(confirm('是否退回礼品?')) {
$.post('/gift/cancel-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
});
</script>

@ -1,74 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//详情
function info(id) {
window.location.href = '/gift/mng-list-info?id=' + id;
}
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/gift/mng-list?" + params;
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车主:<input name="car_man" type="text" value="<?=$car_man?>">
电话:<input name="phone" type="text" value="<?=$phone?>">
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> </td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="30" align="center" class="bg_tr" nowrap>序号</td>
<td width="50" align="center" class="bg_tr" nowrap>车主</td>
<td width="60" align="center" class="bg_tr" nowrap>提单日期</td>
<td width="60" align="center" class="bg_tr" nowrap>送单日期</td>
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td>
<td width="60" align="center" class="bg_tr" nowrap>品牌</td>
<td width="60" align="center" class="bg_tr" nowrap>共计签单</td>
<td width="60" align="center" class="bg_tr" nowrap>应收</td>
<td width="60" align="center" class="bg_tr" nowrap>状态</td>
<td width="60" align="center" class="bg_tr" nowrap>业务员</td>
<td width="60" align="center" class="bg_tr" nowrap>当前操作</td>
<td width="30" align="center" class="bg_tr" nowrap>操作</td>
</tr>
<?php
foreach($items as $index => $item) {
$start_index = ($page - 1) * 20 + $index;
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"n owrap ><?=$start_index + 1?></td>
<td class="td_bg" nowrap><?=MyLib::substr_cut($item->car_man,15)?></td>
<td class="td_bg" nowrap><?=$item->submit_date?></td>
<td class="td_bg" nowrap><?=$item->send_date?></td>
<td class="td_bg" nowrap><?=$item->car_no?></td>
<td class="td_bg" nowrap><?=$item->car?MyLib::substr_cut($item->car->factory_model,15):''?></td>
<td class="td_bg" nowrap><?=$item->total_all?></td>
<td class="td_bg" ><?=$item->total_real?>&nbsp;</td>
<td class="td_bg" ><?=$item->status->name?></td>
<td class="td_bg" ><?=$item->user?$item->user->getShowName():''?></td>
<td class="td_bg" ><?=$item->lock?$item->lock->getShowName():''?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="info(<?=$item->id?>)">详情</a>]
</td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="14" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>

@ -1,65 +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">
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th width="50" data-field="id">ID</th>
<th data-field="name">名称</th>
<th data-field="total">总数量</th>
<th data-field="out_total">已出库</th>
<th data-field="use_total">已使用</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 refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/gift/stastics-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
});
return false;
}
$(function() {
search();
});
</script>
<?php $this->endBlock(); ?>

@ -16,28 +16,24 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form role="form" class="form-horizontal" onsubmit="return search();"> <form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group"> <div class="form-group" style="margin-bottom: 8px;">
<label class="control-label col-md-1">范围</label> <label for="date_type">范围</label>
<div class="col-md-2"> <select id="date_type" name="date_type" class="form-control">
<select id="date_type" name="date_type" class="form-control"> <option value="0">全部</option>
<option value="0">全部</option> <option value="1">出库时间</option>
<option value="1">出库时间</option> <option value="2">正本生成时间</option>
<option value="2">正本生成时间</option> <option value="3">提单时间</option>
<option value="3">提单时间</option> </select>
</select> </div>
</div> <div class="form-group" style="margin-bottom: 8px;">
<div class="col-md-2"> <div class="input-daterange input-group" id="datepicker">
<div class="input-daterange input-group" id="datepicker"> <input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" />
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" /> <span class="input-group-addon"></span>
<span class="input-group-addon"></span> <input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" />
<input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" />
</div>
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">搜索</button>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:30px;"> <div class="row" style="margin-top:30px;">
<div class="col-md-12"> <div class="col-md-12">
@ -46,9 +42,8 @@ use \common\libs\MyLib;
<tr> <tr>
<th width="50" data-field="id">ID</th> <th width="50" data-field="id">ID</th>
<th data-field="name">名称</th> <th data-field="name">名称</th>
<th data-field="total">库存</th> <th data-field="unuse_total">未使用</th>
<th data-field="unuse_total">待出库</th> <th data-field="use_total">已使用</th>
<th data-field="use_total">已出库</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -64,21 +59,26 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script> <script>
var o = {};
function refreshList() { function refreshList() {
$('#listTable').bootstrapTable('refresh'); $('#listTable').bootstrapTable('refresh');
} }
function search() { function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy'); $('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({ $('#listTable').bootstrapTable({
url: "/gift/ticket-tj-json", url: "/gift/ticket-tj-json",
pagination: true, pagination: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
params.date_type = $('#date_type').val(); o['offset'] = params['offset'];
params.begin_date = $('#begin_date').val(); o['limit'] = params['limit'];
params.end_date = $('#end_date').val(); return o;
return params;
} }
}); });
return false; return false;

@ -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-sm-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-sm-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">使用日期</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(); ?>

@ -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-5"> <div class="col-sm-5">
<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-5"> <div class="col-sm-5">
<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,22 +33,22 @@ 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="base_pay" value="<?=$info->base_pay?>" class="form-control"> <input type="text" name="base_pay" value="<?=$info->base_pay?>" 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="job_pay" value="<?=$info->job_pay?>" class="form-control"> <input type="text" name="job_pay" value="<?=$info->job_pay?>" 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="station_pay" value="<?=$info->station_pay?>" class="form-control"> <input type="text" name="station_pay" value="<?=$info->station_pay?>" 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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -1,65 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
<input type="button" class="act_btn" id="save-btn" name="save-btn" value="保存">
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="返回">
<?=$group_info?$group_info->getPath():''?>
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="100" align="center" class="bg_tr">菜单名称</td>
<td width="70%" align="center" class="bg_tr">路径</td>
</tr>
<form id="theFrm">
<input type="hidden" name="group_id" value="<?=$group_id?>">
<?php
foreach($menu_items as $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td width="24" align="center" class="td_bg">
<label>
<input class="checkbox" type="checkbox" name="menu_ids[]" value="<?=$item->id?>" <?=in_array($item->id,$menu_ids)?'checked':''?>>
</label>
</td>
<td class="td_bg" nowrap><?= $item->name ?></td>
<td class="td_bg" nowrap><?= $item->path ?></td>
</tr>
<?php
}
?>
</form>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
$('#save-btn').click(function(){
var params = $('#theFrm').serialize();
$.post('/group/permission',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.href = '/group/index';
}
},'json');
});
$('#return-btn').click(function(){
window.location.href = '/group/index';
});
$('#all').click(function(){
var key = $(this).prop('checked');
if(key)
$('.checkbox').prop('checked',true);
else
$('.checkbox').removeProp('checked');
});
});
</script>

@ -9,7 +9,7 @@ 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">

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>

@ -9,28 +9,28 @@ 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">
<input type="text" name="code" value="<?=$info->code?>" class="form-control"> <input type="text" name="code" value="<?=$info->code?>" 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-6"> <div class="col-sm-6">
<input type="text" name="content" value="<?=$info->content?>" class="form-control"> <input type="text" name="content" value="<?=$info->content?>" 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">
<label class="i-checks form-control-static"> <label class="i-checks form-control-static">
<input type="checkbox" name="has_nopay" value="1" <?=$info->has_nopay==1?'checked':''?> ><i></i> <input type="checkbox" name="has_nopay" value="1" <?=$info->has_nopay==1?'checked':''?> ><i></i>
</label> </label>
@ -38,7 +38,7 @@ use \common\libs\MyLib;
</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>

@ -20,7 +20,7 @@ use \common\libs\MyLib;
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<table id="listTable"> <table id="listTable">
<thead class="bg-warning"> <thead class="bg-warning">
<tr> <tr>
@ -47,12 +47,14 @@ use \common\libs\MyLib;
<script> <script>
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); if(row.id > 12) {
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('</a>'); opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); opStr.push('</a>');
opStr.push('<i class="fa fa-trash" title="删除"></i>'); opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('</a>'); opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
}
return opStr.join(' '); return opStr.join(' ');
} }

@ -16,9 +16,9 @@ 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="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 style="margin-left:20px;">电话</label> <label style="margin-left:20px;">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:20px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:20px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:20px;"> <div class="row" style="margin-top:20px;">
<div class="col-md-12"> <div class="col-md-12">
@ -102,6 +103,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/finance-mng-json", url: "/insurer/finance-mng-json",
@ -112,6 +118,20 @@ use \common\libs\MyLib;
o['limit'] = params['limit']; o['limit'] = params['limit'];
o['offset'] = params['offset']; o['offset'] = params['offset'];
return o; return o;
},
responseHandler: function (res) {
var totals = res.rows.pop();
var html = '<tfoot><tr><td colspan="18" class="text-center">';
$.each(totals,function (i,d) {
html += '<div class="layui-show-md-inline-block m-r-lg m-l-lg">' +
'<span>'+ d[0] +':</span>' +
'<span class="font-bold">'+ d[1] +'</span>' +
'</div>'
});
html += '</td></tr></tfoot>';
$('#listTable').find('tfoot').remove();
$('#listTable').append(html);
return res;
} }
}); });
return false; return false;

@ -1,591 +1,391 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
use common\models\PriceT;
?> ?>
<?php $this->beginBlock('header_css'); ?> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<style>
label.control-label {
width: 120px;
}
.form-inline .form-control {
width: 180px;
}
</style>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins"> <form class="form-horizontal" id="orderFrm">
<div class="ibox-title fixed"> <input type="hidden" name="car_id" value="<?=$order_info->car_id?>">
<h5>保单信息</h5> <input type="hidden" name="order_id" value="<?=$order_info->id?>">
<div class="ibox-tools"> <input type="hidden" name="celuo_id" value="<?=$order_info->celuo_id?>">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')"> <input type="hidden" name="fanxian_id" value="<?=$order_info->fanxian_id?>">
<i class="fa fa-plus"></i> 保单打印信息 <div class="ibox float-e-margins">
</a> <div class="ibox-title">
</div> <h5>保单信息</h5>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <table class="table table-bordered">
<div class="col-md-12"> <tr>
<div class="container"> <th class="bg-warning">车牌号</th>
<input type="hidden" name="id" value="" class="form-control car-info"> <td><?=$order_info->car_no?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning" nowrap>初登日期</th>
<label class="control-label">车牌号</label> <td><?=$car_info->register_date?></td>
<span class="car-info" data-name="car_no"></span> <th class="bg-warning" nowrap>座位数</th>
</div> <td><?=$order_info->seats?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning" nowrap>电子邮件</th>
<label class="control-label">厂牌型号</label> <td><?=$order_info->email?></td>
<span class="car-info" data-name="factory_model"></span> </tr>
</div> <tr>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">车型</th>
<label class="control-label">品牌</label> <td><?=$order_info->factory_model?></td>
<span class="car-info" data-name="brand_txt"></span> <th class="bg-warning" nowrap>发动机号</th>
</div> <td><?=$order_info->engine_no?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning" nowrap>车架号</th>
<label class="control-label">车系</label> <td><?=$order_info->car_frame_no?></td>
<span class="car-info" data-name="series_txt"></span> <th class="bg-warning" nowrap>新车购置价</th>
</div> <td><?=$order_info->purchase_price?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> </tr>
<label class="control-label">发动机号</label> <tr>
<span class="car-info" data-name="engine_no"></span> <th class="bg-warning">车主</th>
</div> <td><?=$order_info->car_man?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">证件类型</th>
<label class="control-label">车架号</label> <td><?=$order_info->car_man_type?></td>
<span class="car-info" data-name="car_frame_no"></span> <th class="bg-warning">证件号码</th>
</div> <td><?=$order_info->car_man_number?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">联系电话</th>
<label class="control-label">初登日期</label> <td><?=$order_info->car_man_phone?></td>
<span class="car-info" data-name="register_date"></span> </tr>
</div> <tr>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">被投保人</th>
<label class="control-label">排量</label> <td><?=$order_info->id_man?></td>
<span class="car-info" data-name="displacement_txt"></span> <th class="bg-warning">证件类型</th>
</div> <td><?=$order_info->id_man_type?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">证件号码</th>
<label class="control-label">车辆类型</label> <td><?=$order_info->id_man_number?></td>
<span class="car-info" data-name="car_type_txt"></span> <th class="bg-warning">联系电话</th>
</div> <td><?=$order_info->id_man_phone?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> </tr>
<label class="control-label">运营性质</label> <tr>
<span class="car-info" data-name="car_use_txt"></span> <th class="bg-warning">投保人</th>
</div> <td><?=$order_info->link_man?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">证件类型</th>
<label class="control-label">座位数</label> <td><?=$order_info->link_man_type?></td>
<span class="car-info" data-name="seats"></span> <th class="bg-warning">证件号码</th>
</div> <td><?=$order_info->link_man_number?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">联系电话</th>
<label class="control-label">年份</label> <td><?=$order_info->link_man_phone?></td>
<span class="car-info" data-name="car_year"></span> </tr>
</div> <tr>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning" nowrap>商业起保日期</th>
<label class="control-label">车主</label> <td><?=$order_info->insurer1_begin_date?></td>
<span class="car-info" data-name="car_man"></span> <th class="bg-warning" nowrap>交强起保日期</th>
</div> <td><?=$order_info->insurer2_begin_date?></td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning">保险公司</th>
<label class="control-label">联系电话</label> <td><?=$order_info->company->name?></td>
<span class="car-info" data-name="phone"></span> <th class="bg-warning">车辆使用性质</th>
</div> <td><?=$order_info->car->carUse->name?></td>
</div><hr> </tr>
<div class="container"> <tr>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <th class="bg-warning" nowrap>商业保单号</th>
<label class="control-label">业务分组</label> <td><?=$order_info->insurer1_no?></td>
<span class="order-info" data-name="business_group_name"></span> <th class="bg-warning" nowrap>商业PDF文件</th>
</div> <td>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <?php if($order_info->shangye_src != '') { ?>
<label class="control-label">被保险人</label> <a href="<?=$order_info->shangye_src?>"><i class="fa fa-image">保单</i></a>
<span class="order-info" data-name="id_man"></span> <?php } ?>
</div> <?php if($order_info->fapiao_src != '') { ?>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <a href="<?=$order_info->fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<label class="control-label">证件号码</label> <?php } ?>
<span class="order-info" data-name="id_man_number"></span> </td>
</div> <th class="bg-warning">交强保单号</th>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <td><?=$order_info->insurer2_no?></td>
<label class="control-label">联系人</label> <th class="bg-warning">交强PDF文件</th>
<span class="order-info" data-name="link_man"></span> <td>
</div> <?php if($order_info->jiaoqiang_src != '') { ?>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <a href="<?=$order_info->jiaoqiang_src?>"><i class="fa fa-image">保单</i></a>
<label class="control-label">联系电话</label> <?php } ?>
<span class="order-info" data-name="link_man_phone"></span> <?php if($order_info->jq_fapiao_src != '') { ?>
</div> <a href="<?=$order_info->jq_fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <?php } ?>
<label class="control-label">送单日期</label> </td>
<span class="order-info" data-name="send_date"></span> </tr>
</div> </table>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<span class="order-info" data-name="company_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">付款方式</label>
<span class="order-info" data-name="pay_type_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">收款人</label>
<span class="order-info" data-name="payee_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业起保日期</label>
<span class="order-info" data-name="insurer1_begin_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强起保日期</label>
<span class="order-info" data-name="insurer2_begin_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">付款人</label>
<span class="order-info" data-name="payer_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">缴费单号</label>
<span class="order-info" data-name="pay_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业保单号</label>
<span class="order-info" data-name="insurer1_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强保单号</label>
<span class="order-info" data-name="insurer2_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">收款方式</label>
<span class="order-info" data-name="payment_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">送单地址</label>
<span class="order-info" data-name=""></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">备注</label>
<span class="order-info" data-name=""></span>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label class="control-label">正本送单地址</label>
<span class="order-info" data-name="receiver_addr_txt"></span>
</div>
</div><hr>
<div class="container">
<table id="insurer_type_table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="show_name">险种</th>
<th data-field="show_content">内容</th>
<th data-field="is_nopay_txt">不计免赔</th>
</tr>
</thead>
</table>
</div><hr>
<div class="container">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业总净保费</label>
<span class="order-info" data-name="total1_clear"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业含税总保费</label>
<span class="order-info" data-name="total1"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强总净保费</label>
<span class="order-info" data-name="total2_clear"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强含税总保费</label>
<span class="order-info" data-name="total2"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车船税</label>
<span class="order-info" data-name="total3"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">共计签单</label>
<span class="order-info" data-name="total_all"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">折扣后商业净保费</label>
<span class="order-info" data-name="total1_real"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">减免金额</label>
<span class="order-info" data-name="total1_dis"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业折扣率</label>
<span class="order-info" data-name="total1_percent"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">应收</label>
<span class="order-info" data-name="total_real"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">备注</label>
<span class="order-info" data-name="price_remark"></span>
</div>
</div>
</div> </div>
</div> </div>
</div> <div class="ibox float-e-margins">
</div> <div class="ibox-title">
<div class="ibox float-e-margins"> <h5>险种</h5>
<div class="ibox-title fixed"> </div>
<h5>保单文件信息</h5> <div class="ibox-content">
<div class="ibox-tools"> <table class="table table-bordered">
<a class="btn btn-primary btn-xs edit-btn" id="business_print_btn" href="javascript:void(0);" onclick="insurer_files_print('business')"> <tr>
<i class="fa fa-search"></i> 查看商业保单并打印 <?php
</a> $len = count($insurer_type_items);
<a class="btn btn-primary btn-xs edit-btn" id="compulsory_print_btn" href="javascript:void(0);" onclick="insurer_files_print('compulsory')"> $index = 0;
<i class="fa fa-search"></i> 查看交强保单并打印 for($i = 0; $i < $len; $i++) {
</a> $item = $insurer_type_items[$i];
</div> $order_id = $order_info->id;
</div> if(!$order_id)
<div class="ibox-content"> $order_id = 0;
<div class="row"> $tmp_row = PriceT::find()
<div class="col-md-12"> ->where('order_id='.$order_id.' and type_id='.$item->id)
<form method="get" class="form-horizontal"> ->one();
<input type="hidden" name="id" class="form-control order-info"> if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
<div class="form-group"> ?>
<label class="col-sm-4 control-label">商业保单文件</label> <th class="bg-warning">
<div class="col-sm-8"> <?=$item->name?>(<?=$item->code?>)
<div class="input-group"> </th>
<input type="text" data-name="shangye_src" name="shangye_src" class="form-control order-info" value=""> <td><?=$tmp_row->val?></td>
<a href="javascript:void(0);" class="input-group-addon upload"> <td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
上传文件 <?php
</a> if(($index+1)%3==0) {
</div> echo '</tr>';
</div> echo '<tr>';
</div> }
<div class="hr-line-dashed"></div> $index++;
<div class="form-group"> }
<label class="col-sm-4 control-label">交强保单文件</label> ?>
<div class="col-sm-8"> </tr>
<div class="input-group"> </table>
<input type="text" data-name="jiaoqiang_src" name="jiaoqiang_src" class="form-control order-info" value="">
<a href="javascript:void(0);" class="input-group-addon upload">
上传文件
</a>
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="text-center">
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="insurer_files_save()">
<i class="fa fa-save"></i> 保存
</a>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> <div class="ibox float-e-margins">
</div> <div class="ibox-title">
<div class="ibox float-e-margins"> <h5>保费信息</h5>
<div class="ibox-title fixed"> </div>
<h5>礼品信息</h5> <div class="ibox-content">
</div> <table class="table table-bordered">
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h4 class="title">免费礼品</h4>
<table id="free_gift_table">
<thead>
<tr> <tr>
<th data-field="id">ID</th> <th class="bg-warning">商业总净保费</th>
<th data-field="group_name">组名</th> <td><?=$order_info->total1_clear?></td>
<th data-field="gift_name">礼品名</th> <th class="bg-warning">商业含税总保费</th>
<td><?=$order_info->total1?></td>
<th class="bg-warning">车船税</th>
<td><?=$order_info->total3?></td>
</tr>
<tr>
<th class="bg-warning">交强总净保费</th>
<td><?=$order_info->total2_clear?></td>
<th class="bg-warning">交强含税总保费</th>
<td><?=$order_info->total2?></td>
<th class="bg-warning">业务自付金额</th>
<td><?=$order_info->yuangong_money?></td>
</tr>
<tr>
<th class="bg-warning">折扣后商业净保费</th>
<td><?=$order_info->total1_real?></td>
<th class="bg-warning">减免金额</th>
<td><?=$order_info->total1_dis?></td>
<th class="bg-warning">商业折扣率</th>
<td><?=$order_info->total1_percent?></td>
</tr>
<tr>
<th class="bg-warning">共计签单</th>
<td><?=$order_info->total_all?></td>
<th class="bg-warning">应收</th>
<td><?=$order_info->total_real?></td>
<th class="bg-warning">支付方式</th>
<td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
</tr>
<tr>
<th class="bg-warning">备注</th>
<td colspan="5"><?=$order_info->price_remark?></td>
</tr> </tr>
</thead>
</table> </table>
</div> </div>
<div class="col-md-6"> </div>
<h4 class="title">自费礼品</h4> <div class="ibox float-e-margins">
<table id="private_gift_table"> <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="$('#giftTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<table id="giftTable">
<thead> <thead>
<tr> <tr>
<th data-field="id">ID</th> <th width="50" data-field="id">ID</th>
<th data-field="group_name">组名</th> <th data-field="code">礼券编号</th>
<th data-field="gift_name">礼品名</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>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div>
</div> </div>
</div> <div class="ibox float-e-margins">
</div> <div class="ibox-title">
<div class="ibox float-e-margins"> <h5>其他信息</h5>
<div class="ibox-title fixed"> </div>
<h5>财务信息</h5> <div class="ibox-content">
<div class="ibox-tools"> <table class="table table-bordered">
<tr>
<th class="bg-warning">领款人</th>
<td><?=$order_info->money_man?></td>
<th class="bg-warning">开户行</th>
<td><?=$order_info->money_bank?></td>
<th class="bg-warning">银行账号</th>
<td><?=$order_info->money_no?></td>
</tr>
<tr>
<th class="bg-warning">送单地址</th>
<td colspan="5" class="form-inline">
<label><?=$order_info->sendCity?$order_info->sendCity->name:''?></label>
<label><?=$order_info->sendDistrict?$order_info->sendDistrict->name:''?></label>
<label><?=$order_info->send_address?></label>
</td>
</tr>
<tr>
<th class="bg-warning">备注</th>
<td colspan="5"><?=$order_info->remark?></td>
</tr>
</table>
</div>
</div> </div>
</div> <div class="ibox float-e-margins">
<div class="ibox-content"> <div class="ibox-title">
<div class="row"> <h5>操作记录</h5>
<div class="col-md-12"> <div class="ibox-tools">
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#logTable').bootstrapTable('refresh');">
<label class="control-label">领款人</label> <i class="fa fa-refresh"></i> 刷新
<span class="order-insurer-info" data-name="money_man"></span> </a>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">开户行</label>
<span class="order-insurer-info" data-name="money_bank"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label>
<span class="order-insurer-info" data-name="money_no"></span>
</div> </div>
</div> </div>
</div> <div class="ibox-content">
</div> <table id="logTable">
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>操作记录</h5>
<div class="ibox-tools">
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="car_history_table">
<thead> <thead>
<tr> <tr>
<th data-field="id">ID</th>
<th data-field="op_man">操作者</th> <th data-field="op_man">操作者</th>
<th data-field="op_time_txt">操作时间</th> <th data-field="op_time">操作时间</th>
<th data-field="remark">操作内容</th> <th data-field="remark">操作内容</th>
</th>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div>
</div> </div>
</div> <?php if($uid < 2 && $order_info->status_id > 1) {?>
</div> <div class="ibox float-e-margins">
<div class="ibox float-e-margins"> <div class="col-sm-5 col-sm-offset-4">
<div class="ibox-title fixed"> <button type="button" class="btn btn-primary btn-return" type="button">
<div class="ibox-tools"> <strong>退单</strong>
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" </button>
onclick="reBack()"> </div>
<i class="fa fa-backward"></i> 退单
</a>
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-close"></i> 关闭
</a>
</div> </div>
<div class="clearfix"></div> <?php }?>
</div> </form>
</div> </div>
</div>
<?php $this->beginBlock('footer_js'); ?> <?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.min.js"></script>
<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 src="/assets/js/plugins/webuploader/webuploader.min.js"></script> <script>
<script type="text/javascript" language="javascript"> var o = {};
var params = {}; //判断是否填写了选项
$(function () { function isNull(data){
layui.use(['upload'], function(){ if(data == "" || data == undefined || data == null){
var upload = layui.upload; return true;
var uploadInst = upload.render({ }else{
elem: '.upload' /*绑定元素*/, return false;
url: '/common/upload' /*上传接口*/,
accept: 'file',
done: function(res){
//上传完毕回调
if(res.status == 'SUCCESS') {
$('#file').val(res.fileUrl);
}
},
error: function(){
//请求异常回调
}
});
});
$('.input-date').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
// 获取数据,初始化
$.get('info-json' + window.location.search, function (obj) {
if (obj.code == 200) {
params = obj.data;
init();
} else {
alert('数据加载错误');
}
}, 'json');
$('#pdate').blur(function () {
var params = $("#appointmentFrm").serialize();
$.post('/appointment/count', params, function (obj) {
if (obj.success) {
$('#day_count').val(obj.count);
}
}, 'json');
});
$('#brand_info').change(function () {
var brand_id = $(this).val();
$('#series_info').html('<option value="0">---请选择---</option>');
$('#displacement_info').html('<option value="0">---请选择---</option>');
if (brand_id > 0) {
$.get('/car/series-fix', {brand_id: brand_id}, function (obj) {
if (obj.success) {
$('#series_info').html(obj.html);
}
}, 'json');
}
});
$('#series_info').change(function () {
var series_id = $(this).val();
$('#displacement_info').html('<option value="0">---请选择---</option>');
if (series_id > 0) {
$.get('/car/displacements-fix', {series_id: series_id}, function (obj) {
if (obj.success) {
$('#displacement_info').html(obj.html);
}
}, 'json');
}
});
});
function init(){
console.log(params);
carInfoInit(params['car_info']);
if(!params['order_info']['shangye_src']){
$('#business_print_btn').hide();
}
if(!params['order_info']['jiaoqiang_src']){
$('#compulsory_print_btn').hide();
} }
orderInfoInit(params['order_info']); }
function searchGifts() {
orderInsurerInfoInit(params['order_insurer_info']); $('#giftTable').bootstrapTable('destroy');
$('#giftTable').bootstrapTable({
var free_gift = [], url: "/gift/ticket-use-json",
private_gift = []; pagination: true,
$.each(params['gift_info'],function (i,d) { sidePagination: 'server',
if(d['is_free'] == 1){ queryParams: function(params) {
free_gift.push(d); o['order_id'] = '<?=$order_info->id?>';
}else { o['limit'] = params['limit'];
private_gift.push(d); o['offset'] = params['offset'];
return o;
} }
}); });
var tables = { return false;
'insurer_type': params['insurer_type_info'],
'free_gift': free_gift,
'private_gift': private_gift,
'car_history': {
url: '/car/ajax-history-index-json',
queryParamsFunc: function (param) {
param['car_id'] = params['car_info']['id'];
param['limit'] = param['limit'];
param['offset'] = param['offset'];
return param;
}
}
};
tableInfoInit(tables, params);
}
function insurer_files_print(type) {
if(type == 'compulsory' && params['order_info']['jiaoqiang_src']){
window.open('/upload/files'+ params['order_info']['jiaoqiang_src'])
}
if(type == 'compulsory' && !params['order_info']['jiaoqiang_src']){
alert('找不到文件,加载失败');
}
if(type == 'business' && params['order_info']['shangye_src']){
window.open('/upload/files'+ params['order_info']['shangye_src'])
}
if(type == 'business' && !params['order_info']['shangye_src']){
alert('找不到文件,加载失败');
}
} }
//保存订单
function insurer_files_save() { function saveOrder(status_id) {
var param = $(this).closest('form').serialize(); var params = $('#orderFrm').serialize();
$.post('/insurer/pdf-save',param,function(obj){ params = params + '&status_id=' + status_id;
console.log(obj); $.post('/insurer/office-mng-save',params,function(obj){
if(obj.success) { parent.layer.msg(obj.msg);
alert('保单上传成功'); if(obj.success && status_id>2) {
window.location.reload(); $('.btn-back').click();
} }
},'json'); },'json');
} }
//操作记录
function reBack(){ function searchOps() {
if(confirm('请核对好出单日期,确认退回到正本?')) { $('#logTable').bootstrapTable('destroy');
$.post('/insurer/tuidan-save',{id:params['order_info']['id']},function(obj){ $('#logTable').bootstrapTable({
if(obj.success) { url: "/car/history-json",
alert('退单成功'); pagination: true,
} sidePagination: 'server',
},'json'); multipleSelectRow: true,
} queryParams: function(params) {
} o['car_id'] = '<?=$order_info->car_id?>';
o['limit'] = params['limit'];
function goBack(){ o['offset'] = params['offset'];
window.close(); return o;
}
function tableInfoInit(tables){
$.each(tables,function(name,data){
var $table = $('#'+ name +'_table');
var options = {};
if(typeof data == 'String'){
options = {
url: data.url,
pagination: true,
sidePagination: 'server',
queryParams: data.queryParamsFunc
}
}else {
options = {
data: data
}
} }
$table.bootstrapTable('destroy');
$table.bootstrapTable(options);
}); });
} }
// 页面车辆数据初始化 $(function() {
function carInfoInit(data){ searchOps();
$('.car-info:not(input)').each(function(key,item) { searchGifts();
$(item).html(data[$(item).data('name')]);
}); <?php if($uid < 2 && $order_info->status_id > 1) {?>
$('.car-info:input').each(function(key,item) { layer.config({extend: 'extend/layer.ext.js'});
$(item).val(data[$(item).data('name')]); $('.btn-return').click(function(){
layer.prompt({
formType: 2,
title: '退单理由',
}, function(value, index){
$.post('/insurer/supper-return',{
order_id:<?=$order_info->id?>,
return_remark:value,
},function(obj){
layer.alert(obj.msg,function () {
window.location.reload();
});
},'json');
layer.close(index);
});
}); });
} <?php }?>
function orderInfoInit(data){ $('.btn-cancel').click(function(){
$('.order-info:not(input)').each(function(key,item) { parent.layer.confirm('是否确认放弃处理?', {
$(item).html(data[$(item).data('name')]); btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/insurer/order-cancel-save',{order_id:<?=$order_info->id?>},function(obj){
parent.layer.msg(obj.msg);
if(obj.success) {
$('.btn-back').click();
}
},'json');
}, function(){
//
});
}); });
$('.order-info:input').each(function(key,item) { $('.btn-save').click(function(){
$(item).val(data[$(item).data('name')]); saveOrder(2);
}); });
} $('.btn-submit').click(function(){
saveOrder(5);
function orderInsurerInfoInit(data){
$('.order-insurer-info:not(input)').each(function(key,item) {
$(item).html(data[$(item).data('name')]);
}); });
$('.order-insurer-info:input').each(function(key,item) { $('.btn-back').click(function() {
$(item).val(data[$(item).data('name')]); window.location.href = '/insurer/office-mng';
}); });
} });
function buttonInit(param) {
if(param){
$('#appointment_btn').prepend('<button type="button" class="btn btn-primary" onclick="cancelAppointment()">放弃</button>');
}
}
</script> </script>
<?php $this->endBlock('footer_js'); ?> <?php $this->endBlock(); ?>

@ -195,8 +195,8 @@ use common\models\PriceT;
<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> <label><?=$order_info->sendCity?$order_info->sendCity->name:''?></label>
<label><?=$order_info->sendDistrict->name?></label> <label><?=$order_info->sendDistrict?$order_info->sendDistrict->name:''?></label>
<label><?=$order_info->send_address?></label> <label><?=$order_info->send_address?></label>
</td> </td>
</tr> </tr>
@ -207,12 +207,17 @@ use common\models\PriceT;
</table> </table>
<div> <div>
<div class="row"> <div class="row">
<div class="col-md-5 col-md-offset-4"> <div class="col-sm-5 col-sm-offset-4">
<?php if($order_info->gift_status == 0) { ?> <?php if($order_info->gift_status == 0) { ?>
<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 } ?> <?php } ?>
<?php if($order_info->gift_status == 1 && $my_id == 1) { ?>
<button type="button" class="btn btn-primary btn-cancel" type="button">
<strong>取消确认</strong>
</button>
<?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>
</button> </button>
@ -264,7 +269,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){
@ -291,8 +296,13 @@ use common\models\PriceT;
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 += '</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;
if(sub_item.img_src != '') {
html += '<a href="' + sub_item.img_src + '" target="_blank"><i class="fa fa-image"></i></a>';
}
html += '</div>';
}
<?php } ?> <?php } ?>
}); });
html += '</td>'; html += '</td>';
@ -303,7 +313,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');
} }
@ -345,6 +355,29 @@ use common\models\PriceT;
// //
}); });
}); });
<?php if($order_info->gift_status == 1 && $my_id == 1) { ?>
layer.config({extend: 'extend/layer.ext.js'});
$('.btn-cancel').click(function () {
layer.confirm('此操作将回滚礼品状态,删除已生成礼物记录,确定继续?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
layer.prompt({
formType: 2,
title: '礼品状态回退理由',
}, function(value, index){
$.post('/insurer/gift-cancel',{order_id:<?=$order_info->id?>,return_msg:value},function(data) {
layer.alert(data.msg,function () {
window.location.reload();
});
}, 'json');
layer.close(index);
});
}, function(){
//
});
});
<?php } ?>
}); });
</script> </script>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>

@ -16,9 +16,9 @@ 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="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 style="margin-left:20px;">电话</label> <label style="margin-left:20px;">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:30px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:30px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:20px;"> <div class="row" style="margin-top:20px;">
<div class="col-md-12"> <div class="col-md-12">
@ -79,6 +80,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/my-list-json", url: "/insurer/my-list-json",
@ -86,10 +92,6 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
multipleSelectRow: true, multipleSelectRow: true,
queryParams: function(params) { queryParams: function(params) {
o['car_man'] = $('#car_man').val();
o['phone'] = $('#phone').val();
o['car_no'] = $('#car_no').val();
o['id_man'] = $('#id_man').val();
o['limit'] = params['limit']; o['limit'] = params['limit'];
o['offset'] = params['offset']; o['offset'] = params['offset'];
return o; return o;

@ -16,9 +16,9 @@ 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="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 style="margin-left:20px;">电话</label> <label style="margin-left:20px;">电话</label>
<input type="text" name="phone" id="phone" class="form-control"> <input type="text" name="phone" id="phone" class="form-control">
@ -28,6 +28,7 @@ use \common\libs\MyLib;
<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" style="margin-left:30px;">搜索</button> <button type="submit" class="btn btn-primary" style="margin-left:30px;">搜索</button>
</div> </div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form> </form>
<div class="row" style="margin-top:20px;"> <div class="row" style="margin-top:20px;">
<div class="col-md-12"> <div class="col-md-12">
@ -74,6 +75,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/my-return-list-json", url: "/insurer/my-return-list-json",

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save