Przeglądaj źródła

2024080151
费用报销单、总务付款申请单、差旅费报销单,增加费用发票明细从表

zxl 2 tygodni temu
rodzic
commit
46945da053

+ 31 - 5
WebContent/app/controller/oa/fee/feePlease.js

@@ -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;

+ 149 - 0
WebContent/app/view/oa/fee/FeeInvoGrid.js

@@ -0,0 +1,149 @@
+Ext.define('erp.view.oa.fee.FeeInvoGrid',{
+	extend:'Ext.grid.Panel',
+	alias:'widget.FeeInvoGrid',
+	requires:['erp.view.oa.fee.FeeInvotoolbar'],
+	layout:'fit',
+	id:'FeeInvoGrid',
+	emptyText : $I18N.common.grid.emptyText,
+	columnLines : true,
+	autoScroll : true,
+	detno:'fid_detno',
+	keyField:'fid_id',
+	mainField:'fid_fpid',
+	caller:'FeeInvo',
+	columns:[],
+	bodyStyle:'bachgroud-color:#f1f1f1;',
+	plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
+		clicksToEdit: 1,
+		listeners: {
+			beforeedit: function (e) {
+				var g = e.grid, r = e.record, f = e.field;
+				if (g.binds) {
+					var bool = true;
+					Ext.Array.each(g.binds, function (item) {
+						if (Ext.Array.contains(item.fields, f)) {
+							Ext.each(item.refFields, function (field) {
+								if (r.get(field) != null && r.get(field) != 0 && r.get(field) != '' && r.get(field) != '0') {
+									bool = false;
+								}
+							});
+						}
+					});
+					return bool;
+				}
+			}
+		}
+
+	}), Ext.create('erp.view.core.plugin.CopyPasteMenu')],
+	features: [Ext.create('Ext.grid.feature.Grouping', {
+		showSummaryRow: true,
+		startCollapsed: false,
+		groupHeaderTpl: '{name} (共:{rows.length}条)'
+	}), {
+		ftype: 'summary',
+		showSummaryRow: false,//不显示默认合计行
+		generateSummaryData: function () {
+			// 避开在grid reconfigure后的计算,节约加载时间50~600ms
+			return {};
+		}
+	}],
+	/*plugins:Ext.create('Ext.grid.plugin.CellEditing',{
+        clicksToEdit:1
+    }),*/
+	bbar:{
+		xtype: 'FeeInvotoolbar',
+		id:'FeeInvotoolbar'
+	},
+	test:0,
+	GridUtil:Ext.create('erp.util.GridUtil'),
+	BaseUtil:Ext.create('erp.util.BaseUtil'),
+	initComponent:function(){
+		this.callParent(arguments);
+//		console.log(urlCondition);
+		//得到页面上显示的formCondition属性
+		var urlCondition = this.BaseUtil.getUrlParam('formCondition');
+		//定义通过IS拆分后的数值
+		var cons=null;
+		//存在urlCondition的情况下
+		if(urlCondition){
+			//对urlCondition进行拆分  urlCondition的格式一半为pp_idIS1
+			urlCondition=urlCondition.replace(/'/g,'');
+			if(urlCondition.indexOf('IS')>-1){
+				cons = urlCondition.split("IS");
+			}else if(urlCondition.indexOf('=')>-1){
+				cons = urlCondition.split("=");
+			}
+		}
+		var pp_id=0;
+		if(cons!=null){
+			if(cons[0]&&cons[1]){
+				if(cons[0]!=null&&cons[0]!=''){
+					if(cons[1]-0>0){
+						pp_id=cons[1];
+					}else{
+						pp_id=0;
+					}
+				}
+
+			}
+		}
+		var condition = " fid_fpid='"+pp_id+"'";
+//		console.log(condition);
+		//ERP查看单据禁用grid按钮	hey
+		var _noBbar = getUrlParam('_noBbar');
+		if(_noBbar){
+			this.bbar=[];
+			this.allowExtraButtons=false;
+		}
+		if(!this.boxready) {
+			if(this.allowExtraButtons)// 加载其它按钮
+				this.on('reconfigure', this.loadExtraButton, this, {single: true, delay: 1000});
+			this.on('summary', this.generateSummaryData, this, {single: true, delay: 1000});
+		}
+		this.getMyData(condition);
+
+	},
+	getMyData:function(condition){
+//		console.log(condition);
+		var me = this;
+		var params = {
+			caller:"FeeInvo",
+			condition:condition
+		};
+		me.gridExportCondition =condition;
+		if(me.columns && me.columns.length > 2){
+			me.GridUtil.loadNewStore(me,params);
+		} else {
+			me.GridUtil.getGridColumnsAndStore(me,'common/singleGridPanel.action',params);
+		}
+		this.fireEvent("summary", this);
+	},
+	generateSummaryData : function() {
+		var store = this.store,
+			columns = this.columns, s = this.features[this.features.length - 1],
+			i = 0, length = columns.length, comp, bar = this.down('FeeInvotoolbar');
+		if (!bar) return;
+		var limitArr=this.limitArr;
+		//将feature的data打印在toolbar上面
+		for (; i < length; i++ ) {
+			comp = columns[i];
+			if((limitArr.length == 0 || !Ext.Array.contains(limitArr, comp.dataIndex))&&comp.summaryType) {
+				var tb = Ext.getCmp(comp.dataIndex + '_' + comp.summaryType);
+				if(!tb){
+					bar.add('-');
+					tb = bar.add({
+						id: bar.id+comp.dataIndex + '_' + comp.summaryType,
+						itemId: comp.dataIndex,
+						xtype: 'tbtext'
+					});
+				}
+
+				var val = s.getSummary(store, comp.summaryType, comp.dataIndex, false);
+				if(comp.xtype == 'numbercolumn') {
+					val = Ext.util.Format.number(val, (comp.format || '0,000.000'));
+				}
+				tb.setText(comp.text + ':' + val);
+			}
+		}
+	}
+});

