@ -45,9 +45,9 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
//揽货人
this . comboxSALE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
fieldLabel : '揽货人' ,
//fieldLabel: '揽货人',
store : this . storeOpCode ,
// forceSelection: true,
forceSelection : true ,
queryMode : 'remote' ,
minChars : 0 ,
queryParam : 'CODENAME' ,
@ -358,7 +358,25 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ this . comboxSALE , this . comboxOP , this . comboxDOC , { xtype : 'hiddenfield' } ]
items : [ {
fieldLabel : '揽货人' , //企业备案号
flex : 1 ,
readOnly : true ,
//labelWidth: 40,
name : 'SALE'
} , {
fieldLabel : '客户经理' , //商检备案号
//labelWidth: 80,
readOnly : true ,
flex : 1 ,
name : 'OP'
} , {
fieldLabel : '客服' , //商检备案号
//labelWidth: 40,
readOnly : true ,
flex : 1 ,
name : 'DOC'
} , { xtype : 'hiddenfield' } ]
}
]
} ) ;
@ -526,6 +544,33 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
height : 60 ,
name : 'REMARK' ,
anchor : '100%'
} , {
xtype : 'container' ,
layout : 'hbox' ,
defaultType : 'textfield' ,
items : [ //this.CheckISSTOP,
{
fieldLabel : '业务来源' ,
flex : 1 ,
readOnly : true ,
name : 'BBSSOURCE'
} , {
fieldLabel : '来源明细' ,
flex : 1 ,
readOnly : true ,
name : 'BSSOURCEDETAIL'
} , {
fieldLabel : '业务日期' ,
readOnly : true ,
name : 'ETD'
} , {
fieldLabel : '备注' ,
readOnly : true ,
flex : 2 ,
name : 'BREMARK'
}
]
}
// , {
// xtype: 'textareafield',
@ -900,6 +945,141 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
//#region 框架结构
this . storeBodyListRole = Ext . create ( 'Ext.data.Store' , {
model : 'MsInfoClientRoleModel' ,
remoteSort : false ,
proxy : {
type : 'ajax' ,
url : '/MvcShipping/MsInfoClient/GetRoleDataList' ,
reader : {
id : 'GID' ,
root : 'data' ,
totalProperty : 'totalCount'
}
}
} ) ;
//#region 列定义
this . storeROLE = Ext . create ( 'Ext.data.Store' , {
fields : [ 'FSTATUS' , 'NAME' ]
} ) ;
this . storeROLE . add ( { "FSTATUS" : "揽货人" , "NAME" : "揽货人" } ) ;
this . storeROLE . add ( { "FSTATUS" : "客户经理" , "NAME" : "客户经理" } ) ;
this . storeROLE . add ( { "FSTATUS" : "客服" , "NAME" : "客服" } ) ;
this . comboxROLE = Ext . create ( 'DsExt.ux.RefTableCombox' , {
// fieldLabel: '费用状态',
store : this . storeROLE ,
valueField : 'FSTATUS' ,
displayField : 'NAME' ,
forceSelection : true ,
name : 'ROLE' ,
enableKeyEvents : true
} ) ;
this . girdcolumsRole = [ {
sortable : true ,
dataIndex : 'GID' ,
header : Zi . LAN . GID , //'GID',
hidden : true ,
width : 100
} , {
sortable : true ,
dataIndex : 'ROLE' ,
header : '角色' , //'费用名称',
editor : this . comboxROLE ,
width : 140
} , {
sortable : true ,
dataIndex : 'SHOWNAME' ,
header : '姓名' , //'标准',
editor : this . comboxSALE ,
width : 80
} ,
{
sortable : true ,
dataIndex : 'BEGINDATE' ,
header : '开始日期' , //'合同生效日期',
width : 80 ,
renderer : Ext . util . Format . dateRenderer ( 'Y-m-d' ) ,
editor : {
xtype : 'datefield' ,
selectOnFocus : true
}
} ,
{
sortable : true ,
dataIndex : 'ENDDATE' ,
header : '结束日期' , //'合同失效日期',
width : 80 ,
renderer : Ext . util . Format . dateRenderer ( 'Y-m-d' ) ,
editor : {
xtype : 'datefield' ,
selectOnFocus : true
}
} ,
{
sortable : true ,
dataIndex : 'MODIFIEDUSERREF' ,
header : '修改人' , //'修改人',
width : 80
} ,
{
sortable : true ,
dataIndex : 'MODIFIEDTIME' ,
header : '修改日期' , //'修改日期',
width : 80
}
]
//#endregion
//#region gridList列表显示信息
this . gridListCellEditingRole = Ext . create ( 'Ext.grid.plugin.CellEditing' , {
clicksToEdit : 1 //1单击, 2双击
} ) ;
this . gridListRole = new Ext . grid . GridPanel ( {
region : 'center' ,
store : this . storeBodyListRole ,
enableHdMenu : false , //是否显示表格列的菜单
hideHeaders : false , //是否隐藏表头
rowLines : true ,
columnLines : true ,
tbar : [ {
text : Zi . LAN . btnAddDetail , //'增加费用明细',
tooltip : Zi . LAN . btnAddDetail , //'增加费用明细',
iconCls : "btnadddetail" ,
handler : function ( button , event ) {
this . onAddRoleClick ( button , event , 1 ) ;
} ,
scope : this
} , '-' , {
text : Zi . LAN . btnDeleteDetail , //'删除费用明细',
tooltip : Zi . LAN . btnDeleteDetail , //'删除费用明细',
iconCls : "btndeletedetail" ,
handler : function ( button , event ) {
this . onDelRoleClick ( button , event , 1 ) ;
} ,
scope : this
} ] ,
loadMask : { msg : Zi . LAN . ShuJuJiaZaiZhong } , //"数据加载中,请稍等..."
plugins : [ this . gridListCellEditingRole ] ,
selType : 'cellmodel' ,
columns : this . girdcolumsRole
} ) ;
//#endregion
this . panelRole = new Ext . Panel ( {
layout : "border" ,
region : "center" ,
id : 'pnlmodSaleInfo' ,
title : '我司联系信息' ,
//split: true,
items : [ this . gridListRole ]
} ) ;
this . panelpage = new Ext . Panel ( {
title : '客户基本信息' ,
@ -932,7 +1112,8 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
items :
[
this . panelpage ,
this . panelAcc
this . panelAcc ,
this . panelRole
]
} ) ;
@ -1088,6 +1269,37 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
this . ACCAfterEdit ( editor , e , eOpts ) ;
} , this ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsBaseInfo/GetUserModuleEnable' ,
params : {
modulename : "modInfoClientAcc"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success ) {
var children = this . tabSeaeWTpanel . items ;
if ( children ) {
for ( var i = children . length - 1 , len = 0 ; i >= len ; i -- ) {
if ( children . items [ i ] . id ) {
if ( children . items [ i ] . id == 'pnlmodSaleInfo' ) {
children . items [ i ] . close ( ) ;
}
}
}
}
this . tabSeaeWTpanel . doLayout ( ) ;
}
} else {
}
} ,
scope : this
} ) ;
} , //end initUIComponents
@ -1106,6 +1318,7 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
if ( this . opStatus == 'edit' ) {
condition = "GID='" + this . editRecord . get ( 'GID' ) + "'" ;
this . storeBodyList . load ( { params : { condition : "LINKID='" + this . editRecord . get ( 'GID' ) + "'" , isedit : "1" } } ) ;
this . storeBodyListRole . load ( { params : { condition : "LINKID='" + this . editRecord . get ( 'GID' ) + "'" } } ) ;
}
this . LoadData ( this . opStatus , condition ) ;
@ -1152,6 +1365,48 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
}
this . Editdata = data ;
this . GetEditStatus ( ) ;
this . LoadBsData ( "CUSTOMERNAME='" + data . SHORTNAME + "' AND ((BSSOURCE='维护' AND BSSOURCEDETAIL='维护按年') OR BSSOURCE='SAAS续费')" ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
}
} ,
scope : this
} ) ;
var billno = '*' ;
var gid = '*' ;
} , // end LoadDate
LoadBsData : function ( condition ) {
this . serialNo = 0 ;
//this.bodyDel = [];
Ext . Ajax . request ( {
waitMsg : '正在查询主表数据...' ,
url : '/MvcShipping/MsInfoClient/GetBsData' ,
params : {
condition : condition
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( ! result . Success ) {
Ext . Msg . show ( {
title : '提示' ,
msg : result . Message ,
icon : Ext . MessageBox . ERROR ,
buttons : Ext . Msg . OK
} ) ;
return ;
}
data = result . data ;
this . formEdit . getForm ( ) . findField ( 'BBSSOURCE' ) . setValue ( data . BSSOURCE ) ;
this . formEdit . getForm ( ) . findField ( 'BSSOURCEDETAIL' ) . setValue ( data . BSSOURCEDETAIL ) ;
this . formEdit . getForm ( ) . findField ( 'ETD' ) . setValue ( data . ETD ) ;
this . formEdit . getForm ( ) . findField ( 'BREMARK' ) . setValue ( data . REMARK ) ;
} else {
Ext . MessageBox . alert ( '请求出现错误,请重试' , response . responseText ) ;
@ -1185,6 +1440,21 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
j = j + 1 ;
bodydatas . push ( member ) ;
}
var bodyRoledatas = [ ] ;
for ( var i = 0 ; i < this . storeBodyListRole . getCount ( ) ; i += 1 ) {
var member = this . storeBodyListRole . getAt ( i ) ;
var BEGINDATE = member . data . BEGINDATE ;
if ( BEGINDATE != '' )
BEGINDATE = Ext . util . Format . date ( BEGINDATE , 'Y-m-d' ) ;
member . data . BEGINDATE = BEGINDATE ;
var ENDDATE = member . data . ENDDATE ;
if ( ENDDATE != '' )
ENDDATE = Ext . util . Format . date ( ENDDATE , 'Y-m-d' ) ;
member . data . ENDDATE = ENDDATE ;
j = j + 1 ;
bodyRoledatas . push ( member ) ;
}
//
if ( j == 0 ) {
alert ( '请注意:未录入银行信息!' ) ;
@ -1197,6 +1467,7 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
}
var jsonBody = ConvertRecordsToJsonAll ( bodydatas ) ;
var jsonRoleBody = ConvertRecordsToJsonAll ( bodyRoledatas ) ;
this . formEdit . getForm ( ) . findField ( 'GID' ) . setDisabled ( false ) ;
var data2 = this . formACC . getForm ( ) . getValues ( false , false , false ) ;
@ -1213,13 +1484,14 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
Ext . Msg . wait ( '正在保存数据, 请稍侯..' ) ;
Ext . Ajax . request ( {
waitMsg : '正在保存数据...' ,
url : '/MvcShipping/MsInfoClient/Save ',
url : '/MvcShipping/MsInfoClient/Save Ds ',
scope : this ,
params : {
opstatus : this . opStatus ,
data : datajs ,
data2 : Ext . JSON . encode ( data2 ) ,
body : jsonBody
body : jsonBody ,
rolebody : jsonRoleBody
} ,
callback : function ( options , success , response ) {
if ( success ) {
@ -1250,7 +1522,11 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . storeBodyListRole . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyListRole . getAt ( j ) ;
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
} else if ( type == '1' ) {
window . close ( ) ;
} else if ( type == '2' ) {
@ -1264,6 +1540,11 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . storeBodyListRole . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyListRole . getAt ( j ) ;
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
} else if ( type == '1' ) {
window . close ( ) ;
@ -1289,7 +1570,11 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
for ( var j = 0 ; j < this . storeBodyListRole . getCount ( ) ; j += 1 ) {
var memberbody = this . storeBodyListRole . getAt ( j ) ;
memberbody . set ( "LINKID" , this . editRecord . get ( 'GID' ) ) ;
memberbody . commit ( ) ;
} ;
} else if ( type == '1' ) {
window . close ( ) ;
@ -1375,6 +1660,63 @@ Ext.extend(Shipping.MsInfoClientDsEdit, Ext.Panel, {
}
} ,
onAddRoleClick : function ( button , event ) {
var record = Ext . create ( 'MsInfoClientRoleModel' , {
GID : NewGuid ( ) ,
LINKID : '*' ,
SHOWNAME : '' ,
ROLE : ''
} ) ;
this . storeBodyListRole . add ( record ) ;
var n = this . storeBodyListRole . getCount ( ) ;
this . gridListCellEditingRole . startEditByPosition ( { row : n - 1 , column : 1 } ) ;
} ,
onDelRoleClick : function ( button , event ) {
var selectedRecords = this . gridListRole . selModel . getSelection ( ) ;
for ( var i = 0 ; i < selectedRecords . length ; i ++ ) {
var rec = selectedRecords [ i ] ;
if ( rec . data . LINKID == "" || rec . data . LINKID == "*" ) //如果是新增但没有保存的数据,没有必要提交到后台
{
this . storeBodyListRole . remove ( selectedRecords [ i ] ) ;
}
else {
Ext . MessageBox . confirm ( '提示' , '确定删除该记录吗?' , function ( btn ) {
if ( btn == 'yes' ) {
Ext . Msg . wait ( '正在删除数据...' ) ;
Ext . Ajax . request ( {
waitMsg : '正在删除数据...' ,
url : '/MvcShipping/MsInfoClient/DeleteRole' ,
params : {
data : Ext . JSON . encode ( rec . data )
} ,
callback : function ( options , success , response ) {
if ( success ) {
var jsonresult = Ext . JSON . decode ( response . responseText ) ;
if ( jsonresult . Success ) {
this . storeBodyListRole . remove ( rec ) ;
Ext . Msg . show ( { title : '提示' , msg : jsonresult . Message , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
}
else {
Ext . Msg . show ( { title : '错误' , msg : jsonresult . Message , icon : Ext . Msg . ERROR , buttons : Ext . Msg . OK } ) ;
}
}
} ,
failure : function ( response , options ) {
Ext . Msg . show ( { title : '警告' , msg : '服务器响应出错,请重试' , icon : Ext . Msg . INFO , buttons : Ext . Msg . OK } ) ;
} ,
scope : this
} ) ; //end Ext.Ajax.request
}
} , this ) ;
}
//this.storeBodyList.remove(selectedRecords[i]);
}
} ,
//#endregion