Ibzsys常用代码

来自ling
跳转至: 导航搜索

jvm

-Xms512m
-Xmx1024m
-XX:MaxNewSize=256m
-XX:MaxPermSize=512m

前端

this.$bus.$emit
this.$bus.$on
@Watch('viewparam',{immediate: true, deep: true})

关闭tab数据刷新

  public created(): void {
    //@ts-ignore
    this.$bus.$on("appviewchange", (data: any) => {
      if (data && data.viewname === "SpPurchaseSpPurchaseEditView") {
        this.onSearch(null);
      }
    })
  }

watch

  @Watch('data.order_type')
  onOrder_typeChange(newVal: any, oldVal: any) {
    this.formDataChange({name: 'order_type', newVal: newVal, oldVal: oldVal});
    console.log(newVal)
    if ("6" === newVal) {
      this.data.is_supplement = 1
      // this.data.is_supplement=;
    } else {
      this.data.is_supplement = 0
    }
  }
AppCenterService.notifyMessage({name:"SpSubCenterCheck",action:'appRefresh',data:data});


AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
  console.log(name);
})
AppCenterService.notifyMessage({name:"11111111111111111111",action:'appRefresh',data:null});
public loadDraft(opt: any = {}): void {
    // super.loadDraft(opt);
    let css_spare_parts_userInfo_ = localStorage.getItem("css_spare_parts_userInfo_") + "";
    let user_str = localStorage.getItem("user") + "";
    if ("" !== user_str) {
      let user = JSON.parse(user_str);
      this.data.created_by = user.personName
      this.data.create_date = Util.dateFormat(new Date())
    }
    if (css_spare_parts_userInfo_ != null) {
      // setTimeout(() => {
      let css_spare_parts_userInfo = JSON.parse(css_spare_parts_userInfo_);
      this.data.seller_code = css_spare_parts_userInfo.mdeptCode
      this.data.seller_name = css_spare_parts_userInfo.mdeptName
      // }, 1000)
    }
    // setTimeout(() => {
    this.detailsModel.seller_code.disabled = true;
    this.detailsModel.seller_name.disabled = true;
    this.detailsModel.sales_order_no.disabled = true;
    this.detailsModel.outbound_status.disabled = true;
    this.detailsModel.created_by.disabled = true;
    this.detailsModel.create_date.disabled = true;
    this.detailsModel.grouppanel1.visible = this;
    this.detailsModel.grouppanel2.visible = true;
    if (AppCenterService && AppCenterService.getMessageCenter()) {
      this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({name, action, data}) => {
        if (!Object.is(name, "SpSubCenterCheck")) {
          return;
        }
        if (Object.is(action, 'appRefresh')) {
          debugger
        }
      })
    }
    // this.detailsModel.druipart1.visible = true;
    // }, 1000)
  }

代码同步

git-pull-->svn update-->svn revert

同步视图

  • 目标上用Navicat Premium删除所有视图
  • intelijj上复制表结构
  • 复制的dll带go,直接运行,遇到报错停止的地方,复制查找后复制后面的sql继续执行,一般只有几处报错需要跳过.

ibz抽筋各种搞不定的终极方案

  • 代码快速重构

*检查dtt-common,sai jar 版本是不是最新的

  • 删除 maven 本地库中这2jar包的所有版本
  • maven clean

regUIActions/doDEUIAction

var EIT_FILING_ACC_SUBGridViewController = EIT_FILING_ACC_SUBGridViewControllerBase.extend({
    regUIActions:function(config){
        arguments.callee.$.regUIActions.call(this,config);
        var uiaction_0={
            "type":"DEUIACTION",
            "tag":"EXCEL_INPUT",
            "actiontarget":"NONE",
            "actionmode":"FRONT",
            "fronttype":"WIZARD",
            "refreshview":true,
            "frontview":{
                "viewurl":"../../ibizutil/eituploaddedataview.jsp?srfdeid=EIT_FILING_ACC_SUB",
                "width":900,
                "height":300,
                "title":"导入",
                openMode:'POPUPMODAL'
            }
        };
        this.regUIAction(uiaction_0);
    },
    doDEUIAction : function(uiaction, params) {
        var me = this;
        if (uiaction.tag == 'SUB_ADJUST_AUDIT') {
            //获取要删除的数据集合
            var  selectedData =  me.getGrid().getSelection() ;
            if(selectedData==null||selectedData.length==0){
                IBiz.alert('','请选择数据', 2);
                return;
            }
            var key=selectedData[0].srfkey;
            setTimeout(function () {
                window.location.href= '/eit/page.html#/eitFiling/eitFilingAccAdjList?adjType=AUDIT&eitFilingAccSubId='+key;
            },500);
            return
        }
        if (uiaction.tag == 'SUB_ADJUST_TAX') {
            //获取要删除的数据集合
            var  selectedData =  me.getGrid().getSelection() ;
            if(selectedData==null||selectedData.length==0){
                IBiz.alert('','请选择数据', 2);
                return;
            }
            var key=selectedData[0].srfkey;
            setTimeout(function () {
                window.location.href= '/eit/page.html#/eitFiling/eitFilingAccAdjList?adjType=TAX&eitFilingAccSubId='+key;
            },500);
            return
        }
        arguments.callee.$.doDEUIAction.call(me, uiaction, params);
    }
});

sql

String getOutLSql = "select * from T_TMS_VAT_TC_IPTOUT_L where TC_IPTOUTID = ? and PTMS_VAT_TC_IPTOUT_LID is null";
					SqlParamList sqlParamListO = new SqlParamList();
					sqlParamListO.addString(iptoutId);
					List<IEntity> entities = srv1.selectRaw(getOutLSql, sqlParamListO);
					List<TMSVATTcIptoutL> list = new ArrayList<TMSVATTcIptoutL>();
					for(IEntity outentity:entities){
						TMSVATTcIptoutL outl = new TMSVATTcIptoutL();
						outentity.copyTo(outl, true);
						list.add(outl);
					}

事务doServiceWork

public void calMethodOfLine(final String outId) throws Exception{ this.doServiceWork(new IServiceWork() { @Override public void execute(ITransaction iTransaction) throws Exception {

} }); }

USRTMSVatSlmHService

USRTMSVatSlmHService

CommonUtils.getRequestRefererParseMap

fetchDEDataSet

    protected DBFetchResult fetchDEDataSet(DEDataSetFetchContext deDataSetFetchContext) throws Exception {
    	Map<String, String> referers = CommonUtils.getRequestRefererParseMap(this.getWebContext());
		String tMSVATConRecId=referers.get("srfkey");
		List<IDEDataSetCond> userConditions = deDataSetFetchContext.getConditionList();
		DEDataSetCond sc = new DEDataSetCond();
		sc.setCondType(IDEDataSetCond.CONDTYPE_DEFIELD);
		sc.setCondOp(ICondition.CONDOP_EQ);
		sc.setDEFName(TMSVATConBilRec.FIELD_TMSVATCONRECID);
		sc.setCondValue(tMSVATConRecId);
		userConditions.add(sc);
        return  this.getRealService().fetchDefault(deDataSetFetchContext);
    }

	List<BaseOrg> getAllOrgs() throws Exception{
		BaseOrgService orgService=(BaseOrgService) ServiceGlobal.getService(BaseOrgService.class);
		ISelectCond cond=new SelectCond();
		ArrayList<BaseOrg> orgs=orgService.select(cond);
		return orgs;
	}
