sth
This commit is contained in:
parent
311e6f8b86
commit
1729d3cf8b
|
|
@ -59,10 +59,9 @@ class Dispatch extends Backend
|
|||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
|
||||
$row->btn_edit = (in_array($row->status,$this->model->btnActiveStatusList('btn_edit'))) ? true:false;
|
||||
$row->btn_cancel = (in_array($row->status,$this->model->btnActiveStatusList('btn_cancel'))) ? true:false;
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
|
|
|
|||
|
|
@ -1,67 +1,80 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Order_id' => '订单ID',
|
||||
'Type' => '派单方式',
|
||||
'Type 1' => '手动',
|
||||
'Worker_id' => '师傅ID',
|
||||
'Worker_name' => '师傅姓名',
|
||||
'Worker_tel' => '师傅电话',
|
||||
'Status' => '进度',
|
||||
'Status 0' => '待接单',
|
||||
'Set status to 0' => '设为待接单',
|
||||
'Status 1' => '进行中',
|
||||
'Set status to 1' => '设为进行中',
|
||||
'Status 10' => '已完成',
|
||||
'Set status to 10' => '设为已完成',
|
||||
'Is_notice' => '自动通知',
|
||||
'Is_notice 0' => '否',
|
||||
'Is_notice 1' => '是',
|
||||
'Finish_time' => '完成时间',
|
||||
'Admin_id' => '派单人ID',
|
||||
'Admin_user' => '派单人',
|
||||
'Create_time' => '派单时间',
|
||||
'Update_time' => '编辑时间',
|
||||
'Order.id' => 'ID',
|
||||
'Order.order_no' => '订单号',
|
||||
'Order.customer' => '客户姓名',
|
||||
'Order.tel' => '客户电话',
|
||||
'Order.status' => '订单状态',
|
||||
'Order.status 10' => '未派单',
|
||||
'Order.status 20' => '已派单',
|
||||
'Order.status 50' => '已完成',
|
||||
'Order.status -10' => '取消',
|
||||
'Order.status -20' => '作废',
|
||||
'Order.area_id' => '地域',
|
||||
'Order.address' => '详细地址',
|
||||
'Order.lng' => '经度',
|
||||
'Order.lat' => '纬度',
|
||||
'Order.work_tel_id' => '工作机',
|
||||
'Order.source_shop' => '来源店铺',
|
||||
'Order.source' => '订单来源',
|
||||
'Order.source_uid' => '来源UID',
|
||||
'Order.item_id' => '服务ID',
|
||||
'Order.item_title' => '服务名称',
|
||||
'Order.detail' => '订单详情',
|
||||
'Order.remark' => '订单备注',
|
||||
'Order.images' => '图片',
|
||||
'Order.plan_time' => '客户预约时间',
|
||||
'Order.collect' => '是否收藏',
|
||||
'Order.collect 0' => '否',
|
||||
'Order.collect 1' => '是',
|
||||
'Order.collect_remark' => '收藏备注',
|
||||
'Order.admin_id' => '录单员ID',
|
||||
'Order.total' => '总收款',
|
||||
'Order.cost' => '成本',
|
||||
'Order.performance' => '绩效',
|
||||
'Order.sb_amount' => '垫付',
|
||||
'Order.real_amount' => '实付',
|
||||
'Order.cancel_reason_id' => '取消原因',
|
||||
'Order.cancel_detail' => '取消详情',
|
||||
'Order.abolish_reason_id' => '作废原因',
|
||||
'Order.abolish_detail' => '作废详情',
|
||||
'Order.create_time' => '录单时间',
|
||||
'Order.update_time' => '更新时间',
|
||||
'Order.delete_time' => '删除时间'
|
||||
'Id' => 'ID',
|
||||
'Order_id' => '订单ID',
|
||||
'Type' => '派单方式',
|
||||
'Type 1' => '手动',
|
||||
'Worker_id' => '师傅ID',
|
||||
'Worker_name' => '师傅姓名',
|
||||
'Worker_tel' => '师傅电话',
|
||||
'Status' => '进度',
|
||||
'Status 0' => '待接单',
|
||||
'Set status to 0' => '设为待接单',
|
||||
'Status 10' => '已接单',
|
||||
'Set status to 10' => '设为已接单',
|
||||
'Status 20' => '已预约',
|
||||
'Set status to 20' => '设为已预约',
|
||||
'Status 30' => '已打卡',
|
||||
'Set status to 30' => '设为已打卡',
|
||||
'Status 60' => '已完成',
|
||||
'Set status to 60' => '设为已完成',
|
||||
'Status -10' => '已拒接',
|
||||
'Set status to -10' => '设为已拒接',
|
||||
'Status -20' => '已移交',
|
||||
'Set status to -20' => '设为已移交',
|
||||
'Status -30' => '已取消',
|
||||
'Set status to -30' => '设为已取消',
|
||||
'Remark' => '备注',
|
||||
'Notice_num' => '通知次数',
|
||||
'Plan_time' => '预约时间',
|
||||
'Finish_time' => '完成时间',
|
||||
'Admin_id' => '派单人ID',
|
||||
'Admin_user' => '派单人',
|
||||
'Create_time' => '派单时间',
|
||||
'Update_time' => '编辑时间',
|
||||
'Order.id' => 'ID',
|
||||
'Order.order_no' => '订单号',
|
||||
'Order.customer' => '客户姓名',
|
||||
'Order.tel' => '客户电话',
|
||||
'Order.status' => '订单状态',
|
||||
'Order.status 10' => '未派单',
|
||||
'Order.status 20' => '已派单',
|
||||
'Order.status 30' => '进行中',
|
||||
'Order.status 40' => '待验收',
|
||||
'Order.status 41' => '审核驳回',
|
||||
'Order.status 50' => '待财务审核',
|
||||
'Order.status 60' => '已完成',
|
||||
'Order.status -10' => '取消',
|
||||
'Order.area_id' => '地域',
|
||||
'Order.address' => '详细地址',
|
||||
'Order.lng' => '经度',
|
||||
'Order.lat' => '纬度',
|
||||
'Order.work_tel_id' => '工作机',
|
||||
'Order.source_shop' => '来源店铺',
|
||||
'Order.source' => '订单来源',
|
||||
'Order.source_uid' => '来源UID',
|
||||
'Order.item_id' => '服务ID',
|
||||
'Order.item_title' => '服务名称',
|
||||
'Order.detail' => '订单详情',
|
||||
'Order.remark' => '订单备注',
|
||||
'Order.images' => '图片',
|
||||
'Order.plan_time' => '客户预约时间',
|
||||
'Order.admin_id' => '录单员ID',
|
||||
'Order.coupon_id' => '优惠码id',
|
||||
'Order.total' => '总收款',
|
||||
'Order.online_amount' => '线上收款',
|
||||
'Order.offline_amount' => '线下收款',
|
||||
'Order.discount_amount' => '优惠抵扣',
|
||||
'Order.refund_amount' => '总退款额',
|
||||
'Order.real_amount' => '实际收款',
|
||||
'Order.cost' => '师傅成本',
|
||||
'Order.performance' => '预计利润',
|
||||
'Order.cancel_reason_id' => '取消原因',
|
||||
'Order.cancel_detail' => '取消详情',
|
||||
'Order.audit_remark' => '审核备注',
|
||||
'Order.audit_admin_id' => '审核员',
|
||||
'Order.create_time' => '录单时间',
|
||||
'Order.update_time' => '更新时间',
|
||||
'Order.delete_time' => '删除时间'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -30,7 +30,15 @@ class OrderDispatch extends Model
|
|||
'status_text',
|
||||
'is_notice_text'
|
||||
];
|
||||
|
||||
|
||||
const STATUS_TOGET = 0; //待接
|
||||
const STATUS_GOTIT = 10; //已接
|
||||
const STATUS_PLANIT = 20; //已预约
|
||||
const STATUS_CLOCK = 30; //已打卡
|
||||
const STATUS_FINISH = 60; //完成
|
||||
const STATUS_REFUSED = -10; //拒绝
|
||||
const STATUS_MOVE = -20; //中转
|
||||
const STATUS_CANCEL = -20; //取消
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
|
|
@ -40,9 +48,7 @@ class OrderDispatch extends Model
|
|||
|
||||
public function getStatusList()
|
||||
{
|
||||
//return ['0' => __('Status 0'), '1' => __('Status 1'), '10' => __('Status 10')];
|
||||
|
||||
return [ '1' => __('Status 1'), '10' => __('Status 10')];
|
||||
return ['0' => __('Status 0'), '10' => __('Status 10'), '20' => __('Status 20'), '30' => __('Status 30'), '60' => __('Status 60'), '-10' => __('Status -10'), '-20' => __('Status -20'), '-30' => __('Status -30')];
|
||||
}
|
||||
|
||||
public function getIsNoticeList()
|
||||
|
|
@ -81,4 +87,23 @@ class OrderDispatch extends Model
|
|||
{
|
||||
return $this->belongsTo('Order', 'order_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function btnActiveStatusList($btn){
|
||||
|
||||
return [
|
||||
'btn_edit' => [
|
||||
self::STATUS_TOGET,
|
||||
self::STATUS_GOTIT,
|
||||
self::STATUS_PLANIT,
|
||||
self::STATUS_CLOCK,
|
||||
],
|
||||
'btn_cancel' => [ //取消按钮
|
||||
self::STATUS_TOGET,
|
||||
self::STATUS_GOTIT,
|
||||
self::STATUS_PLANIT,
|
||||
self::STATUS_CLOCK,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1')}, formatter: Table.api.formatter.normal},
|
||||
|
||||
|
||||
{field: 'order.source_shop', title: __('Order.source_shop'), operate: 'LIKE'},
|
||||
{field: 'order.source', title: __('Order.source')},
|
||||
{field: 'order.customer', title: __('Order.customer'), operate: 'LIKE'},
|
||||
|
|
@ -48,18 +49,54 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'order.detail', title: __('Order.detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
{field: 'order.images', title: __('Order.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
||||
{field: 'order.plan_time', title: __('Order.plan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"10":__('Status 10')}, formatter: Table.api.formatter.status},
|
||||
// {field: 'is_notice', title: __('Is_notice'), searchList: {"0":__('Is_notice 0'),"1":__('Is_notice 1')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"60":__('Status 60'),"-10":__('Status -10'),"-20":__('Status -20'),"-30":__('Status -30')}, formatter: Table.api.formatter.status},
|
||||
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
{field: 'plan_time', title: __('Plan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
// {field: 'is_notice', title: __('Is_notice'), searchList: {"0":__('Is_notice 0'),"1":__('Is_notice 1')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'finish_time', title: __('Finish_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
// {field: 'admin_id', title: __('Admin_id')},
|
||||
{field: 'admin_user', title: __('Admin_user'), operate: 'LIKE'},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
text:"修改",
|
||||
title:"修改",
|
||||
icon: 'fa fa-pencil',
|
||||
//title: __('Edit'),
|
||||
extend: 'data-toggle="tooltip" data-container="body"',
|
||||
classname: 'btn btn-xs btn-success btn-editone',
|
||||
visible:function(row){
|
||||
if(row.btn_edit){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
text:"取消",
|
||||
title:"取消",
|
||||
icon: 'fa fa-trash',
|
||||
//title: __('Del'),
|
||||
extend: 'data-toggle="tooltip" data-container="body"',
|
||||
classname: 'btn btn-xs btn-danger btn-delone',
|
||||
visible:function(row){
|
||||
if(row.btn_cancel){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user