+ 40 - 0
WebContent/app/view/oa/fee/FeeInvotoolbar.js

@@ -0,0 +1,40 @@
+/**
+ * 此toolbar用于明细表grid
+ */
+Ext.define('erp.view.oa.fee.FeeInvotoolbar', {
+	extend : 'Ext.Toolbar',
+	alias : 'widget.FeeInvotoolbar',
+	dock : 'bottom',
+	requires : [ 'erp.view.core.button.AddDetail', 'erp.view.core.button.DeleteDetail', 'erp.view.core.button.Copy',
+		'erp.view.core.button.Paste', 'erp.view.core.button.Up', 'erp.view.core.button.Down',
+		'erp.view.core.button.UpExcel' ],
+	initComponent : function() {
+		Ext.apply(this, {// default buttons
+			items : [ {
+				xtype : 'tbtext',
+				id : 'InDrow'
+			}, '-', {
+				xtype : 'erpAddDetailButton',
+				id : 'InaddDetail'
+			}, '-', {
+				xtype : 'erpDeleteDetailButton',
+				id : 'IndeleteDetail'
+			}, '-', {
+				xtype : 'copydetail',
+				id : 'IncopyDetail'
+			}, '-', {
+				xtype : 'pastedetail',
+				id : 'InpasteDetail'
+			}, '-', {
+				xtype : 'updetail',
+				id : 'InupDetail'
+			}, '-', {
+				xtype : 'downdetail',
+				id : 'IndownDetail'
+			}, '-' , {
+				xtype: 'erpExportDetailButton'
+			}, '-'  ]
+		});
+		this.callParent(arguments);
+	}
+});

+ 20 - 0
WebContent/app/view/oa/fee/feePlease.js

@@ -80,6 +80,16 @@ Ext.define('erp.view.oa.fee.feePlease',{
 				anchor : '100% 30%',
 				necessaryField: 'fb_jksqcode',
 				detno: 'fb_detno'
+			},{
+				id: 'FeeInvoGrid',
+				title:'费用发票明细',
+				_noc:1,
+				xtype: 'FeeInvoGrid',
+				keyField: 'fid_id',
+				mainField: 'fid_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				detno: 'fid_detno'
 			}]
 		}];
 		var items2 = [{
@@ -163,6 +173,16 @@ Ext.define('erp.view.oa.fee.feePlease',{
 				allowExtraButtons: true,
 				anchor : '100% 30%',
 				title:'费用报销明细'
+			},{
+				id: 'FeeInvoGrid',
+				title:'费用发票明细',
+				_noc:1,
+				xtype: 'FeeInvoGrid',
+				keyField: 'fid_id',
+				mainField: 'fid_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				detno: 'fid_detno'
 			},{
 				id: 'FeeBackGrid',
 				title:'还款明细',

+ 9 - 1
WebContent/app/view/oa/fee/feePleaseFYBX.js

@@ -43,7 +43,15 @@ Ext.define('erp.view.oa.fee.feePleaseFYBX',{
 				    mainField: 'fb_fpid',
 					necessaryField: 'fb_jksqcode',
 					detno: 'fb_detno'
-				}]
+				},{
+                    xtype: 'FeeInvoGrid',
+                    id: 'FeeInvoGrid',
+                    detno: 'fid_detno',
+                    keyField: 'fid_id',
+                    mainField: 'fid_fpid',
+                    allowExtraButtons: true,
+                    title:'费用发票明细'
+                }]
 			}]
 		}); 
 		me.callParent(arguments); 