/**
	 * 后台处理
	 */
	protected AjaxActionResult onFetch() throws Exception {
		MDAjaxActionResult mdAjaxActionResult = createFetchActionResult();
		this.getWebContext().setCurAjaxActionResult(mdAjaxActionResult);

		DEDataSetFetchContext deDataSetFetchContextImpl = new DEDataSetFetchContext(this.getWebContext());
		deDataSetFetchContextImpl.setSessionFactory(this.getSessionFactory());
		IMDCtrlRender iMDCtrlRender = this.getMDCtrlRender();
		if (iMDCtrlRender != null) iMDCtrlRender.fillDEDataSetFetchContext(deDataSetFetchContextImpl);

		if (!this.isEnableUserSort()) {
			deDataSetFetchContextImpl.resetSortInfo();
		}
		if (!StringHelper.isNullOrEmpty(getMinorSortField())) {
			deDataSetFetchContextImpl.setSort2(getMinorSortField());
			deDataSetFetchContextImpl.setSort2Dir(getMinorSortDir());
		}

		if (this.getDefaultPageSize() > 0) {
			deDataSetFetchContextImpl.setDefaultPageSize(this.getDefaultPageSize());
		}

		fillFetchConditions(deDataSetFetchContextImpl);
	
		
		
		
		fillDEDataSetFetchContext(deDataSetFetchContextImpl);
		if (deDataSetFetchContextImpl.isCancel()) {
			mdAjaxActionResult.setTotalRow(0);
			mdAjaxActionResult.setStartRow(deDataSetFetchContextImpl.getStartRow());
			mdAjaxActionResult.setPageSize(deDataSetFetchContextImpl.getPageSize());
			return mdAjaxActionResult;
		} else {
			fillDEDataSetFetchDataRange(deDataSetFetchContextImpl);
			List<IDEDataSetCond> conds =deDataSetFetchContextImpl.getConditionList();
			List<IDEDataSetCond> removesSoConds = new ArrayList<IDEDataSetCond>();
			List<IDEDataSetCond> removesDoConds = new ArrayList<IDEDataSetCond>();
			List<IDEDataSetCond> sourceCodeConds = new ArrayList<IDEDataSetCond>();
			List<IDEDataSetCond> reqHIdConds = new ArrayList<IDEDataSetCond>();
			for(IDEDataSetCond cond:conds){
				if("ALL_SO_LIST".equals(cond.getDEFName())){
					removesSoConds.add(cond);
				}
				if("ALL_DO_LIST".equals(cond.getDEFName())){
					removesDoConds.add(cond);
				}
				if("SOURCE_CODE".equals(cond.getDEFName())){
					sourceCodeConds.add(cond);
				}
				if("TMS_DR_INVOICE_REQ_HID".equals(cond.getDEFName())){
					reqHIdConds.add(cond);
				}
			}
			conds.removeAll(removesSoConds);
			conds.removeAll(removesDoConds);
			conds.removeAll(sourceCodeConds);
			conds.removeAll(reqHIdConds);
			if(sourceCodeConds.size()>0){
				IDEDataSetCond cond = sourceCodeConds.get(0);
				String sourceCode = cond.getDEFName();
				List<IDEDataSetCond> removesConds = new ArrayList<IDEDataSetCond>();
				if("B2B".equals(sourceCode)){
					//删除客户编码和销售组织的查找条件
					
					for(IDEDataSetCond cond2:conds){
						if("SALES_ORG_CODE".equals(cond2.getDEFName())||"CUSTOMER_NUMBER".equals(cond2.getDEFName())){
							removesConds.add(cond2);
						}
					}
					conds.removeAll(removesConds);
				}else{
					for(IDEDataSetCond cond2:conds){
						if("ORIGINAL_REQ_NO".equals(cond2.getDEFName())){
							removesConds.add(cond2);
						}
					}
					conds.removeAll(removesConds);
					
					if(removesSoConds.size()>0||removesDoConds.size()>0){
						DEDataSetCond deDataSetCondImpl = new DEDataSetCond();
						deDataSetCondImpl.setCondType(IDEDataSetCond.CONDTYPE_CUSTOM);
						
						String salesos = "";
						if(removesSoConds.size()>0){
							String salesoList = removesSoConds.get(0).getCondValue();
							salesos =StringUtil.getSelectInCon(salesoList);	
						}
						String delivers = "";
						if(removesDoConds.size()>0){
							String deliverList = removesDoConds.get(0).getCondValue();
						    delivers = StringUtil.getSelectInCon(deliverList);
						}								          
						StringBuffer sql = new StringBuffer();
						if(!StringUtil.isEmpty(salesos) && !StringUtil.isEmpty(delivers)){
			            	sql.append("  (sales_order_no in (").append(salesos).append(")");
			            	sql.append(" or deliver_no in (").append(delivers).append("))");
			            }else if(StringUtil.isEmpty(salesos) && !StringUtil.isEmpty(delivers)){
			            	sql.append(" deliver_no in (").append(delivers).append(")");
			            }else if(!StringUtil.isEmpty(salesos) && StringUtil.isEmpty(delivers)){
			            	sql.append(" sales_order_no in (").append(salesos).append(")");
			            }
						deDataSetCondImpl.setCustomCond(sql.toString());
						deDataSetFetchContextImpl.getConditionList().add(deDataSetCondImpl);
					}
				}
			}else{
				List<IDEDataSetCond> removesConds = new ArrayList<IDEDataSetCond>();
				for(IDEDataSetCond cond2:conds){
					if("ORIGINAL_REQ_NO".equals(cond2.getDEFName())){
						removesConds.add(cond2);
					}
				}
				conds.removeAll(removesConds);
				
				if(removesSoConds.size()>0||removesDoConds.size()>0){
					DEDataSetCond deDataSetCondImpl = new DEDataSetCond();
					deDataSetCondImpl.setCondType(IDEDataSetCond.CONDTYPE_CUSTOM);					
					String salesos = "";
					if(removesSoConds.size()>0){
						String salesoList = removesSoConds.get(0).getCondValue();
						salesos =StringUtil.getSelectInCon(salesoList);	
					}
					String delivers = "";
					if(removesDoConds.size()>0){
						String deliverList = removesDoConds.get(0).getCondValue();
					    delivers = StringUtil.getSelectInCon(deliverList);
					}								          
					StringBuffer sql = new StringBuffer();
					if(!StringUtil.isEmpty(salesos) && !StringUtil.isEmpty(delivers)){
		            	sql.append("  (sales_order_no in (").append(salesos).append(")");
		            	sql.append(" or deliver_no in (").append(delivers).append("))");
		            }else if(StringUtil.isEmpty(salesos) && !StringUtil.isEmpty(delivers)){
		            	sql.append(" deliver_no in (").append(delivers).append(")");
		            }else if(!StringUtil.isEmpty(salesos) && StringUtil.isEmpty(delivers)){
		            	sql.append(" sales_order_no in (").append(salesos).append(")");
		            }
					deDataSetCondImpl.setCustomCond(sql.toString());
					deDataSetFetchContextImpl.getConditionList().add(deDataSetCondImpl);
				}			
			}			
			deDataSetFetchContextImpl.setPageSize(100);
			DBFetchResult fetchResult = fetchDEDataSet(deDataSetFetchContextImpl);
			mdAjaxActionResult.setTotalRow(fetchResult.getTotalRow());
			mdAjaxActionResult.setStartRow(deDataSetFetchContextImpl.getStartRow());
			mdAjaxActionResult.setPageSize(deDataSetFetchContextImpl.getPageSize());
			fillFetchResult(mdAjaxActionResult, fetchResult.getDataSet().getDataTable(0));
			fetchResult.getDataSet().close();
			List<JSONObject> list =mdAjaxActionResult.getRows();
			String reqHid = "";
			for(IDEDataSetCond cond:reqHIdConds){
				reqHid = cond.getCondValue();
			}
			for(JSONObject jsonObject:list){
				jsonObject.remove("tms_dr_invoice_req_hid");
				jsonObject.put("tms_dr_invoice_req_hid", reqHid);
			}
			return mdAjaxActionResult;
		}
	}
