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:
todayswind 2025-06-26 14:28:00 +08:00 committed by Coding
commit 8b3c98980c
5 changed files with 73 additions and 34 deletions

View File

@ -334,7 +334,8 @@ class Ajax extends Backend
$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 语句
$ids = $user->area_ids??'';
if ($ids == ''){
@ -350,7 +351,10 @@ class Ajax extends Backend
});
$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();
}
//待跟进

View File

@ -46,7 +46,8 @@ class Index extends Backend
$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 语句
$ids = $user->area_ids??'';
if ($ids == ''){
@ -62,7 +63,10 @@ class Index extends Backend
});
$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();
}
//待跟进

View File

@ -132,6 +132,20 @@ class Order extends Backend
$group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0;
$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()) {
return $this->view->fetch();
@ -197,7 +211,9 @@ class Order extends Backend
->where('create_time', '<=', (new Carbon())->subMinutes(20)
->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 语句
$ids = $user->area_ids ?? '';
if ($ids == '') {
@ -211,8 +227,6 @@ class Order extends Backend
$q->whereOr('area_id', 'like', $area_code . '%');
}
});
}
$list = $build

View File

@ -4,10 +4,17 @@
<div class="panel-heading">
{:build_heading(null,FALSE)}
<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 === (string)2 ? 'active' : ''}"><a href="#t-cancel" data-value="2" data-toggle="tab">取消订单</a></li>
<li class="{:$Think.get.status === (string)2 ? 'active' : ''}"><a href="#t-overtime" data-value="3" data-toggle="tab">超时订单</a></li>
<li class="{:$Think.get.status === 1 ? 'active' : ''}">
<a href="#t-active" data-value="1" data-toggle="tab">待派单</a>
</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>
</div>
<div class="panel-body">
@ -140,7 +147,7 @@
<script id="items_picker" type="text/html">
<div class="row">
<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" />
</div>
</div>

View File

@ -98,7 +98,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'id', title: __('Id'),searchable: false},
{
field: 'status',
title: __('Status'),
@ -160,18 +160,18 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
},
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: 'customer', title: __('Customer'), operate: 'LIKE'},
{field: 'customer', title: __('Customer'), operate: false},
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
{field: 'area.merge_name', title: __('Area_id'), searchable: false},
{
field: 'address',
title: __('Address'),
operate: 'LIKE',
operate: false,
table: table,
class: 'autocontent',
formatter: Table.api.formatter.content
@ -190,6 +190,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
{
field: 'total',
title: '总收款',
operate: false,
formatter: Table.api.formatter.Text
},
@ -199,7 +200,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
{
field: 'detail',
title: __('Detail'),
operate: 'LIKE',
operate: false,
table: table,
class: 'autocontent',
formatter: Table.api.formatter.content
@ -207,7 +208,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
{
field: 'remark',
title: __('Remark'),
operate: 'LIKE',
operate: false,
table: table,
class: 'autocontent',
formatter: Table.api.formatter.content
@ -222,14 +223,14 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
{
field: 'create_time',
title: __('Create_time'),
operate: 'RANGE',
operate: false,
addclass: 'datetimerange',
autocomplete: false
},
{
field: 'update_time',
title: __('Update_time'),
operate: 'RANGE',
operate: false,
addclass: 'datetimerange',
autocomplete: false
},
@ -266,7 +267,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
classname: 'btn btn-xs btn-info btn-editone',
dropdown: "更多",
visible: function (row) {
if (row.status != 60 && row.status != 70) {
if (Config.permissions.edit && row.status != 60 && row.status != 70) {
return true;
}
return false;
@ -284,6 +285,9 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
callback: function ($data) {
// console.log($data);
},
visible:function (row) {
return Config.permissions.copy;
},
dropdown: "更多"
},
@ -296,7 +300,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
icon: 'fa fa-add',
url: 'order/warning',
visible: function (row) {
if (row.status == 10) {
if (Config.permissions.warning && row.status == 10) {
return true;
}
return false;
@ -315,7 +319,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
return 'orders/dispatch/map?order_id=' + row.id;
},
visible: function (row) {
if (row.status == 10) {
if (Config.permissions.map && row.status == 10) {
return true;
}
return false;
@ -335,7 +339,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
return 'orders/dispatch/add?order_id=' + row.id;
},
visible: function (row) {
if (row.status == 10) {
if (Config.permissions.dispatch && row.status == 10) {
return true;
}
return false;
@ -366,7 +370,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
return false;
},
visible: function (row) {
if (row.status == 10) {
if (Config.permissions.reminder && row.status == 10) {
return true;
}
return false;
@ -392,7 +396,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
url: 'order/delete',
dropdown: "更多",
visible: function (row) {
if (row.status >= 0 && row.status < 60) {
if (Config.permissions.delete && row.status >= 0 && row.status < 60) {
return true;
}
return false;
@ -409,7 +413,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
refresh: true,
dropdown: "更多",
visible: function (row) {
if (row.status != 60 && row.status != 70) {
if (Config.permissions.addAbnormal && row.status != 60 && row.status != 70) {
return true;
}
return false;
@ -435,7 +439,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
dropdown: "更多",
visible: function (row) {
if (row.status == 60 || row.status == 70) {
if (Config.permissions.invoice && row.status == 60 || row.status == 70) {
return true;
}
return false;
@ -450,7 +454,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
url: 'aftersales/aftersale/add',
dropdown: "更多",
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 false;
@ -470,6 +474,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
//绑定tab事件
$('a[data-toggle="tab"]').on('show.bs.tab', function (event) {
let type = $(this).attr("data-value");
let options = table.bootstrapTable('getOptions');
$('.nav-tabs li').attr('class', '');
$(this).parent().attr("class", 'active');
@ -477,11 +482,16 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
if (cloneQueryParams == null) {
cloneQueryParams = options.queryParams;
}
options.queryParams = function (params) {
params.type = type;
return cloneQueryParams(params);
};
if (type == 1){
$("form.form-commonsearch [name='status']").val(10).trigger("change");
$("form.form-commonsearch [name='is_timeout']").val('').trigger("change");
}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', {});
return false;
});