| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.oa.fee.feePlease', {
- extend: 'Ext.app.Controller',
- FormUtil: Ext.create('erp.util.FormUtil'),
- GridUtil: Ext.create('erp.util.GridUtil'),
- BaseUtil: Ext.create('erp.util.BaseUtil'),
- views:[
- 'oa.fee.feePlease','core.form.Panel','core.grid.Panel2','core.toolbar.Toolbar','core.button.Scan','core.form.FileField','core.form.SeparNumber',
- 'core.button.Save','core.button.Add','core.button.Submit','core.button.Print','core.button.Upload','core.button.ResAudit',
- 'core.button.Audit','core.button.Close','core.button.Delete','core.button.Update','core.button.DeleteDetail','core.form.DateHourMinuteField',
- 'core.button.ResSubmit','core.button.TurnCLFBX','core.button.TurnFYBX','core.button.TurnYHFKSQ','core.button.VoCreate',
- 'core.button.TurnYWZDBX','core.button.End','core.button.ResEnd','core.button.Confirm','core.trigger.MultiDbfindTrigger',
- 'core.trigger.DbfindTrigger','core.trigger.TextAreaTrigger','core.button.TurnBankRegister','core.form.MultiField','oa.fee.FeeBackGrid',
- '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','common.datalist.Toolbar','oa.fee.feePleaseFYBX','core.form.ConDateHourMinuteField','core.form.CheckBoxGroup'
- ],
- init:function(){
- var me = this;
- this.control({
- 'erpGridPanel2': {
- itemclick: function(selModel, record){
- if(record.data.fpd_id != 0 && record.data.fpd_id != null && record.data.fpd_id != ''){
- var btn = Ext.getCmp('factdays');
- btn && btn.setDisabled(false);
- }
- this.onGridItemClick(selModel, record);
- }
- },
- 'mfilefield':{
- beforerender:function(f){
- if(caller=='FeePlease!ZWSQ'){
- f.readOnly=false;
- }
- }
- },
- 'FeeBackGrid': {
- itemclick: this.onGridItemClick2
- },
- 'erpFormPanel' : {
- afterload : function(form) {
- this.hidecolumns(true);
- }
- },
- 'field[name=fp_v11]':{
- beforerender: function(field){
- field.readOnly=false;
- }
- },
- 'dbfindtrigger[name=fp_v1]': {
- afterrender:function(trigger){
- if(caller=='FeePlease!JKSQ'){
- trigger.dbKey='fp_department';
- trigger.mappingKey='fcs_departmentname';
- trigger.dbMessage='请先选择申请部门';}
- }
- },
- 'dbfindtrigger[name=fpd_d1]': {
- afterrender:function(trigger){
- trigger.dbKey='fp_department';
- trigger.mappingKey='fcs_departmentname';
- trigger.dbMessage='请先选择报销部门';
- }
- },
- 'dbfindtrigger[name=fp_pleaseman]':{
- aftertrigger:function(trigger,record){
- Ext.Ajax.request({
- url:basePath+'oa/fee/getFeeAccount.action',
- method:'POST',
- params:{
- emcode:trigger.value
- },
- async:false,
- callback:function(opts,success,res){
- var r = new Ext.decode(res.responseText);
- trigger.up('form').getForm().setValues(r.info);
- }
-
- });
- }
- },
- 'erpSaveButton': {
- click: function(btn){
- var form = me.getForm(btn);
- if(Ext.getCmp(form.codeField).value == null || Ext.getCmp(form.codeField).value == ''){
- if(caller=='FeePlease!CLFBX'){
- me.BaseUtil.getRandomNumber('FeePlease!FYBX');//差旅费报销取费用报销同样的caller取编号
- }else{
- me.BaseUtil.getRandomNumber(caller);//自动添加编号
- }
-
- }
- if(caller == 'FeePlease!CZCFSQ'|| caller == 'FeePlease!FYBX'){
- this.getamount();
- }
- if(caller == 'FeePlease!CCSQ'){
- this.getTotal();
- if(Ext.getCmp('fp_prestartdate')!=null && Ext.getCmp('fp_preenddate')!=null){
- var start=new Date(Ext.getCmp('fp_prestartdate').items.items[5].value);
- var end=new Date(Ext.getCmp('fp_preenddate').value);
- if(start-end>0){
- showError('预计时间跨度输入有误,请确认后重新输入');
- }
- else{
- this.beforeSave();
- }
- }else{
- this.beforeSave();
- }
- }else if(caller == 'FeePlease!JKSQ'){
- if(Ext.getCmp('fp_startdate')!=null && Ext.getCmp('fp_enddate')!=null){
- var start=new Date(Ext.getCmp('fp_startdate').value);
- var end=new Date(Ext.getCmp('fp_enddate').value);
- if(start-end>0){
- showError('借款日期不能早于还款日期,请确认后重新输入');
- }else{
- this.beforeSave();
- }
- }
- else{
- this.beforeSave();
- }
- }else{
- this.beforeSave();
- }
-
- }
- },
- 'erpCloseButton': {
- click: function(btn){
- this.FormUtil.beforeClose(this);
- }
- },
- 'erpAddButton': {
- click: function(btn){
- 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);
- }
- }
- },
- 'erpUpdateButton': {
- click: function(btn){
- if(caller == 'FeePlease!CZCFSQ'){
- this.getamount();
- }
- if(caller == 'FeePlease!CCSQ'){
- this.getTotal();
- if(Ext.getCmp('fp_prestartdate')!=null && Ext.getCmp('fp_preenddate')!=null){
- var start=new Date(Ext.getCmp('fp_prestartdate').items.items[5].value);
- var end=new Date(Ext.getCmp('fp_preenddate').value);
- if(start-end>0){
- showError('预计时间跨度输入有误,请确认后重新输入');
- }else{
- this.beforeUpdate();
- }
- }else{
- this.beforeUpdate();
- }
- }else if(caller == 'FeePlease!JKSQ'){
- if(Ext.getCmp('fp_startdate')!=null && Ext.getCmp('fp_enddate')!=null){
- var start=new Date(Ext.getCmp('fp_startdate').value);
- var end=new Date(Ext.getCmp('fp_enddate').value);
- if(start-end>0){
- showError('借款日期不能早于还款日期,请确认后重新输入');
- }else{
- this.beforeUpdate();
- }
- }else{
- this.beforeUpdate();
- }
- }else{
- this.beforeUpdate();
- }
-
- }
- },
- 'erpDeleteButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'ENTERING'){
- btn.hide();
- }
- },
- click: function(btn){
- me.FormUtil.onDelete((Ext.getCmp('fp_id').value));
- }
- },
- 'erpAuditButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'COMMITED'){
- btn.hide();
- }
- },
- click: function(btn){
- this.FormUtil.onAudit(Ext.getCmp('fp_id').value);
- }
- },
- 'erpResAuditButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- this.FormUtil.onResAudit(Ext.getCmp('fp_id').value);
- }
- },
- 'erpSubmitButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'ENTERING'){
- btn.hide();
- }
- },
- click: function(btn){
- if(caller == 'FeePlease!CCSQ'){
- this.getTotal();
- }
- if(caller == 'FeePlease!JKSQ'){
- if(Ext.getCmp('fp_startdate')!=null && Ext.getCmp('fp_enddate')!=null){
- var start=new Date(Ext.getCmp('fp_startdate').value);
- var end=new Date(Ext.getCmp('fp_enddate').value);
- if(start-end>0){
- showError('借款日期不能早于还款日期,请确认后重新输入');
- }else{
- this.FormUtil.onSubmit(Ext.getCmp('fp_id').value);
- }
- }else{
- this.FormUtil.onSubmit(Ext.getCmp('fp_id').value);
- }
- }else{
- this.FormUtil.onSubmit(Ext.getCmp('fp_id').value);
- }
-
-
- }
- },
- 'erpResSubmitButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'COMMITED'){
- btn.hide();
- }
- },
- click: function(btn){
- this.FormUtil.onResSubmit(Ext.getCmp('fp_id').value);
- }
- },
- 'erpPrintButton': {
- click:function(btn){
- var reportName='';
- var kind=Ext.getCmp('fp_kind').value;
- if(kind=="借款申请单"){
- reportName="AccountRegZW2";
- }else if(kind=="费用报销单"){
- reportName="AccountRegZW_fybx";
- }else if(kind=="差旅费报销单"){
- reportName="AccountRegZW_clfbx";
- }else if(kind=="还款申请单"){
- reportName="AccountRegZW_hksq";
- }else{
- reportName="AccountRegZW";
- }
- var condition='{FeePlease.fp_id}='+Ext.getCmp('fp_id').value+'';
- var id=Ext.getCmp('fp_id').value;
- me.FormUtil.onwindowsPrint(id,reportName,condition);
- }
- },
- 'field[name=fp_n3]': {
- change:function(f){
- if(caller=='FeePlease!ZWSQ'){
- Ext.getCmp('fp_pleaseamount').setValue((Ext.getCmp('fp_n3').value-0)+(Ext.getCmp('fp_n4').value-0));;
- }
- }
- },
- 'field[name=fp_n4]': {
- change:function(f){
- if(caller=='FeePlease!ZWSQ'){
- Ext.getCmp('fp_pleaseamount').setValue((Ext.getCmp('fp_n3').value-0)+(Ext.getCmp('fp_n4').value-0));;
- }
- }
- },
- 'erpEndButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value == 'FINISH'){
- btn.hide();
- }
- },
- click: function(btn){
- var endreason = Ext.getCmp('fp_endreason')
- if(endreason && endreason !=null){
- me.FormUtil.onUpdate(Ext.getCmp('fp_id').value);
- }
- this.FormUtil.onEnd(Ext.getCmp('fp_id').value);
- }
- },
- 'combo[name=fp_object]': {
- delay: 200,
- change: function(m){
- this.hidecolumns(false);
- }
- },
- 'erpResEndButton': {
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'FINISH'){
- btn.hide();
- }
- },
- click: function(btn){
- this.FormUtil.onResEnd(Ext.getCmp('fp_id').value);
- }
- },
- 'erpConfirmButton': {afterrender: function(btn){
- var statu = Ext.getCmp('fp_statuscode');
- if(statu && statu.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- me.onConfirm(Ext.getCmp('fp_id').value);
-
- }
- } ,
- 'erpVoCreateButton':{//业务招待费转费用报销
- beforerender:function(btn){
- btn.setWidth(100);
- btn.setText("转费用报销");
- },
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- var turnStatus=Ext.getCmp('fp_v11');
- if(status && status.value != 'AUDITED'&&turnStatus||turnStatus.value!='未转费用申请'){
- btn.hide();
- }
- },
- click:function(){
- this.turnFYBX(me);
- }
- },
- //转银行登记
- 'erpTurnBankRegisterButton':{
- click:function(btn){
- me.turnBankRegister();
- },
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- }
- },
- /**
- * 更改实际天数
- */
- '#factdays': {
- click: function(btn) {
- var record=btn.ownerCt.ownerCt.getSelectionModel().getLastSelected();
- me.UpdateFactdays(record);
- }
- },
- 'field[name=fp_v11]':{
- beforerender:function(field){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value == 'AUDITED'){
- field.readOnly=false;
- }
- }
- },
- 'field[name=fp_endreason]':{
- beforerender:function(field){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value == 'AUDITED'){
- field.readOnly=false;
- }
- }
- },
- 'field[name=fp_n2]':{
- beforerender:function(field){
- if(caller!='FeePlease!CCSQ'){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value == 'AUDITED'){
- field.readOnly=false;
- var back=0;
- if(Ext.getCmp('fp_n6')&&Ext.getCmp('fp_n6').value!=''){
- back=Ext.getCmp('fp_n6').value;
- }
- field.setValue((Ext.getCmp('fp_pleaseamount').value-back-Ext.getCmp('fp_n1').value).toFixed(3));
- }
- }
- }
- },
- 'dbfindtrigger[name=fp_kind]': {
- afterrender:function(trigger){
- if(caller == 'FeePlease!JKSQ'){
- trigger.dbKey='fp_department';
- trigger.mappingKey='fcs_departmentname';
- trigger.dbMessage='请先选择申请部门!';
- }
- }
- },
- 'field[name=fp_sourcecode]': {
- afterrender:function(f){
- if(caller=='FeePlease!CLFBX'|| caller=='FeePlease!FYBX'||caller=='FeePlease!HKSQ'){
- if(Ext.getCmp('fp_sourcecode').value!=""){
- f.setFieldStyle({
- 'color': 'blue'
- });
- f.focusCls = 'mail-attach';
- var c = Ext.Function.bind(me.openRelative, me);
- Ext.EventManager.on(f.inputEl, {
- mousedown : c,
- scope: f,
- buffer : 100
- });
- }
- }
- }
- },
- 'erpTurnCLFBXButton':{
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- warnMsg("确定要转入差旅费报销单吗?", function(btn){
- if(btn == 'yes'){
- me.FormUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/feeplease/turnCLFBX.action',
- params: {
- caller: caller,
- id: Ext.getCmp('fp_id').value
- },
- method : 'post',
- callback : function(options,success,response){
- me.FormUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- }
- if(localJson.success){
- turnSuccess(function(){
- var id = localJson.id;
- var url = "jsps/oa/fee/feePlease.jsp?whoami=FeePlease!CLFBX&formCondition=fp_id=" + id + "&gridCondition=fpd_fpid=" + id;
- me.FormUtil.onAdd('FeePlease' + id, '差旅费报销单' + id, url);
- });
- }
- }
- });
- }
- });
- }
- },
- 'erpTurnFYBXButton':{
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- warnMsg("确定要转入费用报销单吗?", function(btn){
- if(btn == 'yes'){
- me.FormUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/feeplease/turnFYBX.action',
- params: {
- caller: caller,
- id: Ext.getCmp('fp_id').value
- },
- method : 'post',
- callback : function(options,success,response){
- me.FormUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- }
- if(localJson.success){
- turnSuccess(function(){
- var id = localJson.id;
- var url = "jsps/oa/fee/feePlease.jsp?whoami=FeePlease!FYBX&formCondition=fp_id=" + id + "&gridCondition=fpd_fpid=" + id;
- me.FormUtil.onAdd('FeePlease' + id, '费用报销单' + id, url);
- });
- }
- }
- });
- }
- });
- }
- },
- 'erpTurnYHFKSQButton':{
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- warnMsg("确定要转入银行付款申请单吗?", function(btn){
- if(btn == 'yes'){
- me.FormUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/feeplease/turnYHFKSQ.action',
- params: {
- caller: caller,
- id: Ext.getCmp('fp_id').value
- },
- method : 'post',
- callback : function(options,success,response){
- me.FormUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- }
- if(localJson.success){
- turnSuccess(function(){
- var id = localJson.id;
- var url = "jsps/oa/fee/feePlease.jsp?whoami=FeePlease!YHFKSQ&formCondition=fp_id=" + id + "&gridCondition=fpd_fpid=" + id;
- me.FormUtil.onAdd('FeePlease' + id, '银行付款申请单' + id, url);
- });
- }
- }
- });
- }
- });
- }
- },
- 'erpTurnYWZDBXButton':{
- afterrender: function(btn){
- var status = Ext.getCmp('fp_statuscode');
- if(status && status.value != 'AUDITED'){
- btn.hide();
- }
- },
- click: function(btn){
- warnMsg("确定要转入业务招待费报销单吗?", function(btn){
- if(btn == 'yes'){
- me.FormUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/feeplease/turnYWZDBX.action',
- params: {
- caller: caller,
- id: Ext.getCmp('fp_id').value
- },
- method : 'post',
- callback : function(options,success,response){
- me.FormUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- }
- if(localJson.success){
- turnSuccess(function(){
- var id = localJson.id;
- var url = "jsps/oa/fee/feePlease.jsp?whoami=FeePlease!YWZDBX&formCondition=fp_id=" + id + "&gridCondition=fpd_fpid=" + id;
- me.FormUtil.onAdd('FeePlease' + id, '业务招待费报销单' + id, url);
- });
- }
- }
- });
- }
- });
- }
- }
- });
- },
- getTotal:function(){
- var carfare=Ext.getCmp('fp_n2')!=null?(Ext.getCmp('fp_n2').value=="" ? 0 : Ext.getCmp('fp_n2').value-0):0;//交通费
- var accommodation=Ext.getCmp('fp_n3')!=null?(Ext.getCmp('fp_n3').value=="" ? 0 : Ext.getCmp('fp_n3').value-0):0;//住宿费
- var prfee=Ext.getCmp('fp_n4')!=null?(Ext.getCmp('fp_n4').value=="" ? 0 : Ext.getCmp('fp_n4').value-0):0;//公关费
- if(Ext.getCmp('fp_pleaseamount')!=null)
- Ext.getCmp('fp_pleaseamount').setValue(carfare+accommodation+prfee);
- },
- getamount: function(){
- var grid = Ext.getCmp('grid');
- var items = grid.store.data.items;
- var amount = 0;
- Ext.each(items,function(item,index){
- if(item.data['fpd_date1']!=null&&item.data['fpd_date1']!=""){
- amount= amount + Number(item.data['fpd_total']);
- }
- });
- Ext.getCmp('fp_pleaseamount').setValue(amount);
- },
- onGridItemClick: function(selModel, record){//grid行选择
- this.GridUtil.onGridItemClick(selModel, record);
- },
- getForm: function(btn){
- return btn.ownerCt.ownerCt;
- },
- onConfirm: function(id){
- var form = Ext.getCmp('form');
- Ext.Ajax.request({
- url : basePath + form.confirmUrl,
- params: {
- id: id,
- caller:caller
- },
- method : 'post',
- callback : function(options,success,response){
- //me.setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.success){
- //audit成功后刷新页面进入可编辑的页面
- //auditSuccess(function(){
- window.location.reload();
- //});
- } else {
- if(localJson.exceptionInfo){
- var str = localJson.exceptionInfo;
- if(str.trim().substr(0, 12) == 'AFTERSUCCESS'){//特殊情况:操作成功,但是出现警告,允许刷新页面
- str = str.replace('AFTERSUCCESS', '');
- showMessage("提示", '确认成功');
- //auditSuccess(function(){
- window.location.reload();
- //});
- } else {
- showError(str);return;
- }
- }
- }
- }
- });
- },
- openRelative:function(e, el, obj){
- var f = obj.scope;
- var name='';
- var cal='';
- var field=''
- var conField=''
- var type=Ext.getCmp('fp_sourcekind').value;
- if(type=='客户拜访记录'){
- name='VisitRecord';
- cal='visitrecord';
- field='vr_id';
- conField='vr_class=\'OfficeClerk\' and vr_code';
- }else if(type=='原厂拜访记录'){
- name='VisitRecord';
- cal='visitrecord';
- field='vr_id';
- conField='vr_class=\'VisitRecord!Vender\' and vr_code';
- }else if(type=='业务招待费申请单'){
- name='FeePlease';
- cal='FeePlease';
- field='fp_id';
- conField='fp_kind=\'业务招待费申请单\' and fp_code';
- }else if(type=='出差申请单'){
- name='FeePlease';
- cal='FeePlease';
- field='fp_id';
- conField='fp_kind=\'出差申请单\' and fp_code';
- }else if(type=='资源开发记录'){
- name='VisitRecord';
- cal='visitrecord';
- field='vr_id';
- conField='vr_class=\'VisitRecord!Resource\' and vr_code';
- }else if(type=='借款申请单'){
- name='FeePlease';
- cal='FeePlease';
- field='fp_id';
- conField='fp_kind=\'借款申请单\' and fp_code';
- }
- else if(type=='费用申请'){
- name='PreFeePlease';
- cal='PreFeePlease';
- field='fp_id';
- conField=' fp_code';
- }else if(type=='资产维修'){
- name='Propertyrepair';
- cal='Propertyrepair';
- field='pr_id';
- conField=' pr_code';
- }else if(type=='车辆维修'){
- name='vehiclearchivesdetail';
- cal='vehiclearchivesdetail';
- field='vd_id';
- conField=' vd_code';
- }
- if(type=='市场调研立项'||type=='客户拜访记录' || type=='原厂拜访记录' || type=='业务招待费申请单'||type=='出差申请单'||type=='资源开发记录'||type=='借款申请单'||type=='费用申请'||type=='资产维修'||type=='车辆维修') {
- var code = Ext.getCmp('fp_sourcecode').value;
- if(code.indexOf('(')>-1){//来自其他的单据
- this.turnOtherSob(code,field,conField,cal);
- }else{
- var url=this.getRelativeUrl(code,field,conField,cal);
- this.FormUtil.onAdd(name, Ext.getCmp('fp_sourcekind').value,
- url);
- }
-
- }
- },
- getRelativeUrl:function(code,field,conField,cal){
- var id = 0;
- Ext.Ajax.request({
- url : basePath + 'common/getFieldData.action',
- async: false,
- params: {
- caller: cal,
- field: field,
- condition: conField+'=\'' + code + '\''
- },
- method : 'post',
- callback : function(o, s, r){
- var rs = new Ext.decode(r.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);return;
- }
- if(rs.success){
- if(rs.data != null){
- id = rs.data;
- }
- }
- }
- });
- var url='#';
- var type=Ext.getCmp('fp_sourcekind').value;
- if(type=='客户拜访记录'){
- url='jsps/crm/customermgr/customervisit/visitRecord.jsp?formCondition=vr_idIS'+id+'&gridCondition=vrd_vridIS'+id;
- }else if(type=='原厂拜访记录'){
- url='jsps/crm/customermgr/customervisit/visitRecord3.jsp?formCondition=vr_idIS'+id+'&gridCondition=vrd_vridIS'+id;
- }else if(type=='业务招待费申请单'){
- url='jsps/oa/fee/feePlease.jsp?whoami=FeePlease!YWZDSQ&formCondition=fp_idIS'+id+'&gridCondition=fpd_fpidIS'+id;
- }else if(type=='出差申请单'){
- url='jsps/oa/fee/feePlease.jsp?whoami=FeePlease!CCSQ&formCondition=fp_idIS'+id+'&gridCondition=fpd_fpidIS'+id;
- }else if(type=='资源开发记录'){
- url='jsps/crm/customermgr/customervisit/visitRecord4.jsp?formCondition=vr_idIS'+id+'&gridCondition=vrd_vridIS'+id;
- }else if(type=='借款申请单'){
- url='jsps/oa/fee/feePlease.jsp?whoami=FeePlease!JKSQ&formCondition=fp_idIS'+id+'&gridCondition=fpd_fpidIS'+id;
- }else if(type=='费用申请'){
- url='jsps/oa/fee/preFeePlease.jsp?formCondition=fp_idIS'+id+'&gridCondition=fpd_fpidIS'+id;
- }else if(type=='资产维修'){
- url='jsps/oa/storage/propertyrepair.jsp?formCondition=pr_idIS'+id+'&gridCondition=prd_pridIS'+id;
- }else if(type=='车辆维修'){
- url='jsps/oa/vehicle/vehiclemaintain.jsp?formCondition=vd_idIS'+id;
- }
- return url;
- },
- turnOtherSob:function(code,field,conField,cal){
- var newSob=null;//code形如:2015040052(资料中心) 2016010052((华商龙)资料中心)
- Ext.Ajax.request({//去资料中心寻找括号内的帐套
- url : basePath + 'common/getFieldData.action',
- async: false,
- params: {
- caller: 'N_DataCenter.MASTER',
- field: 'ma_user',
- condition: 'ma_function=\'' + code.substring(code.lastIndexOf('('),code.lastIndexOf(')')) + '\''
- },
- method : 'post',
- callback : function(o, s, r){
- var rs = new Ext.decode(r.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);return;
- }
- if(rs.success){
- if(rs.data != null){
- newSob = rs.data;
- }
- }
- }
- });
- if(newSob==null){
- showError('没有找到要转的帐套!');
- return;
- }else{
- var url=this.getRelativeUrl(code.split('(')[0],field,conField,newSob+'.'+cal);
- var currentMaster = parent.sob?parent.sob:parent.parent.sob;
- url=parent.location.href.split('jsps')[0]+url;//防止因为父页面url的改变,而找不到页面
- Ext.Ajax.request({
- url: basePath + 'common/changeMaster.action',
- params: {
- to: newSob
- },
- callback: function(opt, s, r) {
- if (s) {
- var win = parent.Ext.create('Ext.Window', {
- width: '100%',
- height: '100%',
- draggable: false,
- closable: false,
- modal: true,
- id:'modalwindow',
- historyMaster:currentMaster,
- title: '创建到帐套' + code.substring(code.lastIndexOf('('),code.lastIndexOf(')')) + '的临时会话',
- html : '<iframe src="' + url + '" height="100%" width="100%" frameborder="0" style="border-width: 0px;padding: 0px;" scrolling="auto"></iframe>',
- buttonAlign: 'center',
- buttons: [{
- text: $I18N.common.button.erpCloseButton,
- cls: 'x-btn-blue',
- id: 'close',
- handler: function(b) {
- Ext.Ajax.request({
- url: basePath + 'common/changeMaster.action',
- params: {
- to: currentMaster
- },
- callback: function(opt, s, r) {
- if (s) {
- b.up('window').close();
- } else {
- alert('切换到原帐套失败!');
- }
- }
- });
- }
- }]
- });
- win.show();
- } else {
- alert('无法创建到帐套' + code.substring(code.lastIndexOf('('),code.lastIndexOf(')')) + '的临时会话!');
- }
- }
- });
- }
- },
- turnFYBX:function(me){
- warnMsg("确定要转入费用报销单吗?", function(btn){
- if(btn == 'yes'){
- me.FormUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/feeplease/turnFYBX2.action',
- params: {
- caller: caller,
- id: Ext.getCmp('fp_id').value
- },
- method : 'post',
- callback : function(options,success,response){
- me.FormUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- }
- if(localJson.success){
- //turnSuccess(function(){
- showMessage("提示", '转入成功');
- window.location.reload();
- var id = localJson.id;
- var url = "jsps/oa/fee/feePlease.jsp?whoami=FeePlease!FYBX&formCondition=fp_id=" + id + "&gridCondition=fpd_fpid=" + id;
- me.FormUtil.onAdd('FeePlease' + id, '费用报销单' + id, url);
- //});
-
- }
- }
- });
- }
- });
- },
- turnBankRegister:function(){
- var form = Ext.getCmp('form');
- var catecode = Ext.getCmp('fp_v11').value;
- if(catecode == null || catecode == ''){
- showMessage("警告", '请填写需要转银行登记的付款方信息!');
- return;
- }
- var thispayamount=form.BaseUtil.numberFormat(Ext.getCmp('fp_n2').value,2);
- var back=0;//还款金额
- if(Ext.getCmp('fp_n6')&&Ext.getCmp('fp_n6').value!=null&&Ext.getCmp('fp_n6').value!=''){
- back=form.BaseUtil.numberFormat(Ext.getCmp('fp_n6').value,2);
- }
- if(form.BaseUtil.numberFormat(Ext.getCmp('fp_n1').value+thispayamount,2) > form.BaseUtil.numberFormat(Ext.getCmp('fp_pleaseamount').value-back,2)){
- showMessage("警告", '本次转金额超出剩余金额!');
- return;
- }
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + 'oa/fee/turnBankRegister.action',
- params: {
- id:Ext.getCmp("fp_id").value,
- paymentcode:Ext.getCmp('fp_v11').value,
- payment:Ext.getCmp('fp_v10').value,
- thispayamount:Ext.getCmp('fp_n2').value,
- caller:caller
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- if(localJson.log){
- showMessage("提示", localJson.log);
- window.location.reload();
- }
- }
- }
- });
- },
- UpdateFactdays:function(record){
- var win = this.factdayswindow;
- if (!win) {
- win = this.getFactdaysWindow();
- }
- win.show();
- },
- getFactdaysWindow : function() {
- var me = this;
- return Ext.create('Ext.window.Window',{
- width: 330,
- height: 180,
- closeAction: 'hide',
- cls: 'custom-blue',
- title:'<h1>更改实际天数</h1>',
- layout: {
- type: 'vbox'
- },
- items:[{
- margin: '5 0 0 5',
- xtype:'numberfield',
- fieldLabel:'实际天数',
- name:'factdays',
- id:'factdays'
- },{
- margin: '5 0 0 5',
- xtype: 'fieldcontainer',
- fieldLabel: '全部更新',
- combineErrors: false,
- defaults: {
- hideLabel: true
- },
- layout: {
- type: 'column',
- defaultMargins: {top: 0, right: 5, bottom: 0, left: 0}
- },
- items: [{
- xtype:'checkbox',
- columnidth: 0.4,
- fieldLabel:'全部更新',
- name:'allupdate',
- id:'allupdate'
- },{
- xtype:'displayfield',
- fieldStyle:'color:red',
- columnidth: 0.6,
- value:' *更改当前所有明细'
- }]
- }],
- buttonAlign:'center',
- buttons:[{
- xtype:'button',
- text:'保存',
- width:60,
- iconCls: 'x-button-icon-save',
- handler:function(btn){
- var w = btn.up('window');
- me.saveFactdays(w);
- w.hide();
- }
- },{
- xtype:'button',
- columnWidth:0.1,
- text:'关闭',
- width:60,
- iconCls: 'x-button-icon-close',
- margin:'0 0 0 10',
- handler:function(btn){
- btn.up('window').hide();
- }
- }]
- });
- },
- saveFactdays: function(w) {
- var factdays = w.down('field[name=factdays]').getValue(),
- grid = Ext.getCmp('grid'),
- record = grid.getSelectionModel().getLastSelected();
- if(!factdays) {
- showError('请先设置预计天数.') ;
- return;
- } else {
- var allupdate = w.down('field[name=allupdate]').getValue();
- var dd = {
- fpd_id : record.data.fpd_id,
- fpd_fpid : record.data.fpd_fpid,
- factdays : factdays? factdays : record.data.fpd_n5,
- allupdate : allupdate ? 1 : 0
- };
- Ext.Ajax.request({
- url : basePath +'oa/fee/updatefactdays.action',
- params : {
- data: unescape(Ext.JSON.encode(dd))
- },
- method : 'post',
- callback : function(opt, s, res){
- var r = new Ext.decode(res.responseText);
- if(r.success){
- grid.GridUtil.loadNewStore(grid,{
- caller:'FeePlease!CCSQ',
- condition: 'fpd_fpid=' + record.data.fpd_fpid
- });
- } else if(r.exceptionInfo){
- showError(r.exceptionInfo);
- } else{
- saveFailure();
- }
- }
- });
- }
- },
- beforeSave: function(){
- var me = this;
- var form = Ext.getCmp('form');
- if(! me.FormUtil.checkForm()){
- return;
- }
- if(caller=='FeePlease!FYBX'&&Ext.getCmp('fp_object')){
- var obj = Ext.getCmp("fp_object").value;
- if(obj == '供应商' && (Ext.getCmp('fp_vendcode').value==null||Ext.getCmp('fp_vendcode').value=='')){
- showError('供应商不能为空!');//对象为供应商时,供应商编号不能为空
- return;
- }
- if(obj == '客户' && (Ext.getCmp('fp_cucode').value==null||Ext.getCmp('fp_cucode').value=='')){
- showError('供应商不能为空!');//对象为客户时,客户编号不能为空
- return;
- }
- }
- if(Ext.getCmp(form.keyField).value == null || Ext.getCmp(form.keyField).value == ''){
- me.FormUtil.getSeqId(form);
- }
- var detail = Ext.getCmp('grid');
- var detail2 = Ext.getCmp('FeeBackGrid');
- 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;
- }
- });
- var param1 = me.GridUtil.getGridStore(detail);
- var param2 = new Array();
- if(detail2) {
- param2 = me.GridUtil.getGridStore(detail2);
- }
- param1 = param1 == null ? [] : "[" + param1.toString().replace(/\\/g,"%") + "]";
- param2 = param2 == null ? [] : "[" + param2.toString().replace(/\\/g,"%") + "]";
- if(form.getForm().isValid()){
- Ext.each(form.items.items, function(item){
- if(item.xtype == 'numberfield'){
- if(item.value == null || item.value == ''){
- item.setValue(0);
- }
- }
- });
- var r = form.getValues();
- me.save(r, param1, param2);
- }else{
- me.FormUtil.checkForm();
- }
- },
- save: function(){
- var form=Ext.getCmp('form');
- var params = new Object();
- var r = arguments[0];
- Ext.each(Ext.Object.getKeys(r), function(k){//去掉页面非表单定义字段
- if(contains(k, 'ext-', true)){
- delete r[k];
- }
- });
- //去除ignore字段
- var keys = Ext.Object.getKeys(r), f;
- var reg = /[!@#$%^&*()'":,\/?]/;
- Ext.each(keys, function(k){
- f = form.down('#' + k);
- if(f && f.logic == 'ignore') {
- delete r[k];
- }
- //codeField值强制大写,自动过滤特殊字符
- if(k == form.codeField && !Ext.isEmpty(r[k])) {
- r[k] = r[k].trim().toUpperCase().replace(reg, '');
- }
- });
- 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.caller=caller;
- /*for(var i=2; i<arguments.length; i++) { //兼容多参数
- params['param' + i] = unescape(arguments[i].toString().replace(/\\/g,"%"));
- }*/
- var me = this;
- var form = Ext.getCmp('form');
- //me.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + form.saveUrl,
- params : params,
- method : 'post',
- callback : function(options,success,response){
- var localJson = new Ext.decode(response.responseText);
- if(localJson.success){
- saveSuccess(function(){
- //add成功后刷新页面进入可编辑的页面
- var value = r[form.keyField];
- var formCondition = form.keyField + "IS" + value ;
- if(me.contains(window.location.href, '?', true)){
- window.location.href = window.location.href + '&formCondition=' +
- formCondition+'&gridCondition=fpd_fpidIS'+value;
- } else {
- window.location.href = window.location.href + '?formCondition=' +
- formCondition+'&gridCondition=fpd_fpidIS'+value;
- }
- });
- } else if(localJson.exceptionInfo){
- var str = localJson.exceptionInfo;
- if(str.trim().substr(0, 12) == 'AFTERSUCCESS'){//特殊情况:操作成功,但是出现警告,允许刷新页面
- str = str.replace('AFTERSUCCESS', '');
- saveSuccess(function(){
- //add成功后刷新页面进入可编辑的页面
- var value = r[form.keyField];
- var formCondition = form.keyField + "IS" + value ;
- if(me.contains(window.location.href, '?', true)){
- window.location.href = window.location.href + '&formCondition=' +
- formCondition+'&gridCondition=fpd_fpidIS'+value;
- } else {
- window.location.href = window.location.href + '?formCondition=' +
- formCondition+'&gridCondition=fpd_fpidIS'+value;
- }
- });
- showError(str);
- } else {
- showError(str);
- return;
- }
- } else{
- saveFailure();//@i18n/i18n.js
- }
- }
-
- });
- },
-
- beforeUpdate: function(){
- var me = this;
- var form = Ext.getCmp('form');
- if(! me.FormUtil.checkForm()){
- return;
- }
- if(caller=='FeePlease!FYBX'&&Ext.getCmp('fp_object')){
- var obj = Ext.getCmp("fp_object").value;
- if(obj == '供应商' && (Ext.getCmp('fp_vendcode').value==null||Ext.getCmp('fp_vendcode').value=='')){
- showError('供应商不能为空!');//对象为供应商时,供应商编号不能为空
- return;
- }
- if(obj == '客户' && (Ext.getCmp('fp_cucode').value==null||Ext.getCmp('fp_cucode').value=='')){
- showError('客户不能为空!');//对象为客户时,客户编号不能为空
- return;
- }
- }
- if(Ext.getCmp(form.keyField).value == null || Ext.getCmp(form.keyField).value == ''){
- me.FormUtil.getSeqId(form);
- }
- var detail = Ext.getCmp('grid');
- var detail2 = Ext.getCmp('FeeBackGrid');
- 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;
- }
- });
- var param1 = me.GridUtil.getGridStore(detail);
- var param2 = new Array();
- if(detail2) {
- param2 = me.GridUtil.getGridStore(detail2);
- }
- param1 = param1 == null ? [] : "[" + param1.toString().replace(/\\/g,"%") + "]";
- param2 = param2 == null ? [] : "[" + param2.toString().replace(/\\/g,"%") + "]";
- if(form.getForm().isValid()){
- Ext.each(form.items.items, function(item){
- if(item.xtype == 'numberfield'){
- if(item.value == null || item.value == ''){
- item.setValue(0);
- }
- }
- });
- var r = form.getValues();
- me.update(r, param1, param2);
- }else{
- me.FormUtil.checkForm();
- }
-
- },
- update:function(){
- var form=Ext.getCmp('form');
- var params = new Object();
- var r = arguments[0];
- Ext.each(Ext.Object.getKeys(r), function(k){//去掉页面非表单定义字段
- if(contains(k, 'ext-', true)){
- delete r[k];
- }
- });
- //去除ignore字段
- var keys = Ext.Object.getKeys(r), f;
- var reg = /[!@#$%^&*()'":,\/?]/;
- Ext.each(keys, function(k){
- f = form.down('#' + k);
- if(f && f.logic == 'ignore') {
- delete r[k];
- }
- //codeField值强制大写,自动过滤特殊字符
- if(k == form.codeField && !Ext.isEmpty(r[k])) {
- r[k] = r[k].trim().toUpperCase().replace(reg, '');
- }
- });
- 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.caller=caller;
- var me = this;
- var form = Ext.getCmp('form');
- //me.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + form.updateUrl,
- params : params,
- method : 'post',
- callback : function(options,success,response){
- //me.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.success){
- saveSuccess(function(){
- //add成功后刷新页面进入可编辑的页面
- var value = r[form.keyField];
- var formCondition = form.keyField + "IS" + value ;
- if(me.contains(window.location.href, '?', true)){
- window.location.href = window.location.href + '&formCondition=' +
- formCondition;
- } else {
- window.location.href = window.location.href + '?formCondition=' +
- formCondition;
- }
- });
- } else if(localJson.exceptionInfo){
- var str = localJson.exceptionInfo;
- if(str.trim().substr(0, 12) == 'AFTERSUCCESS'){//特殊情况:操作成功,但是出现警告,允许刷新页面
- str = str.replace('AFTERSUCCESS', '');
- saveSuccess(function(){
- //add成功后刷新页面进入可编辑的页面
- var value = r[form.keyField];
- var formCondition = form.keyField + "IS" + value ;
- if(me.contains(window.location.href, '?', true)){
- window.location.href = window.location.href + '&formCondition=' +
- formCondition;
- } else {
- window.location.href = window.location.href + '?formCondition=' +
- formCondition;
- }
- });
- showError(str);
- } else {
- showError(str);
- return;
- }
- } else{
- saveFailure();//@i18n/i18n.js
- }
- }
-
- });
- },
- contains: function(string,substr,isIgnoreCase){
- if(isIgnoreCase){
- string=string.toLowerCase();
- substr=substr.toLowerCase();
- }
- var startChar=substr.substring(0,1);
- var strLen=substr.length;
- for(var j=0;j<string.length-strLen+1;j++){
- if(string.charAt(j)==startChar){//如果匹配起始字符,开始查找
- if(string.substring(j,j+strLen)==substr){//如果从j开始的字符与str匹配,那ok
- return true;
- }
- }
- }
- return false;
- },
- onGridItemClick: function(selModel, record){//grid行选择
- this.GridUtil.onGridItemClick(selModel, record);
- },
- onGridItemClick2: function(selModel,record){
- this.onGridItemClick(selModel,record,'FeeBackGrid');
-
- },
- hidecolumns: function(isNoClean){
- if(caller=='FeePlease!CLFBX'){
- var source = Ext.getCmp('fp_sourcekind').value;
- var form = Ext.getCmp('fp_sourcekind').ownerCt;
- if(source == '原厂拜访记录'){
- if(Ext.getCmp('fp_cucode')){
- form.down('#fp_cucode').hide();
- }
- if(Ext.getCmp('fp_cuname')){
- form.down('#fp_cuname').hide();
- }
- }else if(source == '客户拜访记录'){
- if(Ext.getCmp('fp_vendcode')){
- form.down('#fp_vendcode').hide();
- }
- if(Ext.getCmp('fp_vendname')){
- form.down('#fp_vendname').hide();
- }
- }else{
- if(Ext.getCmp('fp_vendcode')){
- form.down('#fp_vendcode').hide();
- }
- if(Ext.getCmp('fp_vendname')){
- form.down('#fp_vendname').hide();
- }
- if(Ext.getCmp('fp_cucode')){
- form.down('#fp_cucode').hide();
- }
- if(Ext.getCmp('fp_cuname')){
- form.down('#fp_cuname').hide();
- }
- }
- }
- if(caller=='FeePlease!FYBX'&&Ext.getCmp('fp_object')){
- var obj=Ext.getCmp('fp_object').value;
- var form = Ext.getCmp('fp_object').ownerCt;
- if(obj=='供应商'){
- form.down('#fp_cucode').hide();
- form.down('#fp_cuname').hide();
- form.down('#fp_vendcode').show();
- form.down('#fp_vendname').show();
- if(!isNoClean){
- form.down('#fp_cucode').setValue('');
- form.down('#fp_cuname').setValue('');
- form.down('#fp_vendcode').setValue('');
- form.down('#fp_vendname').setValue('');
- }
- }else if(obj=='客户'){
- form.down('#fp_cucode').show();
- form.down('#fp_cuname').show();
- form.down('#fp_vendcode').hide();
- form.down('#fp_vendname').hide();
- if(!isNoClean){
- form.down('#fp_cucode').setValue('');
- form.down('#fp_cuname').setValue('');
- form.down('#fp_vendcode').setValue('');
- form.down('#fp_vendname').setValue('');
- }
- }else{
- form.down('#fp_cucode').hide();
- form.down('#fp_cuname').hide();
- form.down('#fp_vendcode').hide();
- form.down('#fp_vendname').hide();
- if(!isNoClean){
- form.down('#fp_cucode').setValue('');
- form.down('#fp_cuname').setValue('');
- form.down('#fp_vendcode').setValue('');
- form.down('#fp_vendname').setValue('');
- }
- }
- }
- }
- });
|