From bd66abc4a2163281ff210d6296cb75c9807ead90 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 4 Mar 2025 16:08:54 +0800 Subject: [PATCH 1/3] css --- .../admin/controller/finances/Auditorder.php | 71 +++++++ .../admin/lang/zh-cn/finances/auditorder.php | 65 ++++++ application/admin/lang/zh-cn/order.php | 2 +- application/admin/model/Order.php | 12 +- application/admin/validate/Auditorder.php | 27 +++ .../admin/view/finances/auditorder/add.html | 191 ++++++++++++++++++ .../admin/view/finances/auditorder/edit.html | 191 ++++++++++++++++++ .../admin/view/finances/auditorder/index.html | 46 +++++ application/admin/view/order/index.html | 3 +- application/admin/view/order/recyclebin.html | 25 +++ .../assets/js/backend/finances/auditorder.js | 96 +++++++++ public/assets/js/backend/orders/income.js | 4 +- 12 files changed, 724 insertions(+), 9 deletions(-) create mode 100644 application/admin/controller/finances/Auditorder.php create mode 100644 application/admin/lang/zh-cn/finances/auditorder.php create mode 100644 application/admin/validate/Auditorder.php create mode 100644 application/admin/view/finances/auditorder/add.html create mode 100644 application/admin/view/finances/auditorder/edit.html create mode 100644 application/admin/view/finances/auditorder/index.html create mode 100644 application/admin/view/order/recyclebin.html create mode 100644 public/assets/js/backend/finances/auditorder.js diff --git a/application/admin/controller/finances/Auditorder.php b/application/admin/controller/finances/Auditorder.php new file mode 100644 index 0000000..3f5b013 --- /dev/null +++ b/application/admin/controller/finances/Auditorder.php @@ -0,0 +1,71 @@ +model = new \app\admin\model\Order; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['admin']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/lang/zh-cn/finances/auditorder.php b/application/admin/lang/zh-cn/finances/auditorder.php new file mode 100644 index 0000000..4b399ee --- /dev/null +++ b/application/admin/lang/zh-cn/finances/auditorder.php @@ -0,0 +1,65 @@ + 'ID', + 'Order_no' => '订单号', + 'Customer' => '客户姓名', + 'Tel' => '客户电话', + 'Status' => '订单状态', + 'Status 10' => '未派单', + 'Set status to 10' => '设为未派单', + 'Status 20' => '已派单', + 'Set status to 20' => '设为已派单', + 'Status 30' => '进行中', + 'Set status to 30' => '设为进行中', + 'Status 40' => '待验收', + 'Set status to 40' => '设为待验收', + 'Status 41' => '审核驳回', + 'Set status to 41' => '设为审核驳回', + 'Status 50' => '待财务审核', + 'Set status to 50' => '设为待财务审核', + 'Status 60' => '已完成', + 'Set status to 60' => '设为已完成', + 'Status -10' => '取消', + 'Set status to -10' => '设为取消', + 'Area_id' => '地域', + 'Address' => '详细地址', + 'Lng' => '经度', + 'Lat' => '纬度', + 'Work_tel_id' => '工作机', + 'Source_shop' => '来源店铺', + 'Source' => '订单来源', + 'Source_uid' => '来源UID', + 'Item_id' => '服务ID', + 'Item_title' => '服务名称', + 'Detail' => '订单详情', + 'Remark' => '订单备注', + 'Images' => '图片', + 'Plan_time' => '客户预约时间', + 'Admin_id' => '录单员ID', + 'Total' => '总收款', + 'Cost' => '师傅成本', + 'Performance' => '预计利润', + 'Cancel_reason_id' => '取消原因', + 'Cancel_detail' => '取消详情', + 'Audit_remark' => '审核备注', + 'Audit_admin_id' => '审核员', + 'Create_time' => '录单时间', + 'Update_time' => '更新时间', + 'Delete_time' => '删除时间', + 'Admin.id' => 'ID', + 'Admin.username' => '用户名', + 'Admin.nickname' => '昵称', + 'Admin.password' => '密码', + 'Admin.salt' => '密码盐', + 'Admin.avatar' => '头像', + 'Admin.email' => '电子邮箱', + 'Admin.mobile' => '手机号码', + 'Admin.loginfailure' => '失败次数', + 'Admin.logintime' => '登录时间', + 'Admin.loginip' => '登录IP', + 'Admin.createtime' => '创建时间', + 'Admin.updatetime' => '更新时间', + 'Admin.token' => 'Session标识', + 'Admin.status' => '状态' +]; diff --git a/application/admin/lang/zh-cn/order.php b/application/admin/lang/zh-cn/order.php index 1e36e21..97855d0 100644 --- a/application/admin/lang/zh-cn/order.php +++ b/application/admin/lang/zh-cn/order.php @@ -45,7 +45,7 @@ return [ 'Dispatch_type 20' => '线下', 'Total' => '总收款', 'Cost' => '成本', - 'Performance' => '绩效', + 'Performance' => '利润', 'Sb_amount' => '垫付', 'Real_amount' => '实付', 'Cancel_reason_id' => '取消原因', diff --git a/application/admin/model/Order.php b/application/admin/model/Order.php index dca32ee..a13734a 100644 --- a/application/admin/model/Order.php +++ b/application/admin/model/Order.php @@ -3,25 +3,27 @@ namespace app\admin\model; use think\Model; +use traits\model\SoftDelete; class Order extends Model { - + use SoftDelete; // 表名 protected $name = 'order'; // 自动写入时间戳字段 - protected $autoWriteTimestamp = false; + protected $autoWriteTimestamp = 'datetime'; + protected $dateFormat = 'Y-m-d H:i:s'; // 定义时间戳字段名 - protected $createTime = false; - protected $updateTime = false; - protected $deleteTime = false; + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; // 追加属性 protected $append = [ diff --git a/application/admin/validate/Auditorder.php b/application/admin/validate/Auditorder.php new file mode 100644 index 0000000..e5f89a8 --- /dev/null +++ b/application/admin/validate/Auditorder.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/finances/auditorder/add.html b/application/admin/view/finances/auditorder/add.html new file mode 100644 index 0000000..1738e81 --- /dev/null +++ b/application/admin/view/finances/auditorder/add.html @@ -0,0 +1,191 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    diff --git a/application/admin/view/finances/auditorder/edit.html b/application/admin/view/finances/auditorder/edit.html new file mode 100644 index 0000000..e77a6c5 --- /dev/null +++ b/application/admin/view/finances/auditorder/edit.html @@ -0,0 +1,191 @@ +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    + {foreach name="statusList" item="vo"} + + {/foreach} +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + + +
    + +
    +
      +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      + +
      diff --git a/application/admin/view/finances/auditorder/index.html b/application/admin/view/finances/auditorder/index.html new file mode 100644 index 0000000..2b53945 --- /dev/null +++ b/application/admin/view/finances/auditorder/index.html @@ -0,0 +1,46 @@ +
      + +
      + {:build_heading(null,FALSE)} + +
      + + +
      +
      +
      +
      +
      + + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + +
      + +
      +
      +
      + +
      +
      +
      diff --git a/application/admin/view/order/index.html b/application/admin/view/order/index.html index ef078d8..6e0a345 100644 --- a/application/admin/view/order/index.html +++ b/application/admin/view/order/index.html @@ -20,7 +20,8 @@ - + {:__('Recycle bin')} + + {:build_heading()} + +
      +
      +
      +
      + + + + + + diff --git a/public/assets/js/backend/finances/auditorder.js b/public/assets/js/backend/finances/auditorder.js new file mode 100644 index 0000000..ae99dc6 --- /dev/null +++ b/public/assets/js/backend/finances/auditorder.js @@ -0,0 +1,96 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'finances/auditorder/index' + location.search, + add_url: 'finances/auditorder/add', + edit_url: 'finances/auditorder/edit', + del_url: 'finances/auditorder/del', + multi_url: 'finances/auditorder/multi', + import_url: 'finances/auditorder/import', + table: 'order', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, + {field: 'customer', title: __('Customer'), operate: 'LIKE'}, + {field: 'tel', title: __('Tel'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"40":__('Status 40'),"41":__('Status 41'),"50":__('Status 50'),"60":__('Status 60'),"-10":__('Status -10')}, formatter: Table.api.formatter.status}, + {field: 'area_id', title: __('Area_id')}, + {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'lng', title: __('Lng'), operate:'BETWEEN'}, + {field: 'lat', title: __('Lat'), operate:'BETWEEN'}, + {field: 'work_tel_id', title: __('Work_tel_id')}, + {field: 'source_shop', title: __('Source_shop'), operate: 'LIKE'}, + {field: 'source', title: __('Source')}, + {field: 'source_uid', title: __('Source_uid'), operate: 'LIKE'}, + {field: 'item_id', title: __('Item_id')}, + {field: 'item_title', title: __('Item_title'), operate: 'LIKE'}, + {field: 'detail', title: __('Detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, + {field: 'plan_time', title: __('Plan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'admin_id', title: __('Admin_id')}, + {field: 'total', title: __('Total'), operate:'BETWEEN'}, + {field: 'cost', title: __('Cost'), operate:'BETWEEN'}, + {field: 'performance', title: __('Performance'), operate:'BETWEEN'}, + {field: 'cancel_reason_id', title: __('Cancel_reason_id')}, + {field: 'cancel_detail', title: __('Cancel_detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'audit_remark', title: __('Audit_remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'audit_admin_id', title: __('Audit_admin_id')}, + {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: 'delete_time', title: __('Delete_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'admin.id', title: __('Admin.id')}, + {field: 'admin.username', title: __('Admin.username'), operate: 'LIKE'}, + {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, + {field: 'admin.password', title: __('Admin.password'), operate: 'LIKE'}, + {field: 'admin.salt', title: __('Admin.salt'), operate: 'LIKE'}, + {field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'admin.email', title: __('Admin.email'), operate: 'LIKE'}, + {field: 'admin.mobile', title: __('Admin.mobile'), operate: 'LIKE'}, + {field: 'admin.loginfailure', title: __('Admin.loginfailure')}, + {field: 'admin.logintime', title: __('Admin.logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'admin.loginip', title: __('Admin.loginip'), operate: 'LIKE'}, + {field: 'admin.createtime', title: __('Admin.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'admin.updatetime', title: __('Admin.updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'admin.token', title: __('Admin.token'), operate: 'LIKE'}, + {field: 'admin.status', title: __('Admin.status'), operate: 'LIKE', formatter: Table.api.formatter.status}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/orders/income.js b/public/assets/js/backend/orders/income.js index c0f300b..adddabc 100644 --- a/public/assets/js/backend/orders/income.js +++ b/public/assets/js/backend/orders/income.js @@ -39,8 +39,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'payment_time', title: __('Payment_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'image', title: __('凭证'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false}, {field: 'remark', title: __('备注'), operate: false}, - {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1')}, formatter: Table.api.formatter.status}, - {field: 'audit_remark', title: __('审核备注'), operate: false}, + //{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1')}, formatter: Table.api.formatter.status}, + //{field: 'audit_remark', title: __('审核备注'), operate: 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}, From 21f866d2868532d47884a303c16fbf221024eac9 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 5 Mar 2025 17:06:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BD=9C=E7=94=A8=E5=9F=9F=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/finances/Auditorder.php | 2 ++ application/admin/lang/zh-cn/order.php | 34 +++++++++---------- application/admin/model/Order.php | 31 ++++++++++++++--- 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/application/admin/controller/finances/Auditorder.php b/application/admin/controller/finances/Auditorder.php index 3f5b013..2da9da8 100644 --- a/application/admin/controller/finances/Auditorder.php +++ b/application/admin/controller/finances/Auditorder.php @@ -2,6 +2,7 @@ namespace app\admin\controller\finances; +use app\admin\model\Order; use app\common\controller\Backend; /** @@ -51,6 +52,7 @@ class Auditorder extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model + ->scope('tag',Order::TAB_AUDIT) ->with(['admin']) ->where($where) ->order($sort, $order) diff --git a/application/admin/lang/zh-cn/order.php b/application/admin/lang/zh-cn/order.php index 97855d0..23ce16d 100644 --- a/application/admin/lang/zh-cn/order.php +++ b/application/admin/lang/zh-cn/order.php @@ -5,23 +5,23 @@ return [ 'Order_no' => '订单号', 'Customer' => '客户姓名', 'Tel' => '客户电话', - 'Status' => '订单状态', - 'Status 10' => '未派单', - 'Set status to 10' => '设为未派单', - 'Status 20' => '已派单', - 'Set status to 20' => '设为已派单', - 'Status 30' => '已接单', - 'Set status to 30' => '设为已接单', - 'Status 40' => '处理中', - 'Set status to 40' => '设为处理中', - 'Status 50' => '已完成', - 'Set status to 50' => '设为已完成', - 'Status -10' => '取消', - 'Set status to -10' => '设为取消', - 'Status -20' => '作废', - 'Set status to -20' => '设为作废', - 'Status -30' => '已拒接', - 'Set status to -30' => '设为已拒接', + 'Status' => '订单状态', + 'Status 10' => '未派单', + 'Set status to 10' => '设为未派单', + 'Status 20' => '已派单', + 'Set status to 20' => '设为已派单', + 'Status 30' => '进行中', + 'Set status to 30' => '设为进行中', + 'Status 40' => '待验收', + 'Set status to 40' => '设为待验收', + 'Status 41' => '审核驳回', + 'Set status to 41' => '设为审核驳回', + 'Status 50' => '待财务审核', + 'Set status to 50' => '设为待财务审核', + 'Status 60' => '已完成', + 'Set status to 60' => '设为已完成', + 'Status -10' => '取消', + 'Set status to -10' => '设为取消', 'Area_id' => '地域', 'Address' => '详细地址', 'Work_tel_id' => '工作机', diff --git a/application/admin/model/Order.php b/application/admin/model/Order.php index a13734a..67c5b39 100644 --- a/application/admin/model/Order.php +++ b/application/admin/model/Order.php @@ -31,12 +31,20 @@ class Order extends Model 'collect_text', 'dispatch_type_text' ]; - - + + const TAB_DISPATCH = 'dispatch'; //派单 + + const TAB_PENDING = 'pending'; //跟进中 + + const TAB_AUDIT = 'audit'; //审核 + + const TAB_REVIEW = 'review'; //回访 + + public function getStatusList() { - return ['10' => __('Status 10'), '20' => __('Status 20'), '30' => __('Status 30'), '40' => __('Status 40'), '50' => __('Status 50'), '-10' => __('Status -10'), '-20' => __('Status -20'), '-30' => __('Status -30')]; + return ['10' => __('Status 10'), '20' => __('Status 20'), '30' => __('Status 30'), '40' => __('Status 40'), '41' => __('Status 41'), '50' => __('Status 50'), '60' => __('Status 60'), '-10' => __('Status -10')]; } public function getCollectList() @@ -74,6 +82,21 @@ class Order extends Model } + protected function scopeTab($query, $tab=null) + { + $status = $this->tabStatus($tab); + if(!empty($status)){ + $query->whereIn('order.status', $status); + } + } - + private function tabStatus($tab){ + $tabStatus = [ + self::TAB_DISPATCH => [10], //派单管理状态 + self::TAB_PENDING => [20,30,40,41], //订单跟进状态 + self::TAB_AUDIT => [50], //待审核 + self::TAB_REVIEW => [60], + ]; + return $tabStatus[$tab] ?? []; + } } From 4e429931144733986ba257192780ded9936fda3e Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 5 Mar 2025 17:18:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=9E=E8=AE=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/orders/Revisitorder.php | 69 +++++++ .../admin/lang/zh-cn/orders/revisitorder.php | 50 +++++ application/admin/validate/Revisitorder.php | 27 +++ .../admin/view/orders/revisitorder/add.html | 191 ++++++++++++++++++ .../admin/view/orders/revisitorder/edit.html | 191 ++++++++++++++++++ .../admin/view/orders/revisitorder/index.html | 46 +++++ .../assets/js/backend/orders/revisitorder.js | 81 ++++++++ 7 files changed, 655 insertions(+) create mode 100644 application/admin/controller/orders/Revisitorder.php create mode 100644 application/admin/lang/zh-cn/orders/revisitorder.php create mode 100644 application/admin/validate/Revisitorder.php create mode 100644 application/admin/view/orders/revisitorder/add.html create mode 100644 application/admin/view/orders/revisitorder/edit.html create mode 100644 application/admin/view/orders/revisitorder/index.html create mode 100644 public/assets/js/backend/orders/revisitorder.js diff --git a/application/admin/controller/orders/Revisitorder.php b/application/admin/controller/orders/Revisitorder.php new file mode 100644 index 0000000..66004e9 --- /dev/null +++ b/application/admin/controller/orders/Revisitorder.php @@ -0,0 +1,69 @@ +model = new Order(); + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + * + * @return string|Json + * @throws \think\Exception + * @throws DbException + */ + public function index() + { + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if (false === $this->request->isAjax()) { + return $this->view->fetch(); + } + //如果发送的来源是 Selectpage,则转发到 Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + [$where, $sort, $order, $offset, $limit] = $this->buildparams(); + $list = $this->model + ->scope('tag',Order::TAB_REVIEW) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + $result = ['total' => $list->total(), 'rows' => $list->items()]; + return json($result); + } + + +} diff --git a/application/admin/lang/zh-cn/orders/revisitorder.php b/application/admin/lang/zh-cn/orders/revisitorder.php new file mode 100644 index 0000000..0888265 --- /dev/null +++ b/application/admin/lang/zh-cn/orders/revisitorder.php @@ -0,0 +1,50 @@ + 'ID', + 'Order_no' => '订单号', + 'Customer' => '客户姓名', + 'Tel' => '客户电话', + 'Status' => '订单状态', + 'Status 10' => '未派单', + 'Set status to 10' => '设为未派单', + 'Status 20' => '已派单', + 'Set status to 20' => '设为已派单', + 'Status 30' => '进行中', + 'Set status to 30' => '设为进行中', + 'Status 40' => '待验收', + 'Set status to 40' => '设为待验收', + 'Status 41' => '审核驳回', + 'Set status to 41' => '设为审核驳回', + 'Status 50' => '待财务审核', + 'Set status to 50' => '设为待财务审核', + 'Status 60' => '已完成', + 'Set status to 60' => '设为已完成', + 'Status -10' => '取消', + 'Set status to -10'=> '设为取消', + 'Area_id' => '地域', + 'Address' => '详细地址', + 'Lng' => '经度', + 'Lat' => '纬度', + 'Work_tel_id' => '工作机', + 'Source_shop' => '来源店铺', + 'Source' => '订单来源', + 'Source_uid' => '来源UID', + 'Item_id' => '服务ID', + 'Item_title' => '服务名称', + 'Detail' => '订单详情', + 'Remark' => '订单备注', + 'Images' => '图片', + 'Plan_time' => '客户预约时间', + 'Admin_id' => '录单员ID', + 'Total' => '总收款', + 'Cost' => '师傅成本', + 'Performance' => '预计利润', + 'Cancel_reason_id' => '取消原因', + 'Cancel_detail' => '取消详情', + 'Audit_remark' => '审核备注', + 'Audit_admin_id' => '审核员', + 'Create_time' => '录单时间', + 'Update_time' => '更新时间', + 'Delete_time' => '删除时间' +]; diff --git a/application/admin/validate/Revisitorder.php b/application/admin/validate/Revisitorder.php new file mode 100644 index 0000000..168ad3e --- /dev/null +++ b/application/admin/validate/Revisitorder.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/orders/revisitorder/add.html b/application/admin/view/orders/revisitorder/add.html new file mode 100644 index 0000000..0319abc --- /dev/null +++ b/application/admin/view/orders/revisitorder/add.html @@ -0,0 +1,191 @@ +
      + +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      + {foreach name="statusList" item="vo"} + + {/foreach} +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      +
      + +
      + + +
      + +
      +
        +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        + +
        diff --git a/application/admin/view/orders/revisitorder/edit.html b/application/admin/view/orders/revisitorder/edit.html new file mode 100644 index 0000000..a800617 --- /dev/null +++ b/application/admin/view/orders/revisitorder/edit.html @@ -0,0 +1,191 @@ +
        + +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        + {foreach name="statusList" item="vo"} + + {/foreach} +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        +
        + +
        + + +
        + +
        +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          + +
          diff --git a/application/admin/view/orders/revisitorder/index.html b/application/admin/view/orders/revisitorder/index.html new file mode 100644 index 0000000..eb2b5e5 --- /dev/null +++ b/application/admin/view/orders/revisitorder/index.html @@ -0,0 +1,46 @@ +
          + +
          + {:build_heading(null,FALSE)} + +
          + + +
          +
          +
          +
          +
          + + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + +
          + +
          +
          +
          + +
          +
          +
          diff --git a/public/assets/js/backend/orders/revisitorder.js b/public/assets/js/backend/orders/revisitorder.js new file mode 100644 index 0000000..d38fbdc --- /dev/null +++ b/public/assets/js/backend/orders/revisitorder.js @@ -0,0 +1,81 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'orders/revisitorder/index' + location.search, + add_url: 'orders/revisitorder/add', + edit_url: 'orders/revisitorder/edit', + del_url: 'orders/revisitorder/del', + multi_url: 'orders/revisitorder/multi', + import_url: 'orders/revisitorder/import', + table: 'order', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, + {field: 'customer', title: __('Customer'), operate: 'LIKE'}, + {field: 'tel', title: __('Tel'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"40":__('Status 40'),"41":__('Status 41'),"50":__('Status 50'),"60":__('Status 60'),"-10":__('Status -10')}, formatter: Table.api.formatter.status}, + {field: 'area_id', title: __('Area_id')}, + {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'lng', title: __('Lng'), operate:'BETWEEN'}, + {field: 'lat', title: __('Lat'), operate:'BETWEEN'}, + {field: 'work_tel_id', title: __('Work_tel_id')}, + {field: 'source_shop', title: __('Source_shop'), operate: 'LIKE'}, + {field: 'source', title: __('Source')}, + {field: 'source_uid', title: __('Source_uid'), operate: 'LIKE'}, + {field: 'item_id', title: __('Item_id')}, + {field: 'item_title', title: __('Item_title'), operate: 'LIKE'}, + {field: 'detail', title: __('Detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, + {field: 'plan_time', title: __('Plan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'admin_id', title: __('Admin_id')}, + {field: 'total', title: __('Total'), operate:'BETWEEN'}, + {field: 'cost', title: __('Cost'), operate:'BETWEEN'}, + {field: 'performance', title: __('Performance'), operate:'BETWEEN'}, + {field: 'cancel_reason_id', title: __('Cancel_reason_id')}, + {field: 'cancel_detail', title: __('Cancel_detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'audit_remark', title: __('Audit_remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'audit_admin_id', title: __('Audit_admin_id')}, + {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: 'delete_time', title: __('Delete_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +});