fullorder-addedit_ceshi.js 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. //添加信息框
  2. function reinitIframe(){
  3. var iframe = document.getElementById("abccc");
  4. try{
  5. var bHeight = iframe.contentWindow.document.body.scrollHeight;
  6. var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
  7. var height = Math.max(bHeight, dHeight);
  8. iframe.height = height;
  9. console.log(height);
  10. }catch (ex){}
  11. }
  12. $(".packing .exptj").click(function() {
  13. $(".addful .addwp").html("<iframe id='abccc' allowtransparency='true' frameborder='0' scrolling='auto' allowfullscreen='' mozallowfullscreen='' webkitallowfullscreen='' src='/choice/1' data-focus='true'></iframe>");
  14. $( ".addwp" ).draggable({revert: true,iframeFix:true});// revert: true,axis: "x"
  15. window.setInterval("reinitIframe()", 200);
  16. $(".addful").show();
  17. });
  18. //查找信息单价
  19. function price() {
  20. var f = "";
  21. $(".exp .datalist .select").each(function() {
  22. if($(this).prop("name") != "hairtype")
  23. {
  24. f = f + $(this).children("option:selected").val() + "-";
  25. }
  26. else
  27. {
  28. f = f + 0 + "-";
  29. }
  30. });
  31. $(".datalist .checkbox .ckrows input:checked").each(function(){
  32. f = f + $(this).val() + "-";
  33. });
  34. $(".exp .post .select").each(function() {
  35. f = f + $(this).children("option:selected").val() + "-";
  36. });
  37. $.ajax({
  38. url: "/fullorder/price/",
  39. data: "data="+f,
  40. type: "POST",
  41. dataType: "json",
  42. success: function(a) {
  43. if (a && a.success) {
  44. var ma = $(".exp input[name='money']").val()*1;
  45. var mx = a.msg['salesprice']*1;
  46. var n = $(".exp .num font").text()*1;
  47. $(".exp input[name='money']").val(mx.toFixed(2));
  48. $(".exp .tm font").html((mx*n).toFixed(2));
  49. //$(".exp input[name='money']").val((ma+mx).toFixed(2));//多条数叠加计算价格
  50. //$(".exp .tm font").html(((ma+mx)*n).toFixed(2));//多条数叠加计算价格
  51. $(".zm").append("<font class='z"+a.n+"'>"+mx.toFixed(2)+"</span>");
  52. $(".exp .purchase").text((a.msg['purchase']*1*n).toFixed(2));
  53. $(".exp .cost").text((a.msg['cost']*1*n).toFixed(2));
  54. } else {
  55. $('.exp .'+a.n).prop("checked",false);
  56. $(".ts p").html(a.msg);
  57. $(".ts").fadeIn();
  58. setTimeout('$(".ts").fadeOut()', 600);
  59. }
  60. }
  61. });
  62. /** 单选用不上,这个无成本计算
  63. else
  64. {
  65. var cname = $(this).prop("className");
  66. var ma = $(".exp input[name='money']").val()*1;
  67. var mx = $(".z"+cname).text()*1;
  68. var n = $(".exp .num font").text()*1;
  69. $(".exp input[name='money']").val((ma-mx).toFixed(2));
  70. $(".exp .tm font").html(((ma-mx)*n).toFixed(2));
  71. $(".z"+cname).remove();
  72. }
  73. **/
  74. };
  75. //关闭添加信息框
  76. function choicegb() {
  77. $(".addful",window.parent.document).hide();
  78. /**
  79. var id;
  80. if (self != top && self.frameElement && self.frameElement.tagName == "IFRAME") {
  81. var layxWindow = $(self.frameElement).parents(".layx-window");
  82. id = layxWindow.attr("id").substr(5);
  83. }
  84. parent.layx.destroy(id);
  85. **/
  86. }
  87. //提交时tr增加data信息
  88. $(".exp").on('click',".packingtj",function() {
  89. var f = "";
  90. var index = $(".cike select").find("option:selected").index();
  91. if(index == '4')
  92. {
  93. f = f + $(".cike select").children("option:selected").val() + "-";
  94. }
  95. $(".exp .datalist .select").each(function() {
  96. if($(this).prop("name") != "hairtype" && index != '4')
  97. {
  98. f = f + $(this).children("option:selected").val() + "-";
  99. }
  100. });
  101. $(".datalist .checkbox .ckrows input:checked").each(function(){
  102. f = f + $(this).val() + "-";
  103. });
  104. $(".exp .post .select").each(function() {
  105. f = f + $(this).children("option:selected").val() + "-";
  106. });
  107. $.ajax({
  108. url: "/weight/cx/",
  109. data: "data="+f,
  110. type: "POST",
  111. dataType: "json",
  112. success: function(a) {
  113. if (a && a.success) {
  114. packingtj(a.weight*1);
  115. }
  116. else
  117. {
  118. packingtj('0');
  119. }
  120. }
  121. });
  122. });
  123. function packingtj(weight) {
  124. var f = "";var e = "";var o = "";var checkid = "";
  125. var index = $(".cike select").find("option:selected").index();
  126. if(index == '4')
  127. {
  128. f = f + $(".cike select").children("option:selected").val() + "-";
  129. e = e + $(".cike select").children("option:selected").text() + " ";
  130. }
  131. $(".exp .datalist .select").each(function() {
  132. if(($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '') && index != '4')
  133. {
  134. f = f + $(this).children("option:selected").val() + "-";
  135. e = e + $(this).children("option:selected").text() + " ";
  136. }
  137. });
  138. $(".exp .post .select").each(function() {
  139. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  140. {
  141. f = f + $(this).children("option:selected").val() + "-";
  142. e = e + $(this).children("option:selected").text() + " ";
  143. }
  144. });
  145. var checkname = "";
  146. $(".datalist .checkbox .ckrows input:checked").each(function(){
  147. checkname = $(this).attr("name");
  148. checkid = checkid + $(this).val()+",";
  149. o = o + $(this).next('font').text()+" ";
  150. });
  151. if(checkname == "" && index != '4')
  152. {
  153. $(".ts p").text($(".datalist .checkbox").prevAll("em").text()+"为必填项");
  154. $(".ts").show();
  155. setTimeout('$(".ts").fadeOut()', 600);
  156. return false;
  157. }
  158. else
  159. {
  160. f = checkid + "-" + f;
  161. e = e + o;
  162. }
  163. var ab = 0;
  164. $(".datalist .must").each(function() {
  165. if ($.trim($(this).val()).length == 0) {
  166. $(this).css("border", "1px solid #F66");
  167. ab = ab + 1;
  168. }
  169. });
  170. if (ab > 0) {
  171. $(".ts p").text("红框为必填项");
  172. $(".ts").show();
  173. setTimeout('$(".ts").fadeOut()', 600);
  174. return false;
  175. }
  176. var x = 0
  177. $(".datatext tr",window.parent.document).each(function() {
  178. if($(this).data("list") == f)
  179. {
  180. x++;
  181. }
  182. });
  183. if(x > 0)
  184. {
  185. $(".ts p").text("已有相同信息!");
  186. $(".ts").show();
  187. setTimeout('$(".ts").fadeOut()', 700);
  188. return false;
  189. }
  190. else
  191. {
  192. var ts = $(".exp .num font").text()*1
  193. var dj = $(".exp input[name='money']").val()*1;
  194. var purchasemy = $(".exp .purchase").text()*1;
  195. var costmy = $(".exp .cost").text()*1;
  196. var index = $(".cike select").find("option:selected").index();
  197. var inch = $(".datalist .checkbox .ckrows input:checked").next("font").text();//针对单选尺寸,多选需要修改
  198. $(".datatext",window.parent.document).append("<tr data-list='"+f+"'><td>"+e+"</td><td>"+ts+"</td><td class='none'>"+(dj).toFixed(2)+"</td><td class='none'>"+(ts*dj).toFixed(2)+"</td><td class='none'>CNY</td><td class='none'>"+inch.replace("inch","")+"</td><td class='none'>"+(ts*purchasemy).toFixed(2)+"</td><td class='none'>"+(ts*costmy).toFixed(2)+"</td><td class='none'>"+(ts*weight)+"</td><td class='none'>0</td></tr>");
  199. }
  200. //$("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1+(sl*dj)).toFixed(2));//应收价格加上新增价格
  201. //et();
  202. cost();//计算成本价
  203. window.parent.custom();
  204. choicegb();
  205. pptskc("a");//匹配特殊库存
  206. };
  207. //修改tr-data信息
  208. $(".exp").on('click',".packingxg",function() {
  209. var f = "";
  210. var index = $(".cike select").find("option:selected").index();
  211. if(index == '4')
  212. {
  213. f = f + $(".cike select").children("option:selected").val() + "-";
  214. }
  215. $(".exp .datalist .select").each(function() {
  216. if($(this).prop("name") != "hairtype" && index != '4')
  217. {
  218. f = f + $(this).children("option:selected").val() + "-";
  219. }
  220. });
  221. if(index!= '4')
  222. {
  223. $(".datalist .checkbox .ckrows input:checked").each(function(){
  224. f = f + $(this).val() + "-";
  225. });
  226. }
  227. $(".exp .post .select").each(function() {
  228. f = f + $(this).children("option:selected").val() + "-";
  229. });
  230. $.ajax({
  231. url: "/weight/cx/",
  232. data: "data="+f,
  233. type: "POST",
  234. dataType: "json",
  235. success: function(a) {
  236. if (a && a.success) {
  237. packingxg(a.weight*1);
  238. }
  239. else
  240. {
  241. packingxg('0');
  242. }
  243. }
  244. });
  245. });
  246. function packingxg(weight) {
  247. var f = "";var e = "";var o = "";var checkid = "";
  248. var index = $(".cike select").find("option:selected").index();
  249. if(index == '4')
  250. {
  251. f = f + $(".cike select").children("option:selected").val() + "-";
  252. e = e + $(".cike select").children("option:selected").text() + " ";
  253. }
  254. $(".exp .datalist .select").each(function() {
  255. if(($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '') && index != '4')
  256. {
  257. f = f + $(this).children("option:selected").val() + "-";
  258. e = e + $(this).children("option:selected").text() + " ";
  259. }
  260. });
  261. $(".exp .post .select").each(function() {
  262. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  263. {
  264. f = f + $(this).children("option:selected").val() + "-";
  265. e = e + $(this).children("option:selected").text() + " ";
  266. }
  267. });
  268. var checkname = "";
  269. if(index!= '4')
  270. {
  271. $(".datalist .checkbox .ckrows input:checked").each(function(){
  272. checkname = $(this).attr("name");
  273. checkid = checkid + $(this).val()+",";
  274. o = o + $(this).next('font').text()+" ";
  275. });
  276. }
  277. if(checkname == "" && index != '4')
  278. {
  279. $(".ts p").text($(".datalist .checkbox").prevAll("em").text()+"为必填项");
  280. $(".ts").show();
  281. setTimeout('$(".ts").fadeOut()', 600);
  282. return false;
  283. }
  284. else
  285. {
  286. f = checkid + "-" + f;
  287. e = e + o;
  288. }
  289. var ab = 0;
  290. $(".datalist .must").each(function() {
  291. if ($.trim($(this).val()).length == 0) {
  292. $(this).css("border", "1px solid #F66");
  293. ab = ab + 1;
  294. }
  295. });
  296. if (ab > 0) {
  297. $(".ts p").text("红框为必填项");
  298. $(".ts").show();
  299. setTimeout('$(".ts").fadeOut()', 600);
  300. return false;
  301. }
  302. //var ts = $(".datalist .checkbox .ckrows input:checked").length*1;
  303. var ts = $(".exp .num font").text()*1
  304. var dj = $(".exp input[name='money']").val()*1;
  305. var purchasemy = $(".exp .purchase").text()*1;
  306. var costmy = $(".exp .cost").text()*1;
  307. $(".datatext tr.on",window.parent.document).attr("data-list",f);
  308. //var xg = $(".datatext tr.on td:eq(8)").text()*1;
  309. // $("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1+((sl*dj)-xg)).toFixed(2));
  310. // et();
  311. var inch = $(".datalist .checkbox .ckrows input:checked").next("font").text();//针对单选尺寸,多选需要修改
  312. $(".datatext tr.on",window.parent.document).html("<td>"+e+"</td><td>"+ts+"</td><td class='none'>"+(dj).toFixed(2)+"</td><td class='none'>"+(ts*dj).toFixed(2)+"</td><td class='none'>CNY</td><td class='none'>"+inch.replace("inch","")+"</td><td class='none'>"+(ts*purchasemy).toFixed(2)+"</td><td class='none'>"+(ts*costmy).toFixed(2)+"</td><td class='none'>"+(ts*weight)+"</td><td class='none'>0</td>");
  313. cost();//计算成本价
  314. window.parent.custom();
  315. choicegb();
  316. pptskc("a");//匹配特殊库存
  317. };
  318. //修改数量
  319. $(".exp .lengththree .gz").click(function() {
  320. var num = $(".exp .num font").text()*1;
  321. var dj = $(".exp input[name='money']").val()*1;
  322. $(".exp .num font").text(num+1);
  323. if(dj > 0)
  324. {
  325. $(".exp .tm font").text((dj*(num+1)).toFixed(2));
  326. }
  327. });
  328. $(".exp .lengththree .gj").click(function() {
  329. var num = $(".exp .num font").text()*1;
  330. var dj = $(".exp input[name='money']").val()*1;
  331. if(num > 1)
  332. {
  333. $(".exp .num font").text(num-1)*1;
  334. if(dj > 0)
  335. {
  336. $(".exp .tm font").text((dj*(num-1)).toFixed(2));
  337. }
  338. }
  339. });
  340. //点击增加信息是增加标记
  341. $(".datatext").on('click',"tr",function() {
  342. $(".datatext tr").removeClass("on");
  343. $(this).addClass("on");
  344. });
  345. //删除信息
  346. $(".packing .expsc").click(function() {
  347. var b = 0;
  348. $(".packing .datatext .on").each(function() {
  349. b = b+1;
  350. });
  351. if (b>1)
  352. {
  353. $(".ts p").html("每次只可删除一条内容");
  354. $(".ts").show();
  355. setTimeout('$(".ts").fadeOut()', 1000);
  356. }
  357. else if(b<1)
  358. {
  359. $(".ts p").html("请选择需要删除的内容");
  360. $(".ts").show();
  361. setTimeout('$(".ts").fadeOut()', 1000);
  362. }
  363. else
  364. {
  365. // var xg = $(".datatext tr.on td:eq(8)").text()*1;
  366. //$("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1-xg).toFixed(2));et();
  367. $(".packing .datatext .on").remove();
  368. }
  369. costz();//计算成本价
  370. window.parent.custom();
  371. });
  372. //统一修改币种
  373. $("#currency").change(function(){
  374. var index = $(this).find("option:selected").text();
  375. var va = $(this).find("option:selected").val();
  376. $(".currency").text(index);
  377. $(".datatext tr").each(function() {
  378. //$(this).find("td:eq(9)").text(index);
  379. });
  380. });
  381. //fullorder 数据库增加currency币种 考虑更改币种是否需要ajax获取美元汇率更改金额
  382. $(".packing .expxg").click(function() {
  383. var b = 0;
  384. $(".packing .datatext .on").each(function() {
  385. b = b+1;
  386. });
  387. if (b>1)
  388. {
  389. $(".ts p").html("每次只可修改一条内容");
  390. $(".ts").show();
  391. setTimeout('$(".ts").fadeOut()', 1000);
  392. }
  393. else if(b<1)
  394. {
  395. $(".ts p").html("请选择需要修改的内容");
  396. $(".ts").show();
  397. setTimeout('$(".ts").fadeOut()', 1000);
  398. }
  399. else
  400. {
  401. $(".addful .addwp").html("<iframe id='abccc' allowtransparency='true' frameborder='0' scrolling='auto' allowfullscreen='' mozallowfullscreen='' webkitallowfullscreen='' src='/choice/2' data-focus='true'></iframe>");
  402. $( ".addwp" ).draggable({ revert: true,axis: "x" });
  403. window.setInterval("reinitIframe()", 200);
  404. $(".addful").show();
  405. }
  406. });
  407. //自动显示option
  408. function option() {
  409. var index = $(".cike select").find("option:selected").index();
  410. $(".pttab li").hide(); $(".pttab li").removeClass("post");
  411. $("."+index).show();$(".none"+index).hide();$("."+index).addClass("post");
  412. $('.pttab select option:eq(0)').prop('selected','selected');
  413. if(index == 1)
  414. {
  415. $(".pttab .a1").show();$(".pttab .a2").hide();
  416. }
  417. if(index == 4)
  418. {
  419. $(".Gift").hide();
  420. }
  421. else
  422. {
  423. $(".Gift").show();
  424. }
  425. var indexb = $(".cikeb.post select").find("option:selected").index();
  426. $(".pttab .a1").hide();$(".pttab .a2").hide();$(".pttab .a3").hide();$(".pttab .a4").hide();$(".pttab .a1").removeClass("post");$(".pttab .a2").removeClass("post");$(".pttab .a3").removeClass("post");$(".pttab .a4").removeClass("post");
  427. if(indexb == 0)
  428. {
  429. $(".pttab .a1").show();$(".pttab .a1").addClass("post");
  430. }
  431. else if(indexb == 1)
  432. {
  433. $(".pttab .a4").show();$(".pttab .a4").addClass("post");
  434. }
  435. else if(indexb == 2)
  436. {
  437. $(".pttab .a2").show();$(".pttab .a2").addClass("post");
  438. }
  439. else if(indexb == 4)
  440. {
  441. $(".pttab .a3").show();$(".pttab .a3").addClass("post");
  442. }
  443. }
  444. $("select[name='country']").change(function() {
  445. $("select[name=productdescription]").html("");
  446. $("input[name=customs]").val("0");
  447. //express() 暂时固定运费为20USD 不在查找设置价格
  448. printtype();
  449. });
  450. $("select[name='express']").change(function() {
  451. $("select[name=productdescription]").html("");
  452. $("input[name=customs]").val("0");
  453. if($(this).find("option:selected").val() == '24' || $(this).find("option:selected").val() == '31')//联邦的话替换签名选项
  454. {
  455. $("select[name='qm']").html('<option value="0" selected="selected">默认</option><option value="1">成人签名</option>');
  456. }
  457. else
  458. {
  459. $("select[name='qm']").html('<option value="0" selected="selected">不需要</option><option value="1">需要</option>');
  460. }
  461. //express() 暂时固定运费为20USD 不在查找设置价格
  462. printtype();
  463. type();
  464. });
  465. $("select[name='printtype']").change(function() {
  466. $("select[name=productdescription]").html("");
  467. $("input[name=customs]").val("0");
  468. printtype();
  469. });
  470. //打印类型
  471. function printtype() {
  472. var index = $("select[name='printtype']").find("option:selected").index();
  473. if(index == 0)
  474. {
  475. var e = $("select[name=express]").find("option:selected").val();
  476. var c = $("select[name=country]").find("option:selected").val();
  477. $.ajax({
  478. url: "/fullorder/customs/",
  479. data: "e="+e+"&c="+c,
  480. type: "POST",
  481. dataType: "json",
  482. success: function(a) {
  483. if (a && a.success) {
  484. $("input[name=customs]").val(a.money);
  485. for(i=0;i<a.msg.length;i++)
  486. {
  487. $("select[name=productdescription]").append("<option value='"+a.msg[i]['id']+"'>"+a.msg[i]['title']+"</option>");
  488. }
  489. $(".productdescription").show();
  490. $(".customs").show();
  491. }
  492. /** 无快递信息配置时提示框
  493. else {
  494. $(".productdescription").hide();
  495. $(".customs").hide();
  496. $(".ts p").html(a.msg);
  497. $(".ts").fadeIn();
  498. setTimeout('$(".ts").fadeOut()', 800);
  499. }
  500. **/
  501. }
  502. });
  503. }
  504. else
  505. {
  506. $(".productdescription").hide();
  507. $(".customs").hide();
  508. }
  509. }
  510. function pptskc(pptskccs) {
  511. if(pptskccs == "a")
  512. {
  513. var w = "";
  514. $(".datatext tr",window.parent.document).each(function() {
  515. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  516. var cc = list.split(",");
  517. w = w + cc[1] + '|';
  518. });
  519. $.ajax({
  520. url: "/specialstock/ppkc/1",
  521. data: "data="+w,
  522. type: "POST",
  523. dataType: "json",
  524. success: function(a) {
  525. if (a && a.success)
  526. {
  527. for(i=0;i<a.list.length;i++)
  528. {
  529. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0) span",window.parent.document).remove();
  530. console.log($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)",window.parent.document).text());
  531. if($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)",window.parent.document).text() == 'z')
  532. {
  533. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)",window.parent.document).prepend("<span class='l' id='xf"+i+"' style='padding:0px 15px;background:#2ca8a1;' data-id='"+a.list[i][1]+"'>已选择特殊库存</span>");
  534. }
  535. else
  536. {
  537. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)",window.parent.document).prepend("<span class='l' id='xf"+i+"' style='padding:0px 15px' data-id='"+a.list[i][1]+"'>有可用特殊库存</span>");
  538. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)",window.parent.document).css("color","#C3C");
  539. }
  540. }
  541. }
  542. }
  543. });
  544. }
  545. else
  546. {
  547. var w = "";
  548. $(".datatext tr").each(function() {
  549. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  550. var cc = list.split(",");
  551. w = w + cc[1] + '|';
  552. });
  553. $.ajax({
  554. url: "/specialstock/ppkc/",
  555. data: "data="+w,
  556. type: "POST",
  557. dataType: "json",
  558. success: function(a) {
  559. if (a && a.success)
  560. {
  561. for(i=0;i<a.list.length;i++)
  562. {
  563. if($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)").text() == 'z')
  564. {
  565. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)").prepend("<span class='l' id='xf"+i+"' style='padding:0px 15px;background:#2ca8a1;' data-id='"+a.list[i][1]+"'>已选择特殊库存</span>");
  566. }
  567. else
  568. {
  569. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)").prepend("<span class='l' id='xf"+i+"' style='padding:0px 15px' data-id='"+a.list[i][1]+"'>有可用特殊库存</span>");
  570. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)").css("color","#C3C");
  571. }
  572. }
  573. }
  574. }
  575. });
  576. }
  577. //判断是匹配特殊库存
  578. }
  579. $(".datatext").on('click',"tr span",function() {
  580. var btnTarget= document.getElementById($(this).attr("id"));
  581. var winform = layx.iframe('float-bottom','可选择的特殊产品','/specialstock/list/'+$(this).data("id"),{
  582. floatTarget:btnTarget, // 被吸附的DOM对象
  583. shadable:true,
  584. escKey:false,
  585. control:false,
  586. icon:false,
  587. width:870,
  588. height:300,
  589. alwaysOnTop:true,
  590. floatDirection: 'bottom', // 设置方向
  591. event:{
  592. ondestroy: {
  593. before: function (layxWindow, winform, params, inside,escKey) {
  594. if(inside===false){
  595. layx.visual(winform.id,false); // 隐藏窗口
  596. layx.updateFloatWinPosition(winform.id);
  597. return false;
  598. }
  599. }
  600. },
  601. onexist: function (layxWindow, winform) {
  602. layx.visual(winform.id,true); // 显示窗口
  603. }
  604. }
  605. });
  606. });
  607. $("select[name='warehouse']").change(function() {
  608. type()
  609. });
  610. function express() {
  611. var e = $("select[name=express]").find("option:selected").val();
  612. var c = $("select[name=country]").find("option:selected").val();
  613. $.ajax({
  614. url: "/fullorder/express/",
  615. data: "e="+e+"&c="+c,
  616. type: "POST",
  617. dataType: "json",
  618. success: function(a) {
  619. if (a && a.success) {
  620. $("input[name=expressmoney]").val(a.money);//?这里或许需要根据币种美元转换
  621. } else {
  622. $("input[name=expressmoney]").val("0.00");
  623. }
  624. }
  625. });
  626. }
  627. function type() {
  628. var t = $("select[name=express]").find("option:selected").val();
  629. var c = $("select[name=warehouse]").find("option:selected").val();
  630. /** 如果仓库不是1的话,执行不打印操作
  631. if(c!=1)
  632. {
  633. $("select[name=printtype]").find("option[value='3']").prop("selected","selected");return false;
  634. }
  635. **/
  636. $.ajax({
  637. url: "/fullorder/expresstype/",
  638. data: "id="+t,
  639. type: "POST",
  640. dataType: "json",
  641. success: function(a) {
  642. if (a && a.success) {
  643. $("select[name=printtype]").find("option[value='"+a.msg+"']").prop("selected","selected");
  644. }
  645. }
  646. });
  647. }
  648. $(".lengththree input[name='money']").bind("change",function(){
  649. var ma= $(this).val();
  650. var n = $(".exp .num font").text()*1;
  651. $(".exp .tm font").html((ma*n).toFixed(2));
  652. });
  653. //整体提交数据
  654. $(".fullorderdata").click(function() {
  655. var f = "";
  656. var e = "";
  657. var w = "";
  658. var fpcount = "";
  659. $(".need .select").each(function() {
  660. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  661. });
  662. $(".need input:text").each(function() {
  663. var str = $(this).val().replace(/\+/g,"%2B");
  664. var str = str.replace(/&/g,"%26");
  665. f = f + $(this).attr("name") + "=" + str + "&";
  666. });
  667. $(".need input:hidden").each(function() {
  668. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  669. });
  670. $(".need textarea").each(function() {
  671. var str2 = $(this).val().replace(/\+/g,"%2B");
  672. var str2 = str2.replace(/&/g,"%26");
  673. f = f + $(this).attr("name") + "=" + str2 + "&";
  674. });
  675. var tdweight = 0;
  676. $(".datatext tr").each(function() {
  677. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  678. var td0 = $(this).find("td:eq(0)").text().replace(/\+/g,"%2B");
  679. var td0 = td0.replace(/&/g,"%26");
  680. var td8 = '';
  681. if($(this).find("td:eq(8)").length > 0)
  682. {
  683. if($(this).find("td:eq(8)").text() == '')
  684. {
  685. td8 = '0';
  686. }
  687. else
  688. {
  689. td8 = $(this).find("td:eq(8)").text();
  690. }
  691. }
  692. else
  693. {
  694. td8 = '0';
  695. }
  696. e = e + $(this).attr("data-list")+ "|" + td0 + "|" + $(this).find("td:eq(1)").text() + "|" + $(this).find("td:eq(2)").text() + "|" + $(this).find("td:eq(3)").text() + "|" + $(this).find("td:eq(5)").text() + "|" + $(this).find("td:eq(6)").text() + "|" + $(this).find("td:eq(7)").text() + "|" + td8 + "|" + $(this).find("td:eq(9)").text() + ";";
  697. tdweight = tdweight + td8*1;
  698. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  699. cc = list.split(",");
  700. listqc = list.replace(/\d{1,3}\,/,'');
  701. listqc = listqc.substring(0,listqc.length-1);
  702. data = listqc.split("-");
  703. for(i=1;i<data.length;i++)
  704. {
  705. if(i == 2)
  706. {
  707. if(cc[0] != list)
  708. {
  709. t = t +data[i] + cc[0];
  710. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  711. }
  712. else
  713. {
  714. t = t +data[i];
  715. fpdg = fpdg + '-' + data[i];
  716. }
  717. }
  718. else
  719. {
  720. t = t +data[i];
  721. fpdg = fpdg + '-' + data[i];
  722. }
  723. }
  724. w = w + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  725. fpcount = fpcount + fpdg + '-|';
  726. });
  727. f = f + "jweight=" + tdweight + "&";
  728. e = e.replace(/(有可用特殊库存|已选择特殊库存)/g,'');
  729. f = f + "whlabel=|" + w + "&fpdata=" + encodeURI(e) + "&";
  730. f = f + "fpcount=" + fpcount + "&";
  731. f = f + "budget=" + $(".budget").text() + "&";
  732. var ab = 0;
  733. $(".need .must").each(function() {
  734. if ($.trim($(this).val()).length == 0) {
  735. $(this).css("border", "1px solid #F66");
  736. ab = ab + 1;
  737. }
  738. });
  739. if (ab > 0) {
  740. $(".ts p").text("红框为必填项");
  741. $(".ts").show();
  742. setTimeout('$(".ts").fadeOut()', 600);
  743. return false;
  744. }
  745. //限制必须提交产品详细列表
  746. if (e == '') {
  747. $(".ts p").text("必须添加订单详细信息!");
  748. $(".ts").show();
  749. setTimeout('$(".ts").fadeOut()', 800);
  750. return false;
  751. }
  752. else
  753. {
  754. /**
  755. if($("select[name=warehouse]").find("option:selected").val() == "5" || $("select[name=warehouse]").find("option:selected").val() == "6")
  756. {
  757. var yzdata = {
  758. warehouse: $("select[name=warehouse]").find("option:selected").val(),
  759. shop: $("input[name=shop]").val(),
  760. id: $("input[name=id]").val(),
  761. whlabel: "|" + w
  762. };
  763. $.ajax({
  764. url: "/whlabel/kcyz/",
  765. data: yzdata,
  766. type: "POST",
  767. dataType: "json",
  768. success: function(a) {
  769. if (a && a.success) {
  770. zttj(f);
  771. } else {
  772. if(a.t == 1)
  773. {
  774. layx.alert('错误',a.msg,function(id,button){
  775. },{dialogIcon:'error'});
  776. }
  777. else
  778. {
  779. layx.alert('错误',a.msg,function(id,button){
  780. },{dialogIcon:'error'});
  781. for(i=0;i<a.error.length;i++)
  782. {
  783. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  784. }
  785. }
  786. }
  787. }
  788. });
  789. }
  790. else
  791. {
  792. zttj(f);
  793. }
  794. **/
  795. zttj(f);
  796. }
  797. });
  798. function zttj(f){
  799. layx.load('loadId','数据提交中,请稍后');
  800. $.ajax({
  801. url: addedit,
  802. data: f,
  803. type: "POST",
  804. dataType: "json",
  805. success: function(a) {
  806. layx.destroy('loadId');
  807. if (a && a.success) {
  808. $(".express p:eq(0)").html(a.msg);
  809. $(".express p:eq(1)").html("<font class='fh' data-id='"+a.id+"'>确 定</font>");
  810. $(".express").show();
  811. } else {
  812. var old = a.oldwhlabel;
  813. $("select[name=warehouse] option:eq(0)").prop('selected','selected');
  814. if(a.t == 2)
  815. {
  816. layx.alert('错误',a.msg,function(id,button){
  817. },{dialogIcon:'error'});
  818. for(i=0;i<a.error.length;i++)
  819. {
  820. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  821. }
  822. }
  823. else
  824. {
  825. layx.destroy('loadId');
  826. $(".ts p").html(a.msg);
  827. $(".ts").fadeIn();
  828. setTimeout('$(".ts").fadeOut()', 600);
  829. }
  830. }
  831. }
  832. });
  833. }
  834. //关联总金额换算穿预计到帐金额
  835. $("input[name='shouldmoney']").bind("change",function(){
  836. et();
  837. });
  838. function et(){
  839. var ma= $("input[name='shouldmoney']").val();
  840. if(ma > 0)
  841. {
  842. var n= $("input[name='et']").val();
  843. $(".currencymoney").text(eval(ma+n).toFixed(2));
  844. }
  845. else
  846. {
  847. $(".currencymoney").text(0);
  848. }
  849. }
  850. //计算成本金额,子页面用
  851. function cost(){
  852. var purchasemoney = 0;var costmoney = 0;
  853. $(".datatext tr",window.parent.document).each(function() {
  854. purchasemoney = purchasemoney+$(this).find("td:eq(6)").text()*1;
  855. costmoney = costmoney+$(this).find("td:eq(7)").text()*1;
  856. });
  857. $("input[name='purchase']",window.parent.document).val(purchasemoney.toFixed(2));
  858. $("input[name='cost']",window.parent.document).val(costmoney.toFixed(2));
  859. //$("li b .zlr").html(($("li .budget").html()*1-money).toFixed(2));//总利润
  860. }
  861. //计算成本金额,自页面用
  862. function costz(){
  863. var purchasemoney = 0;var costmoney = 0;
  864. $(".datatext tr").each(function() {
  865. purchasemoney = purchasemoney+$(this).find("td:eq(6)").text()*1;
  866. costmoney = costmoney+$(this).find("td:eq(7)").text()*1;
  867. });
  868. $("input[name='purchase']").val(purchasemoney.toFixed(2));
  869. $("input[name='cost']").val(costmoney.toFixed(2));
  870. //$("li b .zlr").html(($("li .budget").html()*1-money).toFixed(2));//总利润
  871. }
  872. $(".power").click(function() {
  873. layx.confirm('重置选择','确定重置此订单?',function(id){
  874. $.ajax({
  875. url: fh+"/power/",
  876. data: "id="+$("input[name='id']").val(),
  877. type: "POST",
  878. dataType: "json",
  879. success: function(a) {
  880. layx.destroy(id);
  881. if (a && a.success) {
  882. $(".express p:eq(0)").html(a.msg);
  883. $(".express p:eq(1)").html("<font class='fh'>确 定</font>");
  884. $(".express").show();
  885. } else {
  886. $(".ts p").html(a.msg);
  887. $(".ts").fadeIn();
  888. setTimeout('$(".ts").fadeOut()', 800);
  889. }
  890. }
  891. });
  892. layx.destroy(id);
  893. },{shadable:0.6,dialogIcon:'help'});
  894. });
  895. //验证库存
  896. $("select[name=warehouse]").change(function(){
  897. var czw = $(this).find("option:selected").val();
  898. var cze = $(this).find("option:selected").data("e");
  899. $.ajax({
  900. url: "/warehouse/list/",
  901. data: "id="+czw,
  902. type: "POST",
  903. dataType: "json",
  904. success: function(a) {
  905. if (a && a.success) {
  906. if(a.msg == "1")
  907. {
  908. var w = "";
  909. $(".datatext tr").each(function() {
  910. var cc = "";var listqc = "";var data = "";var t = "";
  911. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  912. cc = list.split(",");
  913. listqc = list.replace(/\d{1,3}\,/,'');
  914. listqc = listqc.substring(0,listqc.length-1);
  915. data = listqc.split("-");
  916. for(i=1;i<data.length;i++)
  917. {
  918. if(i == 2)
  919. {
  920. if(cc[0] != list)
  921. {
  922. t = t +data[i] + cc[0];
  923. }
  924. else
  925. {
  926. t = t +data[i];
  927. }
  928. }
  929. else
  930. {
  931. t = t +data[i]
  932. }
  933. }
  934. w = w + t + '-' + $(this).find("td:eq(1)").text() + '|';
  935. });
  936. var yzdata = {
  937. warehouse: czw,
  938. shop: $("input[name=shop]").val(),
  939. id: $("input[name=id]").val(),
  940. number: $("input[name=number]").val(),
  941. whlabel: "|" + w
  942. };
  943. $.ajax({
  944. url: "/whlabel/kcyz/",
  945. data: yzdata,
  946. type: "POST",
  947. dataType: "json",
  948. success: function(a) {
  949. if (a && a.success) {
  950. if(cze != 0)//更改为默认快递
  951. {
  952. $('select[name=express]').find("option").each(function(){
  953. if($(this).val() == cze){
  954. $(this).prop('selected','selected');
  955. }
  956. });
  957. usps();
  958. }
  959. } else {
  960. $("select[name=warehouse] option:eq(0)").prop('selected','selected');
  961. if(a.t == 1)
  962. {
  963. layx.alert('错误',a.msg,function(id,button){
  964. },{dialogIcon:'error'});
  965. }
  966. else
  967. {
  968. layx.alert('错误',a.msg,function(id,button){
  969. },{dialogIcon:'error'});
  970. for(i=0;i<a.error.length;i++)
  971. {
  972. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  973. }
  974. }
  975. }
  976. }
  977. });
  978. }
  979. else
  980. {
  981. if(cze != 0)//更改为默认快递
  982. {
  983. $('select[name=express]').find("option").each(function(){
  984. if($(this).val() == cze){
  985. $(this).prop('selected','selected');
  986. }
  987. });
  988. usps();
  989. }
  990. }
  991. } else {
  992. $(".ts p").html(a.msg);
  993. $(".ts").fadeIn();
  994. setTimeout('$(".ts").fadeOut()', 800);
  995. }
  996. }
  997. });
  998. });
  999. $("select[name='express']").change(function() { //usps 显示 签名和服务类型
  1000. usps()
  1001. })
  1002. function usps() {
  1003. var nr = $("select[name='express']").find("option:selected").val();
  1004. if(nr == "2")
  1005. {
  1006. $(".usps").show();
  1007. $(".qm").show();
  1008. }
  1009. else
  1010. {
  1011. $(".usps").hide();
  1012. $(".qm").hide();
  1013. }
  1014. if(nr == "24")
  1015. {
  1016. $(".qm").show();
  1017. }
  1018. else
  1019. {
  1020. $(".qm").hide();
  1021. }
  1022. }
  1023. $(".button .return").click(function() {
  1024. layx.confirm('操作退货','确定生成《退货》信息?',function(id){
  1025. layx.load('loadId','数据提交中,请稍后');
  1026. $.ajax({
  1027. url: fh+"/return/",
  1028. data: "orderinfo="+$(".orderinfo").text(),
  1029. type: "POST",
  1030. dataType: "json",
  1031. success: function(a) {
  1032. layx.destroy('loadId');
  1033. if (a && a.success) {
  1034. layx.alert('完成',a.msg,function(id,button){
  1035. },{dialogIcon:'success'});
  1036. $("li .return").html(a.data);
  1037. } else {
  1038. layx.alert('错误',a.msg,function(id,button){
  1039. },{dialogIcon:'error'});
  1040. }
  1041. }
  1042. });
  1043. layx.destroy(id);
  1044. },{shadable:0.6,dialogIcon:'help'});
  1045. });
  1046. $(".button .clearreturn").click(function() {
  1047. layx.confirm('清除记录','确定清除此单退货记录?',function(id){
  1048. $.ajax({
  1049. url: fh+"/clearreturn/",
  1050. data: "orderinfo="+$(".orderinfo").text(),
  1051. type: "POST",
  1052. dataType: "json",
  1053. success: function(a) {
  1054. layx.destroy(id);
  1055. if (a && a.success) {
  1056. layx.alert('完成',a.msg,function(id,button){
  1057. },{dialogIcon:'success'});
  1058. $(".clearreturnedit1").html("已出库");
  1059. $(".clearreturnedit2").html("<em>允许发货:</em><b>允许出库</b>");
  1060. } else {
  1061. layx.alert('错误',a.msg,function(id,button){
  1062. },{dialogIcon:'error'});
  1063. }
  1064. }
  1065. });
  1066. layx.destroy(id);
  1067. },{shadable:0.6,dialogIcon:'help'});
  1068. });
  1069. $(".bcbz").click(function() {
  1070. var f = "";
  1071. var e = "";
  1072. var w = "";
  1073. var fpcount = "";
  1074. $(".need .select").each(function() {
  1075. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  1076. });
  1077. $(".need input:text").each(function() {
  1078. var str = $(this).val().replace(/\+/g,"%2B");
  1079. var str = str.replace(/&/g,"%26");
  1080. f = f + $(this).attr("name") + "=" + str + "&";
  1081. });
  1082. $(".need input:hidden").each(function() {
  1083. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  1084. });
  1085. $(".need textarea").each(function() {
  1086. var str2 = $(this).val().replace(/\+/g,"%2B");
  1087. f = f + $(this).attr("name") + "=" + str2 + "&";
  1088. });
  1089. var tdweight = 0;
  1090. $(".datatext tr").each(function() {
  1091. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  1092. var td8 = '';
  1093. if($(this).find("td:eq(8)").length > 0)
  1094. {
  1095. if($(this).find("td:eq(8)").text() == '')
  1096. {
  1097. td8 = '0';
  1098. }
  1099. else
  1100. {
  1101. td8 = $(this).find("td:eq(8)").text();
  1102. }
  1103. }
  1104. else
  1105. {
  1106. td8 = '0';
  1107. }
  1108. e = e + $(this).attr("data-list")+ "|" + $(this).find("td:eq(0)").text() + "|" + $(this).find("td:eq(1)").text() + "|" + $(this).find("td:eq(2)").text() + "|" + $(this).find("td:eq(3)").text() + "|" + $(this).find("td:eq(5)").text() + "|" + $(this).find("td:eq(6)").text() + "|" + $(this).find("td:eq(7)").text() + "|" + td8 + ";";
  1109. tdweight = tdweight + td8*1;
  1110. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  1111. cc = list.split(",");
  1112. listqc = list.replace(/\d{1,3}\,/,'');
  1113. listqc = listqc.substring(0,listqc.length-1);
  1114. data = listqc.split("-");
  1115. for(i=1;i<data.length;i++)
  1116. {
  1117. if(i == 2)
  1118. {
  1119. if(cc[0] != list)
  1120. {
  1121. t = t +data[i] + cc[0];
  1122. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  1123. }
  1124. else
  1125. {
  1126. t = t +data[i];
  1127. fpdg = fpdg + '-' + data[i];
  1128. }
  1129. }
  1130. else
  1131. {
  1132. t = t +data[i];
  1133. fpdg = fpdg + '-' + data[i];
  1134. }
  1135. }
  1136. w = w + t + '-' + $(this).find("td:eq(1)").text() + '|';
  1137. fpcount = fpcount + fpdg + '-|';
  1138. });
  1139. f = f + "jweight=" + tdweight + "&";
  1140. f = f + "whlabel=|" + w + "&fpdata=" + encodeURI(e) + "&";
  1141. f = f + "fpcount=" + fpcount + "&";
  1142. f = f + "budget=" + $(".budget").text() + "&";
  1143. /**
  1144. if($("select[name=warehouse]").find("option:selected").val() == "5" || $("select[name=warehouse]").find("option:selected").val() == "6")
  1145. {
  1146. var yzdata = {
  1147. warehouse: $("select[name=warehouse]").find("option:selected").val(),
  1148. shop: $("input[name=shop]").val(),
  1149. id: $("input[name=id]").val(),
  1150. whlabel: "|" + w
  1151. };
  1152. $.ajax({
  1153. url: "/whlabel/kcyz/",
  1154. data: yzdata,
  1155. type: "POST",
  1156. dataType: "json",
  1157. success: function(a) {
  1158. if (a && a.success) {
  1159. bcbz(f);
  1160. } else {
  1161. if(a.t == 1)
  1162. {
  1163. layx.alert('错误',a.msg,function(id,button){
  1164. },{dialogIcon:'error'});
  1165. }
  1166. else
  1167. {
  1168. layx.alert('错误',a.msg,function(id,button){
  1169. },{dialogIcon:'error'});
  1170. for(i=0;i<a.error.length;i++)
  1171. {
  1172. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1173. }
  1174. }
  1175. }
  1176. }
  1177. });
  1178. }
  1179. else
  1180. {
  1181. bcbz(f);
  1182. }
  1183. **/
  1184. bcbz(f);
  1185. });
  1186. function bcbz(f) {
  1187. layx.load('loadId','数据提交中,请稍后');
  1188. $.ajax({
  1189. url: fh+"/bcbz/",
  1190. data: f,
  1191. type: "POST",
  1192. dataType: "json",
  1193. success: function(a) {
  1194. layx.destroy('loadId');
  1195. if (a && a.success) {
  1196. $(".express p:eq(0)").html(a.msg);
  1197. $(".express p:eq(1)").html("<font class='fh' data-id='"+a.id+"'>确 定</font>");
  1198. $(".express").show();
  1199. } else {
  1200. $("select[name=warehouse] option:eq(0)").prop('selected','selected');
  1201. if(a.t == 2)
  1202. {
  1203. layx.alert('错误',a.msg,function(id,button){
  1204. },{dialogIcon:'error'});
  1205. for(i=0;i<a.error.length;i++)
  1206. {
  1207. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1208. }
  1209. }
  1210. else
  1211. {
  1212. layx.destroy('loadId');
  1213. $(".ts p").html(a.msg);
  1214. $(".ts").fadeIn();
  1215. setTimeout('$(".ts").fadeOut()', 600);
  1216. }
  1217. }
  1218. }
  1219. });
  1220. };