+ 215 - 0
WebContent/app/view/oa/fee/feePleaseZWSQ.js

@@ -0,0 +1,215 @@
+Ext.define('erp.view.oa.fee.feePleaseZWSQ',{
+	extend: 'Ext.Viewport',
+	layout: 'anchor',
+	hideBorders: true,
+	initComponent : function(){
+		var me = this;
+		var hiddengrid1 = false;
+		if (caller=='FeePlease!ZWSQ'){
+			hiddengrid1 = true;
+		}
+		var hiddengrid2 = false;
+		var callback = false;
+		Ext.Ajax.request({
+			url : basePath + 'ma/setting/config.action?caller=' + caller + '&code=supportRepayment',
+			method : 'GET',
+			async:false,
+			callback : function(opt, s, res){
+				var val = null;
+				if(res && res.responseText){
+					var r = new Ext.decode(res.responseText);
+					if(r && r.exceptionInfo){
+						showError(r.exceptionInfo);return;
+					} else {
+						val = r.data;
+						if(val) {
+							switch(r.data_type) {
+								case 'YN':
+									val = val == '1';break;
+								case 'NUMBER':
+									val = Number(val);break;
+							}
+							if(r.multi == 1)
+								val = val.split('\n');
+						}
+					}
+				}
+				callback = !val;
+			}
+		});
+		if (caller=='FeePlease!ZWSQ'){
+			hiddengrid2 = callback;
+		}
+		var items1 = [{
+			xtype: 'erpFormPanel',
+			anchor: '100% 65%',
+			saveUrl: 'oa/fee/saveFeePlease.action',
+			deleteUrl: 'oa/fee/deleteFeePlease.action',
+			updateUrl: 'oa/fee/updateFeePlease.action',
+			auditUrl: 'oa/fee/auditFeePlease.action',
+			printUrl: 'oa/fee/printFeePlease.action',
+			confirmUrl:'oa/fee/confirmFeePlease.action',
+			resAuditUrl: 'oa/fee/resAuditFeePlease.action',
+			submitUrl: 'oa/fee/submitFeePlease.action',
+			resSubmitUrl: 'oa/fee/resSubmitFeePlease.action',
+			endUrl: 'oa/fee/endFeePlease.action',
+			resEndUrl: 'oa/fee/resEndFeePlease.action',
+			getIdUrl: 'common/getId.action?seq=FEEPLEASE_SEQ',
+			keyField: 'fp_id',
+			codeField: 'fp_code',
+			statusField: 'fp_status',
+			statuscodeField: 'fp_statuscode'
+		},{
+			xtype:'tabpanel',
+			anchor: '100% 35%',
+			items:[{
+				xtype: 'erpGridPanel2',
+				detno: 'fpd_detno',
+				keyField: 'fpd_id',
+				mainField: 'fpd_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				title:'费用报销明细'
+			},{
+				id: 'FeeBackGrid',
+				title:'还款明细',
+				_noc:1,
+				xtype: 'FeeBackGrid',
+				keyField: 'fb_id',
+				mainField: 'fb_fpid',
+				anchor : '100% 30%',
+				necessaryField: 'fb_jksqcode',
+				detno: 'fb_detno'
+			},{
+				id: 'FeeInvoGrid',
+				title:'费用发票明细',
+				_noc:1,
+				xtype: 'FeeInvoGrid',
+				keyField: 'fid_id',
+				mainField: 'fid_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				detno: 'fid_detno'
+			}]
+		}];
+		var items2 = [{
+			xtype: 'erpFormPanel',
+			anchor: '100% 100%',
+			saveUrl: 'oa/fee/saveFeePlease.action',
+			deleteUrl: 'oa/fee/deleteFeePlease.action',
+			updateUrl: 'oa/fee/updateFeePlease.action',
+			auditUrl: 'oa/fee/auditFeePlease.action',
+			printUrl: 'oa/fee/printFeePlease.action',
+			confirmUrl:'oa/fee/confirmFeePlease.action',
+			resAuditUrl: 'oa/fee/resAuditFeePlease.action',
+			submitUrl: 'oa/fee/submitFeePlease.action',
+			resSubmitUrl: 'oa/fee/resSubmitFeePlease.action',
+			endUrl: 'oa/fee/endFeePlease.action',
+			resEndUrl: 'oa/fee/resEndFeePlease.action',
+			getIdUrl: 'common/getId.action?seq=FEEPLEASE_SEQ',
+			keyField: 'fp_id',
+			codeField: 'fp_code',
+			statusField: 'fp_status',
+			statuscodeField: 'fp_statuscode'
+		},{
+			xtype:'tabpanel',
+			anchor: '100% 0%',
+			ignore:true,
+			hidden:true,
+			items:[{
+				xtype: 'erpGridPanel2',
+				detno: 'fpd_detno',
+				keyField: 'fpd_id',
+				mainField: 'fpd_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 0%',
+				title:'费用报销明细'
+			},{
+				id: 'FeeBackGrid',
+				title:'还款明细',
+				_noc:1,
+				xtype: 'FeeBackGrid',
+				keyField: 'fb_id',
+				mainField: 'fb_fpid',
+				anchor : '100% 0%',
+				necessaryField: 'fb_jksqcode',
+				detno: 'fb_detno'
+			},{
+				id: 'FeeInvoGrid',
+				title:'费用发票明细',
+				_noc:1,
+				xtype: 'FeeInvoGrid',
+				keyField: 'fid_id',
+				mainField: 'fid_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				detno: 'fid_detno'
+			}]
+		}];
+		var items3 = [{
+			xtype: 'erpFormPanel',
+			anchor: '100% 65%',
+			saveUrl: 'oa/fee/saveFeePlease.action',
+			deleteUrl: 'oa/fee/deleteFeePlease.action',
+			updateUrl: 'oa/fee/updateFeePlease.action',
+			auditUrl: 'oa/fee/auditFeePlease.action',
+			printUrl: 'oa/fee/printFeePlease.action',
+			confirmUrl:'oa/fee/confirmFeePlease.action',
+			resAuditUrl: 'oa/fee/resAuditFeePlease.action',
+			submitUrl: 'oa/fee/submitFeePlease.action',
+			resSubmitUrl: 'oa/fee/resSubmitFeePlease.action',
+			endUrl: 'oa/fee/endFeePlease.action',
+			resEndUrl: 'oa/fee/resEndFeePlease.action',
+			getIdUrl: 'common/getId.action?seq=FEEPLEASE_SEQ',
+			keyField: 'fp_id',
+			codeField: 'fp_code',
+			statusField: 'fp_status',
+			statuscodeField: 'fp_statuscode'
+		},{
+			xtype:'tabpanel',
+			anchor: '100% 35%',
+			listeners:{
+				afterrender:function(p){
+					p.setActiveTab((hiddengrid2?0:1));
+				}
+			},
+			items:[{
+				xtype: 'erpGridPanel2',
+				detno: 'fpd_detno',
+				keyField: 'fpd_id',
+				mainField: 'fpd_fpid',
+				ignore:hiddengrid1,
+				hidden:hiddengrid1,
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				title:'费用报销明细'
+			},{
+				id: 'FeeBackGrid',
+				title:'还款明细',
+				_noc:1,
+				xtype: 'FeeBackGrid',
+				keyField: 'fb_id',
+				mainField: 'fb_fpid',
+				anchor : '100% 30%',
+				ignore:hiddengrid2,
+				hidden:hiddengrid2,
+				necessaryField: 'fb_jksqcode',
+				detno: 'fb_detno'
+			},{
+				id: 'FeeInvoGrid',
+				title:'费用发票明细',
+				_noc:1,
+				xtype: 'FeeInvoGrid',
+				keyField: 'fid_id',
+				mainField: 'fid_fpid',
+				allowExtraButtons: true,
+				anchor : '100% 30%',
+				detno: 'fid_detno'
+			}]
+		}];
+		Ext.apply(me, {
+			items: hiddengrid1?(hiddengrid2?items2:items3):items1
+		});
+		me.callParent(arguments);
+	}
+});

