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

248 lines
7.5 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Ext.ns("Zi.LAN");
Shipping.DsAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
Shipping.DsAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.DsAudit, Ext.Window, {
StoreList: null,
formname: '',
Record: null,
BsNo: "",
stroplb: "",
Parentformname:'',
initUIComponents: function () {
this.formname = 'MsOpAuditDetailIndex';
Ext.define('MsOpAuditDetail', {
extend: 'Ext.data.Model',
idProperty: 'ADID',
fields: [
{ name: 'ADID', type: 'string' },
{ name: 'BSNO', type: 'string' },
{ name: 'ERRDATA', type: 'string' },
{ name: 'OPREMARK', type: 'string' },
{ name: 'ERRMSG', type: 'string' },
{ name: 'AUDITTYPE', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATEUSERREF', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'SORT', type: 'number' }
]
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpAuditDetail'
});
this.girdcolums = [{
sortable: true,
dataIndex: 'ADID',
header: 'ADID',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'ERRMSG',
header: '异常信息',
width: 460
}
];
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.CheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
height:160,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
return 'text_red';
}
},
plugins: [this.gridListCellEditing],
selType: 'cellmodel',
columns: this.girdcolums
});
this.storeList.on('beforeload', function (store) {
var sql = "BSNO='" + this.BsNo + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'textareafield',
grow: true,
flex: 2,
fieldLabel: '情况说明', //'备注',
height: 60,
name: 'SHENREMARK',
anchor: '100%'
},this.gridList]
}],
buttons: [{
text: '确定提交',
id: 'btnQuery',
handler: function (button, event) {
_thisDsAudit.execSql();
},
scope: this
}, {
text: '关闭',
handler: function (button, event) {
var win = this.up("window");
win.close();
}
}]
});
_thisDsAudit = this;
Ext.apply(this, {
height: 250,
closable: true,
draggable: true,
title: '整票提交',
defaultButton: 'btnQuery',
resizable: false,
items: [this.formSearch],
layout: "border",
width: 500,
xtype: "window",
id: "DsAuditWin",
listeners: {
scope: this,
'beforeshow': function (thewin, eOpts) {
_thisDsAudit.storeList.loadData(_thisDsAudit.Record);
}
}
});
}, //onDeleteClick
execSql: function () {
if (this.Parentformname == 'ch_fee') {
parentWin = window._thisfee;
} else if (_thisDsAudit.Parentformname == 'op_seae') {
parentWin = window.panelIndex;
} else if (this.Parentformname == 'ch_fee_amemd') {
parentWin = window._thisAmendfee;
}
var bodydatas = [];
for (var i = 0; i < this.storeList.getCount(); i += 1) {
var member = this.storeList.getAt(i);
bodydatas.push(member);
}
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
var shenremark = this.formSearch.getForm().findField('SHENREMARK').getValue();
Ext.Ajax.request({
waitMsg: '正在提交数据...', //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAuditBL',
params: {
feebody: jsonBody,
optype: this.stroplb,
bsno: this.BsNo,
shenremark: shenremark
},
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;
} else {
if (_thisDsAudit.Parentformname == 'ch_fee') {
parentWin.LoadDrChFee();
parentWin.LoadCrChFee();
} if (_thisDsAudit.Parentformname == 'ch_fee_amemd') {
parentWin.LoadDrChFee();
parentWin.LoadCrChFee();
}else if (_thisDsAudit.Parentformname == 'op_seae') {
parentWin.onDsQuery();
}
if (result.Data != '' && result.Data != null) {
Ext.Msg.show({
title: '提示',
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert('服务器响应出错!', response.responseText);
}
},
scope: this
});
var win = Ext.getCmp("DsAuditWin");
win.close();
}
});