Commit 2047945d authored by duxinyuan's avatar duxinyuan

duxinyuan 考勤社保界面 finished 2019/07/24

parent 27501deb
门店考勤社保
\ No newline at end of file
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="attendanceList" />
<style>
.margain-10{
margin-bottom: 10px;
}
.top-5{
position: relative;
top: 5px;
}
#file_input_pic,#file_input_pic2{
opacity: 0;
position: absolute;
top: 0;
left: 0px;
height: 35px;
width: 80px;
}
#container_body_img_area>div,#container_body_img_area2>div{
float: left;
width: 216px;
}
.active {
color:dodgerblue;
}
ul {
-webkit-padding-start: 0px !important;
}
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.hide {
display: none !important;
}
.result>img,.result2>img{
width: 120px;
height: 120px;
margin-top: 8px;
}
#container_body{
position: relative;
overflow: hidden;
}
.span-del2,.span-del{
color: red;
}
/*控制放大镜的 收款图片显示*/
#preview{
z-index: 9999!important;
}
#preview img{
width: 600px;
}
.clear{
clear: both;
}
input {
width: 50%;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<!--<div class="panel-heading breadcrumb">
<li>
<a href="javascript:;">费用报销审核</a>
</li>
<div class="btn-group">
<button type="button" class="choose_btn btn btn-info" data-value="1" style="margin-left: 20px;">总监通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="3">财务一审通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="2">财务二审通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="4">财务三审通过</button>
<button type="button" class="choose_btn btn btn-default " data-value="5">未审核</button>
<button type="button" class="choose_btn btn btn-default " data-value="-1">全部</button>
</div>
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="#modal-check" data-toggle="modal" class="btn btn-info"><i class="icon-plus"></i> 新增费用报销
</a>
</li>
</ul>
</div>
</div>-->
<div class="panel-body" style="overflow:hidden;">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed" style="margin-top:15px">
<thead>
<tr>
<td colspan="15">
<form id="form_search">
<select class="form-control btn2 ld-Marheight" id="changed_City">
</select>
<select class="form-control btn2 ld-Marheight" id="district_id_panfang">
<option value="">选择部门</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
</select>
<select class="form-control btn2 ld-Marheight" id="changed_type">
<option value="">选择门店</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset" style="float:left">重置</span>
<span class="fore-span ld-Marheight" style="font-size:700;font-size:16px;float:left;line-height:20px;margin-top:15px;margin-left:30px" id="dataStr">2019-06</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="1" style="float: left;">考勤 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="2" style="float: left;">社保 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="3" style="float: left;">手续费 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight " id="joinactive" style="float: right;">修改是否参与活动</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">
<input style="width:20px;" class="chooseAll" type="checkbox"/>
</th>
<th class="text-center">门店ID</th>
<th class="text-center">门店名称</th>
<th class="text-center">所在办公室</th>
<th class="text-center">店长</th>
<th class="text-center">是否参加考勤打折</th>
<th class="text-center">手续费</th>
<th class="text-center">当月社保报销(元)</th>
<th class="text-center">当月考勤</th>
<th class="text-center">当月合计总实收</th>
<th class="text-center">当月守护者实收</th>
<th class="text-center">盈利不足2万扣除</th>
</tr>
</thead>
<tbody class="text-center" id="order_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="img_mask_area" title="点击任意位置可关闭">
<img />
</div>
define(['doT', 'text!temp/attendance_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) {
cost = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
house_fatherid: '',
collection_del_id:'',
listData :"",
moneyTotal : "" ,
agent_id_phone : '',
check_status : 1 ,
deleteRefundId:'',
init: function() {
//初始化dot
$(document.body).append(template);
$('#dataStr').text( getUrlParam('time'));
cost.getList(1);
cost.event();
},
event: function() {
var that = cost;
that.initCity();
var _doc = $(document);
console.log(window.location)
//初始化
$('.pic-con2').show();
$('.pic-con1').hide();
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
});
//重置搜索条件
$(document).on('click','#reset',function(e){
that.resetAll();
});
_doc.on('click','.choose_btn',function(e){
var befor = that.check_status
$(this).removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
if ( befor != e.target.dataset.value) {
that.check_status = e.target.dataset.value;
cost.getList(1);
}
})
$(document).on('click','.chooseAll',function(e){
if ($(this).is(":checked")) {
$('[name=tableCheck]').prop("checked",'checked');
} else {
$('[name=tableCheck]').prop("checked","");
}
let vaules = [] ;
$('[name=tableCheck]').each(function(e,i){
vaules.push(this.value)
});
})
$(document).on('click','#joinactive',function(e){
let vaules = [] ;
$('[name=tableCheck]:checked').each(function(i,e){
let obj = {}
obj.discounts = $(this).attr("data-dazhe") == 1 ? 0 : 1 ,
obj.id = this.value,
vaules.push(obj);
});
that.updateIsJoinActive(vaules);
})
$(document).on('click','.tableValSave',function(e){
let value = $(this).prev().val() ;
let type = e.target.dataset.type ;
let params = {
store_id : $(this).parent().parent().find('.storeIdTr').html()-0,
setting_date : that.getDate()
};
if ( value-0 > -1 ){
params[type] = value-0 ;
that.updatePriceFunc(params,$(this))
} else {
alert("请输入正确的金额")
}
})
//操作显示保存按钮
$(document).on('change','.inputSave',function(e){
$(this).next('a').show();
})
$(document).on('click','.checked',function(e){
that.checkFinish(e.target.dataset.index)
})
//部门门店二级联动
that.getDistrictPanFang(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id_panfang', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
that.getDistrictStoreListPanFang(_id, function(_data){
var _str = '<option value="">盘方门店</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
},
checkFinish : function(index){
let that = this ;
let params = {
setting_date:that.getDate(),
type : index
}
$.post('/index/checkCostParameter',params,function(data){
if (data.code == 200 && data.data != null) {
alert(data.msg)
}
})
},
updateIsJoinActive : function( params ){
let that = this ;
that.pageNo = 1 ;
that.getList(1);
$.post('/index/editDiscounts',{'id_discounts_json' : JSON.stringify(params),setting_date : that.getDate()},function(data){
if (data.code == 200 && data.data != null) {
cost.pageNo = 1 ;
cost.getList(1);
} else {
alert(res.msg)
}
})
},
getDate : function(){
let that = this ;
let str = $('#dataStr').text();
let str1 = str.split("-");
let newStr = str1[0] + '-' + ( str1[1]-0>9?str1[1]:'0'+str1[1] ) + '-' + "01"
return newStr;
},
getDistrictPanFang: function (fn) {//调用接口 产生列表 部门
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id_panfang").append(str);
fn && fn();
}
}
});
},
getDistrictStoreListPanFang: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
initCity : function (){
let that = this ;
$.get('/index/getSiteList',{},function(res){
let list = res.data.list ;
let tag = '<option value="">选择城市</option>' ;
list.map(function(obj){
tag += '<option value="'+obj.id+'">'+obj.city+'</option>'
})
$('#changed_City').append(tag);
})
},
updatePriceFunc : function(params,$this){
let that = this ;
$.post('/index/editCostParameter',params,function(res){
if (res.code == 200 && res.data != null) {
$this.hide()
} else {
alert(res.msg)
}
})
},
//获取列表
getList : function(no){
var that = cost;
that.pageNo = no;
let params = {};
params.pageNo = that.pageNo;
params.pageSize = that.pageSize ;
params.setting_date = that.getDate() ;
params.store_id = $('#changed_type').val();
$.get('/index/getStoreCostParameterList',params,function(data){
if(typeof data === 'object') {
if(data.code == 200) {
$('.chooseAll').prop("checked","");
that.listData = data.data.list;
var temp = document.getElementById('att_template_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#order_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total, no, that.pageSize,that.getList);
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},'json');
},
/**
* 重置查询条件
*/
resetAll : function(){
var that = cost;
$('#changed_City').val("");
$('#district_id_panfang').val("");
$('#changed_type').val("");
},
};
return cost;
});
\ No newline at end of file
<script id="att_template_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>
<input style="width:20px;" type="checkbox" name="tableCheck" value="[%= it[item]['id'] %]" data-dazhe="[%= it[item]["is_discounts"] %]"/>
</td>
<td class="storeIdTr">[%= it[item]['id']?it[item]['id']:'--' %]</td>
<td>[%= it[item]['store_name']?it[item]['store_name']:'--' %]</td>
<td>[%= it[item]['office_name']?it[item]['office_name']:'--' %]</td>
<td>[%= it[item]['name']?it[item]['name']:'--' %]</td>
[% if(it[item]['is_discounts'] == 1) { %]
<td></td>
[% } else { %]
<td></td>
[% } %]
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['transfer_charge']?it[item]['transfer_charge']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="transfer_charge" style="display: none;">保存</a>
</td>
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['social_security_fee']?it[item]['social_security_fee']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="social_security_fee" style="display: none;">保存</a>
</td>
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['attendance_num']?it[item]['attendance_num']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="attendance_num" style="display: none;">保存</a>
</td>
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['official_receipts']?it[item]['official_receipts']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="official_receipts" style="display: none;">保存</a>
</td>
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['last_official_receipts']?it[item]['last_official_receipts']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="last_official_receipts" style="display: none;">保存</a>
</td>
<td>
<input class="inputSave" style="width:65%;" type="num" value="[%= it[item]['deduct']?it[item]['deduct']:0 %]">
<a class="btn1 btn-success tableValSave" data-id='[%= it[item]["id"] %]' data-type="deduct" style="display: none;">保存</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment