This commit is contained in:
todaywindy 2025-08-15 15:00:23 +08:00
parent f8d544d12f
commit bc56229a2d
18 changed files with 1147 additions and 356 deletions

View File

@ -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://images.gitee.com/uploads/images/2020/0929/202947_8db2d281_10933.gif "控制台")
## 问题反馈
在使用中有任何问题,请使用以下联系方式联系我们
问答社区: https://ask.fastadmin.net
Github: https://github.com/karsonzhang/fastadmin
Gitee: https://gitee.com/karson/fastadmin
## 特别鸣谢
感谢以下的项目,排名不分先后
ThinkPHPhttp://www.thinkphp.cn
AdminLTEhttps://adminlte.io
Bootstraphttp://getbootstrap.com
jQueryhttp://jquery.com
Bootstrap-tablehttps://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。

View File

@ -108,7 +108,7 @@ return [
'title' => '上传有效时长',
'type' => 'string',
'content' => [],
'value' => '3000',
'value' => 60 * 60 * 2,
'rule' => 'required',
'msg' => '',
'tip' => '用户停留页面上传有效时长,单位秒',

View File

@ -55,7 +55,7 @@ class Order extends Backend
protected $items = null;
protected $itemsformattedTree = null;
protected $noNeedRight = ['smart','export'];
protected $noNeedRight = ['smart','export','orderRemark'];
public function _initialize()
{
@ -170,6 +170,7 @@ class Order extends Backend
'source', 'source_shop', 'source_uid', 'source', 'item_title', 'item_id', 'work_tel_id',
'detail', 'remark', 'images', 'create_time', 'update_time', 'admin_id', 'dispatch_type',
'receive_type',
'order_remark',
'plan_time',
'coupon_id',
'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)
{

View File

@ -87,7 +87,7 @@ class Auditorder extends Backend
->where($where)
->order($sort, $order);
$performance = 0;
if ($getArray) {
$list = $build->paginate([
'list_rows' => $input_limit,
@ -95,6 +95,13 @@ class Auditorder extends Backend
]);
} else {
$list = $build->paginate($limit);
// ✅ 新增:汇总总金额
$sum = $this->model
->where($where)
->field('SUM(performance) as performance')
->find();
$performance = $sum->performance ?? 0;
}
foreach ($list as $item) {
@ -105,7 +112,7 @@ class Auditorder extends Backend
}
unset($item->source);
}
$result = array("total" => $list->total(), "rows" => $list->items());
$result = array("total" => $list->total(), "rows" => $list->items(),'sum' => $performance);
return json($result);

View File

@ -282,7 +282,7 @@ class Dispatch2 extends Backend
$params = $this->request->post('row/a');
dd($params);
$orderParsms = $this->request->post('order/a');
if (empty($params) || empty($orderParsms)) {
$this->error(__('Parameter %s can not be empty', ''));

View File

@ -29,6 +29,9 @@ class Review extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\OrderReview;
$order = new Order();
$this->view->assign("statusList", $order->getStatusList());
$this->view->assign("offlineTotalTypeList", $order->getOfflineTotalTypeList());
}

View File

@ -7,5 +7,10 @@ return [
'Worker_star' => '师傅评分',
'Remark' => '备注',
'Admin_id' => '回访人',
'Admin_user' => '回访人'
'Admin_user' => '回访人',
'Coupons' => '优惠',
'Offline_amount_type' => '线下尾款类型',
'Offline_amount_type 0' => '无',
'Offline_amount_type 1' => '师傅收',
'Offline_amount_type 2' => '公司收',
];

View File

@ -98,7 +98,6 @@ class Item extends Model
foreach ($data as $item) {
$index[$item['pid']][] = $item;
}
// 递归函数,闭包形式避免污染全局
$collect = function($pid) use (&$collect, &$index) {
$ids = [];

View File

@ -8,6 +8,7 @@
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
<!-- 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/common.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
{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">

View File

@ -1,12 +1,5 @@
<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">
<label class="control-label col-xs-12 col-sm-2">{:__('订单编号')}:</label>
@ -15,42 +8,6 @@
</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'}
<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}">-->
<!-- </div>-->
<!-- </div>-->
{if $row['is_receipt']==0 }
<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="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 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">
<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>
{/if}
{if $row['is_receipt']==1 }
<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="order-online-amount" name="order[online_amount]" type="text" class="form-control" value="{$order.online_amount|htmlentities}">
</div>
</div>
<div id="other_info">
<div class="form-group">
<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}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Offline_total_type')}:</label>
<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 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-total" data-rule="required" placeholder="请输入线下尾款金额" class="form-control" name="row[total]" type="number" min="0" value="{$row.total|htmlentities}">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('收款凭据')}:</label>
<div class="col-xs-12 col-sm-8">
@ -150,9 +90,7 @@
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
{/if}
</div>
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('材料成本(¥)')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@ -53,7 +53,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款类型')}:</label>
<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>

1129
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
/* 固定分页条 */
.fixed-table-body{
max-height: calc(100vh - 240px) !important;
}

View File

@ -90,7 +90,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
pk: 'id',
sortName: 'id',
fixedRightNumber: 1,
fixedNumber: 4,
fixedNumber: 5,
fixedColumns: true,
renderDefault: true,
searchFormVisible: true,
@ -125,6 +125,12 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
"10": "my_dispatch"
}
},
{
field: 'order_remark',
title: '标记',
operate: 'like',
autocomplete: false
},
{
field: 'create_time',
title: __('Create_time'),
@ -381,6 +387,45 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
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",
text: "复制信息",

View File

@ -34,7 +34,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
params.op = JSON.stringify(op);
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,
pk: 'id',
sortName: 'update_time',
@ -132,6 +148,7 @@ 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');

View File

@ -436,6 +436,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
// 判断 #c-action 是否存在且有值
const $action = $("#c-action");
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() {
//console.log("sb:计算利润...");
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-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 toggleReceiveFields() {
const type = $('#receive_type').val();
if (type === '0') {
$('#other_info').show();
} else {
$('#other_info').hide();
}
}
toggleReceiveFields();
$('#receive_type').on('change', function () {
toggleReceiveFields();
});
},
addrecord: function () {
Controller.api.bindevent();

34
sql/sync.sh Normal file
View 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
View File