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

447 lines
15 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<title>终端资源维护管理</title>
<style type="text/css">
.inputgroup{
width : 390px;
}
</style>
<script type="text/javascript">
$.extend($.fn.validatebox.defaults.rules, {
equaldDate: {
validator: function(value, param){
var d1 = $(param[0]).datetimebox('getValue'); //获取开始时间
return value >=d1; //有效范围为大于开始时间的日期
},
message: '结束日期不能早于开始日期!'
}
});
var _account_id = $.getSessionUser().account_id;
var _manage_unit_uuid = $.getSessionUser().manageunituuid;
//grid相关
var _gridcode = "products.imp.crm.cst.terminalequipment_grid";
var _gridid = $.getUUID();
//初始化
$(function(){
//管理单元根选中事件
$("#chk_dateactive").on("ifChecked", function(e){
chk_dateactive_click();
});
$("#chk_dateactive").on("ifUnchecked", function(e){
chk_dateactive_click();
});
/* $("#chk_visit_cust").on("ifChecked", function(e){
chk_dateactive_click();
});
$("#chk_order_cust").on("ifChecked", function(e){
chk_dateactive_click();
}); */
initQuery();
//初始化grid
var dataParam = getGridQueryParam();
$.grid({
id : _gridid,
containerid : 'layout_grid',
gridcode : _gridcode,
checkbox : true,
checkOnSelect : true,
selectOnCheck : true,
idField:"cust_uuid",
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
fitColumns:false, //是否自动填充满
nowrap:true, //自动换行
pagination:true,
formatter: {
command:'formatter_command',
cust_code : 'formatter_cust_code',
is_sample : 'formatter_is_sample',
license_code : 'formatter_license_code'
}
,onLoaded:function(){
$.wait_close();
}
});
//注册用户添加成功的监听
$.addListener("terminalequipment_set","btn_query");
});
function initQuery(){
var dataJson = {
op_acc: $.getSessionUser().account_id
,parent_uuid: '-1'
,org_id: $.getSessionUser().org_id
,level:1
,include_self : 1
,result_fields:'org_uuid,org_code,org_name,parent_uuid,manage_unit_uuid'
,order_expr:'display_order' //' display_order '
};
//方法名
var queryMethod="queryAccountOrgListByParentID"; //"queryOrgListByParentID";
//组织请求数据集
var dataParam = {
_SRVNAME: 'service.usr.org',
_SRVMETHOD: queryMethod,
_DATA: $.json2str(dataJson),
_RSFIELD: 'resultset',
_RSTYPE: 'tree',
_RSPARAM: $.json2str({
idField: 'org_uuid'
,textField: 'org_name'
,parentField: 'parent_uuid'
,asyn:'1' //是否是异步 0:同步;1:异步
,asyn_urlField:'parent_uuid'
,asyn_dataField:'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
//区域
$.inputpop({
id: 'org_uuid',
height: 480,
width: 320,
required: false,
editable: false,
url: 'products/imp/pub/mds/departtree.jsp',
initvalue: '', //code
inittext: '', //name
initid: '', //uuid
queryParams: {
manage_unit_uuid: $.getSessionUser().manage_unit_uuid, //管理单元标识
person_uuid: $.getSessionUser().op_account_uuid, //操作人员标识
org_uuid: '', //上级组织标识
isrealunit: '1', //是否实体
orgtype: '', //组织类型
orgattr: '03', //组织属性,03是销售组织
isctrlperm: '1', //是否控制权限
ismulselect: '1', //是否多选
cascadecheck:'0', //是否级联
asyn: '1' //是否异步加载
},
onBeforeOpen: function(jdata) {
return jdata;
},
callback: function(jdata) {}
});
//根据角色数据权限获取当前最大组织区域根节点
$.wait_open();
$.cuajax({
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
method: "post",
timeout: WDK_Timeout,
async: false, //保证表格加载时能获取到返回的组织机构
data: {
_SRVNAME: 'service.md.org',
_SRVMETHOD: 'queryTopOrg',
_DATA: $.json2str({
op_account_uuid: $.getSessionUser().account_id,
manage_unit_uuid: $.getSessionUser().manageunituuid,
isctrlperm: '1',//控制权限
org_attr: '03' //组织属性-销售组织,根据实际情况修改
}),
_DATAFILTER:1 //启用数据权限
},
success: function(result) {
$.wait_close();
var jres = $.str2json(result);
if(jres.code=='1'){
if (jres.resultset && jres.resultset.length>0) { //操作成功
root_org = jres.resultset[0];//取返回结果的第一条数据
$.inputpop_setValue({
id:"org_uuid",
value_id:root_org.org_uuid,
value_text:root_org.org_name,
value_value:root_org.org_code
});
}
}
},error:function(){
$.wait_close();
}
});
var initStart_date = '',initEnd_date = '';
var date = new Date();
var year = date.getFullYear()+'';
var month = date.getMonth() + 1+'';
var day = date.getDate()+'';
if(month.length == 1){
month = '0' + month;
}
if(day.length == 1){
day = '0' + day;
}
$.datebox({
id : 'begin_date',
required : false,
editable : false,
height:25,
tipPosition : 'bottom',
disabled : true,
strFormatter : 'yyyy-MM-dd'
});
$.datebox({
id : 'end_date',
required : false,
editable : false,
height:25,
tipPosition : 'bottom',
disabled : true,
strFormatter : 'yyyy-MM-dd'
});
initStart_date = year+"-"+month+"-01";
initEnd_date = year+"-"+month+"-"+day;
$("#begin_date").datebox('setValue',initStart_date);
$("#end_date").datebox('setValue',initEnd_date);
}
function chk_dateactive_click(){
if($('#chk_dateactive').is(':checked')){
$("#begin_date").datebox('enable');
$("#end_date").datebox('enable');
}else{
$("#begin_date").datebox('disable');
$("#end_date").datebox('disable');
}
}
function removeBlank(e) {
if(e.keyCode == 32){
e.preventDefault();
}
}
//format 操作
function formatter_command(value,row,index) {
var str = '<i tilte="修改" class="fa fa-cog grid-oper-icon" aria-hidden="true" onclick="btn_modify(\''+ row.cust_uuid +'\')"></i>';
//str += '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" aria-hidden="true" onclick="btn_delete(\''+ row.cust_uuid +'\')"></i>';
return str;
}
function formatter_cust_code(value,row,index) {
return "<a style='margin:5px;' href='javascript:void(0)' onclick=btn_view('"+ row.cust_uuid+"')>"+value+"</a>";
}
function formatter_is_sample(value,row,index) {
return value? "是" : "否";
}
function formatter_license_code(value,row,index) {
return row.tel_order_pwd;
}
//获取grid查询参数
function getGridQueryParam(){
var filedValues = $.getFieldValue({formid:'search_form'});
var attr_expr = {};
if(filedValues.chk_dateactive == "1"){
var begin_date = filedValues.begin_date;
var end_date = filedValues.end_date;
if(begin_date && end_date && begin_date>end_date){
alert('入网起始日期不能大于结束日期');
return false;
}
attr_expr.in_net_date = filedValues.begin_date+","+filedValues.end_date;
}
attr_expr.is_active = "1";
//组织参数
var dataParam = {
_SRVNAME:'service.uc.cst.cust',
_SRVMETHOD:'pageSearchCustList',
_DATA:$.json2str({
op_acc : $.getSessionUser().account_id,
manage_unit_uuid : $.getSessionUser().manageunituuid,
search_value : filedValues.txt_cust.trim(),
org_uuid_str : filedValues.org_uuid,
attr_expr : attr_expr,
result_fields:'cust_uuid,cust_code,tel_order_pwd,manage_person_name,cust_name,'+
'address,terminal_level,terminal_levelname,is_sample_cust,'+
'cust_type_name,cust_manager_name,license_code',
order_expr:''
}),
_RSTYPE:'grid',
_RSFIELD:'result',
_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
//查询
function btn_query(){
//组织参数
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
//修改 btn_modify Button
function btn_modify(cust_uuid){
$.openInTab({
id:$.getUUID(),
title:'终端资源--维护',
url:'products/imp/crm/cst/terminalequipment_set.jsp',
queryParams:{
actionflag:'update',
cust_uuid : cust_uuid
},
onClose:function(){
btn_query();
}
});
}
function btn_view(cust_uuid){
$.openInTab({
id:$.getUUID(),
title:'终端资源--查看',
url:'products/imp/crm/cst/terminalequipment_view.jsp',
queryParams:{
actionflag:'view',
cust_uuid : cust_uuid
},
onClose:function(){
btn_query();
}
});
}
function md5pass(){
var rows = $("#"+_gridid).datagrid('getChecked');
var cust_info = [];
if(rows.length == 0){
confirmDialog("您未选择客户,是否全部同步?",function(){
$.post('wdk?action=customer.changepass&method=changePassword&ajaxparam=' + new Date().getTime(),{
op_account_uuid: $.getSessionUser().account_id,
manage_unit_uuid: $.getSessionUser().manageunituuid,
cust_info : ""
});
/* $.cuajax({
url: 'wdk?action=customer.changepass&method=changePassword&ajaxparam=' + new Date().getTime(),
method: "post",
timeout: WDK_Timeout,
async: false, //保证表格加载时能获取到返回的组织机构
data: {
op_account_uuid: $.getSessionUser().account_id,
manage_unit_uuid: $.getSessionUser().manageunituuid,
cust_info : ""
},
success: function(result) {
},error:function(){
$.wait_close();
}
}); */
});
}else{
for(var i=0; i<rows.length; i++){
var row = rows[i];
if(row.cust_uuid && row.tel_order_pwd){
var data = {};
data.cust_uuid = row.cust_uuid;
data.tel_order_pwd = row.tel_order_pwd;
cust_info.push(data);
}
}
$.post('wdk?action=customer.changepass&method=changePassword&ajaxparam=' + new Date().getTime(),{
op_account_uuid: $.getSessionUser().account_id,
manage_unit_uuid: $.getSessionUser().manageunituuid,
cust_info : $.json2str(cust_info)
});
/* $.cuajax({
url: 'wdk?action=customer.changepass&method=changePassword&ajaxparam=' + new Date().getTime(),
method: "post",
timeout: WDK_Timeout,
async: false, //保证表格加载时能获取到返回的组织机构
data: {
op_account_uuid: $.getSessionUser().account_id,
manage_unit_uuid: $.getSessionUser().manageunituuid,
cust_info : $.json2str(cust_info)
},
success: function(result) {
},error:function(){
$.wait_close();
}
}); */
}
}
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar" style="padding-bottom: 5px;">
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="btn_add()" >新增</a> -->
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-info-circle'" onclick="md5pass()" >同步密码</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:0 10px;overflow:hidden;height:80px;" >
<form id="search_form" >
<div class="h_layout">
<div>
<div class="inputgroup">
<label>区域</label>
<div>
<input id="org_uuid" name="org_uuid"/>
</div>
</div>
<div class="inputgroup">
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="txt_cust" name="txt_cust" placeholder="请输入许可证号、客户编码、客户名称等进行搜索"/>
</div>
</div>
</div>
</div>
<div class="h_layout">
<div>
<div class="inputgroup">
<label>入网日期</label>
<div>
<div style="display: inline-block;width: inherit;" >
<input type="checkbox" id="chk_dateactive" name="chk_dateactive">
</div>
<input id="begin_date" name="begin_date" style="width:120px;"/>&nbsp;&nbsp;-&nbsp;&nbsp;
<input id="end_date" name="end_date" style="width:120px;" />
</div>
</div>
<!-- <div class="inputgroup">
<label>拜访/订货客户</label>
<div>
<input id="chk_cust" name="chk_cust"/>
<div style="display: inline-block;width: inherit;" >
<input type="checkbox" id="chk_visit_cust" name="chk_visit_cust" checked="checked">
<label for="chk_visit_cust">当日拜访客户</label>&nbsp;&nbsp;&nbsp;
<input type="checkbox" id="chk_order_cust" name="chk_order_cust" onclick="alert(123);">
<label for="chk_order_cust">当日订货客户</label>
</div>
</div>
</div> -->
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="btn_query()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</form>
</div>
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0px 10px;" >
</div>
</div>
</div>
</div>
</body>
</html>