@Override
	protected AjaxActionResult onFetch() throws Exception {

		MDAjaxActionResult mdAjaxActionResult = createFetchActionResult();
		this.getWebContext().setCurAjaxActionResult(mdAjaxActionResult);

		DEDataSetFetchContext deDataSetFetchContextImpl = new DEDataSetFetchContext(this.getWebContext());
		deDataSetFetchContextImpl.setSessionFactory(this.getSessionFactory());
		IMDCtrlRender iMDCtrlRender = this.getMDCtrlRender();
		if (iMDCtrlRender != null) iMDCtrlRender.fillDEDataSetFetchContext(deDataSetFetchContextImpl);

		if (!this.isEnableUserSort()) {
			deDataSetFetchContextImpl.resetSortInfo();
		}
		if (!StringHelper.isNullOrEmpty(getMinorSortField())) {
			deDataSetFetchContextImpl.setSort2(getMinorSortField());
			deDataSetFetchContextImpl.setSort2Dir(getMinorSortDir());
		}

		if (this.getDefaultPageSize() > 0) {
			deDataSetFetchContextImpl.setDefaultPageSize(this.getDefaultPageSize());
		}

		fillFetchConditions(deDataSetFetchContextImpl);
		fillDEDataSetFetchContext(deDataSetFetchContextImpl);
		if (deDataSetFetchContextImpl.isCancel()) {
			mdAjaxActionResult.setTotalRow(0);
			mdAjaxActionResult.setStartRow(deDataSetFetchContextImpl.getStartRow());
			mdAjaxActionResult.setPageSize(deDataSetFetchContextImpl.getPageSize());
			return mdAjaxActionResult;
		} else {
			fillDEDataSetFetchDataRange(deDataSetFetchContextImpl);
			//获取页面搜索框的查询条件
			DBFetchResult fetchResult = new DBFetchResult();;
			ArrayList<IDEDataSetCond> conditionList = deDataSetFetchContextImpl.getConditionList();
			Map<String,String> map = new HashMap<String,String>();
			for (IDEDataSetCond ideDataSetCond : conditionList) {
				String defName = ideDataSetCond.getDEFName();
				String condValue = ideDataSetCond.getCondValue();
				map.put(defName, condValue);
			}
			//判断条件中是否含客户名称和客户编码
			if(map.containsKey("CUSTOMER_NAME") || map.containsKey("PURCHASER_NUMBER")) {
				//通过客户名称和客户编码查询reqL
				USRTmsDrInvoiceBatchReqLService reqLService = (USRTmsDrInvoiceBatchReqLService) ServiceGlobal.getService(TmsDrInvoiceBatchReqLService.class);
				List<TmsDrInvoiceBatchReqL> reqHlist = reqLService.queryReqHWithCustomerNameAndPurchaseNumber(map);
				if (reqHlist!=null && reqHlist.size()>0) {
					//通过查询出来的结果来查询reqH
					DEDataSetCond deDataSetCondImpl = new DEDataSetCond();
					deDataSetCondImpl.setCondType(IDEDataSetCond.CONDTYPE_CUSTOM);
					String con = "tms_dr_invoice_batch_req_hid in (";
					for (TmsDrInvoiceBatchReqL item : reqHlist) {
						con += "'" + item.getTmsDrInvoiceBatchReqHId() + "',";
					}
					con = con.substring(0, con.length() - 1);
					con += ")";
					deDataSetCondImpl.setCustomCond(con);
					deDataSetFetchContextImpl.getConditionList().add(deDataSetCondImpl);
				}
				fetchResult = fetchDEDataSet(deDataSetFetchContextImpl);
				
			}else {
				fetchResult = fetchDEDataSet(deDataSetFetchContextImpl);
			}
			mdAjaxActionResult.setTotalRow(fetchResult.getTotalRow());
			mdAjaxActionResult.setStartRow(deDataSetFetchContextImpl.getStartRow());
			mdAjaxActionResult.setPageSize(deDataSetFetchContextImpl.getPageSize());
			fillFetchResult(mdAjaxActionResult, fetchResult.getDataSet().getDataTable(0));
			fetchResult.getDataSet().close();
			return mdAjaxActionResult;
		}
	
	}

ibzsys tab问题

获取最新的pub,把改动合并到usr中,这些js很多都自定义过,我这边也碰到这个问题了@bo.wang 

1650124787.jpg

tMSDRInvoiceReqHdraftCreditInvoiceeditviewController 复制代码

