派单员添加区域过滤
This commit is contained in:
parent
cee37cad21
commit
ed63962d56
|
|
@ -42,7 +42,7 @@ return [
|
||||||
'title' => 'Endpoint',
|
'title' => 'Endpoint',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => 'allocatr.oss-cn-hangzhou.aliyuncs.com',
|
'value' => 'oss-cn-hangzhou.aliyuncs.com',
|
||||||
'rule' => 'required;endpoint',
|
'rule' => 'required;endpoint',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '请填写从阿里云存储获取的Endpoint',
|
'tip' => '请填写从阿里云存储获取的Endpoint',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
use app\admin\addresmart\Address;
|
use app\admin\addresmart\Address;
|
||||||
|
use app\admin\model\AuthGroupAccess;
|
||||||
use app\admin\model\OrderDispatch;
|
use app\admin\model\OrderDispatch;
|
||||||
use app\admin\model\Worker;
|
use app\admin\model\Worker;
|
||||||
use app\admin\model\WorkerItem;
|
use app\admin\model\WorkerItem;
|
||||||
|
|
@ -28,29 +29,30 @@ class Order extends Backend
|
||||||
protected $model = null;
|
protected $model = null;
|
||||||
protected $sources = null;
|
protected $sources = null;
|
||||||
protected $items = null;
|
protected $items = null;
|
||||||
|
|
||||||
public function _initialize()
|
public function _initialize()
|
||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new \app\admin\model\Order;
|
$this->model = new \app\admin\model\Order;
|
||||||
$this->view->assign("statusList", $this->model->getStatusList());
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
|
|
||||||
$sources = Db::name('source')
|
$sources = Db::name('source')
|
||||||
->where('status',1)
|
->where('status', 1)
|
||||||
->field(['id','title','key_word','pid'])
|
->field(['id', 'title', 'key_word', 'pid'])
|
||||||
->order('pid','asc')
|
->order('pid', 'asc')
|
||||||
->order('sort','desc')
|
->order('sort', 'desc')
|
||||||
->select();
|
->select();
|
||||||
$this->sources = $sources;
|
$this->sources = $sources;
|
||||||
$filtered = array_filter($sources, function($item) {
|
$filtered = array_filter($sources, function ($item) {
|
||||||
return $item['pid'] == 0;
|
return $item['pid'] == 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
$pid_map = array_column($filtered,null,'id');
|
$pid_map = array_column($filtered, null, 'id');
|
||||||
$res = [];
|
$res = [];
|
||||||
foreach ($sources as $item){
|
foreach ($sources as $item) {
|
||||||
if ($item['pid'] != 0 && isset($pid_map[$item['pid']])){
|
if ($item['pid'] != 0 && isset($pid_map[$item['pid']])) {
|
||||||
$res [] = [
|
$res [] = [
|
||||||
...$item,'ptitle' => $pid_map[$item['pid']]['title']
|
...$item, 'ptitle' => $pid_map[$item['pid']]['title']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -60,30 +62,30 @@ class Order extends Backend
|
||||||
// $data = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'title');
|
// $data = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'title');
|
||||||
// dd($data);
|
// dd($data);
|
||||||
|
|
||||||
$items = Db::name('item')
|
$items = Db::name('item')
|
||||||
->where('status',1)
|
->where('status', 1)
|
||||||
->field(['id','title','key_word','pid'])
|
->field(['id', 'title', 'key_word', 'pid'])
|
||||||
->order('pid','asc')
|
->order('pid', 'asc')
|
||||||
->order('sort','desc')
|
->order('sort', 'desc')
|
||||||
->select();
|
->select();
|
||||||
$tree = $this->buildTree($items);
|
$tree = $this->buildTree($items);
|
||||||
$formattedTree = $this->formatTree($tree);
|
$formattedTree = $this->formatTree($tree);
|
||||||
$phones = Db::name('phones')
|
$phones = Db::name('phones')
|
||||||
->where('assigned_user',$this->auth->id)
|
->where('assigned_user', $this->auth->id)
|
||||||
->field(['id','model','phone_number'])
|
->field(['id', 'model', 'phone_number'])
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
$this->items = $items;
|
$this->items = $items;
|
||||||
|
|
||||||
|
|
||||||
$coupons = Db::name('coupons')
|
$coupons = Db::name('coupons')
|
||||||
->where('status','active')
|
->where('status', 'active')
|
||||||
->field(['id','code','description'])
|
->field(['id', 'code', 'description'])
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
|
||||||
$users = Db::name('admin')
|
$users = Db::name('admin')
|
||||||
->field(['id','nickname'])
|
->field(['id', 'nickname'])
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
$this->view->assign("statusList", $this->model->getStatusList());
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
|
|
@ -100,7 +102,6 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
|
@ -108,10 +109,13 @@ class Order extends Backend
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->request->filter(['strip_tags', 'trim']);
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
$group = \model('auth_group_access')->find($this->auth->id)->group_id ?? 0;
|
||||||
|
$user = \model('admin')->find($this->auth->id);
|
||||||
|
|
||||||
|
|
||||||
if (false === $this->request->isAjax()) {
|
if (false === $this->request->isAjax()) {
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
|
@ -120,16 +124,30 @@ class Order extends Backend
|
||||||
return $this->selectpage();
|
return $this->selectpage();
|
||||||
}
|
}
|
||||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||||
$list = $this->model
|
$build = $this->model
|
||||||
->field(['id','order_no','admin_id','customer','tel','status','area_id','address',
|
->field(['id', 'order_no', 'admin_id', 'customer', 'tel', 'status', 'area_id', 'address',
|
||||||
'source','source_shop','source_uid','source','item_title','item_id','work_tel_id',
|
'source', 'source_shop', 'source_uid', 'source', 'item_title', 'item_id', 'work_tel_id',
|
||||||
'detail','remark','images','create_time','update_time','admin_id','dispatch_type','receive_type'])
|
'detail', 'remark', 'images', 'create_time', 'update_time', 'admin_id', 'dispatch_type', 'receive_type'])
|
||||||
->where($where)
|
->where($where);
|
||||||
->with(['user' => function($q){
|
|
||||||
|
if ($group == 2) {
|
||||||
|
// 生成 SQL 语句
|
||||||
|
$area_codes = $this->filterAreaCodes(explode(',', $user->area_ids));
|
||||||
|
$build->where(function ($q) use ($area_codes) {
|
||||||
|
foreach ($area_codes as $area_code) {
|
||||||
|
$q->whereOr('area_id', 'like', $area_code . '%');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = $build
|
||||||
|
->with(['user' => function ($q) {
|
||||||
$q->field('id,nickname');
|
$q->field('id,nickname');
|
||||||
},'area' => function($q){
|
}, 'area' => function ($q) {
|
||||||
$q->field('id,area_code,merge_name');
|
$q->field('id,area_code,merge_name');
|
||||||
},'phone' => function($q){
|
}, 'phone' => function ($q) {
|
||||||
$q->field('id,model');
|
$q->field('id,model');
|
||||||
}])
|
}])
|
||||||
->order($sort, $order)
|
->order($sort, $order)
|
||||||
|
|
@ -162,14 +180,14 @@ class Order extends Backend
|
||||||
$this->model->validateFailException()->validate($validate);
|
$this->model->validateFailException()->validate($validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sources = $this->sources;
|
$sources = $this->sources;
|
||||||
$items = $this->items;
|
$items = $this->items;
|
||||||
$sources = array_column($sources,'title','id');
|
$sources = array_column($sources, 'title', 'id');
|
||||||
$items = array_column($items,'title','id');
|
$items = array_column($items, 'title', 'id');
|
||||||
$params['source_shop'] = $sources[$params['source']] ?? null;
|
$params['source_shop'] = $sources[$params['source']] ?? null;
|
||||||
$params['item_title'] = $items[$params['item_id']] ?? null;
|
$params['item_title'] = $items[$params['item_id']] ?? null;
|
||||||
$params['admin_id'] = ($params['admin_id'] ?? -1) == -1 ? $this->auth->id : $params['admin_id'];
|
$params['admin_id'] = ($params['admin_id'] ?? -1) == -1 ? $this->auth->id : $params['admin_id'];
|
||||||
if(empty($params['admin_id'])){
|
if (empty($params['admin_id'])) {
|
||||||
$params['admin_id'] = $this->auth->id;
|
$params['admin_id'] = $this->auth->id;
|
||||||
}
|
}
|
||||||
$params['status'] = 10;
|
$params['status'] = 10;
|
||||||
|
|
@ -178,11 +196,11 @@ class Order extends Backend
|
||||||
$params['update_time'] = date('Y-m-d H:i:s');
|
$params['update_time'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
if ($params['dispatch_type'] == 2){
|
if ($params['dispatch_type'] == 2) {
|
||||||
$this->autoDispatch($this->model);
|
$this->autoDispatch($this->model);
|
||||||
}
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -196,12 +214,12 @@ class Order extends Backend
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$ids) {
|
if (!$ids) {
|
||||||
if (request()->isPost()){
|
if (request()->isPost()) {
|
||||||
$ids = input('id');
|
$ids = input('id');
|
||||||
if (!$ids){
|
if (!$ids) {
|
||||||
$this->error('缺少订单ID');
|
$this->error('缺少订单ID');
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$this->error('缺少订单ID');
|
$this->error('缺少订单ID');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -217,19 +235,19 @@ class Order extends Backend
|
||||||
// 获取表单提交的数据
|
// 获取表单提交的数据
|
||||||
$params = input('post.row/a');
|
$params = input('post.row/a');
|
||||||
$params['update_time'] = date('Y-m-d H:i:s');
|
$params['update_time'] = date('Y-m-d H:i:s');
|
||||||
$sources = $this->sources;
|
$sources = $this->sources;
|
||||||
$sources = array_column($sources,'title','id');
|
$sources = array_column($sources, 'title', 'id');
|
||||||
// $data['user_id'] = $this->auth->id;
|
// $data['user_id'] = $this->auth->id;
|
||||||
$params['source_shop'] = $sources[$params['source']] ?? null;
|
$params['source_shop'] = $sources[$params['source']] ?? null;
|
||||||
|
|
||||||
$sources = $this->sources;
|
$sources = $this->sources;
|
||||||
$items = $this->items;
|
$items = $this->items;
|
||||||
|
|
||||||
$sources = array_column($sources,'title','id');
|
$sources = array_column($sources, 'title', 'id');
|
||||||
$items = array_column($items,'title','id');
|
$items = array_column($items, 'title', 'id');
|
||||||
|
|
||||||
$params['admin_id'] = ($params['admin_id'] == -1) ? $this->auth->id : $params['admin_id'];
|
$params['admin_id'] = ($params['admin_id'] == -1) ? $this->auth->id : $params['admin_id'];
|
||||||
if(empty($params['admin_id'])){
|
if (empty($params['admin_id'])) {
|
||||||
$params['admin_id'] = $this->auth->id;
|
$params['admin_id'] = $this->auth->id;
|
||||||
}
|
}
|
||||||
$params['source_shop'] = $sources[$params['source']] ?? null;
|
$params['source_shop'] = $sources[$params['source']] ?? null;
|
||||||
|
|
@ -246,7 +264,7 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
$area = new \app\admin\model\Area();
|
$area = new \app\admin\model\Area();
|
||||||
$area_name = $area->getNameByCode($order->area_id);
|
$area_name = $area->getNameByCode($order->area_id);
|
||||||
$order->area_name = str_replace(',','/',$area_name);
|
$order->area_name = str_replace(',', '/', $area_name);
|
||||||
// dd($area_name);
|
// dd($area_name);
|
||||||
// 将订单数据传递到视图
|
// 将订单数据传递到视图
|
||||||
$this->assign('row', $order);
|
$this->assign('row', $order);
|
||||||
|
|
@ -259,7 +277,7 @@ class Order extends Backend
|
||||||
public function copy($ids = null)
|
public function copy($ids = null)
|
||||||
{
|
{
|
||||||
if (!$ids) {
|
if (!$ids) {
|
||||||
$this->error('缺少订单ID');
|
$this->error('缺少订单ID');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前ID对应的订单信息
|
// 获取当前ID对应的订单信息
|
||||||
|
|
@ -271,7 +289,7 @@ class Order extends Backend
|
||||||
|
|
||||||
$area = new \app\admin\model\Area();
|
$area = new \app\admin\model\Area();
|
||||||
$area_name = $area->getNameByCode($order->area_id);
|
$area_name = $area->getNameByCode($order->area_id);
|
||||||
$order->area_name = str_replace(',','/',$area_name);
|
$order->area_name = str_replace(',', '/', $area_name);
|
||||||
|
|
||||||
// 将订单数据传递到视图
|
// 将订单数据传递到视图
|
||||||
$this->assign('row', $order);
|
$this->assign('row', $order);
|
||||||
|
|
@ -280,7 +298,8 @@ class Order extends Backend
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateOrderNumber($prefix = 'ORD') {
|
function generateOrderNumber($prefix = 'ORD')
|
||||||
|
{
|
||||||
// 获取当前时间戳(精确到毫秒)
|
// 获取当前时间戳(精确到毫秒)
|
||||||
$timestamp = microtime(true);
|
$timestamp = microtime(true);
|
||||||
$date = date('YmdHis', (int)$timestamp); // 格式:YYYYMMDDHHMMSS
|
$date = date('YmdHis', (int)$timestamp); // 格式:YYYYMMDDHHMMSS
|
||||||
|
|
@ -293,27 +312,28 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function autoDispatch($order) {
|
private function autoDispatch($order)
|
||||||
if ($order->dispatch_type != 2){
|
{
|
||||||
|
if ($order->dispatch_type != 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$worker_ids = (new Worker())->where('area_id',$order->area_id)
|
$worker_ids = (new Worker())->where('area_id', $order->area_id)
|
||||||
->where('status',1)
|
->where('status', 1)
|
||||||
->field(['id','area_id','lng'],'lat')
|
->field(['id', 'area_id', 'lng'], 'lat')
|
||||||
->column('id');
|
->column('id');
|
||||||
|
|
||||||
$worker_items_ids = (new WorkerItem())
|
$worker_items_ids = (new WorkerItem())
|
||||||
->where('item_id',$order->item_id)
|
->where('item_id', $order->item_id)
|
||||||
->whereIn('worker_id',$worker_ids)
|
->whereIn('worker_id', $worker_ids)
|
||||||
->field(['worker_id'],'lat')
|
->field(['worker_id'], 'lat')
|
||||||
->column('worker_id');
|
->column('worker_id');
|
||||||
|
|
||||||
$out_workers = array_intersect($worker_ids,$worker_items_ids);
|
$out_workers = array_intersect($worker_ids, $worker_items_ids);
|
||||||
|
|
||||||
$worker_id = $out_workers[0] ?? false;
|
$worker_id = $out_workers[0] ?? false;
|
||||||
|
|
||||||
if (!$worker_id){
|
if (!$worker_id) {
|
||||||
$order->dispatch_type = 1;
|
$order->dispatch_type = 1;
|
||||||
$order->save();
|
$order->save();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -324,12 +344,12 @@ class Order extends Backend
|
||||||
'admin_user' => $this->auth->nickname,
|
'admin_user' => $this->auth->nickname,
|
||||||
'order_id' => $order->id,
|
'order_id' => $order->id,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'worker_id' =>$worker_id,
|
'worker_id' => $worker_id,
|
||||||
'plan_time' => $order->plan_time,
|
'plan_time' => $order->plan_time,
|
||||||
'is_receipt' => $order->receive_type == 1
|
'is_receipt' => $order->receive_type == 1
|
||||||
];
|
];
|
||||||
|
|
||||||
$worker = (new Worker())->where('id',$worker_id)->find();
|
$worker = (new Worker())->where('id', $worker_id)->find();
|
||||||
$insert ['worker_name'] = $worker['name'];
|
$insert ['worker_name'] = $worker['name'];
|
||||||
$insert ['worker_tel'] = $worker['tel'];
|
$insert ['worker_tel'] = $worker['tel'];
|
||||||
(new OrderDispatch())->allowField(true)->save($insert);
|
(new OrderDispatch())->allowField(true)->save($insert);
|
||||||
|
|
@ -340,7 +360,47 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function smart(){
|
public function smart()
|
||||||
$this->success(data:Address::smart(request()->get('str')));
|
{
|
||||||
|
$this->success(data: Address::smart(request()->get('str')));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function reminder($ids = null)
|
||||||
|
{
|
||||||
|
if ($ids) {
|
||||||
|
$order = $this->model->where('id', $ids)->find();
|
||||||
|
}
|
||||||
|
$this->success($order['order_no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function filterAreaCodes(array $area_codes)
|
||||||
|
{
|
||||||
|
// 提取所有两位区号
|
||||||
|
$prefix_2_digits = [];
|
||||||
|
foreach ($area_codes as $code) {
|
||||||
|
if (strlen($code) == 2) {
|
||||||
|
$prefix_2_digits[] = $code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤数组
|
||||||
|
$filtered_codes = array_filter($area_codes, function ($code) use ($prefix_2_digits) {
|
||||||
|
// 如果是两位区号,直接保留
|
||||||
|
if (strlen($code) == 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 检查是否有对应的两位前缀,如果有,则排除四位区号
|
||||||
|
foreach ($prefix_2_digits as $prefix) {
|
||||||
|
if (strpos($code, $prefix) === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果没有匹配的两位前缀,则保留
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 重新索引数组
|
||||||
|
return array_values($filtered_codes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
define([], function () {
|
define([], function () {
|
||||||
require([], function () {
|
require([], function () {
|
||||||
//绑定data-toggle=addresspicker属性点击事件
|
//绑定data-toggle=addresspicker属性点击事件
|
||||||
|
console.log('111');
|
||||||
|
|
||||||
$(document).on('click', "[data-toggle='addresspicker']", function () {
|
$(document).on('click', "[data-toggle='addresspicker']", function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
var callback = $(that).data('callback');
|
var callback = $(that).data('callback');
|
||||||
|
|
@ -10,9 +12,9 @@ define([], function () {
|
||||||
var zoom_id = $(that).data("zoom-id") ? $(that).data("zoom-id") : "";
|
var zoom_id = $(that).data("zoom-id") ? $(that).data("zoom-id") : "";
|
||||||
var lat = lat_id ? $("#" + lat_id).val() : '';
|
var lat = lat_id ? $("#" + lat_id).val() : '';
|
||||||
var lng = lng_id ? $("#" + lng_id).val() : '';
|
var lng = lng_id ? $("#" + lng_id).val() : '';
|
||||||
var city_code = $("#area_name").val();
|
var city_code = $("#area_id").val();
|
||||||
var zoom = zoom_id ? $("#" + zoom_id).val() : '';
|
var zoom = zoom_id ? $("#" + zoom_id).val() : '';
|
||||||
var url = "/addons/address/index/select?abc=1";
|
var url = "/addons/address/index/select?1=1";
|
||||||
url += (lat && lng) ? 'lat=' + lat + '&lng=' + lng +
|
url += (lat && lng) ? 'lat=' + lat + '&lng=' + lng +
|
||||||
(input_id ? "&address=" + $("#" + input_id).val() : "")
|
(input_id ? "&address=" + $("#" + input_id).val() : "")
|
||||||
+(zoom ? "&zoom=" + zoom : "") : ''
|
+(zoom ? "&zoom=" + zoom : "") : ''
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'],
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// Controller.api.rendertree(data);
|
Controller.api.rendertree(data);
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
console.error("请求失败");
|
console.error("请求失败");
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','cascader'], function
|
||||||
},
|
},
|
||||||
refresh:true,
|
refresh:true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"reminder",
|
||||||
|
text:"催单",
|
||||||
|
title:"派单",
|
||||||
|
extend: 'data-toggle="tooltip" data-container="body"',
|
||||||
|
classname: 'btn btn-xs btn-info btn-magic btn-ajax',
|
||||||
|
icon: 'fa fa-bolt',
|
||||||
|
url: 'order/reminder',
|
||||||
|
success: function (data, ret) {
|
||||||
|
if (ret.code === 1){
|
||||||
|
Layer.alert('催单成功');
|
||||||
|
}else {
|
||||||
|
Layer.alert(ret.msg);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
//如果需要阻止成功提示,则必须使用return false;
|
||||||
|
//return false;
|
||||||
|
},
|
||||||
|
error: function (data, ret) {
|
||||||
|
console.log(data, ret);
|
||||||
|
Layer.alert(ret.msg);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user