//集运管理-路单查询 Ext.namespace('Shipping'); Shipping.MsOp_BLISSUESPIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsOp_BLISSUESPIndex.superclass.constructor.call(this); }; Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, //month "d+": this.getDate(), //day "h+": this.getHours(), //hour "m+": this.getMinutes(), //minute "s+": this.getSeconds(), //second "q+": Math.floor((this.getMonth() + 3) / 3), //quarter "S": this.getMilliseconds() //millisecond } if (/(y+)/.test(format)) format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)); return format; } var xhr = new XMLHttpRequest(); var currdate = new Date(); if (!xhr) { //...其他生成xmlhttprequest方法 } xhr.open("HEAD", location.href, true); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { var datestr = xhr.getResponseHeader("Date"); currdate = new Date(datestr); // alert(currdate.format('yyyy-MM-dd')); } } xhr.send(null); Ext.extend(Shipping.MsOp_BLISSUESPIndex, Ext.Panel, { PageSize: 50, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, sqlcontext: '1=2', initUIComponents: function () { this.formname = "MsOp_BLISSUESPIndex"; this.sqlcontext = '1=2'; parentWin = window.parent; mainWin = getMainForm(parentWin); _this = this; Ext.define('Tradermb', { extend: 'Ext.data.Model', idProperty: 'gid', fields: [ { name: 'gid', type: 'string' }, { name: 'name', type: 'string' }, { name: 'codename', type: 'string' } ] }); //#region 定义数据集 //客户加载_委托单位 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } }); // this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); //委托单位 this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '委托单位', store: this.storeCustCode, queryMode: 'remote', minChars: 1, queryParam: 'CODENAME', name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName' //,allowBlank: false }); this.storeAuditCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/WorkFlow/GetWorkFlowStepAuditor_All' } }); this.storeAuditCode.load({ params: { TYPENO: '406' }, callback: function (options, success, response) { if (success) { this.storeAuditCode.add({ UserName: '', CodeAndName: '' }); } }, scope: this }); this.comboxAUDITOPERATOR = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '审核人', store: this.storeAuditCode, forceSelection: true, matchFieldWidth: false, name: 'AUDITOR', valueField: 'UserName', displayField: 'CodeAndName' }); this.storeReplacePaymentCORPID = Ext.create('DsExt.ux.RefTableStore', { model: 'MsCompanysEntity', proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' } }); //this.storeReplacePaymentCORPID.load({ params: { condition: "" } }); this.storeReplacePaymentCORPID.loadData(mainWin.GetPubStore("Company").data.items); this.storeReplacePaymentCORPID.add({ GID: '', NAME: '' }); //this.comboxReplacePaymentCORPID = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '所属公司', //'委托分公司', // //labelWidth: 70, // flex: 1, // store: this.storeReplacePaymentCORPID, // forceSelection: true, // readOnly: false, // name: 'ReplacePaymentCORPID', // valueField: 'GID', // displayField: 'NAME' //}); //#endregion ///////////////////////////////////////// //#region 主列表 this.storeList_SP = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'MsOp_BLISSUEListmb', remoteSort: true, //groupField: 'GroupDate', proxy: { type: 'ajax', //url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL', url: '/MvcShipping/MsOp_BLISSUE/GetSPList', //this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL'; reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.column_SP = [ { sortable: true, //hidden:true, dataIndex: 'GID', header: '特殊放单申请编号', width: 130 }, { sortable: true, hidden: true, dataIndex: 'BSNO', header: 'BSNO', width: 80 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '委托单位', width: 110 }, { sortable: true, //hidden: true, dataIndex: 'BLSTATUS', header: '特殊放单审核状态', width: 110, renderer: function (value, meta) { if (value== '提交审核') { meta.tdCls = 'feestatus_refer'; return value; } else if (value == '审核通过') { meta.tdCls = 'feestatus_pass'; return value; } else if (value == '驳回提交') { meta.tdCls = 'feestatus_nopass'; return value; } else { return value; } } }, { sortable: true, //hidden: true, dataIndex: 'MNGBLSTATUS', header: '总经理复核状态', width: 110 }, { sortable: true, hidden: true, dataIndex: 'BL_BLSTATUS', header: '提单状态', width: 80 }, { sortable: true, dataIndex: 'OPNAME', header: '最近操作人', width: 80 }, { sortable: true, dataIndex: 'OPTIME', header: '最近操作时间', width: 80 }, { sortable: true, dataIndex: 'REMARK', header: '申请说明', width: 200 }, { sortable: true, dataIndex: 'CUSTCARGOAFTER', header: '后面是否有货', width: 100 }, { sortable: true, dataIndex: 'STLNAME', header: '客户结算方式', width: 100 }, { sortable: true, dataIndex: 'COMMITREMARK', format: 'Y-m-d', header: '客户承诺付款日期', width: 100 }, { sortable: true, dataIndex: 'SALE', header: '揽货人', width: 80 }, { sortable: true, dataIndex: 'OP', header: '操作', width: 80 }, { sortable: true, dataIndex: 'SALEDEPT', header: '销售部门', width: 80 }, { sortable: true, dataIndex: Zi.LAN.ISDEPTARREARS, header: '是否占部门额度', width: 100 }, { sortable: true, dataIndex: Zi.LAN.MAXARREARS, header: '部门额度', width: 120 }, { sortable: true, dataIndex: Zi.LAN.DEPTTTLDR, header: '部门剩余额度', width: 120 }, { sortable: true, dataIndex: 'ISCHAOQI', header: '是否超期欠费', width: 100 }, { sortable: true, dataIndex: 'RMBNODR', header: 'RMB未收', width: 80 }, { sortable: true, dataIndex: 'USDNODR', header: 'USD未收', width: 80 }, { sortable: true, dataIndex: 'TTLNODR', header: '合计未收', width: 80 }, { sortable: true, dataIndex: 'AUDITOR', header: '审核人', width: 80 }, { sortable: true, dataIndex: 'SALECORPID', header: '所属公司', renderer: function (value, cellmeta) { if (value) { var corpname = _this.storeReplacePaymentCORPID.find('GID', value); if (corpname >= 0) { corp = _this.storeReplacePaymentCORPID.getAt(corpname); return corp.data.NAME; } } } }, { sortable: true, dataIndex: 'RMBNODR_ALL', header: '客户欠款_RMB', width: 80 }, { sortable: true, dataIndex: 'USDNODR_ALL', header: '客户欠款_USD', width: 80 }, { sortable: true, dataIndex: 'TTLNODR_ALL', header: '客户欠款_合计', width: 80 } ]; this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 40 }); this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.gridList_SP = new Ext.grid.GridPanel({ store: this.storeList_SP, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.GridCheckBoxModel, //selModel: this.MainCB, columns: this.column_SP, plugins: [ //this.cellEditing ], /*features: [{ id: 'group', ftype: 'grouping', groupHeaderTpl: '{name}', hideGroupedHeader: true, enableGroupingMenu: true }],*/ viewConfig: { enableTextSelection: true, //允许复制数据 autoFill: true }, bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList_SP, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); /////////////以下部分为获取存储的gridpanel显示样式 this.column_SP = DsTruck.GetGridPanel(USERID, this.formname, this.column_SP); //使用者id,表名 ,中间column数组 this.column_SP.unshift(new Ext.grid.RowNumberer()); this.gridList_SP.reconfigure(this.storeList_SP, this.column_SP); //////////////////////////// //#endregion //#region 日志表 this.storeLog = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'DsShipping.ux.WorkLogmb', remoteSort: false, //groupField: 'GroupDate', proxy: { type: 'ajax', //url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL', url: '/OA/WorkFlow/GetWorkLog', //this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL'; reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.Logcolumn = [ { sortable: true, hidden: true, dataIndex: 'GID', header: 'GID', width: 130 }, { sortable: true, hidden: true, dataIndex: 'BSNO', header: 'BSNO', width: 70, align: 'center' }, { sortable: true, dataIndex: 'OP', header: '操作人', width: 80 }, { sortable: true, dataIndex: 'OPDATE', header: '操作时间', //renderer: 'Y-m-d H:i:s', width: 110 }, { sortable: true, dataIndex: 'ACTNAME', header: '动作', width: 110 }, { sortable: true, dataIndex: 'ACTRESULT', header: '结果', width: 80 }, { sortable: true, dataIndex: 'REMARK', header: '备注', width: 450 } ]; Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 40 }); this.gridList_Log = new Ext.grid.GridPanel({ store: this.storeLog, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, //selModel: this.MainCB, columns: this.Logcolumn, //plugins: [this.cellEditing], viewConfig: { enableTextSelection: true, //允许复制数据 autoFill: true }, bbar: Ext.create('Ext.PagingToolbar', { store: this.storeLog, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); //#endregion ////////////////////////////////////////////////////////////// //#region formSearch //#region formSearch枚举参照相关 //客户加载_委托单位 this.storeCustCode2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } }); // this.storeCustCode2.load({ params: { condition: "ISCONTROLLER='1'"} }); //委托单位 this.comboxCustCode2 = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '委托单位', store: this.storeCustCode2, queryMode: 'remote', minChars: 1, queryParam: 'CODENAME', name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName' //,allowBlank: false }); this.storeBLSTATUS = Ext.create('Ext.data.Store', { fields: ['BLSTATUS'] }); this.storeBLSTATUS.add({ "BLSTATUS": "录入状态" }); this.storeBLSTATUS.add({ "BLSTATUS": "提交审核" }); this.storeBLSTATUS.add({ "BLSTATUS": "审核通过" }); this.storeBLSTATUS.add({ "BLSTATUS": "驳回提交" }); this.storeBLSTATUS.add({ "BLSTATUS": "仅需自己审核且审核人为自己" }); this.storeBLSTATUS.add({ "BLSTATUS": "仅自己提交" }); this.storeBLSTATUS.add({ "BLSTATUS": "需复核业务" }); this.storeBLSTATUS.add({ "BLSTATUS": "已复核通过" }); this.storeBLSTATUS.add({ "BLSTATUS": "仅需自己审核" }); this.storeBLSTATUS.add({ "BLSTATUS": "全部" }); this.comboxBLSTATUS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '审核状态', store: this.storeBLSTATUS, flex: 1, forceSelection: true, name: 'BLSTATUS', valueField: 'BLSTATUS', displayField: 'BLSTATUS', value: '全部', listeners: { scope: this, change: function (field, newValue, oldValue, eOpts) { } } }); //#endregion this.formSearch_SP = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 85, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '提单号', name: 'MBLNO' }, { fieldLabel: '委托编号', name: 'CUSTNO' }, this.comboxBLSTATUS , { fieldLabel: '从开船日期', format: 'Y-m-d', xtype: 'datefield', name: 'ETD_BGN' }, { fieldLabel: '到开船日期', format: 'Y-m-d', xtype: 'datefield', name: 'ETD_END' }, this.comboxAUDITOPERATOR] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [//this.comboxCustCode //, this.comboxF_CustCode //, this.comboxBLSTATUS //, { xtype: 'hiddenfield', flex: 2 } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ //, this.comboxFeeNameRef //, { xtype: 'hiddenfield', flex: 2 } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //#endregion formSearch this.CheckSaveQuery = new Ext.form.Checkbox({ fieldLabel: '记忆查询', labelWidth: 60, flex: 0.4, checked: true }); this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { text: "新建", id: "btnadd", iconCls: "btnadd", handler: function (button, event) { this.OprationStatus = 'add'; DsOpenEditWin('/MvcShipping/MsOp_BLISSUE/Edit_SP', "编辑特殊放单申请"); }, scope: this }, { text: "删除", id: "btndelete", iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: "保存修改", id: "SaveBtn", hidden: true, iconCls: "btnsave", handler: function (button, event) { this.onSaveClick(button, event); }, scope: this }, { text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); saveQuerySetting(this.formname, this.formSearch_SP, true, true); }, scope: this }, '-', { text: "提交审核", id: "SP_Start", handler: function (button, event) { this.onSP_StartClick(); }, scope: this }, { text: "撤回提交", id: "SP_Back", tooltip: '取消特殊放单审请', handler: function (button, event) { this.onSP_BackClick(button, event); }, scope: this }, '-', { text: "审核通过", id: "SP_Audit", //iconCls: "btnrefresh", handler: function (button, event) { var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; GID = ""; if (selections.length > 0) { bodyList.push(selections[0]); GID = selections[0].data.GID; } Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOp_BLISSUE/CanCheckOut_SP', async: false, params: { GID: data.GID }, 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 //}); Ext.MessageBox.confirm("警告", result.Message, function (btn) { if (btn == 'yes') { _this.winAuditShow.show(); } }); } } } }); }, scope: this }, { text: "审核驳回", id: "SP_AuditBack", handler: function (button, event) { this.winAuditBackShow.show(); }, scope: this }, '-', { text: "复核通过", id: "MNGSP_Audit", //iconCls: "btnrefresh", handler: function (button, event) { this.onMNGSP_AuditClick(); }, scope: this }, { text: "复核驳回", id: "MNGSP_AuditBack", handler: function (button, event) { this.onMNGSP_AuditBackClick(); }, scope: this }, '-', { text: "高级查询", iconCls: "btnmore", handler: function (button, event) { var sql = this.getCondition(); var winAccess = new Shipping.DsQuery({ }); winAccess.StoreList = this.storeList; winAccess.formname = this.formname; winAccess.condition = sql; winAccess.show(); return; }, scope: this }, '-', { text: "导出Excel", id: "btnExportExcel", iconCls: 'btnexportexcel', handler: function (button, event) { this.onExportClick(button, event); }, scope: this }, /*{ id: "btnFeeAuditReject", text: '驳回提交费用业务', tooltip: '驳回提交费用业务', iconCls: "btnrefuse", handler: function (button, event) { this.onAuditRefuseClick(button, event); }, scope: this },*/ { text: "保存列表样式", id: "btntest", handler: function (button, event) { var formname = this.formname; var tempcolumns = this.gridList_SP.columns; DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column_SP, 0, false); }, scope: this } //,this.CB_EditMode ] }); //选择load var isloadfee = true; this.gridList_SP.getSelectionModel().on('select', function (model, record, index) { if (!isloadfee) return; Ext.getCmp("BLINFO").setValue(""); var BSNO = record.data.GID; var SALE = record.data.SALE; var CUSTOMERNAME = record.data.CUSTOMERNAME; isloadfee = false; if (BSNO != "") { this.storeLog.load({ params: { condition: " BSNO='" + BSNO + "' "} }); //载入相关信息 写入右下格子 Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/GetBLINFO2', params: { BSNO: " select BB.PARENTID BSNO from OP_BLISSUEList_detail B LEFT JOIN v_op_blissue_bill BB ON (BB.BSNO=B.BSNO) where B.linkgid='" + BSNO + "' " }, callback: function (options, success, response) { if (success) { isloadfee = true; var result = Ext.JSON.decode(response.responseText); if (result.Success) { // Ext.getCmp("BLINFO").setValue(result.data[0].InfoText); Ext.getCmp("BLINFO").update(result.data[0].InfoText); } else { //return; } } else { return; } }, scope: this }); this.storeBlInfoList.load({ params: { SALE: SALE, CUSTNAME: CUSTOMERNAME} }); } else { this.storeLog.removeAll(); this.storeBlInfoList.removAll(); } // }, this); this.storeBlInfoList = Ext.create('Ext.data.Store', { model: 'BLINFOLIST', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsOp_BLISSUE/GetBLINFOLIST', reader: { root: 'data', totalProperty: 'totalCount' } } }); this.gridBlInfoList = new Ext.grid.GridPanel({ store: this.storeBlInfoList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: [{ sortable: true, dataIndex: 'INFOTEXT', header: '描述', width: 160 }, { sortable: true, dataIndex: 'RMBNODR', header: 'RMB应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'USDNODR', header: 'USD应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'TTLNODR', header: '合计应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'RMBNODR_YQC', header: '已签出RMB应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'USDNODR_YQC', header: '已签出USD应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'TTLNODR_YQC', header: '已签出合计应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'RMBNODR_WQC', header: '未签出RMB应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'USDNODR_WQC', header: '未签出USD应收欠费(超期)', width: 160 }, { sortable: true, dataIndex: 'TTLNODR_WQC', header: '未签出合计应收欠费(超期)', width: 160 } ] }); this.panelBlInfoList = new Ext.Panel({ title: '欠费信息', // layout: "border", region: 'south', height: 170, //margin: '5 10', // frame: true, items: [this.gridBlInfoList] }); this.formInfo = Ext.widget('form', { region: 'center', frame: true, bodyPadding: 2, fieldDefaults: { margins: '0 0 0 0', labelAlign: 'right', flex: 5, //labelWidth: 90,//label标签宽度 msgTarget: 'qtip', sourcelabelWidth: '100' //,split:true }, items: [{ //fieldset 1 xtype: 'fieldset', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [ { //container_1 xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'textareafield', height: 60, id: "BLINFO", anchor: '100%' }] }] }] }); //#region 布局 this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 75, items: [this.formSearch_SP, this.panelBtn] }); this.panelContract = new Ext.Panel({ //title: '', layout: "border", region: 'center', height: 600, margin: '1 2', split: true, items: [this.gridList_SP] }); this.panelLogList = new Ext.Panel({ title: '日志', layout: "border", region: 'center', //height: 300, margin: '1 1', split: true, items: [this.gridList_Log] }); this.MainTab = new Ext.tab.Panel({ layout: "border", region: "center", split: true, items: [this.panelLogList//, this.panelAddList ] }); this.panelInfoList = new Ext.Panel({ title: '相关信息', layout: "border", region: 'east', width: 600, margin: '1 1', split: true, items: [this.formInfo, this.panelBlInfoList] }); this.panelSalesBody = new Ext.Panel({ //title: '销售单关联明细', layout: "border", region: 'south', height: 300, margin: '1 1', split: true, items: [this.MainTab, this.panelInfoList ] }); Ext.apply(this, { items: [this.panelTop, this.panelContract, this.panelSalesBody] }); //#endregion //#region 以下集中绑定事件 /* this.cellEditing.on('beforeedit', function (editor, e) { //alert("beforeedit"); return this.PCBeforeEdit(editor, e); }, this); */ //#endregion this.LoadInitData(); this.formReason = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ { fieldLabel: '备注', id: "REASON", xtype: 'textfield', name: 'REASON', width: 400, listeners: { change: function (field, eOpts) { if (field.lastValue != "") { //this.formHead.getForm().findField('STOCKDATE_1').setValue(field.rawValue); } }, scope: this } }] }); this.formReason2 = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ { fieldLabel: '备注', id: "REASON2", xtype: 'textfield', name: 'REASON', width: 400, listeners: { change: function (field, eOpts) { if (field.lastValue != "") { //this.formHead.getForm().findField('STOCKDATE_1').setValue(field.rawValue); } }, scope: this } }] }); var _this2 = this; this.winAuditShow = Ext.create('Ext.window.Window', { id: "winAuditShow", title: "审核通过", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formReason], buttons: [ { text: "确定", minWidth: 70, handler: function () { _this2.onSP_AuditClick(Ext.getCmp("REASON").getRawValue()); } }, { text: "取消", minWidth: 70, handler: function () { _this2.winAuditShow.Close(); } }] }); this.winAuditBackShow = Ext.create('Ext.window.Window', { id: "winAuditBackShow", title: "驳回申请", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formReason2], buttons: [ { text: "确定", minWidth: 70, handler: function () { _this2.onSP_AuditBackClick(Ext.getCmp("REASON2").getRawValue()); } }, { text: "取消", minWidth: 70, handler: function () { _this2.winAuditShow.Close(); } }] }); var btnAudit = Ext.getCmp('SP_Audit'); var btnAuditBack = Ext.getCmp('SP_AuditBack'); Ext.Ajax.request({ waitMsg: '正在添加数据...', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: 'MsOp_BLISSUE_SP' }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { btnAudit.setVisible(true); btnAuditBack.setVisible(true); } else { btnAudit.setVisible(false); btnAuditBack.setVisible(false); } } }, scope: this }); this.gridList_SP.addListener('itemdblclick', function (dataview, record, item, index, e, b) { var selections = this.gridList_SP.getSelectionModel().getSelection(); var _record = selections[0]; this.SelectedRecord = _record; this.OprationStatus = 'edit'; DsOpenEditWin('/MvcShipping/MsOp_BLISSUE/Edit_SP', "编辑特殊放单申请"); }, this); var btnMNGAuditPass = Ext.getCmp('MNGSP_Audit'); var btnMNGAuditBack = Ext.getCmp('MNGSP_AuditBack'); Ext.Ajax.request({ waitMsg: '', url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', params: { modulename: "MNGSP_AUDIT" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { btnMNGAuditPass.setVisible(false); btnMNGAuditBack.setVisible(false); } else { btnMNGAuditPass.setVisible(true); btnMNGAuditBack.setVisible(true); } } else { } }, scope: this }); LoadQueryData(this.formname, this.formSearch_SP, this.CheckSaveQuery); this.RoleTaskQueryGid = getUrlParam('RoleTaskQueryGid'); this._condition = getUrlParam('CONDITION'); /////如果是从首页【待办工作】模块双击跳转,则在URL中增加RoleTaskGid参数,值为Sys_Role_Task_Query.GID //this.RoleTaskQueryGid = getUrlParam('RoleTaskQueryGid'); //LoadRoleTaskQuery(this.RoleTaskQueryGid, this.formSearch, this.onRefreshClick); if (this.RoleTaskQueryGid && this._condition) { LoadRoleTaskQuery(this.RoleTaskQueryGid, this.formSearch_SP); this.storeList_SP.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: this._condition, load: 'true' }, waitMsg: "正在查询数据...", scope: this }); } else { //this.onRefreshClick(); } }, //end initUIComponents LoadInitData: function () { //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} }); }, onAuditRefuseClick: function (button, event) { var sql = " A.GID in (select bsno from ch_fee where FEESTATUS=6)"; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); }, onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); this.sqlcontext = sql; this.storeList_SP.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); //} }, onDsQuery: function (button, event) { var sql = this.sqlcontext; this.storeList_SP.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); //} }, onRefreshClick_Add: function (button, event) { if (!this.checkSearchCondition()) return; var sql = this.getCondition_Add(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); //} }, onDeleteClick: function (button, event) { var selections = this.gridList_SP.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var record = selections[0]; Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { if (btn == 'yes') { Ext.Msg.wait('正在删除数据...'); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOp_BLISSUE/Delete', params: { data: Ext.JSON.encode(record.data) }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.storeList_SP.remove(record); 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 } }, this); }, //onDeleteClick getCondition: function () { var form = this.formSearch_SP.getForm(); var sql = ''; //20170309 增加逻辑 // //只能看到“” var MBLNO = form.findField('MBLNO').getValue(); sql = sql + getAndConSql(sql, MBLNO, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where MBLNO like '%" + MBLNO + "%')) "); var CUSTNO = form.findField('CUSTNO').getValue(); sql = sql + getAndConSql(sql, CUSTNO, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where CUSTNO like '%" + CUSTNO + "%')) "); var BLSTATUS = form.findField('BLSTATUS').getValue(); if (BLSTATUS == "仅需自己审核") { sql = sql + getAndConSql(sql, BLSTATUS, " dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + USERID + "',wu.stepno)>0 "); } else if (BLSTATUS == "仅需自己审核且审核人为自己") { sql = sql + getAndConSql(sql, BLSTATUS, " dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + USERID + "',wu.stepno)>0 and ob.AUDITOR='" + SHOWNAME +"' "); } else if (BLSTATUS == "仅自己提交") { sql = sql + getAndConSql(sql, BLSTATUS, " wu.OP = '" + USERID + "' "); } else if (BLSTATUS == "需复核业务") { sql = sql + getAndConSql(sql, BLSTATUS, " ob.BLSTATUS = '审核通过' and ob.MNGBLSTATUS='录入状态' "); } else if (BLSTATUS == "已复核通过") { sql = sql + getAndConSql(sql, BLSTATUS, " ob.MNGBLSTATUS='审核通过' "); } else if (BLSTATUS == "全部") { } else { sql = sql + getAndConSql(sql, BLSTATUS, " ob.BLSTATUS = '" + BLSTATUS + "' "); } var ETD_BGN = form.findField('ETD_BGN').getRawValue(); sql = sql + getAndConSql(sql, ETD_BGN, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where ETD>='" + ETD_BGN + "'))"); var ETD_END = form.findField('ETD_END').getRawValue(); sql = sql + getAndConSql(sql, ETD_END, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where ETD<='" + ETD_END + " 23:59:59'))"); var AUDITOR = form.findField('AUDITOR').getValue(); sql = sql + getAndConSql(sql, AUDITOR, " ob.AUDITOR='" + AUDITOR +"'"); //到港日期 /* var ETDbgn = form.findField('ETD_BGN').getRawValue(); sql = sql + getAndConSql(sql, ETDbgn, " ETD >='" + ETDbgn + "'"); var ETDend = form.findField('ETD_END').getRawValue(); sql = sql + getAndConSql(sql, ETDend, " ETD <='" + ETDend + " 23:59:59'"); var BLSTATUS = this.comboxBLSTATUS.getValue(); if (BLSTATUS != "") { sql = sql + getAndConSql(sql, BLSTATUS, "BLSTATUS='" + BLSTATUS + "'"); }*/ return sql; }, getCondition_Add: function () { var form = this.formSearch_SP.getForm(); var sql = " not exists (select 1 from op_blissueList ob1 where ob1.bsno=ob.bsno) "; var MBLNO = form.findField('MBLNO').getValue(); sql = sql + getAndConSql(sql, MBLNO, " BLNO like '%" + MBLNO + "%' "); var CUSTNO = form.findField('CUSTNO').getValue(); sql = sql + getAndConSql(sql, CUSTNO, " BSNO in (select BSNO from v_op_blissue_bill where CUSTNO like '%" + CUSTNO + "%' ) "); var ETD_BGN = form.findField('ETD_BGN').getRawValue(); sql = sql + getAndConSql(sql, ETD_BGN, " ETD>='" + ETD_BGN + "'"); var ETD_END = form.findField('ETD_END').getRawValue(); sql = sql + getAndConSql(sql, ETD_END, " ETD<='" + ETD_END + " 23:59:59'"); return sql; }, checkSearchCondition: function () { var form = this.formSearch_SP.getForm(); if (!form.isValid()) { Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); return false; } return true; }, OprationSwap: function () { var ret = new Array(); ret[0] = this.OprationStatus; ret[1] = this.storeList_SP; ret[2] = this.SelectedRecord; if (this.OprationStatus == "add") { ret[3] = ""; } else { ret[3] = this.SelectedRecord.data.BSNO; } return ret; } , onSP_StartClick: function () { //this.onSaveClick(); var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; //for (i = 0; i < selections.length; i += 1) { // var member = selections[i]; // bodyList.push(member); //}; GID = ""; if (selections.length > 0) { bodyList.push(selections[0]); GID = selections[0].data.GID; } var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { return; } Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOp_BLISSUE/CanCheckOut_SP', async: false, params: { GID: GID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.MessageBox.confirm("警告", result.Message + "
" + "是否继续提交", function (btn) { if (btn == 'yes') { Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/SP_Start', params: { USERID: USERID, data: jsonBody }, callback: function (options, success, response) { if (success) { //this.onRefreshClick(); var result = Ext.JSON.decode(response.responseText); if (result.Success) { this.onRefreshClick(); } else { Ext.Msg.show({ title: '警告', msg: result.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.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/SP_Start', params: { USERID: USERID, data: jsonBody }, callback: function (options, success, response) { if (success) { //this.onRefreshClick(); var result = Ext.JSON.decode(response.responseText); if (result.Success) { this.onRefreshClick(); } else { Ext.Msg.show({ title: '警告', msg: result.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 } } } }); } , onSP_BackClick: function () { var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; for (i = 0; i < selections.length; i += 1) { var member = selections[i]; bodyList.push(member); }; var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { return; } Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/SP_Back', params: { USERID: USERID, data: jsonBody }, callback: function (options, success, response) { if (success) { //this.winAuditShow.close(); //Ext.getCmp("REASON").setValue(""); this.onRefreshClick(); } }, 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 } , onSP_AuditClick: function (REASON) { //this.onSaveClick(); var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; for (i = 0; i < selections.length; i += 1) { var member = selections[i]; bodyList.push(member); }; var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { return; } Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/SP_Audit', params: { USERID: USERID, data: jsonBody, REASON: REASON }, callback: function (options, success, response) { if (success) { this.winAuditShow.close(); Ext.getCmp("REASON").setValue(""); this.storeList_SP.reload(); } }, 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 }, onExportClick: function (button, event) { GridExportExcelPage(this.gridList_SP); }, onSP_AuditBackClick: function (REASON) { //this.onSaveClick(); var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; for (i = 0; i < selections.length; i += 1) { var member = selections[i]; bodyList.push(member); }; var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { return; } Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/SP_AuditBack', params: { USERID: USERID, data: jsonBody, REASON: REASON }, callback: function (options, success, response) { if (success) { this.winAuditBackShow.close(); Ext.getCmp("REASON2").setValue(""); this.storeList_SP.reload(); } }, 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 } , onMNGSP_AuditClick: function () { //this.onSaveClick(); var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; for (i = 0; i < selections.length; i += 1) { var member = selections[i]; if (member.data.BLSTATUS == '审核通过') bodyList.push(member); }; var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { Ext.Msg.show({ title: '提示', msg: '没有要复核的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/MNGSP_Audit', params: { USERID: USERID, data: jsonBody }, callback: function (options, success, response) { if (success) { this.storeList_SP.reload(); } }, 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 } , onMNGSP_AuditBackClick: function () { //this.onSaveClick(); var selections = this.gridList_SP.getSelectionModel().getSelection(); var bodyList = []; for (i = 0; i < selections.length; i += 1) { var member = selections[i]; if (member.data.MNGBLSTATUS == '审核通过') bodyList.push(member); }; var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { Ext.Msg.show({ title: '提示', msg: '没有要取消复核的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } Ext.Ajax.request({ waitMsg: '正在提交数据...', url: '/MvcShipping/MsOp_BLISSUE/MNGSP_AuditBack', params: { USERID: USERID, data: jsonBody }, callback: function (options, success, response) { if (success) { this.storeList_SP.reload(); } }, 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 } });