You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

343 lines
14 KiB
HTML

<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">毛利分析</h3>
<p class="description_text">不自动生成,请在每月结算完成后手动生成,如该月结算数据有变动,需重算分析表</p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 15px;">
<div class="input-list input-list-promote search_label_rehab">
<select id="count_date" name="count_date" class="select_gallery" style="width:150px;">
<option value="">请选择月份</option>
<volist name=":getOpenCompanyMonthsList()" id="vo">
<option value="{$vo}" <if condition="$vo eq $_GET['count_date']">selected=selected</if>>{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<if condition = "$isCanRecount">
<a class="butn" id="addMargin">生成毛利表</a>
</if>
<a class='butn' id='export'>导出</a>
<a class='butn' id='moreMarginView'>汇总查看</a>
<a class='butn' id='moreMarginExport'>汇总导出</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
4 years ago
<th><input class="check-all" type="checkbox"></th>
<th>月份</th>
<th>流水</th>
<th>毛利额</th>
<th>毛利率</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
4 years ago
<td ><input class="ids" type="checkbox" name="ids[]" value="{$data['id']}"></td>
<td>{$data.count_year}-{$data.count_month}</td>
<td>{$data.pay_amount}</td>
<td>{$data.margin_amount}</td>
<td>{$data.margin_ratio}%</td>
<td>
<a class="confirm margin_view" data-id="{$data.id}">查看/编辑</a>
<a class="confirm margin_recount" data-id="{$data.id}">重算</a>
</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
<script type="text/html" id="addMarginTpl">
<div style="padding:10px 40px 30px;">
<spend style="font-size:14px;color:#666;">
按月份对生成毛利分析表,请确保该月已完成结算。<br/>任务提交成功后大约需等待3-5分钟才会完成计算。
</spend>
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:30px;">
<tr>
<td class="l noticeinfo" style="width:80px;">月份:</td>
<td class="r table_radio">
<select id="recount_date" name="recount_date" class="select_gallery" style="width:150px;">
<option value="">请选择月份</option>
<volist name=":getOpenCompanyMonthsList()" id="vo">
<option value="{$vo}">{$vo}</option>
</volist>
</select>
</td>
</tr>
</table>
<button class="submit_btn mlspacing" id="addMarginSubmit" type="submit" style="margin-top:30px;">
保存
</button>
</div>
</script>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
function reload() {
window.location.reload();
}
$(function(){
$(".margin_view").click(function () {
var id = $(this).data("id");
var url = "{:U('marginView')}"+"&id="+id
layer.open({
type: 2,
title: "毛利分析表",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
$(".margin_recount").click(function () {
var id = $(this).data("id");
var url = "{:U('recount')}"+"&type=recount&id="+id
$.get(url,function(data) {
if (data.status == 1) {
layer.msg(data.msg);
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg(data.msg);
return false;
}
})
});
$("#addMargin").on("click",function(){
var html = $("#addMarginTpl").html();
layer.open({
type: 1,
title: "生成毛利分析表",
maxWidth:720,
closeBtn: 1,
content: html,
success:function(){
$("#addMarginSubmit").off("click");
$("#addMarginSubmit").on("click",function() {
var date = $("#recount_date").val();
var url = "{:U('recount')}"+"&type=add&date="+date
$.get(url,function(data) {
if (data.status == 1) {
layer.msg(data.msg);
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg(data.msg);
return false;
}
})
});
}
});
})
4 years ago
$("#export").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length > 20){
layer.msg("<font style='color:white'>" + '暂不支持超过20条的批量导出' + "</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要导出的分析单' + "</font>");
return;
}
_export();
function _export(){
for (var index = 0; index < text.length; index++) {
var id = text[index];
var url ="{:U('marginView')}"+"&id="+id+"&export=1";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel)
}
}
})
$("#moreMarginView").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length < 2){
layer.msg("<font style='color:white'>" + '请选择大于两条(含)以上的数据' + "</font>");
return;
}
var ids = text.join(",");
var url = "{:U('moreMarginView')}"+"&ids="+ids
layer.open({
type: 2,
title: "毛利分析表",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
})
$("#moreMarginExport").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length < 2){
layer.msg("<font style='color:white'>" + '请选择大于两条(含)以上的数据' + "</font>");
return;
}
var ids = text.join(",");
var url = "{:U('moreMarginView')}"+"&export=1&ids="+ids
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel)
})
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>