+ 42 - 0
WebContent/jsps/oa/fee/feePleaseZWSQ.jsp

@@ -0,0 +1,42 @@
+<%@ page language="java" contentType="text/html; charset=utf-8"
+    pageEncoding="utf-8"%>
+<%
+String path = request.getContextPath();
+String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css" type="text/css"></link>
+<!--[if IE]>
+	<link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-ie-scoped.css" type="text/css"></link>
+<![endif]-->
+<link rel="stylesheet" href="<%=basePath %>resource/css/main.css" type="text/css"></link>
+<script type="text/javascript" src="<%=basePath %>resource/ext/ext-all.js"></script>
+<script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
+<script type="text/javascript">	
+Ext.Loader.setConfig({
+	enabled: true
+});//开启动态加载
+Ext.application({
+    name: 'erp',//为应用程序起一个名字,相当于命名空间
+    appFolder: basePath+'app',//app文件夹所在路径
+    controllers: [//声明所用到的控制层
+        'oa.fee.feePlease'
+    ],
+    launch: function() {
+    	Ext.create('erp.view.oa.fee.feePleaseZWSQ');//创建视图
+    }
+});
+var caller ="${param.whoami}";
+caller = caller.replace(/'/g, "");
+var formCondition = '';
+var gridCondition = '';
+
+
+</script>
+</head>
+<body >
+</body>
+</html>

+ 4 - 4
src/com/uas/erp/controller/oa/FeePleaseController.java

@@ -31,9 +31,9 @@ public class FeePleaseController {
 	 */
 	@RequestMapping("/oa/fee/saveFeePlease.action")
 	@ResponseBody
-	public Map<String, Object> save(HttpServletRequest request, String formStore, String param, String param2, String caller) {
+	public Map<String, Object> save(HttpServletRequest request, String formStore, String param, String param2, String param3, String caller) {
 		Map<String, Object> modelMap = new HashMap<String, Object>();
-		modelMap.put("fpd_data", feePleaseService.saveFeePlease(formStore, param, param2, caller));
+		modelMap.put("fpd_data", feePleaseService.saveFeePlease(formStore, param, param2,param3, caller));
 		modelMap.put("success", true);
 		modelMap.put("sessionId", request.getSession().getId());
 		return modelMap;
@@ -44,9 +44,9 @@ public class FeePleaseController {
 	 */
 	@RequestMapping("/oa/fee/updateFeePlease.action")
 	@ResponseBody
-	public Map<String, Object> update(HttpServletRequest request, String formStore, String param, String param2, String caller) {
+	public Map<String, Object> update(HttpServletRequest request, String formStore, String param, String param2, String param3, String caller) {
 		Map<String, Object> modelMap = new HashMap<String, Object>();
-		modelMap.put("fpd_data", feePleaseService.updateFeePlease(formStore, param, param2, caller));
+		modelMap.put("fpd_data", feePleaseService.updateFeePlease(formStore, param, param2,param3, caller));
 		modelMap.put("success", true);
 		modelMap.put("sessionId", request.getSession().getId());
 		return modelMap;

+ 2 - 2
src/com/uas/erp/service/oa/FeePleaseService.java

@@ -9,9 +9,9 @@ import com.uas.erp.model.Employee;
 import com.uas.erp.model.JSONTree;
 
 public interface FeePleaseService {
-	Object saveFeePlease(String formStore, String gridStore, String gridStore2, String caller);
+	Object saveFeePlease(String formStore, String gridStore, String gridStore2, String gridStore3,String caller);
 
-	Object updateFeePlease(String formStore, String gridStore, String gridStore2, String caller);
+	Object updateFeePlease(String formStore, String gridStore, String gridStore2, String gridStore3, String caller);
 
 	void deleteFeePlease(int fp_id, String caller);
 

+ 46 - 2
src/com/uas/erp/service/oa/impl/FeePleaseServiceImpl.java

@@ -54,7 +54,7 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 	private AccountRegisterBankService accountRegisterBankService;
 
 	@Override
-	public Object saveFeePlease(String formStore, String gridStore, String gridStore2, String caller) {
+	public Object saveFeePlease(String formStore, String gridStore, String gridStore2,String gridStore3,String caller) {
 		Map<Object, Object> store = BaseUtil.parseFormStoreToMap(formStore);
 		List<Map<Object, Object>> grid = BaseUtil.parseGridStoreToMaps(gridStore);
 		if ("FeePlease!CCSQ!new".equals(caller)) {
@@ -186,6 +186,24 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 				BaseUtil.showError(listError.toString());
 			}
 		}
+		if(gridStore3!= null){
+			List<Map<Object, Object>> grid3 = BaseUtil.parseGridStoreToMaps(gridStore3);
+			for (Map<Object, Object> map : grid3) {
+				map.put("fid_id", baseDao.getSeqId("FEEINVODETAIL_SEQ"));
+			}
+			List<String> gridSql3 = SqlUtil.getInsertSqlbyGridStore(grid3, "FEEINVODETAIL");
+			//insert with check
+			String err = baseDao
+					.executeWithCheck(
+							gridSql3,
+							null,"select LOB_CONCAT(FID_INVOICECODE) from (" +
+									" select  FID_INVOICECODE from FEEINVODETAIL where nvl(FID_INVOICECODE,' ')<>' '" +
+									" and FID_INVOICECODE in (select FID_INVOICECODE from FEEINVODETAIL  where nvl(FID_INVOICECODE,' ')<>' '  and fid_fpid="+store.get("fp_id")+") " +
+									" group by FID_INVOICECODE having count(1)>1) where rownum<=5");
+			if (err != null){
+				BaseUtil.showError("发票号重复:<br>"+err);
+			}
+		}
 		// 执行保存操作
 		String formSql = SqlUtil.getInsertSqlByFormStore(store, "FeePlease", new String[] {}, new Object[] {});
 		baseDao.execute(formSql);
@@ -301,7 +319,7 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 	}
 
 	@Override
-	public Object updateFeePlease(String formStore, String gridStore, String gridStore2, String caller) {
+	public Object updateFeePlease(String formStore, String gridStore, String gridStore2, String gridStore3, String caller) {
 		Map<Object, Object> store = BaseUtil.parseFormStoreToMap(formStore);
 		List<Map<Object, Object>> gstore = BaseUtil.parseGridStoreToMaps(gridStore);
 		// 只能更新在录入的单据!
@@ -481,6 +499,30 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 				BaseUtil.showError(listError.toString());
 			}
 		}
+		// 更新费用发票明细
+		if(gridStore3!= null){
+			List<String> gridSql3 = SqlUtil.getUpdateSqlbyGridStore(gridStore3, "FEEINVODETAIL", "fid_id");
+			List<Map<Object, Object>> grid3 = BaseUtil.parseGridStoreToMaps(gridStore3);
+			for (Map<Object, Object> s : grid3) {
+				if (s.get("fid_id") == null || s.get("fid_id").equals("") || s.get("fid_id").equals("0")
+						|| Integer.parseInt(s.get("fid_id").toString()) == 0) {// 新添加的数据,id不存在
+					int fid_id = baseDao.getSeqId("FEEINVODETAIL_SEQ");
+					String sql = SqlUtil.getInsertSqlByMap(s, "FEEINVODETAIL", new String[] { "fid_id" }, new Object[] { fid_id });
+					gridSql3.add(sql);
+				}
+			}
+			//insert with check
+			String err = baseDao
+					.executeWithCheck(
+							gridSql3,
+							null,"select LOB_CONCAT(FID_INVOICECODE) from (" +
+									" select  FID_INVOICECODE from FEEINVODETAIL where nvl(FID_INVOICECODE,' ')<>' '" +
+									" and FID_INVOICECODE in (select FID_INVOICECODE from FEEINVODETAIL  where nvl(FID_INVOICECODE,' ')<>' '  and fid_fpid="+store.get("fp_id")+") " +
+									" group by FID_INVOICECODE having count(1)>1) where rownum<=5");
+			if (err != null){
+				BaseUtil.showError("发票号重复:<br>"+err);
+			}
+		}
 		// 修改Evaluation
 		String formSql = SqlUtil.getUpdateSqlByFormStore(store, "FeePlease", "fp_id");
 		baseDao.execute(formSql);
@@ -612,6 +654,8 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 		baseDao.deleteById("FeePleaseDetail", "fpd_fpid", fp_id);
 		// 删除Feeback
 		baseDao.deleteById("feeback", "fb_fpid", fp_id);
+		baseDao.deleteById("FEEINVODETAIL", "fId_fpid", fp_id);
+
 		// 记录操作
 		baseDao.logger.delete(caller, "fp_id", fp_id);
 		// 执行删除后的其它逻辑