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.
816 lines
26 KiB
JavaScript
816 lines
26 KiB
JavaScript
Ext.namespace('DsTruck');
|
|
|
|
DsTruck.MsWlDriverEdit = function (config) {
|
|
Ext.applyIf(this, config);
|
|
this.initUIComponents();
|
|
window.DsTruck.MsWlDriverEdit.superclass.constructor.call(this);
|
|
};
|
|
|
|
Ext.extend(DsTruck.MsWlDriverEdit, Ext.Panel, {
|
|
|
|
ParentWin: null,
|
|
OpStatus: 'add',
|
|
StoreList: null,
|
|
EditRecord: null,
|
|
|
|
initUIComponents: function () {
|
|
|
|
//枚举参照相关
|
|
|
|
this.storeDrvClass = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
this.storeDrvClass.load({ params: { enumTypeId: 99017} });
|
|
|
|
this.comboxDrvClass = Ext.create('DsExt.ux.RefEnumCombox', {
|
|
fieldLabel: '驾驶员级别',
|
|
store: this.storeDrvClass,
|
|
name: 'DrvClass'
|
|
});
|
|
|
|
this.storeTruckType = Ext.create('DsExt.ux.RefEnumStore', {});
|
|
this.storeTruckType.load({ params: { enumTypeId: 99019} });
|
|
|
|
this.comboxTruckType = Ext.create('DsExt.ux.RefEnumCombox', {
|
|
fieldLabel: '准驾车型',
|
|
store: this.storeTruckType,
|
|
name: 'TruckType'
|
|
});
|
|
|
|
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
|
|
model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
|
|
});
|
|
this.storeCompany.load({ params: { condition: ""} });
|
|
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
|
|
fieldLabel: '所属分公司',
|
|
forceSelection: true,
|
|
//allowBlank: false,
|
|
store: this.storeCompany,
|
|
name: 'OrgCode',
|
|
valueField: 'code',
|
|
displayField: 'name'
|
|
});
|
|
//表参照相关
|
|
|
|
|
|
//编辑form
|
|
this.formEdit = Ext.widget('form', {
|
|
region: 'center',
|
|
frame: true,
|
|
bodyPadding: 5,
|
|
fieldDefaults: {
|
|
margins: '2 2 2 2',
|
|
labelAlign: 'right',
|
|
flex: 1,
|
|
labelWidth: 90,
|
|
msgTarget: 'qtip'
|
|
},
|
|
|
|
items: [
|
|
{//fieldset 1
|
|
xtype: 'fieldset',
|
|
defaultType: 'textfield',
|
|
layout: 'anchor',
|
|
defaults: {
|
|
anchor: '100%'
|
|
},
|
|
items: [, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: 'GID',
|
|
name: 'GID', flex: 0, hidden: true, margins: '0'
|
|
}, /*{
|
|
fieldLabel: '组织编码',
|
|
name: 'OrgCode', flex: 0, hidden: true, margins: '0'
|
|
},*/{
|
|
fieldLabel: '驾驶员编码',
|
|
allowBlank: false,
|
|
name: 'DrvCode'
|
|
}, {
|
|
fieldLabel: '驾驶员姓名',
|
|
name: 'DrvName'
|
|
}, this.comboxDrvClass
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '驾照号',
|
|
name: 'JzNo'
|
|
}, {
|
|
fieldLabel: '领证日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'LzDate'
|
|
}, {
|
|
fieldLabel: '有效期限',
|
|
xtype: 'numberfield',
|
|
allowBlank: false,
|
|
name: 'LimitDays'
|
|
}
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '驾龄',
|
|
xtype: 'numberfield',
|
|
allowBlank: false,
|
|
name: 'DriverYears'
|
|
}, this.comboxTruckType, {
|
|
fieldLabel: '发证机关',
|
|
name: 'Licence'
|
|
}
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '年审到期日',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'YearCheckDate'
|
|
}, {
|
|
fieldLabel: '下次年审日期',
|
|
format: 'Y-m-d',
|
|
xtype: 'datefield',
|
|
name: 'NextCheckDate'
|
|
}, {
|
|
fieldLabel: '提前提醒天数',
|
|
xtype: 'numberfield',
|
|
allowBlank: false,
|
|
name: 'NoticeDays'
|
|
}
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '手机',
|
|
name: 'Mobile', flex: 1
|
|
}, {
|
|
fieldLabel: '电话',
|
|
name: 'OffTel', flex: 1
|
|
}, {
|
|
fieldLabel: '从业资格证号',
|
|
name: 'CertificateNo', flex: 1
|
|
}, {
|
|
fieldLabel: '基本工资',
|
|
xtype: 'numberfield',
|
|
name: 'BASESALARY', flex: 1
|
|
}
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [this.comboxCompany
|
|
, {
|
|
fieldLabel: '家庭住址',
|
|
name: 'Addr', flex: 3
|
|
}/*, {
|
|
xtype: 'hidden'
|
|
|
|
}*/
|
|
]
|
|
}, {
|
|
xtype: 'container',
|
|
layout: 'hbox',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: '备注',
|
|
name: 'Remark'
|
|
}
|
|
]
|
|
}
|
|
]//end items(fieldset 1)
|
|
}//end fieldset 1
|
|
]//end root items
|
|
}); //end this.formEdit
|
|
|
|
//按钮Toolbar
|
|
this.panelBtn = new Ext.Panel({
|
|
region: "north",
|
|
tbar: [
|
|
{
|
|
text: "保存",
|
|
iconCls: "btnsave",
|
|
handler: function (button, event) {
|
|
this.Save('0');
|
|
},
|
|
scope: this
|
|
},
|
|
{
|
|
text: "保存并关闭",
|
|
handler: function (button, event) {
|
|
this.Save('1');
|
|
},
|
|
scope: this
|
|
},
|
|
'-',
|
|
{
|
|
text: "保存并新建",
|
|
handler: function (button, event) {
|
|
this.Save('2');
|
|
},
|
|
scope: this
|
|
}
|
|
]
|
|
}); //end 按钮Toolbar
|
|
|
|
|
|
|
|
//明细表-数据集
|
|
this.storeBodyList = Ext.create('Ext.data.Store', {
|
|
model: 'MsUploadFile',
|
|
remoteSort: true,
|
|
proxy: {
|
|
type: 'ajax',
|
|
url: '/TruckMng/MsWlDriver/GetFileList',
|
|
reader: {
|
|
id: 'GID',
|
|
root: 'data',
|
|
totalProperty: 'totalCount'
|
|
}
|
|
}
|
|
});
|
|
//明细表表格
|
|
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
|
|
clicksToEdit: 1
|
|
});
|
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
store: this.storeBodyList,
|
|
enableHdMenu: false,
|
|
region: 'center',
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
trackMouseOver: true,
|
|
disableSelection: false,
|
|
plugins: [this.gridListCellEditing],
|
|
selModel: this.GridCheckBoxModel,
|
|
selType: 'cellmodel',
|
|
tbar: [{
|
|
text: '添加',
|
|
tooltip: '添加',
|
|
iconCls: "btnadddetail",
|
|
handler: function (button, event) {
|
|
this.onAddFileClick(button, event);
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: '删除',
|
|
tooltip: '删除',
|
|
iconCls: "btndeletedetail",
|
|
handler: function (button, event) {
|
|
this.onDelFileClick(button, event);
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: '保存',
|
|
tooltip: '保存',
|
|
iconCls: "btnsave",
|
|
handler: function (button, event) {
|
|
this.onPostFileClick(button, event);
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: '上传附件',
|
|
tooltip: '上传附件',
|
|
iconCls: "btnadddetail",
|
|
handler: function (button, event) {
|
|
this.onUpLoadFileClick(button, event);
|
|
},
|
|
scope: this
|
|
}, '-', {
|
|
text: '打印附件',
|
|
tooltip: '打印附件',
|
|
iconCls: "btnprint",
|
|
handler: function (button, event) {
|
|
this.onPrintFileClick(button, event);
|
|
},
|
|
scope: this
|
|
}],
|
|
columns: [{
|
|
sortable: true,
|
|
dataIndex: 'GID',
|
|
header: '单据号',
|
|
hidden: true,
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'PID',
|
|
header: '单据号',
|
|
hidden: true,
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'FILEPATH',
|
|
header: '文件路径',
|
|
// hidden: true,
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'FILETYPE',
|
|
header: '文件类型',
|
|
hidden: true,
|
|
width: 120
|
|
}, {
|
|
sortable: true,
|
|
dataIndex: 'FILENAME',
|
|
header: '证件名称',
|
|
editor: {
|
|
xtype: 'textfield',
|
|
selectOnFocus: true
|
|
},
|
|
width: 160
|
|
}, {
|
|
text: "操作",
|
|
width: 130,
|
|
align: "center",
|
|
renderer: function (value, cellmeta) {
|
|
var returnStr = "<INPUT style='width:100%' type='button' value='打印'>";
|
|
return returnStr;
|
|
}
|
|
}
|
|
],
|
|
listeners: {
|
|
cellClick: function (thisTab, td, cellIndex, record, tr, rowIndex, event, eventObj) {
|
|
if (cellIndex == 6) {//设置按钮列
|
|
var path = record.data.FILEPATH;
|
|
var path2 = path.split("\\");
|
|
var curWwwPath = window.document.location.href;
|
|
var pathName = window.document.location.pathname;
|
|
var pos = curWwwPath.indexOf(pathName);
|
|
var localhostPaht = curWwwPath.substring(0, pos);
|
|
var path3 = localhostPaht + '/' + 'UploadFiles/' + 'MsDriver/' + path2[path2.length - 1];
|
|
Ext.MessageBox.confirm('提示', '确定打印此证件?', function (btn) {
|
|
if (btn == 'yes') {
|
|
// var newstr = document.getElementsByName('certimg')[0].src;
|
|
printWindow = window.open(path3);
|
|
printWindow.print();
|
|
return false;
|
|
} else {
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
layout: "border",
|
|
region: "north",
|
|
height: 255,
|
|
items: [this.panelBtn, this.formEdit]
|
|
});
|
|
|
|
this.panelBody = new Ext.Panel({
|
|
title: '附件',
|
|
layout: "border",
|
|
region: 'center',
|
|
margin: '5 10',
|
|
frame: true,
|
|
items: [this.gridList]
|
|
});
|
|
|
|
Ext.apply(this, {
|
|
items: [this.panelTop, this.panelBody]
|
|
});
|
|
|
|
parentWin = window.parent.opener;
|
|
this.InitData();
|
|
}, //end initUIComponents
|
|
|
|
InitData: function () {
|
|
this.opStatus = 'add';
|
|
var condition = '';
|
|
if (parentWin) {
|
|
var ret = parentWin.OprationSwap();
|
|
this.opStatus = ret[0];
|
|
this.StoreList = ret[1];
|
|
this.editRecord = ret[2];
|
|
}
|
|
|
|
if (this.opStatus == 'edit')
|
|
condition = " DrvCode='" + this.editRecord.get('DrvCode') + "'";
|
|
|
|
this.LoadData(this.opStatus, condition);
|
|
|
|
}, //end InitData
|
|
|
|
LoadData: function (opstatus, condition) {
|
|
this.opStatus = opstatus;
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在查询主表数据...',
|
|
url: '/TruckMng/MsWlDriver/GetData',
|
|
async: false,
|
|
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;
|
|
}
|
|
|
|
var data = result.data;
|
|
|
|
if (data.BASESALARY == "") { data.BASESALARY = "0"; }
|
|
|
|
this.formEdit.getForm().reset();
|
|
this.formEdit.getForm().setValues(data);
|
|
|
|
} else {
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
}
|
|
},
|
|
scope: this
|
|
});
|
|
|
|
var billno = '*';
|
|
if (this.opStatus == 'edit') {
|
|
billno = this.editRecord.get('DrvCode');
|
|
this.formEdit.getForm().findField('DrvCode').setDisabled(false);
|
|
}
|
|
this.storeBodyList.load({ params: { PID: billno} });
|
|
|
|
}, // end LoadDate
|
|
|
|
|
|
Save: function (type) {
|
|
if (!this.formEdit.getForm().isValid()) {
|
|
return;
|
|
}
|
|
|
|
var data = this.formEdit.getForm().getValues();
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在保存数据...',
|
|
url: '/TruckMng/MsWlDriver/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) {
|
|
var returnData = jsonresult.Data;
|
|
this.formEdit.getForm().setValues(returnData);
|
|
|
|
if (this.opStatus == 'add') {
|
|
// var p = Ext.create('MsWlDriver', returnData); // Ext.create('MsWlDriver', data, NewGuid()); //或者new MsWlDriver(data, NewGuid());
|
|
// this.storeList.add(p);
|
|
// this.editRecord = p;
|
|
|
|
var arrNewRecords = this.StoreList.add(returnData);
|
|
this.editRecord = arrNewRecords[0];
|
|
}
|
|
else if (this.opStatus == 'edit') {
|
|
var editp = Ext.create('MsWlDriver', returnData);
|
|
this.editRecord.fields.each(function (field) {
|
|
if (field.persist) {
|
|
name = field.name;
|
|
if (name != 'id')
|
|
this.editRecord.set(name, editp.get(name));
|
|
}
|
|
}, this);
|
|
this.editRecord.commit();
|
|
}
|
|
if (type == '0') {
|
|
this.opStatus = 'edit';
|
|
} else if (type == '1') {
|
|
window.close();
|
|
} else {
|
|
this.LoadData('add', '');
|
|
}
|
|
} 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
|
|
|
|
|
|
, onAddFileClick: function (button, event) {
|
|
|
|
var billno = this.formEdit.getForm().findField('DrvCode').value;
|
|
var myDate = new Date();
|
|
|
|
var record = Ext.create('MsUploadFile', {
|
|
GID: NewGuid(),
|
|
PID: '*',
|
|
UPLOADEMPLY: SHOWNAME,
|
|
UPLOADDATE: myDate,
|
|
FILETYPE: '驾驶员信息',
|
|
FILEPATH: '',
|
|
FILENAME: ''
|
|
});
|
|
|
|
this.storeBodyList.add(record);
|
|
|
|
var n = this.storeBodyList.getCount();
|
|
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 5 });
|
|
}
|
|
|
|
, onPostFileClick: function (button, event) {
|
|
|
|
var billno = this.formEdit.getForm().findField('DrvCode').value;
|
|
var bodyDatas = [];
|
|
var i;
|
|
|
|
for (i = 0; i < this.storeBodyList.getCount(); i += 1) {
|
|
var memberyf = this.storeBodyList.getAt(i);
|
|
bodyDatas.push(memberyf);
|
|
|
|
var FILENAME = memberyf.data.FILENAME;
|
|
if (FILENAME == '') {
|
|
Ext.Msg.show({ title: '警告',
|
|
msg: '文件名称不能为空',
|
|
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
};
|
|
var jsonBody = ConvertRecordsToJsonAll(bodyDatas);
|
|
|
|
|
|
_this = this;
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
Ext.Ajax.request({
|
|
waitMsg: '正在保存数据...',
|
|
url: '/TruckMng/MsWlDriver/SaveFile',
|
|
scope: this,
|
|
params: {
|
|
bsno: billno,
|
|
body: jsonBody
|
|
},
|
|
callback: function (options, success, response) {
|
|
if (success) {
|
|
Ext.MessageBox.hide();
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
if (jsonresult.Success) {
|
|
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
|
|
var member = this.storeBodyList.getAt(i);
|
|
member.set("PID", billno);
|
|
member.commit();
|
|
}
|
|
|
|
} 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
|
|
|
|
onDelFileClick: function (button, event) {
|
|
|
|
var feeGidSql = '';
|
|
var selectedRecords = [];
|
|
|
|
selectedRecords = this.GridCheckBoxModel.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.PID == "*") //如果是新增但没有保存的数据,没有必要提交到后台
|
|
{
|
|
this.storeBodyList.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: '/TruckMng/MsWlDriver/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.storeBodyList.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);
|
|
|
|
}
|
|
|
|
,
|
|
|
|
onUpLoadFileClick: function (button, event) {
|
|
var billno = this.formEdit.getForm().findField('DrvCode').value;
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
if (selections.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要上传的证件名称!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
|
|
var record = selections[0];
|
|
|
|
var PID = record.data.PID;
|
|
|
|
if (PID == '*') {
|
|
Ext.Msg.show({ title: '提示', msg: '请先保存证件,再上传!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
var GID = record.data.GID;
|
|
me = 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: 'LoadImage',
|
|
name: 'LoadImage',
|
|
emptyText: '请选择图片',
|
|
fieldLabel: '图片',
|
|
buttonText: '选择文件',
|
|
allowBlank: false,
|
|
buttonCfg:
|
|
{
|
|
iconCls: 'uploaddialog'
|
|
},
|
|
anchor: '98%'
|
|
}],
|
|
buttons: [{
|
|
text: '上传',
|
|
type: 'submit',
|
|
handler: function () {
|
|
var UserFilePath = Ext.getCmp('LoadImage').getValue();
|
|
if (!CheckFileExt(UserFilePath, /.jpg|.gif|.png|.bmp/i)) {
|
|
Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为图片文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
if (!imgform.form.isValid()) { return; }
|
|
imgform.form.submit({
|
|
url: '/TruckMng/MsWlDriver/UploadFile',
|
|
waitMsg: '正在上传',
|
|
method: 'POST',
|
|
params: {
|
|
fileGid: GID
|
|
},
|
|
success: function (form, action) {
|
|
win.close(this);
|
|
|
|
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
me.storeBodyList.load({ params: { PID: billno} });
|
|
},
|
|
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: 120,
|
|
modal: true,
|
|
resizable: false,
|
|
border: false,
|
|
items: imgform
|
|
|
|
});
|
|
win.show();
|
|
},
|
|
|
|
onPrintFileClick: function (button, event) {
|
|
|
|
|
|
|
|
selectedRecords = this.GridCheckBoxModel.selected.items;
|
|
|
|
|
|
|
|
if (selectedRecords.length == 0) {
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的证件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
return;
|
|
}
|
|
|
|
var sql1 = "";
|
|
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 != '') {
|
|
sql1 = " Select * from info_files where Gid in (" + feeGidSql + ") ";
|
|
}
|
|
|
|
var sql2 = "";
|
|
var sql3 = "";
|
|
var sql4 = "";
|
|
var sql5 = "";
|
|
var sql6 = "";
|
|
PrintComm('DriverFilePrint', sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|