Form.js 94 KB

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