Ext.namespace('Shipping'); Shipping.MsInfoClientEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsInfoClientEdit.superclass.constructor.call(this); }; Ext.extend(Shipping.MsInfoClientEdit, Ext.Panel, { ParentWin: null, OpStatus: 'add', StoreList: null, editRecord: null, Editdata: null, stroplb: Zi.LAN.WangLaiDanWei, //'往来单位', //需求编号:SR2017061200005-1 initUIComponents: function () { this.serialNo = 0; //this.bodyDel = []; this.itemindex = 1; this.initloaddata = 0; //#region 信息加载 //权限范围 this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', { model: 'MsOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' } }); this.StoreOpRange.load({ params: { optype: "modExchangesUnit"} }); //人员信息加载 this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' } }); this.storeOpCode2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' } }); this.storeMustBe = Ext.create('Ext.data.Store', { model: 'DsShipping.ux.OpDefValue', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsCodeOpMustField/GetDataList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); //揽货人 this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SALE, //'揽货人', store: this.storeOpCode, // forceSelection: true, name: 'SALE', valueField: 'UserName', displayField: 'CodeAndName' }); //操 作 this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.OP, //'操 作', store: this.storeOpCode, // forceSelection: true, name: 'OP', valueField: 'UserName', displayField: 'CodeAndName' }); //单证 this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.DOC, //'单 证', store: this.storeOpCode, forceSelection: true, name: 'DOC', valueField: 'UserName', displayField: 'CodeAndName' }); //揽货人 this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.CUSTSERVICE, //'揽货人', store: this.storeOpCode2, forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', name: 'CUSTSERVICE', valueField: 'UserName', displayField: 'CodeAndName' }); 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, 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.storeRCVMode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsExtEnumModel', proxy: { url: '/CommMng/PubSys/GetEnumValueList' } }); this.storeRCVMode.load({ params: { enumTypeId: 23} }); this.comboxRCVMode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.RCVMode, //'收单据模式', flex: 1, store: this.storeRCVMode, forceSelection: true, name: 'RCVMode', valueField: 'EnumValueId', displayField: 'EnumValueName' }); 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, name: 'SALECORPID', valueField: 'GID', displayField: 'NAME' }); this.storeSALEDEPT = Ext.create('DsExt.ux.RefTableStore', { model: 'DsExtEnumModel', proxy: { url: '/CommMng/PubSys/GetEnumValueList' } }); this.storeSALEDEPT.load({ params: { enumTypeId: 97303 } }); this.comboxSALEDEPT = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SALEDEPT, //'装箱类型', store: this.storeSALEDEPT, // forceSelection: true, name: 'SALEDEPT', valueField: 'EnumValueName', displayField: 'EnumValueName' }); this.storeOFFICEADDR = Ext.create('DsExt.ux.RefTableStore', { model: 'DsExtEnumModel', proxy: { url: '/CommMng/PubSys/GetEnumValueList' } }); this.storeOFFICEADDR.load({ params: { enumTypeId: 97304 } }); this.comboxOFFICEADDR = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.OFFICEADDR, //'装箱类型', store: this.storeOFFICEADDR, // forceSelection: true, name: 'OFFICEADDR', valueField: 'EnumValueName', displayField: 'EnumValueName' }); //客户加载_委托单位 this.storePSCUST = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' } }); // this.storeCustCode.loadData(this.mainWin.GetPubStore("OPSEAE_CUST_ISCONTROLLER").data.items); this.comboxPSCUST = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PSCUST, //'委托单位', store: this.storePSCUST, // forceSelection: true, queryMode: 'remote', minChars: 1, queryParam: 'CODENAME', autoSelect: true, name: 'PSCUST', valueField: 'CustName', displayField: 'CodeAndName' }); //#endregion //#region 数据集 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.CheckISSTOP = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.ISSTOP, //'停止使用', inputValue: true, name: 'ISSTOP' }); me = this; 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.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.storeCountry = Ext.create('DsExt.ux.RefTableStore', { model: 'ConutryRef', proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' } }); this.storeCountry.load({ params: { condition: ""} }); this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: Zi.LAN.COUNTRYID, //'所在国', store: this.storeCountry, forceSelection: true, name: 'countryid', valueField: 'countryid', displayField: 'country_idandname' }); 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.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' }); //#endregion //#region 编辑formEdit 基本信息 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.CODENAME, //'客户编码', allowBlank: 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, name: 'EDICODE2' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.DESCRIPTION, //'客户全称', allowBlank: true, flex: 3, name: 'DESCRIPTION' },this.comboxCustCode] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.ENFULLNAME, //'英文全称', flex: 2, name: 'ENFULLNAME' },this.comboxSaleCompany,{ xtype : 'checkbox',flex:0.5, labelWidth: 90, fieldLabel: Zi.LAN.ISSP, //'特批放单客户', //readOnly:true, name: 'ISSP' }, { xtype: 'checkbox', flex: 0.5, labelWidth: 90, inputValue: true, fieldLabel: Zi.LAN.ISNOTPR, //'特批放单客户', //readOnly:true, name: 'ISNOTPR' }]/*, { boxLabel: Zi.LAN.ISSP, //'特批放单客户', inputValue: true, name: 'ISSP' }*/ }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'textareafield', fieldLabel: Zi.LAN.ADDR, //'地址', grow: true, height: 45, name: 'ADDR' }] }, { 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.TEL, //'TEL', flex: 1, name: 'TEL' }, { fieldLabel: Zi.LAN.FAX, //'FAX', flex: 1, name: 'FAX' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ 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' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.MSN, //'MSN', allowBlank: true, flex: 1, name: 'MSN' }, { fieldLabel: Zi.LAN.CITY, //'城市', flex: 1, name: 'CITY' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.PROVINCE, //'省(州)', flex: 1, name: 'PROVINCE' }, { fieldLabel: Zi.LAN.COUNTRY, //'国家', flex: 1, name: 'COUNTRY' }, this.comboxBSSOURCE,{ fieldLabel: Zi.LAN.OPNAME, //'录入人', readOnly: true, disabled: true, name: 'OPNAME' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxSALE, this.comboxOP, this.comboxDOC, this.comboxCUSTSERVICE ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.CheckISSTOP, { fieldLabel: Zi.LAN.LOGINNAME, //'登陆名', flex: 1, name: 'LOGINNAME' }, { fieldLabel: Zi.LAN.LOGINPASSWORD, //'密码', flex: 1, name: 'LOGINPASSWORD' }, { fieldLabel: Zi.LAN.UNITPRICE, //'冷藏费率', flex: 1, xtype:'numberfield', name: 'UNITPRICE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxSALEDEPT, this.comboxOFFICEADDR, this.comboxPSCUST, this.comboxFeeFrt] }, this.myCheckboxService, { xtype: 'textareafield', grow: true, fieldLabel: Zi.LAN.REMARK, //'备 注', height: 60, name: 'REMARK', anchor: '100%' }, { xtype: 'textareafield', grow: true, fieldLabel: Zi.LAN.BLCONTENT, //'提单信息', height: 90, name: 'BLCONTENT', 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.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' }] }, { 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' }] } ] }); //end this.formEdit //#endregion //#region 定义数据集 往来单位银行账户 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' } } }); //#endregion this.storeISINVDEF = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeISINVDEF.add({ "DC": "1", "NAME": "是" }); this.storeISINVDEF.add({ "DC": "", "NAME": "否" }); this.comboxISINVDEF = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeISINVDEF, valueField: 'DC', displayField: 'NAME', name: 'ISINVDEF' }); //#region 列定义 this.girdcolums = [{ 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:'是否开票默认账户', //'所在国', dataIndex: 'ISINVDEF', width: 100, align: 'center', editor: this.comboxISINVDEF }, { text: Zi.LAN.REMARK, //'备注', dataIndex: 'REMARK', width: 100, align: 'center', editor: { xtype: 'textfield', selectOnFocus: true } }]; //#endregion //#region 账户 this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 //1单击,2双击 }); this.gridList = 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.gridListCellEditing], selType: 'cellmodel', columns: this.girdcolums }); //#endregion this.panelBank = new Ext.Panel({ layout: "border", region: "center", split: true, items: [this.gridList] }); //#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.comboxSALE2 = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: Zi.LAN.SALE, //'揽货人', store: this.storeOpCode, 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 }); //#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 //#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", split: true, items: [this.panelACCDATE_form,this.panelACCDATE] }); //#region 定义数据集 固定费用 this.storeBodyList_GuDingFeeWeiHu = Ext.create('Ext.data.Store', { model: 'MsInfoClientFeeDetailModel', remoteSort: false, proxy: { type: 'ajax', url: '/MvcShipping/MsInfoClient/GetGDFYWHList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.FeeTypeRefModel', proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' } }); this.storeFeeNameRef.load({ params: { condition: "" } }); this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeFeeNameRef, forceSelection: true, name: 'FEENAME', valueField: 'Name', displayField: 'CodeAndName' }); Ext.define('MsFeeCurr', { extend: 'Ext.data.Model', idProperty: 'CURR', fields: [ { name: 'CURR', type: 'string' }, { name: 'DEFRATE', type: 'number' }, { name: 'CRDEFRATE', type: 'number' } ] }); this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', { model: 'MsFeeCurr', proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' } }); this.StoreCurr.load({ params: { condition: "" } }); this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreCurr, forceSelection: true, name: 'CURRENCY', valueField: 'CURR', displayField: 'CURR' }); this.storeFeeUnit = Ext.create('DsExt.ux.RefTableStore', { fields: ['UNIT'], proxy: { url: '/MvcShipping/MsCodeFeeTemplate/GetFeeUnit' } }); this.storeFeeUnit.load({ params: { condition: "" } }); this.comboxFeeUnit = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeFeeUnit, forceSelection: true, name: 'UNIT', valueField: 'UNIT', displayField: 'UNIT' }); this.storeIsCtn = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeIsCtn.add({ "DC": true, "NAME": "是" }); this.storeIsCtn.add({ "DC": false, "NAME": "否" }); this.comboxIsCtn = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeIsCtn, valueField: 'DC', displayField: 'NAME', forceSelection: true, name: 'ISCTN' }); this.storeIsExChange = Ext.create('Ext.data.Store', { fields: ['DC', 'NAME'] }); this.storeIsExChange.add({ "DC": 0, "NAME": "根据汇率设置" }); this.comboxIsExChange = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeIsExChange, valueField: 'DC', displayField: 'NAME', // forceSelection: true, name: 'EXCHANGERATE' }); 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, forceSelection: true, name: 'FeeFrt', valueField: 'Frt', displayField: 'Frt' }); //#endregion //#region 列定义 this.girdcolums_DGFYWH = [{ sortable: true, dataIndex: 'GID', header: Zi.LAN.GID, //'GID', hidden: true, width: 100 }, { sortable: true, dataIndex: 'FEENAME', header: Zi.LAN.FEENAME, //'费用名称', editor: this.comboxFeeNameRef, width: 140 }, { sortable: true, dataIndex: 'UNIT', header: Zi.LAN.UNIT, //'标准', editor: this.comboxFeeUnit, width: 80 }, { sortable: true, dataIndex: 'CURRENCY', header: Zi.LAN.CURRENCY, //'币别', editor: this.comboxCurr, width: 40 }, { sortable: true, dataIndex: 'UNITPRICE', header: Zi.LAN.UNITPRICE_WH, //'单价', editor: { xtype: 'numberfield', keyNavEnabled: false, selectOnFocus: true, hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true }, 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 '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'EXCHANGERATE', header: Zi.LAN.EXCHANGERATE, //'汇率', editor: this.comboxIsExChange, renderer: function (value, p, record) { if (value == 0) return Zi.LAN.GenJuSheZhiHuiLvShengCheng; //'根据设置汇率生成'; else return value; }, // { // xtype: 'numberfield', // keyNavEnabled: false, // selectOnFocus: true, // hideTrigger: true, // mouseWheelEnabled: false, // decimalPrecision: 6, // enableKeyEvents: true // }, // renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 6, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'TAXRATE', header: Zi.LAN.TAXRATE, //'单价', editor: { xtype: 'numberfield', keyNavEnabled: false, selectOnFocus: true, hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true }, align: 'right', width: 80 }, { sortable: true, dataIndex: 'FEEFRT', header: Zi.LAN.FEEFRT_WH, //'FRT', editor: this.comboxFeeFrt, width: 40 }, { sortable: true, dataIndex: 'ISADVANCEDPAY', header: Zi.LAN.ISADVANCEDPAY, //'垫付', editor: { xtype: 'checkboxfield', inputValue: '1', uncheckedValue: '0' // selectOnFocus: true }, renderer: function (value, cellmeta) { if (value == '1') { return "是"; } }, width: 60 }, { sortable: true, dataIndex: 'ISINVOICE', header: Zi.LAN.ISINVOICE, //'不开发票', editor: { xtype: 'checkboxfield', inputValue: '1', uncheckedValue: '0' // selectOnFocus: true }, renderer: function (value, cellmeta) { if (value == '1') { return "是"; } }, width: 60 }, { sortable: true, dataIndex: 'REMARK', header: Zi.LAN.REMARK, //'备注', editor: { xtype: 'textfield', selectOnFocus: true, enableKeyEvents: true }, width: 150 } ] //#endregion //#region gridList列表显示信息 this.gridListCellEditing_GDFYWH = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 //1单击,2双击 }); this.gridList_GDFYWH = new Ext.grid.GridPanel({ region: 'center', store: this.storeBodyList_GuDingFeeWeiHu, enableHdMenu: false, //是否显示表格列的菜单 hideHeaders: false, //是否隐藏表头 rowLines: true, columnLines: true, tbar: [{ text: Zi.LAN.btnAddDetail, //'增加费用明细', tooltip: Zi.LAN.btnAddDetail, //'增加费用明细', iconCls: "btnadddetail", handler: function (button, event) { this.onAddDGFYWHClick(button, event, 1); }, scope: this }, '-', { text: Zi.LAN.btnDeleteDetail, //'删除费用明细', tooltip: Zi.LAN.btnDeleteDetail, //'删除费用明细', iconCls: "btndeletedetail", handler: function (button, event) { this.onDelGDFYWHClick(button, event, 1); }, scope: this }], loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..." plugins: [this.gridListCellEditing_GDFYWH], selType: 'cellmodel', columns: this.girdcolums_DGFYWH }); //#endregion this.panelGDFYWH = new Ext.Panel({ layout: "border", region: "center", //split: true, items: [this.gridList_GDFYWH] }); this.panel_GDFYWUEdit = new Ext.Panel({ layout: "border", region: "center", split: true, items: [this.panelGDFYWH] }); //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [{ id: 'btnEPrev', text: Zi.LAN.btnEPrev, //"上一客户", // iconCls: "btnsave", handler: function (button, event) { this.PrevRecord(); }, scope: this }, { id: 'btnENext', text: Zi.LAN.btnENext, //"下一客户", // iconCls: "btnsave", handler: function (button, event) { this.NextRecord(); }, scope: this }, { id: 'btnESave', text: Zi.LAN.btnESave, //"保存", iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnESaveAndClose', text: Zi.LAN.btnESaveAndClose, //"保存并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, { id: 'btnESaveAndNew', text: Zi.LAN.btnESaveAndNew, //"保存并新建", handler: function (button, event) { this.Save('2'); }, scope: this }, '-', { text: Zi.LAN.btnClose, //"关闭", handler: function (button, event) { window.close(); }, scope: this }, { text: Zi.LAN.btnAdd, //"新建", handler: function (button, event) { this.LoadData('add', ''); var basicForm = this.formEdit.getForm(); basicForm.findField('GID').setDisabled(false); }, scope: this }, '-', { text: Zi.LAN.btnPrint, //"打印", iconCls: "btnprint", handler: function (button, event) { this.Print(); }, scope: this }] }); //end 按钮Toolbar //#endregion this.storeListPS = Ext.create('Ext.data.Store', { model: 'MsInfoClientPS', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsInfoClient/GetPSList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); this.storeDept = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.DeptModel', proxy: { url: '/CommMng/BasicDataRef/GetDeptList' } }); this.storeDept.load(); this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeDept, //flex: 0.5, //labelWidth: 55, forceSelection: true, name: 'SALEDEPT', valueField: 'DeptName', displayField: 'DeptName' //,hidden: true }); this.gridListPSCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); //定义Grid this.gridListPS = new Ext.grid.GridPanel({ store: this.storeListPS, enableHdMenu: false, region: 'center', tbar: [{ text: Zi.LAN.btnAddDetail, //'增加费用明细', tooltip: Zi.LAN.btnAddDetail, //'增加费用明细', iconCls: "btnadddetail", handler: function (button, event) { this.onAddPSClick(button, event, 1); }, scope: this }, '-', { text: Zi.LAN.btnDeleteDetail, //'删除费用明细', tooltip: Zi.LAN.btnDeleteDetail, //'删除费用明细', iconCls: "btndeletedetail", handler: function (button, event) { this.onDelPSClick(button, event, 1); }, scope: this }], loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, plugins: [this.gridListPSCellEditing], disableSelection: false, columns: [{ sortable: true, dataIndex: 'GID', header: 'GID', hidden: true, width: 120 }, { sortable: true, dataIndex: 'LINKGID', header: 'LINKGID', hidden: true, width: 120 }, { sortable: true, dataIndex: 'SALEDEPT', header: '部门', width: 160, editor: this.comboxDept }, { sortable: true, dataIndex: 'PS', header: Zi.LAN.PS, //'汇率', editor: { xtype: 'numberfield', keyNavEnabled: false, selectOnFocus: true, decimalPrecision: 6, hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true } } ] }); this.panel_PS = new Ext.Panel({ title: Zi.LAN.PS, //'客户基本信息', layout: "border", region: "center", split: true, items: [this.gridListPS] }); //#region 框架结构 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: Zi.LAN.CaiWuXinXi, //'财务信息', layout: "border", id:"panelAcc", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.formACC, this.panelBank] }); this.panelACCDATE = new Ext.Panel({ title: Zi.LAN.ZhangQiXinXi, //'账期信息', layout: "border", region: 'center', id: "panelACCDATE", animate: true, //autoScroll: true, // containerScroll: true, frame: false, items: [this.panel_ACCDATEEdit] }); this.panelGuDingFeeWeiHu = new Ext.Panel({ title: '固定费用维护', //'固定费用维护', layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.panel_GDFYWUEdit] }); this.tabSeaeWTpanel = new Ext.TabPanel({ activeTab: 0, autoWidth: true, border: true, frame: false, region: 'center', enableTabScroll: true, items: [ this.panelpage, this.panelAcc, this.panelACCDATE, this.panelGuDingFeeWeiHu, this.panel_PS ] }); this.panelSeae = new Ext.Panel({ title: Zi.LAN.KeHuXinXi, //'客户信息', id: 'pnlmodCUSTInfo', layout: "border", region: 'center', animate: true, autoScroll: true, frame: false, //closable:true, items: [this.panelBtn, this.tabSeaeWTpanel] }); this.treestore = new Ext.data.TreeStore({ model: 'DsShipping.ux.ModuleModel', nodeParam: 'PARENTID', proxy: { type: 'ajax', url: '/MvcShipping/MsBaseInfo/GetModuTreeRefList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } }, autoLoad: true, root: { name: '根节点', expanded: true, id: '5EA51E0B-BEC4-4F41-B384-54B51B70C81A' } }); this.tabtree = new Ext.tree.Panel({ region: 'west', title: Zi.LAN.WangLaiDanWei, //'往来单位', split: true, width: 180, collapsible: true, margins: '0 0 0 0', store: this.treestore, rootVisible: false, hideHeaders: true, animate: false, lines: false, columns: [{ xtype: 'treecolumn', text: Zi.LAN.MoKuaiMingCheng, //'模块名称', width: 178, dataIndex: 'DESCRIPTION' }], listeners: { scope: this, 'itemclick': function (_this, record, item, index, e, eOpts) { var finded = false; if (record.data.MODULEURL == '@') { this.tabSeaepanel.setActiveTab(0); } else if (record.data.MODULEURL != '#') { var children = this.tabSeaepanel.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { if (children.items[i].id) { if (children.items[i].id == 'pnl' + record.data.NAME) { this.tabSeaepanel.setActiveTab(i); finded = true; } } } } if (finded == false) { if (this.formEdit.getForm().findField('SHORTNAME').getValue() == "") { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunXinXi, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请先保存客户信息后再打开其他模块'! } else { var paneltabitems = new Ext.Panel({ id: 'pnl' + record.data.NAME, layout: "fit", region: "center", autoScroll: true, frame: false, closable: true, title: record.data.DESCRIPTION, html: ' ' }); this.tabSeaepanel.add(paneltabitems); this.tabSeaepanel.setActiveTab(paneltabitems); this.tabSeaepanel.doLayout(); } } } } } }); this.tabSeaepanel = new Ext.TabPanel({ activeTab: 0, autoWidth: true, border: true, frame: false, region: 'center', enableTabScroll: true, items: [ this.panelSeae ] }); Ext.apply(this, { items: [this.tabtree, this.tabSeaepanel] }); //#endregion this.LoadInitData(); //#region 其他 parentWin = window.parent.opener._this; this.InitData(); this.gridList.on('edit', function (editor, e, eOpts) { this.ACCAfterEdit(editor, e, eOpts); }, this); this.storeBodyList.on('beforeload', function (store) { var sql="GID='" + this.editRecord.get('GID') + "'"; Ext.apply(store.proxy.extraParams, { condition: sql,isedit: "1"}); }, this); this.storeListPS.on('beforeload', function (store) { var sql = "LINKGID='" + this.editRecord.get('GID') + "'"; Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); this.storeBodyList_GuDingFeeWeiHu.on('beforeload', function (store) { var sql = "CUSTOMERNAME='" + this.editRecord.get('SHORTNAME') + "'"; Ext.apply(store.proxy.extraParams, { condition: sql, isedit: "1" }); }, 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 == 'panelACCDATE' || children.items[i].id == 'panelAcc') { children.items[i].close(); } } } } this.tabSeaeWTpanel.doLayout(); } } else { } }, scope: this }); var btncustadd = Ext.getCmp('btnESaveAndNew'); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: 'modInfoClientCustNotAdd' }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { btncustadd.hide(); } else { btncustadd.show(); } } }, scope: this }); }, //end initUIComponents //#region 加载事件 InitData: function () { this.opStatus = 'add'; var condition = ''; _this = this; if (parentWin) { var ret = parentWin.OprationSwap(); this.opStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; } this.LoadData(this.opStatus, condition); this.LoadMustBe(); }, //end InitData LoadData: function (opstatus, condition) { this.serialNo = 0; //this.bodyDel = []; this.opStatus = opstatus; if (this.opStatus == 'edit') { condition = "GID='" + this.editRecord.get('GID') + "'"; this.storeBodyList.load({ params: { condition: "LINKID='" + this.editRecord.get('GID') + "'", isedit: "1" } }); this.storeBodyList_ACCDATE.load({ params: { condition: "LINKGID='" + this.editRecord.get('GID') + "'", isedit: "1" } }); this.storeBodyList_GuDingFeeWeiHu.load({ params: { condition: "CUSTOMERNAME='" + this.editRecord.get('SHORTNAME') + "'" } }); this.storeListPS.load({ params: { condition: "LINKGID='" + this.editRecord.get('GID') + "'" } }); } 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; this.GetEditStatus(); } else { Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText); } }, scope: this }); var billno = '*'; var gid = '*'; }, // end LoadDate //#endregion LoadInitData: function () { this.storeOpCode.load(); this.storeTCCode.load(); }, //#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); } // if ((this.opStatus=='add') && (j == 0)) { alert(Zi.LAN.WeiLuRuYinHangXinXi);//'请注意:未录入银行信息!' } 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 FARCODE = this.formACC.getForm().findField('FARCODE').getValue(); var FAPCODE = this.formACC.getForm().findField('FAPCODE').getValue(); _this = this; Ext.Ajax.request({ waitMsg: '正在锁定...', url: '/MvcShipping/MsInfoClient/ISREPEAT', params: { cust: cust, codename: CODENAME, draccid: FARCODE, craccid: FAPCODE }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.MessageBox.confirm(Zi.LAN.TiShi, result.Message+"确实要保存吗?", function (btn) { if (btn == 'yes') { _this.doSave(type); } }, this); } else { _this.doSave(type); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, //end save doSave: 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 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 = []; for (var i = 0; i < this.storeBodyList_GuDingFeeWeiHu.getCount(); i += 1) { var member = this.storeBodyList_GuDingFeeWeiHu.getAt(i); bodydatasGDFYWH.push(member); } var GDFYWHbody = ConvertRecordsToJsonAll(bodydatasGDFYWH); var bodydatasPS= []; for (var i = 0; i < this.storeListPS.getCount(); i += 1) { var member = this.storeListPS.getAt(i); bodydatasPS.push(member); } var PSbody = ConvertRecordsToJsonAll(bodydatasPS); 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, PSbody: PSbody }, 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; //this.onStartClick(_sd); // 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 == '1') { window.close(); } 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 == '1') { window.close(); } 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 == '1') { window.close(); } else if (type == '2') { this.LoadData('add', ''); } } this.SetShowACCEdit("隐藏"); this.storeBodyList_ACCDATE.load({ params: { condition: "LINKGID='" + returnData.GID + "'", isedit: "1" } }); this.storeBodyList_GuDingFeeWeiHu.load({ params: { condition: "CUSTOMERNAME='" + returnData.SHORTNAME + "'" } }); this.storeListPS.load({ params: { condition: "LINKGID='" + returnData.GID + "'"} }); } 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 //#endregion //#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.gridListCellEditing.startEditByPosition({ row: n - 1, column: 3 }); }, onDelDetailClick: function (button, event) { var selectedRecords = this.gridList.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', ''); } } }, //#region 编辑时按钮等的状态 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); } else { } } else { } }, scope: this }); } _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 btnESaveAndClose = Ext.getCmp('btnESaveAndClose'); var btnESaveAndNew = Ext.getCmp('btnESaveAndNew'); if (enable) { btnESave.enable(); btnESaveAndClose.enable(); btnESaveAndNew.enable(); } else { btnESave.disable(); btnESaveAndClose.disable(); btnESaveAndNew.disable(); } }, //#endregion LoadMustBe: function () { this.storeMustBe.load({ params: { condition: "BSTYPE='往来单位'" }, callback: function (r, options, success) { if (success) { if (this.storeMustBe.getCount() > 0) { for (var j = 0; j < this.storeMustBe.getCount(); j += 1) { var member = this.storeMustBe.getAt(j); var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME); if (headfield != NaN && headfield != null) { if (member.data.ISMUST == "1") headfield.allowBlank = false; if (member.data.ISCOLOR == "1") headfield.setFieldStyle({ background: '#ffc' }); } var headfield = this.formACC.getForm().findField(member.data.FIELDNAME); if (headfield != NaN && headfield != null) { if (member.data.ISMUST == "1") headfield.allowBlank = false; if (member.data.ISCOLOR == "1") headfield.setFieldStyle({ background: '#ffc' }); } }; } else { } } }, scope: this }); }, //#region 打印 Print: function () { var basicForm = this.formEdit.getForm(); var billNo = basicForm.findField('GID').value; if (billNo == '*' || billNo == '') { Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: Zi.LAN.QingXianBaoCunXinXi, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'单据还没有保存,请保存后再打印' return; } var printType = 'MSINFOCLIENT'; var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM info_client WHERE GID = '" + billNo + "'"; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); }, //#endregion PrevRecord: function () { var modifystr = ""; var drmodify = this.storeBodyList.getModifiedRecords(); if (drmodify.length != 0){ modifystr = Zi.LAN.YinHangXinXiWeiBaoCun;//'银行信息未保存,如果离开此页,将丢失未保存的更改 !!!'; } if (panelEdit.formEdit.getForm().isDirty() == true || panelEdit.formACC.getForm().isDirty() == true || drmodify.length != 0) { modifystr = Zi.LAN.JiBenXinXiWeiBaoCun;//'基本信息未保存,如果离开此页,将丢失未保存的更改 !!!'; } if (modifystr != "") { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: modifystr, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var j = this.StoreList.indexOf(this.editRecord); if (j == 0) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YiShiZuiQianYiPiao, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'已是最前一票' return; } if (j == this.StoreList.count) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YiShiZuiHouYiPiao, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'已是最后一票' return; } var children = this.tabSeaepanel.items; if (children) { for (var i = children.length - 1, len = 0; i >= len; i--) { if (children.items[i].id) { if (children.items[i].id == 'pnlmodCUSTInfo') { } else { children.items[i].close(); } } } } this.tabSeaepanel.doLayout(); j = j - 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { condition = "GID='" + this.editRecord.get('GID') + "'"; //this.storeBodyList.load({ params: { condition: condition} }); } this.LoadData(this.opStatus, condition); }, NextRecord: function () { var modifystr = ""; var drmodify = this.storeBodyList.getModifiedRecords(); if (drmodify.length != 0){ modifystr = Zi.LAN.YinHangXinXiWeiBaoCun;//'银行信息未保存,如果离开此页,将丢失未保存的更改 !!!'; } if (panelEdit.formEdit.getForm().isDirty() == true || panelEdit.formACC.getForm().isDirty() == true || drmodify.length != 0) { modifystr = Zi.LAN.JiBenXinXiWeiBaoCun;//'基本信息未保存,如果离开此页,将丢失未保存的更改 !!!'; } if (modifystr != "") { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: modifystr, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var j = this.StoreList.indexOf(this.editRecord); if (j == (this.StoreList.count - 1)) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YiShiZuiHouYiPiao, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'已是最后一票' return; } var children = this.tabSeaepanel.items; if (children) { for (var i = children.length - 1, len = 0; i >= len; i--) { if (children.items[i].id) { if (children.items[i].id == 'pnlmodCUSTInfo') { //this.tabSeaepanel.setActiveTab(i); } else { children.items[i].close(); } } } } this.tabSeaepanel.doLayout(); j = j + 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { condition = "GID='" + this.editRecord.get('GID') + "'"; //this.storeBodyList.load({ params: { condition: condition} }); } this.LoadData(this.opStatus, condition); }, onStartClick: function (returnData) { //this.onSaveClick(); //var selections = this.gridList.getSelectionModel().getSelection(); var bodyList = []; bodyList.push(returnData); 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.onRefreshClick(); } }, 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 }, 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 == "隐藏" || 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; }, onAddDGFYWHClick: function (button, event, type) { var newSerialno = 0; store = this.storeBodyList_GuDingFeeWeiHu; var newSerialno = this.GetHandleSerialNo(store); var record = Ext.create('MsInfoClientFeeDetailModel', { GID: NewGuid(), TEMPLATEID: '', FEENAME: "", CUSTOMERNAME: "", CLIENT: 5, CLIENTREF: "委托单位", UNIT: "单票", CURRENCY: "RMB", UNITPRICE: 0, SORT: newSerialno, EXCHANGERATE: 1, CREATEUSER: "", FEEFRT: "PP", REMARK: "", ISCTN: false, ISCTNREF: "否" }); store.add(record); var n = this.storeBodyList_GuDingFeeWeiHu.getCount(); this.gridListCellEditing_GDFYWH.startEditByPosition({ row: n - 1, column: 1 }); }, onDelGDFYWHClick: function (button, event, type) { var selectedRecords = this.gridList_GDFYWH.selModel.getSelection(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; this.storeBodyList_GuDingFeeWeiHu.remove(rec); } }, onAddPSClick: function (button, event, type) { var newSerialno = 0; store = this.storeListPS; var record = Ext.create('MsInfoClientPS', { GID: NewGuid(), LINKGID: '', CUSTNAME: "", SALEDEPT: "", PS: 0, REMARK: "" }); store.add(record); var n = this.storeListPS.getCount(); this.gridListPSCellEditing.startEditByPosition({ row: n - 1, column: 1 }); }, onDelPSClick: function (button, event, type) { var selectedRecords = this.gridListPS.selModel.getSelection(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; this.storeListPS.remove(rec); } } });