tbar: [
'<fontstyle="line-height:25px;color:blue;">任務類型:</font>',
OrderType,
'-',
'<fontstyle="line-height:25px;color:blue;">當前批次號:</font>',
new Ext.form.TextField({
id: 'txtBatchNumber',
width: 150,
readOnly: true,
style: 'top:1px;'
}),
new Ext.Button({
id: 'btnGetBatchNumber',
//text: '生成批次號',
tooltip: '<fontstyle="color:Red;line-height:25px;">重新生成一個新的批次號</font>',
//minWidth: 100,
iconCls: 'SalaryStructure_BatchNum',
handler: function () {
GetTheBatchNumber();
}
}),
'-', '<fontstyle="line-height:25px;color:blue;">僱員操作:</font>',
{
id: 'btnAddEmployee',
text: '手工添加僱員',
tooltip: '<fontstyle="color:green;line-height:25px;">從每間公司的僱員列表中,<br />選中至少一名僱員,<br />添加到薪酬計算名單中!</font>',
iconCls: 'SalaryStructure_Add',
disabled: true,
handler: function () {
var AddWin = new Ext.Window({
title: '添加工資/計稅任務僱員',
id: 'AddWindow',
width: 750,
height: 300,
closable: true,
modal: true,
closeAction: 'close',
layout: 'fit',
html: "<iframe id='EmployeeAddiFrame'src='EmployeeAddTemplate' style='width:100%; height:100%;'frameborder='0'></iframe>",
buttons: [
{
text: '確定',
iconCls: 'SalaryStructure_Success',
handler: function () {
//取數
var emStore = window.document.getElementById("EmployeeAddiFrame").contentWindow.GetData();
if (emStore.length > 0) {
AddDataToGridStore(emStore);
AddBatchNumberToGridStore();
Ext.getCmp("btnBlongMonth").enable();
Ext.getCmp("btnCalcuteDate").enable();
Ext.getCmp("btnUploadFile").enable();
Ext.getCmp("txtTemplateName").enable();
Ext.getCmp("txtCount").setValue(emStore.length);
}
else {
Ext.getCmp("btnBlongMonth").disable();
Ext.getCmp("btnCalcuteDate").disable();
Ext.getCmp("btnUploadFile").disable();
Ext.getCmp("txtTemplateName").disable();
Ext.getCmp("txtCount").setValue("0");
}
AddWin.close();
}
}
]
});
AddWin.show();
AddWin.setSize(750, 300);
}
}, {
id: 'btnImportExcel',
text: '通過Excel導入僱員',
tooltip: '<fontstyle="color:green;line-height:25px;">通過Excel導入大批量的僱員名單,<br />導入模版可以從右側菜單的<br /><b>[薪酬服務部]->[工資模版管理]</b>中下載</font>',
iconCls: 'SalaryStructure_Leading-in',
handler: function () {
var BatchAddWin = new Ext.Window({
closeAction: 'close',
modal: true,
id: 'BatchAddWindow',
width: 650,
height: 300,
closable: true,
layout: 'fit',
html: '<iframeid=\'BatchEmployeeAddiFrame\' src=\'BatchEmployeeAddTemplate\'style=\'width:100%; height:100%;\' frameborder=\'0\'></iframe>'
});
BatchAddWin.show();
}
},
'-',
DeleteOneEmployee,
'-',
ClearAllData
]
bbar: [
'<fontstyle="line-height:25px;color:red;">總共</font>',
newExt.form.TextField({ cls: 'textwidth', id: 'txtCount',style: 'margin-left:5px;margin-right:5px; top:0px;',readOnly: true }),
new Ext.form.Label({ text: '條', cls: 'labelcolor' }),
'-',
'<fontstyle="line-height:25px;color:blue;">參數指定:</font>',
'<fontstyle="line-height:25px;">所屬月份:</font>',
new Ext.form.CustomDateField({ id:'btnBlongMonth', width: 90, format: 'Y-m', emptyText: '請指定月份', disabled: true, selectOnFocus: true,
setValueFn: function (value) {
AddBelongMonthToGridStore(value);
}
}),
'<fontstyle="line-height:25px;margin-left:10px;">計算日期:</font>',
new Ext.form.CustomDateField({ id:'btnCalcuteDate', width: 100, format: 'Y-m-d', emptyText: '請指定日期', disabled: true, selectOnFocus: true,
setValueFn: function (value) {
AddCalcuteDateToGridStore(value);
}
}),
{
text: '上傳統一附件',
id: 'btnUploadFile',
tooltip: '<fontstyle="color:blue;line-height:25px;">上傳當前批次下所有僱員計算薪酬與稅費需要的附件,<br />請先在薪酬計算名單中鉤選使用相同附件的僱員,<br />如僱員沒有附件,可不指定!</font>',
iconCls: 'SalaryStructure_Upload',
style: 'margin-left:10px;margin-right:10px;',
disabled: true,
handler: function () {
var winUpload = new Ext.Window({
title: '上傳統一附件',
id: 'winUpload', width: 500, height: 300, closable: true,
resizable: true, minimizable: true, maximizable: true,
closeAction: 'close',
layout: 'fit',
html: '<iframe src=\'UploadUniteFile\'style=\'width:100%; height:100%;\' frameborder=\'0\'></iframe>',
listeners: {
'beforeclose': function(p) {
GetTheSelectedData();
}
}
});
winUpload.show();
}
},
'指定模版:',
TemplateSearchBox,
'-',
'<fontstyle="line-height:25px;color:blue;">任務操作:</font>',
newExt.Button({
text: '校驗數據',
iconCls: 'SalaryStructure_Check',
handler: function () {
var Flag = 1;
var ErrText = "";
//1:有無數據
if(store.getCount() == 0) { Flag *= 0; ErrText += "◆還沒有添加僱員到薪酬計算名單中;<br />"; }
//2:是否指定所屬月份
if (Ext.getCmp("btnBlongMonth").getRawValue()== "") { Flag *= 0; ErrText += "◆還沒有指定“所屬月份”;<br />"; }
//3:是否指定計算日期
if (Ext.getCmp("btnCalcuteDate").getRawValue()== "") { Flag *= 0; ErrText += "◆還沒有指定“計算日期”;<br />"; }
//4:是否指定了工資模板
if (Ext.get("txtTemplateID").dom.value == "") { Flag *= 0;ErrText += "◆還沒有選擇工資模板;<br />"; }
if (Flag == 1) {
//第一步校驗OK
Ext.MessageBox.show({
title: '提示',
msg: '<fontstyle="color:red;line-height:25px;">你指定當前批次的用於計算薪酬的模板爲:<b>[' + Ext.getCmp("txtTemplateName").getRawValue() + ']</b><br />如果正確,請點擊[是];<br />不正確,請點擊[否]!</font>',
buttons:Ext.MessageBox.YESNO,
fn: function (result) {
if (result == 'yes') {
CheckDataForReady();
}
}
});
}
else {
Ext.MessageBox.alert("注意", "<fontstyle='color:red;line-height:25px;'>" + ErrText + "</font>");
}
}
}),
newExt.Button({
id: 'btnStarMission',
text: '發起任務',
iconCls: 'SalaryStructure_Next',
disabled: true,
style: 'text:-align:right; float:right;',
handler:function(){
StarMission();
}
})
]