Accept Merge Request #97: (feature/hant -> develop)

Merge Request: 修改

Created By: @todayswind
Accepted By: @todayswind
URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/97?initial=true
This commit is contained in:
todayswind 2025-06-03 15:40:21 +08:00 committed by Coding
commit 5b3bd1aa00
14 changed files with 79 additions and 35 deletions

View File

@ -1,7 +1,5 @@
require([], function () {
//绑定data-toggle=addresspicker属性点击事件
console.log('111');
$(document).on('click', "[data-toggle='addresspicker']", function () {
var that = this;
var callback = $(that).data('callback');

View File

@ -223,7 +223,7 @@ class Dashboard extends Backend
return $this->view->fetch('kpi_presale');
}
$this->error('当前岗位暂未支持');
return $this->view->fetch('kpi_admin');
}

View File

@ -52,7 +52,13 @@ class Orderplan extends Backend
public function dashboard()
{
return $this->fetch('orderplan/index');
$start = now()->modify('-14 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d');
$default_daterange = $start . ' - ' . $end_at;
return $this->fetch('orderplan/index',[
'default_daterange' => $default_daterange
]);
}
public function data()
@ -144,7 +150,7 @@ class Orderplan extends Backend
private function getPie()
{
$build = new OrderAbnormal();
$res = $this->buildDate($build)
$res = $this->buildDate($build,name:'create_time')
->field([
'abnormal_title name',
'count(id) value',
@ -212,7 +218,7 @@ class Orderplan extends Backend
}
private function buildDate($build, $table_name = null)
private function buildDate($build, $table_name = null,$name = 'audit_time')
{
$start = now()->modify('-14 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d 23:29:59');
@ -228,9 +234,9 @@ class Orderplan extends Backend
}
// dd([$start, $end_at]);
if ($table_name) {
$build->where($table_name . '.create_time', 'between', [$start, $end_at]);
$build->where($table_name . '.'.$name, 'between', [$start, $end_at]);
} else {
$build->where('create_time', 'between', [$start, $end_at]);
$build->where($name, 'between', [$start, $end_at]);
}
return $build;

View File

@ -108,8 +108,9 @@ class Auditorder extends Backend
$this->error(__('You have no permission'));
}
if (false === $this->request->isPost()) {
$order = Order::where('id',$ids)->find();
$this->view->assign('row', $row);
$this->view->assign('worker',Worker::where('status',$order->worker_id)->find());
$this->view->assign('worker',Worker::where('id',$order->worker_id)->find());
return $this->view->fetch();
}
$params = $this->request->post('row/a');

View File

@ -136,8 +136,8 @@ class Configorder extends Backend
'amount_images' => $params['amount_images'],
'material_cost' => $params['material_cost'],
'cost_rate' => $params['cost_rate'],
'cost_remark' => $params['cost_remark'],
'material_images' => $params['material_images'],
'cost_remark' => $params['cost_remark'] ?? '',
'material_images' => $params['material_images'] ?? '',
];
$last_amount = bcadd($params['online_amount_last'],$params['offline_amount'],2);

View File

@ -29,12 +29,18 @@ class Aftersale extends Backend
->order('pid', 'asc')
->order('sort', 'desc')
->select();
$start = now()->modify('-30 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d');
$default_daterange = $start . ' - ' . $end_at;
$tree = $this->buildTree($items);
$formattedTree = $this->formatTree($tree);
$this->items = $items;
$this->itemsformattedTree = $formattedTree;
$this->view->assign("items", $formattedTree);
$this->view->assign("default_daterange", $default_daterange);
parent::_initialize();
}

View File

@ -35,7 +35,12 @@ class Item extends Backend
public function index()
{
return $this->fetch('index');
$start = now()->modify('-7 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d');
$default_daterange = $start . ' - ' . $end_at;
return $this->fetch('index',[
'default_daterange' => $default_daterange
]);
}
public function list()
@ -63,7 +68,7 @@ class Item extends Backend
}
$build->whereBetween('create_time', [$start, $end_at])
$build->whereBetween('audit_time', [$start, $end_at])
->field([
'item_title name', // 类型
'sum(total) total', // 营业额
@ -140,7 +145,7 @@ class Item extends Backend
}
}
$res = $build->whereBetween('create_time', [$start, $end_at])
$res = $build->whereBetween('audit_time', [$start, $end_at])
->where('status', Order::STATUS_FINISHED)
->field([
'item_title name', // 类型

View File

@ -0,0 +1,9 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<h1>KPI面板</h1>
</div>
<div class="panel-body">
<div class="row">
</div>
</div>
</div>

View File

@ -36,7 +36,7 @@
<!-- 单选:维度 -->
<!-- 时间范围 -->
<div class="form-group" style="margin-left: 15px;">
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 180px;">
<input type="text" class="form-control datetimerange" value = "{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 180px;">
</div>
<!-- 查询按钮 -->

View File

@ -126,10 +126,18 @@
</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 readonly class="form-control" type="text" value="{$worker.name|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 readonly class="form-control" step="0.01" type="number" value="{$row.cost_rate|htmlentities}">
<input readonly class="form-control" step="0.01" type="number" value="{$worker.rate|htmlentities}">
</div>
</div>

View File

@ -91,13 +91,28 @@
</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 readonly min="0" max="100" step="1" class="form-control" value="{$worker->name}" />
</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-cost_rate" data-rule="required" name="row[cost_rate]" type="number" min="0" max="100" step="1" class="form-control" value="{$rate|htmlentities}">
<input readonly name="row[cost_rate]" type="number" min="0" max="100" step="1" class="form-control" value="{$worker.rate|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 readonly type="text" class="form-control" value="{$worker.rate_remark}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Cost')}:</label>
<div class="col-xs-12 col-sm-8">
@ -105,16 +120,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-cost_remark" data-rule="required" name="row[cost_remark]" type="text" class="form-control" value="{$row.cost_remark}">
</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">
@ -184,11 +189,17 @@
</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 readonly min="0" max="100" step="1" class="form-control" value="{$worker->name}" />
</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 name="row[cost_rate]" readonly type="number" min="0" max="100" step="1" class="form-control" value="{$worker.rate|htmlentities}">
<input name="row[cost_rate]" readonly type="number" min="0" max="100" step="1" class="form-control" value="{$worker.rate|htmlentities}" />
</div>
</div>

View File

@ -178,7 +178,7 @@
<div id="chart-filter-table" style="margin-top:20px;margin-bottom: 30px;">
<div style="display: flex;position: relative" class="col-sm-6 row">
<input type="text" style="max-width: 200px" class="form-control mr-2" id="keyword" placeholder="名称/电话号码" >
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
placeholder="指定日期" name="filter[daterange]" id="daterange-table" autocomplete="off" style="width: 180px;">
<button class="btn btn-default ml-2" id="first-search">查询</button>
</div>
@ -200,7 +200,7 @@
<input id="area_id" style="display: none" class="form-control" name="area_id" hidden type="text" />
</div>
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
placeholder="指定日期" name="filter[daterange]" id="daterange-table2" autocomplete="off" style="position: absolute;left: 320px;width: 180px;">
<button class="btn btn-default ml-2" id="first-search2" style="position: absolute;left: 500px;">查询</button>
</div>
@ -221,7 +221,7 @@
</div>
<input type="text" id="item_id_value" style="display: none" name="row[item_id]">
<input type="text" class="form-control datetimerange ml-2" style="max-width: 200px" data-locale='{"format":"YYYY-MM-DD"}'
placeholder="指定日期" name="filter[daterange]" id="daterange-table3" autocomplete="off" >
placeholder="指定日期" name="filter[daterange]" value="{$default_daterange}" id="daterange-table3" autocomplete="off" >
<button class="btn btn-default ml-2" id="first-search3">查询</button>
</div>
<!-- 查询按钮 -->
@ -237,7 +237,7 @@
<div id="chart-filter-table4" style="margin-top:20px;margin-bottom: 30px;">
<div style="display: flex;position: relative" class="col-sm-6 row">
<input type="text" style="max-width: 200px" class="form-control mr-2" id="keyword4" placeholder="名称/电话号码" >
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
<input type="text" class="form-control datetimerange" value="{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}'
placeholder="指定日期" name="filter[daterange]" id="daterange-table4" autocomplete="off" style="width: 180px;">
<button class="btn btn-default ml-2" id="first-search4">查询</button>
</div>

View File

@ -26,7 +26,7 @@
<div class="form-inline" id="chart-filter" style="margin-top:20px;margin-bottom: 30px;">
<!-- 时间范围 -->
<div class="form-group" style="margin-left: 15px;">
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 200px;">
<input type="text" class="form-control datetimerange" value = "{$default_daterange}" data-locale='{"format":"YYYY-MM-DD"}' placeholder="指定日期" name="filter[daterange]" id="daterange" autocomplete="off" style="width: 200px;">
</div>
<!-- 查询按钮 -->
@ -50,6 +50,7 @@
</div>
<div style="display: inline-block;width: 200px;position: relative">
<input type="text" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD"}'
value = "{$default_daterange}"
placeholder="指定日期" name="filter[daterange]" id="daterange-table" autocomplete="off" style="width: 180px;">
</div>
<!-- 查询按钮 -->

View File

@ -1,7 +1,6 @@
define([], function () {
require([], function () {
//绑定data-toggle=addresspicker属性点击事件
console.log('111');
$(document).on('click', "[data-toggle='addresspicker']", function () {
var that = this;