发布测试版 2.5.0
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
|
||||
use DB;
|
||||
use Request;
|
||||
use Gdoo\Index\Services\InfoService;
|
||||
|
||||
use Gdoo\Index\Controllers\DefaultController;
|
||||
use Gdoo\Index\Services\InfoService;
|
||||
|
||||
class WidgetController extends DefaultController
|
||||
{
|
||||
public $permission = ['birthday', 'customerCount', 'customerContactCount'];
|
||||
|
||||
// 生日提醒
|
||||
// 客户生日
|
||||
public function birthday()
|
||||
{
|
||||
if (Request::method() == 'POST') {
|
||||
@@ -30,12 +30,11 @@ class WidgetController extends DefaultController
|
||||
(datediff(dd, getdate(), dateadd(year, datediff(year, head_birthday, getdate())+1, head_birthday)) between 0 and 7)')
|
||||
->selectRaw('id, code, name, head_name, head_phone, head_birthday')
|
||||
->get();
|
||||
}
|
||||
else if($this->dbType == 'mysql') {
|
||||
} else if($this->dbType == 'mysql') {
|
||||
$model->whereRaw("
|
||||
(concat(year(now()), DATE_FORMAT(head_birthday,'-%m-%d')) BETWEEN DATE_FORMAT(now(),'%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(now(), interval 10 day),'%Y-%m-%d'))
|
||||
(concat(year(now()), DATE_FORMAT(head_birthday,'-%m-%d')) BETWEEN DATE_FORMAT(now(),'%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(now(), interval 7 day),'%Y-%m-%d'))
|
||||
OR
|
||||
(concat(year(now()) + 1, DATE_FORMAT(head_birthday,'-%m-%d')) BETWEEN DATE_FORMAT(now(),'%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(now(), interval 10 day),'%Y-%m-%d'))")
|
||||
(concat(year(now()) + 1, DATE_FORMAT(head_birthday,'-%m-%d')) BETWEEN DATE_FORMAT(now(),'%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(now(), interval 7 day),'%Y-%m-%d'))")
|
||||
->selectRaw("id, code, name, head_name, head_phone, concat(year(now()), DATE_FORMAT(head_birthday,'-%m-%d')) as head_birthday");
|
||||
}
|
||||
|
||||
@@ -78,12 +77,7 @@ class WidgetController extends DefaultController
|
||||
'count2' => $count2,
|
||||
'rate' => $rate,
|
||||
];
|
||||
|
||||
return $this->render([
|
||||
'dates' => $config['dates'],
|
||||
'info' => $config['info'],
|
||||
'res' => $res,
|
||||
]);
|
||||
return $this->json($res, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,11 +101,6 @@ class WidgetController extends DefaultController
|
||||
'count2' => $count2,
|
||||
'rate' => $rate,
|
||||
];
|
||||
|
||||
return $this->render([
|
||||
'dates' => $config['dates'],
|
||||
'info' => $config['info'],
|
||||
'res' => $res,
|
||||
]);
|
||||
return $this->json($res, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ class CustomerApplyHook
|
||||
bank_account,
|
||||
bank_address
|
||||
')->first();
|
||||
|
||||
$apply['status'] = 1;
|
||||
|
||||
// 新建用户
|
||||
$_user = [
|
||||
|
||||
@@ -19,7 +19,7 @@ class CustomerHook
|
||||
public function onBeforeStore($params)
|
||||
{
|
||||
$master = $params['master'];
|
||||
|
||||
|
||||
$_user = [
|
||||
'role_id' => 2,
|
||||
'group_id' => 2,
|
||||
@@ -45,7 +45,7 @@ class CustomerHook
|
||||
// 客户开票单位为空
|
||||
$count = CustomerTax::where('customer_id', $master['id'])->count();
|
||||
if ($count == 0) {
|
||||
// 自动新建开票单位
|
||||
// 新建开票单位
|
||||
CustomerTax::insert([
|
||||
'code' => $master['code'],
|
||||
'name' => $master['name'],
|
||||
@@ -65,6 +65,7 @@ class CustomerHook
|
||||
if ($ret['error_code'] > 0) {
|
||||
abort_error($ret['msg']);
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ class TaxHook
|
||||
}
|
||||
|
||||
public function onAfterStore($params) {
|
||||
|
||||
$master = $params['master'];
|
||||
|
||||
// 开票单位同步外部接口
|
||||
|
||||
@@ -50,19 +50,22 @@ return [
|
||||
'name' => '客户生日',
|
||||
'type' => 1,
|
||||
'url' => 'customer/widget/birthday',
|
||||
'more_url' => 'customer/customer/birthday',
|
||||
'more_url' => 'customer/customer/index',
|
||||
'params' => ['permission' => 'dept2', 'date' => 'last_day7'],
|
||||
],
|
||||
'info_customer_count' => [
|
||||
'name' => '客户',
|
||||
'type' => 2,
|
||||
'url' => 'customer/widget/customerCount',
|
||||
'more_url' => 'customer/customer/index',
|
||||
'params' => ['permission' => 'dept2', 'date' => 'month'],
|
||||
],
|
||||
'info_customer_contact_count' => [
|
||||
'name' => '客户联系人',
|
||||
'type' => 2,
|
||||
'url' => 'customer/widget/customerContactCount',
|
||||
'more_url' => 'customer/contact/index',
|
||||
'params' => ['permission' => 'dept2', 'date' => 'month'],
|
||||
],
|
||||
],
|
||||
"listens" => [
|
||||
|
||||
@@ -31,8 +31,6 @@ Vue.createApp({
|
||||
|
||||
var setup = config.setup;
|
||||
|
||||
console.log(setup);
|
||||
|
||||
Vue.onMounted(function() {
|
||||
var gridDiv = config.div(136);
|
||||
// 初始化数据
|
||||
|
||||
@@ -34,7 +34,8 @@ Vue.createApp({
|
||||
Vue.onMounted(function() {
|
||||
var gridDiv = config.div(136);
|
||||
// 初始化数据
|
||||
grid.remoteData({page: 1}, function(res) {
|
||||
grid.remoteData({page: 1}, function(res)
|
||||
{
|
||||
config.init(res);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
grid.remoteDataUrl = '{{url()}}';
|
||||
grid.remoteParams = {};
|
||||
var columnDefs = [
|
||||
{suppressMenu: true, cellClass:'text-center', field: "code", headerName: '客户编码', width: 120},
|
||||
{suppressMenu: true, cellClass:'text-center', field: "name", headerName: '客户名称', minWidth: 160},
|
||||
{suppressMenu: true, cellClass:'text-center', field: "head_name", headerName: '法人', width: 120},
|
||||
{suppressMenu: true, cellClass:'text-center', field: "head_phone", headerName: '法人手机', width: 120},
|
||||
{suppressMenu: true, cellClass:'text-center', field: "head_birthday", headerName: '法人生日', width: 120},
|
||||
{suppressMenu: true, cellClass:'text-center', field: "id", headerName: 'ID', width: 80}
|
||||
{suppressMenu: true, type:'sn', cellClass:'text-center', headerName: '序号', width: 60},
|
||||
{suppressMenu: true, field: "code", cellClass:'text-center', headerName: '客户编码', width: 120},
|
||||
{suppressMenu: true, field: "name", cellClass:'text-center', headerName: '客户名称', minWidth: 260},
|
||||
{suppressMenu: true, field: "head_name", cellClass:'text-center', headerName: '法人', width: 120},
|
||||
{suppressMenu: true, field: "head_phone", cellClass:'text-center', headerName: '法人手机', width: 120},
|
||||
{suppressMenu: true, field: "head_birthday", cellClass:'text-center', headerName: '法人生日', width: 120},
|
||||
];
|
||||
|
||||
grid.onRowDoubleClicked = function(row) {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<div class="panel panel-shadow info-skin1">
|
||||
<div class="info-l hidden-xs" style="background-color:{{$info['color']}}">
|
||||
<i class="fa fa-2x {{$info['icon']}}"></i>
|
||||
</div>
|
||||
<div class="info-c">
|
||||
<div class="info-name">{{$info['name']}}</div>
|
||||
<a href="javascript:;" data-toggle="addtab" data-url="{{$info['more_url']}}" data-id="{{str_replace(['/', '?', '='], ['_', '_', '_'], $info['more_url'])}}" data-name="{{$info['name']}}">
|
||||
<div class="text-info info-item" data-id="{{$info['id']}}" data-more_url="{{$info['more_url']}}">{{$res['count']}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="info-r">
|
||||
<div>比{{$dates[$info['params']['date']]}}</div>
|
||||
<div class="rate @if($res['rate'] > 100) red @endif">{{$res['rate']}}%</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,15 +0,0 @@
|
||||
<div class="panel panel-shadow info-skin1">
|
||||
<div class="info-l hidden-xs" style="background-color:{{$info['color']}}">
|
||||
<i class="fa fa-2x {{$info['icon']}}"></i>
|
||||
</div>
|
||||
<div class="info-c">
|
||||
<div class="info-name">{{$info['name']}}</div>
|
||||
<a href="javascript:;" data-toggle="addtab" data-url="{{$info['more_url']}}" data-id="{{str_replace(['/', '?', '='], ['_', '_', '_'], $info['more_url'])}}" data-name="{{$info['name']}}">
|
||||
<div class="text-info info-item" data-id="{{$info['id']}}" data-more_url="{{$info['more_url']}}">{{$res['count']}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="info-r">
|
||||
<div>比{{$dates[$info['params']['date']]}}</div>
|
||||
<div class="rate @if($res['rate'] > 100) red @endif">{{$res['rate']}}%</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user