信呼OA版本v2.3.8
This commit is contained in:
135
webmain/main/customer/customerAction.php
Normal file
135
webmain/main/customer/customerAction.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
class customerClassAction extends Action
|
||||
{
|
||||
public function custtotalbefore($table)
|
||||
{
|
||||
$where = '';
|
||||
$uid = $this->adminid;
|
||||
$lx = $this->post('atype');
|
||||
$month = $this->month = $this->post('month',date('Y-m'));
|
||||
$key = $this->post('key');
|
||||
if($lx=='my'){
|
||||
$where=' and `id`='.$uid.'';
|
||||
}
|
||||
if($lx=='down'){
|
||||
$s = m('admin')->getdownwheres('id', $uid, 0);
|
||||
$where =' and ('.$s.' or `id`='.$uid.')';
|
||||
}
|
||||
if($lx!='my' && $lx!='down'){
|
||||
$where = m('admin')->getcompanywhere(5);
|
||||
}
|
||||
if($key!=''){
|
||||
$where .= m('admin')->getkeywhere($key);
|
||||
}
|
||||
return array(
|
||||
'fields'=> 'id,name,deptname',
|
||||
'where' => $where,
|
||||
);
|
||||
}
|
||||
|
||||
public function custtotalafter($table,$rows)
|
||||
{
|
||||
$crm = m('crm');
|
||||
foreach($rows as $k=>$rs){
|
||||
$rows[$k]['month'] = $this->month;
|
||||
$toarr = $crm->moneytotal($rs['id'], $this->month);
|
||||
|
||||
foreach($toarr as $f=>$v){
|
||||
if($v==0)$v='';
|
||||
$rows[$k][$f] = $v;
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
public function custtotalgebefore($table)
|
||||
{
|
||||
return 'and 1=2';
|
||||
}
|
||||
|
||||
public function custtotalgeafter($t, $rows)
|
||||
{
|
||||
$rows = array();
|
||||
$crm = m('crm');
|
||||
$dtobj = c('date');
|
||||
$uid = $this->post('uid', $this->adminid);
|
||||
$urs = m('admin')->getone($uid, 'name,deptname');
|
||||
$start = $this->post('startdt', date('Y-01'));
|
||||
$end = $this->post('enddt', date('Y-m'));
|
||||
$jgm = $dtobj->datediff('m', $start.'-01', $end.'-01');
|
||||
for($i=0; $i<=$jgm; $i++){
|
||||
$month = $dtobj->adddate($end.'-01', 'm', 0-$i, 'Y-m');
|
||||
$arr['month'] = $month;
|
||||
$arr['name'] = $urs['name'];
|
||||
$arr['deptname']= $urs['deptname'];
|
||||
|
||||
$toarr = $crm->moneytotal($uid, $month);
|
||||
foreach($toarr as $f=>$v){
|
||||
if($v==0)$v='';
|
||||
$arr[$f] = $v;
|
||||
}
|
||||
$rows[] = $arr;
|
||||
}
|
||||
|
||||
$barr['rows'] = $rows;
|
||||
$barr['totalCount'] = count($rows);
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//客户转移
|
||||
public function movecustAjax()
|
||||
{
|
||||
$sid = c('check')->onlynumber($this->post('sid'));
|
||||
$toid = (int)$this->post('toid');
|
||||
if($sid==''||$sid=='')return;
|
||||
m('crm')->movetouser($this->adminid, $sid, $toid);
|
||||
}
|
||||
|
||||
public function retotalAjax()
|
||||
{
|
||||
m('crm')->custtotal();
|
||||
}
|
||||
|
||||
|
||||
//批量添加客户
|
||||
public function addplcustAjax()
|
||||
{
|
||||
$rows = c('html')->importdata('type,name,unitname,laiyuan,linkname,tel,mobile,email,address','type,name');
|
||||
$oi = 0;
|
||||
$db = m('customer');
|
||||
foreach($rows as $k=>$rs){
|
||||
$rs['adddt'] = $this->now;
|
||||
$rs['optdt'] = $this->now;
|
||||
$rs['status'] = 1;
|
||||
$rs['uid'] = $this->adminid;
|
||||
$rs['createid'] = $this->adminid;
|
||||
$rs['optname'] = $this->adminname;
|
||||
$rs['createname'] = $this->adminname;
|
||||
$db->insert($rs);
|
||||
$oi++;
|
||||
}
|
||||
backmsg('','成功导入'.$oi.'条数据');
|
||||
}
|
||||
|
||||
//分配客户
|
||||
public function distcustAjax()
|
||||
{
|
||||
$sid = c('check')->onlynumber($this->post('sid','0'));
|
||||
$sname = $this->post('sname');
|
||||
$snid = $this->post('snid');
|
||||
$lx = $this->post('lx');
|
||||
$uarr['uid'] = 0;
|
||||
if($lx==1 && $snid!='' && $sname!=''){
|
||||
$uarr['uid'] = $snid;
|
||||
$uarr['suoname'] = $sname;
|
||||
$uarr['isgh'] = '0';
|
||||
m('crm')->update($uarr, "`id` in($sid)");
|
||||
}
|
||||
if($lx==0){
|
||||
m('crm')->update($uarr, "`id` in($sid)");
|
||||
}
|
||||
echo 'ok';
|
||||
}
|
||||
}
|
||||
90
webmain/main/customer/rock_customer_alllist.php
Normal file
90
webmain/main/customer/rock_customer_alllist.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var atype=params.atype;
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'customer',fanye:true,modenum:'customer',params:{'atype':atype},
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'type'
|
||||
},{
|
||||
text:'名称',dataIndex:'name'
|
||||
},{
|
||||
text:'单位名称',dataIndex:'unitname'
|
||||
},{
|
||||
text:'拥有者',dataIndex:'optname'
|
||||
},{
|
||||
text:'合同数',dataIndex:'htshu',sortable:true
|
||||
},{
|
||||
text:'销售总额',dataIndex:'moneyz',sortable:true
|
||||
},{
|
||||
text:'待收金额',dataIndex:'moneyd',sortable:true
|
||||
},{
|
||||
text:'创建时间',dataIndex:'adddt',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('xiang_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
view:function(){
|
||||
var d=a.changedata;
|
||||
openxiangs('客户','customer',d.id);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
retotal:function(){
|
||||
js.ajax(js.getajaxurl('retotal','{mode}','{dir}'),{},function(s){
|
||||
a.reload();
|
||||
},'get',false,'统计中...,统计完成')
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="名称/拥有者">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="retotal" type="button">重新统计</button>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" id="xiang_{rand}" click="view" disabled type="button">详情</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">统计并不是实时统计,数据有偏差?请点[重新统计]按钮。销售总额是从收款单上统计。</div>
|
||||
169
webmain/main/customer/rock_customer_index.php
Normal file
169
webmain/main/customer/rock_customer_index.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var obj=[];
|
||||
obj[0] = $('#view0_{rand}').bootstable({
|
||||
tablename:'custsale',params:{'atype':'mygx'},fanye:false,modenum:'custsale',modename:'销售机会',limit:5,moreurl:'flow,page,custsale,atype=mygx',morenum:'num110',
|
||||
columns:[{
|
||||
text:'客户',dataIndex:'custname',align:'left'
|
||||
},{
|
||||
text:'来源',dataIndex:'laiyuan'
|
||||
},{
|
||||
text:'状态',dataIndex:'state'
|
||||
},{
|
||||
text:'金额',dataIndex:'money'
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',align:'left'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
obj[1] = $('#view1_{rand}').bootstable({
|
||||
tablename:'custract',params:{'atype':'my'},fanye:false,modenum:'custract',modename:'合同',limit:5,moreurl:'flow,page,custract,atype=my',morenum:'num108',
|
||||
columns:[{
|
||||
text:'合同编号',dataIndex:'num'
|
||||
},{
|
||||
text:'客户',dataIndex:'custname',align:'left'
|
||||
},{
|
||||
text:'签约日期',dataIndex:'signdt',sortable:true
|
||||
},{
|
||||
text:'合同金额',dataIndex:'money',sortable:true
|
||||
},{
|
||||
text:'待收付款',dataIndex:'moneys',sortable:true
|
||||
},{
|
||||
text:'状态',dataIndex:'statetext'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
obj[2] = $('#view2_{rand}').bootstable({
|
||||
tablename:'custfina',params:{'atype':'myskdws'},modenum:'custfina',modename:'收款单',limit:5,moreurl:'flow,page,custfina,atype=myskdws',morenum:'num106',
|
||||
columns:[{
|
||||
text:'所属日期',dataIndex:'dt'
|
||||
},{
|
||||
text:'合同编号',dataIndex:'htnum'
|
||||
},{
|
||||
text:'客户',dataIndex:'custname',align:'left'
|
||||
},{
|
||||
text:'金额',dataIndex:'money',sortable:true
|
||||
},{
|
||||
text:'状态',dataIndex:'ispay'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
obj[3] = $('#view3_{rand}').bootstable({
|
||||
tablename:'custfina',params:{'atype':'myfkdwf'},modenum:'custfina',modename:'付款单',limit:5,moreurl:'flow,page,custfina,atype=myfkdwf,pnum=fkd',morenum:'num107',
|
||||
columns:[{
|
||||
text:'所属日期',dataIndex:'dt'
|
||||
},{
|
||||
text:'合同编号',dataIndex:'htnum'
|
||||
},{
|
||||
text:'客户',dataIndex:'custname',align:'left'
|
||||
},{
|
||||
text:'金额',dataIndex:'money',sortable:true
|
||||
},{
|
||||
text:'状态',dataIndex:'ispay'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
obj[4] = $('#view4_{rand}').bootstable({
|
||||
tablename:'goodm',params:{'atype':'my'},modenum:'custxiao',modename:'销售单',limit:5,moreurl:'flow,page,custxiao,atype=my',morenum:'num300',statuschange:false,
|
||||
columns:[{
|
||||
text:'销售日期',dataIndex:'applydt'
|
||||
},{
|
||||
text:'销售单号',dataIndex:'num'
|
||||
},{
|
||||
text:'客户',dataIndex:'custname',align:'left'
|
||||
},{
|
||||
text:'金额',dataIndex:'money',sortable:true
|
||||
},{
|
||||
text:'状态',dataIndex:'statustext'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
reload:function(o1,lx){
|
||||
obj[lx].reload();
|
||||
},
|
||||
more:function(o1,lx){
|
||||
var d = obj[lx].options;
|
||||
addtabs({num:d.morenum,name:'我的'+d.modename+'',url:d.moreurl});
|
||||
}
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left" style="padding:10px">
|
||||
<table border="0" width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr valign="top">
|
||||
|
||||
<td width="50%">
|
||||
<div align="left" style="min-width:300px" class="list-group">
|
||||
<div class="list-group-item list-group-item-info">
|
||||
<i class="icon-flag"></i> 需跟踪销售机会
|
||||
<span style="float:right" ><a click="reload,0"><i class="icon-refresh"></i></a> <a click="more,0">更多>></a></span>
|
||||
</div>
|
||||
<div id="view0_{rand}"></div>
|
||||
</div>
|
||||
|
||||
<div align="left" class="list-group">
|
||||
<div class="list-group-item list-group-item-success">
|
||||
<i class="icon-flag"></i> 合同
|
||||
<span style="float:right" ><a click="reload,1"><i class="icon-refresh"></i></a> <a click="more,1">更多>></a></span>
|
||||
</div>
|
||||
<div id="view1_{rand}"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:20px;">
|
||||
|
||||
<div align="left" class="list-group">
|
||||
<div class="list-group-item list-group-item-info">
|
||||
<i class="icon-money"></i> 销售单
|
||||
<span style="float:right" ><a click="reload,4"><i class="icon-refresh"></i></a> <a click="more,4">更多>></a></span>
|
||||
</div>
|
||||
<div id="view4_{rand}"></div>
|
||||
</div>
|
||||
|
||||
<div align="left" class="list-group">
|
||||
<div class="list-group-item list-group-item-success">
|
||||
<i class="icon-money"></i> 待收款单
|
||||
<span style="float:right" ><a click="reload,2"><i class="icon-refresh"></i></a> <a click="more,2">更多>></a></span>
|
||||
</div>
|
||||
<div id="view2_{rand}"></div>
|
||||
</div>
|
||||
|
||||
<div align="left" class="list-group">
|
||||
<div class="list-group-item list-group-item-danger">
|
||||
<i class="icon-money"></i> 待付款单
|
||||
<span style="float:right" ><a click="reload,3"><i class="icon-refresh"></i></a> <a click="more,3">更多>></a></span>
|
||||
</div>
|
||||
<div id="view3_{rand}"></div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div class="tishi">双击对应记录可查看详情!</div>
|
||||
</div>
|
||||
142
webmain/main/customer/rock_customer_total.php
Normal file
142
webmain/main/customer/rock_customer_total.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var atype=params.atype,month=js.now('Y-m');
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'admin',params:{'atype':atype,'month':month},fanye:atype=='all',
|
||||
modedir:'{mode}:{dir}',storeafteraction:'custtotalafter',storebeforeaction:'custtotalbefore',
|
||||
columns:[{
|
||||
text:'部门',dataIndex:'deptname'
|
||||
},{
|
||||
text:'姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'月份',dataIndex:'month'
|
||||
},{
|
||||
text:'待收金额',dataIndex:'shou_moneyd'
|
||||
},{
|
||||
text:'已收金额',dataIndex:'shou_moneys'
|
||||
},{
|
||||
text:'应收金额',dataIndex:'shou_moneyz'
|
||||
},{
|
||||
text:'当月已收金额',dataIndex:'shou_moneyn'
|
||||
},{
|
||||
text:'收款单数',dataIndex:'shou_shu'
|
||||
},{
|
||||
text:'待付金额',dataIndex:'fu_moneyd'
|
||||
},{
|
||||
text:'已付金额',dataIndex:'fu_moneys'
|
||||
},{
|
||||
text:'应付金额',dataIndex:'fu_moneyz'
|
||||
},{
|
||||
text:'当月已付金额',dataIndex:'fu_moneyn'
|
||||
},{
|
||||
text:'付款单数',dataIndex:'fu_shu'
|
||||
}],
|
||||
load:function(a){
|
||||
c.loadcharts();
|
||||
},
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('xiang_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var myChart=false;
|
||||
var c = {
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value,mon = get('month_{rand}').value;
|
||||
a.setparams({key:s,month:mon},true);
|
||||
},
|
||||
view:function(){
|
||||
var d=a.changedata;
|
||||
addtabs({num:'custfintotal'+d.id+'',url:'main,customer,totalge,uid='+d.id+'',icons:'bar-chart',name:''+d.name+'的年度统计'});
|
||||
},
|
||||
loadcharts:function(){
|
||||
if(atype!='down')return;
|
||||
if(!myChart){
|
||||
$('#view_{rand}').after('<div class="blank20"></div><div id="main_show{rand}" style="width:98%;height:500px;"></div>');
|
||||
myChart = echarts.init(get('main_show{rand}'));
|
||||
}
|
||||
var rows = a.getData('rows'),i,len=rows.length,v;
|
||||
var xAxis=[],data=[];
|
||||
for(i=0;i<len;i++){
|
||||
xAxis.push(rows[i].name);
|
||||
v = rows[i].shou_moneyz;if(v=='')v=0;
|
||||
data.push(parseFloat(v));
|
||||
}
|
||||
|
||||
var mon = get('month_{rand}').value;
|
||||
var option = {
|
||||
title: {
|
||||
text: ''+mon+'月份应收金额图表',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data:['应收金额']
|
||||
},
|
||||
xAxis: {
|
||||
data: xAxis
|
||||
},
|
||||
yAxis: {type : 'value'},
|
||||
series: [{
|
||||
name: '金额',
|
||||
type: 'bar',
|
||||
data: data
|
||||
}]
|
||||
};
|
||||
myChart.setOption(option);
|
||||
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#month_{rand}').val(month);
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding-right:10px">
|
||||
<button class="btn btn-default" click="reload" type="button"><i class="icon-refresh"></i></button>
|
||||
</td>
|
||||
<td style="padding-right:10px">
|
||||
<div style="width:120px" class="input-group">
|
||||
<input readonly placeholder="月份" class="form-control" id="month_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button onclick="return js.selectdate(this,'month_{rand}','month')" class="btn btn-default" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" style="width:200px" id="key_{rand}" placeholder="部门/人员">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" id="xiang_{rand}" click="view" disabled type="button">详情</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">系统是以收付款单上是所属日期算对应月份统计的,当月已收金额是收款时间是当月的统计。</div>
|
||||
154
webmain/main/customer/rock_customer_totalge.php
Normal file
154
webmain/main/customer/rock_customer_totalge.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var uid=params.uid;
|
||||
if(!uid)uid=adminid+'';
|
||||
|
||||
var columns=[{
|
||||
text:'部门',dataIndex:'deptname'
|
||||
},{
|
||||
text:'姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'月份',dataIndex:'month'
|
||||
},{
|
||||
text:'待收金额',dataIndex:'shou_moneyd'
|
||||
},{
|
||||
text:'已收金额',dataIndex:'shou_moneys'
|
||||
},{
|
||||
text:'应收金额',dataIndex:'shou_moneyz'
|
||||
},{
|
||||
text:'当月已收金额',dataIndex:'shou_moneyn'
|
||||
},{
|
||||
text:'收款单数',dataIndex:'shou_shu'
|
||||
},{
|
||||
text:'待付金额',dataIndex:'fu_moneyd'
|
||||
},{
|
||||
text:'已付金额',dataIndex:'fu_moneys'
|
||||
},{
|
||||
text:'应付金额',dataIndex:'fu_moneyz'
|
||||
},{
|
||||
text:'当月已付金额',dataIndex:'fu_moneyn'
|
||||
},{
|
||||
text:'付款单数',dataIndex:'fu_shu'
|
||||
}];
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'custfina',params:{'uid':uid},modedir:'{mode}:{dir}',storeafteraction:'custtotalgeafter',storebeforeaction:'custtotalgebefore',
|
||||
columns:columns,
|
||||
load:function(a){
|
||||
c.loadcharts('shou_moneys','已收金额');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var myChart=false;
|
||||
var c = {
|
||||
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var startdt = get('start_{rand}').value,
|
||||
enddt = get('end_{rand}').value;
|
||||
a.setparams({'startdt':startdt,'enddt':enddt},true);
|
||||
},
|
||||
loadcharts:function(sf, nas){
|
||||
if(!myChart){
|
||||
$('#ssssv_{rand}').after('<div class="blank20"></div><div id="main_show{rand}" style="width:98%;height:400px;"></div>');
|
||||
myChart = echarts.init(get('main_show{rand}'));
|
||||
}
|
||||
var rows = a.getData('rows'),i,len=rows.length,v;
|
||||
if(!sf)sf='shou_moneys';
|
||||
var xAxis=[],data=[];
|
||||
for(i=len-1;i>=0;i--){
|
||||
xAxis.push(rows[i].month);
|
||||
v = rows[i][sf];if(v=='')v=0;
|
||||
data.push(parseFloat(v));
|
||||
}
|
||||
var option = {
|
||||
title: {
|
||||
text: ''+nas+'图表',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data:['']
|
||||
},
|
||||
xAxis: {
|
||||
data: xAxis
|
||||
},
|
||||
yAxis: {type : 'value'},
|
||||
series: [{
|
||||
name: nas,
|
||||
type: 'line',
|
||||
data: data
|
||||
}]
|
||||
};
|
||||
myChart.setOption(option);
|
||||
},
|
||||
inits:function(){
|
||||
var ss=[];
|
||||
for(var i=0;i<columns.length;i++){
|
||||
if(i>2)ss.push({name:columns[i].text,id:columns[i].dataIndex});
|
||||
}
|
||||
js.setselectdata(get('selectsss_{rand}'), ss,'id');
|
||||
get('selectsss_{rand}').value='shou_moneys';
|
||||
$('#selectsss_{rand}').change(function(){
|
||||
c.changesels(this);
|
||||
});
|
||||
},
|
||||
changesels:function(o){
|
||||
var val = o.value;if(val=='')return;
|
||||
var nam = o.options[o.selectedIndex].text;
|
||||
this.loadcharts(val, nam);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#start_{rand}').val(js.now('Y-01'));
|
||||
$('#end_{rand}').val(js.now('Y-m'));
|
||||
c.inits();
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding-right:10px">
|
||||
<button class="btn btn-default" click="reload" type="button"><i class="icon-refresh"></i></button>
|
||||
</td>
|
||||
<td style="padding-right:10px">
|
||||
<div style="width:120px" class="input-group">
|
||||
<input readonly placeholder="月份从" class="form-control" id="start_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button onclick="return js.selectdate(this,'start_{rand}','month')" class="btn btn-default" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td nowrap>至 </td>
|
||||
<td>
|
||||
<div style="width:120px" class="input-group">
|
||||
<input readonly class="form-control" id="end_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button onclick="return js.selectdate(this,'end_{rand}','month')" class="btn btn-default" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="blank10"></div>
|
||||
<div id="ssssv_{rand}"><select id="selectsss_{rand}" style="width:250px" class="form-control"><option value="">--选择图表字段--</option></select></div>
|
||||
Reference in New Issue
Block a user