Compare commits
312 Commits
fea#qhy
...
fea#sytopic
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f4027fd61 | |||
| 44ba39352d | |||
| ea7917245e | |||
| 64aa50fd09 | |||
| 1a1169fe11 | |||
| 9d3b44175c | |||
| cf68c97f8f | |||
| 0d6a2e9ead | |||
| e01ac5a20f | |||
| e3f8aca9e2 | |||
| e6a2722321 | |||
| 07cf724038 | |||
| 19e3a6994b | |||
| 5e1e0cd4d2 | |||
| 19682cfcef | |||
| d554a0233d | |||
| 3c5fc44632 | |||
| 7dd6612c26 | |||
| ad16229b21 | |||
| b8e256fdcb | |||
| 52536af755 | |||
| 46cc957b91 | |||
| f3acb1b354 | |||
| 2a3b42c434 | |||
| 66c96b85fd | |||
| fe7c2f57f9 | |||
| 1583c81360 | |||
| f972ab2b2b | |||
| 67d57b9bcb | |||
| 05b273c4a3 | |||
| 4efcce905c | |||
| 4e0ab69a5d | |||
| 704f8fd6f5 | |||
| 836e02fd46 | |||
| c64f7db0c1 | |||
| abc1e47cfa | |||
| 7948744e69 | |||
| 9ed04e5cbd | |||
| a7937d9b73 | |||
| d6d06df38c | |||
| 2bb53b90f0 | |||
| e3bb2d6dde | |||
| d5e19798d2 | |||
| 4091650b06 | |||
| eff7244cdd | |||
| 30b3321bcc | |||
| b75e0f2232 | |||
| af70a7e94d | |||
| f160297b22 | |||
| 99b743c34d | |||
| a11c841985 | |||
| 8de775f9e8 | |||
| afb40c9d5b | |||
| 1c2f97666b | |||
| 313d8fd7bf | |||
| 5cf674d585 | |||
| a8b13eb170 | |||
| ec8f0d7088 | |||
| 4862bb72d4 | |||
| 0f004e5c6f | |||
| 2f7298daa2 | |||
| b4ef47ae49 | |||
| 5929fb9694 | |||
| 2d93a54596 | |||
| 9a4d620c5a | |||
| 677d22900a | |||
| 154972341a | |||
| 5ac2b693bc | |||
| 6b54922c88 | |||
| 4d1e6d3a0f | |||
| 1445572abc | |||
| f70065109b | |||
| 01caa45b39 | |||
| 772923ffce | |||
| ce0acff18b | |||
| d0847adfe5 | |||
| f680e2da0e | |||
| 01041445e5 | |||
| 0a46d41d57 | |||
| 2227925c92 | |||
| a9e4159038 | |||
| ca106994f4 | |||
| e36e5b2560 | |||
| 77224176f9 | |||
| 6fc3e8e87b | |||
| 8add10dfa9 | |||
| 320c030396 | |||
| 93ec3288eb | |||
| 3b9e0467d1 | |||
| c071b912aa | |||
| e11c06271b | |||
| 026bfc9274 | |||
| 903ff760b6 | |||
| 34131c0526 | |||
| 068e016701 | |||
| 6934c38ec5 | |||
| 45a7133ac7 | |||
| ea000490b8 | |||
| 4f41117a9e | |||
| 45cd64669a | |||
| 292c2f01ce | |||
| 32d41d6e78 | |||
| 4fe61d370e | |||
| a49bb4cbad | |||
| 18623d1c8d | |||
| 42fff71177 | |||
| f760da0097 | |||
| 437e00974d | |||
| ba8e138381 | |||
| 9bc6bd6f81 | |||
| 19bbce0e3c | |||
| ecbbcd43b7 | |||
| 12f13b564c | |||
| 514eabb3c2 | |||
| a6a81c376d | |||
| d8d9119598 | |||
| 5bb77c22ee | |||
| d8cfe1b8f4 | |||
| c200848180 | |||
| 7e18c320f7 | |||
| 84b572c285 | |||
| 561f987cf5 | |||
| a264dc1ecb | |||
| 0ac3b7180a | |||
| 50c44599c2 | |||
| 9cfd8c6f3d | |||
| 81d56f9650 | |||
| 7d4cb3452c | |||
| 46c98d5af1 | |||
| 12dd080bf0 | |||
| 22cefd9289 | |||
| a929adf738 | |||
| 610828fe78 | |||
| d7755d0ea8 | |||
| 97908cee90 | |||
| 8bc57b8300 | |||
| d2b6b73e7c | |||
| 3656a641ce | |||
| a2934fb01b | |||
| 709fe5a5f3 | |||
| d8a5d1eb36 | |||
| e7aa9142b5 | |||
| 495ef25dce | |||
| 7ae54dd2fa | |||
| f500447683 | |||
| 9e4e8cae04 | |||
| 097a00e980 | |||
| 86f52bfe38 | |||
| 06b4891a4b | |||
| 443a331e32 | |||
| 7dbbe30807 | |||
| 300a4910d0 | |||
| 4a7821ed09 | |||
| 276fd5e592 | |||
| e6a2d773bf | |||
| 374e8239ed | |||
| 12d26acd8b | |||
| f07bee02cc | |||
| 56656a66b2 | |||
| f97a3bef37 | |||
| be77d9c53e | |||
| 3f8997bc7e | |||
| 817cf2a999 | |||
| 1512ffdf99 | |||
| 968393c350 | |||
| adf795774e | |||
| 7c2fb94c0a | |||
| 7fd8f794bd | |||
| 7b5296e905 | |||
| d223cfbca2 | |||
| 2e907c53fe | |||
| 10a5346eb1 | |||
| 22c1ef83a4 | |||
| d1a91d34c2 | |||
| 9a18e31978 | |||
| 11dafef6ea | |||
| 123c89d495 | |||
| e34e9115a7 | |||
| a87d22afc1 | |||
| da5ab5cf1c | |||
| d6c722b7d7 | |||
| d18e6bf2af | |||
| ab568222e0 | |||
| fd76e114fc | |||
| 670489a89b | |||
| 521659c64a | |||
| f425ae68ef | |||
| cd4dae7f7f | |||
| 7a524e1e32 | |||
| 40b921ca16 | |||
| cbf8c6cd9b | |||
| f7af5c59ad | |||
| b0cf350bbd | |||
| 19c64016fb | |||
| be19ba28c9 | |||
| fd90bd5bf0 | |||
| 0cea129541 | |||
| dc9f0c21cd | |||
| 8e8f0342d7 | |||
| 5be647ea08 | |||
| e33314c92e | |||
| 62b6efb3d2 | |||
| f5e7fb21a7 | |||
| 0545eadf8b | |||
| 428bfe54f2 | |||
| 1f4e37f6f8 | |||
| be5d18a123 | |||
| 1073b24692 | |||
| ebeb748cc4 | |||
| c76ad35344 | |||
| 34286f37d9 | |||
| e14c8d984c | |||
| f534b7be65 | |||
| e55ea26767 | |||
| 7d43757135 | |||
| 870a19fb1b | |||
| 85de7fce07 | |||
| 8426025969 | |||
| 5377248d3c | |||
| 582bcdb27f | |||
| e16e0efff9 | |||
| eb5cb58925 | |||
| c47e150681 | |||
| 08d053c7d0 | |||
| 8aac432673 | |||
| d048525c79 | |||
| 8bba2e75f6 | |||
| b7267260a2 | |||
| 2e91f779b4 | |||
| 61450335f4 | |||
| f28211194c | |||
| 59e5b996c6 | |||
| c88dbf0a70 | |||
| 5e947de24b | |||
| 994a7a6e8f | |||
| e8d4b80811 | |||
| 8df928e5bb | |||
| f4a8ec7380 | |||
| de7d497f5b | |||
| 02d4a671b1 | |||
| 23e8ec97bb | |||
| 7971a8d861 | |||
| d3f03c7c65 | |||
| 4ca0013968 | |||
| ce150e2e78 | |||
| 2f697e40aa | |||
| 58b0c56462 | |||
| b14a66cd84 | |||
| 2ebb7eb262 | |||
| 8f17416510 | |||
| 33627a9c53 | |||
| 761848b9d9 | |||
| 4eda14c853 | |||
| 678b7cf37c | |||
| 9c45beba85 | |||
| 1831089200 | |||
| dc3ae76d0c | |||
| b7310c0916 | |||
| ccc63aa530 | |||
| c8371c524a | |||
| 09493138f9 | |||
| a7f3af47a7 | |||
| aac9677e1f | |||
| fdc1332319 | |||
| 6a52a680bc | |||
| f84272bb12 | |||
| 6f5d1d3196 | |||
| a94cf41cdf | |||
| 2c5cf829ee | |||
| 7d503d6fc4 | |||
| a80929632f | |||
| d5fdf943f6 | |||
| fe26174582 | |||
| 15be428cc9 | |||
| 637c329b7d | |||
| 7e3d329a9a | |||
| e91b2be754 | |||
| 3092dee7f1 | |||
| 4ecd61506e | |||
| 5448d0cd4e | |||
| acec22291f | |||
| e777e81e44 | |||
| 2eb338c42e | |||
| 9292d4635d | |||
| 59b22aac80 | |||
| da3d7dc26b | |||
| e3aed3f45c | |||
| b1a61b9274 | |||
| 9c4c4b6ac6 | |||
| 544f9d7f19 | |||
| 72a7c3a0b6 | |||
| 1810b6a478 | |||
| fabe410daa | |||
| 3c454b0818 | |||
| baf47fbe3c | |||
| 88d27cccf9 | |||
| 71acb64283 | |||
| b989c791cd | |||
| 09ea12a452 | |||
| 87511ece07 | |||
| 984875b0fe | |||
| f6f17c4e21 | |||
| 5c341c997d | |||
| 1544e239bc | |||
| 961b57090d | |||
| 9afc059182 | |||
| 140a2ccef3 | |||
| 4172c31bbb | |||
| d9b99d5606 | |||
| 3785bc6d4b | |||
| 182e44014c | |||
| 684fa4e6fe |
@@ -11,6 +11,5 @@ $config['app_id'] = 1206;
|
||||
$config['app_key'] = 'WX6HDVZX3AYSZDR1739332ZM';
|
||||
|
||||
$config['mobile_list'] = array(
|
||||
'13391247942','13391407003','13391416119','13391416302',
|
||||
'13391416570',
|
||||
'13391419510',
|
||||
);
|
||||
|
||||
@@ -491,7 +491,12 @@ class Common extends CI_Controller
|
||||
$city_id && $where['city_id'] = $city_id;
|
||||
$county_id && $where['county_id'] = $county_id;
|
||||
$type && $where['type'] = $type;
|
||||
$types = $this->input->post('types');
|
||||
$types && $where['type in (' . $types . ')'] = null;
|
||||
$ids && $where['id not in (' . $ids . ')'] = null;
|
||||
$typeAry = $this->mdBiz->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$type_ids && $where["type in ($type_ids)"] = null;
|
||||
$count = $this->mdBiz->count($where);
|
||||
if ($count) {
|
||||
$resBiz = $this->mdBiz->select($where, 'id desc', $page, $size);
|
||||
@@ -1488,7 +1493,15 @@ class Common extends CI_Controller
|
||||
}
|
||||
if ($type == 1) {
|
||||
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
|
||||
$res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name');
|
||||
#$res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name');
|
||||
$res = array();
|
||||
$rows = $this->mdAutoBrand->select($where, 'status desc, id asc', 0, 0, 'id,name');
|
||||
foreach($rows as $v){
|
||||
$res[] = array(
|
||||
'id' => strlen($status) > 0 ? $v['id'] : " " . $v['id'],
|
||||
'name' => $v['name'],
|
||||
);
|
||||
}
|
||||
} else if ($type == 2) {
|
||||
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
|
||||
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name');
|
||||
@@ -1550,7 +1563,7 @@ class Common extends CI_Controller
|
||||
|
||||
$count = $this->items_model->count($fhwhere);
|
||||
if ($count) {
|
||||
$rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin');
|
||||
$rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin,buy_price,estimated_rebate');
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
@@ -1567,7 +1580,9 @@ class Common extends CI_Controller
|
||||
foreach ($rows as $key => $val) {
|
||||
$setval = [
|
||||
'id' => $val['id'],
|
||||
'vin' => $val['vin']
|
||||
'vin' => $val['vin'],
|
||||
'buy_price' => $val['buy_price'],
|
||||
'estimated_rebate' => $val['estimated_rebate'],
|
||||
];
|
||||
$setval['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$setval['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
|
||||
@@ -18,7 +18,11 @@ class Login extends CI_Controller
|
||||
header('Location:/welcome');
|
||||
}
|
||||
|
||||
$this->load->view('login');
|
||||
$arr = array();
|
||||
if ($this->input->get('need_code') == 'logsms'){
|
||||
$arr['need_code'] = 'logsms';
|
||||
}
|
||||
$this->load->view('login', $arr);
|
||||
}
|
||||
|
||||
public function post()
|
||||
@@ -33,9 +37,10 @@ class Login extends CI_Controller
|
||||
return false;
|
||||
}
|
||||
$log = 0;//加日志
|
||||
if ($this->input->post('need_code') == 'login') {
|
||||
if ($this->input->post('need_code') == 'login' || $this->input->post('need_code') == 'logsms') {
|
||||
$code = $this->input->post('code');
|
||||
$mobile = $this->input->post('mobile');
|
||||
$this->input->post('need_code') == 'logsms' && $mobile = $this->input->post('number');
|
||||
$cookie = $this->input->cookie(LOGIN_CODE_COOKIE);
|
||||
$code_cookie = $this->encryption->decrypt($cookie);
|
||||
if (!$code_cookie) {
|
||||
@@ -46,6 +51,9 @@ class Login extends CI_Controller
|
||||
}
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
$admin_user = $this->sys_admin_model->get(array("mobile = '{$mobile}'" => null, 'status' => 1));
|
||||
if (!$admin_user['id']) {
|
||||
return $this->show_json(0, '用户不存在');
|
||||
}
|
||||
$log = 1;
|
||||
} else {
|
||||
if (!$username) {
|
||||
@@ -116,6 +124,14 @@ class Login extends CI_Controller
|
||||
{
|
||||
if ($this->input->method() == 'post') {
|
||||
$mobile = $this->input->post('mobile', true);
|
||||
if (!$mobile){
|
||||
return false;
|
||||
}
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
$admin_user = $this->sys_admin_model->get(array("mobile = '{$mobile}'" => null, 'status' => 1));
|
||||
if (!$admin_user['id']) {
|
||||
return false;
|
||||
}
|
||||
$code = rand(100000, 999999);
|
||||
|
||||
$domain = explode('.', $_SERVER['HTTP_HOST']);
|
||||
|
||||
@@ -7,7 +7,7 @@ class Outer extends CI_Controller {
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('sys/sys_menu_model');
|
||||
$list = $this->sys_menu_model->select(array('status' => 1,'type'=>0), 'sort desc', 0, 0);
|
||||
$list = $this->sys_menu_model->select(array('status' => 1), 'sort desc', 0, 0);
|
||||
$this->load->model('sys/sys_role_model');
|
||||
$role = $this->sys_role_model->get(array('id' => $this->role));
|
||||
$menu_ids = explode(',', $role['menu_ids']);
|
||||
@@ -46,7 +46,7 @@ class Outer extends CI_Controller {
|
||||
unset($map);
|
||||
|
||||
//获取面包屑
|
||||
$menus = $this->sys_menu_model->select(array("url like '" . $url . "%'" => null, 'status' => 1, 'outer_link' => 1,'type'=>0));
|
||||
$menus = $this->sys_menu_model->select(array("url like '" . $url . "%'" => null, 'status' => 1, 'outer_link' => 1));
|
||||
$menu = array();
|
||||
foreach($menus as $item){
|
||||
if(!$menu){
|
||||
@@ -65,7 +65,7 @@ class Outer extends CI_Controller {
|
||||
$spm_arr1 = explode('-', $spm);
|
||||
$spm_arr1 && !is_numeric($spm_arr1[0]) && $spm_arr1 = array_slice($spm_arr1, 1);
|
||||
if($spm_arr1){
|
||||
$rows = $this->sys_menu_model->select(array("id in (" . implode(",",$spm_arr1) . ")" => null, 'status' => 1,'type'=>0), 'sort desc');
|
||||
$rows = $this->sys_menu_model->select(array("id in (" . implode(",",$spm_arr1) . ")" => null, 'status' => 1), 'sort desc');
|
||||
$menu_arr = array();
|
||||
$breads = array();
|
||||
foreach($rows as $row){
|
||||
|
||||
@@ -58,6 +58,19 @@ class Main extends HD_Controller
|
||||
),
|
||||
);
|
||||
|
||||
$this->load->model('auto/auto_introduce_model', 'mdAutoIntroduce');
|
||||
$value = $this->mdAutoIntroduce->count(["status<>-1" => null, 'brand_id in (select id from lc_auto_brand where status > -1)' => null]);
|
||||
$list[] = array(
|
||||
'title' => '车型介绍(条)',
|
||||
'value' => $value,
|
||||
'btns' => array(
|
||||
array('name' => '查看详情', 'url' => '/auto/introduce'),
|
||||
),
|
||||
);
|
||||
|
||||
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
|
||||
|
||||
$list = [];
|
||||
$value = $this->mdBlindBox->count(['status>' => -1]);
|
||||
$list[] = array(
|
||||
'title' => '盲盒抽奖(个)',
|
||||
@@ -109,7 +122,7 @@ class Main extends HD_Controller
|
||||
);
|
||||
|
||||
//消费订单
|
||||
$this->load->model('apporder/order_purchase_model');
|
||||
/*$this->load->model('apporder/order_purchase_model');
|
||||
$value = $this->order_purchase_model->count(array('app_id' => $this->app_id));
|
||||
$list[] = array(
|
||||
'title' => '消费订单(笔)',
|
||||
@@ -117,7 +130,7 @@ class Main extends HD_Controller
|
||||
'btns' => array(
|
||||
array('name' => '查看详情', 'url' => '/order/purchase?app_id=' . $this->app_id),
|
||||
),
|
||||
);
|
||||
);*/
|
||||
|
||||
//分销体现
|
||||
$value = $this->user_accountlog_model->count_log(array('lc_app_user_account.app_id' => $this->app_id,'lc_app_user_accountlog.trade_type'=>2));
|
||||
@@ -130,7 +143,7 @@ class Main extends HD_Controller
|
||||
);
|
||||
|
||||
//购车
|
||||
$this->load->model('app/liche/app_liche_orders_model');
|
||||
/*$this->load->model('app/liche/app_liche_orders_model');
|
||||
$value = $this->app_liche_orders_model->count(['pid'=>0]);
|
||||
$list[] = array(
|
||||
'title' => '购车订单(笔)',
|
||||
@@ -138,17 +151,7 @@ class Main extends HD_Controller
|
||||
'btns' => array(
|
||||
array('name' => '查看详情', 'url' => '/app/liche/order'),
|
||||
),
|
||||
);
|
||||
|
||||
$this->load->model('auto/auto_introduce_model', 'mdAutoIntroduce');
|
||||
$value = $this->mdAutoIntroduce->count(["status<>-1" => null]);
|
||||
$list[] = array(
|
||||
'title' => '车型介绍(条)',
|
||||
'value' => $value,
|
||||
'btns' => array(
|
||||
array('name' => '查看详情', 'url' => '/auto/introduce'),
|
||||
),
|
||||
);
|
||||
);*/
|
||||
|
||||
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
|
||||
|
||||
@@ -234,7 +237,7 @@ class Main extends HD_Controller
|
||||
$order = $this->receiver_orders_model->get(['id'=>$val['item_id']]);
|
||||
if($order && $order['brand_id']!=3){
|
||||
if(!$p_row){
|
||||
$p_sid = create_order_no(350200,'liche',1,0);
|
||||
$p_sid = create_order_no(350200,'liche');
|
||||
$p_data = [
|
||||
'o_id' => $val['item_id'],
|
||||
'uid' => $val['app_uid'],
|
||||
@@ -257,7 +260,7 @@ class Main extends HD_Controller
|
||||
$su_p_row = $this->app_liche_orders_model->get(['pid'=>$p_id,'type'=>$order_type]);
|
||||
if(!$su_p_row){
|
||||
$money = $this->order_purchase_model->sum('total_price',['type'=>6,'app_uid'=>$val['app_uid'],'item_id'=>$val['item_id']]);
|
||||
$sub_p_sid = create_order_no(350200,'liche',1,$order_type);
|
||||
$sub_p_sid = create_order_no(350200,'liche');
|
||||
$p_data = [
|
||||
'o_id' => $val['item_id'],
|
||||
'uid' => $val['app_uid'],
|
||||
|
||||
@@ -162,7 +162,7 @@ class Order extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_FAIL, '需支付金额必须大于0');
|
||||
}
|
||||
$this->load->helper('order');
|
||||
$sid = create_order_no(350200,'liche',1,$row['type']);
|
||||
$sid = create_order_no(350200,'liche');
|
||||
$sub_data = [
|
||||
'o_id' => $row['o_id'],
|
||||
'sid' => $sid,
|
||||
|
||||
@@ -83,13 +83,15 @@ class Channel extends HD_Controller
|
||||
|
||||
private function dataSelect($params)
|
||||
{
|
||||
$channel_biz_table = $params['group_id1'] ? 'lc_app_licheb_channel_biz1' : 'lc_app_licheb_channel_biz';
|
||||
$lists = [];
|
||||
$where['lc_biz.status'] = 1;
|
||||
$_title = '门店列表';
|
||||
if ($params['uid']) {
|
||||
$where['lc_app_licheb_channel_biz.uid'] = $params['uid'];
|
||||
$where[$channel_biz_table.'.uid'] = $params['uid'];
|
||||
$re = $this->mdUsers->get(array('id' => $params['uid']));
|
||||
$re['uname'] && $_title = $re['uname'] . '_门店列表';
|
||||
$group = $params['group_id1'] ? ' (第二角色)' :'';
|
||||
$re['uname'] && $_title = $re['uname'] .$group. '_门店列表';
|
||||
}
|
||||
!$params['city_id'] && $params['city_id'] = '';
|
||||
!$params['county_id'] && $params['county_id'] = '';
|
||||
@@ -102,20 +104,20 @@ class Channel extends HD_Controller
|
||||
if ($params['county_id']) {
|
||||
$where['lc_biz.county_id'] = $params['county_id'];
|
||||
}
|
||||
$count = $this->db->select('lc_app_licheb_channel_biz.biz_id')
|
||||
->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left')
|
||||
$count = $this->db->select($channel_biz_table.'.biz_id')
|
||||
->join('lc_biz', 'lc_biz.id = '.$channel_biz_table.'.biz_id', 'left')
|
||||
->where($where)
|
||||
->count_all_results('lc_app_licheb_channel_biz');
|
||||
->count_all_results($channel_biz_table);
|
||||
if ($count) {
|
||||
$offset = ($params['page'] - 1) * $params['size'];
|
||||
$limit = $params['size'];
|
||||
$this->db->from('lc_app_licheb_channel_biz');
|
||||
$this->db->join('lc_biz', "lc_biz.id = lc_app_licheb_channel_biz.biz_id", 'left');
|
||||
$this->db->from($channel_biz_table);
|
||||
$this->db->join('lc_biz', "lc_biz.id = ".$channel_biz_table.".biz_id", 'left');
|
||||
$this->db->select('lc_biz.id,lc_biz.biz_name,lc_biz.county_id,lc_biz.c_time');
|
||||
$this->db->where($where);
|
||||
$this->db->order_by('lc_app_licheb_channel_biz.id Desc');
|
||||
$this->db->order_by($channel_biz_table.'.id Desc');
|
||||
$this->db->limit($limit, $offset);
|
||||
!$params['uid'] && $this->db->group_by('lc_app_licheb_channel_biz.biz_id');
|
||||
!$params['uid'] && $this->db->group_by($channel_biz_table.'.biz_id');
|
||||
$res = $this->db->get()->result_array();
|
||||
$county_id_arr = array_unique(array_column($res, 'county_id'));
|
||||
$Areas = $this->mdArea->get_map_by_county_ids($county_id_arr, 'city_name,county_name,county_id', 'county_id');
|
||||
@@ -131,10 +133,10 @@ class Channel extends HD_Controller
|
||||
$setValue['orders'] = $this->mdOrders->count(['biz_id' => $value['id'], 'status>=' => 0, 'brand_id<>' => 3, 'biz_id<>' => 1]);
|
||||
$setValue['days'] = round((time() - $value['c_time']) / 3600 / 24) . '天';
|
||||
if (!$params['uid']) {
|
||||
$this->db->from('lc_app_licheb_channel_biz');
|
||||
$this->db->join('lc_app_licheb_users', "lc_app_licheb_users.id = lc_app_licheb_channel_biz.uid", 'left');
|
||||
$this->db->from($channel_biz_table);
|
||||
$this->db->join('lc_app_licheb_users', "lc_app_licheb_users.id = ".$channel_biz_table.".uid", 'left');
|
||||
$this->db->select('lc_app_licheb_users.uname');
|
||||
$this->db->where(['lc_app_licheb_channel_biz.biz_id' => $value['id']]);
|
||||
$this->db->where([$channel_biz_table.'.biz_id' => $value['id']]);
|
||||
$res_u = $this->db->get()->result_array();
|
||||
$unames = $res_u ? implode(',', array_column($res_u, 'uname')) : '';
|
||||
$setValue['uname'] = $unames;
|
||||
|
||||
@@ -66,7 +66,7 @@ class Main extends HD_Controller
|
||||
);
|
||||
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
|
||||
|
||||
$list = array();
|
||||
/*$list = array();
|
||||
$value = $this->mdSytLive->count(['status>' => -1]);
|
||||
$list[] = array(
|
||||
'title' => '私域通-直播(个)',
|
||||
@@ -108,7 +108,7 @@ class Main extends HD_Controller
|
||||
),
|
||||
);
|
||||
$conditions[] = array('icon' => 'am-icon-user', 'list' => $list);
|
||||
|
||||
*/
|
||||
/*小程序设置 end*/
|
||||
|
||||
/*实时数据 end*/
|
||||
|
||||
@@ -12,6 +12,7 @@ class Member extends HD_Controller
|
||||
parent::__construct();
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'userM');
|
||||
$this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz');
|
||||
$this->load->model('app/licheb/App_licheb_channel_biz1_model', 'mdChannelBiz1');
|
||||
$this->load->model("biz/biz_model");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,17 @@ class Member extends HD_Controller
|
||||
}
|
||||
$lists[$key]['biz_name'] = $biz_name;
|
||||
$lists[$key]['group_name'] = $this->groups[$val['group_id']];
|
||||
|
||||
$biz_name = '';
|
||||
if ($val['group_id1'] == 4) {
|
||||
$biz_name = ' <a href="javascript:void(0)" data-open="/app/licheb/channel/lists_biz?group_id1=1&uid=' . $val['id'] . '">门店列表</a>';
|
||||
} else if ($val['biz_id1']) {
|
||||
$re_biz = $this->biz_model->get(['id' => $val['biz_id1']], 'biz_name');
|
||||
$re_biz && $biz_name = $re_biz['biz_name'];
|
||||
}
|
||||
$lists[$key]['biz_name1'] = $biz_name;
|
||||
$lists[$key]['group_name1'] = $this->groups[$val['group_id1']];
|
||||
|
||||
if (SUPER_ADMIN == $this->role) {//超级管理员才允许操作用户的披上超级马甲
|
||||
$majia = array();
|
||||
if ($val['jsondata']) {
|
||||
@@ -90,6 +102,7 @@ class Member extends HD_Controller
|
||||
$id = $this->input->get('id');
|
||||
$row = $this->userM->get(['id' => $id]);
|
||||
$selectedBrands = [];
|
||||
$selectedBrands1 = [];
|
||||
if ($id) {
|
||||
$info = array(
|
||||
'id' => $row['id'],
|
||||
@@ -98,6 +111,9 @@ class Member extends HD_Controller
|
||||
'group_id' => $row['group_id'],
|
||||
'biz_id' => $row['biz_id'],
|
||||
'city_id' => $row['city_id'],
|
||||
'group_id1' => $row['group_id1'],
|
||||
'biz_id1' => $row['biz_id1'],
|
||||
'city_id1' => $row['city_id1'],
|
||||
);
|
||||
if ($row['group_id'] == 4) {
|
||||
$this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz');
|
||||
@@ -106,7 +122,9 @@ class Member extends HD_Controller
|
||||
if ($res_biz) {
|
||||
$biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
|
||||
$ids = implode(',', $biz_id_arr);
|
||||
$selectedBrands = $this->biz_model->select(["id in ($ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$selectedBrands = $this->biz_model->select(["id in ($ids)" => null, "type in ($type_ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
|
||||
}
|
||||
} else if ($row['biz_id']) {
|
||||
$re_biz = $this->biz_model->get(["id" => $row['biz_id'], 'status' => 1], 'id ,biz_name');
|
||||
@@ -114,16 +132,44 @@ class Member extends HD_Controller
|
||||
$selectedBrands[] = ['biz_id' => $re_biz['id'], 'name' => $re_biz['biz_name']];
|
||||
}
|
||||
}
|
||||
# group_id1
|
||||
if ($row['group_id1'] == 4) {
|
||||
$this->load->model('app/licheb/App_licheb_channel_biz1_model', 'mdChannelBiz1');
|
||||
$res_biz = $this->mdChannelBiz1->select(['uid' => $id], 'id desc', 0, 0, 'biz_id');
|
||||
$res_biz && $biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
|
||||
if ($res_biz) {
|
||||
$biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
|
||||
$ids = implode(',', $biz_id_arr);
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$selectedBrands1 = $this->biz_model->select(["id in ($ids)" => null, "type in ($type_ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
|
||||
}
|
||||
} else if ($row['biz_id1']) {
|
||||
$re_biz = $this->biz_model->get(["id" => $row['biz_id1'], 'status' => 1], 'id ,biz_name');
|
||||
if ($re_biz) {
|
||||
$selectedBrands1[] = ['biz_id' => $re_biz['id'], 'name' => $re_biz['biz_name']];
|
||||
}
|
||||
}
|
||||
$action = '/app/licheb/member/edit';
|
||||
$_title = '编辑用户';
|
||||
} else {
|
||||
$info = array('biz_id' => '', 'group_id' => '', 'city_id' => 0);
|
||||
$info = array('biz_id' => '', 'group_id' => '', 'city_id' => 0, 'biz_id1' => '', 'group_id1' => 0, 'city_id1' => 0);
|
||||
$action = '/app/licheb/member/add';
|
||||
$_title = '添加用户';
|
||||
}
|
||||
$type_ary = $this->biz_model->type_ary();
|
||||
$typeStr = '1,2,3';//品牌 合伙 代理
|
||||
$typeAry = [];
|
||||
foreach ($type_ary as $k => $v) {
|
||||
if (strstr($typeStr . ',', $k . ',')) {
|
||||
$typeAry[$k] = $v;
|
||||
}
|
||||
}
|
||||
$show_info['typeAry'] = $typeAry;
|
||||
#$show_info['typeAry'] = $this->biz_model->type_ary();
|
||||
$show_info['cityList'] = $this->mdSysCity->select(['status' => 1], 'id desc', 0, 0, 'city_id,name');
|
||||
$show_info['typeAry'] = $this->biz_model->type_ary();
|
||||
$this->data['selectedBrands'] = $selectedBrands;
|
||||
$this->data['selectedBrands1'] = $selectedBrands1;
|
||||
$this->data['show_info'] = $show_info;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['groups'] = $this->groups;
|
||||
@@ -142,6 +188,10 @@ class Member extends HD_Controller
|
||||
$bizs = $info['bizs'];
|
||||
$city_id = $info['city_id'];
|
||||
$biz_id_arr = array_column($bizs, 'biz_id');
|
||||
$group_id1 = $info['group_id1'];
|
||||
$bizs1 = $info['bizs1'];
|
||||
$city_id1 = $info['city_id1'];
|
||||
$biz_id_arr1 = is_array($bizs1) ? array_column($bizs1, 'biz_id') : '';
|
||||
|
||||
if (!mobile_valid($mobile)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '输入正确手机号');
|
||||
@@ -150,7 +200,7 @@ class Member extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入姓名');
|
||||
}
|
||||
|
||||
$exist = $this->userM->get(array('mobile' => $mobile));
|
||||
$exist = $this->userM->get(array('mobile' => $mobile, 'status in (0, 1)' => null));
|
||||
if ($exist) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '手机号的用户存在');
|
||||
}
|
||||
@@ -159,15 +209,22 @@ class Member extends HD_Controller
|
||||
'mobile' => $mobile,
|
||||
'uname' => $uname,
|
||||
'city_id' => $city_id,
|
||||
'city_id1' => $city_id1,
|
||||
'status' => 1,
|
||||
'c_time' => time(),
|
||||
);
|
||||
$group_id && $add['group_id'] = $group_id;
|
||||
$biz_id_arr && $add['biz_id'] = implode(',', $biz_id_arr);
|
||||
$add['group_id1'] = $group_id1 ? $group_id1 : 0;
|
||||
$biz_id_arr1 && $add['biz_id1'] = implode(',', $biz_id_arr1);
|
||||
|
||||
$id = $this->userM->add($add);
|
||||
if ($id && $group_id == 4 && $biz_id_arr) {//加狸车宝渠道门店
|
||||
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr]);
|
||||
}
|
||||
if ($id && $group_id1 == 4 && $biz_id_arr1) {//加狸车宝渠道门店 group_id1
|
||||
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr1, 'edit' => 1, 'group_id1'=>true]);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功', '/app/licheb/member');
|
||||
}
|
||||
|
||||
@@ -183,12 +240,19 @@ class Member extends HD_Controller
|
||||
$bizs = $info['bizs'];
|
||||
$city_id = $info['city_id'];
|
||||
$biz_id_arr = is_array($bizs) ? array_column($bizs, 'biz_id') : '';
|
||||
$group_id1 = $info['group_id1'];
|
||||
$bizs1 = $info['bizs1'];
|
||||
$city_id1 = $info['city_id1'];
|
||||
$biz_id_arr1 = is_array($bizs1) ? array_column($bizs1, 'biz_id') : '';
|
||||
|
||||
if (!mobile_valid($mobile)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '输入正确手机号');
|
||||
}
|
||||
if (!$uname) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入姓名');
|
||||
}
|
||||
|
||||
$exist = $this->userM->get(array('mobile' => $mobile, 'id <>' => $id));
|
||||
$exist = $this->userM->get(array('mobile' => $mobile, 'status in (0, 1)' => null, 'id <>' => $id));
|
||||
if ($exist) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '手机号的用户存在');
|
||||
}
|
||||
@@ -196,10 +260,13 @@ class Member extends HD_Controller
|
||||
$upd = array(
|
||||
'mobile' => $mobile,
|
||||
'city_id' => $city_id,
|
||||
'city_id1' => $city_id1,
|
||||
);
|
||||
|
||||
$upd['group_id'] = $group_id ? $group_id : 0;
|
||||
$upd['biz_id'] = $biz_id_arr ? implode(',', $biz_id_arr) : 0;
|
||||
$upd['group_id1'] = $group_id1 ? $group_id1 : 0;
|
||||
$upd['biz_id1'] = $biz_id_arr1 ? implode(',', $biz_id_arr1) : 0;
|
||||
|
||||
$nickname && $upd['nickname'] = $nickname;
|
||||
$uname && $upd['uname'] = $uname;
|
||||
@@ -208,6 +275,9 @@ class Member extends HD_Controller
|
||||
if ($id && $group_id == 4) {//加狸车宝渠道门店
|
||||
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr, 'edit' => 1]);
|
||||
}
|
||||
if ($id && $group_id1 == 4) {//加狸车宝渠道门店 group_id1
|
||||
$this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr1, 'edit' => 1, 'group_id1'=>true]);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
@@ -308,10 +378,12 @@ class Member extends HD_Controller
|
||||
function channel_biz($json = [])
|
||||
{
|
||||
$biz_ids = $json['biz_id_arr'] ? implode(',', $json['biz_id_arr']) : 0;
|
||||
$group_id1 = $json['group_id1'] ? true : false;
|
||||
if ($json['edit'] == 1) {//编辑删除未添加的
|
||||
$where_d['uid'] = $json['uid'];
|
||||
$biz_ids && $where_d["biz_id not in({$biz_ids})"] = null;
|
||||
$this->mdChannelBiz->delete($where_d);
|
||||
!$group_id1 && $this->mdChannelBiz->delete($where_d);
|
||||
$group_id1 && $this->mdChannelBiz1->delete($where_d);
|
||||
}
|
||||
if (!$biz_ids) {
|
||||
return;
|
||||
@@ -319,10 +391,12 @@ class Member extends HD_Controller
|
||||
$res_b = $this->biz_model->select(["id in({$biz_ids})" => null], '', 0, 0, 'id as biz_id');
|
||||
foreach ($res_b as $key => $value) {
|
||||
$where = ["uid" => $json['uid'], 'biz_id' => $value['biz_id']];
|
||||
$re_cb = $this->mdChannelBiz->get($where);
|
||||
!$group_id1 && $re_cb = $this->mdChannelBiz->get($where);
|
||||
$group_id1 && $re_cb = $this->mdChannelBiz1->get($where);
|
||||
if (!$re_cb) {
|
||||
$where['c_time'] = time();
|
||||
$this->mdChannelBiz->add($where);
|
||||
!$group_id1 && $this->mdChannelBiz->add($where);
|
||||
$group_id1 && $this->mdChannelBiz1->add($where);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ class Userslog extends HD_Controller
|
||||
$this->load->model('app/licheb/app_licheb_bizs_log_model', 'mdBizsLog');
|
||||
$this->load->model('receiver/receiver_customers_visit_sales_model', 'mdCustomerVisitSales');
|
||||
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
$this->load->model('receiver/order/receiver_orders_v2_model', 'orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'customer_oplogs_model');
|
||||
$this->load->model('app/app_lichene_qy_log_model', 'mdWechatqyLog');
|
||||
$this->load->model("biz/biz_model", 'mdBiz');
|
||||
$this->load->model('area_model', 'mdArea');
|
||||
@@ -63,7 +66,8 @@ class Userslog extends HD_Controller
|
||||
!$params['biz_id'] && $params['biz_id'] = '';
|
||||
!$params['city_id'] && $params['city_id'] = '';
|
||||
!$params['county_id'] && $params['county_id'] = '';
|
||||
$lists = $where_c = $where_dt = $where = [];
|
||||
$lists = $where_c = $where_dt = $where = $where_order = $where_order_del = $where_gr = [];
|
||||
$where_gr['type'] = 10;
|
||||
$same_day = 0;
|
||||
if ($params['time']) {
|
||||
$time = explode(' ~ ', $params['time']);
|
||||
@@ -72,15 +76,20 @@ class Userslog extends HD_Controller
|
||||
$where["log_date>="] = $time[0];
|
||||
$where_c["c_time>="] = strtotime("{$time[0]} 00:00:00");
|
||||
$where_dt["dt_time>="] = "{$time[0]} 00:00:00";
|
||||
$where_order_del["c_time>="] = strtotime("{$time[0]} 00:00:00");
|
||||
$where_gr["c_time>="] = strtotime("{$time[0]} 00:00:00");
|
||||
}
|
||||
if ($time[1]) {
|
||||
$where["log_date<="] = $time[1];
|
||||
$where_c["c_time<="] = strtotime("{$time[1]} 23:59:59");
|
||||
$where_dt["dt_time<="] = "{$time[1]} 23:59:59";
|
||||
$where_order_del["c_time<="] = strtotime("{$time[1]} 23:59:59");
|
||||
$where_gr["c_time<="] = strtotime("{$time[1]} 23:59:59");
|
||||
}
|
||||
} else {
|
||||
$where_c["c_time>="] = strtotime("2022-04-15 00:00:00");
|
||||
$where_dt["dt_time>="] = "2022-04-15 00:00:00";
|
||||
$where_order_del["c_time>="] = strtotime("2022-04-15 00:00:00");
|
||||
}
|
||||
$where_qy = $where_c;//企微数
|
||||
$where_qy['change_type'] = 'add_external_contact';
|
||||
@@ -103,6 +112,8 @@ class Userslog extends HD_Controller
|
||||
$where_c["biz_id in ({$str_ids})"] = null;
|
||||
$where_dt["biz_id in ({$str_ids})"] = null;
|
||||
}
|
||||
$where_order["biz_id in ({$str_ids})"] = null;
|
||||
$where_gr["customer_id in (select id from lc_receiver_customers where biz_id in ({$str_ids}))"] = null;
|
||||
} else {
|
||||
$where['biz_id'] = -2;
|
||||
$where_user = "biz_id = -2";
|
||||
@@ -110,6 +121,8 @@ class Userslog extends HD_Controller
|
||||
$where_c['biz_id'] = -2;
|
||||
$where_dt['biz_id'] = -2;
|
||||
}
|
||||
$where_order['biz_id'] = -2;
|
||||
$where_gr['type'] = -2;
|
||||
}
|
||||
}
|
||||
$total = $this->mdBizsLog->count($where);
|
||||
@@ -227,9 +240,25 @@ class Userslog extends HD_Controller
|
||||
$menus[] = ['title' => "战败数", 'value' => intval($sum['defeats']), 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('bills', $where);
|
||||
$menus[] = ['title' => "开票数", 'value' => intval($sum['bills']), 'tag' => '个'];
|
||||
|
||||
$where_user && $where_qy["userid in(select userid from lc_app_licheb_users where $where_user)"] = null;
|
||||
$qy_adds = $this->mdWechatqyLog->count($where_qy);
|
||||
$menus[] = ['title' => "企微数", 'value' => $qy_adds, 'tag' => '人'];
|
||||
#$menus[] = ['title' => "企微数", 'value' => $qy_adds, 'tag' => '人'];
|
||||
$qy_dts = $this->mdCustomers->count(array_merge($where_dt, ['wxqy' => 1]));
|
||||
$this->order_deliverys_model->get(array_merge($where_order_del, ['status in (1, 2)'=> null]), 'o_id');
|
||||
$del_sql = $this->order_deliverys_model->db->last_query();
|
||||
$this->orders_model->get(array_merge($where_order, ["id in ($del_sql)" => null]), 'customer_id');
|
||||
$order_sql = $this->orders_model->db->last_query();
|
||||
$qy_deliverys = $this->mdCustomers->count(array_merge($where_order, ['wxqy' => 1, "id in ($order_sql)" => null]));
|
||||
$qy_info = "<br>进店数:{$qy_dts}<br>交付数:{$qy_deliverys}";
|
||||
$menus[] = ['title' => "企微数", 'note' => $qy_adds ? "新增数:{$qy_adds}{$qy_info}" : '0人'];
|
||||
|
||||
$gr_adds = $this->customer_oplogs_model->count($where_gr);
|
||||
$gr_dts = $this->mdCustomers->count(array_merge($where_dt, ['wxgr' => 1]));
|
||||
$gr_deliverys = $this->mdCustomers->count(array_merge($where_order, ['wxgr' => 1, "id in ($order_sql)" => null]));
|
||||
$gr_info = "<br>进店数:{$gr_dts}<br>交付数:{$gr_deliverys}";
|
||||
$menus[] = ['title' => "个微数", 'note' => $gr_adds ? "新增数:{$gr_adds}{$gr_info}" : '0人'];
|
||||
|
||||
$sum = $this->mdUsersLog->sum('reassigns', $where);
|
||||
$menus[] = ['title' => "改派数", 'value' => intval($sum['reassigns']), 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('receives', $where);
|
||||
@@ -364,7 +393,7 @@ class Userslog extends HD_Controller
|
||||
$uname = '';
|
||||
$map_sale[$v['sales_id']] && $uname = $map_sale[$v['sales_id']];
|
||||
$follows = $v['t_follows'] + $v['h_follows'] + $v['w_follows'];
|
||||
$temp = ['uname' => $uname, 'follows' => $follows, 't_follows' => $v['t_follows']
|
||||
$temp = ['id'=>$v['id'], 'uname' => $uname, 'follows' => $follows, 't_follows' => $v['t_follows']
|
||||
, 'h_follows' => $v['h_follows'], 'w_follows' => $v['w_follows'], 't_day' => $v['t_day']];
|
||||
$lists[] = $temp;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class Attr extends HD_Controller
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
$this->load->model('auto/auto_option_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -32,6 +33,7 @@ class Attr extends HD_Controller
|
||||
$where["status > -1"] = null;
|
||||
$params['title'] && $where["title like '%{$params['title']}%'"] = null;
|
||||
|
||||
$where['s_id in (select id from lc_auto_series where brand_id in (select id from lc_auto_brand where status > -1))'] = null;
|
||||
if ($params['s_id']) {
|
||||
$where['s_id'] = $params['s_id'];
|
||||
}
|
||||
@@ -46,17 +48,29 @@ class Attr extends HD_Controller
|
||||
$where['s_id'] = -1;
|
||||
}
|
||||
}
|
||||
strlen($params['type']) && $where['type'] = $params['type'];
|
||||
if (!strlen($params['status'])){
|
||||
$params['status'] = $where['status'] = 1;
|
||||
}
|
||||
elseif ($params['status'] == -9){
|
||||
# pass
|
||||
}
|
||||
else{
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
|
||||
!$params['s_id'] && $params['s_id'] = '';
|
||||
!$params['brand_id'] && $params['brand_id'] = '';
|
||||
!strlen($params['type']) && $params['type'] = '';
|
||||
|
||||
$count = $this->auto_attr_model->count($where);
|
||||
$rows = $this->auto_attr_model->select($where, 'id desc', $page, $size);
|
||||
$rows = $this->auto_attr_model->select($where, 'id desc', $page, $size, '*, (select brand_id from lc_auto_series where id=lc_auto_attr.s_id) as brand_id');
|
||||
$type_arr = $this->auto_attr_model->get_type();
|
||||
$status_arr = $this->auto_brand_model->get_status();
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0, 0, 'id, name');
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
|
||||
$list = [];
|
||||
if ($rows) {
|
||||
@@ -66,6 +80,7 @@ class Attr extends HD_Controller
|
||||
$list[] = [
|
||||
'id' => $val['id'],
|
||||
'title' => $val['title'],
|
||||
'brand_name' => $map_brand[$val['brand_id']] ? $map_brand[$val['brand_id']] : '',
|
||||
's_name' => $series_rows[$val['s_id']] ? $series_rows[$val['s_id']][0]['name'] : '',
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'status' => $val['status'],
|
||||
@@ -74,9 +89,13 @@ class Attr extends HD_Controller
|
||||
];
|
||||
}
|
||||
}
|
||||
$status_arr_list = $status_arr;
|
||||
unset($status_arr_list[-1]);
|
||||
$this->data['status_arr'] = $status_arr_list;
|
||||
$this->data['type_arr'] = $type_arr;
|
||||
$this->data['lists'] = $list;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['brandAry'] = $map_brand;
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['_title'] = '属性管理';
|
||||
$this->show_view('auto/attr/lists', true);
|
||||
@@ -87,7 +106,8 @@ class Attr extends HD_Controller
|
||||
$id = $this->input->get('id');
|
||||
|
||||
$info = [
|
||||
'title' => ''
|
||||
'title' => '',
|
||||
'options' => [],
|
||||
];
|
||||
if ($id) {
|
||||
$info = $this->auto_attr_model->get(array('id' => $id));
|
||||
@@ -96,17 +116,20 @@ class Attr extends HD_Controller
|
||||
}
|
||||
$info['jsondata'] = json_decode($info['jsondata'], true);
|
||||
$info['jsondata']['img'] && $info['jsondata']['s_img'] = build_qiniu_image_url($info['jsondata']['img']);
|
||||
$info['options'] = $info['jsondata']['options'] ? $info['jsondata']['options'] : [];
|
||||
}
|
||||
$brand_id = '';
|
||||
if ($info['s_id']) {
|
||||
$row_sery = $this->auto_series_model->get(array('id' => $info['s_id']));
|
||||
$brand_id = $row_sery['brand_id'];
|
||||
}
|
||||
$options = $this->auto_option_model->select(['status'=>1],'id desc',0,0,'id,title,price');
|
||||
$type_arr = $this->auto_attr_model->get_type();
|
||||
!$info['type'] && $info['type'] = 0;
|
||||
$info['brand_id'] = $brand_id;
|
||||
!$info['s_id'] && $info['s_id'] = '';
|
||||
!$info['jsondata']['img'] && $info['jsondata']['img'] = '';
|
||||
$this->data['options'] = $options;
|
||||
$this->data['type_arr'] = $type_arr;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = $id ? '编辑' : '新增';
|
||||
@@ -128,6 +151,7 @@ class Attr extends HD_Controller
|
||||
'type' => $post['type'],
|
||||
'c_time' => time()
|
||||
];
|
||||
$post['jsondata']['options'] = $post['options'] ? $post['options'] : [];
|
||||
$post['jsondata'] && $add_data['jsondata'] = json_encode($post['jsondata'], JSON_UNESCAPED_UNICODE);
|
||||
$result = $this->auto_attr_model->add($add_data);
|
||||
if (!$result) {
|
||||
@@ -154,6 +178,7 @@ class Attr extends HD_Controller
|
||||
's_id' => $post['s_id'],
|
||||
'type' => $post['type'],
|
||||
];
|
||||
$post['jsondata']['options'] = $post['options'] ? $post['options'] : [];
|
||||
$post['jsondata'] && $update['jsondata'] = json_encode($post['jsondata'], JSON_UNESCAPED_UNICODE);
|
||||
$result = $this->auto_attr_model->update($update, ['id' => $row['id']]);
|
||||
if (!$result) {
|
||||
@@ -198,10 +223,24 @@ class Attr extends HD_Controller
|
||||
$where = array();
|
||||
$s_id && $where['s_id'] = $s_id;
|
||||
strlen($type) > 0 && $where['type'] = $type;
|
||||
if ($status == 3) {//搜索专用
|
||||
/*if ($status == 3) {//搜索专用
|
||||
$where['status'] = 1;
|
||||
} else {
|
||||
$where['status>'] = -1;
|
||||
}*/
|
||||
if(strlen($status) > 0){
|
||||
if (strpos($status,'>') !== false || strpos($status,'<') !== false || strpos($status,'in') !== false){
|
||||
$where["status {$status}"] = null;
|
||||
}
|
||||
else{
|
||||
if ($status == 3) {//搜索专用
|
||||
$where['status'] = 1;
|
||||
} else {
|
||||
$where['status>'] = -1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$where['status > -1'] = null;
|
||||
}
|
||||
$where['status>-1'] = null;
|
||||
$total = $this->auto_attr_model->count($where);
|
||||
|
||||
@@ -12,6 +12,8 @@ class Brand extends HD_Controller{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_brand_biz_model');
|
||||
$this->load->model('biz/biz_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
@@ -25,8 +27,18 @@ class Brand extends HD_Controller{
|
||||
$size = 20;
|
||||
$where["status > -1"] = null;
|
||||
$params['title'] && $where["name like '%{$params['title']}%'"] = null;
|
||||
if (!strlen($params['status'])){
|
||||
$params['status'] = $where['status'] = 1;
|
||||
}
|
||||
elseif ($params['status'] == -9){
|
||||
# pass
|
||||
}
|
||||
else{
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
|
||||
$count = $this->auto_brand_model->count($where);
|
||||
$rows = $this->auto_brand_model->select($where, 'id desc', $page, $size);
|
||||
$rows = $this->auto_brand_model->select($where, 'status desc, id asc', $page, $size);
|
||||
$status_arr = $this->auto_brand_model->get_status();
|
||||
$list = [];
|
||||
if($rows){
|
||||
@@ -35,11 +47,15 @@ class Brand extends HD_Controller{
|
||||
'id' => $val['id'],
|
||||
'name' => $val['name'],
|
||||
'status' => $val['status'],
|
||||
't_biz' => $this->auto_brand_biz_model->count(['brand_id'=>$val['id']]),
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'c_time' => date('Y-m-d H:i:s',$val['c_time'])
|
||||
];
|
||||
}
|
||||
}
|
||||
$status_arr_list = $status_arr;
|
||||
unset($status_arr_list[-1]);
|
||||
$this->data['status_arr'] = $status_arr_list;
|
||||
$this->data['lists'] = $list;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
@@ -126,6 +142,20 @@ class Brand extends HD_Controller{
|
||||
$stauts = $this->input->post('status');
|
||||
$where = array('id' => $id);
|
||||
$this->auto_brand_model->update(array('status' => $stauts), $where);
|
||||
if ($stauts == -1){
|
||||
$this->load->model('auto/auto_cars_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
# 车型库
|
||||
$this->auto_cars_model->update(array('status' => $stauts), array('brand_id' => $id));
|
||||
# 车系
|
||||
$this->auto_series_model->update(array('status' => $stauts), array('brand_id' => $id));
|
||||
# 车辆属性
|
||||
$this->auto_attr_model->update(array('status' => $stauts), array("s_id in (select id from lc_auto_series where brand_id = {$id})" => null));
|
||||
# 车型介绍
|
||||
$this->load->model('auto/auto_introduce_model', 'mdAutoIntroduce');
|
||||
$this->mdAutoIntroduce->update(array('status' => $stauts), array('brand_id' => $id));
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
@@ -154,22 +184,27 @@ class Brand extends HD_Controller{
|
||||
$title && $where["name like '%{$title}%'"] = null;
|
||||
$un_ids && $where["id not in({$un_ids})"] = null;
|
||||
if(strlen($status) > 0){
|
||||
$where['status'] = $status;
|
||||
if (strpos($status,'>') !== false || strpos($status,'<') !== false || strpos($status,'in') !== false){
|
||||
$where["status {$status}"] = null;
|
||||
}
|
||||
else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
} else {
|
||||
$whre['status > -1'] = null;
|
||||
$where['status > -1'] = null;
|
||||
}
|
||||
|
||||
$total = $this->auto_brand_model->count($where);
|
||||
|
||||
$lists = array();
|
||||
if($total){
|
||||
$orderby = 'id desc';
|
||||
$orderby = 'status desc, id asc';
|
||||
$select = 'id, name';
|
||||
$rows = $this->auto_brand_model->select($where, $orderby, $page, $size, $select);
|
||||
|
||||
foreach($rows as $v){
|
||||
$lists[] = array(
|
||||
'id' => $v['id'],
|
||||
'id' => strlen($status) > 0 ? $v['id'] : " " . $v['id'],
|
||||
'name' => $v['name'],
|
||||
);
|
||||
}
|
||||
@@ -178,5 +213,153 @@ class Brand extends HD_Controller{
|
||||
$this->data = array('total' => $total, 'list' => $lists);
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
//授权门店
|
||||
public function get_biz(){
|
||||
$id = $this->input->get('id');
|
||||
|
||||
$info = $this->auto_brand_model->get(array('id' => $id));
|
||||
if (!$info) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
$cate_lists = $this->biz_model->type_ary();
|
||||
$params = [
|
||||
'id' => $id,
|
||||
'cate_id' => 1
|
||||
];
|
||||
$this->data['params'] = $params;
|
||||
$this->data['cate_lists'] = $cate_lists;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = '授权品牌';
|
||||
return $this->show_view('auto/brand/edit_biz',true);
|
||||
}
|
||||
//授权门店
|
||||
public function edit_biz(){
|
||||
$brand_id = $this->input->post('id');
|
||||
$type = intval($this->input->post('type'));
|
||||
$brand_biz = $this->input->post('brand_biz');
|
||||
|
||||
$info = $this->auto_brand_model->get(array('id' => $brand_id));
|
||||
if (!$info) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$biz_ids = '';
|
||||
$brand_biz && $biz_ids = implode(',',array_unique(array_keys($brand_biz)));
|
||||
if($brand_biz && $biz_ids){
|
||||
$where = [
|
||||
"biz_id not in ({$biz_ids})" => null,
|
||||
'brand_id' => $brand_id
|
||||
];
|
||||
$type && $where['type'] = $type;
|
||||
if($this->auto_brand_biz_model->count($where)){
|
||||
$this->auto_brand_biz_model->delete($where);
|
||||
}
|
||||
$add_datas = [];
|
||||
foreach ($brand_biz as $key => $val) {
|
||||
$where = [
|
||||
'biz_id' => $key,
|
||||
'brand_id' => $brand_id
|
||||
];
|
||||
$type && $where['type'] = $type;
|
||||
if(!$this->auto_brand_biz_model->count($where)){
|
||||
if(!$type){
|
||||
$biz_row = $this->biz_model->get(['id'=>$key],'type');
|
||||
$type = $biz_row['type'];
|
||||
}
|
||||
$add_datas[] = [
|
||||
'biz_id' => $key,
|
||||
'type' => $type,
|
||||
'brand_id' => $brand_id,
|
||||
'c_time' => time()
|
||||
];
|
||||
}
|
||||
}
|
||||
$add_datas && $this->auto_brand_biz_model->add_batch($add_datas);
|
||||
}else{
|
||||
$where = [
|
||||
'brand_id' => $brand_id,
|
||||
];
|
||||
$type && $where['type'] = $type;
|
||||
if($this->auto_brand_biz_model->count($where)){
|
||||
$this->auto_brand_biz_model->delete($where);
|
||||
}
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function ajax_biz(){
|
||||
$type = intval($this->input->get('type'));
|
||||
$brand_id = intval($this->input->get('id'));
|
||||
if($type){
|
||||
$where = [
|
||||
'status' => 1,
|
||||
'type' => $type,
|
||||
"id not in (select biz_id from lc_auto_brand_biz where brand_id={$brand_id} and type={$type})" => null
|
||||
];
|
||||
}else{
|
||||
$where = [
|
||||
'status' => 1,
|
||||
"id not in (select biz_id from lc_auto_brand_biz where brand_id={$brand_id})" => null
|
||||
];
|
||||
}
|
||||
$biz_lists = $this->biz_model->map('id','biz_name',$where,'',0,0,'id,biz_name');
|
||||
if($type){
|
||||
$where = [
|
||||
'status' => 1,
|
||||
'type' => $type,
|
||||
"id in (select biz_id from lc_auto_brand_biz where brand_id={$brand_id} and type={$type})" => null
|
||||
];
|
||||
}else{
|
||||
$where = [
|
||||
'status' => 1,
|
||||
"id in (select biz_id from lc_auto_brand_biz where brand_id={$brand_id})" => null
|
||||
];
|
||||
}
|
||||
$brand_biz = $this->biz_model->map('id','biz_name',$where,'',0,0,'id,biz_name');
|
||||
$this->data['biz_lists'] = $biz_lists;
|
||||
$this->data['brand_biz'] = $brand_biz;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
//旧门店授权品牌脚本
|
||||
public function change(){
|
||||
$page = $this->input->get('page');
|
||||
$size = $this->input->get('size');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 20;
|
||||
$where = [
|
||||
'status' => 1
|
||||
];
|
||||
$rows = $this->biz_model->select($where,'id asc',$page,$size,'id,type,jsondata');
|
||||
if($rows){
|
||||
foreach ($rows as $key=>$val) {
|
||||
$jsondata = json_decode($val['jsondata'],true);
|
||||
$add_datas = [];
|
||||
if($jsondata['auto_brands'] && is_array($jsondata['auto_brands'])){
|
||||
foreach ($jsondata['auto_brands'] as $v) {
|
||||
$where = [
|
||||
'biz_id'=>$val['id'],
|
||||
'type'=>$val['type'],
|
||||
'brand_id'=>$v
|
||||
];
|
||||
if(!$this->auto_brand_biz_model->count($where)){
|
||||
$add_datas[] = [
|
||||
'biz_id' => $val['id'],
|
||||
'type' => $val['type'],
|
||||
'brand_id' => $v,
|
||||
'c_time' => time()
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
$add_datas && $this->auto_brand_biz_model->add_batch($add_datas);
|
||||
echo "门店id:{$val['id']},添加数据:".json_encode($add_datas,JSON_UNESCAPED_UNICODE).'<br>';
|
||||
}else{
|
||||
echo "门店id:{$val['id']},无授权品牌<br>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
echo '执行完毕';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,11 +20,43 @@ class Business extends HD_Controller{
|
||||
public function index()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$where = $this->get_where($params);
|
||||
$page = $params['page'];
|
||||
$page = !$page ? 1 : $page;
|
||||
$size = $params['size'];
|
||||
$size = !$size ? 20 : $size;
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status = 1' => null);
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
//状态
|
||||
$statusAry = array('0' => '关闭', '1' => '开启');
|
||||
|
||||
$total = $this->auto_business_model->count($where);
|
||||
$lists = array();
|
||||
$total && $lists = $this->get_data($where, $page, $size, $map_brand);
|
||||
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['statusAry'] = $statusAry;
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['cityAry'] = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name');
|
||||
$this->data['yearAry'] = $this->auto_business_model->year();
|
||||
$this->data['monthAry'] = $this->auto_business_model->month();
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
|
||||
$this->data['_title'] = '商务政策管理';
|
||||
$this->show_view('auto/business/lists',true);
|
||||
}
|
||||
|
||||
private function get_where(&$params){
|
||||
!isset($params['status']) && $params['status'] = 1;
|
||||
!isset($params['if_effect']) && $params['if_effect'] = 1;
|
||||
!isset($params['month']) && $params['month'] = '';
|
||||
|
||||
$where = array();
|
||||
$where['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where['s_id in (select id from lc_auto_series where status = 1)'] = null;
|
||||
$where['v_id in (select id from lc_auto_attr where status = 1 and type = 1)'] = null;
|
||||
if($params['brand_id']){
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
} else{
|
||||
@@ -64,83 +96,82 @@ class Business extends HD_Controller{
|
||||
if($params['month']){
|
||||
$where['month'] = $params['month'];
|
||||
}
|
||||
$page = $params['page'];
|
||||
$page = !$page ? 1 : $page;
|
||||
$size = $params['size'];
|
||||
$size = !$size ? 20 : $size;
|
||||
return $where;
|
||||
}
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
|
||||
//状态
|
||||
$statusAry = array('0' => '关闭', '1' => '开启');
|
||||
|
||||
$total = $this->auto_business_model->count($where);
|
||||
private function get_data($where, $page, $size, $map_brand, $export=false){
|
||||
$lists = array();
|
||||
if($total){
|
||||
$orderby = 'id desc';
|
||||
$select = '*';
|
||||
$rows = $this->auto_business_model->select($where, $orderby, $page, $size, $select);
|
||||
if($rows){
|
||||
$s_ids = array_unique(array_column($rows,'s_id'));
|
||||
$attr_ids = array_unique(array_column($rows,'v_id'));
|
||||
$city_ids = array_unique(array_column($rows,'city_id'));
|
||||
//获取车系列表
|
||||
$map_sery = array();
|
||||
if($s_ids){
|
||||
$str_ids = implode(',', $s_ids);
|
||||
$where_sery = array("id in ({$str_ids})" => null);
|
||||
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
$map_attr = array();
|
||||
if($attr_ids){
|
||||
$str_ids = implode(',', $attr_ids);
|
||||
$where_attr = array("id in ({$str_ids})" => null);
|
||||
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
|
||||
}
|
||||
if($city_ids){
|
||||
$str_ids = implode(',', $city_ids);
|
||||
$where_city = array("city_id in ({$str_ids})" => null);
|
||||
$map_city = $this->sys_city_model->map('city_id', 'name', $where_city, 'id desc', 0 , 0, 'city_id, name');
|
||||
}
|
||||
//属性按'车型-车身颜色-内饰颜色'排序
|
||||
foreach($rows as $v){
|
||||
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]}";
|
||||
$city_cn = $map_city[$v['city_id']];
|
||||
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
|
||||
$lists[] = array(
|
||||
'id' => $v['id'],
|
||||
'title' => $title,
|
||||
'status' => $v['status'],
|
||||
'price_car' => $v['price_car'] > 0 ? $v['price_car'] : '0.00',
|
||||
'price_floor' => $v['price_floor'] > 0 ? $v['price_floor'] : '0.00',
|
||||
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
|
||||
'price_color' => $v['price_color'] > 0 ? $v['price_color'] : '0.00',
|
||||
'profix_car' => $v['profix_car'],
|
||||
'profix_insure' => $v['profix_insure'],
|
||||
'profix_carno' => $v['profix_carno'],
|
||||
'profix_loan' => $v['profix_loan'],
|
||||
'city_cn'=> $city_cn,
|
||||
'month' => $month,
|
||||
's_effect_time' => $v['s_effect_time'] ? date('Y-m-d',$v['s_effect_time']) : '',
|
||||
'effect_status' => $v['if_effect'] ? '生效中' : '未生效',
|
||||
'if_effect' => $v['if_effect'],
|
||||
'delivery_day' => $v['delivery_day']
|
||||
$orderby = 'id desc';
|
||||
$select = '*';
|
||||
$rows = $this->auto_business_model->select($where, $orderby, $page, $size, $select);
|
||||
if($rows){
|
||||
$s_ids = array_unique(array_column($rows,'s_id'));
|
||||
$attr_ids = array_unique(array_column($rows,'v_id'));
|
||||
$city_ids = array_unique(array_column($rows,'city_id'));
|
||||
//获取车系列表
|
||||
$map_sery = array();
|
||||
if($s_ids){
|
||||
$str_ids = implode(',', $s_ids);
|
||||
$where_sery = array("id in ({$str_ids})" => null);
|
||||
$map_sery = $this->auto_series_model->map('id', 'name', $where_sery, 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
$map_attr = array();
|
||||
if($attr_ids){
|
||||
$str_ids = implode(',', $attr_ids);
|
||||
$where_attr = array("id in ({$str_ids})" => null);
|
||||
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
|
||||
}
|
||||
if($city_ids){
|
||||
$str_ids = implode(',', $city_ids);
|
||||
$where_city = array("city_id in ({$str_ids})" => null);
|
||||
$map_city = $this->sys_city_model->map('city_id', 'name', $where_city, 'id desc', 0 , 0, 'city_id, name');
|
||||
}
|
||||
//属性按'车型-车身颜色-内饰颜色'排序
|
||||
foreach($rows as $v){
|
||||
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]}";
|
||||
$city_cn = $map_city[$v['city_id']];
|
||||
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
|
||||
$row = array(
|
||||
'id' => $v['id'],
|
||||
'title' => $title,
|
||||
'status' => $v['status'],
|
||||
'price_car' => $v['price_car'] > 0 ? $v['price_car'] : '0.00',
|
||||
'price_floor' => $v['price_floor'] > 0 ? $v['price_floor'] : '0.00',
|
||||
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
|
||||
'price_color' => $v['price_color'] > 0 ? $v['price_color'] : '0.00',
|
||||
'profix_car' => $v['profix_car'],
|
||||
'proxy_type' => $v['proxy_type'] == 0 ? '返佣' : '票折',
|
||||
'proxy_profix_price' => $v['proxy_profix_price'] != 0.0 ? $v['proxy_profix_price'] :'',
|
||||
'proxy_profix_lower' => $v['proxy_profix_lower'] != 0.0 ? $v['proxy_profix_lower'] : '',
|
||||
'proxy_profix_rebate' => $v['proxy_profix_rebate'] != 0.0 ? $v['proxy_profix_rebate'] : '',
|
||||
'proxy_profix_car' => $v['proxy_profix_car'],
|
||||
'profix_insure' => $v['profix_insure'],
|
||||
'profix_carno' => $v['profix_carno'],
|
||||
'profix_loan' => $v['profix_loan'],
|
||||
'city_cn'=> $city_cn,
|
||||
'month' => $month,
|
||||
's_effect_time' => $v['s_effect_time'] ? date('Y-m-d',$v['s_effect_time']) : '',
|
||||
'effect_status' => $v['if_effect'] ? '生效中' : '未生效',
|
||||
'if_effect' => $v['if_effect'],
|
||||
'delivery_day' => $v['delivery_day']
|
||||
);
|
||||
|
||||
if ($export){
|
||||
$export_arr = array(
|
||||
'brand_name' => $map_brand[$v['brand_id']],
|
||||
'sery_name' => $map_sery[$v['s_id']],
|
||||
'attr_name' => $map_attr[$v['v_id']],
|
||||
'year' => $v['year'],
|
||||
'month' => $v['month'],
|
||||
'status_name' => $v['status'] ? '开启' : '关闭',
|
||||
);
|
||||
$row = array_merge($row, $export_arr);
|
||||
}
|
||||
$lists[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['statusAry'] = $statusAry;
|
||||
$this->data['brandAry'] = $map_brand;
|
||||
$this->data['cityAry'] = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name');
|
||||
$this->data['yearAry'] = $this->auto_business_model->year();
|
||||
$this->data['monthAry'] = $this->auto_business_model->month();
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
|
||||
$this->data['_title'] = '商务政策管理';
|
||||
$this->show_view('auto/business/lists',true);
|
||||
return $lists;
|
||||
}
|
||||
|
||||
public function lists()
|
||||
@@ -151,20 +182,25 @@ class Business extends HD_Controller{
|
||||
public function get()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', ['status>'=>-1], 'id desc', 0 , 0, 'id, name');
|
||||
#$map_brand = $this->auto_brand_model->map('id', 'name', ['status>'=>-1], 'id desc', 0 , 0, 'id, name');
|
||||
$map_brand = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand(array('status = 1' => null)));
|
||||
$city_rows = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name');
|
||||
$row = $this->auto_business_model->get(['id'=>$id]);
|
||||
if($id && $row){
|
||||
$info = [
|
||||
'id' => $row['id'],
|
||||
'city_id' => $row['city_id'],
|
||||
'brand_id' => $row['brand_id'],
|
||||
'brand_id' => ' '.$row['brand_id'],
|
||||
's_id' => $row['s_id'],
|
||||
'v_id' => $row['v_id'],
|
||||
'price_car' => $row['price_car'],
|
||||
'price_floor' => $row['price_floor'],
|
||||
'price_color' => $row['price_color'],
|
||||
'price_coplus' => $row['price_coplus'],
|
||||
'proxy_type' => intval($row['proxy_type']),
|
||||
'proxy_profix_price' => $row['proxy_profix_price'],
|
||||
'proxy_profix_lower' => $row['proxy_profix_lower'],
|
||||
'proxy_profix_rebate' => $row['proxy_profix_rebate'],
|
||||
'proxy_profix_car' => $row['proxy_profix_car'],
|
||||
'profix_car' => $row['profix_car'],
|
||||
'profix_carno' => $row['profix_carno'],
|
||||
@@ -193,6 +229,10 @@ class Business extends HD_Controller{
|
||||
'price_floor' => 0.00,
|
||||
'price_color' => 0.00,
|
||||
'price_coplus' => 0.00,
|
||||
'proxy_type' => 0,
|
||||
'proxy_profix_price' => 0.00,
|
||||
'proxy_profix_lower' => 0.00,
|
||||
'proxy_profix_rebate' => 0.00,
|
||||
'proxy_profix_car' => 0.00,
|
||||
'profix_car' => 0.00,
|
||||
'profix_carno' => 0.00,
|
||||
@@ -250,6 +290,10 @@ class Business extends HD_Controller{
|
||||
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
|
||||
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
|
||||
$info['price_color'] && $data['price_color'] = $info['price_color'];
|
||||
$data['proxy_type'] = $info['proxy_type'];
|
||||
$data['proxy_profix_price'] = $info['proxy_profix_price'];
|
||||
$data['proxy_profix_lower'] = $info['proxy_profix_lower'];
|
||||
$data['proxy_profix_rebate'] = $info['proxy_profix_rebate'];
|
||||
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
|
||||
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
|
||||
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
|
||||
@@ -265,6 +309,186 @@ class Business extends HD_Controller{
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
|
||||
}
|
||||
|
||||
function add_excel()
|
||||
{
|
||||
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
|
||||
$res = $this->upload();
|
||||
if (!$res['code']) {
|
||||
return $this->show_json(0, $res['message']);
|
||||
}
|
||||
$file = $res['path'];
|
||||
if ($res['file_ext'] == '.xls') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel5'); // 读取 excel 文档
|
||||
} elseif ($res['file_ext'] == '.xlsx') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '文件无法识别');
|
||||
}
|
||||
$PHPExcel = $reader->load($file); // 文档名称
|
||||
$objWorksheet = $PHPExcel->getActiveSheet();
|
||||
$rowCnt = $objWorksheet->getHighestRow(); //获取总行数
|
||||
if ($rowCnt > 800) {
|
||||
@unlink($file);
|
||||
return $this->show_json(0, '数据大于800请拆分多个表格导入');
|
||||
}
|
||||
$data = array();
|
||||
$yearary = $this->auto_business_model->year();
|
||||
$monthary = $this->auto_business_model->month();
|
||||
$c_time = time();
|
||||
$count = $rowCnt - 1;
|
||||
$count_ignore = 0;
|
||||
$msg_debug = "file: {$file};count: {$count};";
|
||||
for ($_row = 2; $_row <= $rowCnt; $_row++) { //读取内容
|
||||
$brand_name = $objWorksheet->getCell('A' . $_row)->getValue();
|
||||
$res = $this->auto_brand_model->get(array('status'=>1, 'name'=>$brand_name), 'id');
|
||||
if (!$res){
|
||||
$count_ignore += 1;
|
||||
$msg_debug .= 'no brand_id;';
|
||||
continue;
|
||||
}
|
||||
$brand_id = $res['id'];
|
||||
|
||||
$s_name = $objWorksheet->getCell('B' . $_row)->getValue();
|
||||
$res = $this->auto_series_model->get(array('status'=>1, 'brand_id'=> $brand_id, 'name'=>$s_name), 'id');
|
||||
if (!$res){
|
||||
$count_ignore += 1;
|
||||
$msg_debug .= 'no s_id;';
|
||||
continue;
|
||||
}
|
||||
$s_id = $res['id'];
|
||||
|
||||
$v_name = $objWorksheet->getCell('C' . $_row)->getValue();
|
||||
$res = $this->auto_attr_model->get(array('status'=>1, 's_id'=> $s_id, 'title'=>$v_name), 'id');
|
||||
if (!$res){
|
||||
$count_ignore += 1;
|
||||
$msg_debug .= 'no v_id;';
|
||||
continue;
|
||||
}
|
||||
$v_id = $res['id'];
|
||||
|
||||
$city_name = $objWorksheet->getCell('D' . $_row)->getValue();
|
||||
if (!$city_name){
|
||||
$count_ignore += 1;
|
||||
$msg_debug .= 'no city_name;';
|
||||
continue;
|
||||
}
|
||||
$res = $this->sys_city_model->get(array('status'=>1, "name like '%{$city_name}%'"=>null), 'city_id');
|
||||
if (!$res){
|
||||
$count_ignore += 1;
|
||||
$sql = $this->sys_city_model->db->last_query();
|
||||
$msg_debug .= "no city_id: {$sql};";
|
||||
continue;
|
||||
}
|
||||
$city_id = $res['city_id'];
|
||||
|
||||
$s_effect_date = $objWorksheet->getCell('E' . $_row)->getValue(); # 此处得到是距离1900-01-01天数
|
||||
$s_effect_date && $s_effect_date = gmdate("Y-m-d", \PHPExcel_Shared_Date::ExcelToPHP($s_effect_date));
|
||||
$s_effect_time = 0;
|
||||
$if_effect = 0;
|
||||
if ($s_effect_date) {
|
||||
$s_effect_time = strtotime($s_effect_date);
|
||||
if($c_time>$s_effect_time){
|
||||
$if_effect = 1;
|
||||
}
|
||||
}
|
||||
$msg_debug .= "s_effect_date:{$s_effect_date};s_effect_time:{$s_effect_time};if_effect:{$if_effect};";
|
||||
|
||||
$year = $objWorksheet->getCell('F' . $_row)->getValue();
|
||||
$month = $objWorksheet->getCell('G' . $_row)->getValue();
|
||||
$year = intval($year);
|
||||
$month = intval($month);
|
||||
if (!in_array($year, $yearary) || !in_array($month, $monthary)){
|
||||
$count_ignore += 1;
|
||||
$msg_debug .= 'year or month exception;';
|
||||
continue;
|
||||
}
|
||||
|
||||
$where = [
|
||||
'brand_id' => $brand_id,
|
||||
's_id' => $s_id,
|
||||
'v_id' => $v_id,
|
||||
'city_id' => $city_id,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'status' => 1,
|
||||
];
|
||||
if($this->auto_business_model->get($where)){
|
||||
$count_ignore += 1;
|
||||
$sql = $this->auto_business_model->db->last_query();
|
||||
$msg_debug .= "exists business: {$sql};";
|
||||
continue;
|
||||
}
|
||||
|
||||
$price_car = $objWorksheet->getCell('H' . $_row)->getValue();
|
||||
$price_floor = $objWorksheet->getCell('I' . $_row)->getValue();
|
||||
$delivery_day = $objWorksheet->getCell('J' . $_row)->getValue();
|
||||
$delivery_day = intval($delivery_day);
|
||||
$delivery_day = $delivery_day < 0 ? 0 : $delivery_day;
|
||||
//$price_color = $objWorksheet->getCell('K' . $_row)->getValue();
|
||||
$proxy_name = $objWorksheet->getCell('K' . $_row)->getValue();
|
||||
$proxy_type = $proxy_name == '票折' ? 1 : 0;
|
||||
$proxy_profix_price = $objWorksheet->getCell('L' . $_row)->getValue();
|
||||
$proxy_profix_lower = $objWorksheet->getCell('M' . $_row)->getValue();
|
||||
$proxy_profix_rebate = $objWorksheet->getCell('N' . $_row)->getValue();
|
||||
//$proxy_profix_car = $objWorksheet->getCell('M' . $_row)->getValue();
|
||||
//$profix_car = $objWorksheet->getCell('N' . $_row)->getValue();
|
||||
//$profix_cardno = $objWorksheet->getCell('O' . $_row)->getValue();
|
||||
//$profix_insure = $objWorksheet->getCell('P' . $_row)->getValue();
|
||||
//$profix_loan = $objWorksheet->getCell('Q' . $_row)->getValue();
|
||||
|
||||
$info = [
|
||||
'brand_id' => $brand_id,
|
||||
's_id' => $s_id,
|
||||
'v_id' => $v_id,
|
||||
'city_id' => $city_id,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'status' => 1,
|
||||
'c_time' => $c_time,
|
||||
];
|
||||
|
||||
$info['price_car'] = $price_car;
|
||||
$info['price_floor'] = $price_floor;
|
||||
//$info['price_color'] = $price_color;
|
||||
$info['proxy_type'] = $proxy_type;
|
||||
$info['proxy_profix_price'] = $proxy_profix_price;
|
||||
$info['proxy_profix_lower'] = $proxy_profix_lower;
|
||||
$info['proxy_profix_rebate'] = $proxy_profix_rebate;
|
||||
//$info['proxy_profix_car'] = $proxy_profix_car;
|
||||
//$info['profix_car'] = $profix_car;
|
||||
//$info['profix_carno'] = $profix_cardno;
|
||||
//$info['profix_insure'] = $profix_insure;
|
||||
//$info['profix_loan'] = $profix_loan;
|
||||
$info['s_effect_time'] = $s_effect_time;
|
||||
$info['if_effect'] = $if_effect;
|
||||
$info['delivery_day'] = $delivery_day;
|
||||
$data[] = $info;
|
||||
}
|
||||
$msg_debug .= "count_ignore:{$count_ignore}";
|
||||
$done = 0;
|
||||
$data && $done = $this->auto_business_model->add_batch($data);
|
||||
@unlink($file);
|
||||
$this->data['load_num'] = count($data);
|
||||
$this->data['done'] = $done;
|
||||
#$this->data['msg_debug'] = $msg_debug;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, "共{$count}条,成功导入{$done}条");
|
||||
}
|
||||
|
||||
private function upload()
|
||||
{
|
||||
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
|
||||
$config['allowed_types'] = 'xls|xlsx';
|
||||
$config['max_size'] = 5120;
|
||||
$config['file_name'] = 'receiver_clues' . time() . rand(1, 99999);
|
||||
$this->load->library('upload', $config);
|
||||
if (!$this->upload->do_upload('file')) {
|
||||
return array('code' => SYS_CODE_FAIL, 'message' => $this->upload->display_errors('', ''));
|
||||
} else {
|
||||
$data = $this->upload->data();
|
||||
return array('code' => SYS_CODE_SUCCESS, 'path' => $data['full_path'], 'file_ext' => $data['file_ext']);
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$info = $this->input->post('info');
|
||||
@@ -298,15 +522,19 @@ class Business extends HD_Controller{
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
];
|
||||
$info['price_car'] && $data['price_car'] = $info['price_car'];
|
||||
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
|
||||
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
|
||||
$info['price_color'] && $data['price_color'] = $info['price_color'];
|
||||
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
|
||||
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
|
||||
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
|
||||
$info['profix_insure'] && $data['profix_insure'] = $info['profix_insure'];
|
||||
$info['profix_loan'] && $data['profix_loan'] = $info['profix_loan'];
|
||||
$data['price_car'] = $info['price_car'];
|
||||
$data['price_floor'] = $info['price_floor'];
|
||||
$data['price_coplus'] = $info['price_coplus'];
|
||||
$data['price_color'] = $info['price_color'];
|
||||
$data['proxy_type'] = $info['proxy_type'];
|
||||
$data['proxy_profix_price'] = $info['proxy_profix_price'];
|
||||
$data['proxy_profix_lower'] = $info['proxy_profix_lower'];
|
||||
$data['proxy_profix_rebate'] = $info['proxy_profix_rebate'];
|
||||
$data['proxy_profix_car'] = $info['proxy_profix_car'];
|
||||
$data['profix_car'] = $info['profix_car'];
|
||||
$data['profix_carno'] = $info['profix_carno'];
|
||||
$data['profix_insure'] = $info['profix_insure'];
|
||||
$data['profix_loan'] = $info['profix_loan'];
|
||||
$info['colors'] && $data['colors'] = json_encode($info['colors'],JSON_UNESCAPED_UNICODE);
|
||||
$info['s_effect_time'] && $data['s_effect_time'] = strtotime($info['s_effect_time']);
|
||||
$info['delivery_day'] && $data['delivery_day'] = $info['delivery_day'];
|
||||
@@ -329,8 +557,47 @@ class Business extends HD_Controller{
|
||||
|
||||
public function export()
|
||||
{
|
||||
// TODO: Implement export() method.
|
||||
$params = $this->input->get();
|
||||
$where = $this->get_where($params);
|
||||
$page = 1;
|
||||
$size = 10000;
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status = 1' => null);
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
$data = $this->get_data($where, $page, $size, $map_brand, true);
|
||||
|
||||
$fileName = '商务政策';
|
||||
$indexs = [
|
||||
'brand_name' => '品牌',
|
||||
'sery_name' => '车系',
|
||||
'attr_name' => '车型',
|
||||
'city_cn' => '城市',
|
||||
's_effect_time' => '生效日期',
|
||||
'year' => '时间-年',
|
||||
'month' => '时间-月',
|
||||
'price_car' => '裸车报价',
|
||||
'price_floor' => '展厅最低限价',
|
||||
'delivery_day' => '交车工作日',
|
||||
//'price_color' => '颜色加价',
|
||||
'proxy_type' => '代理店返用方式',
|
||||
'proxy_profix_price' => '代理店结算价',
|
||||
'proxy_profix_lower' => '代理店最低限价',
|
||||
'proxy_profix_rebate' => '代理店佣金',
|
||||
//'proxy_profix_car' => '代理店单车毛利',
|
||||
//'profix_car' => '品牌店单车毛利',
|
||||
//'profix_carno' => '上牌毛利',
|
||||
//'profix_insure' => '保险毛利',
|
||||
//'profix_loan' => '按揭毛利', # 以上次序与导入一致,方便导出后编辑再导入
|
||||
'status_name' => '状态',
|
||||
'effect_status' => '是否生效',
|
||||
'id' => 'ID',
|
||||
];
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
|
||||
function edit_status(){
|
||||
$id = $this->input->post('id');
|
||||
$field = $this->input->post('field');
|
||||
|
||||
@@ -29,6 +29,9 @@ class Cars extends HD_Controller{
|
||||
$params = $this->input->get();
|
||||
|
||||
$where = array();
|
||||
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
$where['s_id in (select id from lc_auto_series where status > -1)'] = null;
|
||||
$where['v_id in (select id from lc_auto_attr where status > -1 and type = 1)'] = null;
|
||||
if($params['brand_id']){
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
} else{
|
||||
@@ -58,7 +61,7 @@ class Cars extends HD_Controller{
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
//状态
|
||||
$statusAry = array('0' => '关闭', '1' => '开启');
|
||||
|
||||
@@ -109,7 +112,7 @@ class Cars extends HD_Controller{
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['statusAry'] = $statusAry;
|
||||
$this->data['brandAry'] = $map_brand;
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
|
||||
$this->data['_title'] = '车型库管理';
|
||||
$this->show_view('auto/cars/lists',true);
|
||||
@@ -120,7 +123,8 @@ class Cars extends HD_Controller{
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
|
||||
#$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
|
||||
$map_brand = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand($where_brand));
|
||||
//状态
|
||||
$statusAry = array('0' => '关闭', '1' => '开启');
|
||||
if($id){
|
||||
@@ -344,6 +348,7 @@ class Cars extends HD_Controller{
|
||||
// 'price_car' => $row['price_car']
|
||||
// );
|
||||
|
||||
$row['price_floor'] && $row['price_floor'] = 0;
|
||||
$this->data = $row;
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
|
||||
@@ -16,7 +16,8 @@ class Finance extends HD_Controller{
|
||||
$this->load->model('auto/auto_cars_model');
|
||||
$this->load->model('auto/auto_finance_model');
|
||||
|
||||
$this->load->model('sys/sys_finance_model');
|
||||
//$this->load->model('sys/sys_finance_model');
|
||||
$this->load->model('sys/sys_supplier_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
@@ -42,7 +43,11 @@ class Finance extends HD_Controller{
|
||||
$params['brand_id'] && $where["$t2.brand_id"] = $params['brand_id'];
|
||||
$params['s_id'] && $where["$t2.s_id"] = $params['s_id'];
|
||||
$params['v_id'] && $where["$t2.v_id"] = $params['v_id'];
|
||||
$params['cor_id'] && $where["$t2.cor_id"] = $params['cor_id'];
|
||||
#$params['cor_id'] && $where["$t2.cor_id"] = $params['cor_id'];
|
||||
#$where[$t2.'.color_id in (select id from lc_auto_attr where status = 1 and type = 0)'] = null;
|
||||
$where[$t2.'.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where[$t2.'.s_id in (select id from lc_auto_series where status = 1)'] = null;
|
||||
$where[$t2.'.v_id in (select id from lc_auto_attr where status = 1 and type = 1)'] = null;
|
||||
|
||||
$total = $this->auto_finance_model->count_finance($where);
|
||||
$lists = array();
|
||||
@@ -50,7 +55,8 @@ class Finance extends HD_Controller{
|
||||
$select = "$t1.id,$t1.car_id,$t1.fin_id,$t1.num,$t1.month_pay,$t1.first_pay,$t1.srv_pay,$t1.status";
|
||||
$rows = $this->auto_finance_model->select_finance($where, 'id desc', $page, $size, $select);
|
||||
$fin_id_arr = array_column($rows,'fin_id');
|
||||
$fin_rows = $this->sys_finance_model->get_map_by_ids($fin_id_arr,'id,title');
|
||||
//$fin_rows = $this->sys_finance_model->get_map_by_ids($fin_id_arr,'id,title');
|
||||
$fin_rows = $this->sys_supplier_model->get_map_by_ids($fin_id_arr,'id,title');
|
||||
foreach($rows as $key=>$val){
|
||||
$lists[] = [
|
||||
'id' => $val['id'],
|
||||
@@ -94,7 +100,8 @@ class Finance extends HD_Controller{
|
||||
$info['status'] = $row['status'];
|
||||
}
|
||||
$nums = $this->auto_finance_model->get_nums();
|
||||
$finance = $this->sys_finance_model->select(['status'=>1],'id desc',1,20,'id,title');
|
||||
//$finance = $this->sys_finance_model->select(['status'=>1],'id desc',1,20,'id,title');
|
||||
$finance = $this->sys_supplier_model->select(['status'=>1, 'type'=>3],'id desc',0,0,'id,title');
|
||||
!$info['fin_id'] && $info['fin_id'] = $finance[0]['id'];
|
||||
!$info['num'] && $info['num'] = $nums[0];
|
||||
!isset($info['status']) && $info['status'] = 1;
|
||||
@@ -120,8 +127,9 @@ class Finance extends HD_Controller{
|
||||
}
|
||||
$row = $this->auto_finance_model->get(['car_id'=>$info['car_id'],'num'=>$info['num'],'fin_id'=>$info['fin_id']]);
|
||||
if($row){
|
||||
$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
|
||||
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}金融-{$info['num']}期");
|
||||
//$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
|
||||
$finance = $this->sys_supplier_model->get(['id'=>$info['fin_id']]);
|
||||
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}-{$info['num']}期");
|
||||
}
|
||||
$adata = [
|
||||
'car_id' => $info['car_id'],
|
||||
@@ -154,8 +162,9 @@ class Finance extends HD_Controller{
|
||||
}
|
||||
$row = $this->auto_finance_model->get(['car_id'=>$info['car_id'],'num'=>$info['num'],'fin_id'=>$info['fin_id'],'id !='=>$info['id']]);
|
||||
if($row){
|
||||
$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
|
||||
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}金融-{$info['num']}期");
|
||||
//$finance = $this->sys_finance_model->get(['id'=>$info['fin_id']]);
|
||||
$finance = $this->sys_supplier_model->get(['id'=>$info['fin_id']]);
|
||||
return $this->show_json(SYS_CODE_FAIL, "该车已配置:{$finance['title']}-{$info['num']}期");
|
||||
}
|
||||
$adata = [
|
||||
'car_id' => $info['car_id'],
|
||||
|
||||
@@ -35,6 +35,8 @@ class Introduce extends HD_Controller
|
||||
if (strlen($params['status'])) {
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
$where['s_id in (select id from lc_auto_series where status > -1)'] = null;
|
||||
$count = $this->mdAutoIntroduce->count($where);
|
||||
if ($count) {
|
||||
$res = $this->mdAutoIntroduce->select($where, "id desc", $params['page'], $params['size']);
|
||||
@@ -151,7 +153,8 @@ class Introduce extends HD_Controller
|
||||
);
|
||||
$showInfo = ['title' => '请选择车型', 'url' => '/auto/introduce/add'];
|
||||
}
|
||||
$showInfo['brandList'] = $this->mdAutoBrand->select(["status<>-1" => null], 'id desc', 0, 0, 'id, name');
|
||||
#$showInfo['brandList'] = $this->mdAutoBrand->select(["status<>-1" => null], 'id desc', 0, 0, 'id, name');
|
||||
$showInfo['brandList'] = $this->mdAutoBrand->map_brand_list($this->mdAutoBrand->map_brand(array('status > -1' => null), false));
|
||||
$this->data['_title'] = $_title;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['showInfo'] = $showInfo;
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Vim
|
||||
* User: lcc
|
||||
* Date: 2023/03/14
|
||||
* Time: 10:19
|
||||
*/
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Options extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('auto/auto_option_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
!$params['s_id'] && $params['s_id'] = '';
|
||||
!$params['brand_id'] && $params['brand_id'] = '';
|
||||
$page = $this->input->get('page');
|
||||
!$page && $page = 1;
|
||||
$size = 20;
|
||||
$where["status > -1"] = null;
|
||||
$params['title'] && $where["title like '%{$params['title']}%'"] = null;
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
|
||||
$params['brand_id'] && $where['brand_id'] = intval($params['brand_id']);
|
||||
$params['s_id'] && $where['s_id'] = intval($params['s_id']);
|
||||
$count = $this->auto_option_model->count($where);
|
||||
|
||||
$list = [];
|
||||
if($count){
|
||||
$status_arr = $this->auto_option_model->get_status();
|
||||
$rows = $this->auto_option_model->select($where,'id desc',$page,$size);
|
||||
$b_rows = $this->auto_brand_model->get_map_by_ids(array_column($rows,'brand_id'));
|
||||
$s_rows = $this->auto_series_model->get_map_by_ids(array_column($rows,'s_id'));
|
||||
foreach ($rows as $item) {
|
||||
$b_row = $b_rows[$item['brand_id']][0];
|
||||
$s_row = $s_rows[$item['s_id']][0];
|
||||
$list[] = [
|
||||
'id' => $item['id'],
|
||||
'brand_cn' => $b_row['name'],
|
||||
'series_cn' => $s_row['name'],
|
||||
'title' => $item['title'],
|
||||
'price' => $item['price'],
|
||||
'status_name' => $status_arr[$item['status']],
|
||||
'status' => $item['status'],
|
||||
'c_time' => date('Y-m-d H:i:s',$item['c_time'])
|
||||
];
|
||||
}
|
||||
}
|
||||
$this->data['lists'] = $list;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['_title'] = '选装管理';
|
||||
$this->show_view('auto/options/lists', true);
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
|
||||
$info = [
|
||||
'title' => '',
|
||||
'options' => [],
|
||||
'brand_id' => 0,
|
||||
's_id' => 0
|
||||
];
|
||||
if ($id) {
|
||||
$info = $this->auto_option_model->get(array('id' => $id));
|
||||
if (!$info) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
$info['brand_id'] = " {$info['brand_id']}";
|
||||
}
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = $id ? '编辑' : '新增';
|
||||
return $this->show_view('auto/options/edit',true);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if (!$this->if_ajax) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
|
||||
}
|
||||
$post = $this->input->post();
|
||||
if (!$post['title']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '标题不能为空');
|
||||
}
|
||||
$add_data = [
|
||||
'title' => $post['title'],
|
||||
'price' => floatval($post['price']),
|
||||
'brand_id' => intval($post['brand_id']),
|
||||
's_id' => intval($post['s_id']),
|
||||
'descrip' => $post['descrip'],
|
||||
'c_time' => time()
|
||||
];
|
||||
$result = $this->auto_option_model->add($add_data);
|
||||
if (!$result) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '添加失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if (!$this->if_ajax) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
|
||||
}
|
||||
$post = $this->input->post();
|
||||
$row = $this->auto_option_model->get(['id' => $post['id']]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在');
|
||||
}
|
||||
if (!$post['title']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '标题不能为空');
|
||||
}
|
||||
$update = [
|
||||
'title' => $post['title'],
|
||||
'price' => floatval($post['price']),
|
||||
'descrip' => $post['descrip'],
|
||||
'brand_id' => intval($post['brand_id']),
|
||||
's_id' => intval($post['s_id']),
|
||||
];
|
||||
$result = $this->auto_option_model->update($update, ['id' => $row['id']]);
|
||||
if (!$result) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
if (!$id) {
|
||||
$this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
$stauts = $this->input->post('status');
|
||||
$where = ['id' => $id];
|
||||
$this->auto_option_model->update(['status' => $stauts], $where);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function json_lists()
|
||||
{
|
||||
$brand_id = $this->input->get('brand_id');
|
||||
$s_id = $this->input->get('s_id');
|
||||
$where = [
|
||||
'status'=>1,
|
||||
'brand_id' => intval($brand_id)
|
||||
];
|
||||
$s_id && $where['s_id'] = $s_id;
|
||||
$lists = [];
|
||||
$rows = $this->auto_option_model->select($where,'','','','id,title,price');
|
||||
if($rows){
|
||||
foreach ($rows as $items) {
|
||||
$lists[] = $items;
|
||||
}
|
||||
}
|
||||
$this->data['lists'] = $lists;
|
||||
$this->show_json(SYS_CODE_SUCCESS,'');
|
||||
}
|
||||
}
|
||||
@@ -26,11 +26,22 @@ class Series extends HD_Controller{
|
||||
$size = 20;
|
||||
$where["status > -1"] = null;
|
||||
$params['title'] && $where["name like '%{$params['title']}%'"] = null;
|
||||
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
if($params['brand_id']){
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
} else {
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if (!strlen($params['status'])){
|
||||
$params['status'] = $where['status'] = 1;
|
||||
}
|
||||
elseif ($params['status'] == -9){
|
||||
# pass
|
||||
}
|
||||
else{
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
|
||||
$count = $this->auto_series_model->count($where);
|
||||
$rows = $this->auto_series_model->select($where, 'id desc', $page, $size);
|
||||
$status_arr = $this->auto_series_model->get_status();
|
||||
@@ -38,7 +49,7 @@ class Series extends HD_Controller{
|
||||
|
||||
//获取品牌map
|
||||
$where_brand = array('status > -1' => null);
|
||||
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
|
||||
$map_brand = $this->auto_brand_model->map_brand($where_brand);
|
||||
|
||||
if($rows){
|
||||
foreach($rows as $key=>$val){
|
||||
@@ -53,9 +64,12 @@ class Series extends HD_Controller{
|
||||
];
|
||||
}
|
||||
}
|
||||
$status_arr_list = $status_arr;
|
||||
unset($status_arr_list[-1]);
|
||||
$this->data['status_arr'] = $status_arr_list;
|
||||
$this->data['lists'] = $list;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['brandAry'] = $map_brand;
|
||||
$this->data['brandAry'] = $this->auto_brand_model->map_brand_list($map_brand);
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['_title'] = '车系列表';
|
||||
$this->show_view('auto/series/lists', true);
|
||||
@@ -67,11 +81,22 @@ class Series extends HD_Controller{
|
||||
*/
|
||||
public function json_lists(){
|
||||
$brand_id = $this->input->get_post('brand_id');
|
||||
$status = $this->input->get_post('status');
|
||||
$page = $this->input->get_post('page');
|
||||
$size = $this->input->get_post('size');
|
||||
|
||||
$where = array('status > -1' => null);
|
||||
$brand_id && $where['brand_id'] = $brand_id;
|
||||
if(strlen($status) > 0){
|
||||
if (strpos($status,'>') !== false || strpos($status,'<') !== false || strpos($status,'in') !== false){
|
||||
$where["status {$status}"] = null;
|
||||
}
|
||||
else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
} else {
|
||||
$where['status > -1'] = null;
|
||||
}
|
||||
$orderby = 'id desc';
|
||||
|
||||
$total = $this->auto_series_model->count($where);
|
||||
@@ -103,7 +128,8 @@ class Series extends HD_Controller{
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
}
|
||||
$brands = $this->auto_brand_model->select([],'','','','id,name');
|
||||
#$brands = $this->auto_brand_model->select([],'','','','id,name');
|
||||
$brands = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand(array('status > -1' => null), false));
|
||||
$this->data['brands'] = $brands;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = $id ? '编辑车系' : '新增车系';
|
||||
|
||||
@@ -17,6 +17,7 @@ class Fine extends HD_Controller{
|
||||
public function lists(){
|
||||
$params = $this->input->get();
|
||||
$params['id'] && $_SESSION['srv_biz_id'] = $params['id'];
|
||||
$re_biz = $this->biz_model->get(['id' => $_SESSION['srv_biz_id']]);
|
||||
!strlen($params['status']) && $params['status'] = '';
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$pagesize = 20;
|
||||
@@ -53,7 +54,7 @@ class Fine extends HD_Controller{
|
||||
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = '门店精品成本列表';
|
||||
$this->data['_title'] = $re_biz['biz_name'].'-精品配置';
|
||||
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
|
||||
$this->show_view('biz/fine/lists', true);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class Settle extends HD_Controller
|
||||
$this->data['yearAry'] = $this->auto_business_model->year();
|
||||
$this->data['monthAry'] = $this->auto_business_model->month();
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
|
||||
$this->data['_title'] = '商家结算管理';
|
||||
$this->data['_title'] = '门店结算管理';
|
||||
$view = $params['_biz_type']==1 ? 'biz/settle/lists_brand' : 'biz/settle/lists';
|
||||
$this->show_view($view,true);
|
||||
}
|
||||
@@ -357,8 +357,10 @@ class Settle extends HD_Controller
|
||||
}elseif(!isset($params['month'])){
|
||||
$where['month'] = $params['month'] = intval(date('m',strtotime("-1 month")));
|
||||
}
|
||||
$re_biz = array();
|
||||
if($params['id']){
|
||||
$where['biz_id'] = $params['id'];
|
||||
$re_biz = $this->biz_model->get(array('id' => $params['id']));
|
||||
}
|
||||
$page = $params['page'];
|
||||
$page = !$page ? 1 : $page;
|
||||
@@ -400,7 +402,7 @@ class Settle extends HD_Controller
|
||||
$this->data['monthAry'] = $this->auto_business_model->month();
|
||||
$this->data['type_arr'] = $this->biz_settle_static_model->other_price_type();
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
|
||||
$this->data['_title'] = '商家结算管理';
|
||||
$this->data['_title'] = $re_biz ? $re_biz['biz_name'].'-结算统计' : '门店结算统计';
|
||||
$view = $params['_biz_type']==1 ? 'biz/settle/lists_static_brand' : 'biz/settle/lists_static';
|
||||
$this->show_view($view,true);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Notes:店铺概况
|
||||
* Notes:门店概况
|
||||
* Created on: 2022/1/7 14:52
|
||||
* Created by: dengbw
|
||||
*/
|
||||
@@ -40,14 +40,15 @@ class Situation extends HD_Controller
|
||||
public function get()
|
||||
{
|
||||
$biz_id = $this->input->get('id');
|
||||
$re_biz = $this->mdBiz->get(['id' => $biz_id, 'status' => 1]);
|
||||
$re_biz = $this->mdBiz->get(['id' => $biz_id]);
|
||||
if (!$re_biz || empty($re_biz)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不存在!');
|
||||
}
|
||||
$base_info = [];
|
||||
//店铺概况
|
||||
//门店概况
|
||||
$re_base = $this->mdBizBase->get(['biz_id' => $biz_id]);
|
||||
$fields = $this->mdBizBase->get_fields();
|
||||
unset($fields['company']); # 230220close
|
||||
foreach ($fields as $key => $value) {
|
||||
$list = '';
|
||||
if ($key == 'county_id' && $re_biz['county_id']) {//县区
|
||||
@@ -98,7 +99,7 @@ class Situation extends HD_Controller
|
||||
}
|
||||
$showInfo['y_month_ary'] = $y_month_ary;
|
||||
$this->data['showInfo'] = $showInfo;
|
||||
$this->data['_title'] = $re_biz['biz_name'];
|
||||
$this->data['_title'] = $re_biz['biz_name']."-概况";
|
||||
return $this->show_view('biz/situation/get', true);
|
||||
}
|
||||
|
||||
|
||||
+124
-37
@@ -6,10 +6,11 @@ class Srv extends HD_Controller{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('auto/auto_business_model');
|
||||
|
||||
$this->load->model('auto/auto_finance_model');
|
||||
$this->load->model('biz/biz_model');
|
||||
$this->load->model('biz/biz_settle_srv_model');
|
||||
$this->load->model('sys/sys_finance_model');
|
||||
//$this->load->model('sys/sys_finance_model');
|
||||
$this->load->model('sys/sys_supplier_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -20,6 +21,8 @@ class Srv extends HD_Controller{
|
||||
public function lists(){
|
||||
$params = $this->input->get();
|
||||
$params['id'] && $_SESSION['srv_biz_id'] = $params['id'];
|
||||
$re_biz = $this->biz_model->get(['id' => $_SESSION['srv_biz_id']]);
|
||||
!$params['insure_type'] && $params['insure_type'] = '';
|
||||
!$params['type'] && $params['type'] = '';
|
||||
!$params['title'] && $params['title'] = '';
|
||||
!strlen($params['status']) && $params['status'] = '';
|
||||
@@ -30,12 +33,13 @@ class Srv extends HD_Controller{
|
||||
'biz_id' => $_SESSION['srv_biz_id']
|
||||
];
|
||||
strlen($params['status']) && $where['status'] = $params['status'];
|
||||
$params['insure_type'] && $where["json_extract(jsondata, '$.type') = '{$params['insure_type']}'"] = null;
|
||||
$params['type'] && $where['type'] = $params['type'];
|
||||
$params['title'] && $where['title'] = $params['title'];
|
||||
$count = $this->biz_settle_srv_model->count($where);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$rows = $this->biz_settle_srv_model->select($where, 'is_def desc,id desc', $page, $pagesize);
|
||||
$rows = $this->biz_settle_srv_model->select($where, 'status desc, title, is_def desc, id desc', $page, $pagesize);
|
||||
$biz_ids = array_unique(array_column($rows,'biz_id'));
|
||||
$map_biz = [];
|
||||
if(is_array($biz_ids)){
|
||||
@@ -45,13 +49,16 @@ class Srv extends HD_Controller{
|
||||
}
|
||||
foreach ($rows as $val) {
|
||||
$other_data = $this->biz_settle_srv_model->get_jsondata($val['type'],$val['jsondata']);
|
||||
$s_effect_time = $val['s_effect_time'] == '0000-00-00' ? '长期' : $val['s_effect_time'];
|
||||
$s_effect_time = $other_data['时间区间'] ? $other_data['时间区间'] : $s_effect_time;
|
||||
unset($other_data['时间区间']);
|
||||
$lists[] = [
|
||||
'id' => $val['id'],
|
||||
'biz_id' => $val['biz_id'],
|
||||
'biz_name' => $map_biz[$val['biz_id']],
|
||||
'title' => $val['title'],
|
||||
'other_data' => $other_data,
|
||||
's_effect_time' =>$val['s_effect_time'],
|
||||
's_effect_time' => $s_effect_time,
|
||||
'is_def' => $val['is_def'] ? '是':'否',
|
||||
'type_cn' => $this->biz_settle_srv_model->get_type($val['type']),
|
||||
'status_cn' => $this->biz_settle_srv_model->get_status($val['status']),
|
||||
@@ -63,7 +70,8 @@ class Srv extends HD_Controller{
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['typeAry'] = $this->biz_settle_srv_model->get_type();
|
||||
$this->data['_title'] = '门店列表';
|
||||
$this->data['insure_typeAry'] = $this->biz_settle_srv_model->get_insure_type();
|
||||
$this->data['_title'] = $re_biz['biz_name'].'-水平业务配置';
|
||||
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
|
||||
$this->show_view('biz/srv/lists', true);
|
||||
}
|
||||
@@ -74,18 +82,24 @@ class Srv extends HD_Controller{
|
||||
$type = $this->input->get('type');
|
||||
!$type && $type = 1;
|
||||
if(!$biz_id){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误');
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请刷新列表再重新操作');
|
||||
}
|
||||
$row = $this->biz_settle_srv_model->get(['id'=>$id]);
|
||||
$finances = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
|
||||
$row && $type = $row['type'];
|
||||
$supplier = $this->sys_supplier_model->select(['status' => 1, 'type' => $type], '', 0, 0, 'id,title');
|
||||
//$finances_num = $this->sys_finance_model->get_nums();
|
||||
$finances_num = $this->auto_finance_model->get_nums();
|
||||
$info = [
|
||||
'biz_id' => $biz_id,
|
||||
'type' => $type,
|
||||
'is_def' => 0,
|
||||
's_effect_time' => date('Y-m-d'),
|
||||
's_effect_time' => date('Y-m-d') ,
|
||||
'action' => 'biz/srv/add',
|
||||
'jsondata' => ['price'=>300,'type'=>1,'finance_id'=>$finances[0]['id'],'finance_num'=>12]
|
||||
'is_tiexi' => 0,
|
||||
'step' => 1, # 1仅用于新增时默认第一步,2为第二步
|
||||
'jsondata' => ['price'=>300,'type'=>1, 'supplier_id'=>$supplier[0] ? $supplier[0]['id'] : 0,'finance_num'=>$finances_num ? $finances_num[0]: null]
|
||||
];
|
||||
$view = 'biz/srv/get';
|
||||
if($row){
|
||||
$info['title'] = $row['title'];
|
||||
$info['id'] = $row['id'];
|
||||
@@ -96,55 +110,79 @@ class Srv extends HD_Controller{
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$jsondata['s_time'] && $jsondata['s_time'] = date('Y-m-d H:i:s',$jsondata['s_time']);
|
||||
$jsondata['e_time'] && $jsondata['e_time'] = date('Y-m-d H:i:s',$jsondata['e_time']);
|
||||
$info['is_tiexi'] = $row['type'] == 3 && floatval($jsondata['rebate']) > 0 ? 0 : 1;
|
||||
$jsondata['supplier_id'] = $jsondata['supplier_id'] ? intval($jsondata['supplier_id']) : 0;
|
||||
$info['jsondata'] = $jsondata;
|
||||
$view = 'biz/srv/edit';
|
||||
}
|
||||
$this->data['yearAry'] = $this->auto_business_model->year();
|
||||
$this->data['monthAry'] = $this->auto_business_model->month();
|
||||
$this->data['finances'] = $finances;
|
||||
$this->data['finances_num'] = $this->sys_finance_model->get_nums();
|
||||
$this->data['finances_num'] = $finances_num;
|
||||
$this->data['supplier'] = $supplier;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['typeAry'] = $this->biz_settle_srv_model->get_type();
|
||||
$this->show_view('biz/srv/get');
|
||||
$this->data['insure_typeAry'] = $this->biz_settle_srv_model->get_insure_type();
|
||||
$this->show_view($view);
|
||||
}
|
||||
|
||||
public function add(){
|
||||
$info = $this->input->post('info');
|
||||
if (!$info['jsondata']['supplier_id']){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请先配置供应商');
|
||||
}
|
||||
if ($info['type'] == 2 && !$info['is_def'] && (!$info['s_time'] || !$info['e_time'])){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请填写时间区间');
|
||||
}
|
||||
$data = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'c_time' => time(),
|
||||
'type' => $info['type'],
|
||||
'is_def' => $info['is_def'] ? 1 : 0,
|
||||
];
|
||||
$info['title'] && $data['title'] = $info['title'];
|
||||
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
|
||||
$info['type'] == 3 && $info['is_def'] && $data['s_effect_time'] = '';
|
||||
$jsondata = [];
|
||||
$jsondata['supplier_id'] = $info['jsondata']['supplier_id'];
|
||||
$supplier = $this->sys_supplier_model->get(['id'=>intval($jsondata['supplier_id'])],'title');
|
||||
$jsondata['supplier_title'] = $supplier['title'];
|
||||
$data['title'] = $jsondata['supplier_title'];
|
||||
|
||||
if($info['type']==1){
|
||||
$jsondata['price'] = floatval($info['jsondata']['price']);
|
||||
}elseif($info['type']==2){
|
||||
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
|
||||
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
|
||||
$jsondata['rebate'] = $info['jsondata']['rebate'];
|
||||
if ($info['is_def'] == 1){
|
||||
unset($jsondata['s_time']);
|
||||
unset($jsondata['e_time']);
|
||||
}
|
||||
else{
|
||||
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
|
||||
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
|
||||
}
|
||||
$jsondata['rebate'] = floatval($info['jsondata']['rebate']);
|
||||
$jsondata['type'] = $info['jsondata']['type'];
|
||||
}else{
|
||||
$jsondata['rebate'] = $info['jsondata']['rebate'];
|
||||
$jsondata['finance_id'] = $info['jsondata']['finance_id'];
|
||||
$jsondata['rebate'] = $info['is_tiexi'] ? 0 : floatval($info['jsondata']['rebate']);
|
||||
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
|
||||
$finance = $this->sys_finance_model->get(['id'=>intval($jsondata['finance_id'])],'title');
|
||||
$jsondata['finance_title'] = $finance['title'];
|
||||
$data['title'] = $jsondata['finance_title'];
|
||||
}
|
||||
//只能有一条默认
|
||||
if($info['is_def']){
|
||||
$where = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'title' => $info['title'],
|
||||
'title' => $data['title'],
|
||||
'type' => $info['type'],
|
||||
'status' => 1,
|
||||
'is_def' => 1
|
||||
];
|
||||
$update = ['is_def'=>0];
|
||||
if($info['type']==2){
|
||||
$where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null;
|
||||
$update['status'] = 0;
|
||||
}
|
||||
$this->biz_settle_srv_model->update(['is_def'=>0],$where);
|
||||
if($info['type']==3){
|
||||
$where["json_extract(jsondata, '$.finance_num') = '{$info['jsondata']['finance_num']}'"] = null;
|
||||
}
|
||||
|
||||
$this->biz_settle_srv_model->update($update,$where);
|
||||
}
|
||||
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
$res = $this->biz_settle_srv_model->add($data);
|
||||
@@ -159,42 +197,63 @@ class Srv extends HD_Controller{
|
||||
$info = $this->input->post('info');
|
||||
$row = $this->biz_settle_srv_model->get(['id'=>$info['id']]);
|
||||
if(!$row){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误');
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请刷新列表再重新操作');
|
||||
}
|
||||
if (!$info['jsondata']['supplier_id']){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请先配置供应商');
|
||||
}
|
||||
if ($info['type'] == 2 && !$info['is_def'] && (!$info['s_time'] || !$info['e_time'])){
|
||||
return $this->show_json(SYS_CODE_FAIL,'参数错误,请填写时间区间');
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$data = [
|
||||
'type' => $info['type'],
|
||||
'is_def' => $info['is_def'] ? 1 : 0,
|
||||
];
|
||||
$info['title'] && $data['title'] = $info['title'];
|
||||
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
|
||||
$info['type'] == 3 && $info['is_def'] && $data['s_effect_time'] = '';
|
||||
$jsondata['supplier_id'] = $info['jsondata']['supplier_id'];
|
||||
$supplier = $this->sys_supplier_model->get(['id'=>intval($jsondata['supplier_id'])],'title');
|
||||
$jsondata['supplier_title'] = $supplier['title'];
|
||||
$data['title'] = $jsondata['supplier_title'];
|
||||
|
||||
if($info['type']==1){
|
||||
$jsondata['price'] = floatval($info['jsondata']['price']);
|
||||
|
||||
}elseif($info['type']==2){
|
||||
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
|
||||
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
|
||||
$jsondata['rebate'] = $info['jsondata']['rebate'];
|
||||
if ($info['is_def'] == 1){
|
||||
unset($jsondata['s_time']);
|
||||
unset($jsondata['e_time']);
|
||||
}
|
||||
else{
|
||||
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
|
||||
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
|
||||
}
|
||||
$jsondata['rebate'] = floatval($info['jsondata']['rebate']);
|
||||
$jsondata['type'] = $info['jsondata']['type'];
|
||||
}else{
|
||||
$jsondata['rebate'] = $info['jsondata']['rebate'];
|
||||
$jsondata['finance_id'] = $info['jsondata']['finance_id'];
|
||||
$jsondata['rebate'] = $info['is_tiexi'] ? 0 : floatval($info['jsondata']['rebate']);
|
||||
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
|
||||
$finance = $this->sys_finance_model->get(['id'=>intval($jsondata['finance_id'])],'title');
|
||||
$jsondata['finance_title'] = $finance['title'];
|
||||
$data['title'] = $jsondata['finance_title'];
|
||||
}
|
||||
//只能有一条默认
|
||||
if($info['is_def']){
|
||||
if($info['is_def'] && $row['status'] == 1){
|
||||
$where = [
|
||||
'biz_id' => $info['biz_id'],
|
||||
'title' => $info['title'],
|
||||
'title' => $data['title'],
|
||||
'type' => $info['type'],
|
||||
'status' => 1,
|
||||
'is_def' => 1,
|
||||
"id != {$info['id']}" => null,
|
||||
];
|
||||
$update = ['is_def'=>0];
|
||||
if($info['type']==2){
|
||||
$where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null;
|
||||
$update['status'] = 0;
|
||||
}
|
||||
$this->biz_settle_srv_model->update(['is_def'=>0],$where);
|
||||
if($info['type']==3){
|
||||
$where["json_extract(jsondata, '$.finance_num') = '{$info['jsondata']['finance_num']}'"] = null;
|
||||
}
|
||||
$this->biz_settle_srv_model->update($update,$where);
|
||||
}
|
||||
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
$res = $this->biz_settle_srv_model->update($data,['id'=>$info['id']]);
|
||||
@@ -228,6 +287,34 @@ class Srv extends HD_Controller{
|
||||
$this->show_json(0, '参数错误');
|
||||
}
|
||||
$where['id'] = $id;
|
||||
|
||||
# 参考edit处理:修改状态为正常 + 当前数据为默认
|
||||
if ($status == 1){
|
||||
$row = $this->biz_settle_srv_model->get(['id'=>$id]);
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
if($row['is_def']){
|
||||
$where_u = [
|
||||
'biz_id' => $row['biz_id'],
|
||||
'title' => $row['title'],
|
||||
'type' => $row['type'],
|
||||
'status' => 1,
|
||||
'is_def' => 1,
|
||||
"id != {$id}" => null,
|
||||
];
|
||||
$update = ['is_def'=>0];
|
||||
if($row['type']==2){
|
||||
$where["json_extract(jsondata, '$.type') = '{$jsondata['type']}'"] = null;
|
||||
$update['status'] = 0;
|
||||
}
|
||||
if($row['type']==3){
|
||||
$where["json_extract(jsondata, '$.finance_num') = '{$jsondata['finance_num']}'"] = null;
|
||||
}
|
||||
$this->biz_settle_srv_model->update($update,$where_u);
|
||||
}
|
||||
if ($row['type']==2 && !$row['is_def'] && (!$jsondata['s_time'] || !$jsondata['e_time'])){
|
||||
return $this->show_json(SYS_CODE_FAIL,'请先修改,填写时间区间后,再操作');
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['status'] = $status;
|
||||
$this->biz_settle_srv_model->update($data, $where);
|
||||
@@ -246,7 +333,7 @@ class Srv extends HD_Controller{
|
||||
'biz_id' => $biz_id,
|
||||
'status' => 1
|
||||
];
|
||||
$rows = $this->biz_settle_srv_model->select_groupby('title', $where, '', 0, 20, 'id,title');
|
||||
$rows = $this->biz_settle_srv_model->select_groupby('title', $where, 'is_def desc, id desc', 0, 0, 'id,title');
|
||||
$this->data['lists'] = $rows;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ class Store extends HD_Controller
|
||||
$this->load->model("biz/biz_trucking_model");
|
||||
$this->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_brand_biz_model');
|
||||
|
||||
$this->load->model("biz/biz_brand_model", 'bizBrand');
|
||||
$this->load->model('area_model');
|
||||
@@ -103,13 +104,17 @@ class Store extends HD_Controller
|
||||
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$type_ids && $where["type in ($type_ids)"] = null;
|
||||
|
||||
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
|
||||
$count = $this->biz_model->count($where);
|
||||
$bizlists = [];
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
foreach ($biz_lists as $v) {
|
||||
$brand = $this->bizBrand->get(array('id' => $v['brand_id']), 'brand_name');
|
||||
$v['brand_name'] = $brand['brand_name'];
|
||||
# 230220close
|
||||
/*$brand = $this->bizBrand->get(array('id' => $v['brand_id']), 'brand_name');
|
||||
$v['brand_name'] = $brand['brand_name'];*/
|
||||
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
|
||||
$v['type_name'] = $typeAry[$v['type']];
|
||||
$v['type'] = $v['type'];
|
||||
@@ -124,13 +129,14 @@ class Store extends HD_Controller
|
||||
$map_company = $this->company_model->map('id', 'short', $where, $orderby, 0, 0, $select);
|
||||
|
||||
//获取品牌
|
||||
$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
|
||||
$data = array();
|
||||
# 230220close
|
||||
/*$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
|
||||
if ($lists) {
|
||||
foreach ($lists as $value) {
|
||||
$data[] = array('name' => $value['brand_name'], 'id' => $value['id']);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$qdjl_lists = [];
|
||||
$res_u = $this->mdLichebUsers->select(array('group_id' => 4, 'status' => 1), 'id desc', 0, 0, 'id,uname as name,city_id');
|
||||
if ($res_u) {
|
||||
@@ -160,20 +166,22 @@ class Store extends HD_Controller
|
||||
$id = intval($this->input->get('id'));
|
||||
$this->data['provinces'] = $this->area_model->select(array(), '', 0, 0, 'distinct(province_id), province_name');
|
||||
//获取品牌
|
||||
$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
|
||||
$data = array();
|
||||
# 230220close
|
||||
/*$lists = $this->bizBrand->select(array('status' => 1), '', '', '', 'brand_name,id');
|
||||
|
||||
if ($lists) {
|
||||
foreach ($lists as $value) {
|
||||
$data[] = array('name' => $value['brand_name'], 'id' => $value['id']);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$this->data['brand_list'] = $data;
|
||||
|
||||
if ($id) {
|
||||
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
|
||||
|
||||
if (!$biz || empty($biz)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不存在!');
|
||||
}
|
||||
|
||||
$this->data['citys'] = $this->area_model->select(array('province_id' => $biz['province_id']), '', 0, 0, 'distinct(city_id), city_name');
|
||||
@@ -203,9 +211,9 @@ class Store extends HD_Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($biz['jsondata']) {
|
||||
$jsondata = json_decode($biz['jsondata'], true);
|
||||
$biz['auto_brands'] = $jsondata ? $jsondata['auto_brands'] : array();
|
||||
$b_biz_rows = $this->auto_brand_biz_model->select(['biz_id'=>$biz['id']],'','','','brand_id');
|
||||
if ($b_biz_rows) {
|
||||
$biz['auto_brands'] = array_column($b_biz_rows,'brand_id');
|
||||
} else {
|
||||
$biz['auto_brands'] = array();
|
||||
}
|
||||
@@ -240,7 +248,7 @@ class Store extends HD_Controller
|
||||
|
||||
$this->data['typeAry'] = $this->biz_model->type_ary();
|
||||
$this->data['companyAry'] = $map_company;
|
||||
$this->data['_title'] = $id ? '编辑门店' : '新增门店';
|
||||
$this->data['_title'] = $id ? '编辑门店-'.$biz['biz_name'] : '新增门店';
|
||||
$this->show_view('biz/store/edit', true);
|
||||
}
|
||||
|
||||
@@ -250,7 +258,7 @@ class Store extends HD_Controller
|
||||
$biz['status'] = 1;
|
||||
$biz['biz_name'] = $this->input->post('biz_name', true);
|
||||
if (!$biz['biz_name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '商家名称不能为空');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不能为空');
|
||||
}
|
||||
//中文转拼音
|
||||
$pinyin = new PinYin();
|
||||
@@ -258,9 +266,10 @@ class Store extends HD_Controller
|
||||
$biz['firstchar'] = strtoupper($py);
|
||||
|
||||
$biz['brand_id'] = intval($this->input->post('brand_id', true));
|
||||
if (!$biz['brand_id']) {
|
||||
# 230220close
|
||||
/*if (!$biz['brand_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择品牌');
|
||||
}
|
||||
}*/
|
||||
|
||||
$biz['province_id'] = $this->input->post('province_id', true);
|
||||
$biz['city_id'] = intval($this->input->post('city_id', true));
|
||||
@@ -279,14 +288,14 @@ class Store extends HD_Controller
|
||||
}
|
||||
|
||||
$auto_brands = $this->input->post('auto_brands');
|
||||
if ($auto_brands) {
|
||||
/*if ($auto_brands) {
|
||||
$jsondata = array('auto_brands' => $auto_brands);
|
||||
$biz['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}*/
|
||||
|
||||
//上传头像
|
||||
$biz['headimg'] = $this->input->post('headimg');
|
||||
//商家标签
|
||||
//门店标签
|
||||
$tag_more = $this->input->post('tag_more');
|
||||
if (!$tag_more || !is_array($tag_more)) {
|
||||
$tag_more = array();
|
||||
@@ -297,6 +306,7 @@ class Store extends HD_Controller
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '添加失败');
|
||||
}
|
||||
$this->grant_auto_brands($auto_brands, $id, $biz['type']);
|
||||
|
||||
foreach ($tag_more as $key => $value) {
|
||||
if ($value) {
|
||||
@@ -313,6 +323,42 @@ class Store extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
private function grant_auto_brands($auto_brands, $id, $biz_type){
|
||||
if($auto_brands){
|
||||
$brand_ids = implode(',',$auto_brands);
|
||||
$where = [
|
||||
'biz_id' => $id,
|
||||
"brand_id not in ({$brand_ids})" => null,
|
||||
];
|
||||
if($this->auto_brand_biz_model->count($where)){
|
||||
$this->auto_brand_biz_model->delete($where);
|
||||
}
|
||||
$add_datas = [];
|
||||
foreach ($auto_brands as $key => $val) {
|
||||
$where = [
|
||||
'biz_id' => $id,
|
||||
'brand_id' => $val
|
||||
];
|
||||
if(!$this->auto_brand_biz_model->count($where)){
|
||||
$add_datas[] = [
|
||||
'biz_id' => $id,
|
||||
'type' => $biz_type,
|
||||
'brand_id' => $val,
|
||||
'c_time' => time()
|
||||
];
|
||||
}
|
||||
}
|
||||
$add_datas && $this->auto_brand_biz_model->add_batch($add_datas);
|
||||
}else{
|
||||
$where = [
|
||||
'biz_id' => $id,
|
||||
];
|
||||
if($this->auto_brand_biz_model->count($where)){
|
||||
$this->auto_brand_biz_model->delete($where);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if (!$this->if_ajax) {
|
||||
@@ -324,7 +370,7 @@ class Store extends HD_Controller
|
||||
|
||||
$biz['biz_name'] = $this->input->post('biz_name', true);
|
||||
if (!$biz['biz_name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '商家名称不能为空');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不能为空');
|
||||
}
|
||||
//中文转拼音
|
||||
$pinyin = new PinYin();
|
||||
@@ -332,9 +378,10 @@ class Store extends HD_Controller
|
||||
$biz['firstchar'] = strtoupper($py);
|
||||
|
||||
$biz['brand_id'] = intval($this->input->post('brand_id', true));
|
||||
if (!$biz['brand_id']) {
|
||||
# 230220close
|
||||
/*if (!$biz['brand_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择品牌');
|
||||
}
|
||||
}*/
|
||||
|
||||
$biz['province_id'] = $this->input->post('province_id', true);
|
||||
$biz['city_id'] = intval($this->input->post('city_id', true));
|
||||
@@ -356,16 +403,17 @@ class Store extends HD_Controller
|
||||
|
||||
//授权品牌
|
||||
$auto_brands = $this->input->post('auto_brands');
|
||||
$old = $this->biz_model->get(array('id' => $id));
|
||||
$jsondata = json_decode($old['jsondata'], true);
|
||||
if ($auto_brands) {
|
||||
$jsondata['auto_brands'] = $auto_brands;
|
||||
} else {
|
||||
unset($jsondata['auto_brands']);
|
||||
}
|
||||
$biz['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
// $old = $this->biz_model->get(array('id' => $id));
|
||||
// $jsondata = json_decode($old['jsondata'], true);
|
||||
// if ($auto_brands) {
|
||||
// $jsondata['auto_brands'] = $auto_brands;
|
||||
// } else {
|
||||
// unset($jsondata['auto_brands']);
|
||||
// }
|
||||
// $biz['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$this->grant_auto_brands($auto_brands, $id, $biz['type']);
|
||||
|
||||
//商家标签
|
||||
//门店标签
|
||||
$tag_more = $this->input->post('tag_more');
|
||||
if (!$tag_more || !is_array($tag_more)) {
|
||||
$tag_more = array();
|
||||
@@ -401,7 +449,7 @@ class Store extends HD_Controller
|
||||
}
|
||||
$stauts = $this->input->post('status');
|
||||
$where = array('id' => $id);
|
||||
$this->bizBrand->update(array('status' => $stauts), $where);
|
||||
$this->biz_model->update(array('status' => $stauts), $where);
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
@@ -479,7 +527,7 @@ class Store extends HD_Controller
|
||||
}
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
if (!$biz || empty($biz)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '商家不存在!');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不存在!');
|
||||
}
|
||||
$biz_name = $biz['biz_name'];
|
||||
$where['biz_id'] = $biz_id;
|
||||
@@ -579,7 +627,7 @@ class Store extends HD_Controller
|
||||
return $this->show_json(0, "该用户已是门店管理员了");
|
||||
}
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
//绑定商家
|
||||
//绑定门店
|
||||
$data['uid'] = $uid;
|
||||
$data['brand_id'] = $biz['brand_id'];
|
||||
$data['biz_id'] = $biz_id;
|
||||
@@ -635,7 +683,7 @@ class Store extends HD_Controller
|
||||
return $this->show_json(0, "该用户已是门店管理员了");
|
||||
}
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
//绑定商家
|
||||
//绑定门店
|
||||
$data['uid'] = $uid;
|
||||
$data['brand_id'] = $biz['brand_id'];
|
||||
$data['biz_id'] = $biz_id;
|
||||
@@ -719,7 +767,7 @@ class Store extends HD_Controller
|
||||
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page);
|
||||
$this->data['_title'] = "商家{$biz_name}管理员列表";
|
||||
$this->data['_title'] = "{$biz_name}管理员列表";
|
||||
|
||||
$this->show_view('biz/store/lists_manager', true);
|
||||
}
|
||||
@@ -745,7 +793,7 @@ class Store extends HD_Controller
|
||||
}
|
||||
|
||||
if (!$biz_id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '商家不存在!');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不存在!');
|
||||
}
|
||||
|
||||
//店铺名称
|
||||
@@ -803,12 +851,12 @@ class Store extends HD_Controller
|
||||
// }
|
||||
//店铺名称
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
//绑定商家
|
||||
//绑门店
|
||||
$data = array('uid' => $uid);
|
||||
$data['biz_id'] = $biz_id;
|
||||
$data['brand_id'] = $biz['brand_id'];
|
||||
$this->$ub_model->add($data);
|
||||
//生成商家关联数据
|
||||
//生成门店关联数据
|
||||
//座上宾
|
||||
$this->load->model('app/zsb/app_zsb_user_model');
|
||||
$this->load->model('user/user_model', 'user_model');
|
||||
@@ -872,11 +920,11 @@ class Store extends HD_Controller
|
||||
}
|
||||
//店铺名称
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
//绑定商家
|
||||
//绑定门店
|
||||
$data = array('uid' => $uid);
|
||||
$data['brand_id'] = $biz['brand_id'];
|
||||
$this->$ub_model->update($data, array('id' => $id));
|
||||
//生成商家关联数据
|
||||
//生成门店关联数据
|
||||
//座上宾
|
||||
$res = $this->app_zsb_user_model->get(array('mobile' => $mobile));
|
||||
if (!$res) {
|
||||
@@ -897,7 +945,7 @@ class Store extends HD_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺可选列表
|
||||
* 获取门店可选列表
|
||||
* @return bool
|
||||
*/
|
||||
function json_lists()
|
||||
@@ -912,6 +960,9 @@ class Store extends HD_Controller
|
||||
$type = $this->input->post('type');
|
||||
|
||||
$where = array();
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$type_ids && $where["type in ($type_ids)"] = null;
|
||||
if (strlen($status) > 0) {
|
||||
$where['status'] = $status;
|
||||
} else {
|
||||
@@ -922,7 +973,7 @@ class Store extends HD_Controller
|
||||
} else {
|
||||
if ($_SESSION['admin_info']['biz_id']) {
|
||||
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
|
||||
$where["id in ($biz_ids)"] = null;
|
||||
$where["id in ({$biz_ids})"] = null;
|
||||
}
|
||||
}
|
||||
$province_id && $where['province_id'] = $province_id;
|
||||
@@ -950,7 +1001,7 @@ class Store extends HD_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺信息
|
||||
* 获取门店信息
|
||||
* @return bool
|
||||
*/
|
||||
function json_get()
|
||||
@@ -1028,7 +1079,7 @@ class Store extends HD_Controller
|
||||
$biz_id = $this->input->get('id');
|
||||
$biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
if (!$biz) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
|
||||
return $this->show_json(SYS_CODE_FAIL, '门店不存在!');
|
||||
}
|
||||
$base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
|
||||
if (!$base_info) {
|
||||
@@ -1076,7 +1127,7 @@ class Store extends HD_Controller
|
||||
$this->data['type_arr'] = [1 => '扩展', 2 => '新建'];
|
||||
$this->data['brands'] = $brands;
|
||||
$this->data['info'] = $info;
|
||||
$this->data['_title'] = '编辑门店基本信息';
|
||||
$this->data['_title'] = $biz['biz_name'].'-编辑基本信息';
|
||||
$this->show_view('biz/store/get_info', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ class Cost extends HD_Controller{
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model('app/liche/app_liche_orders_model');
|
||||
$this->load->model('sys/sys_company_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
$this->load->library('receiver/orders_v2_entity');
|
||||
}
|
||||
@@ -29,6 +29,7 @@ class Cost extends HD_Controller{
|
||||
//lc_items
|
||||
//品牌 车系 车型
|
||||
$where_items = $where_items_default = '1 = 1';
|
||||
$where["item_id in (select id from lc_items where brand_id in (select id from lc_auto_brand where status > -1))"] = null;
|
||||
if ($params['brand_id']) {//品牌
|
||||
//$where["brand_id"] = $params['brand_id'];
|
||||
$where_items = $where_items." and brand_id = ".$params['brand_id'];
|
||||
@@ -46,7 +47,7 @@ class Cost extends HD_Controller{
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["v_id"] = $params['v_id'];
|
||||
//$where["v_id"] = $params['v_id'];
|
||||
$where_items = $where_items." and v_id = ".$params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
@@ -54,6 +55,7 @@ class Cost extends HD_Controller{
|
||||
|
||||
if ($params['vin']) {
|
||||
//$where["item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
|
||||
$params['vin'] = trim($params['vin']);
|
||||
$where_items = $where_items." and vin like '%{$params['vin']}%'";
|
||||
}
|
||||
if ($where_items != $where_items_default){
|
||||
@@ -106,6 +108,14 @@ class Cost extends HD_Controller{
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
//二手车
|
||||
if (strlen($params['if_usedcar'])) {
|
||||
$where_orders = $where_orders." and if_usedcar = {$params['if_usedcar']}";
|
||||
}
|
||||
else {
|
||||
$params['if_usedcar'] = '';
|
||||
}
|
||||
|
||||
if ($where_orders != $where_orders_default){
|
||||
$where["o_id in (select id from lc_receiver_orders_v2 where $where_orders)"] = null;
|
||||
}
|
||||
@@ -120,6 +130,16 @@ class Cost extends HD_Controller{
|
||||
$where["bill_time <="] = $bill_time[1] . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (!$params['bt_init']){
|
||||
$params['bt_init'] = 1;
|
||||
$time1 = date("Y-m-d",mktime(0, 0 , 0,date("m"),1,date("Y")));
|
||||
$time2 = date("Y-m-d",mktime(23,59,59,date("m"),date("t"),date("Y")));
|
||||
$params['bill_time'] = $time1 . ' ~ ' . $time2;
|
||||
$where["bill_time >="] = $time1 . ' 00:00:00';
|
||||
$where["bill_time <="] = $time2 . ' 23:59:59';
|
||||
}
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
@@ -130,8 +150,16 @@ class Cost extends HD_Controller{
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$autoList = array();
|
||||
$where = $this->get_where($params);
|
||||
if ($params['brand_id']) {
|
||||
$autoList[2] = $this->auto_series_model->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
if ($params['s_id']) {
|
||||
$autoList[3] = $this->auto_attr_model->select(array('status > -1' => null, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
}
|
||||
|
||||
$count = $this->items_cost_model->count($where);
|
||||
#$count = $this->items_cost_model->count($where);var_dump($count);
|
||||
$aggs = $this->items_cost_model->get($where, 'count(*) as doc_count, sum(srv_price) as srv_price_sum, sum(car_price) as car_price_sum');
|
||||
$count = $aggs['doc_count'];
|
||||
$lists = [];
|
||||
if($count){
|
||||
$rows = $this->items_cost_model->select($where,'id desc',$page,$size);
|
||||
@@ -150,7 +178,7 @@ class Cost extends HD_Controller{
|
||||
$map_order = [];
|
||||
if($o_ids){
|
||||
$where = ["id in ($o_ids)" => null];
|
||||
$fields = "id, (select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name";
|
||||
$fields = "id, if_usedcar, (select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name, (select lc_sys_city.name from lc_biz left join lc_sys_city on lc_biz.city_id = lc_sys_city.city_id where lc_biz.id = lc_receiver_orders_v2.biz_id) as city_name ";
|
||||
$order_rows = $this->receiver_orders_v2_model->select($where,'','','',$fields);
|
||||
foreach ($order_rows as $item) {
|
||||
$map_order[$item['id']] = $item;
|
||||
@@ -178,10 +206,12 @@ class Cost extends HD_Controller{
|
||||
$v_name = isset($attr[$item['v_id']]) ? $attr[$item['v_id']][0]['title'] : '';
|
||||
$srv_json = json_decode($val['srv_json'],true);
|
||||
$order = $map_order[$val['o_id']];
|
||||
$if_usedcar_name = $order['if_usedcar'] ? ' (二手车)':'';
|
||||
$lists[] = [
|
||||
'id' => $val['id'],
|
||||
'city_name' => $order['city_name'],
|
||||
'biz_name' => $order['biz_name'],
|
||||
'title' => "{$brand_name} {$series_name} {$v_name}",
|
||||
'title' => "{$brand_name} {$series_name} {$v_name}{$if_usedcar_name}",
|
||||
'vin' => $item['vin'],
|
||||
'sale_price' => $val['sale_price'],
|
||||
'buy_price' => $val['buy_price'],
|
||||
@@ -191,6 +221,8 @@ class Cost extends HD_Controller{
|
||||
'insurance_price' => $val['insurance_price'],
|
||||
'fee_carno_price' => $val['fee_carno_price'],
|
||||
'loan_price' => $val['loan_price'],
|
||||
'loan_price0' => $val['loan_price0'], // 首付按揭
|
||||
'loan_price_total' => $val['loan_price_total'],
|
||||
'srv_price' => $val['srv_price'],
|
||||
'car_price' => $val['car_price'],
|
||||
'dl_car_price' => $val['dl_car_price'],
|
||||
@@ -201,9 +233,12 @@ class Cost extends HD_Controller{
|
||||
}
|
||||
}
|
||||
$show_info['bizTypeAry'] = $this->biz_model->type_ary();//门店类型
|
||||
$show_info['usedcarAry'] = array(1=>'是', 0=>'否');
|
||||
$this->data['show_info'] = $show_info;
|
||||
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
#$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['aggs'] = $aggs;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['autoList'] = $autoList;
|
||||
$this->data['params'] = $params;
|
||||
@@ -233,18 +268,29 @@ class Cost extends HD_Controller{
|
||||
$srv_json = json_decode($row['srv_json'],true);
|
||||
!$srv_json['commission_price'] && $srv_json['commission_price'] = 0;
|
||||
!$srv_json['back_price'] && $srv_json['back_price'] = 0;
|
||||
!$srv_json['loan_srv'] && $srv_json['loan_srv'] = 0;
|
||||
!$srv_json['loan_fd'] && $srv_json['loan_fd'] = 0;
|
||||
!$srv_json['loan_offset_price'] && $srv_json['loan_offset_price'] = 0;
|
||||
!$srv_json['loan_subsidy_price'] && $srv_json['loan_subsidy_price'] = 0;
|
||||
!$srv_json['loan_in_price'] && $srv_json['loan_in_price'] = 0;
|
||||
!$srv_json['loan_out_price'] && $srv_json['loan_out_price'] = 0;
|
||||
!$srv_json['loan_srv0'] && $srv_json['loan_srv0'] = 0; // 首付按揭 // 按揭手续费
|
||||
!$srv_json['loan_fd0'] && $srv_json['loan_fd0'] = 0; // 返点
|
||||
!$srv_json['loan_srv_price0'] && $srv_json['loan_srv_price0'] = 0; // 按揭佣金
|
||||
!$srv_json['loan_offset_price0'] && $srv_json['loan_offset_price0'] = 0; // 解抵服务费
|
||||
!$srv_json['loan_subsidy_price0'] && $srv_json['loan_subsidy_price0'] = 0; // 利息补贴收入 其他收入金额
|
||||
!$srv_json['loan_in_price0'] && $srv_json['loan_in_price0'] = 0; // 其他收入金额
|
||||
!$srv_json['loan_out_price0'] && $srv_json['loan_out_price0'] = 0; // 其他支出金额
|
||||
!$srv_json['commission_price0'] && $srv_json['commission_price0'] = 0; // 按揭手续费收入
|
||||
!$srv_json['other_out_price'] && $srv_json['other_out_price'] = 0;
|
||||
!$srv_json['other_in_price'] && $srv_json['other_in_price'] = 0;
|
||||
!$srv_json['ori_price'] && $srv_json['ori_price'] = 0;
|
||||
$info = [
|
||||
'bill_name' => $row['bill_name'],
|
||||
'bill_time' => date('Y-m-d',strtotime($row['bill_time'])),
|
||||
'bill_time' => $row['bill_time'] !='0000-00-00 00:00:00' ? date('Y-m-d',strtotime($row['bill_time'])) : '',
|
||||
'price' => $row['price'],
|
||||
'bill_price' => $row['bill_price'],
|
||||
'if_usedcar_name' => $order_row['if_usedcar'] ? '是':'否',
|
||||
'vin' => $item_row['vin'],
|
||||
'ori_price' => $item_row['ori_price'],
|
||||
'buy_price' => $item_row['buy_price'],
|
||||
@@ -254,6 +300,7 @@ class Cost extends HD_Controller{
|
||||
'biz_type' => $biz['type'],
|
||||
'biz_type_name' => $this->biz_model->type_ary($biz['type']),
|
||||
'biz_name' => $biz['biz_name'],
|
||||
'biz_type_force' => $biz['type'] == 3 && in_array($biz['city_id'], $this->receiver_orders_v2_model->get_city_ids_force()) ? 1 : 0, # 23-04-03: 按揭, 350600 代理店按所在城市的品牌店处理; 23-04-04: 加多一个城市,宁德
|
||||
'admin_name' => $admin['uname'],
|
||||
'order_time' => date('Y-m-d',$order_row['c_time']),
|
||||
'promotion_json' => $promotion_json,
|
||||
@@ -264,7 +311,7 @@ class Cost extends HD_Controller{
|
||||
];
|
||||
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$row['o_id'],'status'=>1,'pay_price <>'=>0]);
|
||||
$info['pay_price'] = $sum['total_price'] ? $sum['total_price'] : 0;
|
||||
$info['need_price'] = $this->orders_v2_entity->recevable_price($row['o_id']);
|
||||
$info['need_price'] = $this->orders_v2_entity->recevable_price($row['o_id'],$srv_price=true,$price_loan=false);
|
||||
//获取车信息
|
||||
$brand = $this->auto_brand_model->get(['id' => $item_row['brand_id']], 'name');
|
||||
$serie = $this->auto_series_model->get(['id' => $item_row['s_id']], 'name');
|
||||
@@ -296,6 +343,8 @@ class Cost extends HD_Controller{
|
||||
}
|
||||
|
||||
$data = [
|
||||
'bill_name' => $post_data['bill_name'] ? $post_data['bill_name'] : '',
|
||||
'bill_price' => $post_data['bill_price'] ? $post_data['bill_price'] : 0,
|
||||
'price' => $post_data['price'] ? $post_data['price'] : 0,
|
||||
'cost_json' => json_encode($post_data['cost_json'],JSON_UNESCAPED_UNICODE),
|
||||
'promotion_json' => json_encode($post_data['promotion_json'],JSON_UNESCAPED_UNICODE),
|
||||
@@ -357,6 +406,142 @@ class Cost extends HD_Controller{
|
||||
|
||||
}
|
||||
|
||||
public function add_excel()
|
||||
{
|
||||
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
|
||||
$res = $this->upload();
|
||||
if (!$res['code']) {
|
||||
return $this->show_json(0, $res['message']);
|
||||
}
|
||||
$file = $res['path'];
|
||||
if ($res['file_ext'] == '.xls') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel5'); // 读取 excel 文档
|
||||
} elseif ($res['file_ext'] == '.xlsx') {
|
||||
$reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档
|
||||
}
|
||||
$PHPExcel = $reader->load($file); // 文档名称
|
||||
$objWorksheet = $PHPExcel->getActiveSheet();
|
||||
$rowCnt = $objWorksheet->getHighestRow(); //获取总行数
|
||||
if ($rowCnt > 10000) {
|
||||
@unlink($file);
|
||||
return $this->show_json(0, '数据大于一万请拆分多个表格导入');
|
||||
}
|
||||
$s = $f = $ignore_vin = $ignore_item = $ignore_cost = 0;
|
||||
for ($_row = 2; $_row <= $rowCnt; $_row++) { //读取内容
|
||||
$vin = $objWorksheet->getCell('A' . $_row)->getValue(); //vin码
|
||||
if (!$vin){
|
||||
$ignore_vin++;
|
||||
continue;
|
||||
}
|
||||
$item = $this->items_model->get(array('vin' => $vin));
|
||||
if (!$item){
|
||||
$ignore_item++;
|
||||
continue;
|
||||
}
|
||||
$cost = $this->items_cost_model->get(array('item_id' => $item['id']));
|
||||
if (!$cost){
|
||||
$ignore_cost++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$id = $cost['id'];
|
||||
$promotion_json = json_decode($cost['promotion_json'],true);
|
||||
$cost_json = json_decode($cost['cost_json'],true);
|
||||
$srv_json = json_decode($cost['srv_json'],true);
|
||||
# 读取需要更新的列,生成需更新的数据
|
||||
# 参考 edit* 更新
|
||||
$buy_price = floatval($objWorksheet->getCell('B' . $_row)->getValue()); //采购成本
|
||||
$select_price = floatval($objWorksheet->getCell('C' . $_row)->getValue()); //选装成本
|
||||
$labor_price = floatval($objWorksheet->getCell('D' . $_row)->getValue()); //选装工时费
|
||||
$sale_price = floatval($objWorksheet->getCell('E' . $_row)->getValue()); //销售佣金
|
||||
$other = floatval($objWorksheet->getCell('F' . $_row)->getValue()); //其他促销成本
|
||||
$factory_price = floatval($objWorksheet->getCell('G' . $_row)->getValue()); //厂家补贴
|
||||
$other_in_price = floatval($objWorksheet->getCell('H' . $_row)->getValue()); //其他收入
|
||||
$other_out_price = floatval($objWorksheet->getCell('I' . $_row)->getValue()); //其他支出
|
||||
$business_product = $objWorksheet->getCell('J' . $_row)->getValue(); //保险公司
|
||||
$business_price = floatval($objWorksheet->getCell('K' . $_row)->getValue()); //商业险金额
|
||||
$business_fd = floatval($objWorksheet->getCell('L' . $_row)->getValue()); //商业险返点
|
||||
$business_ins_price = floatval($objWorksheet->getCell('M' . $_row)->getValue()); //商业险佣金
|
||||
$insurance_price = floatval($objWorksheet->getCell('N' . $_row)->getValue()); //交强险金额
|
||||
$insurance_fd = floatval($objWorksheet->getCell('O' . $_row)->getValue()); //交强险返点
|
||||
$insurance_ins_price = floatval($objWorksheet->getCell('P' . $_row)->getValue()); //交强险佣金
|
||||
$accident_price = floatval($objWorksheet->getCell('Q' . $_row)->getValue()); //意外险金额
|
||||
$accident_fd = floatval($objWorksheet->getCell('R' . $_row)->getValue()); //意外险返点
|
||||
$accident_ins_price = floatval($objWorksheet->getCell('S' . $_row)->getValue()); //意外险佣金
|
||||
$back_price = floatval($objWorksheet->getCell('T' . $_row)->getValue()); //客户退点金额
|
||||
$fee_carno = floatval($objWorksheet->getCell('U' . $_row)->getValue()); //挂牌收入
|
||||
$cb_fee_carno = floatval($objWorksheet->getCell('V' . $_row)->getValue()); //挂牌成本
|
||||
$loan_product = $objWorksheet->getCell('W' . $_row)->getValue(); //按揭银行
|
||||
$loan_num = floatval($objWorksheet->getCell('X' . $_row)->getValue()); //按揭期数
|
||||
$loan_price = floatval($objWorksheet->getCell('Y' . $_row)->getValue()); //按揭金额
|
||||
$loan_fd = floatval($objWorksheet->getCell('Z' . $_row)->getValue()); //按揭返点
|
||||
$loan_srv_price = floatval($objWorksheet->getCell('AA' . $_row)->getValue()); //按揭佣金
|
||||
$loan_srv = floatval($objWorksheet->getCell('AB' . $_row)->getValue()); //按揭手续费
|
||||
$loan_offset_price = floatval($objWorksheet->getCell('AC' . $_row)->getValue()); //解抵服务费
|
||||
$loan_subsidy_price = floatval($objWorksheet->getCell('AD' . $_row)->getValue()); //利息补贴收入
|
||||
$loan_in_price = floatval($objWorksheet->getCell('AE' . $_row)->getValue()); //其他收入金额
|
||||
$loan_out_price = floatval($objWorksheet->getCell('AF' . $_row)->getValue()); //其他支出金额
|
||||
$commission_price = floatval($objWorksheet->getCell('AG' . $_row)->getValue()); //利息补贴收入
|
||||
|
||||
$res_item = 0;
|
||||
if ($item['buy_price'] != $buy_price){
|
||||
$res_item = $this->items_model->update(array('buy_price'=>$buy_price),['id'=>$item['id']]);
|
||||
}
|
||||
$cost_json['select_price'] = $select_price ? $select_price : 0;
|
||||
$cost_json['labor_price'] = $labor_price ? $labor_price : 0;
|
||||
|
||||
$promotion_json['sale_price'] = $sale_price ? $sale_price : 0;
|
||||
$promotion_json['other'] = $other ? $other : 0;
|
||||
$promotion_json['factory_price'] = $factory_price ? $factory_price : 0;
|
||||
|
||||
$srv_json['other_in_price'] = $other_in_price ? $other_in_price : 0;
|
||||
$srv_json['other_out_price'] = $other_out_price ? $other_out_price : 0;
|
||||
$srv_json['business_product'] = $business_product ? $business_product : '';
|
||||
$srv_json['business_price'] = $business_price ? $business_price : 0;
|
||||
$srv_json['business_fd'] = $business_fd ? $business_fd : 0;
|
||||
$srv_json['business_ins_price'] = $business_ins_price ? $business_ins_price : 0;
|
||||
$srv_json['insurance_price'] = $insurance_price ? $insurance_price : 0;
|
||||
$srv_json['insurance_fd'] = $insurance_fd ? $insurance_fd : 0;
|
||||
$srv_json['insurance_ins_price'] = $insurance_ins_price ? $insurance_ins_price : 0;
|
||||
$srv_json['accident_price'] = $accident_price ? $accident_price : 0;
|
||||
$srv_json['accident_fd'] = $accident_fd ? $accident_fd : 0;
|
||||
$srv_json['accident_ins_price'] = $accident_ins_price ? $accident_ins_price : 0;
|
||||
$srv_json['back_price'] = $back_price ? $back_price : 0;
|
||||
$srv_json['fee_carno'] = $fee_carno ? $fee_carno : 0;
|
||||
$srv_json['cb_fee_carno'] = $cb_fee_carno ? $cb_fee_carno : 0;
|
||||
$srv_json['loan_product'] = $loan_product ? $loan_product : '';
|
||||
$srv_json['loan_num'] = $loan_num ? $loan_num : 0;
|
||||
$srv_json['loan_price'] = $loan_price ? $loan_price : 0;
|
||||
$srv_json['loan_fd'] = $loan_fd ? $loan_fd : 0;
|
||||
$srv_json['loan_srv_price'] = $loan_srv_price ? $loan_srv_price : 0;
|
||||
$srv_json['loan_srv'] = $loan_srv ? $loan_srv : 0;
|
||||
$srv_json['loan_offset_price'] = $loan_offset_price ? $loan_offset_price : 0;
|
||||
$srv_json['loan_subsidy_price'] = $loan_subsidy_price ? $loan_subsidy_price : 0;
|
||||
$srv_json['loan_in_price'] = $loan_in_price ? $loan_in_price : 0;
|
||||
$srv_json['loan_out_price'] = $loan_out_price ? $loan_out_price : 0;
|
||||
$srv_json['commission_price'] = $commission_price ? $commission_price : 0;
|
||||
|
||||
$data = [
|
||||
'cost_json' => json_encode($cost_json,JSON_UNESCAPED_UNICODE),
|
||||
'promotion_json' => json_encode($promotion_json,JSON_UNESCAPED_UNICODE),
|
||||
'srv_json' => json_encode($srv_json,JSON_UNESCAPED_UNICODE),
|
||||
];
|
||||
$res = $this->items_cost_model->update($data,['id'=>$cost['id']]);
|
||||
if(is_numeric($res_item) || is_numeric($res)){
|
||||
$this->items_cost_model->update_total($cost['id']);
|
||||
}else{
|
||||
$f++;
|
||||
}
|
||||
$s++;
|
||||
}
|
||||
@unlink($file);
|
||||
$ignore = $ignore_vin + $ignore_item + $ignore_cost;
|
||||
$msg = "导入完成,导入总条数为:" . $s;
|
||||
$f && $msg = $msg . '; 失败条数:'. $f;
|
||||
$ignore && $msg = $msg . '; 忽略条数:'. $ignore;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, $msg);
|
||||
}
|
||||
|
||||
public function export(){
|
||||
$params = $this->input->get();
|
||||
$params['page'] = 1;
|
||||
@@ -384,11 +569,13 @@ class Cost extends HD_Controller{
|
||||
$map_order = [];
|
||||
if($o_ids){
|
||||
$where = ["id in ($o_ids)" => null];
|
||||
$fields = "id, name, mobile, owner_name, owner_mobile, c_time, biz_id, admin_id, payway,
|
||||
if(payway=1,'贷款','全款') as payway_name,
|
||||
$fields = "id, name, mobile, owner_name, owner_mobile, c_time, biz_id, admin_id,
|
||||
payway, if(payway=1,'全款','按揭') as payway_name,
|
||||
if_usedcar, if(if_usedcar=1,'是','') as if_usedcar_name,
|
||||
(select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type,
|
||||
(select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name,
|
||||
(select uname from lc_app_licheb_users where id = lc_receiver_orders_v2.admin_id) as admin_name";
|
||||
(select uname from lc_app_licheb_users where id = lc_receiver_orders_v2.admin_id) as admin_name,
|
||||
(select lc_sys_city.name from lc_biz left join lc_sys_city on lc_biz.city_id = lc_sys_city.city_id where lc_biz.id = lc_receiver_orders_v2.biz_id) as city_name";
|
||||
$order_rows = $this->receiver_orders_v2_model->select($where,'','','',$fields);
|
||||
foreach ($order_rows as $item) {
|
||||
$map_order[$item['id']] = $item;
|
||||
@@ -439,16 +626,18 @@ class Cost extends HD_Controller{
|
||||
|
||||
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$val['o_id'],'status'=>1,'pay_price <>'=>0]);
|
||||
$pay_price = $sum['total_price'] ? $sum['total_price'] : 0;
|
||||
$need_price = $this->orders_v2_entity->recevable_price($val['o_id']);
|
||||
$need_price = $this->orders_v2_entity->recevable_price($val['o_id'],$srv_price=true,$price_loan=false);
|
||||
|
||||
$data[] = [
|
||||
'id' => $val['id'],
|
||||
'city_name' => $order['city_name'],
|
||||
'bill_name' => $val['bill_name'],
|
||||
'biz_type' => $order['biz_type'],
|
||||
'biz_type_name' => $this->biz_model->type_ary($order['biz_type']),
|
||||
'vin' => $item['vin'],
|
||||
'brand_name' => $brand_name,
|
||||
'series_name' => "{$series_name} {$v_name}",
|
||||
'if_usedcar_name' => $order['if_usedcar_name'],
|
||||
'ori_price' => $srv_json['ori_price'],
|
||||
|
||||
'owner_name' => $order['owner_name']."({$order['owner_mobile']})",
|
||||
@@ -487,6 +676,9 @@ class Cost extends HD_Controller{
|
||||
"insurance_price" => $srv_json['insurance_price'],
|
||||
"insurance_fd" => $srv_json['insurance_fd'],
|
||||
"insurance_ins_price" => $srv_json['insurance_ins_price'],
|
||||
"accident_price" => $srv_json['accident_price'],
|
||||
"accident_fd" => $srv_json['accident_fd'],
|
||||
"accident_ins_price" => $srv_json['accident_ins_price'],
|
||||
"back_price" => $srv_json['back_price'],
|
||||
"insurance_price_pure" => $val['insurance_price'],
|
||||
|
||||
@@ -496,17 +688,36 @@ class Cost extends HD_Controller{
|
||||
|
||||
'payway_name' => $order['payway_name'],
|
||||
|
||||
'loan_product0' => $srv_json['loan_product0'],
|
||||
'loan_is_tiexi0' => $srv_json['loan_product0'] ? ($srv_json['loan_is_tiexi0'] ? '是' : '否') : '',
|
||||
'loan_price0' => $srv_json['loan_price0'],
|
||||
'loan_num0' => $srv_json['loan_num0'],
|
||||
'loan_srv_price0' => $srv_json['loan_srv_price0'],
|
||||
'loan_srv0' => $srv_json['loan_srv0'],
|
||||
'loan_fd0' => $srv_json['loan_fd0'],
|
||||
'loan_offset_price0' => $srv_json['loan_offset_price0'],
|
||||
'loan_subsidy_price' => $srv_json['loan_subsidy_price0'],
|
||||
'commission_price0' => $srv_json['commission_price0'],
|
||||
'loan_in_price0' => $srv_json['loan_in_price0'],
|
||||
'loan_out_price0' => $srv_json['loan_out_price0'],
|
||||
'loan_price_pure0' => $val['loan_price0'],
|
||||
|
||||
'loan_product' => $srv_json['loan_product'],
|
||||
'loan_price' => $srv_json['loan_price'],
|
||||
'loan_num' => $srv_json['loan_num'],
|
||||
'loan_srv_price' => $srv_json['loan_srv_price'],
|
||||
'loan_offset_price' => $srv_json['loan_offset_price'],
|
||||
'loan_subsidy_price' => $srv_json['loan_subsidy_price'],
|
||||
'commission_price' => $srv_json['commission_price'],
|
||||
'loan_in_price' => $srv_json['loan_in_price'],
|
||||
'loan_out_price' => $srv_json['loan_out_price'],
|
||||
'loan_is_tiexi' => $srv_json['loan_is_tiexi'] ? '是' : '否',
|
||||
'loan_price' => $srv_json['loan_price'], // 按揭金额
|
||||
'loan_num' => $srv_json['loan_num'], // 期数
|
||||
'loan_srv_price' => $srv_json['loan_srv_price'], // 按揭佣金
|
||||
'loan_srv' => $srv_json['loan_srv'], // 按揭手续费
|
||||
'loan_fd' => $srv_json['loan_fd'], // 返点
|
||||
'loan_offset_price' => $srv_json['loan_offset_price'], // 解抵服务费
|
||||
'loan_subsidy_price' => $srv_json['loan_subsidy_price'], // 利息补贴收入
|
||||
'commission_price' => $srv_json['commission_price'], // 按揭手续费收入
|
||||
'loan_in_price' => $srv_json['loan_in_price'], // 其他收入金额
|
||||
'loan_out_price' => $srv_json['loan_out_price'], // 其他支出金额
|
||||
'loan_price_pure' => $val['loan_price'],
|
||||
|
||||
'loan_price_total' => $val['loan_price_total'],
|
||||
|
||||
'other_in_price' => $srv_json['other_in_price'],
|
||||
'other_out_price' => $srv_json['other_out_price'],
|
||||
'other_price' => $srv_json['other_in_price'] - $srv_json['other_out_price'],
|
||||
@@ -528,20 +739,23 @@ class Cost extends HD_Controller{
|
||||
'price_floor' => array('title'=>'销售政策', 'column_num'=>3),
|
||||
'company_name' => array('title'=>'采购成本', 'column_num'=>5),
|
||||
'promotion_sale_price' => array('title'=>'促销成本', 'column_num'=>3),
|
||||
'business_product' => array('title'=>'保险收入', 'column_num'=>9),
|
||||
'business_product' => array('title'=>'保险收入', 'column_num'=>12),
|
||||
'fee_carno' => array('title'=>'挂牌收入', 'column_num'=>3),
|
||||
'loan_product' => array('title'=>'分期付款业务', 'column_num'=>10),
|
||||
'loan_product0' => array('title'=>'首付按揭付款业务', 'column_num'=>12), // 首付按揭-表头, 首付按揭不需要贴息选项,所以少一列
|
||||
'loan_product' => array('title'=>'按揭付款业务', 'column_num'=>13),
|
||||
'other_in_price' => array('title'=>'其他收入及成本', 'column_num'=>3),
|
||||
'need_price' => array('title'=>'收款核对', 'column_num'=>3),
|
||||
];
|
||||
$indexs = [
|
||||
'id' => '序号',
|
||||
'city_name' => '城市',
|
||||
'bill_name' => '开票方',
|
||||
//'biz_type' => 'biz_type',
|
||||
'biz_type_name' => '门店类型',
|
||||
'vin' => '车架号',
|
||||
'brand_name' => '品牌',
|
||||
'series_name' => '车型',
|
||||
'if_usedcar_name' => '二手车',
|
||||
'ori_price' => '指导价',
|
||||
|
||||
'owner_name' => '车主', // 客户名称
|
||||
@@ -580,6 +794,9 @@ class Cost extends HD_Controller{
|
||||
"insurance_price" => "交强险金额",
|
||||
"insurance_fd" => "交强险返点",
|
||||
"insurance_ins_price" => "交强险佣金",
|
||||
"accident_price" => "意外险金额",
|
||||
"accident_fd" => "意外险返点",
|
||||
"accident_ins_price" => "意外险佣金",
|
||||
"back_price" => "客户退点金额", // 退客户保险退点
|
||||
"insurance_price_pure" => "保险收入合计", // 保险净收入
|
||||
|
||||
@@ -589,10 +806,28 @@ class Cost extends HD_Controller{
|
||||
|
||||
'payway_name' => '购车方式',
|
||||
|
||||
// 首付按揭-字段
|
||||
'loan_product0' => '按揭银行',
|
||||
//'loan_is_tiexi0' => '贴息', // 首付按揭不需要贴息选项
|
||||
'loan_num0' => '期数',
|
||||
'loan_price0' => '按揭金额',
|
||||
'loan_fd0' => '按揭返点',
|
||||
'loan_srv_price0' => '按揭佣金',
|
||||
'loan_srv0' => '按揭手续费',
|
||||
'loan_offset_price0' => '解抵服务费',
|
||||
'loan_subsidy_price0' => '利息补贴收入',
|
||||
'commission_price0' => '按揭手续费收入',
|
||||
'loan_in_price0' => '其他收入金额',
|
||||
'loan_out_price0' => '其他支出金额',
|
||||
'loan_price_pure0' => '按揭收入合计',
|
||||
|
||||
'loan_product' => '按揭银行',
|
||||
'loan_price' => '按揭金额',
|
||||
'loan_is_tiexi' => '贴息',
|
||||
'loan_num' => '期数',
|
||||
'loan_srv_price' => '按揭服务费',
|
||||
'loan_price' => '按揭金额',
|
||||
'loan_fd' => '按揭返点',
|
||||
'loan_srv_price' => '按揭佣金',
|
||||
'loan_srv' => '按揭手续费',
|
||||
'loan_offset_price' => '解抵服务费',
|
||||
'loan_subsidy_price' => '利息补贴收入',
|
||||
'commission_price' => '按揭手续费收入',
|
||||
@@ -600,6 +835,8 @@ class Cost extends HD_Controller{
|
||||
'loan_out_price' => '其他支出金额',
|
||||
'loan_price_pure' => '按揭收入合计',
|
||||
|
||||
'loan_price_total' => '按揭收入总合计',
|
||||
|
||||
'other_in_price' => '其他收入',
|
||||
'other_out_price' => '其他支出',
|
||||
'other_price' => '其他合计',
|
||||
@@ -697,4 +934,25 @@ class Cost extends HD_Controller{
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:上传excel
|
||||
* Created on: 2021/7/14 15:06
|
||||
* Created by: dengbw
|
||||
* @return array
|
||||
*/
|
||||
private function upload()
|
||||
{
|
||||
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
|
||||
$config['allowed_types'] = '*';//xls|xlsx
|
||||
$config['max_size'] = 5 * 1024;
|
||||
$config['file_name'] = 'items_' . time() . rand(1, 99999);
|
||||
$this->load->library('upload', $config);
|
||||
if (!$this->upload->do_upload('file')) {
|
||||
return array('code' => SYS_CODE_FAIL, 'message' => $this->upload->display_errors('', ''));
|
||||
} else {
|
||||
$data = $this->upload->data();
|
||||
return array('code' => SYS_CODE_SUCCESS, 'path' => $data['full_path'], 'file_ext' => $data['file_ext']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,9 @@ class Inventory extends HD_Controller
|
||||
foreach ($res as $key => $value) {
|
||||
$setValue = [];
|
||||
$setValue['id'] = $value['id'];
|
||||
$setValue['title'] = '盘点时间_' . date('Y-m-d', $value['c_time']);
|
||||
$jsondata = $value['jsondata'] ? json_decode($value['jsondata'], true) : array();
|
||||
$city_name = $jsondata['city_name'] ? '_'.$jsondata['city_name'] : '';
|
||||
$setValue['title'] = '盘点时间_' . date('Y-m-d', $value['c_time']).$city_name;
|
||||
$lists[] = $setValue;
|
||||
}
|
||||
}
|
||||
@@ -190,6 +192,7 @@ class Inventory extends HD_Controller
|
||||
$map_addr[$v['id']] = "{$v['city_name']} {$v['county_name']} 其它 {$v['title']}";
|
||||
}
|
||||
}
|
||||
$row_id = 0;
|
||||
foreach ($res as $key => $v) {
|
||||
$address = $mileage = $itemStatus_name = $car_img = $where_logs = '';
|
||||
if ($v['biz_id'] > 0) {
|
||||
@@ -217,20 +220,38 @@ class Inventory extends HD_Controller
|
||||
}
|
||||
$jsondata = $v['jsondata'] ? json_decode($v['jsondata'], true) : [];
|
||||
$jsondata['mileage'] && $mileage = $jsondata['mileage'];
|
||||
if ($jsondata['car_img']) {
|
||||
/*if ($jsondata['car_img']) {
|
||||
foreach ($carImgAry as $key2 => $value2) {
|
||||
$src = $jsondata['car_img'][$key2];
|
||||
$src && $car_img[] = ['title' => $value2, 'src' => build_qiniu_image_url($src)];
|
||||
}
|
||||
}*/
|
||||
$car_img_layer = $car_img = array();
|
||||
if ($jsondata['car_img']) {
|
||||
$car_img_layer['title'] = '';
|
||||
$car_img_layer['id'] = $v['item_id'];
|
||||
$car_img_layer['start'] = 0;
|
||||
$data = array();
|
||||
$pid = 0;
|
||||
foreach ($carImgAry as $key2 => $value2) {
|
||||
$src = $jsondata['car_img'][$key2];
|
||||
$src && $src = build_qiniu_image_url($src);
|
||||
$src && $data[] = ['alert' => $value2, 'pid' => $pid, 'src' => $src, 'thumb' => $src];
|
||||
$src && $car_img[] = ['title' => $value2, 'pid' => $pid, 'src' => $src];
|
||||
$src && $pid += 1;
|
||||
}
|
||||
$data && $car_img_layer['data'] = $data;
|
||||
}
|
||||
|
||||
$in_time = $v['in_time'];
|
||||
if ($where_logs) {
|
||||
$re_logs = $this->mdItemsOplogs->max('com_time', $where_logs);
|
||||
$re_logs['com_time'] && $in_time = $re_logs['com_time'];
|
||||
}
|
||||
$lists[] = ['item_id' => $v['item_id'], 'title' => $title, 'vin' => $v['vin'], 'address' => $address,
|
||||
'itemStatus_name' => $itemStatus_name, 'status_name' => $statusAry[$v['status']], 'mileage' => $mileage, 'car_img' => $car_img,
|
||||
$lists[] = ['row_id' => $row_id, 'item_id' => $v['item_id'], 'title' => $title, 'vin' => $v['vin'], 'address' => $address,
|
||||
'itemStatus_name' => $itemStatus_name, 'status_name' => $statusAry[$v['status']], 'mileage' => $mileage, 'car_img' => $car_img, 'car_img_layer'=>$car_img_layer,
|
||||
'in_time' => '0000-00-00 00:00:00' == $in_time ? '' : substr($in_time, 0, 10)];
|
||||
$row_id += 1;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
|
||||
@@ -248,12 +269,33 @@ class Inventory extends HD_Controller
|
||||
|
||||
public function add()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
$city_id = $params['city_id'] ? intval($params['city_id']) : 0;
|
||||
$force = $params['force'] ? intval($params['force']) : 0;
|
||||
# 如果当前(该月)有相同的盘点任务,再弹窗确认是否继续发起
|
||||
$starttime = mktime(0,0,0, date('m'),1, date('Y'));
|
||||
$endtime = mktime(23,59,59, date('m'),date('t'), date('Y'));
|
||||
$where = array('city_id' => $city_id, "c_time >= {$starttime}" => null, "c_time <= {$endtime}" => null);
|
||||
$res = $this->mdInventory->count($where);
|
||||
if (!$force && $res){
|
||||
return $this->show_json(-1, '本月已有此盘点,确认要重新发起吗?');
|
||||
}
|
||||
$c_time = time();
|
||||
$inve_id = $this->mdInventory->add(['c_time' => $c_time]);
|
||||
#$inve_id = $this->mdInventory->add(['c_time' => $c_time]);
|
||||
$jsondata = json_encode(array('city_name'=> $params['city_id'] && $params['city_name'] ? $params['city_name'] : ''));
|
||||
$inve_id = $this->mdInventory->add(['c_time' => $c_time, 'city_id' => $city_id, 'jsondata' => $jsondata]);
|
||||
if (!$inve_id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '发起盘点失败');
|
||||
}
|
||||
$where = array('status>' => 0, 'bill_time' => '0000-00-00 00:00:00');
|
||||
if ($city_id){
|
||||
$where_biz['city_id'] = $params['city_id'];
|
||||
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
$res_addr = $this->addr_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
$str_ids = $res_biz ? implode(',', array_column($res_biz, 'id')) : '-2';
|
||||
$str_addr_ids = $res_addr ? implode(',', array_column($res_addr, 'id')) : '-2';
|
||||
$where["(biz_id in ({$str_ids}) or addr_id in ({$str_addr_ids}))"] = null;
|
||||
}
|
||||
$res = $this->mdItems->select($where, 'id asc', 0, 0, 'id,biz_id,addr_id');
|
||||
$addDate = [];
|
||||
foreach ($res as $key => $value) {
|
||||
|
||||
@@ -37,6 +37,7 @@ class Stock extends HD_Controller
|
||||
} else {
|
||||
$order = "id desc";
|
||||
}
|
||||
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
if ($params['brand_id']) {
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
}
|
||||
@@ -69,7 +70,8 @@ class Stock extends HD_Controller
|
||||
$time[0] && $where["log_date>="] = $time[0];
|
||||
$time[1] && $where["log_date<="] = $time[1];
|
||||
}
|
||||
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), "id desc", 0, 0, 'id,name');
|
||||
//$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), "id desc", 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
if ($params['brand_id']) {
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
@@ -192,7 +194,7 @@ class Stock extends HD_Controller
|
||||
foreach ($dateMonths as $v2) {
|
||||
$where2 = $where3 = ['biz_id' => $v['id'], 'log_date>=' => $v2['firstDay'], 'log_date<=' => $v2['lastDay']];
|
||||
$res_log = $this->mdStockLog->select_groupby('s_id', $where2, 'id desc', 0, 0, 'brand_id,s_id');
|
||||
$data = '';
|
||||
$data_month = '';
|
||||
if ($res_log) {
|
||||
$str_ids = implode(',', array_unique(array_column($res_log, 'brand_id')));
|
||||
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
|
||||
@@ -204,13 +206,13 @@ class Stock extends HD_Controller
|
||||
, "count(id) as total");
|
||||
$count = $res_log2 ? $res_log2[0]['total'] : 0;
|
||||
$title = "{$map_brand[$v3['brand_id']]}-{$map_sery[$v3['s_id']]} {$count}天";
|
||||
$data = $data ? $data . ',' . $title : $title;
|
||||
$data_month = $data_month ? $data_month . ',' . $title : $title;
|
||||
}
|
||||
}
|
||||
if ($params['export'] == 1) {
|
||||
$months[$v2['name']] = $data;
|
||||
$months[$v2['name']] = $data_month;
|
||||
} else {
|
||||
$months[] = ['name' => $v2['name'], 'data' => $data];
|
||||
$months[] = ['name' => $v2['name'], 'data' => $data_month];
|
||||
}
|
||||
}
|
||||
if ($params['export'] == 1) {
|
||||
|
||||
@@ -39,7 +39,8 @@ class Transfer extends HD_Controller
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$re = $this->dataSelect($params);
|
||||
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
//$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
if ($params['brand_id']) {
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
@@ -156,6 +157,7 @@ class Transfer extends HD_Controller
|
||||
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
$where['item_id in (select id from lc_items where brand_id in (select id from lc_auto_brand where status > -1))'] = null;
|
||||
$total = $this->mdTransfer->count($where);
|
||||
$lists = array();
|
||||
if ($total) {
|
||||
@@ -243,6 +245,7 @@ class Transfer extends HD_Controller
|
||||
$trailer_fees .= '-' . $re_biz['biz_name'];
|
||||
}
|
||||
$setValue['fees'] = $trailer_fees;
|
||||
$setValue['settlement'] = in_array('settlement', array_keys($jsondata)) ? $jsondata['settlement'] : '';
|
||||
$setValue['reason'] = $jsondata['reason'] ? $jsondata['reason'] : '';
|
||||
}
|
||||
$lists[] = $setValue;
|
||||
@@ -363,6 +366,7 @@ class Transfer extends HD_Controller
|
||||
}
|
||||
$abnormal['imgs'] = $imgs;
|
||||
}
|
||||
$jsondata['settlement'] && $fields[] = ['title' => '调拨结算价', 'value' => $jsondata['settlement']]; # 23.04.20 新增一个字段 调拨结算价
|
||||
$jsondata['reason'] && $fields[] = ['title' => '调拨理由', 'value' => $jsondata['reason']];
|
||||
if ($re['trailer_fees']) {
|
||||
$trailer_fees = $re['trailer_fees'] ? $re['trailer_fees'] . '元' : '';
|
||||
@@ -393,7 +397,7 @@ class Transfer extends HD_Controller
|
||||
$view = 'items/transfer/get_add';
|
||||
$showInfo = ['vin' => $vin, 'items_info' => ['id' => 0, 'title' => '', 'vin' => '', 'cor' => '', 'address' => ''],
|
||||
'feesTypeAry' => $this->mdTransfer->feesTypeAry(), 'feesBizList' => [], 'uidTypeAry' => $this->mdTransfer->uidTypeAry()];
|
||||
$info = ['id' => 0, 'status' => -1, 'item_id' => 0, 'arti_id' => [], 'out_bak' => 0, 'in_bak' => 0, 'trailer_fees' => '', 'fees_city' => '', 'trailer_fees' => 0,
|
||||
$info = ['id' => 0, 'status' => -1, 'item_id' => 0, 'arti_id' => [], 'out_bak' => 0, 'in_bak' => 0, 'settlement' => 0, 'trailer_fees' => '', 'fees_city' => '', 'trailer_fees' => 0,
|
||||
'fees_type' => 1, 'fees_biz_id' => '', 'transport' => ['name' => '', 'mobile' => '', 'cardid' => ''], 'reason' => ''];
|
||||
$this->data['transports'] = $this->transports(['type' => 'get']);//运输人员
|
||||
$this->data['showInfo'] = $showInfo;
|
||||
@@ -425,6 +429,7 @@ class Transfer extends HD_Controller
|
||||
$info = ['id' => $id, 'status' => $re['status'], 'out_bak' => 0, 'in_bak' => 0
|
||||
, 'item_id' => $item_id
|
||||
, 'arti_id' => $re['arti_id'] ? explode(',', $re['arti_id']) : []
|
||||
, 'settlement' => in_array('settlement', array_keys($jsondata)) ? $jsondata['settlement'] : ''
|
||||
, 'trailer_fees' => $re['trailer_fees'] ? $re['trailer_fees'] : ''
|
||||
, 'fees_city' => $re['fees_city'] ? $re['fees_city'] : ''
|
||||
, 'fees_type' => $re['fees_type']
|
||||
@@ -519,6 +524,24 @@ class Transfer extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '短信提醒成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 货物物流信息测试
|
||||
* @return array
|
||||
*/
|
||||
public function get_aliwuliu(){
|
||||
$no = $this->input->get('no');
|
||||
/*if (!$no) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '快递单号不能为空【顺丰和丰网请输入单号 : 收件人或寄件人手机号后四位。例如:123456789:1234】');
|
||||
}*/
|
||||
$type = $this->input->get('type');
|
||||
|
||||
$this->load->library('AliWuliu');
|
||||
$res = $this->aliwuliu->kdi($no, $type, $debug=false);
|
||||
print(json_encode($res));
|
||||
#var_dump($res);var_dump($res['status']);var_dump($res['msg']);
|
||||
#var_dump($res['result']['number']);var_dump($res['result']['type']);var_dump($res['result']['deliverystatus']);var_dump($res['result']['issign']);var_dump($res['result']['expName']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改调拨
|
||||
* @return bool
|
||||
@@ -527,15 +550,22 @@ class Transfer extends HD_Controller
|
||||
{
|
||||
$info = $this->input->post('info');
|
||||
$takeCar = $this->input->post('takeCar');
|
||||
$settlement = $info['settlement'];
|
||||
if ($settlement == '' && $settlement != '0'){
|
||||
return $this->show_json(SYS_CODE_FAIL, '调拨结算价不能为空!');
|
||||
}
|
||||
$settlement = intval($settlement);
|
||||
$trailer_fees = intval($info['trailer_fees']);
|
||||
$remind = $info['remind'];//1提交
|
||||
$db_status = -1;
|
||||
$db_status_not2_flag = true;
|
||||
$jsondata_old = array();
|
||||
if ($info['id']) {//修改调拨
|
||||
$re_t = $this->mdTransfer->get(array('id' => $info['id']));
|
||||
if (!$re_t || empty($re_t)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '车辆调拨不存在!');
|
||||
}
|
||||
$jsondata_old = $re_t['jsondata'] ? json_decode($re_t['jsondata'], true) : [];
|
||||
$db_status = $re_t['status'];
|
||||
if ($db_status == 2) {
|
||||
$db_status_not2_flag = false; // 2022.12.20 “确认接车”状态的数据,修改提交后:不改状态,不发短信
|
||||
@@ -593,7 +623,18 @@ class Transfer extends HD_Controller
|
||||
if ($re && $re['id'] != $info['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '操作失败,车辆正在调拨中...');
|
||||
}
|
||||
$jsondata['transport'] = $info['transport'];//运输人员
|
||||
$jsondata['settlement'] = $settlement;
|
||||
if ($info['id']){
|
||||
# 23.04.20修复:修改时丢失除"name", "cardid", "mobile"数据情况
|
||||
$transport = $jsondata_old['transport'] ? $jsondata_old['transport'] : [];
|
||||
$transport['name'] = $info['transport']['name'];
|
||||
$transport['cardid'] = $info['transport']['cardid'];
|
||||
$transport['mobile'] = $info['transport']['mobile'];
|
||||
$jsondata['transport'] = $transport;
|
||||
}
|
||||
else{
|
||||
$jsondata['transport'] = $info['transport'];//运输人员
|
||||
}
|
||||
$jsondata['reason'] = $info['reason'];//调拨理由
|
||||
$c_time = time();
|
||||
if ($takeCar[3]['type'] == 2) {//接收信息员
|
||||
@@ -1001,6 +1042,7 @@ class Transfer extends HD_Controller
|
||||
$temp['in_addr_name'] = $value['in_addr_name'];
|
||||
$temp['abnormal'] = $value['abnormal'];
|
||||
$temp['status_name'] = $value['status_name'];
|
||||
$temp['settlement'] = $value['settlement'];
|
||||
$temp['trailer_fees'] = $value['trailer_fees'];
|
||||
$temp['fees'] = $value['fees'];
|
||||
$temp['reason'] = $value['reason'];
|
||||
@@ -1018,6 +1060,7 @@ class Transfer extends HD_Controller
|
||||
'in_addr_name' => '存放地址',
|
||||
"abnormal" => "异常",
|
||||
"status_name" => "状态",
|
||||
"settlement" => "调拨结算价",
|
||||
"trailer_fees" => "运输费用",
|
||||
"fees" => "费用承担方",
|
||||
"reason" => "调拔理由",
|
||||
|
||||
@@ -32,8 +32,16 @@ class Goods extends HD_Controller
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$this->data = $this->dataSelect($params);
|
||||
$view = $this->data['view'];
|
||||
return $this->show_view($view, true);
|
||||
}
|
||||
|
||||
private function dataSelect($params){
|
||||
$page = $params['page'];
|
||||
$size = $params['size'];
|
||||
$where = array('id<>1' => null, 'status>' => 0);
|
||||
$where_1 = $where_2 = $where_3 = array('m.id<>1' => null);
|
||||
$autoList = array();
|
||||
@@ -58,14 +66,24 @@ class Goods extends HD_Controller
|
||||
$where_1['brand_id'] = $params['brand_id'];
|
||||
$where_2['m.brand_id'] = $params['brand_id'];
|
||||
$where_3['m.brand_id'] = $params['brand_id'];
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
if (1 == $params['sold']){
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
else{
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
}
|
||||
if ($params['s_id']) {
|
||||
$where['s_id'] = $params['s_id'];
|
||||
$where_1['s_id'] = $params['s_id'];
|
||||
$where_2['m.s_id'] = $params['s_id'];
|
||||
$where_3['m.s_id'] = $params['s_id'];
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
if (1 == $params['sold']){
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status > -1' => null, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
}
|
||||
else{
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
}
|
||||
}
|
||||
if ($params['v_id']) {
|
||||
$where['v_id'] = $params['v_id'];
|
||||
@@ -148,6 +166,10 @@ class Goods extends HD_Controller
|
||||
$where_3["m.bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$view = '/items/goods/lists_sold';
|
||||
$_title = '已售车辆';
|
||||
$where['brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_1['brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_2['m.brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_3['m.brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
} else {
|
||||
$where["bill_time"] = '0000-00-00 00:00:00';
|
||||
$where_1["m.bill_time"] = '0000-00-00 00:00:00';
|
||||
@@ -155,6 +177,10 @@ class Goods extends HD_Controller
|
||||
$where_3["m.bill_time"] = '0000-00-00 00:00:00';
|
||||
$view = '/items/goods/lists';
|
||||
$_title = '库存车辆';
|
||||
$where['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_1['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_2['m.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_3['m.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
}
|
||||
|
||||
if ($params['vin']) {
|
||||
@@ -223,7 +249,14 @@ class Goods extends HD_Controller
|
||||
$params['sort'] = $sort;
|
||||
}
|
||||
|
||||
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
#$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
if (1 == $params['sold']){
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
}
|
||||
else{
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status = 1' => null), false);
|
||||
}
|
||||
|
||||
switch ($search_type) {
|
||||
case 1://精品筛选
|
||||
$count = $this->mdItems->count_fine($where_1);
|
||||
@@ -288,7 +321,8 @@ class Goods extends HD_Controller
|
||||
$map_item_fine[$v['item_id']][] = $v['type_id'];
|
||||
}
|
||||
//已售商品订单信息
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
//$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
$this->load->model('receiver/order/receiver_orders_v2_model', 'orders_model');
|
||||
$str_ids = implode(',', $items_info['ids']);
|
||||
$where = array("item_id in ({$str_ids})" => null);
|
||||
$rows_order = $this->orders_model->select($where, 'id desc', 0, 0, 'item_id, admin_id, name, mobile');
|
||||
@@ -387,7 +421,8 @@ class Goods extends HD_Controller
|
||||
$this->data['autoList'] = $autoList;
|
||||
$this->data['statusAry'] = $statusAry;
|
||||
$this->data['_title'] = $_title;
|
||||
return $this->show_view($view, true);
|
||||
$this->data['view'] = $view;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function get()
|
||||
@@ -397,6 +432,7 @@ class Goods extends HD_Controller
|
||||
$info['company_id'] = $info['brand_id'] = $info['s_id'] = $info['v_id'] = $info['cor_id'] = $info['incor_id'] = 0;
|
||||
$info['if_pack'] = $info['city_id'] = $info['county_id'] = $info['biz_id'] = $info['addr_id'] = '';
|
||||
$info['status'] = 1;
|
||||
$info['option_ids'] = [];
|
||||
$autoList[2] = $autoList[3] = $autoList[4] = $autoList[5] = array();
|
||||
$comList = $this->sys_company_model->select(['status' => 1], '', '', '', 'id,short');
|
||||
if ($id > 0) {
|
||||
@@ -405,6 +441,7 @@ class Goods extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_FAIL, '商品不存在!');
|
||||
}
|
||||
$info = $re;
|
||||
$info['option_ids'] = $info['option_ids'] ? json_decode($info['option_ids'],true) : [];
|
||||
$info['pro_time'] = $re['pro_time'] != '0000-00-00 00:00:00' ? $re['pro_time'] : '';
|
||||
$info['in_time'] = $re['in_time'] != '0000-00-00 00:00:00' ? $re['in_time'] : '';
|
||||
$info['out_time'] = $re['out_time'] != '0000-00-00 00:00:00' ? $re['out_time'] : '';
|
||||
@@ -445,9 +482,14 @@ class Goods extends HD_Controller
|
||||
$info['in_time'] = date('Y-m-d H:i:s');
|
||||
$_title = '新增商品';
|
||||
$edit_url = '/items/goods/goods/add';
|
||||
$where_auto = ['status>' => -1];
|
||||
}
|
||||
|
||||
if ($this->input->get('sold') != 1){
|
||||
$where_auto = ['status' => 1];
|
||||
}
|
||||
$autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name');
|
||||
#$autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand($where_auto, false);
|
||||
$showInfo['autoList'] = $autoList;
|
||||
$showInfo['comList'] = $comList;
|
||||
$showInfo['statusAry'] = $this->statusAry;
|
||||
@@ -485,6 +527,7 @@ class Goods extends HD_Controller
|
||||
$info['dis_price'] = $re['dis_price'] . '元';
|
||||
$info['bill_price'] = $re['bill_price'] . '元';
|
||||
$info['buy_price'] = $re['buy_price'] . '元';
|
||||
$info['estimated_rebate'] = $re['estimated_rebate'] . '元';
|
||||
$info['discount'] = $re['discount'] ? $re['discount'] . '%' : '100%';
|
||||
$info['pro_time'] = $re['pro_time'] != '0000-00-00 00:00:00' ? $re['pro_time'] : '';
|
||||
$info['in_time'] = $re['in_time'] != '0000-00-00 00:00:00' ? $re['in_time'] : '';
|
||||
@@ -537,6 +580,8 @@ class Goods extends HD_Controller
|
||||
$msg = '请选择入库时间';
|
||||
} else if (!$info['company_id']) {
|
||||
$msg = '请选择公司归属';
|
||||
//} else if (!$info['buy_price'] || $info['buy_price'] <= 0.0) {
|
||||
// $msg = '请输入采购成本'; // 23.06.01 采购成本再改成 非必填
|
||||
} else {
|
||||
$code = SYS_CODE_SUCCESS;
|
||||
}
|
||||
@@ -580,6 +625,7 @@ class Goods extends HD_Controller
|
||||
$addData['bill_num'] = $info['bill_num'] ? $info['bill_num'] : '';
|
||||
$addData['bill_price'] = $info['bill_price'] ? $info['bill_price'] : 0.00;
|
||||
$addData['buy_price'] = $info['buy_price'] ? $info['buy_price'] : 0.00;
|
||||
$addData['estimated_rebate'] = $info['estimated_rebate'] ? $info['estimated_rebate'] : 0.00;
|
||||
|
||||
$addData['pro_time'] = $info['pro_time'] ? $info['pro_time'] : '0000-00-00 00:00:00';
|
||||
$addData['in_time'] = $info['in_time'] ? $info['in_time'] : date('Y-m-d H:i:s');
|
||||
@@ -594,6 +640,7 @@ class Goods extends HD_Controller
|
||||
}
|
||||
$addData['biz_id'] = $biz_id;
|
||||
$addData['addr_id'] = $addr_id;
|
||||
$addData['option_ids'] = $info['option_ids'] ? json_encode($info['option_ids']) : json_encode([]);
|
||||
$id = $this->mdItems->add($addData);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '添加失败!');
|
||||
@@ -750,7 +797,8 @@ class Goods extends HD_Controller
|
||||
$editData['dis_price'] = $info['dis_price'];
|
||||
$editData['bill_num'] = $info['bill_num'];
|
||||
$editData['bill_price'] = $info['bill_price'];
|
||||
$editData['buy_price'] = $info['buy_price'];
|
||||
$editData['buy_price'] = $info['buy_price'] ? $info['buy_price'] : 0;
|
||||
$editData['estimated_rebate'] = $info['estimated_rebate'] ? $info['estimated_rebate'] : 0;
|
||||
|
||||
$editData['pro_time'] = $info['pro_time'];
|
||||
$editData['in_time'] = $info['in_time'];
|
||||
@@ -766,6 +814,7 @@ class Goods extends HD_Controller
|
||||
}
|
||||
$editData['biz_id'] = $biz_id;
|
||||
$editData['addr_id'] = $addr_id;
|
||||
$editData['option_ids'] = $info['option_ids'] ? json_encode($info['option_ids']) : json_encode([]);
|
||||
$ret = $this->mdItems->update($editData, array('id' => $info['id']));
|
||||
if (!$ret) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '修改失败!');
|
||||
@@ -932,6 +981,402 @@ class Goods extends HD_Controller
|
||||
$where_3['m.status >'] = 0;
|
||||
}
|
||||
|
||||
if (1 == $params['sold']) {//已售
|
||||
$where["bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$where_1["m.bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$where_2["m.bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$where_3["m.bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$where['brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_1['brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_2['m.brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
$where_3['m.brand_id in (select id from lc_auto_brand where status >- 1)'] = null;
|
||||
} else {
|
||||
$where["bill_time"] = '0000-00-00 00:00:00';
|
||||
$where_1["m.bill_time"] = '0000-00-00 00:00:00';
|
||||
$where_2["m.bill_time"] = '0000-00-00 00:00:00';
|
||||
$where_3["m.bill_time"] = '0000-00-00 00:00:00';
|
||||
$where['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_1['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_2['m.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$where_3['m.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
}
|
||||
|
||||
if ($params['vin']) {
|
||||
$where["vin like '%{$params['vin']}%'"] = null;
|
||||
$where_1["m.vin like '%{$params['vin']}%'"] = null;
|
||||
$where_2["m.vin like '%{$params['vin']}%'"] = null;
|
||||
$where_3["m.vin like '%{$params['vin']}%'"] = null;
|
||||
}
|
||||
//精品筛选
|
||||
if ($params['fine_ids']) {
|
||||
$fine_num = substr_count($params['fine_ids'], ',') + 1;
|
||||
$where_1["j.type_id in ({$params['fine_ids']})"] = null;
|
||||
$where_1["having"] = "fine_num={$fine_num}";
|
||||
$where_2["j2.type_id in ({$params['fine_ids']})"] = null;
|
||||
$where_2["having"] = "fine_num={$fine_num}";
|
||||
$search_type = 0 == $search_type || 1 == $search_type ? 1 : 3;
|
||||
} else {
|
||||
$params['fine_ids'] = '';
|
||||
}
|
||||
//是否选入精品
|
||||
if (strlen($params['is_fine']) > 0) {
|
||||
if (1 == $params['is_fine']) {
|
||||
$where_1["j.type_id>0"] = null;
|
||||
$where_1["having"] = "fine_num>0";
|
||||
$where_3["j2.type_id>0"] = null;
|
||||
$where_3["having"] = "fine_num>0";
|
||||
} else {
|
||||
$where_1["j.type_id is null"] = null;
|
||||
$where_3["j2.type_id is null"] = null;
|
||||
}
|
||||
$search_type = 0 == $search_type || 1 == $search_type ? 1 : 3;
|
||||
} else {
|
||||
$params['is_fine'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$search_type = 0 == $search_type || 2 == $search_type ? 2 : 3;
|
||||
$where_2['j.admin_id'] = $params['admin_id'];
|
||||
$where_3['j.admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$params['city_id_admin'] = '';
|
||||
$params['county_id_admin'] = '';
|
||||
$params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$order = 'id';
|
||||
if ('fine_num' == $params['order']) {//精品标签数排序
|
||||
$order = $params['order'];
|
||||
$search_type = 0 == $search_type || 1 == $search_type ? 1 : 3;
|
||||
} else if ('admin_id' == $params['order']) {//销售员ID排序
|
||||
$order = $params['order'];
|
||||
$search_type = 0 == $search_type || 2 == $search_type ? 2 : 3;
|
||||
} else if ('sold_time' == $params['order']) {//售卖时间排序
|
||||
$order = 'bill_time';
|
||||
} else if ($params['order']) {
|
||||
$order = $params['order'];
|
||||
} else {
|
||||
$params['order'] = $order;
|
||||
}
|
||||
$sort = 'desc';
|
||||
if ($params['sort']) {
|
||||
$sort = $params['sort'];
|
||||
} else {
|
||||
$params['sort'] = $sort;
|
||||
}
|
||||
|
||||
#$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
if (1 == $params['sold']){
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
}
|
||||
else{
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status = 1' => null), false);
|
||||
}
|
||||
|
||||
switch ($search_type) {
|
||||
case 1://精品筛选
|
||||
$count = $this->mdItems->count_fine($where_1);
|
||||
break;
|
||||
case 2://订单筛选
|
||||
$count = $this->mdItems->count_order($where_2);
|
||||
break;
|
||||
case 3://精品+订单筛选
|
||||
$count = $this->mdItems->count_order_fine($where_3);
|
||||
break;
|
||||
default:
|
||||
$count = $this->mdItems->count($where);
|
||||
}
|
||||
|
||||
if ($count > 10000) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据量超过1w导出太为难我了');
|
||||
} else if (0 == $count) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '当前没有数据');
|
||||
}
|
||||
|
||||
$fileName = "车辆明细";
|
||||
$indexs = array(
|
||||
'id' => 'ID',
|
||||
'brand_name' => '品牌',
|
||||
's_name' => '车系',
|
||||
'v_name' => '车型',
|
||||
'cor_name' => '车身颜色',
|
||||
'incor_name' => '内饰颜色',
|
||||
'ori_price' => '指导价',
|
||||
'sale_price' => '售价',
|
||||
'bill_price' => '开票金额',
|
||||
'buy_price' => '采购成本',
|
||||
'estimated_rebate' => '预估返利',
|
||||
'dis_price' => '折扣价',
|
||||
'discount' => '折扣百分比',
|
||||
'city_name' => '城市名',
|
||||
'county_name' => '行政区',
|
||||
'address' => '存放地址',
|
||||
'vin' => '车架号',
|
||||
'engine_num' => '发动机号',
|
||||
'stdard_num' => '合格证号',
|
||||
'bill_num' => '开票号',
|
||||
'auto_fine' => '精品加装',
|
||||
'company_name' => '公司归属',
|
||||
'status' => '状态',
|
||||
'in_time' => '入库时间',
|
||||
'out_time' => '出库时间',
|
||||
'bill_time' => '开票时间',
|
||||
);
|
||||
|
||||
$lists = array();
|
||||
$fine_ids = array();
|
||||
if ($count) {
|
||||
switch ($search_type) {
|
||||
case 1://精品筛选
|
||||
$fileds = 'm.*,count(type_id) as fine_num';
|
||||
$orderby = "{$order} {$sort}";
|
||||
$rows = $this->mdItems->select_fine($where_1, $orderby, 0, 0, $fileds);
|
||||
break;
|
||||
case 2://订单筛选
|
||||
$fileds = 'm.*';
|
||||
$orderby = "{$order} {$sort}";
|
||||
$rows = $this->mdItems->select_order($where_2, $orderby, 0, 0, $fileds);
|
||||
break;
|
||||
case 3://精品+订单筛选
|
||||
$fileds = 'm.*, count(j2.type_id) as fine_num';
|
||||
if (in_array($order, array('admin_id'))) {
|
||||
$orderby = "{$order} {$sort}";
|
||||
} else {
|
||||
$orderby = "m.{$order} {$sort}";
|
||||
}
|
||||
$rows = $this->mdItems->select_order_fine($where_3, $orderby, 0, 0, $fileds);
|
||||
break;
|
||||
default:
|
||||
$fileds = '*';
|
||||
$orderby = "{$order} {$sort}";
|
||||
$rows = $this->mdItems->select($where, $orderby, 0, 0, $fileds);
|
||||
}
|
||||
|
||||
$lists[] = $indexs;
|
||||
$company_ids = $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array();
|
||||
$ids = array();
|
||||
foreach ($rows as $v) {
|
||||
$ids[] = $v['id'];
|
||||
$v['brand_id'] && !in_array($v['brand_id'], $brand_ids) && $brand_ids[] = $v['brand_id'];
|
||||
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
|
||||
$v['addr_id'] && !in_array($v['addr_id'], $addr_ids) && $addr_ids[] = $v['addr_id'];
|
||||
$v['s_id'] && !in_array($v['s_id'], $s_ids) && $s_ids[] = $v['s_id'];
|
||||
$v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id'];
|
||||
$v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id'];
|
||||
$v['incor_id'] && !in_array($v['incor_id'], $attr_incorids) && $attr_incorids[] = $v['incor_id'];
|
||||
$v['company_id'] && !in_array($v['company_id'], $company_ids) && $company_ids[] = $v['company_id'];
|
||||
}
|
||||
|
||||
$map_company = $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
|
||||
if ($brand_ids) {
|
||||
$str_ids = implode(',', $brand_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_brand = $this->mdAutoBrand->map('id', 'name', $where);
|
||||
}
|
||||
if ($s_ids) {
|
||||
$str_ids = implode(',', $s_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_sery = $this->mdAutoSeries->map('id', 'name', $where);
|
||||
}
|
||||
if ($attr_vids) {
|
||||
$str_ids = implode(',', $attr_vids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_vid = $this->mdAutoAttr->map('id', 'title', $where);
|
||||
}
|
||||
if ($attr_corids) {
|
||||
$str_ids = implode(',', $attr_corids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_corid = $this->mdAutoAttr->map('id', 'title', $where);
|
||||
}
|
||||
if ($attr_incorids) {
|
||||
$str_ids = implode(',', $attr_incorids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_incorid = $this->mdAutoAttr->map('id', 'title', $where);
|
||||
}
|
||||
if ($biz_ids) {
|
||||
$str_ids = implode(',', $biz_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_biz = $this->mdBiz->map('id', 'biz_name', $where);
|
||||
}
|
||||
if ($addr_ids) {
|
||||
$str_ids = implode(',', $addr_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$orderby = 'id desc';
|
||||
$select = 'id, title, city_name, county_name';
|
||||
$map_addr = $this->addr_model->map('id', '*', $where, $orderby, 0, 0, $select);
|
||||
}
|
||||
if ($company_ids) {
|
||||
$str_ids = implode(',', $company_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_company = $this->sys_company_model->map('id', 'short', $where);
|
||||
}
|
||||
//获取精品加装
|
||||
$str_ids = implode(',', $ids);
|
||||
$where = array("item_id in ({$str_ids})" => null, 'type' => 1, 'status' => 1);
|
||||
$rows_fine = $this->items_relate_model->select($where, '', 0, 0, 'item_id, type_id');
|
||||
$map_item_fine = array();//按item_id分组所属精品ID
|
||||
foreach ($rows_fine as $v) {
|
||||
!in_array($v['type_id'], $fine_ids) && $fine_ids[] = $v['type_id'];
|
||||
$map_item_fine[$v['item_id']][] = $v['type_id'];
|
||||
}
|
||||
//获取精品ID和名称映射
|
||||
$map_fine = array();
|
||||
if ($fine_ids) {
|
||||
$this->load->model('auto/auto_fine_model');
|
||||
$str_ids = implode(',', $fine_ids);
|
||||
$where = array("id in ({$str_ids})" => null);
|
||||
$map_fine = $this->auto_fine_model->map('id', 'title', $where);
|
||||
}
|
||||
|
||||
foreach ($rows as $v) {
|
||||
//获取并组装精品信息
|
||||
$fine_ids = $map_item_fine[$v['id']];
|
||||
$auto_fine = '';
|
||||
if ($fine_ids) {
|
||||
foreach ($fine_ids as $fine_id) {
|
||||
$auto_fine = $auto_fine ? "{$auto_fine} {$map_fine[$fine_id]}" : $map_fine[$fine_id];
|
||||
}
|
||||
}
|
||||
$addr = array();
|
||||
if ($v['biz_id'] > 0) {
|
||||
$re_biz = $this->mdBiz->get(array('id' => $v['biz_id']));
|
||||
if ($re_biz['county_id']) {
|
||||
$re_area = $this->mdArea->get(array('county_id' => $re_biz['county_id']));
|
||||
if ($re_area) {
|
||||
$addr = array('city_name' => $re_area['city_name'], 'county_name' => $re_area['county_name']
|
||||
, 'title' => $map_biz[$v['biz_id']]);
|
||||
}
|
||||
} else if ($re_biz['city_id']) {
|
||||
$re_area = $this->mdArea->get(array('city_id' => $re_biz['city_id']));
|
||||
if ($re_area) {
|
||||
$addr = array('city_name' => $re_area['city_name'], 'title' => $map_biz[$v['biz_id']]);
|
||||
}
|
||||
}
|
||||
} else if ($v['biz_id'] == -1 && $v['addr_id']) {
|
||||
$addr = $map_addr[$v['addr_id']];
|
||||
}
|
||||
$lists[] = array(
|
||||
'id' => $v['id'],
|
||||
'brand_name' => $map_brand[$v['brand_id']],
|
||||
's_name' => $map_sery[$v['s_id']],
|
||||
'v_name' => $map_vid[$v['v_id']],
|
||||
'cor_name' => $map_corid[$v['cor_id']],
|
||||
'incor_name' => $map_incorid[$v['incor_id']],
|
||||
'ori_price' => $v['ori_price'],
|
||||
'sale_price' => $v['sale_price'],
|
||||
'bill_price' => $v['bill_price'],
|
||||
'buy_price' => $v['buy_price'],
|
||||
'estimated_rebate' => $v['estimated_rebate'],
|
||||
'dis_price' => $v['dis_price'],
|
||||
'discount' => $v['discount'],
|
||||
'city_name' => $addr ? $addr['city_name'] : '',
|
||||
'county_name' => $addr ? $addr['county_name'] : '',
|
||||
'address' => $addr ? $addr['title'] : '',
|
||||
'vin' => $v['vin'],
|
||||
'engine_num' => $v['engine_num'],
|
||||
'stdard_num' => $v['stdard_num'],
|
||||
'bill_num' => $v['bill_num'],
|
||||
'auto_fine' => $auto_fine,
|
||||
'company_name' => $map_company[$v['company_id']],
|
||||
'status' => $this->statusAry[$v['status']],
|
||||
'in_time' => '0000-00-00 00:00:00' == $v['in_time'] ? '' : $v['in_time'],
|
||||
'out_time' => '0000-00-00 00:00:00' == $v['out_time'] ? '' : $v['out_time'],
|
||||
'bill_time' => '0000-00-00 00:00:00' == $v['bill_time'] ? '' : $v['bill_time'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($lists, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
|
||||
return 1;
|
||||
}
|
||||
public function export_()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$where = $where_1 = $where_2 = $where_3 = $autoList = array();
|
||||
$search_type = 0;//0不连表,1联表筛选精品,2联表筛选销售,3联表筛选精品和销售
|
||||
if ($params['brand_id']) {
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
$where_1['brand_id'] = $params['brand_id'];
|
||||
$where_2['m.brand_id'] = $params['brand_id'];
|
||||
$where_3['m.brand_id'] = $params['brand_id'];
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
if ($params['s_id']) {
|
||||
$where['s_id'] = $params['s_id'];
|
||||
$where_1['s_id'] = $params['s_id'];
|
||||
$where_2['m.s_id'] = $params['s_id'];
|
||||
$where_3['m.s_id'] = $params['s_id'];
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
}
|
||||
if ($params['v_id']) {
|
||||
$where['v_id'] = $params['v_id'];
|
||||
$where_1['v_id'] = $params['v_id'];
|
||||
$where_2['m.v_id'] = $params['v_id'];
|
||||
$where_3['m.v_id'] = $params['v_id'];
|
||||
}
|
||||
//车身颜色
|
||||
if ($params['cor_id']) {
|
||||
$where['cor_id'] = $params['cor_id'];
|
||||
$where_1['cor_id'] = $params['cor_id'];
|
||||
$where_2['m.cor_id'] = $params['cor_id'];
|
||||
$where_3['m.cor_id'] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//地址筛选
|
||||
if ($params['biz_id']) {
|
||||
$where['biz_id'] = $params['biz_id'];
|
||||
$where_1['biz_id'] = $params['biz_id'];
|
||||
$where_2['m.biz_id'] = $params['biz_id'];
|
||||
$where_3['m.biz_id'] = $params['biz_id'];
|
||||
}
|
||||
if ($params['biz_id'] == -1 && $params['addr_id']) {
|
||||
$where['addr_id'] = $params['addr_id'];
|
||||
$where_1['addr_id'] = $params['addr_id'];
|
||||
$where_2['m.addr_id'] = $params['addr_id'];
|
||||
$where_3['m.addr_id'] = $params['addr_id'];
|
||||
} else if ($params['city_id']) {
|
||||
$where_biz['status'] = 1;
|
||||
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
|
||||
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
|
||||
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($res_biz) {
|
||||
$str_ids = implode(',', array_column($res_biz, 'id'));
|
||||
$where["biz_id in ({$str_ids})"] = null;
|
||||
$where_1["biz_id in ({$str_ids})"] = null;
|
||||
$where_2["m.biz_id in ({$str_ids})"] = null;
|
||||
$where_3["m.biz_id in ({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['biz_id'] = -2;
|
||||
$where_1['biz_id'] = -2;
|
||||
$where_2['m.biz_id'] = -2;
|
||||
$where_3['m.biz_id'] = -2;
|
||||
}
|
||||
} else {
|
||||
$params['city_id'] = '';
|
||||
$params['county_id'] = '';
|
||||
$params['addr_id'] = '';
|
||||
$params['biz_id'] = '';
|
||||
}
|
||||
|
||||
if (strlen($params['status']) > 0) {
|
||||
$where['status'] = $params['status'];
|
||||
$where_1['m.status'] = $params['status'];
|
||||
$where_2['m.status'] = $params['status'];
|
||||
$where_3['m.status'] = $params['status'];
|
||||
} else {
|
||||
$params['status'] = '';
|
||||
$where['status >'] = 0;
|
||||
$where_1['m.status >'] = 0;
|
||||
$where_2['m.status >'] = 0;
|
||||
$where_3['m.status >'] = 0;
|
||||
}
|
||||
|
||||
if (1 == $params['sold']) {//已售
|
||||
$where["bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
$where_1["m.bill_time<>'0000-00-00 00:00:00'"] = null;
|
||||
@@ -1233,6 +1678,7 @@ class Goods extends HD_Controller
|
||||
$this->load->model('items/items_oplogs_model', 'mdItemsOplogs');
|
||||
$fileName = '超期车辆';
|
||||
$where = ['status<>' => 0, 'bill_time' => '0000-00-00 00:00:00'];
|
||||
$where['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
|
||||
$res = $this->mdItems->select($where, 'id asc', 1, 5000, 'brand_id,biz_id,addr_id,s_id,v_id,cor_id,incor_id,company_id,id,vin,in_time,status');
|
||||
$data = $list = [];
|
||||
foreach ($res as $key => $value) {
|
||||
|
||||
@@ -43,13 +43,14 @@ class Logs extends HD_Controller
|
||||
{
|
||||
$lists = $autoList = array();
|
||||
$where = array('id<>1' => null, 'status>' => 0);
|
||||
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
if ($params['brand_id']) {
|
||||
$where['brand_id'] = $params['brand_id'];
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
$autoList[2] = $this->mdAutoSeries->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
|
||||
}
|
||||
if ($params['s_id']) {
|
||||
$where['s_id'] = $params['s_id'];
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
$autoList[3] = $this->mdAutoAttr->select(array('status > -1' => null,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
|
||||
}
|
||||
if ($params['v_id']) {
|
||||
$where['v_id'] = $params['v_id'];
|
||||
@@ -98,7 +99,8 @@ class Logs extends HD_Controller
|
||||
} else {
|
||||
$params['sold'] = '';
|
||||
}
|
||||
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
//$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
$statusAry = $this->statusAry;
|
||||
$soldAry = $this->soldAry;
|
||||
$count = $this->mdItems->count($where);
|
||||
|
||||
@@ -185,7 +185,12 @@ class Clues extends HD_Controller
|
||||
}
|
||||
$dataInfo['editType'] = 0;
|
||||
$re_cf = $this->clues_cfrom_model->get(array('id' => $re['cf_id']));
|
||||
$info_show['cfrom_title'] = $re_cf['title'] ? $re_cf['title'] : '';
|
||||
$re_cf_title_p = '';
|
||||
if ($re_cf && $re_cf['pid']){
|
||||
$re_cf_pid = $this->clues_cfrom_model->get(array('id' => $re_cf['pid']));
|
||||
$re_cf_title_p = $re_cf_pid['title'] ? $re_cf_pid['title'].'-' : '';
|
||||
}
|
||||
$info_show['cfrom_title'] = $re_cf['title'] ? $re_cf_title_p.$re_cf['title'] : '';
|
||||
$info_show['statusList'] = $statusList;
|
||||
$info_show['status2List'] = $status2List;
|
||||
$info_show['c_time'] = date('Y-m-d H:i', $re['c_time']);
|
||||
@@ -209,6 +214,13 @@ class Clues extends HD_Controller
|
||||
if ($row['duration']) {
|
||||
$rec_url = $row['rec_url'] ? build_qiniu_image_url($row['rec_url'], 0, 0, 'video') : '';
|
||||
$rec_text = '录音文件未生成';
|
||||
}else{
|
||||
$jsondata = json_decode($row['json_data'],true);
|
||||
if($row['c_time']>strtotime('2023-03-21 13:00:00')){
|
||||
$rec_text = $this->mdReceiverXz->get_xz_status($jsondata['status']);
|
||||
$answer_text = $this->mdReceiverXz->get_xz_noAnswerReason($jsondata['noAnswerReason']);
|
||||
$answer_text && $rec_text .= "($answer_text)";
|
||||
}
|
||||
}
|
||||
}
|
||||
$setValue['rec_url'] = $rec_url;
|
||||
@@ -239,7 +251,9 @@ class Clues extends HD_Controller
|
||||
if ($re['lat'] && $re['lng']) {
|
||||
$info_show['near_bizs'] = $this->biz_model->nearby($re['lat'], $re['lng'], 1, 3, 'id,biz_name');
|
||||
} else {
|
||||
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], "type in ($type_ids)" => null, 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
|
||||
}
|
||||
//获取分销用户
|
||||
$cf_user = '';
|
||||
@@ -563,6 +577,9 @@ class Clues extends HD_Controller
|
||||
];
|
||||
$city_id && $where['city_id'] = $city_id;
|
||||
$county_id && $where['county_id'] = $county_id;
|
||||
$typeAry = $this->biz_model->type_ary();
|
||||
$type_ids = implode(',',array_keys($typeAry));
|
||||
$type_ids && $where["type in ($type_ids)"] = null;
|
||||
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
|
||||
$this->data['bizList'] = $bizList;
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class CluesCfrom extends HD_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
|
||||
}
|
||||
|
||||
//首页信息
|
||||
public function index()
|
||||
{
|
||||
return $this->lists();
|
||||
}
|
||||
|
||||
//数据列表
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$lists = [];
|
||||
$where = ["status<>" => -1, 'pid' => 0];
|
||||
if (strlen($params['status'])) {
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["title like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
$count = $this->mdCluesCfrom->count($where);
|
||||
if ($count) {
|
||||
$res = $this->mdCluesCfrom->select($where, "sort desc,id desc", $params['page'], $params['size']);
|
||||
foreach ($res as $key => $value) {
|
||||
$setValue = [];
|
||||
$setValue['id'] = $value['id'];
|
||||
$setValue['name'] = $value['title'];
|
||||
$setValue['sort'] = $value['sort'];
|
||||
$setValue['status'] = $value['status'];
|
||||
$setValue['status_name'] = $value['status'] == 1 ? '正常' : '禁用';
|
||||
$options = '';
|
||||
$res_cfrom = $this->mdCluesCfrom->select(["status<>" => -1, 'pid' => $value['id']], "sort desc,id desc", 1, 10, 'title');
|
||||
$res_cfrom && $options = implode(',', array_column($res_cfrom, 'title'));
|
||||
$setValue['options'] = $options;
|
||||
$lists[] = $setValue;
|
||||
}
|
||||
}
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = '线索来源';
|
||||
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
|
||||
return $this->show_view('receiver/cluescfrom/lists', true);
|
||||
}
|
||||
|
||||
public function get_options()
|
||||
{
|
||||
$id = intval($this->input->post('id'));
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$res_tag = $this->mdCluesCfrom->select(["status" => 1, 'pid' => $id], "sort desc,id desc", 0, 0, 'id,title as name,sort,status');
|
||||
$this->data['lists'] = $res_tag;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
//展示单条数据
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
if ($id) {
|
||||
$url = "receiver/CluesCfrom/edit";
|
||||
$re = $this->mdCluesCfrom->get(['id' => $id]);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
$name = $re['title'];
|
||||
$sort = $re['sort'];
|
||||
} else {
|
||||
$url = "receiver/CluesCfrom/add";
|
||||
$sort = 50;
|
||||
$name = '';
|
||||
}
|
||||
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'url' => $url];
|
||||
return $this->show_view('receiver/cluescfrom/edit');
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
if (!$params['name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '名称不能为空!');
|
||||
}
|
||||
$re = $this->mdCluesCfrom->get(['title' => $params['name'], 'pid' => 0, "status<>" => -1]);
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '名称已存在了!');
|
||||
}
|
||||
$id = $this->mdCluesCfrom->add(['title' => $params['name'], 'sort' => $params['sort'], 'c_time' => time()]);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
if (!$params['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
if (!$params['name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入名称');
|
||||
}
|
||||
$re = $this->mdCluesCfrom->get(array('title' => $params['name'], 'pid' => 0, "status<>" => -1));
|
||||
if ($re && $re['id'] != $params['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '名称已存在了!');
|
||||
}
|
||||
$this->mdCluesCfrom->update(['title' => $params['name'], 'sort' => $params['sort']], ['id' => $params['id']]);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
if (!$id) {
|
||||
$this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
$re = $this->mdCluesCfrom->get(['id' => $id]);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
$this->mdCluesCfrom->update(['status' => -1], ['id' => $id]);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
//修改来源选项
|
||||
function edit_options()
|
||||
{
|
||||
$pid = $this->input->post('id');
|
||||
$options = $this->input->post('options');
|
||||
if (!$pid || !$options) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$re = $this->mdCluesCfrom->get(['id' => $pid]);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
|
||||
}
|
||||
foreach ($options as $key => $value) {
|
||||
$sort = intval($value['sort']);
|
||||
$data = ['title' => $value['name'], 'status' => $value['status'], 'sort' => $sort];
|
||||
if ($value['name']) {
|
||||
if ($value['id']) {//修改
|
||||
$this->mdCluesCfrom->update($data, ['id' => $value['id']]);
|
||||
} else {//新增
|
||||
$data['pid'] = $pid;
|
||||
$data['c_time'] = time();
|
||||
$this->mdCluesCfrom->add($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
function edit_status()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$stauts = intval($this->input->post('status'));
|
||||
if (!$id) {
|
||||
$this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
}
|
||||
$this->mdCluesCfrom->update(['status' => $stauts], ['id' => $id]);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取分类信息
|
||||
* Created on: 2023/3/27 17:39
|
||||
* Created by: dengbw
|
||||
* @return bool
|
||||
*/
|
||||
function json_get()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$where = [
|
||||
'status' => 1,
|
||||
'pid' => 0
|
||||
];
|
||||
$id && $where['pid'] = $id;
|
||||
if ($this->role == 37) {
|
||||
!$id && $where['id'] = 36;
|
||||
}
|
||||
$rows = $this->mdCluesCfrom->select($where, 'sort desc,id desc', '', '', 'id,title');
|
||||
$this->data['data'] = $rows;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class Customer extends HD_Controller
|
||||
{
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
|
||||
private $searchTimeAry = array('c_time' => '创建时间', 'p_time' => '分配时间', 'cont_time' => '最后联系时间', 'u_time' => '最后操作时间'
|
||||
, 'dt_time' => '首次到店时间', 'order_time' => '下单时间');
|
||||
, 'dt_time' => '首次到店时间', 'order_time' => '下单时间', 'def_time' => '战败时间');
|
||||
|
||||
protected $log_dir;
|
||||
|
||||
@@ -25,6 +25,9 @@ class Customer extends HD_Controller
|
||||
$this->load->model('receiver/receiver_clues_model', 'clues_model');
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model');
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
$this->load->model('receiver/Receiver_customer_stat_plan_model', 'statplan');
|
||||
$this->load->model('receiver/Receiver_customer_stat_data_model', 'statdata');
|
||||
$this->load->model('receiver/Receiver_customer_stat_data_log_model', 'statdatalog');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
|
||||
@@ -50,8 +53,9 @@ class Customer extends HD_Controller
|
||||
$lists = [];
|
||||
$offlineSources = $this->customers_model->offlineSources();
|
||||
$wxqyAry = $this->customers_model->wxqyAry();
|
||||
$wxgrAry = $this->customers_model->wxgrAry();
|
||||
if ($count) {
|
||||
$fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,level,of_id,of2_id,wxqy';
|
||||
$fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,cs_biz_id,level,of_id,of2_id,wxqy,wxgr';
|
||||
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
//获取销售员
|
||||
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
|
||||
@@ -81,17 +85,28 @@ class Customer extends HD_Controller
|
||||
'of2_id' => $val['of2_id'],
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'wxqy_name' => $wxqyAry[$val['wxqy']],
|
||||
'wxgr_name' => $wxgrAry[$val['wxgr']],
|
||||
'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0),
|
||||
'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '',
|
||||
'biz_name' => isset($biz_rows[$val['biz_id']]) ? $biz_rows[$val['biz_id']][0]['biz_name'] : '',
|
||||
'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '',
|
||||
);
|
||||
}
|
||||
}
|
||||
$tag_data = $params['tags'] ? explode(',', $params['tags']) : '';
|
||||
$show_info['tags'] = $this->get_tag(0, 0, $tag_data);
|
||||
$tag_data = $params['tagsIntention'] ? explode(',', $params['tagsIntention']) : '';
|
||||
$show_info['tagsIntention'] = $this->get_tag(0, 2, $tag_data);
|
||||
$tag_data = $params['tagsDefeat'] ? explode(',', $params['tagsDefeat']) : '';
|
||||
$show_info['tagsDefeat'] = $this->get_tag(0, 1, $tag_data);
|
||||
//渠道经理
|
||||
$qdjl_lists = $this->app_licheb_users_model->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name');
|
||||
$show_info['levelAry'] = $this->customers_model->get_sdata('level');
|
||||
$show_info['offlineSourcesAry'] = $offlineSources;
|
||||
#$show_info['offlineSourcesAry'] = $offlineSources;
|
||||
$show_info['offlineSourcesAry'] = $this->customers_model->offlineSources_search();
|
||||
$show_info['wxqyAry'] = $wxqyAry;
|
||||
$show_info['wxgrAry'] = $wxgrAry;
|
||||
$show_info['csbizidAry'] = $this->customers_model->csbizidAry();
|
||||
$this->data['show_info'] = $show_info;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
@@ -100,19 +115,291 @@ class Customer extends HD_Controller
|
||||
$this->data['params'] = $params;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['qdjl_lists'] = $qdjl_lists;
|
||||
$this->data['export_button'] = $this->uid == 1 ? 1 : 0;
|
||||
$this->data['export_button'] = SUPER_ADMIN == $this->role || in_array($this->uid, array(1, 62, 82)) ? 1 : 0;
|
||||
$this->data['_title'] = '客户列表';
|
||||
return $this->show_view('receiver/customer/lists', true);
|
||||
}
|
||||
|
||||
private function get_where(&$params){
|
||||
public function lists_statplan(){
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
!$params['of_id'] && $params['of_id'] = '';
|
||||
!$params['of2_id'] && $params['of2_id'] = '';
|
||||
!$params['sp_name'] && $params['sp_name'] = '';
|
||||
$where = array();
|
||||
if ($params['of_id']) {
|
||||
$where['of_id'] = $params['of_id'];
|
||||
}
|
||||
if ($params['of2_id']) {
|
||||
$where['of2_id'] = $params['of2_id'];
|
||||
}
|
||||
if ($params['sp_name']) {
|
||||
$where["sp_name like '%{$params['sp_name']}%'"] = null;
|
||||
}
|
||||
|
||||
$count = $this->statplan->count($where);
|
||||
$lists = [];
|
||||
$offlineSources = $this->customers_model->offlineSources();
|
||||
if ($count){
|
||||
$rows = $this->statplan->select($where, 'id desc', $page, $size, '*');
|
||||
foreach ($rows as $key => $val){
|
||||
$of_title = '';
|
||||
if ($val['of_id']) {
|
||||
$of_ary = $offlineSources[$val['of_id']];
|
||||
$of_title = $of_ary['name'];
|
||||
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
|
||||
}
|
||||
$lists[] = array(
|
||||
'id' => $val['id'],
|
||||
'sp_name' => $val['sp_name'],
|
||||
'mobile' => $val['mobile'],
|
||||
'of_title' => $of_title,
|
||||
's_date' => $val['s_date'],
|
||||
'e_date' => $val['e_date'],
|
||||
'last_date' => $val['last_date'],
|
||||
'c_time' => date('Y-m-d H:i:s', $val['c_time']),
|
||||
'u_time' => $val['u_time'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$show_info['offlineSourcesAry'] = $this->customers_model->offlineSources_search();
|
||||
$this->data['show_info'] = $show_info;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = '客户统计计划列表';
|
||||
return $this->show_view('receiver/customer/lists_statplan', true);
|
||||
}
|
||||
|
||||
public function lists_statdata(){
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$where = ['id' => $id];
|
||||
$re = $this->statplan->get($where);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划不存在!');
|
||||
}
|
||||
|
||||
$stat_data = $this->get_statdata($id);
|
||||
$indexs = $stat_data['indexs'];
|
||||
$lists = $stat_data['lists'];
|
||||
|
||||
$this->data['indexs'] = $indexs;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = $re['sp_name'].'_统计数据';
|
||||
return $this->show_view('receiver/customer/lists_statdata', true);
|
||||
}
|
||||
|
||||
public function lists_statdatalog(){
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$where = ['id' => $id];
|
||||
$re = $this->statplan->get($where);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划不存在!');
|
||||
}
|
||||
|
||||
!$params['city_id'] && $params['city_id'] = '';
|
||||
!$params['biz_id'] && $params['biz_id'] = '';
|
||||
|
||||
$where = array('spid'=>$id);
|
||||
$rows_city = $this->statdatalog->select_groupby('city_id', $where, 'city_id', 0, 0, 'city_id, city_name');
|
||||
$maps_city = $this->statdatalog->map($map_key = 'city_id', $map_value = '', $where, $order = 'city_id, biz_id', $page = 0, $page_size = 0, $select = "distinct city_id, biz_id, biz_name");
|
||||
$city_biz_ary = array();
|
||||
foreach ($rows_city as $item){
|
||||
$list = array();
|
||||
foreach ($maps_city[$item['city_id']] as $k => $v){
|
||||
$list[$v['biz_id']] = $v['biz_name'];
|
||||
}
|
||||
$city_biz_ary[$item['city_id']] = array('name'=>$item['city_name'], 'list' => $list);
|
||||
}
|
||||
|
||||
$stat_data = $this->get_statdatalog($params);
|
||||
$indexs = $stat_data['indexs'];
|
||||
$lists = $stat_data['lists'];
|
||||
|
||||
$this->data['indexs'] = $indexs;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['city_biz_ary'] = $city_biz_ary;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['_title'] = $re['sp_name'].'_统计数据';
|
||||
return $this->show_view('receiver/customer/lists_statdatalog', true);
|
||||
}
|
||||
|
||||
private function get_statdata($id, $export=false){
|
||||
if (!$id){
|
||||
return array();
|
||||
}
|
||||
|
||||
$lists = array();
|
||||
$where = ['spid' => $id];
|
||||
$rows_group_id_k = $this->statdata->select_groupby('group_id,k', $where, 'group_id,k', 0, 0, 'group_id,k');
|
||||
$rows_stat_date = $this->statdata->select_groupby('stat_date', $where, 'stat_date', 0, 0, 'stat_date');
|
||||
$key_v = $this->statdata->map($map_key = 'k', $map_value = 'v', $where, $order = '', $page = 0, $page_size = 0, $select = "concat(group_id, '-', k, '-', stat_date) as k, v");
|
||||
$indexs = ['序号', '栏目'];
|
||||
$i = 1;
|
||||
foreach ($rows_group_id_k as $key => $val){
|
||||
$group_id = $val['group_id'];
|
||||
$k = $val['k'];
|
||||
$list['序号'] = $i;
|
||||
$list['栏目'] = $export ? str_replace('</b>', '', str_replace('<b>', '', $k)) : $k;
|
||||
foreach ($rows_stat_date as $key_date => $val_date){
|
||||
$stat_date = $val_date['stat_date'];
|
||||
#$index = str_replace('-', '', substr($stat_date, 5));
|
||||
$index = substr($stat_date, 5);
|
||||
if (!in_array($index, $indexs)){
|
||||
$indexs[] = $index;
|
||||
}
|
||||
$key_ = $group_id . '-' . $k . '-' . $stat_date;
|
||||
$list[$index] = $key_v[$key_] ? $key_v[$key_] : 0;
|
||||
}
|
||||
$lists[] = $list;
|
||||
$i += 1;
|
||||
}
|
||||
|
||||
return array('indexs' => $indexs, 'lists' => $lists);
|
||||
}
|
||||
|
||||
private function get_statdatalog($params, $export=false){
|
||||
$id = $params['id'];
|
||||
if (!$id){
|
||||
return array();
|
||||
}
|
||||
|
||||
$where = ['spid' => $id];
|
||||
$where_s = "spid = {$id} ";
|
||||
|
||||
$city_id = $params['city_id'];
|
||||
$city_id && $where_s .= " and city_id = {$city_id} ";
|
||||
|
||||
$biz_id = $params['biz_id'];
|
||||
$biz_id && $where_s .= " and biz_id = {$biz_id} ";
|
||||
|
||||
if ($params['stat_date']) {
|
||||
$stat_date = explode(' ~ ', $params['stat_date']);
|
||||
if ($stat_date[0]) {
|
||||
$where_s .= " and stat_date >= '{$stat_date[0]}' ";
|
||||
}
|
||||
if ($stat_date[1]) {
|
||||
$where_s .= " and stat_date <= '{$stat_date[1]}' ";
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "
|
||||
select * from (
|
||||
select 1 as group_id, stat_date, '<b>总数</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null group by stat_date
|
||||
union all
|
||||
select 3 as group_id, stat_date, city_name as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null group by stat_date, k
|
||||
union all
|
||||
select biz_id * 10 as group_id, stat_date, if(biz_id,concat('<b>',biz_name,'</b>'),'<b>未分配门店</b>') as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null group by stat_date, k
|
||||
union all
|
||||
select (biz_id * 10 + 1) as group_id, stat_date, if(admin_id,concat(' - ',biz_name,'-', admin_name), ' - 未分配') as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null group by stat_date, k
|
||||
union all
|
||||
select 10007 as group_id, stat_date, '<b>战败</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 3 group by stat_date
|
||||
union all
|
||||
select 10008 as group_id, stat_date, '<b>战败-无购车意向</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 3 and tag_id_1_1 is not null group by stat_date
|
||||
union all
|
||||
select 10009 as group_id, stat_date, concat(' - 战败-无购车意向-', tag_id_1_1_name) as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 3 and tag_id_1_1 is not null group by stat_date, k
|
||||
union all
|
||||
select 10020 as group_id, stat_date, '<b>战败-有购车意向</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 3 and tag_id_1_2 is not null group by stat_date
|
||||
union all
|
||||
select 10021 as group_id, stat_date, concat(' - 战败-有购车意向-', tag_id_1_2_name) as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 3 and tag_id_1_2 is not null group by stat_date, k
|
||||
union all
|
||||
select 10030 as group_id, stat_date, '<b>加V(扣除 战败-无购车意向)</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and (tag_id_1_1 is null or tag_id_1_1 is not null and status <> 3) and wxgr = 1 group by stat_date
|
||||
union all
|
||||
select 10040 as group_id, stat_date, '<b>未见客户的见面意向</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 0 and tag_id_2_1 is not null group by stat_date
|
||||
union all
|
||||
select 10041 as group_id, stat_date, concat(' - 未见客户的见面意向','-', tag_id_2_1_name) as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 0 and tag_id_2_1 is not null group by stat_date, k
|
||||
union all
|
||||
select 10050 as group_id, stat_date, '<b>到店客户的购车意向</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 1 and tag_id_2_2 is not null group by stat_date
|
||||
union all
|
||||
select 10051 as group_id, stat_date, concat(' - 到店客户的购车意向','-', tag_id_2_2_name) as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and status = 1 and tag_id_2_2 is not null group by stat_date, k
|
||||
union all
|
||||
select 10060 as group_id, stat_date, '<b>订单数</b>' as k, count(*) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is not null group by stat_date
|
||||
union all
|
||||
select 10061 as group_id, stat_date, concat(' - 订单数','-',brand_name,' ', s_name) as k, count(*) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is not null group by stat_date, k
|
||||
union all
|
||||
select 10090 as group_id, stat_date, '<b>加企微</b>' as k, count(distinct c_id) as v from lc_receiver_customers_stat_data_log where spid = 1 and o_id is null and wxqy = 1 group by stat_date
|
||||
) t
|
||||
order by group_id, stat_date, k
|
||||
";
|
||||
$sql = str_replace('spid = 1', $where_s, $sql);
|
||||
$rows = $this->statdatalog->db->query($sql)->result_array();
|
||||
if (!$rows){
|
||||
return array();
|
||||
}
|
||||
|
||||
$rows_gk = array();
|
||||
$rows_group_id_k = array();
|
||||
$rows_stat_date = array();
|
||||
$key_v = array();
|
||||
|
||||
foreach ($rows as $row){
|
||||
$group_id = $row['group_id'];
|
||||
$k = $row['k'];
|
||||
$stat_date = $row['stat_date'];
|
||||
$v = $row['v'];
|
||||
$group_id_k = $group_id . '-' . $k;
|
||||
if (!in_array($group_id_k, $rows_gk)){
|
||||
$rows_gk[] = $group_id_k;
|
||||
$rows_group_id_k[] = array('group_id' => $group_id, 'k' => $k );
|
||||
}
|
||||
if (!in_array($stat_date, $rows_stat_date)){
|
||||
$rows_stat_date[] = $stat_date;
|
||||
}
|
||||
$key_ = $group_id . '-' . $k . '-' . $stat_date;
|
||||
$key_v[$key_] = $v;
|
||||
}
|
||||
|
||||
$lists = array();
|
||||
$indexs = ['序号', '栏目'];
|
||||
$i = 1;
|
||||
foreach ($rows_group_id_k as $key => $val){
|
||||
$group_id = $val['group_id'];
|
||||
$k = $val['k'];
|
||||
$list['序号'] = $i;
|
||||
$list['栏目'] = $export ? str_replace('</b>', '', str_replace('<b>', '', $k)) : $k;
|
||||
foreach ($rows_stat_date as $key_date => $val_date){
|
||||
$stat_date = $val_date;
|
||||
#$index = str_replace('-', '', substr($stat_date, 5));
|
||||
$index = substr($stat_date, 5);
|
||||
if (!in_array($index, $indexs)){
|
||||
$indexs[] = $index;
|
||||
}
|
||||
$key_ = $group_id . '-' . $k . '-' . $stat_date;
|
||||
$list[$index] = $key_v[$key_] ? $key_v[$key_] : 0;
|
||||
}
|
||||
$lists[] = $list;
|
||||
$i += 1;
|
||||
}
|
||||
|
||||
return array('indexs' => $indexs, 'lists' => $lists);
|
||||
}
|
||||
|
||||
private function get_where(&$params)
|
||||
{
|
||||
!$params['biz_id'] && $params['biz_id'] = '';
|
||||
!strlen($params['cs_biz_id']) && $params['cs_biz_id'] = '';
|
||||
!$params['cf_title'] && $params['cf_title'] = '';
|
||||
!$params['qdjl_id'] && $params['qdjl_id'] = '';
|
||||
!$params['level'] && $params['level'] = '';
|
||||
!$params['of_id'] && $params['of_id'] = '';
|
||||
!$params['of2_id'] && $params['of2_id'] = '';
|
||||
!$params['city_id'] && $params['city_id'] = '';
|
||||
!$params['county_id'] && $params['county_id'] = '';
|
||||
!$params['biz_type'] && $params['biz_type'] = '';
|
||||
!$params['tags'] && $params['tags'] = '';
|
||||
!$params['tagsIntention'] && $params['tagsIntention'] = '';
|
||||
!$params['tagsDefeat'] && $params['tagsDefeat'] = '';
|
||||
$where = array('status>=0' => null);
|
||||
if ($_SESSION['admin_info']['biz_id']) {
|
||||
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
|
||||
@@ -140,11 +427,22 @@ class Customer extends HD_Controller
|
||||
if ($params['of2_id']) {
|
||||
$where['of2_id'] = $params['of2_id'];
|
||||
}
|
||||
if ($params['city_id']) {
|
||||
$where['city_id'] = $params['city_id'];
|
||||
}
|
||||
if ($params['county_id']) {
|
||||
$where['county_id'] = $params['county_id'];
|
||||
}
|
||||
if (strlen($params['wxqy'])) {
|
||||
$where["wxqy"] = $params['wxqy'];
|
||||
} else {
|
||||
$params['wxqy'] = '';
|
||||
}
|
||||
if (strlen($params['wxgr'])) {
|
||||
$where["wxgr"] = $params['wxgr'];
|
||||
} else {
|
||||
$params['wxgr'] = '';
|
||||
}
|
||||
!$params['search_tp'] && $params['search_tp'] = 'mobile';
|
||||
strlen($params['status']) && $where["status"] = $params['status'];
|
||||
if ($params['qdjl_id']) {
|
||||
@@ -160,6 +458,7 @@ class Customer extends HD_Controller
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where["biz_id in(select id from lc_biz where city_id={$params['city_id_admin']})"] = null;
|
||||
}
|
||||
$where[$this->customers_model->csbizidWhere($params['cs_biz_id'])] = null;
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
@@ -194,6 +493,11 @@ class Customer extends HD_Controller
|
||||
$order_time[0] && $where["order_time >="] = $order_time[0] . ' 00:00:00';
|
||||
$order_time[1] && $where["order_time <="] = $order_time[1] . ' 23:59:59';
|
||||
}
|
||||
if ($params['def_time']) {
|
||||
$order_time = explode(' ~ ', $params['def_time']);
|
||||
$order_time[0] && $where["def_time >="] = $order_time[0] . ' 00:00:00';
|
||||
$order_time[1] && $where["def_time <="] = $order_time[1] . ' 23:59:59';
|
||||
}
|
||||
if ($params['cfrom_id'] || $params['cfrom_id2']) {
|
||||
if ($params['cfrom_id'] == 24) {
|
||||
$where['cf_id'] = 24;
|
||||
@@ -210,6 +514,21 @@ class Customer extends HD_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($params['tags']) {
|
||||
$where = $this->tagWhere($where, $params['tags']);
|
||||
} else if ($params['tagsIntention']) {
|
||||
$where = $this->tagWhere($where, $params['tagsIntention']);
|
||||
} else if ($params['tagsDefeat']) {
|
||||
$where['status'] = 3;
|
||||
$where = $this->tagWhere($where, $params['tagsDefeat']);
|
||||
}
|
||||
// 指定顾问的回访客户,通过 vsid + vdststus 时间
|
||||
if ($vsid = $params['vsid']) {
|
||||
$vdststus = $params['vdststus'] ? intval($params['vdststus']) : 0;
|
||||
$vdststus_parm = $vdststus ? " and lc_vd.status = {$vdststus}" : "";
|
||||
$where["id in(select lc_vd.c_id from lc_receiver_customer_visit_data lc_vd join lc_receiver_customer_visit_sales lc_vs on lc_vd.biz_id = lc_vs.biz_id and lc_vd.sales_id = lc_vs.sales_id and lc_vd.t_day = lc_vs.t_day and lc_vs.id = {$vsid} {$vdststus_parm})"] = null;
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
@@ -218,7 +537,8 @@ class Customer extends HD_Controller
|
||||
$id = $this->input->get('id');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
$row = $this->customers_model->get(array('id' => $id));
|
||||
$select = '*, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name';
|
||||
$row = $this->customers_model->get(array('id' => $id), $select);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
@@ -263,19 +583,25 @@ class Customer extends HD_Controller
|
||||
$row['of2_id'] && $of_title .= '-' . $of_ary['list'][$row['of2_id']];
|
||||
}
|
||||
$tag = $tag_group = [];
|
||||
$tag_defeat = $tag_intention = '';
|
||||
$biz_type = intval($row_biz['type']);
|
||||
if ($biz_type == 5) {
|
||||
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : [];
|
||||
$jsondata['tag_group'] && $tag_group = $jsondata['tag_group'];
|
||||
} else {
|
||||
$tag = $this->get_tag($row['id']);
|
||||
if ($row['status'] == 3) {
|
||||
$tag_defeat = $this->get_tag($row['id'], 1, '', 1);
|
||||
}
|
||||
$tag_intention = $this->get_tag($row['id'], 2, '', 1);
|
||||
}
|
||||
$to_send = '';
|
||||
/*$to_send = '';
|
||||
if ($row['cs_biz_id'] == -1) {
|
||||
$to_send = '已改派';
|
||||
} else if ($row['cs_biz_id'] > 0) {
|
||||
$to_send = '接收线索';
|
||||
}
|
||||
}*/
|
||||
$to_send = $this->customers_model->csbizidAry($row['cs_biz_id'] ? $row['cs_biz_id'] : 0);
|
||||
$info = array(
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
@@ -283,20 +609,25 @@ class Customer extends HD_Controller
|
||||
'mobile' => $mobile_sub,
|
||||
'of_title' => $of_title,
|
||||
'wxqy_name' => $this->customers_model->wxqyAry($row['wxqy']),
|
||||
'wxgr_name' => $this->customers_model->wxgrAry($row['wxgr']),
|
||||
'wx_name' => '企微:' . $this->customers_model->wxqyAry($row['wxqy']) . '; 个微:' . $this->customers_model->wxgrAry($row['wxgr']),
|
||||
'cf_user' => $cf_user,
|
||||
'to_send' => $to_send,
|
||||
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
|
||||
'status' => $row['status'],
|
||||
'tag' => $tag,
|
||||
'tag_defeat' => $tag_defeat,
|
||||
'tag_intention' => $tag_intention,
|
||||
'tag_group' => $tag_group,
|
||||
'biz_type' => $biz_type,
|
||||
'city_county' => $row['city_name'] ? $row['city_name'].$row['county_name'] : '-',
|
||||
);
|
||||
|
||||
//到店信息
|
||||
$toshop = array(
|
||||
array(
|
||||
array('title' => '门店', 'value' => $row_biz['biz_name']),
|
||||
array('title' => '试驾', 'value' => $if_driver),
|
||||
//array('title' => '试驾', 'value' => $if_driver), # 2023.02.28 数据与t_num无关联,屏蔽
|
||||
array('title' => '到店次数', 'value' => $row['a_num']),
|
||||
array('title' => '试驾次数', 'value' => $row['t_num']),
|
||||
),
|
||||
@@ -362,6 +693,33 @@ class Customer extends HD_Controller
|
||||
return $this->show_view('receiver/customer/get', true);
|
||||
}
|
||||
|
||||
public function get_statplan()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
if ($id) {
|
||||
$url = "/receiver/customer/edit_statplan";
|
||||
$re = $this->statplan->get(['id' => $id]);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划不存在!');
|
||||
}
|
||||
$sp_name = $re['sp_name'];
|
||||
$of_id = $re['of_id'];
|
||||
$of2_id = $re['of2_id'];
|
||||
$s_date = $re['s_date'];
|
||||
$e_date = $re['e_date'];
|
||||
$s_e_date = $s_date .' ~ '.$e_date;
|
||||
} else {
|
||||
$url = "/receiver/customer/edit_statplan";
|
||||
$sp_name = '';
|
||||
$of_id = '';
|
||||
$of2_id = '';
|
||||
$s_e_date = '';
|
||||
}
|
||||
$this->data['info'] = ['id' => $id, 'sp_name' => $sp_name, 'of_id' => $of_id, 'of2_id' => $of2_id, 's_e_date' => $s_e_date, 'url' => $url];
|
||||
$this->data['show_info'] = ['offlineSourcesAry' => $this->customers_model->offlineSources()];
|
||||
return $this->show_view('/receiver/customer/edit_statplan');
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
// TODO: Implement add() method.
|
||||
@@ -397,6 +755,54 @@ class Customer extends HD_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function edit_statplan()
|
||||
{
|
||||
$params = $this->input->post()['info'];
|
||||
$id = intval($params['id']);
|
||||
if (!$params['sp_name']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划名不能为空!');
|
||||
}
|
||||
if (!$params['of_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '来源1不能为空!');
|
||||
}
|
||||
if (!$params['of2_id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '来源2不能为空!');
|
||||
}
|
||||
if (!$params['s_e_date']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '起止日期不能为空!');
|
||||
}
|
||||
|
||||
$s_e_date = explode(' ~ ', $params['s_e_date']);
|
||||
$s_date = $s_e_date[0];
|
||||
$e_date = $s_e_date[1] ;
|
||||
if (!$s_date){
|
||||
return $this->show_json(SYS_CODE_FAIL, '开始日期不能为空!');
|
||||
}
|
||||
if (!$e_date){
|
||||
return $this->show_json(SYS_CODE_FAIL, '结束日期不能为空!');
|
||||
}
|
||||
|
||||
$data = [
|
||||
'sp_name' => $params['sp_name'],
|
||||
'of_id' => $params['of_id'],
|
||||
'of2_id' => $params['of2_id'],
|
||||
's_date' => $s_date,
|
||||
'e_date' => $e_date,
|
||||
];
|
||||
|
||||
if (!$id){
|
||||
$data['c_time'] = time();
|
||||
$res = $this->statplan->add($data);
|
||||
}
|
||||
else{
|
||||
$res = $this->statplan->update($data, array('id' => $id));
|
||||
}
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @return bool
|
||||
@@ -449,17 +855,18 @@ class Customer extends HD_Controller
|
||||
$msg = '修改用户信息成功';
|
||||
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => $log));
|
||||
}
|
||||
} else if ($info['editType'] == 3) {
|
||||
} else if ($info['editType'] == 3 || $info['editType'] == 4) {
|
||||
$id = $info['id'];
|
||||
//客户标签
|
||||
if (!$info['tag']) {
|
||||
if (!$info['tag'] && $info['editType'] == 3) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户画像不存在!');
|
||||
}
|
||||
$add_tag = [];
|
||||
//查找已加入标签
|
||||
$res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');
|
||||
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
|
||||
foreach ($info['tag'] as $key => $val) {
|
||||
$tag_lists = $info['editType'] == 3 ? $info['tag'] : $info['invalid_user_tag'];
|
||||
foreach ($tag_lists as $key => $val) {
|
||||
foreach ($val['list'] as $key2 => $val2) {
|
||||
if ($val['type'] == 'checkbox') {
|
||||
if ($val2['checked'] == 'true') {
|
||||
@@ -487,7 +894,8 @@ class Customer extends HD_Controller
|
||||
if ($add_tag && count($add_tag)) {
|
||||
$this->mdCustomerTagdata->add_batch($add_tag);
|
||||
}
|
||||
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => '修改用户画像'));
|
||||
$log_msg = $info['editType'] == 3 ? '修改用户画像' : '修改战败标签';
|
||||
$this->addLog(array('customer_id' => $info['id'], 'type' => 0, 'log' => $log_msg));
|
||||
}
|
||||
return $this->show_json($code, $msg);
|
||||
}
|
||||
@@ -514,15 +922,38 @@ class Customer extends HD_Controller
|
||||
|
||||
public function export()
|
||||
{
|
||||
if ($this->uid != 1){
|
||||
if (!(SUPER_ADMIN == $this->role || in_array($this->uid, array(1, 62, 82)))) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '无权限导出');
|
||||
}
|
||||
|
||||
$params = $this->input->get();
|
||||
$where = $this->get_where($params);
|
||||
$where["cs_biz_id >= 0"] = null;
|
||||
#$where["cs_biz_id >= 0"] = null;
|
||||
$page = 1;
|
||||
$size = 10000;
|
||||
$params['export_tag'] && $size = 500;
|
||||
|
||||
$indexs = [
|
||||
'id' => 'ID',
|
||||
'name' => '客户姓名',
|
||||
'mobile' => '手机',
|
||||
'level' => '客户等级',
|
||||
'status_name' => '客户状态',
|
||||
'city_name' => '所在城市',
|
||||
'county_name' => '所在地区',
|
||||
'to_send' => '是否改派',
|
||||
'c_time' => '建档时间',
|
||||
"dt_time" => "到店时间",
|
||||
"order_time" => "下单时间",
|
||||
"cont_time" => "最后联系时间",
|
||||
#"of_title" => "来源",
|
||||
"of_title_1" => "来源1",
|
||||
"of_title_2" => "来源2",
|
||||
"biz_name" => "归属门店",
|
||||
"admin_name" => "归属顾问",
|
||||
"wxqy_name" => "企微好友",
|
||||
"wxgr_name" => "加个微",
|
||||
];
|
||||
|
||||
$count = $this->customers_model->count($where);
|
||||
$data = [];
|
||||
@@ -530,50 +961,130 @@ class Customer extends HD_Controller
|
||||
$status_arr = $this->customers_model->get_status();
|
||||
unset($status_arr['-1']);
|
||||
if ($count) {
|
||||
$fileds = "id, name, mobile, level, status, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id";
|
||||
$fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name";
|
||||
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
foreach ($rows as $key => $val) {
|
||||
$of_title = '';
|
||||
$of_title_1 = $of_title_2 = '';
|
||||
if ($val['of_id']) {
|
||||
$of_ary = $offlineSources[$val['of_id']];
|
||||
$of_title = $of_ary['name'];
|
||||
$of_ary['name'] && $of_title_1 = $of_ary['name'];
|
||||
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
|
||||
$val['of2_id'] && $of_ary['list'][$val['of2_id']] && $of_title_2 = $of_ary['list'][$val['of2_id']];
|
||||
}
|
||||
$data[] = array(
|
||||
'id' => 'ID',
|
||||
$id = $val['id'];
|
||||
$row = array(
|
||||
'id' => $id,
|
||||
'name' => $val['name'],
|
||||
'mobile' => $val['mobile'],
|
||||
'level' => $val['level'],
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'city_name' => $val['city_name'],
|
||||
'county_name' => $val['county_name'],
|
||||
'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0),
|
||||
'c_time' => $val['c_time'],
|
||||
'dt_time' => $val['dt_time'],
|
||||
'order_time' => $val['order_time'],
|
||||
'cont_time' => $val['cont_time'],
|
||||
'of_title' => $of_title,
|
||||
'of_title_1' => $of_title_1,
|
||||
'of_title_2' => $of_title_2,
|
||||
'biz_name' => $val['biz_name'],
|
||||
'admin_name' => $val['admin_name'],
|
||||
'wxqy_name' => $this->customers_model->wxqyAry($val['wxqy']),
|
||||
'wxgr_name' => $this->customers_model->wxgrAry($val['wxgr']),
|
||||
);
|
||||
|
||||
if ($params['export_tag']){
|
||||
$tag = $this->get_tag($id);
|
||||
foreach ($tag as $key => $val) {
|
||||
$tag_key = 'tag__' . $val['id'];
|
||||
$row[$tag_key] = $val['value_str'];
|
||||
if (!in_array($tag_key, array_keys($indexs))) {
|
||||
$indexs[$tag_key] = $val['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$tag_intention = $this->get_tag($id, 2);
|
||||
foreach ($tag_intention as $key => $val) {
|
||||
$tag_key = 'tag__' . $val['id'];
|
||||
$row[$tag_key] = $val['value_str'];
|
||||
if (!in_array($tag_key, array_keys($indexs))) {
|
||||
$indexs[$tag_key] = '意向-' . $val['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$tag_defeat = $this->get_tag($id, 1);
|
||||
foreach ($tag_defeat as $key => $val) {
|
||||
$tag_key = 'tag__' . $val['id'];
|
||||
$row[$tag_key] = $val['value_str'];
|
||||
if (!in_array($tag_key, array_keys($indexs))) {
|
||||
$indexs[$tag_key] = '战败-' . $val['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[] = $row;
|
||||
}
|
||||
}
|
||||
$indexs = [
|
||||
'name' => '客户姓名',
|
||||
'mobile' => '手机',
|
||||
'level' => '客户等级',
|
||||
'status_name' => '客户类型',
|
||||
'c_time' => '建档时间',
|
||||
"dt_time" => "到店时间",
|
||||
"order_time" => "下单时间",
|
||||
"cont_time" => "最后联系时间",
|
||||
"of_title" => "来源",
|
||||
"biz_name" => "归属门店",
|
||||
"admin_name" => "归属顾问",
|
||||
];
|
||||
|
||||
$fileName = '客户列表';
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
|
||||
public function export_statdata(){
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$where = ['id' => $id];
|
||||
$re = $this->statplan->get($where);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划不存在!');
|
||||
}
|
||||
|
||||
$stat_data = $this->get_statdata($id, $export=true);
|
||||
$indexs = array();
|
||||
foreach ($stat_data['indexs'] as $index){
|
||||
$indexs[$index] = $index;
|
||||
}
|
||||
$data = $stat_data['lists'];
|
||||
|
||||
$fileName = $re['sp_name'].'_统计数据';
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
|
||||
public function export_statdatalog(){
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$where = ['id' => $id];
|
||||
$re = $this->statplan->get($where);
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '计划不存在!');
|
||||
}
|
||||
|
||||
$stat_data = $this->get_statdatalog($params, $export=true);
|
||||
$indexs = array();
|
||||
foreach ($stat_data['indexs'] as $index){
|
||||
$indexs[$index] = $index;
|
||||
}
|
||||
$data = $stat_data['lists'];
|
||||
|
||||
$fileName = $re['sp_name'].'_统计数据';
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
}
|
||||
|
||||
//改派
|
||||
public function edit_adviser()
|
||||
{
|
||||
@@ -624,15 +1135,51 @@ class Customer extends HD_Controller
|
||||
return $id;
|
||||
}
|
||||
|
||||
private function get_tag($id)
|
||||
private function tagWhere($where, $tags)
|
||||
{
|
||||
$pidAry = [];
|
||||
$res_tag = $this->mdCustomerTag->select(["id in ({$tags})" => null], 'id desc', 0, 0, 'pid,id');
|
||||
foreach ($res_tag as $v) {
|
||||
$v['pid'] && $pidAry[$v['pid']][] = $v['id'];
|
||||
}
|
||||
$str_c_ids = $res_tag_data = '';
|
||||
foreach ($pidAry as $v) {
|
||||
if ($v) {
|
||||
$where_tag = [];
|
||||
$str_ids = implode(',', $v);
|
||||
$where_tag["t_id in({$str_ids})"] = null;
|
||||
if ($str_c_ids) {
|
||||
$where_tag["c_id in({$str_c_ids})"] = null;
|
||||
}
|
||||
$res_tag_data = $this->mdCustomerTagdata->select_groupby('c_id', $where_tag, "id desc", 0, 0, "c_id");
|
||||
if (!$res_tag_data) {
|
||||
break;
|
||||
}
|
||||
if ($res_tag_data) {
|
||||
$str_c_ids = implode(',', array_column($res_tag_data, 'c_id'));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($res_tag_data) {
|
||||
$str_cids = implode(',', array_column($res_tag_data, 'c_id'));
|
||||
$where["id in({$str_cids})"] = null;
|
||||
} else {
|
||||
$where["id"] = -1;
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
private function get_tag($id, $tag_type = 0, $tag_data = '', $check_show = 0)
|
||||
{
|
||||
$show = $res_td = [];
|
||||
$res = $this->mdCustomerTag->select(['status' => 1, 'pid' => 0, 'show<>' => 1], 'sort desc,id desc', 0, 0, 'id,name,type');
|
||||
$res = $this->mdCustomerTag->select(['status' => 1, 'pid' => 0, 'show<>' => 1, 'tag_type' => $tag_type], 'sort desc,id desc', 0, 0, 'id,name,type');
|
||||
if ($res) {
|
||||
$id && $res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
|
||||
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
|
||||
if ($id) {
|
||||
$res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
|
||||
$res_td && $tag_data = array_unique(array_column($res_td, 't_id'));
|
||||
}
|
||||
foreach ($res as $key => $val) {
|
||||
$list = [];
|
||||
$list = $value_arr = [];
|
||||
$value = '';
|
||||
$res2 = $this->mdCustomerTag->select(['status' => 1, 'pid' => $val['id']], 'sort desc,id desc', 0, 0, 'id,name');
|
||||
foreach ($res2 as $key2 => $val2) {
|
||||
@@ -640,16 +1187,24 @@ class Customer extends HD_Controller
|
||||
$setValue = ['id' => $val2['id'], 'name' => $val2['name']];
|
||||
if ($val['type'] == 'checkbox') {
|
||||
$setValue['checked'] = $tag_data && in_array($val2['id'], $tag_data) ? true : false;
|
||||
if ($setValue['checked']) {
|
||||
$value_arr[] = $val2['name'];
|
||||
$check_show && $check_show = 0;
|
||||
}
|
||||
} else {
|
||||
if ($tag_data && in_array($val2['id'], $tag_data)) {
|
||||
$value = $val2['id'];
|
||||
$value_arr[] = $val2['name'];
|
||||
$check_show && $check_show = 0;
|
||||
}
|
||||
}
|
||||
$list[] = $setValue;
|
||||
}
|
||||
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'list' => $list];
|
||||
$value_str = $value_arr ? implode(', ', $value_arr) : '';
|
||||
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'value_str' => $value_str, 'list' => $list];
|
||||
}
|
||||
}
|
||||
$check_show && $show = '';
|
||||
return $show;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ class Orders extends HD_Controller
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
$this->load->model('auto/auto_finance_model');
|
||||
$this->load->model('sys/sys_finance_model');
|
||||
//$this->load->model('sys/sys_finance_model');
|
||||
$this->load->model('sys/sys_supplier_model');
|
||||
$this->load->model('sys/sys_company_model');
|
||||
$this->load->model('app/liche/app_liche_orders_model');
|
||||
|
||||
@@ -178,8 +179,10 @@ class Orders extends HD_Controller
|
||||
$loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : '';
|
||||
$loan['lend_file_name'] = $loan['lend_file'] ? end(explode('/', $loan['lend_file'])) : '';
|
||||
|
||||
$loan['finance_rows'] = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
|
||||
$loan['finance_rows_nums'] = $this->sys_finance_model->get_nums();
|
||||
//$loan['finance_rows'] = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
|
||||
//$loan['finance_rows_nums'] = $this->sys_finance_model->get_nums();
|
||||
$loan['finance_rows'] = $this->sys_supplier_model->select(['status' => 1, 'type'=>3], '', 0, 0, 'id,title');
|
||||
$loan['finance_rows_nums'] = $this->auto_finance_model->get_nums();
|
||||
$loan['price_loan'] = $money_json['price_loan'] ? $money_json['price_loan'] : '';
|
||||
$loan['first_pay'] = 0;
|
||||
if ($money_json['price_loan']) {
|
||||
@@ -868,7 +871,7 @@ class Orders extends HD_Controller
|
||||
}
|
||||
$p_row = $this->app_liche_orders_model->get(['pid'=>0,'o_id'=>$row['id']]);
|
||||
$this->load->helper('order');
|
||||
$sid = create_order_no(350200, 'liche', 1, $type);
|
||||
$sid = create_order_no(350200, 'liche');
|
||||
$data = [
|
||||
'o_id' => $row['id'],
|
||||
'sid' => $sid,
|
||||
|
||||
@@ -54,6 +54,7 @@ class Owners extends HD_Controller
|
||||
!$params['brand_id'] && $params['brand_id'] = '';
|
||||
!$params['s_id'] && $params['s_id'] = '';
|
||||
!$params['v_id'] && $params['v_id'] = '';
|
||||
!$params['tags'] && $params['tags'] = '';
|
||||
if (strlen($params['status'])) {
|
||||
$where["a.status"] = $params['status'];
|
||||
} else {
|
||||
@@ -97,6 +98,7 @@ class Owners extends HD_Controller
|
||||
if ($params['sex']) {
|
||||
$where["a.sex"] = $params['sex'];
|
||||
}
|
||||
$where['a.brand_id in (select id from lc_auto_brand where status > -1)'] = null;
|
||||
if ($params['brand_id']) {
|
||||
$where["a.brand_id"] = $params['brand_id'];
|
||||
}
|
||||
@@ -116,6 +118,37 @@ class Owners extends HD_Controller
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where["b.biz_id in(select id from lc_biz where city_id={$params['city_id_admin']})"] = null;
|
||||
}
|
||||
if ($params['tags']) {
|
||||
$pidAry = [];
|
||||
$res_tag = $this->mdOwnersTag->select(["id in ({$params['tags']})" => null], 'id desc', 0, 0, 'pid,id');
|
||||
foreach ($res_tag as $v) {
|
||||
$v['pid'] && $pidAry[$v['pid']][] = $v['id'];
|
||||
}
|
||||
$str_o_ids = $res_tag_data = '';
|
||||
foreach ($pidAry as $v) {
|
||||
if ($v) {
|
||||
$where_tag = [];
|
||||
$str_ids = implode(',', $v);
|
||||
$where_tag["t_id in({$str_ids})"] = null;
|
||||
if ($str_o_ids) {
|
||||
$where_tag["o_id in({$str_o_ids})"] = null;
|
||||
}
|
||||
$res_tag_data = $this->mdOwnersTagdata->select_groupby('o_id', $where_tag, "id desc", 0, 0, "o_id");
|
||||
if (!$res_tag_data) {
|
||||
break;
|
||||
}
|
||||
if ($res_tag_data) {
|
||||
$str_o_ids = implode(',', array_column($res_tag_data, 'o_id'));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($res_tag_data) {
|
||||
$str_oids = implode(',', array_column($res_tag_data, 'o_id'));
|
||||
$where["a.id in({$str_oids})"] = null;
|
||||
} else {
|
||||
$where["a.id"] = -1;
|
||||
}
|
||||
}
|
||||
$lists = [];
|
||||
$wxqyAry = $this->mdOwners->wxqyAry();
|
||||
$statusAry = $this->mdOwners->statusAry();
|
||||
@@ -144,8 +177,8 @@ class Owners extends HD_Controller
|
||||
#$str_biz_ids = implode(',', array_unique(array_column($res, 'biz_id')));
|
||||
#$map_bizs = $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]);
|
||||
$arr_biz_id = array_unique(array_column($res, 'biz_id'));
|
||||
foreach ($arr_biz_id as $k => $v){
|
||||
if ($v == null || $v == ''){
|
||||
foreach ($arr_biz_id as $k => $v) {
|
||||
if ($v == null || $v == '') {
|
||||
unset($arr_biz_id[$k]);
|
||||
}
|
||||
}
|
||||
@@ -154,8 +187,8 @@ class Owners extends HD_Controller
|
||||
#$str_admin_ids = implode(',', array_unique(array_column($res, 'admin_id')));
|
||||
#$map_admins = $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]);
|
||||
$arr_admin_id = array_unique(array_column($res, 'admin_id'));
|
||||
foreach ($arr_admin_id as $k => $v){
|
||||
if ($v == null || $v == ''){
|
||||
foreach ($arr_admin_id as $k => $v) {
|
||||
if ($v == null || $v == '') {
|
||||
unset($arr_admin_id[$k]);
|
||||
}
|
||||
}
|
||||
@@ -167,6 +200,9 @@ class Owners extends HD_Controller
|
||||
$map_brands[$val['brand_id']] && $car_name = $map_brands[$val['brand_id']];
|
||||
$map_series[$val['s_id']] && $car_name = $car_name ? $car_name . '-' . $map_series[$val['s_id']] : $map_series[$val['s_id']];
|
||||
$map_attrs[$val['v_id']] && $car_name = $car_name ? $car_name . '-' . $map_attrs[$val['v_id']] : $map_attrs[$val['v_id']];
|
||||
$brand_name = isset($map_brands[$val['brand_id']]) ? $map_brands[$val['brand_id']] : '';
|
||||
$series_name = isset($map_series[$val['s_id']]) ? $map_series[$val['s_id']] : '';
|
||||
$v_name = isset($map_attrs[$val['v_id']]) ? $map_attrs[$val['v_id']] : '';
|
||||
$map_countys[$val['county_id']] && $city_name = $map_countys[$val['county_id']]['city_name'] . '-' . $map_countys[$val['county_id']]['county_name'];
|
||||
if (!$city_name && $val['city_id']) {
|
||||
$re_are = $this->mdArea->get(['city_id' => $val['city_id']]);
|
||||
@@ -183,6 +219,9 @@ class Owners extends HD_Controller
|
||||
'sex' => $sex,
|
||||
'age' => $this->getAgeByBirth($val['birth_day']),
|
||||
'car_name' => $car_name,
|
||||
'brand_name' => $brand_name,
|
||||
'series_name' => $series_name,
|
||||
'v_name' => $v_name,
|
||||
'city_name' => $city_name,
|
||||
'biz_name' => $biz_name,
|
||||
'admin_name' => $admin_name,
|
||||
@@ -195,6 +234,8 @@ class Owners extends HD_Controller
|
||||
];
|
||||
}
|
||||
}
|
||||
$tag_data = $params['tags'] ? explode(',', $params['tags']) : '';
|
||||
$show_info['tags'] = $this->get_tag(0, $tag_data);
|
||||
$show_info['searchTpAry'] = $this->searchTpAry;
|
||||
$show_info['wxqyAry'] = $wxqyAry;
|
||||
$show_info['statusAry'] = $statusAry;
|
||||
@@ -425,10 +466,14 @@ class Owners extends HD_Controller
|
||||
$data = $indexs = array();
|
||||
$res = $this->dataSelect($params);
|
||||
$fileName = $res['_title'];
|
||||
$indexs_tags = array();
|
||||
foreach ($res['lists'] as $key => $value) {
|
||||
$temp['name'] = $value['name'];
|
||||
$temp['mobile'] = $value['mobile'];
|
||||
$temp['car_name'] = $value['car_name'];
|
||||
$temp['brand_name'] = $value['brand_name'];
|
||||
$temp['series_name'] = $value['series_name'];
|
||||
$temp['v_name'] = $value['v_name'];
|
||||
$temp['city_name'] = $value['city_name'];
|
||||
$temp['car_num'] = $value['car_num'];
|
||||
$temp['sex'] = $value['sex'];
|
||||
@@ -441,12 +486,27 @@ class Owners extends HD_Controller
|
||||
$temp['biz_name'] = $value['biz_name'];
|
||||
$temp['admin_name'] = $value['admin_name'];
|
||||
$temp['u_time'] = $value['u_time'];
|
||||
$data[] = $value;
|
||||
|
||||
$tag = $this->get_tag($value['id']);
|
||||
foreach ($tag as $key2 => $val2) {
|
||||
$tag_id_key = 'tag_id_' . $val2['id'];
|
||||
$tag_name = $val2['name'];
|
||||
$tag_value = $val2['value_name'];
|
||||
if (!in_array($tag_id_key, array_keys($indexs_tags))) {
|
||||
$indexs_tags[$tag_id_key] = $tag_name;
|
||||
}
|
||||
$temp[$tag_id_key] = $tag_value;
|
||||
}
|
||||
|
||||
$data[] = $temp;
|
||||
}
|
||||
$indexs = [
|
||||
'name' => '车主',
|
||||
'mobile' => '手机号',
|
||||
'car_name' => '车辆',
|
||||
#'car_name' => '车辆',
|
||||
'brand_name' => '品牌',
|
||||
'series_name' => '车系',
|
||||
'v_name' => '车型',
|
||||
'city_name' => '所在城市',
|
||||
'car_num' => '车牌号',
|
||||
"sex" => "性别",
|
||||
@@ -459,6 +519,7 @@ class Owners extends HD_Controller
|
||||
"admin_name" => "销售员",
|
||||
"u_time" => "最后操作时间",
|
||||
];
|
||||
$indexs = array_merge($indexs, $indexs_tags);
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
@@ -493,32 +554,39 @@ class Owners extends HD_Controller
|
||||
* Created on: 2022/6/16 14:47
|
||||
* Created by: dengbw
|
||||
* @param $id
|
||||
* @param $tag_data
|
||||
* @return array
|
||||
*/
|
||||
private function get_tag($id)
|
||||
private function get_tag($id, $tag_data = '')
|
||||
{
|
||||
$show = $res_td = [];
|
||||
$res = $this->mdOwnersTag->select(['status' => 1, 'pid' => 0], 'sort desc,id desc', 0, 0, 'id,name,type');
|
||||
if ($res) {
|
||||
$id && $res_td = $this->mdOwnersTagdata->select(['o_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
|
||||
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
|
||||
if ($id) {
|
||||
$res_td = $this->mdOwnersTagdata->select(['o_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
|
||||
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
|
||||
}
|
||||
foreach ($res as $key => $val) {
|
||||
$list = [];
|
||||
$value = '';
|
||||
$value_name = '';
|
||||
$res2 = $this->mdOwnersTag->select(['status' => 1, 'pid' => $val['id']], 'sort desc,id desc', 0, 0, 'id,name');
|
||||
foreach ($res2 as $key2 => $val2) {
|
||||
//检查是否选中标签
|
||||
$setValue = ['id' => $val2['id'], 'name' => $val2['name']];
|
||||
if ($val['type'] == 'checkbox') {
|
||||
$setValue['checked'] = $tag_data && in_array($val2['id'], $tag_data) ? true : false;
|
||||
$setValue['checked'] && $value_name .= $val2['name'] . ' ';
|
||||
} else {
|
||||
if ($tag_data && in_array($val2['id'], $tag_data)) {
|
||||
$value = $val2['id'];
|
||||
$value_name .= $val2['name'];
|
||||
}
|
||||
}
|
||||
$list[] = $setValue;
|
||||
}
|
||||
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'list' => $list];
|
||||
$value_name = trim($value_name);
|
||||
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'value_name' => $value_name, 'list' => $list];
|
||||
}
|
||||
}
|
||||
return $show;
|
||||
|
||||
@@ -4,7 +4,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class OwnersTag extends HD_Controller
|
||||
{
|
||||
private $tabAry = [1 => ['title' => '客户标签', 'url' => '/receiver/tag'], 2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag']];
|
||||
private $tabAry = [
|
||||
1 => ['title' => '客户标签', 'url' => '/receiver/tag'],
|
||||
2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag'],
|
||||
3 => ['title' => '战败标签', 'url' => '/receiver/tag?tag_type=1'],
|
||||
4 => ['title' => '意向标签', 'url' => '/receiver/tag?tag_type=2']
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Tag extends HD_Controller
|
||||
{
|
||||
private $tabAry = [1 => ['title' => '客户标签', 'url' => '/receiver/tag'], 2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag']];
|
||||
private $tabAry = [
|
||||
1 => ['title' => '客户标签', 'url' => '/receiver/tag'],
|
||||
2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag'],
|
||||
3 => ['title' => '战败标签', 'url' => '/receiver/tag?tag_type=1'],
|
||||
4 => ['title' => '意向标签', 'url' => '/receiver/tag?tag_type=2']
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -24,12 +29,14 @@ class Tag extends HD_Controller
|
||||
$params = $this->input->get();
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$params['tab'] = 1;
|
||||
#$params['tab'] = $params['tag_type'] ? 3 : 1;
|
||||
$params['tab'] = $params['tag_type'] ? $params['tag_type'] + 2 : 1;
|
||||
$statusAry = $this->mdCustomerTag->statusAry();
|
||||
$typeAry = $this->mdCustomerTag->typeAry();
|
||||
$showAry = $this->mdCustomerTag->showAry();
|
||||
$lists = array();
|
||||
$where = ["status<>-1" => null, 'pid' => 0];
|
||||
$where['tag_type'] = $params['tag_type'] ? $params['tag_type'] : 0;
|
||||
if (strlen($params['status'])) {
|
||||
$where['status'] = $params['status'];
|
||||
}
|
||||
@@ -81,6 +88,8 @@ class Tag extends HD_Controller
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
$tag_type = $this->input->get('tag_type');
|
||||
!$tag_type && $tag_type = 0;
|
||||
if ($id) {
|
||||
$url = "/receiver/tag/edit";
|
||||
$re = $this->mdCustomerTag->get(['id' => $id]);
|
||||
@@ -98,7 +107,7 @@ class Tag extends HD_Controller
|
||||
$type = 'checkbox';
|
||||
}
|
||||
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'type' => $type, 'show' => $show,
|
||||
'typeAry' => $this->mdCustomerTag->typeAry(), 'showAry' => $this->mdCustomerTag->showAry(), 'url' => $url];
|
||||
'typeAry' => $this->mdCustomerTag->typeAry(), 'showAry' => $this->mdCustomerTag->showAry(), 'url' => $url,'tag_type'=>$tag_type];
|
||||
return $this->show_view('/receiver/tag/edit');
|
||||
}
|
||||
|
||||
@@ -113,8 +122,14 @@ class Tag extends HD_Controller
|
||||
if ($re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!');
|
||||
}
|
||||
$id = $this->mdCustomerTag->add(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']
|
||||
, 'show' => $params['show']]);
|
||||
$add_data = [
|
||||
'name' => $params['name'],
|
||||
'sort' => $params['sort'],
|
||||
'type' => $params['type'],
|
||||
'show' => $params['show']
|
||||
];
|
||||
$params['tag_type'] && $add_data['tag_type'] = $params['tag_type'];
|
||||
$id = $this->mdCustomerTag->add($add_data);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
@@ -157,6 +172,9 @@ class Tag extends HD_Controller
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '标签不存在!');
|
||||
}
|
||||
if ($re['tag_type'] == 2) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '该标签不能删除!');
|
||||
}
|
||||
$this->mdCustomerTag->update(['status' => '-1'], ['id' => $id]);
|
||||
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn') && $re['qy_id']) {//正试才能修改企业标签
|
||||
$this->load->library('wx_qyapi', ['app' => 'lichene']);
|
||||
@@ -180,7 +198,7 @@ class Tag extends HD_Controller
|
||||
$add_tag = $del_tag = $edit_tag = [];
|
||||
foreach ($options as $key => $value) {
|
||||
$sort = intval($value['sort']);
|
||||
$data = ['name' => $value['name'], 'status' => $value['status'], 'sort' => $sort];
|
||||
$data = ['name' => $value['name'], 'status' => $value['status'], 'sort' => $sort, 'tag_type' => $re['tag_type']];
|
||||
if ($value['status'] == -1 && $value['qy_id']) {//删除标签
|
||||
$del_tag[] = $value['qy_id'];
|
||||
}
|
||||
@@ -197,7 +215,7 @@ class Tag extends HD_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn')) {//正试才能修改企业标签
|
||||
if (false !== strpos($_SERVER['HTTP_HOST'], 'admin.liche.cn') && !$re['tag_type']) {//正试才能修改企业标签
|
||||
$this->load->library('wx_qyapi', ['app' => 'lichene']);
|
||||
if (count($add_tag)) {//新增标签
|
||||
if (!$re['qy_id']) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,7 +63,9 @@ class order extends HD_Controller
|
||||
$config['bizs'] = [
|
||||
1 => ['biz_name' => '泉州零跑品牌店', 'ids' => '63', 'rowspan' => 1],
|
||||
2 => ['biz_name' => '泉州渠道', 'not_ids' => '63', 'city_id' => '350500', 'show' => 'order'],
|
||||
3 => ['biz_name' => '厦门渠道', 'city_id' => '350200', 'show' => 'order']];
|
||||
3 => ['biz_name' => '厦门渠道', 'city_id' => '350200', 'show' => 'order'],
|
||||
4 => ['biz_name' => '福州渠道', 'city_id' => '350100', 'show' => 'order'],
|
||||
];
|
||||
$res = $this->commonSelect($params, $config);
|
||||
$this->data['info'] = $res['info'];
|
||||
$this->data['params'] = $res['params'];
|
||||
@@ -86,7 +88,10 @@ class order extends HD_Controller
|
||||
2 => ['biz_name' => '宁德哪吒代理店', 'type' => 3, 'city_id' => '350900', 'show' => 'order'],
|
||||
3 => ['biz_name' => '厦门哪吒订单中心', 'city_id' => '350200', 'show' => 'order'],
|
||||
4 => ['biz_name' => '泉州哪吒订单中心', 'city_id' => '350500', 'show' => 'order'],
|
||||
5 => ['biz_name' => '福州哪吒订单中心', 'city_id' => '350100', 'show' => 'order']];
|
||||
5 => ['biz_name' => '福州哪吒订单中心', 'city_id' => '350100', 'show' => 'order'],
|
||||
6 => ['biz_name' => '漳州哪吒品牌店', 'type' => 1, 'city_id' => '350600', 'show' => 'order'],
|
||||
7 => ['biz_name' => '漳州哪吒代理店', 'type' => 3, 'city_id' => '350600', 'show' => 'order'],
|
||||
];
|
||||
$res = $this->commonSelect($params, $config);
|
||||
$this->data['info'] = $res['info'];
|
||||
$this->data['params'] = $res['params'];
|
||||
@@ -114,13 +119,14 @@ class order extends HD_Controller
|
||||
6 => ['biz_name' => '三明代理店', 'type' => 3, 'city_id' => '350400'],
|
||||
7 => ['biz_name' => '南平代理店', 'type' => 3, 'city_id' => '350700'],
|
||||
8 => ['biz_name' => '漳州代理店', 'type' => 3, 'city_id' => '350600'],
|
||||
9 => ['biz_name' => '厦门代理店', 'type' => 3, 'city_id' => '350200'],
|
||||
];
|
||||
$res = $this->common2Select($params, $config);
|
||||
$this->data['info'] = $res['info'];
|
||||
$this->data['params'] = $res['params'];
|
||||
$this->data['url'] = '/stats/order/get_agent';
|
||||
$this->data['type_name'] = '代理店';
|
||||
$this->data['_title'] = '代理店品牌店群';
|
||||
$this->data['_title'] = '代理店群';
|
||||
return $this->show_view('stats/order/common2', true);
|
||||
}
|
||||
|
||||
@@ -140,12 +146,12 @@ class order extends HD_Controller
|
||||
$this->data['params'] = $res['params'];
|
||||
$this->data['url'] = '/stats/order/get_partner';
|
||||
$this->data['type_name'] = '合伙店';
|
||||
$this->data['_title'] = '合伙店品牌店群';
|
||||
$this->data['_title'] = '合伙店群';
|
||||
return $this->show_view('stats/order/common2', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:东风品牌店群
|
||||
* Notes:品牌店群
|
||||
* Created on: 2022/8/17 14:17
|
||||
* Created by: dengbw
|
||||
* @return bool|void
|
||||
@@ -157,13 +163,18 @@ class order extends HD_Controller
|
||||
$config['bizs'] = [
|
||||
1 => ['biz_name' => '厦门东风', 'ids' => '20', 'rowspan' => 1],
|
||||
2 => ['biz_name' => '晋江东风', 'ids' => '99'],
|
||||
3 => ['biz_name' => '福州东风', 'ids' => '55']];
|
||||
3 => ['biz_name' => '福州东风', 'ids' => '55'],
|
||||
4 => ['biz_name' => '厦门哪吒', 'ids' => '191'],
|
||||
5 => ['biz_name' => '宁德哪吒', 'ids' => '70'],
|
||||
6 => ['biz_name' => '漳州哪吒', 'ids' => '160'],
|
||||
7 => ['biz_name' => '泉州零跑', 'ids' => '63'],
|
||||
];
|
||||
$res = $this->common2Select($params, $config);
|
||||
$this->data['info'] = $res['info'];
|
||||
$this->data['params'] = $res['params'];
|
||||
$this->data['url'] = '/stats/order/';
|
||||
$this->data['type_name'] = '品牌店';
|
||||
$this->data['_title'] = '东风品牌店群';
|
||||
$this->data['_title'] = '品牌店群';
|
||||
return $this->show_view('stats/order/common2', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ref Finance.php
|
||||
*/
|
||||
class Supplier extends HD_Controller{
|
||||
protected $log_dir;
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model("sys/sys_supplier_model", 'supplier_model');
|
||||
$this->load->model('biz/biz_settle_srv_model');
|
||||
|
||||
$this->log_dir = 'sys_' . get_class($this);
|
||||
}
|
||||
|
||||
public function index(){
|
||||
return $this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$params = $this->input->get();
|
||||
|
||||
$where = array();
|
||||
if ($params['keyword']){
|
||||
$params['keyword'] = trim($params['keyword']);
|
||||
$where["(title like '%{$params['keyword']}%' or short like '%{$params['keyword']}%')"] = null;
|
||||
}
|
||||
|
||||
if(strlen($params['status']) > 0){
|
||||
$where['status'] = $params['status'];
|
||||
} else {
|
||||
$params['status'] = '';
|
||||
}
|
||||
|
||||
if($params['type']){
|
||||
$where['type'] = $params['type'];
|
||||
} else {
|
||||
$params['type'] = '';
|
||||
}
|
||||
|
||||
$page = $params['page'];
|
||||
$page = !$page ? 1 : $page;
|
||||
$size = $params['size'];
|
||||
$size = !$size ? 20 : $size;
|
||||
|
||||
$statusAry = $this->supplier_model->status_ary();
|
||||
$typeAry = $this->supplier_model->type_ary();
|
||||
|
||||
$count = $this->supplier_model->count($where);
|
||||
$lists = array();
|
||||
if($count){
|
||||
$orderby = 'status desc, id desc';
|
||||
$select = '*';
|
||||
$rows = $this->supplier_model->select($where, $orderby, $page, $size, $select);
|
||||
foreach($rows as $k => $v){
|
||||
$lists[] = array(
|
||||
'id' => $v['id'],
|
||||
'title' => $v['title'],
|
||||
'short' => $v['short'],
|
||||
'type' => $v['type'],
|
||||
'type_name' => $typeAry[$v['type']],
|
||||
'jsondata' => json_decode($v['jsondata'], true),
|
||||
'status' => $v['status'],
|
||||
'status_name' => $statusAry[$v['status']],
|
||||
'c_time' => date('Y-m-d H:i:s', $v['c_time'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['statusAry'] = $statusAry;
|
||||
$this->data['typeAry'] = $typeAry;
|
||||
$this->data['pager'] = array('count'=>ceil($count/$size),'curr'=>$page,'totle'=>$count);
|
||||
$this->data['_title'] = '供应商';
|
||||
$this->show_view('sys/supplier/lists',true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
$id = $this->input->get('id');
|
||||
if($id){
|
||||
$row = $this->supplier_model->get(array('id' => $id));
|
||||
$info = array(
|
||||
'id' => $row['id'],
|
||||
'title' => $row['title'],
|
||||
'short' => $row['short'],
|
||||
'type' => $row['type'],
|
||||
'jsondata' => json_decode($row['jsondata'], true),
|
||||
'status' => $row['status'],
|
||||
);
|
||||
$action = '/sys/supplier/edit';
|
||||
$title = '编辑供应商';
|
||||
} else {
|
||||
$info = array(
|
||||
'title' => '',
|
||||
'short' =>'',
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
);
|
||||
$action = '/sys/supplier/add';
|
||||
$title = '新增供应商';
|
||||
}
|
||||
|
||||
$this->data['info'] = $info;
|
||||
$this->data['action'] = $action;
|
||||
$this->data['statusAry'] = $this->supplier_model->status_ary();
|
||||
$this->data['typeAry'] = $this->supplier_model->type_ary();
|
||||
$this->data['_title'] = $title;
|
||||
$this->show_view('sys/supplier/get');
|
||||
}
|
||||
|
||||
public function add(){
|
||||
$info = $this->input->post('info');
|
||||
|
||||
$type = trim($info['type']);
|
||||
if(!$type){
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择供应商类型');
|
||||
}
|
||||
|
||||
$title = trim($info['title']);
|
||||
if(!$title){
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入供应商名字');
|
||||
}
|
||||
$where = array("title like '%{$title}%'" => null, "type" => $type);
|
||||
$count = $this->supplier_model->count($where);
|
||||
if($count>0){
|
||||
return $this->show_json(SYS_CODE_FAIL, '供应商已经存在');
|
||||
}
|
||||
|
||||
$short = trim($info['short']);
|
||||
$short = $this->short_check($short, $type, $info['id']);
|
||||
|
||||
$add = array(
|
||||
'title' => $title,
|
||||
'short' => $short,
|
||||
'jsondata' => json_encode(array()),
|
||||
'type' => intval($type),
|
||||
'status' => intval($info['status']),
|
||||
'c_time' => time(),
|
||||
);
|
||||
|
||||
$id = $this->supplier_model->add($add);
|
||||
if(!$id){
|
||||
debug_log("[error]# " . $this->supplier_model->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function edit(){
|
||||
$info = $this->input->post('info');
|
||||
|
||||
$row = $this->supplier_model->get(array('id' => $info['id']));
|
||||
if (!$row){
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误:ID不存在');
|
||||
}
|
||||
|
||||
$type = trim($info['type']);
|
||||
if(!$type){
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择供应商类型');
|
||||
}
|
||||
|
||||
$title = trim($info['title']);
|
||||
if(!$title){
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入供应商名字');
|
||||
}
|
||||
$where = array("title like '%{$title}%'" => null, "type" => $type, "id<>{$info['id']}" => null);
|
||||
$count = $this->supplier_model->count($where);
|
||||
if($count>0){
|
||||
return $this->show_json(SYS_CODE_FAIL, '供应商已经存在');
|
||||
}
|
||||
|
||||
$short = trim($info['short']);
|
||||
$short = $this->short_check($short, $type, $info['id']);
|
||||
|
||||
$upd = array(
|
||||
'title' => $title,
|
||||
'short' => $short,
|
||||
'jsondata' => json_encode(array()),
|
||||
'type' => intval($type),
|
||||
'status' => intval($info['status']),
|
||||
);
|
||||
|
||||
$ret = $this->supplier_model->update($upd, array('id' => $info['id']));
|
||||
if(!$ret){
|
||||
debug_log("[error]# " . $this->supplier_model->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
|
||||
# title修改要同步
|
||||
if ($row['title'] != $title){
|
||||
$upd = array(
|
||||
'title' => $title,
|
||||
"jsondata = json_set(jsondata, '$.supplier_title', '{$title}')" => null,
|
||||
);
|
||||
$where = array(
|
||||
'type' => intval($type),
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.supplier_id')) = '{$info['id']}'" => null,
|
||||
);
|
||||
$this->biz_settle_srv_model->update($upd, $where);
|
||||
}
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
private function short_check($short='', $type=2, $id=0){
|
||||
$short = trim($short);
|
||||
if (!$short){
|
||||
return $short;
|
||||
}
|
||||
|
||||
$short = str_replace(',',',', $short);
|
||||
$short = str_replace(' ',',', $short);
|
||||
$short = str_replace(' ',',', $short);
|
||||
$shorts = explode(',', $short);
|
||||
$shorts_new = array();
|
||||
foreach ($shorts as $short){
|
||||
if (!$short){
|
||||
continue;
|
||||
}
|
||||
$shorts_new[] = $short;
|
||||
$where = array("short like '%{$short}%'" => null, "type" => $type);
|
||||
$id && $where["id<>{$id}"] = null;
|
||||
$count = $this->supplier_model->count($where);
|
||||
if($count>0){
|
||||
$this->show_json(SYS_CODE_FAIL, "简称'{$short}'已经存在");exit();
|
||||
}
|
||||
}
|
||||
$short = implode(',', $shorts_new);
|
||||
return $short;
|
||||
}
|
||||
|
||||
function edit_status(){
|
||||
$id = $this->input->post('id');
|
||||
$status = $this->input->post('status');
|
||||
|
||||
$upd = array('status' => $status);
|
||||
$where = array('id' => $id);
|
||||
|
||||
$ret = $this->supplier_model->update($upd, $where);
|
||||
if(!$ret){
|
||||
debug_log("[error]# " . $this->supplier_model->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
public function del(){
|
||||
// TODO: Implement del() method.
|
||||
}
|
||||
|
||||
public function batch(){
|
||||
// TODO: Implement batch() method.
|
||||
}
|
||||
|
||||
public function export(){
|
||||
// TODO: Implement export() method.
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Notes:报名管理
|
||||
* Created on: 2020/5/18 12:45
|
||||
* Created on: 2023/3/27 12:45
|
||||
* Created by: dengbw
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
Class Enroll extends HD_Controller
|
||||
{
|
||||
private $statusAry = array(-1 => '已失效', 0 => '未核销', 1 => '已核销');
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('topics/topics_model', 'mdTopics');
|
||||
$this->load->model('topics/topic_modules_model', 'mdTopicModules');
|
||||
$this->load->model('topics/topic_module_enroll_model', 'mdModuleEnroll');
|
||||
$this->load->model('topics/topic_module_enrolldata_model', 'mdModuleEnrolldata');
|
||||
$this->load->model('topics/topic_enroll_model', 'mdEnroll');
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -29,182 +26,81 @@ Class Enroll extends HD_Controller
|
||||
$params = $this->input->get();
|
||||
$params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$params['module_id'] = intval($params['module_id']);
|
||||
|
||||
$params['id'] = intval($params['id']);
|
||||
$res = $this->dataSelect($params);
|
||||
if ($res['code'] == 0) {
|
||||
return $this->show_json(SYS_CODE_FAIL, $res['msg']);
|
||||
}
|
||||
$lists = $res['lists'];
|
||||
$count = $res['count'];
|
||||
$this->data['params'] = $res['params'];
|
||||
$this->data['_title'] = $res['title'] . '列表';
|
||||
$this->data['type'] = $res['type'];
|
||||
$this->data['statusAry'] = $this->statusAry;
|
||||
$this->data['_title'] = $res['title'];
|
||||
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
return $this->show_view('topics/enroll/lists', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名活动列表
|
||||
* @return bool
|
||||
*/
|
||||
public function lists_module()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$page = $params['page'] ? $params['page'] : 1;
|
||||
$size = $params['size'] ? $params['size'] : 20;
|
||||
|
||||
$app_id = $params['app_id'];
|
||||
$search_ary = array("title" => "标题", "module_id" => "ID");
|
||||
|
||||
//根据应用获取模块
|
||||
$where = array('app_id' => $app_id);
|
||||
$rows_topic = $this->mdTopics->select($where);
|
||||
$module_ids = array();
|
||||
if ($rows_topic) {
|
||||
foreach ($rows_topic as $v) {
|
||||
if ($v['module_ids']) {
|
||||
$ids = explode(',', $v['module_ids']);
|
||||
if ($ids) {
|
||||
$module_ids = array_merge($module_ids, $ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
$lists = array();
|
||||
if ($module_ids) {
|
||||
$str_ids = implode(',', $module_ids);
|
||||
$where = array("module_id in ({$str_ids})" => null);
|
||||
if ($params['search_v']) {
|
||||
if ('title' == $params['search_k']) {
|
||||
$where["m.title like '%{$params['search_v']}%'"] = null;
|
||||
} else {
|
||||
$where["m.{$params['search_k']}"] = $params['search_v'];
|
||||
}
|
||||
}
|
||||
!$params['search_k'] && $params['search_k'] = 'title';
|
||||
|
||||
if (strlen($params['status']) > 0) {
|
||||
$where['j.status'] = $params['status'];
|
||||
} else {
|
||||
$where['j.status>=0'] = null;
|
||||
$params['status'] = '';
|
||||
}
|
||||
|
||||
$total = $this->mdModuleEnroll->count_status($where);
|
||||
if ($total) {
|
||||
$orderby = 'id desc';
|
||||
$select = "module_id, title, es_time, ee_time, as_time, ae_time, j.status";
|
||||
$rows = $this->mdModuleEnroll->select_status($where, $orderby, $page, $size, $select);
|
||||
foreach ($rows as $v) {
|
||||
$lists[] = array(
|
||||
'id' => $v['module_id'],
|
||||
'title' => $v['title'],
|
||||
'e_time' => "{$v['es_time']}~{$v['ee_time']}",
|
||||
'a_time' => "{$v['as_time']}~{$v['ae_time']}",
|
||||
'status' => $v['status'],
|
||||
'statusion' => 1 == $v['status'] ? "正常" : "下架",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['params'] = $params;
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['search_ary'] = $search_ary;
|
||||
$this->data['_title'] = '报名活动管理';
|
||||
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
|
||||
|
||||
return $this->show_view('topics/enroll/lists_module', true);
|
||||
return $this->show_view('topics/lists_enroll', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:查找报名数据
|
||||
* Created on: 2020/5/19 16:37
|
||||
* Created on: 2023/3/27 16:37
|
||||
* Created by: dengbw
|
||||
* @param $params
|
||||
* @return array
|
||||
*/
|
||||
private function dataSelect($params)
|
||||
{
|
||||
$where = $lists = array();
|
||||
$title = '活动报名';
|
||||
$type = 0;
|
||||
if ($params['module_id']) {
|
||||
$where['module_id'] = $params['module_id'];
|
||||
$row_en = $this->mdModuleEnroll->get(array('module_id' => $params['module_id']), 'title,type');
|
||||
$title = $row_en['title'];
|
||||
$type = $row_en['type'];
|
||||
} else {
|
||||
//根据应用获取报名列表
|
||||
$app_id = $params['app_id'];
|
||||
$where_topic = array('app_id' => $app_id);
|
||||
$rows_topic = $this->mdTopics->select($where_topic);
|
||||
$module_ids = array();
|
||||
if ($rows_topic) {
|
||||
foreach ($rows_topic as $v) {
|
||||
if ($v['module_ids']) {
|
||||
$ids = explode(',', $v['module_ids']);
|
||||
if ($ids) {
|
||||
$module_ids = array_merge($module_ids, $ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($module_ids) {
|
||||
$str_ids = implode(',', $module_ids);
|
||||
$where["module_id in ({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['module_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (status_verify($params['status'])) {
|
||||
$where['status'] = $params['status'];
|
||||
} else {
|
||||
$params['status'] = -99;
|
||||
}
|
||||
|
||||
if ($params['name']) {
|
||||
$where['name like "%' . $params['name'] . '%"'] = null;
|
||||
$where['topics_id'] = $params['id'];
|
||||
if ($params['nickname']) {
|
||||
$where['nickname like "%' . $params['nickname'] . '%"'] = null;
|
||||
}
|
||||
if ($params['mobile']) {
|
||||
$where['mobile'] = $params['mobile'];
|
||||
}
|
||||
if ($params['code']) {
|
||||
$where['code'] = $params['code'];
|
||||
if ($params['cfrom_id'] || $params['cfrom_id2']) {
|
||||
if ($params['cfrom_id2']) {
|
||||
$where['cf_id'] = $params['cfrom_id2'];
|
||||
} else {
|
||||
$cf_rows = $this->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
|
||||
$cf_ids = array_column($cf_rows, 'id');
|
||||
$cf_ids[] = $params['cfrom_id'];
|
||||
$cf_str_ids = implode(',', array_filter($cf_ids));
|
||||
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
|
||||
}
|
||||
}
|
||||
if ($params['time']) {
|
||||
$time = explode(' ~ ', $params['time']);
|
||||
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
|
||||
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
|
||||
}
|
||||
$count = $this->mdModuleEnrolldata->count($where);
|
||||
$lists = [];
|
||||
$count = $this->mdEnroll->count($where);
|
||||
if ($count) {
|
||||
$select = "id,module_id,name,mobile,code,status,c_time,jsondata";
|
||||
$lists = $this->mdModuleEnrolldata->select($where, "id desc", $params['page'], $params['size'], $select);
|
||||
$map_module = array();
|
||||
if ($lists) {
|
||||
$module_ids = array_unique(array_column($lists, 'module_id'));
|
||||
$str_ids = implode(',', $module_ids);
|
||||
$where_module = array("module_id in ({$str_ids})" => null);
|
||||
$map_module = $this->mdModuleEnroll->map('module_id', '*', $where_module, '', 0, 0, 'module_id, title, descrip');
|
||||
$res = $this->mdEnroll->select($where, "id desc", $params['page'], $params['size']);
|
||||
//获取来源
|
||||
$map_cf_pid = $cf_title_arr = [];
|
||||
$cf_id_arr = array_unique(array_column($res, 'cf_id'));
|
||||
if ($cf_id_arr) {
|
||||
$cf_id_str = implode(',', $cf_id_arr);
|
||||
$res_cfrom = $this->mdCluesCfrom->select(["id in({$cf_id_str})" => null], 'id desc', 0, 0, 'id,title,pid');
|
||||
$cf_pid_arr = array_unique(array_column($res_cfrom, 'pid'));
|
||||
if ($cf_pid_arr) {
|
||||
$cf_pid_str = implode(',', $cf_pid_arr);
|
||||
$map_cf_pid = $this->mdCluesCfrom->map('id', 'title', ["id in({$cf_pid_str})" => null]);
|
||||
}
|
||||
foreach ($res_cfrom as $key => $val) {
|
||||
$title = $val['title'];
|
||||
if ($val['pid']) {//一级分类
|
||||
$map_cf_pid[$val['pid']] && $title = $map_cf_pid[$val['pid']] . '-' . $title;
|
||||
}
|
||||
$cf_title_arr[$val['id']] = $title;
|
||||
}
|
||||
}
|
||||
foreach ($lists as $key => $value) {
|
||||
$json = json_decode($value['jsondata'], true);
|
||||
$module = $map_module[$value['module_id']];
|
||||
$lists[$key]['c_time'] = date('Y-m-d H:i', $value['c_time']);
|
||||
$lists[$key]['status_name'] = $this->statusAry[$value['status']];
|
||||
$lists[$key]['remark'] = $json['remark'] ? $json['remark'] : '';
|
||||
$lists[$key]['title'] = $module['descrip'] ? $module['descrip'] : $module['title'];
|
||||
foreach ($res as $k => $v) {
|
||||
$cf_name = $cf_title_arr[$v['cf_id']] ? $cf_title_arr[$v['cf_id']] : '-';
|
||||
$c_time = date('Y-m-d H:i', $v['c_time']);
|
||||
$lists[] = ['id' => $v['id'],'nickname' => $v['nickname'], 'mobile' => $v['mobile']
|
||||
, 'cf_name' => $cf_name, 'c_time' => $c_time];
|
||||
}
|
||||
}
|
||||
$data['code'] = SYS_CODE_SUCCESS;
|
||||
$data['type'] = $type;
|
||||
$re = $this->mdTopics->get(['id' => $params['id']]);
|
||||
$title = $re['title'] ? $re['title'] . '_报名列表' : '专题报名列表';
|
||||
$data['title'] = $title;
|
||||
$data['lists'] = $lists;
|
||||
$data['count'] = $count;
|
||||
@@ -214,30 +110,6 @@ Class Enroll extends HD_Controller
|
||||
|
||||
public function get()
|
||||
{
|
||||
$id = intval($this->input->get('id'));
|
||||
$module_id = intval($this->input->get('module_id'));
|
||||
if (!$id || !$module_id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$re = $this->mdModuleEnrolldata->get(array("id" => $id));
|
||||
if (!$re || empty($re)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '报名详情不存在!');
|
||||
}
|
||||
$reEn = $this->mdModuleEnroll->get(array('module_id' => $module_id), 'enroll_json,type');
|
||||
$enroll_json = array();
|
||||
if ($reEn['enroll_json'] && $re['jsondata']) {
|
||||
$enroll_json = json_decode($reEn['enroll_json'], true);
|
||||
$jsondata = json_decode($re['jsondata'], true);
|
||||
foreach ($enroll_json as $key => $value) {
|
||||
$jsondata[$key] && $enroll_json[$key]['value'] = $jsondata[$key];
|
||||
}
|
||||
}
|
||||
$re['enroll_json'] = $enroll_json;
|
||||
$re['type'] = $reEn['type'];
|
||||
$re['c_time'] = date('Y-m-d H:i', $re['c_time']);
|
||||
$re['status_name'] = $this->statusAry[$re['status']];
|
||||
$this->data['info'] = $re;
|
||||
return $this->show_view('topics/enroll/edit');
|
||||
}
|
||||
|
||||
public function del()
|
||||
@@ -255,63 +127,22 @@ Class Enroll extends HD_Controller
|
||||
$params = $this->input->get();
|
||||
$params['page'] = 1;
|
||||
$params['size'] = 10000;
|
||||
$params['export'] = 1;
|
||||
$data = $indexs = array();
|
||||
$data = $indexs = [];
|
||||
$res = $this->dataSelect($params);
|
||||
if ($params['module_id']) {
|
||||
if ($params['type'] == 1) {
|
||||
$fileName = '活动报名用户';
|
||||
foreach ($res['lists'] as $key => $value) {
|
||||
$temp['name'] = $value['name'];
|
||||
$temp['mobile'] = $value['mobile'];
|
||||
$temp['code'] = $value['code'];
|
||||
$temp['status_name'] = $value['status_name'];
|
||||
$temp['c_time'] = $value['c_time'];
|
||||
$temp['remark'] = $value['remark'];
|
||||
$data[] = $temp;
|
||||
}
|
||||
$indexs = [
|
||||
'name' => '姓名',
|
||||
'mobile' => '手机号',
|
||||
'code' => '核销码',
|
||||
'status_name' => '状态',
|
||||
'c_time' => '报名时间',
|
||||
"remark" => "备注",
|
||||
];
|
||||
} else {
|
||||
$fileName = '报名用户';
|
||||
foreach ($res['lists'] as $key => $value) {
|
||||
$temp['name'] = $value['name'];
|
||||
$temp['mobile'] = $value['mobile'];
|
||||
$temp['c_time'] = $value['c_time'];
|
||||
$temp['remark'] = $value['remark'];
|
||||
$data[] = $temp;
|
||||
}
|
||||
$indexs = [
|
||||
'name' => '姓名',
|
||||
'mobile' => '手机号',
|
||||
'c_time' => '报名时间',
|
||||
"remark" => "备注",
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$fileName = '活动报名';
|
||||
foreach ($res['lists'] as $key => $value) {
|
||||
$temp['title'] = $value['title'];
|
||||
$temp['name'] = $value['name'];
|
||||
$temp['mobile'] = $value['mobile'];
|
||||
$temp['c_time'] = $value['c_time'];
|
||||
$temp['remark'] = $value['remark'];
|
||||
$data[] = $temp;
|
||||
}
|
||||
$indexs = [
|
||||
'title' => '活动名称',
|
||||
'name' => '姓名',
|
||||
'mobile' => '手机号',
|
||||
'c_time' => '报名时间',
|
||||
"remark" => "备注",
|
||||
];
|
||||
$fileName = $res['title'];
|
||||
foreach ($res['lists'] as $key => $value) {
|
||||
$temp['nickname'] = $value['nickname'];
|
||||
$temp['mobile'] = $value['mobile'];
|
||||
$temp['cf_name'] = $value['cf_name'];
|
||||
$temp['c_time'] = $value['c_time'];
|
||||
$data[] = $temp;
|
||||
}
|
||||
$indexs = [
|
||||
'nickname' => '昵称',
|
||||
'mobile' => '手机号',
|
||||
"cf_name" => "来源",
|
||||
'c_time' => '报名时间',
|
||||
];
|
||||
array_unshift($data, $indexs);
|
||||
$this->load->library('excel');
|
||||
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
|
||||
|
||||
@@ -14,7 +14,6 @@ Class Topics extends AppBase
|
||||
private $moduleAry = array(
|
||||
array('name' => '文本模块', 'tag' => 'text'),
|
||||
array('name' => '广告模块', 'tag' => 'ad'),
|
||||
array('name' => '报名模块', 'tag' => 'enroll'),
|
||||
array("name" => "按钮模块", "tag" => "button")
|
||||
);
|
||||
|
||||
@@ -26,10 +25,10 @@ Class Topics extends AppBase
|
||||
$this->load->model('topics/topic_module_text_model', 'mdModuleText');
|
||||
$this->load->model('topics/topic_module_ad_model', 'mdModuleAd');
|
||||
$this->load->model('topics/topic_module_enroll_model', 'mdModuleEnroll');
|
||||
$this->load->model('topics/topic_module_enrolldata_model', 'mdModuleEnrolldata');
|
||||
$this->load->model('topics/topic_module_button_model', 'mdModuleButton');
|
||||
$this->load->model('topics/topic_user_log_model', 'mdUserLog');
|
||||
$this->load->model("sys/sys_admin_model", 'mdSysAdmin');
|
||||
$this->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,12 +347,22 @@ Class Topics extends AppBase
|
||||
if (!$re || empty($re)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '专题不存在!');
|
||||
}
|
||||
$re['bg_img_url'] = build_qiniu_image_url($re['bg_img']);
|
||||
$info = $re;
|
||||
$json = $info['jsondata'] ? json_decode($info['jsondata'], true) : '';
|
||||
$info['cf_id'] = $json['cf_id'] ? $json['cf_id'] : "";
|
||||
$info['mp_app_id'] = $json['mp_app_id'] ? $json['mp_app_id'] : "";
|
||||
$info['ebiz'] = $json['ebiz'] ? $json['ebiz'] : "";
|
||||
if ($re['cf_id']) {
|
||||
$re_cf = $this->mdCluesCfrom->get(['id' => $re['cf_id']]);
|
||||
if ($re_cf) {
|
||||
if ($re_cf['pid'] == 0) {
|
||||
$info['cfrom_id'] = $re_cf['id'];
|
||||
$info['cfrom_id2'] = 0;
|
||||
} else {
|
||||
$info['cfrom_id'] = $re_cf['pid'];
|
||||
$info['cfrom_id2'] = $re_cf['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$jsonData = $info['jsondata'] ? json_decode($info['jsondata'], true) : '';
|
||||
$info['bg_img_url'] = $re['bg_img'] ? build_qiniu_image_url($re['bg_img']) : '';
|
||||
$info['share_img_url'] = $jsonData['share_img'] ? build_qiniu_image_url($jsonData['share_img']) : '';
|
||||
$_title = '编辑专题';
|
||||
$edit_url = '/topics/topics/edit';
|
||||
} else {
|
||||
@@ -361,9 +370,9 @@ Class Topics extends AppBase
|
||||
$edit_url = '/topics/topics/add';
|
||||
$info['id'] = $id;
|
||||
$info['app_id'] = $app_id;
|
||||
$info['cf_id'] = "";
|
||||
$info['mp_app_id'] = "";
|
||||
$info['ebiz'] = 0;
|
||||
$info['share_img_url'] = '';
|
||||
$info['cfrom_id'] = 0;
|
||||
$info['cfrom_id2'] = 0;
|
||||
}
|
||||
$info['spm'] = $this->input->get('spm');
|
||||
$info['edit_url'] = $edit_url;
|
||||
@@ -386,13 +395,18 @@ Class Topics extends AppBase
|
||||
}
|
||||
$bg_color = $this->input->post('bg_color');
|
||||
$bg_img = $this->input->post('bg_img');
|
||||
|
||||
$share_img = $this->input->post('share_img');
|
||||
$cfrom_id = intval($this->input->post('cfrom_id'));
|
||||
$cfrom_id2 = intval($this->input->post('cfrom_id2'));
|
||||
$jsonData['share_img'] = $share_img ? $share_img : '';
|
||||
$dataItems['app_id'] = $app_id;
|
||||
$dataItems['title'] = $title;
|
||||
$dataItems['bg_color'] = $bg_color;
|
||||
$dataItems['bg_img'] = $bg_img;
|
||||
$dataItems['status'] = 1;
|
||||
$dataItems['c_time'] = time();
|
||||
$dataItems['cf_id'] = $cfrom_id2 ? $cfrom_id2 : $cfrom_id;
|
||||
$dataItems['jsondata'] = json_encode($jsonData, JSON_UNESCAPED_UNICODE);
|
||||
$id = $this->mdTopics->add($dataItems);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '添加失败');
|
||||
@@ -412,9 +426,15 @@ Class Topics extends AppBase
|
||||
}
|
||||
$bg_color = $this->input->post('bg_color');
|
||||
$bg_img = $this->input->post('bg_img');
|
||||
$share_img = $this->input->post('share_img');
|
||||
$cfrom_id = intval($this->input->post('cfrom_id'));
|
||||
$cfrom_id2 = intval($this->input->post('cfrom_id2'));
|
||||
$jsonData['share_img'] = $share_img ? $share_img : '';
|
||||
$dataItems['title'] = $title;
|
||||
$dataItems['bg_color'] = $bg_color;
|
||||
$dataItems['bg_img'] = $bg_img;
|
||||
$dataItems['cf_id'] = $cfrom_id2 ? $cfrom_id2 : $cfrom_id;
|
||||
$dataItems['jsondata'] = json_encode($jsonData, JSON_UNESCAPED_UNICODE);
|
||||
$re = $this->mdTopics->update($dataItems, array('id' => $id));
|
||||
if (!$re) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '修改失败');
|
||||
|
||||
@@ -596,7 +596,6 @@ class OrdersList
|
||||
$count = $this->ci->order_loans_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$this->ci->load->model('sys/sys_finance_model');
|
||||
$fileds = "$t1.o_id,$t1.title,$t1.year,$t1.first_price,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.rid,$t2.id,$t2.name,$t2.mobile,$t2.sid,$t2.finance_id,$t2.money_json,$t2.bill_time,$t2.admin_id";
|
||||
$rows = $this->ci->order_loans_model->select_order($where, "$t2.c_time desc", $page, $size, $fileds);
|
||||
@@ -606,7 +605,10 @@ class OrdersList
|
||||
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
|
||||
$offlineSources = $this->ci->mdCustomers->offlineSources();
|
||||
$finance_arr = array_column($rows, 'finance_id');
|
||||
$finance_rows = $this->ci->sys_finance_model->get_map_by_ids($finance_arr, 'id,title');
|
||||
//$this->ci->load->model('sys/sys_finance_model');
|
||||
//$finance_rows = $this->ci->sys_finance_model->get_map_by_ids($finance_arr, 'id,title');
|
||||
$this->ci->load->model('sys/sys_supplier_model');
|
||||
$finance_rows = $this->ci->sys_supplier_model->get_map_by_ids($finance_arr, 'id,title');
|
||||
//获取销售
|
||||
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
|
||||
!$str_admin_ids && $str_admin_ids = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ class Ordersv2List
|
||||
{
|
||||
private $ci;
|
||||
private $searchTpAry = array('owner_name' => '车主姓名', 'owner_mobile' => '车主手机号', 'name' => '客户姓名', 'mobile' => '客户手机号', 'sid' => '订单号');
|
||||
private $paywayAry = array(0 => '贷款', 1 => '全款');
|
||||
private $paywayAry = array(0 => '按揭', 1 => '全款');
|
||||
private $overAry = array(0 => '7天内', 1 => '14天内', 2=> '30天内', 3=> '大于30天');
|
||||
private $t1 = 'lc_receiver_orders_v2';
|
||||
private $t2 = 'lc_receiver_order_status';
|
||||
@@ -17,9 +17,12 @@ class Ordersv2List
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('receiver/order/receiver_orders_v2_model', 'mdOrders');
|
||||
$this->ci->load->model('receiver/order/receiver_order_status_model');
|
||||
$this->ci->load->model('receiver/order/receiver_order_loans_model', 'order_loans_model');
|
||||
$this->ci->load->model('receiver/order/receiver_order_loans0_model', 'order_loans0_model');
|
||||
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
|
||||
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
|
||||
$this->ci->load->model('app/licheb/app_licheb_channel_biz_model');
|
||||
$this->ci->load->model('app/liche/app_liche_orders_model');
|
||||
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
|
||||
$this->ci->load->model("biz/biz_model");
|
||||
@@ -28,7 +31,8 @@ class Ordersv2List
|
||||
$this->ci->load->model('auto/auto_attr_model');
|
||||
$this->ci->load->model('items/items_model', 'mdItems');
|
||||
$this->ci->load->model('area_model');
|
||||
$this->ci->load->model('sys/sys_finance_model');
|
||||
//$this->ci->load->model('sys/sys_finance_model');
|
||||
$this->ci->load->model('sys/sys_supplier_model');
|
||||
|
||||
$this->ci->load->library('receiver/orders_v2_entity');
|
||||
$this->ci->load->library('receiver/orders_status_entity');
|
||||
@@ -44,11 +48,14 @@ class Ordersv2List
|
||||
!$params['biz_type'] && $params['biz_type'] = '';
|
||||
!strlen($params['over_id']) && $params['over_id'] = '';
|
||||
!strlen($params['is_bill']) && $params['is_bill'] = '';
|
||||
!strlen($params['if_usedcar']) && $params['if_usedcar'] = '';
|
||||
$fieldAry = $this->get_fields($status_pid,0,$params['status']);
|
||||
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
|
||||
#$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
|
||||
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources_search();
|
||||
$show_info['paywayAry'] = $this->paywayAry;//付款方式
|
||||
$show_info['overAry'] = $this->overAry;
|
||||
$show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
|
||||
$show_info['usedcarAry'] = array(1=>'是', 0=>'否');
|
||||
//渠道经理
|
||||
$show_info['qdjl_lists'] = $this->ci->mdLichebUsers->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0')
|
||||
, 'id desc', 0, 0, 'id,uname as name');
|
||||
@@ -210,6 +217,7 @@ class Ordersv2List
|
||||
$where["{$this->t1}.over_time<="] = date('Y-m-d',time()+$e_day*24*60*60);
|
||||
}
|
||||
}
|
||||
$where["{$this->t1}.brand_id in (select id from lc_auto_brand where status > -1)"] = null;
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$this->t1}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
@@ -267,10 +275,13 @@ class Ordersv2List
|
||||
$where = ["{$this->t1}.status>=" => 0];
|
||||
$where["{$this->t1}.item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
|
||||
}
|
||||
$fileds = "{$this->t1}.id,{$this->t1}.name,{$this->t1}.mobile,{$this->t1}.brand_id,{$this->t1}.s_id,{$this->t1}.v_id,
|
||||
if (strlen($params['if_usedcar'])) {
|
||||
$where["{$this->t1}.if_usedcar"] = $params['if_usedcar'];
|
||||
}
|
||||
$fileds = "{$this->t1}.id,{$this->t1}.name,{$this->t1}.mobile,{$this->t1}.brand_id,{$this->t1}.s_id,{$this->t1}.v_id,{$this->t1}.if_usedcar,
|
||||
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,{$this->t1}.fines,
|
||||
{$this->t1}.biz_id,{$this->t1}.bill_time,{$this->t1}.customer_id,{$this->t1}.owner_name,{$this->t1}.owner_mobile,{$this->t1}.main_type,{$this->t1}.info_json,
|
||||
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time,{$this->t1}.sale_id,{$this->t1}.finance_id,{$this->t1}.refund_time,
|
||||
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time,{$this->t1}.sale_id,{$this->t1}.finance_id,{$this->t1}.finance_id0,{$this->t1}.refund_time,
|
||||
{$this->t1}.ck_time,{$this->t1}.admin_id";
|
||||
if(strlen($params['status_pid'])){
|
||||
$where["{$this->t1}.brand_id>"] = 0;
|
||||
@@ -389,6 +400,7 @@ class Ordersv2List
|
||||
}
|
||||
$open_url = '/receiver/orderv2/orders/get?id=';
|
||||
$id_card_append = $info_json['c_owner_cardid'] ? '<br>'.$info_json['c_owner_cardid'] : '';
|
||||
$id_card = $info_json['c_owner_cardid'] ? '="'.$info_json['c_owner_cardid'].'"' : '';
|
||||
$fields['name'] = $size > 1000 ? $name
|
||||
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . $id_card_append . '</a>';
|
||||
} else {
|
||||
@@ -398,8 +410,9 @@ class Ordersv2List
|
||||
$id_card_append = $info_json['c_cardid'] ? '<br>'.$info_json['c_cardid'] : '';
|
||||
$fields['name'] = $size > 1000 ? $val['name']
|
||||
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $val['name'] . $o_tp . '<br>' . $val['mobile'] . $id_card_append .'</a>';
|
||||
$id_card = $info_json['c_cardid'] ? '="'.$info_json['c_cardid'].'"' : '';
|
||||
}
|
||||
$fields['id_card'] = $info_json['c_owner_cardid'] ? '="'.$info_json['c_owner_cardid'].'"' : '';
|
||||
$fields['id_card'] = $id_card;
|
||||
$fields['mobile'] = $size > 1000 ? '="'.$mobile.'"' : $mobile;
|
||||
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
|
||||
$fields['price_car'] = number_format($this->ci->orders_v2_entity->total_price($val['id'],$val['money_json']),2);
|
||||
@@ -443,6 +456,9 @@ class Ordersv2List
|
||||
$fields['over_time'] = $val['over_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($val['over_time'])) : '';
|
||||
$fields['refund_time'] = $val['refund_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($val['refund_time'])) : '';
|
||||
$fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
|
||||
$fields['if_usedcar_name'] = $val['if_usedcar'] ? '是':'';
|
||||
$if_usedcar_name = $val['if_usedcar'] ? ' (二手车)':'';
|
||||
$if_usedcar_name && $fields['vin'] && $size<1000 && $fields['vin'] = "{$fields['vin']}{$if_usedcar_name}";
|
||||
$fields['vin'] && $fields['car_name'] = $fields['car_name']."<br>".$fields['vin'];
|
||||
$fields['ck_time'] = $val['ck_time'];
|
||||
|
||||
@@ -469,13 +485,25 @@ class Ordersv2List
|
||||
}
|
||||
$fields['address'] = $info_json['c_address'];
|
||||
}
|
||||
if(!$val['payway']){ //分期
|
||||
$finance_row = $this->ci->sys_finance_model->get(['id' => $val['finance_id']], 'id,title');
|
||||
if(!$val['payway']){ //按揭
|
||||
//$finance_row = $this->ci->sys_finance_model->get(['id' => $val['finance_id']], 'id,title');
|
||||
$finance_row = $this->ci->sys_supplier_model->get(['id' => $val['finance_id'], 'type'=>3], 'id,title');
|
||||
$is_sure = $this->ci->receiver_order_status_model->count(['o_id'=>$val['id'],'pid_status'=>1,'status'=>2]);
|
||||
$finance_row && $fields['price'] = "{$fields['payway_name']}({$finance_row['title']})<br>{$fields['price_car']}";
|
||||
$fields['pro_loan'] = $finance_row['title'];
|
||||
$fields['price_loan'] = $money_json['price_loan'];
|
||||
$fields['is_sure'] = $is_sure ? '是':'否';
|
||||
$loan = $this->ci->order_loans_model->get(['o_id' => $val['id']]);
|
||||
$fields['is_tiexi'] = intval($loan['is_tiexi']) ? '是': '';
|
||||
|
||||
// 首付按揭
|
||||
$finance_row0 = $this->ci->sys_supplier_model->get(['id' => $val['finance_id0'], 'type'=>3], 'id,title');
|
||||
$is_sure0 = $this->ci->app_liche_orders_model->count(['o_id'=>$val['id'],'type'=>8,'status'=>1]);
|
||||
$fields['pro_loan0'] = $finance_row0['title'];
|
||||
$fields['price_loan0'] = $money_json['price_loan0'];
|
||||
$fields['is_sure0'] = $is_sure0 ? '是':'否';
|
||||
$loan0 = $this->ci->order_loans0_model->get(['o_id' => $val['id']]);
|
||||
$fields['is_tiexi'] = intval($loan0['is_tiexi']) ? '是': '';
|
||||
}
|
||||
$srv_info = $this->get_srv_info($val);
|
||||
$fields['srv_info_total'] = $srv_info['total'] > 0 ? $srv_info['total'] : '';
|
||||
@@ -609,7 +637,8 @@ class Ordersv2List
|
||||
$id_card_append = $info_json['c_owner_cardid'] ? '<br>'.$info_json['c_owner_cardid'] : '';
|
||||
$fields['name'] = $size > 1000 ? $name
|
||||
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . $id_card_append .'</a>';
|
||||
$fields['mobile'] = $mobile;
|
||||
$fields['id_card'] = $info_json['c_owner_cardid'] ? '="'.$info_json['c_owner_cardid'].'"' : '';
|
||||
$fields['mobile'] = $size > 1000 ? '="'.$mobile.'"' : $mobile;
|
||||
$fields['biz_name'] = $bizs[$val['biz_id']];
|
||||
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
|
||||
$of_title = '-';
|
||||
@@ -656,6 +685,7 @@ class Ordersv2List
|
||||
$fields1['v_name'] = ['title' => '车型'];
|
||||
$fields1['cor_name'] = ['title' => '车身颜色'];
|
||||
$fields1['vin'] = ['title' => 'vin码'];
|
||||
$fields1['if_usedcar_name'] = ['title' => '二手车'];
|
||||
$fields1['city_name'] = ['title'=>'城市'];
|
||||
$fields1['biz_type'] = ['title'=>'门店类型'];
|
||||
$fields1['biz_name'] = ['title' => '门店'];
|
||||
@@ -701,16 +731,21 @@ class Ordersv2List
|
||||
}
|
||||
$fields = array_merge($fields1, $fields2);
|
||||
if ($export) {
|
||||
unset($fields['price'],$fields['c_time'],$fields['car_name'],$fields['vin'],$fields['of_title']);
|
||||
unset($fields['price'],$fields['c_time'],$fields['car_name'],$fields['of_title']);
|
||||
$fields['payway_name'] = ['title'=>'付款方式'];
|
||||
$fields['pro_loan0'] = ['title'=>'首付按揭-金融机构'];
|
||||
//$fields['is_tiexi0'] = ['title'=>'首付按揭-贴息']; // 首付按揭不需要贴息选项
|
||||
$fields['price_loan0'] = ['title'=>'首付按揭-金额'];
|
||||
$fields['is_sure0'] = ['title'=>'首付按揭-确认到款(是/否)'];
|
||||
$fields['pro_loan'] = ['title'=>'金融机构'];
|
||||
$fields['price_loan'] = ['title'=>'贷款金额'];
|
||||
$fields['is_tiexi'] = ['title'=>'贴息'];
|
||||
$fields['price_loan'] = ['title'=>'按揭金额'];
|
||||
$fields['is_sure'] = ['title'=>'确认到款(是/否)'];
|
||||
$fields['price_car'] = ['title'=>'最终售价'];
|
||||
$fields['srv_info_total'] = ['title'=>'服务费'];
|
||||
$fields['srv_info_fee_carno'] = ['title'=>'服务-上牌'];
|
||||
$fields['srv_info_price_finance'] = ['title'=>'服务-金融'];
|
||||
$fields['srv_info_price_fine_select'] = ['title'=>'服务-精品选装'];
|
||||
$fields['srv_info_total'] = ['title'=>'手续费'];
|
||||
$fields['srv_info_fee_carno'] = ['title'=>'手续费-上牌'];
|
||||
$fields['srv_info_price_finance'] = ['title'=>'手续费-按揭'];
|
||||
$fields['srv_info_price_fine_select'] = ['title'=>'手续费-精品选装'];
|
||||
$fields['srv_info_price_fine_select_detail'] = ['title'=>'精品选装内容'];
|
||||
!$fields['c_time'] && $fields['c_time'] = ['title' => '订单时间'];
|
||||
!$fields['over_time'] && $fields['over_time'] = ['title' => '止交付时间'];
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<input type="hidden" name="id" value="<?= $row['id'] ?>"/>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">姓名:</label>
|
||||
<div class="am-para-input w300">
|
||||
<label class="am-para-label w120">姓名:</label>
|
||||
<div class="am-para-input w300" style="margin-left: 130px">
|
||||
<input type="text" placeholder="输入姓名" name="uname" v-model="info.uname" maxlength="30"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">手机号:</label>
|
||||
<div class="am-para-input w300">
|
||||
<label class="am-para-label w120">手机号:</label>
|
||||
<div class="am-para-input w300" style="margin-left: 130px">
|
||||
<input type="text" placeholder="输入手机号" name="mobile" v-model="info.mobile" maxlength="30"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">角色:</label>
|
||||
<div class="am-para-input w100">
|
||||
<label class="am-para-label w120">默认角色:</label>
|
||||
<div class="am-para-input w100" style="margin-left: 130px">
|
||||
<select name="group_id" v-model="info.group_id" @change="resetBiz">
|
||||
<option value="">选择角色</option>
|
||||
<option :value="i" v-for="(v,i) in groups">{{v}}</option>
|
||||
@@ -23,8 +23,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" v-if="info.group_id==4">
|
||||
<label class="am-para-label">所在城市:</label>
|
||||
<div class="am-para-input w100">
|
||||
<label class="am-para-label w120">默认角色城市:</label>
|
||||
<div class="am-para-input w100" style="margin-left: 130px">
|
||||
<select v-model="info.city_id">
|
||||
<option value="0">选择城市</option>
|
||||
<option :value="v.city_id" v-for="(v,i) in show_info.cityList">{{v.name}}</option>
|
||||
@@ -32,8 +32,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">门店:</label>
|
||||
<div class="am-para-inline lh-default">
|
||||
<label class="am-para-label w120">默认角色门店:</label>
|
||||
<div class="am-para-input lh-default" style="margin-left: 130px">
|
||||
<button class="am-btn am-btn-default" type="button" @click="brandModal">选择门店</button>
|
||||
<div class="mt5">
|
||||
<button class="am-btn am-btn-default mr5" type="button" @click="brandModal"
|
||||
@@ -43,6 +43,36 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w120">第二角色:</label>
|
||||
<div class="am-para-input w100" style="margin-left: 130px">
|
||||
<select name="group_id1" v-model="info.group_id1" @change="resetBiz1">
|
||||
<option value="0">选择角色</option>
|
||||
<option :value="i" v-for="(v,i) in groups">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" v-if="info.group_id1==4">
|
||||
<label class="am-para-label w120">第二角色城市:</label>
|
||||
<div class="am-para-input w100" style="margin-left: 130px">
|
||||
<select v-model="info.city_id1">
|
||||
<option value="0">选择城市</option>
|
||||
<option :value="v.city_id" v-for="(v,i) in show_info.cityList">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w120">第二角色门店:</label>
|
||||
<div class="am-para-input lh-default" style="margin-left: 130px">
|
||||
<button class="am-btn am-btn-default" type="button" @click="brandModal1">选择门店</button>
|
||||
<div class="mt5">
|
||||
<button class="am-btn am-btn-default mr5" type="button" @click="brandModal1"
|
||||
v-for="(item) in selectedBrands1">{{item.name}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-success" type="button" @click='saveEdit'>提交</button>
|
||||
@@ -134,6 +164,96 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="brand-modal1" style="display:none">
|
||||
<div class="modal-body">
|
||||
<div class="header">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select title="城市" v-model="search_info.city_id1">
|
||||
<option value="0">城市</option>
|
||||
<template v-for="(v,i) in cityAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select title="行政区" v-model="search_info.county_id1">
|
||||
<option value="0">行政区</option>
|
||||
<template v-for="(v,i) in countyAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select title="类型" v-model="search_info.type1">
|
||||
<option value="0">类型</option>
|
||||
<template v-for="(v,i) in show_info.typeAry">
|
||||
<option :value="i">{{v}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<a class="am-btn am-btn-success am-btn-sm w100" @click="search1()">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top: 10px;">
|
||||
<div class="vuetable-body-wrapper">
|
||||
<table class="vuetable table table-middle table-hover fixed">
|
||||
<colgroup>
|
||||
<col class="vuetable-col-title" style="width: 50%;">
|
||||
<col class="vuetable-col-actions text-right" style="width: 10%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="vuetable-th-slot-title">商家名</th>
|
||||
<th class="vuetable-th-slot-actions text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot></tfoot>
|
||||
<tbody class="vuetable-body">
|
||||
<tr v-for="(v,i) in brandsList1">
|
||||
<td class="vuetable-slot">
|
||||
{{v.name}}
|
||||
</td>
|
||||
<td class="vuetable-slot text-right">
|
||||
<button type='button' v-if="v.is_checked==0 || !v.is_checked"
|
||||
class="btn btn-sm btn-success"
|
||||
@click="addItem1(i)">添加
|
||||
</button>
|
||||
<button type='button' v-if="v.is_checked==1" class="btn btn-sm btn-danger"
|
||||
@click="removeItem1(v)">删除
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<span class="pull-left text-muted">第{{brandsPage.page}}页(每页{{brandsPage.pageLimit}}条,共{{brandsPage.pageCount}}条)</span>
|
||||
<nav class="pull-right" aria-label="Page navigation">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li>
|
||||
<a href="javascript:void(0);" @click="beforeShopPage1();" aria-label="上一页">
|
||||
<span class="glyphicon glyphicon-menu-left"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="brandsPage.hasNext">
|
||||
<a href="javascript:void(0);" @click="afterShopPage1();" aria-label="下一页">
|
||||
<span class="glyphicon glyphicon-menu-right"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var vue_app;
|
||||
@@ -149,11 +269,13 @@
|
||||
brandsPage: [],
|
||||
bizIds: [],
|
||||
brandsList: [],
|
||||
brandsList1: [],
|
||||
selectedBrands: [],
|
||||
selectedBrands1: [],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
show_info: {cityList: [], typeAry: []},
|
||||
search_info: {city_id: 0, county_id: 0, type: 0}
|
||||
search_info: {city_id: 0, county_id: 0, type: 0, city_id1: 0, county_id1: 0, type1: 0}
|
||||
},
|
||||
computed: {},
|
||||
created: function () {
|
||||
@@ -165,6 +287,7 @@
|
||||
vm.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.groups = <?=json_encode($groups, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.selectedBrands = <?=json_encode($selectedBrands, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.selectedBrands1 = <?=json_encode($selectedBrands1, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.show_info = <?=json_encode($show_info, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.init_citys();
|
||||
},
|
||||
@@ -172,6 +295,9 @@
|
||||
resetBiz: function () {
|
||||
this.selectedBrands = [];
|
||||
},
|
||||
resetBiz1: function () {
|
||||
this.selectedBrands1 = [];
|
||||
},
|
||||
search: function () {
|
||||
this.changePage(1);
|
||||
},
|
||||
@@ -256,7 +382,8 @@
|
||||
page: that.brandsThPage,
|
||||
type: that.search_info.type,
|
||||
city_id: that.search_info.city_id,
|
||||
county_id: that.search_info.county_id
|
||||
county_id: that.search_info.county_id,
|
||||
types:'1,2,3',
|
||||
},
|
||||
success: function (json) {
|
||||
var brandsList = json.data.shopList;
|
||||
@@ -277,6 +404,113 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//group_id1
|
||||
search1: function () {
|
||||
this.changePage1(1);
|
||||
},
|
||||
changePage1: function (page) {
|
||||
var that = this;
|
||||
that.brandsThPage = page;
|
||||
return this.brandModal1();
|
||||
},
|
||||
beforeShopPage1: function () {
|
||||
var vm = this;
|
||||
if (vm.brandsThPage == 1) {
|
||||
alert('已经是第一页了');
|
||||
return;
|
||||
}
|
||||
vm.brandsThPage--;
|
||||
return this.brandModal1();
|
||||
},
|
||||
afterShopPage1: function () {
|
||||
var vm = this;
|
||||
vm.brandsThPage++;
|
||||
return this.brandModal1();
|
||||
},
|
||||
addItem1: function (index) {
|
||||
var vm = this;
|
||||
var brand_id;
|
||||
var biz_id;
|
||||
biz_id = vm.brandsList1[index]['id'];
|
||||
var _shop = {
|
||||
biz_id: biz_id,
|
||||
name: vm.brandsList1[index]['name'],
|
||||
};
|
||||
if (vm.info.group_id1 == 4) {
|
||||
vm.selectedBrands1.push(_shop);
|
||||
vm.brandsList1[index]['is_checked'] = 1;
|
||||
} else {
|
||||
vm.selectedBrands1 = [];
|
||||
vm.selectedBrands1.push(_shop);
|
||||
this.brandsList1.map(function (_item, _index) {
|
||||
if (vm.brandsList1[index]['id'] == _item['id']) {
|
||||
vm.brandsList1[_index]['is_checked'] = 1;
|
||||
} else {
|
||||
vm.brandsList1[_index]['is_checked'] = 0;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
removeItem1: function (item) {
|
||||
var vm = this;
|
||||
if (vm.info.group_id1 == 4) {
|
||||
this.selectedBrands1 = this.selectedBrands1.filter(function (_item) {
|
||||
var id = _item.biz_id > 0 ? _item.biz_id : _item.brand_id;
|
||||
return id != item.id;
|
||||
})
|
||||
} else {
|
||||
vm.selectedBrands1 = [];
|
||||
}
|
||||
this.brandsList1.map(function (_item, _index) {
|
||||
if (item.id == _item.id) {
|
||||
vm.brandsList1[_index].is_checked = 0;
|
||||
}
|
||||
})
|
||||
},
|
||||
brandModal1: function () {
|
||||
var that = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['55%', '80%'], //宽高
|
||||
content: $('#brand-modal1'),
|
||||
title: '选择商家',
|
||||
shade: false,
|
||||
btn: ['选好了'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
url: '/common/shop_app',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
page: that.brandsThPage,
|
||||
type: that.search_info.type1,
|
||||
city_id: that.search_info.city_id1,
|
||||
county_id: that.search_info.county_id1,
|
||||
types:'1,2,3',
|
||||
},
|
||||
success: function (json) {
|
||||
var brandsList1 = json.data.shopList;
|
||||
that.brandsPage = json.data.shopPage;
|
||||
brandsList1.map(function (_item, _index) {
|
||||
for (var index in that.selectedBrands1) {
|
||||
var item = that.selectedBrands1[index];
|
||||
var id = that.sys_type_id == 1 ? item.brand_id : item.biz_id;
|
||||
if (id == _item.id) {
|
||||
brandsList1[_index].is_checked = 1;
|
||||
break;
|
||||
} else {
|
||||
brandsList1[_index].is_checked = 0;
|
||||
}
|
||||
}
|
||||
})
|
||||
that.brandsList1 = brandsList1;
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
|
||||
@@ -299,6 +533,7 @@
|
||||
|
||||
var vm = this;
|
||||
vm.info.bizs = vm.selectedBrands;
|
||||
vm.info.bizs1 = vm.selectedBrands1;
|
||||
loading = true;
|
||||
$.ajax({
|
||||
url: '<?=$action?>',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">角色:</label>
|
||||
<label class="am-para-label w100">默认角色:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="group_id">
|
||||
<option value="">全部</option>
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">门店:</label>
|
||||
<label class="am-para-label w100">默认门店:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select title="城市" name="city_id" v-model="params.city_id">
|
||||
<option value="">城市</option>
|
||||
@@ -75,8 +75,10 @@
|
||||
<th width="10%"><span>ID</span></th>
|
||||
<th width="20%"><span>姓名</span></th>
|
||||
<th width="20%"><span>手机号码</span></th>
|
||||
<th width="20%"><span>角色</span></th>
|
||||
<th width="20%"><span>门店</span></th>
|
||||
<th width="20%"><span>默认角色</span></th>
|
||||
<th width="20%"><span>默认门店</span></th>
|
||||
<th width="20%"><span>第二角色</span></th>
|
||||
<th width="20%"><span>第二角色门店</span></th>
|
||||
<th width="20%"><span>创建时间</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -88,10 +90,12 @@
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= $v['group_name'] ?></td>
|
||||
<td><?= $v['biz_name'] ?></td>
|
||||
<td><?= $v['group_name1'] ?></td>
|
||||
<td><?= $v['biz_name1'] ?></td>
|
||||
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6" class="align-r">
|
||||
<td colspan="8" class="align-r">
|
||||
<input type="hidden" class="id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
|
||||
<select data-update-group="" data-list-target=".id-<?= $v['id'] ?>"
|
||||
data-action="/app/licheb/member/batch" data-field=""
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</table>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="app/licheb/userslog">
|
||||
action="/app/licheb/userslog/lists_users">
|
||||
<input type="hidden" name="tab" v-model="params.tab"/>
|
||||
<input type="hidden" name="biz_id" v-model="params.biz_id"/>
|
||||
<div class="am-form am-form-horizontal">
|
||||
@@ -81,10 +81,29 @@
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['uname'] ?></td>
|
||||
<td><?= $v['follows'] ?></td>
|
||||
<td><?= $v['h_follows'] ?></td>
|
||||
<td><?= $v['t_follows'] ?></td>
|
||||
<td><?= $v['w_follows'] ?></td>
|
||||
<? if($v['follows'] > 0) {?>
|
||||
<td><a href="#/receiver/customer?vsid=<?= $v['id'] ?>&vdststus=0"><?= $v['follows'] ?></a></td>
|
||||
<?}else{?>
|
||||
<td><?= $v['follows'] ?></td>
|
||||
<?}?>
|
||||
|
||||
<? if($v['h_follows'] > 0) {?>
|
||||
<td><a href="#/receiver/customer?vsid=<?= $v['id'] ?>&vdststus=2"><?= $v['h_follows'] ?></a></td>
|
||||
<?}else{?>
|
||||
<td><?= $v['h_follows'] ?></td>
|
||||
<?}?>
|
||||
|
||||
<? if($v['t_follows'] > 0) {?>
|
||||
<td><a href="#/receiver/customer?vsid=<?= $v['id'] ?>&vdststus=1"><?= $v['t_follows'] ?></a></td>
|
||||
<?}else{?>
|
||||
<td><?= $v['t_follows'] ?></td>
|
||||
<?}?>
|
||||
|
||||
<? if($v['w_follows'] > 0) {?>
|
||||
<td><a href="#/receiver/customer?vsid=<?= $v['id'] ?>&vdststus=3"><?= $v['w_follows'] ?></a></td>
|
||||
<?}else{?>
|
||||
<td><?= $v['w_follows'] ?></td>
|
||||
<?}?>
|
||||
<td><?= $v['t_day'] ?></td>
|
||||
</tr>
|
||||
<? }
|
||||
|
||||
@@ -59,6 +59,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--选装-->
|
||||
<div class="am-form-group" v-if="info.type==1">
|
||||
<label class="am-para-label">选装包:</label>
|
||||
<div class="am-para-input">
|
||||
|
||||
<label class="mr10" style="margin-top: 7px" v-for="(v,i) in options">
|
||||
<input type="checkbox" name="options[]" :value="v.id" v-model="info.options"> {{v.title}}(价格:{{v.price}})
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-secondary" type="button" @click="saveEdit()">保存</button>
|
||||
@@ -73,7 +83,8 @@
|
||||
info:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
type_arr:[]
|
||||
type_arr:[],
|
||||
options:[]
|
||||
},
|
||||
mounted: function () {
|
||||
this.info = <?=json_encode($info)?>;
|
||||
@@ -87,7 +98,7 @@
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
data: {status:'>-1'},
|
||||
beforeSend: function () {},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
@@ -150,6 +161,17 @@
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
$.get("/auto/options/json_lists",{'brand_id':nv,'s_id':vm.info.s_id},function (res){
|
||||
vm.options = res.data.lists
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
'info.s_id':function(nv, ov){
|
||||
var vm = this;
|
||||
if(nv > 0){
|
||||
$.get("/auto/options/json_lists",{'brand_id':vm.info.brand_id,'s_id':nv},function (res){
|
||||
vm.options = res.data.lists
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">品牌:</label>
|
||||
<label class="am-para-label w100">品牌:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">请选择</option>
|
||||
@@ -25,7 +25,29 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">类型:</label>
|
||||
<div class="am-para-inline w200">
|
||||
<select name="type" v-model="params.type">
|
||||
<option value="">请选择</option>
|
||||
<option v-for="(item,index) in type_arr" :value="index">
|
||||
{{item}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">状态:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="status" v-model="params.status">
|
||||
<option value="-9">请选择</option>
|
||||
<option v-for="(item,index) in status_arr" :value="index">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<label class="am-para-label w50"></label>
|
||||
<button type="submit" class="am-btn am-btn-success w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
@@ -44,6 +66,7 @@
|
||||
<tr>
|
||||
<th width="10%"><span>ID</span></th>
|
||||
<th width="20%"><span>标题</span></th>
|
||||
<th width="10%"><span>品牌名称</span></th>
|
||||
<th width="10%"><span>车系名称</span></th>
|
||||
<th width="10%"><span>类型</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
@@ -56,21 +79,28 @@
|
||||
<tr>
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['title'] ?></td>
|
||||
<td><?= $v['brand_name'] ?></td>
|
||||
<td><?= $v['s_name'] ?></td>
|
||||
<td><?= $v['type_cn'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
<a href="javascript:void (0);" data-title="编辑车系" data-open="/auto/attr/get?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary"><?= '编辑' ?></a> |
|
||||
class="am-text-primary"><?= '编辑' ?></a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] == 1) { ?>
|
||||
<a href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">禁用</a>
|
||||
<?php } else { ?>
|
||||
<a style="color: red" href="javascript:void (0);" data-ajax="post"
|
||||
data-action="/auto/attr/del"
|
||||
<?php }
|
||||
elseif ($v['status'] == 0) { ?>
|
||||
| <a style="color: red" href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">恢复</a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="-1">删除</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@@ -92,12 +122,16 @@
|
||||
data: {
|
||||
params: [],
|
||||
brandAry: [],
|
||||
seryAry: []
|
||||
seryAry: [],
|
||||
type_arr: [],
|
||||
status_arr: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.brandAry = <?=json_encode($brandAry)?>;
|
||||
vm.type_arr = <?=json_encode($type_arr)?>;
|
||||
vm.status_arr = <?=json_encode($status_arr)?>;
|
||||
},
|
||||
methods: {},
|
||||
watch: {
|
||||
|
||||
Executable
+250
@@ -0,0 +1,250 @@
|
||||
<style type="text/css">
|
||||
.seaction-hand-area {
|
||||
padding: 20px 30px
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf {
|
||||
min-width: 100px;
|
||||
padding: 30px 0 0;
|
||||
float: left;
|
||||
margin-right: 50px;
|
||||
position: relative;
|
||||
border: 1px solid #e6e6e6
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .caption {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #f2f2f2;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .list {
|
||||
max-height: 438px;
|
||||
overflow: auto
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .list li {
|
||||
border-bottom: 1px solid #e6e6e6
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .list li.active a {
|
||||
color: #fff;
|
||||
background: #3bb4f2
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .list li a {
|
||||
display: block;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 20px;
|
||||
text-align: center;
|
||||
color: #333
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-lf .list li a:hover {
|
||||
color: #fff;
|
||||
background: #3bb4f2
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-mid, .seaction-hand-area .sec-rt {
|
||||
padding: 30px 0 40px;
|
||||
margin-right: 50px;
|
||||
float: left;
|
||||
position: relative;
|
||||
border: 1px solid #e6e6e6;
|
||||
min-width: 250px
|
||||
}
|
||||
|
||||
.seaction-hand-area .sec-mid .caption, .seaction-hand-area .sec-rt .caption {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #f2f2f2;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.check-hand-box {
|
||||
padding: 10px 0;
|
||||
min-height: 200px;
|
||||
max-height: 400px;
|
||||
overflow: auto
|
||||
}
|
||||
|
||||
.check-hand-box .item-cell {
|
||||
color: #333;
|
||||
padding: 3px 15px
|
||||
}
|
||||
|
||||
.check-hand-box .item-cell label {
|
||||
font-weight: 400
|
||||
}
|
||||
|
||||
.check-hand-btns {
|
||||
background: #f2f2f2;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 5px 15px
|
||||
}
|
||||
|
||||
.check-hand-btns .check-all {
|
||||
font-size: 14px;
|
||||
font-weight: 400
|
||||
}
|
||||
|
||||
.check-hand-btns .check-all input {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-top: -2px
|
||||
}
|
||||
</style>
|
||||
<!-- table 表格样式************************************* -->
|
||||
<div id="vue-app">
|
||||
<div class="seaction-hand-area clearfix">
|
||||
<div class="sec-lf">
|
||||
<p class="caption">门店类型</p>
|
||||
<ul class="list">
|
||||
<li :class="params.cate_id > 0 ? '': 'active'" @click="get_biz(0)">
|
||||
<a href="javascript:;">所有门店</a>
|
||||
</li>
|
||||
<li :class="params.cate_id == i ? 'active': ''" v-for="(v,i) in cate_lists" @click="get_biz(i)">
|
||||
<a href="javascript:;">{{v}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sec-mid clearfix">
|
||||
<p class="caption">未授权门店</p>
|
||||
<div class="check-hand-box" id="biz_lists">
|
||||
<div class="item-cell" v-for="(v,i) in biz_lists">
|
||||
<label><input type="checkbox" :value="i" class="biz-ids">{{v}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="check-hand-btns clearfix">
|
||||
<label class="check-all fl">
|
||||
<input type="checkbox" data-check-target=".biz-ids">全选
|
||||
</label>
|
||||
<button class="am-btn am-btn-primary am-btn-xs fr" id="add_biz" @click="add_biz">选择</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sec-rt">
|
||||
<p class="caption">已授权门店</p>
|
||||
|
||||
<div class="check-hand-box" id="hz_biz_lists">
|
||||
<div class="item-cell" v-for="(v,i) in brand_biz">
|
||||
<label><input type="checkbox" :value="i" data-type="remove" class="hz_biz_lists">{{v}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="check-hand-btns clearfix">
|
||||
<label class="check-all fl">
|
||||
<input type="checkbox" data-check-target=".hz_biz_lists">全选
|
||||
</label>
|
||||
<button class="am-btn am-btn-danger am-btn-xs fr" id="remove_biz" @click="remove_biz">移除</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form class="am-form am-form-horizontal ptb20 pr20" action="" data-auto="true" method="post">
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="add_input">
|
||||
|
||||
</div>
|
||||
<div class="remove_input">
|
||||
|
||||
</div>
|
||||
<div class="am-para-input">
|
||||
<a href="javascript:;" class="am-btn am-btn-secondary" type="button" id="edit-btn" @click="save">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
params:[],
|
||||
cate_lists:[],
|
||||
biz_lists:new Object(),
|
||||
brand_biz:new Object(),
|
||||
},
|
||||
mounted:function() {
|
||||
this.params = <?=json_encode($params,JSON_UNESCAPED_UNICODE)?>;
|
||||
this.cate_lists = <?=json_encode($cate_lists,JSON_UNESCAPED_UNICODE)?>;
|
||||
this.get_biz(this.params.cate_id)
|
||||
},
|
||||
methods:{
|
||||
get_biz(cate_id=0){
|
||||
var that = this
|
||||
this.params.cate_id=cate_id
|
||||
this.biz_lists = new Object()
|
||||
this.brand_biz = new Object()
|
||||
var params = {
|
||||
'id' : this.params.id,
|
||||
'type' : this.params.cate_id
|
||||
}
|
||||
$.get('/auto/brand/ajax_biz',params,function (res){
|
||||
if(res.data.biz_lists && res.data.biz_lists.length!=0){
|
||||
that.biz_lists = res.data.biz_lists
|
||||
}
|
||||
if(res.data.brand_biz && res.data.brand_biz.length!=0){
|
||||
that.brand_biz = res.data.brand_biz
|
||||
}
|
||||
},'json')
|
||||
},
|
||||
add_biz(){
|
||||
var that = this
|
||||
$(".biz-ids").each(function(){
|
||||
var check = $(this).is(':checked');
|
||||
var biz_name = $(this).parent().text();
|
||||
var biz_id = $(this).val();
|
||||
if(check){
|
||||
$(this).prop("checked",false);
|
||||
delete that.biz_lists[biz_id]
|
||||
that.brand_biz[biz_id] = biz_name
|
||||
}
|
||||
});
|
||||
this.$forceUpdate()
|
||||
},
|
||||
remove_biz(){
|
||||
var that = this
|
||||
$(".hz_biz_lists").each(function(){
|
||||
var check = $(this).is(':checked');
|
||||
var biz_name = $(this).parent().text();
|
||||
var biz_id = $(this).val();
|
||||
if(check){
|
||||
$(this).prop("checked",false);
|
||||
delete that.brand_biz[biz_id]
|
||||
that.biz_lists[biz_id] = biz_name
|
||||
}
|
||||
});
|
||||
this.$forceUpdate()
|
||||
},
|
||||
save(){
|
||||
var params = {
|
||||
'id' : this.params.id,
|
||||
'brand_biz' : this.brand_biz,
|
||||
'type' : this.params.cate_id
|
||||
}
|
||||
$.post('/auto/brand/edit_biz',params,function (result){
|
||||
if(result.code){
|
||||
layer.msg(result.msg, {time: 2000,icon:1 }, function () {
|
||||
// $.form.reload();
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -7,7 +7,19 @@
|
||||
<input type="text" name="title" value="<?=$params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">状态:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="status">
|
||||
<option value="-9">请选择</option>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<option value="<?=$key?>" <?=$key==$params['status']?'selected':''?>><?=$val?></option>
|
||||
<?}?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<label class="am-para-label w50"></label>
|
||||
<button type="submit" class="am-btn am-btn-success w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
@@ -25,6 +37,7 @@
|
||||
<th width="10%"><span>ID</span></th>
|
||||
<th width="20%"><span>品牌名称</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
<th width="10%"><span>授权门店数</span></th>
|
||||
<th width="15%"><span>创建时间</span></th>
|
||||
<th width="35%"><span>操作</span></th>
|
||||
</tr>
|
||||
@@ -35,18 +48,27 @@
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['t_biz'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:void (0);" data-title="编辑品牌" data-modal="/auto/brand/get?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary"><?= '编辑' ?></a> |
|
||||
<a href="javascript:void (0);" data-open="/auto/brand/get_biz?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary">授权门店</a>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
| <a href="javascript:void (0);" data-title="编辑品牌" data-modal="/auto/brand/get?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary"><?= '编辑' ?></a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] == 1) { ?>
|
||||
<a href="javascript:void (0);" data-ajax="post" data-action="/auto/brand/del"
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/brand/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">禁用</a>
|
||||
<?php } else { ?>
|
||||
<a style="color: red" href="javascript:void (0);" data-ajax="post"
|
||||
data-action="/auto/brand/del"
|
||||
<?php }
|
||||
elseif ($v['status'] == 0) { ?>
|
||||
| <a style="color: red" href="javascript:void (0);" data-ajax="post" data-action="/auto/brand/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">恢复</a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/brand/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="-1">删除</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</ul>
|
||||
<form id="vue-edit-business" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
|
||||
<div class="tab-pane fade in active" id="swzc">
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp80">
|
||||
<label class="am-para-label">车型:</label>
|
||||
<div class="am-para-input" style="width: 100%;">
|
||||
<select name="brand_id" style="display: inline;width: 100px" v-model="info.brand_id">
|
||||
@@ -23,7 +23,7 @@
|
||||
<option value="">车系</option>
|
||||
<option :value="i" v-for="(v,i) in seryAry">{{v}}</option>
|
||||
</select>
|
||||
<select name="v_id" style="display: inline;width: 100px" v-model="info.v_id">
|
||||
<select name="v_id" style="display: inline;width: 200px" v-model="info.v_id">
|
||||
<option value="">车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
@@ -65,14 +65,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50 fl">
|
||||
<label class="am-para-label">车辆底价:</label>
|
||||
<label class="am-para-label w120">展厅最低限价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入底价" name="price_fine" v-model="info.price_floor" style="display: inline;width: 60%"/>
|
||||
<input type="text" placeholder="请输入展厅最低限价" name="price_fine" v-model="info.price_floor" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label">公司加价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入公司加价" name="price_fine" v-model="info.price_coplus" style="display: inline;width: 60%"/>
|
||||
@@ -102,38 +102,67 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="jszc">
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp70">
|
||||
<label class="am-para-label w140">代理店结佣方式:</label>
|
||||
<div class="am-para-input">
|
||||
<input id="proxy_type0" name="proxy_type" type="radio" value="0" v-model="info.proxy_type"/><label for="proxy_type0">返佣 (优惠额度=售价-代理店最低限价)</label><br>
|
||||
<input id="proxy_type1" name="proxy_type" type="radio" value="1" v-model="info.proxy_type"/><label for="proxy_type1">票折 (优惠额度=售价-代理店结算价)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50" v-if="info.proxy_type==1">
|
||||
<label class="am-para-label w140">代理店结算价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入代理店结算价" name="proxy_profix_price" v-model="info.proxy_profix_price" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50" v-if="info.proxy_type==0">
|
||||
<label class="am-para-label w140">代理店最低限价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入代理店最低限价" name="proxy_profix_lower" v-model="info.proxy_profix_lower" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50" v-if="info.proxy_type==0">
|
||||
<label class="am-para-label w140">代理店佣金:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入代理店佣金" name="proxy_profix_rebate" v-model="info.proxy_profix_rebate" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label w140">代理店单车毛利:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入代理店单车毛利" name="proxy_profix_car" v-model="info.proxy_profix_car" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label w140">品牌店单车毛利:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入品牌店单车毛利" name="profix_car" v-model="info.profix_car" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label w140">上牌毛利:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入上牌毛利" name="profix_carno" v-model="info.profix_carno" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label w140">保险毛利:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入保险毛利" name="profix_insure" v-model="info.profix_insure" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label w140">贷款毛利:</label>
|
||||
<div class="am-form-group wp50" style="display: none">
|
||||
<label class="am-para-label w140">按揭毛利:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入贷款毛利" name="profix_loan" v-model="info.profix_loan" style="display: inline;width: 60%"/>
|
||||
<input type="text" placeholder="请输入按揭毛利" name="profix_loan" v-model="info.profix_loan" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -231,7 +260,7 @@
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
$.get('/auto/series/json_lists',{brand_id:nv},function (data) {
|
||||
$.get('/auto/series/json_lists',{brand_id:nv, status:1},function (data) {
|
||||
if (1 == data.code) {
|
||||
var lists = data.data.list;
|
||||
var seryAry = {};
|
||||
@@ -254,12 +283,12 @@
|
||||
var old_s_id = '<?=$info['s_id']?>';
|
||||
if (nv > 0) {
|
||||
//型号
|
||||
$.get('/auto/attr/json_lists',{s_id:nv,'status':1,'type':1},function (response) {
|
||||
$.get('/auto/attr/json_lists',{s_id:nv,'status':3,'type':1},function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.attrvAry = response.data.list;
|
||||
}
|
||||
},'json');
|
||||
$.get('/auto/attr/json_lists',{s_id:nv,'status':1,'type':0},function (response) {
|
||||
$.get('/auto/attr/json_lists',{s_id:nv,'status':3,'type':0},function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.colorattrvAry = response.data.list;
|
||||
if(vm.colors){
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
<div class="am-form-group fl ml20">
|
||||
<button type="submit" class="am-btn am-btn-sm am-btn-success w100">搜索</button>
|
||||
<a class="am-btn am-btn-sm am-btn-success w100" data-modal="/auto/business/get" data-title="新增">新增</a>
|
||||
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
|
||||
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -86,12 +88,17 @@
|
||||
<span>ID</span>
|
||||
</th>
|
||||
<th width="10%"><span>裸车报价</span></th>
|
||||
<th width="10%"><span>车辆底价</span></th>
|
||||
<th width="6%"><span>单车利润</span></th>
|
||||
<th width="6%"><span>保险利润</span></th>
|
||||
<th width="6%"><span>贷款利润</span></th>
|
||||
<th width="6%"><span>挂牌利润</span></th>
|
||||
<th width="10%"><span>展厅最低限价</span></th>
|
||||
<th width="6%"><span>代理店单结佣方式</span></th>
|
||||
<th width="6%"><span>代理店结算价</span></th>
|
||||
<th width="6%"><span>代理店最低限价</span></th>
|
||||
<th width="6%"><span>代理店佣金</span></th>
|
||||
<!--
|
||||
<th width="6%"><span>代理店单车毛利</span></th>
|
||||
<th width="6%"><span>品牌店单车毛利</span></th>
|
||||
<th width="6%"><span>保险利润</span></th>
|
||||
<th width="6%"><span>按揭利润</span></th>
|
||||
<th width="6%"><span>挂牌利润</span></th>
|
||||
<th width="10%"><span>公司加价</span></th>
|
||||
<th width="10%"><span>颜色加价</span></th>
|
||||
-->
|
||||
@@ -115,11 +122,16 @@
|
||||
</td>
|
||||
<td>{{v.price_car}}</td>
|
||||
<td>{{v.price_floor}}</td>
|
||||
<td>{{v.proxy_type}}</td>
|
||||
<td>{{v.proxy_profix_price}}</td>
|
||||
<td>{{v.proxy_profix_lower}}</td>
|
||||
<td>{{v.proxy_profix_rebate}}</td>
|
||||
<!--
|
||||
<td>{{v.proxy_profix_car}}</td>
|
||||
<td>{{v.profix_car}}</td>
|
||||
<td>{{v.profix_insure}}</td>
|
||||
<td>{{v.profix_loan}}</td>
|
||||
<td>{{v.profix_carno}}</td>
|
||||
<!--
|
||||
<td>{{v.price_coplus}}</td>
|
||||
<td>{{v.price_color}}</td>
|
||||
-->
|
||||
@@ -164,6 +176,26 @@
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cule-modal" style="display: none;padding: 10px">
|
||||
<div class="modal-body">
|
||||
<div class="text-center">
|
||||
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
||||
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
||||
<div class="form-group-action">
|
||||
<a href="/temp/business.xlsx" target="_blank" class="btn btn-default">查看模板</a>
|
||||
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
||||
<form id="import-form">
|
||||
<input type="file" id="business-file" name="file" accept=".xls,.xlsx"
|
||||
style="left:-9999px;position:absolute;" onchange="load_business()">
|
||||
</form>
|
||||
<span>上传Excel文件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate'], function (laydate) {
|
||||
@@ -265,7 +297,7 @@
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
data: {brand_id:nv, status:1},
|
||||
beforeSend: function () {},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
@@ -300,7 +332,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: nv,
|
||||
status: 1,
|
||||
status: 3,
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
@@ -317,7 +349,67 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#export').click(function () {
|
||||
var count = <?=$pager['totle']?>;
|
||||
if (count > 10000) {
|
||||
layer.msg('单次导出数据不能超过10000');
|
||||
return false;
|
||||
}
|
||||
var href = $.menu.parseUri(window.location.href);
|
||||
var arr = href.split('?');
|
||||
href = '/auto/business/export?' + arr[1];
|
||||
window.location.href = href;
|
||||
});
|
||||
|
||||
$("#import").click(function () {
|
||||
$("#business-file").val('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['40%'], //宽高
|
||||
content: $('#cule-modal'),
|
||||
title: '导入线索',
|
||||
shade: false,
|
||||
btn: ['完成'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
|
||||
function load_business() {
|
||||
var file = $("#business-file");
|
||||
if (file.val() == '') {
|
||||
layer.msg('文件是空的');
|
||||
return 0;
|
||||
}
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
|
||||
var options = {
|
||||
url: "/auto/business/add_excel",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if (1 == res.code) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
file.val('');
|
||||
layer.close(loading);
|
||||
}
|
||||
};
|
||||
$("#import-form").ajaxSubmit(options);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="am-form-group wp50 fl">
|
||||
<label class="am-para-label">车辆底价:</label>
|
||||
<div class="am-para-input">
|
||||
@@ -13,7 +14,6 @@
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="am-form-group wp50 fl">
|
||||
<label class="am-para-label">定金:</label>
|
||||
<div class="am-para-input">
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
<span>ID</span>
|
||||
</th>
|
||||
<th width="30%"><span>裸车报价</span></th>
|
||||
<th width="30%"><span>车辆底价</span></th>
|
||||
<!--
|
||||
<th width="30%"><span>车辆底价</span></th>
|
||||
<th width="7%"><span>定金</span></th>
|
||||
<th width="7%"><span>保险报价</span></th>
|
||||
<th width="7%"><span>精品报价</span></th>
|
||||
@@ -61,13 +61,13 @@
|
||||
<th width="9%"><span>一级分销佣金</span></th>
|
||||
<th width="9%"><span>二级分销佣金</span></th>
|
||||
-->
|
||||
<th width=""><span>操作</span></th>
|
||||
<th width="7%"><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr class="tl">
|
||||
<td colspan="4">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
<td colspan="3">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>
|
||||
@@ -76,8 +76,8 @@
|
||||
</td>
|
||||
<template v-if="1==v.edit">
|
||||
<td><input style="width: 100%" type="text" name="price_car" v-model="info_edit.price_car" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_floor" v-model="info_edit.price_floor" placeholder=""></td>
|
||||
<!--
|
||||
<td><input style="width: 100%" type="text" name="price_floor" v-model="info_edit.price_floor" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_book" v-model="info_edit.price_book" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_insure" v-model="info_edit.price_insure" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_fine" v-model="info_edit.price_fine" placeholder=""></td>
|
||||
@@ -90,8 +90,8 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_car}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_floor}}</td>
|
||||
<!--
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_floor}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_book}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_insure}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_fine}}</td>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
methods:{
|
||||
init_auto:function(){
|
||||
var vm = this;
|
||||
$.get('common/auto',{type:1,tp:1},function(response){
|
||||
$.get('common/auto',{type:1,tp:1,status:3},function(response){
|
||||
if (response.code == 1) {
|
||||
vm.brand_arr = response.data;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-form-group" style="display: none">
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
@@ -148,7 +148,7 @@
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
data: {brand_id:nv, status:1},
|
||||
beforeSend: function () {},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
@@ -183,7 +183,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: nv,
|
||||
status: 1,
|
||||
status: 3,
|
||||
type: 0
|
||||
},
|
||||
success: function (response) {
|
||||
@@ -199,7 +199,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: nv,
|
||||
status: 1,
|
||||
status: 3,
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
<colgroup>
|
||||
<col width="70%"/>
|
||||
<col width="10%"/>
|
||||
<col width="20%"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr v-for="(v,i) in seriesList">
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%"><span>ID</span></th>
|
||||
<th width="25%"><span>车型</span></th>
|
||||
<th width="10%"><span>创建时间</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
@@ -46,6 +47,7 @@
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['title'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
|
||||
Executable
+113
@@ -0,0 +1,113 @@
|
||||
<form id="vue-app-edit" class="am-form am-form-horizontal" action="" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">标题:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="输入标题" name="title" v-model="info.title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">品牌车系:</label>
|
||||
<div class="am-para-input">
|
||||
<select name="brand_id" v-model="info.brand_id" style="display: inline; width: 120px;">
|
||||
<option value="0">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in brandAry">{{v}}</option>
|
||||
</select>
|
||||
<select name="s_id" v-model="info.s_id" style="display: inline; width: 120px;">
|
||||
<option value="0">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in seryAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">价格:</label>
|
||||
<div class="am-para-input w150">
|
||||
<input type="text" placeholder="输入价格" name="number" v-model="info.price">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">描述:</label>
|
||||
<div class="am-para-input">
|
||||
<textarea name="content" id="editor" v-model="info.descrip"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-secondary" type="button" @click="saveEdit()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
require(['ckeditor'], function (ckeditor) {
|
||||
window.createEditor('[name="content"]');
|
||||
});
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-app-edit',
|
||||
data: {
|
||||
brandAry: [],
|
||||
info:[],
|
||||
seryAry: [],
|
||||
},
|
||||
mounted: function () {
|
||||
this.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>;
|
||||
this.brandAry = <?=json_encode($brandAry,JSON_UNESCAPED_UNICODE)?>;
|
||||
},
|
||||
methods: {
|
||||
saveEdit: function(){
|
||||
var action = '';
|
||||
this.info.descrip = CKEDITOR.instances.editor.getData();
|
||||
if(this.info.id){
|
||||
action = 'auto/options/edit'
|
||||
}else{
|
||||
action = 'auto/options/add'
|
||||
}
|
||||
$.post(action,this.info,function(result){
|
||||
if (result.code) {
|
||||
layer.msg(result.msg, {time: 2000, icon: 1}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'info.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id: nv},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
var lists = data.data.list;
|
||||
var seryAry = {};
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = seryAry;
|
||||
if (vm.info.s_id > 0 && undefined == seryAry[vm.info.s_id]) {
|
||||
vm.info.s_id = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
loading = 0;
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
Executable
+158
@@ -0,0 +1,158 @@
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class="form-search" onsubmit="return false" action="/auto/options/lists">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">标题:</label>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" name="title" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">品牌:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in brandAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">车系:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in seryAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<label class="am-para-label w50"></label>
|
||||
<button type="submit" class="am-btn am-btn-success w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" data-title="新增g " data-open="/auto/options/get" class="am-btn am-btn-success w100">
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
<div class="am-form-group fr" style="font-size: 15px;padding-right: 20px;padding-top: 6px;">
|
||||
共有<?= $pager['totle'] ?>条数据
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="coms-table-bd">
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>ID</span></th>
|
||||
<th width="20%"><span>品牌</span></th>
|
||||
<th width="20%"><span>车系</span></th>
|
||||
<th width="20%"><span>标题</span></th>
|
||||
<th width="10%"><span>价格</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
<th width="15%"><span>创建时间</span></th>
|
||||
<th width="15%"><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['brand_cn'] ?></td>
|
||||
<td><?= $v['series_cn'] ?></td>
|
||||
<td><?= $v['title'] ?></td>
|
||||
<td><?= $v['price'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
<a href="javascript:void (0);" data-title="编辑车系" data-open="/auto/options/get?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary"><?= '编辑' ?></a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] == 1) { ?>
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/options/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">禁用</a>
|
||||
<?php }
|
||||
elseif ($v['status'] == 0) { ?>
|
||||
| <a style="color: red" href="javascript:void (0);" data-ajax="post" data-action="/auto/options/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">恢复</a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="-1">删除</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vue_obj;
|
||||
var loading = 0;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
type_arr: [],
|
||||
status_arr: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.brandAry = <?=json_encode($brandAry)?>;
|
||||
vm.type_arr = <?=json_encode($type_arr)?>;
|
||||
vm.status_arr = <?=json_encode($status_arr)?>;
|
||||
},
|
||||
methods: {},
|
||||
watch: {
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id: nv},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
var lists = data.data.list;
|
||||
var seryAry = {};
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = seryAry;
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
loading = 0;
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">品牌:</label>
|
||||
<label class="am-para-label w80">品牌:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">请选择</option>
|
||||
@@ -16,7 +16,17 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">状态:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<select name="status" v-model="params.status">
|
||||
<option value="-9">请选择</option>
|
||||
<option v-for="(item,index) in status_arr" :value="index">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<label class="am-para-label w50"></label>
|
||||
<button type="submit" class="am-btn am-btn-success w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
@@ -48,16 +58,22 @@
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
<a href="javascript:void (0);" data-title="编辑车系" data-modal="/auto/series/get?id=<?= $v['id'] ?>"
|
||||
class="am-text-primary"><?= '编辑' ?></a> |
|
||||
class="am-text-primary"><?= '编辑' ?></a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] == 1) { ?>
|
||||
<a href="javascript:void (0);" data-ajax="post" data-action="/auto/series/del"
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/series/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">禁用</a>
|
||||
<?php } else { ?>
|
||||
<a style="color: red" href="javascript:void (0);" data-ajax="post"
|
||||
data-action="/auto/series/del"
|
||||
<?php }
|
||||
elseif ($v['status'] == 0) { ?>
|
||||
| <a style="color: red" href="javascript:void (0);" data-ajax="post" data-action="/auto/series/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">恢复</a>
|
||||
<?php } ?>
|
||||
<?php if ($v['status'] > -1) { ?>
|
||||
| <a href="javascript:void (0);" data-ajax="post" data-action="/auto/series/del"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="-1">删除</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@@ -78,19 +94,20 @@
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params:[],
|
||||
brandAry:[]
|
||||
brandAry:[],
|
||||
status_arr: [],
|
||||
},
|
||||
mounted:function() {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.brandAry = <?=json_encode($brandAry)?>;
|
||||
vm.status_arr = <?=json_encode($status_arr)?>;
|
||||
},
|
||||
methods:{},
|
||||
watch:{}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span href="javascript:void(0)" style="font-size: 20px">
|
||||
店铺概况
|
||||
门店概况
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
|
||||
<div class="tab-pane fade in active" id="swzc">
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">业务类型:</label>
|
||||
<div class="am-para-input">
|
||||
<select name="type" v-model="info.type" disabled>
|
||||
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50" v-if="info.type==2">
|
||||
<label class="am-para-label">保险类型:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.type" disabled>
|
||||
<option v-for="(v,i) in insure_typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">供应商:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.supplier_id" :disabled="info.jsondata.supplier_id>0">
|
||||
<option v-for="(item,key) in supplier" :value="item.id">{{item.title}}</option>
|
||||
</select>
|
||||
<input type="hidden" placeholder="供应商" v-model="info.title">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="info.type==3">
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">期数:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.finance_num" :disabled="info.jsondata.finance_num>0">
|
||||
<option v-for="item in finances_num" :value="item">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="am-form-group wp50" v-if="info.type==1 || info.type==3 && info.is_def==0">
|
||||
<label class="am-para-label">生效时间:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp100">
|
||||
<label class="am-para-label">是否默认:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_def"/>
|
||||
</div>
|
||||
<span v-if="info.type==1">同个供应商,只能有一个默认值</span>
|
||||
<span v-if="info.type==2">同个供应商 + 保险类型,只能有一个默认值</span>
|
||||
<span v-if="info.type==3">同个供应商 + 同个期数,只能有一个默认值</span>
|
||||
</div>
|
||||
<template v-if="info.type==1">
|
||||
<div class="am-form-group wp50" >
|
||||
<label class="am-para-label">结算价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" placeholder="请输入结算价" name="price_insure" v-model="info.jsondata.price" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="am-form-group wp100" v-if="info.type==3">
|
||||
<label class="am-para-label">是否贴息:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_tiexi"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="info.type==2 || info.type==3 && info.is_tiexi == 0">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">返点:</label>
|
||||
<div class="input-group am-para-input w150">
|
||||
<input type="number" placeholder="输入返点" v-model="info.jsondata.rebate">
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<div class="input-group am-para-input">
|
||||
<span class="f12 clr999 lh-default ml5">百分比</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="am-form-group" :style="{'display':info.type==2 && info.is_def==0 ? 'block':'none'}">
|
||||
<label class="am-para-label">时间区间:</label>
|
||||
<div class="am-para-input wp60">
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" placeholder="开始时间" autocomplete="off" value="<?=$info['jsondata']['s_time']?>" name="s_time" id="s-time">
|
||||
</div>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" placeholder="结束时间" autocomplete="off" value="<?=$info['jsondata']['e_time']?>" name="e_time" id="e-time">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="saveEdit">提交</button></div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
require(['laydate'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-time'
|
||||
});
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#s-time'
|
||||
,type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#e-time'
|
||||
,type: 'datetime'
|
||||
});
|
||||
});
|
||||
var loading = 0;
|
||||
var vue_obj;
|
||||
$(function(){
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit',
|
||||
data: {
|
||||
info : {jsondata:[]},
|
||||
typeAry:[],
|
||||
insure_typeAry:[],
|
||||
yearAry:[],
|
||||
monthAry:[],
|
||||
finances_num:[],
|
||||
supplier:[],
|
||||
action:''
|
||||
},
|
||||
mounted:function(){
|
||||
var vm = this;
|
||||
vm.info = <?=json_encode($info)?>;
|
||||
vm.typeAry = <?=$typeAry ? json_encode($typeAry) : '[]'?>;
|
||||
vm.insure_typeAry = <?=$insure_typeAry ? json_encode($insure_typeAry) : '[]'?>;
|
||||
vm.action = '<?=$info['action']?>';
|
||||
vm.yearAry = <?=json_encode($yearAry)?>;
|
||||
vm.monthAry = <?=json_encode($monthAry)?>;
|
||||
vm.finances_num = <?=json_encode($finances_num)?>;
|
||||
vm.supplier = <?=json_encode($supplier)?>;
|
||||
},
|
||||
methods:{
|
||||
saveEdit:function(){
|
||||
var vm = this;
|
||||
|
||||
vm.info.s_effect_time = $("#id-time").val();
|
||||
if(vm.info.type==2){
|
||||
vm.info.s_time = $("#s-time").val();
|
||||
vm.info.e_time = $("#e-time").val();
|
||||
if (vm.info.is_def == 0){
|
||||
if (vm.info.s_time == '' || vm.info.e_time == '') {
|
||||
alert("请填写时间区间");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(1 == loading){
|
||||
return 0;
|
||||
}
|
||||
loading = 1;
|
||||
$.ajax({
|
||||
url: vm.action,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {info:vm.info},
|
||||
beforeSend: function () {
|
||||
layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
},
|
||||
success: function (data) {
|
||||
loading = 0;
|
||||
if (data['code']) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
layer.closeAll();
|
||||
$.form.reload();
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
loading = 0;
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+73
-49
@@ -1,30 +1,67 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
|
||||
<div class="tab-pane fade in active" id="swzc">
|
||||
<div class="am-form-group wp50" v-if="info.type!=3">
|
||||
<label class="am-para-label">供应商:</label>
|
||||
<div class="am-form-group wp100" v-if="info.step<=2">
|
||||
<b>第一步:选择供应商</b>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">类型:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="供应商" v-model="info.title">
|
||||
<select name="type" v-model="info.type" disabled>
|
||||
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50" v-if="info.type!=2">
|
||||
<div class="am-form-group wp50" v-if="info.type==2">
|
||||
<label class="am-para-label">保险类型:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.type" :disabled="info.step==2">
|
||||
<option v-for="(v,i) in insure_typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">供应商:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.supplier_id" :disabled="info.step==2">
|
||||
<option v-for="(item,key) in supplier" :value="item.id">{{item.title}}</option>
|
||||
</select>
|
||||
<input type="hidden" placeholder="供应商" v-model="info.title">
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="info.type==3">
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">期数:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.finance_num" :disabled="info.step==2">
|
||||
<option v-for="item in finances_num" :value="item">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="nextstep" v-if="info.step==1" :disabled="info.type==3 && info.jsondata.supplier_id==0 && info.jsondata.finance_num > 0|| info.type!=3 && info.jsondata.supplier_id==0 && info.jsondata.finance_num > 0">点击进入下一步</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fade in tab-pane" v-show="info.step==2" :class="info.step==2?'active':''" id="swzc2">
|
||||
<div class="am-form-group wp100" v-if="info.step<=2">
|
||||
<b>第二步:配置业务数据</b>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group wp50" v-if="info.type==1 || info.type==3 && info.is_def==0">
|
||||
<label class="am-para-label">生效时间:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">类型:</label>
|
||||
<div class="am-para-input">
|
||||
<select name="type" v-model="info.type">
|
||||
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
|
||||
<div class="am-form-group wp100">
|
||||
<label class="am-para-label">是否默认:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_def"/>
|
||||
</div>
|
||||
<span v-if="info.type!=2">同个业务类型下,同个供应商只能有一个默认值</span>
|
||||
<span v-else>保险业务类型下,同个供应商只能有一个默认值,设置当前为默认值会自动下架其他</span>
|
||||
</div>
|
||||
<template v-if="info.type==1">
|
||||
<div class="am-form-group wp50" >
|
||||
@@ -36,7 +73,13 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="info.type==2 || info.type==3">
|
||||
<div class="am-form-group wp100" v-if="info.type==3">
|
||||
<label class="am-para-label">是否贴息:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_tiexi"/>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="info.type==2 || info.type==3 && info.is_tiexi == 0">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label">返点:</label>
|
||||
<div class="input-group am-para-input w150">
|
||||
@@ -52,18 +95,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="info.type==2">
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">保险类型:</label>
|
||||
<div class="input-group am-para-input w150">
|
||||
<select v-model="info.jsondata.type">
|
||||
<option value="1">商业险</option>
|
||||
<option value="2">交强险</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="am-form-group" :style="{'display':info.type==2 ? 'block':'none'}" v-if="info.is_def==0">
|
||||
<label class="am-para-label">时间区间:</label>
|
||||
<div class="am-para-input wp60">
|
||||
@@ -75,28 +106,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="info.type==3">
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">产品:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.finance_id">
|
||||
<option v-for="(item,key) in finances" :value="item.id">{{item.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label">期数:</label>
|
||||
<div class="am-para-input">
|
||||
<select v-model="info.jsondata.finance_num">
|
||||
<option v-for="item in finances_num" :value="item">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-form-group" style="margin-bottom: 2rem" v-if="info.step>=2">
|
||||
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="saveEdit">提交</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -121,23 +133,25 @@
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit',
|
||||
data: {
|
||||
info : [],
|
||||
info : {jsondata:[]},
|
||||
typeAry:[],
|
||||
insure_typeAry:[],
|
||||
yearAry:[],
|
||||
monthAry:[],
|
||||
finances:[],
|
||||
finances_num:[],
|
||||
supplier:[],
|
||||
action:''
|
||||
},
|
||||
mounted:function(){
|
||||
var vm = this;
|
||||
vm.info = <?=json_encode($info)?>;
|
||||
vm.typeAry = <?=$typeAry ? json_encode($typeAry) : '[]'?>;
|
||||
vm.insure_typeAry = <?=$insure_typeAry ? json_encode($insure_typeAry) : '[]'?>;
|
||||
vm.action = '<?=$info['action']?>';
|
||||
vm.yearAry = <?=json_encode($yearAry)?>;
|
||||
vm.monthAry = <?=json_encode($monthAry)?>;
|
||||
vm.finances = <?=json_encode($finances)?>;
|
||||
vm.finances_num = <?=json_encode($finances_num)?>;
|
||||
vm.supplier = <?=json_encode($supplier)?>;
|
||||
},
|
||||
methods:{
|
||||
saveEdit:function(){
|
||||
@@ -147,6 +161,12 @@
|
||||
if(vm.info.type==2){
|
||||
vm.info.s_time = $("#s-time").val();
|
||||
vm.info.e_time = $("#e-time").val();
|
||||
if (vm.info.is_def == 0){
|
||||
if (vm.info.s_time == '' || vm.info.e_time == '') {
|
||||
alert("请填写时间区间");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(1 == loading){
|
||||
return 0;
|
||||
@@ -181,6 +201,10 @@
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
},
|
||||
nextstep:function(){
|
||||
var vm = this;
|
||||
vm.info.step = 2;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/biz/srv/lists">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl" v-if="params.type==2">
|
||||
<label class="am-para-label w80">保险类型:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="insure_type" v-model="params.insure_type">
|
||||
<option value="">请选择</option>
|
||||
<option v-for="(v,i) in insure_typeAry" :value="i">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">状态:</label>
|
||||
<div class="am-para-inline w100">
|
||||
@@ -38,7 +47,7 @@
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml20">
|
||||
<button data-title="新增" type="button" :data-modal="'/biz/srv/get?type='+params.type" class="am-btn am-btn-success am-btn-sm w100">
|
||||
<button :data-title="'新增-'+typeAry[params.type]" type="button" :data-modal="'/biz/srv/get?type='+params.type" class="am-btn am-btn-success am-btn-sm w100">
|
||||
新增
|
||||
</button>
|
||||
</div>
|
||||
@@ -50,7 +59,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="8%"><span>ID</span></th>
|
||||
<th width="20%"><span>商家</span></th>
|
||||
<th width="20%"><span>门店</span></th>
|
||||
<th width="20%"><span>供应商</span></th>
|
||||
<th width="20%"><span>其它参数</span></th>
|
||||
<th width="15%"><span>生效日期</span></th>
|
||||
@@ -66,7 +75,7 @@
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['biz_name'] ?></td>
|
||||
<td><?= $v['title'] ?></td>
|
||||
<td>
|
||||
<td style="text-align: left; margin-left: 20px">
|
||||
<?foreach ($v['other_data'] as $k2 => $v2){?>
|
||||
<?=$k2?>:<?= $v2 ?><br>
|
||||
<?}?>
|
||||
@@ -104,11 +113,15 @@
|
||||
el: '#vue-app',
|
||||
data: {
|
||||
params: [],
|
||||
titleAry:[]
|
||||
titleAry:[],
|
||||
typeAry:[],
|
||||
insure_typeAry:[],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.typeAry = <?=json_encode($typeAry)?>;
|
||||
vm.insure_typeAry = <?=json_encode($insure_typeAry)?>;
|
||||
$.get('/biz/srv/get_title', {"type":<?=$params['type']?>},function(result){
|
||||
if(result.code && result.data.lists){
|
||||
vm.titleAry = result.data.lists
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<?php } ?>
|
||||
|
||||
<div class="am-form-group">
|
||||
<div class="am-form-group" style="display: none">
|
||||
<label class="am-para-label">所属品牌:</label>
|
||||
<div class="am-para-input">
|
||||
<select id="brand_id" name="brand_id" v-model="brand_id" style="display: none">
|
||||
@@ -153,12 +153,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">商家名称:</label>
|
||||
<label class="am-para-label">门店:</label>
|
||||
<div class="am-para-input"><input type="text" placeholder="(最多 30 个字符)" name="biz_name"
|
||||
value="<?= $biz['biz_name'] ?>"/></div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">商家地址:</label>
|
||||
<label class="am-para-label">门店地址:</label>
|
||||
<div class="am-para-input">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group" style="display: none">
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="vuetable-th-slot-title">商家名</th>
|
||||
<th class="vuetable-th-slot-title">品牌</th>
|
||||
<th class="vuetable-th-slot-actions text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -294,14 +294,14 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
//选择商家
|
||||
//选择品牌
|
||||
brandModal: function () {
|
||||
var that = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['55%', '80%'], //宽高
|
||||
content: $('#brand-modal'),
|
||||
title: '选择商家',
|
||||
title: '选择品牌',
|
||||
shade: false,
|
||||
btn: ['选好了'],
|
||||
yes: function (index) {
|
||||
@@ -309,12 +309,13 @@
|
||||
}
|
||||
});
|
||||
data = {
|
||||
//page: that.brandsThPage,
|
||||
page: that.brandsThPage,
|
||||
//ids: that.sys_type_id == 1 ? that.info.brandIds : that.info.bizIds,
|
||||
};
|
||||
$.post('/common/brands', data, function (json) {
|
||||
var brandsList = json.data.itemsList;
|
||||
that.brandsPage = json.data.itemsPage;
|
||||
that.brandsThPage = json.data.itemsPage.page;
|
||||
brandsList.map(function (_item, _index) {
|
||||
brandsList[_index]['money'] = 0.00
|
||||
for (var index in that.selectedBrands) {
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
action="/biz/store/store/lists">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">商家名称:</label>
|
||||
<label class="am-para-label w100">门店:</label>
|
||||
<div class="am-para-inline w150">
|
||||
<input type="text" name="bizname" value="<?= $bizname ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group fl" style="display: none">
|
||||
<label class="am-para-label w80">品牌:</label>
|
||||
<div class="am-para-inline w250">
|
||||
<select name="brand_id" v-model="brand_id">
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">商家地址:</label>
|
||||
<label class="am-para-label w100">门店地址:</label>
|
||||
<div class="am-form-group am-para-inline w150" style="display: none">
|
||||
<select name="province_id" data-toggle="next-select"
|
||||
data-refurl="/common/area?key=city&id={value}&url=search" data-next="#bd-hd-city">
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
-->
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">渠道经理:</label>
|
||||
<label class="am-para-label w110">渠道经理:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="qdjl_id" v-model="params.qdjl_id">
|
||||
<option value=''>请选择</option>
|
||||
@@ -132,8 +132,8 @@
|
||||
<tr>
|
||||
<th width="50"></th>
|
||||
<th width="5%"><span>ID</span></th>
|
||||
<th width="30%"><span>商家名称</span></th>
|
||||
<th width="30%"><span>品牌</span></th>
|
||||
<th><span>门店</span></th>
|
||||
<!--<th width="30%"><span>品牌</span></th>-->
|
||||
<th width="12%"><span>类型</span></th>
|
||||
<th width="12%"><span>状态</span></th>
|
||||
<th width="15%"><span>创建时间</span></th>
|
||||
@@ -148,13 +148,13 @@
|
||||
</td>
|
||||
<td><?= $v['id'] ?></td>
|
||||
<td><?= $v['biz_name'] ?></td>
|
||||
<td><?= $v['brand_name'] ?></td>
|
||||
<!-- <td><?/*= $v['brand_name'] */?></td>-->
|
||||
<td><?= $v['type_name'] ?></td>
|
||||
<td><?= $statuscn[$v['status']] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6" class="align-r">
|
||||
<td colspan="5" class="align-r">
|
||||
<?if($v['type']==1){?>
|
||||
<a data-open="/biz/fine/lists?id=<?= $v['id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">精品配置
|
||||
@@ -177,12 +177,12 @@
|
||||
<a data-open="/biz/situation/get?id=<?= $v['id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">概况</a>
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
@click="channel_modal(<?= $v['id'] ?>)">渠道归属</a>
|
||||
@click="channel_modal(<?= $v['id'] ?>, '<?= $v['biz_name'] ?>')">渠道归属</a>
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
@click="biz_manage_modal(<?= $v['id'] ?>)">门店管理员</a>
|
||||
@click="biz_manage_modal(<?= $v['id'] ?>, '<?= $v['biz_name'] ?>')">门店管理员</a>
|
||||
<a class="am-btn am-btn-primary am-btn-xs"
|
||||
data-modal="/common/share_link?id=<?= $v['id'] ?>&app_id=1&pages=storeInfo"
|
||||
data-title="狸车小程序店铺首页">分享链接</a>
|
||||
data-title="<?= $v['biz_name'] ?>-狸车小程序门店首页">分享链接</a>
|
||||
<a data-open="/biz/store/store/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
|
||||
<input type="hidden" class="biz-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
|
||||
<select data-update-group="" data-list-target=".biz-id-<?= $v['id'] ?>"
|
||||
@@ -293,7 +293,7 @@
|
||||
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
|
||||
},
|
||||
methods: {
|
||||
channel_modal: function (biz_id) {
|
||||
channel_modal: function (biz_id,biz_name) {
|
||||
//选择渠道归属
|
||||
var vm = this;
|
||||
vm.channels = [];
|
||||
@@ -312,7 +312,7 @@
|
||||
type: 1,
|
||||
area: ['50%', '40%'], //宽高
|
||||
content: $('#channel-modal'),
|
||||
title: '渠道归属',
|
||||
title: biz_name+'-渠道归属',
|
||||
shade: false,
|
||||
btn: ['保存选择'],
|
||||
yes: function (index) {
|
||||
@@ -333,7 +333,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
biz_manage_modal: function (biz_id) {
|
||||
biz_manage_modal: function (biz_id,biz_name) {
|
||||
//选择门店管理员
|
||||
var vm = this;
|
||||
vm.biz_manage = {admins: [], group_id: 2, admin_id: 0, biz_id: biz_id, admin_name: ''};
|
||||
@@ -342,7 +342,7 @@
|
||||
type: 1,
|
||||
area: ['50%', '50%'], //宽高
|
||||
content: $('#biz_manage-modal'),
|
||||
title: '门店管理员',
|
||||
title: biz_name+'-门店管理员',
|
||||
shade: false,
|
||||
btn: ['保存选择'],
|
||||
yes: function (index) {
|
||||
|
||||
+370
-25
@@ -32,7 +32,7 @@
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">开票方:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.bill_name}}</label>
|
||||
<input type="text" v-model="info.bill_name" style="width: 200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
@@ -62,7 +62,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
|
||||
<label class="am-para-label label-width"><span class="span-bold">二手车:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.if_usedcar_name}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,7 +92,7 @@
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">开票价:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.bill_price}}</label>
|
||||
<input type="number" v-model="info.bill_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
@@ -267,8 +270,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<div v-if="info.srv_json.srv_if_insure=='1'" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">保险公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
<!-- <label class="am-para-label-con">{{info.srv_json.business_product}}</label>-->
|
||||
@@ -317,6 +320,26 @@
|
||||
<input type="number" v-model="info.srv_json.insurance_ins_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.accident_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险返点:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.accident_fd" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险佣金:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.accident_ins_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">客户退点金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -324,14 +347,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【保险收入合计】(商业险佣金+交强险佣金-客户退点金额">保险收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【保险收入合计】(商业险佣金+交强险佣金+意外险佣金-客户退点金额">保险收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.insurance_price}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
<div class="am-form-inline">
|
||||
<hr v-if="info.srv_json.srv_if_insure=='1'" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
<div v-if="info.srv_json.srv_if_num=='1'" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">挂牌收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -353,8 +376,106 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr v-if="info.payway=='1'" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
<div v-if="info.payway=='1'" class="am-form-inline">
|
||||
<hr v-if="info.srv_json.srv_if_num=='1'" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
|
||||
<div v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1' && info.srv_json.loan_price0" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
首付按揭
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭银行:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" v-model="info.srv_json.loan_product0" style="width: 200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-8">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_num0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭返点:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_fd0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭佣金:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">解抵服务费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_offset_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">利息补贴收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_subsidy_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他收入金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_in_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他支出金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_out_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4" style="display: none">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> 贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_json.loan_is_tiexi0==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.commission_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width" style="width: 170px"><span class="span-bold" title="【首付按揭收入合计】(按揭佣金+按揭手续费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">首付按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price0}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1' && info.srv_json.loan_price0" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
|
||||
<div v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1'" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭银行:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -362,27 +483,38 @@
|
||||
<input type="text" v-model="info.srv_json.loan_product" style="width: 200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-8">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_num" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<!-- <label class="am-para-label-con">{{info.srv_json.loan_price}}</label>-->
|
||||
<input type="number" v-model="info.srv_json.loan_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭返点:</span></label>
|
||||
<div class="am-para-input">
|
||||
<!-- <label class="am-para-label-con">{{info.srv_json.loan_num}}</label>-->
|
||||
<input type="number" v-model="info.srv_json.loan_num" style="width: 150px;">
|
||||
<input type="number" v-model="info.srv_json.loan_fd" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭服务费:</span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="4.1前按揭佣金已包含按揭手续费">按揭佣金<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<!-- <label class="am-para-label-con">{{info.srv_json.loan_srv_price}}</label>-->
|
||||
<input type="number" v-model="info.srv_json.loan_srv_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">解抵服务费:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -408,8 +540,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold"> 贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_json.loan_is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
@@ -418,20 +552,28 @@
|
||||
<input type="number" v-model="info.srv_json.commission_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入合计】(按揭服务费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入合计】(按揭佣金+按揭手续费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="info.srv_json.loan_price0" class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入总合计】(首付按揭收入合计+按揭收入合计)">按揭收入总合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price_total}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
<hr v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1'" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他收入:</span></label>
|
||||
@@ -476,7 +618,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div v-if="info.payway=='1'" class="am-form-inline">-->
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭收入合计:</span></label>
|
||||
@@ -487,6 +628,208 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="info.biz_type_force == '1'" class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span style="font-size: 20px">水平业务</span>
|
||||
<span style="float:right;margin-top:5px">
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1' && info.srv_json.loan_price0" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
首付按揭
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭银行:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" v-model="info.srv_json.loan_product0" style="width: 200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-8">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_num0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭返点:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_fd0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭佣金:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">解抵服务费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_offset_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">利息补贴收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_subsidy_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他收入金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_in_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他支出金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_out_price0" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4" style="display: none">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> 贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_json.loan_is_tiexi0==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.commission_price0" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width" style="width: 170px"><span class="span-bold" title="【首付按揭收入合计】(按揭佣金+按揭手续费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">首付按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price0}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1' && info.srv_json.loan_price0" class="am-u-lg-12 wp90" style="margin: 10px">
|
||||
|
||||
<div v-if="info.payway=='0' && info.srv_json.srv_if_finance=='1'" class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭银行:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" v-model="info.srv_json.loan_product" style="width: 200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-8">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_num" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭返点:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_fd" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="4.1前按揭佣金已包含按揭手续费">按揭佣金<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_srv" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">解抵服务费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_offset_price" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">利息补贴收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_subsidy_price" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他收入金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_in_price" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">其他支出金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.loan_out_price" style="width: 150px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> 贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_json.loan_is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭手续费收入:</span></label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" v-model="info.srv_json.commission_price" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入合计】(按揭服务费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="info.srv_json.loan_price" class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入总合计】(首付按揭收入合计+按揭收入合计)">按揭收入总合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.row.loan_price_total}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span style="font-size: 20px">整车合计</span>
|
||||
@@ -639,6 +982,8 @@
|
||||
post_data['srv_json'] = vm.info.srv_json;
|
||||
post_data['price'] = vm.info.price;
|
||||
post_data['buy_price'] = vm.info.buy_price;
|
||||
post_data['bill_name'] = vm.info.bill_name;
|
||||
post_data['bill_price'] = vm.info.bill_price;
|
||||
post_data['insurance_price'] = vm.info.row.insurance_price;
|
||||
post_data['fee_carno_price'] = vm.info.row.fee_carno_price;
|
||||
post_data['loan_price'] = vm.info.row.loan_price;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=1"
|
||||
data-next="#bd-auto2-id">
|
||||
<option value="0">选择品牌</option>
|
||||
<? if ($autoList[1]) {
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=1"
|
||||
data-next="#bd-auto3-id" @change="set_sery">
|
||||
<option value="0">选择车系</option>
|
||||
<?php if ($autoList[2]) {
|
||||
@@ -51,6 +51,15 @@
|
||||
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">二手车:</label>
|
||||
<div class="am-para-inline w80">
|
||||
<select name="if_usedcar" v-model="params.if_usedcar">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.usedcarAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">开票时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
@@ -64,6 +73,7 @@
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="bill">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="bill">本月</a>
|
||||
</div>
|
||||
<input id="id-bt-init" name="bt_init" type="hidden" value="<?= $params['bt_init'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
@@ -115,14 +125,29 @@
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="aggs.doc_count>0">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w200 fl"><b>水平业务总毛利:</b>{{aggs.srv_price_sum}}</label>
|
||||
<label class="am-para-label w200 fl"><b>单车总毛利:</b>{{aggs.car_price_sum}}</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="coms-table-bd">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>城市</th>
|
||||
<th>门店</th>
|
||||
<th width="15%">车辆</th>
|
||||
<th>销售收入合计</th>
|
||||
@@ -132,7 +157,9 @@
|
||||
<th>整车采购毛利</th>
|
||||
<th>保险收入合计</th>
|
||||
<th>挂牌收入合计</th>
|
||||
<th>首付按揭收入合计</th>
|
||||
<th>按揭收入合计</th>
|
||||
<th>按揭收入总合计</th>
|
||||
<th>水平业务总毛利</th>
|
||||
<th>单车总毛利</th>
|
||||
<th>门店单车毛利</th>
|
||||
@@ -143,6 +170,7 @@
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr>
|
||||
<td>{{v.city_name}}</td>
|
||||
<td>{{v.biz_name}}</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" :data-open="'/items/cost/get?id='+v.id">
|
||||
@@ -156,7 +184,9 @@
|
||||
<td>{{v.car_profit_price}}</td>
|
||||
<td>{{v.insurance_price}}</td>
|
||||
<td>{{v.fee_carno_price}}</td>
|
||||
<td>{{v.loan_price0}}</td>
|
||||
<td>{{v.loan_price}}</td>
|
||||
<td>{{v.loan_price_total}}</td>
|
||||
<td>{{v.srv_price}}</td>
|
||||
<td>{{v.car_price}}</td>
|
||||
<td>{{v.dl_car_price}}</td>
|
||||
@@ -175,6 +205,24 @@
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="cost-modal" style="display: none;padding: 10px">
|
||||
<div class="modal-body">
|
||||
<div class="text-center">
|
||||
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
||||
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
||||
<div class="form-group-action">
|
||||
<a href="/temp/cost.xlsx" target="_blank" class="btn btn-default">查看模板</a>
|
||||
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
||||
<form id="import-form">
|
||||
<input type="file" id="cost-file" name="file" accept=".xls,.xlsx"
|
||||
style="left:-9999px;position:absolute;" onchange="load_cost()">
|
||||
</form>
|
||||
<span>上传Excel文件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -200,6 +248,42 @@
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
|
||||
function load_cost() {
|
||||
var file = $("#cost-file");
|
||||
if (file.val() == '') {
|
||||
layer.msg('文件是空的');
|
||||
return 0;
|
||||
}
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
|
||||
var options = {
|
||||
url: "/items/cost/add_excel",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if (res['code']) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
file.val('');
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
};
|
||||
$("#import-form").ajaxSubmit(options);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@@ -251,6 +335,7 @@
|
||||
data: {
|
||||
params: [],
|
||||
lists: [],
|
||||
aggs: [],
|
||||
show_info: [],
|
||||
// modal_fine: {title: '', lists: [], selected: [], page: 1, size: 10, total: 0},
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
@@ -259,6 +344,7 @@
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.aggs = <?=json_encode($aggs)?>;
|
||||
vm.show_info = <?=json_encode($show_info)?>;
|
||||
vm.set_sery();
|
||||
vm.init_citys();
|
||||
@@ -425,6 +511,22 @@
|
||||
window.location.href = href;
|
||||
});
|
||||
|
||||
$("#import").click(function () {
|
||||
$("#cost-file").val('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['40%'], //宽高
|
||||
content: $('#cost-modal'),
|
||||
title: '导入整车成本',
|
||||
shade: false,
|
||||
btn: ['完成'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#bd-auto1-id').change(function () {
|
||||
$('#bd-auto2-id').empty();
|
||||
$('#bd-auto3-id').empty();
|
||||
|
||||
@@ -96,6 +96,17 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td" colspan="2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">选装包</div>
|
||||
<label class="mr10" style="margin-top: 7px" v-for="(v,i) in options">
|
||||
<input type="checkbox" name="option_ids[]" :value="v.id" v-model="info.option_ids"> {{v.title}}(价格:{{v.price}})
|
||||
</label>
|
||||
<input type="hidden" name="" >
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
@@ -204,6 +215,20 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
</td>
|
||||
<td class="table-td">
|
||||
</td>
|
||||
<td class="table-td">
|
||||
</td>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">预估返利</div>
|
||||
<input type="text" v-model="info.estimated_rebate" placeholder="请输入预估返利">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>-->
|
||||
<!-- <td class="table-td">-->
|
||||
<!-- <div class="input-group">-->
|
||||
@@ -321,7 +346,8 @@
|
||||
addrAry: [],
|
||||
bizAry: [],
|
||||
fines: [],
|
||||
modal_fine: {title: '', lists: [], selected: [], page: 1, size: 10, total: 0}
|
||||
modal_fine: {title: '', lists: [], selected: [], page: 1, size: 10, total: 0},
|
||||
options:[]
|
||||
},
|
||||
mounted: function () {
|
||||
var that = this;
|
||||
@@ -700,6 +726,22 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'info.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if(nv > 0){
|
||||
$.get("/auto/options/json_lists",{'brand_id':nv,'s_id':vm.info.s_id},function (res){
|
||||
vm.options = res.data.lists
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
'info.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if(nv > 0){
|
||||
$.get("/auto/options/json_lists",{'brand_id':vm.info.brand_id,'s_id':nv},function (res){
|
||||
vm.options = res.data.lists
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=1"
|
||||
data-next="#bd-auto2-id">
|
||||
<option value="0">选择品牌</option>
|
||||
<? if ($autoList[1]) {
|
||||
@@ -119,7 +119,7 @@
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=1"
|
||||
data-next="#bd-auto3-id" @change="set_sery">
|
||||
<option value="0">选择车系</option>
|
||||
<?php if ($autoList[2]) {
|
||||
@@ -253,7 +253,7 @@
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml20">
|
||||
<button type="button" data-open="/items/goods/goods/get"
|
||||
<button type="button" data-open="/items/goods/goods/get?sold=1"
|
||||
class="am-btn am-btn-success am-btn-sm w100">新增
|
||||
</button>
|
||||
</div>
|
||||
@@ -342,7 +342,7 @@
|
||||
:data-open="'/items/goods/logs/get?id='+v.id+'&title='+v.title"
|
||||
class="am-btn am-btn-primary am-btn-xs">轨迹</a>
|
||||
<a href="javascript:void(0);"
|
||||
:data-open="'/items/goods/goods/get?id='+v.id"
|
||||
:data-open="'/items/goods/goods/get?sold=1&id='+v.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">编辑</a></td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -694,7 +694,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: s_id,
|
||||
status: 3,
|
||||
status: 1,
|
||||
type: 0
|
||||
},
|
||||
success: function (response) {
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
<div class="am-form-group fl ml20">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
<button type="button" id="inve_add" class="am-btn am-btn-success am-btn-sm w100">发起盘点</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<a data-ajax="post" data-action="/items/inventory/add" class="am-btn am-btn-success am-btn-sm w100">发起盘点</a>
|
||||
<a data-ajax="post" data-action="/items/inventory/add" class="am-btn am-btn-success am-btn-sm w100" style="display: none">发起盘点</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,6 +64,24 @@
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="inve-modal" style="display: none;padding: 10px">
|
||||
<div class="modal-body">
|
||||
<div class="text-center">
|
||||
<div class="form-group-action">
|
||||
<form id="inve-form">
|
||||
<label class="am-para-label w150">选择需盘点的城市:</label>
|
||||
<select title="城市" id="city_id" name="city_id" v-model="city_id">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
<label class="am-para-label w30"></label>
|
||||
<button type="button" id="inve" class="am-btn am-btn-success am-btn-sm w100" onclick="load_inve()">盘 点</button>
|
||||
</form>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -91,4 +110,107 @@
|
||||
$('#' + source_id).val(date);
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
lists: [],
|
||||
cityAry: [],//城市
|
||||
city_id:'',
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/common/area',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: '350',
|
||||
key: 'city',
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
watch: {}
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
|
||||
$("#inve_add").click(function () {
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['40%'], //宽高
|
||||
content: $('#inve-modal'),
|
||||
title: '发起盘点',
|
||||
shade: false,
|
||||
btn: ['关闭'],
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function load_inve(force=0) {
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
// let myselect=document.getElementById("city_id");
|
||||
// let index=myselect.selectedIndex;
|
||||
// alert(myselect.options[index].value);
|
||||
let city_id = $("#city_id option:selected").val();
|
||||
let city_name = $("#city_id option:selected").text();
|
||||
var options = {
|
||||
url: "/items/inventory/add",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {'city_id_': city_id, 'city_name': city_name, 'force': force},
|
||||
success: function (res) {
|
||||
if (res['code'] > 0) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
else if (res['code'] == -1){
|
||||
layer.confirm(res.msg, {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
load_inve(force=1)
|
||||
}, function(){
|
||||
// layer.msg('也可以这样', {
|
||||
// time: 1000, //20s后自动关闭
|
||||
// btn: ['明白了', '知道了']
|
||||
// });
|
||||
});
|
||||
}
|
||||
else {
|
||||
layer.msg(res.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
};
|
||||
$("#inve-form").ajaxSubmit(options);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -158,8 +158,8 @@
|
||||
<td><?= $v['mileage'] ?></td>
|
||||
<td><? if ($v['car_img']) {
|
||||
foreach ($v['car_img'] as $key => $v2) { ?>
|
||||
<img title="<?= $v2['title'] ?>" src="<?= $v2['src'] ?>" data-tips-image
|
||||
style="width:22px;height:22px;margin-right: 5px;">
|
||||
<img title="<?= $v2['title'] ?>" src="<?= $v2['src'] ?>"
|
||||
style="width:22px;height:22px;margin-right: 5px;" @click="show_car_img(<?= $v['row_id'] ?>, <?= $v2['pid'] ?>);">
|
||||
<?
|
||||
}
|
||||
} ?>
|
||||
@@ -186,6 +186,7 @@
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: {},
|
||||
lists: {},
|
||||
cityAry: [],//城市
|
||||
countyAry: [],//行政区
|
||||
bizAry: [],//门店
|
||||
@@ -194,6 +195,7 @@
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.set_sery();
|
||||
vm.init_citys();
|
||||
@@ -260,6 +262,21 @@
|
||||
$('#bd-auto2-id').val(0);
|
||||
$('#bd-auto3-id').val(0);
|
||||
$('#bd-auto4-id').val('');
|
||||
},
|
||||
show_car_img: function (row_id, pid) {
|
||||
// alert(row_id + ' - '+ pid);
|
||||
var vm = this;
|
||||
let car_img_layer = vm.lists[row_id]['car_img_layer'];
|
||||
// alert(car_img_layer['id']);
|
||||
// console.dir(car_img_layer['start']); # 该值在辅值前后输出是不一样的
|
||||
// console.dir(car_img_layer); # 该值在辅值前后输出不一样的
|
||||
car_img_layer['start'] = pid;
|
||||
// console.dir(car_img_layer['start']);
|
||||
// console.dir(car_img_layer);
|
||||
layer.photos({
|
||||
photos: car_img_layer,
|
||||
anim: 5 // 0-6的选择,指定弹出图片动画类型,默认随机
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=2&status=1"
|
||||
data-next="#bd-auto2-id">
|
||||
<option value="0">选择品牌</option>
|
||||
<? if ($autoList[1]) {
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w120">
|
||||
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=3"
|
||||
data-refurl="/common/auto?pid={value}&type=3&status=1"
|
||||
data-next="#bd-auto3-id" @change="set_sery">
|
||||
<option value="0">选择车系</option>
|
||||
<?php if ($autoList[2]) {
|
||||
@@ -235,7 +235,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: s_id,
|
||||
status: 3,
|
||||
status: 1,
|
||||
type: 0
|
||||
},
|
||||
success: function (response) {
|
||||
|
||||
@@ -296,6 +296,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">调拨结算价:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<input type="text" v-model="info.settlement" placeholder="输入金额">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">运输费用:</label>
|
||||
<div class="am-para-inline w120">
|
||||
|
||||
+17
-4
@@ -63,7 +63,7 @@
|
||||
<li class="username">
|
||||
<i></i>
|
||||
<input style="width: 65%" name="number" type="text" autofocus="autofocus"
|
||||
value="<?= $mobile ? mobile_asterisk($mobile) : '' ?>" disabled
|
||||
value="<?= $mobile ? mobile_asterisk($mobile) : '' ?>" <?= $need_code=='login' ? disabled : ''?>
|
||||
autocomplete="off" title="请输入手机号码" placeholder="请输入手机号码" maxlength="11">
|
||||
<button class="am-btn am-btn-sm" style="float: right; margin-top: 5px; margin-bottom: 5px;"
|
||||
type="button" onclick="getCode(this)"/>
|
||||
@@ -76,11 +76,16 @@
|
||||
autocomplete="off" title="请输入验证码" placeholder="请输入验证码" maxlength="6">
|
||||
</li>
|
||||
<input type="hidden" name="mobile" value="<?= $mobile ?>">
|
||||
<input type="hidden" name="need_code" value="">
|
||||
<input type="hidden" name="need_code" value="<?= $need_code ?>">
|
||||
<?php endif; ?>
|
||||
<li class="text-center">
|
||||
<button type="submit" class="am-btn am-btn-success" data-form-loaded="立 即 登 录">正 在 载 入</button>
|
||||
<!-- <a class="forget" href="/admin/login/forget.html">忘记密码?</a> -->
|
||||
<?php if (!$need_code) : ?>
|
||||
<a style="display:inline-block;position: relative;vertical-align: middle;margin-left: 5px;" href="/login/?need_code=logsms">验证码登录</a>
|
||||
<?php elseif ($need_code==='logsms') : ?>
|
||||
<a style="display:inline-block;position: relative;vertical-align: middle;margin-left: 5px;" href="/login">密码登录</a>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
@@ -117,15 +122,23 @@
|
||||
|
||||
function getCode(obj) {
|
||||
settime($(obj));
|
||||
|
||||
let mobile = "<?=$mobile?>";
|
||||
let need_code = $('[name="need_code"]').val();
|
||||
if (need_code == 'logsms'){
|
||||
mobile = $('[name="number"]').val();
|
||||
}
|
||||
$('[name="need_code"]').val('get');
|
||||
$.ajax({
|
||||
'url': 'get_code',
|
||||
'method': 'post',
|
||||
'type': 'json',
|
||||
'data': {mobile: "<?=$mobile?>"},
|
||||
//'data': {mobile: "<?//=$mobile?>//"},
|
||||
'data': {mobile: mobile},
|
||||
success: function (data) {
|
||||
$('[name="need_code"]').val('login');
|
||||
if (need_code == 'logsms'){
|
||||
$('[name="need_code"]').val(need_code);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
$('iframe').width($('.coms-layout-body').width());
|
||||
$('iframe').width('100%');
|
||||
// $('iframe').width($('.coms-layout-body').width());
|
||||
$('iframe').height($('.coms-layout-body').height());
|
||||
$('.coms-layout-body').find('.coms-layout-aside').hide();
|
||||
$('.coms-layout-body').find('.coms-layout-header').hide();
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</td>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">渠道来源:</div>
|
||||
<div class="input-group-addon">线索来源:</div>
|
||||
{{infoShow.cfrom_title}}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户来源:</label>
|
||||
<label class="am-para-label w100">线索来源:</label>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="cfrom_id" v-model="cfrom_id">
|
||||
<option value=0>请选择</option>
|
||||
@@ -181,7 +181,7 @@
|
||||
<input type="checkbox" data-check-target=".order-ids"> 全选</label></th>
|
||||
<th width="5%"><span>客户姓名</span></th>
|
||||
<th width="5%"><span>客户电话</span></th>
|
||||
<th width="8%"><span>客户来源</span></th>
|
||||
<th width="8%"><span>线索来源</span></th>
|
||||
<th width="8%"><span>状态</span></th>
|
||||
<th width="4%"><span>跟进人</span></th>
|
||||
<th width="7%"><span>创建时间</span></th>
|
||||
@@ -300,11 +300,11 @@
|
||||
},
|
||||
getCfroms: function () {
|
||||
var that = this
|
||||
$.get('/receiver/clues/get_cfroms', function (result) {
|
||||
$.get('/receiver/CluesCfrom/json_get', function (result) {
|
||||
that.cfroms = result.data.data
|
||||
});
|
||||
if (that.cfrom_id > 0) {
|
||||
$.get('/receiver/clues/get_cfroms', {'id': that.cfrom_id}, function (result) {
|
||||
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
|
||||
that.cfroms2 = result.data.data
|
||||
});
|
||||
}
|
||||
@@ -350,9 +350,9 @@
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.cfrom_id2 = 0;
|
||||
that.cfroms = [];
|
||||
that.cfroms2 = [];
|
||||
} else {
|
||||
$.get('/receiver/clues/get_cfroms', {'id': nv}, function (result) {
|
||||
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
|
||||
that.cfroms2 = result.data.data;
|
||||
if (that.cfrom_id2 > 0) {
|
||||
var cfrom_id2 = '0';
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal" action="<?= $showInfo['url'] ?>" data-auto="true"
|
||||
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
|
||||
<input type="hidden" value="<?= $showInfo['id'] ?>" name="id"/>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">分类名称:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="输入分类名称" value="<?= $showInfo['name'] ?>" name="name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">排序:</label>
|
||||
<div class="am-para-input" style="width: 30%">
|
||||
<input type="number" placeholder="输入排序" value="<?= $showInfo['sort'] ?>" name="sort"/>
|
||||
<small class="text-muted">越大越靠前</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,217 @@
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="receiver/cluesCfrom">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">一级分类名称:</label>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" name="title" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl ml30">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button data-modal="/receiver/cluesCfrom/get" type="button" data-title="新增一级分类"
|
||||
class="am-btn am-btn-success am-btn-sm">
|
||||
新增一级分类
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="coms-table-bd" id="vue-show">
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30%"><span>一级分类</span></th>
|
||||
<th width="60%"><span>二级分类</span></th>
|
||||
<th width="5%"><span>排序</span></th>
|
||||
<th width="5%"><span>状态</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['options'] ?></td>
|
||||
<td><?= $v['sort'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="align-r">
|
||||
<a href="javascript:void(0);" data-modal="/receiver/cluesCfrom/get?id=<?= $v['id'] ?>"
|
||||
data-title="编辑一级分类" class="am-btn am-btn-primary am-btn-xs">编辑一级分类</a>
|
||||
<a href="javascript:void(0);" @click="optionsModal(<?= $v['id'] ?>,'<?= $v['name'] ?>')"
|
||||
class="am-btn am-btn-primary am-btn-xs">编辑二级分类</a>
|
||||
<? if ($v['status'] == 1) { ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/edit_status"
|
||||
class="am-btn am-btn-danger am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="0">关闭</a>
|
||||
<?
|
||||
} ?>
|
||||
<? if ($v['status'] == 0) { ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/edit_status"
|
||||
class="am-btn am-btn-success am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>" data-params-status="1">开启</a>
|
||||
<? } ?>
|
||||
<a data-ajax="post" data-action="/receiver/cluesCfrom/del"
|
||||
class="am-btn am-btn-danger am-btn-xs"
|
||||
data-params-id="<?= $v['id'] ?>">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="options-modal" style="display: none;">
|
||||
<table class="table table-hover table-middle" style="table-layout:fixed">
|
||||
<colgroup>
|
||||
<col width="65%">
|
||||
<col width="15%">
|
||||
<col width="">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">分类名称</th>
|
||||
<th class="text-center">排序</th>
|
||||
<th class="text-right">
|
||||
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
|
||||
@click='addOptions()'>添加</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(item,index) in optionsList">
|
||||
<tr v-if="item.status==1">
|
||||
<td class="text-center">
|
||||
<input :id="'name_'+index" @blur="editName(index)" class="form-control"
|
||||
v-model="item.name" placeholder="请输入分类名称"></td>
|
||||
<td class="text-center">
|
||||
<input :id="'group_name_'+index" @blur="editGroupName(index)" class="form-control"
|
||||
v-model="item.sort" type="number" placeholder="请输入排序值">
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a href="javascript:void(0);" style="margin-top:2px;"
|
||||
class="btn btn-danger btn-sm" @click='delOptions(index)'>删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-show',
|
||||
data: {
|
||||
optionsList: [],
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {
|
||||
optionsModal: function (id, name) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%', '50%'], //宽高
|
||||
content: $('#options-modal'),
|
||||
title: '编辑【' + name + '】二级分类',
|
||||
shade: false,
|
||||
btn: ['保存', '取消'],
|
||||
yes: function (index) {
|
||||
$.ajax({
|
||||
url: '/receiver/cluesCfrom/edit_options',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {id: id, options: that.optionsList},
|
||||
beforeSend: function () {
|
||||
layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
},
|
||||
success: function (data) {
|
||||
if (data['code']) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url: '/receiver/cluesCfrom/get_options',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {id: id},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (re) {
|
||||
if (re.code) {
|
||||
that.optionsList = re.data.lists;
|
||||
} else {
|
||||
layer.msg(re.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
addOptions: function () {
|
||||
var that = this;
|
||||
that.optionsList.push({id: 0, name: '', status: 1, sort: 50});
|
||||
},
|
||||
delOptions: function (index) {
|
||||
var that = this;
|
||||
if (that.optionsList[index]['id'] > 0) {
|
||||
that.optionsList[index]['status'] = -1;
|
||||
} else {
|
||||
that.optionsList.splice(index, 1);
|
||||
}
|
||||
},
|
||||
editName: function (index) {
|
||||
var name = $("#name_" + index).val();
|
||||
if (name == '') {
|
||||
layer.msg("标题不能为空!", {icon: 2});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// 修改排序
|
||||
editGroupName: function (index) {
|
||||
var order_view = $("#group_name_" + index).val();
|
||||
if (order_view == '') {
|
||||
layer.msg("排序值不能为空!", {icon: 2});
|
||||
return false;
|
||||
}
|
||||
this.optionsList.sort(function (a, b) {
|
||||
return b.sort - a.sort;
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,158 @@
|
||||
<form id="vue-edit" class="am-form am-form-horizontal" :action="info.url" data-auto="true" method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<input type="hidden" name="id" v-model="info.id"/>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">计划名:</label>
|
||||
<div class="am-para-inline w300">
|
||||
<input type="text" placeholder="输入计划名" name="sp_name" v-model="info.sp_name"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户来源:</label>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<select name="of_id" v-model="info.of_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.offlineSourcesAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<select name="of2_id" v-model="info.of2_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in of2Ary">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">起止日期:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w250">
|
||||
<input id="id-s_e_date" name="s_e_date" type="text" v-model="info.s_e_date"
|
||||
placeholder="起止日期范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<!-- <a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="s_e">今天</a>-->
|
||||
<!-- <a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="s_e">昨日</a>-->
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="s_e">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="s_e">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<label class="am-para-label w150"></label>
|
||||
<button class="am-btn ml20 am-btn-sm am-btn-success w100" type="button" @click="saveEdit">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit',
|
||||
data: {
|
||||
info: [],
|
||||
show_info: {offlineSourcesAry: []},
|
||||
of2Ary: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.info = <?=json_encode($info)?>;
|
||||
vm.show_info = <?=json_encode($show_info)?>;
|
||||
},
|
||||
methods: {
|
||||
saveEdit: function () {
|
||||
var vm = this;
|
||||
vm.info.s_e_date = $('#id-s_e_date').val();
|
||||
$.ajax({
|
||||
url: vm.info.url,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
info: vm.info,
|
||||
},
|
||||
beforeSend: function () {
|
||||
layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
},
|
||||
success: function (data) {
|
||||
if (data['code']) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
if (data.url != '') {
|
||||
$.form.href(data.url);
|
||||
} else {
|
||||
// $.form.reload();
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
layer.closeAll('loading');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'info.of_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.info.of2_id = '';
|
||||
that.of2Ary = [];
|
||||
} else {
|
||||
that.of2Ary = that.show_info.offlineSourcesAry[nv]['list'];
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-s_e_date', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), nowDate = new Date();
|
||||
var beginDate = '', endDate = '';
|
||||
switch (type) {
|
||||
case 'today':
|
||||
endDate = beginDate = nowDate.Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'yesterday':
|
||||
endDate = beginDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'weeks':
|
||||
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
nowDate.setDate(nowDate.getDate() + 6);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
break;
|
||||
case 'month':
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
|
||||
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
|
||||
break;
|
||||
}
|
||||
date = beginDate + ' ~ ' + endDate;
|
||||
switch ($(this).data('btn')) {
|
||||
case 's_e':
|
||||
$('#id-s_e_date').val(date);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span href="javascript:void(0)" style="font-size: 20px">
|
||||
用户信息
|
||||
客户信息
|
||||
</span>
|
||||
<span style="float:right;margin-top:5px;">
|
||||
<a href="javascript:" @click="editType(2)"><i class="fa fa-edit"></i></a>
|
||||
@@ -59,15 +59,22 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table-td"><span class="mr5">客户来源:</span>{{info.of_title}}</td>
|
||||
<td class="table-td"><span class="mr5">企微好友:</span>{{info.wxqy_name}}</td>
|
||||
<td class="table-td"><span class="mr5">微信好友:</span>{{info.wx_name}}</td>
|
||||
<td class="table-td"><span class="mr5">客户等级:</span>{{info.level}}</td>
|
||||
</tr>
|
||||
<tr v-if="info.to_send || info.cf_user">
|
||||
<td class="table-td" v-if="info.to_send"><span class="mr5">改派:</span>{{info.to_send}}</td>
|
||||
<tr>
|
||||
<td class="table-td"><span class="mr5">客户位置:</span>{{info.city_county}}</td>
|
||||
<td class="table-td" v-if="info.to_send"><span class="mr5">是否改派:</span>{{info.to_send}}</td>
|
||||
<td class="table-td" v-if="info.cf_user"><span class="mr5">分销来源:</span>{{info.cf_user}}</td>
|
||||
<td class="table-td" v-if="info.to_send && info.cf_user"></td>
|
||||
<td class="table-td" v-else colspan="2"></td>
|
||||
<td class="table-td" v-if="!info.to_send && !info.cf_user" colspan="2"></td>
|
||||
<td class="table-td" v-else-if="!info.to_send || !info.cf_user"></td>
|
||||
</tr>
|
||||
<!-- <tr v-if="info.to_send || info.cf_user">-->
|
||||
<!-- <td class="table-td" v-if="info.to_send"><span class="mr5">是否改派:</span>{{info.to_send}}</td>-->
|
||||
<!-- <td class="table-td" v-if="info.cf_user"><span class="mr5">分销来源:</span>{{info.cf_user}}</td>-->
|
||||
<!-- <td class="table-td" v-if="info.to_send && info.cf_user"></td>-->
|
||||
<!-- <td class="table-td" v-else colspan="2"></td>-->
|
||||
<!-- </tr>-->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
|
||||
@@ -124,7 +131,7 @@
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span href="javascript:void(0)" style="font-size: 20px">
|
||||
用户画像
|
||||
客户画像
|
||||
</span>
|
||||
<span style="float:right;margin-top:5px;" v-if="info.biz_type!=5">
|
||||
<a href="javascript:" @click="editType(3)"><i class="fa fa-edit"></i></a>
|
||||
@@ -187,6 +194,60 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-lg-12" v-if="info.tag_intention">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span href="javascript:void(0)" style="font-size: 20px">
|
||||
客户意向
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g">
|
||||
<table width="100%" style="margin-left: 10px;margin-right: 10px;">
|
||||
<template v-for="(v,i) in info.tag_intention">
|
||||
<tr v-if="v.value_str">
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
{{v.value_str}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-lg-12" v-if="info.tag_defeat">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
<span href="javascript:void(0)" style="font-size: 20px">
|
||||
战败标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g">
|
||||
<table width="100%" style="margin-left: 10px;margin-right: 10px;">
|
||||
<template v-for="(v,i) in info.tag_defeat">
|
||||
<tr v-if="v.value_str">
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
{{v.value_str}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-lg-12">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/customer">
|
||||
<input name="status" value="<?= $params['status'] ?>" type="hidden">
|
||||
<input type="hidden" id="id_tag" name="tag" value="<?= $params['tag'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">客户搜索:</label>
|
||||
@@ -61,21 +59,52 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">加个微:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="wxgr" v-model="params.wxgr">
|
||||
<option value=''>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.wxgrAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">是否改派:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="cs_biz_id" v-model="params.cs_biz_id">
|
||||
<option value=''>请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.csbizidAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">客户来源:</label>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<div class="am-form-group am-para-inline w100">
|
||||
<select name="of_id" v-model="params.of_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.offlineSourcesAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<div class="am-form-group am-para-inline w100">
|
||||
<select name="of2_id" v-model="params.of2_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in of2Ary">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="am-para-label w80">客户位置:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="城市" name="city_id" v-model="params.city_id">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w100">
|
||||
<select title="行政区" name="county_id" v-model="params.county_id">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w90">门店类型:</label>
|
||||
@@ -138,22 +167,33 @@
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
<input type="button" @click="btnTimes" value="筛选时间" class="am-btn am-btn-success am-btn-sm">
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<input type="button" @click="btnTimes" value="选择筛选时间" class="am-btn am-btn-success am-btn-sm">
|
||||
<input type="button" @click="btnTags" value="客户画像" class="am-btn am-btn-success am-btn-sm">
|
||||
</div>
|
||||
<div class="am-form-group fl ml10" style="display: none">
|
||||
<input type="button" @click="searchTag" value="客户画像" class="am-btn am-btn-success am-btn-sm">
|
||||
<div class="am-form-group fl ml10">
|
||||
<input type="button" @click="btnTagsIntention" value="客户意向" class="am-btn am-btn-success am-btn-sm">
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<input type="button" @click="btnTagsDefeat" value="战败标签" class="am-btn am-btn-success am-btn-sm">
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10" v-if="export_button==1">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out">导出</button>
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out()" title="最多500条">导出(带标签)</button>
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out(0)">导出(无标签)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input name="status" value="<?= $params['status'] ?>" type="hidden">
|
||||
<input type="hidden" id="id_tags" name="tags" value="<?= $params['tags'] ?>">
|
||||
<input type="hidden" id="id_tagsIntention" name="tagsIntention" value="<?= $params['tagsIntention'] ?>">
|
||||
<input type="hidden" id="id_tagsDefeat" name="tagsDefeat" value="<?= $params['tagsDefeat'] ?>">
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
@@ -170,8 +210,10 @@
|
||||
<th width="10%"><span>客户来源</span></th>
|
||||
<th width="10%"><span>所属门店</span></th>
|
||||
<th width="5%"><span>状态</span></th>
|
||||
<th width="5%"><span>是否改派</span></th>
|
||||
<th width="5%"><span>销售员</span></th>
|
||||
<th width="5%"><span>企微好友</span></th>
|
||||
<th width="5%"><span>加个微</span></th>
|
||||
<th width="6%"><span>最后联系时间</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -185,12 +227,14 @@
|
||||
<td>{{v.of_title}}</td>
|
||||
<td>{{v.biz_name}}</td>
|
||||
<td>{{v.status_name}}</td>
|
||||
<td>{{v.to_send}}</td>
|
||||
<td>{{v.admin_name}}</td>
|
||||
<td>{{v.wxqy_name}}</td>
|
||||
<td>{{v.wxgr_name}}</td>
|
||||
<td>{{v.cont_time}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="10">
|
||||
<td colspan="12">
|
||||
<div class="row">
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
@@ -237,6 +281,100 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tags-modal" style="display: none;">
|
||||
<div class="modal-body">
|
||||
<template v-for="(v,i) in show_info.tags">
|
||||
<tr>
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr v-if="v.type=='checkbox'">
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="checkbox" :value='v2.checked'
|
||||
v-model="v2.checked"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-else>
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="radio" :value='v2.id'
|
||||
v-model="v.value"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tags-intention-modal" style="display: none;">
|
||||
<div class="modal-body">
|
||||
<template v-for="(v,i) in show_info.tagsIntention">
|
||||
<tr>
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr v-if="v.type=='checkbox'">
|
||||
<td style="min-width: 100px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="checkbox" :value='v2.checked'
|
||||
v-model="v2.checked"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-else>
|
||||
<td style="min-width: 100px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="radio" :value='v2.id'
|
||||
v-model="v.value"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tags-defeat-modal" style="display: none;">
|
||||
<div class="modal-body">
|
||||
<template v-for="(v,i) in show_info.tagsDefeat">
|
||||
<tr>
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr v-if="v.type=='checkbox'">
|
||||
<td style="min-width: 100px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="checkbox" :value='v2.checked'
|
||||
v-model="v2.checked"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-else>
|
||||
<td style="min-width: 100px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="radio" :value='v2.id'
|
||||
v-model="v.value"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -283,10 +421,13 @@
|
||||
lists: [],
|
||||
qdjl_lists: [],
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
show_info: {levelAry: [], offlineSourcesAry: [], wxqyAry: []},
|
||||
show_info: {levelAry: [], offlineSourcesAry: [], wxqyAry: [], wxgrAry: [], csbizidAry: [], tags: []
|
||||
, tagsIntention: [], tagsDefeat: []},
|
||||
of2Ary: [],
|
||||
bizTypeAry: [],
|
||||
export_button: 0,
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
@@ -336,17 +477,168 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
btnTags: function () {
|
||||
var vm = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%'], //宽高
|
||||
content: $('#tags-modal'),
|
||||
title: '搜索客户画像',
|
||||
shade: false,
|
||||
btn: ['点击搜索', '重置画像', '取消搜索'],
|
||||
yes: function (index) {
|
||||
var ids = '';
|
||||
vm.show_info.tags.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
if (item2.checked) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
} else {
|
||||
if (item1.value == item2.id) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要搜索的数据!');
|
||||
}
|
||||
$('#id_tags').val(ids);
|
||||
$('#id_tagsIntention').val('');
|
||||
$('#id_tagsDefeat').val('');
|
||||
$('#vue-app').submit();
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function () {
|
||||
vm.show_info.tags.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
item2.checked = false;
|
||||
} else {
|
||||
item1.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#id_tags').val('');
|
||||
return false;
|
||||
},
|
||||
btn3: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
},
|
||||
btnTagsIntention: function () {
|
||||
var vm = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%'], //宽高
|
||||
content: $('#tags-intention-modal'),
|
||||
title: '搜索客户意向',
|
||||
shade: false,
|
||||
btn: ['点击搜索', '重置意向', '取消搜索'],
|
||||
yes: function (index) {
|
||||
var ids = '';
|
||||
vm.show_info.tagsIntention.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
if (item2.checked) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
} else {
|
||||
if (item1.value == item2.id) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要搜索的数据!');
|
||||
}
|
||||
$('#id_tagsIntention').val(ids);
|
||||
$('#id_tags').val('');
|
||||
$('#id_tagsDefeat').val('');
|
||||
$('#vue-app').submit();
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function () {
|
||||
vm.show_info.tagsIntention.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
item2.checked = false;
|
||||
} else {
|
||||
item1.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#id_tagsIntention').val('');
|
||||
return false;
|
||||
},
|
||||
btn3: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
},
|
||||
btnTagsDefeat: function () {
|
||||
var vm = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%'], //宽高
|
||||
content: $('#tags-defeat-modal'),
|
||||
title: '搜索战败标签',
|
||||
shade: false,
|
||||
btn: ['点击搜索', '重置战败', '取消搜索'],
|
||||
yes: function (index) {
|
||||
var ids = '';
|
||||
vm.show_info.tagsDefeat.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
if (item2.checked) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
} else {
|
||||
if (item1.value == item2.id) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要搜索的数据!');
|
||||
}
|
||||
$('#id_tagsDefeat').val(ids);
|
||||
$('#id_tags').val('');
|
||||
$('#id_tagsIntention').val('');
|
||||
$('#vue-app').submit();
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function () {
|
||||
vm.show_info.tagsDefeat.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
item2.checked = false;
|
||||
} else {
|
||||
item1.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#id_tagsDefeat').val('');
|
||||
return false;
|
||||
},
|
||||
btn3: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
},
|
||||
saveEdit: function () {
|
||||
$("form").submit();
|
||||
},
|
||||
searchTag: function () {
|
||||
var tag = [];
|
||||
tag.push('1_1');
|
||||
tag.push('1_3');
|
||||
tag.push('2_5');
|
||||
$('#id_tag').val(tag);
|
||||
$('#vue-app').submit();
|
||||
},
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
@@ -362,6 +654,7 @@
|
||||
if (response.code == 1) {
|
||||
//vm.cityAry = response.data;
|
||||
vm.admins.cityAry = JSON.parse(JSON.stringify(response.data));
|
||||
vm.cityAry = JSON.parse(JSON.stringify(response.data));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -373,8 +666,12 @@
|
||||
that.cfrom_id = 0;
|
||||
that.cfrom_id2 = 0;
|
||||
that.params.city_id_admin = '';
|
||||
that.params.city_id = '';
|
||||
that.params.of_id = '';
|
||||
that.params.of2_id = '';
|
||||
$('#id_tags').val('');
|
||||
$('#id_tagsIntention').val('');
|
||||
$('#id_tagsDefeat').val('');
|
||||
$('#cf_time').val('');
|
||||
$(".order-times").map(function () {
|
||||
var id = this.value;
|
||||
@@ -384,7 +681,7 @@
|
||||
});
|
||||
$("#times_checkbox").prop("checked", false);
|
||||
},
|
||||
export_out: function () {
|
||||
export_out: function (tag=1) {
|
||||
var that = this;
|
||||
if (that.export_button == 0){
|
||||
layer.msg('无权限导出');
|
||||
@@ -397,6 +694,7 @@
|
||||
}
|
||||
let href = $.menu.parseUri(window.location.href);
|
||||
href = href.replace("customer?", "customer/export?");
|
||||
href = href + "&export_tag=" + tag;
|
||||
window.location.href = href;
|
||||
},
|
||||
},
|
||||
@@ -436,6 +734,32 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.county_id_admin = '';
|
||||
} else {
|
||||
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
|
||||
that.params.county_id = '';
|
||||
}
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/common/area',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
@@ -508,3 +832,11 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.table-td {
|
||||
width: 20%;
|
||||
padding-top: 10px;
|
||||
line-height: 28px;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="coms-table-wrap mt10">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fr" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<template v-for="(index) in indexs">
|
||||
<th v-if="index=='序号'" width="50px">{{index}}</th>
|
||||
<th v-else>{{index}}</th>
|
||||
</template>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(list) in lists">
|
||||
<tr>
|
||||
<template v-for="(v, i) in list">
|
||||
<td v-if="i=='序号'">{{v}}</td>
|
||||
<td v-else-if="i=='栏目'" style="text-align: left" v-html="v"></td>
|
||||
<td v-else style="text-align: right">{{v}}</td>
|
||||
</template>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: {},
|
||||
indexs: [],
|
||||
lists: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.indexs = <?=json_encode($indexs)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
},
|
||||
methods: {
|
||||
export_out: function () {
|
||||
let href = $.menu.parseUri(window.location.href);
|
||||
href = href.replace("customer/lists_statdata?", "customer/export_statdata?");
|
||||
window.location.href = href;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,147 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/receiver/customer/lists_statdatalog">
|
||||
<input type="hidden" id="id" name="id" v-model="params.id">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">城市-门店:</label>
|
||||
<div class="am-form-group am-para-inline w100">
|
||||
<select name="city_id" v-model="params.city_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in city_biz_ary">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w100">
|
||||
<select name="biz_id" v-model="params.biz_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in biz_ary">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">统计时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w230">
|
||||
<input id="id-stat_date" name="stat_date" type="text" value="<?= $params['stat_date'] ?>"
|
||||
placeholder="统计时间范围" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="am-para-inline" style="padding-top: 5px;">
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="stat_date">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="stat_date">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="stat_date">本周</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="stat_date">本月</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fr" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<template v-for="(index) in indexs">
|
||||
<th v-if="index=='序号'" width="50px">{{index}}</th>
|
||||
<th v-else>{{index}}</th>
|
||||
</template>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(list) in lists">
|
||||
<tr>
|
||||
<template v-for="(v, i) in list">
|
||||
<td v-if="i=='序号'">{{v}}</td>
|
||||
<td v-else-if="i=='栏目'" style="text-align: left" v-html="v"></td>
|
||||
<td v-else style="text-align: right">{{v}}</td>
|
||||
</template>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-stat_date', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', nowDate = new Date();
|
||||
var beginDate = '', endDate = '';
|
||||
switch (type) {
|
||||
case 'today':
|
||||
endDate = beginDate = nowDate.Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'yesterday':
|
||||
endDate = beginDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
break;
|
||||
case 'weeks':
|
||||
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
nowDate.setDate(nowDate.getDate() + 6);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
|
||||
break;
|
||||
case 'month':
|
||||
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
|
||||
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
|
||||
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
|
||||
break;
|
||||
}
|
||||
date = beginDate + ' ~ ' + endDate;
|
||||
switch ($(this).data('btn')) {
|
||||
case 'stat_date':
|
||||
$('#id-stat_date').val(date);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: {'city_id': '', 'biz_id': ''},
|
||||
indexs: [],
|
||||
lists: [],
|
||||
city_biz_ary: [],
|
||||
biz_ary:[],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.indexs = <?=json_encode($indexs)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.city_biz_ary = <?=json_encode($city_biz_ary)?>;
|
||||
},
|
||||
methods: {
|
||||
export_out: function () {
|
||||
let href = $.menu.parseUri(window.location.href);
|
||||
href = href.replace("customer/lists_statdatalog?", "customer/export_statdatalog?");
|
||||
window.location.href = href;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'params.city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.params.biz_id = '';
|
||||
that.biz_ary = [];
|
||||
} else {
|
||||
that.biz_ary = that.city_biz_ary[nv]['list'];
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,122 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/receiver/customer/lists_statplan">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">计划名:</label>
|
||||
<div class="am-para-inline w220">
|
||||
<input id="sp_name" name="sp_name" type="text" v-model="params.sp_name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">客户来源:</label>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<select name="of_id" v-model="params.of_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.offlineSourcesAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w120">
|
||||
<select name="of2_id" v-model="params.of2_id">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in of2Ary">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
data-modal="/receiver/customer/get_statplan?id=0" data-title="新增客户统计计划">新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>条 </span>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">ID</th>
|
||||
<th width="30%"><span>计划名</span></th>
|
||||
<th width="15%"><span>客户来源</span></th>
|
||||
<th width="15%"><span>起止时间</span></th>
|
||||
<th width="10%"><span>最近执行日期</span></th>
|
||||
<th width="15%"><span>最后更新时间</span></th>
|
||||
<th width="15%"><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr>
|
||||
<td>{{v.id}}</td>
|
||||
<td>{{v.sp_name}}</td>
|
||||
<td>{{v.of_title}}</td>
|
||||
<td>{{v.s_date}} ~ {{v.e_date}}</td>
|
||||
<td>{{v.last_date}}</td>
|
||||
<td>{{v.u_time}}</td>
|
||||
<td>
|
||||
<a :data-modal="'/receiver/customer/get_statplan?id='+v.id+'&type=customer'"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
:data-title="'编辑 '+v.sp_name">编辑</a>
|
||||
<a href="javascript:void(0);" :data-open="'/receiver/customer/lists_statdata?id='+v.id"
|
||||
class="am-btn am-btn-primary am-btn-xs" style="display: none">数据</a>
|
||||
<a href="javascript:void(0);" :data-open="'/receiver/customer/lists_statdatalog?id='+v.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">数据</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: {'of_id': '', 'of2_id': '', 'sp_name': ''},
|
||||
lists: [],
|
||||
show_info: {offlineSourcesAry: []},
|
||||
of2Ary: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.show_info = <?=json_encode($show_info)?>;
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
watch: {
|
||||
'params.of_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.params.of2_id = '';
|
||||
that.of2Ary = [];
|
||||
} else {
|
||||
that.of2Ary = that.show_info.offlineSourcesAry[nv]['list'];
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,16 @@
|
||||
<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/edit_price_car" data-auto="true" method="post"
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">车辆售价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" value="<?=$price_car?>" name="price_car"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<input type="hidden" name="id" value="<?=$id?>">
|
||||
<button class="am-btn am-btn-secondary" type="submit">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,22 +1,199 @@
|
||||
<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/edit_srv" data-auto="true" method="post"
|
||||
<!--<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/edit_srv" data-auto="true" method="post"
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<? foreach ($srv_info as $key=>$value) {?>
|
||||
<?/* foreach ($srv_info as $key=>$value) {*/?>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" value="<?=$value['id']?>" name="money[<?=$key?>][id]"/>
|
||||
<input type="hidden" value="<?=$value['key']?>" name="money[<?=$key?>][key]"/>
|
||||
<input type="hidden" value="<?/*=$value['id']*/?>" name="money[<?/*=$key*/?>][id]"/>
|
||||
<input type="hidden" value="<?/*=$value['key']*/?>" name="money[<?/*=$key*/?>][key]"/>
|
||||
<label class="am-para-label">
|
||||
<input type="checkbox" name="money[<?=$key?>][checkbox]" <?=$value['checked']?> value="1">
|
||||
<?=$value['title']?>:
|
||||
<input type="checkbox" name="money[<?/*=$key*/?>][checkbox]" <?/*=$value['checked']*/?> value="1">
|
||||
<?/*=$value['title']*/?>:
|
||||
</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" value="<?=$value['money']?>" name="money[<?=$key?>][price]" <?=$value['key']=='price_insure' ? 'readonly' : ''?>/>
|
||||
<input type="text" value="<?/*=$value['money']*/?>" name="money[<?/*=$key*/?>][price]" <?/*=$value['key']=='price_insure' ? 'readonly' : ''*/?>/>
|
||||
</div>
|
||||
</div>
|
||||
<?}?>
|
||||
<?/*}*/?>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<input type="hidden" name="id" value="<?=$id?>">
|
||||
<input type="hidden" name="id" value="<?/*=$id*/?>">
|
||||
<button class="am-btn am-btn-secondary" type="submit">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>-->
|
||||
|
||||
<div id="vue-edit-srv" class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
|
||||
<template v-for="(item,index) in srv_info">
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" :id="'id_'+index" name="'id_'+index" v-model="item.id" />
|
||||
<input type="hidden" :id="'key_'+index" name="'key_'+index" v-model="item.key" />
|
||||
<label class="am-para-label">
|
||||
<input type="checkbox" v-model="item.checked" />
|
||||
{{item.title}}:
|
||||
</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" :id="'money_'+index" name="'money_'+index" v-model="item.money" :readonly="item.key=='price_insure'" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">
|
||||
精品选装:
|
||||
</label>
|
||||
<div class="am-para-input">
|
||||
{{price_fine_select}}
|
||||
</div>
|
||||
<div id="options-modal" class="am-para-input">
|
||||
<table class="table table-hover table-middle" style="table-layout:fixed">
|
||||
<colgroup>
|
||||
<col width="60%">
|
||||
<col width="20%">
|
||||
<col width="">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">项目</th>
|
||||
<th class="text-center">金额(非服务费时,0为赠送)</th>
|
||||
<th class="text-right">
|
||||
<a v-if="biz_type==1" href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm" @click='addOptions()'>添加</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(item,index) in fines">
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input v-if="biz_type==1" :id="'txt_'+index" @blur="editTxt(index)" class="form-control" v-model="item.txt" placeholder="请输入项目">
|
||||
<label v-else v-text="item.txt"></label>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input :id="'price_'+index" @blur="editPrice(index)" class="form-control"
|
||||
v-model="item.price" type="number" placeholder="请输入金额" min="0" oninput="if(value<0)value=0;">
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a v-if="biz_type==1" href="javascript:void(0);" style="margin-top:2px;"
|
||||
class="btn btn-danger btn-sm" @click='delOptions(index)'>删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
<input type="hidden" id="o_id" name="o_id" v-model="o_id">
|
||||
<button class="am-btn am-btn-secondary" type="submit" @click="saveEdit();">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue_obj;
|
||||
$(document).ready(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#vue-edit-srv',
|
||||
data: {
|
||||
srv_info: [],
|
||||
fines: [],
|
||||
o_id: 0,
|
||||
biz_type: '',
|
||||
price_fine_select: '',
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.srv_info = <?=json_encode($srv_info, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.fines = <?=json_encode($fines, JSON_UNESCAPED_UNICODE)?>;
|
||||
vm.o_id = <?=$id?>;
|
||||
vm.biz_type = <?=$biz_type?>;
|
||||
vm.price_fine_select = <?=$price_fine_select?>;
|
||||
// alert(vm.o_id);
|
||||
},
|
||||
computed: {},
|
||||
created: function () {
|
||||
// var vm = this;
|
||||
// alert(vm.o_id); // 在data初始化赋值才可
|
||||
},
|
||||
methods: {
|
||||
saveEdit: function () {
|
||||
var vm = this;
|
||||
var post_data = {};
|
||||
post_data['id'] = vm.o_id;
|
||||
post_data['money'] = vm.srv_info;
|
||||
post_data['fines'] = vm.fines;
|
||||
$.ajax({
|
||||
url: '/receiver/orderv2/orders/edit_srv',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: post_data,
|
||||
beforeSend: function () {
|
||||
layer.load(1, {
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
},
|
||||
success: function (data) {
|
||||
loading = false;
|
||||
if (data['code']) {
|
||||
layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
}, function () {
|
||||
if (data.url != '') {
|
||||
// $.form.href(data.url);
|
||||
window.location.href = data.url;
|
||||
} else {
|
||||
// $.form.reload();
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
loading = false;
|
||||
layer.closeAll('loading');
|
||||
},
|
||||
});
|
||||
},
|
||||
addOptions: function () {
|
||||
var vm = this;
|
||||
vm.fines.push({txt: '', price: '0'});
|
||||
// vm.fines.push({id: 0, txt: '', price: '0'});
|
||||
},
|
||||
delOptions: function (index) {
|
||||
var vm = this;
|
||||
vm.fines.splice(index,1);
|
||||
},
|
||||
editTxt: function (index) {
|
||||
var name = $("#txt_" + index).val();
|
||||
if (name == '') {
|
||||
layer.msg("项目不能为空!", {icon: 2});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
editPrice: function (index) {
|
||||
var vm = this;
|
||||
var price = 0;
|
||||
console.dir(vm.fines);
|
||||
for (item in vm.fines){
|
||||
console.dir(item);
|
||||
console.dir(vm.fines[item]);
|
||||
console.dir(vm.fines[item]['price']);
|
||||
console.dir(parseInt(vm.fines[item]['price']));
|
||||
if (vm.fines[item]['price'].length > 0){
|
||||
price += parseInt(vm.fines[item]['price']);
|
||||
}
|
||||
}
|
||||
console.dir(price);
|
||||
vm.price_fine_select = price;
|
||||
return true;
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@@ -6,6 +6,13 @@
|
||||
<input type="text" value="" name="id"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">订单号:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" value="" name="sid"/>
|
||||
* 订单id 与 订单号,只要有一个条件就可
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group" style="margin-bottom: 2rem">
|
||||
<div class="am-para-input">
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/add_paylog" data-auto="true" method="post"
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<input type="hidden" name="id" value="<?= $id ?>">
|
||||
<input type="hidden" name="log_id" value="<?= intval($order_row["id"]) ?>">
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">支付金额:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="number" value="" name="money">
|
||||
<input type="number" value="<?=$order_row["total_price"]?>" name="money">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +14,7 @@
|
||||
<div class="am-para-input w150">
|
||||
<select name="type">
|
||||
<?foreach($type as $item){?>
|
||||
<option value="<?=$item['id']?>"><?=$item['name']?></option>
|
||||
<option <?=$order_row["type"]==$item["id"] ? "selected" : ""?> value="<?=$item['id']?>"><?=$item['name']?></option>
|
||||
<?}?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -24,7 +25,7 @@
|
||||
<div class="am-para-input w150">
|
||||
<select name="wx_mchid">
|
||||
<?foreach($companys as $item){?>
|
||||
<option value="<?=$item['wx_mchid']?>"><?=$item['short']?></option>
|
||||
<option <?=$order_row["mch_id"]==$item["wx_mchid"] ? "selected" : ""?> value="<?=$item['wx_mchid']?>"><?=$item['short']?></option>
|
||||
<?}?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -42,7 +43,7 @@
|
||||
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
|
||||
value="" class="layui-input">
|
||||
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
|
||||
src=""/>
|
||||
src="<?=$order_row["img"] ? build_qiniu_image_url($order_row["img"]):""?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
@@ -57,7 +58,7 @@
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">备注:</label>
|
||||
<div class="am-para-input">
|
||||
<textarea name="descrip"></textarea>
|
||||
<textarea name="descrip"><?=$order_row["descrip"]?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">保险到期时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 90%;text-align: left">
|
||||
<label class="am-para-label" style="width: 50%;text-align: left">
|
||||
<? if ($info['agent']['business_time']) { ?>
|
||||
<?= $info['agent']['business_time'] ?>
|
||||
<? } else { ?>
|
||||
@@ -50,10 +50,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12"></div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">商业险公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -67,7 +63,23 @@
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="number" name="business_price" v-model="info.agent.business_price"></label>
|
||||
</div>
|
||||
<div class="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="text" name="accident_title" v-model="info.agent.accident_title"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险费用:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="text" name="accident_price" v-model="info.agent.accident_price"></label>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<input type="hidden" name="oid" v-model="info.id">
|
||||
<a href='javascript:;' class='am-btn am-btn-primary am-btn-xs' @click="save_agent">
|
||||
保存
|
||||
@@ -119,9 +131,11 @@
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="身份证正面" onclick="showViewer('viewer-cardida')"
|
||||
src="<?= $info['imgs_status']['cardida']['imgs'][0] ?>"/>
|
||||
src="<?= $info['imgs_status']['cardida']['imgs'][0].'?imageView2/2/w/640/h/0/interlace/1' ?>"/>
|
||||
</a>
|
||||
<div class="f12 tc">身份证正面</div>
|
||||
<div class="f12 tc">身份证正面<br>
|
||||
<a href=<?= $info['imgs_status']['cardida']['imgs'][0] ?> target="_blank">查看原图</a>
|
||||
</div>
|
||||
</li>
|
||||
<? } else { ?>
|
||||
<li>
|
||||
@@ -141,9 +155,12 @@
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="身份证反面" onclick="showViewer('viewer-cardida')"
|
||||
src="<?= $info['imgs_status']['cardida']['imgs'][1] ?>"/>
|
||||
src="<?= $info['imgs_status']['cardida']['imgs'][1].'?imageView2/2/w/640/h/0/interlace/1' ?>"/>
|
||||
</a>
|
||||
<div class="f12 tc">身份证反面</div>
|
||||
<div class="f12 tc">身份证反面<br>
|
||||
<a href=<?= $info['imgs_status']['cardida']['imgs'][1] ?> target="_blank">查看原图</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<? } else { ?>
|
||||
<li>
|
||||
@@ -168,9 +185,10 @@
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="登记证" onclick="showViewer('viewer-register_img')"
|
||||
src="<?= $info['imgs_status']['register_img']['imgs'][0] ?>"/>
|
||||
src="<?= $info['imgs_status']['register_img']['imgs'][0].'?imageView2/2/w/640/h/0/interlace/1' ?>"/>
|
||||
</a>
|
||||
<div class="f12 tc">登记证</div>
|
||||
<div class="f12 tc">登记证<br>
|
||||
<a href=<?= $info['imgs_status']['register_img']['imgs'][0] ?> target="_blank">查看原图</div>
|
||||
</li>
|
||||
<? } else { ?>
|
||||
<li>
|
||||
@@ -190,9 +208,10 @@
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="行驶证" onclick="showViewer('viewer-register_img')"
|
||||
src="<?= $info['imgs_status']['car_img']['imgs'][0] ?>"/>
|
||||
src="<?= $info['imgs_status']['car_img']['imgs'][0].'?imageView2/2/w/640/h/0/interlace/1' ?>"/>
|
||||
</a>
|
||||
<div class="f12 tc">行驶证</div>
|
||||
<div class="f12 tc">行驶证<br>
|
||||
<a href=<?= $info['imgs_status']['car_img']['imgs'][0] ?> target="_blank">查看原图</div>
|
||||
</li>
|
||||
<? } else { ?>
|
||||
<li>
|
||||
@@ -257,6 +276,28 @@
|
||||
<div class="tc f12">商业险</div>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? if ($info['imgs_status']['accident_img']['imgs'][0]) { ?>
|
||||
<li style="position:relative;">
|
||||
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
|
||||
onclick="del_img('data','accident_img','')">x
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="意外险" onclick="showViewer('viewer-insurance_img')"
|
||||
src="<?= $info['imgs_status']['accident_img']['imgs'][0] ?>"/>
|
||||
</a>
|
||||
<div class="f12 tc">意外险</div>
|
||||
</li>
|
||||
<? } else { ?>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
|
||||
data-uptype="qiniu" data-field="accident_img" data-mark="compalbum">
|
||||
<input type="hidden" class="accident_img" name="accident_img" data-type="1" value=""
|
||||
onchange="upImg('accident_img',this)">
|
||||
<div></div>
|
||||
</a>
|
||||
<div class="tc f12">意外险</div>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -107,6 +107,8 @@
|
||||
<span style="font-size: 20px">基本信息</span>
|
||||
<span class="ml10">{{info.sid}}</span>
|
||||
<span style="float:right;margin-top:5px">
|
||||
<a :data-update="info.id" data-action="/receiver/orderv2/orders/edit_finished" class="am-btn am-btn-success am-btn-xs"
|
||||
v-if="0==info.status">一键完成</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
@@ -256,6 +258,12 @@
|
||||
下载汽车购车协议
|
||||
</a><br>
|
||||
</div>
|
||||
<div class="am-form-group" v-if="info.contract_data[1]">
|
||||
<a :href="'/receiver/orderv2/orders/get_down?type=1&id='+info.id" target="_blank"
|
||||
class="am-btn am-btn-primary am-btn-sm">
|
||||
下载委托服务协议
|
||||
</a><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -301,9 +309,10 @@
|
||||
<div class="am-form-group" v-if="info.bill && info.bill.file">
|
||||
<div v-if="info.bill.file_type=='img'" class="fl ml10">
|
||||
<img id="viewer-bill_file_img" :layer-src="info.bill.file"
|
||||
:src="info.bill.file" class="w100" alt="发票"
|
||||
:src="info.bill.file+'?imageView2/2/w/640/h/0/interlace/1'" class="w100" alt="发票"
|
||||
onclick="showViewer('viewer-bill_file_img')"
|
||||
style="height:auto;max-height:32px;max-width:50px;margin-left: 5px">
|
||||
<a :href="info.bill.file" target="_blank">查看原图</a>
|
||||
</div>
|
||||
<a v-else :href="info.bill.file" target="_blank" class="mt5"
|
||||
style="width:100px;line-height:20px;margin-left:5px;">查看发票</a>
|
||||
@@ -357,7 +366,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--贷款明细-->
|
||||
<!--首付按揭-->
|
||||
<? require_once "loaninfo0.php" ?>
|
||||
<!--按揭明细-->
|
||||
<? require_once "loaninfo.php" ?>
|
||||
<!--资料审核-->
|
||||
<? require_once "ckinfo.php" ?>
|
||||
@@ -372,6 +383,10 @@
|
||||
elem: '#loan_time'
|
||||
, type: 'date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#loan_time0'
|
||||
, type: 'date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ins_time'
|
||||
, type: 'date'
|
||||
@@ -453,7 +468,11 @@
|
||||
yes: function (index) {
|
||||
$.post("/receiver/orderv2/orders/edit_item", {
|
||||
'id': that.info.id,
|
||||
'item_id': that.info.item_id
|
||||
'item_id': that.info.item_id,
|
||||
'buy_price': that.info.buy_price,
|
||||
'buy_price_origin': that.info.buy_price_origin,
|
||||
'estimated_rebate': that.info.estimated_rebate,
|
||||
'estimated_rebate_origin': that.info.estimated_rebate_origin,
|
||||
}, function (data) {
|
||||
if (data.code) {
|
||||
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
|
||||
@@ -466,6 +485,22 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
carModalInfo: function () {
|
||||
var that = this
|
||||
layer.open({
|
||||
type: 1,
|
||||
// area: ['40%', '50%'], //宽高
|
||||
area: ['400', '300'], //宽高
|
||||
content: $('#car-modal-info'),
|
||||
title: '确认采购成本与预估返利',
|
||||
shade: false,
|
||||
btn: ['确定'],
|
||||
yes: function (index) {
|
||||
// alert(that.info.vin);
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
},
|
||||
getCars: function (page) {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
@@ -506,8 +541,19 @@
|
||||
if (checked) {
|
||||
vm.info.item_id = cars.id;
|
||||
cars.selected = 1;
|
||||
vm.info.vin = cars.vin;
|
||||
vm.info.buy_price = cars.buy_price;
|
||||
vm.info.buy_price_origin = cars.buy_price;
|
||||
vm.info.estimated_rebate = cars.estimated_rebate;
|
||||
vm.info.estimated_rebate_origin = cars.estimated_rebate;
|
||||
this.carModalInfo();
|
||||
} else {
|
||||
vm.info.item_id = 0;
|
||||
vm.info.vin = '';
|
||||
vm.info.buy_price = 0;
|
||||
vm.info.buy_price_origin = 0;
|
||||
vm.info.estimated_rebate = 0;
|
||||
vm.info.estimated_rebate_origin = 0;
|
||||
}
|
||||
},
|
||||
beforeUsersPage: function () {
|
||||
@@ -526,6 +572,8 @@
|
||||
},
|
||||
finish_loan: function (status) {
|
||||
var that = this;
|
||||
var url = '/receiver/orderv2/orders/edit_loan';
|
||||
var if_loan0 = false; // 首付按揭
|
||||
if (status == 2) {
|
||||
var loan_time = $('#loan_time').val();
|
||||
// if (!loan_time) {
|
||||
@@ -534,7 +582,23 @@
|
||||
// }
|
||||
this.info.loan_info.loan_time = loan_time;
|
||||
}
|
||||
$.post("/receiver/orderv2/orders/edit_loan", {
|
||||
else if (status == 3){
|
||||
if_loan0 = true;
|
||||
}
|
||||
else if (status == 4){
|
||||
if_loan0 = true;
|
||||
var loan_time = $('#loan_time0').val();
|
||||
// if (!loan_time) {
|
||||
// layer.msg("请填写放款时间");
|
||||
// return;
|
||||
// }
|
||||
this.info.loan_info0.loan_time = loan_time;
|
||||
}
|
||||
if (if_loan0){
|
||||
status = status - 2;
|
||||
url = '/receiver/orderv2/orders/edit_loan0';
|
||||
}
|
||||
$.post(url, {
|
||||
'info': this.info,
|
||||
'status': status
|
||||
}, function (data) {
|
||||
@@ -663,14 +727,88 @@
|
||||
, shade: 0.3
|
||||
, time: false
|
||||
});
|
||||
var value = $(obj).val();
|
||||
var that = this;
|
||||
$.post("/receiver/orderv2/orders/edit_bill", {
|
||||
'id': <?=$info['id']?>,
|
||||
'value': value,
|
||||
}, function (data) {
|
||||
var params = {
|
||||
'id':<?=$info['id']?>,
|
||||
'value': $(obj).val()
|
||||
}
|
||||
$.post("/receiver/orderv2/orders/edit_bill", params, function (data) {
|
||||
layer.closeAll()
|
||||
if (data.code) {
|
||||
if (data.code==1) {
|
||||
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
} else if(data.code==2) {
|
||||
layer.open({
|
||||
type: 0,
|
||||
// title: '标题',
|
||||
content:data.msg,
|
||||
btn: ['重新上传','二手车发票'],
|
||||
btn1:function(index, layero){
|
||||
// 按钮1的逻辑
|
||||
layer.closeAll()
|
||||
},
|
||||
btn2:function(index, layero){
|
||||
// 按钮2的逻辑
|
||||
layer.closeAll()
|
||||
params['if_usedcar'] = 1
|
||||
$.post("/receiver/orderv2/orders/edit_bill", params, function (data) {
|
||||
layer.closeAll()
|
||||
if (data.code) {
|
||||
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},'json')
|
||||
},
|
||||
cancel: function(){
|
||||
// 右上角关闭事件的逻辑
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function upLoanFile(type, obj) {
|
||||
var that = this;
|
||||
var params = {
|
||||
'id':<?=$info['id']?>,
|
||||
'value': $(obj).val(),
|
||||
'type': type
|
||||
};
|
||||
var url = '/receiver/orderv2/orders/edit_loanfile';
|
||||
var if_loan0 = false; // 首付按揭
|
||||
if (type == 1) {
|
||||
var loan_time = $('#loan_time').val();
|
||||
if (!loan_time) {
|
||||
layer.msg("请填写放款时间");
|
||||
return;
|
||||
}
|
||||
params['loan_time'] = loan_time;
|
||||
}
|
||||
else if (type == 2){
|
||||
if_loan0 = true;
|
||||
}
|
||||
else if (type == 3){
|
||||
if_loan0 = true;
|
||||
var loan_time = $('#loan_time0').val();
|
||||
if (!loan_time) {
|
||||
layer.msg("请填写首付放款时间");
|
||||
return;
|
||||
}
|
||||
params['loan_time'] = loan_time;
|
||||
}
|
||||
if (if_loan0){
|
||||
params['type'] = type - 2;
|
||||
url = '/receiver/orderv2/orders/edit_loanfile0';
|
||||
}
|
||||
$.post(url, params, function (data) {
|
||||
layer.closeAll()
|
||||
if (data.code==1) {
|
||||
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
|
||||
$.form.reload();
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="am-panel am-panel-default" v-if="!info.payway && info.loan_info">
|
||||
<div class="am-panel-hd">
|
||||
<span style="font-size: 20px">分期明细</span>
|
||||
<span style="font-size: 20px">按揭明细</span>
|
||||
<span style="float:right;margin-top:5px">
|
||||
</span>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">贷款金额:</span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label">
|
||||
<input type="text" v-model="info.loan_info.price_loan">
|
||||
@@ -51,16 +51,48 @@
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.loan_info.is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label">
|
||||
<input type="text" v-model="info.loan_info.num">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭通知函:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="input-group-btn" style="width: 50px;">
|
||||
<label class="input-group-btn" style="width: 50px; display: none">
|
||||
<span class="am-btn am-btn-default am-btn-sm">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg" @change="upTz(0,$event)">
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="am-form-group">
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1"
|
||||
data-type="jpg,png,gif,png,jpeg"
|
||||
data-uptype="qiniu" data-field="loan_file">
|
||||
<input type="hidden" class="loan_file" name="loan_file" data-type="0" value=""
|
||||
onchange="upLoanFile(0,this)">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul id="viewer-notify_file" class="photopic-list clearfix mt10" v-if="info.loan_info && info.loan_info.notify_file_list">
|
||||
<? foreach ($info['loan_info']['notify_file_list'] as $key=>$val) {?>
|
||||
<li style="position:relative;">
|
||||
@@ -127,13 +159,22 @@
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<div class="am-form-group">
|
||||
<label class="input-group-btn" style="width: 50px;">
|
||||
<label class="input-group-btn" style="width: 50px;; display: none">
|
||||
<span class="am-btn am-btn-default am-btn-sm">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg"
|
||||
@change="upTz(1,$event)"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1"
|
||||
data-type="jpg,png,gif,png,jpeg"
|
||||
data-uptype="qiniu" data-field="notify_file">
|
||||
<input type="hidden" class="notify_file" id="notify_file" name="notify_file" data-type="1" value=""
|
||||
onchange="upLoanFile(1,this)">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
</a>
|
||||
</div>
|
||||
<div class="am-form-group ml10" v-if="info.loan_info.lend_file">
|
||||
<a :href="info.loan_info.lend_file" target="_blank" class='mt5' title="查看文件">
|
||||
{{info.loan_info.lend_file_name}}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
<div class="am-panel am-panel-default" v-if="!info.payway && info.loan_info0">
|
||||
<div class="am-panel-hd">
|
||||
<span style="font-size: 20px">首付按揭明细</span>
|
||||
<span style="float:right;margin-top:5px">
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;" v-if="info.loan_info0.finance_rows">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">金融机构:</span></label>
|
||||
<div class="am-para-input">
|
||||
<select style="width:150px" v-model="info.finance_id0">
|
||||
<option v-for="item in info.loan_info0.finance_rows" :value="item.id">{{item.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label">
|
||||
<input type="text" v-model="info.loan_info0.price_loan">
|
||||
</label>
|
||||
</div>
|
||||
<label class="am-para-label label-width"><span class="span-bold">收款公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label w130">
|
||||
<select v-model="info.loan_info0.company_id">
|
||||
<option value="0">请选择</option>
|
||||
<option v-for="item in info.companys" :value="item.id">{{item.short}}</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<!--<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">首付:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.loan_info.first_pay}}</label>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold"></span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<? if ($info['loan_info0']['status_array'] && in_array(1, $info['loan_info0']['status_array'])) { ?>
|
||||
<label class="am-para-label label-width"><span class="span-bold">放款时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label">
|
||||
<input type="text" id="loan_time0" v-model="info.loan_info0.loan_time" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-inline" style="display: none">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.loan_info0.is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">期数:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label">
|
||||
<input type="text" v-model="info.loan_info0.num">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭通知函:</span></label>
|
||||
<div class="am-para-input">
|
||||
<div class="am-form-group">
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1"
|
||||
data-type="jpg,png,gif,png,jpeg"
|
||||
data-uptype="qiniu" data-field="loan_file0">
|
||||
<input type="hidden" class="loan_file0" name="loan_file0" data-type="0" value=""
|
||||
onchange="upLoanFile(2,this)">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul id="viewer-notify_file" class="photopic-list clearfix mt10" v-if="info.loan_info0 && info.loan_info0.notify_file_list">
|
||||
<? foreach ($info['loan_info0']['notify_file_list'] as $key=>$val) {?>
|
||||
<li style="position:relative;">
|
||||
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;" onclick="del_img('load_info0','notify_file','<?=$key?>')">x
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="按揭通知函" onclick="showViewer('viewer-notify_file')" src="<?=$val?>"/>
|
||||
</a>
|
||||
<div class="f12 tc"></div>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<? if ($info['loan_info0']['status_array'] && in_array(1, $info['loan_info0']['status_array'])) { ?>
|
||||
<label class="am-para-label label-width"><span class="span-bold">按揭放款函:</span></label>
|
||||
<div class="am-para-input">
|
||||
<div class="am-form-inline">
|
||||
<? if (is_img($info['loan_info0']['lend_file_name'])) { ?>
|
||||
<ul id="viewer-lend_file" class="photopic-list ml30 clearfix">
|
||||
<li style="position:relative;">
|
||||
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
|
||||
onclick="del_img('load_info0','lend_file','')">x
|
||||
</div>
|
||||
<a target="_blank" class="pic">
|
||||
<img alt="按揭放款函" onclick="showViewer('viewer-lend_file')"
|
||||
:src="info.loan_info0.lend_file"/>
|
||||
</a>
|
||||
<div class="f12 tc"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<div class="am-form-group">
|
||||
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1"
|
||||
data-type="jpg,png,gif,png,jpeg"
|
||||
data-uptype="qiniu" data-field="notify_file0">
|
||||
<input type="hidden" class="notify_file0" id="notify_file0" name="notify_file0" data-type="1" value=""
|
||||
onchange="upLoanFile(3,this)">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
</a>
|
||||
</div>
|
||||
<div class="am-form-group ml10" v-if="info.loan_info0.lend_file">
|
||||
<a :href="info.loan_info0.lend_file" target="_blank" class='mt5' title="查看文件">
|
||||
{{info.loan_info0.lend_file_name}}
|
||||
</a>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<div class="am-form-group ml10">
|
||||
<? if (!$info['loan_info0']['status_array']) { ?>
|
||||
<a href='javascript:;' @click="finish_loan(3)"
|
||||
class='am-btn am-btn-primary am-btn-xs'>等待放款</a>
|
||||
<? } elseif ($info['loan_info0']['status_array'] && in_array(1, $info['loan_info0']['status_array']) && !in_array(2, $info['loan_info0']['status_array'])) { ?>
|
||||
<a href='javascript:;' @click="finish_loan(4)"
|
||||
class='am-btn am-btn-primary am-btn-xs'>按揭完成</a>
|
||||
<? } else { ?>
|
||||
<a href="javascript:"
|
||||
class="am-btn am-btn-default am-active am-btn-xs">已完成按揭</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,6 +29,7 @@
|
||||
({{info.sale_detail}})
|
||||
</span>
|
||||
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改优惠金额" :data-modal="'/receiver/orderv2/orders/edit_price?id='+info.id">修改优惠</span>
|
||||
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改售价" :data-modal="'/receiver/orderv2/orders/edit_price_car?id='+info.id">修改售价</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +57,7 @@
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">服务费:</span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold">手续费:</span></label>
|
||||
<div class="am-para-input" style="margin-left:120px">
|
||||
<label class="am-para-label-con" v-if="info.srv_info">
|
||||
{{info.srv_info.total}}
|
||||
@@ -64,7 +65,7 @@
|
||||
(<span class="text-danger" v-html="info.srv_info.detail"></span>)
|
||||
</template>
|
||||
</label>
|
||||
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改服务费" :data-modal="'/receiver/orderv2/orders/edit_srv?id='+info.id">修改</span>
|
||||
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改手续费" :data-modal="'/receiver/orderv2/orders/edit_srv?id='+info.id">修改</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
@@ -72,7 +73,7 @@
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">
|
||||
<span v-if="info.payway">全款</span>
|
||||
<span v-else>贷款</span>
|
||||
<span v-else>按揭</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -98,7 +99,7 @@
|
||||
<label class="am-para-label-con">
|
||||
<span v-if="info.item_id">
|
||||
<a href="javascript:void(0);" :data-modal="'/items/goods/goods/get_info?id='+info.item_id"
|
||||
data-title="车辆信息">{{info.vin}}</a>
|
||||
data-title="车辆信息">{{info.vin}}</a>{{info.if_usedcar_name}}
|
||||
</span>
|
||||
<span v-else>未选择</span>
|
||||
<a @click="cancelItem" v-if="info.item_id" class='am-btn am-btn-default am-btn-xs'>取消分配</a>
|
||||
@@ -245,3 +246,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="car-modal-info" style="display: none;">
|
||||
<div class="modal-body">
|
||||
<div class="input-group">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">车架号:</label>
|
||||
<!-- <div class="am-para-inline ">-->
|
||||
<label class="am-para-label fl">{{info.vin}}</label>
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">采购成本:</label>
|
||||
<div class="am-para-inline">
|
||||
<input type="text" v-model="info.buy_price" placeholder="请输入采购成本"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">预估返利:</label>
|
||||
<div class="am-para-inline">
|
||||
<input type="text" v-model="info.estimated_rebate" placeholder="请输入预估返利"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<th>操作人</th>
|
||||
<th>备注</th>
|
||||
<th>支付截图</th>
|
||||
<th>付款时间</th>
|
||||
<th>付款时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -42,6 +43,13 @@
|
||||
</template>
|
||||
</td>
|
||||
<td>{{item.pay_time}}</td>
|
||||
<td>
|
||||
<a href="javascript:;"
|
||||
class="am-btn am-btn-primary am-btn-xs" v-if="item.admin_id>0"
|
||||
:data-modal="'/receiver/orderv2/orders/add_paylog?id=<?=$id?>&log_id='+item.id">
|
||||
修改
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -63,8 +71,9 @@
|
||||
</nav>
|
||||
</div>
|
||||
<div class="align-r ml15" v-if="need_price">
|
||||
应收总额:{{need_price}},已收总额:{{pay_price}}
|
||||
<template v-if="price_loan">,贷款金额:{{price_loan}}</template>  
|
||||
应收总额:{{need_price}} , 已收总额:{{pay_price}}
|
||||
<template v-if="price_loan0">, 首付按揭金额:{{price_loan0}}</template>
|
||||
<template v-if="price_loan">, 按揭金额:{{price_loan}}</template>  
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,6 +91,7 @@
|
||||
pay_price: '',
|
||||
need_price: '',
|
||||
price_loan: '',
|
||||
price_loan0: '',
|
||||
car_info : [],
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -97,6 +107,7 @@
|
||||
that.pay_price = result.data.pay_price;
|
||||
that.need_price = result.data.need_price;
|
||||
that.price_loan = result.data.price_loan;
|
||||
that.price_loan0 = result.data.price_loan0;
|
||||
that.car_info = result.data.car_info;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -159,10 +159,19 @@
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">车架号:</label>
|
||||
<div class="am-para-inline w260">
|
||||
<div class="am-para-inline w200">
|
||||
<input name="vin" type="text" value="<?= $params['vin'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">二手车:</label>
|
||||
<div class="am-para-inline w80">
|
||||
<select name="if_usedcar" v-model="params.if_usedcar">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.usedcarAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">销售员:</label>
|
||||
@@ -262,7 +271,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<a type="button" data-modal="/receiver/orderv2/orders/edit_status" class="am-btn am-btn-success am-btn-sm w100">退款
|
||||
<a type="button" data-modal="/receiver/orderv2/orders/edit_status" class="am-btn am-btn-success am-btn-sm w100" data-title="退款">退款
|
||||
</a>
|
||||
</div>
|
||||
<!--
|
||||
@@ -381,7 +390,7 @@
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: [],
|
||||
show_info: {cfTitleAry: [], qdjl_lists: []},
|
||||
show_info: {cfTitleAry: [], qdjl_lists: [], usedcarAry: []},
|
||||
of2Ary: [],
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -409,7 +418,7 @@
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status: 1},
|
||||
data: {status: '> -1'}, // data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/owners">
|
||||
<input name="status" type='hidden' value="<?=$params['status']?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<label class="am-para-label w100">车主搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" v-model="params.search_tp">
|
||||
<option :value="i" v-for="(v,i) in show_info.searchTpAry">{{v}}</option>
|
||||
@@ -146,6 +145,9 @@
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<input type="button" @click="btnTags" value="搜索车主画像" class="am-btn am-btn-success am-btn-sm">
|
||||
</div>
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
||||
</div>
|
||||
@@ -154,11 +156,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input name="status" type='hidden' value="<?=$params['status']?>">
|
||||
<input type="hidden" id="id_tags" name="tags" value="<?= $params['tags'] ?>">
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<span>共<?= intval($pager['totle']) ?>个车主</span>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
@@ -236,6 +240,37 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tags-modal" style="display: none;">
|
||||
<div class="modal-body">
|
||||
<template v-for="(v,i) in show_info.tags">
|
||||
<tr>
|
||||
<td class="table-td" style="width: 80%">
|
||||
<table>
|
||||
<tr v-if="v.type=='checkbox'">
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="checkbox" :value='v2.checked'
|
||||
v-model="v2.checked"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-else>
|
||||
<td style="min-width: 80px">{{v.name}}:</td>
|
||||
<td>
|
||||
<template v-for="(v2,i2) in v.list">
|
||||
<input type="radio" :value='v2.id'
|
||||
v-model="v.value"> {{v2.name}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -284,7 +319,7 @@
|
||||
attrvAry: [],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
show_info: {searchTpAry: [], wxqyAry: []},
|
||||
show_info: {searchTpAry: [], wxqyAry: [], tags: []},
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -318,7 +353,7 @@
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status: 1},
|
||||
data: {status: '> -1'}, // data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
@@ -352,6 +387,57 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
btnTags: function () {
|
||||
var vm = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['50%'], //宽高
|
||||
content: $('#tags-modal'),
|
||||
title: '搜索车主画像',
|
||||
shade: false,
|
||||
btn: ['点击搜索', '重置画像', '取消搜索'],
|
||||
yes: function (index) {
|
||||
var ids = '';
|
||||
vm.show_info.tags.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
if (item2.checked) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
} else {
|
||||
if (item1.value == item2.id) {
|
||||
ids = ids ? ids + ',' + item2.id : item2.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (ids.length < 1) {
|
||||
return $.msg.tips('请选择需要搜索的数据!');
|
||||
}
|
||||
$('#id_tags').val(ids);
|
||||
$('#vue-app').submit();
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function () {
|
||||
vm.show_info.tags.map(function (item1) {
|
||||
for (var i in item1.list) {
|
||||
var item2 = item1.list[i];
|
||||
if (item1.type == 'checkbox') {
|
||||
item2.checked = false;
|
||||
} else {
|
||||
item1.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#id_tags').val('');
|
||||
return false;
|
||||
},
|
||||
btn3: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
},
|
||||
saveEdit: function () {
|
||||
$("form").submit();
|
||||
},
|
||||
@@ -364,6 +450,7 @@
|
||||
that.params.brand_id = '';
|
||||
that.params.wxqy = '';
|
||||
that.params.city_id = '';
|
||||
$('#id_tags').val('');
|
||||
$(".order-times").map(function () {
|
||||
var id = this.value;
|
||||
this.checked = false;
|
||||
@@ -562,3 +649,11 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.table-td {
|
||||
width: 20%;
|
||||
padding-top: 10px;
|
||||
line-height: 28px;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user