orders_421

This commit is contained in:
dengbw
2022-04-21 11:35:11 +08:00
committed by lccsw
parent 703a7c6d35
commit 8626eaf349
9 changed files with 318 additions and 622 deletions
+8 -3
View File
@@ -102,11 +102,17 @@ class Orders extends HD_Controller
$id = $this->input->get('id');
$row = $this->orders_model->get(['id' => $id]);
$sign = $this->order_signs_model->get(['o_id' => $row['id']], 'status');
$customers = $this->customers_model->get(['id' => $row['rid']], 'cf_title');
//$sign = $this->order_signs_model->get(['o_id' => $row['id']], 'status');
$customers = $this->customers_model->get(['id' => $row['rid']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
if ($customers['of_id']) {//客户来源
$of_ary = $this->customers_model->offlineSources($customers['of_id']);
$of_title = $of_ary['name'];
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
$row['of_title'] = $of_title;
}
$sub_status_cn = $this->orderslist->sub_status_cn($row['id'],$row['status']);
$sub_status_cn && $sub_status_cn = "-".$sub_status_cn;
$money_json = json_decode($row['money_json'], true);
@@ -121,7 +127,6 @@ class Orders extends HD_Controller
$row['deposit'] = number_format($deposit, 2);
$row['c_time'] = date('Y-m-d', $row['c_time']);
$row['sign_status_name'] = $status_arr[$row['status']]['name'].$sub_status_cn;
$row['cf_title'] = $customers['cf_title'];
$row['payway'] = intval($row['payway']);
$row['item_id'] = intval($row['item_id']);
$row['cardid'] = $row['info_json']['cardid'] ? $row['info_json']['cardid'] : $row['info_json']['c_cardid'];
@@ -115,10 +115,16 @@ class Orders extends HD_Controller
$id = $this->input->get('id');
$row = $this->receiver_orders_v2_model->get(['id' => $id]);
$customers = $this->customers_model->get(['id' => $row['customer_id']], 'cf_title');
$customers = $this->customers_model->get(['id' => $row['customer_id']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
if ($customers['of_id']) {//客户来源
$of_ary = $this->customers_model->offlineSources($customers['of_id']);
$of_title = $of_ary['name'];
$customers['of2_id'] && $of_title .= '-' . $of_ary['list'][$customers['of2_id']];
$row['of_title'] = $of_title;
}
$money_json = json_decode($row['money_json'], true);
$deposit = $money_json['price_book'];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
@@ -136,7 +142,6 @@ class Orders extends HD_Controller
$row['price'] = number_format($money_json['price_car'], 2);
$row['deposit'] = number_format($deposit, 2);
$row['c_time'] = date('Y-m-d', $row['c_time']);
$row['cf_title'] = $customers['cf_title'];
$row['payway'] = intval($row['payway']);
$row['item_id'] = intval($row['item_id']);
$row['cardid'] = $row['info_json']['c_cardid'] ? $row['info_json']['c_cardid'] :'';
+107 -226
View File
@@ -28,13 +28,12 @@ class OrdersList
{
$result = $show_info = array();
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['cf_clues'] && $params['cf_clues'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!strlen($params['payway']) && $params['payway'] = '';
!$params['biz_type'] && $params['biz_type'] = '';
$fieldAry = $this->get_fields($status_pid);
$show_info['cfTitleAry'] = $this->ci->mdCustomers->get_sdata('cfrom');//来源类型
$show_info['cfCluesAry'] = $this->ci->mdCustomers->get_sdata('cfrom_clues');//线下来源
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
$show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
//渠道经理
@@ -108,25 +107,11 @@ class OrdersList
if ($params['biz_type']) {
$where['biz_id in (select id from lc_biz where type = ' . $params['biz_type'] . ' and status=1)'] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$where['rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where["rid in (select id from lc_receiver_customers where " . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
$where["payway"] = $params['payway'];
@@ -220,15 +205,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
@@ -255,6 +233,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -268,9 +255,6 @@ class OrdersList
$fields['status_name'] = $status_arr[$val['status']]['name'];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$fields['cf_clues'] = $customers[$val['rid']][0]['cf_clues'];
$fields['cf_name'] = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'];
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
}
@@ -308,24 +292,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -440,15 +410,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//品牌车型
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
@@ -484,6 +447,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -498,11 +470,6 @@ class OrdersList
$fields['price'] = $val['price'] > 1 ? number_format($val['price']) : number_format($val['price'], 2);
$fields['deposit'] = $val['deposit'] > 1 ? number_format($val['deposit']) : number_format($val['deposit'], 2);
$fields['biz_name'] = $map_biz[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '';
$lists[] = $fields;
}
@@ -539,24 +506,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -650,15 +603,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$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');
//获取销售
@@ -669,6 +615,15 @@ class OrdersList
$fields = array();
$money_json = json_decode($val['money_json'], true);
$price_loan = $money_json['price_loan'] ? $money_json['price_loan'] : 0;
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -678,11 +633,6 @@ class OrdersList
$fields['price_loan'] = number_format($price_loan, 2);
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['status_name'] = $status_arr[$val['status']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
}
@@ -719,24 +669,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -829,15 +765,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
@@ -864,6 +793,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -876,11 +814,6 @@ class OrdersList
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
}
@@ -917,24 +850,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -1042,15 +961,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
@@ -1077,6 +989,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -1090,12 +1011,6 @@ class OrdersList
$jsondata = json_decode($val['jsondata'], true);
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['item_id'] = $val['item_id'];
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
@@ -1134,24 +1049,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -1244,15 +1145,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
@@ -1279,6 +1173,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -1296,11 +1199,6 @@ class OrdersList
}
$fields['status_name'] = $status_arr[$val['status']] . $complete;
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['u_time'] = date('Y-m-d H:i', strtotime($val['u_time']));
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
@@ -1338,24 +1236,10 @@ class OrdersList
if ($biz_type) {
$where["$t2.biz_id in (select id from lc_biz where type = $biz_type and status=1)"] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where[$t2 . '.rid in (select id from lc_receiver_customers where ' . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -1448,15 +1332,8 @@ class OrdersList
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null), '', '', '', 'id,cf_title,cf_clues,cf_id');
$cfroms = [];
if ($customers) {
foreach ($customers as $key => $val) {
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//获取销售
$str_admin_ids = implode(',', array_unique(array_column($rows, 'admin_id')));
!$str_admin_ids && $str_admin_ids = 0;
@@ -1483,6 +1360,15 @@ class OrdersList
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$of_title = '-';
$of_id = $customers[$val['rid']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['rid']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['o_id'] = $val['o_id'];
$fields['bill_time'] = $val['bill_time'];
$fields['mobile'] = $val['mobile'];
@@ -1495,11 +1381,6 @@ class OrdersList
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
$fields['status_name'] = $status_arr[$val['status']];
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['cf_title'] = $customers[$val['rid']][0]['cf_title'];
$cf_name = '';
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] . '(线上)<br>';
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'] . '(线下)';
$fields['cf_name'] = $cf_name;
$fields['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
$lists[] = $fields;
}
@@ -1531,13 +1412,13 @@ class OrdersList
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '22%'],
'biz_name' => ['title' => '门店', 'width' => '10%'], 'price' => ['title' => '合同价', 'width' => '7%'],
'payway_name' => ['title' => '付款', 'width' => '5%'], 'admin_name' => ['title' => '销售员', 'width' => '7%'],
'cf_title' => ['title' => '来源类型', 'width' => '8%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '合同状态', 'width' => '7%'], 'order_time' => ['title' => '下定时间', 'width' => '12%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 1) {
$fields2 = ['title' => ['title' => '分期产品', 'width' => '15%'],
'price_loan' => ['title' => '贷款金额', 'width' => '10%'], 'c_time' => ['title' => '分期时间', 'width' => '7%'],
'cf_title' => ['title' => '来源类型', 'width' => '10%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '10%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 3) {
@@ -1545,14 +1426,14 @@ class OrdersList
'vin' => ['title' => '车架号', 'width' => '12%'], 'biz_name' => ['title' => '门店', 'width' => '12%'],
'price' => ['title' => '车辆平台价', 'width' => '9%'], 'admin_name' => ['title' => '销售员', 'width' => '8%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '8%']];
$fields = array_merge($fields1, $fields2);
} else if ($status_pid == 2 || $status_pid == 4 || $status_pid == 5) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%']];
$status_pid == 4 && $fields2['u_time'] = ['title' => '更新时间', 'width' => '9%'];
$fields = array_merge($fields1, $fields2);
@@ -1560,7 +1441,7 @@ class OrdersList
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源', 'width' => '10%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'],
'c_time' => ['title' => '订单时间', 'width' => '9%']];
$fields = array_merge($fields1, $fields2);
+65 -89
View File
@@ -6,7 +6,7 @@
class Ordersv2List
{
private $ci;
private $searchTpAry = array('owner_name'=>'车主姓名','owner_mobile'=>'车主手机号','name' => '客户姓名', 'mobile' => '客户手机号', 'sid' => '订单号');
private $searchTpAry = array('owner_name' => '车主姓名', 'owner_mobile' => '车主手机号', 'name' => '客户姓名', 'mobile' => '客户手机号', 'sid' => '订单号');
private $paywayAry = array(0 => '贷款', 1 => '全款');
private $t1 = 'lc_receiver_orders_v2';
private $t2 = 'lc_receiver_order_status';
@@ -34,15 +34,14 @@ class Ordersv2List
{
// $result = $show_info = array();
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['cf_clues'] && $params['cf_clues'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!strlen($params['payway']) && $params['payway'] = '';
!$params['biz_type'] && $params['biz_type'] = '';
$fieldAry = $this->get_fields($status_pid);
$show_info['cfTitleAry'] = $this->ci->mdCustomers->get_sdata('cfrom');//来源类型
$show_info['cfCluesAry'] = $this->ci->mdCustomers->get_sdata('cfrom_clues');//线下来源
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
$show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
$show_info['bizTypeAry'] = $this->ci->biz_model->type_ary();//门店类型
//渠道经理
$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');
@@ -69,8 +68,8 @@ class Ordersv2List
$where = ["{$this->t1}.status>=" => 0];
$_title = '全部订单';
$view = 'receiver/orderv2/lists';
$params['status_pid']==1 && $where["{$this->t1}.payway"] = 0;
if(is_product()){
$params['status_pid'] == 1 && $where["{$this->t1}.payway"] = 0;
if (is_product()) {
$where["{$this->t1}.biz_id<>"] = 1;
}
if ($_SESSION['admin_info']['biz_id']) {
@@ -80,24 +79,10 @@ class Ordersv2List
if ($params['biz_type']) {
$where["{$this->t1}.biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ' and status=1)'] = null;
}
if ($params['cf_title'] || $params['cf_clues'] || $params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
if ($params['cfrom_id'] == 24) {
$where_c .= ' and cf_id = 24';
$params['cfrom_id2'] && $where_c .= ' and t_id = ' . $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where_c .= ' and cf_id = ' . $params['cfrom_id2'];
} else if ($params['cfrom_id']) {
$cf_rows = $this->ci->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_c .= " and cf_id in ({$cf_str_ids})";
}
}
$params['cf_title'] && $where_c .= ' and cf_title = "' . $params['cf_title'] . '"';
$params['cf_clues'] && $where_c .= ' and cf_clues = "' . $params['cf_clues'] . '"';
$params['of_id'] && $where_c .= ' and of_id = ' . $params['of_id'];
$params['of2_id'] && $where_c .= ' and of2_id = ' . $params['of2_id'];
$where["{$this->t1}.customer_id in (select id from lc_receiver_customers where " . $where_c . ')'] = null;
}
if (strlen($params['payway'])) {
@@ -142,10 +127,10 @@ class Ordersv2List
if ($params['brand_id']) {//品牌
$where["{$this->t1}.brand_id"] = $params['brand_id'];
} else {
if(is_product()){
$where["{$this->t1}.brand_id<>"] = 3;//狸车品牌不显示
}
$params['brand_id'] = '';
if (is_product()) {
$where["{$this->t1}.brand_id<>"] = 3;//狸车品牌不显示
}
$params['brand_id'] = '';
}
if ($params['s_id']) {//车系
$where["{$this->t1}.s_id"] = $params['s_id'];
@@ -192,7 +177,7 @@ class Ordersv2List
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
if($params['vin']){
if ($params['vin']) {
$where = ["{$this->t1}.status>=" => 0];
$where["{$this->t1}.item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
}
@@ -200,46 +185,46 @@ class Ordersv2List
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,
{$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";
if($params['status_pid']==3 && strlen($params['status'])){ //开票
if ($params['status_pid'] == 3 && strlen($params['status'])) { //开票
}
if($params['status_pid']==4){ //交付需要开票后才显示
if ($params['status_pid'] == 4) { //交付需要开票后才显示
$where["{$this->t1}.id in (select o_id from lc_receiver_order_status where pid_status=3 and status=1)"] = null;
}
if(strlen($params['status_pid'])){
if (strlen($params['status_pid'])) {
$where["{$this->t1}.id>="] = Orders_v2_entity::V2_START_ID;
}
if(strlen($params['status_pid']) && !$params['status_pid']){ //付款列表 下定时间排序
if (strlen($params['status_pid']) && !$params['status_pid']) { //付款列表 下定时间排序
$orderby = "{$this->t1}.order_time desc";
}elseif ($params['status_pid']==3){ // 开票列表 开票时间排序
} elseif ($params['status_pid'] == 3) { // 开票列表 开票时间排序
$orderby = "{$this->t1}.bill_time desc";
}else{
} else {
$orderby = "{$this->t1}.c_time desc";
}
if(strlen($params['status_pid']) && $params['status']){
if (strlen($params['status_pid']) && $params['status']) {
$where["{$this->t2}.pid_status"] = $params['status_pid'];
$up_key = $params['status']+1;
$up_key = $params['status'] + 1;
$where["{$this->t2}.status in ({$params['status']},{$up_key})"] = null;
$having = "total = 1";
if($params['status_pid']==0 && $params['status']==1){
if ($params['status_pid'] == 0 && $params['status'] == 1) {
$having = "total >= 1";
}
$count = $this->ci->mdOrders->selectOrders($where,'', '', '', 1,'',$having);
$rows = $this->ci->mdOrders->selectOrders($where, $orderby, $page, $size, '',$fileds,$having);
}else{
if(strlen($params['status'])){
$count = $this->ci->mdOrders->selectOrders($where, '', '', '', 1, '', $having);
$rows = $this->ci->mdOrders->selectOrders($where, $orderby, $page, $size, '', $fileds, $having);
} else {
if (strlen($params['status'])) {
$where["id not in (select o_id from lc_receiver_order_status where pid_status={$params['status_pid']} and status=1)"] = null;
}
if($params['status_pid']==3){ //开票
if(strlen($params['status'])){ //待开票
if ($params['status_pid'] == 3) { //开票
if (strlen($params['status'])) { //待开票
$where['id in (select o_id from lc_receiver_order_status where pid_status=0 and status=2)'] = null;
}else{ //全部
} else { //全部
$where['id in (select o_id from lc_receiver_order_status where (pid_status=0 and status=2) or (pid_status=3 and status=1))'] = null;
}
}
$count = $this->ci->mdOrders->count($where);
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size,$fileds);
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size, $fileds);
}
$lists = [];
if ($count) {
@@ -250,15 +235,8 @@ class Ordersv2List
//客户来源
$str_rids = implode(',', array_unique(array_column($rows, 'customer_id')));
!$str_rids && $str_rids = 0;
$customers = $this->ci->mdCustomers->map('id', '', array("id in({$str_rids})" => null),'','','','id,cf_title,cf_clues,cf_id');
$cfroms = [];
if($customers){
foreach($customers as $key=>$val){
$cf_id_arr[] = $val[0]['cf_id'];
}
//获取来源
$cfroms = $this->ci->mdCluesCfrom->get_map_by_ids($cf_id_arr, 'id,title');
}
$customers = $this->ci->mdCustomers->map('id', 'of_id,of2_id', array("id in({$str_rids})" => null));
$offlineSources = $this->ci->mdCustomers->offlineSources();
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
@@ -276,8 +254,8 @@ class Ordersv2List
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$money_json = json_decode($val['money_json'],true);
$info_json = json_decode($val['info_json'],true);
$money_json = json_decode($val['money_json'], true);
$info_json = json_decode($val['info_json'], true);
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
@@ -285,42 +263,45 @@ class Ordersv2List
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$fields['o_id'] = $val['id'];
$fields['bill_time'] = $val['bill_time'];
if(Orders_v2_entity::V2_START_ID<$val['id']){
if($val['main_type']){
if (Orders_v2_entity::V2_START_ID < $val['id']) {
if ($val['main_type']) {
$name = $info_json['c_company'];
$mobile = $val['mobile'];
}else{
} else {
$name = $val['owner_name'];
$mobile = $val['owner_mobile'];
}
$open_url = '/receiver/orderv2/orders/get?id=';
$fields['name'] = $size > 1000 ? $name
: '<a href="javascript:;" data-open="'.$open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
}else{
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
} else {
$open_url = '/receiver/orders/get?id=';
$mobile = $val['mobile'];
$o_tp = '(旧订单)';
$o_tp = '(旧订单)';
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="'.$open_url . $val['id'] . '">' . $val['name']. $o_tp . '<br>' . $val['mobile'] . '</a>';
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $val['name'] . $o_tp . '<br>' . $val['mobile'] . '</a>';
}
$fields['mobile'] = $mobile;
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = number_format($money_json['price_car'], 2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
if(strlen($params['status_pid']) && $params['status_pid']!=5 && $val['status']!=2){
$fields['status_name'] = $this->ci->orders_status_entity->last_status_cn($val['id'],$params['status_pid']);
}else{
if (strlen($params['status_pid']) && $params['status_pid'] != 5 && $val['status'] != 2) {
$fields['status_name'] = $this->ci->orders_status_entity->last_status_cn($val['id'], $params['status_pid']);
} else {
$fields['status_name'] = $order_status_cn[$val['status']];
}
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$fields['cf_title'] = $customers[$val['customer_id']][0]['cf_title'];
$cf_name = $cfroms[$customers[$val['customer_id']][0]['cf_id']][0]['title'];
$cf_clues = $customers[$val['customer_id']][0]['cf_clues'];
$fields['cf_name'] = '';
$cf_name && $fields['cf_name'] = $cf_name.'(线上)<br>';
$cf_clues && $fields['cf_name'] .= $cf_clues.'(线下)';
$of_title = '-';
$of_id = $customers[$val['customer_id']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of2_id = $customers[$val['customer_id']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '';
$fields['bill_time'] = $val['bill_time'] != '0000-00-00 00:00:00' ? $val['bill_time'] : '';
$fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
@@ -351,31 +332,26 @@ class Ordersv2List
} else {
$fields1['name'] = ['title' => '客户', 'width' => '14%'];
}
if(strlen($status_pid) && $status_pid==0){
if (strlen($status_pid) && $status_pid == 0) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源','width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'],
'order_time' => ['title' => '下定时间', 'width' => '9%']];
}elseif($status_pid==3){
'payway_name' => ['title' => '付款方式', 'width' => '8%'], 'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'], 'order_time' => ['title' => '下定时间', 'width' => '9%']];
} elseif ($status_pid == 3) {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源','width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'],
'bill_time' => ['title' => '开票时间', 'width' => '9%']];
}else{
'payway_name' => ['title' => '付款方式', 'width' => '8%'], 'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'], 'bill_time' => ['title' => '开票时间', 'width' => '9%']];
} else {
$fields2 = ['car_name' => ['title' => '车辆', 'width' => '27%'],
'biz_name' => ['title' => '门店', 'width' => '12%'], 'price' => ['title' => '车辆平台价', 'width' => '9%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'cf_title' => ['title' => '来源类型', 'width' => '9%'], 'cf_name' => ['title' => '来源','width' => '10%'],
'payway_name' => ['title' => '付款方式', 'width' => '8%'], 'of_title' => ['title' => '客户来源', 'width' => '10%'],
'status_name' => ['title' => '状态', 'width' => '9%'],
'c_time' => ['title' => '订单时间', 'width' => '9%']];
}
$fields = array_merge($fields1, $fields2);
if($export){
$fields['vin'] = ['title'=>'vin码'];
if ($export) {
$fields['vin'] = ['title' => 'vin码'];
}
return $fields;
}
+52 -106
View File
@@ -89,7 +89,7 @@
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">订单时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
@@ -105,40 +105,18 @@
</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 w100">
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线下来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_clues" v-model="params.cf_clues">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线上来源:</label>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">客户来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
<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 w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
<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>
@@ -151,6 +129,15 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{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>
@@ -179,24 +166,28 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
<?if((!isset($params['status_pid']) && $params['show_bill_time']) || ($params['status']==2 && $params['status_pid']==3) || $params['status_pid']==6){?>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">开票时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-bill-time" name="bill_time" type="text" value="<?= $params['bill_time'] ?>"
placeholder="时间范围" autocomplete="off"/>
</div>
</div>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{v}}</option>
</select>
<?}?>
<?if((isset($params['status_pid']) && !$params['status_pid'] && $params['status']==2) || ($params['sign'] && $params['status']==2)){?>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">下定时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-order-time" name="order_time" type="text" value="<?= $params['order_time'] ?>"
placeholder="时间范围" autocomplete="off"/>
</div>
</div>
</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>
@@ -229,28 +220,15 @@
</select>
</div>
</div>
<?if((!isset($params['status_pid']) && $params['show_bill_time']) || ($params['status']==2 && $params['status_pid']==3) || $params['status_pid']==6){?>
<div class="am-form-group fl">
<label class="am-para-label w100">开票时间</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-bill-time" name="bill_time" type="text" value="<?= $params['bill_time'] ?>"
placeholder="订单时间范围" autocomplete="off"/>
</div>
<label class="am-para-label w100">渠道经理</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<?}?>
<?if((isset($params['status_pid']) && !$params['status_pid'] && $params['status']==2) || ($params['sign'] && $params['status']==2)){?>
<div class="am-form-group fl">
<label class="am-para-label w100">下定时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-order-time" name="order_time" type="text" value="<?= $params['order_time'] ?>"
placeholder="订单时间范围" autocomplete="off"/>
</div>
</div>
</div>
<?}?>
<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">
@@ -347,33 +325,17 @@
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
lists: [],
show_info: {cfTitleAry: [], qdjl_lists: []},
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
of2Ary: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.getCfroms();
vm.init_brands();
vm.init_citys();
},
methods: {
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
export_out: function (type) {
var count = <?=$pager['totle']?>;
if (count > 10000) {
@@ -430,10 +392,8 @@
$("#search_tp").val('name');
$("#title").val('');
$("#id-create-time").val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.cf_title = '';
that.params.cf_clues = '';
that.params.of_id = '';
that.params.of2_id = '';
that.params.payway = '';
that.params.brand_id = '';
that.params.city_id_admin = '';
@@ -442,27 +402,13 @@
}
},
watch: {
'cfrom_id': function (nv, ov) {
'params.of_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
that.params.of2_id = '';
that.of2Ary = [];
} else {
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
that.of2Ary = that.show_info.offlineSourcesAry[nv]['list'];
}
},
'params.brand_id': function (nv, ov) {
+2 -2
View File
@@ -23,9 +23,9 @@
</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.cf_title}}</label>
<label class="am-para-label-con">{{info.of_title}}</label>
</div>
</div>
</div>
+40 -101
View File
@@ -68,9 +68,7 @@
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">订单时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
@@ -86,40 +84,18 @@
</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 w100">
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线下来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_clues" v-model="params.cf_clues">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线上来源:</label>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">客户来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
<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 w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
<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>
@@ -132,6 +108,15 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{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>
@@ -161,25 +146,13 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{v}}</option>
</select>
<label class="am-para-label w100">车架号</label>
<div class="am-para-inline w260">
<input name="vin" type="text" value="<?= $params['vin'] ?>"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">销售员:</label>
<div class="am-para-inline w120">
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
@@ -209,11 +182,14 @@
</template>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">车架号:</label>
<div class="am-para-inline w260">
<input name="vin" type="text" value="<?= $params['vin'] ?>"/>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
@@ -248,8 +224,7 @@
<th width="11%"><span>门店</span></th>
<th width="8%"><span>车辆平台价</span></th>
<th width="6%"><span>付款方式</span></th>
<th width="8%"><span>来源类型</span></th>
<th width="10%"><span>来源</span></th>
<th width="10%"><span>客户来源</span></th>
<th width="8%"><span>状态</span></th>
<th width="12%"><span>订单时间</span></th>
</tr>
@@ -263,11 +238,7 @@
<td><?= $v['biz_name'] ?></td>
<td><?= $v['price'] ?></td>
<td><?= $v['payway_name'] ?></td>
<td><?= $v['cf_title'] ?></td>
<td>
<?if($v['cf_name']){?><?= $v['cf_name'] ?>(线上)<br><?}?>
<?if($v['cf_clues']){?><?= $v['cf_clues'] ?>(线下)<?}?>
</td>
<td><?= $v['of_title'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
@@ -324,33 +295,17 @@
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
lists: [],
show_info: {cfTitleAry: [], qdjl_lists: []},
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
of2Ary: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.getCfroms();
vm.init_brands();
vm.init_citys();
},
methods: {
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
export_out: function (type) {
var count = <?=$pager['totle']?>;
if (count > 10000) {
@@ -403,10 +358,8 @@
$("#search_tp").val('name');
$("#title").val('');
$("#id-create-time").val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.cf_title = '';
that.params.cf_clues = '';
that.params.of_id = '';
that.params.of2_id = '';
that.params.payway = '';
that.params.brand_id = '';
that.params.city_id_admin = '';
@@ -415,27 +368,13 @@
}
},
watch: {
'cfrom_id': function (nv, ov) {
'params.of_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
that.params.of2_id = '';
that.of2Ary = [];
} else {
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
that.of2Ary = that.show_info.offlineSourcesAry[nv]['list'];
}
},
'params.brand_id': function (nv, ov) {
+2 -2
View File
@@ -118,9 +118,9 @@
</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.cf_title}}</label>
<label class="am-para-label-con">{{info.of_title}}</label>
</div>
</div>
</div>
+35 -91
View File
@@ -70,9 +70,7 @@
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">下定时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
@@ -88,40 +86,18 @@
</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 w100">
<select name="cf_title" v-model="params.cf_title">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线下来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_clues" v-model="params.cf_clues">
<option value="">请选择</option>
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线上来源:</label>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">客户来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
<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 w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
<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>
@@ -134,6 +110,15 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{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>
@@ -163,21 +148,9 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{v}}</option>
</select>
<label class="am-para-label w80">车架号</label>
<div class="am-para-inline w260">
<input name="vin" type="text" value="<?= $params['vin'] ?>"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
@@ -213,9 +186,12 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">车架号</label>
<div class="am-para-inline w260">
<input name="vin" type="text" value="<?= $params['vin'] ?>"/>
<label class="am-para-label w100">渠道经理</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
</select>
</div>
</div>
<?if($params['status_pid']==3 && $params['status']==1){?>
@@ -339,33 +315,17 @@
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
lists: [],
show_info: {cfTitleAry: [], qdjl_lists: []},
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
of2Ary: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.getCfroms();
vm.init_brands();
vm.init_citys();
},
methods: {
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
export_out: function (type) {
var count = <?=$pager['totle']?>;
if (count > 10000) {
@@ -418,10 +378,8 @@
$("#search_tp").val('name');
$("#title").val('');
$("#id-create-time").val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.cf_title = '';
that.params.cf_clues = '';
that.params.of_id = '';
that.params.of2_id = '';
that.params.payway = '';
that.params.brand_id = '';
that.params.city_id_admin = '';
@@ -430,27 +388,13 @@
}
},
watch: {
'cfrom_id': function (nv, ov) {
'params.of_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
that.params.of2_id = '';
that.of2Ary = [];
} else {
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
$.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
that.of2Ary = that.show_info.offlineSourcesAry[nv]['list'];
}
},
'params.brand_id': function (nv, ov) {