var tMSDRInvoiceReqHdraftCreditInvoiceeditviewController = tMSDRInvoiceReqHdraftCreditInvoiceeditviewControllerBase.extend({
	onFormFieldChanged: function (fieldname, field, value) {
	   var me=this;
	   var form=me.getForm();
	   //购方变更
	   if(fieldname=='req_h_customer_id'){
			var id=form.getFieldValue('req_h_customer_id');
			var paraMap = {action:'purchasername',id:id};
			me.loadingTag = IBiz.beginload();
			IBiz.ajax({
				url:controller.getBackendUrl(),
				params:{srfaction: JSON.stringify(paraMap)},
				dataType:'json',
				method:'post',
				success:function(data){
					IBiz.endload(me.loadingTag);
					if (data.ret == 0) {
						var customer = data.content.customer;
						form.setFieldValue('customer_number',customer.customerNumber);
						form.setFieldValue('purchasertaxno',customer.custRegistrationNumber);
						form.setFieldValue('phone_num',customer.contactPhone);
						form.setFieldValue('purchaser_address',customer.custRegistrationAddress);
						form.setFieldValue('purchaser_bank_name',customer.custDepositBankName);
						form.setFieldValue('purchaser_bank_code',customer.custDepositBankAccountNum);
					}
				}
					
			});
	   }
	   //客户编码
	   if(fieldname=='customer_number'){
			var id=form.getFieldValue('customer_number');
			var paraMap = {action:'customer_number',id:id};
			me.loadingTag = IBiz.beginload();
			IBiz.ajax({
				url:controller.getBackendUrl(),
				params:{srfaction: JSON.stringify(paraMap)},
				dataType:'json',
				method:'post',
				success:function(data){
					IBiz.endload(me.loadingTag);
					if (data.ret == 0) {
						var customer = data.content.customer;
						form.setFieldValue('purchasername',customer.customerName);
						form.setFieldValue('purchasertaxno',customer.custRegistrationNumber);
						form.setFieldValue('phone_num',customer.contactPhone);
						form.setFieldValue('purchaser_address',customer.custRegistrationAddress);
						form.setFieldValue('purchaser_bank_name',customer.custDepositBankName);
						form.setFieldValue('purchaser_bank_code',customer.custDepositBankAccountNum);
					}
				}
					
			});
	   }
	   //原蓝字发票号变更
	   if(fieldname=='tms_vat_dr_inv_pol_hid'){
			var id=form.getFieldValue('tms_vat_dr_inv_pol_hid');
			var paraMap = {action:'invoice_number',id:id};
			me.loadingTag = IBiz.beginload();
			IBiz.ajax({
				url:controller.getBackendUrl(),
				params:{srfaction: JSON.stringify(paraMap)},
				dataType:'json',
				method:'post',
				success:function(data){
					IBiz.endload(me.loadingTag);
					if (data.ret == 0) {
						var polH = data.content.PolH;
						form.setFieldValue('invoice_code',polH.invoiceCode);
						form.setFieldValue('total_amount',polH.totalAmount);
						form.setFieldValue('total_tax',polH.totalTax);
						form.setFieldValue('amount_tax',polH.amountTax);
						if(form.getFieldValue('customer_number').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('customer_number',polH.customerNumber);
						}
						if(form.getFieldValue('purchasertaxno').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('purchasertaxno',polH.purchaserTaxNo);
						}
						if(form.getFieldValue('phone_num').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('phone_num',polH.purchasePhone);
						}
						if(form.getFieldValue('purchaser_address').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('purchaser_address',polH.addressPhone);
						}
						if(form.getFieldValue('purchaser_bank_name').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('purchaser_bank_name',polH.bankAccount);
						}
						if(form.getFieldValue('purchaser_bank_code').length==0 || form.getFieldValue('purchasername').length==0){
							form.setFieldValue('purchaser_bank_code',polH.custDepositBankAccountNum);
						}
					}
				}
					
			});
	   }
	   //红字信息表
	   if(fieldname=='tms_dr_invoice_rev_hid'){
			var id=form.getFieldValue('tms_dr_invoice_rev_hid');
			var paraMap = {action:'invoice_rev_h',id:id};
			me.loadingTag = IBiz.beginload();
			IBiz.ajax({
				url:controller.getBackendUrl(),
				params:{srfaction: JSON.stringify(paraMap)},
				dataType:'json',
				method:'post',
				success:function(data){
					IBiz.endload(me.loadingTag);
					if (data.ret == 0) {
						var RevH = data.content.RevH;
						form.setFieldValue('rev_total_amount',RevH.totalAmount);
						form.setFieldValue('application_instruction',RevH.applicationInstruction);
						if(form.getFieldValue('purchasertaxno').length==0){
							form.setFieldValue('purchasertaxno',RevH.purchaserTaxNo);
						}
						if(form.getFieldValue('purchasername').length==0){
							form.setFieldValue('purchasername',RevH.purchaserName);
						}
						if(form.getFieldValue('sales_name').length==0){
							form.setFieldValue('sales_name',RevH.salesName);
						}
						if(form.getFieldValue('sales_tax_no').length==0){
							form.setFieldValue('sales_tax_no',RevH.salesTaxNo);
						}
					}
				}
					
			});
	   }
	   //组织名称
	   if(fieldname=='orgid'){
			var id=form.getFieldValue('orgid');
			var paraMap = {action:'orgid',id:id};
			me.loadingTag = IBiz.beginload();
			IBiz.ajax({
				url:controller.getBackendUrl(),
				params:{srfaction: JSON.stringify(paraMap)},
				dataType:'json',
				method:'post',
				success:function(data){
					IBiz.endload(me.loadingTag);
					if (data.ret == 0) {
						var org = data.content.org;
						var taxPayer = data.content.taxPayer;
						form.setFieldValue('org_code',org.orgCode);
						form.setFieldValue('sales_name',taxPayer.baseTaxPayerName);
						form.setFieldValue('sales_tax_no',taxPayer.taxPayerCode);
					}	
				}
			});
	   }
	   //邮寄信息
	   if(fieldname=='customer_site_id'){
			var id=form.getFieldValue('customer_site_id');
			if(id == null || id=="" || id == 'null'){
				return;
			}
	   }
	   //是否释放交易
	   if(fieldname=='is_write_off'){
		   var is_write_off = form.getFieldValue('is_write_off');
		   var invoice_number = form.getFieldValue('invoice_number');
		   var issue_type = form.getFieldValue('issue_type');
		   if(is_write_off == 1 && invoice_number!=null && invoice_number!='' && issue_type!='special'){
			   var id=form.getFieldValue('tms_vat_dr_inv_pol_hid');
			   var paraMap = {action:'is_write_off',id:id};
			   IBiz.ajax({
				   url:me.config.backendurl,
				   params:{srfaction: JSON.stringify(paraMap)},
				   dateType:'json',
				   method:'post',
				   success:function(date){
					   if( date.content.success== 'false'){
						   IBiz.alert('',date.content.errorMessage,1);
						   form.setFieldValue('is_write_off',0);
					   }
				   },
			   });
		   }
	   }
	   arguments.callee.$.onFormFieldChanged.call(this,fieldname, field, value);
	},
	doDEUIAction:function(uiaction,params){
		var me = this;
		var form=me.getForm();
		if(uiaction.tag=='Save' || 'submitForApproval' == uiaction.tag){
			form.setFieldValue('srfupdatedate',null);
			var issue_type = form.getFieldValue('issue_type');
			if(issue_type ==null || ''==issue_type){
				IBiz.alert('',$IGM('IBIZFORM.SUBMIT.ISSUETYPE.ISNULL','开票类型为空'));
				return;
			}
			var is_write_off = form.getFieldValue('is_write_off');
			if( is_write_off ==null || ''==is_write_off){
				IBiz.alert('',$IGM('IBIZFORM.SUBMIT.ISWRITEOFF.ISNULL','是否释放交易为空'));
				return;
			}
			var operation_type = form.getFieldValue('operation_type');
			if(null == operation_type || operation_type==''){
				IBiz.alert('',$IGM('IBIZFORM.SUBMIT.OPERATIONTYPE.ISNULL','操作类型为空为空'));
				return;
			}
			var invoice_number = form.getFieldValue('invoice_number');
			if ('creditInvoice'==operation_type) {
				if('vatFapiao' == issue_type || 'eFapiao' == issue_type ){
					if(invoice_number==null || invoice_number==''){
						IBiz.alert('',$IGM('IBIZFORM.SUBMIT.INVOICENUMBER.ISNULL','蓝字发票号码不能为空'));
						return;
					}
				}
				//如果操作类型是红冲,并且是专票,则蓝字发票不能为空
				if('special' == issue_type){
					if(is_write_off == 1){
						if(invoice_number==null || invoice_number==''){
							IBiz.alert('',$IGM('IBIZFORM.SUBMIT.INVOICENUMBER.SPECIALCREDIT','专票红冲选择了释放交易,蓝字发票号码不能为空'));
							return;
						}
					}
				}
			}
			if('voidInvoice'==operation_type){
				if(invoice_number==null || invoice_number==''){
					IBiz.alert('',$IGM('IBIZFORM.SUBMIT.INVOICENUMBER.ISNULL','蓝字发票号码不能为空'));
					return;
				}
			}
		}
		arguments.callee.$.doDEUIAction.call(this,uiaction,params);
	}
});

