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/TruckMng/Viewsjs/MsWl_HH_ZY/FileImport.js

142 lines
5.5 KiB
JavaScript

3 years ago
Ext.namespace('DsTruck');
DsTruck.FileImport = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
DsTruck.FileImport.superclass.constructor.call(this);
};
Ext.extend(DsTruck.FileImport, Ext.Window, {
StoreList: null,
initUIComponents: function () {
// BEGIN OF CODE GENERATION PARTS, DON'T DELETE CODE BELOW
Ext.apply(this, {
height: 210,
width: 200,
closable: true,
draggable: true,
defaultButton: 'btnImport',
resizable: false,
items: [{
region: "center",
frame: "true",
items: [{
xtype: 'filefield',
name: 'file',
fieldLabel: 'Excel文件',
labelWidth: 110,
anchor: '100%',
buttonText: '选择文件...'
}, {
xtype: 'textfield',
name: 'Price_1',
fieldLabel: '物流付操作费率',
tooltip: "中烟业务操作部从物流部收费的收费费率",
labelWidth: 110,
anchor: '100%',
listeners: {
blur: function (field, eOpts) {
if (field.lastValue != "") {
Ext.getCmp("Price_3").setValue(Add(field.lastValue,0.01,2));
}
},
scope: this
}
}, {
xtype: 'textfield',
name: 'Price_2',
fieldLabel: '对车队付费费率',
tooltip: "中烟业务操作部向车队付费的付费费率",
labelWidth: 110,
anchor: '100%'
}, {
xtype: 'textfield', id: "Price_3",
name: 'Price_3',
fieldLabel: '中烟付物流费率',
tooltip: "中烟公司向物流部付费的付费费率",
labelWidth: 110,
anchor: '100%'
}, {
xtype: 'label',
//name: 'label1',
text: '依照合同号导入,相同合同号的数据会覆盖,但资金类的数据不变。'
//labelWidth: 80,
//anchor: '100%'
}],
xtype: "form",
layout: "form",
id: 'importForm',
buttons: [{
text: "导入",
id: 'btnImport',
handler: function (button, event) {
var form = Ext.getCmp("importForm").getForm();
var storeList = this.StoreList;
//alert(form.findField('Price_1').getValue());
var Price_1 = form.findField('Price_1').getValue();
var Price_2 = form.findField('Price_2').getValue();
var Price_3 = form.findField('Price_3').getValue();
if (Price_1 == "") {
Price_1 = "0";
Price_2 = "0";
Price_3 = "0";
}
if (form.isValid()) {
form.submit({
url: '/TruckMng/MsWl_HH_ZY/File', waitMsg: '正在导入文件...',
params: {
_Price_1: Price_1,
_Price_2: Price_2,
_Price_3: Price_3
},
success: function (f, a) {
var result = a.result,
dataList = result.data;
for (var i = 0; i < dataList.length; i++) {
var record = dataList[i];
storeList.add(record);
}
var win = Ext.getCmp("importWin");
win.close();
Ext.Msg.alert('Success', result.Message);
},
failure: function (f, a) { Ext.Msg.alert('Failure', a.result.Message); }
});
}
//this.onImportClick(button, event);
},
scope: this
}, {
text: "关闭",
handler: function (button, event) {
var win = this.up("window"); // Ext.getCmp("importWin");
win.close();
}
}]
}],
layout: "border",
width: 300,
xtype: "window",
id: "importWin"/*,
closeAction: "close"*/
});
// END OF CODE GENERATION PARTS, DON'T DELETE CODE ABOVE
}
});
DsTruck.MsChFeeGetRowClass = function (feeStatus) {
if (feeStatus == 2) {
return 'feestatus_refer';
} else if (feeStatus == 0) {
return 'feestatus_pass';
} else if (feeStatus == 6) {
return 'feestatus_nopass';
} else if (feeStatus == 8 || feeStatus == 9) {
return 'feestatus_settle';
}
return '';
}