|
@@ -5,8 +5,8 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
GridUtil: Ext.create('erp.util.GridUtil'),
|
|
|
BaseUtil: Ext.create('erp.util.BaseUtil'),
|
|
|
views:[
|
|
|
- 'oa.fee.feePlease','oa.fee.feePleaseFYBX','oa.fee.FeeBackGrid',
|
|
|
- 'core.form.Panel','core.grid.Panel2','core.toolbar.Toolbar',
|
|
|
+ 'oa.fee.feePlease','oa.fee.feePleaseFYBX','oa.fee.FeeBackGrid','erp.view.oa.fee.feePleaseZWSQ','oa.fee.FeeInvoGrid',
|
|
|
+ 'core.form.Panel','core.grid.Panel2','core.toolbar.Toolbar','erp.view.oa.fee.FeeInvotoolbar',
|
|
|
'core.form.MultiField','core.form.FileField','core.form.SeparNumber',
|
|
|
'core.form.DateHourMinuteField','core.form.ConDateHourMinuteField','core.form.CheckBoxGroup','core.form.DateHourMinuteComboField',
|
|
|
'core.button.Scan','core.button.Save','core.button.Add','core.button.Submit','core.button.Print','core.button.Upload','core.button.ResAudit',
|
|
@@ -40,6 +40,9 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
'FeeBackGrid': {
|
|
|
itemclick: this.onGridItemClick2
|
|
|
},
|
|
|
+ 'FeeInvoGrid': {
|
|
|
+ itemclick: this.onGridItemClick3
|
|
|
+ },
|
|
|
'erpFormPanel' : {
|
|
|
afterload : function(form) {
|
|
|
this.hidecolumns(true);
|
|
@@ -175,7 +178,9 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
},
|
|
|
'erpAddButton': {
|
|
|
click: function(btn){
|
|
|
- if(caller!='FeePlease!FYBX'){
|
|
|
+ if(caller=='FeePlease!ZWSQ'){
|
|
|
+ me.FormUtil.onAdd('add' + caller, '新增单据', "jsps/oa/fee/feePleaseZWSQ.jsp?whoami=" + caller);
|
|
|
+ }else if(caller!='FeePlease!FYBX'){
|
|
|
me.FormUtil.onAdd('add' + caller, '新增单据', "jsps/oa/fee/feePlease.jsp?whoami=" + caller);
|
|
|
}else{
|
|
|
me.FormUtil.onAdd('add' + caller, '新增费用申请', "jsps/oa/fee/feePleaseFYBX.jsp?whoami=" + caller);
|
|
@@ -1245,6 +1250,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
var detail = Ext.getCmp('grid');
|
|
|
var detail2 = Ext.getCmp('FeeBackGrid');
|
|
|
+ var detail3 = Ext.getCmp('FeeInvoGrid');
|
|
|
Ext.each(detail.store.data.items, function(item){
|
|
|
if(item.data.vd_id == null || item.data.vd_id == 0){
|
|
|
item.data.vd_id = -item.index;
|
|
@@ -1260,6 +1266,11 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}else{
|
|
|
param.push(new Array());
|
|
|
}
|
|
|
+ if(detail3) {
|
|
|
+ param.push(me.GridUtil.getGridStore(detail3));
|
|
|
+ }else{
|
|
|
+ param.push(new Array());
|
|
|
+ }
|
|
|
//lidy 2017110394 费用报销单保存时添加提示 明细表必填字段未完成填写
|
|
|
var errInfo = new Array();
|
|
|
if(caller!='FeePlease!ZWSQ'){
|
|
@@ -1284,6 +1295,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
param[0] = param[0] == null ? [] : "[" + param[0].toString().replace(/\\/g,"%") + "]";
|
|
|
param[1] = param[1] == null ? [] : "[" + param[1].toString().replace(/\\/g,"%") + "]";
|
|
|
+ param[2] = param[2] == null ? [] : "[" + param[2].toString().replace(/\\/g,"%") + "]";
|
|
|
if(errInfo.length>0){
|
|
|
warnMsg(errInfo, function(btn){
|
|
|
if(btn == 'yes'){
|
|
@@ -1309,7 +1321,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
});
|
|
|
var r = form.getValues();
|
|
|
- me.save(r, param[0], param[1]);
|
|
|
+ me.save(r, param[0], param[1], param[2]);
|
|
|
}else{
|
|
|
me.FormUtil.checkForm();
|
|
|
}
|
|
@@ -1339,6 +1351,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
params.formStore = unescape(Ext.JSON.encode(r).replace(/\\/g,"%"));
|
|
|
params.param = unescape(arguments[1].toString().replace(/\\/g,"%"));
|
|
|
params.param2 = unescape(arguments[2].toString().replace(/\\/g,"%"));
|
|
|
+ params.param3 = unescape(arguments[3].toString().replace(/\\/g,"%"));
|
|
|
params.caller=caller;
|
|
|
/*for(var i=2; i<arguments.length; i++) { //兼容多参数
|
|
|
params['param' + i] = unescape(arguments[i].toString().replace(/\\/g,"%"));
|
|
@@ -1417,6 +1430,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
var detail = Ext.getCmp('grid');
|
|
|
var detail2 = Ext.getCmp('FeeBackGrid');
|
|
|
+ var detail3 = Ext.getCmp('FeeInvoGrid');
|
|
|
Ext.each(detail.store.data.items, function(item){
|
|
|
if(item.data.vd_id == null || item.data.vd_id == 0){
|
|
|
item.data.vd_id = -item.index;
|
|
@@ -1432,6 +1446,11 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}else{
|
|
|
param.push(new Array());
|
|
|
}
|
|
|
+ if(detail3) {
|
|
|
+ param.push(me.GridUtil.getGridStore(detail3));
|
|
|
+ }else{
|
|
|
+ param.push(new Array());
|
|
|
+ }
|
|
|
//lidy 2017110394 费用报销单保存时添加提示 明细表必填字段未完成填写
|
|
|
var errInfo = new Array();
|
|
|
for(var i = 0 ; i < grids.length ; i ++){
|
|
@@ -1453,6 +1472,8 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
param[0] = param[0] == null ? [] : "[" + param[0].toString().replace(/\\/g,"%") + "]";
|
|
|
param[1] = param[1] == null ? [] : "[" + param[1].toString().replace(/\\/g,"%") + "]";
|
|
|
+ param[2] = param[2] == null ? [] : "[" + param[2].toString().replace(/\\/g,"%") + "]";
|
|
|
+
|
|
|
if(errInfo.length>0){
|
|
|
warnMsg(errInfo, function(btn){
|
|
|
if(btn == 'yes' || btn == 'ok'){
|
|
@@ -1478,7 +1499,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
}
|
|
|
});
|
|
|
var r = form.getValues();
|
|
|
- me.update(r, param[0], param[1]);
|
|
|
+ me.update(r, param[0], param[1], param[2]);
|
|
|
}else{
|
|
|
me.FormUtil.checkForm();
|
|
|
}
|
|
@@ -1508,6 +1529,7 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
params.formStore = unescape(Ext.JSON.encode(r).replace(/\\/g,"%"));
|
|
|
params.param = unescape(arguments[1].toString().replace(/\\/g,"%"));
|
|
|
params.param2 = unescape(arguments[2].toString().replace(/\\/g,"%"));
|
|
|
+ params.param3 = unescape(arguments[3].toString().replace(/\\/g,"%"));
|
|
|
params.caller=caller;
|
|
|
var me = this;
|
|
|
var form = Ext.getCmp('form');
|
|
@@ -1583,6 +1605,10 @@ Ext.define('erp.controller.oa.fee.feePlease', {
|
|
|
this.onGridItemClick(selModel,record,'FeeBackGrid');
|
|
|
|
|
|
},
|
|
|
+ onGridItemClick3: function(selModel,record){
|
|
|
+ this.onGridItemClick(selModel,record,'FeeInvoGrid');
|
|
|
+
|
|
|
+ },
|
|
|
hidecolumns: function(isNoClean){
|
|
|
if(caller=='FeePlease!CLFBX'){
|
|
|
var source = Ext.getCmp('fp_sourcekind').value;
|