fullorder-addedit.js 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826
  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. else
  96. {
  97. $(".exp .datalist .select").each(function() {
  98. if(!$(this).parent().is(":hidden"))
  99. {
  100. f = f + $(this).children("option:selected").val() + "-";
  101. }
  102. });
  103. }
  104. $(".datalist .checkbox .ckrows input:checked").each(function(){
  105. f = f + $(this).val() + "-";
  106. });
  107. $(".exp .post .select").each(function() {
  108. f = f + $(this).children("option:selected").val() + "-";
  109. });
  110. $.ajax({
  111. url: "/weight/cx/",
  112. data: "data="+f,
  113. type: "POST",
  114. dataType: "json",
  115. success: function(a) {
  116. if (a && a.success) {
  117. packingtj(a.weight*1);
  118. }
  119. else
  120. {
  121. packingtj('0');
  122. }
  123. }
  124. });
  125. });
  126. function packingtj(weight) {
  127. var f = "";var e = "";var o = "";var checkid = "";var reg = RegExp(/ - /);
  128. var index = $(".cike select").find("option:selected").index();
  129. if(index == '4')
  130. {
  131. f = f + $(".cike select").children("option:selected").val() + "-";
  132. if($(".cike select").children("option:selected").text().match(reg))
  133. {
  134. var thistext = $(".cike select").children("option:selected").text().split(" - ");
  135. e = e + thistext[0] + " ";
  136. }
  137. }
  138. $(".exp .datalist .select").each(function() {
  139. if((($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '') && index != '4') && !$(this).parent().is(":hidden"))
  140. {
  141. f = f + $(this).children("option:selected").val() + "-";
  142. if($(this).children("option:selected").text().match(reg))
  143. {
  144. var thistext = $(this).children("option:selected").text().split(" - ");
  145. e = e + thistext[0] + " ";
  146. }
  147. else
  148. {
  149. e = e + $(this).children("option:selected").text() + " ";
  150. }
  151. }
  152. });
  153. $(".exp .post .select").each(function() {
  154. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  155. {
  156. f = f + $(this).children("option:selected").val() + "-";
  157. if($(this).children("option:selected").text().match(reg))
  158. {
  159. var thistext = $(this).children("option:selected").text().split(" - ");
  160. e = e + thistext[0] + " ";
  161. }
  162. else
  163. {
  164. e = e + $(this).children("option:selected").text() + " ";
  165. }
  166. }
  167. });
  168. var checkname = "";
  169. $(".datalist .checkbox .ckrows input:checked").each(function(){
  170. checkname = $(this).attr("name");
  171. checkid = checkid + $(this).val()+",";
  172. o = o + $(this).next('font').text()+" ";
  173. });
  174. if(checkname == "" && index != '4')
  175. {
  176. $(".ts p").text($(".datalist .checkbox").prevAll("em").text()+"为必填项");
  177. $(".ts").show();
  178. setTimeout('$(".ts").fadeOut()', 600);
  179. return false;
  180. }
  181. else
  182. {
  183. f = checkid + "-" + f;
  184. e = e + o;
  185. }
  186. var ab = 0;
  187. $(".datalist .must").each(function() {
  188. if ($.trim($(this).val()).length == 0) {
  189. $(this).css("border", "1px solid #F66");
  190. ab = ab + 1;
  191. }
  192. });
  193. if (ab > 0) {
  194. $(".ts p").text("红框为必填项");
  195. $(".ts").show();
  196. setTimeout('$(".ts").fadeOut()', 600);
  197. return false;
  198. }
  199. var x = 0
  200. $(".datatext tr",window.parent.document).each(function() {
  201. if($(this).data("list") == f)
  202. {
  203. x++;
  204. }
  205. });
  206. if(x > 0)
  207. {
  208. $(".ts p").text("已有相同信息!");
  209. $(".ts").show();
  210. setTimeout('$(".ts").fadeOut()', 700);
  211. return false;
  212. }
  213. else
  214. {
  215. var ts = $(".exp .num font").text()*1
  216. var dj = $(".exp input[name='money']").val()*1;
  217. var purchasemy = $(".exp .purchase").text()*1;
  218. var costmy = $(".exp .cost").text()*1;
  219. var index = $(".cike select").find("option:selected").index();
  220. var inch = $(".datalist .checkbox .ckrows input:checked").next("font").text();//针对单选尺寸,多选需要修改
  221. //xyxg 删除这个
  222. /**
  223. $(".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><td class='none'></td></tr>");//xyxg 启用下面这个
  224. **/
  225. if($("input[name='mdedit']",window.parent.document).length > 0)//线下单操作界面
  226. {
  227. $(".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 val9'>0</td><td><font class='jzzd'>禁止占单</font></td></tr>");
  228. }
  229. else
  230. {
  231. $(".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 val9'>0</td><td></td><td><font class='jzzd'>禁止占单</font></td></tr>");
  232. }
  233. }
  234. //$("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1+(sl*dj)).toFixed(2));//应收价格加上新增价格
  235. //et();
  236. cost();//计算成本价
  237. window.parent.custom();
  238. choicegb();
  239. pptskc("a");//匹配特殊库存
  240. };
  241. //修改tr-data信息
  242. $(".exp").on('click',".packingxg",function() {
  243. var f = "";
  244. var index = $(".cike select").find("option:selected").index();
  245. if(index == '4')
  246. {
  247. f = f + $(".cike select").children("option:selected").val() + "-";
  248. }
  249. else
  250. {
  251. $(".exp .datalist .select").each(function() {
  252. if(!$(this).parent().is(":hidden"))
  253. {
  254. f = f + $(this).children("option:selected").val() + "-";
  255. }
  256. });
  257. }
  258. if(index!= '4')
  259. {
  260. $(".datalist .checkbox .ckrows input:checked").each(function(){
  261. f = f + $(this).val() + "-";
  262. });
  263. }
  264. $(".exp .post .select").each(function() {
  265. f = f + $(this).children("option:selected").val() + "-";
  266. });
  267. $.ajax({
  268. url: "/weight/cx/",
  269. data: "data="+f,
  270. type: "POST",
  271. dataType: "json",
  272. success: function(a) {
  273. if (a && a.success) {
  274. packingxg(a.weight*1);
  275. }
  276. else
  277. {
  278. packingxg('0');
  279. }
  280. }
  281. });
  282. });
  283. function packingxg(weight) {
  284. var f = "";var e = "";var o = "";var checkid = "";var reg = RegExp(/ - /);
  285. var index = $(".cike select").find("option:selected").index();
  286. if(index == '4')
  287. {
  288. f = f + $(".cike select").children("option:selected").val() + "-";
  289. if($(".cike select").children("option:selected").text().match(reg))
  290. {
  291. var thistext = $(".cike select").children("option:selected").text().split(" - ");
  292. e = e + thistext[0] + " ";
  293. }
  294. }
  295. $(".exp .datalist .select").each(function() {
  296. if((($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '') && index != '4') && !$(this).parent().is(":hidden"))
  297. {
  298. f = f + $(this).children("option:selected").val() + "-";
  299. if($(this).children("option:selected").text().match(reg))
  300. {
  301. var thistext = $(this).children("option:selected").text().split(" - ");
  302. e = e + thistext[0] + " ";
  303. }
  304. else
  305. {
  306. e = e + $(this).children("option:selected").text() + " ";
  307. }
  308. }
  309. });
  310. $(".exp .post .select").each(function() {
  311. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  312. {
  313. f = f + $(this).children("option:selected").val() + "-";
  314. if($(this).children("option:selected").text().match(reg))
  315. {
  316. var thistext = $(this).children("option:selected").text().split(" - ");
  317. e = e + thistext[0] + " ";
  318. }
  319. else
  320. {
  321. e = e + $(this).children("option:selected").text() + " ";
  322. }
  323. }
  324. });
  325. var checkname = "";
  326. if(index!= '4')
  327. {
  328. $(".datalist .checkbox .ckrows input:checked").each(function(){
  329. checkname = $(this).attr("name");
  330. checkid = checkid + $(this).val()+",";
  331. o = o + $(this).next('font').text()+" ";
  332. });
  333. }
  334. if(checkname == "" && index != '4')
  335. {
  336. $(".ts p").text($(".datalist .checkbox").prevAll("em").text()+"为必填项");
  337. $(".ts").show();
  338. setTimeout('$(".ts").fadeOut()', 600);
  339. return false;
  340. }
  341. else
  342. {
  343. f = checkid + "-" + f;
  344. e = e + o;
  345. }
  346. var ab = 0;
  347. $(".datalist .must").each(function() {
  348. if ($.trim($(this).val()).length == 0) {
  349. $(this).css("border", "1px solid #F66");
  350. ab = ab + 1;
  351. }
  352. });
  353. if (ab > 0) {
  354. $(".ts p").text("红框为必填项");
  355. $(".ts").show();
  356. setTimeout('$(".ts").fadeOut()', 600);
  357. return false;
  358. }
  359. var x = 0
  360. $(".datatext tr",window.parent.document).each(function() {
  361. if($(this).data("list") == f && !$(this).is(".on"))
  362. {
  363. x++;
  364. }
  365. });
  366. if(x > 0)
  367. {
  368. $(".ts p").text("已有相同信息!");
  369. $(".ts").show();
  370. setTimeout('$(".ts").fadeOut()', 700);
  371. return false;
  372. }
  373. //var ts = $(".datalist .checkbox .ckrows input:checked").length*1;
  374. var ts = $(".exp .num font").text()*1
  375. var dj = $(".exp input[name='money']").val()*1;
  376. var purchasemy = $(".exp .purchase").text()*1;
  377. var costmy = $(".exp .cost").text()*1;
  378. $(".datatext tr.on",window.parent.document).attr("data-list",f);
  379. //var xg = $(".datatext tr.on td:eq(8)").text()*1;
  380. // $("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1+((sl*dj)-xg)).toFixed(2));
  381. // et();
  382. var inch = $(".datalist .checkbox .ckrows input:checked").next("font").text();//针对单选尺寸,多选需要修改
  383. //xyxg 删除这个
  384. /**
  385. $(".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><td class='none'></td>");//xyxg 启用下面这个
  386. **/
  387. if($("input[name='mdedit']",window.parent.document).length > 0)//线下单操作界面
  388. {
  389. $(".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 val9'>0</td><td><font class='jzzd'>禁止占单</font></td>");
  390. }
  391. else
  392. {
  393. $(".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 val9'>0</td><td></td><td><font class='jzzd'>禁止占单</font></td>");//xyxg
  394. }
  395. cost();//计算成本价
  396. window.parent.custom();
  397. choicegb();
  398. pptskc("a");//匹配特殊库存
  399. };
  400. //修改数量
  401. $(".exp .lengththree .gz").click(function() {
  402. var num = $(".exp .num font").text()*1;
  403. var dj = $(".exp input[name='money']").val()*1;
  404. $(".exp .num font").text(num+1);
  405. if(dj > 0)
  406. {
  407. $(".exp .tm font").text((dj*(num+1)).toFixed(2));
  408. }
  409. });
  410. $(".exp .lengththree .gj").click(function() {
  411. var num = $(".exp .num font").text()*1;
  412. var dj = $(".exp input[name='money']").val()*1;
  413. if(num > 1)
  414. {
  415. $(".exp .num font").text(num-1)*1;
  416. if(dj > 0)
  417. {
  418. $(".exp .tm font").text((dj*(num-1)).toFixed(2));
  419. }
  420. }
  421. });
  422. //点击增加信息是增加标记
  423. $(".datatext").on('click',"tr",function() {
  424. $(".datatext tr").removeClass("on");
  425. $(this).addClass("on");
  426. });
  427. //删除信息
  428. $(".packing .expsc").click(function() {
  429. var b = 0;
  430. $(".packing .datatext .on").each(function() {
  431. b = b+1;
  432. });
  433. if (b>1)
  434. {
  435. $(".ts p").html("每次只可删除一条内容");
  436. $(".ts").show();
  437. setTimeout('$(".ts").fadeOut()', 1000);
  438. }
  439. else if(b<1)
  440. {
  441. $(".ts p").html("请选择需要删除的内容");
  442. $(".ts").show();
  443. setTimeout('$(".ts").fadeOut()', 1000);
  444. }
  445. else
  446. {
  447. // var xg = $(".datatext tr.on td:eq(8)").text()*1;
  448. //$("input[name='shouldmoney']").val(($("input[name='shouldmoney']").val()*1-xg).toFixed(2));et();
  449. $(".packing .datatext .on").remove();
  450. }
  451. costz();//计算成本价
  452. window.parent.custom();
  453. });
  454. //统一修改币种
  455. $("#currency").change(function(){
  456. var index = $(this).find("option:selected").text();
  457. var va = $(this).find("option:selected").val();
  458. $(".currency").text(index);
  459. $(".datatext tr").each(function() {
  460. //$(this).find("td:eq(9)").text(index);
  461. });
  462. });
  463. //fullorder 数据库增加currency币种 考虑更改币种是否需要ajax获取美元汇率更改金额
  464. $(".packing .expxg").click(function() {
  465. var b = 0;
  466. $(".packing .datatext .on").each(function() {
  467. b = b+1;
  468. });
  469. if (b>1)
  470. {
  471. $(".ts p").html("每次只可修改一条内容");
  472. $(".ts").show();
  473. setTimeout('$(".ts").fadeOut()', 1000);
  474. }
  475. else if(b<1)
  476. {
  477. $(".ts p").html("请选择需要修改的内容");
  478. $(".ts").show();
  479. setTimeout('$(".ts").fadeOut()', 1000);
  480. }
  481. else
  482. {
  483. $(".addful .addwp").html("<iframe id='abccc' allowtransparency='true' frameborder='0' scrolling='auto' allowfullscreen='' mozallowfullscreen='' webkitallowfullscreen='' src='/choice/2' data-focus='true'></iframe>");
  484. $( ".addwp" ).draggable({ revert: true,axis: "x" });
  485. window.setInterval("reinitIframe()", 200);
  486. $(".addful").show();
  487. }
  488. });
  489. //自动显示option
  490. function option() {
  491. var index = $(".cike select").find("option:selected").index();
  492. $(".pttab li").hide(); $(".pttab li").removeClass("post");
  493. $("."+index).show();$(".none"+index).hide();$("."+index).addClass("post");
  494. $('.pttab select option:eq(0)').prop('selected','selected');
  495. if(index == 1)
  496. {
  497. $(".pttab .a1").show();$(".pttab .a2").hide();
  498. }
  499. if(index == 4)
  500. {
  501. $(".Gift").hide();
  502. $(".none"+index).hide();
  503. }
  504. else
  505. {
  506. $(".Gift").show();
  507. $(".none4").show();
  508. }
  509. if(index == 5)
  510. {
  511. $(".Accessories").hide();
  512. }
  513. else if(index == 2)
  514. {
  515. $(".ycwigs").hide();
  516. }
  517. else if(index == 3)
  518. {
  519. $(".Extension").hide();
  520. }
  521. else if(index == 6 || index == 7)
  522. {
  523. $(".synthetic").hide();
  524. if(index == 7)
  525. {
  526. $(".synthetichair").show();
  527. }
  528. }
  529. var indexb = $(".cikeb.post select").find("option:selected").val();
  530. $(".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");
  531. if(indexb == 195)
  532. {
  533. $(".pttab .a1").show();$(".pttab .a1").addClass("post");
  534. }
  535. else if(indexb == 197)
  536. {
  537. $(".pttab .a2").show();$(".pttab .a2").addClass("post");
  538. }
  539. /**
  540. if(indexb == 0)
  541. {
  542. $(".pttab .a1").show();$(".pttab .a1").addClass("post");
  543. }
  544. else if(indexb == 1)
  545. {
  546. $(".pttab .a4").show();$(".pttab .a4").addClass("post");
  547. }
  548. else if(indexb == 2)
  549. {
  550. $(".pttab .a2").show();$(".pttab .a2").addClass("post");
  551. }
  552. else if(indexb == 4)
  553. {
  554. $(".pttab .a3").show();$(".pttab .a3").addClass("post");
  555. }
  556. **/
  557. }
  558. $("select[name='ioss']").change(function() {
  559. var io = $(this).find("option:selected").val();
  560. var gj =$("select[name='express']").find("option:selected").val();
  561. //alert(io+' - '+gj);
  562. if((gj == 66 || gj == 67) && io != 'IOSS243131124570470022786' && io != 'IOSS243131124412071487821')
  563. {
  564. layx.alert('提示','禁止更改!',null,{dialogIcon:'error'});
  565. $("select[name=ioss]").find("option[value='IOSS243131124570470022786']").prop("selected","selected");
  566. }
  567. else if((io == 'IOSS243131124570470022786' || io == 'IOSS243131124412071487821') && gj != 66 && gj != 67)
  568. {
  569. layx.alert('提示','此物流不可选择!',null,{dialogIcon:'error'});
  570. $("select[name=ioss]").find("option[value='']").prop("selected","selected");
  571. }
  572. });
  573. $("select[name='country']").change(function() {
  574. $("select[name=productdescription]").html("");
  575. $("input[name=customs]").val("0");
  576. //express() 暂时固定运费为20USD 不在查找设置价格
  577. printtype();
  578. });
  579. $("select[name='express']").change(function() {
  580. var gj = $(this).find("option:selected").val();
  581. if(gj == 2)
  582. {
  583. $(".zzldw").html("oz");
  584. }
  585. else if(gj == 66)
  586. {
  587. $(".zzldw").html("kg");
  588. $("select[name=ioss]").find("option[value='IOSS243131124570470022786']").prop("selected","selected");
  589. }
  590. else if(gj == 67)
  591. {
  592. $(".zzldw").html("kg");
  593. $("select[name=ioss]").find("option[value='IOSS243131124412071487821']").prop("selected","selected");
  594. }
  595. else
  596. {
  597. $("select[name=ioss]").find("option[value='']").prop("selected","selected");
  598. $(".zzldw").html("kg");
  599. }
  600. $("select[name=productdescription]").html("");
  601. $("input[name=customs]").val("0");
  602. eqm($(this).find("option:selected").val());
  603. //express() 暂时固定运费为20USD 不在查找设置价格
  604. //printtype();暂时不用
  605. var type = $(this).find("option:selected").data("type");
  606. $("select[name=printtype]").find("option[value='"+type+"']").prop("selected","selected");
  607. //type();
  608. $.ajax({
  609. url: "/express/read",
  610. data: "id="+gj,
  611. type: "POST",
  612. dataType: "json",
  613. success: function(a) {
  614. layx.destroy('loadId');
  615. if (a && a.success) {
  616. //$('#tipdata').attr('title', a.msg);
  617. $(".expressfa .expressfa2").html(a.msg);
  618. $(".expressfa i").show();
  619. layx.tip($(".expressfa").find(".expressfa1").html(),document.getElementById('tipdata'),'bottom');
  620. }
  621. else
  622. {
  623. //$('#tipdata').attr('title',"");
  624. $(".expressfa .expressfa2").html("");
  625. $(".expressfa i").hide();
  626. }
  627. }
  628. });
  629. });
  630. function eqm(id) {
  631. if(id == '24' || id == '31' || id == '2')//联邦的话替换签名选项
  632. {
  633. $("select[name='qm']").html('<option value="0" selected="selected">默认</option><option value="1">成人签名</option>');
  634. }
  635. else
  636. {
  637. $("select[name='qm']").html('<option value="0" selected="selected">无</option>');//<option value="1">需要</option>
  638. }
  639. if(id == '2' || id == '64')//联邦的话替换签名选项
  640. {
  641. $("select[name='js']").html('<option value="0">Ground Advantage</option><option value="1">PRIORITY</option><option value="2">EXPRESS</option>');
  642. }
  643. else
  644. {
  645. $("select[name='js']").html('<option value="0" selected="selected">无</option>');//<option value="1">需要</option>
  646. }
  647. //在这里添加服务类型为 一个是ip 一个是ficp
  648. if(id == '24' || id == '31'){
  649. $("select[name='js']").html(
  650. '<option selected="selected" value="4">FICP</option><option value="3" hidden>IP</option>'
  651. );
  652. }
  653. }
  654. $("select[name='printtype']").change(function() {
  655. $("select[name=productdescription]").html("");
  656. $("input[name=customs]").val("0");
  657. printtype();
  658. });
  659. //打印类型
  660. function printtype() {
  661. var index = $("select[name='printtype']").find("option:selected").index();
  662. if(index == 0)
  663. {
  664. var e = $("select[name=express]").find("option:selected").val();
  665. var c = $("select[name=country]").find("option:selected").val();
  666. var sjsz = 0;
  667. min = Math.ceil(10);
  668. max = Math.floor(50);
  669. sjsz = Math.floor(Math.random() * (max - min + 1)) + min;
  670. var ul = "http";
  671. var protocol = window.location.protocol;
  672. if (protocol === 'https:') {
  673. ul = ul+"s://"+"1.wepolicy.cn";
  674. } else {
  675. ul = ul+"://a"+sjsz+".wepolicy.cn";;
  676. }
  677. var customs = $.ajax({
  678. url: ul+"/fullorder/customs/",
  679. data: "e="+e+"&c="+c,
  680. type: "POST",
  681. dataType: "json",
  682. success: function(a) {
  683. if (a && a.success) {
  684. $("input[name=customs]").val(a.money);
  685. for(i=0;i<a.msg.length;i++)
  686. {
  687. $("select[name=productdescription]").append("<option value='"+a.msg[i]['id']+"'>"+a.msg[i]['title']+"</option>");
  688. }
  689. $(".productdescription").show();
  690. $(".customs").show();
  691. }
  692. /** 无快递信息配置时提示框
  693. else {
  694. $(".productdescription").hide();
  695. $(".customs").hide();
  696. $(".ts p").html(a.msg);
  697. $(".ts").fadeIn();
  698. setTimeout('$(".ts").fadeOut()', 800);
  699. }
  700. **/
  701. }
  702. });
  703. }
  704. else
  705. {
  706. $(".productdescription").hide();
  707. $(".customs").hide();
  708. }
  709. }
  710. function pptskc(pptskccs) {
  711. if(pptskccs == "a")
  712. {
  713. var w = "";var number = $("input[name='number']",window.parent.document).val();
  714. $(".datatext tr",window.parent.document).each(function() {
  715. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  716. var cc = list.split(",");
  717. w = w + cc[1] + '|';
  718. });
  719. var wl = '';
  720. $(".datatext tr",window.parent.document).each(function()
  721. {
  722. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  723. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  724. cc = list.split(",");
  725. listqc = list.replace(/\d{1,3}\,/,'');
  726. listqc = listqc.substring(0,listqc.length-1);
  727. data = listqc.split("-");
  728. var zrflx = 0;//是否有真人发类型
  729. for(i=1;i<data.length;i++)
  730. {
  731. if(i == 2)
  732. {
  733. //if(data[i] == 2090)
  734. if ((data[i] == 2090) || (data[i] == 1620))
  735. {
  736. zrflx++;
  737. t = t +data[i];
  738. fpdg = fpdg + '-' + data[i];
  739. }
  740. else
  741. {
  742. if(cc[0] != list)
  743. {
  744. t = t +data[i] + cc[0];
  745. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  746. }
  747. else
  748. {
  749. t = t +data[i];
  750. fpdg = fpdg + '-' + data[i];
  751. }
  752. }
  753. }
  754. else if(i == 3 && zrflx > 0)
  755. {
  756. if(cc[0] != list)
  757. {
  758. t = t +data[i] + cc[0];
  759. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  760. }
  761. else
  762. {
  763. t = t +data[i];
  764. fpdg = fpdg + '-' + data[i];
  765. }
  766. }
  767. else
  768. {
  769. t = t +data[i];
  770. fpdg = fpdg + '-' + data[i];
  771. }
  772. }
  773. wl = wl + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  774. })
  775. var sjsz = 0;
  776. min = Math.ceil(10);
  777. max = Math.floor(50);
  778. sjsz = Math.floor(Math.random() * (max - min + 1)) + min;
  779. var ul = "http";
  780. var protocol = window.location.protocol;
  781. if (protocol === 'https:') {
  782. ul = ul+"s://"+"1.wepolicy.cn";
  783. } else {
  784. ul = ul+"://a"+sjsz+".wepolicy.cn";;
  785. }
  786. var ppkc = $.ajax({
  787. url: ul+"/specialstock/ppkc/1",
  788. data: "data="+w+"&number="+number+"&whlabel=|"+wl,
  789. type: "POST",
  790. dataType: "json",
  791. success: function(a) {
  792. if (a && a.success)
  793. {
  794. for(i=0;i<a.list.length;i++)
  795. {
  796. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0) span",window.parent.document).remove();
  797. console.log($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)",window.parent.document).text());
  798. if($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)",window.parent.document).text().indexOf("z") != -1)
  799. {
  800. $(".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]+"'>已选择"+a.list[i][2]+"库存</span>");//特殊库存
  801. }
  802. else
  803. {
  804. $(".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]+"'>有可用"+a.list[i][2]+"库存</span>");//特殊库存
  805. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)",window.parent.document).css("color","#C3C");
  806. }
  807. }
  808. }
  809. }
  810. });
  811. }
  812. else
  813. {
  814. var w = "";var c = "";var number = $("input[name='number']").val();
  815. $(".datatext tr").each(function() {
  816. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  817. var cc = list.split(",");
  818. w = w + cc[1] + '|';
  819. c = c + list + '|';
  820. });
  821. var wl = '';
  822. $(".datatext tr").each(function() {
  823. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  824. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  825. cc = list.split(",");
  826. listqc = list.replace(/\d{1,3}\,/,'');
  827. listqc = listqc.substring(0,listqc.length-1);
  828. data = listqc.split("-");
  829. var zrflx = 0;//是否有真人发类型
  830. for(i=1;i<data.length;i++)
  831. {
  832. if(i == 2)
  833. {
  834. //if(data[i] == 2090)
  835. if ((data[i] == 2090) || (data[i] == 1620))
  836. {
  837. zrflx++;
  838. t = t +data[i];
  839. fpdg = fpdg + '-' + data[i];
  840. }
  841. else
  842. {
  843. if(cc[0] != list)
  844. {
  845. t = t +data[i] + cc[0];
  846. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  847. }
  848. else
  849. {
  850. t = t +data[i];
  851. fpdg = fpdg + '-' + data[i];
  852. }
  853. }
  854. }
  855. else if(i == 3 && zrflx > 0)
  856. {
  857. if(cc[0] != list)
  858. {
  859. t = t +data[i] + cc[0];
  860. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  861. }
  862. else
  863. {
  864. t = t +data[i];
  865. fpdg = fpdg + '-' + data[i];
  866. }
  867. }
  868. else
  869. {
  870. t = t +data[i];
  871. fpdg = fpdg + '-' + data[i];
  872. }
  873. }
  874. wl = wl + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  875. })
  876. var ppkc = $.ajax({
  877. url: "/specialstock/ppkc/",
  878. data: "data="+w+"&number="+number+"&whlabel=|"+wl,
  879. type: "POST",
  880. dataType: "json",
  881. success: function(a) {
  882. if (a && a.success)
  883. {
  884. for(i=0;i<a.list.length;i++)
  885. {
  886. if($(".datatext tr:eq("+a.list[i][0]+") td:eq(9)").text().indexOf("z") != -1)
  887. {
  888. $(".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]+"'>已选择"+a.list[i][2]+"库存</span>");//特殊库存
  889. }
  890. else
  891. {
  892. $(".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]+"'>有可用"+a.list[i][2]+"库存</span>");//特殊库存
  893. $(".datatext tr:eq("+a.list[i][0]+") td:eq(0)").css("color","#C3C");
  894. }
  895. }
  896. }
  897. }
  898. });
  899. var sjsz = 0;
  900. min = Math.ceil(10);
  901. max = Math.floor(50);
  902. sjsz = Math.floor(Math.random() * (max - min + 1)) + min;
  903. var ul = "http";
  904. var protocol = window.location.protocol;
  905. if (protocol === 'https:') {
  906. ul = ul+"s://"+"1.wepolicy.cn";
  907. } else {
  908. ul = ul+"://a"+sjsz+".wepolicy.cn";;
  909. }
  910. //预先判断库存仓
  911. var kcpd = $.ajax({
  912. url: ul+"/warehouse/kcpd/",
  913. data: "data="+c+"&shop="+$("input[name='shop']").val()+"&warehouse="+$("select[name=warehouse]").find("option:selected").val()+"&whlabel="+$("input[name='whlabel']").val()+"&number="+$("input[name='number']").val(),
  914. type: "POST",
  915. dataType: "json",
  916. success: function(a) {
  917. if (a && a.success)
  918. {
  919. $(".packing").append("<p style='padding-top:10px;text-align: center;color:#F00'>"+a.msg+"</p>");
  920. }
  921. }
  922. });
  923. }
  924. }
  925. $(".datatext").on('click',"tr span",function() {
  926. var btnTarget= document.getElementById($(this).attr("id"));
  927. var xzid = $(this).parents("tr").find("td:eq(9)").text();
  928. var winform = layx.iframe('float-bottom','可选择的产品','/specialstock/list/'+$(this).data("id")+'/'+$("input[name=number]").val()+"/"+xzid,{
  929. floatTarget:btnTarget, // 被吸附的DOM对象 特殊/现货产品窗口
  930. shadable:true,
  931. escKey:false,
  932. control:false,
  933. icon:false,
  934. width:870,
  935. height:300,
  936. alwaysOnTop:true,
  937. floatDirection: 'bottom', // 设置方向
  938. event:{
  939. ondestroy: {
  940. before: function (layxWindow, winform, params, inside,escKey) {
  941. if(inside===false){
  942. layx.visual(winform.id,false); // 隐藏窗口
  943. layx.updateFloatWinPosition(winform.id);
  944. return false;
  945. }
  946. }
  947. },
  948. onexist: function (layxWindow, winform) {
  949. layx.visual(winform.id,true); // 显示窗口
  950. }
  951. }
  952. });
  953. });
  954. /**
  955. $("select[name='warehouse']").change(function() {
  956. type();
  957. });
  958. function express() {
  959. var e = $("select[name=express]").find("option:selected").val();
  960. var c = $("select[name=country]").find("option:selected").val();
  961. $.ajax({
  962. url: "/fullorder/express/",
  963. data: "e="+e+"&c="+c,
  964. type: "POST",
  965. dataType: "json",
  966. success: function(a) {
  967. if (a && a.success) {
  968. $("input[name=expressmoney]").val(a.money);//?这里或许需要根据币种美元转换
  969. } else {
  970. $("input[name=expressmoney]").val("0.00");
  971. }
  972. }
  973. });
  974. }
  975. function type() {
  976. var t = $("select[name=express]").find("option:selected").val();
  977. var c = $("select[name=warehouse]").find("option:selected").val();
  978. $.ajax({
  979. url: "/fullorder/expresstype/",
  980. data: "id="+t,
  981. type: "POST",
  982. dataType: "json",
  983. success: function(a) {
  984. if (a && a.success) {
  985. $("select[name=printtype]").find("option[value='"+a.msg+"']").prop("selected","selected");
  986. }
  987. }
  988. });
  989. }
  990. **/
  991. $(".lengththree input[name='money']").bind("change",function(){
  992. var ma= $(this).val();
  993. var n = $(".exp .num font").text()*1;
  994. $(".exp .tm font").html((ma*n).toFixed(2));
  995. });
  996. //整体提交数据
  997. $(".fullorderdata").click(function() {
  998. $(".addful").hide();
  999. var f = "";
  1000. var e = "";
  1001. var w = "";
  1002. var fpcount = "";
  1003. $(".need .select").each(function() {
  1004. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  1005. });
  1006. $(".need input:text").each(function() {
  1007. str2 = $(this).val().replace(/\</g,"&lt;");
  1008. str2 = str2.replace(/\>/g,"&gt;");
  1009. str2 = str2.replace(/\+/g,"%2B");
  1010. str2 = str2.replace(/&/g,"%26");
  1011. f = f + $(this).attr("name") + "=" + str2 + "&";
  1012. });
  1013. $(".need input:hidden").each(function() {
  1014. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  1015. });
  1016. $(".need textarea").each(function() {
  1017. str2 = $(this).val().replace(/\</g,"&lt;");
  1018. str2 = str2.replace(/\>/g,"&gt;");
  1019. str2 = str2.replace(/\+/g,"%2B");
  1020. str2 = str2.replace(/&/g,"%26");
  1021. f = f + $(this).attr("name") + "=" + encodeURI(str2) + "&";
  1022. });
  1023. var tdweight = 0;
  1024. $(".datatext tr").each(function() {
  1025. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  1026. var td0 = $(this).find("td:eq(0)").text().replace(/\+/g,"%2B");
  1027. var td0 = td0.replace(/&/g,"%26");
  1028. var td8 = '';
  1029. if($(this).find("td:eq(8)").length > 0)
  1030. {
  1031. if($(this).find("td:eq(8)").text() == '')
  1032. {
  1033. td8 = '0';
  1034. }
  1035. else
  1036. {
  1037. td8 = $(this).find("td:eq(8)").text();
  1038. }
  1039. }
  1040. else
  1041. {
  1042. td8 = '0';
  1043. }
  1044. 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() + ";";
  1045. tdweight = tdweight + td8*1;
  1046. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  1047. cc = list.split(",");
  1048. listqc = list.replace(/\d{1,3}\,/,'');
  1049. listqc = listqc.substring(0,listqc.length-1);
  1050. data = listqc.split("-");
  1051. var zrflx = 0;//是否有真人发类型
  1052. for(i=1;i<data.length;i++)
  1053. {
  1054. if(i == 2)
  1055. {
  1056. //if(data[i] == 2090)
  1057. if ((data[i] == 2090) || (data[i] == 1620))
  1058. {
  1059. zrflx++;
  1060. t = t +data[i];
  1061. fpdg = fpdg + '-' + data[i];
  1062. }
  1063. else
  1064. {
  1065. if(cc[0] != list)
  1066. {
  1067. t = t +data[i] + cc[0];
  1068. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  1069. }
  1070. else
  1071. {
  1072. t = t +data[i];
  1073. fpdg = fpdg + '-' + data[i];
  1074. }
  1075. }
  1076. }
  1077. else if(i == 3 && zrflx > 0)
  1078. {
  1079. if(cc[0] != list)
  1080. {
  1081. t = t +data[i] + cc[0];
  1082. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  1083. }
  1084. else
  1085. {
  1086. t = t +data[i];
  1087. fpdg = fpdg + '-' + data[i];
  1088. }
  1089. }
  1090. else
  1091. {
  1092. t = t +data[i];
  1093. fpdg = fpdg + '-' + data[i];
  1094. }
  1095. }
  1096. if(t == '')
  1097. {
  1098. $(".ts p").text("商品信息错误!");
  1099. $(".ts").show();
  1100. setTimeout('$(".ts").fadeOut()', 800);
  1101. $.exit();
  1102. }
  1103. if($(this).find("td:eq(1)").text() < 1)
  1104. {
  1105. $(".ts p").text("商品数量错误!");
  1106. $(".ts").show();
  1107. setTimeout('$(".ts").fadeOut()', 800);
  1108. $.exit();
  1109. }
  1110. w = w + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  1111. fpcount = fpcount + fpdg + '-|';
  1112. });
  1113. f = f + "jweight=" + tdweight + "&";
  1114. e = e.replace(/(有可用特殊库存|已选择特殊库存|有可用现货库存|已选择现货库存|已选择库存)/g,'');
  1115. f = f + "whlabel=|" + w + "&fpdata=" + encodeURI(e) + "&";
  1116. f = f + "fpcount=" + fpcount + "&";
  1117. f = f + "budget=" + $(".budget").text() + "&";
  1118. var ab = 0;
  1119. $(".need .must").each(function() {
  1120. if ($.trim($(this).val()).length == 0) {
  1121. $(this).css("border", "1px solid #F66");
  1122. ab = ab + 1;
  1123. }
  1124. });
  1125. if (ab > 0) {
  1126. $(".ts p").text("红框为必填项");
  1127. $(".ts").show();
  1128. setTimeout('$(".ts").fadeOut()', 600);
  1129. return false;
  1130. }
  1131. //限制必须提交产品详细列表
  1132. if (e == '') {
  1133. $(".ts p").text("必须添加订单详细信息!");
  1134. $(".ts").show();
  1135. setTimeout('$(".ts").fadeOut()', 800);
  1136. return false;
  1137. }
  1138. else
  1139. {
  1140. /**
  1141. if($("select[name=warehouse]").find("option:selected").val() == "5" || $("select[name=warehouse]").find("option:selected").val() == "6")
  1142. {
  1143. var yzdata = {
  1144. warehouse: $("select[name=warehouse]").find("option:selected").val(),
  1145. shop: $("input[name=shop]").val(),
  1146. id: $("input[name=id]").val(),
  1147. whlabel: "|" + w
  1148. };
  1149. $.ajax({
  1150. url: "/ck/kcyz/",//xyxg 修改为/ck/kcyz/
  1151. data: yzdata,
  1152. type: "POST",
  1153. dataType: "json",
  1154. success: function(a) {
  1155. if (a && a.success) {
  1156. zttj(f);
  1157. } else {
  1158. if(a.t == 1)
  1159. {
  1160. layx.alert('错误',a.msg,function(id,button){
  1161. },{dialogIcon:'error'});
  1162. }
  1163. else
  1164. {
  1165. layx.alert('错误',a.msg,function(id,button){
  1166. },{dialogIcon:'error'});
  1167. for(i=0;i<a.error.length;i++)
  1168. {
  1169. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1170. }
  1171. }
  1172. }
  1173. }
  1174. });
  1175. }
  1176. else
  1177. {
  1178. zttj(f);
  1179. }
  1180. **/
  1181. zttj(f);
  1182. }
  1183. });
  1184. function zttj(f){
  1185. layx.load('loadId','数据提交中,请稍后');
  1186. $.ajax({
  1187. url: addedit,
  1188. data: f,
  1189. type: "POST",
  1190. dataType: "json",
  1191. timeout: 30000,
  1192. success: function(a) {
  1193. layx.destroy('loadId');
  1194. if (a && a.success) {
  1195. $(".express p:eq(0)").html(a.msg);
  1196. $(".express p:eq(1)").html("<font class='fh' data-id='"+a.id+"'>确 定</font>");
  1197. $(".express").show();
  1198. } else {
  1199. var old = a.oldwhlabel;
  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()', 1000);
  1216. }
  1217. }
  1218. },
  1219. error: function(textStatus) {
  1220. layx.destroy('loadId');
  1221. layx.alert('错误', '提交超时,请重试', function(id, button) {
  1222. $(".search span").click();
  1223. }, { dialogIcon: 'error' });
  1224. },
  1225. });
  1226. }
  1227. //关联总金额换算穿预计到帐金额
  1228. $("input[name='shouldmoney']").bind("change",function(){
  1229. et();
  1230. });
  1231. function et(){
  1232. var ma= $("input[name='shouldmoney']").val();
  1233. if(ma > 0)
  1234. {
  1235. var n= $("input[name='et']").val();
  1236. $(".currencymoney").text(eval(ma+n).toFixed(2));
  1237. }
  1238. else
  1239. {
  1240. $(".currencymoney").text(0);
  1241. }
  1242. }
  1243. //计算成本金额,子页面用
  1244. function cost(){
  1245. var purchasemoney = 0;var costmoney = 0;
  1246. $(".datatext tr",window.parent.document).each(function() {
  1247. purchasemoney = purchasemoney+$(this).find("td:eq(6)").text()*1;
  1248. costmoney = costmoney+$(this).find("td:eq(7)").text()*1;
  1249. });
  1250. $("input[name='purchase']",window.parent.document).val(purchasemoney.toFixed(2));
  1251. $("input[name='cost']",window.parent.document).val(costmoney.toFixed(2));
  1252. //$("li b .zlr").html(($("li .budget").html()*1-money).toFixed(2));//总利润
  1253. }
  1254. //计算成本金额,自页面用
  1255. function costz(){
  1256. var purchasemoney = 0;var costmoney = 0;
  1257. $(".datatext tr").each(function() {
  1258. purchasemoney = purchasemoney+$(this).find("td:eq(6)").text()*1;
  1259. costmoney = costmoney+$(this).find("td:eq(7)").text()*1;
  1260. });
  1261. $("input[name='purchase']").val(purchasemoney.toFixed(2));
  1262. $("input[name='cost']").val(costmoney.toFixed(2));
  1263. //$("li b .zlr").html(($("li .budget").html()*1-money).toFixed(2));//总利润
  1264. }
  1265. $(".power").click(function() {
  1266. layx.confirm('重置选择','确定重置此订单?',function(id){
  1267. $.ajax({
  1268. url: fh+"/power/",
  1269. data: "id="+$("input[name='id']").val(),
  1270. type: "POST",
  1271. dataType: "json",
  1272. success: function(a) {
  1273. layx.destroy(id);
  1274. if (a && a.success) {
  1275. $(".express p:eq(0)").html(a.msg);
  1276. $(".express p:eq(1)").html("<font class='fh'>确 定</font>");
  1277. $(".express").show();
  1278. } else {
  1279. $(".ts p").html(a.msg);
  1280. $(".ts").fadeIn();
  1281. setTimeout('$(".ts").fadeOut()', 800);
  1282. }
  1283. }
  1284. });
  1285. layx.destroy(id);
  1286. },{shadable:0.6,dialogIcon:'help'});
  1287. });
  1288. //验证库存
  1289. $("select[name=warehouse]").change(function(){
  1290. var czw = $(this).find("option:selected").val();
  1291. cze = $(this).find("option:selected").data("e");
  1292. $.ajax({
  1293. url: "/warehouse/list/",
  1294. data: "id="+czw,
  1295. type: "POST",
  1296. dataType: "json",
  1297. success: function(a) {
  1298. if (a && a.success) {
  1299. if(a.msg == "1")
  1300. {
  1301. var w = "";
  1302. $(".datatext tr").each(function() {
  1303. var cc = "";var listqc = "";var data = "";var t = "";
  1304. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  1305. cc = list.split(",");
  1306. listqc = list.replace(/\d{1,3}\,/,'');
  1307. listqc = listqc.substring(0,listqc.length-1);
  1308. data = listqc.split("-");
  1309. var zrflx = 0;//是否有真人发类型
  1310. for(i=1;i<data.length;i++)
  1311. {
  1312. if(i == 2)
  1313. {
  1314. if((data[i] == 2090)||(data[i] == 1620))
  1315. {
  1316. zrflx++;
  1317. t = t +data[i];
  1318. }
  1319. else
  1320. {
  1321. if(cc[0] != list)
  1322. {
  1323. t = t +data[i] + cc[0];
  1324. }
  1325. else
  1326. {
  1327. t = t +data[i];
  1328. }
  1329. }
  1330. }
  1331. else if(i == 3 && zrflx > 0)
  1332. {
  1333. if(cc[0] != list)
  1334. {
  1335. t = t +data[i] + cc[0];
  1336. }
  1337. else
  1338. {
  1339. t = t +data[i];
  1340. }
  1341. }
  1342. else
  1343. {
  1344. t = t +data[i];
  1345. }
  1346. }
  1347. w = w + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  1348. });
  1349. //alert(w)
  1350. var yzdata = {
  1351. warehouse: czw,
  1352. shop: $("input[name=shop]").val(),
  1353. id: $("input[name=id]").val(),
  1354. number: $("input[name=number]").val(),
  1355. state: $("select[name=state]").find("option:selected").val(),
  1356. whlabel: "|" + w
  1357. };
  1358. $.ajax({
  1359. url: "/ck/kcyz/",//xyxg 修改为/ck/kcyz/
  1360. data: yzdata,
  1361. type: "POST",
  1362. dataType: "json",
  1363. success: function(a) {
  1364. if (a && a.success) {
  1365. if(cze != 0)//更改为默认快递
  1366. {
  1367. $('select[name=express]').find("option").each(function(){
  1368. if($(this).val() == cze){
  1369. $(this).prop('selected','selected');
  1370. }
  1371. });
  1372. usps();
  1373. }
  1374. } else {
  1375. $("select[name=warehouse] option:eq(0)").prop('selected','selected');
  1376. var express = $("select[name=warehouse]").find("option:selected").data("e");
  1377. $("select[name=express]").find("option[value='"+express+"']").prop("selected","selected");
  1378. eqm(express);
  1379. if(a.t == 1)
  1380. {
  1381. layx.alert('错误',a.msg,function(id,button){
  1382. },{dialogIcon:'error'});
  1383. }
  1384. else
  1385. {
  1386. layx.alert('错误',a.msg,function(id,button){
  1387. },{dialogIcon:'error'});
  1388. for(i=0;i<a.error.length;i++)
  1389. {
  1390. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1391. }
  1392. }
  1393. }
  1394. }
  1395. });
  1396. }
  1397. else
  1398. {
  1399. if(cze != 0)//更改为默认快递
  1400. {
  1401. $('select[name=express]').find("option").each(function(){
  1402. if($(this).val() == cze){
  1403. $(this).prop('selected','selected');
  1404. }
  1405. });
  1406. usps();
  1407. }
  1408. }
  1409. } else {
  1410. $(".ts p").html(a.msg);
  1411. $(".ts").fadeIn();
  1412. setTimeout('$(".ts").fadeOut()', 800);
  1413. }
  1414. }
  1415. });
  1416. });
  1417. $("select[name='express']").change(function() { //usps 显示 签名和服务类型
  1418. usps()
  1419. })
  1420. function usps() {
  1421. var nr = $("select[name='express']").find("option:selected").val();
  1422. console.log(nr)
  1423. if(nr == "2")
  1424. {
  1425. $(".usps").show();
  1426. $(".qm").show();
  1427. }
  1428. else if((nr == '24') || (nr == '31')){
  1429. $(".usps").show();
  1430. $(".qm").show();
  1431. }
  1432. else
  1433. {
  1434. $(".usps").hide();
  1435. $(".qm").hide();
  1436. }
  1437. if(nr == "24")
  1438. {
  1439. $(".qm").show();
  1440. }
  1441. else
  1442. {
  1443. $(".qm").hide();
  1444. }
  1445. }
  1446. $(".button .return").click(function() {
  1447. layx.confirm('操作退货','确定生成《退货》信息?',function(id){
  1448. layx.load('loadId','数据提交中,请稍后');
  1449. $.ajax({
  1450. url: fh+"/return/",
  1451. data: "orderinfo="+$(".orderinfo").text(),
  1452. type: "POST",
  1453. dataType: "json",
  1454. success: function(a) {
  1455. layx.destroy('loadId');
  1456. if (a && a.success) {
  1457. layx.alert('完成',a.msg,function(id,button){
  1458. },{dialogIcon:'success'});
  1459. $("li .return").html(a.data);
  1460. } else {
  1461. layx.alert('错误',a.msg,function(id,button){
  1462. },{dialogIcon:'error'});
  1463. }
  1464. }
  1465. });
  1466. layx.destroy(id);
  1467. },{shadable:0.6,dialogIcon:'help'});
  1468. });
  1469. $(".button .clearreturn").click(function() {
  1470. layx.confirm('清除记录','确定清除此单退货记录?',function(id){
  1471. $.ajax({
  1472. url: fh+"/clearreturn/",
  1473. data: "orderinfo="+$(".orderinfo").text(),
  1474. type: "POST",
  1475. dataType: "json",
  1476. success: function(a) {
  1477. layx.destroy(id);
  1478. if (a && a.success) {
  1479. layx.alert('完成',a.msg,function(id,button){
  1480. },{dialogIcon:'success'});
  1481. $(".clearreturnedit1").html("已出库");
  1482. $(".clearreturnedit2").html("<em>允许发货:</em><b>允许出库</b>");
  1483. } else {
  1484. layx.alert('错误',a.msg,function(id,button){
  1485. },{dialogIcon:'error'});
  1486. }
  1487. }
  1488. });
  1489. layx.destroy(id);
  1490. },{shadable:0.6,dialogIcon:'help'});
  1491. });
  1492. $(".bcbz").click(function() {
  1493. var f = "";
  1494. var e = "";
  1495. var w = "";
  1496. var fpcount = "";
  1497. $(".need .select").each(function() {
  1498. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  1499. });
  1500. $(".need input:text").each(function() {
  1501. var str = $(this).val().replace(/\+/g,"%2B");
  1502. var str = str.replace(/&/g,"%26");
  1503. f = f + $(this).attr("name") + "=" + str + "&";
  1504. });
  1505. $(".need input:hidden").each(function() {
  1506. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  1507. });
  1508. $(".need textarea").each(function() {
  1509. var str2 = $(this).val().replace(/\+/g,"%2B");
  1510. f = f + $(this).attr("name") + "=" + str2 + "&";
  1511. });
  1512. var tdweight = 0;
  1513. $(".datatext tr").each(function() {
  1514. var cc = "";var listqc = "";var data = "";var t = "";var fpdg = "";
  1515. var td0 = $(this).find("td:eq(0)").text().replace(/\+/g,"%2B");
  1516. var td0 = td0.replace(/&/g,"%26");
  1517. var td8 = '';
  1518. if($(this).find("td:eq(8)").length > 0)
  1519. {
  1520. if($(this).find("td:eq(8)").text() == '')
  1521. {
  1522. td8 = '0';
  1523. }
  1524. else
  1525. {
  1526. td8 = $(this).find("td:eq(8)").text();
  1527. }
  1528. }
  1529. else
  1530. {
  1531. td8 = '0';
  1532. }
  1533. 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() + ";";
  1534. tdweight = tdweight + td8*1;
  1535. var list = $(this).attr("data-list").replace(/\-(0|163|164|165|166)\-/,'-');
  1536. cc = list.split(",");
  1537. listqc = list.replace(/\d{1,3}\,/,'');
  1538. listqc = listqc.substring(0,listqc.length-1);
  1539. data = listqc.split("-");
  1540. var zrflx = 0;//是否有真人发类型
  1541. for(i=1;i<data.length;i++)
  1542. {
  1543. if(i == 2)
  1544. {
  1545. //if(data[i] == 2090)
  1546. if ((data[i] == 2090) || (data[i] == 1620))
  1547. {
  1548. zrflx++;
  1549. t = t +data[i];
  1550. fpdg = fpdg + '-' + data[i];
  1551. }
  1552. else
  1553. {
  1554. if(cc[0] != list)
  1555. {
  1556. t = t +data[i] + cc[0];
  1557. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  1558. }
  1559. else
  1560. {
  1561. t = t +data[i];
  1562. fpdg = fpdg + '-' + data[i];
  1563. }
  1564. }
  1565. }
  1566. else if(i == 3 && zrflx > 0)
  1567. {
  1568. if(cc[0] != list)
  1569. {
  1570. t = t +data[i] + cc[0];
  1571. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  1572. }
  1573. else
  1574. {
  1575. t = t +data[i];
  1576. fpdg = fpdg + '-' + data[i];
  1577. }
  1578. }
  1579. else
  1580. {
  1581. t = t +data[i];
  1582. fpdg = fpdg + '-' + data[i];
  1583. }
  1584. }
  1585. w = w + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
  1586. fpcount = fpcount + fpdg + '-|';
  1587. });
  1588. f = f + "jweight=" + tdweight + "&";
  1589. e = e.replace(/(有可用特殊库存|已选择特殊库存|有可用现货库存|已选择现货库存|已选择库存)/g,'');
  1590. f = f + "whlabel=|" + w + "&fpdata=" + encodeURI(e) + "&";
  1591. f = f + "fpcount=" + fpcount + "&";
  1592. f = f + "budget=" + $(".budget").text() + "&";
  1593. /**
  1594. if($("select[name=warehouse]").find("option:selected").val() == "5" || $("select[name=warehouse]").find("option:selected").val() == "6")
  1595. {
  1596. var yzdata = {
  1597. warehouse: $("select[name=warehouse]").find("option:selected").val(),
  1598. shop: $("input[name=shop]").val(),
  1599. id: $("input[name=id]").val(),
  1600. whlabel: "|" + w
  1601. };
  1602. $.ajax({
  1603. url: "/ck/kcyz/",//xyxg 修改为/ck/kcyz/
  1604. data: yzdata,
  1605. type: "POST",
  1606. dataType: "json",
  1607. success: function(a) {
  1608. if (a && a.success) {
  1609. bcbz(f);
  1610. } else {
  1611. if(a.t == 1)
  1612. {
  1613. layx.alert('错误',a.msg,function(id,button){
  1614. },{dialogIcon:'error'});
  1615. }
  1616. else
  1617. {
  1618. layx.alert('错误',a.msg,function(id,button){
  1619. },{dialogIcon:'error'});
  1620. for(i=0;i<a.error.length;i++)
  1621. {
  1622. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1623. }
  1624. }
  1625. }
  1626. }
  1627. });
  1628. }
  1629. else
  1630. {
  1631. bcbz(f);
  1632. }
  1633. **/
  1634. bcbz(f);
  1635. });
  1636. function bcbz(f) {
  1637. layx.load('loadId','数据提交中,请稍后');
  1638. $.ajax({
  1639. url: fh+"/bcbz/",
  1640. data: f,
  1641. type: "POST",
  1642. dataType: "json",
  1643. timeout: 9000,
  1644. success: function(a) {
  1645. layx.destroy('loadId');
  1646. if (a && a.success) {
  1647. $(".express p:eq(0)").html(a.msg);
  1648. $(".express p:eq(1)").html("<font class='fh' data-id='"+a.id+"'>确 定</font>");
  1649. $(".express").show();
  1650. } else {
  1651. $("select[name=warehouse] option:eq(0)").prop('selected','selected');
  1652. if(a.t == 2)
  1653. {
  1654. layx.alert('错误',a.msg,function(id,button){
  1655. },{dialogIcon:'error'});
  1656. for(i=0;i<a.error.length;i++)
  1657. {
  1658. $(".datatext tr:eq("+a.error[i]+") td:eq(0)").css("color","red");
  1659. }
  1660. }
  1661. else
  1662. {
  1663. layx.destroy('loadId');
  1664. $(".ts p").html(a.msg);
  1665. $(".ts").fadeIn();
  1666. setTimeout('$(".ts").fadeOut()', 600);
  1667. }
  1668. }
  1669. },
  1670. error: function(textStatus) {
  1671. layx.destroy('loadId');
  1672. layx.alert('错误', '请检查数据再重试', function(id, button) {
  1673. $(".search span").click();
  1674. }, { dialogIcon: 'error' });
  1675. },
  1676. });
  1677. };
  1678. $(".datatext").on('click',".jzzd",function() {
  1679. $(this).parent().siblings(".val9").html("DNOTO");
  1680. $(this).parent().html('已禁止占单<br>保存后生效');
  1681. });
  1682. $(".datatext .jzzd").click(function() {
  1683. $(this).parent().siblings(".val9").html("DNOTO");
  1684. $(this).parent().html('已禁止占单<br>保存后生效');
  1685. });
  1686. $(".datatext .yxzd").click(function() {
  1687. $(this).parent().siblings(".val9").html("0");
  1688. $(this).parent().html('已允许占单<br>保存后生效');
  1689. });
  1690. $(".epod").click(function() {
  1691. layx.load('loadId','获取中,如果未弹出PDF,请检查浏览器拦截');
  1692. $.ajax({
  1693. url: fh+'/epod',
  1694. data: 'number='+$("input[name='number']").val(),
  1695. type: "POST",
  1696. dataType: "json",
  1697. success: function(a) {
  1698. layx.destroy('loadId');
  1699. if (a && a.success) {
  1700. window.open(a.msg);
  1701. } else {
  1702. layx.alert('错误',a.msg,function(id,button){
  1703. },{dialogIcon:'error'});
  1704. }
  1705. }
  1706. });
  1707. });
  1708. $(".button .refund").click(function() {
  1709. var f = $(this).data("f");
  1710. layx.confirm('申请退款','是否确定提交《退款》申请?',function(id){
  1711. layx.load('loadId','数据提交中,请稍后');
  1712. $.ajax({
  1713. url: "/returncw/return",
  1714. data: "number="+$("input[name=number]").val()+"&f="+f,
  1715. type: "POST",
  1716. dataType: "json",
  1717. success: function(a) {
  1718. layx.destroy('loadId');
  1719. if (a && a.success) {
  1720. layx.alert('完成',a.msg,function(id,button){
  1721. },{dialogIcon:'success'});
  1722. $("li .return").html(a.data);
  1723. } else {
  1724. layx.alert('错误',a.msg,function(id,button){
  1725. },{dialogIcon:'error'});
  1726. }
  1727. }
  1728. });
  1729. layx.destroy(id);
  1730. },{shadable:0.6,dialogIcon:'help'});
  1731. });
  1732. $(".button .ddcf").click(function() {
  1733. var f = $(this).data("f");
  1734. layx.confirm('订单拆分','是否确定拆分 '+$("input[name=number]").val(),function(id){
  1735. layx.load('loadId','数据提交中,请稍后');
  1736. $.ajax({
  1737. url: "/"+f+"/ddcf",
  1738. data: "number="+$("input[name=number]").val(),
  1739. type: "POST",
  1740. dataType: "json",
  1741. success: function(a) {
  1742. layx.destroy('loadId');
  1743. if (a && a.success) {
  1744. layx.alert('完成',a.msg,function(id,button){
  1745. },{dialogIcon:'success'});
  1746. $("li .return").html(a.data);
  1747. } else {
  1748. layx.alert('错误',a.msg,function(id,button){
  1749. },{dialogIcon:'error'});
  1750. }
  1751. }
  1752. });
  1753. layx.destroy(id);
  1754. },{shadable:0.6,dialogIcon:'help'});
  1755. });