| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491 |
- 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(i<length){
- //判断逻辑类型是否为空,不为空条件需替代为逻辑字段,不为空需要判断逻辑类型的字段类型,日期型需要格式化
- //console.log(form.items.items[i].logic);
- logicField=form.items.items[i].logic;
- //console.log(form.items.keys[i]);
- field=form.items.keys[i];
- //console.log(field);
- //console.log(Ext.getCmp(form.items.keys[i]).value);
- thisvalue=Ext.getCmp(form.items.keys[i]).value;
- console.log(thisvalue);
- console.log(form.items.items[i].xtype);
- console.log(logicField);
-
- if(thisvalue!="" && logicField!=null ){
- //判断逻辑字段的类型,日期需要格式化
- if(form.items.items[i].xtype=="condatefield"){
- var dateRange=Ext.getCmp(logicField);
- var dateValuePrint=dateRange.valuePrint;
- console.log(dateValuePrint);
- console.log(commonContition);
- if(commonContition!=null && commonContition!=''){
- commonContition+=' and '+dateValuePrint;
- }else{
- commonContition=dateValuePrint;
- }
-
- }else if(form.items.items[i].xtype=="ftfindfield"){
- var codeRange=Ext.getCmp(logicField);
- var codeValuePrint=codeRange.valuePrint;
- if(logicField=="am_yearmonth"){
- codeValuePrint=codeValuePrint.replace(/'/g,'');
-
- }
- if(commonContition!=null && commonContition!=''){
- commonContition+=' and '+codeValuePrint;
-
- }else{
- commonContition=codeValuePrint;
- }
- }else if(form.items.items[i].xtype=="datefield"){
- thisvalue=Ext.Date.format(thisvalue, 'Y-m-d');
- todate=thisvalue;
- //倒算库存金额带日期,倒算未开票
- if(commonContition!=null && commonContition!=''){
- commonContition+=' and '+'{'+logicField+'}<='+"date("+"'"+thisvalue+"'"+")";
- }else{
- commonContition='{'+logicField+'}<='+"date("+"'"+thisvalue+"'"+")";
- }
- }
- else{
- if(commonContition!=null && commonContition!=''){
- //判断是否是采购员ID,因为采购员ID设置成DBFIND,则判断不出是数值型还是字符型,故需要特殊处理一下
- if(logicField.indexOf('buyerid')>0||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;i<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- commonContition+=' and '+'{'+logicField+'}in ['+arrcode.substring(0, arrcode.length-1)+']';
- }else{
- commonContition+=' and '+'{'+logicField+'}='+"'"+thisvalue+"'";
- }
- }
- else{
- commonContition+=' and '+'{'+logicField+'}='+"'"+thisvalue+"'";
- }
-
-
- }else{
- //判断是否是采购员ID,因为采购员ID设置成DBFIND,则判断不出是数值型还是字符型,故需要特殊处理一下
- if(logicField.indexOf('buyerid')>0||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<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- commonContition='{'+logicField+'}in ['+arrcode.substring(0, arrcode.length-1)+']';
- }else{
- commonContition='{'+logicField+'}='+"'"+thisvalue+"'";
- }
-
-
- }else {
- commonContition='{'+logicField+'}='+"'"+thisvalue+"'";
- }
- }
-
- }
-
- }
-
- }
- i=i+1;
- // }
- }
- // console.log(commonContition);
- // consle.lg();
- /*
- ********报表公用取条件
- * start
- *
-
- ********
- * end
- /
- */
-
- /*
- * */
-
- /*
-
- if(cop=="估价/成交价差异表"){
-
- var dateRange=Ext.getCmp('ev_date');
- var codeRange=Ext.getCmp('ev_code');
- console.log(dateRange.valuePrint);
- console.log(codeRange.valuePrint);
- var codeValuePrint = codeRange.valuePrint;
- var dateValuePrint=dateRange.valuePrint;
- var custcode=Ext.getCmp('cu_code');
- var prodcode=Ext.getCmp('pr_code');
- var conditioncode = codeValuePrint;
- var conditiondate = dateValuePrint;
- console.log(conditioncode);
- console.log(conditiondate);
- reportName="Evaluation";
- condition=conditioncode+' and '+conditiondate;
- console.log(condition);
- console.log(form.title);
- }else if(cop=="采购额物料"){
- var dateRange=Ext.getCmp('pi_date');
- var dateValuePrint=dateRange.valuePrint;
- var kind=Ext.getCmp('pr_kind').value;
- reportName="ypurc2";
- condition=dateValuePrint+' and ('+'{ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单'"+')'+' and '+'{ProdInOut.pi_status}='+"'已过账'";
- if(kind!=""){
- condition+=' and '+'{Product.pr_kind}=' +"'"+kind+"'";
- }
- console.log(kind);
- }else if(cop=="采购额供应商"){
- var dateRange=Ext.getCmp('pi_date');
- var dateValuePrint=dateRange.valuePrint;
- var vendcode=Ext.getCmp('ve_code').value;
- reportName="ypurc1";
- condition=dateValuePrint+' and ('+'{ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单'"+')'+' and '+'{ProdInOut.pi_status}='+"'已过账'";
- if(vendcode!=""){
- condition+=' and '+'{ProdInout.pi_cardcode}' +"'"+vendcode+"'";
- }
- console.log(condition);
- }
- else if(cop=="客户名条打印"){
- reportName="customerMT";
- code=Ext.getCmp('cu_code').value;
- if (code!=""){
- condition='{customer.cu_code}='+"'"+code+"'";
- }
- }else if(cop=="客户信用检查明细表"){
- reportName="customerXY";
- code=Ext.getCmp('cu_code').value;
- if (code!=""){
- condition='{customer.cu_code}='+"'"+code+"'";
- }
- }else if(cop=="客户订单明细表"){
- reportName="saledetail";
- dateRange=Ext.getCmp('sa_date');
- console.log(dateRange);
-
- dateFW=dateRange.value;
- console.log(dateFW);
- var dateValuePrint=dateRange.valuePrint;
- var conditiondate = dateValuePrint;
- var custcode=Ext.getCmp('sa_custcode').value;
- var prodcode=Ext.getCmp('pr_code').value;
- condition=conditiondate+' and '+'{Sale.sa_status}<>'+"'已结案'";
- 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;i<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- condition+=' and '+'{MA_MAKEUSEPRE.ma_code}in['+arrcode.substring(0, arrcode.length-1)+']';
- }else{
- if(code!=""){
- condition+=' and '+'{MA_MAKEUSEPRE.ma_code}in['+"'"+code+"'"+']';
- }
- }
- if(remark=="A4"){
- reportName="MakeUsagePre";
- }
- if(remark=="半刀"){
- reportName="MakeUsagePre_14";
- }
- if(prodcode!=""){
- condition+=' and '+'{MA_MAKEUSEPRE.mm_prodcode}='+"'"+prodcode+"'";
- }
- if(wccode!=""){
- condition+=' and '+'{MA_MAKEUSEPRE.ma_wccode}='+"'"+wccode+"'";
- }
- ///if(code!=""){
- //condititon+=' and '+'{MA_MAKEUSEPRE.ma_code}='+"'"+arrcode+"'";
- //}
- 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_p";
- 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('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;i<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- condition+=' and '+'{MakeMaterial.mm_processcode} in['+arrcode.substring(0, arrcode.length-1)+']';
- idS=arrcode.substring(0, arrcode.length-1);
- }else{
- if(macode!=""){
- condition+=' and '+'{MakeMaterial.mm_processcode} in['+"'"+macode+"'"+']';
- idS="'"+macode+"'";
- }
- }
-
- console.log(condition);
- }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="MakeMaterial31";
- condition=dateValuePrint;
- if(strs.length>1){
- for(i=0;i<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- condition+=' and '+'{make.ma_code} in['+arrcode.substring(0, arrcode.length-1)+']';
- idS=arrcode.substring(0, arrcode.length-1);
- }else{
- if(macode!=""){
- condition+=' and '+'{make.ma_code} in['+"'"+macode+"'"+']';
- idS="'"+macode+"'";
- }
- }
- console.log(condition);
- }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="MakeMaterial32";
- condition=dateValuePrint;
- if(strs.length>1){
- for(i=0;i<strs.length;i++){
- arrcode+="'"+strs[i]+"'"+",";
- }
- condition+=' and '+'{make.ma_code} in['+arrcode.substring(0, arrcode.length-1)+']';
- idS=arrcode.substring(0, arrcode.length-1);
- }else{
- if(macode!=""){
- condition+=' and '+'{make.ma_code} in['+"'"+macode+"'"+']';
- idS="'"+macode+"'";
- }
- }
- console.log(condition);
-
- }else if(cop=="物料时段需求分析"){
- reportName="ProdMonthNeed";
-
- var prodcode=Ext.getCmp('pr_code').value;
- var kind=Ext.getCmp('pr_jhzc').value;
- if(kind=="外购件"){
- if(prodcode!=""){
- condition="{product.pr_status}='已审核' and {product.pr_supplytype}<>'VIRTUAL' and {product.pr_manutype}='PURCHASE'"+' and '+'{product.pr_code}='+"'"+prodcode+"'";
- }
- }
- if(kind=="制造件"){
- if(prodcode!=""){
- condition="{product.pr_status}='已审核' and {product.pr_supplytype}<>'虚拟件' and ({product.pr_manutype}='MAKE' or {product.pr_manutype}='OSMAKE')"+' and '+'{product.pr_code}='+"'"+prodcode+"'";
- }
- }
- }else if(cop=="发票明细查询"){
- var dateRange=Ext.getCmp('ab_date');
- var dateValuePrint=dateRange.valuePrint;
- var custcode=Ext.getCmp('ma_custcode').value;
- var prodcode=Ext.getCmp('pr_code').value;
- reportName="ArbillDetail";
- condition=dateValuePrint;
- if(custcode!=""){
- condition+=' and '+'{ArBill.ab_custcode}='+"'"+custcode+"'";
- }
- if(prodcode!=""){
- condition+=' and '+'{ARBILLDetail.abd_prodcode}='+"'"+prodcode+"'";
- }
- }else if(cop=="发票明细查询香港"){
- var dateRange=Ext.getCmp('ab_date');
- var dateValuePrint=dateRange.valuePrint;
- var custcode=Ext.getCmp('ma_custcode').value;
- var prodcode=Ext.getCmp('pr_code').value;
- reportName="ArbillDetail_hk";
- condition=dateValuePrint;
- if(custcode!=""){
- condition+=' and '+'{ArBill.ab_custcode}='+"'"+custcode+"'";
- }
- if(prodcode!=""){
- condition+=' and '+'{ARBILLDetail.abd_prodcode}='+"'"+prodcode+"'";
- }
- } else if(cop=="批记录"){
- reportName="BATCHLST";
- var whcode=Ext.getCmp('ba_whcode').value;
- var batchcode=Ext.getCmp('ba_code').value;
- var prodcode=Ext.getCmp('pr_code').value;
- condition="{Batch.ba_remain}>0";
- if(whcode!=""){
- condition+=' and '+'{batch.ba_whcode}='+"'"+whcode+"'";
- }
- if(batchcode!=""){
- condition+=' and '+'{batch.ba_code}='+"'"+batchcode+"'";
- }
- if(prodcode!=""){
- condition+=' and '+'{batch.ba_prodcode}='+"'"+prodcode+"'";
- }
- console.log(condition);
- }else if(cop=="开票明细表"){
- var dateRange=Ext.getCmp('ab_date');
- var dateValuePrint=dateRange.valuePrint;
- reportName="billout";
- var custcode=Ext.getCmp('ab_custcode').value;
- condition=dateValuePrint;
- 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_hk";
- var custcode=Ext.getCmp('ab_custcode').value;
- condition=dateValuePrint;
- if(custcode!=""){
- condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'";
- }
- console.log(condition);
- }
- else if(cop=="出入库明细表(过账日期)"){
- var dateRange=Ext.getCmp('pi_date1');
- 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;
- 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+"'";
- }
- console.log(condition);
-
- } else if(cop=="月销售分析表香港"){
- var dateRange=Ext.getCmp('ab_date');
- var dateValuePrint=dateRange.valuePrint;
- reportName="billout_month_hk";
- 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('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);
- }
- });
- }
- }
-
- });
|