Accept Merge Request #184: (feature/hant -> develop)
Merge Request: 修改 Created By: @todayswind Accepted By: @todayswind URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/184?initial=true
This commit is contained in:
commit
8b3c98980c
|
|
@ -334,7 +334,8 @@ class Ajax extends Backend
|
||||||
|
|
||||||
$group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0;
|
$group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0;
|
||||||
|
|
||||||
if ($group == 2 || $group == 6) {
|
$to_dispatch = 0;
|
||||||
|
if ($group == 6) {
|
||||||
// 生成 SQL 语句
|
// 生成 SQL 语句
|
||||||
$ids = $user->area_ids??'';
|
$ids = $user->area_ids??'';
|
||||||
if ($ids == ''){
|
if ($ids == ''){
|
||||||
|
|
@ -350,7 +351,10 @@ class Ajax extends Backend
|
||||||
});
|
});
|
||||||
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
}
|
}
|
||||||
}else{
|
}else if($group == 2){
|
||||||
|
$order->where('admin_id',$user->id);
|
||||||
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
|
}else if($group == 1){
|
||||||
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
}
|
}
|
||||||
//待跟进
|
//待跟进
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ class Index extends Backend
|
||||||
|
|
||||||
$group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0;
|
$group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0;
|
||||||
|
|
||||||
if ($group == 2 || $group == 6) {
|
$to_dispatch = 0;
|
||||||
|
if ($group == 6) {
|
||||||
// 生成 SQL 语句
|
// 生成 SQL 语句
|
||||||
$ids = $user->area_ids??'';
|
$ids = $user->area_ids??'';
|
||||||
if ($ids == ''){
|
if ($ids == ''){
|
||||||
|
|
@ -62,7 +63,10 @@ class Index extends Backend
|
||||||
});
|
});
|
||||||
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
}
|
}
|
||||||
}else{
|
}else if($group == 2){
|
||||||
|
$order->where('admin_id',$user->id);
|
||||||
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
|
}else if($group == 1){
|
||||||
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
$to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count();
|
||||||
}
|
}
|
||||||
//待跟进
|
//待跟进
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,20 @@ class Order extends Backend
|
||||||
$group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0;
|
$group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0;
|
||||||
$user = \model('admin')->find($this->auth->id);
|
$user = \model('admin')->find($this->auth->id);
|
||||||
|
|
||||||
|
$this->assignconfig('permissions', [
|
||||||
|
'add' => $this->auth->check('order/add'),
|
||||||
|
'edit' => $this->auth->check('order/edit'),
|
||||||
|
'copy' => $this->auth->check('order/copy'),
|
||||||
|
'reminder' => $this->auth->check('order/reminder'),
|
||||||
|
'warning' => $this->auth->check('order/warning'),
|
||||||
|
'addAbnormal' => $this->auth->check('order/addAbnormal'),
|
||||||
|
'delete' => $this->auth->check('order/delete'),
|
||||||
|
'invoice' => $this->auth->check('order/invoice'),
|
||||||
|
'aftersale' => $this->auth->check('aftersales/aftersale/add'),
|
||||||
|
'log' => $this->auth->check('order/log'),
|
||||||
|
'dispatch' => $this->auth->check('orders/dispatch/add'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
if (false === $this->request->isAjax()) {
|
if (false === $this->request->isAjax()) {
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
|
|
@ -197,7 +211,9 @@ class Order extends Backend
|
||||||
->where('create_time', '<=', (new Carbon())->subMinutes(20)
|
->where('create_time', '<=', (new Carbon())->subMinutes(20)
|
||||||
->format('Y-m-d H:i:s'));
|
->format('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
if ($group == 2 || $group == 6) {
|
if ($group == 2 ) {
|
||||||
|
$build->where('admin_id',$user->id);
|
||||||
|
}elseif ($group == 6){
|
||||||
// 生成 SQL 语句
|
// 生成 SQL 语句
|
||||||
$ids = $user->area_ids ?? '';
|
$ids = $user->area_ids ?? '';
|
||||||
if ($ids == '') {
|
if ($ids == '') {
|
||||||
|
|
@ -211,8 +227,6 @@ class Order extends Backend
|
||||||
$q->whereOr('area_id', 'like', $area_code . '%');
|
$q->whereOr('area_id', 'like', $area_code . '%');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = $build
|
$list = $build
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,17 @@
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{:build_heading(null,FALSE)}
|
{:build_heading(null,FALSE)}
|
||||||
<ul class="nav nav-tabs" data-field="status">
|
<ul class="nav nav-tabs" data-field="status">
|
||||||
<li class="{:$Think.get.status === (string)1 ? 'active' : ''}"><a href="#t-active" data-value="1" data-toggle="tab">正常订单</a></li>
|
<li class="{:$Think.get.status === 1 ? 'active' : ''}">
|
||||||
<li class="{:$Think.get.status === (string)2 ? 'active' : ''}"><a href="#t-cancel" data-value="2" data-toggle="tab">取消订单</a></li>
|
<a href="#t-active" data-value="1" data-toggle="tab">待派单</a>
|
||||||
<li class="{:$Think.get.status === (string)2 ? 'active' : ''}"><a href="#t-overtime" data-value="3" data-toggle="tab">超时订单</a></li>
|
</li>
|
||||||
|
<li class="{:$Think.get.status === 2 ? 'active' : ''}">
|
||||||
|
<a href="#t-cancel" data-value="2" data-toggle="tab">已超时</a>
|
||||||
|
</li>
|
||||||
|
<li class="{:$Think.get.status === 3 ? 'active' : ''}">
|
||||||
|
<a href="#t-overtime" data-value="3" data-toggle="tab">全部订单</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
@ -140,7 +147,7 @@
|
||||||
<script id="items_picker" type="text/html">
|
<script id="items_picker" type="text/html">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<input id="select_item" class="form-control" type="text" />
|
<input id="select_item" class="form-control" type="text" autocomplete="off" />
|
||||||
<input id="select_item_id" type="hidden" name="item_id" />
|
<input id="select_item_id" type="hidden" name="item_id" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
columns: [
|
columns: [
|
||||||
[
|
[
|
||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'id', title: __('Id')},
|
{field: 'id', title: __('Id'),searchable: false},
|
||||||
{
|
{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: __('Status'),
|
title: __('Status'),
|
||||||
|
|
@ -160,18 +160,18 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
},
|
},
|
||||||
formatter: Table.api.formatter.label
|
formatter: Table.api.formatter.label
|
||||||
},
|
},
|
||||||
{field: 'item_title', title: __('Item_title'), operate: 'LIKE'},
|
{field: 'item_title', title: __('Item_title'), operate: false},
|
||||||
|
|
||||||
|
|
||||||
{field: 'user.nickname', title: '录单员'},
|
{field: 'user.nickname', title: '录单员',operate: false},
|
||||||
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
||||||
{field: 'customer', title: __('Customer'), operate: 'LIKE'},
|
{field: 'customer', title: __('Customer'), operate: false},
|
||||||
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
||||||
{field: 'area.merge_name', title: __('Area_id'), searchable: false},
|
{field: 'area.merge_name', title: __('Area_id'), searchable: false},
|
||||||
{
|
{
|
||||||
field: 'address',
|
field: 'address',
|
||||||
title: __('Address'),
|
title: __('Address'),
|
||||||
operate: 'LIKE',
|
operate: false,
|
||||||
table: table,
|
table: table,
|
||||||
class: 'autocontent',
|
class: 'autocontent',
|
||||||
formatter: Table.api.formatter.content
|
formatter: Table.api.formatter.content
|
||||||
|
|
@ -190,6 +190,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
{
|
{
|
||||||
field: 'total',
|
field: 'total',
|
||||||
title: '总收款',
|
title: '总收款',
|
||||||
|
operate: false,
|
||||||
formatter: Table.api.formatter.Text
|
formatter: Table.api.formatter.Text
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -199,7 +200,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
{
|
{
|
||||||
field: 'detail',
|
field: 'detail',
|
||||||
title: __('Detail'),
|
title: __('Detail'),
|
||||||
operate: 'LIKE',
|
operate: false,
|
||||||
table: table,
|
table: table,
|
||||||
class: 'autocontent',
|
class: 'autocontent',
|
||||||
formatter: Table.api.formatter.content
|
formatter: Table.api.formatter.content
|
||||||
|
|
@ -207,7 +208,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
{
|
{
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
title: __('Remark'),
|
title: __('Remark'),
|
||||||
operate: 'LIKE',
|
operate: false,
|
||||||
table: table,
|
table: table,
|
||||||
class: 'autocontent',
|
class: 'autocontent',
|
||||||
formatter: Table.api.formatter.content
|
formatter: Table.api.formatter.content
|
||||||
|
|
@ -222,14 +223,14 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
{
|
{
|
||||||
field: 'create_time',
|
field: 'create_time',
|
||||||
title: __('Create_time'),
|
title: __('Create_time'),
|
||||||
operate: 'RANGE',
|
operate: false,
|
||||||
addclass: 'datetimerange',
|
addclass: 'datetimerange',
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'update_time',
|
field: 'update_time',
|
||||||
title: __('Update_time'),
|
title: __('Update_time'),
|
||||||
operate: 'RANGE',
|
operate: false,
|
||||||
addclass: 'datetimerange',
|
addclass: 'datetimerange',
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
|
|
@ -266,7 +267,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
classname: 'btn btn-xs btn-info btn-editone',
|
classname: 'btn btn-xs btn-info btn-editone',
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status != 60 && row.status != 70) {
|
if (Config.permissions.edit && row.status != 60 && row.status != 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -284,6 +285,9 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
callback: function ($data) {
|
callback: function ($data) {
|
||||||
// console.log($data);
|
// console.log($data);
|
||||||
},
|
},
|
||||||
|
visible:function (row) {
|
||||||
|
return Config.permissions.copy;
|
||||||
|
},
|
||||||
dropdown: "更多"
|
dropdown: "更多"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -296,7 +300,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
icon: 'fa fa-add',
|
icon: 'fa fa-add',
|
||||||
url: 'order/warning',
|
url: 'order/warning',
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 10) {
|
if (Config.permissions.warning && row.status == 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -315,7 +319,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
return 'orders/dispatch/map?order_id=' + row.id;
|
return 'orders/dispatch/map?order_id=' + row.id;
|
||||||
},
|
},
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 10) {
|
if (Config.permissions.map && row.status == 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -335,7 +339,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
return 'orders/dispatch/add?order_id=' + row.id;
|
return 'orders/dispatch/add?order_id=' + row.id;
|
||||||
},
|
},
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 10) {
|
if (Config.permissions.dispatch && row.status == 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -366,7 +370,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 10) {
|
if (Config.permissions.reminder && row.status == 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -392,7 +396,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
url: 'order/delete',
|
url: 'order/delete',
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status >= 0 && row.status < 60) {
|
if (Config.permissions.delete && row.status >= 0 && row.status < 60) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -409,7 +413,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
refresh: true,
|
refresh: true,
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status != 60 && row.status != 70) {
|
if (Config.permissions.addAbnormal && row.status != 60 && row.status != 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -435,7 +439,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
|
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 60 || row.status == 70) {
|
if (Config.permissions.invoice && row.status == 60 || row.status == 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -450,7 +454,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
url: 'aftersales/aftersale/add',
|
url: 'aftersales/aftersale/add',
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status !== -10 && row.status !== 70 && row.aftersale_id <= 0) {
|
if (Config.permissions.aftersale && row.status !== -10 && row.status !== 70 && row.aftersale_id <= 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -470,6 +474,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
//绑定tab事件
|
//绑定tab事件
|
||||||
$('a[data-toggle="tab"]').on('show.bs.tab', function (event) {
|
$('a[data-toggle="tab"]').on('show.bs.tab', function (event) {
|
||||||
let type = $(this).attr("data-value");
|
let type = $(this).attr("data-value");
|
||||||
|
|
||||||
let options = table.bootstrapTable('getOptions');
|
let options = table.bootstrapTable('getOptions');
|
||||||
$('.nav-tabs li').attr('class', '');
|
$('.nav-tabs li').attr('class', '');
|
||||||
$(this).parent().attr("class", 'active');
|
$(this).parent().attr("class", 'active');
|
||||||
|
|
@ -477,11 +482,16 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
if (cloneQueryParams == null) {
|
if (cloneQueryParams == null) {
|
||||||
cloneQueryParams = options.queryParams;
|
cloneQueryParams = options.queryParams;
|
||||||
}
|
}
|
||||||
|
if (type == 1){
|
||||||
options.queryParams = function (params) {
|
$("form.form-commonsearch [name='status']").val(10).trigger("change");
|
||||||
params.type = type;
|
$("form.form-commonsearch [name='is_timeout']").val('').trigger("change");
|
||||||
return cloneQueryParams(params);
|
}else if(type == 2){
|
||||||
};
|
$("form.form-commonsearch [name='status']").val(10).trigger("change");
|
||||||
|
$("form.form-commonsearch [name='is_timeout']").val(1).trigger("change");
|
||||||
|
}else {
|
||||||
|
$("form.form-commonsearch [name='status']").val('').trigger("change");
|
||||||
|
$("form.form-commonsearch [name='is_timeout']").val('').trigger("change");
|
||||||
|
}
|
||||||
table.bootstrapTable('refresh', {});
|
table.bootstrapTable('refresh', {});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user