下载列控制器

子系统==>表现管理==>系统表现管理==>应用框架插件==>

导入关闭后刷新数据

在...GridViewController中添加

/**
	 * 打开界面行为视图
	 * @param uiaction 行为
	 */
	openUIActionView:function(frontview,viewparam)
	{
		//alert(1);
		var me = this;
		var callback;
		if(viewparam && viewparam.callback){
			callback = viewparam.callback;
			delete viewparam.callback;
		}
		var win = $.getIBizApp().createWindow({});
		win.scope = me;
		win.title = frontview.title;
		win.height = frontview.height ? frontview.height: 0;
		win.width = frontview.width ? frontview.width: 0;
		win.url = $.getIBizApp().parseURL2(	frontview.subapp,frontview.viewurl, {windowid : win.getId(),openerid : me.getId()});
		win.viewparam = viewparam;
		win.callback = function(win) {
			//alert(2);
			me.getGrid().refresh();
			if(callback && typeof(callback) == 'function'){
				callback({win:win});
			}
		}
		
		var modal=false;
		if(frontview.openMode=='POPUPMODAL')
		{
			modal = true;
		}
		if(modal){
			win.openModal(window);
		} else {
			win.openInNewWindow(window);
		}
	}

etUSRTMSDRInvoiceReqHDAO().executeCreateSql

 TMSDRInvoiceReqH tMSDRInvoiceReqH = new TMSDRInvoiceReqH();
 reqh.copyTo(tMSDRInvoiceReqH, true);
 DBCallResult dbCallResult = getUSRTMSDRInvoiceReqHDAO().executeCreateSql(null, tMSDRInvoiceReqH, false);
 if (dbCallResult.isError()) {
   throw new ErrorException(Errors.INTERNALERROR, dbCallResult.getErrorInfo());
 }

get不返回错误

USRTMSDRInvoiceReqH ureqh = new USRTMSDRInvoiceReqH();
ureqh.setTMSDRInvoiceReqHId(reqh.getSourceReqDocID());
boolean isexist = reqHService.get(ureqh, true);

true 表示这条数据找到,false表示这条数据没找到

doSleep

doSleep : function(d){
 for(var t = Date.now();Date.now() - t <= d;);
}

