You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientSaleIndex.js

3907 lines
140 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.MsInfoClientSaleIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsInfoClientSaleIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsInfoClientSaleIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
sqlcontext: '',
editype: '',
selectbsno: '',
sortfield: '',
sortdire: '',
//需求编号SR2017061200005-1
initUIComponents: function () {
this.formname = "MsInfoClientSaleIndex"; //页面名称
this.selecttype = 3;
//定义数据集
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
_this = this;
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsInfoClientModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
_this = this;
this.initgirdcolums = [{
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'GID',
header: Zi.LAN.GID, //'编号',
hidden: true,
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'CODENAME',
header: Zi.LAN.CODENAME, //'客户代码',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'BLSTATUSREF',
header: Zi.LAN.BLSTATUSREF, //'客户简称',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'SHORTNAME',
header: Zi.LAN.SHORTNAME, //'客户简称',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'DESCRIPTION',
header: Zi.LAN.DESCRIPTION, //'客户全称',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'ENFULLNAME',
header: Zi.LAN.ENFULLNAME, //'英文全称',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'FARCODE',
header: Zi.LAN.FARCODE, //'应收代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'FAPCODE',
header: Zi.LAN.FAPCODE, //'应付代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ORDERNO',
header: Zi.LAN.ORDERNO, //'财务序号',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TEL',
header: Zi.LAN.TEL, //'电话',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'FAX',
header: Zi.LAN.FAX, //'传真',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'SALE',
header: Zi.LAN.SALE, //'揽货人',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'DOC',
header: Zi.LAN.DOC, //'揽货人',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'BSSOURCE',
header: Zi.LAN.BSSOURCE, //'业务来源',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'OPNAME',
header: Zi.LAN.OPNAME, //'录入人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPTIME',
header: Zi.LAN.OPTIME, //'录入日期',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OP',
header: Zi.LAN.OP, //'录入日期',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'BLSTATUSREF',
header: Zi.LAN.BLSTATUSREF, //'审核状态',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ACCREMARK',
header: Zi.LAN.ACCREMARK, //'审核状态',
width: 80
},
{
sortable: true,
dataIndex: 'ACCTYPE',
header: "可结算方式",
width: 80
},
{
sortable: true,
dataIndex: 'ACCMONTH',
header: "间隔月份",
width: 80
},
{
sortable: true,
dataIndex: 'ACCDAYS',
header: "结算时间",
width: 80
},
{
sortable: true,
dataIndex: 'ALLOWAMOUNT',
header: Zi.LAN.ALLOWAMOUNT,
width: 80
}];
this.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'west',
width: 300,
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
listeners: {
cellclick: function (thisTab, record, item, index, e, eOpts) {
if (index == 10) {//设置按钮列
// alert('用户编号=' + this.getStore().getAt(rowIndex).data.usercode);
}
}
},
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayMsg: Zi.LAN.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: Zi.LAN.emptyMsg, //"没有数据"
displayInfo: true
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridList.columns[0] = new Ext.grid.RowNumberer();
this.gridList.reconfigure(this.storeList, this.girdcolums);
////////////////////////////////////////////////
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
_this.editRecord = record;
_this.OpStatus = 'edit';
_this.LoadData("edit", "GID='" + record.data.GID + "'");
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
//#region formSearch 下拉框信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modExchangesUnit"} });
this.storeBLSTATUS = Ext.create('Ext.data.Store', {
fields: ['BLSTATUS', 'BLSTATUSREF']
});
this.storeBLSTATUS.add({ "BLSTATUS": "", "BLSTATUSREF": "" });
this.storeBLSTATUS.add({ "BLSTATUS": "1", "BLSTATUSREF": "录入状态" });
this.storeBLSTATUS.add({ "BLSTATUS": "2", "BLSTATUSREF": "提交审核" });
this.storeBLSTATUS.add({ "BLSTATUS": "0", "BLSTATUSREF": "审核通过" });
this.storeBLSTATUS.add({ "BLSTATUS": "6", "BLSTATUSREF": "驳回提交" });
this.comboxBLSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BLSTATUS, //'审核状态',
store: this.storeBLSTATUS,
forceSelection: true,
flex: 0.8,
labelWidth: 70,
name: 'BLSTATUS',
valueField: 'BLSTATUS',
displayField: 'BLSTATUSREF'
});
//#endregion
//#region formSearch 查询面板
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.MblNo, //'代码或简称',
labelWidth: 80, name: 'MblNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.CODENO, //'财务代码/序号',
name: 'CODENO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.QUANCHENG, //'联系人',
name: 'CUSTFULLNAME',
labelWidth: 50,
flex: 0.8,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ATTN, //'联系人',
name: 'ATTN',
labelWidth: 50,
flex: 0.8,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBLSTATUS
,{
fieldLabel: Zi.LAN.NeedAudit, //'只显示待审核',
xtype: 'checkbox',
name: 'NeedAudit',
flex: 0.5
}
, {
xtype: 'button',
width: 90,
text: Zi.LAN.btnRefresh, //"执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 45,
// text: Zi.LAN.btnMore, //"高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
_this = this;
//按钮工具条_
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: Zi.LAN.btnAdd, //"新建",
iconCls: "btnadd",
handler: function (button, event) {
this.LoadData('add', '');
},
scope: this
}, {
text: Zi.LAN.btnDelete, //"删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, {
id: 'btnESave',
text: Zi.LAN.btnESave, //"保存",
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
id: 'btnESaveAndNew',
text: Zi.LAN.btnESaveAndNew, //"保存并新建",
handler: function (button, event) {
this.Save('2');
},
scope: this
}, '-', {
text: Zi.LAN.btnstatus, //"保存列表样式",
id: "btnsubmit",
menu: [
{
text: Zi.LAN.onStartClick, //"保存",
handler: function (menu, event) {
_this.onStartClick();
}
}, {
text: Zi.LAN.onBackClick, //"初始化",
handler: function (menu, event) {
_this.onBackClick();
}
}],
scope: this
}, {
text: Zi.LAN.onAuditClick, //"审核通过",
id: "btnAudit",
iconCls: "btnconfirm",
handler: function (button, event) {
this.onAuditClick(button, event);
},
scope: this
}, {
text: Zi.LAN.onAuditBackClick, //"驳回提交",
id: "btnAuditBack",
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditBackClick(button, event);
},
scope: this
}, {
text: "显示工作流",
id: "btnShowMap",
iconCls: 'btnexportexcel',
handler: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
var record = selections[0];
var bsno = record.data.GID;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + bsno;
window.open(openUrl, openType, openSet);
},
scope: this
}, '-',
{
text: Zi.LAN.btnReset, //"重置条件",
iconCls: "btnreset",
handler: function (button, event) {
var form = this.formSearch.getForm();
form.reset();
},
scope: this
}, '-', {
text: Zi.LAN.Excel,
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.btnTest, //"保存列表样式",
id: "btntest",
menu: [
{ text: Zi.LAN.btnESave, //"保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: Zi.LAN.SaveGridPanel, //"初始化",
handler: function (menu, event) {
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-',
{
text: Zi.LAN.btnPrint, //"打印",
iconCls: 'btnprint',
menu: [
{ text: Zi.LAN.PrintAll, //"全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: Zi.LAN.PrintSelect, //"选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}
]
});
//#region 编辑formEdit 基本信息
this.storeTCCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.comboxTC = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.TC, //'单 证',
store: this.storeTCCode,
forceSelection: true,
hidden: true,
name: 'TICHENGCANYU',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: " 1=1 " } });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PCORPNAME, //'所属集团公司',
store: this.storeCustCode,
labelWidth: 90,
forceSelection: true,
name: 'PCORPNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storeSaleCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanysEntity',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.storeSaleCompany.load({ params: { condition: "" } });
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SALECOMPANY, //'委托分公司',
store: this.storeSaleCompany,
forceSelection: true,
hidden: true,
name: 'SALECORPID',
valueField: 'GID',
displayField: 'NAME'
});
this.StoreFeeFrt = Ext.create('Ext.data.Store', {
fields: ['Frt']
});
this.StoreFeeFrt.add({ "Frt": "PP" });
this.StoreFeeFrt.add({ "Frt": "CC" });
this.comboxFeeFrt = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
fieldLabel: Zi.LAN.FEEFRT, //'默认付费方式',
labelWidth: 90,
forceSelection: true,
name: 'FEEFRT',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeSaleCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeSaleCode.load();
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SALE, //'揽货人',
store: this.storeSaleCode,
// forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeOpCode.load();
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.OP, //'操 作',
store: this.storeOpCode,
// forceSelection: true,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.StoreCUSTTYPE = Ext.create('Ext.data.Store', {
fields: ['CUSTTYPE']
});
this.StoreCUSTTYPE.add({ "CUSTTYPE": "当地同行" });
this.StoreCUSTTYPE.add({ "CUSTTYPE": "外地同行" });
this.StoreCUSTTYPE.add({ "CUSTTYPE": "贸易公司" });
this.StoreCUSTTYPE.add({ "CUSTTYPE": "工厂" });
this.comboxCUSTTYPE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCUSTTYPE,
fieldLabel: Zi.LAN.CUSTTYPE, //'默认付费方式',
forceSelection: true,
name: 'CUSTTYPE',
valueField: 'CUSTTYPE',
displayField: 'CUSTTYPE'
});
this.StoreCUSTGUIMO = Ext.create('Ext.data.Store', {
fields: ['CUSTGUIMO']
});
this.comboxCUSTGUIMO = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCUSTGUIMO,
fieldLabel: Zi.LAN.CUSTGUIMO, //'默认付费方式',
forceSelection: true,
name: 'CUSTGUIMO',
valueField: 'CUSTGUIMO',
displayField: 'CUSTGUIMO',
listeners: {
scope: this,
'focus': function (_this, eOpts) {
var CUSTTYPE = this.formEdit.getForm().findField('CUSTTYPE').getValue();
if (CUSTTYPE == '当地同行' || CUSTTYPE == '外地同行') {
this.StoreCUSTGUIMO.removeAll();
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "小型(200万以下)" });
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "中型(200-800万)" });
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "大型(800万以上)" });
} else if (CUSTTYPE == '贸易公司' || CUSTTYPE == '工厂') {
this.StoreCUSTGUIMO.removeAll();
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "小型(500万以下)" });
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "中型(500-1500万)" });
this.StoreCUSTGUIMO.add({ "CUSTGUIMO": "大型(1500万以上)" });
}
}
}
});
this.StoreCUSTCLASS = Ext.create('Ext.data.Store', {
fields: ['CUSTCLASS']
});
this.StoreCUSTCLASS.add({ "CUSTCLASS": "优" });
this.StoreCUSTCLASS.add({ "CUSTCLASS": "良" });
this.StoreCUSTCLASS.add({ "CUSTCLASS": "差" });
this.comboxCUSTCLASS = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCUSTCLASS,
fieldLabel: Zi.LAN.CUSTCLASS, //'默认付费方式',
forceSelection: true,
name: 'CUSTCLASS',
valueField: 'CUSTCLASS',
displayField: 'CUSTCLASS'
});
this.StoreNATURE = Ext.create('Ext.data.Store', {
fields: ['NATURE']
});
this.StoreNATURE.add({ "NATURE": "民营" });
this.StoreNATURE.add({ "NATURE": "国有" });
this.StoreNATURE.add({ "NATURE": "外资" });
this.StoreNATURE.add({ "NATURE": "合资" });
this.comboxNATURE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreNATURE,
fieldLabel: Zi.LAN.NATURE, //'默认付费方式',
forceSelection: true,
name: 'NATURE',
valueField: 'NATURE',
displayField: 'NATURE'
});
this.StoreQUALIFICATION = Ext.create('Ext.data.Store', {
fields: ['QUALIFICATION']
});
this.StoreQUALIFICATION.add({ "QUALIFICATION": "NVOCC" });
this.StoreQUALIFICATION.add({ "QUALIFICATION": "一级代理" });
this.StoreQUALIFICATION.add({ "QUALIFICATION": "二级代理" });
this.comboxQUALIFICATION = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreQUALIFICATION,
fieldLabel: Zi.LAN.QUALIFICATION, //'默认付费方式',
forceSelection: true,
name: 'QUALIFICATION',
valueField: 'QUALIFICATION',
displayField: 'QUALIFICATION'
});
this.myCheckboxService = new Ext.form.CheckboxGroup({
id: 'myService',
xtype: 'checkboxgroup',
fieldLabel: Zi.LAN.myService, //'客户属性',
columns: 7,
items: [{
boxLabel: Zi.LAN.ISCARRIER, //'船公司',
inputValue: true,
name: 'ISCARRIER'
}, {
boxLabel: Zi.LAN.ISCONTROLLER, //'委托单位',
inputValue: true,
name: 'ISCONTROLLER'
}, {
boxLabel: Zi.LAN.ISYARD, //'场站',
inputValue: true,
name: 'ISYARD'
}, {
boxLabel: Zi.LAN.ISTRUCK, //'车队',
inputValue: true,
name: 'ISTRUCK'
}, {
boxLabel: Zi.LAN.ISCUSTOM, //'报关行',
inputValue: true,
name: 'ISCUSTOM'
}, {
boxLabel: Zi.LAN.ISBOOKING, //'订舱代理',
inputValue: true,
name: 'ISBOOKING'
}, {
boxLabel: Zi.LAN.ISAGENT, //'代理',
inputValue: true,
name: 'ISAGENT'
}, {
boxLabel: Zi.LAN.ISAIRLINES, //'航空公司',
inputValue: true,
name: 'ISAIRLINES'
}, {
boxLabel: Zi.LAN.ISWAREHOUSE, //'仓库',
inputValue: true,
name: 'ISWAREHOUSE'
}, {
boxLabel: Zi.LAN.ISEXPRESS, //'快递公司',
inputValue: true,
name: 'ISEXPRESS'
}, {
boxLabel: Zi.LAN.ISAGENTCN, //'国内代理',
inputValue: true,
name: 'ISAGENTCN'
}, {
boxLabel: Zi.LAN.ISINSURE, //'保险公司',
inputValue: true,
name: 'ISINSURE'
}, {
boxLabel: Zi.LAN.ISSHIPPER, //'发货人',
inputValue: true,
name: 'ISSHIPPER'
}, {
boxLabel: Zi.LAN.ISCONSIGNEE, //'收货人',
inputValue: true,
name: 'ISCONSIGNEE'
}, {
boxLabel: Zi.LAN.ISNOTIFYPARTY, //'通知人',
inputValue: true,
name: 'ISNOTIFYPARTY'
}, {
boxLabel: Zi.LAN.ISLEASING, //'租箱公司',
inputValue: true,
name: 'ISLEASING'
}, {
boxLabel: Zi.LAN.ISTRADINGAGENCY, //'贸易代理',
inputValue: true,
name: 'ISTRADINGAGENCY'
}, {
boxLabel: Zi.LAN.ISENTERP, //'经营单位',
inputValue: true,
name: 'ISENTERP'
}, {
boxLabel: Zi.LAN.ISSHIPAGENCY, //'船代',
inputValue: true,
name: 'ISSHIPAGENCY'
}, {
boxLabel: Zi.LAN.ISOTHER, //'其他',
inputValue: true,
name: 'ISOTHER'
}]
});
this.storeStlName = Ext.create('Ext.data.Store', {
fields: ['FRT']
});
this.storeStlName.add({ "FRT": "月结" });
this.storeStlName.add({ "FRT": "半月结" });
this.storeStlName.add({ "FRT": "约定天数" });
this.storeStlName.add({ "FRT": "季结" });
//this.storeStlName.add({ "FRT": "周结" });
//this.storeStlName.add({ "FRT": "约定天数" });
this.comboxStlName = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.STLNAME, //'结费方式',
hidden: true,
store: this.storeStlName,
forceSelection: true,
name: 'STLNAME',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
}
}
});
this.comboxStlName2 = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: Zi.LAN.STLNAME, //'结费方式',
store: this.storeStlName,
forceSelection: true,
name: 'ACCTYPE',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
}
}
});
//业务来源
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource.load();
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BSSOURCE, //'业务来源',
store: this.storeSource,
//forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName'
});
this.formEdit = Ext.widget('form', {
region: 'center',
frame: true,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.GID, //'编号',
name: 'GID', hidden: true
}, {
fieldLabel: 'BLSTATUSREF', //'编号',
name: 'BLSTATUSREF', hidden: true
}, {
fieldLabel: Zi.LAN.CUSTNUM, //'客户编码',
allowBlank: true,
readOnly:true,
flex: 1,
name: 'CUSTNUM'
}, {
fieldLabel: Zi.LAN.CODENAME, //'客户编码',
allowBlank: true,
readOnly: true,
flex: 1,
name: 'CODENAME'
}, {
fieldLabel: Zi.LAN.SHORTNAME, //'客户简称',
allowBlank: true,
flex: 1,
name: 'SHORTNAME'
}, {
fieldLabel: Zi.LAN.EDICODE, //'EDI代码',
flex: 1,
name: 'EDICODE'
}, {
fieldLabel: Zi.LAN.EDICODE2, //'EDI代码2',
flex: 1,
hidden:true,
name: 'EDICODE2'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.DESCRIPTION, //'客户全称',
allowBlank: true,
flex: 2,
name: 'DESCRIPTION'
}, this.comboxCustCode, {
fieldLabel: Zi.LAN.OPNAME, //'录入人',
readOnly: true,
disabled: true,
name: 'OPNAME'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ENFULLNAME, //'英文全称',
flex: 2,
hidden: true,
name: 'ENFULLNAME'
}, this.comboxSaleCompany, {
xtype: 'checkbox', flex: 1,
labelWidth: 90,
fieldLabel: Zi.LAN.ISSP, //'特批放单客户',
hidden:true,
//readOnly:true,
name: 'ISSP'
}]/*, {
boxLabel: Zi.LAN.ISSP, //'特批放单客户',
inputValue: true,
name: 'ISSP'
}*/
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ADDR, //'TEL',
flex: 2,
name: 'ADDR'
},this.comboxSALE, this.comboxOP]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.TEL, //'TEL',
flex: 1,
name: 'TEL'
}, {
fieldLabel: Zi.LAN.FAX, //'FAX',
flex: 1,
name: 'FAX'
}, {
fieldLabel: Zi.LAN.CHIEF, //'负责人',
flex: 1,
name: 'CHIEF'
}, {
fieldLabel: Zi.LAN.QQ, //'QQ',
flex: 1,
name: 'QQ'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.EMAIL, //'EMAIL',
allowBlank: true,
flex: 1,
name: 'EMAIL'
}, {
fieldLabel: Zi.LAN.WEB, //'网址',
allowBlank: true,
flex: 1,
name: 'WEB'
}
, {
fieldLabel: Zi.LAN.CITY, //'城市',
flex: 1,
hidden:true,
name: 'CITY'
}, {
fieldLabel: Zi.LAN.PROVINCE, //'省(州)',
flex: 1,
hidden: true,
name: 'PROVINCE'
}, {
fieldLabel: Zi.LAN.COUNTRY, //'国家',
flex: 1,
hidden: true,
name: 'COUNTRY'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCUSTTYPE, this.comboxCUSTGUIMO, this.comboxCUSTCLASS, this.comboxNATURE
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxQUALIFICATION,{
fieldLabel: Zi.LAN.REGDATE, //'EDI代码',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'REGDATE'
}, {
fieldLabel: Zi.LAN.CARGOL, //'网址',
allowBlank: true,
flex: 1,
name: 'CARGOL'
}, this.comboxBSSOURCE
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.PRODUCT, //'备 注',
height: 80,
readOnly:true,
name: 'PRODUCT',
anchor: '100%'
}, {
xtype: 'button',
iconCls: "btnadd",
handler: function (button, event) {
this.onSelectListClick(1);
},
scope: this
}]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.EXPREGION, //'备 注',
height: 80,
readOnly: true,
name: 'EXPREGION',
anchor: '100%'
}, {
xtype: 'button',
iconCls: "btnadd",
handler: function (button, event) {
this.onSelectListClick(2);
},
scope: this
}]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.CARRIERLIST, //'备 注',
height: 80,
readOnly: true,
name: 'CARRIERLIST',
anchor: '100%'
}, {
xtype: 'button',
iconCls: "btnadd",
handler: function (button, event) {
this.onSelectListClick(3);
},
scope: this
}]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CTNTYPE, //'MSN',
allowBlank: true,
flex: 1,
name: 'CTNTYPE'
},{
fieldLabel: Zi.LAN.MSN, //'MSN',
allowBlank: true,
flex: 1,
hidden: true,
name: 'MSN'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: Zi.LAN.DOC, //'登陆名',
flex: 1,
hidden: true,
name: 'DOC'
} ]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ISSTOP, //'登陆名',
flex: 1,
hidden:true,
name: 'ISSTOP'
}, {
fieldLabel: Zi.LAN.LOGINNAME, //'登陆名',
flex: 1,
hidden: true,
name: 'LOGINNAME'
}, {
fieldLabel: Zi.LAN.LOGINPASSWORD, //'密码',
flex: 1,
hidden: true,
name: 'LOGINPASSWORD'
}, {
fieldLabel: Zi.LAN.UNITPRICE, //'冷藏费率',
flex: 1,
hidden: true,
xtype: 'numberfield',
name: 'UNITPRICE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.TICHENG, //'密码',
flex: 1,
hidden:true,
xtype: 'numberfield',
name: 'TICHENG'
}, {
fieldLabel: Zi.LAN.FENCHENG, //'冷藏费率',
flex: 1,
hidden: true,
xtype: 'numberfield',
name: 'FENCHENG'
}, this.comboxTC, { xtype: 'hiddenfield' }]
}, this.myCheckboxService, {
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.REMARK, //'备 注',
height: 60,
name: 'REMARK',
anchor: '100%'
}
]
}); //end this.formEdit
this.formACC = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 100,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.REGISTRATIONNO, //'企业备案号',
flex: 1,
labelWidth: 70,
name: 'REGISTRATIONNO'
}, {
fieldLabel: Zi.LAN.InspectionNo, //'商检备案号',
flex: 1,
labelWidth: 70,
name: 'InspectionNo'
}, {
fieldLabel: Zi.LAN.ORGANIZATIONCODE, //'组织机构代码',
flex: 1,
labelWidth: 85,
name: 'ORGANIZATIONCODE'
}, this.comboxRCVMode]
},{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FARCODE2, //'财务应收账款代码',
flex: 1,
labelWidth: 110,
name: 'FARCODE'
}, {
fieldLabel: Zi.LAN.FAPCODE2, //'财务应付账款代码',
flex: 1,
labelWidth: 110,
name: 'FAPCODE'
}, {
fieldLabel: Zi.LAN.ORDERNO, //'财务序号',
flex: 1,
name: 'ORDERNO'
}, this.comboxFeeFrt]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BILLRISES1, //'发票抬头',
allowBlank: true,
flex: 1,
name: 'BILLRISES1'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.INVADDRTEL, //'发票地址电话',
flex: 1,
name: 'INVADDRTEL'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.RMBBILLRISES, //'人民币支票抬头',
flex: 1,
name: 'RMBBILLRISES'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.USDBILLRISES, //'美元支票抬头',
flex: 1,
name: 'USDBILLRISES'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.TAXNO, //'纳税人识别号',
flex: 1,
name: 'TAXNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxStlName]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.STLDATE, //'结费日期',
hidden: true,
flex: 1,
name: 'STLDATE'
}, {
fieldLabel: Zi.LAN.STLFIRSTHALFDATE, //'上半月',
hidden: true,
flex: 1,
name: 'STLFIRSTHALFDATE'
}, {
fieldLabel: Zi.LAN.STLMIDDLEDATE, //'下半月',
hidden: true,
flex: 1,
name: 'STLMIDDLEDATE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.BLCONTENT, //'提单信息',
height: 90,
name: 'BLCONTENT',
anchor: '100%'
}]
}
]
}); //end this.formEdit
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsInfoClientBankModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetBankList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdbankcolums = [{
sortable: true,
dataIndex: 'GID',
text: Zi.LAN.GID, //'唯一编码',
width: 0
}, {
text: Zi.LAN.CODENAME, //'代码',
dataIndex: 'CODENAME',
width: 50,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.CURRENCY, //'币别',
dataIndex: 'CURRENCY',
width: 50,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.ACCOUNTNAME, //'户头名称',
dataIndex: 'ACCOUNTNAME',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.BANKNAME, //'银行名称',
dataIndex: 'BANKNAME',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.ACCOUNT, //'银行账户',
dataIndex: 'ACCOUNT',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.BANKADDR, //'银行地址',
dataIndex: 'BANKADDR',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.FINANCESOFTCODE, //'财务软件代码',
dataIndex: 'FINANCESOFTCODE',
width: 100,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.BANKAGENTNAME, //'代理银行名称',
dataIndex: 'BANKAGENTNAME',
width: 100,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.SWIFT, //'代理银行SWIFT',
dataIndex: 'SWIFT',
width: 100,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.BANKACNO, //'银行SWIFT',
dataIndex: 'BANKACNO',
width: 100,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
text: Zi.LAN.COUNTRYID, //'所在国',
dataIndex: 'COUNTRYID',
width: 100,
align: 'center',
renderer: function (value, p, record) {
if (value == null || value == '') return '';
else return record.data.COUNTRY;
},
editor: this.comboxCountry
}, {
text: Zi.LAN.COUNTRY, //'国家',
hidden: true,
dataIndex: 'COUNTRY',
width: 100,
align: 'center',
}, {
text: Zi.LAN.REMARK, //'备注',
dataIndex: 'REMARK',
width: 100,
align: 'center',
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}];
this.gridListbankCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1 //1单击2双击
});
this.gridListbank = new Ext.grid.GridPanel({
region: 'center',
store: this.storeBodyList,
enableHdMenu: false, //是否显示表格列的菜单
hideHeaders: false, //是否隐藏表头
rowLines: true,
columnLines: true,
tbar: [{
text: '',
tooltip: Zi.LAN.onAddDetailClick, //'添加账户',
iconCls: "btnadd",
handler: function (button, event) {
this.onAddDetailClick(button, event);
},
scope: this
},
'-', {
text: '',
tooltip: Zi.LAN.onDelDetailClick, //'删除账户',
iconCls: "btndelete",
handler: function (button, event) {
this.onDelDetailClick(button, event);
},
scope: this
}
],
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
plugins: [this.gridListbankCellEditing],
selType: 'cellmodel',
columns: this.girdbankcolums
});
this.panelBank = new Ext.Panel({
layout: "border",
region: "center",
split: true,
items: [this.gridListbank]
});
this.storeBodyList.on('beforeload', function (store) {
var GID = _this.formEdit.getForm().findField('GID').getValue();
var sql = "LINKID='" + GID + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//#region 账期 子表
//#region 定义数据集 往来单位账期
this.storeBodyList_ACCDATE = Ext.create('Ext.data.Store', {
model: 'Info_Client_ACCDATEmb',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetACCDATEList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeOPLBNAME = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeOPLBNAME.load({ params: { enumTypeId: 96005 } });
this.comboxOPLBNAME = Ext.create('DsExt.ux.RefEnumCombox', {
//fieldLabel: '税率',
store: this.storeOPLBNAME,
name: 'OPLBNAME',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
//,id: "OPLBNAME"
});
this.storeSale2Code = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeSale2Code.load();
//揽货人
this.comboxSALE2 = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: Zi.LAN.SALE, //'揽货人',
store: this.storeSale2Code,
//forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
this.storeSource2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource2.load();
this.comboxBSSOURCE2 = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: Zi.LAN.BSSOURCE, //'业务来源',
store: this.storeSource2,
//forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName'
});
//#endregion
//#region 列定义
this.girdcolums_ACCDATE = [{
sortable: true, hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'LINKGID',
header: 'LINKGID',
width: 80
},
{
sortable: true,
dataIndex: 'OPLBNAME',
header: Zi.LAN.OPLBNAME, //'业务类型',
width: 80,
editor: this.comboxOPLBNAME
},
{
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.SALE, //'销售员',
width: 80,
editor: this.comboxSALE2
},
{
sortable: true,
dataIndex: 'BSSOURCE',
header: Zi.LAN.BSSOURCE, //'销售员',
width: 80,
editor: this.comboxBSSOURCE2
},
{
sortable: true,
dataIndex: 'BGNDATE',
header: Zi.LAN.BGNDATE, //'合同生效日期',
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
editor: {
xtype: 'datefield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ENDDATE',
header: Zi.LAN.ENDDATE, //'合同失效日期',
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
editor: {
xtype: 'datefield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ACCTYPE',
header: Zi.LAN.ACCTYPE, //'账期类型',
width: 80,
editor: this.comboxStlName2
},
{
sortable: true,
dataIndex: 'ACCSTARTDATE',
tooltip: Zi.LAN.ACCSTARTDATE2, //'从哪天开始计算。通常使用默认的“ETD”',
header: Zi.LAN.ACCSTARTDATE, //'账期起算日',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true, hidden: true,
dataIndex: 'ACCMONTH',
header: Zi.LAN.ACCMONTH, //'间隔月',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'ACCDAYS',
header: Zi.LAN.ACCDAYS, //'间隔日',
width: 80
},
{
sortable: true,
dataIndex: 'ALLOWAMOUNT',
header: Zi.LAN.ALLOWAMOUNT, //'信用额度',
width: 80,
editor: {
xtype: 'numberfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'COMMISSIONRATE',
header: Zi.LAN.COMMISSIONRATE, //'信用额度',
width: 80,
editor: {
xtype: 'numberfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: Zi.LAN.MODIFIEDUSER, //'修改人',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: Zi.LAN.MODIFIEDTIME, //'修改日期',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.REMARK, //'备注',
width: 300,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}];
//#endregion
//#region gridList列表显示信息
this.gridListCellEditing_ACCDATE = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1 //1单击2双击
});
//往来单位-账期信息
this.gridList_ACCDATE = new Ext.grid.GridPanel({
region: 'center',
store: this.storeBodyList_ACCDATE,
enableHdMenu: false, //是否显示表格列的菜单
hideHeaders: false, //是否隐藏表头
rowLines: true,
columnLines: true,
tbar: [{
text: '',
tooltip: Zi.LAN.onAddACCDATE, //'添加账期',
iconCls: "btnadd",
handler: function (button, event) {
this.onAddACCDATE(button, event);
},
scope: this
}, {
text: '',
tooltip: Zi.LAN.onDelACCDATE, //'删除账期',
iconCls: "btndelete",
handler: function (button, event) {
this.onDelACCDATE(button, event);
},
scope: this
},
'-', {
text: Zi.LAN.onSetACCDATE, //'更改相关业务结算日期',
tooltip: Zi.LAN.onSetACCDATE2, //'将符合条件的业务的结算日期按选定的账期重新设定。',
iconCls: "btnup",
handler: function (button, event) {
this.onSetACCDATE(button, event);
},
scope: this
}
],
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
plugins: [this.gridListCellEditing_ACCDATE],
selType: 'cellmodel',
columns: this.girdcolums_ACCDATE
});
this.storeBodyList_ACCDATE.on('beforeload', function (store) {
var GID = _this.formEdit.getForm().findField('GID').getValue();
var sql = "LINKID='" + GID + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//#endregion
//#region 编辑日期
this.formACCDATE = Ext.widget('form', {
region: 'center',
frame: true,
height: 40,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '1 1 1 1',
labelAlign: 'right',
flex: 1,
labelWidth: 100,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
id: "ACCEditForm",//hidden:true,
layout: 'hbox',
defaultType: 'numberfield',
items: [{
fieldLabel: Zi.LAN.ACCMONTH2, //'账期月份',
id: "ACCMONTH",
hidden: true,
tooltip: Zi.LAN.SetACCDATE, //'每月一结选1每两月一结选2以此类推',
flex: 1,
name: 'ACCMONTH',
listeners: {
change: function (field, eOpts) {
this.SetACCDATE();
},
scope: this
}
}, {
fieldLabel: Zi.LAN.STLDATE, //'结费日期',
id: "ACCDAYS",
hidden: true,
flex: 1,
name: 'ACCDAYS',
listeners: {
change: function (field, eOpts) {
this.SetACCDATE();
},
scope: this
}
}, {
xtype: 'hiddenfield', id: "ACChidden", flex: 2
}]
}
]
}); //end this.formEdit
//#endregion
//#region 选择load
this.gridList_ACCDATE.getSelectionModel().on('select', function (model, record, index) {
var ACCTYPE = record.data.ACCTYPE;
var ACCMONTH = record.data.ACCMONTH;
var ACCDAYS = record.data.ACCDAYS;
this.SetShowACCEdit(ACCTYPE, ACCMONTH, ACCDAYS);
}, this);
//#endregion
this.panelACCDATE = new Ext.Panel({
layout: "border",
region: "center",
//split: true,
items: [this.gridList_ACCDATE]
});
this.panelACCDATE_form = new Ext.Panel({
layout: "border",
region: "north", height: 40,
//split: true,
items: [this.formACCDATE]
});
this.panel_ACCDATEEdit = new Ext.Panel({
layout: "border",
region: "center",
title: Zi.LAN.ZhangQiXinXi, //'账期信息',
split: true,
items: [this.panelACCDATE_form, this.panelACCDATE]
});
//#endregion
//#region 联系人
this.storeListContact = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsInfoClientContactModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetContactDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.girdContactcolums = [{
sortable: true,
dataIndex: 'GID',
header: Zi.LAN.GID, //'GID',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'LINKID',
hidden: true,
header: Zi.LAN.LINKID, //'LINKID',
width: 0
},
{
sortable: true,
dataIndex: 'SHOWNAME',
header: Zi.LAN.SHOWNAME, //'联系人',
width: 140
},
{
sortable: true,
dataIndex: 'TEL',
header: Zi.LAN.TEL, //'电话',
width: 140
}, {
sortable: true,
dataIndex: 'EMAIL',
header: Zi.LAN.EMAIL, //'邮箱',
width: 120
},
{
sortable: true,
dataIndex: 'MOBILE',
header: Zi.LAN.MOBILE, //'手机',
width: 120
}, {
sortable: true,
dataIndex: 'QQ',
header: Zi.LAN.QQ, //'QQ',
width: 120
},
{
sortable: true,
dataIndex: 'ISOPERATOR',
header: Zi.LAN.ISOPERATOR2, //'是否操作',
width: 120
},
{
sortable: true,
dataIndex: 'ISSALEMAN',
header: Zi.LAN.ISSALEMAN2, //'是否销售',
width: 120
},
{
sortable: true,
dataIndex: 'ISFINANCIALSTAFF',
header: Zi.LAN.ISFINANCIALSTAFF2, //'是否财务',
width: 120
},
{
sortable: true,
dataIndex: 'ISINSURANCE',
header: Zi.LAN.ISINSURANCE, //'是否财务',
width: 120
},
{
sortable: true,
dataIndex: 'ISOTHER',
header: Zi.LAN.ISOTHER2, //'是否其他',
width: 120
},
{
sortable: true,
dataIndex: 'ISSTOP',
header: Zi.LAN.ISSTOP2, //'是否停用',
width: 120
},
{
sortable: true,
dataIndex: 'INPUTBY',
header: Zi.LAN.INPUTBY, //'录入人',
width: 80
},
{
sortable: true,
dataIndex: 'CREATEDATE',
header: Zi.LAN.CREATEDATE, //'录入时间',
width: 80
}];
this.GridContactCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridContactList = new Ext.grid.GridPanel({
store: this.storeListContact,
enableHdMenu: false,
region: 'west',
width:300,
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
trackMouseOver: true,
disableSelection: false,
columns: this.girdContactcolums,
selModel: this.GridContactCheckBoxModel,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeListContact,
displayMsg: Zi.LAN.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: Zi.LAN.emptyMsg, //"没有数据"
displayInfo: true
})
});
this.gridContactList.reconfigure(this.storeListContact, this.girdContactcolums);
this.gridContactList.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////////////////////////
this.gridContactList.addListener('itemclick', function (dataview, record, item, index, e, b) {
_this.editContactRecord = record;
_this.OpContactStatus = 'edit';
_this.LoadContactData("edit", "GID='" + record.data.GID + "'");
}, this);
this.storeListContact.on('beforeload', function (store) {
var GID = _this.formEdit.getForm().findField('GID').getValue();
var sql = "LINKID='" + GID + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.panelContactBtn = new Ext.Panel({
region: "north",
tbar: [{
text: Zi.LAN.btnAdd, //"新建",
iconCls: "btnadd",
handler: function (button, event) {
_this.LoadContactData("add", "");
},
scope: this
}, {
text: Zi.LAN.btnDelete, //"删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteContactClick(button, event);
},
scope: this
}, {
text: Zi.LAN.btnESave, //"保存",
iconCls: "btnsave",
handler: function (button, event) {
this.SaveContact('0');
},
scope: this
},
'-',
{
text: Zi.LAN.btnESaveAndNew, //"保存并新建",
handler: function (button, event) {
this.SaveContact('2');
},
scope: this
}]
});
this.ContactmyCheckboxService = new Ext.form.CheckboxGroup({
xtype: 'checkboxgroup',
fieldLabel: Zi.LAN.LianXiRenLeiXing, //'联系人类型',
columns: 5,
items: [{
boxLabel: Zi.LAN.ISOPERATOR, //'操作',
inputValue: true,
name: 'ISOPERATOR',
id: 'ISOPERATOR'
}, {
boxLabel: Zi.LAN.ISSALEMAN, //'销售',
inputValue: true,
name: 'ISSALEMAN',
id: 'ISSALEMAN'
}, {
boxLabel: Zi.LAN.ISFINANCIALSTAFF, //'财务',
inputValue: true,
name: 'ISFINANCIALSTAFF',
id: 'ISFINANCIALSTAFF'
}, {
boxLabel: Zi.LAN.ISINSURANCE, //'其他',
inputValue: true,
name: 'ISINSURANCE',
id: 'ISINSURANCE'
}, {
boxLabel: Zi.LAN.ISOTHER, //'其他',
inputValue: true,
name: 'ISOTHER',
id: 'ISOTHER'
}]
});
//编辑form
this.formContactEdit = Ext.widget('form', {
region: 'center',
frame: true,
bodyPadding: 5,
autoScroll: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.GID, //'GID',
name: 'GID', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.LINKID, //'LINKID',
name: 'LINKID', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.SHOWNAME, //'联系人',
name: 'SHOWNAME'
}, this.ContactmyCheckboxService
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.TEL, //'联系电话',
name: 'TEL'
}, {
fieldLabel: Zi.LAN.MOBILE, //'手机',
name: 'MOBILE'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FAX, //'传真',
name: 'FAX'
}, {
fieldLabel: Zi.LAN.QQ, //'QQ',
name: 'QQ'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.EMAIL, //'邮箱',
name: 'EMAIL'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ADDR, //'地址',
name: 'ADDR'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.REMARK, //'备 注',
height: 60,
name: 'REMARK',
anchor: '100%'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
//, {//fieldset 1
// xtype: 'fieldset',
// defaultType: 'textfield',
// layout: 'anchor',
// defaults: {
// anchor: '100%'
// },
// items: [{
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [{
// fieldLabel: Zi.LAN.PICURL, //'签名图片',
// id: "PICURL",
// readOnly: true,
// name: 'PICURL'
// }, {
// xtype: 'button',
// width: 90,
// text: Zi.LAN.onUpLoadFileClick, //'上传附件',
// tooltip: Zi.LAN.onUpLoadFileClick, //'上传附件',
// tooltip: Zi.LAN.onUpLoadFileClick, //'上传附件',
// iconCls: "btnupload",
// handler: function (button, event) {
// this.onUpLoadFileClick(button, event);
// },
// scope: this
// }
// , { xtype: 'hiddenfield', flex: 1 }
// ]
// }
// ]//end items(fieldset 1)
//}//end fieldset 1
]//end root items
}); //end this.formEdit
this.panelContactCenter = new Ext.Panel({
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridContactList, this.formContactEdit]
});
this.panelContact = new Ext.Panel({
title: '职员信息', //'财务信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.panelContactBtn, this.panelContactCenter]
});
//#endregion
this.panelpage = new Ext.Panel({
title: Zi.LAN.KeHuJiBenXinXi, //'客户基本信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEdit]
});
this.panelAcc = new Ext.Panel({
title: '业务信息', //'财务信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formACC, this.panelBank]
});
this.tabSeaeWTpanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
split: true,
enableTabScroll: true,
items:
[
this.panelpage,
this.panelAcc,
this.panel_ACCDATEEdit,
this.panelContact
]
});
//#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.panelBtn, this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.tabSeaeWTpanel]
});
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: '', load: 'true' },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
this.storeList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
var btnAudit = Ext.getCmp('btnAudit');
var btnAuditBack = Ext.getCmp('btnAuditBack');
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: 'modInfoClientAudit'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
btnAudit.show();
btnAuditBack.show();
} else {
btnAudit.hide();
btnAuditBack.hide();
}
}
},
scope: this
});
this.formAuditCust = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '客户代码',
name: 'CODENAME'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '客户简称',
name: 'SHORTNAME'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winAuditCustShow = Ext.create('Ext.window.Window', {
title: "客户审核",
width: 320,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formAuditCust],
buttons: [{
text: "审核通过",
minWidth: 70,
handler: function () {
var form = me.formAuditCust.getForm();
var CODENAME = form.findField('CODENAME').getValue();
var SHORTNAME = form.findField('SHORTNAME').getValue();
//if (CODENAME == '') {
// Ext.Msg.show({ title: '提示', msg: '客户代码为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
//if (SHORTNAME == '') {
// Ext.Msg.show({ title: '提示', msg: '客户简称为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
me.onAuditCustClick(CODENAME, SHORTNAME);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winAuditCustShow.close();
}
}]
});
this.storelane = Ext.create('DsExt.ux.RefEnumStore', {});
this.storelane.load({ params: { enumTypeId: 96010 } });
this.storecarrier = Ext.create('DsExt.ux.RefEnumStore', {});
this.storecarrier.load({ params: { enumTypeId: 96011 } });
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.storeSelectList = Ext.create('Ext.data.Store', {
fields: [
{ name: 'SELECTSTR', type: 'string' }
],
remoteSort: false
});
this.storeSelectListtmp = Ext.create('Ext.data.Store', {
fields: [
{ name: 'SELECTSTR', type: 'string' }
],
remoteSort: false
});
//定义Grid
this.girdselectcolums = [{
sortable: true,
dataIndex: 'SELECTSTR',
header: '航线',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 180
}
];
this.SelectGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridListSelect = new Ext.grid.GridPanel({
store: this.storeSelectList,
enableHdMenu: false,
selModel: this.SelectGridCheckBoxModel,
region: 'north',
height: 500,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdselectcolums
});
this.formSelect = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
width: 420,
height: 520,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [this.gridListSelect]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winSelectShow = Ext.create('Ext.window.Window', {
title: "请选择",
width: 420,
height : 520,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formSelect],
buttons: [{
text: "确认选择",
minWidth: 70,
handler: function () {
var form = me.formEdit.getForm();
var s = '';
var selectedRecords = me.gridListSelect.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (s == '') s = rec.data.SELECTSTR;
else s = s + "\n" + rec.data.SELECTSTR;
}
if (me.selecttype == 3) {
form.findField('CARRIERLIST').setValue(s);
} else if (me.selecttype == 2) {
form.findField('EXPREGION').setValue(s);
} else if (me.selecttype == 1) {
form.findField('PRODUCT').setValue(s);
}
me.winSelectShow.close();
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winSelectShow.close();
}
}]
});
}, //end initUIComponents
onSelectListClick: function (type) {
this.selecttype = type;
this.storeSelectList.removeAll();
var bodyAddDatas = [];
if (this.selecttype == 3) {
for (i = 0; i < this.storecarrier.getCount(); i += 1) {
var memberyf = this.storecarrier.getAt(i);
this.storeSelectList.add({ "SELECTSTR": memberyf.data.EnumValueName });
}
var CARRIERLIST = this.formEdit.getForm().findField('CARRIERLIST').getValue();
if (CARRIERLIST != '') {
var i = CARRIERLIST.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = CARRIERLIST.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
for (j = 0; j < this.storeSelectList.getCount(); j += 1) {
var memberyf = this.storeSelectList.getAt(j);
if (memberyf.data.SELECTSTR == member) {
bodyAddDatas.push(memberyf);
}
}
}
this.gridListSelect.getSelectionModel().select(bodyAddDatas);
}
}
this.winSelectShow.show();
} else if (this.selecttype == 2) {
for (i = 0; i < this.storelane.getCount(); i += 1) {
var memberyf = this.storelane.getAt(i);
this.storeSelectList.add({ "SELECTSTR": memberyf.data.EnumValueName });
}
var EXPREGION = this.formEdit.getForm().findField('EXPREGION').getValue();
if (EXPREGION != '') {
var i = EXPREGION.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = EXPREGION.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
for (j = 0; j < this.storeSelectList.getCount(); j += 1) {
var memberyf = this.storeSelectList.getAt(j);
if (memberyf.data.SELECTSTR == member) {
bodyAddDatas.push(memberyf);
}
}
}
this.gridListSelect.getSelectionModel().select(bodyAddDatas);
}
}
this.winSelectShow.show();
} else if (this.selecttype == 1) {
for (i = 0; i < this.storeCodeGoodsList.getCount(); i += 1) {
var memberyf = this.storeCodeGoodsList.getAt(i);
this.storeSelectList.add({ "SELECTSTR": memberyf.data.GOODNAME });
}
var PRODUCT = this.formEdit.getForm().findField('PRODUCT').getValue();
if (PRODUCT != '') {
var i = PRODUCT.indexOf("\n");
var num = 0;
if (i > 0) {
var slist = PRODUCT.split("\n");
for (var i = 0; i < slist.length; i += 1) {
var member = slist[i];
for (j = 0; j < this.storeSelectList.getCount(); j += 1) {
var memberyf = this.storeSelectList.getAt(j);
if (memberyf.data.SELECTSTR == member) {
bodyAddDatas.push(memberyf);
}
}
}
this.gridListSelect.getSelectionModel().select(bodyAddDatas);
}
}
this.winSelectShow.show();
}
},
LoadData: function (opstatus, condition) {
this.serialNo = 0;
//this.bodyDel = [];
this.opStatus = opstatus;
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
url: '/MvcShipping/MsInfoClient/GetData',
params: {
handle: opstatus,
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi, //Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.formACC.getForm().reset();
this.formACC.getForm().setValues(data);
if (this.opStatus == 'add') {
// this.LoadDefValue();
}
this.Editdata = data;
if (this.opStatus == 'edit') {
this.storeBodyList.load({ params: { condition: "LINKID='" + data.GID + "'", isedit: "1" } });
this.storeBodyList_ACCDATE.load({ params: { condition: "LINKGID='" + data.GID + "'", isedit: "1" } });
this.storeListContact.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: "LINKID='" + data.GID + "'" },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
}
this.GetEditStatus();
} else {
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
var billno = '*';
var gid = '*';
}, // end LoadDate
//#region 保存
Save: function (type) {
var basicForm = this.formEdit.getForm();
var basicForm2 = this.formACC.getForm();
if (!basicForm.isValid()) {
return;
}
if (!basicForm2.isValid()) {
return;
}
var j = 0;
var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i);
j = j + 1;
bodydatas.push(member);
}
//
var cust = this.formEdit.getForm().findField('SHORTNAME').getValue();
if (cust == "") {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.KeHuJianChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'客户简称不能为空!'
return;
}
if (cust.indexOf("'") >= 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.KeHuJianChengBuNengYouTeshuZiFu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'客户简称不能为空!'
return;
}
var DESCRIPTION = this.formEdit.getForm().findField('DESCRIPTION').getValue();
if (DESCRIPTION == "") {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.KeHuQuanChenBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'客户简称不能为空!'
return;
}
//var CODENAME = this.formEdit.getForm().findField('CODENAME').getValue();
//if (CODENAME == "") {
// Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.KeHuDaiMaBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'客户简称不能为空!'
// return;
//}
if (this.myCheckboxService.getChecked() == "") {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.KeHuShuXingBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'客户属性不能为空!'
return;
};
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
var bodydatas2 = [];
for (var i = 0; i < this.storeBodyList_ACCDATE.getCount(); i += 1) {
var member = this.storeBodyList_ACCDATE.getAt(i);
bodydatas2.push(member);
}
var ACCDATEbody = ConvertRecordsToJson(bodydatas2);
this.formEdit.getForm().findField('GID').setDisabled(false);
var data2 = this.formACC.getForm().getValues(false, false, false);
var data = this.formEdit.getForm().getValues(false, false, false);
this.formEdit.getForm().findField('GID').setDisabled(true);
data.ISSP = this.formEdit.getForm().findField('ISSP').getValue() ? 1 : 0;
var datajs = Ext.JSON.encode(data);
var reg = new RegExp("<", "g"); //创建正则RegExp对象
var stringObj = "";
stringObj = datajs.toString();
var datajs = stringObj.replace(reg, "❥");
var bodydatasGDFYWH = [];
var GDFYWHbody = ConvertRecordsToJsonAll(bodydatasGDFYWH);
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/Save',
scope: this,
params: {
opstatus: this.opStatus,
data: datajs,
data2: Ext.JSON.encode(data2),
body: jsonBody,
ACCDATEbody: ACCDATEbody,
GDFYWHbody: GDFYWHbody,
issale:'1'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formACC.getForm().reset();
this.formACC.getForm().setValues(returnData);
this.Editdata = returnData;
var _sd = {
data: ""
};
_sd.data = returnData;
if (this.opStatus == 'add') {
var arrNewRecords = this.storeList.insert(0, returnData);
this.editRecord = this.storeList.getAt(0);
if (type == '0') {
this.opStatus = 'edit';
basicForm.findField('GID').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("LINKID", this.editRecord.get('GID'));
memberbody.commit();
};
} else if (type == '2') {
this.LoadData('add', '');
}
if (type == '0') {
this.opStatus = 'edit';
basicForm.findField('GID').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("LINKID", this.editRecord.get('GID'));
memberbody.commit();
};
} else if (type == '2') {
this.LoadData('add', '');
}
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsInfoClientModel', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
if (type == '0') {
this.opStatus = 'edit';
basicForm.findField('GID').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("LINKID", this.editRecord.get('GID'));
memberbody.commit();
};
} else if (type == '2') {
this.LoadData('add', '');
}
}
this.SetShowACCEdit("隐藏");
this.storeBodyList_ACCDATE.load({ params: { condition: "LINKGID='" + returnData.GID + "'", isedit: "1" } });
} else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: Zi.LAN.FuWuQiXiangYingChuCuo, //'服务器响应出错,请重试...',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
GetEditStatus: function () {
var cust = this.formEdit.getForm().findField('SHORTNAME').getValue();
if (cust != "") {
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsInfoClient/ISUSE',
params: {
cust: cust
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
this.formEdit.getForm().findField('SHORTNAME').setReadOnly(true);
// this.formEdit.getForm().findField('CODENAME').setReadOnly(true);
} else {
}
} else {
}
},
scope: this
});
} else {
this.formEdit.getForm().findField('SHORTNAME').setReadOnly(false);
}
_this = this;
var OPNAME = this.formEdit.getForm().findField('OPNAME').getValue();
this.StoreOpRange.load({
params: { optype: "modExchangesUnit" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', OPNAME);
if (records.getCount() > 0) {
canedit = true;
} else {
canedit = false;
}
} else { canedit = false; }
_this.setSaveBtnStatus(canedit);
}
}
});
},
setSaveBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
if (enable) {
btnESave.enable();
btnESaveAndNew.enable();
} else {
btnESave.disable();
btnESaveAndNew.disable();
}
},
//#region 银行明细
onAddDetailClick: function (button, event) {
var custfullname = this.formEdit.getForm().findField('DESCRIPTION').getValue();
var record = Ext.create('MsInfoClientBankModel', {
GID: NewGuid(),
LINKID: '*',
ACCOUNTNAME: custfullname,
CODENAME: '',
CURRENCY: 'RMB',
BANKNAME: '',
ACCOUNT: '',
FINANCESOFTCODE: '',
REMARK: ''
});
this.storeBodyList.add(record);
var n = this.storeBodyList.getCount();
this.gridListbankCellEditing.startEditByPosition({ row: n - 1, column: 3 });
},
onDelDetailClick: function (button, event) {
var selectedRecords = this.gridListbank.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.LINKID == "" || rec.data.LINKID == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList.remove(selectedRecords[i]);
}
else {
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/DeleteBank',
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.storeBodyList.remove(rec);
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//this.storeBodyList.remove(selectedRecords[i]);
}
},
//#endregion
//#region 账期明细
onAddACCDATE: function (button, event) {
var record = Ext.create('Info_Client_ACCDATEmb', {
GID: NewGuid(),
LINKGID: '*',
OPLBNAME: '',
SALE: '',
BGNDATE: '',
ENDDATE: '',
ACCTYPE: "月结",
ACCSTARTDATE: "ETD",
ACCMONTH: "1",
ACCDAYS: "1",
ALLOWAMOUNT: "0",
MODIFIEDUSER: SHOWNAME,
MODIFIEDUSER_REF: SHOWNAME,
MODIFIEDTIME: '',
REMARK: ''
});
this.storeBodyList_ACCDATE.add(record);
var n = this.storeBodyList_ACCDATE.getCount();
this.gridListCellEditing_ACCDATE.startEditByPosition({ row: n - 1, column: 2 });
},
onDelACCDATE: function (button, event) {
var selectedRecords = this.gridList_ACCDATE.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.LINKGID == "" || rec.data.LINKGID == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList_ACCDATE.remove(selectedRecords[i]);
this.SetShowACCEdit("隐藏");
}
else {
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/DeleteACCDATE',
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.storeBodyList_ACCDATE.remove(rec);
this.SetShowACCEdit("隐藏");
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//this.storeBodyList.remove(selectedRecords[i]);
}
},
onSetACCDATE: function (button, event) {
var selectedRecords = this.gridList_ACCDATE.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.LINKGID == "" || rec.data.LINKGID == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList_ACCDATE.remove(selectedRecords[i]);
this.SetShowACCEdit("隐藏");
}
else {
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingYaoPiLiangSheDingJieSuanRiQiMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/SetACCDATE',
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.storeBodyList_ACCDATE.remove(rec);
//this.SetShowACCEdit("隐藏");
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//this.storeBodyList.remove(selectedRecords[i]);
}
},
//#endregion
ACCAfterEdit: function (editor, e, eOpts) {
if (e.field == 'COUNTRYID') {
var records = DsStoreQueryBy(this.storeCountry, 'countryid', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
e.record.set('COUNTRY', data.country);
} else {
e.record.set('COUNTRY', '');
}
}
},
SetShowACCEdit: function (ACCTYPE, _ACCMONTH, _ACCDAYS) {
//根据ACCTYPE决定ACCEDIT的labelfield如何显示
var ACCMONTH = Ext.getCmp("ACCMONTH");
var ACCDAYS = Ext.getCmp("ACCDAYS");
var ACChidden = Ext.getCmp("ACChidden");
if (ACCTYPE == "月结") {
Ext.DomQuery.selectNode('label[id=ACCMONTH-labelEl]').innerHTML = Zi.LAN.ACCMONTH; //'间隔月份';
ACCMONTH.tooltip = Zi.LAN.ACCMONTH2; //'每月一结选1每两月一结选2以此类推';
ACCMONTH.setValue(_ACCMONTH);
ACCMONTH.maxValue = 24;
ACCMONTH.minValue = 1;
ACCMONTH.show();
Ext.DomQuery.selectNode('label[id=ACCDAYS-labelEl]').innerHTML = Zi.LAN.ZhangQiRiQi; //'账期日期';
ACCDAYS.tooltip = Zi.LAN.ZhangQiRiQi2; //'该月几日为结算期限';
ACCDAYS.setValue(_ACCDAYS);
ACCDAYS.maxValue = 31;
ACCDAYS.minValue = 0;
ACCDAYS.show();
//ACChidden.flex=2;
} if (ACCTYPE == "季结") {
Ext.DomQuery.selectNode('label[id=ACCMONTH-labelEl]').innerHTML = Zi.LAN.SEASON; //'间隔月份';
ACCMONTH.tooltip = Zi.LAN.ACCMONTH2; //'每月一结选1每两月一结选2以此类推';
ACCMONTH.setValue(_ACCMONTH);
ACCMONTH.maxValue = 12;
ACCMONTH.minValue = 1;
ACCMONTH.show();
Ext.DomQuery.selectNode('label[id=ACCDAYS-labelEl]').innerHTML = Zi.LAN.ZhangQiRiQi; //'账期日期';
ACCDAYS.tooltip = Zi.LAN.ZhangQiRiQi2; //'该月几日为结算期限';
ACCDAYS.setValue("0");
ACCDAYS.hide();
//ACCDAYS.show();
//ACChidden.flex=2;
}
if (ACCTYPE == "半月结") {
Ext.DomQuery.selectNode('label[id=ACCMONTH-labelEl]').innerHTML = Zi.LAN.STLFIRSTHALFDATE; //'上半月';
ACCMONTH.tooltip = Zi.LAN.STLFIRSTHALFDATE2; //'上半月账期';
ACCMONTH.setValue(_ACCMONTH);
ACCMONTH.maxValue = 15;
ACCMONTH.minValue = 1;
ACCMONTH.show();
Ext.DomQuery.selectNode('label[id=ACCDAYS-labelEl]').innerHTML = Zi.LAN.STLMIDDLEDATE; //'下半月';
ACCDAYS.tooltip = Zi.LAN.STLMIDDLEDATE2; //'下半月账期如大于28日则都按照该月最后一天处理。';
ACCDAYS.setValue(_ACCDAYS);
ACCDAYS.maxValue = 31;
ACCDAYS.minValue = 16;
ACCDAYS.show();
//ACChidden.flex=2;
}
if (ACCTYPE == "约定天数") {
Ext.DomQuery.selectNode('label[id=ACCMONTH-labelEl]').innerHTML = Zi.LAN.ACCMONTH; //'间隔月份';
ACCMONTH.tooltip = Zi.LAN.ACCMONTH2; //'每月一结选1每两月一结选2以此类推';
ACCMONTH.setValue("0");
ACCMONTH.hide();
Ext.DomQuery.selectNode('label[id=ACCDAYS-labelEl]').innerHTML = Zi.LAN.ZhangQiRiQi; //'账期日期';
ACCDAYS.tooltip = Zi.LAN.ZhangQiRiQi3; //'将结算日期设为开船日期后的多少天。';
ACCDAYS.setValue(_ACCDAYS);
ACCDAYS.maxValue = 1000;
ACCDAYS.minValue = 0;
ACCDAYS.show();
//ACChidden.flex=4;
}
if (ACCTYPE == "隐藏") {
ACCMONTH.hide();
ACCDAYS.hide();
//ACChidden.flex=4;
}
},
SetACCDATE: function () {
var ACCMONTH = Ext.getCmp("ACCMONTH");
var ACCDAYS = Ext.getCmp("ACCDAYS");
var selectedRecords = this.gridList_ACCDATE.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
rec.set('ACCMONTH', ACCMONTH.getValue());
rec.set('ACCDAYS', ACCDAYS.getValue());
}
},
GetHandleSerialNo: function (store) {
var result = 0;
if (result == 0) {
for (var i = 0; i < store.getCount(); i += 1) {
var member = store.getAt(i);
if (parseInt(member.data.SORT) > parseInt(result)) {
result = member.data.SORT;
}
}
}
result = parseInt(result) + 1;
return result;
},
//#region 联系人
LoadContactData: function (opstatus, condition) {
this.serialNo = 0;
this.workSerialNo = 0;
this.bodyDel = [];
this.OpContactStatus = opstatus;
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
url: '/MvcShipping/MsInfoClient/GetContactData',
params: {
handle: opstatus,
condition: condition
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var data = result.data;
this.formContactEdit.getForm().reset();
this.formContactEdit.getForm().setValues(data);
if (this.OpContactStatus == 'add') {
var GID = this.formEdit.getForm().findField('GID').getValue();
this.formContactEdit.getForm().findField('LINKID').setValue(GID);
}
//var PICURL = Ext.getCmp("PICURL").getValue();
//Ext.getCmp('panelPic').body.update(' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + PICURL + '"> </iframe>');
} else {
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}, // end LoadDate
SaveContact: function (type) {
var basicForm = this.formContactEdit.getForm();
if (!basicForm.isValid()) {
return;
}
basicForm.findField('GID').setDisabled(false);
var data = basicForm.getValues();
basicForm.findField('GID').setDisabled(true);
if (this.opStatus == 'add') {
data.GID = NewGuid();
}
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsInfoClient/SaveContact',
scope: this,
params: {
opstatus: this.OpContactStatus,
data: Ext.JSON.encode(data)
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formContactEdit.getForm().setValues(returnData);
if (this.OpContactStatus == 'add') {
var arrNewRecords = this.storeListContact.add(returnData);
this.editContactRecord = arrNewRecords[0];
}
else if (this.OpContactStatus == 'edit') {
var editp = Ext.create('MsInfoClientContactModel', returnData);
this.editContactRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editContactRecord.set(name, editp.get(name));
}
}, this);
this.editContactRecord.commit();
}
if (type == '0') {
this.OpContactStatus = 'edit';
basicForm.findField('GID').setDisabled(true);
} else {
this.LoadContactData('add', '');
basicForm.findField('GID').setDisabled(false);
}
} else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: Zi.LAN.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
onDeleteContactClick: function (button, event) {
var selections = this.gridContactList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在删除数据...',
url: '/MvcShipping/MsInfoClient/DeleteContact',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeListContact.remove(record);
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
//#endregion
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请先选择要删除的客户!'
return;
}
for (var i = 0; i < selections.length; i++) {
if (selections[i].data.BLSTATUSREF == '审核通过') {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '无法删除已审核通过的信息!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请先选择要删除的客户!'
return;
}
}
var record = selections[0];
if (this.StoreOpRange.getCount() == 0) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'权限不足,不允许删除!'
return;
} else {
var op = record.data.OPNAME;
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
canedit = false;
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'权限不足,不允许删除!'
return;
}
}
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/Delete',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
//end initUIComponents
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
// var form2 = this.formSearch2.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.ChaXunTiaoJianFuZhiCuoWu); //'查询条件赋值错误,请检查。'
return '';
}
this.isShowAdvancedQuery = 0;
//
var sql = '';
//#region formSearch 查询面板
var MblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, MblNo, "(CODENAME like '%" + MblNo + "%' or SHORTNAME like '%" + MblNo + "%')");
var ATTN = form.findField('ATTN').getValue();
sql = sql + getAndConSql(sql, ATTN, "GID IN (SELECT LINKID FROM info_client_contact where SHOWNAME like '%" + ATTN + "%')");
//var ETDbgn = form.findField('ETDbgn').getRawValue();
//sql = sql + getAndConSql(sql, ETDbgn, "OPTIME >='" + ETDbgn + "'");
//var ETDend = form.findField('ETDend').getRawValue();
//sql = sql + getAndConSql(sql, ETDend, "OPTIME <='" + ETDend + "'");
var CODENO = form.findField('CODENO').getValue();
sql = sql + getAndConSql(sql, CODENO, "(FARCODE like '%" + CODENO + "%' or FAPCODE like '%" + CODENO + "%' or ORDERNO like '%" + CODENO + "%')");
var CUSTFULLNAME = form.findField('CUSTFULLNAME').getValue();
sql = sql + getAndConSql(sql, CUSTFULLNAME, "[DESCRIPTION] like '%" + CUSTFULLNAME + "%' ");
var BLSTATUS = form.findField('BLSTATUS').getValue();
sql = sql + getAndConSql(sql, BLSTATUS, " BLSTATUS=" + BLSTATUS + " ");
//var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) ";
var NeedAudit = form.findField("NeedAudit").getValue();
if (NeedAudit)
{ sql = sql + getAndConSql(sql, NeedAudit, " EXISTS (select 1 from workflow_using wu where wu.BSNO=info_client.GID and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + USERID + "',wu.stepno)>0 ) "); }
//#endregion formSearch
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.selectbsno;
ret[4] = 'info_client';
return ret;
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.CODENAME;
}
var sortstr = '[{\"property\":\"CODENAME\",\"direction\":\"ASC\"}]';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/GetDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true',
sort: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSINFOCLIENTLIST';
var sql1 = returnstr;
var sql2 = "select * from info_client where CODENAME='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.FuWuQiXiangYingChuCuo, //'服务器响应出错,请重试...',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
PrintSelect: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.GridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请先选择要打印的业务!'
return;
}
var sortstr = 'CODENAME';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var printType = 'MSOPCLIENTLISTSELECT';
var sql1 = "select * from info_client WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "select * from info_client where GID='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
//#region EDI导入
onImportHangXinClick: function (button, event) {
if (this.winAccess) { this.winAccess.close(); }
this.winAccess = new Shipping.FileImport({
});
this.winAccess.StoreList = this.storeList;
this.winAccess.show();
return;
},
//#endregion
onStartClick: function () {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "录入状态" && member.data.BLSTATUSREF != "驳回提交") {
alert(Zi.LAN.ZhiNengTiJiaoLuRuZhuangTaiHuoBoHuiTiJiaoDeWangLaiDanWei); //"只能提交 录入状态 或 驳回提交 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/IC_Start',
params: {
USERID: USERID,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
this.storeList.reload();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
, onBackClick: function (REASON) {
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "提交审核") {
alert(Zi.LAN.ZhiNengCheHuiTiJiaoShenHeDeWangLaiDanWei); //"只能撤回 提交审核 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/IC_Back',
params: {
USERID: USERID,
data: jsonBody,
REASON: REASON
},
callback: function (options, success, response) {
if (success) {
this.storeList.reload();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
, onAuditBackClick: function (REASON) {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "提交审核" && member.data.BLSTATUSREF != "审核通过") {
alert(Zi.LAN.ZhiNengBoHuiTiJiaoShenHeHuoShenHeTongGuoDeWangLaiDanWei); //"只能驳回 提交审核 或 审核通过 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/IC_AuditBack',
params: {
USERID: USERID,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
this.storeList.reload();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
, onAuditClick: function () {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {//提示 请先选择单据
Ext.Msg.show({ title:'提示', msg:'请选择客户!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var billstatus = record.data.BLSTATUSREF;
if (billstatus != '提交审核') {
// 提示 当前状态无法删除此单据
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.ZhiNengShenHeTiJiaoShenHeDeWangLaiDanWei, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.formAuditCust.getForm().findField('CODENAME').setValue('');
this.formAuditCust.getForm().findField('SHORTNAME').setValue(record.data.SHORTNAME);
this.winAuditCustShow.show();
},
onAuditCustClick: function (codename, shortname) {
this.formEdit.getForm().findField('GID').setDisabled(false);
var data = this.formEdit.getForm().getValues(false, false, false);
this.formEdit.getForm().findField('GID').setDisabled(true);
var datajs = Ext.JSON.encode(data);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/AuditCust',
params: {
data: datajs,
codename: codename,
shortname: shortname
},
callback: function (options, success, response) {
if (success) {
this.formEdit.getForm().findField('CODENAME').setValue(codename);
this.formEdit.getForm().findField('SHORTNAME').setValue(shortname);
this.storeList.reload();
this.winAuditCustShow.close();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
});