Ext.define('erp.view.common.print.Form',{ extend: 'Ext.form.Panel', alias: 'widget.erpPrintFormPanel', id: 'printform', autoScroll : true, defaultType : 'textfield', layout: 'column', labelSeparator : ':', fieldDefaults : { margin : '2 2 2 2', fieldStyle : "background:#FFFAFA;color:#515151;", labelAlign : "right", blankText : $I18N.common.form.blankText }, FormUtil: Ext.create('erp.util.FormUtil'), buttonAlign: 'center', buttons: [{ name: 'print', text: $I18N.common.button.erpPrintButton, iconCls: 'x-button-icon-print', cls: 'x-btn-gray', style: { marginLeft: '10px' }, handler:function(btn){ var form = Ext.getCmp('printform'); console.log(form); var reportName=''; var condition=''; var cop=form.title; var code=''; var custcode=''; var prodcode=''; var fromdate=''; var enddate=''; console.log(cop); var id="1"; var idS=''; var vendorcode=''; var purchaseman=''; var status=''; var whcode=''; var salecode=''; var todate=''; var dateFW=''; var assifall=''; var tablename=form.tablename; console.log("tablename="+tablename); console.log(form.caller); var defaultCondition=""; var thisreport=""; if(cop=="销售额同比增长图(按业务员)"||cop=="销售额同比增长图(按业务员)"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="出入库明细表(过账日期)"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date1').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date1').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="明细分类账报表"){ fromdate=Ext.Date.format(Ext.getCmp('sl_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('sl_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="期间库存表"){ fromdate=Ext.Date.format(Ext.getCmp('pw_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pw_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="出货成本汇总表"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="未发货客户订单明细表"){ fromdate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('sa_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="库存周转率分析表"||cop=="原材料周转天数表"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="产品分析表"){ fromdate=Ext.Date.format(Ext.getCmp('vr_recorddate').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('vr_recorddate').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="集团业务员考核"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="供应商交货达成率报表"){ fromdate=Ext.Date.format(Ext.getCmp('pd_delivery').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pd_delivery').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="毛利润分析(按订单)"){ fromdate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('sa_date').secondVal, 'Y-m-d'); console.log(fromdate); console.log(todate); } if(cop=="采购成本降价表(按最新入库)"){ fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d'); todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d'); enddate=Ext.Date.format(Ext.getCmp('pi_date1').value, 'Y-m-d'); console.log(fromdate); console.log(todate); console.log(enddate); } if(cop=="在制仓库库存表(汇总)"){ var myDate = new Date(); var y=myDate.getFullYear(); var m=myDate.getMonth()+1; var d=myDate.getDate(); m=m<10?"0"+m:m; d=d<10?"0"+d:d; todate=y+"-"+m+"-"+d; } if(cop=="制造单备料单(A4)"){ //var today=new Date()(); // 获取今天时间 //today.setDate()(today.getDate()() + 7); // 系统会自动转换 idS=Ext.getCmp('ma_code').value; } if(cop=="客户信用执行报表"){ todate=Ext.getCmp('ccr_yearmonth').value; } if(cop=="派车费用统计"){ var dateRange=Ext.getCmp('tt_date'); dateFW=dateRange.value; var custcode=Ext.getCmp('tt_carcode').value; todate=custcode; fromdate=Ext.getCmp('tt_date').firstVal; enddate=Ext.getCmp('tt_date').secondVal; } if(cop=="销售订单达成率表"){ todate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d');; } if(cop=="死库存统计(按业务员)"||cop=="死库存统计(按业务员)"||cop=="呆库存统计(按业务员)"||cop=="呆库存统计(按公司)"){ todate=Ext.Date.format(Ext.getCmp('ba_date').value, 'Y-m-d');; } if(cop=="在制仓库库存表(制单)"){ var myDate = new Date(); var y=myDate.getFullYear(); var m=myDate.getMonth()+1; var d=myDate.getDate(); m=m<10?"0"+m:m; d=d<10?"0"+d:d; todate=y+"-"+m+"-"+d; } /* if(cop=="未发货客户订单明细表"){ var dateRange=Ext.getCmp('sa_date'); var dateValuePrint=dateRange.valuePrint; dateFW=dateRange.value; } */ var me = this; Ext.Ajax.request({ url : basePath + 'common/enterprise/getprinturl.action?caller=' + caller, callback: function(opt, s, r) { var re = Ext.decode(r.responseText); defaultCondition = re.condition; thisreport=re.reportname; console.log(defaultCondition); if(defaultCondition!=null){ if(commonContition!=""){ commonContition=defaultCondition+' and '+commonContition; }else{ commonContition=defaultCondition; } } //=========================================== var whichsystem = re.whichsystem; var urladdress = ""; var rpname = re.reportName; //console.log(rpname); if(Ext.isEmpty(rpname) || rpname == "null"){ urladdress = re.printurl; } else if(rpname.indexOf(thisreport) > 0){ urladdress = re.ErpPrintLargeData; } else{ urladdress = re.printurl; } //console.log(reportName); //console.log(re.ErpPrintLargeData); console.log(urladdress); console.log(whichsystem); //=============================================== console.log(commonContition); form.FormUtil.batchPrint(idS,thisreport,commonContition,cop,todate,dateFW,fromdate,enddate,urladdress,whichsystem); //在这里传条件和报表名字 } }); var length=form.items.length; var i=0; var tablename=form.tablename; var reportName=""; var thisvalue=""; var field=""; var logicField=""; //设置一个默认条件 // var defaultContition=form.detailcondition; var commonContition=defaultCondition; while(i0||logicField.indexOf('sellerid')>0||logicField.indexOf('yearmonth')>0){ commonContition+=' and '+'{'+logicField+'}='+thisvalue; }else if(cop=="集团毛利润汇总表"||cop=="集团毛利润分析表-按客户"||cop=="集团毛利润分析表-按品牌"||cop=="集团毛利润分析表-按业务员"||cop=="集团应收汇总表"||cop=="集团应付汇总表"||cop=="集团呆库存汇总表-按业务员"||cop=="集团死库存汇总表-按业务员"||cop=="集团呆库存汇总表-按业务员"||cop=="集团毛利润明细分析表"){ var arrcode=''; strs=thisvalue.split(","); if(strs.length>1){ for(i=0;i0||logicField.indexOf('sellerid')>0||logicField.indexOf('yearmonth')>0){ console.log("ffff"); if(cop=="成本汇总表"){ commonContition='{'+logicField+'}='+"'"+thisvalue+"'"; }else{ commonContition='{'+logicField+'}='+thisvalue; } } else{ if(cop=="分仓库库存报表"||cop=="仓库盘点表(按品牌规格)"||cop=="集团库存数量金额表"||cop=="集团库存汇总表"||cop=="集团品牌库存汇总表"||cop=="集团银行余额汇总表"||cop=="集团业务员应付汇总表"){ var arrcode=''; var strs= new Array(); if(cop=="分仓库库存报表"||cop=="仓库盘点表(按品牌规格)"){ strs=thisvalue.split("#"); }else{ strs=thisvalue.split(","); } if(strs.length>1){ for(i=0;i'+"'已结案'"; if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } if(prodcode!=""){ condition+=' and '+'{saledetail.sd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="未发货客户订单明细表"){ reportName="saledetailnotsend"; var dateRange=Ext.getCmp('sa_date'); var dateValuePrint=dateRange.valuePrint; dateFW=dateRange.value; console.log(dateFW); var conditiondate = dateValuePrint; var custcode=Ext.getCmp('sa_custcode').value; var sellercode=Ext.getCmp('sa_sellercode').value; condition=conditiondate+' and '+'{SaleDetail.sd_qty}-{SaleDetail.sd_sendqty}>0.001'+' and '+'{sale.sa_status}<>'+"'已结案'" ; if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{sale.sa_sellercode}='+"'"+sellercode+"'"; } console.log(condition); }else if(cop=="价格变动审批表"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('pu_vendcode').value; prodcode=Ext.getCmp('pr_code').value; reportName="PriceChange"; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+code+"'"; } if(prodcode!=""){ condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'" ; } console.log(condition); }else if(cop=="月COST DOWN统计表"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('pu_vendcode').value; prodcode=Ext.getCmp('pr_code').value; reportName="CostDown"; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+code+"'"; } if(prodcode!=""){ condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'" ; } console.log(condition); } else if(cop=="客户订单追踪表"){ var dateRange=Ext.getCmp('sa_date'); var codeRange=Ext.getCmp('sa_code'); console.log(dateRange.valuePrint); console.log(codeRange.valuePrint); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; custcode=Ext.getCmp('cu_code').value; reportName="saletrack"; console.log(codeValuePrint); condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } }else if(cop=="派车费用统计"){ var dateRange=Ext.getCmp('tt_date'); dateFW=dateRange.value; var dateValuePrint=dateRange.valuePrint; reportName="carcosttotal"; var custcode=Ext.getCmp('tt_carcode').value; todate=custcode; fromdate=Ext.getCmp('tt_date').firstVal; enddate=Ext.getCmp('tt_date').secondVal; }else if(cop=="销售订单预计交货表"){ var dateRange=Ext.getCmp('sa_date'); var codeRange=Ext.getCmp('sa_code'); console.log(dateRange.valuePrint); console.log(codeRange.valuePrint); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); custcode=Ext.getCmp('cu_code').value; reportName="salepresend"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } }else if(cop=="产品别预计出货表"){ var dateRange=Ext.getCmp('sa_date'); var codeRange=Ext.getCmp('sa_code'); console.log(dateRange.valuePrint); console.log(codeRange.valuePrint); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); reportName="saleprodkind"; custcode=Ext.getCmp('cu_code').value; reportName="salekindsend"; console.log(reportName); condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } }else if(cop=="订单生产进度表"){ var dateRange=Ext.getCmp('sa_date'); var codeRange=Ext.getCmp('sa_code'); console.log(dateRange.valuePrint); console.log(codeRange.valuePrint); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); reportName="ProgressSheet"; custcode=Ext.getCmp('cu_code').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(custcode!=""){ condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'"; } }else if(cop=="出货清单DD"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; reportName="SaleSendOut"; condition=codeValuePrint+' and '+dateValuePrint; }else if(cop=="出货明细表" || cop=="出货清单"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var whcode=Ext.getCmp('pi_whcode').value; var depcode=Ext.getCmp('pi_departmentcode').value; var status=Ext.getCmp('pi_status').value; var cardcode=Ext.getCmp('pi_cardcode').value; var piclass=Ext.getCmp('pi_class').value; var prodcode=Ext.getCmp('pr_code').value; reportName="SaleSendOut"; condition=dateValuePrint; if(cardcode!=""){ condition+=" and {prodinout.pi_cardcode}='"+cardcode+"' " ; } if(whcode!=""){ condition+=' and {prodiodetail.pd_whcode}='+"'"+whcode+"'"; } if(depcode!=""){ condition+=' and {prodinout.pi_departmentcode}='+"'"+depcode+"'"; } if(piclass=="出货单"){ condition+=' and {prodinout.pi_class}='+"'"+piclass+"'"; } if(piclass=="销售退货单"){ condition+=' and {prodinout.pi_class}='+"'"+piclass+"'"; } if(piclass=="全部"){ condition+=' and '+'({prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}= '+"'销售退货单'"+")"; } if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="包装单打印"){ reportName="paking"; condition='{packing.pa_id}='+Ext.getCmp('pa_id').value+'';; }else if(cop=="销售退货清单打印"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); var codeValuePrint = codeRange.valuePrint; var dateValuePrint=dateRange.valuePrint; custcode=Ext.getCmp('cu_code').value; reportName="Salereturn"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(custcode!=""){ condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'"; } console.log(condition); }else if(cop=="销售退货理由分析表"){ var dateRange=Ext.getCmp('pi_date'); custcode=Ext.getCmp('cu_code').value; console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); reportName="retulistAn"; condition=dateValuePrint; if(custcode!=""){ condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'"; } }else if(cop=="客户别销退理由分析表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); custcode=Ext.getCmp('cu_code').value; reportName="salecustkind"; condition=dateValuePrint; if(custcode!=""){ condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'"; } }else if(cop=="估价单成本一览表"){ var dateRange=Ext.getCmp('ev_date'); var codeRange=Ext.getCmp('ev_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; console.log(dateValuePrint); custcode=Ext.getCmp('cu_code').value; prodcode=Ext.getCmp('pr_code').value; reportName="EvaluationCB"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and ' + codeValuePrint; } if(custcode!=""){ condition+=' and ' +'{Evaluation.ev_custcode}='+"'"+custcode+"'"; } if(prodcode!=""){ condition+=' and '+'{EvaluationDetail.evd_prodcode}='+prodcode+"'"; } }else if(cop=="毛利润分析(按客户)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; custcode=Ext.getCmp('sa_custcode').value; reportName="PROFITCUSTOMER"; condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";; if(custcode!=""){ condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'"; } console.log(condition); }else if(cop=="毛利润分析(按业务员)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var sellercode=Ext.getCmp('sa_sellercode').value; reportName="PROFITSELLER"; condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")"; if(sellercode!=""){ condition+=' and '+'{prodinout.pi_sellercode}='+"'"+sellercode+"'"; } console.log(condition); }else if(cop=="毛利润分析(按产品)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var prodcode=Ext.getCmp('pr_code').value; reportName="profitproduct"; condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")"; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="毛利润分析(按机型)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; reportName="profitproductkind"; condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")"; console.log(condition); } else if(cop=="毛利润分析明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var sellercode=Ext.getCmp('sa_sellercode').value; reportName="PROFITDETAIL"; condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")"; if(sellercode!=""){ condition+=' and '+'{prodinout.pi_sellercode}='+"'"+sellercode+"'"; } }else if(cop=="销售预测明细表"){ var dateRange=Ext.getCmp('sf_tilldate'); var dateValuePrint=dateRange.valuePrint; var sellercode=Ext.getCmp('cu_code').value; reportName="SaleForDetail"; condition=dateValuePrint; if(sellercode!=""){ condition+=' and '+'{SaleForecast.sf_custcode}='+"'"+sellercode+"'"; } } else if(cop=="供应商基本资料表"){ reportName="VendorList"; code=Ext.getCmp('ve_code').value; vendorcode=Ext.getCmp('ve_buyerid').value; if(code!="" && vendorcode!="" ){ condition='{vendor.ve_code}='+"'"+code+"'"+" and " +'{vendor.ve_buyerid}='+code; console.log(condition); } if(code!="" && vendorcode==""){ condition='{vendor.ve_code}='+"'"+code+"'"; } if(code=="" && vendorcode!=""){ condition='{vendor.ve_buyerid}='+vendorcode; } }else if(cop=="供应商名条打印"){ reportName="VendorMT"; code=Ext.getCmp('ve_code').value; if(code!=""){ condition='{vendor.ve_code}='+"'"+code+"'"; } }else if(cop=="供应商ABC分析表"){ reportName="VendorABC"; code=Ext.getCmp('ve_code').value; if(code!=""){ condition='{vendor.ve_code}='+"'"+code+"'"; } }else if(cop=="请购清单打印"){ reportName="ApplicationDetail"; var dateRange=Ext.getCmp('ap_date'); var dateValuePrint=dateRange.valuePrint; code=Ext.getCmp('ap_code').value; if(code!="" && dateRange=="[object Object]"){ condition='{Application.ap_code}='+"'"+code+"'"; }else if(code=="" && dateValuePrint!=""){ condition=dateValuePrint; }else if(code!=""&& dateValuePrint!=""){ condition='{Application.ap_code}='+"'"+code+"'" + " and "+dateValuePrint; } }else if(cop=="请购单进度追踪表打印"){ reportName="ApplicationTrack"; code=Ext.getCmp('ap_code').value; if(code!=""){ condition='{Application.ap_code}='+"'"+code+"'"; } }else if(cop=="请购转采购清单打印"){ reportName="ApplicationToPur"; code=Ext.getCmp('ap_code').value; if(code!=""){ condition='{Application.ap_code}='+"'"+code+"'"; } }else if(cop=="采购单交货数量审核表"){ var dateRange=Ext.getCmp('pu_date'); var codeRange=Ext.getCmp('pu_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; status=Ext.getCmp('pu_status').value; reportName="PurchaseQTY"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if(purchaseman!=""){ condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'"; } }else if(cop=="采购单进度追踪表"){ var dateRange=Ext.getCmp('pu_date'); var codeRange=Ext.getCmp('pu_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; status=Ext.getCmp('pu_status').value; reportName="PurchaseTrack"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if(purchaseman!=""){ condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'"; } }else if(cop=="采购单清单打印"){ var dateRange=Ext.getCmp('pu_date'); var codeRange=Ext.getCmp('pu_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; reportName="PurcAllDetail"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if(purchaseman!=""){ condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'"; } }else if(cop=="物料采购明细表"){ var dateRange=Ext.getCmp('pu_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; reportName="ProductBuy"; condition=dateValuePrint; if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if( purchaseman!="") { condition+=' and '+'{purchase.pu_buyerid}='+purchaseman; } }else if(cop=="收货明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; var vendcode=Ext.getCmp('ve_code').value; var pucode=Ext.getCmp('pu_code').value; var piclass=Ext.getCmp('pi_class').value; reportName="inDetail"; condition=dateValuePrint+' and {ProdInOut.pi_status}='+"'已过账'"; // if(prodcode!=""){ condition+=' and {prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(vendcode!=""){ condition+=' and {prodinout.pi_cardcode}='+"'"+vendcode+"'"; } if(pucode!=""){ condition+=' and {purchase.pu_code}='+"'"+pucode+"'"; } if(piclass=="全部"){ condition+=' and '+'({ProdInOut.pi_class}='+"'采购验收单'"+ 'OR {ProdInOut.pi_class}='+"'采购验退单'"+ 'OR {ProdInOut.pi_class}='+"'委外验收单'"+ 'OR {ProdInOut.pi_class}='+"'委外验退单'"+ 'OR {ProdInOut.pi_class}='+"'不良品入库单'"+' OR {ProdInOut.pi_class}='+"'不良品出库单')"; }else{ condition+=' and {prodinout.pi_class}='+"'"+piclass+"'"; } console.log(condition); } else if(cop=="未到货采购明细表"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; var pucode=Ext.getCmp('pu_code').value; var prodcode=Ext.getCmp('pr_code').value; reportName="PurcAllDetail"; condition=dateValuePrint+' and '+'({PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001 AND (ISNULL({PurchaseDetail.pd_mrpstatus}) or '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'"+ ' )'+' and '+'{purchase.pu_status}<>'+"'已结案'"; if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if( purchaseman!="") { condition+=' and '+'{purchase.pu_buyerid}='+purchaseman; } if(pucode!=""){ condition+=' and '+'{purchase.pu_code}='+"'"+pucode+"'"; } if(prodcode!=""){ condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); } else if(cop=="物料采购单价明细表"){ var dateRange=Ext.getCmp('pp_auditdate'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pp_buyerid').value; reportName="PurchasePriceDetail"; condition=dateValuePrint; if(vendorcode!=""){ condition+=' and '+'{PurchasePrice.pp_vendcode}='+"'"+vendorcode+"'"; } if( purchaseman!="") { condition+=' and '+'{PurchasePrice.pp_buyerid}='+purchaseman; } }else if(cop=="供应商收货状况表"){ reportName="PurcAllDetail_vv"; vendorcode=Ext.getCmp('ve_code').value; if(vendorcode!=""){ condition='{Vendor.ve_code}='+"'"+vendorcode+"'"; } }else if(cop=="采购物料预计到库状况表"){ var dateRange=Ext.getCmp('pu_date'); var codeRange=Ext.getCmp('pu_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; console.log(dateValuePrint); vendorcode=Ext.getCmp('pu_vendcode').value; purchaseman=Ext.getCmp('pu_buyerid').value; reportName="ProductWLDKZK"; condition=dateValuePrint; if(vendorcode!=""){ condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'"; } if( purchaseman!="") { condition+=' and '+'{purchase.pu_buyerid}='+purchaseman; } if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } }else if(cop=="采购预测未转明细表"){ reportName="PurchaseYCWZ"; code=Ext.getCmp('pf_code').value; if(vendorcode!=""){ condition='{PurchaseForecast.pf_code}='+"'"+code+"'"; } }else if(cop=="采购预测转出明细表"){ reportName="PurchaseYCYZ"; code=Ext.getCmp('pf_code').value; if(vendorcode!=""){ condition='{PurchaseForecast.pf_code}='+"'"+code+"'"; } }else if(cop=="交货数量统计分析表"){ reportName="InWh"; code=Ext.getCmp('pi_inoutno').value; if(code!=""){ condition='{ProdInOut.pi_inoutno}='+"'"+code+"'"; } }else if(cop=="交期统计分析表"){ reportName="InJh"; code=Ext.getCmp('pi_inoutno').value; if(code!=""){ condition='{ProdInOut.pi_inoutno}='+"'"+code+"'"; } }else if(cop=="采购收料统计表"){ reportName="QUA_VerifyApply"; code=Ext.getCmp('pd_vacode').value; if(code!=""){ condition='{VerifyApply.va_code}='+"'"+code+"'"; } }else if(cop=="采购退货理由分析表"){ reportName="piolistTHreson"; code=Ext.getCmp('pi_inoutno').value; if(code!=""){ condition='{ProdInOut.pi_inoutno}='+"'"+code+"'"; } }else if(cop=="物料询价历史资料表"){ reportName="InquiryProduct"; code=Ext.getCmp('pp_code').value; if(code!=""){ condition='{PurchasePrice.pp_code}='+"'"+code+"'"; } }else if(cop=="采购单价统计表"){ reportName="InPrice"; code=Ext.getCmp('pi_inoutno').value; if(code!=""){ condition='{ProdInOut.pi_inoutno}='+"'"+code+"'"; } }else if(cop=="采购单交货异常表"){ reportName="PurchaseJHNG"; code=Ext.getCmp('pi_inoutno').value; if(code!=""){ condition='{ProdInOut.pi_inoutno}='+"'"+code+"'"; } }else if(cop=="物料库存成本报表"){ reportName="ProductCBJE"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"; } }else if(cop=="出入库明细表"){ var dateRange=Ext.getCmp('pi_date'); var kind=Ext.getCmp('pi_class').value; var whcode=Ext.getCmp('pi_whcode').value; var batchcode=Ext.getCmp('pd_batchcode').value; var status=Ext.getCmp('pi_status').value; var department=Ext.getCmp('pi_departmentname').value; var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; var xcode=Ext.getCmp('pd_ordercode').value; reportName="PRODIO"; condition=dateValuePrint; console.log(dateValuePrint); console.log(kind); console.log(whcode); if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(kind!=""&&kind!="全部"){ condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'"; } if(whcode!=""){ condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'"; } if(batchcode!=""){ condition+=' and '+'{prodiodetail.pd_batchcode}='+"'"+batchcode+"'"; } if(status!=""&&status!="全部"){ condition+=' and '+'{prodinout.pi_status}='+"'"+status+"'"; } if(department!=""){ condition+=' and '+'{prodinout.pi_departmentname}='+"'"+department+"'"; } if(xcode!=""){ condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+xcode+"'"; } console.log(condition); }else if(cop=="出入库明细表(合并)"){ var dateRange=Ext.getCmp('pi_date'); var kind=Ext.getCmp('pi_class').value; var whcode=Ext.getCmp('pi_whcode').value; var batchcode=Ext.getCmp('pd_batchcode').value; var status=Ext.getCmp('pi_status').value; var department=Ext.getCmp('pi_departmentname').value; var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; var xcode=Ext.getCmp('pd_ordercode').value; reportName="PRODIOHB"; condition=dateValuePrint+' and '+'({PRODINOUT.PI_CLASS}='+"'出货单'" + ' or {PRODINOUT.PI_CLASS}='+"'生产领料单'"+' or {PRODINOUT.PI_CLASS}='+"'生产补料单'"+' or {PRODINOUT.PI_CLASS}='+"'其它出库单'"+' or {PRODINOUT.PI_CLASS}='+"'拨出单'"+ ' or {PRODINOUT.PI_CLASS}='+"'采购验退单')"; console.log(dateValuePrint); console.log(kind); console.log(whcode); if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(kind!=""&&kind!="全部"){ condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'"; } if(whcode!=""){ condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'"; } if(batchcode!=""){ condition+=' and '+'{prodiodetail.pd_batchcode}='+"'"+batchcode+"'"; } if(status!=""&&status!="全部"){ condition+=' and '+'{prodinout.pi_status}='+"'"+status+"'"; } if(department!=""){ condition+=' and '+'{prodinout.pi_departmentname}='+"'"+department+"'"; } if(xcode!=""){ condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+xcode+"'"; } console.log(condition); } else if(cop=="采购验收清单表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); var kind='采购验收单'; var whcode=Ext.getCmp('pi_whcode').value; var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint;; reportName="PRODIO"; condition=dateValuePrint; console.log(dateValuePrint); console.log(kind); console.log(whcode); if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(kind!=""){ condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'"; } if(whcode!=""){ condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'"; } console.log(condition); } else if(cop=="仓库库存金额汇总表"){ reportName="ProductJEHZ"; code=Ext.getCmp('pr_code').value; whcode=Ext.getCmp('pw_whcode').value; if(code!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"; }else if(whcode!=""){ if (code!=""){ condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'"; }else { condition='{ProductWh.pw_whcode}='+"'"+whcode+"'"; } } }else if(cop=="仓库库存金额明细表"){ reportName="ProductJEMX"; code=Ext.getCmp('pr_code').value; whcode=Ext.getCmp('pw_whcode').value; if(code!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"; }else if(whcode!=""){ if (code!=""){ condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'"; }else { condition='{ProductWh.pw_whcode}='+"'"+whcode+"'"; } } }else if(cop=="库存数量表"){ reportName="ProductNUM"; code=Ext.getCmp('pr_code').value; //whcode=Ext.getCmp('pw_whcode').value; if(code!=""){ condition='{ProductOnhand.po_prodcode}='+"'"+code+"'"; } }else if(cop=="仓库有效状况表"){ reportName="ProductSFYX"; code=Ext.getCmp('pr_code').value; whcode=Ext.getCmp('ba_whcode').value; if(code!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"; }else if(whcode!=""){ if (code!=""){ condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'"; }else { condition='{ProductWh.pw_whcode}='+"'"+whcode+"'"; } } }else if(cop=="滞料物料分析表"){ reportName="ProductDCWL"; code=Ext.getCmp('pr_code').value; whcode=Ext.getCmp('ba_whcode').value; if(code!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"; }else if(whcode!=""){ if (code!=""){ condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'"; }else { condition='{ProductWh.pw_whcode}='+"'"+whcode+"'"; } } }else if(cop=="库存帐龄表"){ reportName="PwAgeAll"; code=Ext.getCmp('ba_prodcode').value; whcode=Ext.getCmp('ba_whcode').value; condition="{Batch.ba_date}<={@Date0To} and {Batch.ba_thisremain}<>0"; if(code!=""){ condition+=' and '+'{Batch.ba_prodcode}='+"'"+code+"'"; } if(whcode!=""){ condition+=' and '+'{Batch.ba_whcode}='+"'"+whcode+"'"; } }else if(cop=="库存数量金额帐龄表"){ reportName="PwAgeAll"; code=Ext.getCmp('pr_code').value; whcode=Ext.getCmp('pw_whcode').value; if(code!="" && whcode!=""){ condition='{ProductWh.pw_prodcode}='+"'"+code+"'"+"and"+'{ProductWh.pw_whcode}='+"'"+whcode+"'"; } }else if(cop=="低於订购点物料表"){ reportName="PRODLIST"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="两阶段调拨明细表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; custcode=Ext.getCmp('cu_code').value; reportName="WareHouse"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(custcode!=""){ condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'"; } }else if(cop=="两阶段调拨数量稽核表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; custcode=Ext.getCmp('cu_code').value; reportName="WareHouseYYDB"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(custcode!=""){ condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'"; } }else if(cop=="营运中心间调拨数量稽核表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; custcode=Ext.getCmp('cu_code').value; reportName="WareHouseCKDB"; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(custcode!=""){ condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'"; } }else if(cop=="营运中心间调拨在途数量统计表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="WareHouseZTSL"; prodcode=Ext.getCmp('pr_code').value; custcode=Ext.getCmp('cu_code').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } if(custcode!=""){ condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'"; } }else if(cop=="ABC分类表"){ reportName="ProductABC"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料基本资料表(报表)"){ reportName="PRODLIST"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料基本资料-库存资料表(报表)"){ reportName="ProductKCZL"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料资料-销售资料"){ reportName="ProductSale"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料资料-采购资料"){ reportName="ProductPurchase"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料资料-计划资料"){ reportName="ProductJHZL"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料资料-财务资料"){ reportName="ProductCWZL"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料资料-特征资料"){ reportName="ProductTZZL"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="新增物料资料基本状况表"){ reportName="PRODLIST"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料单位换算资料表"){ reportName="ProductDWHS"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="物料库存明细表(报表)"){ reportName="ProductKCMX"; code=Ext.getCmp('pr_code').value; if(code!=""){ condition='{Product.pr_code}='+"'"+code+"'"; } }else if(cop=="在制委外加工单控制表"){ var dateRange=Ext.getCmp('ma_date'); var codeRange=Ext.getCmp('ma_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="ProgressSheetExp"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="委外加工单损耗率报表"){ var dateRange=Ext.getCmp('ma_date'); var codeRange=Ext.getCmp('ma_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="Expliolist_bfbl"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="委外加工变更单打印"){ var dateRange=Ext.getCmp('mc_date'); var codeRange=Ext.getCmp('mc_code'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="MakeChangeWW_Batch"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+='{makechangedetail.md_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="在制制造单控制表"){ reportName="ProgressSheet"; code=Ext.getCmp('ma_code').value; if(code!=""){ condition='{make.ma_code}='+"'"+code+"'"; } }else if(cop=="完工入库明细表"){ var dateRange=Ext.getCmp('pi_date'); var codeRange=Ext.getCmp('pi_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="finish_Batch"; var whcode=Ext.getCmp('pi_whcode').value; condition=dateValuePrint; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(whcode!=""){ condition+='{ProdInOut.pi_whcode}='+"'"+whcode+"'"; } }else if(cop=="拆件完工入库明细表"){ var date=Ext.getCmp('pi_date'); var code=Ext.getCmp('pi_inoutno'); reportName="chaijianDetailh"; var whcode=Ext.getCmp('pi_whcode').value; condition='{ProdInOut.pi_class}='+"'拆件完工入库'"; if(code!=""){ condition+=' and '+'{ProdInOut.pi_inoutno}='+"'"+code+"'"; } if(whcode!=""){ condition+=' and '+'{ProdInOut.pi_whcode}='+"'"+whcode+"'"; } if(date!=""){ condition+=' and '+'{ProdInOut.pi_date}='+"'"+date+"'"; } }else if(cop=="制造单变更打印"){ var dateRange=Ext.getCmp('mc_date'); var codeRange=Ext.getCmp('mc_inoutno'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; var codeValuePrint = codeRange.valuePrint; reportName="MakeChange_Batch"; custcode=Ext.getCmp('pi_cardcode').value; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint+' and '+'{makechange.mc_tasktype}='+"'制造变更单'"; if(codeValuePrint!=""){ condition+=' and '+codeValuePrint; } if(prodcode!=""){ condition+=' and '+'{makechangedetail.md_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="生产进度报表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; //var codeValuePrint = codeRange.valuePrint; reportName="ProgressSheet"; custcode=Ext.getCmp('ma_custcode').value; prodcode=Ext.getCmp('ma_prodcode').value; code=Ext.getCmp('ma_code').value; condition=dateValuePrint; if(code!=""){ condition+=' and '+'{make.ma_code}='+"'"+code+"'"; } if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } if(custcode!=""){ condition+=' and '+'{make.ma_custcode}='+"'"+custcode+"'"; } }else if(cop=="生产执行明细表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeDetail"; prodcode=Ext.getCmp('ma_prodcode').value; code=Ext.getCmp('ma_code').value; condition=dateValuePrint; if(code!=""){ condition+=' and '+code; } if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="生产领料退料明细表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="scll"; var code=Ext.getCmp('ma_code').value; prodcode=Ext.getCmp('ma_prodcode').value; condition=dateValuePrint+' and '+'{ProdInOut.pi_status}='+"'已过账'"+' and ('+'{ProdInOut.pi_class}='+"'生产领料单'"+' or '+'{ProdInOut.pi_class}='+"'生产退料单'"+' or '+'{ProdInOut.pi_class}='+"'生产补料单'"+')'; if(code!=""){ condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+code+"'"; } if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="生产领料退料汇总表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="ProdOutMake"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint+' and '+'{ProdInOut.pi_status}='+"'已过账'"+' and ('+'{ProdInOut.pi_class}='+"'生产领料单'"+' or '+'{ProdInOut.pi_class}='+"'生产退料单'"+' or '+'{ProdInOut.pi_class}='+"'生产补料单'"+')'; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="生产报废明细表"){ var dateRange=Ext.getCmp('ms_indate'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeScrapDetail"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{MakeScrapDetail.md_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="制造单材料成本统计表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeCost"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="制造用料ECR替代汇总表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MaterialECR"; var code=Ext.getCmp('ma_code').value; condition=dateValuePrint; if(code!=""){ condition+=' and '+'{makematerial.mm_code}='+"'"+code+"'"; } }else if(cop=="制造单ECN汇总表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="ECNtoMake"; var code=Ext.getCmp('ma_code').value; condition=dateValuePrint; if(code!=""){ condition+=' and '+'{make.ma_code}='+"'"+code+"'"; } }else if(cop=="制造单一览表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeList"; var code=Ext.getCmp('ma_code').value; var status=Ext.getCmp('ma_status').value; var checkstatus=Ext.getCmp('ma_checkstatus').value; condition=dateValuePrint; if(code!=""){ condition+=' and '+'{make.ma_code}='+"'"+code+"'"; } if(status!="全部"){ condition+=' and '+'{make.ma_status}='+"'"+status+"'"; } if(checkstatus!="全部"){ condition+=' and '+'{make.ma_checkstatus}='+"'"+checkstatus+"'"; } }else if(cop=="制造单用料明细表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeMaterial_Status"; prodcode=Ext.getCmp('ma_prodcode').value; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="生产领料退料明细表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeMaterialUse"; prodcode=Ext.getCmp('ma_prodcode').value; var code=Ext.getCmp('ma_code').value; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } if(code!=""){ condition+=' and '+'{make.ma_code}='+"'"+code+"'"; } }else if(cop=="制造单领料情况"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; reportName="makeMaterialsum"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="制造单领料情况(按结案日期)"){ var dateRange=Ext.getCmp('ma_actenddate'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; dateFW=dateRange.value; console.log(dateFW); reportName="makeMaterialsum"; condition=dateValuePrint+' and '+'{Make.MA_STATUS}='+"'已结案'"; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } } else if(cop=="物料状态明细表"){ prodcode=Ext.getCmp('pr_code').value; reportName="ProductBalance"; if(prodcode!=""){ condition='{product.pr_code}='+"'"+product+"'"; } }else if(cop=="缺料表分析(按工单)"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; reportName="MaterialLackForWCPlan_bymake"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="缺料表分析(按物料)"){ prodcode=Ext.getCmp('pr_code').value; reportName="MaterialLackForWCPlan_byprod"; if(prodcode!=""){ condition='{MaterialLackForWCPlan.ml_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="在制仓库库存表(制单)"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; var whcode=Ext.getCmp('ma_whcode').value; reportName="Makeonhand"; condition=dateValuePrint+' and '+'(isnull({makematerial.mm_materialstatus}) or {makematerial.mm_materialstatus}=" ")'; todate=Ext.getCmp('pr_date').rawValue; if(todate==""){ var myDate = new Date(); var y=myDate.getFullYear(); var m=myDate.getMonth()+1; var d=myDate.getDate(); m=m<10?"0"+m:m; d=d<10?"0"+d:d; todate=y+"-"+m+"-"+d; } console.log(todate); if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } if(whcode!=""){ condition+=' and '+'{make.ma_whcode}='+"'"+whcode+"'"; } console.log(condition); }else if(cop=="在制仓库库存表(汇总)"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; var whcode=Ext.getCmp('ma_whcode').value; reportName="MakeonhandSum"; condition=dateValuePrint; if(todate==""){ var myDate = new Date(); var y=myDate.getFullYear(); var m=myDate.getMonth()+1; var d=myDate.getDate(); m=m<10?"0"+m:m; d=d<10?"0"+d:d; todate=y+"-"+m+"-"+d; } if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } if(whcode!=""){ condition+=' and '+'{make.ma_whcode}='+"'"+whcode+"'"; } }else if(cop=="生产领料明细表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; reportName="scll"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="委外单一览表"){ var dateRange=Ext.getCmp('ma_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; reportName="MakeListWW"; prodcode=Ext.getCmp('pr_code').value; condition=dateValuePrint+' and '+'{make.ma_tasktype}='+"'OS'"; if(prodcode!=""){ condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="委外领退料明细表"){ var dateRange=Ext.getCmp('pi_date'); console.log(dateRange.valuePrint); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; reportName="scllWW"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="委外入库明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pr_code').value; reportName="PRODIO"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="标准工时统计"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; condition=dateValuePrint+' and '+'{prodinout.pi_status}='+"'已过账'"+' and '+'{prodinout.pi_class}='+"'完工入库单'"; reportName="bztime"; }else if(cop=="出入库单状态统计表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; condition=dateValuePrint; reportName="ProdInoutStatus"; console.log(condition); }else if(cop=="制造单备料单"){ var code=Ext.getCmp('ma_code').value; var remark=Ext.getCmp('ma_remark').value; if(remark=="A4"){ reportName="MakeUsagePrebymake"; } if(remark=="半刀"){ reportName="MakeUsagePrebymake_14"; } if(code!=""){ condition='{MA_MAKEMATERIAL_VIEW.ma_code}='+"'"+code+"'"; } }else if(cop=="制造单备料单(按物料合并)"){ var prodcode=Ext.getCmp('ma_prodcode').value; var wccode=Ext.getCmp('ma_wccode').value; var code=Ext.getCmp('ma_code').value; var remark=Ext.getCmp('ma_reamrk').value; condition='{MA_MAKEUSEPRE.ma_checkstatus}='+"'已批准'"; var arrcode=''; var strs= new Array(); strs=code.split("#"); console.log(strs.length); if(strs.length>1){ for(i=0;i0.001'+' and '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'"; if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="未到货采购汇总表‎(‎按供应商‎)"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var prodcode=Ext.getCmp('pr_code').value; reportName="purcalldetail_v"; condition=dateValuePrint+' and ('+'{PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001'+' and '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'"; if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="收料明细表"){ var dateRange=Ext.getCmp('va_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('ve_code').value; var prodcode=Ext.getCmp('pr_code').value; reportName="QUA_VerifyApply"; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{VerifyApply.va_vendcode}='+"'"+vendcode+"'"; } if(prodcode!=""){ condition+=' and '+'{Product.pr_code}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="采购汇总表(按供应商)"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('ve_code').value; var prodcode=Ext.getCmp('pr_code').value; reportName="PurTotal_V"; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{Purchase.pu_vendcode}='+"'"+prodcode+"'"; } if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="采购汇总表(按物料)"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('ve_code').value; var prodcode=Ext.getCmp('pr_code').value; reportName="PurTotal_P"; condition=dateValuePrint+' and '+'{Purchase.pu_status}='+"'已审核'"+' and '+'{Purchase.pu_status}<>'+"'已作废'"+' and '+'{Purchase.pu_status}<>'+"'已结案'"; if(vendcode!=""){ condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'"; } if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } console.log(condition); }else if(cop=="采购汇总表(按订单)"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('ve_code').value; var prodcode=Ext.getCmp('pr_code').value; var pucode=Ext.getCmp('pu_code').value; reportName="PurTotal_S"; condition=dateValuePrint+' and '+'{Purchase.pu_status}='+"'已审核'"+' and '+'{Purchase.pu_status}<>'+"'已作废'"+' and '+'{Purchase.pu_status}<>'+"'已结案'"; if(vendcode!=""){ condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'"; } if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } if(pucode!=""){ condition+=' and '+'{Purchase.pu_code}='+"'"+pucode+"'"; } console.log(condition); }else if(cop=="超期未到货明细表"){ var dateRange=Ext.getCmp('pu_date'); var dateValuePrint=dateRange.valuePrint; var vendcode=Ext.getCmp('ve_code').value; var prodcode=Ext.getCmp('pr_code').value; var pucode=Ext.getCmp('pu_code').value; reportName="purcalldetail"; if(todate==""){ var myDate = new Date(); var y=myDate.getFullYear(); var m=myDate.getMonth()+1; var d=myDate.getDate(); m=m<10?"0"+m:m; d=d<10?"0"+d:d; todate=y+"-"+m+"-"+d; } console.log(todate); condition=dateValuePrint+' and ('+'{PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001 and {PurchaseDetail.pd_delivery}<='+'date('+"'"+todate+"'"+')'; if(vendcode!=""){ condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'"; } if(prodcode!=""){ condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'"; } if(pu_code!=""){ condition+=' and '+'{Purchase.pu_code}='+"'"+pucode+"'"; } console.log(condition); }else if(cop=="分仓库库存报表"){ var whcode=Ext.getCmp('pi_whcode').value; console.log(whcode); reportName="pronhandw"; condition='{ProductWH.pw_onhand}>0'; if(whcode!=""){ condition+=' and '+'{ProductWH.pw_whcode}='+"'"+whcode+"'"; } console.log(condition); }else if(cop=="出入库汇总表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var prodcode=Ext.getCmp('pr_code').value; var whcode=Ext.getCmp('pi_whcode').value; condition=dateValuePrint; reportName="ProdIOTotal"; if(prodcode!=""){ condition+=' and '+'{ProdIoDetail.pd_prodcode}='+"'"+prodcode+"'"; } if(whcode!=""){ condition+=' and '+'{ProdInout.pd_whcode}='+"'"+whcode+"'"; } console.log(condition); }else if(cop=="分仓库库存总表"){ reportName="pronhandwtotal"; var whcode=Ext.getCmp('pi_whcode').value; condition='{ProductWH.pw_onhand}>0'; if(whcode!=""){ condition+=' and '+'{ProductWH.pw_whcode}='+"'"+whcode+"'"; } }else if(cop=="下阶工单查询"){ var dateRange=Ext.getCmp('ma_date'); var dateValuePrint=dateRange.valuePrint; var macode=Ext.getCmp('ma_code').value; console.log(macode); var i; var arrcode=""; var strs= new Array(); strs=macode.split("#"); console.log(strs.length); reportName="MakeMaterial33"; condition=dateValuePrint; if(strs.length>1){ for(i=0;i1){ for(i=0;i1){ for(i=0;i'+"'其它应收单')"; if(custcode!=""){ condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'"; } console.log(condition); } else if(cop=="月销售分析表"){ var dateRange=Ext.getCmp('ab_date'); var dateValuePrint=dateRange.valuePrint; reportName="billout_month"; var custcode=Ext.getCmp('ab_custcode').value; condition=dateValuePrint+' and '+' ( ({arbill.ab_class}='+"'其它应收单'"+' and '+'({ARBillDetail.abd_catecode} like '+ "'5101*'"+ ' or {ARBillDetail.abd_catecode} like '+ "'5102*'))"+' or '+'{arbill.ab_class}<>'+"'其它应收单')"; if(custcode!=""){ condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'"; } console.log(condition); } else if(cop=="派车次数统计"){ var dateRange=Ext.getCmp('vr_recorddate'); var dateValuePrint=dateRange.valuePrint; reportName="carcountdetail"; var custcode=Ext.getCmp('vr_depart').value; condition=dateValuePrint; if(custcode!=""){ condition+=' and '+'{Vehiclereturn.vr_depart}='+"'"+custcode+"'"; } console.log(condition); }else if(cop=="部门派车费用统计"){ var dateRange=Ext.getCmp('vr_recorddate'); var dateValuePrint=dateRange.valuePrint; reportName="carcostdepart"; var custcode=Ext.getCmp('vr_depart').value; condition=dateValuePrint; if(custcode!=""){ condition+=' and '+'{Vehiclereturn.vr_depart}='+"'"+custcode+"'"; } console.log(condition); }else if(cop=="成本汇总表"){ var datemonth=Ext.getCmp('cd_yearmonth').value; console.log(datemonth); reportName="CostDetail"; condition='{CostDetail.cd_yearmonth}='+"'"+datemonth+"'"; console.log(condition); }else if(cop=="成本用料月结表"){ var datemonth=Ext.getCmp('cd_yearmonth').value; console.log(datemonth); reportName="costdetailmaterial"; condition='{CostDetailMaterial.cdm_yearmonth}='+datemonth; console.log(condition); }else if(cop=="未开票明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; reportName="wkpDetail"; var custcode=Ext.getCmp('pi_arcode').value; condition=dateValuePrint; if(custcode!=""){ condition+=' and '+'{FA_NOTKP_ARBILL_VIEW.pi_arcode}='+"'"+custcode+"'"; } console.log(condition); }else if(cop=="应付开票明细表"){ var dateRange=Ext.getCmp('ab_date'); var dateValuePrint=dateRange.valuePrint; reportName="BillOutAPDetail"; var vendcode=Ext.getCmp('ab_vendcode').value; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{apbill.ab_vendcode}='+"'"+vendcode+"'"; } console.log(condition); }else if(cop=="应付开票明细表香港"){ var dateRange=Ext.getCmp('ab_date'); var dateValuePrint=dateRange.valuePrint; reportName="BillOutAPDetail_hk"; var vendcode=Ext.getCmp('ab_vendcode').value; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{apbill.ab_vendcode}='+"'"+vendcode+"'"; } console.log(condition); } else if(cop=="应付未开票明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; reportName="ApwkpDetail"; var vendcode=Ext.getCmp('pi_receivecode').value; condition=dateValuePrint; if(vendcode!=""){ condition+=' and '+'{FA_NOTKP_APBILL_VIEW.pi_receivecode}='+"'"+vendcode+"'"; } console.log(condition); } else if(cop=="已完成采购总额"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; reportName="purchaseAll"; condition=dateValuePrint+' and ' +'({ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单')"+' and '+'{ProdInOut.pi_status}='+"'已过账'"; console.log(condition); }else if(cop=="流程单打印"){ var code=Ext.getCmp('si_flowcode').value; reportName="byqmakeflow"; if(code!=""){ condition='{MakeFlow.mf_code}='+"'"+code+"'"; } console.log(condition); }else if(cop=="生产日报明细表"){ var dateRange=Ext.getCmp('di_date'); var dateValuePrint=dateRange.valuePrint; reportName="MakeDayDetail"; condition=dateValuePrint; console.log(condition); }else if(cop=="集团出入库明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; prodcode=Ext.getCmp('pd_prodcode').value; var piclass=Ext.getCmp('pi_class').value; reportName="ProdIO_Group"; condition=dateValuePrint; if(prodcode!=""){ condition+=' and '+'{GROUP_PRODIO_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } if(piclass!=""){ condition+=' and '+'{GROUP_PRODIO_VIEW.pi_class}='+"'"+piclass+"'"; } }else if(cop=="集团毛利润分析明细表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="PROFITDETAIL_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团毛利润分析表-按客户"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="PROFITCUSTOMER_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{GETALLDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团毛利润分析表-按产品型号"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="profitproduct_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团毛利润分析表-按品牌"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="profitproductkind_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{MLR_PRODUCTVIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团毛利润分析表-按业务员"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="PROFITSELLER_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{SELLERDATA_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{SELLERDATA_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{SELLERDATA_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{SELLERDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团未交货销售订单总表"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="sasumc_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团未交货销售订单总表(型号)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="sasump_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="集团未交货销售订单总表(业务员)"){ var dateRange=Ext.getCmp('pi_date'); var dateValuePrint=dateRange.valuePrint; var cop=Ext.getCmp('pi_cop').value; var custcode=Ext.getCmp('cu_code').value; var sellercode=Ext.getCmp('pi_emcode').value; prodcode=Ext.getCmp('pd_prodcode').value; reportName="sasums_Group"; condition=dateValuePrint; if(cop!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'"; } if(custcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'"; } if(sellercode!=""){ condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'"; } if(prodcode!=""){ condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'"; } }else if(cop=="应收账龄分析表"){ var dateRange=Ext.getCmp('ab_date'); var dateValuePrint=dateRange.valuePrint; var custcode=Ext.getCmp('cu_code').value; var seller=Ext.getCmp('em_id').value; reportName="ARAgeAll"; condition='{ARBill.ab_date}<={@Date0To} AND {ARBill.ab_aramount}<>{ARBill.ab_thispayamount}'+' and '+dateValuePrint; if(custcode!=""){ condition+=' and '+'{ARBill.ab_custcode}='+"'"+custcode+"'"; } if(seller!=""){ condition+=' and '+'{ARBill.ab_sellerid}='+seller; } }else if(cop=="应付账龄分析表"){ var dateRange=Ext.getCmp('ab_date'); var dateValuePrint=dateRange.valuePrint; reportName="APAgeAll"; condition='{APBill.ab_paydate}<={@Date0To} AND {APBill.ab_apamount}<>{APBill.ab_payamount}'+' and '+dateValuePrint; console.log(condition); }else if(cop=="应收账明细表"){ var dateRange=Ext.getCmp('asl_date'); var dateValuePrint=dateRange.valuePrint; var custcode=Ext.getCmp('cu_code').value; condition=dateValuePrint+' and '+'{ArSubledger.asl_source}<>'+"'预收冲应收'"; reportName="ArSubledger"; if(custcode!=""){ condition+=' and '+'{ArSubledger.asl_custcode}='+"'"+custcode+"'"; } }else if(cop=="应付账明细表"){ var dateRange=Ext.getCmp('asl_date'); var dateValuePrint=dateRange.valuePrint; reportName="ApSubledger"; var vendcode=Ext.getCmp('ve_code').value; condition=dateValuePrint+' and '+'{ApSubledger.asl_source}<>'+"'预收冲应收'"; if(vendcode!=""){ condition+=' and '+'{ApSubledger.asl_vendcode}='+"'"+vendcode+"'"; } }else if(cop=="应收账款汇总表"){ reportName="CustomerAR"; var custcode=Ext.getCmp('cu_code').value; var condition=""; if(custcode!=""){ condition='{CustAr.ca_custcode}='+"'"+custcode+"'"; } }else if(cop=="应付账款汇总表"){ reportName="VendorAP"; var custcode=Ext.getCmp('ve_code').value; var condition=""; if(custcode!=""){ condition='{VendAp.va_vendcode}='+"'"+custcode+"'"; } } form.FormUtil.batchPrint(idS,reportName,condition,cop,todate,dateFW,fromdate,enddate); */ } },'-','-',{ text: $I18N.common.button.erpCloseButton, iconCls: 'x-button-icon-close', cls: 'x-btn-gray', handler: function(){ var main = parent.Ext.getCmp("content-panel"); main.getActiveTab().close(); } }], initComponent : function(){ var param = {caller: caller, condition: ''}; this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action', param); this.callParent(arguments); this.addKeyBoardEvents(); //this.initFields(this); }, addKeyBoardEvents: function(){ var me = this; if(Ext.isIE){ document.body.attachEvent('onkeydown', function(){//ie的事件名称不同,也不支持addEventListener if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id + "&gridCondition=fd_foidIS" + me.fo_id); } }); } else { document.body.addEventListener("keydown", function(e){ if(Ext.isFF5){//firefox不支持window.event e = e || window.event; } if(e.altKey && e.ctrlKey && e.keyCode == 83){ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id + "&gridCondition=fd_foidIS" + me.fo_id); } }); } } });