diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php
index 1bdb6fb..e5134b2 100644
--- a/application/admin/controller/Order.php
+++ b/application/admin/controller/Order.php
@@ -157,6 +157,7 @@ class Order extends Backend
$filter = (array)json_decode(input()['filter'] ?? '', true);
$admin_filter = $filter['user.nickname'] ?? false;
$area_id = $filter['area_id'] ?? false;
+ $item_id = $filter['item_id'] ?? false;
$is_timeout = $filter['is_timeout'] ?? null;
// dd($create_time,$filter);
if ($admin_filter) {
@@ -166,6 +167,11 @@ class Order extends Backend
if ($area_id) {
$build->where('area_id', 'like', $this->getSelectAreaCode($area_id) . '%');
}
+ if ($item_id) {
+ $item_ids = $this->getItemsById($item_id);
+ $item_ids [] = $item_id;
+ $build->whereIn('item_id', $item_ids);
+ }
if (!is_null($is_timeout)) {
if ($is_timeout == 1){
$build->where('status', '>=', \app\admin\model\Order::STATUS_DISPATCHING)
@@ -817,29 +823,11 @@ class Order extends Backend
$this->request->get([config('paginate.var_page') => $page]);
$filter = (array)json_decode($filter, true);
+ unset($filter['item_id']);
-
- $province_id = $filter['province_id']??null;
- $city_id = $filter['city_id']??null;
- $area_id = $filter['city_id']??null;
- unset($filter['city_id']);
- unset($filter['province_id']);
unset($filter['area_id']);
- if(!empty($area_id)){
- $filter['area_id'] = $area_id;
- }else{
- if(!empty($city_id)){
- $filter['area_id'] = $city_id;
- }else{
- if(!empty($province_id)){
- $filter['area_id'] = $province_id;
- }
- }
- }
- $op = (array)json_decode($op, true);
- $op['area_id'] = 'LIKE%';
$filter = $filter ? $filter : [];
$where = [];
$alias = [];
diff --git a/application/admin/controller/aftersales/Aftersale2.php b/application/admin/controller/aftersales/Aftersale2.php
index 7c5e1a3..341e8cb 100644
--- a/application/admin/controller/aftersales/Aftersale2.php
+++ b/application/admin/controller/aftersales/Aftersale2.php
@@ -12,6 +12,7 @@ use think\Db;
use think\exception\DbException;
use think\exception\PDOException;
use think\exception\ValidateException;
+use think\Loader;
/**
* 待退款列表
@@ -69,11 +70,29 @@ class Aftersale2 extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $filter = (array)json_decode(input()['filter'] ?? '', true);
+
+ $area_id = $filter['area_id'] ?? request()->get('area_id') ?? false;
+ $item_id = $filter['item_id'] ?? request()->get('item_id') ?? false;
+
$builder = $this->model
->whereIn('fa_aftersale.status',[3,4])
->with(['order'])
->where($where);
+
+ if ($area_id) {
+ $builder->where('area_id', 'like', $this->getSelectAreaCode($area_id) . '%');
+ }
+
+
+ if ($item_id) {
+ $item_ids = $this->getItemsById($item_id);
+ $item_ids [] = $item_id;
+ $builder->whereIn('item_id', $item_ids);
+ }
+
if($from == 2){
//$builder->where('refund_amount','>',0);
//$builder->where('status','<>',-1);
@@ -102,6 +121,200 @@ class Aftersale2 extends Backend
return $this->view->fetch();
}
+ protected function buildparams($searchfields = null, $relationSearch = null)
+ {
+ $searchfields = is_null($searchfields) ? $this->searchFields : $searchfields;
+ $relationSearch = is_null($relationSearch) ? $this->relationSearch : $relationSearch;
+ $search = $this->request->get("search", '');
+ $filter = $this->request->get("filter", '');
+ $op = $this->request->get("op", '', 'trim');
+ $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id');
+ $order = $this->request->get("order", "DESC");
+ $offset = max(0, $this->request->get("offset/d", 0));
+ $limit = max(0, $this->request->get("limit/d", 0));
+ $limit = $limit ?: 999999;
+ //新增自动计算页码
+ $page = $limit ? intval($offset / $limit) + 1 : 1;
+ if ($this->request->has("page")) {
+ $page = max(0, $this->request->get("page/d", 1));
+ }
+ $this->request->get([config('paginate.var_page') => $page]);
+ $filter = (array)json_decode($filter, true);
+
+
+ unset($filter['area_id']);
+ unset($filter['item_id']);
+
+
+
+ $op = (array)json_decode($op, true);
+ $filter = $filter ? $filter : [];
+ $where = [];
+ $alias = [];
+ $bind = [];
+ $name = '';
+ $aliasName = '';
+ if (!empty($this->model) && $relationSearch) {
+ $name = $this->model->getTable();
+ $alias[$name] = Loader::parseName(basename(str_replace('\\', '/', get_class($this->model))));
+ $aliasName = $alias[$name] . '.';
+ }
+ $sortArr = explode(',', $sort);
+ foreach ($sortArr as $index => & $item) {
+ $item = stripos($item, ".") === false ? $aliasName . trim($item) : $item;
+ }
+ unset($item);
+ $sort = implode(',', $sortArr);
+ $adminIds = $this->getDataLimitAdminIds();
+ if (is_array($adminIds)) {
+ $where[] = [$aliasName . $this->dataLimitField, 'in', $adminIds];
+ }
+ if ($search) {
+ $searcharr = is_array($searchfields) ? $searchfields : explode(',', $searchfields);
+ foreach ($searcharr as $k => &$v) {
+ $v = stripos($v, ".") === false ? $aliasName . $v : $v;
+ }
+ unset($v);
+ $where[] = [implode("|", $searcharr), "LIKE", "%{$search}%"];
+ }
+ $index = 0;
+ foreach ($filter as $k => $v) {
+ if (!preg_match('/^[a-zA-Z0-9_\-\.]+$/', $k)) {
+ continue;
+ }
+ $sym = $op[$k] ?? '=';
+ if (stripos($k, ".") === false) {
+ $k = $aliasName . $k;
+ }
+ $v = !is_array($v) ? trim($v) : $v;
+ $sym = strtoupper($op[$k] ?? $sym);
+ //null和空字符串特殊处理
+ if (!is_array($v)) {
+ if (in_array(strtoupper($v), ['NULL', 'NOT NULL'])) {
+ $sym = strtoupper($v);
+ }
+ if (in_array($v, ['""', "''"])) {
+ $v = '';
+ $sym = '=';
+ }
+ }
+
+ switch ($sym) {
+ case '=':
+ case '<>':
+ $where[] = [$k, $sym, (string)$v];
+ break;
+ case 'LIKE':
+ case 'NOT LIKE':
+ case 'LIKE %...%':
+ case 'NOT LIKE %...%':
+ $where[] = [$k, trim(str_replace('%...%', '', $sym)), "%{$v}%"];
+ break;
+ // ✅ 新增:右匹配(like%)
+ case 'LIKE%':
+ $where[] = [$k, 'LIKE', "{$v}%"];
+ break;
+
+ // ✅ 新增:左匹配(%like)
+ case '%LIKE':
+ $where[] = [$k, 'LIKE', "%{$v}"];
+ break;
+ case '>':
+ case '>=':
+ case '<':
+ case '<=':
+ $where[] = [$k, $sym, intval($v)];
+ break;
+ case 'FINDIN':
+ case 'FINDINSET':
+ case 'FIND_IN_SET':
+ $v = is_array($v) ? $v : explode(',', str_replace(' ', ',', $v));
+ $findArr = array_values($v);
+ foreach ($findArr as $idx => $item) {
+ $bindName = "item_" . $index . "_" . $idx;
+ $bind[$bindName] = $item;
+ $where[] = "FIND_IN_SET(:{$bindName}, `" . str_replace('.', '`.`', $k) . "`)";
+ }
+ break;
+ case 'IN':
+ case 'IN(...)':
+ case 'NOT IN':
+ case 'NOT IN(...)':
+ $where[] = [$k, str_replace('(...)', '', $sym), is_array($v) ? $v : explode(',', $v)];
+ break;
+ case 'BETWEEN':
+ case 'NOT BETWEEN':
+ $arr = array_slice(explode(',', $v), 0, 2);
+ if (stripos($v, ',') === false || !array_filter($arr, function ($v) {
+ return $v != '' && $v !== false && $v !== null;
+ })) {
+ continue 2;
+ }
+ //当出现一边为空时改变操作符
+ if ($arr[0] === '') {
+ $sym = $sym == 'BETWEEN' ? '<=' : '>';
+ $arr = $arr[1];
+ } elseif ($arr[1] === '') {
+ $sym = $sym == 'BETWEEN' ? '>=' : '<';
+ $arr = $arr[0];
+ }
+ $where[] = [$k, $sym, $arr];
+ break;
+ case 'RANGE':
+ case 'NOT RANGE':
+ $v = str_replace(' - ', ',', $v);
+ $arr = array_slice(explode(',', $v), 0, 2);
+ if (stripos($v, ',') === false || !array_filter($arr)) {
+ continue 2;
+ }
+ //当出现一边为空时改变操作符
+ if ($arr[0] === '') {
+ $sym = $sym == 'RANGE' ? '<=' : '>';
+ $arr = $arr[1];
+ } elseif ($arr[1] === '') {
+ $sym = $sym == 'RANGE' ? '>=' : '<';
+ $arr = $arr[0];
+ }
+ $tableArr = explode('.', $k);
+ if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias)
+ && !empty($this->model) && $this->relationSearch) {
+ //修复关联模型下时间无法搜索的BUG
+ $relation = Loader::parseName($tableArr[0], 1, false);
+ $alias[$this->model->$relation()->getTable()] = $tableArr[0];
+ }
+ $where[] = [$k, str_replace('RANGE', 'BETWEEN', $sym) . ' TIME', $arr];
+ break;
+ case 'NULL':
+ case 'IS NULL':
+ case 'NOT NULL':
+ case 'IS NOT NULL':
+ $where[] = [$k, strtolower(str_replace('IS ', '', $sym))];
+ break;
+ default:
+ break;
+ }
+ $index++;
+ }
+ if (!empty($this->model)) {
+ $this->model->alias($alias);
+ }
+ $model = $this->model;
+ $where = function ($query) use ($where, $alias, $bind, &$model) {
+ if (!empty($model)) {
+ $model->alias($alias);
+ $model->bind($bind);
+ }
+ foreach ($where as $k => $v) {
+ if (is_array($v)) {
+ call_user_func_array([$query, 'where'], $v);
+ } else {
+ $query->where($v);
+ }
+ }
+ };
+ return [$where, $sort, $order, $offset, $limit, $page, $alias, $bind];
+ }
+
/**
* 添加
*
diff --git a/application/admin/controller/statistics/Aftersale.php b/application/admin/controller/statistics/Aftersale.php
index 6fe008a..9dd9525 100644
--- a/application/admin/controller/statistics/Aftersale.php
+++ b/application/admin/controller/statistics/Aftersale.php
@@ -50,18 +50,12 @@ class Aftersale extends Backend
return $this->fetch('index');
}
- public function list()
- {
- $build = new Order();
-
- }
-
public function dispatch()
{
$build = new Admin();
$build->alias('a')
->join('order b', 'a.id = b.admin_id', 'right')
- ->join('aftersale c', 'b.id = c.admin_id', 'left')
+ ->join('aftersale c', 'a.id = c.refund_admin_id', 'left')
->where('b.status', Order::STATUS_FINISHED);
@@ -101,6 +95,7 @@ class Aftersale extends Backend
'a.mobile',
'count(b.id) order_total',
'count(c.id) after_total',
+ 'sum(c.refund_amount) refund_amount',
]
);
@@ -157,6 +152,7 @@ class Aftersale extends Backend
'a.area_id',
'count(a.id) order_total',
'count(c.id) after_total',
+ 'sum(c.refund_amount) refund_amount',
]
)->with([
'area' => function ($q) {
@@ -205,7 +201,7 @@ class Aftersale extends Backend
}
$build->where('audit_time', '>=', $start);
$build->where('audit_time', '<=', $end_at);
- $build->group('a.item_title');
+ $build->group('a.item_id,a.item_title');
@@ -217,9 +213,11 @@ class Aftersale extends Backend
$build->field(
[
+ 'a.item_id',
'a.item_title',
'count(a.id) order_total',
'count(c.id) after_total',
+ 'sum(c.refund_amount) refund_amount',
]
);
@@ -253,20 +251,13 @@ class Aftersale extends Backend
return $val;
}
- private function getItemsById(mixed $item_id)
- {
- $build = new \app\admin\model\Item();
- $data = $build->getAllData();
- return \app\admin\model\Item::getAllChildIds($data,$item_id);
- }
-
public function worker()
{
$build = new \app\admin\model\Worker();
$build->alias('a')
->join('order b', 'a.id = b.worker_id', 'right')
- ->join('aftersale c', 'b.id = c.admin_id', 'left')
+ ->join('aftersale c', 'a.id = c.worker_id', 'left')
->where('b.status', Order::STATUS_FINISHED);
@@ -306,6 +297,7 @@ class Aftersale extends Backend
'a.tel',
'count(b.id) order_total',
'count(c.id) after_total',
+ 'sum(c.refund_amount) refund_amount',
]
);
diff --git a/application/admin/view/aftersales/aftersale2/index.html b/application/admin/view/aftersales/aftersale2/index.html
index 138db65..ddf3449 100644
--- a/application/admin/view/aftersales/aftersale2/index.html
+++ b/application/admin/view/aftersales/aftersale2/index.html
@@ -34,3 +34,12 @@
+
+
diff --git a/application/admin/view/order/index.html b/application/admin/view/order/index.html
index 4e619fe..af0ab3f 100644
--- a/application/admin/view/order/index.html
+++ b/application/admin/view/order/index.html
@@ -41,7 +41,7 @@
-
+
-
+
+
+
diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php
index b226d8c..71d6d5e 100755
--- a/application/common/controller/Backend.php
+++ b/application/common/controller/Backend.php
@@ -723,4 +723,11 @@ class Backend extends Controller
// 重新索引数组
return array_values($filtered_codes);
}
+
+ public function getItemsById(mixed $item_id)
+ {
+ $build = new \app\admin\model\Item();
+ $data = $build->getAllData();
+ return \app\admin\model\Item::getAllChildIds($data,$item_id);
+ }
}
diff --git a/public/assets/js/backend/aftersales/aftersale2.js b/public/assets/js/backend/aftersales/aftersale2.js
index fcabd2b..362e176 100644
--- a/public/assets/js/backend/aftersales/aftersale2.js
+++ b/public/assets/js/backend/aftersales/aftersale2.js
@@ -57,9 +57,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'admin_user', title: __('Admin_user'), operate: '='},
//{field: 'handle_admin_id', title: __('Handle_admin_id')},
{field: 'handle_admin_user', title: __('Handle_admin_user'), operate: '='},
+ {field: 'worker_name', title: '师傅', operate: 'like'},
{field: 'star', title: __('Star'),operate:false},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'update_time', title: __('Update_time'), operate:false, addclass:'datetimerange', autocomplete:false},
+ {field: 'area_id', title: __('地区'), searchList: function (column) {
+ return Template('categorytpl', {});
+ }, formatter: function (value, row, index) {
+ return '无';
+ }, visible: false
+ },
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
@@ -82,7 +89,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
]
]
});
-
+ $("#select_city").on("cp:updated", function () {
+ var citypicker = $(this).data("citypicker");
+ var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province");
+ $("#select_area_id").val(code);
+ });
// 为表格绑定事件
Table.api.bindevent(table);
},
diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js
index d2678ff..8f311b3 100644
--- a/public/assets/js/backend/order.js
+++ b/public/assets/js/backend/order.js
@@ -217,6 +217,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
return '无';
}, visible: false
},
+ {field: 'item_id', title: '服务项目', searchList: function (column) {
+ return Template('items_picker', {});
+ }, formatter: function (value, row, index) {
+ return '无';
+ }, visible: false
+ },
{
field: 'operate',
@@ -463,6 +469,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
});
resetIdleTimer();
+
+
+ var _data = items;
+ $('#select_item').zdCascader({
+ data: _data,
+ onChange: function ($this, data, allPathData) {
+ // console.log(data,allPathData);
+ $('#select_item_id').val(data.value);
+ },
+ clear:true,
+ clickParent: true
+ });
+
},
add: function () {
$("#mybuttom").on("click", function () {
diff --git a/public/assets/js/backend/statistics/aftersale.js b/public/assets/js/backend/statistics/aftersale.js
index 6f55b9c..ee35774 100644
--- a/public/assets/js/backend/statistics/aftersale.js
+++ b/public/assets/js/backend/statistics/aftersale.js
@@ -4,14 +4,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
var Controller = {
index: function () {
-
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var $targetPanel = $($(this).attr("href"));
var tabVal = $(this).data('val');
if (tabVal === 'first') {
Controller.api.first();
}else if (tabVal === 'second') {
- console.log(3333);
Controller.api.second();
}else if (tabVal === 'third'){
Controller.api.third();
@@ -19,16 +17,84 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
Controller.api.fourth();
}
});
+ Table.api.init();
Controller.api.first();
Controller.api.datepicker();
+ Controller.api.enevt();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
},
+ enevt:function (){
+ $('#first-search').on('click', function (e) {
+ e.preventDefault();
+ const range = $('#daterange-table').val();
+ const keyword = $('#keyword').val();
+ let data = '';
+ if (range !== ''){
+ data += 'range=' + range;
+ }
+ if (keyword !== ''){
+ data += '&keyword=' + keyword;
+ }
+ // data = encodeURIComponent(data);
+ $("#table1").bootstrapTable('refresh',{
+ url:'statistics/aftersale/dispatch?' + data,
+ });
+ });
+ $('#first-search2').on('click', function (e) {
+ e.preventDefault();
+ const range = $('#daterange-table2').val();
+ const area_id = $('#area_id').val();
+ let data = '';
+ if (range !== ''){
+ data += 'range=' + range;
+ }
+ if (area_id !== ''){
+ data += 'area_id=' + area_id;
+ }
+ // data = encodeURIComponent(data);
+ $("#table2").bootstrapTable('refresh',{
+ url:'statistics/aftersale/city?' + data,
+ });
+ });
+
+ $('#first-search3').on('click', function () {
+
+ const range = $('#daterange-table3').val();
+ const item_id = $('#item_id_value').val();
+ let data = '';
+ if (range !== ''){
+ data += 'range=' + range;
+ }
+ if (item_id !== ''){
+ data += '&item_id=' + item_id;
+ }
+ // data = encodeURIComponent(data);
+ $("#table3").bootstrapTable('refresh',{
+ url:'statistics/aftersale/item?' + data,
+ });
+ });
+ $('#first-search4').on('click', function () {
+
+ const range = $('#daterange-table4').val();
+ const keyword = $('#keyword4').val();
+ let data = '';
+ if (range !== ''){
+ data += 'range=' + range;
+ }
+ if (keyword !== ''){
+ data += '&keyword=' + keyword;
+ }
+ // data = encodeURIComponent(data);
+ $("#table4").bootstrapTable('refresh',{
+ url:'statistics/aftersale/worker?' + data,
+ });
+ });
+ },
first: function (){
- Table.api.init();
// 表格2
var table = $("#table1");
table.bootstrapTable({
@@ -46,35 +112,36 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
{field: 'nickname', title: '名称', operate: false},
{field: 'mobile', title: '电话', operate: false},
{field: 'order_total', title: '订单总数', operate: false},
+ {field: 'refund_amount', title: '退款金额', operate: false},
{field: 'after_total', title: '退款订单数', operate: false},
{field: 'rate', title: '退款率', operate: false},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
+ buttons: [
+ {
+ name: 'aftersales',
+ text:"退款订单",
+ title:"退款订单",
+ icon: 'fa fa-list',
+ url: function(row){
+ return 'aftersales/aftersale2/?dispatch_admin_user='+row.nickname;
+ },
+ extend: 'data-toggle="tooltip" data-container="body"',
+ classname: 'btn btn-xs btn-default btn-dialog',
+ visible:function(row){
+ return true;
+ }
+ },
+ ]
+ }
]
]
});
// 为表格2绑定事件
Table.api.bindevent(table);
- $('#first-search').on('click', function () {
-
- const range = $('#daterange-table').val();
- const keyword = $('#keyword').val();
- let data = '';
- if (range !== ''){
- data += 'range=' + range;
- }
- if (keyword !== ''){
- data += '&keyword=' + keyword;
- }
- // data = encodeURIComponent(data);
- $("#table1").bootstrapTable('refresh',{
- url:'statistics/aftersale/dispatch?' + data,
- });
- });
-
},
second: function (){
- Table.api.init();
// 表格2
var table = $("#table2");
table.bootstrapTable({
@@ -92,7 +159,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
{field: 'area.merge_name', title: '城市', operate: false},
{field: 'order_total', title: '订单总数', operate: false},
{field: 'after_total', title: '退款订单数', operate: false},
+ {field: 'refund_amount', title: '退款金额', operate: false},
{field: 'rate', title: '退款率', operate: false},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
+ buttons: [
+ {
+ name: 'aftersales',
+ text:"退款订单",
+ title:"退款订单",
+ icon: 'fa fa-list',
+ url: function(row){
+ return 'aftersales/aftersale2/?area_id='+row.area.area_code;
+ },
+ extend: 'data-toggle="tooltip" data-container="body"',
+ classname: 'btn btn-xs btn-default btn-dialog',
+ visible:function(row){
+ return true;
+ }
+ },
+ ]
+ }
]
]
@@ -100,29 +186,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
// 为表格2绑定事件
Table.api.bindevent(table);
- $('#first-search2').on('click', function () {
-
- const range = $('#daterange-table2').val();
- const area_id = $('#area_id').val();
- let data = '';
- if (range !== ''){
- data += 'range=' + range;
- }
- if (area_id !== ''){
- data += 'area_id=' + area_id;
- }
- // data = encodeURIComponent(data);
- $("#table2").bootstrapTable('refresh',{
- url:'statistics/aftersale/city?' + data,
- });
- });
-
Controller.api.areapicker();
},
third: function (){
- Table.api.init();
// 表格2
var table = $("#table3");
table.bootstrapTable({
@@ -139,35 +207,37 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
[
{field: 'item_title', title: '服务项目', operate: false},
{field: 'order_total', title: '订单总数', operate: false},
+ {field: 'refund_amount', title: '退款金额', operate: false},
{field: 'after_total', title: '退款订单数', operate: false},
{field: 'rate', title: '退款率', operate: false},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
+ buttons: [
+ {
+ name: 'aftersales',
+ text:"退款订单",
+ title:"退款订单",
+ icon: 'fa fa-list',
+ url: function(row){
+ return 'aftersales/aftersale2/?item_id='+row.item_id;
+ },
+ extend: 'data-toggle="tooltip" data-container="body"',
+ classname: 'btn btn-xs btn-default btn-dialog',
+ visible:function(row){
+ return true;
+ }
+ },
+ ]
+ }
]
]
});
// 为表格2绑定事件
Table.api.bindevent(table);
- $('#first-search3').on('click', function () {
-
- const range = $('#daterange-table3').val();
- const item_id = $('#item_id_value').val();
- let data = '';
- if (range !== ''){
- data += 'range=' + range;
- }
- if (item_id !== ''){
- data += 'item_id=' + item_id;
- }
- // data = encodeURIComponent(data);
- $("#table3").bootstrapTable('refresh',{
- url:'statistics/aftersale/item?' + data,
- });
- });
Controller.api.itemspicker();
},
fourth: function (){
- Table.api.init();
// 表格2
var table = $("#table4");
table.bootstrapTable({
@@ -185,31 +255,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'addtabs'
{field: 'name', title: '名称', operate: false},
{field: 'tel', title: '电话', operate: false},
{field: 'order_total', title: '订单总数', operate: false},
+ {field: 'refund_amount', title: '退款金额', operate: false},
{field: 'after_total', title: '退款订单数', operate: false},
{field: 'rate', title: '退款率', operate: false},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
+ buttons: [
+ {
+ name: 'aftersales',
+ text:"退款订单",
+ title:"退款订单",
+ icon: 'fa fa-list',
+ url: function(row){
+ return 'aftersales/aftersale2/?worker_name='+row.name;
+ },
+ extend: 'data-toggle="tooltip" data-container="body"',
+ classname: 'btn btn-xs btn-default btn-dialog',
+ visible:function(row){
+ return true;
+ }
+ },
+ ]
+ }
]
]
});
// 为表格2绑定事件
Table.api.bindevent(table);
- $('#first-search4').on('click', function () {
-
- const range = $('#daterange-table4').val();
- const keyword = $('#keyword4').val();
- let data = '';
- if (range !== ''){
- data += 'range=' + range;
- }
- if (keyword !== ''){
- data += '&keyword=' + keyword;
- }
- // data = encodeURIComponent(data);
- $("#table4").bootstrapTable('refresh',{
- url:'statistics/aftersale/worker?' + data,
- });
- });
-
},
datepicker: function () {
diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js
index a6c2045..11698d7 100755
--- a/public/assets/js/bootstrap-table-commonsearch.js
+++ b/public/assets/js/bootstrap-table-commonsearch.js
@@ -40,7 +40,8 @@
// 重置搜索
form.on("click", "button[type=reset]", function (event) {
form[0].reset();
-
+ form.find('#select_area_id').val('');
+ form.find('#select_item_id').val('');
setTimeout(function () {
that.onCommonSearch();
}, 1);