Form.js 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491
  1. Ext.define('erp.view.common.print.Form',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpPrintFormPanel',
  4. id: 'printform',
  5. autoScroll : true,
  6. defaultType : 'textfield',
  7. layout: 'column',
  8. labelSeparator : ':',
  9. fieldDefaults : {
  10. margin : '2 2 2 2',
  11. fieldStyle : "background:#FFFAFA;color:#515151;",
  12. labelAlign : "right",
  13. blankText : $I18N.common.form.blankText
  14. },
  15. FormUtil: Ext.create('erp.util.FormUtil'),
  16. buttonAlign: 'center',
  17. buttons: [{
  18. name: 'print',
  19. text: $I18N.common.button.erpPrintButton,
  20. iconCls: 'x-button-icon-print',
  21. cls: 'x-btn-gray',
  22. style: {
  23. marginLeft: '10px'
  24. },
  25. handler:function(btn){
  26. var form = Ext.getCmp('printform');
  27. console.log(form);
  28. var reportName='';
  29. var condition='';
  30. var cop=form.title;
  31. var code='';
  32. var custcode='';
  33. var prodcode='';
  34. var fromdate='';
  35. var enddate='';
  36. console.log(cop);
  37. var id="1";
  38. var idS='';
  39. var vendorcode='';
  40. var purchaseman='';
  41. var status='';
  42. var whcode='';
  43. var salecode='';
  44. var todate='';
  45. var dateFW='';
  46. var assifall='';
  47. var tablename=form.tablename;
  48. console.log("tablename="+tablename);
  49. console.log(form.caller);
  50. var defaultCondition="";
  51. var thisreport="";
  52. if(cop=="销售额同比增长图(按业务员)"||cop=="销售额同比增长图(按业务员)"){
  53. fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d');
  54. todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d');
  55. console.log(fromdate);
  56. console.log(todate);
  57. }
  58. if(cop=="出入库明细表(过账日期)"){
  59. fromdate=Ext.Date.format(Ext.getCmp('pi_date1').firstVal, 'Y-m-d');
  60. todate=Ext.Date.format(Ext.getCmp('pi_date1').secondVal, 'Y-m-d');
  61. console.log(fromdate);
  62. console.log(todate);
  63. }
  64. if(cop=="明细分类账报表"){
  65. fromdate=Ext.Date.format(Ext.getCmp('sl_date').firstVal, 'Y-m-d');
  66. todate=Ext.Date.format(Ext.getCmp('sl_date').secondVal, 'Y-m-d');
  67. console.log(fromdate);
  68. console.log(todate);
  69. }
  70. if(cop=="期间库存表"){
  71. fromdate=Ext.Date.format(Ext.getCmp('pw_date').firstVal, 'Y-m-d');
  72. todate=Ext.Date.format(Ext.getCmp('pw_date').secondVal, 'Y-m-d');
  73. console.log(fromdate);
  74. console.log(todate);
  75. }
  76. if(cop=="出货成本汇总表"){
  77. fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d');
  78. todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d');
  79. console.log(fromdate);
  80. console.log(todate);
  81. }
  82. if(cop=="未发货客户订单明细表"){
  83. fromdate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d');
  84. todate=Ext.Date.format(Ext.getCmp('sa_date').secondVal, 'Y-m-d');
  85. console.log(fromdate);
  86. console.log(todate);
  87. }
  88. if(cop=="库存周转率分析表"||cop=="原材料周转天数表"){
  89. fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d');
  90. todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d');
  91. console.log(fromdate);
  92. console.log(todate);
  93. }
  94. if(cop=="产品分析表"){
  95. fromdate=Ext.Date.format(Ext.getCmp('vr_recorddate').firstVal, 'Y-m-d');
  96. todate=Ext.Date.format(Ext.getCmp('vr_recorddate').secondVal, 'Y-m-d');
  97. console.log(fromdate);
  98. console.log(todate);
  99. }
  100. if(cop=="集团业务员考核"){
  101. fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d');
  102. todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d');
  103. console.log(fromdate);
  104. console.log(todate);
  105. }
  106. if(cop=="供应商交货达成率报表"){
  107. fromdate=Ext.Date.format(Ext.getCmp('pd_delivery').firstVal, 'Y-m-d');
  108. todate=Ext.Date.format(Ext.getCmp('pd_delivery').secondVal, 'Y-m-d');
  109. console.log(fromdate);
  110. console.log(todate);
  111. }
  112. if(cop=="毛利润分析(按订单)"){
  113. fromdate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d');
  114. todate=Ext.Date.format(Ext.getCmp('sa_date').secondVal, 'Y-m-d');
  115. console.log(fromdate);
  116. console.log(todate);
  117. }
  118. if(cop=="采购成本降价表(按最新入库)"){
  119. fromdate=Ext.Date.format(Ext.getCmp('pi_date').firstVal, 'Y-m-d');
  120. todate=Ext.Date.format(Ext.getCmp('pi_date').secondVal, 'Y-m-d');
  121. enddate=Ext.Date.format(Ext.getCmp('pi_date1').value, 'Y-m-d');
  122. console.log(fromdate);
  123. console.log(todate);
  124. console.log(enddate);
  125. }
  126. if(cop=="在制仓库库存表(汇总)"){
  127. var myDate = new Date();
  128. var y=myDate.getFullYear();
  129. var m=myDate.getMonth()+1;
  130. var d=myDate.getDate();
  131. m=m<10?"0"+m:m;
  132. d=d<10?"0"+d:d;
  133. todate=y+"-"+m+"-"+d;
  134. }
  135. if(cop=="制造单备料单(A4)"){
  136. //var today=new Date()(); // 获取今天时间
  137. //today.setDate()(today.getDate()() + 7); // 系统会自动转换
  138. idS=Ext.getCmp('ma_code').value;
  139. }
  140. if(cop=="客户信用执行报表"){
  141. todate=Ext.getCmp('ccr_yearmonth').value;
  142. }
  143. if(cop=="派车费用统计"){
  144. var dateRange=Ext.getCmp('tt_date');
  145. dateFW=dateRange.value;
  146. var custcode=Ext.getCmp('tt_carcode').value;
  147. todate=custcode;
  148. fromdate=Ext.getCmp('tt_date').firstVal;
  149. enddate=Ext.getCmp('tt_date').secondVal;
  150. }
  151. if(cop=="销售订单达成率表"){
  152. todate=Ext.Date.format(Ext.getCmp('sa_date').firstVal, 'Y-m-d');;
  153. }
  154. if(cop=="死库存统计(按业务员)"||cop=="死库存统计(按业务员)"||cop=="呆库存统计(按业务员)"||cop=="呆库存统计(按公司)"){
  155. todate=Ext.Date.format(Ext.getCmp('ba_date').value, 'Y-m-d');;
  156. }
  157. if(cop=="在制仓库库存表(制单)"){
  158. var myDate = new Date();
  159. var y=myDate.getFullYear();
  160. var m=myDate.getMonth()+1;
  161. var d=myDate.getDate();
  162. m=m<10?"0"+m:m;
  163. d=d<10?"0"+d:d;
  164. todate=y+"-"+m+"-"+d;
  165. }
  166. /*
  167. if(cop=="未发货客户订单明细表"){
  168. var dateRange=Ext.getCmp('sa_date');
  169. var dateValuePrint=dateRange.valuePrint;
  170. dateFW=dateRange.value;
  171. }
  172. */
  173. var me = this;
  174. Ext.Ajax.request({
  175. url : basePath + 'common/enterprise/getprinturl.action?caller=' + caller,
  176. callback: function(opt, s, r) {
  177. var re = Ext.decode(r.responseText);
  178. defaultCondition = re.condition;
  179. thisreport=re.reportname;
  180. console.log(defaultCondition);
  181. if(defaultCondition!=null){
  182. if(commonContition!=""){
  183. commonContition=defaultCondition+' and '+commonContition;
  184. }else{
  185. commonContition=defaultCondition;
  186. }
  187. }
  188. //===========================================
  189. var whichsystem = re.whichsystem;
  190. var urladdress = "";
  191. var rpname = re.reportName;
  192. //console.log(rpname);
  193. if(Ext.isEmpty(rpname) || rpname == "null"){
  194. urladdress = re.printurl;
  195. } else if(rpname.indexOf(thisreport) > 0){
  196. urladdress = re.ErpPrintLargeData;
  197. } else{
  198. urladdress = re.printurl;
  199. }
  200. //console.log(reportName);
  201. //console.log(re.ErpPrintLargeData);
  202. console.log(urladdress);
  203. console.log(whichsystem);
  204. //===============================================
  205. console.log(commonContition);
  206. form.FormUtil.batchPrint(idS,thisreport,commonContition,cop,todate,dateFW,fromdate,enddate,urladdress,whichsystem);
  207. //在这里传条件和报表名字
  208. }
  209. });
  210. var length=form.items.length;
  211. var i=0;
  212. var tablename=form.tablename;
  213. var reportName="";
  214. var thisvalue="";
  215. var field="";
  216. var logicField="";
  217. //设置一个默认条件
  218. // var defaultContition=form.detailcondition;
  219. var commonContition=defaultCondition;
  220. while(i<length){
  221. //判断逻辑类型是否为空,不为空条件需替代为逻辑字段,不为空需要判断逻辑类型的字段类型,日期型需要格式化
  222. //console.log(form.items.items[i].logic);
  223. logicField=form.items.items[i].logic;
  224. //console.log(form.items.keys[i]);
  225. field=form.items.keys[i];
  226. //console.log(field);
  227. //console.log(Ext.getCmp(form.items.keys[i]).value);
  228. thisvalue=Ext.getCmp(form.items.keys[i]).value;
  229. console.log(thisvalue);
  230. console.log(form.items.items[i].xtype);
  231. console.log(logicField);
  232. if(thisvalue!="" && logicField!=null ){
  233. //判断逻辑字段的类型,日期需要格式化
  234. if(form.items.items[i].xtype=="condatefield"){
  235. var dateRange=Ext.getCmp(logicField);
  236. var dateValuePrint=dateRange.valuePrint;
  237. console.log(dateValuePrint);
  238. console.log(commonContition);
  239. if(commonContition!=null && commonContition!=''){
  240. commonContition+=' and '+dateValuePrint;
  241. }else{
  242. commonContition=dateValuePrint;
  243. }
  244. }else if(form.items.items[i].xtype=="ftfindfield"){
  245. var codeRange=Ext.getCmp(logicField);
  246. var codeValuePrint=codeRange.valuePrint;
  247. if(logicField=="am_yearmonth"){
  248. codeValuePrint=codeValuePrint.replace(/'/g,'');
  249. }
  250. if(commonContition!=null && commonContition!=''){
  251. commonContition+=' and '+codeValuePrint;
  252. }else{
  253. commonContition=codeValuePrint;
  254. }
  255. }else if(form.items.items[i].xtype=="datefield"){
  256. thisvalue=Ext.Date.format(thisvalue, 'Y-m-d');
  257. todate=thisvalue;
  258. //倒算库存金额带日期,倒算未开票
  259. if(commonContition!=null && commonContition!=''){
  260. commonContition+=' and '+'{'+logicField+'}<='+"date("+"'"+thisvalue+"'"+")";
  261. }else{
  262. commonContition='{'+logicField+'}<='+"date("+"'"+thisvalue+"'"+")";
  263. }
  264. }
  265. else{
  266. if(commonContition!=null && commonContition!=''){
  267. //判断是否是采购员ID,因为采购员ID设置成DBFIND,则判断不出是数值型还是字符型,故需要特殊处理一下
  268. if(logicField.indexOf('buyerid')>0||logicField.indexOf('sellerid')>0||logicField.indexOf('yearmonth')>0){
  269. commonContition+=' and '+'{'+logicField+'}='+thisvalue;
  270. }else if(cop=="集团毛利润汇总表"||cop=="集团毛利润分析表-按客户"||cop=="集团毛利润分析表-按品牌"||cop=="集团毛利润分析表-按业务员"||cop=="集团应收汇总表"||cop=="集团应付汇总表"||cop=="集团呆库存汇总表-按业务员"||cop=="集团死库存汇总表-按业务员"||cop=="集团呆库存汇总表-按业务员"||cop=="集团毛利润明细分析表"){
  271. var arrcode='';
  272. strs=thisvalue.split(",");
  273. if(strs.length>1){
  274. for(i=0;i<strs.length;i++){
  275. arrcode+="'"+strs[i]+"'"+",";
  276. }
  277. commonContition+=' and '+'{'+logicField+'}in ['+arrcode.substring(0, arrcode.length-1)+']';
  278. }else{
  279. commonContition+=' and '+'{'+logicField+'}='+"'"+thisvalue+"'";
  280. }
  281. }
  282. else{
  283. commonContition+=' and '+'{'+logicField+'}='+"'"+thisvalue+"'";
  284. }
  285. }else{
  286. //判断是否是采购员ID,因为采购员ID设置成DBFIND,则判断不出是数值型还是字符型,故需要特殊处理一下
  287. if(logicField.indexOf('buyerid')>0||logicField.indexOf('sellerid')>0||logicField.indexOf('yearmonth')>0){
  288. console.log("ffff");
  289. if(cop=="成本汇总表"){
  290. commonContition='{'+logicField+'}='+"'"+thisvalue+"'";
  291. }else{
  292. commonContition='{'+logicField+'}='+thisvalue;
  293. }
  294. }
  295. else{
  296. if(cop=="分仓库库存报表"||cop=="仓库盘点表(按品牌规格)"||cop=="集团库存数量金额表"||cop=="集团库存汇总表"||cop=="集团品牌库存汇总表"||cop=="集团银行余额汇总表"||cop=="集团业务员应付汇总表"){
  297. var arrcode='';
  298. var strs= new Array();
  299. if(cop=="分仓库库存报表"||cop=="仓库盘点表(按品牌规格)"){
  300. strs=thisvalue.split("#");
  301. }else{
  302. strs=thisvalue.split(",");
  303. }
  304. if(strs.length>1){
  305. for(i=0;i<strs.length;i++){
  306. arrcode+="'"+strs[i]+"'"+",";
  307. }
  308. commonContition='{'+logicField+'}in ['+arrcode.substring(0, arrcode.length-1)+']';
  309. }else{
  310. commonContition='{'+logicField+'}='+"'"+thisvalue+"'";
  311. }
  312. }else {
  313. commonContition='{'+logicField+'}='+"'"+thisvalue+"'";
  314. }
  315. }
  316. }
  317. }
  318. }
  319. i=i+1;
  320. // }
  321. }
  322. // console.log(commonContition);
  323. // consle.lg();
  324. /*
  325. ********报表公用取条件
  326. * start
  327. *
  328. ********
  329. * end
  330. /
  331. */
  332. /*
  333. * */
  334. /*
  335. if(cop=="估价/成交价差异表"){
  336. var dateRange=Ext.getCmp('ev_date');
  337. var codeRange=Ext.getCmp('ev_code');
  338. console.log(dateRange.valuePrint);
  339. console.log(codeRange.valuePrint);
  340. var codeValuePrint = codeRange.valuePrint;
  341. var dateValuePrint=dateRange.valuePrint;
  342. var custcode=Ext.getCmp('cu_code');
  343. var prodcode=Ext.getCmp('pr_code');
  344. var conditioncode = codeValuePrint;
  345. var conditiondate = dateValuePrint;
  346. console.log(conditioncode);
  347. console.log(conditiondate);
  348. reportName="Evaluation";
  349. condition=conditioncode+' and '+conditiondate;
  350. console.log(condition);
  351. console.log(form.title);
  352. }else if(cop=="采购额‎‎物料"){
  353. var dateRange=Ext.getCmp('pi_date');
  354. var dateValuePrint=dateRange.valuePrint;
  355. var kind=Ext.getCmp('pr_kind').value;
  356. reportName="ypurc2";
  357. condition=dateValuePrint+' and ('+'{ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单'"+')'+' and '+'{ProdInOut.pi_status}='+"'已过账'";
  358. if(kind!=""){
  359. condition+=' and '+'{Product.pr_kind}=' +"'"+kind+"'";
  360. }
  361. console.log(kind);
  362. }else if(cop=="采购额供应商‎‎"){
  363. var dateRange=Ext.getCmp('pi_date');
  364. var dateValuePrint=dateRange.valuePrint;
  365. var vendcode=Ext.getCmp('ve_code').value;
  366. reportName="ypurc1";
  367. condition=dateValuePrint+' and ('+'{ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单'"+')'+' and '+'{ProdInOut.pi_status}='+"'已过账'";
  368. if(vendcode!=""){
  369. condition+=' and '+'{ProdInout.pi_cardcode}' +"'"+vendcode+"'";
  370. }
  371. console.log(condition);
  372. }
  373. else if(cop=="客户名条打印"){
  374. reportName="customerMT";
  375. code=Ext.getCmp('cu_code').value;
  376. if (code!=""){
  377. condition='{customer.cu_code}='+"'"+code+"'";
  378. }
  379. }else if(cop=="客户信用检查明细表"){
  380. reportName="customerXY";
  381. code=Ext.getCmp('cu_code').value;
  382. if (code!=""){
  383. condition='{customer.cu_code}='+"'"+code+"'";
  384. }
  385. }else if(cop=="客户订单明细表"){
  386. reportName="saledetail";
  387. dateRange=Ext.getCmp('sa_date');
  388. console.log(dateRange);
  389. dateFW=dateRange.value;
  390. console.log(dateFW);
  391. var dateValuePrint=dateRange.valuePrint;
  392. var conditiondate = dateValuePrint;
  393. var custcode=Ext.getCmp('sa_custcode').value;
  394. var prodcode=Ext.getCmp('pr_code').value;
  395. condition=conditiondate+' and '+'{Sale.sa_status}<>'+"'已结案'";
  396. if(custcode!=""){
  397. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  398. }
  399. if(prodcode!=""){
  400. condition+=' and '+'{saledetail.sd_prodcode}='+"'"+prodcode+"'";
  401. }
  402. console.log(condition);
  403. }else if(cop=="未发货客户订单明细表"){
  404. reportName="saledetailnotsend";
  405. var dateRange=Ext.getCmp('sa_date');
  406. var dateValuePrint=dateRange.valuePrint;
  407. dateFW=dateRange.value;
  408. console.log(dateFW);
  409. var conditiondate = dateValuePrint;
  410. var custcode=Ext.getCmp('sa_custcode').value;
  411. var sellercode=Ext.getCmp('sa_sellercode').value;
  412. condition=conditiondate+' and '+'{SaleDetail.sd_qty}-{SaleDetail.sd_sendqty}>0.001'+' and '+'{sale.sa_status}<>'+"'已结案'" ;
  413. if(custcode!=""){
  414. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  415. }
  416. if(sellercode!=""){
  417. condition+=' and '+'{sale.sa_sellercode}='+"'"+sellercode+"'";
  418. }
  419. console.log(condition);
  420. }else if(cop=="价格变动审批表"){
  421. var dateRange=Ext.getCmp('pu_date');
  422. var dateValuePrint=dateRange.valuePrint;
  423. var vendcode=Ext.getCmp('pu_vendcode').value;
  424. prodcode=Ext.getCmp('pr_code').value;
  425. reportName="PriceChange";
  426. condition=dateValuePrint;
  427. if(vendcode!=""){
  428. condition+=' and '+'{purchase.pu_vendcode}='+"'"+code+"'";
  429. }
  430. if(prodcode!=""){
  431. condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'" ;
  432. }
  433. console.log(condition);
  434. }else if(cop=="月COST DOWN统计表"){
  435. var dateRange=Ext.getCmp('pu_date');
  436. var dateValuePrint=dateRange.valuePrint;
  437. var vendcode=Ext.getCmp('pu_vendcode').value;
  438. prodcode=Ext.getCmp('pr_code').value;
  439. reportName="CostDown";
  440. condition=dateValuePrint;
  441. if(vendcode!=""){
  442. condition+=' and '+'{purchase.pu_vendcode}='+"'"+code+"'";
  443. }
  444. if(prodcode!=""){
  445. condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'" ;
  446. }
  447. console.log(condition);
  448. }
  449. else if(cop=="客户订单追踪表"){
  450. var dateRange=Ext.getCmp('sa_date');
  451. var codeRange=Ext.getCmp('sa_code');
  452. console.log(dateRange.valuePrint);
  453. console.log(codeRange.valuePrint);
  454. var codeValuePrint = codeRange.valuePrint;
  455. var dateValuePrint=dateRange.valuePrint;
  456. custcode=Ext.getCmp('cu_code').value;
  457. reportName="saletrack";
  458. console.log(codeValuePrint);
  459. condition=dateValuePrint;
  460. if(codeValuePrint!=""){
  461. condition+=' and '+codeValuePrint;
  462. }
  463. if(custcode!=""){
  464. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  465. }
  466. }else if(cop=="派车费用统计"){
  467. var dateRange=Ext.getCmp('tt_date');
  468. dateFW=dateRange.value;
  469. var dateValuePrint=dateRange.valuePrint;
  470. reportName="carcosttotal";
  471. var custcode=Ext.getCmp('tt_carcode').value;
  472. todate=custcode;
  473. fromdate=Ext.getCmp('tt_date').firstVal;
  474. enddate=Ext.getCmp('tt_date').secondVal;
  475. }else if(cop=="销售订单预计交货表"){
  476. var dateRange=Ext.getCmp('sa_date');
  477. var codeRange=Ext.getCmp('sa_code');
  478. console.log(dateRange.valuePrint);
  479. console.log(codeRange.valuePrint);
  480. var codeValuePrint = codeRange.valuePrint;
  481. var dateValuePrint=dateRange.valuePrint;
  482. console.log(dateValuePrint);
  483. custcode=Ext.getCmp('cu_code').value;
  484. reportName="salepresend";
  485. condition=dateValuePrint;
  486. if(codeValuePrint!=""){
  487. condition+=' and '+codeValuePrint;
  488. }
  489. if(custcode!=""){
  490. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  491. }
  492. }else if(cop=="产品别预计出货表"){
  493. var dateRange=Ext.getCmp('sa_date');
  494. var codeRange=Ext.getCmp('sa_code');
  495. console.log(dateRange.valuePrint);
  496. console.log(codeRange.valuePrint);
  497. var codeValuePrint = codeRange.valuePrint;
  498. var dateValuePrint=dateRange.valuePrint;
  499. console.log(dateValuePrint);
  500. reportName="saleprodkind";
  501. custcode=Ext.getCmp('cu_code').value;
  502. reportName="salekindsend";
  503. console.log(reportName);
  504. condition=dateValuePrint;
  505. if(codeValuePrint!=""){
  506. condition+=' and '+codeValuePrint;
  507. }
  508. if(custcode!=""){
  509. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  510. }
  511. }else if(cop=="订单生产进度表"){
  512. var dateRange=Ext.getCmp('sa_date');
  513. var codeRange=Ext.getCmp('sa_code');
  514. console.log(dateRange.valuePrint);
  515. console.log(codeRange.valuePrint);
  516. var codeValuePrint = codeRange.valuePrint;
  517. var dateValuePrint=dateRange.valuePrint;
  518. console.log(dateValuePrint);
  519. reportName="ProgressSheet";
  520. custcode=Ext.getCmp('cu_code').value;
  521. condition=dateValuePrint;
  522. if(codeValuePrint!=""){
  523. condition+=' and '+codeValuePrint;
  524. }
  525. if(custcode!=""){
  526. condition+=' and '+'{sale.sa_custcode}='+"'"+custcode+"'";
  527. }
  528. }else if(cop=="出货清单DD"){
  529. var dateRange=Ext.getCmp('pi_date');
  530. var codeRange=Ext.getCmp('pi_inoutno');
  531. var codeValuePrint = codeRange.valuePrint;
  532. var dateValuePrint=dateRange.valuePrint;
  533. reportName="SaleSendOut";
  534. condition=codeValuePrint+' and '+dateValuePrint;
  535. }else if(cop=="出货明细表" || cop=="出货清单"){
  536. var dateRange=Ext.getCmp('pi_date');
  537. var dateValuePrint=dateRange.valuePrint;
  538. var whcode=Ext.getCmp('pi_whcode').value;
  539. var depcode=Ext.getCmp('pi_departmentcode').value;
  540. var status=Ext.getCmp('pi_status').value;
  541. var cardcode=Ext.getCmp('pi_cardcode').value;
  542. var piclass=Ext.getCmp('pi_class').value;
  543. var prodcode=Ext.getCmp('pr_code').value;
  544. reportName="SaleSendOut";
  545. condition=dateValuePrint;
  546. if(cardcode!=""){
  547. condition+=" and {prodinout.pi_cardcode}='"+cardcode+"' " ;
  548. }
  549. if(whcode!=""){
  550. condition+=' and {prodiodetail.pd_whcode}='+"'"+whcode+"'";
  551. }
  552. if(depcode!=""){
  553. condition+=' and {prodinout.pi_departmentcode}='+"'"+depcode+"'";
  554. }
  555. if(piclass=="出货单"){
  556. condition+=' and {prodinout.pi_class}='+"'"+piclass+"'";
  557. }
  558. if(piclass=="销售退货单"){
  559. condition+=' and {prodinout.pi_class}='+"'"+piclass+"'";
  560. }
  561. if(piclass=="全部"){
  562. condition+=' and '+'({prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}= '+"'销售退货单'"+")";
  563. }
  564. if(prodcode!=""){
  565. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  566. }
  567. console.log(condition);
  568. }else if(cop=="包装单打印"){
  569. reportName="paking";
  570. condition='{packing.pa_id}='+Ext.getCmp('pa_id').value+'';;
  571. }else if(cop=="销售退货清单打印"){
  572. var dateRange=Ext.getCmp('pi_date');
  573. var codeRange=Ext.getCmp('pi_inoutno');
  574. var codeValuePrint = codeRange.valuePrint;
  575. var dateValuePrint=dateRange.valuePrint;
  576. custcode=Ext.getCmp('cu_code').value;
  577. reportName="Salereturn";
  578. condition=dateValuePrint;
  579. if(codeValuePrint!=""){
  580. condition+=' and '+codeValuePrint;
  581. }
  582. if(custcode!=""){
  583. condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'";
  584. }
  585. console.log(condition);
  586. }else if(cop=="销售退货理由分析表"){
  587. var dateRange=Ext.getCmp('pi_date');
  588. custcode=Ext.getCmp('cu_code').value;
  589. console.log(dateRange.valuePrint);
  590. var dateValuePrint=dateRange.valuePrint;
  591. console.log(dateValuePrint);
  592. reportName="retulistAn";
  593. condition=dateValuePrint;
  594. if(custcode!=""){
  595. condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'";
  596. }
  597. }else if(cop=="客户别销退理由分析表"){
  598. var dateRange=Ext.getCmp('pi_date');
  599. console.log(dateRange.valuePrint);
  600. var dateValuePrint=dateRange.valuePrint;
  601. console.log(dateValuePrint);
  602. custcode=Ext.getCmp('cu_code').value;
  603. reportName="salecustkind";
  604. condition=dateValuePrint;
  605. if(custcode!=""){
  606. condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'";
  607. }
  608. }else if(cop=="估价单成本一览表"){
  609. var dateRange=Ext.getCmp('ev_date');
  610. var codeRange=Ext.getCmp('ev_code');
  611. console.log(dateRange.valuePrint);
  612. var dateValuePrint=dateRange.valuePrint;
  613. var codeValuePrint = codeRange.valuePrint;
  614. console.log(dateValuePrint);
  615. custcode=Ext.getCmp('cu_code').value;
  616. prodcode=Ext.getCmp('pr_code').value;
  617. reportName="EvaluationCB";
  618. condition=dateValuePrint;
  619. if(codeValuePrint!=""){
  620. condition+=' and ' + codeValuePrint;
  621. }
  622. if(custcode!=""){
  623. condition+=' and ' +'{Evaluation.ev_custcode}='+"'"+custcode+"'";
  624. }
  625. if(prodcode!=""){
  626. condition+=' and '+'{EvaluationDetail.evd_prodcode}='+prodcode+"'";
  627. }
  628. }else if(cop=="毛利润分析(按客户)"){
  629. var dateRange=Ext.getCmp('pi_date');
  630. var dateValuePrint=dateRange.valuePrint;
  631. custcode=Ext.getCmp('sa_custcode').value;
  632. reportName="PROFITCUSTOMER";
  633. condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";;
  634. if(custcode!=""){
  635. condition+=' and '+'{prodinout.pi_cardcode}='+"'"+custcode+"'";
  636. }
  637. console.log(condition);
  638. }else if(cop=="毛利润分析(按业务员)"){
  639. var dateRange=Ext.getCmp('pi_date');
  640. var dateValuePrint=dateRange.valuePrint;
  641. var sellercode=Ext.getCmp('sa_sellercode').value;
  642. reportName="PROFITSELLER";
  643. condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";
  644. if(sellercode!=""){
  645. condition+=' and '+'{prodinout.pi_sellercode}='+"'"+sellercode+"'";
  646. }
  647. console.log(condition);
  648. }else if(cop=="毛利润分析(按产品)"){
  649. var dateRange=Ext.getCmp('pi_date');
  650. var dateValuePrint=dateRange.valuePrint;
  651. var prodcode=Ext.getCmp('pr_code').value;
  652. reportName="profitproduct";
  653. condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";
  654. if(prodcode!=""){
  655. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  656. }
  657. console.log(condition);
  658. }else if(cop=="毛利润分析(按机型)"){
  659. var dateRange=Ext.getCmp('pi_date');
  660. var dateValuePrint=dateRange.valuePrint;
  661. reportName="profitproductkind";
  662. condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";
  663. console.log(condition);
  664. }
  665. else if(cop=="毛利润分析明细表"){
  666. var dateRange=Ext.getCmp('pi_date');
  667. var dateValuePrint=dateRange.valuePrint;
  668. var sellercode=Ext.getCmp('sa_sellercode').value;
  669. reportName="PROFITDETAIL";
  670. condition=dateValuePrint+' and ('+'{prodinout.pi_class}='+"'出货单'"+' or '+'{prodinout.pi_class}='+"'销售退货单'"+")";
  671. if(sellercode!=""){
  672. condition+=' and '+'{prodinout.pi_sellercode}='+"'"+sellercode+"'";
  673. }
  674. }else if(cop=="销售预测明细表"){
  675. var dateRange=Ext.getCmp('sf_tilldate');
  676. var dateValuePrint=dateRange.valuePrint;
  677. var sellercode=Ext.getCmp('cu_code').value;
  678. reportName="SaleForDetail";
  679. condition=dateValuePrint;
  680. if(sellercode!=""){
  681. condition+=' and '+'{SaleForecast.sf_custcode}='+"'"+sellercode+"'";
  682. }
  683. }
  684. else if(cop=="供应商基本资料表"){
  685. reportName="VendorList";
  686. code=Ext.getCmp('ve_code').value;
  687. vendorcode=Ext.getCmp('ve_buyerid').value;
  688. if(code!="" && vendorcode!="" ){
  689. condition='{vendor.ve_code}='+"'"+code+"'"+" and " +'{vendor.ve_buyerid}='+code;
  690. console.log(condition);
  691. }
  692. if(code!="" && vendorcode==""){
  693. condition='{vendor.ve_code}='+"'"+code+"'";
  694. }
  695. if(code=="" && vendorcode!=""){
  696. condition='{vendor.ve_buyerid}='+vendorcode;
  697. }
  698. }else if(cop=="供应商名条打印"){
  699. reportName="VendorMT";
  700. code=Ext.getCmp('ve_code').value;
  701. if(code!=""){
  702. condition='{vendor.ve_code}='+"'"+code+"'";
  703. }
  704. }else if(cop=="供应商ABC分析表"){
  705. reportName="VendorABC";
  706. code=Ext.getCmp('ve_code').value;
  707. if(code!=""){
  708. condition='{vendor.ve_code}='+"'"+code+"'";
  709. }
  710. }else if(cop=="请购清单打印"){
  711. reportName="ApplicationDetail";
  712. var dateRange=Ext.getCmp('ap_date');
  713. var dateValuePrint=dateRange.valuePrint;
  714. code=Ext.getCmp('ap_code').value;
  715. if(code!="" && dateRange=="[object Object]"){
  716. condition='{Application.ap_code}='+"'"+code+"'";
  717. }else if(code=="" && dateValuePrint!=""){
  718. condition=dateValuePrint;
  719. }else if(code!=""&& dateValuePrint!=""){
  720. condition='{Application.ap_code}='+"'"+code+"'" + " and "+dateValuePrint;
  721. }
  722. }else if(cop=="请购单进度追踪表打印"){
  723. reportName="ApplicationTrack";
  724. code=Ext.getCmp('ap_code').value;
  725. if(code!=""){
  726. condition='{Application.ap_code}='+"'"+code+"'";
  727. }
  728. }else if(cop=="请购转采购清单打印"){
  729. reportName="ApplicationToPur";
  730. code=Ext.getCmp('ap_code').value;
  731. if(code!=""){
  732. condition='{Application.ap_code}='+"'"+code+"'";
  733. }
  734. }else if(cop=="采购单交货数量审核表"){
  735. var dateRange=Ext.getCmp('pu_date');
  736. var codeRange=Ext.getCmp('pu_code');
  737. console.log(dateRange.valuePrint);
  738. var dateValuePrint=dateRange.valuePrint;
  739. var codeValuePrint = codeRange.valuePrint;
  740. console.log(dateValuePrint);
  741. vendorcode=Ext.getCmp('pu_vendcode').value;
  742. purchaseman=Ext.getCmp('pu_buyerid').value;
  743. status=Ext.getCmp('pu_status').value;
  744. reportName="PurchaseQTY";
  745. condition=dateValuePrint;
  746. if(codeValuePrint!=""){
  747. condition+=' and '+codeValuePrint;
  748. }
  749. if(vendorcode!=""){
  750. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  751. }
  752. if(purchaseman!=""){
  753. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'";
  754. }
  755. }else if(cop=="采购单进度追踪表"){
  756. var dateRange=Ext.getCmp('pu_date');
  757. var codeRange=Ext.getCmp('pu_code');
  758. console.log(dateRange.valuePrint);
  759. var dateValuePrint=dateRange.valuePrint;
  760. var codeValuePrint = codeRange.valuePrint;
  761. console.log(dateValuePrint);
  762. vendorcode=Ext.getCmp('pu_vendcode').value;
  763. purchaseman=Ext.getCmp('pu_buyerid').value;
  764. status=Ext.getCmp('pu_status').value;
  765. reportName="PurchaseTrack";
  766. condition=dateValuePrint;
  767. if(codeValuePrint!=""){
  768. condition+=' and '+codeValuePrint;
  769. }
  770. if(vendorcode!=""){
  771. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  772. }
  773. if(purchaseman!=""){
  774. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'";
  775. }
  776. }else if(cop=="采购单清单打印"){
  777. var dateRange=Ext.getCmp('pu_date');
  778. var codeRange=Ext.getCmp('pu_code');
  779. console.log(dateRange.valuePrint);
  780. var dateValuePrint=dateRange.valuePrint;
  781. var codeValuePrint = codeRange.valuePrint;
  782. console.log(dateValuePrint);
  783. vendorcode=Ext.getCmp('pu_vendcode').value;
  784. purchaseman=Ext.getCmp('pu_buyerid').value;
  785. reportName="PurcAllDetail";
  786. condition=dateValuePrint;
  787. if(codeValuePrint!=""){
  788. condition+=' and '+codeValuePrint;
  789. }
  790. if(vendorcode!=""){
  791. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  792. }
  793. if(purchaseman!=""){
  794. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman+"'";
  795. }
  796. }else if(cop=="物料采购明细表"){
  797. var dateRange=Ext.getCmp('pu_date');
  798. console.log(dateRange.valuePrint);
  799. var dateValuePrint=dateRange.valuePrint;
  800. console.log(dateValuePrint);
  801. vendorcode=Ext.getCmp('pu_vendcode').value;
  802. purchaseman=Ext.getCmp('pu_buyerid').value;
  803. reportName="ProductBuy";
  804. condition=dateValuePrint;
  805. if(vendorcode!=""){
  806. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  807. }
  808. if( purchaseman!="") {
  809. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman;
  810. }
  811. }else if(cop=="收货明细表"){
  812. var dateRange=Ext.getCmp('pi_date');
  813. var dateValuePrint=dateRange.valuePrint;
  814. prodcode=Ext.getCmp('pr_code').value;
  815. var vendcode=Ext.getCmp('ve_code').value;
  816. var pucode=Ext.getCmp('pu_code').value;
  817. var piclass=Ext.getCmp('pi_class').value;
  818. reportName="inDetail";
  819. condition=dateValuePrint+' and {ProdInOut.pi_status}='+"'已过账'";
  820. //
  821. if(prodcode!=""){
  822. condition+=' and {prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  823. }
  824. if(vendcode!=""){
  825. condition+=' and {prodinout.pi_cardcode}='+"'"+vendcode+"'";
  826. }
  827. if(pucode!=""){
  828. condition+=' and {purchase.pu_code}='+"'"+pucode+"'";
  829. }
  830. if(piclass=="全部"){
  831. 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}='+"'不良品出库单')";
  832. }else{
  833. condition+=' and {prodinout.pi_class}='+"'"+piclass+"'";
  834. }
  835. console.log(condition);
  836. }
  837. else if(cop=="未到货采购明细表"){
  838. var dateRange=Ext.getCmp('pu_date');
  839. var dateValuePrint=dateRange.valuePrint;
  840. console.log(dateValuePrint);
  841. vendorcode=Ext.getCmp('pu_vendcode').value;
  842. purchaseman=Ext.getCmp('pu_buyerid').value;
  843. var pucode=Ext.getCmp('pu_code').value;
  844. var prodcode=Ext.getCmp('pr_code').value;
  845. reportName="PurcAllDetail";
  846. condition=dateValuePrint+' and '+'({PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001 AND (ISNULL({PurchaseDetail.pd_mrpstatus}) or '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'"+ ' )'+' and '+'{purchase.pu_status}<>'+"'已结案'";
  847. if(vendorcode!=""){
  848. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  849. }
  850. if( purchaseman!="") {
  851. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman;
  852. }
  853. if(pucode!=""){
  854. condition+=' and '+'{purchase.pu_code}='+"'"+pucode+"'";
  855. }
  856. if(prodcode!=""){
  857. condition+=' and '+'{purchasedetail.pd_prodcode}='+"'"+prodcode+"'";
  858. }
  859. console.log(condition);
  860. } else if(cop=="物料采购单价明细表"){
  861. var dateRange=Ext.getCmp('pp_auditdate');
  862. console.log(dateRange.valuePrint);
  863. var dateValuePrint=dateRange.valuePrint;
  864. console.log(dateValuePrint);
  865. vendorcode=Ext.getCmp('pu_vendcode').value;
  866. purchaseman=Ext.getCmp('pp_buyerid').value;
  867. reportName="PurchasePriceDetail";
  868. condition=dateValuePrint;
  869. if(vendorcode!=""){
  870. condition+=' and '+'{PurchasePrice.pp_vendcode}='+"'"+vendorcode+"'";
  871. }
  872. if( purchaseman!="") {
  873. condition+=' and '+'{PurchasePrice.pp_buyerid}='+purchaseman;
  874. }
  875. }else if(cop=="供应商收货状况表"){
  876. reportName="PurcAllDetail_vv";
  877. vendorcode=Ext.getCmp('ve_code').value;
  878. if(vendorcode!=""){
  879. condition='{Vendor.ve_code}='+"'"+vendorcode+"'";
  880. }
  881. }else if(cop=="采购物料预计到库状况表"){
  882. var dateRange=Ext.getCmp('pu_date');
  883. var codeRange=Ext.getCmp('pu_code');
  884. console.log(dateRange.valuePrint);
  885. var dateValuePrint=dateRange.valuePrint;
  886. var codeValuePrint = codeRange.valuePrint;
  887. console.log(dateValuePrint);
  888. vendorcode=Ext.getCmp('pu_vendcode').value;
  889. purchaseman=Ext.getCmp('pu_buyerid').value;
  890. reportName="ProductWLDKZK";
  891. condition=dateValuePrint;
  892. if(vendorcode!=""){
  893. condition+=' and '+'{purchase.pu_vendcode}='+"'"+vendorcode+"'";
  894. }
  895. if( purchaseman!="") {
  896. condition+=' and '+'{purchase.pu_buyerid}='+purchaseman;
  897. }
  898. if(codeValuePrint!=""){
  899. condition+=' and '+codeValuePrint;
  900. }
  901. }else if(cop=="采购预测未转明细表"){
  902. reportName="PurchaseYCWZ";
  903. code=Ext.getCmp('pf_code').value;
  904. if(vendorcode!=""){
  905. condition='{PurchaseForecast.pf_code}='+"'"+code+"'";
  906. }
  907. }else if(cop=="采购预测转出明细表"){
  908. reportName="PurchaseYCYZ";
  909. code=Ext.getCmp('pf_code').value;
  910. if(vendorcode!=""){
  911. condition='{PurchaseForecast.pf_code}='+"'"+code+"'";
  912. }
  913. }else if(cop=="交货数量统计分析表"){
  914. reportName="InWh";
  915. code=Ext.getCmp('pi_inoutno').value;
  916. if(code!=""){
  917. condition='{ProdInOut.pi_inoutno}='+"'"+code+"'";
  918. }
  919. }else if(cop=="交期统计分析表"){
  920. reportName="InJh";
  921. code=Ext.getCmp('pi_inoutno').value;
  922. if(code!=""){
  923. condition='{ProdInOut.pi_inoutno}='+"'"+code+"'";
  924. }
  925. }else if(cop=="采购收料统计表"){
  926. reportName="QUA_VerifyApply";
  927. code=Ext.getCmp('pd_vacode').value;
  928. if(code!=""){
  929. condition='{VerifyApply.va_code}='+"'"+code+"'";
  930. }
  931. }else if(cop=="采购退货理由分析表"){
  932. reportName="piolistTHreson";
  933. code=Ext.getCmp('pi_inoutno').value;
  934. if(code!=""){
  935. condition='{ProdInOut.pi_inoutno}='+"'"+code+"'";
  936. }
  937. }else if(cop=="物料询价历史资料表"){
  938. reportName="InquiryProduct";
  939. code=Ext.getCmp('pp_code').value;
  940. if(code!=""){
  941. condition='{PurchasePrice.pp_code}='+"'"+code+"'";
  942. }
  943. }else if(cop=="采购单价统计表"){
  944. reportName="InPrice";
  945. code=Ext.getCmp('pi_inoutno').value;
  946. if(code!=""){
  947. condition='{ProdInOut.pi_inoutno}='+"'"+code+"'";
  948. }
  949. }else if(cop=="采购单交货异常表"){
  950. reportName="PurchaseJHNG";
  951. code=Ext.getCmp('pi_inoutno').value;
  952. if(code!=""){
  953. condition='{ProdInOut.pi_inoutno}='+"'"+code+"'";
  954. }
  955. }else if(cop=="物料库存成本报表"){
  956. reportName="ProductCBJE";
  957. code=Ext.getCmp('pr_code').value;
  958. if(code!=""){
  959. condition='{ProductWh.pw_prodcode}='+"'"+code+"'";
  960. }
  961. }else if(cop=="出入库明细表"){
  962. var dateRange=Ext.getCmp('pi_date');
  963. var kind=Ext.getCmp('pi_class').value;
  964. var whcode=Ext.getCmp('pi_whcode').value;
  965. var batchcode=Ext.getCmp('pd_batchcode').value;
  966. var status=Ext.getCmp('pi_status').value;
  967. var department=Ext.getCmp('pi_departmentname').value;
  968. var dateValuePrint=dateRange.valuePrint;
  969. prodcode=Ext.getCmp('pr_code').value;
  970. var xcode=Ext.getCmp('pd_ordercode').value;
  971. reportName="PRODIO";
  972. condition=dateValuePrint;
  973. console.log(dateValuePrint);
  974. console.log(kind);
  975. console.log(whcode);
  976. if(prodcode!=""){
  977. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  978. }
  979. if(kind!=""&&kind!="全部"){
  980. condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'";
  981. }
  982. if(whcode!=""){
  983. condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'";
  984. }
  985. if(batchcode!=""){
  986. condition+=' and '+'{prodiodetail.pd_batchcode}='+"'"+batchcode+"'";
  987. }
  988. if(status!=""&&status!="全部"){
  989. condition+=' and '+'{prodinout.pi_status}='+"'"+status+"'";
  990. }
  991. if(department!=""){
  992. condition+=' and '+'{prodinout.pi_departmentname}='+"'"+department+"'";
  993. }
  994. if(xcode!=""){
  995. condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+xcode+"'";
  996. }
  997. console.log(condition);
  998. }else if(cop=="出入库明细表(合并)"){
  999. var dateRange=Ext.getCmp('pi_date');
  1000. var kind=Ext.getCmp('pi_class').value;
  1001. var whcode=Ext.getCmp('pi_whcode').value;
  1002. var batchcode=Ext.getCmp('pd_batchcode').value;
  1003. var status=Ext.getCmp('pi_status').value;
  1004. var department=Ext.getCmp('pi_departmentname').value;
  1005. var dateValuePrint=dateRange.valuePrint;
  1006. prodcode=Ext.getCmp('pr_code').value;
  1007. var xcode=Ext.getCmp('pd_ordercode').value;
  1008. reportName="PRODIOHB";
  1009. 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}='+"'采购验退单')";
  1010. console.log(dateValuePrint);
  1011. console.log(kind);
  1012. console.log(whcode);
  1013. if(prodcode!=""){
  1014. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1015. }
  1016. if(kind!=""&&kind!="全部"){
  1017. condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'";
  1018. }
  1019. if(whcode!=""){
  1020. condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'";
  1021. }
  1022. if(batchcode!=""){
  1023. condition+=' and '+'{prodiodetail.pd_batchcode}='+"'"+batchcode+"'";
  1024. }
  1025. if(status!=""&&status!="全部"){
  1026. condition+=' and '+'{prodinout.pi_status}='+"'"+status+"'";
  1027. }
  1028. if(department!=""){
  1029. condition+=' and '+'{prodinout.pi_departmentname}='+"'"+department+"'";
  1030. }
  1031. if(xcode!=""){
  1032. condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+xcode+"'";
  1033. }
  1034. console.log(condition);
  1035. }
  1036. else if(cop=="采购验收清单表"){
  1037. var dateRange=Ext.getCmp('pi_date');
  1038. var codeRange=Ext.getCmp('pi_inoutno');
  1039. var kind='采购验收单';
  1040. var whcode=Ext.getCmp('pi_whcode').value;
  1041. var dateValuePrint=dateRange.valuePrint;
  1042. var codeValuePrint = codeRange.valuePrint;;
  1043. reportName="PRODIO";
  1044. condition=dateValuePrint;
  1045. console.log(dateValuePrint);
  1046. console.log(kind);
  1047. console.log(whcode);
  1048. if(codeValuePrint!=""){
  1049. condition+=' and '+codeValuePrint;
  1050. }
  1051. if(kind!=""){
  1052. condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'";
  1053. }
  1054. if(whcode!=""){
  1055. condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'";
  1056. }
  1057. console.log(condition);
  1058. } else if(cop=="仓库库存金额汇总表"){
  1059. reportName="ProductJEHZ";
  1060. code=Ext.getCmp('pr_code').value;
  1061. whcode=Ext.getCmp('pw_whcode').value;
  1062. if(code!=""){
  1063. condition='{ProductWh.pw_prodcode}='+"'"+code+"'";
  1064. }else if(whcode!=""){
  1065. if (code!=""){
  1066. condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1067. }else
  1068. {
  1069. condition='{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1070. }
  1071. }
  1072. }else if(cop=="仓库库存金额明细表"){
  1073. reportName="ProductJEMX";
  1074. code=Ext.getCmp('pr_code').value;
  1075. whcode=Ext.getCmp('pw_whcode').value;
  1076. if(code!=""){
  1077. condition='{ProductWh.pw_prodcode}='+"'"+code+"'";
  1078. }else if(whcode!=""){
  1079. if (code!=""){
  1080. condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1081. }else
  1082. {
  1083. condition='{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1084. }
  1085. }
  1086. }else if(cop=="库存数量表"){
  1087. reportName="ProductNUM";
  1088. code=Ext.getCmp('pr_code').value;
  1089. //whcode=Ext.getCmp('pw_whcode').value;
  1090. if(code!=""){
  1091. condition='{ProductOnhand.po_prodcode}='+"'"+code+"'";
  1092. }
  1093. }else if(cop=="仓库有效状况表"){
  1094. reportName="ProductSFYX";
  1095. code=Ext.getCmp('pr_code').value;
  1096. whcode=Ext.getCmp('ba_whcode').value;
  1097. if(code!=""){
  1098. condition='{ProductWh.pw_prodcode}='+"'"+code+"'";
  1099. }else if(whcode!=""){
  1100. if (code!=""){
  1101. condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1102. }else
  1103. {
  1104. condition='{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1105. }
  1106. }
  1107. }else if(cop=="滞料物料分析表"){
  1108. reportName="ProductDCWL";
  1109. code=Ext.getCmp('pr_code').value;
  1110. whcode=Ext.getCmp('ba_whcode').value;
  1111. if(code!=""){
  1112. condition='{ProductWh.pw_prodcode}='+"'"+code+"'";
  1113. }else if(whcode!=""){
  1114. if (code!=""){
  1115. condition+=" and "+'{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1116. }else
  1117. {
  1118. condition='{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1119. }
  1120. }
  1121. }else if(cop=="库存帐龄表"){
  1122. reportName="PwAgeAll";
  1123. code=Ext.getCmp('ba_prodcode').value;
  1124. whcode=Ext.getCmp('ba_whcode').value;
  1125. condition="{Batch.ba_date}<={@Date0To} and {Batch.ba_thisremain}<>0";
  1126. if(code!=""){
  1127. condition+=' and '+'{Batch.ba_prodcode}='+"'"+code+"'";
  1128. }
  1129. if(whcode!=""){
  1130. condition+=' and '+'{Batch.ba_whcode}='+"'"+whcode+"'";
  1131. }
  1132. }else if(cop=="库存数量金额帐龄表"){
  1133. reportName="PwAgeAll";
  1134. code=Ext.getCmp('pr_code').value;
  1135. whcode=Ext.getCmp('pw_whcode').value;
  1136. if(code!="" && whcode!=""){
  1137. condition='{ProductWh.pw_prodcode}='+"'"+code+"'"+"and"+'{ProductWh.pw_whcode}='+"'"+whcode+"'";
  1138. }
  1139. }else if(cop=="低於订购点物料表"){
  1140. reportName="PRODLIST";
  1141. code=Ext.getCmp('pr_code').value;
  1142. if(code!=""){
  1143. condition='{Product.pr_code}='+"'"+code+"'";
  1144. }
  1145. }else if(cop=="两阶段调拨明细表"){
  1146. var dateRange=Ext.getCmp('pi_date');
  1147. var codeRange=Ext.getCmp('pi_inoutno');
  1148. console.log(dateRange.valuePrint);
  1149. var dateValuePrint=dateRange.valuePrint;
  1150. var codeValuePrint = codeRange.valuePrint;
  1151. prodcode=Ext.getCmp('pr_code').value;
  1152. custcode=Ext.getCmp('cu_code').value;
  1153. reportName="WareHouse";
  1154. condition=dateValuePrint;
  1155. if(codeValuePrint!=""){
  1156. condition+=' and '+codeValuePrint;
  1157. }
  1158. if(prodcode!=""){
  1159. condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1160. }
  1161. if(custcode!=""){
  1162. condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'";
  1163. }
  1164. }else if(cop=="两阶段调拨数量稽核表"){
  1165. var dateRange=Ext.getCmp('pi_date');
  1166. var codeRange=Ext.getCmp('pi_inoutno');
  1167. console.log(dateRange.valuePrint);
  1168. var dateValuePrint=dateRange.valuePrint;
  1169. var codeValuePrint = codeRange.valuePrint;
  1170. prodcode=Ext.getCmp('pr_code').value;
  1171. custcode=Ext.getCmp('cu_code').value;
  1172. reportName="WareHouseYYDB";
  1173. condition=dateValuePrint;
  1174. if(codeValuePrint!=""){
  1175. condition+=' and '+codeValuePrint;
  1176. }
  1177. if(prodcode!=""){
  1178. condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1179. }
  1180. if(custcode!=""){
  1181. condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'";
  1182. }
  1183. }else if(cop=="营运中心间调拨数量稽核表"){
  1184. var dateRange=Ext.getCmp('pi_date');
  1185. var codeRange=Ext.getCmp('pi_inoutno');
  1186. console.log(dateRange.valuePrint);
  1187. var dateValuePrint=dateRange.valuePrint;
  1188. var codeValuePrint = codeRange.valuePrint;
  1189. prodcode=Ext.getCmp('pr_code').value;
  1190. custcode=Ext.getCmp('cu_code').value;
  1191. reportName="WareHouseCKDB";
  1192. condition=dateValuePrint;
  1193. if(codeValuePrint!=""){
  1194. condition+=' and '+codeValuePrint;
  1195. }
  1196. if(prodcode!=""){
  1197. condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1198. }
  1199. if(custcode!=""){
  1200. condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'";
  1201. }
  1202. }else if(cop=="营运中心间调拨在途数量统计表"){
  1203. var dateRange=Ext.getCmp('pi_date');
  1204. var codeRange=Ext.getCmp('pi_inoutno');
  1205. console.log(dateRange.valuePrint);
  1206. var dateValuePrint=dateRange.valuePrint;
  1207. var codeValuePrint = codeRange.valuePrint;
  1208. reportName="WareHouseZTSL";
  1209. prodcode=Ext.getCmp('pr_code').value;
  1210. custcode=Ext.getCmp('cu_code').value;
  1211. condition=dateValuePrint;
  1212. if(codeValuePrint!=""){
  1213. condition+=' and '+codeValuePrint;
  1214. }
  1215. if(prodcode!=""){
  1216. condition+='{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1217. }
  1218. if(custcode!=""){
  1219. condition+=' and '+'{ProdInOut.pi_cardcode}='+custcode+"'";
  1220. }
  1221. }else if(cop=="ABC分类表"){
  1222. reportName="ProductABC";
  1223. code=Ext.getCmp('pr_code').value;
  1224. if(code!=""){
  1225. condition='{Product.pr_code}='+"'"+code+"'";
  1226. }
  1227. }else if(cop=="物料基本资料表(报表)"){
  1228. reportName="PRODLIST";
  1229. code=Ext.getCmp('pr_code').value;
  1230. if(code!=""){
  1231. condition='{Product.pr_code}='+"'"+code+"'";
  1232. }
  1233. }else if(cop=="物料基本资料-库存资料表(报表)"){
  1234. reportName="ProductKCZL";
  1235. code=Ext.getCmp('pr_code').value;
  1236. if(code!=""){
  1237. condition='{Product.pr_code}='+"'"+code+"'";
  1238. }
  1239. }else if(cop=="物料资料-销售资料"){
  1240. reportName="ProductSale";
  1241. code=Ext.getCmp('pr_code').value;
  1242. if(code!=""){
  1243. condition='{Product.pr_code}='+"'"+code+"'";
  1244. }
  1245. }else if(cop=="物料资料-采购资料"){
  1246. reportName="ProductPurchase";
  1247. code=Ext.getCmp('pr_code').value;
  1248. if(code!=""){
  1249. condition='{Product.pr_code}='+"'"+code+"'";
  1250. }
  1251. }else if(cop=="物料资料-计划资料"){
  1252. reportName="ProductJHZL";
  1253. code=Ext.getCmp('pr_code').value;
  1254. if(code!=""){
  1255. condition='{Product.pr_code}='+"'"+code+"'";
  1256. }
  1257. }else if(cop=="物料资料-财务资料"){
  1258. reportName="ProductCWZL";
  1259. code=Ext.getCmp('pr_code').value;
  1260. if(code!=""){
  1261. condition='{Product.pr_code}='+"'"+code+"'";
  1262. }
  1263. }else if(cop=="物料资料-特征资料"){
  1264. reportName="ProductTZZL";
  1265. code=Ext.getCmp('pr_code').value;
  1266. if(code!=""){
  1267. condition='{Product.pr_code}='+"'"+code+"'";
  1268. }
  1269. }else if(cop=="新增物料资料基本状况表"){
  1270. reportName="PRODLIST";
  1271. code=Ext.getCmp('pr_code').value;
  1272. if(code!=""){
  1273. condition='{Product.pr_code}='+"'"+code+"'";
  1274. }
  1275. }else if(cop=="物料单位换算资料表"){
  1276. reportName="ProductDWHS";
  1277. code=Ext.getCmp('pr_code').value;
  1278. if(code!=""){
  1279. condition='{Product.pr_code}='+"'"+code+"'";
  1280. }
  1281. }else if(cop=="物料库存明细表(报表)"){
  1282. reportName="ProductKCMX";
  1283. code=Ext.getCmp('pr_code').value;
  1284. if(code!=""){
  1285. condition='{Product.pr_code}='+"'"+code+"'";
  1286. }
  1287. }else if(cop=="在制委外加工单控制表"){
  1288. var dateRange=Ext.getCmp('ma_date');
  1289. var codeRange=Ext.getCmp('ma_code');
  1290. console.log(dateRange.valuePrint);
  1291. var dateValuePrint=dateRange.valuePrint;
  1292. var codeValuePrint = codeRange.valuePrint;
  1293. reportName="ProgressSheetExp";
  1294. prodcode=Ext.getCmp('pr_code').value;
  1295. condition=dateValuePrint;
  1296. if(codeValuePrint!=""){
  1297. condition+=' and '+codeValuePrint;
  1298. }
  1299. if(prodcode!=""){
  1300. condition+='{make.ma_prodcode}='+"'"+prodcode+"'";
  1301. }
  1302. }else if(cop=="委外加工单损耗率报表"){
  1303. var dateRange=Ext.getCmp('ma_date');
  1304. var codeRange=Ext.getCmp('ma_code');
  1305. console.log(dateRange.valuePrint);
  1306. var dateValuePrint=dateRange.valuePrint;
  1307. var codeValuePrint = codeRange.valuePrint;
  1308. reportName="Expliolist_bfbl";
  1309. prodcode=Ext.getCmp('pr_code').value;
  1310. condition=dateValuePrint;
  1311. if(codeValuePrint!=""){
  1312. condition+=' and '+codeValuePrint;
  1313. }
  1314. if(prodcode!=""){
  1315. condition+='{make.ma_prodcode}='+"'"+prodcode+"'";
  1316. }
  1317. }else if(cop=="委外加工变更单打印"){
  1318. var dateRange=Ext.getCmp('mc_date');
  1319. var codeRange=Ext.getCmp('mc_code');
  1320. console.log(dateRange.valuePrint);
  1321. var dateValuePrint=dateRange.valuePrint;
  1322. var codeValuePrint = codeRange.valuePrint;
  1323. reportName="MakeChangeWW_Batch";
  1324. prodcode=Ext.getCmp('pr_code').value;
  1325. condition=dateValuePrint;
  1326. if(codeValuePrint!=""){
  1327. condition+=' and '+codeValuePrint;
  1328. }
  1329. if(prodcode!=""){
  1330. condition+='{makechangedetail.md_prodcode}='+"'"+prodcode+"'";
  1331. }
  1332. }else if(cop=="在制制造单控制表"){
  1333. reportName="ProgressSheet";
  1334. code=Ext.getCmp('ma_code').value;
  1335. if(code!=""){
  1336. condition='{make.ma_code}='+"'"+code+"'";
  1337. }
  1338. }else if(cop=="完工入库明细表"){
  1339. var dateRange=Ext.getCmp('pi_date');
  1340. var codeRange=Ext.getCmp('pi_inoutno');
  1341. console.log(dateRange.valuePrint);
  1342. var dateValuePrint=dateRange.valuePrint;
  1343. var codeValuePrint = codeRange.valuePrint;
  1344. reportName="finish_Batch";
  1345. var whcode=Ext.getCmp('pi_whcode').value;
  1346. condition=dateValuePrint;
  1347. if(codeValuePrint!=""){
  1348. condition+=' and '+codeValuePrint;
  1349. }
  1350. if(whcode!=""){
  1351. condition+='{ProdInOut.pi_whcode}='+"'"+whcode+"'";
  1352. }
  1353. }else if(cop=="拆件完工入库明细表"){
  1354. var date=Ext.getCmp('pi_date');
  1355. var code=Ext.getCmp('pi_inoutno');
  1356. reportName="chaijianDetailh";
  1357. var whcode=Ext.getCmp('pi_whcode').value;
  1358. condition='{ProdInOut.pi_class}='+"'拆件完工入库'";
  1359. if(code!=""){
  1360. condition+=' and '+'{ProdInOut.pi_inoutno}='+"'"+code+"'";
  1361. }
  1362. if(whcode!=""){
  1363. condition+=' and '+'{ProdInOut.pi_whcode}='+"'"+whcode+"'";
  1364. }
  1365. if(date!=""){
  1366. condition+=' and '+'{ProdInOut.pi_date}='+"'"+date+"'";
  1367. }
  1368. }else if(cop=="制造单变更打印"){
  1369. var dateRange=Ext.getCmp('mc_date');
  1370. var codeRange=Ext.getCmp('mc_inoutno');
  1371. console.log(dateRange.valuePrint);
  1372. var dateValuePrint=dateRange.valuePrint;
  1373. var codeValuePrint = codeRange.valuePrint;
  1374. reportName="MakeChange_Batch";
  1375. custcode=Ext.getCmp('pi_cardcode').value;
  1376. prodcode=Ext.getCmp('pr_code').value;
  1377. condition=dateValuePrint+' and '+'{makechange.mc_tasktype}='+"'制造变更单'";
  1378. if(codeValuePrint!=""){
  1379. condition+=' and '+codeValuePrint;
  1380. }
  1381. if(prodcode!=""){
  1382. condition+=' and '+'{makechangedetail.md_prodcode}='+"'"+prodcode+"'";
  1383. }
  1384. }else if(cop=="生产进度报表"){
  1385. var dateRange=Ext.getCmp('ma_date');
  1386. console.log(dateRange.valuePrint);
  1387. var dateValuePrint=dateRange.valuePrint;
  1388. //var codeValuePrint = codeRange.valuePrint;
  1389. reportName="ProgressSheet";
  1390. custcode=Ext.getCmp('ma_custcode').value;
  1391. prodcode=Ext.getCmp('ma_prodcode').value;
  1392. code=Ext.getCmp('ma_code').value;
  1393. condition=dateValuePrint;
  1394. if(code!=""){
  1395. condition+=' and '+'{make.ma_code}='+"'"+code+"'";
  1396. }
  1397. if(prodcode!=""){
  1398. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1399. }
  1400. if(custcode!=""){
  1401. condition+=' and '+'{make.ma_custcode}='+"'"+custcode+"'";
  1402. }
  1403. }else if(cop=="生产执行明细表"){
  1404. var dateRange=Ext.getCmp('ma_date');
  1405. console.log(dateRange.valuePrint);
  1406. var dateValuePrint=dateRange.valuePrint;
  1407. reportName="MakeDetail";
  1408. prodcode=Ext.getCmp('ma_prodcode').value;
  1409. code=Ext.getCmp('ma_code').value;
  1410. condition=dateValuePrint;
  1411. if(code!=""){
  1412. condition+=' and '+code;
  1413. }
  1414. if(prodcode!=""){
  1415. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1416. }
  1417. }else if(cop=="生产领料退料明细表"){
  1418. var dateRange=Ext.getCmp('pi_date');
  1419. console.log(dateRange.valuePrint);
  1420. var dateValuePrint=dateRange.valuePrint;
  1421. reportName="scll";
  1422. var code=Ext.getCmp('ma_code').value;
  1423. prodcode=Ext.getCmp('ma_prodcode').value;
  1424. condition=dateValuePrint+' and '+'{ProdInOut.pi_status}='+"'已过账'"+' and ('+'{ProdInOut.pi_class}='+"'生产领料单'"+' or '+'{ProdInOut.pi_class}='+"'生产退料单'"+' or '+'{ProdInOut.pi_class}='+"'生产补料单'"+')';
  1425. if(code!=""){
  1426. condition+=' and '+'{prodiodetail.pd_ordercode}='+"'"+code+"'";
  1427. }
  1428. if(prodcode!=""){
  1429. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1430. }
  1431. console.log(condition);
  1432. }else if(cop=="生产领料退料汇总表"){
  1433. var dateRange=Ext.getCmp('pi_date');
  1434. console.log(dateRange.valuePrint);
  1435. var dateValuePrint=dateRange.valuePrint;
  1436. reportName="ProdOutMake";
  1437. prodcode=Ext.getCmp('pr_code').value;
  1438. condition=dateValuePrint+' and '+'{ProdInOut.pi_status}='+"'已过账'"+' and ('+'{ProdInOut.pi_class}='+"'生产领料单'"+' or '+'{ProdInOut.pi_class}='+"'生产退料单'"+' or '+'{ProdInOut.pi_class}='+"'生产补料单'"+')';
  1439. if(prodcode!=""){
  1440. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1441. }
  1442. }else if(cop=="生产报废明细表"){
  1443. var dateRange=Ext.getCmp('ms_indate');
  1444. console.log(dateRange.valuePrint);
  1445. var dateValuePrint=dateRange.valuePrint;
  1446. reportName="MakeScrapDetail";
  1447. prodcode=Ext.getCmp('pr_code').value;
  1448. condition=dateValuePrint;
  1449. if(prodcode!=""){
  1450. condition+=' and '+'{MakeScrapDetail.md_prodcode}='+"'"+prodcode+"'";
  1451. }
  1452. }else if(cop=="制造单材料成本统计表"){
  1453. var dateRange=Ext.getCmp('pi_date');
  1454. console.log(dateRange.valuePrint);
  1455. var dateValuePrint=dateRange.valuePrint;
  1456. reportName="MakeCost";
  1457. prodcode=Ext.getCmp('pr_code').value;
  1458. condition=dateValuePrint;
  1459. if(prodcode!=""){
  1460. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1461. }
  1462. }else if(cop=="制造用料ECR替代汇总表"){
  1463. var dateRange=Ext.getCmp('ma_date');
  1464. console.log(dateRange.valuePrint);
  1465. var dateValuePrint=dateRange.valuePrint;
  1466. reportName="MaterialECR";
  1467. var code=Ext.getCmp('ma_code').value;
  1468. condition=dateValuePrint;
  1469. if(code!=""){
  1470. condition+=' and '+'{makematerial.mm_code}='+"'"+code+"'";
  1471. }
  1472. }else if(cop=="制造单ECN汇总表"){
  1473. var dateRange=Ext.getCmp('ma_date');
  1474. console.log(dateRange.valuePrint);
  1475. var dateValuePrint=dateRange.valuePrint;
  1476. reportName="ECNtoMake";
  1477. var code=Ext.getCmp('ma_code').value;
  1478. condition=dateValuePrint;
  1479. if(code!=""){
  1480. condition+=' and '+'{make.ma_code}='+"'"+code+"'";
  1481. }
  1482. }else if(cop=="制造单一览表"){
  1483. var dateRange=Ext.getCmp('ma_date');
  1484. console.log(dateRange.valuePrint);
  1485. var dateValuePrint=dateRange.valuePrint;
  1486. reportName="MakeList";
  1487. var code=Ext.getCmp('ma_code').value;
  1488. var status=Ext.getCmp('ma_status').value;
  1489. var checkstatus=Ext.getCmp('ma_checkstatus').value;
  1490. condition=dateValuePrint;
  1491. if(code!=""){
  1492. condition+=' and '+'{make.ma_code}='+"'"+code+"'";
  1493. }
  1494. if(status!="全部"){
  1495. condition+=' and '+'{make.ma_status}='+"'"+status+"'";
  1496. }
  1497. if(checkstatus!="全部"){
  1498. condition+=' and '+'{make.ma_checkstatus}='+"'"+checkstatus+"'";
  1499. }
  1500. }else if(cop=="制造单用料明细表"){
  1501. var dateRange=Ext.getCmp('ma_date');
  1502. console.log(dateRange.valuePrint);
  1503. var dateValuePrint=dateRange.valuePrint;
  1504. reportName="MakeMaterial_Status";
  1505. prodcode=Ext.getCmp('ma_prodcode').value;
  1506. condition=dateValuePrint;
  1507. if(prodcode!=""){
  1508. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1509. }
  1510. }else if(cop=="生产领料退料明细表"){
  1511. var dateRange=Ext.getCmp('ma_date');
  1512. console.log(dateRange.valuePrint);
  1513. var dateValuePrint=dateRange.valuePrint;
  1514. reportName="MakeMaterialUse";
  1515. prodcode=Ext.getCmp('ma_prodcode').value;
  1516. var code=Ext.getCmp('ma_code').value;
  1517. condition=dateValuePrint;
  1518. if(prodcode!=""){
  1519. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1520. }
  1521. if(code!=""){
  1522. condition+=' and '+'{make.ma_code}='+"'"+code+"'";
  1523. }
  1524. }else if(cop=="制造单领料情况"){
  1525. var dateRange=Ext.getCmp('ma_date');
  1526. console.log(dateRange.valuePrint);
  1527. var dateValuePrint=dateRange.valuePrint;
  1528. prodcode=Ext.getCmp('pr_code').value;
  1529. reportName="makeMaterialsum";
  1530. condition=dateValuePrint;
  1531. if(prodcode!=""){
  1532. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1533. }
  1534. }else if(cop=="制造单领料情况(按结案日期)"){
  1535. var dateRange=Ext.getCmp('ma_actenddate');
  1536. console.log(dateRange.valuePrint);
  1537. var dateValuePrint=dateRange.valuePrint;
  1538. prodcode=Ext.getCmp('pr_code').value;
  1539. dateFW=dateRange.value;
  1540. console.log(dateFW);
  1541. reportName="makeMaterialsum";
  1542. condition=dateValuePrint+' and '+'{Make.MA_STATUS}='+"'已结案'";
  1543. if(prodcode!=""){
  1544. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1545. }
  1546. }
  1547. else if(cop=="物料状态明细表"){
  1548. prodcode=Ext.getCmp('pr_code').value;
  1549. reportName="ProductBalance";
  1550. if(prodcode!=""){
  1551. condition='{product.pr_code}='+"'"+product+"'";
  1552. }
  1553. }else if(cop=="缺料表分析(按工单)"){
  1554. var dateRange=Ext.getCmp('ma_date');
  1555. console.log(dateRange.valuePrint);
  1556. var dateValuePrint=dateRange.valuePrint;
  1557. prodcode=Ext.getCmp('pr_code').value;
  1558. reportName="MaterialLackForWCPlan_bymake";
  1559. condition=dateValuePrint;
  1560. if(prodcode!=""){
  1561. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1562. }
  1563. }else if(cop=="缺料表分析(按物料)"){
  1564. prodcode=Ext.getCmp('pr_code').value;
  1565. reportName="MaterialLackForWCPlan_byprod";
  1566. if(prodcode!=""){
  1567. condition='{MaterialLackForWCPlan.ml_prodcode}='+"'"+prodcode+"'";
  1568. }
  1569. }else if(cop=="在制仓库库存表(制单)"){
  1570. var dateRange=Ext.getCmp('ma_date');
  1571. console.log(dateRange.valuePrint);
  1572. var dateValuePrint=dateRange.valuePrint;
  1573. prodcode=Ext.getCmp('pr_code').value;
  1574. var whcode=Ext.getCmp('ma_whcode').value;
  1575. reportName="Makeonhand";
  1576. condition=dateValuePrint+' and '+'(isnull({makematerial.mm_materialstatus}) or {makematerial.mm_materialstatus}=" ")';
  1577. todate=Ext.getCmp('pr_date').rawValue;
  1578. if(todate==""){
  1579. var myDate = new Date();
  1580. var y=myDate.getFullYear();
  1581. var m=myDate.getMonth()+1;
  1582. var d=myDate.getDate();
  1583. m=m<10?"0"+m:m;
  1584. d=d<10?"0"+d:d;
  1585. todate=y+"-"+m+"-"+d;
  1586. }
  1587. console.log(todate);
  1588. if(prodcode!=""){
  1589. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1590. }
  1591. if(whcode!=""){
  1592. condition+=' and '+'{make.ma_whcode}='+"'"+whcode+"'";
  1593. }
  1594. console.log(condition);
  1595. }else if(cop=="在制仓库库存表(汇总)"){
  1596. var dateRange=Ext.getCmp('ma_date');
  1597. console.log(dateRange.valuePrint);
  1598. var dateValuePrint=dateRange.valuePrint;
  1599. prodcode=Ext.getCmp('pr_code').value;
  1600. var whcode=Ext.getCmp('ma_whcode').value;
  1601. reportName="MakeonhandSum";
  1602. condition=dateValuePrint;
  1603. if(todate==""){
  1604. var myDate = new Date();
  1605. var y=myDate.getFullYear();
  1606. var m=myDate.getMonth()+1;
  1607. var d=myDate.getDate();
  1608. m=m<10?"0"+m:m;
  1609. d=d<10?"0"+d:d;
  1610. todate=y+"-"+m+"-"+d;
  1611. }
  1612. if(prodcode!=""){
  1613. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1614. }
  1615. if(whcode!=""){
  1616. condition+=' and '+'{make.ma_whcode}='+"'"+whcode+"'";
  1617. }
  1618. }else if(cop=="生产领料明细表"){
  1619. var dateRange=Ext.getCmp('pi_date');
  1620. console.log(dateRange.valuePrint);
  1621. var dateValuePrint=dateRange.valuePrint;
  1622. prodcode=Ext.getCmp('pr_code').value;
  1623. reportName="scll";
  1624. condition=dateValuePrint;
  1625. if(prodcode!=""){
  1626. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1627. }
  1628. }else if(cop=="委外单一览表"){
  1629. var dateRange=Ext.getCmp('ma_date');
  1630. console.log(dateRange.valuePrint);
  1631. var dateValuePrint=dateRange.valuePrint;
  1632. reportName="MakeListWW";
  1633. prodcode=Ext.getCmp('pr_code').value;
  1634. condition=dateValuePrint+' and '+'{make.ma_tasktype}='+"'OS'";
  1635. if(prodcode!=""){
  1636. condition+=' and '+'{make.ma_prodcode}='+"'"+prodcode+"'";
  1637. }
  1638. }else if(cop=="委外领退料明细表"){
  1639. var dateRange=Ext.getCmp('pi_date');
  1640. console.log(dateRange.valuePrint);
  1641. var dateValuePrint=dateRange.valuePrint;
  1642. prodcode=Ext.getCmp('pr_code').value;
  1643. reportName="scllWW";
  1644. condition=dateValuePrint;
  1645. if(prodcode!=""){
  1646. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1647. }
  1648. }else if(cop=="委外入库明细表"){
  1649. var dateRange=Ext.getCmp('pi_date');
  1650. var dateValuePrint=dateRange.valuePrint;
  1651. prodcode=Ext.getCmp('pr_code').value;
  1652. reportName="PRODIO";
  1653. condition=dateValuePrint;
  1654. if(prodcode!=""){
  1655. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  1656. }
  1657. }else if(cop=="标准工时统计"){
  1658. var dateRange=Ext.getCmp('pi_date');
  1659. var dateValuePrint=dateRange.valuePrint;
  1660. condition=dateValuePrint+' and '+'{prodinout.pi_status}='+"'已过账'"+' and '+'{prodinout.pi_class}='+"'完工入库单'";
  1661. reportName="bztime";
  1662. }else if(cop=="出入库单状态统计表"){
  1663. var dateRange=Ext.getCmp('pi_date');
  1664. var dateValuePrint=dateRange.valuePrint;
  1665. condition=dateValuePrint;
  1666. reportName="ProdInoutStatus";
  1667. console.log(condition);
  1668. }else if(cop=="制造单备料单"){
  1669. var code=Ext.getCmp('ma_code').value;
  1670. var remark=Ext.getCmp('ma_remark').value;
  1671. if(remark=="A4"){
  1672. reportName="MakeUsagePrebymake";
  1673. }
  1674. if(remark=="半刀"){
  1675. reportName="MakeUsagePrebymake_14";
  1676. }
  1677. if(code!=""){
  1678. condition='{MA_MAKEMATERIAL_VIEW.ma_code}='+"'"+code+"'";
  1679. }
  1680. }else if(cop=="制造单备料单(按物料合并)"){
  1681. var prodcode=Ext.getCmp('ma_prodcode').value;
  1682. var wccode=Ext.getCmp('ma_wccode').value;
  1683. var code=Ext.getCmp('ma_code').value;
  1684. var remark=Ext.getCmp('ma_reamrk').value;
  1685. condition='{MA_MAKEUSEPRE.ma_checkstatus}='+"'已批准'";
  1686. var arrcode='';
  1687. var strs= new Array();
  1688. strs=code.split("#");
  1689. console.log(strs.length);
  1690. if(strs.length>1){
  1691. for(i=0;i<strs.length;i++){
  1692. arrcode+="'"+strs[i]+"'"+",";
  1693. }
  1694. condition+=' and '+'{MA_MAKEUSEPRE.ma_code}in['+arrcode.substring(0, arrcode.length-1)+']';
  1695. }else{
  1696. if(code!=""){
  1697. condition+=' and '+'{MA_MAKEUSEPRE.ma_code}in['+"'"+code+"'"+']';
  1698. }
  1699. }
  1700. if(remark=="A4"){
  1701. reportName="MakeUsagePre";
  1702. }
  1703. if(remark=="半刀"){
  1704. reportName="MakeUsagePre_14";
  1705. }
  1706. if(prodcode!=""){
  1707. condition+=' and '+'{MA_MAKEUSEPRE.mm_prodcode}='+"'"+prodcode+"'";
  1708. }
  1709. if(wccode!=""){
  1710. condition+=' and '+'{MA_MAKEUSEPRE.ma_wccode}='+"'"+wccode+"'";
  1711. }
  1712. ///if(code!=""){
  1713. //condititon+=' and '+'{MA_MAKEUSEPRE.ma_code}='+"'"+arrcode+"'";
  1714. //}
  1715. console.log(condition);
  1716. }else if(cop=="未到货采购汇总表‎(‎按物料‎)"){
  1717. var dateRange=Ext.getCmp('pu_date');
  1718. var dateValuePrint=dateRange.valuePrint;
  1719. var prodcode=Ext.getCmp('pr_code').value;
  1720. reportName="purcalldetail_p";
  1721. condition=dateValuePrint+' and ('+'{PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001'+' and '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'";
  1722. if(prodcode!=""){
  1723. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1724. }
  1725. console.log(condition);
  1726. }else if(cop=="未到货采购汇总表‎(‎按供应商‎)"){
  1727. var dateRange=Ext.getCmp('pu_date');
  1728. var dateValuePrint=dateRange.valuePrint;
  1729. var prodcode=Ext.getCmp('pr_code').value;
  1730. reportName="purcalldetail_v";
  1731. condition=dateValuePrint+' and ('+'{PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001'+' and '+'{PurchaseDetail.pd_mrpstatus}<>'+"'已结案'";
  1732. if(prodcode!=""){
  1733. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1734. }
  1735. console.log(condition);
  1736. }else if(cop=="收料明细表"){
  1737. var dateRange=Ext.getCmp('va_date');
  1738. var dateValuePrint=dateRange.valuePrint;
  1739. var vendcode=Ext.getCmp('ve_code').value;
  1740. var prodcode=Ext.getCmp('pr_code').value;
  1741. reportName="QUA_VerifyApply";
  1742. condition=dateValuePrint;
  1743. if(vendcode!=""){
  1744. condition+=' and '+'{VerifyApply.va_vendcode}='+"'"+vendcode+"'";
  1745. }
  1746. if(prodcode!=""){
  1747. condition+=' and '+'{Product.pr_code}='+"'"+prodcode+"'";
  1748. }
  1749. console.log(condition);
  1750. }else if(cop=="采购汇总表(按供应商)"){
  1751. var dateRange=Ext.getCmp('pu_date');
  1752. var dateValuePrint=dateRange.valuePrint;
  1753. var vendcode=Ext.getCmp('ve_code').value;
  1754. var prodcode=Ext.getCmp('pr_code').value;
  1755. reportName="PurTotal_V";
  1756. condition=dateValuePrint;
  1757. if(vendcode!=""){
  1758. condition+=' and '+'{Purchase.pu_vendcode}='+"'"+prodcode+"'";
  1759. }
  1760. if(prodcode!=""){
  1761. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1762. }
  1763. console.log(condition);
  1764. }else if(cop=="采购汇总表(按物料)"){
  1765. var dateRange=Ext.getCmp('pu_date');
  1766. var dateValuePrint=dateRange.valuePrint;
  1767. var vendcode=Ext.getCmp('ve_code').value;
  1768. var prodcode=Ext.getCmp('pr_code').value;
  1769. reportName="PurTotal_P";
  1770. condition=dateValuePrint+' and '+'{Purchase.pu_status}='+"'已审核'"+' and '+'{Purchase.pu_status}<>'+"'已作废'"+' and '+'{Purchase.pu_status}<>'+"'已结案'";
  1771. if(vendcode!=""){
  1772. condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'";
  1773. }
  1774. if(prodcode!=""){
  1775. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1776. }
  1777. console.log(condition);
  1778. }else if(cop=="采购汇总表(按订单)"){
  1779. var dateRange=Ext.getCmp('pu_date');
  1780. var dateValuePrint=dateRange.valuePrint;
  1781. var vendcode=Ext.getCmp('ve_code').value;
  1782. var prodcode=Ext.getCmp('pr_code').value;
  1783. var pucode=Ext.getCmp('pu_code').value;
  1784. reportName="PurTotal_S";
  1785. condition=dateValuePrint+' and '+'{Purchase.pu_status}='+"'已审核'"+' and '+'{Purchase.pu_status}<>'+"'已作废'"+' and '+'{Purchase.pu_status}<>'+"'已结案'";
  1786. if(vendcode!=""){
  1787. condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'";
  1788. }
  1789. if(prodcode!=""){
  1790. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1791. }
  1792. if(pucode!=""){
  1793. condition+=' and '+'{Purchase.pu_code}='+"'"+pucode+"'";
  1794. }
  1795. console.log(condition);
  1796. }else if(cop=="超期未到货明细表"){
  1797. var dateRange=Ext.getCmp('pu_date');
  1798. var dateValuePrint=dateRange.valuePrint;
  1799. var vendcode=Ext.getCmp('ve_code').value;
  1800. var prodcode=Ext.getCmp('pr_code').value;
  1801. var pucode=Ext.getCmp('pu_code').value;
  1802. reportName="purcalldetail";
  1803. if(todate==""){
  1804. var myDate = new Date();
  1805. var y=myDate.getFullYear();
  1806. var m=myDate.getMonth()+1;
  1807. var d=myDate.getDate();
  1808. m=m<10?"0"+m:m;
  1809. d=d<10?"0"+d:d;
  1810. todate=y+"-"+m+"-"+d;
  1811. }
  1812. console.log(todate);
  1813. condition=dateValuePrint+' and ('+'{PurchaseDetail.pd_qty}-{PurchaseDetail.pd_acceptqty})>0.001 and {PurchaseDetail.pd_delivery}<='+'date('+"'"+todate+"'"+')';
  1814. if(vendcode!=""){
  1815. condition+=' and '+'{Purchase.pu_vendcode}='+"'"+vendcode+"'";
  1816. }
  1817. if(prodcode!=""){
  1818. condition+=' and '+'{PurchaseDetail.pd_prodcode}='+"'"+prodcode+"'";
  1819. }
  1820. if(pu_code!=""){
  1821. condition+=' and '+'{Purchase.pu_code}='+"'"+pucode+"'";
  1822. }
  1823. console.log(condition);
  1824. }else if(cop=="分仓库库存报表"){
  1825. var whcode=Ext.getCmp('pi_whcode').value;
  1826. console.log(whcode);
  1827. reportName="pronhandw";
  1828. condition='{ProductWH.pw_onhand}>0';
  1829. if(whcode!=""){
  1830. condition+=' and '+'{ProductWH.pw_whcode}='+"'"+whcode+"'";
  1831. }
  1832. console.log(condition);
  1833. }else if(cop=="出入库汇总表"){
  1834. var dateRange=Ext.getCmp('pi_date');
  1835. var dateValuePrint=dateRange.valuePrint;
  1836. var prodcode=Ext.getCmp('pr_code').value;
  1837. var whcode=Ext.getCmp('pi_whcode').value;
  1838. condition=dateValuePrint;
  1839. reportName="ProdIOTotal";
  1840. if(prodcode!=""){
  1841. condition+=' and '+'{ProdIoDetail.pd_prodcode}='+"'"+prodcode+"'";
  1842. }
  1843. if(whcode!=""){
  1844. condition+=' and '+'{ProdInout.pd_whcode}='+"'"+whcode+"'";
  1845. }
  1846. console.log(condition);
  1847. }else if(cop=="分仓库库存总表"){
  1848. reportName="pronhandwtotal";
  1849. var whcode=Ext.getCmp('pi_whcode').value;
  1850. condition='{ProductWH.pw_onhand}>0';
  1851. if(whcode!=""){
  1852. condition+=' and '+'{ProductWH.pw_whcode}='+"'"+whcode+"'";
  1853. }
  1854. }else if(cop=="下阶工单查询"){
  1855. var dateRange=Ext.getCmp('ma_date');
  1856. var dateValuePrint=dateRange.valuePrint;
  1857. var macode=Ext.getCmp('ma_code').value;
  1858. console.log(macode);
  1859. var i;
  1860. var arrcode="";
  1861. var strs= new Array();
  1862. strs=macode.split("#");
  1863. console.log(strs.length);
  1864. reportName="MakeMaterial33";
  1865. condition=dateValuePrint;
  1866. if(strs.length>1){
  1867. for(i=0;i<strs.length;i++){
  1868. arrcode+="'"+strs[i]+"'"+",";
  1869. }
  1870. condition+=' and '+'{MakeMaterial.mm_processcode} in['+arrcode.substring(0, arrcode.length-1)+']';
  1871. idS=arrcode.substring(0, arrcode.length-1);
  1872. }else{
  1873. if(macode!=""){
  1874. condition+=' and '+'{MakeMaterial.mm_processcode} in['+"'"+macode+"'"+']';
  1875. idS="'"+macode+"'";
  1876. }
  1877. }
  1878. console.log(condition);
  1879. }else if(cop=="工单调拨查询"){
  1880. var dateRange=Ext.getCmp('ma_date');
  1881. var dateValuePrint=dateRange.valuePrint;
  1882. var macode=Ext.getCmp('ma_code').value;
  1883. console.log(macode);
  1884. var i;
  1885. var arrcode="";
  1886. var strs= new Array();
  1887. strs=macode.split("#");
  1888. console.log(strs.length);
  1889. reportName="MakeMaterial31";
  1890. condition=dateValuePrint;
  1891. if(strs.length>1){
  1892. for(i=0;i<strs.length;i++){
  1893. arrcode+="'"+strs[i]+"'"+",";
  1894. }
  1895. condition+=' and '+'{make.ma_code} in['+arrcode.substring(0, arrcode.length-1)+']';
  1896. idS=arrcode.substring(0, arrcode.length-1);
  1897. }else{
  1898. if(macode!=""){
  1899. condition+=' and '+'{make.ma_code} in['+"'"+macode+"'"+']';
  1900. idS="'"+macode+"'";
  1901. }
  1902. }
  1903. console.log(condition);
  1904. }else if(cop=="工单素材查询"){
  1905. var dateRange=Ext.getCmp('ma_date');
  1906. var dateValuePrint=dateRange.valuePrint;
  1907. var macode=Ext.getCmp('ma_code').value;
  1908. console.log(macode);
  1909. var i;
  1910. var arrcode="";
  1911. var strs= new Array();
  1912. strs=macode.split("#");
  1913. console.log(strs.length);
  1914. reportName="MakeMaterial32";
  1915. condition=dateValuePrint;
  1916. if(strs.length>1){
  1917. for(i=0;i<strs.length;i++){
  1918. arrcode+="'"+strs[i]+"'"+",";
  1919. }
  1920. condition+=' and '+'{make.ma_code} in['+arrcode.substring(0, arrcode.length-1)+']';
  1921. idS=arrcode.substring(0, arrcode.length-1);
  1922. }else{
  1923. if(macode!=""){
  1924. condition+=' and '+'{make.ma_code} in['+"'"+macode+"'"+']';
  1925. idS="'"+macode+"'";
  1926. }
  1927. }
  1928. console.log(condition);
  1929. }else if(cop=="物料时段需求分析"){
  1930. reportName="ProdMonthNeed";
  1931. var prodcode=Ext.getCmp('pr_code').value;
  1932. var kind=Ext.getCmp('pr_jhzc').value;
  1933. if(kind=="外购件"){
  1934. if(prodcode!=""){
  1935. condition="{product.pr_status}='已审核' and {product.pr_supplytype}<>'VIRTUAL' and {product.pr_manutype}='PURCHASE'"+' and '+'{product.pr_code}='+"'"+prodcode+"'";
  1936. }
  1937. }
  1938. if(kind=="制造件"){
  1939. if(prodcode!=""){
  1940. condition="{product.pr_status}='已审核' and {product.pr_supplytype}<>'虚拟件' and ({product.pr_manutype}='MAKE' or {product.pr_manutype}='OSMAKE')"+' and '+'{product.pr_code}='+"'"+prodcode+"'";
  1941. }
  1942. }
  1943. }else if(cop=="发票明细查询"){
  1944. var dateRange=Ext.getCmp('ab_date');
  1945. var dateValuePrint=dateRange.valuePrint;
  1946. var custcode=Ext.getCmp('ma_custcode').value;
  1947. var prodcode=Ext.getCmp('pr_code').value;
  1948. reportName="ArbillDetail";
  1949. condition=dateValuePrint;
  1950. if(custcode!=""){
  1951. condition+=' and '+'{ArBill.ab_custcode}='+"'"+custcode+"'";
  1952. }
  1953. if(prodcode!=""){
  1954. condition+=' and '+'{ARBILLDetail.abd_prodcode}='+"'"+prodcode+"'";
  1955. }
  1956. }else if(cop=="发票明细查询香港"){
  1957. var dateRange=Ext.getCmp('ab_date');
  1958. var dateValuePrint=dateRange.valuePrint;
  1959. var custcode=Ext.getCmp('ma_custcode').value;
  1960. var prodcode=Ext.getCmp('pr_code').value;
  1961. reportName="ArbillDetail_hk";
  1962. condition=dateValuePrint;
  1963. if(custcode!=""){
  1964. condition+=' and '+'{ArBill.ab_custcode}='+"'"+custcode+"'";
  1965. }
  1966. if(prodcode!=""){
  1967. condition+=' and '+'{ARBILLDetail.abd_prodcode}='+"'"+prodcode+"'";
  1968. }
  1969. } else if(cop=="批记录"){
  1970. reportName="BATCHLST";
  1971. var whcode=Ext.getCmp('ba_whcode').value;
  1972. var batchcode=Ext.getCmp('ba_code').value;
  1973. var prodcode=Ext.getCmp('pr_code').value;
  1974. condition="{Batch.ba_remain}>0";
  1975. if(whcode!=""){
  1976. condition+=' and '+'{batch.ba_whcode}='+"'"+whcode+"'";
  1977. }
  1978. if(batchcode!=""){
  1979. condition+=' and '+'{batch.ba_code}='+"'"+batchcode+"'";
  1980. }
  1981. if(prodcode!=""){
  1982. condition+=' and '+'{batch.ba_prodcode}='+"'"+prodcode+"'";
  1983. }
  1984. console.log(condition);
  1985. }else if(cop=="开票明细表"){
  1986. var dateRange=Ext.getCmp('ab_date');
  1987. var dateValuePrint=dateRange.valuePrint;
  1988. reportName="billout";
  1989. var custcode=Ext.getCmp('ab_custcode').value;
  1990. condition=dateValuePrint;
  1991. if(custcode!=""){
  1992. condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'";
  1993. }
  1994. console.log(condition);
  1995. }else if(cop=="开票明细表香港"){
  1996. var dateRange=Ext.getCmp('ab_date');
  1997. var dateValuePrint=dateRange.valuePrint;
  1998. reportName="billout_hk";
  1999. var custcode=Ext.getCmp('ab_custcode').value;
  2000. condition=dateValuePrint;
  2001. if(custcode!=""){
  2002. condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'";
  2003. }
  2004. console.log(condition);
  2005. }
  2006. else if(cop=="出入库明细表(过账日期)"){
  2007. var dateRange=Ext.getCmp('pi_date1');
  2008. var kind=Ext.getCmp('pi_class').value;
  2009. var whcode=Ext.getCmp('pi_whcode').value;
  2010. var batchcode=Ext.getCmp('pd_batchcode').value;
  2011. var status=Ext.getCmp('pi_status').value;
  2012. var department=Ext.getCmp('pi_departmentname').value;
  2013. var dateValuePrint=dateRange.valuePrint;
  2014. prodcode=Ext.getCmp('pr_code').value;
  2015. reportName="PRODIO";
  2016. condition=dateValuePrint;
  2017. console.log(dateValuePrint);
  2018. console.log(kind);
  2019. console.log(whcode);
  2020. if(prodcode!=""){
  2021. condition+=' and '+'{prodiodetail.pd_prodcode}='+"'"+prodcode+"'";
  2022. }
  2023. if(kind!=""&&kind!="全部"){
  2024. condition+=' and '+'{prodinout.pi_class}='+"'"+kind+"'";
  2025. }
  2026. if(whcode!=""){
  2027. condition+=' and '+'{prodiodetail.pd_whcode}='+"'"+whcode+"'";
  2028. }
  2029. if(batchcode!=""){
  2030. condition+=' and '+'{prodiodetail.pd_batchcode}='+"'"+batchcode+"'";
  2031. }
  2032. if(status!=""&&status!="全部"){
  2033. condition+=' and '+'{prodinout.pi_status}='+"'"+status+"'";
  2034. }
  2035. if(department!=""){
  2036. condition+=' and '+'{prodinout.pi_departmentname}='+"'"+department+"'";
  2037. }
  2038. console.log(condition);
  2039. } else if(cop=="月销售分析表香港"){
  2040. var dateRange=Ext.getCmp('ab_date');
  2041. var dateValuePrint=dateRange.valuePrint;
  2042. reportName="billout_month_hk";
  2043. var custcode=Ext.getCmp('ab_custcode').value;
  2044. condition=dateValuePrint+' and '+' ( ({arbill.ab_class}='+"'其它应收单'"+' and '+'({ARBillDetail.abd_catecode} like '+ "'5101*'"+ ' or {ARBillDetail.abd_catecode} like '+ "'5102*'))"+' or '+'{arbill.ab_class}<>'+"'其它应收单')";
  2045. if(custcode!=""){
  2046. condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'";
  2047. }
  2048. console.log(condition);
  2049. }
  2050. else if(cop=="月销售分析表"){
  2051. var dateRange=Ext.getCmp('ab_date');
  2052. var dateValuePrint=dateRange.valuePrint;
  2053. reportName="billout_month";
  2054. var custcode=Ext.getCmp('ab_custcode').value;
  2055. condition=dateValuePrint+' and '+' ( ({arbill.ab_class}='+"'其它应收单'"+' and '+'({ARBillDetail.abd_catecode} like '+ "'5101*'"+ ' or {ARBillDetail.abd_catecode} like '+ "'5102*'))"+' or '+'{arbill.ab_class}<>'+"'其它应收单')";
  2056. if(custcode!=""){
  2057. condition+=' and '+'{arbill.ab_custcode}='+"'"+custcode+"'";
  2058. }
  2059. console.log(condition);
  2060. } else if(cop=="派车次数统计"){
  2061. var dateRange=Ext.getCmp('vr_recorddate');
  2062. var dateValuePrint=dateRange.valuePrint;
  2063. reportName="carcountdetail";
  2064. var custcode=Ext.getCmp('vr_depart').value;
  2065. condition=dateValuePrint;
  2066. if(custcode!=""){
  2067. condition+=' and '+'{Vehiclereturn.vr_depart}='+"'"+custcode+"'";
  2068. }
  2069. console.log(condition);
  2070. }else if(cop=="部门派车费用统计"){
  2071. var dateRange=Ext.getCmp('vr_recorddate');
  2072. var dateValuePrint=dateRange.valuePrint;
  2073. reportName="carcostdepart";
  2074. var custcode=Ext.getCmp('vr_depart').value;
  2075. condition=dateValuePrint;
  2076. if(custcode!=""){
  2077. condition+=' and '+'{Vehiclereturn.vr_depart}='+"'"+custcode+"'";
  2078. }
  2079. console.log(condition);
  2080. }else if(cop=="成本汇总表"){
  2081. var datemonth=Ext.getCmp('cd_yearmonth').value;
  2082. console.log(datemonth);
  2083. reportName="CostDetail";
  2084. condition='{CostDetail.cd_yearmonth}='+"'"+datemonth+"'";
  2085. console.log(condition);
  2086. }else if(cop=="成本用料月结表"){
  2087. var datemonth=Ext.getCmp('cd_yearmonth').value;
  2088. console.log(datemonth);
  2089. reportName="costdetailmaterial";
  2090. condition='{CostDetailMaterial.cdm_yearmonth}='+datemonth;
  2091. console.log(condition);
  2092. }else if(cop=="未开票明细表"){
  2093. var dateRange=Ext.getCmp('pi_date');
  2094. var dateValuePrint=dateRange.valuePrint;
  2095. reportName="wkpDetail";
  2096. var custcode=Ext.getCmp('pi_arcode').value;
  2097. condition=dateValuePrint;
  2098. if(custcode!=""){
  2099. condition+=' and '+'{FA_NOTKP_ARBILL_VIEW.pi_arcode}='+"'"+custcode+"'";
  2100. }
  2101. console.log(condition);
  2102. }else if(cop=="应付开票明细表"){
  2103. var dateRange=Ext.getCmp('ab_date');
  2104. var dateValuePrint=dateRange.valuePrint;
  2105. reportName="BillOutAPDetail";
  2106. var vendcode=Ext.getCmp('ab_vendcode').value;
  2107. condition=dateValuePrint;
  2108. if(vendcode!=""){
  2109. condition+=' and '+'{apbill.ab_vendcode}='+"'"+vendcode+"'";
  2110. }
  2111. console.log(condition);
  2112. }else if(cop=="应付开票明细表香港"){
  2113. var dateRange=Ext.getCmp('ab_date');
  2114. var dateValuePrint=dateRange.valuePrint;
  2115. reportName="BillOutAPDetail_hk";
  2116. var vendcode=Ext.getCmp('ab_vendcode').value;
  2117. condition=dateValuePrint;
  2118. if(vendcode!=""){
  2119. condition+=' and '+'{apbill.ab_vendcode}='+"'"+vendcode+"'";
  2120. }
  2121. console.log(condition);
  2122. }
  2123. else if(cop=="应付未开票明细表"){
  2124. var dateRange=Ext.getCmp('pi_date');
  2125. var dateValuePrint=dateRange.valuePrint;
  2126. reportName="ApwkpDetail";
  2127. var vendcode=Ext.getCmp('pi_receivecode').value;
  2128. condition=dateValuePrint;
  2129. if(vendcode!=""){
  2130. condition+=' and '+'{FA_NOTKP_APBILL_VIEW.pi_receivecode}='+"'"+vendcode+"'";
  2131. }
  2132. console.log(condition);
  2133. }
  2134. else if(cop=="已完成采购总额"){
  2135. var dateRange=Ext.getCmp('pi_date');
  2136. var dateValuePrint=dateRange.valuePrint;
  2137. reportName="purchaseAll";
  2138. condition=dateValuePrint+' and ' +'({ProdInOut.pi_class}='+"'采购验收单'"+' or '+'{ProdInOut.pi_class}='+"'采购验退单')"+' and '+'{ProdInOut.pi_status}='+"'已过账'";
  2139. console.log(condition);
  2140. }else if(cop=="流程单打印"){
  2141. var code=Ext.getCmp('si_flowcode').value;
  2142. reportName="byqmakeflow";
  2143. if(code!=""){
  2144. condition='{MakeFlow.mf_code}='+"'"+code+"'";
  2145. }
  2146. console.log(condition);
  2147. }else if(cop=="生产日报明细表"){
  2148. var dateRange=Ext.getCmp('di_date');
  2149. var dateValuePrint=dateRange.valuePrint;
  2150. reportName="MakeDayDetail";
  2151. condition=dateValuePrint;
  2152. console.log(condition);
  2153. }else if(cop=="集团出入库明细表"){
  2154. var dateRange=Ext.getCmp('pi_date');
  2155. var dateValuePrint=dateRange.valuePrint;
  2156. prodcode=Ext.getCmp('pd_prodcode').value;
  2157. var piclass=Ext.getCmp('pi_class').value;
  2158. reportName="ProdIO_Group";
  2159. condition=dateValuePrint;
  2160. if(prodcode!=""){
  2161. condition+=' and '+'{GROUP_PRODIO_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2162. }
  2163. if(piclass!=""){
  2164. condition+=' and '+'{GROUP_PRODIO_VIEW.pi_class}='+"'"+piclass+"'";
  2165. }
  2166. }else if(cop=="集团毛利润分析明细表"){
  2167. var dateRange=Ext.getCmp('pi_date');
  2168. var dateValuePrint=dateRange.valuePrint;
  2169. var cop=Ext.getCmp('pi_cop').value;
  2170. var custcode=Ext.getCmp('cu_code').value;
  2171. var sellercode=Ext.getCmp('pi_emcode').value;
  2172. prodcode=Ext.getCmp('pd_prodcode').value;
  2173. reportName="PROFITDETAIL_Group";
  2174. condition=dateValuePrint;
  2175. if(cop!=""){
  2176. condition+=' and '+'{GETALLDATA_VIEW.pi_code}='+"'"+cop+"'";
  2177. }
  2178. if(custcode!=""){
  2179. condition+=' and '+'{GETALLDATA_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2180. }
  2181. if(sellercode!=""){
  2182. condition+=' and '+'{GETALLDATA_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2183. }
  2184. if(prodcode!=""){
  2185. condition+=' and '+'{GETALLDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2186. }
  2187. }else if(cop=="集团毛利润分析表-按客户"){
  2188. var dateRange=Ext.getCmp('pi_date');
  2189. var dateValuePrint=dateRange.valuePrint;
  2190. var cop=Ext.getCmp('pi_cop').value;
  2191. var custcode=Ext.getCmp('cu_code').value;
  2192. var sellercode=Ext.getCmp('pi_emcode').value;
  2193. prodcode=Ext.getCmp('pd_prodcode').value;
  2194. reportName="PROFITCUSTOMER_Group";
  2195. condition=dateValuePrint;
  2196. if(cop!=""){
  2197. condition+=' and '+'{GETALLDATA_VIEW.pi_code}='+"'"+cop+"'";
  2198. }
  2199. if(custcode!=""){
  2200. condition+=' and '+'{GETALLDATA_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2201. }
  2202. if(sellercode!=""){
  2203. condition+=' and '+'{GETALLDATA_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2204. }
  2205. if(prodcode!=""){
  2206. condition+=' and '+'{GETALLDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2207. }
  2208. }else if(cop=="集团毛利润分析表-按产品型号"){
  2209. var dateRange=Ext.getCmp('pi_date');
  2210. var dateValuePrint=dateRange.valuePrint;
  2211. var cop=Ext.getCmp('pi_cop').value;
  2212. var custcode=Ext.getCmp('cu_code').value;
  2213. var sellercode=Ext.getCmp('pi_emcode').value;
  2214. prodcode=Ext.getCmp('pd_prodcode').value;
  2215. reportName="profitproduct_Group";
  2216. condition=dateValuePrint;
  2217. if(cop!=""){
  2218. condition+=' and '+'{MLR_PRODUCTVIEW.pi_code}='+"'"+cop+"'";
  2219. }
  2220. if(custcode!=""){
  2221. condition+=' and '+'{MLR_PRODUCTVIEW.pi_cardcode}='+"'"+custcode+"'";
  2222. }
  2223. if(sellercode!=""){
  2224. condition+=' and '+'{MLR_PRODUCTVIEW.pi_emcode}='+"'"+sellercode+"'";
  2225. }
  2226. if(prodcode!=""){
  2227. condition+=' and '+'{MLR_PRODUCTVIEW.pd_prodcode}='+"'"+prodcode+"'";
  2228. }
  2229. }else if(cop=="集团毛利润分析表-按品牌"){
  2230. var dateRange=Ext.getCmp('pi_date');
  2231. var dateValuePrint=dateRange.valuePrint;
  2232. var cop=Ext.getCmp('pi_cop').value;
  2233. var custcode=Ext.getCmp('cu_code').value;
  2234. var sellercode=Ext.getCmp('pi_emcode').value;
  2235. prodcode=Ext.getCmp('pd_prodcode').value;
  2236. reportName="profitproductkind_Group";
  2237. condition=dateValuePrint;
  2238. if(cop!=""){
  2239. condition+=' and '+'{MLR_PRODUCTVIEW.pi_code}='+"'"+cop+"'";
  2240. }
  2241. if(custcode!=""){
  2242. condition+=' and '+'{MLR_PRODUCTVIEW.pi_cardcode}='+"'"+custcode+"'";
  2243. }
  2244. if(sellercode!=""){
  2245. condition+=' and '+'{MLR_PRODUCTVIEW.pi_emcode}='+"'"+sellercode+"'";
  2246. }
  2247. if(prodcode!=""){
  2248. condition+=' and '+'{MLR_PRODUCTVIEW.pd_prodcode}='+"'"+prodcode+"'";
  2249. }
  2250. }else if(cop=="集团毛利润分析表-按业务员"){
  2251. var dateRange=Ext.getCmp('pi_date');
  2252. var dateValuePrint=dateRange.valuePrint;
  2253. var cop=Ext.getCmp('pi_cop').value;
  2254. var custcode=Ext.getCmp('cu_code').value;
  2255. var sellercode=Ext.getCmp('pi_emcode').value;
  2256. prodcode=Ext.getCmp('pd_prodcode').value;
  2257. reportName="PROFITSELLER_Group";
  2258. condition=dateValuePrint;
  2259. if(cop!=""){
  2260. condition+=' and '+'{SELLERDATA_VIEW.pi_code}='+"'"+cop+"'";
  2261. }
  2262. if(custcode!=""){
  2263. condition+=' and '+'{SELLERDATA_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2264. }
  2265. if(sellercode!=""){
  2266. condition+=' and '+'{SELLERDATA_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2267. }
  2268. if(prodcode!=""){
  2269. condition+=' and '+'{SELLERDATA_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2270. }
  2271. }else if(cop=="集团未交货销售订单总表"){
  2272. var dateRange=Ext.getCmp('pi_date');
  2273. var dateValuePrint=dateRange.valuePrint;
  2274. var cop=Ext.getCmp('pi_cop').value;
  2275. var custcode=Ext.getCmp('cu_code').value;
  2276. var sellercode=Ext.getCmp('pi_emcode').value;
  2277. prodcode=Ext.getCmp('pd_prodcode').value;
  2278. reportName="sasumc_Group";
  2279. condition=dateValuePrint;
  2280. if(cop!=""){
  2281. condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'";
  2282. }
  2283. if(custcode!=""){
  2284. condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2285. }
  2286. if(sellercode!=""){
  2287. condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2288. }
  2289. if(prodcode!=""){
  2290. condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2291. }
  2292. }else if(cop=="集团未交货销售订单总表(型号)"){
  2293. var dateRange=Ext.getCmp('pi_date');
  2294. var dateValuePrint=dateRange.valuePrint;
  2295. var cop=Ext.getCmp('pi_cop').value;
  2296. var custcode=Ext.getCmp('cu_code').value;
  2297. var sellercode=Ext.getCmp('pi_emcode').value;
  2298. prodcode=Ext.getCmp('pd_prodcode').value;
  2299. reportName="sasump_Group";
  2300. condition=dateValuePrint;
  2301. if(cop!=""){
  2302. condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'";
  2303. }
  2304. if(custcode!=""){
  2305. condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2306. }
  2307. if(sellercode!=""){
  2308. condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2309. }
  2310. if(prodcode!=""){
  2311. condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2312. }
  2313. }else if(cop=="集团未交货销售订单总表(业务员)"){
  2314. var dateRange=Ext.getCmp('pi_date');
  2315. var dateValuePrint=dateRange.valuePrint;
  2316. var cop=Ext.getCmp('pi_cop').value;
  2317. var custcode=Ext.getCmp('cu_code').value;
  2318. var sellercode=Ext.getCmp('pi_emcode').value;
  2319. prodcode=Ext.getCmp('pd_prodcode').value;
  2320. reportName="sasums_Group";
  2321. condition=dateValuePrint;
  2322. if(cop!=""){
  2323. condition+=' and '+'{SALEINFO_VIEW.pi_code}='+"'"+cop+"'";
  2324. }
  2325. if(custcode!=""){
  2326. condition+=' and '+'{SALEINFO_VIEW.pi_cardcode}='+"'"+custcode+"'";
  2327. }
  2328. if(sellercode!=""){
  2329. condition+=' and '+'{SALEINFO_VIEW.pi_emcode}='+"'"+sellercode+"'";
  2330. }
  2331. if(prodcode!=""){
  2332. condition+=' and '+'{SALEINFO_VIEW.pd_prodcode}='+"'"+prodcode+"'";
  2333. }
  2334. }else if(cop=="应收账龄分析表"){
  2335. var dateRange=Ext.getCmp('ab_date');
  2336. var dateValuePrint=dateRange.valuePrint;
  2337. var custcode=Ext.getCmp('cu_code').value;
  2338. var seller=Ext.getCmp('em_id').value;
  2339. reportName="ARAgeAll";
  2340. condition='{ARBill.ab_date}<={@Date0To} AND {ARBill.ab_aramount}<>{ARBill.ab_thispayamount}'+' and '+dateValuePrint;
  2341. if(custcode!=""){
  2342. condition+=' and '+'{ARBill.ab_custcode}='+"'"+custcode+"'";
  2343. }
  2344. if(seller!=""){
  2345. condition+=' and '+'{ARBill.ab_sellerid}='+seller;
  2346. }
  2347. }else if(cop=="应付账龄分析表"){
  2348. var dateRange=Ext.getCmp('ab_date');
  2349. var dateValuePrint=dateRange.valuePrint;
  2350. reportName="APAgeAll";
  2351. condition='{APBill.ab_paydate}<={@Date0To} AND {APBill.ab_apamount}<>{APBill.ab_payamount}'+' and '+dateValuePrint;
  2352. console.log(condition);
  2353. }else if(cop=="应收账明细表"){
  2354. var dateRange=Ext.getCmp('asl_date');
  2355. var dateValuePrint=dateRange.valuePrint;
  2356. var custcode=Ext.getCmp('cu_code').value;
  2357. condition=dateValuePrint+' and '+'{ArSubledger.asl_source}<>'+"'预收冲应收'";
  2358. reportName="ArSubledger";
  2359. if(custcode!=""){
  2360. condition+=' and '+'{ArSubledger.asl_custcode}='+"'"+custcode+"'";
  2361. }
  2362. }else if(cop=="应付账明细表"){
  2363. var dateRange=Ext.getCmp('asl_date');
  2364. var dateValuePrint=dateRange.valuePrint;
  2365. reportName="ApSubledger";
  2366. var vendcode=Ext.getCmp('ve_code').value;
  2367. condition=dateValuePrint+' and '+'{ApSubledger.asl_source}<>'+"'预收冲应收'";
  2368. if(vendcode!=""){
  2369. condition+=' and '+'{ApSubledger.asl_vendcode}='+"'"+vendcode+"'";
  2370. }
  2371. }else if(cop=="应收账款汇总表"){
  2372. reportName="CustomerAR";
  2373. var custcode=Ext.getCmp('cu_code').value;
  2374. var condition="";
  2375. if(custcode!=""){
  2376. condition='{CustAr.ca_custcode}='+"'"+custcode+"'";
  2377. }
  2378. }else if(cop=="应付账款汇总表"){
  2379. reportName="VendorAP";
  2380. var custcode=Ext.getCmp('ve_code').value;
  2381. var condition="";
  2382. if(custcode!=""){
  2383. condition='{VendAp.va_vendcode}='+"'"+custcode+"'";
  2384. }
  2385. }
  2386. form.FormUtil.batchPrint(idS,reportName,condition,cop,todate,dateFW,fromdate,enddate);
  2387. */
  2388. }
  2389. },'-','-',{
  2390. text: $I18N.common.button.erpCloseButton,
  2391. iconCls: 'x-button-icon-close',
  2392. cls: 'x-btn-gray',
  2393. handler: function(){
  2394. var main = parent.Ext.getCmp("content-panel");
  2395. main.getActiveTab().close();
  2396. }
  2397. }],
  2398. initComponent : function(){
  2399. var param = {caller: caller, condition: ''};
  2400. this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action', param);
  2401. this.callParent(arguments);
  2402. this.addKeyBoardEvents();
  2403. //this.initFields(this);
  2404. },
  2405. addKeyBoardEvents: function(){
  2406. var me = this;
  2407. if(Ext.isIE){
  2408. document.body.attachEvent('onkeydown', function(){//ie的事件名称不同,也不支持addEventListener
  2409. if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
  2410. me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
  2411. "&gridCondition=fd_foidIS" + me.fo_id);
  2412. }
  2413. });
  2414. } else {
  2415. document.body.addEventListener("keydown", function(e){
  2416. if(Ext.isFF5){//firefox不支持window.event
  2417. e = e || window.event;
  2418. }
  2419. if(e.altKey && e.ctrlKey && e.keyCode == 83){
  2420. me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
  2421. "&gridCondition=fd_foidIS" + me.fo_id);
  2422. }
  2423. });
  2424. }
  2425. }
  2426. });