表格行数据判断

 doDEUIAction: function(uiaction,params) {
		var me = this;
		if (uiaction.tag == 'creditInvoice') {
			
			var  selectedData =  me.getGrid().getSelection() ;
	     	if(selectedData==null||selectedData.length==0)
	     		return;
	     	var selectData = me.getGrid().getSelection()[0];
			var invoice_print_status = selectData["invoice_print_status"];   
			if('printed'!=invoice_print_status){
				IBiz.alert('提示','请选择已打印的发票!');
				return;
			}
					
		}

行数据双击

var tMSDRInvoiceReqHvoidCreditRecGridViewController = tMSDRInvoiceReqHvoidCreditRecGridViewControllerBase
		.extend({
			getEditDataView : function(arg) {
				if (!arg)
					arg = {};

				var me = this;
				var selectedData = me.getGrid().getSelection();
				if (selectedData == null || selectedData.length == 0) {
					IBiz.alert('', '请选择数据', 2);
					return;
				}
				var data = selectedData[0];
				var url = "";
				if ("voidInvoice" == data.operation_type) {
					url = "/dreditinvoicemgt/tmsdrinvoicereqhincomefinancreditinproeditview.jsp";
				} else if ("creditInvoice" == data.operation_type) {
					url = "/dreditinvoicemgt/tmsdrinvoicereqhincomefinanvoidinproeditview.jsp";
				} else {
					url = '/dreditinvoicemgt/tmsdrinvoicereqheditview.jsp';
				}
				return {
					title : '红冲/作废申请-待办',
					openMode : '',
					height : 0,
					width : 0,
					layout : 'fit',
					maximizable : true,
					viewurl : url,
					viewparam : arg
				};
			}
		});

页面刷新

var TmsDrInvManLTmpEditViewController = TmsDrInvManLTmpEditViewControllerBase.extend({
	doDEUIAction: function(uiaction,params) {
		var me = this;
		var param = me.getViewParam();
		
		var pcontroller = window.parent.controller;
		var isTax = pcontroller.getForm().getFieldValue('is_tax');
		var issueType = pcontroller.getForm().getFieldValue('issue_type');
		var reqOrgId = pcontroller.getForm().getFieldValue('req_org_id');
		me.getForm().setFieldValue('head_is_tax', isTax);  
		me.getForm().setFieldValue('srfmajortext', issueType);  
		me.getForm().setFieldValue('srforikey', reqOrgId);  
		
		//var aa = me.getForm().getFieldValue('head_is_tax');
		
		/*param.head_is_tax = isTax;
		params.head_is_tax = isTax;
		param.head_is_tax_new = isTax;
		params.head_is_tax_new = isTax;
		
		me.getViewParam()['head_is_tax'] = isTax;
		me.getViewParam()['head_is_tax_new'] = isTax;*/
		
		//var data = this.getValues();
		
		if (uiaction.tag == 'SaveAndExit') {
			arguments.callee.$.doDEUIAction.call(this,uiaction,params);
			
			//me.doSleep(1000);
			
			/*var controller = window.parent.controller;
			console.log(controller);
			var gridcontroller = controller.getController("C2");
			console.log(gridcontroller);
			gridcontroller.onSearchFormSearched();	
			me.closeWindow();
			
			return;*/
		} else {
			arguments.callee.$.doDEUIAction.call(this,uiaction,params);
		}
	},
	
	saveData: function(arg) {
		if (!arg) arg = {};
		//this.getForm().save2(arg);
		this.save2AA(arg);
	},
	
	save2AA: function (arg) {
    	//var me = this;
    	var me = this.getForm();
        if (!arg)
            arg = {};
        if(IBizApp_Data)
        	arg.srfappdata=IBizApp_Data;
        //var data = this.getValues();
        var data = me.getValues();
        $.extend(arg, data);
        
        if (data.srfuf == "1")
        	$.extend(arg, { srfaction: 'update' });
        else
        	$.extend(arg, { srfaction: 'create' });
        //获取所有Disabled数据
        var disablevalues = {};
        //$.each(this.fieldMap,function (name,item) {
        $.each(me.fieldMap,function (name,item) {
            if (item.isDisabled()) {
                if (disablevalues[item.name] == undefined) {
                	disablevalues[item.name] = item.getValue();
                }
            }
        });
        $.extend(arg, disablevalues);
        
        arg.srfcancel=false;
     	me.fireEvent( IBizEditForm.FORMBEFORESAVE, me,arg);
        if(arg.srfcancel==true){
        	return;
        }
        delete arg.srfcancel;
        
        me.ignoreUFI = true;
        me.ignoreformfieldchange=true;
        
        this.submitAA(arg,function (form, action) {
		            me.resetFormError();
		            me.setFieldAsyncConfig(action.config);
		            me.setFieldState(action.state);
		            me.setDataAccAction(action.dataaccaction);
		            me.fillForm(action.data);
		            me.formDirty = false;
		            //判断是否有提示
		            if (action.info && action.info != '') {
    					IBiz.alert('',action.info,1);
    				}
		            me.fireEvent('formsaved', me,action);
		            me.ignoreUFI = false;
		            me.ignoreformfieldchange=false;
		            me.fireEvent('formfieldchanged', null);
		            me.onSaved();
        		},
        		function (form, action) {
        			if (action.error) {
        				me.setFormError(action.error);
        			}
        			
        			me.ignoreUFI = false;
        			me.ignoreformfieldchange=false;
        			
        			me.fireEvent(IBizEditForm.FORMSAVEERROR, me);
        			
        			action.failureType = 'SERVER_INVALID';
        			if(action.ret==10)
        			{
        				IBiz.confirm2('',$IGM('IBIZEDITFORM.SAVE2FAILED2.INFO',"保存数据发生错误,"+me.getActionErrorInfo(action)+',是否要重新加载数据?',[me.getActionErrorInfo(action)]),2,function (ret){
        					if(ret)
        						me.reload();
        				});
        			}
        			else
        			{
        				IBiz.alert('',$IGM('IBIZEDITFORM.SAVE2FAILED.INFO',"保存数据发生错误,"+me.getActionErrorInfo(action),[me.getActionErrorInfo(action)]),2);
        			}
        		}
        	);
    }, 
    
    submitAA:function(arg,success,failure){
		var me = this.getForm();
		var currentObj = this;
		//var me = this;
		if(!arg)
			arg = {};
		me.loadingTag = IBiz.beginload();
		//IBiz.ajax({url:this.backendurl,
		IBiz.ajax({url:me.backendurl,
			params:arg,
			method:'POST',
			success:function(data){
				 IBiz.endload(me.loadingTag);
				 if(data.ret == 0) {
					var controller = window.parent.controller;
					console.log(controller);
					var gridcontroller = controller.getController("C2");
//					console.log(gridcontroller);
					if(gridcontroller){
						gridcontroller.onSearchFormSearched();
					}
					
					controller.getForm().setFieldValue('total_tax',data.data.totalTax);
					controller.getForm().setFieldValue('total_amount',data.data.totalNetAmount);
					controller.getForm().setFieldValue('amount_tax',data.data.totalAmount);
					controller.getForm().findField('is_tax').setDisabled('true');
					success(me,data);
					//this.closeWindow();
					//window.close();
					//this.close();
					//me.closeWindow();
					currentObj.closeWindow();
					return;
				}
				else
					failure(me,data);
			},
			failure:function(e){
				IBiz.endload(me.loadingTag);
				failure(me,{ret:1000,errorMessage:$IGM('IBIZFORM.SUBMIT.ERROR','请求发生错误')});
			}
		});
	},
	
	doSleep : function(d){
  	  for(var t = Date.now();Date.now() - t <= d;);
    }
	
	,onFormFieldChanged: function (fieldname, field, value) {
		   var me=this;
		   var form=me.getForm();
		   arguments.callee.$.onFormFieldChanged.call(this,fieldname, field, value);
		   if(fieldname=='acctd_amount_cr'){
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
			   if (headIsTax == '0') {
			       var acctdAmountCr=form.getFieldValue('acctd_amount_cr');
			       if (acctdAmountCr == ''){
			    	   acctdAmountCr = 0;
			       } else {
			    	   acctdAmountCr = parseFloat(acctdAmountCr);
			       }
			       var vatAmount = 0;
			       var invoiceAmount = 0;
			       vatAmount = acctdAmountCr * taxRate;
		    	   invoiceAmount = acctdAmountCr + vatAmount;
		    	   form.setFieldValue('invoice_amount', invoiceAmount.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }   
		   } else if(fieldname=='invoice_amount') {
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
			   if (headIsTax == '1') {
			       var invoiceAmount=form.getFieldValue('invoice_amount');
			       if (invoiceAmount == ''){
			    	   invoiceAmount = 0;
			       } else {
			    	   invoiceAmount = parseFloat(invoiceAmount);
			       }
			       var vatAmount = 0;
			       var acctdAmountCr = 0;
			       vatAmount = (invoiceAmount / (1+taxRate))*taxRate;
		    	   acctdAmountCr = invoiceAmount - vatAmount;
		    	   form.setFieldValue('acctd_amount_cr', acctdAmountCr.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }
		   } else if(fieldname=='tax_rate') {
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
		       if (headIsTax == '0') {
			       var acctdAmountCr=form.getFieldValue('acctd_amount_cr');
			       if (acctdAmountCr == ''){
			    	   acctdAmountCr = 0;
			       } else {
			    	   acctdAmountCr = parseFloat(acctdAmountCr);
			       }
			       var vatAmount = 0;
			       var invoiceAmount = 0;
			       vatAmount = acctdAmountCr * taxRate;
		    	   invoiceAmount = acctdAmountCr + vatAmount;
		    	   form.setFieldValue('invoice_amount', invoiceAmount.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }  else if (headIsTax == '1') {
			       var invoiceAmount=form.getFieldValue('invoice_amount');
			       if (invoiceAmount == ''){
			    	   invoiceAmount = 0;
			       } else {
			    	   invoiceAmount = parseFloat(invoiceAmount);
			       }
			       var vatAmount = 0;
			       var acctdAmountCr = 0;
			       vatAmount = (invoiceAmount / (1+taxRate))*taxRate;
		    	   acctdAmountCr = invoiceAmount - vatAmount;
		    	   form.setFieldValue('acctd_amount_cr', acctdAmountCr.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }
		   }
		  
	}
});

uudate sql

用于数据不一致啥的

	StringBuffer updateSql = new StringBuffer();
				updateSql.append(
						"update t_tms_drvat_trx_pool  set status = '10',tms_dr_invoice_req_lid = null where tms_dr_invoice_req_lid = ? ");
				SqlParamList sqlParamList = new SqlParamList();
				String reqLid = tMSDRInvoiceReqL.getTMSDRInvoiceReqLId();
				sqlParamList.addString(reqLid);
				dbCallResult = getTMSDRInvoiceReqLDAO().executeRawSql(null, updateSql.toString(), sqlParamList);
				if (dbCallResult.isError()) {
					throw new ErrorException(Errors.INTERNALERROR, dbCallResult.getErrorInfo());
				}

onFormFieldChanged

,onFormFieldChanged: function (fieldname, field, value) {
		   var me=this;
		   var form=me.getForm();
		   arguments.callee.$.onFormFieldChanged.call(this,fieldname, field, value);
		   if(fieldname=='acctd_amount_cr'){
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
			   if (headIsTax == '0') {
			       var acctdAmountCr=form.getFieldValue('acctd_amount_cr');
			       if (acctdAmountCr == ''){
			    	   acctdAmountCr = 0;
			       } else {
			    	   acctdAmountCr = parseFloat(acctdAmountCr);
			       }
			       var vatAmount = 0;
			       var invoiceAmount = 0;
			       vatAmount = acctdAmountCr * taxRate;
		    	   invoiceAmount = acctdAmountCr + vatAmount;
		    	   form.setFieldValue('invoice_amount', invoiceAmount.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }   
		   } else if(fieldname=='invoice_amount') {
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
			   if (headIsTax == '1') {
			       var invoiceAmount=form.getFieldValue('invoice_amount');
			       if (invoiceAmount == ''){
			    	   invoiceAmount = 0;
			       } else {
			    	   invoiceAmount = parseFloat(invoiceAmount);
			       }
			       var vatAmount = 0;
			       var acctdAmountCr = 0;
			       vatAmount = (invoiceAmount / (1+taxRate))*taxRate;
		    	   acctdAmountCr = invoiceAmount - vatAmount;
		    	   form.setFieldValue('acctd_amount_cr', acctdAmountCr.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }
		   } else if(fieldname=='tax_rate') {
			   var headIsTax=form.getFieldValue('head_is_tax');
		       var taxRate=form.getFieldValue('tax_rate');
		       if (headIsTax == '') {
		    	   headIsTax = '0';
		       }
		       if (taxRate == '') {
		    	   taxRate = 0;
		       } else {
		    	   taxRate = parseFloat(taxRate) * 0.01;
		       }
		       if (headIsTax == '0') {
			       var acctdAmountCr=form.getFieldValue('acctd_amount_cr');
			       if (acctdAmountCr == ''){
			    	   acctdAmountCr = 0;
			       } else {
			    	   acctdAmountCr = parseFloat(acctdAmountCr);
			       }
			       var vatAmount = 0;
			       var invoiceAmount = 0;
			       vatAmount = acctdAmountCr * taxRate;
		    	   invoiceAmount = acctdAmountCr + vatAmount;
		    	   form.setFieldValue('invoice_amount', invoiceAmount.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }  else if (headIsTax == '1') {
			       var invoiceAmount=form.getFieldValue('invoice_amount');
			       if (invoiceAmount == ''){
			    	   invoiceAmount = 0;
			       } else {
			    	   invoiceAmount = parseFloat(invoiceAmount);
			       }
			       var vatAmount = 0;
			       var acctdAmountCr = 0;
			       vatAmount = (invoiceAmount / (1+taxRate))*taxRate;
		    	   acctdAmountCr = invoiceAmount - vatAmount;
		    	   form.setFieldValue('acctd_amount_cr', acctdAmountCr.toFixed(2));
		    	   form.setFieldValue('vat_amount', vatAmount.toFixed(2));
			   }
		   }
		   if(fieldname=='inventory_item_qty'||fieldname=='tax_rate'||fieldname=='invoice_amount'||fieldname=='acctd_amount_cr') {
			   var headIsTax=form.getFieldValue('head_is_tax');
			   /*
			    * 对于tmsdrinvmanltmpeditview.jsp、tmsdrinvoicemanleditview.jsp两个页面
				1、如果抬头是否含税为【是】,单价=本次开票总金额/数量
				2、如果抬头是否含税为【否】,单价=本次开票金额(不含税)/数量
			    */
		       var inventory_item_qty=form.getFieldValue('inventory_item_qty');
		       if(inventory_item_qty!=null&&''!=inventory_item_qty){
				   if (headIsTax == '0') {
					   var price_of_unit=form.getFieldValue('acctd_amount_cr')/inventory_item_qty;
					   form.setFieldValue('price_of_unit', price_of_unit.toFixed(10));
				   }else if (headIsTax == '1') {
					   var price_of_unit=form.getFieldValue('invoice_amount')/inventory_item_qty;
					   form.setFieldValue('price_of_unit', price_of_unit.toFixed(10));
				   }
		       }
		   }
		  
	}

保存后页面跳转

var tMSDRInvoiceReqHinvIssApprvAtTime_D_WFEditView3ManualTmpController = tMSDRInvoiceReqHinvIssApprvAtTime_D_WFEditView3ManualTmpControllerBase.extend({
	saveData: function(arg) {
		if (!arg) arg = {};
		//this.getForm().save2(arg);
		this.save2AA(arg);
	},
	
	save2AA: function (arg) {
    	//var me = this;
    	var me = this.getForm();
        if (!arg)
            arg = {};
        if(IBizApp_Data)
        	arg.srfappdata=IBizApp_Data;
        //var data = this.getValues();
        var data = me.getValues();
        $.extend(arg, data);
        
        if (data.srfuf == "1")
        	$.extend(arg, { srfaction: 'update' });
        else
        	$.extend(arg, { srfaction: 'create' });
        //获取所有Disabled数据
        var disablevalues = {};
        //$.each(this.fieldMap,function (name,item) {
        $.each(me.fieldMap,function (name,item) {
            if (item.isDisabled()) {
                if (disablevalues[item.name] == undefined) {
                	disablevalues[item.name] = item.getValue();
                }
            }
        });
        $.extend(arg, disablevalues);
        
        arg.srfcancel=false;
     	me.fireEvent( IBizEditForm.FORMBEFORESAVE, me,arg);
        if(arg.srfcancel==true){
        	return;
        }
        delete arg.srfcancel;
        
        me.ignoreUFI = true;
        me.ignoreformfieldchange=true;
        
        this.submitAA(arg,function (form, action) {
		            me.resetFormError();
		            me.setFieldAsyncConfig(action.config);
		            me.setFieldState(action.state);
		            me.setDataAccAction(action.dataaccaction);
		            me.fillForm(action.data);
		            me.formDirty = false;
		            //判断是否有提示
		            if (action.info && action.info != '') {
    					IBiz.alert('',action.info,1);
    				}
		            me.fireEvent('formsaved', me,action);
		            me.ignoreUFI = false;
		            me.ignoreformfieldchange=false;
		            me.fireEvent('formfieldchanged', null);
		            me.onSaved();
        		},
        		function (form, action) {
        			if (action.error) {
        				me.setFormError(action.error);
        			}
        			
        			me.ignoreUFI = false;
        			me.ignoreformfieldchange=false;
        			
        			me.fireEvent(IBizEditForm.FORMSAVEERROR, me);
        			
        			action.failureType = 'SERVER_INVALID';
        			if(action.ret==10)
        			{
        				IBiz.confirm2('',$IGM('IBIZEDITFORM.SAVE2FAILED2.INFO',"保存数据发生错误,"+me.getActionErrorInfo(action)+',是否要重新加载数据?',[me.getActionErrorInfo(action)]),2,function (ret){
        					if(ret)
        						me.reload();
        				});
        			}
        			else
        			{
        				IBiz.alert('',$IGM('IBIZEDITFORM.SAVE2FAILED.INFO',"保存数据发生错误,"+me.getActionErrorInfo(action),[me.getActionErrorInfo(action)]),2);
        			}
        		}
        	);
    }, 
    
    submitAA:function(arg,success,failure){
		var me = this.getForm();
		var currentObj = this;
		//var me = this;
		if(!arg)
			arg = {};
		me.loadingTag = IBiz.beginload();
		//IBiz.ajax({url:this.backendurl,
		IBiz.ajax({url:me.backendurl,
			params:arg,
			method:'POST',
			success:function(data){
				 IBiz.endload(me.loadingTag);
				 if(data.ret == 0) {
					var controller = window.controller;
	
					success(me,data);

					//currentObj.closeWindow();
					//var newUrl = window.location.protocol + "//" + window.location.host + controller.config.webctx + "/jsp/todoList.rest"
					var newUrl = window.location.href;
					//0005638: 非租赁业务手工开票--申请页面和复核页面的页面跳转    在新建页面点击保存按钮保存数据到正式表,然后页面跳转到tMSDRInvoiceReqHincomeDraftEditView;

//					newUrl = newUrl.replace("tmsdrinvoicereqhinvissapprvattime_d_wfeditview3manualtmp.jsp","tmsdrinvoicereqhinvoiceissueapprovalattime_d_wfeditview3manual.jsp");
					newUrl = newUrl.replace("tmsdrinvoicereqhinvissapprvattime_d_wfeditview3manualtmp.jsp","tMSDRInvoiceReqHincomeDraftEditView.jsp");
					newUrl += "&srfkey=" + data.data.srfkey + "&srfeditmode2=MSTAG%3Amanual";
					window.location.href = newUrl;
					return;
				}
				else
					failure(me,data);
			},
			failure:function(e){
				IBiz.endload(me.loadingTag);
				failure(me,{ret:1000,errorMessage:$IGM('IBIZFORM.SUBMIT.ERROR','请求发生错误')});
			}
		});
	}
});

格式化货物数量

 formatpriceofunit:function(num){
		var numstr=num+"";
		var dotindex = numstr.indexOf('.');
		if(dotindex>=0){
			var parts=numstr.split(".");
			var front=parts[0];
			var end="0."+parts[1];
			var endnum=Math.floor(parseFloat(end)*100000000000)/100000000000;
			return parseFloat(front)+endnum;
		}else{
			return num;
		}

gridEditItemChange

/**
   * 表格编辑项值变化
   *
   * @public
   * @param row 行数据
   * @param property 列编辑项名
   * @param row 列编辑项值
   * @returns {void}
   * @memberof MainBase
   */
  public gridEditItemChange(row: any, property: string, value: any, rowIndex: number) {
    row.rowDataState = row.rowDataState ? row.rowDataState : "update";
    if (Object.is(row.rowDataState, "update")) {
      if (this.defaultUpdateItems.includes(property)) {
        row.hasUpdated = true;
      }
    }
    //新件差异数量 new_gap_qty=实盘新件库存 actual_new_qty- 新件库存 new_qty
    let actual_new_qty = row.actual_new_qty;
    let new_qty = row.new_qty;
    let new_gap_qty = actual_new_qty - new_qty;
    row.new_gap_qty = new_gap_qty;
    // this.resetGridData(row, "new_gap_qty", rowIndex);
    //旧件差异数量 old_gap_qty=实盘旧件库存 actual_old_qty - 旧件库存 old_qty
    let actual_old_qty = row.actual_old_qty;
    let old_qty = row.old_qty;
    let old_gap_qty = actual_old_qty - old_qty;
    row.old_gap_qty = old_gap_qty;
    // 残次件差异数量 defective_gap_qty=实盘残次件库存 actual_defective_qty - 残次件库存 defective_qty
    let actual_defective_qty = row.actual_defective_qty;
    let defective_qty = row.defective_qty;
    let defective_gap_qty = actual_defective_qty - defective_qty;
    row.defective_gap_qty = defective_gap_qty;
    // 4.新件差异数量 new_gap_qty 或者 旧件差异数量 old_gap_qty 或者 残次件差异数量 defective_gap_qty 不为0时,是否差异 is_gap=是
    if (new_gap_qty != 0 || old_gap_qty != 0 || defective_gap_qty != 0) {
      row.is_gap = 1
    }
    this.curEditRowData = row;
    this.resetGridData(row, property, rowIndex);
    this.validate(property, row, rowIndex);
  }

  public validate(property: string, data: any, rowIndex: number): Promise<any> {
    return new Promise((resolve, reject) => {
      this.$util.validateItem(property, data, this.rules()).then(() => {
        this.gridItemsModel[rowIndex][property].setError(null);
        this.processValidate(property, data, rowIndex, resolve);
        resolve(true);
      }).catch(({errors, fields}) => {
        this.gridItemsModel[rowIndex][property].setError(errors[0].message);
        resolve(false);
      });
    });
  }

  /*
 1.实盘旧件库存 actual_old_qty 不能小于 旧件库存 old_qty
2.实盘残次件库存 actual_defective_qty不能小于 残次件库存 defective_qty
  新件差异数量 new_gap_qty=实盘新件库存 actual_new_qty- 新件库存 new_qty
  旧件差异数量 old_gap_qty=实盘旧件库存 actual_old_qty - 旧件库存 old_qty
  残次件差异数量 defective_gap_qty=实盘残次件库存 actual_defective_qty - 残次件库存 defective_qty
  4.新件差异数量 new_gap_qty 或者 旧件差异数量 old_gap_qty 或者 残次件差异数量 defective_gap_qty 不为0时,是否差异 is_gap=是
  5.新件差异数量>0时 new_gap_qty,差异原因 gap_reason必填
   */
  public processValidate(property: string, data: any, rowIndex: number, resolve: any) {
    if ("actual_old_qty" === property) {
      const old_qty = data.old_qty;
      const actual_old_qty = data.actual_old_qty;
      let msg = "实盘旧件库存:" + actual_old_qty + "不能小于旧件库存:" + old_qty;
      if (actual_old_qty < old_qty) {
        this.gridItemsModel[rowIndex][property].setError(msg);
        if (resolve) {
          resolve(false);
        }
      }
    } else if ("actual_defective_qty" === property) {
      const actual_defective_qty = data.actual_defective_qty;
      const defective_qty = data.defective_qty;
      let msg = "实盘残次件库存:" + actual_defective_qty + "不能小于残次件库存:" + defective_qty;
      if (actual_defective_qty < defective_qty) {
        this.gridItemsModel[rowIndex][property].setError(msg);
        if (resolve) {
          resolve(false);
        }
      }
    } else if ("gap_reason" === property) {
      let new_gap_qty = data.new_gap_qty;
      const gap_reason = data.gap_reason;
      if (new_gap_qty > 0 && (gap_reason === null || gap_reason === undefined || gap_reason === "")) {
        let msg = "新件差异数量>0时差异原因必填";
        if (resolve) {
          this.gridItemsModel[rowIndex][property].setError(msg);
          resolve(false);
        }
      }
    }
  }

报表使用

<%@page import="com.deloitte.tms.reporttmpl.utils.AssertHelper"%>
<%@page import="com.deloitte.tms.reporttmpl.utils.PropertiesUtils"%>
<%@page import="java.util.Date"%>
<%@page import="com.deloitte.tms.reporttmpl.utils.ReportTmplUtils"%>
<%@page import="com.deloitte.tms.vat.vat.util.CoreAPIUtil" %>
<%@page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
</head>
<body>
<div class="fr">
<%
String reportType=null;
String erro=null;
String rpturl=CoreAPIUtil.getReportHost();
try{
 String tmplPath=ReportTmplUtils.getReportPath(new Date(), "TMS_VAT_INPUTDETAIL_VIEW");
 reportType=tmplPath+"&USERID="+"&op=write";
}catch(Exception e){
  erro=e.getMessage();
}
%>
<%if(AssertHelper.notEmpty(erro)){%>
<%=erro %>
        <%}else{%>
	<!--<iframe id="rfiframe" style="width: 100%; border: 0px; height: 400px;"
	src="<%=rpturl%>/ReportServer?reportlet=<%=reportType%>"
	frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes">
	</iframe>-->

	<iframe id="rfiframe" style="width: 100%; border: 0px; height: 400px;"
	src="<%=rpturl%>/ReportServer?reportlet=<%=reportType%>"
	frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes">
	</iframe>
<%}%>
</div>
</body>
</html>