admin_orders_917
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Orders extends HD_Controller{
|
||||
|
||||
class Orders extends HD_Controller
|
||||
{
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名', 'sid' => '订单号');
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_orders_model','orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_signs_model','order_signs_model');
|
||||
$this->load->model('receiver/order/receiver_order_loans_model','order_loans_model');
|
||||
$this->load->model('receiver/order/receiver_order_ckcars_model','order_ckcars_model');
|
||||
$this->load->model('receiver/order/receiver_order_bills_model','order_bills_model');
|
||||
$this->load->model('receiver/order/receiver_order_agents_model','order_agents_model');
|
||||
$this->load->model('receiver/order/receiver_order_deliverys_model','order_deliverys_model');
|
||||
$this->load->model('receiver/order/receiver_order_contracts_model','order_contracts_model');
|
||||
$this->load->model('receiver/receiver_customers_model','customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_signs_model', 'order_signs_model');
|
||||
$this->load->model('receiver/order/receiver_order_loans_model', 'order_loans_model');
|
||||
$this->load->model('receiver/order/receiver_order_ckcars_model', 'order_ckcars_model');
|
||||
$this->load->model('receiver/order/receiver_order_bills_model', 'order_bills_model');
|
||||
$this->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
|
||||
$this->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
|
||||
$this->load->model('receiver/order/receiver_order_contracts_model', 'order_contracts_model');
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
@@ -22,28 +24,86 @@ class Orders extends HD_Controller{
|
||||
$this->load->model('sys/sys_finance_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
public function lists()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$statusAry = $this->orders_model->statusAry();
|
||||
$status_arr = array();
|
||||
foreach ($statusAry as $key => $value) {
|
||||
if (!$value['show']) {
|
||||
continue;
|
||||
}
|
||||
$cate = $where = array();
|
||||
$t2 = 'lc_receiver_orders';
|
||||
if ($key == 0) {
|
||||
$t1 = 'lc_receiver_order_signs';
|
||||
$order_model = $this->order_signs_model;
|
||||
} else if ($key == 1) {
|
||||
$t1 = 'lc_receiver_order_loans';
|
||||
$order_model = $this->order_loans_model;
|
||||
} else if ($key == 2) {
|
||||
$t1 = 'lc_receiver_order_ckcars';
|
||||
$order_model = $this->order_ckcars_model;
|
||||
} else if ($key == 3) {
|
||||
$t1 = 'lc_receiver_order_bills';
|
||||
$order_model = $this->order_bills_model;
|
||||
} else if ($key == 4) {
|
||||
$t1 = 'lc_receiver_order_agents';
|
||||
$order_model = $this->order_agents_model;
|
||||
} else if ($key == 5) {
|
||||
$t1 = 'lc_receiver_order_deliverys';
|
||||
$order_model = $this->order_deliverys_model;
|
||||
} else {
|
||||
$t1 = 'lc_receiver_order_signs';
|
||||
$order_model = $this->order_signs_model;
|
||||
}
|
||||
$where_c = ["$t2.id>" => 0];
|
||||
$where_c["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$count1 = $order_model->count_order($where_c, $t2);
|
||||
if ($value['list']) {
|
||||
foreach ($value['list'] as $key2 => $value2) {
|
||||
$where_c["$t1.status"] = $key2;
|
||||
$count2 = $order_model->count_order($where_c, $t2);
|
||||
$cate[] = array("id" => $key2, "name" => $value2, "count" => $count2);
|
||||
}
|
||||
}
|
||||
$status_arr[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
|
||||
}
|
||||
$params['count_all'] = $this->orders_model->count(array());//全部
|
||||
$this->load->library('OrdersList');
|
||||
$params['list_type'] = 'all';
|
||||
$result = $this->orderslist->lists($params['status_pid'], $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '全部订单列表';
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
$status_arr = $this->order_signs_model->get_status();
|
||||
$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');
|
||||
if(!$row){
|
||||
$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');
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
|
||||
}
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$row['info_json'] = json_decode($row['info_json'],true);
|
||||
$money_json = json_decode($row['money_json'], true);
|
||||
$row['info_json'] = json_decode($row['info_json'], true);
|
||||
$row['status'] = intval($row['status']);
|
||||
$row['price'] = number_format($row['price'],2);
|
||||
$row['deposit'] = number_format($row['deposit'],2);
|
||||
$row['c_time'] = date('Y-m-d',$row['c_time']);
|
||||
$row['price'] = number_format($row['price'], 2);
|
||||
$row['deposit'] = number_format($row['deposit'], 2);
|
||||
$row['c_time'] = date('Y-m-d', $row['c_time']);
|
||||
$row['sign_status_name'] = $status_arr[$sign['status']];
|
||||
$row['cf_title'] = $customers['cf_title'];
|
||||
$row['payway'] = intval($row['payway']);
|
||||
@@ -51,88 +111,88 @@ class Orders extends HD_Controller{
|
||||
$row['cardid'] = $row['info_json']['cardid'] ? $row['info_json']['cardid'] : $row['info_json']['c_cardid'];
|
||||
$row['address'] = $row['info_json']['c_address'] ? $row['info_json']['c_address'] : '';
|
||||
//获取车信息
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$serie = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name');
|
||||
$serie = $this->auto_series_model->get(['id' => $row['s_id']], 'name');
|
||||
$row['brand_name'] = $brand['name'];
|
||||
$row['s_name'] = $serie['name'];
|
||||
$attr_arr = [$row['v_id'],$row['cor_id'],$row['incor_id']];
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
$row['v_name'] = isset($attr[$row['v_id']]) ? $attr[$row['v_id']][0]['title']:'';
|
||||
$row['cor_name'] = isset($attr[$row['cor_id']]) ? $attr[$row['cor_id']][0]['title']:'';
|
||||
$row['incor_name'] = isset($attr[$row['incor_id']]) ? $attr[$row['incor_id']][0]['title']:'';
|
||||
$attr_arr = [$row['v_id'], $row['cor_id'], $row['incor_id']];
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
|
||||
$row['v_name'] = isset($attr[$row['v_id']]) ? $attr[$row['v_id']][0]['title'] : '';
|
||||
$row['cor_name'] = isset($attr[$row['cor_id']]) ? $attr[$row['cor_id']][0]['title'] : '';
|
||||
$row['incor_name'] = isset($attr[$row['incor_id']]) ? $attr[$row['incor_id']][0]['title'] : '';
|
||||
//获取选择车辆vin
|
||||
if($row['item_id']){
|
||||
if ($row['item_id']) {
|
||||
$this->load->model('items/items_model', 'mdItems');
|
||||
$row_goods = $this->mdItems->get(array('id' => $row['item_id']));
|
||||
$row['vin'] = $row_goods['vin'];
|
||||
}
|
||||
//获取贷款信息
|
||||
if(!$row['payway'] && $row['status']>0){
|
||||
$auto_finance_row = $this->auto_finance_model->get(['id'=>$row['finance_id']],'fin_id,num');
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$auto_finance_row['fin_id']],'title');
|
||||
$loan = $this->order_loans_model->get(['o_id'=>$row['id']]);
|
||||
if (!$row['payway'] && $row['status'] > 0) {
|
||||
$auto_finance_row = $this->auto_finance_model->get(['id' => $row['finance_id']], 'fin_id,num');
|
||||
$finance_row = $this->sys_finance_model->get(['id' => $auto_finance_row['fin_id']], 'title');
|
||||
$loan = $this->order_loans_model->get(['o_id' => $row['id']]);
|
||||
$loan['status'] = intval($loan['status']);
|
||||
$loan['title'] = $finance_row['title'];
|
||||
$loan['num'] = $auto_finance_row['num'];
|
||||
$loan['loan_pay'] = number_format($money_json['price_car']-$money_json['first_pay'],2);
|
||||
$loan['first_pay'] = number_format($money_json['first_pay'],2);
|
||||
$loan['loan_pay'] = number_format($money_json['price_car'] - $money_json['first_pay'], 2);
|
||||
$loan['first_pay'] = number_format($money_json['first_pay'], 2);
|
||||
$loan['notify_file'] = $loan['notify_file'] ? build_qiniu_image_url($loan['notify_file']) : '';
|
||||
$loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : '';
|
||||
$row['loan_info'] = $loan;
|
||||
}
|
||||
//获取开票
|
||||
$bill = $this->order_bills_model->get(['o_id'=>$row['id']],'status,file,cardidA,cardidB');
|
||||
$bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB');
|
||||
$bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
|
||||
$bill['cardidA'] = $bill['cardidA'] ? build_qiniu_image_url($bill['cardidA']) : '';
|
||||
$bill['cardidB'] = $bill['cardidB'] ? build_qiniu_image_url($bill['cardidB']) : '';
|
||||
$bill['status'] = intval($bill['status']);
|
||||
$row['bill'] = $bill;
|
||||
//获取合同文件
|
||||
$contracts = $this->order_contracts_model->select(['o_id'=>$row['id'],'status'=>1],'','','','type,file,status');
|
||||
$contracts = $this->order_contracts_model->select(['o_id' => $row['id'], 'status' => 1], '', '', '', 'type,file,status');
|
||||
$contract_data = [];
|
||||
if($contracts){
|
||||
foreach($contracts as $key=>$val){
|
||||
if ($contracts) {
|
||||
foreach ($contracts as $key => $val) {
|
||||
$contract_data[$val['type']] = [
|
||||
'type' => $val['type'],
|
||||
'status_name' => $val['status']?'已签约':'未签约'
|
||||
'status_name' => $val['status'] ? '已签约' : '未签约'
|
||||
];
|
||||
}
|
||||
}
|
||||
$row['contract_data'] = $contract_data;
|
||||
|
||||
//获取销售员
|
||||
if($row['admin_id']){
|
||||
if ($row['admin_id']) {
|
||||
$this->load->model('app/licheb/app_licheb_users_model', 'licheb_users_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$row_admin = $this->licheb_users_model->get(array('id' => $row['admin_id']));
|
||||
$biz_id = $row_admin['biz_id'];
|
||||
$row_biz = array();
|
||||
if($biz_id){
|
||||
if ($biz_id) {
|
||||
$row_biz = $this->biz_model->get(array('id' => $biz_id));
|
||||
}
|
||||
$admin_name = $row_admin ? "{$row_biz['biz_name']} {$row_admin['uname']}":"";
|
||||
$admin_name = $row_admin ? "{$row_biz['biz_name']} {$row_admin['uname']}" : "";
|
||||
$row['admin_name'] = $admin_name;
|
||||
}
|
||||
|
||||
//获取代办信息
|
||||
$agent = $this->order_agents_model->get(['o_id'=>$row['id']]);
|
||||
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
|
||||
$imgs = [];
|
||||
$car_imgs = [];
|
||||
if($agent){
|
||||
if ($agent) {
|
||||
$agent['if_ins'] = intval($agent['if_ins']);
|
||||
$agent['ins_time'] = $agent['ins_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($agent['ins_time'])):'';
|
||||
if($agent['car_img']){
|
||||
$file_name = substr($agent['car_img'], strrpos($agent['car_img'], '/')+1);
|
||||
$agent['ins_time'] = $agent['ins_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($agent['ins_time'])) : '';
|
||||
if ($agent['car_img']) {
|
||||
$file_name = substr($agent['car_img'], strrpos($agent['car_img'], '/') + 1);
|
||||
$car_imgs[] = array(
|
||||
'src' => build_qiniu_image_url($agent['car_img']),
|
||||
'value' => $agent['car_img'],
|
||||
'title' => $file_name
|
||||
);
|
||||
}
|
||||
if($agent['ins_img']){
|
||||
if ($agent['ins_img']) {
|
||||
$ins_img = json_decode($agent['ins_img']);
|
||||
foreach($ins_img as $val){
|
||||
$file_name = substr($val, strrpos($val, '/')+1);
|
||||
foreach ($ins_img as $val) {
|
||||
$file_name = substr($val, strrpos($val, '/') + 1);
|
||||
$imgs[] = [
|
||||
'src' => build_qiniu_image_url($val),
|
||||
'value' => $val,
|
||||
@@ -140,7 +200,7 @@ class Orders extends HD_Controller{
|
||||
];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$agent['if_ins'] = 0;
|
||||
$agent['car_img_src'] = '';
|
||||
$agent['car_img'] = '';
|
||||
@@ -155,70 +215,76 @@ class Orders extends HD_Controller{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//修改分期
|
||||
public function edit_loan(){
|
||||
public function edit_loan()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
$file = $_FILES['file'];
|
||||
$row = $this->order_loans_model->get(['o_id'=>$params['id']]);
|
||||
if(!$row){
|
||||
$row = $this->order_loans_model->get(['o_id' => $params['id']]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$update = [];
|
||||
if($file){ //上传按揭通知函
|
||||
$path = FCPATH.'temp/';
|
||||
if (!file_exists($path)){
|
||||
if ($file) { //上传按揭通知函
|
||||
$path = FCPATH . 'temp/';
|
||||
if (!file_exists($path)) {
|
||||
$oldumask = umask(0);
|
||||
mkdir($path, 0777, true);
|
||||
umask($oldumask);
|
||||
}
|
||||
$file_name = md5($file['name'] . uniqid()) . '.'.end(explode('.',$file['name']));
|
||||
$tmp = $path.$file_name;
|
||||
$file_name = md5($file['name'] . uniqid()) . '.' . end(explode('.', $file['name']));
|
||||
$tmp = $path . $file_name;
|
||||
move_uploaded_file($file['tmp_name'], $tmp);
|
||||
|
||||
if (!filesize($tmp)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
|
||||
}
|
||||
$this->load->library('qiniu');
|
||||
$res= $this->qiniu->save($file_name, file_get_contents($tmp));
|
||||
$res = $this->qiniu->save($file_name, file_get_contents($tmp));
|
||||
unlink($tmp);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '上传文件失败!');
|
||||
}
|
||||
$size = getimagesize($res['url']);
|
||||
if($params['type']){
|
||||
if ($params['type']) {
|
||||
$update['lend_file'] = $res['file'];
|
||||
}else{
|
||||
} else {
|
||||
$update['notify_file'] = $res['file'];
|
||||
}
|
||||
$this->data['file_url'] = build_qiniu_image_url($res['file']);
|
||||
}
|
||||
strlen($params['status']) && $update['status'] = $params['status'];
|
||||
$result = $this->order_loans_model->update($update,['id'=>$row['id']]);
|
||||
if($result && $params['status']==1){ //设置完成按揭
|
||||
$this->orders_model->update(['status'=>2],['id'=>$row['o_id']]);
|
||||
$ckcar = $this->order_ckcars_model->get(['o_id'=>$row['o_id']]);
|
||||
$result = $this->order_loans_model->update($update, ['id' => $row['id']]);
|
||||
if ($result && $params['status'] == 2) { //设置完成按揭
|
||||
$this->orders_model->update(['status' => 2], ['id' => $row['o_id']]);
|
||||
$ckcar = $this->order_ckcars_model->get(['o_id' => $row['o_id']]);
|
||||
$replace = [
|
||||
'o_id' => $row['o_id'],
|
||||
'status' => 0,
|
||||
@@ -227,176 +293,186 @@ class Orders extends HD_Controller{
|
||||
$ckcar && $replace['id'] = $ckcar['id'];
|
||||
$this->order_ckcars_model->replace($replace);
|
||||
}
|
||||
return $result ? $this->show_json(SYS_CODE_SUCCESS,'保存成功') : $this->show_json(SYS_CODE_FAIL,'保存失败');
|
||||
return $result ? $this->show_json(SYS_CODE_SUCCESS, '保存成功') : $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
|
||||
public function edit_item(){
|
||||
public function edit_item()
|
||||
{
|
||||
$this->load->model("items/items_model");
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$item_id = $this->input->post('item_id');
|
||||
$row = $this->orders_model->get(['id'=>$id]);
|
||||
$ckcars = $this->order_ckcars_model->get(['o_id'=>$id]);
|
||||
if(!$row){
|
||||
$row = $this->orders_model->get(['id' => $id]);
|
||||
$ckcars = $this->order_ckcars_model->get(['o_id' => $id]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
if(!$item_id) return $this->show_json(SYS_CODE_FAIL, '请选择车辆!');
|
||||
if (!$item_id) return $this->show_json(SYS_CODE_FAIL, '请选择车辆!');
|
||||
|
||||
if($row['status']>=3){
|
||||
if ($row['status'] >= 3) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '用户已确,不能修改!');
|
||||
}
|
||||
$res = $this->orders_model->update(['item_id'=>$item_id],['id'=>$id]);
|
||||
if(!$res){
|
||||
return $this->show_json(SYS_CODE_FAIL,'保存失败');
|
||||
$res = $this->orders_model->update(['item_id' => $item_id], ['id' => $id]);
|
||||
if (!$res) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
if($row['item_id'] && $row['item_id']!=$item_id){
|
||||
$this->items_model->update(['status'=>1],['id'=>$row['item_id']]);
|
||||
if ($row['item_id'] && $row['item_id'] != $item_id) {
|
||||
$this->items_model->update(['status' => 1], ['id' => $row['item_id']]);
|
||||
}
|
||||
$this->items_model->update(['status'=>2],['id'=>$item_id]);
|
||||
if(!$ckcars){
|
||||
$this->items_model->update(['status' => 2], ['id' => $item_id]);
|
||||
if (!$ckcars) {
|
||||
$add_data = [
|
||||
'o_id' => $id,
|
||||
'status' => 1,
|
||||
'c_time' => time()
|
||||
];
|
||||
$result = $this->order_ckcars_model->add($add_data);
|
||||
}else{
|
||||
$result = $this->order_ckcars_model->update(['status'=>1],['id'=>$ckcars['id']]);
|
||||
} else {
|
||||
$result = $this->order_ckcars_model->update(['status' => 1], ['id' => $ckcars['id']]);
|
||||
}
|
||||
if($result){
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
}else{
|
||||
return $this->show_json(SYS_CODE_FAIL,'保存失败');
|
||||
if ($result) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查看发票信息
|
||||
public function get_bill(){
|
||||
public function get_bill()
|
||||
{
|
||||
$oid = $this->input->get('oid');
|
||||
$row = $this->orders_model->get(['id'=>$oid]);
|
||||
$bill = $this->order_bills_model->get(['o_id'=>$oid]);
|
||||
if(!$row){
|
||||
$row = $this->orders_model->get(['id' => $oid]);
|
||||
$bill = $this->order_bills_model->get(['o_id' => $oid]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
if(!$bill){
|
||||
if (!$bill) {
|
||||
$add_data = [
|
||||
'o_id' => $row['id'],
|
||||
'c_time' => time()
|
||||
];
|
||||
$bill['id'] = $this->order_bills_model->add($add_data);
|
||||
}
|
||||
$bill['src_file'] = $bill['file'] ? build_qiniu_image_url($bill['file']):'';
|
||||
$bill['src_file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : '';
|
||||
$this->data['bill'] = $bill;
|
||||
return $this->show_view('receiver/orders/get_bill');
|
||||
}
|
||||
|
||||
//编辑发表信息
|
||||
public function edit_bill(){
|
||||
public function edit_bill()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$money = $this->input->post('money');
|
||||
$file = $this->input->post('file');
|
||||
$money && $update['money'] = $money;
|
||||
$file && $update['file'] = $file;
|
||||
$result = $this->order_bills_model->update($update,['id'=>$id]);
|
||||
if($result){
|
||||
$result = $this->order_bills_model->update($update, ['id' => $id]);
|
||||
if ($result) {
|
||||
//更新开票时间
|
||||
$row = $this->order_bills_model->get(['id'=>$id]);
|
||||
$row = $this->order_bills_model->get(['id' => $id]);
|
||||
$row_order = $this->orders_model->get(array('id' => $row['o_id']));
|
||||
if($row_order){
|
||||
if ($row_order) {
|
||||
$this->load->model('items/items_model');
|
||||
$upd = array('bill_time' => date('Y-m-d H:i:s'));
|
||||
$where = array('id' => $row_order['item_id']);
|
||||
$ret = $this->items_model->update($upd, $where);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
}else{
|
||||
return $this->show_json(SYS_CODE_FAIL,'保存失败');
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
}
|
||||
|
||||
//确定交款
|
||||
public function edit_jk(){
|
||||
public function edit_jk()
|
||||
{
|
||||
$oid = $this->input->post('oid');
|
||||
$row = $this->orders_model->get(['id'=>$oid]);
|
||||
if(!$row){
|
||||
$row = $this->orders_model->get(['id' => $oid]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
if($row['status']!=3){
|
||||
return $this->show_json(SYS_CODE_FAIL,'修改失败,该订单不处于开票阶段');
|
||||
if ($row['status'] != 3) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '修改失败,该订单不处于开票阶段');
|
||||
}
|
||||
$bill = $this->order_bills_model->get(['o_id'=>$oid]);
|
||||
if(!$bill['file'] || !$bill['money']){
|
||||
$bill = $this->order_bills_model->get(['o_id' => $oid]);
|
||||
if (!$bill['file'] || !$bill['money']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '未上传开票文件或未填写到账金额!');
|
||||
}
|
||||
if(!$bill['cardidA']){
|
||||
if (!$bill['cardidA']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '未上传用户身份证!');
|
||||
}
|
||||
$result = $this->order_bills_model->update(['status'=>1],['o_id'=>$oid]);
|
||||
$this->orders_model->update(['status'=>4],['id'=>$bill['o_id']]);
|
||||
if(!$this->order_agents_model->get(['o_id'=>$oid])){
|
||||
$this->order_agents_model->add(['o_id'=>$oid,'c_time'=>time]);
|
||||
$result = $this->order_bills_model->update(['status' => 1], ['o_id' => $oid]);
|
||||
$this->orders_model->update(['status' => 4], ['id' => $bill['o_id']]);
|
||||
if (!$this->order_agents_model->get(['o_id' => $oid])) {
|
||||
$this->order_agents_model->add(['o_id' => $oid, 'c_time' => time]);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
//保存代办服务
|
||||
public function edit_agent(){
|
||||
public function edit_agent()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
$row = $this->orders_model->get(['id'=>$params['oid']]);
|
||||
if(!$row){
|
||||
$row = $this->orders_model->get(['id' => $params['oid']]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$agent = $this->order_agents_model->get(['o_id'=>$row['id']]);
|
||||
$agent = $this->order_agents_model->get(['o_id' => $row['id']]);
|
||||
$update = [];
|
||||
$params['car_num'] && $update['car_num'] = $params['car_num'];
|
||||
$params['e_time'] && $update['ins_time'] = date('Y-m-d H:i:s',strtotime($params['e_time']));
|
||||
$params['e_time'] && $update['ins_time'] = date('Y-m-d H:i:s', strtotime($params['e_time']));
|
||||
$params['car_img'] && $update['car_img'] = $params['car_img'];
|
||||
$update['if_ins'] = $params['if_ins'] ? 1:0;
|
||||
if($params['bx_imgs']){
|
||||
$imgs = explode(',',$params['bx_imgs']);
|
||||
$update['ins_img'] = json_encode($imgs,JSON_UNESCAPED_UNICODE);
|
||||
$update['if_ins'] = $params['if_ins'] ? 1 : 0;
|
||||
if ($params['bx_imgs']) {
|
||||
$imgs = explode(',', $params['bx_imgs']);
|
||||
$update['ins_img'] = json_encode($imgs, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
if($agent){
|
||||
$result = $this->order_agents_model->update($update,['id'=>$agent['id']]);
|
||||
}else{
|
||||
if ($agent) {
|
||||
$result = $this->order_agents_model->update($update, ['id' => $agent['id']]);
|
||||
} else {
|
||||
$update['o_id'] = $row['id'];
|
||||
$update['c_time'] = time();
|
||||
$result = $this->order_agents_model->add($update);
|
||||
}
|
||||
if($result){
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
}else{
|
||||
return $this->show_json(SYS_CODE_FAIL,'保存失败');
|
||||
if ($result) {
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
}
|
||||
|
||||
//确定代办
|
||||
public function edit_agentfh(){
|
||||
public function edit_agentfh()
|
||||
{
|
||||
$oid = $this->input->post('oid');
|
||||
$row = $this->orders_model->get(['id'=>$oid]);
|
||||
if(!$row){
|
||||
$row = $this->orders_model->get(['id' => $oid]);
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
if($row['status']!=4){
|
||||
return $this->show_json(SYS_CODE_FAIL,'修改失败,该订单不处于代办阶段');
|
||||
if ($row['status'] != 4) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '修改失败,该订单不处于代办阶段');
|
||||
}
|
||||
$this->order_agents_model->update(['status'=>1],['o_id'=>$oid]);
|
||||
$this->orders_model->update(['status'=>5],['id'=>$oid]);
|
||||
if(!$this->order_deliverys_model->count(['o_id'=>$oid])){
|
||||
$this->order_deliverys_model->add(['o_id'=>$oid,'c_time'=>time]);
|
||||
$this->order_agents_model->update(['status' => 1], ['o_id' => $oid]);
|
||||
$this->orders_model->update(['status' => 5], ['id' => $oid]);
|
||||
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
|
||||
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
//获取合同图片
|
||||
public function get_cimgs(){
|
||||
public function get_cimgs()
|
||||
{
|
||||
$type = $this->input->get('type');
|
||||
$oid = $this->input->get('oid');
|
||||
$row = $this->order_contracts_model->get(['type'=>$type,'o_id'=>$oid]);
|
||||
$row = $this->order_contracts_model->get(['type' => $type, 'o_id' => $oid]);
|
||||
$info['title'] = '相册标题';
|
||||
$info['id'] = '222';
|
||||
$info['start'] = 0;
|
||||
$data = [];
|
||||
if($row){
|
||||
$imgs = json_decode($row['imgs'],true);
|
||||
foreach($imgs as $key => $val){
|
||||
if ($row) {
|
||||
$imgs = json_decode($row['imgs'], true);
|
||||
foreach ($imgs as $key => $val) {
|
||||
$data[] = [
|
||||
'alt' => '图片名',
|
||||
'pid' => $key,
|
||||
@@ -404,10 +480,10 @@ class Orders extends HD_Controller{
|
||||
'thumb' => build_qiniu_image_url($val)
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
$info['data'] = $data;
|
||||
$this->data['info'] = $info;
|
||||
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,15 +2,9 @@
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Agent extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_agents_model','order_agents_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
@@ -18,138 +12,15 @@ class Agent extends HD_Controller{
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_agents_model->get_status();
|
||||
$params = $this->input->get();
|
||||
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
|
||||
$t1 = 'lc_receiver_order_agents';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_agents_model->count_order($where,$t2);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds.= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->order_agents_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows,'brand_id'));
|
||||
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows,'s_id'));
|
||||
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows,'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows,'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows,'incor_id'));
|
||||
$attr_arr = array_merge($v_arr,$cor_arr,$incor_arr);
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(4, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '代办服务订列表';
|
||||
return $this->show_view('receiver/order/agent/lists', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,181 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Bill extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
class Bill extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_bills_model','order_bills_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_bills_model->get_status();
|
||||
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;
|
||||
|
||||
$t1 = 'lc_receiver_order_bills';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_bills_model->count_order($where,$t2);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds.= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->order_bills_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows,'brand_id'));
|
||||
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows,'s_id'));
|
||||
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows,'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows,'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows,'incor_id'));
|
||||
$attr_arr = array_merge($v_arr,$cor_arr,$incor_arr);
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
return $this->show_view('receiver/order/bill/lists', true);
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(3, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '开票相关列表';
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,181 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Ckcar extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
class Ckcar extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_ckcars_model','order_ckcars_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_ckcars_model->get_status();
|
||||
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;
|
||||
|
||||
$t1 = 'lc_receiver_order_ckcars';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_ckcars_model->count_order($where,$t2);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds.= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->order_ckcars_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows,'brand_id'));
|
||||
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows,'s_id'));
|
||||
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows,'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows,'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows,'incor_id'));
|
||||
$attr_arr = array_merge($v_arr,$cor_arr,$incor_arr);
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
return $this->show_view('receiver/order/ckcar/lists', true);
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(2, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '车辆确认列表';
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,181 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Delivery extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
class Delivery extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_deliverys_model','order_deliverys_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_deliverys_model->get_status();
|
||||
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;
|
||||
|
||||
$t1 = 'lc_receiver_order_deliverys';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_deliverys_model->count_order($where,$t2);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds.= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->order_deliverys_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows,'brand_id'));
|
||||
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows,'s_id'));
|
||||
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows,'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows,'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows,'incor_id'));
|
||||
$attr_arr = array_merge($v_arr,$cor_arr,$incor_arr);
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
return $this->show_view('receiver/order/delivery/lists', true);
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(5, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '交付车辆列表';
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,160 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Loan extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
class Loan extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_loans_model','order_loans_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_loans_model->get_status();
|
||||
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;
|
||||
|
||||
$t1 = 'lc_receiver_order_loans';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_loans_model->count_order($where,$t2);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.o_id,$t1.title,$t1.year,$t1.first_price,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.id,$t2.name,$t2.mobile,$t2.sid";
|
||||
$rows = $this->order_loans_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
return $this->show_view('receiver/order/loan/lists', true);
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(1, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '分期办理列表';
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,220 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Sign extends HD_Controller{
|
||||
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名','sid' => '订单号');
|
||||
class Sign extends HD_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/order/receiver_order_signs_model','order_signs_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
$this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
$status_arr = $this->order_signs_model->get_status();
|
||||
$status_arr = array(2 => '已预交款', 1 => '已签合同', 0 => '未签合同');
|
||||
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;
|
||||
|
||||
$this->load->model('app/licheb/app_licheb_users_model', 'licheb_users_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
|
||||
$t1 = 'lc_receiver_order_signs';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
|
||||
if(!strlen($params['status'])){
|
||||
$params['status'] = 2;//默认展示预付的
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t2}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t2}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
|
||||
if($params['brand_id']){//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if($params['s_id']){//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if($params['v_id']){//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if($params['cor_id']){//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
|
||||
//销售员筛选
|
||||
if($params['admin_id']){
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if($params['biz_id_admin']){//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if($params['county_id_admin']){
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if($params['city_id_admin']){
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if($where_biz){
|
||||
$where_biz['status>-1'] = null;
|
||||
$this->load->model("biz/biz_model");
|
||||
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if($rows_biz){
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if($where_lcb){
|
||||
$where_lcb['status>-1'] = null;
|
||||
$this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model');
|
||||
$rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if($rows_lcb){
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
|
||||
$count = $this->order_signs_model->count_order($where);
|
||||
$lists = [];
|
||||
if($count){
|
||||
$fileds = "$t1.id,$t1.o_id,$t1.status,";
|
||||
$fileds.= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time, {$t2}.admin_id";
|
||||
$rows = $this->order_signs_model->select_order($where,"$t1.id desc",$page,$size,$fileds);
|
||||
$brand_arr = $series_arr = $v_arr = $cor_arr = $incor_arr = array();
|
||||
$admin_ids = array();
|
||||
if($rows){
|
||||
foreach($rows as $v){
|
||||
!in_array($v['brand_id'], $brand_arr) && $brand_arr[] = $v['brand_id'];
|
||||
!in_array($v['s_id'], $series_arr) && $series_arr[] = $v['s_id'];
|
||||
!in_array($v['v_id'], $v_arr) && $v_arr[] = $v['v_id'];
|
||||
!in_array($v['cor_id'], $cor_arr) && $cor_arr[] = $v['cor_id'];
|
||||
!in_array($v['incor_id'], $incor_arr) && $incor_arr[] = $v['incor_id'];
|
||||
$v['admin_id'] && !in_array($v['admin_id'], $admin_ids) && $admin_ids[] = $v['admin_id'];
|
||||
}
|
||||
}
|
||||
//品牌车型
|
||||
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
|
||||
//车系车型
|
||||
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
|
||||
//获取属性
|
||||
$attr_arr = array_merge($v_arr,$cor_arr,$incor_arr);
|
||||
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr,'id,title');
|
||||
//获取销售
|
||||
$map_admin = array();
|
||||
$map_biz = array();
|
||||
if($admin_ids){
|
||||
$str_ids = implode(',', $admin_ids);
|
||||
$where = array("id in({$str_ids})" => null);
|
||||
$select = 'id, uname, biz_id';
|
||||
$rows_admin = $this->licheb_users_model->select($where, 'id desc', 0, 0, $select);
|
||||
if($rows_admin){
|
||||
$biz_ids = array();
|
||||
foreach($rows_admin as $v){
|
||||
$map_admin[$v['id']] = $v;
|
||||
!in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
|
||||
}
|
||||
if($biz_ids){
|
||||
$str_ids = implode(',', $biz_ids);
|
||||
$where = array("id in({$str_ids})" => null);
|
||||
$map_biz = $this->biz_model->map('id', 'biz_name', $where);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($rows as $key=>$val){
|
||||
$admin = $map_admin[$val['admin_id']];
|
||||
$admin_name = $admin ? "{$map_biz[$admin['biz_id']]} {$admin['uname']}": '';
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$val['admin_name'] = $admin_name;
|
||||
$val['price'] = $val['price'] > 1 ? number_format($val['price']) : number_format($val['price'], 2);
|
||||
$val['deposit'] = $val['deposit'] > 1 ? number_format($val['deposit']) : number_format($val['deposit'], 2);
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->load->library('OrdersList');
|
||||
$result = $this->orderslist->lists(0, $params);
|
||||
$this->data['pager'] = $result['pager'];
|
||||
$this->data['lists'] = $result['lists'];
|
||||
$this->data['params'] = $result['params'];
|
||||
$this->data['searchTpAry'] = $result['searchTpAry'];
|
||||
$this->data['status_arr'] = $result['status_arr'];
|
||||
$this->data['_title'] = '合同签订列表';
|
||||
return $this->show_view('receiver/order/sign/lists', true);
|
||||
return $this->show_view($result['view'], true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
}
|
||||
|
||||
//添加单条数据
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
}
|
||||
|
||||
//编辑单条数据
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
}
|
||||
|
||||
//删除单条数据
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//批量操作(默认修改状态)
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//导出数据列表
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,995 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 订单管理列表
|
||||
*/
|
||||
class OrdersList
|
||||
{
|
||||
|
||||
private $ci;
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名', 'sid' => '订单号');
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = &get_instance();
|
||||
$this->ci->load->model('receiver/order/receiver_orders_model', 'mdOrders');
|
||||
$this->ci->load->model('app/licheb/app_licheb_users_model', 'licheb_users_model');
|
||||
$this->ci->load->model("biz/biz_model");
|
||||
$this->ci->load->model('auto/auto_series_model');
|
||||
$this->ci->load->model('auto/auto_brand_model');
|
||||
$this->ci->load->model('auto/auto_attr_model');
|
||||
}
|
||||
|
||||
public function lists($status_pid, $params = array())
|
||||
{
|
||||
if (!strlen($status_pid)) {
|
||||
return $this->orders($params);
|
||||
}
|
||||
if ($status_pid == 0) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_signs_model', 'order_signs_model');
|
||||
return $this->sign($status_pid, $params);
|
||||
} else if ($status_pid == 1) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_loans_model', 'order_loans_model');
|
||||
return $this->loan($status_pid, $params);
|
||||
} else if ($status_pid == 2) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_ckcars_model', 'order_ckcars_model');
|
||||
return $this->ckcar($status_pid, $params);
|
||||
} else if ($status_pid == 3) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_bills_model', 'order_bills_model');
|
||||
return $this->bill($status_pid, $params);
|
||||
} else if ($status_pid == 4) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
|
||||
return $this->agent($status_pid, $params);
|
||||
} else if ($status_pid == 5) {
|
||||
$this->ci->load->model('receiver/order/receiver_order_deliverys_model', 'order_deliverys_model');
|
||||
return $this->delivery($status_pid, $params);
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
private function orders($params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$status_arr = $this->ci->mdOrders->statusAry();
|
||||
$where = ["id>" => 0];
|
||||
if ($params['title']) {
|
||||
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->mdOrders->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "id,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,price,deposit,payway,status,c_time";
|
||||
$rows = $this->ci->mdOrders->select($where, "id desc", $page, $size, $fileds);
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows, 's_id'));
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows, 'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows, 'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows, 'incor_id'));
|
||||
$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) {
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']]['name'];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/orders/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:合同签订列表
|
||||
* Created on: 2021/9/17 13:44
|
||||
* Created by: dengbw
|
||||
* @param array $params
|
||||
* @param array $status_pid
|
||||
* @return array
|
||||
*/
|
||||
private function sign($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$t1 = 'lc_receiver_order_signs';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t2}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t2}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_signs_model->count_order($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.id,$t1.o_id,$t1.status,";
|
||||
$fileds .= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time, {$t2}.admin_id";
|
||||
$rows = $this->ci->order_signs_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
$brand_arr = $series_arr = $v_arr = $cor_arr = $incor_arr = array();
|
||||
$admin_ids = array();
|
||||
if ($rows) {
|
||||
foreach ($rows as $v) {
|
||||
!in_array($v['brand_id'], $brand_arr) && $brand_arr[] = $v['brand_id'];
|
||||
!in_array($v['s_id'], $series_arr) && $series_arr[] = $v['s_id'];
|
||||
!in_array($v['v_id'], $v_arr) && $v_arr[] = $v['v_id'];
|
||||
!in_array($v['cor_id'], $cor_arr) && $cor_arr[] = $v['cor_id'];
|
||||
!in_array($v['incor_id'], $incor_arr) && $incor_arr[] = $v['incor_id'];
|
||||
$v['admin_id'] && !in_array($v['admin_id'], $admin_ids) && $admin_ids[] = $v['admin_id'];
|
||||
}
|
||||
}
|
||||
//品牌车型
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
|
||||
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
|
||||
//获取销售
|
||||
$map_admin = array();
|
||||
$map_biz = array();
|
||||
if ($admin_ids) {
|
||||
$str_ids = implode(',', $admin_ids);
|
||||
$where = array("id in({$str_ids})" => null);
|
||||
$select = 'id, uname, biz_id';
|
||||
$rows_admin = $this->ci->licheb_users_model->select($where, 'id desc', 0, 0, $select);
|
||||
if ($rows_admin) {
|
||||
$biz_ids = array();
|
||||
foreach ($rows_admin as $v) {
|
||||
$map_admin[$v['id']] = $v;
|
||||
!in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
|
||||
}
|
||||
if ($biz_ids) {
|
||||
$str_ids = implode(',', $biz_ids);
|
||||
$where = array("id in({$str_ids})" => null);
|
||||
$map_biz = $this->ci->biz_model->map('id', 'biz_name', $where);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($rows as $key => $val) {
|
||||
$admin = $map_admin[$val['admin_id']];
|
||||
$admin_name = $admin ? "{$map_biz[$admin['biz_id']]} {$admin['uname']}" : '';
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$val['admin_name'] = $admin_name;
|
||||
$val['price'] = $val['price'] > 1 ? number_format($val['price']) : number_format($val['price'], 2);
|
||||
$val['deposit'] = $val['deposit'] > 1 ? number_format($val['deposit']) : number_format($val['deposit'], 2);
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/sign/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:
|
||||
* Created on: 2021/9/17 15:37
|
||||
* Created by: dengbw
|
||||
* @param $status_pid
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
private function loan($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$t1 = 'lc_receiver_order_loans';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_loans_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.title,$t1.year,$t1.first_price,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.id,$t2.name,$t2.mobile,$t2.sid";
|
||||
$rows = $this->ci->order_loans_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
|
||||
foreach ($rows as $key => $val) {
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/loan/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:车辆确认列表
|
||||
* Created on: 2021/9/17 15:57
|
||||
* Created by: dengbw
|
||||
* @param $status_pid
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
private function ckcar($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$t1 = 'lc_receiver_order_ckcars';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_ckcars_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->ci->order_ckcars_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows, 's_id'));
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows, 'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows, 'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows, 'incor_id'));
|
||||
$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) {
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/ckcar/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:开票相关列表
|
||||
* Created on: 2021/9/17 16:14
|
||||
* Created by: dengbw
|
||||
* @param $status_pid
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
private function bill($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
|
||||
$t1 = 'lc_receiver_order_bills';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_bills_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->ci->order_bills_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows, 's_id'));
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows, 'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows, 'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows, 'incor_id'));
|
||||
$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) {
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/bill/lists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:代办服务订列表
|
||||
* Created on: 2021/9/17 16:26
|
||||
* Created by: dengbw
|
||||
* @param $status_pid
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
private function agent($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$t1 = 'lc_receiver_order_agents';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_agents_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->ci->order_agents_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows, 's_id'));
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows, 'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows, 'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows, 'incor_id'));
|
||||
$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) {
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/agent/lists');
|
||||
}
|
||||
|
||||
private function delivery($status_pid, $params = array())
|
||||
{
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
|
||||
$t1 = 'lc_receiver_order_deliverys';
|
||||
$t2 = 'lc_receiver_orders';
|
||||
$where = [
|
||||
"$t2.id>" => 0,
|
||||
];
|
||||
if ($params['list_type'] == 'all') {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['list'];
|
||||
strlen($params['status']) && $where["$t1.status"] = $params['status'];
|
||||
} else {
|
||||
$status_arr = $this->ci->mdOrders->statusAry($status_pid)['menu_list'];
|
||||
if (!strlen($params['status'])) {
|
||||
$params['status'] = $this->ci->mdOrders->statusAry($status_pid)['menu_default'];
|
||||
}
|
||||
$where["$t1.status"] = $params['status'];
|
||||
}
|
||||
if ($params['title']) {
|
||||
$where["{$t2}.{$params['search_tp']} like '%{$params['title']}%'"] = null;
|
||||
}
|
||||
//创建时间
|
||||
if ($params['c_time']) {
|
||||
$c_time = explode(' ~ ', $params['c_time']);
|
||||
if ($c_time[0]) {
|
||||
$where["{$t1}.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
|
||||
}
|
||||
if ($c_time[1]) {
|
||||
$where["{$t1}.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
|
||||
}
|
||||
}
|
||||
if ($params['brand_id']) {//品牌
|
||||
$where["{$t2}.brand_id"] = $params['brand_id'];
|
||||
} else {
|
||||
$where["{$t2}.brand_id<>3"] = null;//狸车品牌不显示
|
||||
$params['brand_id'] = '';
|
||||
}
|
||||
if ($params['s_id']) {//车系
|
||||
$where["{$t2}.s_id"] = $params['s_id'];
|
||||
} else {
|
||||
$params['s_id'] = '';
|
||||
}
|
||||
if ($params['v_id']) {//车型
|
||||
$where["{$t2}.v_id"] = $params['v_id'];
|
||||
} else {
|
||||
$params['v_id'] = '';
|
||||
}
|
||||
if ($params['cor_id']) {//车身颜色
|
||||
$where["{$t2}.cor_id"] = $params['cor_id'];
|
||||
} else {
|
||||
$params['cor_id'] = '';
|
||||
}
|
||||
//销售员筛选
|
||||
if ($params['admin_id']) {
|
||||
$where['admin_id'] = $params['admin_id'];
|
||||
} else {
|
||||
$where_lcb = array();
|
||||
if ($params['biz_id_admin']) {//指定店铺所有销售员
|
||||
$where_lcb['biz_id'] = $params['biz_id_admin'];
|
||||
} else {
|
||||
//指定城市的所有销售员
|
||||
$where_biz = array();
|
||||
if ($params['county_id_admin']) {
|
||||
$where_biz['county_id'] = $params['county_id_admin'];
|
||||
} else if ($params['city_id_admin']) {
|
||||
$where_biz['city_id'] = $params['city_id_admin'];
|
||||
}
|
||||
if ($where_biz) {
|
||||
$where_biz['status>-1'] = null;
|
||||
$rows_biz = $this->ci->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
|
||||
if ($rows_biz) {
|
||||
$str_ids = implode(',', array_column($rows_biz, 'id'));
|
||||
$where_lcb["biz_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where_lcb['biz_id'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取目标销售员列表
|
||||
if ($where_lcb) {
|
||||
$where_lcb['status>-1'] = null;
|
||||
$rows_lcb = $this->ci->licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
|
||||
if ($rows_lcb) {
|
||||
$str_ids = implode(',', array_column($rows_lcb, 'id'));
|
||||
$where["admin_id in({$str_ids})"] = null;
|
||||
} else {
|
||||
$where['admin_id'] = -1;
|
||||
}
|
||||
}
|
||||
!$params['city_id_admin'] && $params['city_id_admin'] = '';
|
||||
!$params['county_id_admin'] && $params['county_id_admin'] = '';
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
$count = $this->ci->order_deliverys_model->count_order($where, $t2);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time";
|
||||
$rows = $this->ci->order_deliverys_model->select_order($where, "$t1.id desc", $page, $size, $fileds);
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
//车系车型
|
||||
$series_arr = array_unique(array_column($rows, 's_id'));
|
||||
$series = $this->ci->auto_series_model->get_map_by_ids($series_arr, 'id,name');
|
||||
//获取属性
|
||||
$v_arr = array_unique(array_column($rows, 'v_id'));
|
||||
$cor_arr = array_unique(array_column($rows, 'cor_id'));
|
||||
$incor_arr = array_unique(array_column($rows, 'incor_id'));
|
||||
$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) {
|
||||
$val['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
|
||||
$val['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
|
||||
$val['v_name'] = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
|
||||
$val['cor_name'] = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
|
||||
$val['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$pager = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
return array('lists' => $lists, 'pager' => $pager, 'params' => $params, 'status_arr' => $status_arr
|
||||
, 'searchTpAry' => $this->searchTpAry, 'view' => 'receiver/order/delivery/lists');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,172 +1,214 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/agent">全部</a>
|
||||
</li>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/agent?status=<?=$key?>">
|
||||
<?=$val?>
|
||||
</a>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/agent">
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<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 w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/agent">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'], 2) ?></td>
|
||||
<td><?= number_format($v['deposit'], 2) ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['o_id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'],2) ?></td>
|
||||
<td><?= number_format($v['deposit'],2) ?></td>
|
||||
<td><?= $v['payway']?'全款':'贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$v['o_id']?>" class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
<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 class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -195,15 +237,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
attrvAry:[],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
@@ -216,23 +258,25 @@
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands:function(){
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
beforeSend: function () {},
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {}
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys:function() {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -251,7 +295,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
@@ -261,26 +305,27 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id':function(nv, ov){
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
beforeSend: function () {},
|
||||
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){
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = lists;
|
||||
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
@@ -294,7 +339,7 @@
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
},
|
||||
'params.s_id':function(nv, ov){
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
@@ -336,13 +381,13 @@
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin':function(nv, ov){
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.params.county_id_admin.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -351,10 +396,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
@@ -362,9 +407,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin':function(nv, ov){
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
@@ -375,15 +420,15 @@
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if(that.params.biz_id_admin>0){
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for(var i in that.admins.bizAry){
|
||||
if(that.params.biz_id_admin == that.admins.bizAry[i].id){
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
@@ -395,9 +440,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin':function(nv, ov){
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
@@ -407,15 +452,15 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if(that.params.admin_id>0){
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for(var i in that.admins.list){
|
||||
if(that.params.admin_id == that.admins.list[i].id){
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,172 +1,214 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/bill">全部</a>
|
||||
</li>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/bill?status=<?=$key?>">
|
||||
<?=$val?>
|
||||
</a>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/bill">
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<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 w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/bill">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'], 2) ?></td>
|
||||
<td><?= number_format($v['deposit'], 2) ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['o_id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'],2) ?></td>
|
||||
<td><?= number_format($v['deposit'],2) ?></td>
|
||||
<td><?= $v['payway']?'全款':'贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$v['o_id']?>" class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
<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 class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -195,15 +237,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
attrvAry:[],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
@@ -216,23 +258,25 @@
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands:function(){
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
beforeSend: function () {},
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {}
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys:function() {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -251,7 +295,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
@@ -261,26 +305,27 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id':function(nv, ov){
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
beforeSend: function () {},
|
||||
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){
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = lists;
|
||||
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
@@ -294,7 +339,7 @@
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
},
|
||||
'params.s_id':function(nv, ov){
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
@@ -336,13 +381,13 @@
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin':function(nv, ov){
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.params.county_id_admin.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -351,10 +396,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
@@ -362,9 +407,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin':function(nv, ov){
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
@@ -375,15 +420,15 @@
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if(that.params.biz_id_admin>0){
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for(var i in that.admins.bizAry){
|
||||
if(that.params.biz_id_admin == that.admins.bizAry[i].id){
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
@@ -395,9 +440,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin':function(nv, ov){
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
@@ -407,15 +452,15 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if(that.params.admin_id>0){
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for(var i in that.admins.list){
|
||||
if(that.params.admin_id == that.admins.list[i].id){
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,172 +1,227 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/ckcar">全部</a>
|
||||
</li>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/ckcar?status=<?=$key?>">
|
||||
<?=$val?>
|
||||
</a>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<? foreach ($status_arr as $key => $val) { ?>
|
||||
<li role="presentation"
|
||||
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/ckcar?status=<?= $key ?>">
|
||||
<?= $val ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/ckcar">
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<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 w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/ckcar">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'], 2) ?></td>
|
||||
<td><?= number_format($v['deposit'], 2) ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['o_id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'],2) ?></td>
|
||||
<td><?= number_format($v['deposit'],2) ?></td>
|
||||
<td><?= $v['payway']?'全款':'贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$v['o_id']?>" class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
<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 class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -195,15 +250,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
attrvAry:[],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
@@ -216,23 +271,25 @@
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands:function(){
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
beforeSend: function () {},
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {}
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys:function() {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -251,7 +308,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
@@ -261,26 +318,27 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id':function(nv, ov){
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
beforeSend: function () {},
|
||||
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){
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = lists;
|
||||
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
@@ -294,7 +352,7 @@
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
},
|
||||
'params.s_id':function(nv, ov){
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
@@ -336,13 +394,13 @@
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin':function(nv, ov){
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.params.county_id_admin.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -351,10 +409,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
@@ -362,9 +420,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin':function(nv, ov){
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
@@ -375,15 +433,15 @@
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if(that.params.biz_id_admin>0){
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for(var i in that.admins.bizAry){
|
||||
if(that.params.biz_id_admin == that.admins.bizAry[i].id){
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
@@ -395,9 +453,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin':function(nv, ov){
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
@@ -407,15 +465,15 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if(that.params.admin_id>0){
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for(var i in that.admins.list){
|
||||
if(that.params.admin_id == that.admins.list[i].id){
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,172 +1,227 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/delivery">全部</a>
|
||||
</li>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/delivery?status=<?=$key?>">
|
||||
<?=$val?>
|
||||
</a>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<? foreach ($status_arr as $key => $val) { ?>
|
||||
<li role="presentation"
|
||||
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/delivery?status=<?= $key ?>">
|
||||
<?= $val ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/delivery">
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<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 w100">
|
||||
<select name="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/delivery">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'], 2) ?></td>
|
||||
<td><?= number_format($v['deposit'], 2) ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['o_id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'],2) ?></td>
|
||||
<td><?= number_format($v['deposit'],2) ?></td>
|
||||
<td><?= $v['payway']?'全款':'贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$v['o_id']?>" class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
<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 class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -195,15 +250,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
attrvAry:[],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
@@ -216,23 +271,25 @@
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands:function(){
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
beforeSend: function () {},
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {}
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys:function() {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -251,7 +308,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
@@ -261,26 +318,27 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id':function(nv, ov){
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
beforeSend: function () {},
|
||||
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){
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = lists;
|
||||
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
@@ -294,7 +352,7 @@
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
},
|
||||
'params.s_id':function(nv, ov){
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
@@ -336,13 +394,13 @@
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin':function(nv, ov){
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.params.county_id_admin.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -351,10 +409,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
@@ -362,9 +420,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin':function(nv, ov){
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
@@ -375,15 +433,15 @@
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if(that.params.biz_id_admin>0){
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for(var i in that.admins.bizAry){
|
||||
if(that.params.biz_id_admin == that.admins.bizAry[i].id){
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
@@ -395,9 +453,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin':function(nv, ov){
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
@@ -407,15 +465,15 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if(that.params.admin_id>0){
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for(var i in that.admins.list){
|
||||
if(that.params.admin_id == that.admins.list[i].id){
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,56 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/loan">全部</a>
|
||||
</li>
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/loan?status=<?=$key?>">
|
||||
@@ -13,10 +60,16 @@
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/loan">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
|
||||
@@ -1,173 +1,231 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<?foreach($status_arr as $key=>$val){?>
|
||||
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/sign?status=<?=$key?>">
|
||||
<?=$val?>
|
||||
</a>
|
||||
</li>
|
||||
<?}?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<? foreach ($status_arr as $key => $val) { ?>
|
||||
<li role="presentation"
|
||||
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/order/sign?status=<?= $key ?>">
|
||||
<?= $val ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<? if ($params['list_type'] == 'all') { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/sign">
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<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 w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
action="/receiver/orders">
|
||||
<input type="hidden" name="status_pid" value="<?= $params['status_pid'] ?>">
|
||||
<? } else { ?>
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/order/sign">
|
||||
<? } ?>
|
||||
<input type="hidden" name="status" value="<?= $params['status'] ?>">
|
||||
<div class="am-form am-form-horizontal">
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
<label class="am-para-label w100">客户搜索:</label>
|
||||
<div class="am-para-inline w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="coms-table-bd">
|
||||
<div class="am-form-group fr mr10">
|
||||
<span>共<?= intval($pager['totle']) ?>个客户</span>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="9%"><span>客户电话</span></th>
|
||||
<th width="15%"><span>车辆</span></th>
|
||||
<th width="8%"><span>合同价</span></th>
|
||||
<th width="8%"><span>定金</span></th>
|
||||
<th width="5%"><span>付款</span></th>
|
||||
<th width="9%"><span>合同状态</span></th>
|
||||
<th width="15%"><span>销售员</span></th>
|
||||
<th width="15%"><span>订单时间</span></th>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= $v['price'] ?></td>
|
||||
<td><?= $v['deposit'] ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['admin_name'] ?></td>
|
||||
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['o_id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%"><span>客户姓名</span></th>
|
||||
<th width="9%"><span>客户电话</span></th>
|
||||
<th width="15%"><span>车辆</span></th>
|
||||
<th width="8%"><span>合同价</span></th>
|
||||
<th width="8%"><span>定金</span></th>
|
||||
<th width="5%"><span>付款</span></th>
|
||||
<th width="9%"><span>合同状态</span></th>
|
||||
<th width="15%"><span>销售员</span></th>
|
||||
<th width="15%"><span>订单时间</span></th>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= $v['price'] ?></td>
|
||||
<td><?= $v['deposit'] ?></td>
|
||||
<td><?= $v['payway']?'全款':'贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['admin_name'] ?></td>
|
||||
<td><?= date('Y-m-d H:i:s',$v['c_time']) ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?=$v['o_id']?>" class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
<div class="hander am-form">
|
||||
<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 class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
@@ -196,15 +254,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry:[],
|
||||
brandAry:[],
|
||||
seryAry:[],
|
||||
attrvAry:[],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
@@ -217,23 +275,25 @@
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands:function(){
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status:1},
|
||||
beforeSend: function () {},
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {}
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
init_citys:function() {
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -252,7 +312,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
@@ -262,26 +322,27 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'params.brand_id':function(nv, ov){
|
||||
'params.brand_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
vm.seryAry = {};
|
||||
if(nv > 0){
|
||||
if (nv > 0) {
|
||||
$.ajax({
|
||||
url: '/auto/series/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {brand_id:nv},
|
||||
beforeSend: function () {},
|
||||
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){
|
||||
for (var i in lists) {
|
||||
var row = lists[i];
|
||||
seryAry[row.id] = row.name;
|
||||
}
|
||||
vm.seryAry = lists;
|
||||
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
|
||||
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
}
|
||||
@@ -295,7 +356,7 @@
|
||||
vm.params.s_id = '';
|
||||
}
|
||||
},
|
||||
'params.s_id':function(nv, ov){
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
@@ -337,13 +398,13 @@
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin':function(nv, ov){
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.params.county_id_admin.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -352,10 +413,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
@@ -363,9 +424,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin':function(nv, ov){
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
@@ -376,15 +437,15 @@
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if(that.params.biz_id_admin>0){
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for(var i in that.admins.bizAry){
|
||||
if(that.params.biz_id_admin == that.admins.bizAry[i].id){
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
@@ -396,9 +457,9 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin':function(nv, ov){
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
@@ -408,15 +469,15 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status:1
|
||||
status: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if(that.params.admin_id>0){
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for(var i in that.admins.list){
|
||||
if(that.params.admin_id == that.admins.list[i].id){
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -234,6 +234,10 @@
|
||||
},
|
||||
carModal: function () {
|
||||
var that = this
|
||||
if(!that.info.loan_info.status){
|
||||
layer.msg('按揭审核尚未通过~', {icon: 2});
|
||||
return;
|
||||
}
|
||||
that.setauto(1);
|
||||
that.setauto(2);
|
||||
that.setauto(3);
|
||||
@@ -319,13 +323,13 @@
|
||||
vm.page.page++;
|
||||
vm.getCars(vm.page.page);
|
||||
},
|
||||
finish_loan: function () {
|
||||
finish_loan: function (status) {
|
||||
var that = this;
|
||||
$.post("/receiver/orders/edit_loan", {'id': this.info.id, 'status': 1}, function (data) {
|
||||
$.post("/receiver/orders/edit_loan", {'id': this.info.id, 'status': status}, function (data) {
|
||||
console.dir(data);
|
||||
layer.msg(data.msg);
|
||||
if (data.code) {
|
||||
that.info.loan_info.status = 1
|
||||
that.info.loan_info.status = status
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
|
||||
@@ -0,0 +1,471 @@
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
||||
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
||||
<div id="recom-stat"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/orders">
|
||||
全部
|
||||
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
||||
<? if ($v['cate']) { ?>
|
||||
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<? if ($v['cate']) { ?>
|
||||
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
全部
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach ($v['cate'] as $v2) { ?>
|
||||
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
||||
<?= $v2['name'] ?>
|
||||
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<? } else { ?>
|
||||
<a href="javascript:void (0);"
|
||||
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
||||
<?= $v['name'] ?>
|
||||
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
||||
</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/orders">
|
||||
<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 w100">
|
||||
<select name="search_tp" id="search_tp">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w260">
|
||||
<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>
|
||||
<label class="am-para-label w100">创建时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
<div class="am-para-inline w300">
|
||||
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
||||
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">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label w100">车型:</label>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="brand_id" v-model="params.brand_id">
|
||||
<option value="">选择品牌</option>
|
||||
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="s_id" v-model="params.s_id">
|
||||
<option value="">选择车系</option>
|
||||
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="v_id" v-model="params.v_id">
|
||||
<option value="">选择车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="cor_id" v-model="params.cor_id">
|
||||
<option value="">车身颜色</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrcorAry">{{v.title}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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">
|
||||
<option value="">选择城市</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
||||
<option value="">选择行政区</option>
|
||||
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
||||
<option value="">门店</option>
|
||||
<template v-for="(v,i) in admins.bizAry">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w120">
|
||||
<select name="admin_id" v-model="params.admin_id">
|
||||
<option value="">销售员</option>
|
||||
<template v-for="(v,i) in admins.list">
|
||||
<option :value="v.id">{{v.title}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</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">
|
||||
<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>
|
||||
</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="10%"><span>客户姓名</span></th>
|
||||
<th width="10%"><span>客户电话</span></th>
|
||||
<th width="25%"><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>
|
||||
<th width=""><span>操作</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= "{$v['brand_name']}-{$v['series_name']}-{$v['v_name']}-{$v['cor_name']}" ?></td>
|
||||
<td><?= number_format($v['price'], 2) ?></td>
|
||||
<td><?= number_format($v['deposit'], 2) ?></td>
|
||||
<td><?= $v['payway'] ? '全款' : '贷款' ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
<a href="javascript:;" data-open="/receiver/orders/get?id=<?= $v['id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
</tbody>
|
||||
</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>
|
||||
require(['laydate', 'autocomplete'], function (laydate) {
|
||||
laydate.render({
|
||||
elem: '#id-create-time', range: '~'
|
||||
});
|
||||
$('.id-day-btn').click(function () {
|
||||
var type = $(this).data('date'), date = '', d_obj = new Date();
|
||||
switch (type) {
|
||||
case 'today':
|
||||
date = d_obj.Format('yyyy-MM-dd');
|
||||
date = date + ' ~ ' + date;
|
||||
break;
|
||||
case 'yesterday':
|
||||
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
|
||||
date = date + ' ~ ' + date;
|
||||
break;
|
||||
case '7day':
|
||||
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
|
||||
break;
|
||||
case '30day':
|
||||
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
|
||||
break;
|
||||
}
|
||||
$('#id-create-time').val(date);
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params: [],
|
||||
searchTpAry: [],
|
||||
brandAry: [],
|
||||
seryAry: [],
|
||||
attrvAry: [],
|
||||
attrcorAry: [],//车身颜色选项
|
||||
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
||||
lists: []
|
||||
},
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.init_brands();
|
||||
vm.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_brands: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
url: '/auto/brand/json_lists',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {status: 1},
|
||||
beforeSend: function () {
|
||||
},
|
||||
success: function (data) {
|
||||
if (1 == data.code) {
|
||||
vm.brandAry = data.data.list;
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
},
|
||||
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;
|
||||
vm.admins.cityAry = JSON.parse(JSON.stringify(response.data));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$("#search_tp").val('mobile');
|
||||
$("#title").val('');
|
||||
$("#id-create-time").val('');
|
||||
that.params.brand_id = '';
|
||||
that.params.city_id_admin = '';
|
||||
}
|
||||
},
|
||||
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 = lists;
|
||||
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 = '';
|
||||
}
|
||||
},
|
||||
'params.s_id': function (nv, ov) {
|
||||
var vm = this;
|
||||
if (nv > 0) {
|
||||
//车身颜色
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/auto/attr/json_lists',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: nv,
|
||||
status: 1,
|
||||
type: 0
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.attrcorAry = response.data.list;
|
||||
}
|
||||
}
|
||||
});
|
||||
//型号
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/auto/attr/json_lists',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
s_id: nv,
|
||||
status: 1,
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.attrvAry = response.data.list;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
vm.attrcorAry = [];
|
||||
vm.attrvAry = [];
|
||||
vm.params.cor_id = '';
|
||||
vm.params.v_id = '';
|
||||
}
|
||||
},
|
||||
'params.city_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.admins.countyAry = [];
|
||||
that.params.county_id_admin = '';
|
||||
} else {
|
||||
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
||||
that.params.county_id_admin = '';
|
||||
}
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/common/area',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.countyAry = response.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.county_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.admins.bizAry = [];
|
||||
that.params.biz_id_admin = '';
|
||||
} else {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/biz/store/store/json_lists',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
city_id: that.params.city_id_admin,
|
||||
county_id: that.params.county_id_admin,
|
||||
status: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.bizAry = response.data.list;
|
||||
if (that.params.biz_id_admin > 0) {
|
||||
var biz_id = '';
|
||||
for (var i in that.admins.bizAry) {
|
||||
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
||||
biz_id = that.params.biz_id_admin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.params.biz_id_admin = biz_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'params.biz_id_admin': function (nv, ov) {
|
||||
var that = this;
|
||||
if (nv == '') {
|
||||
that.admins.list = [];
|
||||
that.params.admin_id = '';
|
||||
} else {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/app/licheb/member/json_lists',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
biz_id: nv,
|
||||
status: 1
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.admins.list = response.data.list;
|
||||
if (that.params.admin_id > 0) {
|
||||
var admin_id = '';
|
||||
for (var i in that.admins.list) {
|
||||
if (that.params.admin_id == that.admins.list[i].id) {
|
||||
admin_id = that.params.admin_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.params.admin_id = admin_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php page_script($pager) ?>
|
||||
});
|
||||
</script>
|
||||
@@ -38,10 +38,11 @@
|
||||
<label class="input-group-btn">
|
||||
<span class="am-btn am-btn-default am-btn-sm">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件
|
||||
<input type="file" style="display: none;" accept=".pdf" @change="upTz(0,$event)" >
|
||||
<input type="file" style="display: none;" accept=".pdf" @change="upTz(0,$event)">
|
||||
</span>
|
||||
</label>
|
||||
<a :href="info.loan_info.notify_file" target="_blank" v-if="info.loan_info.notify_file" class="ml10 mt5 absolute" style="">查看文件</a>
|
||||
<a :href="info.loan_info.notify_file" target="_blank" v-if="info.loan_info.notify_file"
|
||||
class="ml10 mt5 absolute" style="">查看文件</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
@@ -53,17 +54,30 @@
|
||||
<input type="file" style="display: none;" accept=".pdf" @change="upTz(1,$event)">
|
||||
</span>
|
||||
</label>
|
||||
<a :href="info.loan_info.lend_file" target="_blank" v-if="info.loan_info.lend_file" class="ml10 mt5 absolute" style="">查看文件</a>
|
||||
<a :href="info.loan_info.lend_file" target="_blank" v-if="info.loan_info.lend_file"
|
||||
class="ml10 mt5 absolute" style="">查看文件</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline am-u-lg-12 align-r">
|
||||
<a href='javascript:;' @click="finish_loan()" v-if="!info.loan_info.status" class='am-btn am-btn-primary am-btn-xs'>
|
||||
确认交款
|
||||
|
||||
<div class="am-form-inline am-u-lg-12 align-r mt25">
|
||||
<div class="am-form-inline am-u-lg-12" v-if="!info.loan_info.status">
|
||||
<div class="am-form-group am-u-lg-4"> </div>
|
||||
<div class="am-form-group am-u-lg-4 align-r">
|
||||
<a href='javascript:;' @click="finish_loan(1)"
|
||||
class='am-btn am-btn-primary am-btn-xs'>
|
||||
确认通过
|
||||
</a>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4"> </div>
|
||||
</div>
|
||||
<a href='javascript:;' @click="finish_loan(2)" v-else-if="info.loan_info.status==1"
|
||||
class='am-btn am-btn-primary am-btn-xs'>
|
||||
确认放款
|
||||
</a>
|
||||
<a href='javascript:;' v-else class='am-btn am-btn-default am-btn-xs'>
|
||||
已完成按揭
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,7 +11,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Receiver_order_loans_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_order_loans';
|
||||
private $status_arr = [ 0 => '审核中',1 => '已通过'];
|
||||
|
||||
private $status_arr = [ 0 => '审核中',1 => '已通过',2 => '已放款'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -12,14 +12,46 @@ class Receiver_orders_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_orders';
|
||||
|
||||
private $status_arr = [ 0 => '合同签订',1 => '办理分期',2 => '车辆确认',3 => '申请开票',4=>'代办服务',5 => '交付确认', 6 => '完成交付', 7 => '申请退款'];
|
||||
private $status_arr = [0 => '合同签订', 1 => '办理分期', 2 => '车辆确认', 3 => '申请开票', 4 => '代办服务', 5 => '交付确认', 6 => '完成交付', 7 => '申请退款'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
public function get_step($mobile){
|
||||
/**
|
||||
* Notes:订单状态
|
||||
* Created on: 2021/9/15 10:25
|
||||
* Created by: dengbw
|
||||
* @param $status
|
||||
* @return array
|
||||
*/
|
||||
public function statusAry($status = '')
|
||||
{
|
||||
$status_ary[0] = array('name' => '合同签订', 'show' => true, 'list' => array(2 => '已预交款', 1 => '已签合同', 0 => '未签合同'),
|
||||
'menu_list' => array(1 => '已签合同', 0 => '未签合同'), 'menu_default' => 1);
|
||||
$status_ary[1] = array('name' => '分期办理', 'show' => true, 'list' => array(0 => '审核中', 1 => '已通过', 2 => '已放款'),
|
||||
'menu_list' => array(0 => '审核中', 1 => '已通过', 2 => '已放款'), 'menu_default' => 0);
|
||||
$status_ary[2] = array('name' => '车辆确认', 'show' => true, 'list' => array(0 => '车辆确认中', 1 => '用户未签名', 2 => '尾款未支付', 3 => '已确定'),
|
||||
'menu_list' => array(0 => '车辆确认中', 1 => '用户未签名', 2 => '尾款未支付'), 'menu_default' => 0);
|
||||
$status_ary[3] = array('name' => '开票相关', 'show' => true, 'list' => array(0 => '未开票', 1 => '已开票'),
|
||||
'menu_list' => array(0 => '未开票'), 'menu_default' => 0);
|
||||
$status_ary[4] = array('name' => '代办服务', 'show' => true, 'list' => array(0 => '代办中', 1 => '已完成代办'),
|
||||
'menu_list' => array(0 => '代办中'), 'menu_default' => 0);
|
||||
$status_ary[5] = array('name' => '交付车辆', 'show' => true, 'list' => array(0 => '待用户确认', 1 => '用户已确认', 2 => '销售已确认'),
|
||||
'menu_list' => array(0 => '待用户确认', 1 => '用户已确认', 2 => '销售已确认'), 'menu_default' => 0);
|
||||
$status_ary[6] = array('name' => '完成交付', 'show' => false, 'list' => array(), 'menu_list' => array());
|
||||
$status_ary[7] = array('name' => '申请退款', 'show' => false, 'list' => array(), 'menu_list' => array());
|
||||
if (strlen($status)) {
|
||||
$return_status = $status_ary[$status];
|
||||
} else {
|
||||
$return_status = $status_ary;
|
||||
}
|
||||
return $return_status;
|
||||
}
|
||||
|
||||
public function get_step($mobile)
|
||||
{
|
||||
$t1 = 'lc_receiver_orders';
|
||||
//$t2 = 'lc_receiver_order_contracts';
|
||||
$this->db->select("$t1.*");
|
||||
@@ -39,9 +71,11 @@ class Receiver_orders_model extends HD_Model
|
||||
$row = $this->db->get()->row_array();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取交车列表
|
||||
public function get_finsh($mobile,$page,$size,$count){
|
||||
|
||||
public function get_finsh($mobile, $page, $size, $count)
|
||||
{
|
||||
|
||||
$t1 = 'lc_receiver_orders';
|
||||
//$t2 = 'lc_receiver_order_contracts';
|
||||
$this->db->select("$t1.*");
|
||||
@@ -57,8 +91,8 @@ class Receiver_orders_model extends HD_Model
|
||||
"$t1.status" => 6,
|
||||
];
|
||||
$this->db->where($where);
|
||||
if($count){
|
||||
return $this->db->count_all_results();
|
||||
if ($count) {
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
$this->db->order_by("$t1.id desc");
|
||||
@@ -72,8 +106,10 @@ class Receiver_orders_model extends HD_Model
|
||||
$this->db->limit($limit, $offset);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
public function get_status(){
|
||||
return $this->status_arr;
|
||||
|
||||
public function get_status()
|
||||
{
|
||||
return $this->status_arr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user