Commit 4e57ae42 authored by duxinyuan's avatar duxinyuan

commite

parent b1c15938
define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) { define(['doT', 'text!temp/adjustment_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) {
receiv = { adjustment = {
pageNo: 1, pageNo: 1,
/*第几页*/ /*第几页*/
pageSize: 10, pageSize: 10,
...@@ -11,13 +11,42 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -11,13 +11,42 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
receiv.getList(1); adjustment.getList(1);
receiv.event(); adjustment.event();
}, },
event: function() { event: function() {
var that = receiv; var that = adjustment;
var _doc = $(document); var _doc = $(document);
$(document).on('click','.btn_choose',function(e){
console.log(e);
console.log(e.target.innerHTML);
var value = e.target.innerHTML ;
$('.btn-group').find('button.btn-info').addClass("btn-default");
$('.btn-group').find('button.btn-info').removeClass("btn-info");
$('.btn-group').find('button').each(function(){
console.log($(this).context.innerHTML)
if ($(this).context.innerHTML == value){
$(this).addClass("btn-info");
$(this).removeClass("btn-default");
}
})
adjustment.getList(1);
});
//搜索
$(document).on('click','#search',function(e){
that.getList(that.pageNo);
});
//重置搜索条件
$(document).on('click','#reset',function(e){
that.resetAll();
});
//导出报表
$(document).on('click','#export',function(e){
that.exportExcel();
});
//操作----时间轴 //操作----时间轴
$(document).on('click','.timeline',function(e){ $(document).on('click','.timeline',function(e){
var house_id = e.target.dataset.id;; var house_id = e.target.dataset.id;;
...@@ -30,10 +59,135 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -30,10 +59,135 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
'real_money' : '18','type' : '19','pay_type' : '10','internal_address' : '21','house_number' : '31','aaa' : '41','bbb' : '51','id' : '61'},{ 'real_money' : '18','type' : '19','pay_type' : '10','internal_address' : '21','house_number' : '31','aaa' : '41','bbb' : '51','id' : '61'},{
'create_time' : '12','income_time' : '13','report_agent_name' : '14','report_agent_phone' : '15','store_name' : '16','money' : '17', 'create_time' : '12','income_time' : '13','report_agent_name' : '14','report_agent_phone' : '15','store_name' : '16','money' : '17',
'real_money' : '18','type' : '19','pay_type' : '10','internal_address' : '21','house_number' : '31','aaa' : '41','bbb' : '51','id' : '80'}] 'real_money' : '18','type' : '19','pay_type' : '10','internal_address' : '21','house_number' : '31','aaa' : '41','bbb' : '51','id' : '80'}]
var temp = document.getElementById('receivables_template_tpl').innerHTML; var temp = document.getElementById('adjustment_template_tpl').innerHTML;
var doTtmpl = doT.template(temp); var doTtmpl = doT.template(temp);
$("#order_list").html(doTtmpl(aaa)); $("#order_list").html(doTtmpl(aaa));
that.setValue();
},
setValue : function(){
var that = adjustment ;
$('#change_id').text("123123");
$('#change_price').text("123123");
$('#befor_into_id').text("123123");
$('#befor_order_id').text("123123");
$('#befor_house_id').text("123123");
$('#befor_house_addr').text("123123");
$('#befor_into_date').text("123123");
$('#befor_into_type').text("123123");
$('#after_into_id').text("123123");
$('#after_order_id').text("123123");
$('#after_report_id').text("123123");
$('#after_house_id').text("123123");
$('#after_house_addr').text("123123");
$('#after_into_date').text("123123");
$('#after_into_type').text("123123");
$('#after_into_price').text("123123");
},
/**
* 获取表格数据
* @param {Object} no
*/
getList : function(no){
var that = adjustment;
var params = that.buildSearchParams();
console.log(params) ;
},
/**
* 重置查询条件
*/
resetAll : function(){
var commite_time_start = $('#comit_time_start').val("");
var commite_time_end = $('#comit_time_end').val("");
var into_time_start = $('#into_time_start').val("");
var into_time_end = $('#into_time_end').val("");
var changed_type = $('#changed_type').val("");
var changed_id = $('#changed_id').val("");
var looked_id = $('#looked_id').val("");
var shoped_id = $('#shoped_id').val("");
var shoped_addr = $('#shoped_addr').val("");
var commit_home = $('#commit_home').val("");
var commit_shop = $('#commit_shop').val("");
var comit_name = $('#comit_name').val("");
var comit_phone = $('#comit_phone').val("");
},
/**
* 导出报表
*/
exportExcel : function(){
var that = adjustment;
var params = that.buildSearchParams();
$.post('',params, function(data){
console.log(data);
})
},
/**
* 获取查询参数
*/
buildSearchParams : function(){
var commite_time_start = $('#comit_time_start').val();
var commite_time_end = $('#comit_time_end').val();
var into_time_start = $('#into_time_start').val();
var into_time_end = $('#into_time_end').val();
var changed_type = $('#changed_type').val();
var changed_id = $('#changed_id').val();
var looked_id = $('#looked_id').val();
var shoped_id = $('#shoped_id').val();
var shoped_addr = $('#shoped_addr').val();
var commit_home = $('#commit_home').val();
var commit_shop = $('#commit_shop').val();
var comit_name = $('#comit_name').val();
var comit_phone = $('#comit_phone').val();
var choose_type = $('.btn-group').find('.btn-info').html();
var params = {};
if ( choose_type ) {
params.choose_type = choose_type;
}
if ( commite_time_start ) {
params.commite_time_start = commite_time_start;
}
if ( commite_time_end ) {
params.commite_time_end = commite_time_end;
}
if ( into_time_start ) {
params.into_time_start = into_time_start;
}
if ( into_time_end ) {
params.into_time_end = into_time_end;
}
if ( changed_type ) {
params.changed_type = changed_type;
}
if ( changed_id ) {
params.changed_id = changed_id;
}
if ( looked_id ) {
params.looked_id = looked_id;
}
if ( shoped_id ) {
params.shoped_id = shoped_id;
}
if ( shoped_addr) {
params.shoped_addr = shoped_addr;
}
if ( commit_home ) {
params.commit_home = commit_home;
}
if ( commit_shop ) {
params.commit_shop = commit_shop;
}
if ( comit_name ) {
params.comit_name = comit_name;
}
if ( comit_phone ) {
params.comit_phone = comit_phone;
}
return params ;
}, },
}; };
return receiv; return adjustment;
}); });
\ No newline at end of file
<script id="adjustment_template_tpl" type="text/template">
[% if(it&&it.length!=0) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['income_time'] %]</td>
<td>[%= it[item]['report_agent_name'] %]-[%= it[item]['report_agent_phone'] %]</td>
<td>[%= it[item]['store_name'] %]</td>
<td>[%= it[item]['money'] %]</td>
<td>[%= it[item]['real_money'] %]</td>
<td>[%= it[item]['type'] %]</td>
<td>[%= it[item]['pay_type'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
<td>[%= it[item]['house_number'] %]</td>
<td>[%= it[item]['report_agent_phone'] %]</td>
<td>
<a class="btn1 btn-success add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a>
<a class="btn1 btn-success timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-success list_delete" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"]%]'>撤销调整</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="13" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
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