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/Account/Viewsjs/Chfee_payapplication/FileUpload.js

240 lines
9.3 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.FileUpload = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
Shipping.FileUpload.superclass.constructor.call(this);
};
Ext.regModel('CertType',
{
fields: [{ name: 'value' }, { name: 'text' }]
});
Ext.extend(Shipping.FileUpload, Ext.Window, {
GID: null,
BillNo: null,
File_DocType: null,
File_DocNo:null,
5 months ago
Obj: null,
storeChfeeFile: null,
2 years ago
CallBackFun: function() {},
initUIComponents: function () {
this.storeType = new Ext.data.Store({
model: 'CertType',
data: [
{ 'value': '0', 'text': '请选择' },
{ 'value': '1', 'text': '行车证' },
{ 'value': '2', 'text': '营运证' },
{ 'value': '3', 'text': '驾驶证' },
{ 'value': '4', 'text': '资格证' },
{ 'value': '5', 'text': '车俩照片' },
{ 'value': '6', 'text': '驾驶员身份证'}]
});
1 year ago
Zi.LAN.File_Type = '文件类型';
Zi.LAN.filefield = '附件';
Zi.LAN.selectfile = '选择文件...';
Zi.LAN.File_DocType = '单据类型';
Zi.LAN.File_DocNo = '单据编号';
Zi.LAN.upload = '上传';
Zi.LAN.selectfiletype = '请选择要上传证件的类型!';
Zi.LAN.uploadtishi = '提示';
Zi.LAN.uploadfujianshangchuanchenggong = '附件上传成功!';
Zi.LAN.uploadfujianshangchuanshibai = '附件上传失败!';
Zi.LAN.uploadclose = '关闭';
9 months ago
Zi.LAN.plupload = '批量上传';
1 year ago
if (typeof strLANGUAGES =='undefined') {
} else {
if (strLANGUAGES == 'en-us') {
Zi.LAN.File_Type = 'FileType';
Zi.LAN.filefield = 'Attachment';
Zi.LAN.selectfile = 'Select File...';
Zi.LAN.File_DocType = 'Doc Type';
Zi.LAN.File_DocNo = 'Doc Number';
Zi.LAN.upload = 'Upload';
Zi.LAN.selectfiletype = 'Select the type of document to upload';
Zi.LAN.uploadtishi = 'prompt';
Zi.LAN.uploadfujianshangchuanchenggong = 'Attachment uploaded successfully';
Zi.LAN.uploadfujianshangchuanshibai = 'Attachment upload failed';
Zi.LAN.uploadclose = 'Close';
9 months ago
Zi.LAN.plupload = 'Batch upload';
1 year ago
}
1 year ago
}
2 years ago
5 months ago
_thisuploadfile = this;
2 years ago
this.cmbType = Ext.create('Ext.form.ComboBox', {
1 year ago
fieldLabel: Zi.LAN.File_Type,
2 years ago
queryMode: 'local',
name: 'File_Type',
triggerAction: 'all',
valueField: 'value',
displayField: 'text',
store: this.storeType,
listeners: {
afterRender: function (combo) {
5 months ago
var firstValue = _thisuploadfile.storeType.data.items[0].data.value;
2 years ago
combo.setValue(firstValue); //同时下拉框会将与name为firstValue值对应的 text显示
}
}
});
Ext.apply(this, {
height: 150,
width: 300,
closable: true,
draggable: true,
defaultButton: 'btnImport',
closeAction: 'destroy',
resizable: false,
modal: true,
items: [{
region: "center",
frame: "true",
items: [
//this.cmbType,
{
xtype: 'filefield',
name: 'file',
1 year ago
fieldLabel: Zi.LAN.filefield,
2 years ago
labelWidth: 80,
anchor: '100%',
1 year ago
buttonText: Zi.LAN.selectfile
2 years ago
}, {
xtype: 'textfield',
hidden: true,
hideLabel: true,
name: 'BillNo',
labelWidth: 80
}
, {
xtype: 'textfield',
1 year ago
fieldLabel: Zi.LAN.File_DocType ,
2 years ago
name: 'File_DocType',
// readOnly:true,
labelWidth: 80
}, {
xtype: 'textfield',
1 year ago
fieldLabel: Zi.LAN.File_DocNo,
2 years ago
name: 'File_DocNo',
// readOnly: true,
labelWidth: 80
}
],
xtype: "form",
layout: "form",
id: 'importForm',
buttons: [{
1 year ago
text: Zi.LAN.upload,
2 years ago
handler: function (button, event) {
var form = Ext.getCmp("importForm").getForm();
form.findField('BillNo').setValue(this.BillNo);
3 months ago
form.findField('File_DocType').setValue(_thisuploadfile.File_DocType);
2 years ago
var typenum = 1;
if (typenum == null || typenum == 'null' || typenum == '0') {
1 year ago
Ext.MessageBox.alert(Zi.LAN.uploadtishi, Zi.LAN.selectfiletype);
2 years ago
return;
}
if (form.isValid()) {
form.submit({
url: '/Account/Chfee_payapplication/FileUpload',
waitMsg: '正在上传文件...',
success: function (f, a) {
var win = Ext.getCmp("uploadWin");
win.close();
1 year ago
Ext.Msg.alert(Zi.LAN.uploadtishi, Zi.LAN.uploadfujianshangchuanchenggong);
2 years ago
//if (_this.Obj != null)
// _this.CallBackFun(_this.Obj);
//else
5 months ago
//if (panelEdit != undefined && panelEdit != null)
// panelEdit.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: win.BillNo } });
//else
// panelIndex.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: win.BillNo } });
win.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: win.BillNo } })
2 years ago
// .LoadData('edit', "BILLNO='" + win.BillNo + "'");
},
failure: function (f, a) {
1 year ago
Ext.Msg.alert(Zi.LAN.uploadtishi, Zi.LAN.uploadfujianshangchuanshibai + a.result.Message);
2 years ago
}
});
}
},
scope: this
}, {
9 months ago
text: Zi.LAN.plupload,
tooltip: Zi.LAN.plupload,
iconCls: "btnadddetail",
handler: function (button, event) {
this.UploadFile("", "");
},
scope: this
2 years ago
}, {
1 year ago
text: Zi.LAN.uploadclose,
2 years ago
handler: function (button, event) {
var win = Ext.getCmp("uploadWin");
win.close();
}
}]
}],
layout: "border",
xtype: "window",
id: 'uploadWin',
listeners: {
afterRender: function (combo) {
var form = Ext.getCmp("importForm").getForm();
form.findField('File_DocType').setValue(this.File_DocType);
form.findField('File_DocNo').setValue(this.File_DocNo);
}
}
});
// END OF CODE GENERATION PARTS, DON'T DELETE CODE ABOVE
}
, UploadFile: function (uploadFileType, title) {
var billno = this.BillNo;
//var BSNO = this.strBSNO;
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: "<iframe scrolling='yes'width='100%' height='100%' frameborder='0' src='../../MvcContainer/MsOpCtnBsCard/UpLoadFileAccount'></iframe>"
},
buttonAlign: "center",
buttons: [{
text: "关 闭",
handler: function () {
winUpload.close();
}
}]
});
//_UploadFileStore = panelEdit.storeChfeeFile;
//_condition = " BSNO='" + BSNO + "' ";
_BILLNO = billno;
//_FileBillType = this.FileBillType
//_CUSTNO = billno;
5 months ago
winFXTZModifyShow = _thisuploadfile.winFXTZModifyShow;
extParentWinFrame = winUpload;
winUpload.show();
this.close();
}
2 years ago
});