Anthony

顾客评级模块化

define(function() {
define(['i18n!accountset/nls/resource', 'cls', 'base/index', 'index/index'], function (resource, Class, base, indexlayout) {
return {
resource:resource,
init : function(actId,isMember,flag,rakIndex) {
var panel = getSelectedPanel();
var panel = indexlayout.getSelectedPanel();
var page = panel.children(".crm-rank-detail").show().layout({fit:true});
var button = initButton();// 初始化按钮
var rankForm = page.find(".custLevelDetail").find(".custLevelAddForm");
var rankWindow = page.find(".custLevelDetail");
initValidateboxForm();//验证
var chkValidate=initValidate();
initOptionLevel();
......@@ -131,7 +131,7 @@ define(function() {
data:{scope:"RATED"},
async:false,//同步
success:function(result) {
if(responseUtils(result)){
if($.response(result)){
for(var i=0;i<result.list.length;i++){
page.find(".colNamesSelect").append("<option value='"+result.list[i].fldSql+"'>"+result.list[i].fldName+"</option>")
}
......@@ -164,7 +164,7 @@ define(function() {
ratDays:rankForm.find(".ratDays").val(),
rakExpiry:rankForm.find(".rakExpiry").val()
}, function(result){
if(responseUtils(result)){
if($.response(result)){
closeAndRefresh();
}
});
......@@ -183,7 +183,7 @@ define(function() {
ratDays:rankForm.find(".ratDays").val(),
rakExpiry:rankForm.find(".rakExpiry").val()
}, function(result){
if(responseUtils(result)){
if($.response(result)){
closeAndRefresh();
}
});
......@@ -191,7 +191,7 @@ define(function() {
}
function closeAndRefresh(){
closeSelectedPanel();
indexlayout.closeSelectedPanel();
var levelQuery="d02d277c-a662-4298-8fba-a98e815cc243";
//8c00b574-cdc7-4ade-b471-6599f5cceeee
//c1612bd8-0b0d-449b-976c-f790a1998f71
......@@ -204,14 +204,16 @@ define(function() {
var button = panel.find(".button");
button.rs_toolbar({
buttons:[{
text:resource.btn.submit,
text:base.resource.btn.submit,
iconCls:'btn-submit submit-condition',
handler:submitBtn
}],
tools:[{
text:resource.btn.refresh,
text:base.resource.btn.refresh,
iconCls:'btn-refresh',
handler:panelRefreshUtils
handler:function() {
indexlayout.getSelectedPanel().panel("refresh");
}
}],
content:button.children('div.custLevelDetail')
});
......@@ -327,7 +329,7 @@ define(function() {
//验证顾客等级是否重名字的方法
function isRepetitionName(){
$.JSON("./accountSetDetail/isRepetitionName.json",{rakName:rankForm.find(".rakName").val(),actId:actId}, function(result){
responseUtils(result)
$.response(result)
});
}
......@@ -335,7 +337,7 @@ define(function() {
//验证顾客等级代号是否重名字的方法
function isRepetitionRakId(){
$.JSON("./accountSetDetail/isRepetitionRakId.json",{rakId:rankForm.find(".rakId").val(),actId:actId}, function(result){
responseUtils(result)
$.response(result)
});
}
......