Ext.namespace('Shipping'); Shipping.OP_SERVICEBILLEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.OP_SERVICEBILLEdit.superclass.constructor.call(this); }; Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { parentWin: null, OpStatus: 'add', StoreList: null, editRecord: null, Editdata: null, MainEditRecord: null, stroplb: '服务订单管理',///与视图 V_op_bs 的OPLBNAME相同 依赖于枚举类型96005 isfen: false, panelFee_Name: 'modOP_SERVICEBILL_AllFee',//对应sys_module.name panelAmend_Name: 'modOP_SERVICEBILL_AmendFee', parentType:"SERVICEBILL", initUIComponents: function () { this.serialNo = 0; //this.bodyDel = []; this.itemindex = 1; this.initloaddata = 0; this.accdatesameetd = 0; this.MsPeriod = null; this.SALEORDERDEPTBYOP = 0; this.formname = "OP_SERVICEBILLEdit"; _this = this; this.parentType = getUrlParam('parentType'); if (this.parentType == "SERVICEBILL") { parentWin = window.parent.opener; mainWin = getMainForm(parentWin); } else { parentWin = window.parent.opener.opener; } opflex = 0.6;//上方几个用户下拉框 《操作》等的宽度 ViaWidth = 90;//中转港信息的的标签宽度 //#region 信息加载 this.storeDefValue = Ext.create('Ext.data.Store', { model: 'DsShipping.ux.OpDefValue', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsCodeOpDef/GetDataList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); 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.storecodeservice = Ext.create('DsExt.ux.RefTableStore', { model: 'MsCodeOpService', proxy: { url: '/MvcShipping/MsCodeOpService/GetDataList' } }); //权限范围 this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', { model: 'MsOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpIDRang' } }); //this.StoreOpRange.load({ params: { optype: "modOrderManagement" } }); //#region 客户 往来单位 相关【委托单位 收货人 船公司 车队 场站】 //委托单位 //this.storeCustCode = window.parent.GetPubStore("InfoClient_ISCONTROLLER"); this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); //this.storeCustCode.loadData(mainWin.GetPubStore("INFOCLIENT_ISCONTROLLER").data.items); this.storeCustCode.load(); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '委托单位', matchFieldWidth: false, store: this.storeCustCode, forceSelection: true, queryMode: 'local', flex: 1, //queryParam: 'CODENAME', name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', listeners: { scope: this, //blur: function (field, The, eOpts) { // if (isNullorEmpty(field.rawValue.toUpperCase().trim())) { // field.setRawValue(""); // field.value = ""; // } //}, //'beforequery': function (e) { // return FilterCombox(e);//在beforequery使用此方法 //}, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.storeInfoClientContact.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContact.getCount() > 0) { var member = this.storeInfoClientContact.getAt(0); this.comboxInfoClientContact.setValue(member.data.SHOWNAME); //this.formHead.getForm().findField('OPERATORTEL').setValue(member.data.TEL); } else { this.comboxInfoClientContact.setValue(''); //this.formHead.getForm().findField('OPERATORTEL').setValue(''); } } }, scope: this }); } } } }); //船公司 this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' } }); this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: "*" + '船公司', store: this.storeCARRIER, //queryMode: 'remote', //minChars: 1, //queryParam: 'CODENAME', allowBlank:false, name: 'CARRIER', valueField: 'CustName', displayField: 'CodeAndName', listeners: { scope: this, 'beforequery': function (e) { return FilterCombox(e);//在beforequery使用此方法 }, blur: function (field, The, eOpts) { if (isNullorEmpty(field.rawValue.toUpperCase().trim())) { field.setRawValue(""); field.value = ""; } } } }); //客户加载_船代 this.storeSHIPAGENCY = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListSHIPAGENCY' } }); //船代 this.comboxSHIPAGENCY = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SHIPAGENCY, //'船代', store: this.storeSHIPAGENCY, forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', name: 'SHIPAGENCY', valueField: 'CustName', displayField: 'CodeAndName' }); _this = this; this.storeFEEService = Ext.create('DsExt.ux.RefTableStore', { model: 'DsExtEnumModel', proxy: { url: '/CommMng/PubSys/GetEnumValueList' } }); //this.storeFEEService.load({ // params: { enumTypeId: 96302 }, // callback: function (options, success, response) { // if (success) { // groupform = Ext.getCmp('ServiceGroup'); // for (i = 0; i < _this.storeFEEService.getCount(); i += 1) { // var memberyf = _this.storeFEEService.getAt(i); // if (memberyf.data.EnumValueName != "") { // checked = false // //if (memberyf.data.EnumValueName_2 != "") { // // checked = true // //} // readonly=!( _this.opStatus == 'add'); // //readonly = true; // var checkboxSingleItem = new Ext.form.Checkbox({ // boxLabel: memberyf.data.EnumValueName, // inputValue: true, // checked: checked, // name: memberyf.data.EnumValueName, // id: memberyf.data.EnumValueId, // readOnly: readonly // }); // //var checkboxSingleItem = // //{ // // boxLabel: memberyf.data.EnumValueName , // // inputValue: true, // // checked: checked, // // name: memberyf.data.EnumValueName, // // id: memberyf.data.EnumValueId, // // getItemId: function () { // // return this.itemId || this.id; // // } // //}; // groupform.items.add(checkboxSingleItem); // } // }; // //groupform.doLayout(); // _this.formHead.doLayout(); // } // }, // scorp:this //}); //#endregion //#region 分公司 所属分部 this.storeCompany = Ext.create('DsExt.ux.RefTableStore', { model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' } }); this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: "*"+'所属分部', store: this.storeCompany, allowBlank:false, flex:1, name: 'CORPID', valueField: 'gid', displayField: 'name', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.storeUser.load({ params: { condition: "CORPID='" + combo.value + "'", dbname: records[0].data.DBNAME } , callback: function (options, success, response) { if (success) { //.... } } }); } } } }); //#endregion //#region 系统用户:操作 客服 销售 this.storeUser = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserLinkRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' } }); this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: "*" + '操作', //renderTo: 'basicBoxselect', //autoHeight:true, allowBlank: false, name: 'INPUTBY', autosize: true, bodyPadding: 1, flex: opflex, //labelWidth: 90, store: this.storeUser, queryMode: 'local', //stacked: true, //pinList: false, triggerOnClick: false, valueField: 'GID', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectedRecord = records[0].data; var tel = selectedRecord.Tel; if (tel) { this.formHead.getForm().findField('TEL').setValue(tel); } } } } }); //#endregion //#region 部门 //this.storeDept = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsShipping.ux.DeptModel', // proxy: { url: '/CommMng/BasicDataRef/GetDeptList' } //}); //this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '所属部门', // store: this.storeDept, // flex: 1, // //labelWidth: 55, // forceSelection: true, // name: 'SALEDEPT', // valueField: 'DeptName', // displayField: 'DeptName' // //,hidden: true //}); //#endregion //#region 船名 //this.storeVESSEL = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsShipping.ux.DICModel', // proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' } //}); //this.comboxVESSEL = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '船名', // store: this.storeVESSEL, // forceSelection: false, // name: 'VESSEL', // valueField: 'KEYFIELD', // displayField: 'KEYFIELD', // listeners: { // scope: this, // blur: function (field, The, eOpts) { // if (isNullorEmpty(field.rawValue.toUpperCase().trim())) { // field.setRawValue(""); // field.value = ""; // } // }, // 'beforequery': function (e) { // return FilterCombox(e);//在beforequery使用此方法 // } // } //}); //#endregion //#region 航次 //this.storeVOYNO = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsShipping.ux.DICModel', // proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' } //}); //this.comboxVOYNO = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '航次', // store: this.storeVOYNO, // forceSelection: false, // name: 'VOYNO', // valueField: 'KEYFIELD', // displayField: 'KEYFIELD', // listeners: { // scope: this, // blur: function (field, The, eOpts) { // if (isNullorEmpty(field.rawValue.toUpperCase().trim())) { // field.setRawValue(""); // field.value = ""; // } // }, // 'beforequery': function (e) { // return FilterCombox(e);//在beforequery使用此方法 // } // } //}); //#endregion //加载业务信息 //#endregion //#region 主表信息 this.formHead = Ext.widget('form', { //layout: "border", region: 'north', // title:'委托结算服务', height:420, //grow:true, frame: true, bodyPadding: 5, collapsed: false, collapsible: true, trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 0', labelAlign: 'right', flex: 1, labelWidth: 65, msgTarget: 'qtip' }, items: [ { xtype: 'container', layout: 'hbox', hidden: true, defaultType: 'textfield', items: [ { fieldLabel: 'BSNO', name: 'BSNO' }, { fieldLabel: 'PARENTID', name: 'PARENTID' }, { fieldLabel: 'SALECORPID', name: 'SALECORPID' }, { fieldLabel: 'DEPT', name: 'DEPT' }, { fieldLabel: 'SALEDEPT', name: 'SALEDEPT' }, { fieldLabel: 'SALE', name: 'SALE' }, { fieldLabel: 'BILLSTATUS', name: 'BILLSTATUS' }, { fieldLabel: 'BSSTATUS', name: 'BSSTATUS' }, { fieldLabel: 'FEESTATS', name: 'FEESTATS' }, { fieldLabel: 'CUSTNO', name: 'CUSTNO' }, { fieldLabel: 'CUSTOMNO', name: 'CUSTOMNO' }, { fieldLabel: 'CONTRACTNO', name: 'CONTRACTNO' }, { fieldLabel: 'SERVICETYPE', name: 'SERVICETYPE' }, { fieldLabel: 'ACCDATE', name: 'ACCDATE' }, { fieldLabel: 'BSDATE', name: 'BSDATE' }, { fieldLabel: 'MODIFIEDUSER', name: 'MODIFIEDUSER' }, { fieldLabel: 'MODIFIEDTIME', name: 'MODIFIEDTIME' }, { fieldLabel: 'ATA', name: 'ATA' }, { fieldLabel: 'FORWARDER', name: 'FORWARDER' }, { fieldLabel: 'CUSTOMERNAME', name: 'CUSTOMERNAME' }, { fieldLabel: 'FEE_1', name: 'FEE_1' }, { fieldLabel: 'FEE_2', name: 'FEE_2' }, { fieldLabel: 'DJYID', name: 'DJYID' }, { fieldLabel: 'CangDanShiJian', name: 'CangDanShiJian' }, { fieldLabel: 'HaiFangShiJian', name: 'HaiFangShiJian' }, { fieldLabel: 'TiHuo', name: 'TiHuo' }, { fieldLabel: 'TiHuoInfo', name: 'TiHuoInfo' }, { fieldLabel: 'FanKong', name: 'FanKong' }, { fieldLabel: 'FanKongInfo', name: 'FanKongInfo' } ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxCompany//所属公司 ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxOP//联系人 ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: "*" + Zi.LAN.TEL, allowBlank: false, name: 'TEL' } ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: "*" + Zi.LAN.MBLNO, allowBlank: false, name: 'MBLNO' } , this.comboxCARRIER ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: Zi.LAN.VESSEL, allowBlank: true, name: 'VESSEL' } , { fieldLabel: Zi.LAN.VOYNO, allowBlank: true, name: 'VOYNO' } ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: Zi.LAN.ETA, format: 'Y-m-d', xtype: 'datefield', allowBlank: true, name: 'ETA' } //, { // fieldLabel: Zi.LAN.SHIPAGENCY, // allowBlank: true, // name: 'SHIPAGENCY' //} , this.comboxSHIPAGENCY ] } , { id: 'ServiceGroup', xtype: 'checkboxgroup', fieldLabel: "*" + Zi.LAN.SERVICEBILLService, //'费用项目', allowBlank: false, columns: 4, name: 'SERVICE', items: [] } ,{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', flex: 1, //defaults: { // anchor: '100%' //}, items: [ { xtype: 'container', //title:'委托信息', defaultType: 'textfield', layout: 'anchor', flex: 1, defaults: { anchor: '100%' }, items: [ { xtype: 'textareafield', name: 'REMARK', id: "REMARK", height: 120, grow: false, fieldLabel: '下单备注' //'备注', } , { xtype: 'textareafield', name: 'REMARK2', id: "REMARK2", height: 60, hidden: true, grow: false, fieldLabel: '补充备注', },{ xtype: 'textareafield', name: 'TIPS', id: "TIPS", readOnly: true, height: 60, grow: false, fieldStyle: { color: 'red' }, fieldLabel: '反馈信息', } ] } //, { // xtype: 'container', // //title:'委托信息', // defaultType: 'textfield', // layout: 'anchor', // flex: 1, // defaults: { // anchor: '100%' // }, // items: [ // ] //} ] } ]//end items(fieldset 1) }); //end this.formHead //#endregion this.storeDocList = Ext.create('Ext.data.Store', { model: 'ReceiptDocmb', remoteSort: false, pageSize: this.PageSize, proxy: { type: 'ajax', url: '/Import/ReceiptDoc/GetDocList', reader: { idProperty: '', root: 'data', totalProperty: 'totalCount' } } }); this.DocListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.DocCM = Ext.create('Ext.selection.CheckboxModel'); this.gridDocList = new Ext.grid.GridPanel({ store: this.storeDocList, enableHdMenu: false, region: 'center', border: false, //width: 350, loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, plugins: [this.DocListCellEditing], selModel: this.DocCM, selType: 'cellmodel', tbar: [{ text: '删除', tooltip: '删除', iconCls: "btndeletedetail", handler: function (button, event) { this.onDelFileClick(button, event); }, scope: this }, '-', { text: '上传附件', tooltip: '上传附件', iconCls: "btnadddetail", handler: function (button, event) { this.onUpLoadFileClick(button, event); }, scope: this }, { text: '批量上传附件', tooltip: '批量上传附件', iconCls: "btnadddetail", handler: function (button, event) { this.UploadFile("", ""); }, scope: this } //, '-', { // text: '保存', // tooltip: '保存', // // iconCls: "btnadddetail", // handler: function (button, event) { // this.onPostFileClick(button, event); // }, // scope: this //} ], columns: [{ sortable: true, hidden: true, dataIndex: 'GID', header: 'GID', width: 80 }, { sortable: true, dataIndex: 'RECEIPTTYPE', header: '单据类型', editor: this.comboxReceiptid_DOC, width: 80, renderer: function (value, p, record) { if (value != "发票" && value != "账单" && value != "回馈单据") { return "原始单据" } else { return value; } } }, { sortable: true, hidden: true, dataIndex: 'R_GID', header: 'R_GID', width: 80 }, { sortable: true, hidden: true, dataIndex: 'BSNO', header: 'BSNO', width: 80 }, { sortable: true, dataIndex: 'URL', header: '文件名', width: 340, renderer: function (value, p, record) { return '' + value + ''; } }, { sortable: true, hidden: true, dataIndex: 'Driect_URL', header: 'Driect_URL', width: 80 }, { sortable: true, hidden: true, dataIndex: 'MODIFIEDUSER', header: 'MODIFIEDUSER', width: 80 }, { sortable: true, hidden: true, dataIndex: 'MODIFIEDUSERRef', header: '修改人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'MODIFIEDTIME', header: '修改时间', width: 85 } ] }); //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { id: 'btnEPrev', text: "上一票", hidden:true, // iconCls: "btnsave", handler: function (button, event) { this.PrevRecord(); }, scope: this }, { id: 'btnENext', text: "下一票", hidden: true, // iconCls: "btnsave", handler: function (button, event) { this.NextRecord(); }, scope: this }, { id: 'btnESave', text: "下单",//保存 iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnESaveAndClose',hidden:true, text: "下单并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, { id: 'btnESave2', text: "反馈",//保存 iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnESaveAndClose2', text: "反馈并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, { text: "关闭", handler: function (button, event) { window.close(); }, scope: this } , '-' //, //{ // text: "打印", // iconCls: "btnprint", // handler: function (button, event) { // this.Print(); // }, // scope: this //} //, //{ // text: "test", // handler: function (button, event) { // this.Test(); // }, // scope: this //} ] }); //end 按钮Toolbar //#endregion //#region 框架结构 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: 'A9837D95-10FB-4BB7-A7E8-53FE8C83F3B5' } }); this.tabtree = new Ext.tree.Panel({ region: 'west', hidden: true, title: '业务信息', 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.DESCRIPTION2, //'模块名称', width: 178, dataIndex: 'DESCRIPTION' }], listeners: { scope: this, 'itemclick': function (_this, record, item, index, e, eOpts) { var finded = false; if (record.data.MODULEURL == '@') { this.tabOpPanel.setActiveTab(0); } else if (record.data.MODULEURL != '#') { var children = this.tabOpPanel.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.tabOpPanel.setActiveTab(i); finded = true; } } } } if (finded == false) { if (this.formHead.getForm().findField('BSNO').getValue() == "") { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunYeWu, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请先保存业务信息后再打开其他模块!' } else { //if (record.data.NAME == _this.panelFee_Name) { // var paneltabitems = new Shipping.SeaeFee({ // id: 'pnl' + record.data.NAME, // layout: "border", // region: "center", // autoScroll: true, // frame: false, // closable: true, // title: record.data.DESCRIPTION // }); //} else if (record.data.NAME == _this.panelAmend_Name) { // var paneltabitems = new Shipping.SeaeAmendFee({ // id: 'pnl' + record.data.NAME, // layout: "border", // region: "center", // autoScroll: true, // frame: false, // closable: true, // title: record.data.DESCRIPTION // }); //} //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.tabOpPanel.add(paneltabitems); this.tabOpPanel.setActiveTab(paneltabitems); this.tabOpPanel.doLayout(); } } } } } }); this.panelEdit = new Ext.Panel({ title: '委托信息', id: 'pnlmodNewOpInternalTradeInfo', layout: "border", region: 'center', animate: true, autoScroll: true, frame: false, //closable:true, items: [ this.panelBtn, this.formHead , this.gridDocList ] }); this.tabOpPanel = new Ext.TabPanel({ activeTab: 0, width: 100, layout: 'border', border: true, frame: false, region: 'center', id: "TabOpPanel", enableTabScroll: true, items: [ this.panelEdit ], listeners: { scope: this, 'beforetabchange': function (tabPanel, newCard, oldCard, eOpts) { if (oldCard.id == _this.panelFee_Name) { var feemodify = oldCard.panelFee.getModifyStatus(); if (feemodify) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunFeiYong, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'费用未保存,请先保存费用!' return false; } } if (newCard.id == _this.panelFee_Name) { newCard.panelFee.loadUnit(); } if (oldCard.id == _this.panelAmend_Name) { var feemodify = oldCard.panelAmendFee.getModifyStatus(); if (feemodify) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunFeiYong, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });//'费用未保存,请先保存费用!' return false; } } if (newCard.id == _this.panelAmend_Name) { newCard.panelAmendFee.loadUnit(); } } } }); Ext.apply(this, { items: [ this.tabtree, this.tabOpPanel ] }); //#endregion this.LoadInitData(); this.LoadMustBe(); this.InitData(); this.setformStatus(); //#region 其他 //this.formDetail.on('edit', function (editor, e, eOpts) { // this.AfterEdit(editor, e, eOpts); //}, this); //#endregion }, //end initUIComponents //#region 加载事件 InitData: function () { this.opStatus = 'add'; var condition = ''; _this = this; if (parentWin) { if (this.parentType == "SERVICEBILL") { var ret = parentWin.OprationSwap(); this.opStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; //ret[3] = this.storeCustCode; //ret[4] = this.storeCompany; //ret[5] = this.storeUser; //ret[6] = this.storeDept; //ret[7] = this.storeCARRIER; //ret[8] = this.storeCodeLoadport; //ret[9] = this.storeVESSEL; //ret[10] = this.storeVOYNO; //ret[11] = this.storeTRUCK; //ret[12] = this.storeYARD; //_storeCustCode = ret[3]; //this.storeCustCode.loadData(_storeCustCode.data.items); _storeCompany = ret[3]; this.storeCompany.loadData(_storeCompany.data.items); _storeUser = ret[4]; this.storeUser.loadData(_storeUser.data.items); _storeCARRIER = ret[5]; this.storeCARRIER.loadData(_storeCARRIER.data.items); _storeSHIPAGENCY = ret[6]; this.storeSHIPAGENCY.loadData(_storeSHIPAGENCY.data.items); _storeFEEService = ret[7]; this.storeFEEService.loadData(_storeFEEService.data.items); groupform = Ext.getCmp('ServiceGroup'); for (i = 0; i < _this.storeFEEService.getCount(); i += 1) { var memberyf = _this.storeFEEService.getAt(i); if (memberyf.data.EnumValueName != "") { checked = false //if (memberyf.data.EnumValueName_2 != "") { // checked = true //} readonly = !(_this.opStatus == 'add'); //readonly = true; var checkboxSingleItem = new Ext.form.Checkbox({ boxLabel: memberyf.data.EnumValueName, inputValue: true, checked: checked, name: memberyf.data.EnumValueName, id: memberyf.data.EnumValueId, readOnly: readonly }); groupform.items.add(checkboxSingleItem); } }; //groupform.doLayout(); _this.formHead.doLayout(); if (this.opStatus == 'edit' || this.opStatus == 'copyadd') { Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'"; Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'"; //给复选框加载内容和选中项目 servicegroup = Ext.getCmp('ServiceGroup'); SetCheckGroupReadonly(servicegroup, true); } else { Headcondition = ""; Bodycondition = "1=2"; servicegroup = Ext.getCmp('ServiceGroup'); SetCheckGroupReadonly(servicegroup, false); } this.LoadData(this.opStatus, Headcondition, Bodycondition); } if (this.parentType == "OPSEAE") { Ext.getCmp("btnEPrev").hide(); Ext.getCmp("btnENext").hide(); //this.storeCompany.load(); this.storeCompany.load({ params: { condition: " ISDISABLE=0 " } }); this.storeUser.load(); this.storeCARRIER.load(); this.storeSHIPAGENCY.load(); this.storeFEEService.load({ params: { enumTypeId: 96302 }, callback: function (options, success, response) { if (success) { groupform = Ext.getCmp('ServiceGroup'); for (i = 0; i < _this.storeFEEService.getCount(); i += 1) { var memberyf = _this.storeFEEService.getAt(i); if (memberyf.data.EnumValueName != "") { checked = false //if (memberyf.data.EnumValueName_2 != "") { // checked = true //} readonly=!( _this.opStatus == 'add'); //readonly = true; var checkboxSingleItem = new Ext.form.Checkbox({ boxLabel: memberyf.data.EnumValueName, inputValue: true, checked: checked, name: memberyf.data.EnumValueName, id: memberyf.data.EnumValueId, readOnly: readonly }); //var checkboxSingleItem = //{ // boxLabel: memberyf.data.EnumValueName , // inputValue: true, // checked: checked, // name: memberyf.data.EnumValueName, // id: memberyf.data.EnumValueId, // getItemId: function () { // return this.itemId || this.id; // } //}; groupform.items.add(checkboxSingleItem); } }; //groupform.doLayout(); _this.formHead.doLayout(); } }, scorp:this }); //看此业务有没有相同提单号的委托结算业务 如果有 显示之 如果没有 显示新增页面 var ret = parentWin.OprationSwap(); //this.opStatus = ret[0]; //this.StoreList = ret[1]; var OpSeaeRecord = ret[2]; var _opseaebsno = OpSeaeRecord.get('BSNO'); //var getOpSeaeCondition = " MBLNO =(select MBLNO from op_seae where BSNO='" + _opseaebsno + "')"; opstatus = ""; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/OP_SERVICEBILL/GetEditData', params: { handle: _opseaebsno, condition: "" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } this.Editdata = result.data; if (!result.data.BSNO) { this.opStatus = 'add'; } else { this.opStatus = 'edit'; } //this.LoadInit(data); //去除eta字段中的时分秒 if (this.Editdata.ETA) { this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", ""); } if (opstatus == 'add') { this.Editdata.SERVICETYPE = "码头堆存缴费"; } this.formHead.getForm().reset(); this.formHead.getForm().setValues(this.Editdata); BSNO = this.Editdata.BSNO; if (opstatus == 'add') { this.LoadDefValue(); } if (opstatus == 'copyadd') { this.CopyNew(); } //this.SetLockStatus(this.Editdata); this.GetEditStatus(); var _this = this; this.LoadUploadFile(BSNO); checkboxgroup = Ext.getCmp("ServiceGroup"); SetCheckGroupValue(checkboxgroup, this.Editdata.SERVICE); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } } //groupform = Ext.getCmp('ServiceGroup'); //for (i = 0; i < _this.storeFEEService.getCount(); i += 1) { // var memberyf = _this.storeFEEService.getAt(i); // if (memberyf.data.EnumValueName != "") { // checked = false // //if (memberyf.data.EnumValueName_2 != "") { // // checked = true // //} // readonly=!( _this.opStatus == 'add'); // //readonly = true; // var checkboxSingleItem = new Ext.form.Checkbox({ // boxLabel: memberyf.data.EnumValueName, // inputValue: true, // checked: checked, // name: memberyf.data.EnumValueName, // id: memberyf.data.EnumValueId, // readOnly: readonly // }); // groupform.items.add(checkboxSingleItem); // } //}; ////groupform.doLayout(); //_this.formHead.doLayout(); if (this.opStatus == 'edit' || this.opStatus == 'copyadd') { Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'"; Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'"; //给复选框加载内容和选中项目 servicegroup = Ext.getCmp('ServiceGroup'); SetCheckGroupReadonly(servicegroup, true); } else { Headcondition = ""; Bodycondition = "1=2"; servicegroup = Ext.getCmp('ServiceGroup'); SetCheckGroupReadonly(servicegroup, false); } //if (this.parentType == "SERVICEBILL") { // this.LoadData(this.opStatus, Headcondition, Bodycondition); //} }, //end InitData LoadData: function (opstatus, condition, Bodycondition) { this.serialNo = 0; //this.bodyDel = []; this.opStatus = opstatus; //if (this.opStatus == 'edit') { // var CUSTNO = this.editRecord.get('CUSTNO').toString().trim(); // if (CUSTNO != "") { // document.title = "委托编号:" + this.editRecord.get('CUSTNO').toString().trim(); // } //} Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/OP_SERVICEBILL/GetEditData', 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: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } this.Editdata = result.data; //this.LoadInit(data); //去除eta字段中的时分秒 if (this.Editdata.ETA) { this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", ""); } if (opstatus == 'add') { this.Editdata.SERVICETYPE = "码头堆存缴费"; } this.formHead.getForm().reset(); this.formHead.getForm().setValues(this.Editdata); BSNO = this.Editdata.BSNO; if (opstatus == 'add') { this.LoadDefValue(); } if (opstatus == 'copyadd') { this.CopyNew(); } //this.SetLockStatus(this.Editdata); this.GetEditStatus(); var _this = this; this.LoadUploadFile(BSNO); checkboxgroup = Ext.getCmp("ServiceGroup"); SetCheckGroupValue(checkboxgroup, this.Editdata.SERVICE); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); var billno = '*'; var gid = '*'; }, //SetLockStatus: function (data) { // if (isTrue(data.FEESTATUS)) // this.formHead.getForm().findField('FEESTATUSREF').setValue("是"); // else // this.formHead.getForm().findField('FEESTATUSREF').setValue("否"); // if (isTrue(data.BSSTATUS)) // this.formHead.getForm().findField('BSSTATUSREF').setValue("是"); // else // this.formHead.getForm().findField('BSSTATUSREF').setValue("否"); //}, //loadBody: function (condition) { // this.storeBody.load({ params: { condition: condition } }); //}, // end LoadDate //#endregion LoadInitData: function () { //this.storeCustCode.load({ params: { condition: "" } }); }, //#region 保存/添加/删除 Save: function (type) { var ServiceGroup = Ext.getCmp("ServiceGroup"); //var _s = ServiceGroup.items; //var service = ""; //for (var i = 0; i < ServiceGroup.items.getCount(); i += 1) { // var list = ServiceGroup.items.items; // var rec = ServiceGroup.items.items[i]; // if (rec.checked == true) { // //alert(ServiceGroup.items[i]); // if (service != "") service += ","; // service += rec.id; //} var Form = this.formHead.getForm(); if (!Form.isValid() ) { return; } var data = Form.getValues(); data.SERVICE = GetCheckGroupIDList(ServiceGroup); //var Bodydatas = []; //for (var i = 0; i < this.storeBody.getCount(); i += 1) { // var member = this.storeBody.getAt(i); // Bodydatas.push(member); //} //var jsonBody = ConvertRecordsToJsonAll(Bodydatas); Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/OP_SERVICEBILL/Save', scope: this, params: { opstatus: this.opStatus, 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) { Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); var returnData = jsonresult.Data; this.Editdata = returnData; if (this.Editdata.ETA) this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", ""); this.formHead.getForm().reset(); this.formHead.getForm().setValues(this.Editdata); checkboxgroup = Ext.getCmp("ServiceGroup"); SetCheckGroupValue(checkboxgroup, this.Editdata.SERVICE); if (this.opStatus == 'add') { var arrNewRecords = this.StoreList.add(returnData); this.editRecord = arrNewRecords[0]; this.opStatus = 'edit'; } else if (this.opStatus == 'edit') { var editp = Ext.create('OP_SERVICEBILLmb', returnData); this.editRecord.fields.each(function (field) { if (field.persist) { name = field.name; if (name != 'BSNO') this.editRecord.set(name, editp.get(name)); } }, this); this.editRecord.commit(); //this.Editdata = result.data; } //this.LoadInit(data); this.GetEditStatus(); if (type == '0') { this.opStatus = 'edit'; this.setformStatus(); } else if (type == '1') { window.close(); } //else if (type == '2') { // var Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'"; // var Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'"; // this.LoadData('copyadd', Headcondition, Bodycondition); //} } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, //end save //#endregion //#region 载入初始信息 LoadInit: function (data) { }, //#endregion //#region 编辑时按钮等的状态 GetEditStatus: function () { var canedit = false; _this = this; var op = USERID; this.StoreOpRange.load({ params: { optype: "modOp_InternalTrade" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op); if (records.getCount() > 0) { canedit = true; } } else { canedit = false; } _this.setSaveBtnStatus(canedit); } } }); }, GetStringNum: function (str) { var num = 0; if (str == null || str == '') return num; if (str.length == 0) return num; var if_find = false; var str_num = ''; for (var i = 0; i < str.length; i += 1) { var member = str.substr(i, 1); if ((member == '0') || (member == '1') || (member == '2') || (member == '3') || (member == '4') || (member == '5') || (member == '6') || (member == '7') || (member == '8') || (member == '9') || (member == '.') || (member == '-')) { if (!if_find) { str_num = str_num + member; } } else { if_find = true; } } return str_num; }, LoadDefValue: function () { this.storeDefValue.load({ params: { condition: "BSTYPE='委托结算管理'" }, callback: function (r, options, success) { if (success) { if (this.storeDefValue.getCount() > 0) { for (var j = 0; j < this.storeDefValue.getCount(); j += 1) { var member = this.storeDefValue.getAt(j); var headfield = this.formHead.getForm().findField(member.data.FIELDNAME); if (headfield != NaN && headfield != null) headfield.setValue(member.data.DEFVALUE); }; } else { } } }, scope: this }); }, 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.formHead.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' }); if (member.data.ISREADONLY == "1") headfield.setReadOnly(true); } }; } else { } } }, scope: this }); }, setSaveBtnStatus: function (enable) { var btnESave = Ext.getCmp('btnESave'); var btnESaveAndClose = Ext.getCmp('btnESaveAndClose'); //var btndeletedetail = Ext.getCmp('btndeletedetail'); if (enable) { btnESave.enable(); //btnESaveAndClose.enable(); //btndeletedetail.enable(); } else { btnESave.disable(); btnESaveAndClose.disable(); //btndeletedetail.disable(); } }, setformStatus: function () { if (this.opStatus == 'add') { var basicForm = this.formHead.getForm(); basicForm.findField('CORPID').readOnly = false; basicForm.findField('INPUTBY').readOnly = false; basicForm.findField('TEL').readOnly = false; basicForm.findField('MBLNO').readOnly = false; basicForm.findField('CARRIER').readOnly = false; basicForm.findField('VOYNO').readOnly = false; basicForm.findField('VESSEL').readOnly = false; basicForm.findField('ETA').readOnly = false; basicForm.findField('SHIPAGENCY').readOnly = false; basicForm.findField('REMARK').readOnly = false; Ext.getCmp('REMARK').height = 120; Ext.getCmp('REMARK2').hide(); Ext.getCmp('btnESave').show(); //Ext.getCmp('btnESaveAndClose').show(); Ext.getCmp('btnESave2').hide(); Ext.getCmp('btnESaveAndClose2').hide(); servicegroup = Ext.getCmp('ServiceGroup'); SetCheckGroupReadonly(servicegroup, false); } else { var basicForm = this.formHead.getForm(); basicForm.findField('CORPID').readOnly = true; basicForm.findField('INPUTBY').readOnly = true; basicForm.findField('TEL').readOnly = true; basicForm.findField('MBLNO').readOnly = true; basicForm.findField('CARRIER').readOnly = true; basicForm.findField('VOYNO').readOnly = true; basicForm.findField('VESSEL').readOnly = true; basicForm.findField('ETA').readOnly = true; basicForm.findField('SHIPAGENCY').readOnly = true; basicForm.findField('REMARK').readOnly = true; Ext.getCmp('REMARK').height = 60; Ext.getCmp('REMARK2').show(); Ext.getCmp('btnESave').hide(); //Ext.getCmp('btnESaveAndClose').hide(); Ext.getCmp('btnESave2').show(); Ext.getCmp('btnESaveAndClose2').show(); } }, //#endregion //#region 上一票下一票 PrevRecord: function () { if (this.opStatus == 'add') { Ext.Msg.show({ title: '警告', msg: '请先保存当前业务', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var j = this.StoreList.indexOf(this.editRecord); if (j == 0) { Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j - 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'"; Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'"; this.LoadData(this.opStatus, Headcondition, Bodycondition); //this.LoadData(this.opStatus, condition); } }, NextRecord: function () { if (this.opStatus == 'add') { Ext.Msg.show({ title: '警告', msg: '请先保存当前业务', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var j = this.StoreList.indexOf(this.editRecord); if (j == (this.StoreList.data.length - 1)) { Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j + 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'"; Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'"; this.LoadData(this.opStatus, Headcondition, Bodycondition); //this.LoadData(this.opStatus, condition); } }, //#endregion //#region 打印 Print: function () { var basicForm = this.formHead.getForm(); var BSNO = basicForm.findField('BSNO').value; if (BSNO == '*' || BSNO == '') { Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var printType = 'OP_SERVICEBILLEDIT'; var sql1 = ""; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/MsOp_InternalTrade/GetPrintSql', params: { printname: "Print1", BSNOList: "'" + BSNO+"'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } //this.Editdata = result.data; //this.LoadInit(data); sql1 = result.Data.sql1; sql2 = result.Data.sql2; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, //#endregion AfterEdit: function (editor, e, eOpts) { //if (e.value==e.originalValue){return;} function decimal(str, length) { var _r = round2(str, length); return (_r); } } , onUpLoadFileClick: function (button, event) { var billno = this.Editdata.CUSTNO; var BSNO = this.Editdata.BSNO; if (this.opStatus == 'add') { BSNO = USERID; } //var FILETYPE = "订舱附件"; //枚举维护表tSysEnumValue_附件类型97048 //需求编号:SR2017081100003 //this.storeFileType = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsShipping.ux.TSysEnumValueDataModel', // proxy: { url: '/CommMng/BasicDataRef/GetTSysEnumValueList' } //}); //this.storeFileType.load({ params: { condition: " and EnumTypeID=97048" } }); //var comboxFileType = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '附件类型', // hidden:true, // store: this.storeFileType, // forceSelection: true, // id: 'FILETYPE', // name: 'FILETYPE', // valueField: 'EnumValueName', // displayField: 'EnumValueName' //}); _this = this; var imgform = new Ext.FormPanel({ region: 'center', labelWidth: 40, frame: true, //bodyStyle: 'padding:5px 5px 0', //autoScroll: true, border: false, fileUpload: true, items: [{ xtype: 'fileuploadfield', id: 'LoadFile', name: 'LoadFile', emptyText: '请选择文件', fieldLabel: '文件', buttonText: '选择文件', allowBlank: false, buttonCfg: { iconCls: 'uploaddialog' }, anchor: '98%' }, { xtype: 'textfield', hidden:true, id: 'FILETYPEField', name: 'FILETYPE', fieldLabel: '文件类型', values:'' } , { xtype: 'textfield', hidden: true, id: 'DOCUMENTATTACHEDCODE', name: 'DOCUMENTATTACHEDCODE', fieldLabel: '随附单证代码'//需求编号:SR2017081100003 }, { xtype: 'textfield', hidden: true, id: 'DOCUMENTATTACHEDNO', name: 'DOCUMENTATTACHEDNO', fieldLabel: '随附单证编号'//需求编号:SR2017081100003 } ], buttons: [{ text: '上传', type: 'submit', handler: function () { var UserFilePath = Ext.getCmp('LoadFile').getValue(); // if (!CheckFileExt(UserFilePath, /.jpg|.gif|.png|.bmp|.pdf/i)) { // Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为图片文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // return; // } if (!imgform.form.isValid()) { return; } imgform.form.submit({ url: '/MvcShipping/MsOpReceipt/UploadFile', waitMsg: '正在上传', method: 'POST', submitEmptyText: false, async: false, params: { CUSTNO: billno, BSNO: BSNO, TYPE: "",//Ext.getCmp('FILETYPEField').getValue(), DOCUMENTATTACHEDCODE: Ext.getCmp('DOCUMENTATTACHEDCODE').getValue(), //需求编号:SR2017081100003 DOCUMENTATTACHEDNO: Ext.getCmp('DOCUMENTATTACHEDNO').getValue() //需求编号:SR2017081100003 }, success: function (form, action) { win.close(this); Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //var condition = _this.strBSNO; _this.Loading = true; _this.LoadUploadFile(BSNO); }, failure: function (form, action) { form.reset(); // if (action.failureType == Ext.form.Action.SERVER_INVALID) { // Ext.MessageBox.alert('警告', action.result.errors.msg); // } } }); } }, { text: '关闭', type: 'submit', handler: function () { win.close(this); } }] }); var win = new Ext.Window({ title: "上传文件", width: 360, height: 200, modal: true, resizable: false, border: false, items: imgform }); win.show(); } , UploadFile: function (uploadFileType, title) { var billno = this.Editdata.CUSTNO; var BSNO = this.Editdata.BSNO; if (this.opStatus == 'add') { BSNO = USERID ; } //if (this.storeList.getCount() == 0) { // return; //} //selectedRecords = this.GridCheckBoxModel.selected.items; //if (selectedRecords.length == 0) { // Ext.Msg.show({ title: '提示', msg: '请先选择要上传文件的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // return; //} //var sortstr = 'CTNNO'; //if (this.sortfield != '' && this.sortdire != '') { // sortstr = this.sortfield + ' ' + this.sortdire; //} //var record = selectedRecords[0]; //var feeGId = record.get('GID'); //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; // } //}; //if (feeGidSql == '') { // Ext.Msg.show({ title: '提示', msg: '没有选择要上传文件的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); // return; //} var winUpload = Ext.create('Ext.window.Window', { layout: 'fit', title: '上传' + title, width: 600, height: 500, modal: true, plain: true, autoScroll: true, bodyStyle: "padding:5px 0 0 5px", items: { xtype: "panel", layout: 'fit', border: false, frame: false, autoScroll: true, html: "" }, buttonAlign: "center", buttons: [{ text: "关 闭", handler: function () { winUpload.close(); } }] }); _UploadFileStore = this.storeDocList; _condition = " BSNO='" + BSNO + "' "; _BSNO = BSNO; _CUSTNO = billno; winFXTZModifyShow = _this.winFXTZModifyShow; extParentWinFrame = winUpload; winUpload.show(); } , LoadUploadFile: function (BSNO) { var condition2 = " BSNO='" + BSNO + "' "; if (this.opStatus == 'add') { condition2 = " BSNO='" + USERID + "'"; } this.storeDocList.load({ params: { condition: condition2 }, waitMsg: "正在查询数据...", scope: this, callback: function () { _this.Loading = false; } }); } , onDelFileClick: function (button, event) { var feeGidSql = ''; var selectedRecords = []; selectedRecords = this.DocCM.selected.items; if (selectedRecords.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择要删除的附件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } Ext.MessageBox.confirm('提示', '确定要删除选中的附件吗?', function (btn) { if (btn == 'yes') { if (selectedRecords.length > 0) { for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.GID == "*") //如果是新增但没有保存的数据,没有必要提交到后台 { this.storeDocList.remove(selectedRecords[i]); } else { var feeGId = "'" + rec.data.GID + "'"; if (feeGidSql == '') { feeGidSql = feeGId; } else { feeGidSql = feeGidSql + "," + feeGId; } } } } _this = this; Ext.Msg.wait('正在删除数据...'); if (feeGidSql != '') { Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOpReceipt/DeleteUploadFile', params: { data: feeGidSql }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { for (var i = 0; i < selectedRecords.length; i++) { this.storeDocList.remove(selectedRecords[i]); } Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, success: function (response, options) { }, scope: this }); //end Ext.Ajax.request } else { Ext.Msg.show({ title: '提示', msg: "删除成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } }, this); } , Test() { Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/OP_SERVICEBILL/Test', params: { }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } //this.Editdata = result.data; //this.LoadInit(data); sql1 = result.Data.sql1; sql2 = result.Data.sql2; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } });