Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 029d515617 | |||
| bc56229a2d | |||
| f387ba5da2 | |||
| 4f471e7b67 | |||
| 0e2f9409a6 | |||
| 5b225c0238 | |||
| f8d544d12f | |||
| 171b266e40 | |||
| 15592ed2bd | |||
| 53cad92a23 | |||
| 527ff4e6d6 | |||
| faed32526a |
93
README.md
93
README.md
|
|
@ -1,93 +0,0 @@
|
||||||
FastAdmin是一款基于ThinkPHP+Bootstrap的极速后台开发框架。
|
|
||||||
|
|
||||||
|
|
||||||
## 主要特性
|
|
||||||
|
|
||||||
* 基于`Auth`验证的权限管理系统
|
|
||||||
* 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置
|
|
||||||
* 支持单管理员多角色
|
|
||||||
* 支持管理子级数据或个人数据
|
|
||||||
* 强大的一键生成功能
|
|
||||||
* 一键生成CRUD,包括控制器、模型、视图、JS、语言包、菜单、回收站等
|
|
||||||
* 一键压缩打包JS和CSS文件,一键CDN静态资源部署
|
|
||||||
* 一键生成控制器菜单和规则
|
|
||||||
* 一键生成API接口文档
|
|
||||||
* 完善的前端功能组件开发
|
|
||||||
* 基于`AdminLTE`二次开发
|
|
||||||
* 基于`Bootstrap`开发,自适应手机、平板、PC
|
|
||||||
* 基于`RequireJS`进行JS模块管理,按需加载
|
|
||||||
* 基于`Less`进行样式开发
|
|
||||||
* 强大的插件扩展功能,在线安装卸载升级插件
|
|
||||||
* 通用的会员模块和API模块
|
|
||||||
* 共用同一账号体系的Web端会员中心权限验证和API接口会员权限验证
|
|
||||||
* 二级域名部署支持,同时域名支持绑定到应用插件
|
|
||||||
* 多语言支持,服务端及客户端支持
|
|
||||||
* 支持大文件分片上传、剪切板粘贴上传、拖拽上传,进度条显示,图片上传前压缩
|
|
||||||
* 支持表格固定列、固定表头、跨页选择、Excel导出、模板渲染等功能
|
|
||||||
* 强大的第三方应用模块支持([CMS](https://www.fastadmin.net/store/cms.html)、[CRM](https://www.fastadmin.net/store/facrm.html)、[企业网站管理系统](https://www.fastadmin.net/store/ldcms.html)、[知识库文档系统](https://www.fastadmin.net/store/knowbase.html)、[在线投票系统](https://www.fastadmin.net/store/vote.html)、[B2C商城](https://www.fastadmin.net/store/shopro.html)、[B2B2C商城](https://www.fastadmin.net/store/wanlshop.html))
|
|
||||||
* 整合第三方短信接口(阿里云、腾讯云短信)
|
|
||||||
* 无缝整合第三方云存储(七牛云、阿里云OSS、腾讯云存储、又拍云)功能,支持云储存分片上传
|
|
||||||
* 第三方富文本编辑器支持(Summernote、百度编辑器)
|
|
||||||
* 第三方登录(QQ、微信、微博)整合
|
|
||||||
* 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付
|
|
||||||
* 丰富的插件应用市场
|
|
||||||
|
|
||||||
## 安装使用
|
|
||||||
|
|
||||||
https://doc.fastadmin.net
|
|
||||||
|
|
||||||
## 在线演示
|
|
||||||
|
|
||||||
https://demo.fastadmin.net
|
|
||||||
|
|
||||||
用户名:admin
|
|
||||||
|
|
||||||
密 码:123456
|
|
||||||
|
|
||||||
提 示:演示站数据无法进行修改,请下载源码安装体验全部功能
|
|
||||||
|
|
||||||
## 界面截图
|
|
||||||

|
|
||||||
|
|
||||||
## 问题反馈
|
|
||||||
|
|
||||||
在使用中有任何问题,请使用以下联系方式联系我们
|
|
||||||
|
|
||||||
问答社区: https://ask.fastadmin.net
|
|
||||||
|
|
||||||
Github: https://github.com/karsonzhang/fastadmin
|
|
||||||
|
|
||||||
Gitee: https://gitee.com/karson/fastadmin
|
|
||||||
|
|
||||||
## 特别鸣谢
|
|
||||||
|
|
||||||
感谢以下的项目,排名不分先后
|
|
||||||
|
|
||||||
ThinkPHP:http://www.thinkphp.cn
|
|
||||||
|
|
||||||
AdminLTE:https://adminlte.io
|
|
||||||
|
|
||||||
Bootstrap:http://getbootstrap.com
|
|
||||||
|
|
||||||
jQuery:http://jquery.com
|
|
||||||
|
|
||||||
Bootstrap-table:https://github.com/wenzhixin/bootstrap-table
|
|
||||||
|
|
||||||
Nice-validator: https://validator.niceue.com
|
|
||||||
|
|
||||||
SelectPage: https://github.com/TerryZ/SelectPage
|
|
||||||
|
|
||||||
Layer: https://layuion.com/layer/
|
|
||||||
|
|
||||||
DropzoneJS: https://www.dropzonejs.com
|
|
||||||
|
|
||||||
|
|
||||||
## 版权信息
|
|
||||||
|
|
||||||
FastAdmin遵循Apache2开源协议发布,并提供免费使用。
|
|
||||||
|
|
||||||
本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
|
||||||
|
|
||||||
版权所有Copyright © 2017-2024 by FastAdmin (https://www.fastadmin.net)
|
|
||||||
|
|
||||||
All rights reserved。
|
|
||||||
|
|
@ -108,7 +108,7 @@ return [
|
||||||
'title' => '上传有效时长',
|
'title' => '上传有效时长',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => '3000',
|
'value' => 60 * 60 * 2,
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '用户停留页面上传有效时长,单位秒',
|
'tip' => '用户停留页面上传有效时长,单位秒',
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class Order extends Backend
|
||||||
protected $items = null;
|
protected $items = null;
|
||||||
protected $itemsformattedTree = null;
|
protected $itemsformattedTree = null;
|
||||||
|
|
||||||
protected $noNeedRight = ['smart','export'];
|
protected $noNeedRight = ['smart','export','orderRemark'];
|
||||||
|
|
||||||
public function _initialize()
|
public function _initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -170,6 +170,7 @@ class Order extends Backend
|
||||||
'source', 'source_shop', 'source_uid', 'source', 'item_title', 'item_id', 'work_tel_id',
|
'source', 'source_shop', 'source_uid', 'source', 'item_title', 'item_id', 'work_tel_id',
|
||||||
'detail', 'remark', 'images', 'create_time', 'update_time', 'admin_id', 'dispatch_type',
|
'detail', 'remark', 'images', 'create_time', 'update_time', 'admin_id', 'dispatch_type',
|
||||||
'receive_type',
|
'receive_type',
|
||||||
|
'order_remark',
|
||||||
'plan_time',
|
'plan_time',
|
||||||
'coupon_id',
|
'coupon_id',
|
||||||
'is_overtime',
|
'is_overtime',
|
||||||
|
|
@ -556,6 +557,18 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function orderRemark($ids = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$order = $this->model->where('id', $ids)->find();
|
||||||
|
$params = $this->request->post();
|
||||||
|
$remark = $params['remark'] ?? '';
|
||||||
|
$order->order_remark = $remark;
|
||||||
|
$order->save();
|
||||||
|
$this->success($order['order_no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function warning($ids = null)
|
public function warning($ids = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class Auditorder extends Backend
|
||||||
* @var \app\admin\model\Order
|
* @var \app\admin\model\Order
|
||||||
*/
|
*/
|
||||||
protected $model = null;
|
protected $model = null;
|
||||||
|
protected $noNeedRight = ['export'];
|
||||||
|
|
||||||
public function _initialize()
|
public function _initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -48,13 +49,21 @@ class Auditorder extends Backend
|
||||||
/**
|
/**
|
||||||
* 查看
|
* 查看
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index($getArray = false, $page = 0, $input_limit = 0)
|
||||||
{
|
{
|
||||||
//当前是否为关联查询
|
//当前是否为关联查询
|
||||||
$this->relationSearch = true;
|
$this->relationSearch = true;
|
||||||
//设置过滤方法
|
//设置过滤方法
|
||||||
$this->request->filter(['strip_tags', 'trim']);
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
if ($this->request->isAjax()) {
|
|
||||||
|
|
||||||
|
if (false === $this->request->isAjax() && $getArray == false) {
|
||||||
|
$res = $this->getSource();
|
||||||
|
$this->view->assign("sources", $res);
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
if ($this->request->request('keyField')) {
|
if ($this->request->request('keyField')) {
|
||||||
return $this->selectpage();
|
return $this->selectpage();
|
||||||
|
|
@ -62,13 +71,13 @@ class Auditorder extends Backend
|
||||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
|
|
||||||
$list = $this->model
|
$build = $this->model
|
||||||
->scope('tab',Order::TAB_AUDIT)
|
->scope('tab', Order::TAB_AUDIT)
|
||||||
->alias('order')
|
->alias('order')
|
||||||
->with([
|
->with([
|
||||||
'user' => function ($q) {
|
'user' => function ($q) {
|
||||||
$q->field('id,nickname');
|
$q->field('id,nickname');
|
||||||
},'workerman','auditadmin' => function ($q) {
|
}, 'workerman', 'auditadmin' => function ($q) {
|
||||||
$q->field('id,nickname');
|
$q->field('id,nickname');
|
||||||
}, 'source' => [
|
}, 'source' => [
|
||||||
'parent' => function ($q) {
|
'parent' => function ($q) {
|
||||||
|
|
@ -76,27 +85,40 @@ class Auditorder extends Backend
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
->where($where)
|
->where($where)
|
||||||
->order($sort, $order)
|
->order($sort, $order);
|
||||||
->paginate($limit);
|
|
||||||
|
$performance = 0;
|
||||||
|
if ($getArray) {
|
||||||
|
$list = $build->paginate([
|
||||||
|
'list_rows' => $input_limit,
|
||||||
|
'page' => $page
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$list = $build->paginate($limit);
|
||||||
|
|
||||||
|
// ✅ 新增:汇总总金额
|
||||||
|
$sum = $this->model
|
||||||
|
->where($where)
|
||||||
|
->field('SUM(performance) as performance')
|
||||||
|
->find();
|
||||||
|
$performance = $sum->performance ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($list as $item) {
|
foreach ($list as $item) {
|
||||||
if (isset($item->getRelation('source')->parent->title)){
|
if (isset($item->getRelation('source')->parent->title)) {
|
||||||
$item->source_total_name = '【' . $item->getRelation('source')->parent->title . '】' . ($item->getRelation('source')->title??'');
|
$item->source_total_name = '【' . $item->getRelation('source')->parent->title . '】' . ($item->getRelation('source')->title ?? '');
|
||||||
}else{
|
} else {
|
||||||
$item->source_total_name = ($item->getRelation('source')->title??'');
|
$item->source_total_name = ($item->getRelation('source')->title ?? '');
|
||||||
}
|
}
|
||||||
unset($item->source);
|
unset($item->source);
|
||||||
}
|
}
|
||||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
$result = array("total" => $list->total(), "rows" => $list->items(),'sum' => $performance);
|
||||||
|
|
||||||
return json($result);
|
return json($result);
|
||||||
}
|
|
||||||
$res = $this->getSource();
|
|
||||||
$this->view->assign("sources", $res);
|
|
||||||
return $this->view->fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
|
|
@ -108,12 +130,12 @@ class Auditorder extends Backend
|
||||||
*/
|
*/
|
||||||
public function edit($ids = null)
|
public function edit($ids = null)
|
||||||
{
|
{
|
||||||
$row = $this->model->get($ids,['dispatch']);
|
$row = $this->model->get($ids, ['dispatch']);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
$this->error(__('No Results were found'));
|
$this->error(__('No Results were found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($row ->status != Order::STATUS_AUDITING){
|
if ($row->status != Order::STATUS_AUDITING) {
|
||||||
$this->error('订单状态不可审核');
|
$this->error('订单状态不可审核');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,10 +144,10 @@ class Auditorder extends Backend
|
||||||
$this->error(__('You have no permission'));
|
$this->error(__('You have no permission'));
|
||||||
}
|
}
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
$order = Order::where('id',$ids)->find();
|
$order = Order::where('id', $ids)->find();
|
||||||
$this->view->assign('row', $row);
|
$this->view->assign('row', $row);
|
||||||
$worker = Worker::withTrashed()->where('id', $order->worker_id)->find();
|
$worker = Worker::withTrashed()->where('id', $order->worker_id)->find();
|
||||||
$this->view->assign('worker',$worker);
|
$this->view->assign('worker', $worker);
|
||||||
$this->view->assign('cdnurl', config('upload.cdnurl'));
|
$this->view->assign('cdnurl', config('upload.cdnurl'));
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
|
@ -148,9 +170,9 @@ class Auditorder extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
$txt = '审核通过';
|
$txt = '审核通过';
|
||||||
if($audit_status){
|
if ($audit_status) {
|
||||||
$params['status'] = Order::STATUS_FINISHED;
|
$params['status'] = Order::STATUS_FINISHED;
|
||||||
}else{
|
} else {
|
||||||
$params['status'] = Order::STATUS_CHECKONCE;
|
$params['status'] = Order::STATUS_CHECKONCE;
|
||||||
$txt = '审核未通过';
|
$txt = '审核未通过';
|
||||||
}
|
}
|
||||||
|
|
@ -163,16 +185,16 @@ class Auditorder extends Backend
|
||||||
$hookParams['order'] = $row;
|
$hookParams['order'] = $row;
|
||||||
$hookParams['role'] = 1;
|
$hookParams['role'] = 1;
|
||||||
$hookParams['auth'] = $this->auth;
|
$hookParams['auth'] = $this->auth;
|
||||||
$hookParams['remark'] = $txt.',审核备注:'.$params['audit_remark'];
|
$hookParams['remark'] = $txt . ',审核备注:' . $params['audit_remark'];
|
||||||
Hook::listen('order_change',$hookParams);
|
Hook::listen('order_change', $hookParams);
|
||||||
|
|
||||||
if($params['status'] == Order::STATUS_CHECKONCE){
|
if ($params['status'] == Order::STATUS_CHECKONCE) {
|
||||||
//未通过审核,通知派单员,重新配置
|
//未通过审核,通知派单员,重新配置
|
||||||
Message::create([
|
Message::create([
|
||||||
'to_id' => $row->dispatch_admin_id,
|
'to_id' => $row->dispatch_admin_id,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'title' => '订单结算审核未通过',
|
'title' => '订单结算审核未通过',
|
||||||
'content' => '【订单结算未通过】订单编号:'.$row->order_no.',审核备注:'.$params['audit_remark'].',审核人:'.$this->auth->nickname
|
'content' => '【订单结算未通过】订单编号:' . $row->order_no . ',审核备注:' . $params['audit_remark'] . ',审核人:' . $this->auth->nickname
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,4 +210,42 @@ class Auditorder extends Backend
|
||||||
$this->success();
|
$this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function export()
|
||||||
|
{
|
||||||
|
$columns = json_decode($this->request->get('columns', ''), true);
|
||||||
|
if (!$columns) {
|
||||||
|
$sample = $this->index(true, 1, 1)->getData();
|
||||||
|
|
||||||
|
if (!isset($sample['rows'][0])) {
|
||||||
|
return json(['code' => 0, 'msg' => '无数据可导出']);
|
||||||
|
}
|
||||||
|
$columns = [];
|
||||||
|
foreach ($sample['rows'][0] as $key => $value) {
|
||||||
|
$columns[] = ['field' => $key, 'title' => $key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$generator = function () use ($columns) {
|
||||||
|
$limit = 1000;
|
||||||
|
$page = 1;
|
||||||
|
$order = new \app\admin\model\Order();
|
||||||
|
do {
|
||||||
|
$result = $this->index(true, $page, $limit);
|
||||||
|
$rows = $result->getData()['rows'] ?? [];
|
||||||
|
if (!$rows) break;
|
||||||
|
|
||||||
|
foreach ($rows as $item) {
|
||||||
|
$item->status = $order->getStatusList()[$item->status] ?? '';
|
||||||
|
$item->amount_images = $this->dealImages($item->amount_images);
|
||||||
|
$item->workerman->images = $this->dealImages($item->workerman->images);
|
||||||
|
yield $item->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
$page++;
|
||||||
|
} while (count($rows) === $limit);
|
||||||
|
};
|
||||||
|
|
||||||
|
$this->streamCsv($columns, $generator(), '订单导出_' . date('Ymd_His') . '.csv');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,7 @@ class Dispatch2 extends Backend
|
||||||
|
|
||||||
|
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
|
dd($params);
|
||||||
$orderParsms = $this->request->post('order/a');
|
$orderParsms = $this->request->post('order/a');
|
||||||
if (empty($params) || empty($orderParsms)) {
|
if (empty($params) || empty($orderParsms)) {
|
||||||
$this->error(__('Parameter %s can not be empty', ''));
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ class Review extends Backend
|
||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new \app\admin\model\OrderReview;
|
$this->model = new \app\admin\model\OrderReview;
|
||||||
|
$order = new Order();
|
||||||
|
$this->view->assign("statusList", $order->getStatusList());
|
||||||
|
$this->view->assign("offlineTotalTypeList", $order->getOfflineTotalTypeList());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Item extends Backend
|
||||||
if (!empty($filter)){
|
if (!empty($filter)){
|
||||||
$arr = explode(' - ', $filter);
|
$arr = explode(' - ', $filter);
|
||||||
if (trim($arr[0])) {
|
if (trim($arr[0])) {
|
||||||
$start = trim($arr[0]);
|
$start = trim($arr[0]). ' 00:00:00';
|
||||||
}
|
}
|
||||||
if (trim($arr[1])) {
|
if (trim($arr[1])) {
|
||||||
$end_at = trim($arr[1]) . ' 23:29:59';
|
$end_at = trim($arr[1]) . ' 23:29:59';
|
||||||
|
|
@ -113,10 +113,6 @@ class Item extends Backend
|
||||||
if(!empty(request()->get('source',null))){
|
if(!empty(request()->get('source',null))){
|
||||||
$build->where('source',request()->get('source'));
|
$build->where('source',request()->get('source'));
|
||||||
}
|
}
|
||||||
//城市
|
|
||||||
/* if(!empty(request()->post('area_id',null))){
|
|
||||||
$build->where('area_id','LIKE',request()->post('source').'%');
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(!empty(request()->get('item_id',null))){
|
if(!empty(request()->get('item_id',null))){
|
||||||
$item_id =request()->get('item_id');
|
$item_id =request()->get('item_id');
|
||||||
|
|
@ -125,7 +121,7 @@ class Item extends Backend
|
||||||
$build->whereIn('item_id', $item_ids);
|
$build->whereIn('item_id', $item_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
$build->whereBetween('create_time', [$start, $end_at])
|
$build->whereBetween('audit_time', [$start, $end_at])
|
||||||
->field([
|
->field([
|
||||||
'item_title name', // 类型
|
'item_title name', // 类型
|
||||||
'sum(total) total', // 营业额
|
'sum(total) total', // 营业额
|
||||||
|
|
@ -141,6 +137,7 @@ class Item extends Backend
|
||||||
])->group('item_title')
|
])->group('item_title')
|
||||||
->order('count_num', 'desc');
|
->order('count_num', 'desc');
|
||||||
// dd($total);
|
// dd($total);
|
||||||
|
|
||||||
$res = $build->paginate($limit);
|
$res = $build->paginate($limit);
|
||||||
$total = $res->total();
|
$total = $res->total();
|
||||||
$ress = $res->items();
|
$ress = $res->items();
|
||||||
|
|
|
||||||
|
|
@ -85,10 +85,11 @@ class Worker extends Backend
|
||||||
$this->request->filter(['strip_tags', 'trim']);
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
$items = $this->items;
|
$items = $this->items;
|
||||||
$filtered = array_filter($items, function ($item) {
|
$filtered = array_filter($items, function ($item) {
|
||||||
return $item['pid'] == 0;
|
return $item['level'] == 2;
|
||||||
});
|
});
|
||||||
|
|
||||||
$pid_map = array_column($filtered, null, 'id');
|
$pid_map = array_column($filtered, null, 'id');
|
||||||
|
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
if ($this->request->request('keyField')) {
|
if ($this->request->request('keyField')) {
|
||||||
|
|
@ -135,7 +136,8 @@ class Worker extends Backend
|
||||||
$worker_ids = [];
|
$worker_ids = [];
|
||||||
foreach ($list->items() as $item){
|
foreach ($list->items() as $item){
|
||||||
$dt = $item->toArray();
|
$dt = $item->toArray();
|
||||||
$tel = $dt['tel'];
|
preg_match_all('/\d+/', $dt['tel'], $matches);;
|
||||||
|
$tel = $matches[0][0] ?? '';
|
||||||
if (preg_match('/^\d{7,}$/', $tel)) {
|
if (preg_match('/^\d{7,}$/', $tel)) {
|
||||||
$dt['tel'] = mb_substr($tel, 0, 3, 'UTF-8') . '****' . mb_substr($tel, -4, null, 'UTF-8');
|
$dt['tel'] = mb_substr($tel, 0, 3, 'UTF-8') . '****' . mb_substr($tel, -4, null, 'UTF-8');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -145,8 +147,9 @@ class Worker extends Backend
|
||||||
$data[] = $dt;
|
$data[] = $dt;
|
||||||
$worker_ids [] = $item['id'];
|
$worker_ids [] = $item['id'];
|
||||||
}
|
}
|
||||||
$worker_item = WorkerItem::whereIn('worker_id',$worker_ids)->where('item_path_id',1)
|
$worker_item = WorkerItem::whereIn('worker_id',$worker_ids)->where('item_path_id',2)
|
||||||
->field('worker_id,item_id')->select();
|
->field('worker_id,item_id')->select();
|
||||||
|
|
||||||
$worker_item_map = [];
|
$worker_item_map = [];
|
||||||
// dd($worker_item);
|
// dd($worker_item);
|
||||||
foreach ($worker_item as $item){
|
foreach ($worker_item as $item){
|
||||||
|
|
@ -156,12 +159,14 @@ class Worker extends Backend
|
||||||
// dd($worker_item_map);
|
// dd($worker_item_map);
|
||||||
if (key_exists($datum['id'],$worker_item_map)){
|
if (key_exists($datum['id'],$worker_item_map)){
|
||||||
foreach ($worker_item_map[$datum['id']] as $item){
|
foreach ($worker_item_map[$datum['id']] as $item){
|
||||||
$datum ['worker_item'][] = trim($pid_map[$item]['title']);
|
if ($pid_map[$item] ?? false){
|
||||||
|
$datum ['worker_item'][] = str_replace(" ",'',$pid_map[$item]['title']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$datum ['worker_item'] = [];
|
$datum ['worker_item'] = [];
|
||||||
}
|
}
|
||||||
$datum['worker_item'] = implode(',',$datum['worker_item']);
|
$datum['worker_item'] = implode(',',$datum['worker_item'] ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,10 @@ return [
|
||||||
'Worker_star' => '师傅评分',
|
'Worker_star' => '师傅评分',
|
||||||
'Remark' => '备注',
|
'Remark' => '备注',
|
||||||
'Admin_id' => '回访人',
|
'Admin_id' => '回访人',
|
||||||
'Admin_user' => '回访人'
|
'Admin_user' => '回访人',
|
||||||
|
'Coupons' => '优惠',
|
||||||
|
'Offline_amount_type' => '线下尾款类型',
|
||||||
|
'Offline_amount_type 0' => '无',
|
||||||
|
'Offline_amount_type 1' => '师傅收',
|
||||||
|
'Offline_amount_type 2' => '公司收',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ class Item extends Model
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
$index[$item['pid']][] = $item;
|
$index[$item['pid']][] = $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归函数,闭包形式避免污染全局
|
// 递归函数,闭包形式避免污染全局
|
||||||
$collect = function($pid) use (&$collect, &$index) {
|
$collect = function($pid) use (&$collect, &$index) {
|
||||||
$ids = [];
|
$ids = [];
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
|
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
|
||||||
<!-- Loading Bootstrap -->
|
<!-- Loading Bootstrap -->
|
||||||
<link href="__CDN__/assets/css/backend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
|
<link href="__CDN__/assets/css/backend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
|
||||||
|
<link href="__CDN__/assets/css/common.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
|
||||||
|
|
||||||
{if $Think.config.fastadmin.adminskin}
|
{if $Think.config.fastadmin.adminskin}
|
||||||
<link href="__CDN__/assets/css/skins/{$Think.config.fastadmin.adminskin|htmlentities}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
|
<link href="__CDN__/assets/css/skins/{$Think.config.fastadmin.adminskin|htmlentities}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
<div class="widget-body no-padding">
|
<div class="widget-body no-padding">
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-export" id="btn-export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('orders/auditorder/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('orders/auditorder/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('orders/auditorder/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('orders/auditorder/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('orders/auditorder/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('orders/auditorder/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-order_id" data-rule="required" data-field="order_no" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('订单编号')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('订单编号')}:</label>
|
||||||
|
|
@ -15,42 +8,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户姓名')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-customer" readonly class="form-control" type="text" value="{$order.customer|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户电话')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-tel" readonly class="form-control" type="text" value="{$order.tel|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户地址')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-address" readonly class="form-control" type="text" value="{$order.area.short_merge_name|htmlentities} {$order.address|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('服务类目')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-item_title" readonly class="form-control" type="text" value="{$order.item_title|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<!-- <div class="form-group">-->
|
|
||||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Order.detail')}:</label>-->
|
|
||||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
|
||||||
<!-- <input id="c-detail" readonly class="form-control" type="text" value="{$order.detail|htmlentities}">-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
{notempty name ='action'}
|
{notempty name ='action'}
|
||||||
|
|
||||||
<input id="c-action" name="row[action]" type="hidden" value="{$action|htmlentities}">
|
<input id="c-action" name="row[action]" type="hidden" value="{$action|htmlentities}">
|
||||||
|
|
@ -78,38 +35,26 @@
|
||||||
<!-- <input readonly type="text" class="form-control" value="{$row.status_text|htmlentities}">-->
|
<!-- <input readonly type="text" class="form-control" value="{$row.status_text|htmlentities}">-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{if $row['is_receipt']==0 }
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('线上收款')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('线上收款')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input id="order-online-amount" name="order[online_amount]" type="text" class="form-control" value="{$order.online_amount|htmlentities}">
|
<input id="order-online-amount" name="order[online_amount]" readonly type="text" class="form-control" value="{$order.online_amount|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('尾款收款')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">收款方式:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input readonly class="form-control" type="text" value="无需收尾款">
|
<select name="order[is_receipt]" id="receive_type" class="form-control selectpicker">
|
||||||
|
<option {if 1 == $order.receive_type} selected {/if} value="1">没有尾款</option>
|
||||||
|
<option {if 0 == $order.receive_type} selected {/if} value="0">收尾款</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $row['is_receipt']==1 }
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div id="other_info">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('线上预付')}:</label>
|
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<input id="order-online-amount" name="order[online_amount]" type="text" class="form-control" value="{$order.online_amount|htmlentities}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款')}:</label>
|
||||||
|
|
@ -117,25 +62,20 @@
|
||||||
<input id="c-online_total" name="row[online_total]" data-rule="required" type="number" min="0" placeholder="请输入线上尾款金额" class="form-control" value="{$row.online_total|htmlentities}">
|
<input id="c-online_total" name="row[online_total]" data-rule="required" type="number" min="0" placeholder="请输入线上尾款金额" class="form-control" value="{$row.online_total|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Offline_total_type')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Offline_total_type')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
|
||||||
{:build_select('row[offline_total_type]',$offlineTotalTypeList,$row['offline_total_type'],['class'=>'form-control','data-rule'=>'required'])}
|
{:build_select('row[offline_total_type]',$offlineTotalTypeList,$row['offline_total_type'],['class'=>'form-control selectpicker','data-rule'=>'required'])}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('线下尾款')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('线下尾款')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input id="c-total" data-rule="required" placeholder="请输入线下尾款金额" class="form-control" name="row[total]" type="number" min="0" value="{$row.total|htmlentities}">
|
<input id="c-total" data-rule="required" placeholder="请输入线下尾款金额" class="form-control" name="row[total]" type="number" min="0" value="{$row.total|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('收款凭据')}:</label>
|
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('收款凭据')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
@ -150,9 +90,7 @@
|
||||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/if}
|
|
||||||
|
|
||||||
<!--<div class="form-group">
|
<!--<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('材料成本(¥)')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('材料成本(¥)')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款类型')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款类型')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
{:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control readonly','data-rule'=>'required'])}
|
{:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control','readonly','data-rule'=>'required'])}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -784,7 +784,6 @@ class Backend extends Controller
|
||||||
|
|
||||||
$fields = array_column($columns, 'field');
|
$fields = array_column($columns, 'field');
|
||||||
$titles = array_column($columns, 'title');
|
$titles = array_column($columns, 'title');
|
||||||
|
|
||||||
// 写入表头
|
// 写入表头
|
||||||
fputcsv($output, $titles);
|
fputcsv($output, $titles);
|
||||||
|
|
||||||
|
|
@ -818,4 +817,18 @@ class Backend extends Controller
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function dealImages($image_str)
|
||||||
|
{
|
||||||
|
if (empty($image_str)){
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
$images = explode(',', $image_str);
|
||||||
|
$url = '';
|
||||||
|
foreach ($images as $img) {
|
||||||
|
if (empty($img)) continue;
|
||||||
|
$url .= cdnurl($img) . ',';
|
||||||
|
}
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1129
composer.lock
generated
1129
composer.lock
generated
File diff suppressed because it is too large
Load Diff
5
public/assets/css/common.css
Normal file
5
public/assets/css/common.css
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
/* 固定分页条 */
|
||||||
|
.fixed-table-body{
|
||||||
|
max-height: calc(100vh - 240px) !important;
|
||||||
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
pk: 'id',
|
pk: 'id',
|
||||||
sortName: 'id',
|
sortName: 'id',
|
||||||
fixedRightNumber: 1,
|
fixedRightNumber: 1,
|
||||||
fixedNumber: 4,
|
fixedNumber: 5,
|
||||||
fixedColumns: true,
|
fixedColumns: true,
|
||||||
renderDefault: true,
|
renderDefault: true,
|
||||||
searchFormVisible: true,
|
searchFormVisible: true,
|
||||||
|
|
@ -125,6 +125,12 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
"10": "my_dispatch"
|
"10": "my_dispatch"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'order_remark',
|
||||||
|
title: '标记',
|
||||||
|
operate: 'like',
|
||||||
|
autocomplete: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'create_time',
|
field: 'create_time',
|
||||||
title: __('Create_time'),
|
title: __('Create_time'),
|
||||||
|
|
@ -381,6 +387,45 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "order_remark",
|
||||||
|
text: "标记",
|
||||||
|
title: "标记",
|
||||||
|
classname: 'btn btn-xs btn-click',
|
||||||
|
icon: 'fa fa-comment',
|
||||||
|
click: function (e, row) {
|
||||||
|
Layer.open({
|
||||||
|
type: 1,
|
||||||
|
title: '请输入备注信息(可为空)',
|
||||||
|
area: ['400px', '250px'],
|
||||||
|
btn: ['确定', '取消'],
|
||||||
|
content: '<div style="padding:20px;">' +
|
||||||
|
'<textarea id="remark-input" style="width:100%;" rows="4" placeholder="留空表示清空备注">' +
|
||||||
|
(row.order_remark || '') + '</textarea>' +
|
||||||
|
'</div>',
|
||||||
|
yes: function (index, layero) {
|
||||||
|
var text = $('#remark-input').val();
|
||||||
|
Fast.api.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: 'order/orderRemark/ids/' + row.id,
|
||||||
|
data: {id: row.id, remark: text},
|
||||||
|
}, function (data, ret) {
|
||||||
|
Layer.close(index);
|
||||||
|
Toastr.success("备注提交成功");
|
||||||
|
table.bootstrapTable('refresh');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dropdown: "更多",
|
||||||
|
visible: function (row) {
|
||||||
|
if (Config.permissions.reminder && row.status == 10) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "copy_text",
|
name: "copy_text",
|
||||||
text: "复制信息",
|
text: "复制信息",
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
params.op = JSON.stringify(op);
|
params.op = JSON.stringify(op);
|
||||||
return params;
|
return params;
|
||||||
},
|
},
|
||||||
|
onLoadSuccess: function (data) {
|
||||||
|
var sum = data || {};
|
||||||
|
|
||||||
|
// 1) 把汇总放到表格上方(可改为 append 到其它元素)
|
||||||
|
$('#table-sum-area').remove(); // 先移除已有的,防止重复
|
||||||
|
var html = '<div id="table-sum-area" style="margin:8px 0;text-align:right;">' +
|
||||||
|
'筛选条件总计 — 总预计利润:<strong>' + (parseFloat(data.sum || 0).toFixed(2)) + '</strong>' +
|
||||||
|
',总数量:<strong>' + (parseInt(data.total || 0)) + '</strong>' +
|
||||||
|
'</div>';
|
||||||
|
// 把汇总放在表格容器前面(你也可以放到 table.closest('.bootstrap-table') 里)
|
||||||
|
table.closest('.bootstrap-table').before(html);
|
||||||
|
|
||||||
|
// 2) (可选)如果你想把汇总放到表格 footer 的某一列,用 footerFormatter 示例:
|
||||||
|
// 注意:footerFormatter 会在表格渲染 footer 时调用,这里只是演示
|
||||||
|
// 例如你有一列 field: 'real_amount',它的 footerFormatter 可以是:
|
||||||
|
// footerFormatter: function () { var s = table.data('sum') || {}; return (parseFloat(s.real_amount||0)).toFixed(2); }
|
||||||
|
},
|
||||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
pk: 'id',
|
pk: 'id',
|
||||||
sortName: 'update_time',
|
sortName: 'update_time',
|
||||||
sortOrder: 'desc',
|
sortOrder: 'desc',
|
||||||
fixedColumns: true,
|
fixedColumns: true,
|
||||||
fixedRightNumber: 1,
|
fixedRightNumber: 1,
|
||||||
|
showExport: false,
|
||||||
columns: [
|
columns: [
|
||||||
[
|
[
|
||||||
// {checkbox: true},
|
// {checkbox: true},
|
||||||
|
|
@ -131,7 +148,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
table.closest('.bootstrap-table').addClass('table-with-fixed-pagination');
|
||||||
|
|
||||||
|
$('#btn-export').on('click', function () {
|
||||||
|
var options = $("#table").bootstrapTable('getOptions');
|
||||||
|
|
||||||
|
// 提取列信息(不含 checkbox)
|
||||||
|
var columns = [];
|
||||||
|
$.each(options.columns[0], function (i, item) {
|
||||||
|
if (item.field && !item.checkbox && !item.visible === false) {
|
||||||
|
columns.push({
|
||||||
|
field: item.field,
|
||||||
|
title: item.title
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var params = {
|
||||||
|
columns: JSON.stringify(columns),
|
||||||
|
filter: options.queryParams({}).filter || {},
|
||||||
|
op: options.queryParams({}).op || {},
|
||||||
|
sort: options.sortName,
|
||||||
|
order: options.sortOrder
|
||||||
|
};
|
||||||
|
// console.log($.param(params))
|
||||||
|
var url = '/admin/orders/auditorder/export?' + $.param(params);
|
||||||
|
window.open(url); // 发起文件下载
|
||||||
|
});
|
||||||
// 为表格绑定事件
|
// 为表格绑定事件
|
||||||
Table.api.bindevent(table);
|
Table.api.bindevent(table);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
// 判断 #c-action 是否存在且有值
|
// 判断 #c-action 是否存在且有值
|
||||||
const $action = $("#c-action");
|
const $action = $("#c-action");
|
||||||
if ($action.length && $action.val()) {
|
if ($action.length && $action.val()) {
|
||||||
|
|
||||||
|
/* ["c-online_total", "c-total", "order-cost", "order-material_cost"].forEach(function(id) {
|
||||||
|
$("#" + id).on("input", calculatePerformance);
|
||||||
|
});*/
|
||||||
|
|
||||||
|
$('#c-online_total, #c-total, #order-cost, #order-material_cost').on('input', function () {
|
||||||
|
//calcProfit();
|
||||||
|
calculatePerformance();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 页面加载时先算一次
|
||||||
|
calculatePerformance();
|
||||||
|
}
|
||||||
function calculatePerformance() {
|
function calculatePerformance() {
|
||||||
//console.log("sb:计算利润...");
|
//console.log("sb:计算利润...");
|
||||||
const orderOnlineAmount = parseFloat($("#order-online-amount").val()) || 0;
|
const orderOnlineAmount = parseFloat($("#order-online-amount").val()) || 0;
|
||||||
|
|
@ -452,19 +465,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
||||||
|
|
||||||
$("#c-performance").val(performance.toFixed(2));
|
$("#c-performance").val(performance.toFixed(2));
|
||||||
}
|
}
|
||||||
|
function toggleReceiveFields() {
|
||||||
/* ["c-online_total", "c-total", "order-cost", "order-material_cost"].forEach(function(id) {
|
const type = $('#receive_type').val();
|
||||||
$("#" + id).on("input", calculatePerformance);
|
if (type === '0') {
|
||||||
});*/
|
$('#other_info').show();
|
||||||
|
} else {
|
||||||
$('#c-online_total, #c-total, #order-cost, #order-material_cost').on('input', function () {
|
$('#other_info').hide();
|
||||||
//calcProfit();
|
|
||||||
calculatePerformance();
|
|
||||||
});
|
|
||||||
|
|
||||||
// 页面加载时先算一次
|
|
||||||
calculatePerformance();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
toggleReceiveFields();
|
||||||
|
$('#receive_type').on('change', function () {
|
||||||
|
toggleReceiveFields();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
addrecord: function () {
|
addrecord: function () {
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree','cascader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'worker_item',
|
field: 'worker_item',
|
||||||
|
width:500,
|
||||||
title: '工种',
|
title: '工种',
|
||||||
|
operate: false,
|
||||||
|
table: table,
|
||||||
|
class: 'autocontent',
|
||||||
|
formatter: Table.api.formatter.content
|
||||||
},
|
},
|
||||||
//{field: 'area_id', title: __('Area_id')},
|
//{field: 'area_id', title: __('Area_id')},
|
||||||
//{field: 'lng', title: __('Lng'), operate:'BETWEEN'},
|
//{field: 'lng', title: __('Lng'), operate:'BETWEEN'},
|
||||||
|
|
|
||||||
34
sql/sync.sh
Normal file
34
sql/sync.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 配置参数
|
||||||
|
HOST="rm-bp1769w7k3om452lvzo.mysql.rds.aliyuncs.com"
|
||||||
|
USER="wanyu"
|
||||||
|
SOURCE_DB="wanyu"
|
||||||
|
TARGET_DB="wanyu_test"
|
||||||
|
|
||||||
|
# 输入密码(不回显)
|
||||||
|
read -s -p "请输入数据库用户 $USER 的密码: " DBPASS
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# 检查目标库是否存在,不存在就创建
|
||||||
|
echo "🧩 检查目标数据库 $TARGET_DB 是否存在..."
|
||||||
|
mysql -h $HOST -u $USER -p"$DBPASS" -e "CREATE DATABASE IF NOT EXISTS \`$TARGET_DB\` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" || {
|
||||||
|
echo "❌ 无法连接或创建目标数据库 $TARGET_DB"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# 开始导出并导入
|
||||||
|
echo "📦 正在从 $SOURCE_DB 导出并导入到 $TARGET_DB,请稍候..."
|
||||||
|
|
||||||
|
mysqldump -h $HOST -u $USER -p"$DBPASS" \
|
||||||
|
--single-transaction \
|
||||||
|
--set-gtid-purged=OFF \
|
||||||
|
--routines --triggers --events \
|
||||||
|
"$SOURCE_DB" | mysql -h $HOST -u $USER -p"$DBPASS" "$TARGET_DB"
|
||||||
|
|
||||||
|
# 检查导入结果
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✅ 数据库复制完成:$SOURCE_DB → $TARGET_DB"
|
||||||
|
else
|
||||||
|
echo "❌ 数据库复制失败,请检查日志或权限设置"
|
||||||
|
fi
|
||||||
0
sql/sync.sql
Normal file
0
sql/sync.sql
Normal file
Loading…
Reference in New Issue
Block a user