完善打印相关功能
去掉无用的前端文件 修改版权描述
This commit is contained in:
@@ -30,8 +30,8 @@ class ApiController extends Controller
|
||||
$settings['public_url'] = URL::to('/');
|
||||
$settings['upload_file_type'] = $this->setting['upload_type'];
|
||||
$settings['upload_max_size'] = $this->setting['upload_max'];
|
||||
$settings['openSource'] = $this->openSource;
|
||||
|
||||
$settings['realtime'] = not_empty(env('REALTIME_KEY'));
|
||||
|
||||
header('Content-type: text/javascript');
|
||||
echo 'var settings = '. json_encode($settings, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
|
||||
@@ -27,11 +27,6 @@ class Controller extends BaseController
|
||||
*/
|
||||
public $powered = 'Gdoo';
|
||||
|
||||
/**
|
||||
* @var 是否开源版
|
||||
*/
|
||||
public $openSource = false;
|
||||
|
||||
/**
|
||||
* @var 配置参数
|
||||
*/
|
||||
@@ -79,14 +74,14 @@ class Controller extends BaseController
|
||||
$this->ret = RetService::make();
|
||||
|
||||
View::share([
|
||||
'title' => 'GdooOA',
|
||||
'title' => 'Gdoo',
|
||||
'setting' => $this->setting,
|
||||
'public_url' => URL::to('/'),
|
||||
'upload_url' => URL::to('/uploads'),
|
||||
'static_url' => URL::to('/static'),
|
||||
'asset_url' => URL::to('/assets'),
|
||||
'version' => $this->version,
|
||||
'openSource' => $this->openSource,
|
||||
'licenseType' => env('LICENSE_TYPE'),
|
||||
'resVersion' => $this->resVersion,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class NotificationService
|
||||
*/
|
||||
public static function wechatTemplate($users, $content)
|
||||
{
|
||||
if (env('WECHAT_MESSAGE_PUSH_STATUS') === false) {
|
||||
if (env('WECHAT_MESSAGE_PUSH') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ a { outline: none; }
|
||||
|
||||
<div class="dashboard-footer">
|
||||
<div class="box">
|
||||
{{$version}} {{$openSource ? '开源版' : '企业版'}}
|
||||
{{$version}} {{$licenseType ? $licenseType : '开源版'}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,501 +0,0 @@
|
||||
<style type="text/css">
|
||||
html {
|
||||
overflow: hidden;
|
||||
}
|
||||
a { outline: none; }
|
||||
|
||||
.dashboard-widget-header {
|
||||
margin-top: 49px;
|
||||
height: calc(100vh - 80px);
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.dashboard-title {
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
border-bottom: solid 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.dashboard-title .btn {
|
||||
border: solid 1px rgba(0, 0, 0, 0.15);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.dashboard-config {
|
||||
text-align: center;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
width: 26px;
|
||||
display: block;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
border: solid 1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.dashboard-config .fa {
|
||||
color: #999;
|
||||
}
|
||||
.dashboard-config:hover {
|
||||
border: solid 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.dashboard-config:hover .fa {
|
||||
color: #2490f8;
|
||||
}
|
||||
|
||||
.panel-heading {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.content-body { margin: 0; }
|
||||
.content-body .panel:last-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.frame-green .dashboard-title {
|
||||
color: #fff;
|
||||
}
|
||||
.frame-primary .dashboard-title {
|
||||
color: #58666e;
|
||||
}
|
||||
.frame-blue .dashboard-title {
|
||||
color: #fff;
|
||||
}
|
||||
.frame-blue2 .dashboard-title {
|
||||
color: #1890ff;
|
||||
}
|
||||
|
||||
.frame-blue .quick-text .title,
|
||||
.frame-purple .quick-text .title,
|
||||
.frame-green .quick-text .title,
|
||||
.frame-lilac .quick-text .title,
|
||||
.frame-wood .quick-text .title {
|
||||
color: #fff;
|
||||
}
|
||||
.frame-blue .dashboard-title .btn,
|
||||
.frame-purple .dashboard-title .btn,
|
||||
.frame-green .dashboard-title .btn,
|
||||
.frame-lilac .dashboard-title .btn,
|
||||
.frame-wood .dashboard-title .btn {
|
||||
border: solid 1px rgba(0, 0, 0, 0.15);
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.panel-shadow {
|
||||
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.03);
|
||||
border: solid 1px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 4px !important;
|
||||
}
|
||||
|
||||
.frame-blue .panel-shadow,
|
||||
.frame-purple .panel-shadow,
|
||||
.frame-green .panel-shadow,
|
||||
.frame-lilac .panel-shadow,
|
||||
.frame-wood .panel-shadow {
|
||||
border: solid 0;
|
||||
}
|
||||
|
||||
.row-sm { margin-left: 5px; margin-right: 5px; }
|
||||
.row-sm > div { padding-left: 5px; padding-right: 5px; }
|
||||
.row-sm > div > .panel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.row-info .panel { display: flex; padding-bottom: 10px; position: relative; text-align: center; border-radius: 4px !important; }
|
||||
.row-info .widget-droppable div { border-radius: 4px; }
|
||||
.info-l { color: #fff; margin-top:16px; margin-left: 15px; border-radius: 50%; width: 50px; height:50px; line-height:58px; vertical-align: middle; }
|
||||
|
||||
.info-c { flex:1; margin-left: 15px; text-align: left; }
|
||||
.info-c .info-name { margin-top:18px; font-size: 14px; color: #666; }
|
||||
.info-c .info-item { font-size: 24px; color: #333; }
|
||||
|
||||
.info-r { margin-left: auto; margin-top:18px; width: 70px; line-height:22px; }
|
||||
.info-r .rate { color: #2bbf24; }
|
||||
.info-r::before { position:absolute;top:22px;content:"";width:1px;height:40px;background-color:#e6e6e6;display:block; }
|
||||
|
||||
.app-title {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.app-title a {
|
||||
color: #999;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.app-title a:hover {
|
||||
color: #0e90d2;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.widget-item {
|
||||
min-height: 200px;
|
||||
}
|
||||
.todo-text { margin-left: 60px; }
|
||||
}
|
||||
|
||||
.widget-droppable div {
|
||||
border: 1px dashed #23b7e5;
|
||||
background: #dcf2f8;
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.row-widget .panel-heading {
|
||||
padding: 10px;
|
||||
color: #2490f8;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
}
|
||||
.row-widget .widget-item {
|
||||
text-align: left;
|
||||
}
|
||||
.row-widget .widget-item .red {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.row-widget .widget-droppable div {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.ag-theme-balham .ag-header {
|
||||
border-bottom: 1px solid #dee5e7;
|
||||
}
|
||||
.ag-theme-balham .ag-header-cell::after, .ag-theme-balham .ag-header-group-cell::after {
|
||||
border-right: 0 !important;
|
||||
}
|
||||
|
||||
.dashboard-footer {
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
box-shadow: 20px 0px 8px 0 rgba(29,35,41,.05);
|
||||
border-top: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.dashboard-footer .box {
|
||||
padding: 6px;
|
||||
padding-bottom: 8px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
}
|
||||
.dashboard-footer .box a {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
background: -webkit-linear-gradient(-70deg, #db469f, #2188ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
.dashboard-footer .box a:hover {
|
||||
color: #0e90d2;
|
||||
}
|
||||
|
||||
.row-quick {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
.quick-text {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.quick-text .title {
|
||||
text-align: center;
|
||||
padding-top: 5px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.quick-icon .quick-num {
|
||||
font-family: Arial;
|
||||
position: absolute;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
right: -5px;
|
||||
top: -5px;
|
||||
background: #f00;
|
||||
border-radius: 100%;
|
||||
border: solid 1px #f05050;
|
||||
display: none;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.quick-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
border-radius: 5px;
|
||||
border: solid 1px rgba(255,255,255,0.1);
|
||||
box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.15);
|
||||
position: relative;
|
||||
}
|
||||
.quick-icon .fa {
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="dashboard-widget">
|
||||
|
||||
<div class="dashboard-title">
|
||||
<div class="pull-right">
|
||||
<a class="dashboard-config" data-toggle="dashboard-config" title="仪表盘设置">
|
||||
<i class="fa fa-gear"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="font-thin">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="fa fa-filter"></span> 本部门下属部门
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#">本人</a></li>
|
||||
<li><a href="#">本人和下属</a></li>
|
||||
<li><a href="#">本部门</a></li>
|
||||
<li class="active"><a href="#">本部门下属部门</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class=""><a href="#">自定义</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group m-l-xs" role="group">
|
||||
<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="fa fa-filter"></span> 本月
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#">今天</a></li>
|
||||
<li><a href="#">昨天</a></li>
|
||||
<li><a href="#">本周</a></li>
|
||||
<li><a href="#">上周</a></li>
|
||||
<li class="active"><a href="#">本月</a></li>
|
||||
<li><a href="#">上月</a></li>
|
||||
<li><a href="#">本季度</a></li>
|
||||
<li><a href="#">上季度</a></li>
|
||||
<li><a href="#">本年</a></li>
|
||||
<li><a href="#">去年</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class=""><a href="#">自定义</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-widget-header">
|
||||
<div class="row-quick m-t-sm">
|
||||
<div class="row row-sm">
|
||||
@forelse($quicks as $quick)
|
||||
<div class="quick-text">
|
||||
<a href="javascript:;" data-toggle="addtab" data-url="{{$quick['url']}}" data-id="{{$quick['key']}}" data-name="{{$quick['name']}}">
|
||||
<div class="quick-icon quick-item" style="background-color:{{$quick['color']}}" data-url="{{$quick['url']}}" data-key="{{$quick['key']}}">
|
||||
<i class="fa fa-3x {{$quick['icon']}}"></i>
|
||||
<span class="quick-num">0</span>
|
||||
</div>
|
||||
<div class="title">{{$quick['name']}}</div>
|
||||
</a>
|
||||
</div>
|
||||
@empty
|
||||
<div class="quick-text">
|
||||
<a href="javascript:;" data-toggle="dashboard-config">
|
||||
<div class="quick-icon" style="background-color:#13D06C;">
|
||||
<i class="fa fa-3x fa-plus"></i>
|
||||
</div>
|
||||
<div class="title">添加快捷</div>
|
||||
</a>
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-sm row-info">
|
||||
@foreach($infos as $info)
|
||||
@if($info['status'])
|
||||
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
|
||||
<div class="panel panel-shadow">
|
||||
<div class="info-l hidden-xs bg-{{$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-url="{{$info['url']}}" data-more_url="{{$info['more_url']}}"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="info-r">
|
||||
<div>较上月</div>
|
||||
<div class="rate">50%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="row row-sm row-widget">
|
||||
@foreach($grids as $grid)
|
||||
<div class="col-xs-12 col-sm-{{$grid}}">
|
||||
@foreach($widgets as $widget)
|
||||
@if($widget['status'])
|
||||
@if($widget['grid'] == $grid)
|
||||
<div class="panel panel-shadow">
|
||||
<div class="panel-heading text-base b-b">
|
||||
<div class="pull-right"></div>
|
||||
<a data-toggle='widget-refresh' data-url="{{$widget['url']}}" data-key="{{str_replace(['/', '?', '='], ['_', '_', '_'], $widget['url'])}}" data-id="{{$widget['id']}}">{{$widget['name']}}</a>
|
||||
</div>
|
||||
<div class="widget-item" id="widget_item_{{$widget['id']}}" data-url="{{$widget['url']}}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-footer">
|
||||
<div class="box">
|
||||
{{$version}} {{$openSource ? '开源版' : '企业版'}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.ag-theme-balham .ag-root {
|
||||
border: 0;
|
||||
}
|
||||
.ag-theme-balham .ag-status-bar {
|
||||
border: 0;
|
||||
}
|
||||
.ag-theme-balham .ag-header {
|
||||
background-color: #fff;
|
||||
}
|
||||
.ag-theme-balham .ag-header-cell, .ag-theme-balham .ag-header-group-cell {
|
||||
border-right: transparent;
|
||||
}
|
||||
.ag-theme-balham .ag-ltr .ag-cell {
|
||||
border-width: 0 0 0 0;
|
||||
border-right-color: #d9dcde;
|
||||
}
|
||||
.ag-theme-balham .ag-header-cell::after, .ag-theme-balham .ag-header-group-cell::after {
|
||||
border-right: 1px solid rgba(189, 195, 199, 0.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
(function($) {
|
||||
var $document = $(document);
|
||||
|
||||
var myProcess = null;
|
||||
|
||||
function widgetRefresh() {
|
||||
if (myProcess) {
|
||||
var items = $('.widget-item');
|
||||
items.each(function(index, item) {
|
||||
var data = $(item).data();
|
||||
if (data.key) {
|
||||
gdoo.widgets[data.key].remoteData({page: 1});
|
||||
console.log('refresh item:' + data.key);
|
||||
}
|
||||
});
|
||||
}
|
||||
myProcess = setTimeout(function() {
|
||||
widgetRefresh();
|
||||
}, 1000 * 60 * 5);
|
||||
}
|
||||
|
||||
widgetRefresh();
|
||||
|
||||
$document.on('click', '[data-toggle="addtab"]', function(event) {
|
||||
event.preventDefault();
|
||||
// 触屏设备不触发事件
|
||||
var mq = top.checkMQ();
|
||||
if ($(this).parent().find('ul').length) {
|
||||
if(mq == 'mobile' || mq == 'tablet') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 无ID不触发事件
|
||||
var data = $(this).data();
|
||||
if(data.id == undefined) {
|
||||
return false;
|
||||
}
|
||||
top.addTab(data.url, data.id, data.name);
|
||||
});
|
||||
|
||||
$('[data-toggle="dashboard-config"]').on('click', function() {
|
||||
formDialog({
|
||||
title: '仪表盘设置',
|
||||
url: app.url('index/dashboard/config'),
|
||||
id: 'widget-edit',
|
||||
dialogClass:'modal-lg',
|
||||
success: function(res) {
|
||||
location.reload();
|
||||
toastrSuccess(res.data);
|
||||
$(this).dialog("close");
|
||||
},
|
||||
error: function(res) {
|
||||
toastrError(res.data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('[data-toggle="widget-refresh"]').on('click', function() {
|
||||
var data = $(this).data();
|
||||
if (data.key) {
|
||||
gdoo.widgets[data.key].remoteData({page: 1});
|
||||
}
|
||||
});
|
||||
|
||||
function widgetInit() {
|
||||
var items = $('.widget-item');
|
||||
items.each(function(index, item) {
|
||||
var data = $(item).data();
|
||||
if (data == undefined) {
|
||||
return false;
|
||||
}
|
||||
if (data.url) {
|
||||
$(item).load(app.url(data.url, {id: data.id}));
|
||||
}
|
||||
});
|
||||
|
||||
var items = $('.info-item');
|
||||
items.each(function(index, item) {
|
||||
var me = $(item);
|
||||
var data = me.data();
|
||||
$.get(app.url('index/index/info', {type: data.url}), function(res) {
|
||||
if(res > 0) {
|
||||
me.removeClass('text-info').addClass('text-danger');
|
||||
} else {
|
||||
me.removeClass('text-danger').addClass('text-info');
|
||||
}
|
||||
me.text(res);
|
||||
});
|
||||
});
|
||||
|
||||
var items = $('.quick-item');
|
||||
items.each(function(index, item) {
|
||||
var me = $(item);
|
||||
var data = me.data();
|
||||
$.get(app.url('index/index/badge', {key: data.key}), function(res) {
|
||||
if(res.total > 0) {
|
||||
me.find('.quick-num').show().text(res.total);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
widgetInit();
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
软件版本
|
||||
</td>
|
||||
<td align="left" style="border-top:0;">
|
||||
{{$version}} {{$openSource ? '开源版' : '企业版'}}
|
||||
{{$version}} {{$licenseType ? $licenseType : '开源版'}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -26,11 +26,19 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
支持方式
|
||||
联系方式
|
||||
</td>
|
||||
<td align="left">
|
||||
15182223008(电话/微信)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
QQ交流群
|
||||
</td>
|
||||
<td align="left">
|
||||
79446405
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -224,10 +224,10 @@
|
||||
<div class="form-group">
|
||||
<label for="set_col">打印方式</label>
|
||||
<div class="form-text">
|
||||
<select class="input-select2 form-control input-sm" id="print_type" name="print_type" data-width="100%">
|
||||
<option value=""> </option>
|
||||
<select class="input-select2 form-control input-sm" id="print_type" name="print_type" data-width="100%">
|
||||
<option value="html" @if($template['print_type'] == 'html') selected @endif>html</option>
|
||||
<option value="stiReport" @if($template['print_type'] == 'stiReport') selected @endif>StiReport</option>
|
||||
<option value="pdf" @if($template['print_type'] == 'pdf') selected @endif>pdf</option>
|
||||
<option value="stiReport" @if($template['print_type'] == 'stiReport') selected @endif>stiReport</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -773,50 +773,40 @@ class OrderController extends WorkflowController
|
||||
// 显示促销
|
||||
public function printAction()
|
||||
{
|
||||
$this->layout = 'layouts.print2';
|
||||
|
||||
$id = Request::get('id');
|
||||
$template_id = Request::get('template_id');
|
||||
if ($template_id == 121) {
|
||||
$template = DB::table('model_template')->where('id', $template_id)->first();
|
||||
$print_type = $template['print_type'];
|
||||
$this->layout = 'layouts.print_'.$print_type;
|
||||
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
|
||||
|
||||
$master = DB::table('customer_order as co')->where('co.id', $id)
|
||||
->leftJoin('customer as c', 'c.id', '=', 'co.customer_id')
|
||||
->leftJoin('customer_tax as ct', 'ct.id', '=', 'co.tax_id')
|
||||
->leftJoin('sale_type as st', 'st.id', '=', 'co.type_id')
|
||||
->selectRaw('co.*, ct.name as tax_name, c.name as customer_name, st.name as type_name')
|
||||
->first();
|
||||
$form = [
|
||||
'template' => $template,
|
||||
];
|
||||
|
||||
$rows = DB::table('customer_order_data as cod')
|
||||
->leftJoin('customer_order as co', 'co.id', '=', 'cod.order_id')
|
||||
->leftJoin('product as p', 'p.id', '=', 'cod.product_id')
|
||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
||||
->leftJoin('customer_order_type as cot', 'cot.id', '=', 'cod.type_id')
|
||||
->where('co.id', $id)
|
||||
->selectRaw('
|
||||
cod.*,
|
||||
cod.delivery_quantity * p.weight as total_weight,
|
||||
p.name as product_name,
|
||||
p.spec as product_spec,
|
||||
cot.name as type_name,
|
||||
pu.name as product_unit,
|
||||
p.material_type,
|
||||
p.product_type
|
||||
')
|
||||
->get();
|
||||
|
||||
$form = [
|
||||
'template' => DB::table('model_template')->where('id', $template_id)->first()
|
||||
];
|
||||
|
||||
$tpl = $this->display([
|
||||
'master' => $master,
|
||||
'rows' => $rows,
|
||||
'form' => $form,
|
||||
], 'print/'.$template_id);
|
||||
} else {
|
||||
$tpl = $this->createAction('print');
|
||||
if ($print_tpl) {
|
||||
$data = OrderService::getPrintData($id);
|
||||
$data['form'] = $form;
|
||||
$data['template'] = $template;
|
||||
$tpl = $this->display($data, 'print/'.$template_id);
|
||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
||||
}
|
||||
print_prince($tpl);
|
||||
|
||||
if ($print_type == 'stiReport') {
|
||||
$data = OrderService::getPrintData($id);
|
||||
$print_data = [
|
||||
'master' => [$data['master']],
|
||||
'money' => $data['money'],
|
||||
'customer_order_data' => $data['rows'],
|
||||
];
|
||||
return $this->display([
|
||||
'template' => $template,
|
||||
'print_data' => $print_data,
|
||||
]);
|
||||
}
|
||||
|
||||
$tpl = $this->createAction('print');
|
||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,42 @@ class OrderService
|
||||
return BadgeService::getModelTodo('customer_order');
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义查询打印数据
|
||||
*/
|
||||
public static function getPrintData($id)
|
||||
{
|
||||
$master = DB::table('customer_order as co')->where('co.id', $id)
|
||||
->leftJoin('customer as c', 'c.id', '=', 'co.customer_id')
|
||||
->leftJoin('customer_tax as ct', 'ct.id', '=', 'co.tax_id')
|
||||
->leftJoin('sale_type as st', 'st.id', '=', 'co.type_id')
|
||||
->selectRaw('co.*, ct.name as tax_name, c.name as customer_name, st.name as type_name')
|
||||
->first();
|
||||
|
||||
$rows = DB::table('customer_order_data as cod')
|
||||
->leftJoin('customer_order as co', 'co.id', '=', 'cod.order_id')
|
||||
->leftJoin('product as p', 'p.id', '=', 'cod.product_id')
|
||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
||||
->leftJoin('customer_order_type as cot', 'cot.id', '=', 'cod.type_id')
|
||||
->where('co.id', $id)
|
||||
->selectRaw('
|
||||
cod.*,
|
||||
cod.delivery_quantity * p.weight as total_weight,
|
||||
p.name as product_name,
|
||||
p.spec as product_spec,
|
||||
cot.name as type_name,
|
||||
pu.name as product_unit,
|
||||
p.material_type,
|
||||
p.product_type
|
||||
')
|
||||
->get();
|
||||
|
||||
return [
|
||||
'master' => $master,
|
||||
'rows' => $rows,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取为使用的促销id
|
||||
*
|
||||
|
||||
@@ -123,7 +123,7 @@ class TaskController extends DefaultController
|
||||
'name' => $_item['name'],
|
||||
'type' => $_item['type'],
|
||||
'created_at' => '',
|
||||
'user_id' => '',
|
||||
'user_id' => 0,
|
||||
'user_name' => '',
|
||||
'open' => true,
|
||||
'option_edit' => $project_user_id,
|
||||
@@ -154,7 +154,9 @@ class TaskController extends DefaultController
|
||||
$_task['open'] = true;
|
||||
$_task['loaded'] = true;
|
||||
$_task['expanded'] = true;
|
||||
$_task['created_at'] = format_datetime($_item['created_at']);
|
||||
$_task['created_dt'] = format_datetime($_task['created_at']);
|
||||
$_task['start_dt'] = format_datetime($_task['start_at']);
|
||||
$_task['end_dt'] = format_datetime($_task['end_at']);
|
||||
|
||||
if ($_task['start_at'] && $_task['end_at']) {
|
||||
$remain = remain_time($_task['start_at'], $_task['end_at'], '');
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
<script src="{{$asset_url}}/vendor/dhtmlxgantt/dhtmlxgantt_tooltip.js" type="text/javascript"></script>
|
||||
<script src="{{$asset_url}}/vendor/dhtmlxgantt/locale_cn.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="{{$asset_url}}/vendor/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
|
||||
<!--
|
||||
<script src="https://export.dhtmlx.com/gantt/api.js"></script>
|
||||
-->
|
||||
<style type="text/css">
|
||||
/* 新样式 */
|
||||
html, body {
|
||||
@@ -126,9 +123,6 @@ html, body {
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'board'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'board') active @endif">看板</a>
|
||||
-->
|
||||
</div>
|
||||
<!--
|
||||
<input value="导出PDF" class="btn btn-sm btn-default" type="button" onclick='exportToPDF()'>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<a href="{{url($referer)}}" class="btn btn-sm btn-default"><i class="fa fa-reply"></i> 返回</a>
|
||||
@@ -158,9 +152,7 @@ html, body {
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="gantt-view"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -189,7 +181,6 @@ gantt.config.show_links = false;
|
||||
gantt.config.order_branch = true;
|
||||
|
||||
// gantt.config.order_branch_free = true;
|
||||
|
||||
/*
|
||||
var date_to_str = gantt.date.date_to_str(gantt.config.api_date);
|
||||
var today = new Date();
|
||||
@@ -244,13 +235,13 @@ gantt.templates.tooltip_text = function(start, end, task) {
|
||||
gantt.attachEvent('onTaskDblClick', function (task_id) {
|
||||
var task = gantt.getTask(task_id);
|
||||
if(task.type == 'item') {
|
||||
editItem(task_id);
|
||||
editItem(task);
|
||||
}
|
||||
if(task.type == 'task') {
|
||||
editTask(task_id);
|
||||
editTask(task);
|
||||
}
|
||||
if(task.type == 'subtask') {
|
||||
editSubTask(task_id);
|
||||
editSubTask(task);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -279,22 +270,17 @@ gantt.attachEvent('onBeforeTaskDrag', function(task_id, mode, e) {
|
||||
});
|
||||
|
||||
gantt.attachEvent('onAfterTaskDrag', function(task_id, mode, e) {
|
||||
|
||||
var task = gantt.getTask(task_id);
|
||||
|
||||
var data = {id: task.id,progress: task.progress};
|
||||
|
||||
var date_to_str = gantt.date.date_to_str(gantt.config.api_date);
|
||||
data.start_date = date_to_str(task.start_date);
|
||||
data.end_date = date_to_str(task.end_date);
|
||||
|
||||
data.end_date = date_to_str(task.end_date);
|
||||
$.post('{{url("drag")}}', data, function(res) {
|
||||
gantt.render();
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
gantt._do_autosize = function() {
|
||||
|
||||
// 设置高度
|
||||
var height = $('#gantt-wrapper').outerHeight();
|
||||
var iframeHeight = $(window).height();
|
||||
@@ -327,29 +313,15 @@ $('#search-submit').on('click', function() {
|
||||
$.map(query, function(row) {
|
||||
params[row.name] = row.value;
|
||||
});
|
||||
|
||||
dataReload();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function exportToPDF()
|
||||
{
|
||||
gantt.exportToPDF({
|
||||
locale:"cn",
|
||||
skin:'terrace',
|
||||
});
|
||||
}
|
||||
|
||||
function dataReload() {
|
||||
gantt.clearAll();
|
||||
gantt.load(app.url('project/task/index', params));
|
||||
}
|
||||
|
||||
function getTask(id) {
|
||||
return gantt.getTask(id);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('task/index/js')
|
||||
@@ -45,14 +45,14 @@ var auth_id = '{{auth()->id()}}';
|
||||
|
||||
function progressRenderer(params) {
|
||||
var data = params.data;
|
||||
if (data.type == 'task' || data.type == 'subtask') {
|
||||
if (params.value == 1) {
|
||||
return '<span class="label label-success">已完成</span>';
|
||||
} else {
|
||||
return '<span class="label label-' + (auth_id == data.user_id ? 'danger' : 'info') + '">进行中</span>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
if (data.type == 'task' || data.type == 'subtask') {
|
||||
if (params.value == 1) {
|
||||
return '<div class="label label-success">已完成</div>';
|
||||
} else {
|
||||
return '<div class="label label-' + (auth_id == data.user_id ? 'danger' : 'info') + '">进行中</div>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function durationRenderer(params) {
|
||||
@@ -94,23 +94,23 @@ function durationRenderer(params) {
|
||||
{cellClass:'text-center', sortable: false, field: 'user_name', headerName: '执行者', width: 140},
|
||||
{cellClass:'text-center', sortable: false, field: 'users', headerName: '参与者', minWidth: 200},
|
||||
{cellClass:'text-center', cellRenderer: progressRenderer, sortable: false, field: 'progress', headerName: '状态', width: 100},
|
||||
{cellClass:'text-center', sortable: false, field: 'start_at', headerName: '开始时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'end_at', headerName: '结束时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'start_dt', headerName: '开始时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'end_dt', headerName: '结束时间', width: 120},
|
||||
{cellClass:'text-center', cellRenderer: durationRenderer, sortable: false, field: 'duration_date', headerName: '持续时间', width: 100},
|
||||
{cellClass:'text-center', sortable: false, field: 'created_at', headerName: '创建时间', width: 140},
|
||||
{cellClass:'text-center', field: 'id', headerName: 'ID', width: 80}
|
||||
{cellClass:'text-center', sortable: false, field: 'created_dt', headerName: '创建时间', width: 140},
|
||||
//{cellClass:'text-center', field: 'id', headerName: 'ID', width: 80}
|
||||
);
|
||||
|
||||
grid.onRowDoubleClicked = function (row) {
|
||||
var data = row.data;
|
||||
if(data.type == 'item') {
|
||||
editItem(data.id);
|
||||
editItem(data);
|
||||
}
|
||||
if(data.type == 'task') {
|
||||
editTask(data.id);
|
||||
editTask(data);
|
||||
}
|
||||
if(data.type == 'subtask') {
|
||||
editSubTask(data.id);
|
||||
editSubTask(data);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,9 +142,9 @@ function dataReload() {
|
||||
}
|
||||
|
||||
function getTask(id) {
|
||||
console.log(grid.api.getRowNode(id));
|
||||
return grid.api.getRowNode(id);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('task/index/js')
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
|
||||
function formsBox(title, url, id, success, remove, error)
|
||||
{
|
||||
var options = {
|
||||
@@ -67,12 +66,10 @@ function addItem() {
|
||||
});
|
||||
}
|
||||
|
||||
function editItem(id) {
|
||||
function editItem(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -84,14 +81,14 @@ function editItem(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务列表吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑任务列表', app.url('project/task/edit', {type:'item',id:id}), 'item-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑任务列表', app.url('project/task/edit', {type:'item',id:task.id}), 'item-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addTask() {
|
||||
@@ -100,12 +97,10 @@ function addTask() {
|
||||
});
|
||||
}
|
||||
|
||||
function editTask(id) {
|
||||
function editTask(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -117,14 +112,14 @@ function editTask(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑任务', app.url('project/task/edit', {type:'task',id:id}), 'task-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑任务', app.url('project/task/edit', {type:'task', id:task.id}), 'task-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addSubTask(id) {
|
||||
@@ -140,12 +135,10 @@ function addSubTask(id) {
|
||||
});
|
||||
}
|
||||
|
||||
function editSubTask(id) {
|
||||
|
||||
function editSubTask(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -157,14 +150,14 @@ function editSubTask(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑子任务', app.url('project/task/edit', {type:'subtask',id:id}), 'task-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑子任务', app.url('project/task/edit', {type:'subtask',id:task.id}), 'task-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addComment(task_id) {
|
||||
@@ -190,9 +183,7 @@ function editComment(id) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -14,7 +14,7 @@ class StiReportController extends DefaultController
|
||||
public function designerAction()
|
||||
{
|
||||
$template_id = (int)Request::get('template_id');
|
||||
$template = DB::table('flow_template')->where('id', $template_id)->first();
|
||||
$template = DB::table('model_template')->where('id', $template_id)->first();
|
||||
// 报表名称
|
||||
$report_name = "{$template['code']}";
|
||||
$report_file = '';
|
||||
@@ -42,9 +42,4 @@ class StiReportController extends DefaultController
|
||||
$success = ['success' => true, 'msg' => "保存成功:".$fileName];
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function licenseAction()
|
||||
{
|
||||
echo "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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ use Gdoo\Model\Services\StepService;
|
||||
use Gdoo\Stock\Services\StockService;
|
||||
|
||||
use Gdoo\Index\Controllers\WorkflowController;
|
||||
use Gdoo\Stock\Services\DeliveryService;
|
||||
|
||||
class DeliveryController extends WorkflowController
|
||||
{
|
||||
@@ -312,71 +313,41 @@ class DeliveryController extends WorkflowController
|
||||
{
|
||||
$id = Request::get('id');
|
||||
$template_id = Request::get('template_id');
|
||||
|
||||
$master = DB::table('stock_delivery as sd')
|
||||
->leftJoin('customer as c', 'c.id', '=', 'sd.customer_id')
|
||||
->leftJoin('customer_tax as ct', 'ct.id', '=', 'sd.tax_id')
|
||||
->leftJoin('sale_type as st', 'st.id', '=', 'sd.type_id')
|
||||
->selectRaw('sd.*, ct.name as tax_name, c.name as customer_name, st.name as type_name')
|
||||
->where('sd.id', $id)
|
||||
->first();
|
||||
|
||||
$model = DB::table('stock_delivery_data as sdd')
|
||||
->leftJoin('stock_delivery as sd', 'sd.id', '=', 'sdd.delivery_id')
|
||||
->leftJoin('product as p', 'p.id', '=', 'sdd.product_id')
|
||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
||||
->leftJoin('customer_order_type as cot', 'cot.id', '=', 'sdd.type_id')
|
||||
->leftJoin('warehouse as w', 'w.id', '=', 'sdd.warehouse_id');
|
||||
|
||||
if ($template_id == 112) {
|
||||
$model->where('sd.print_master_id', $master['print_master_id']);
|
||||
} else {
|
||||
$model->where('sdd.delivery_id', $id);
|
||||
}
|
||||
|
||||
$model->whereRaw("p.code <> '99001'");
|
||||
|
||||
$rows = $model->selectRaw("
|
||||
sdd.*,
|
||||
p.name as product_name,
|
||||
p.spec as product_spec,
|
||||
cot.name as type_name,
|
||||
pu.name as product_unit,
|
||||
p.material_type,
|
||||
p.product_type,
|
||||
SUBSTRING(batch_sn, 3, 4) as batch_sn,
|
||||
case when right(w.name, 4) = '不满件库' then 'B' else '' end warehouse_type
|
||||
")
|
||||
->orderBy('p.code', 'asc')
|
||||
->get();
|
||||
|
||||
$money = DB::table('stock_delivery_data as sdd')
|
||||
->leftJoin('product as p', 'p.id', '=', 'sdd.product_id')
|
||||
->where('sdd.delivery_id', $id)
|
||||
->whereRaw("p.code = '99001'")
|
||||
->sum("money");
|
||||
|
||||
$template = DB::table('model_template')->where('id', $template_id)->first();
|
||||
$print_type = $template['print_type'];
|
||||
// 存在打印模板
|
||||
$print_tpl = view()->exists(Request::controller().'.print.'.$template_id);
|
||||
$this->layout = 'layouts.print_'.$print_type;
|
||||
$form = [
|
||||
'template' => DB::table('model_template')->where('id', $template_id)->first()
|
||||
'template' => $template,
|
||||
];
|
||||
|
||||
if ($template_id == 87) {
|
||||
$this->layout = 'layouts.print_stiReport';
|
||||
return $this->display([
|
||||
'master' => $master,
|
||||
'money' => $money,
|
||||
'rows' => $rows,
|
||||
'form' => $form,
|
||||
], 'print/'.$template_id);
|
||||
} else {
|
||||
$this->layout = 'layouts.print2';
|
||||
print_prince($this->display([
|
||||
'master' => $master,
|
||||
'money' => $money,
|
||||
'rows' => $rows,
|
||||
'form' => $form,
|
||||
], 'print/'.$template_id));
|
||||
// 自定义模板
|
||||
if ($print_tpl) {
|
||||
$data = DeliveryService::getPrintData($id);
|
||||
$data['form'] = $form;
|
||||
$data['template'] = $template;
|
||||
$tpl = $this->display($data, 'print/'.$template_id);
|
||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
||||
}
|
||||
|
||||
// 打印插件
|
||||
if ($print_type == 'stiReport') {
|
||||
$data = DeliveryService::getPrintData($id);
|
||||
$print_data = [
|
||||
'master' => [$data['master']],
|
||||
'money' => $data['money'],
|
||||
'stock_delivery_data' => $data['rows'],
|
||||
];
|
||||
return $this->display([
|
||||
'template' => $template,
|
||||
'print_data' => $print_data,
|
||||
]);
|
||||
}
|
||||
|
||||
// 默认模板
|
||||
$tpl = $this->createAction('print');
|
||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
||||
}
|
||||
|
||||
// 物流信息
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php namespace Gdoo\Stock\Services;
|
||||
|
||||
use DB;
|
||||
|
||||
class DeliveryService
|
||||
{
|
||||
/**
|
||||
* 自定义查询打印数据
|
||||
*/
|
||||
public static function getPrintData($id, $print_master_id = false)
|
||||
{
|
||||
$master = DB::table('stock_delivery as sd')
|
||||
->leftJoin('customer as c', 'c.id', '=', 'sd.customer_id')
|
||||
->leftJoin('customer_tax as ct', 'ct.id', '=', 'sd.tax_id')
|
||||
->leftJoin('sale_type as st', 'st.id', '=', 'sd.type_id')
|
||||
->selectRaw('sd.*, ct.name as tax_name, c.name as customer_name, st.name as type_name')
|
||||
->where('sd.id', $id)
|
||||
->first();
|
||||
|
||||
$model = DB::table('stock_delivery_data as sdd')
|
||||
->leftJoin('stock_delivery as sd', 'sd.id', '=', 'sdd.delivery_id')
|
||||
->leftJoin('product as p', 'p.id', '=', 'sdd.product_id')
|
||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
||||
->leftJoin('customer_order_type as cot', 'cot.id', '=', 'sdd.type_id')
|
||||
->leftJoin('warehouse as w', 'w.id', '=', 'sdd.warehouse_id');
|
||||
|
||||
if ($print_master_id) {
|
||||
$model->where('sd.print_master_id', $master['print_master_id']);
|
||||
} else {
|
||||
$model->where('sdd.delivery_id', $id);
|
||||
}
|
||||
|
||||
$model->whereRaw("p.code <> '99001'");
|
||||
|
||||
$rows = $model->selectRaw("
|
||||
sdd.*,
|
||||
p.name as product_name,
|
||||
p.spec as product_spec,
|
||||
cot.name as type_name,
|
||||
pu.name as product_unit,
|
||||
p.material_type,
|
||||
p.product_type,
|
||||
batch_sn,
|
||||
case when right(w.name, 4) = '不满件库' then 'B' else '' end warehouse_type
|
||||
")
|
||||
->orderBy('p.code', 'asc')
|
||||
->get();
|
||||
|
||||
// 获取折扣额
|
||||
$money = DB::table('stock_delivery_data as sdd')
|
||||
->leftJoin('product as p', 'p.id', '=', 'sdd.product_id')
|
||||
->where('sdd.delivery_id', $id)
|
||||
->whereRaw("p.code = '99001'")
|
||||
->sum("money");
|
||||
|
||||
return [
|
||||
'master' => $master,
|
||||
'money' => $money,
|
||||
'rows' => $rows,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
<tr>
|
||||
<td width="10%">特别说明</td>
|
||||
<td width="90%">
|
||||
收货时请按我司《随货单》点货验收。货物如有缺失或者破损,请与承运方协调,采取现场赔付,如协调无法达成一致意见,请第一时间告知我司并向承运方索取有效货物异常证明(贵司收货人与承运方双方签字认可的货物运单)回单至我司028-38296888并确认收到。
|
||||
收货时请按我司《随货单》点货验收。货物如有缺失或者破损,请与承运方协调,采取现场赔付,如协调无法达成一致意见,请第一时间告知我司并向承运方索取有效货物异常证明(贵司收货人与承运方双方签字认可的货物运单)回单至我司并确认收到。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<title>{{$setting['title']}}</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
||||
<link href="{{$asset_url}}/dist/app.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<script src="{{$asset_url}}/vendor/jquery.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
|
||||
@@ -119,7 +119,7 @@ class UserService
|
||||
*/
|
||||
public static function wantsTotp()
|
||||
{
|
||||
if (env('AUTH_TOTP_STATUS', true) == false) {
|
||||
if (env('AUTH_TOTP', true) == false) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ body {
|
||||
|
||||
<div class="panel-body" style="padding:20px 30px 0 30px;">
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="账号" class="form-control" name="username" required>
|
||||
<input type="text" placeholder="账号" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" placeholder="密码" class="form-control" name="password" required>
|
||||
@@ -192,6 +192,17 @@ body {
|
||||
|
||||
<script>
|
||||
(function($) {
|
||||
|
||||
// 初始化获取的用户名
|
||||
let username = localStorage.getItem('remember_username');
|
||||
if (username) {
|
||||
$('#username').val(username);
|
||||
}
|
||||
// 记住用户名
|
||||
$("#username").on("input propertychange", function() {
|
||||
localStorage.setItem('remember_username', this.value);
|
||||
});
|
||||
|
||||
// ajax 登录
|
||||
$('#myform').on('submit', function () {
|
||||
var url = $(this).attr('action');
|
||||
@@ -213,13 +224,15 @@ body {
|
||||
}, 'json');
|
||||
return false;
|
||||
});
|
||||
// 刷新验证码方法
|
||||
function refresh_captcha() {
|
||||
$('#captcha_image').attr('src', settings.public_url + '/user/auth/captcha?_=' + Math.random());
|
||||
}
|
||||
|
||||
// 刷新验证码
|
||||
$(document).on('click', '#refresh_captcha', function () {
|
||||
refresh_captcha();
|
||||
});
|
||||
|
||||
// 刷新验证码方法
|
||||
function refresh_captcha() {
|
||||
$('#captcha_image').attr('src', settings.public_url + '/user/auth/captcha?_=' + Math.random());
|
||||
}
|
||||
})(jQuery);
|
||||
</script>
|
||||
+5
-11
@@ -1559,10 +1559,6 @@ function encodeURIComponent($str)
|
||||
|
||||
function plugin_sync_api($uri, $data = [])
|
||||
{
|
||||
if (env('PLUGIN_SYNC_API_STATUS') === false) {
|
||||
return ['success' => true];
|
||||
}
|
||||
|
||||
$base_url = env('PLUGIN_SYNC_API_URL');
|
||||
if (empty($base_url)) {
|
||||
return ['success' => true];
|
||||
@@ -1624,15 +1620,13 @@ function plugin_sync_api($uri, $data = [])
|
||||
function print_prince($view)
|
||||
{
|
||||
$viewData = $view->getData();
|
||||
$prince = new App\Support\Prince(env('PRINCE_DIR'));
|
||||
$file = storage_path() . '/print/' . auth()->id() . '.pdf';
|
||||
$ret = $prince->convert_string_to_file($view, $file);
|
||||
if ($ret) {
|
||||
try {
|
||||
$prince = new App\Support\Prince(env('PRINCE_DIR'));
|
||||
header('Content-Type:application/pdf');
|
||||
header('Content-Disposition:inline;filename="' . $viewData['form']['template']['name'] . '.pdf"');
|
||||
echo file_get_contents($file);
|
||||
} else {
|
||||
echo $ret;
|
||||
$prince->convert_string_to_passthru($view);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user