You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

698 lines
23 KiB

  1. //补单
  2. var first_load=1;
  3. var line_id = 450894;
  4. var run_date = getDateTime(0);
  5. var urlstr = base_api + 'orderManager/index.php';
  6. var listHTML = ''
  7. var newstr = base_api + 'index.php';
  8. var order_id = '';
  9. var old_data = [];
  10. var last_supplier_id='';
  11. window.onload = function () {
  12. $('#Wdate2').val(run_date);
  13. listHTML = $('#list').html();
  14. //修改订单时,先通过order_id获取run_date和line_id
  15. console.log(first_load);
  16. //###针对补单载入线路列表并默认选中第一个线路###//
  17. $.ajax({
  18. url: newstr,
  19. data: {
  20. tp: 'order_groupOrder_getGroupLine',
  21. },
  22. type: "post",
  23. dataType: "json",
  24. async: false,
  25. success: function (data) {
  26. if (data.code == "0") {
  27. line_id = data.list[1]['line_id'];
  28. $('#hotel').val(data.list[0]['tavern_stay']);
  29. $('#substitute_add').val(data.list[0]['add_line_price']);
  30. var sel_text = data.list[0]['terrace'];
  31. $(".if_online").find('option[text='+sel_text+']').attr("selected",true);
  32. replaceLineInfo(data);
  33. loadCar();
  34. } else {
  35. ZZAlertInfo(data.info);
  36. }
  37. },
  38. error: function (e) {
  39. ZZLog(e);
  40. }
  41. });
  42. //###//
  43. reloadData();//根据line_id,run_date载入渠道票种信息
  44. //载入时如果是修改订单,则重置订单值
  45. if (order_id != '') {
  46. initEditData();
  47. }
  48. //这里给上车站点的空间生成input加一个onblur事件
  49. $('.start_sta input').blur(function () {
  50. reset_sta()
  51. });
  52. }
  53. //combo-select(bug)插件如果输入项没有对应值,则将显示值设置为厦门未知酒店
  54. function reset_sta() {
  55. if ($("#start_area").val() == '11964') {
  56. var name = $("#start_area").find("option[value='11964']").text();
  57. $('.start_sta input:eq(0)').val(name);
  58. }
  59. }
  60. //选择日期
  61. function selectDate() {
  62. run_date = $('#Wdate2').val();
  63. first_load=first_load-1;
  64. console.log(first_load);
  65. loadCar();
  66. // reloadData();
  67. }
  68. //刷新车次日期
  69. function refreshDate() {
  70. $('#theday').text(run_date);
  71. $('#nextday').text(after(run_date));
  72. }
  73. //根据line_id,run_date得到车次信息(包括一日游,两个车;双日游三个车)
  74. function loadCar() {
  75. refreshDate();
  76. var data = {
  77. tp: 'order_groupOrder_getDayCar',
  78. run_date: run_date,
  79. line_id: line_id
  80. };
  81. ZZLog(data);
  82. $.ajax({
  83. url: newstr,
  84. data: data,
  85. type: "post",
  86. dataType: "json",
  87. async: false,
  88. success: function (data) {
  89. if (data.code == "0") {
  90. console.log(data);
  91. replaceCar(data.list);
  92. } else {
  93. ZZAlertInfo(data.info);
  94. run_date = $('#Wdate2').val();
  95. }
  96. },
  97. error: function (e) {
  98. ZZLog(e);
  99. }
  100. });
  101. }
  102. //替换车次信息选项
  103. function replaceCar(data) {
  104. var bus11=data.bus11;
  105. var bus12=data.bus12;
  106. var bus22=data.bus22;
  107. //console.log(bus22);
  108. //处理run_id
  109. if(bus22.length!=0){
  110. $('#bus2').show();
  111. $('#bus22_run_id').val(bus22[0]['run_id']);
  112. $('#bus22_run_date').val(bus22[0]['run_date']);
  113. }else{
  114. $('#bus2').hide();
  115. $('#bus22_run_id').val(0);
  116. $('#bus22_run_date').val(0);
  117. }
  118. if(bus11.length!=0){
  119. $('#bus11_run_id').val(bus11[0]['run_id']);
  120. $('#bus11_run_date').val(bus11[0]['run_date']);
  121. }else{
  122. $('#bus11_run_id').val(0);
  123. $('#bus11_run_date').val(0);
  124. }
  125. if(bus12.length!=0){
  126. $('#bus12_run_id').val(bus12[0]['run_id']);
  127. $('#bus12_run_date').val(bus12[0]['run_date']);
  128. }else{
  129. $('#bus12_run_id').val(0);
  130. $('#bus12_run_date').val(0);
  131. }
  132. //处理有数据的列表信息
  133. //当日接驳
  134. var temp11 = '<option value="0">若无接驳段请勿选择</option>';
  135. for(var i = 0, j = bus11.length; i < j; i++) {
  136. temp11 += '<option value="' + bus11[i].run_bus_id + '">' +bus11[i].run_bus_id+' | '+ bus11[i].send_bus_no +' | 司机:'+bus11[i].send_driver_name+' | 导游:'+bus11[i].send_tour_guide_name+ '</option>';
  137. }
  138. //当日直通
  139. var temp12 = '<option value="0">请选择</option>';
  140. for(var i = 0, j = bus12.length; i < j; i++) {
  141. temp12 += '<option value="' + bus12[i].run_bus_id + '">' +bus12[i].run_bus_id+' | '+ bus12[i].send_bus_no +' | 司机:'+bus12[i].send_driver_name+' | 导游:'+bus12[i].send_tour_guide_name+ '</option>';
  142. }
  143. //次日直通
  144. var temp22 = '<option value="0">请选择</option>';
  145. for(var i = 0, j = bus22.length; i < j; i++) {
  146. temp22 += '<option value="' + bus22[i].run_bus_id + '">' +bus22[i].run_bus_id+' | '+ bus22[i].send_bus_no +' | 司机:'+bus22[i].send_driver_name+' | 导游:'+bus22[i].send_tour_guide_name+ '</option>';
  147. }
  148. //alert(temp11);
  149. $("#bus11").html(temp11);
  150. $("#bus12").html(temp12);
  151. $("#bus22").html(temp22);
  152. }
  153. //页面加载数据
  154. function reloadData() {
  155. var data = {
  156. tp: 'groupOrder_getProductBase',
  157. run_date: run_date,
  158. line_id: line_id
  159. };
  160. ZZLog(data);
  161. $.ajax({
  162. url: urlstr,
  163. data: data,
  164. type: "post",
  165. dataType: "json",
  166. async: false,
  167. success: function (data) {
  168. if (data.code == "0") {
  169. console.log(data);
  170. replaceData(data);
  171. } else {
  172. ZZAlertInfo(data.info,function(){
  173. console.log(first_load);
  174. if(first_load<0){
  175. run_date = getDateTime(0);
  176. window.location.reload();
  177. }
  178. });
  179. //run_date = $('#Wdate2').val();
  180. }
  181. /*if (order_id != ''){
  182. initEditData();
  183. }*/
  184. },
  185. error: function (e) {
  186. ZZLog(e);
  187. }
  188. });
  189. }
  190. //数据展示
  191. function replaceData(data) {
  192. //修改线路列表
  193. //changeLine();
  194. $('#line_code').html(data.line_name);
  195. var startHTML = '';
  196. var start_station = data.start_station;
  197. for (var i = 0; i < start_station.length; i++) {
  198. var tempHTML1 = '<option seq_id="[seq_id]" start_time="[start_time]" value="0">请选择</option>';
  199. tempHTML1 = tempHTML1.replace('请选择', start_station[i].res_name);
  200. tempHTML1 = tempHTML1.replace('0', start_station[i].res_id);
  201. tempHTML1 = tempHTML1.replace('[seq_id]', start_station[i].seq_id);
  202. tempHTML1 = tempHTML1.replace('[start_time]', start_station[i].start_time);
  203. startHTML += tempHTML1;
  204. }
  205. $('#start_area').html(startHTML);
  206. //如果始发站点 有 名为‘厦门未知酒店’的站点,则默认选中
  207. $('#start_area').comboSelect();
  208. $("#start_area").find("option[value='11964']").attr("selected", true);
  209. var channelHTML = '';
  210. var channel_list = data.channel_list;
  211. for (var j = 0; j < channel_list.length; j++) {
  212. var tempHTML = '<option saleman="[saleman]" value="0">请选择</option>';
  213. tempHTML = tempHTML.replace('请选择', channel_list[j].supplier_name);
  214. tempHTML = tempHTML.replace('0', channel_list[j].supplier_id);
  215. tempHTML = tempHTML.replace('[saleman]', channel_list[j].sales_man);
  216. $('#salesman').html(channel_list[0].sales_man);
  217. channelHTML += tempHTML;
  218. }
  219. $('#channel_list').html(channelHTML);
  220. $('.select_line').comboSelect();
  221. var value = $('#channel_list').val();
  222. changeChannelSelected(value);
  223. }
  224. //替换线路的相关信息
  225. function replaceLineInfo(data) {
  226. var productHTML = '';
  227. var product_list = data.list;
  228. console.log(data.list);
  229. for (var i = 0; i < product_list.length; i++) {
  230. var tempHTML1 = '<option value="0">请选择</option>';
  231. tempHTML1 = tempHTML1.replace('请选择', product_list[i].line_name);
  232. tempHTML1 = tempHTML1.replace('0', product_list[i].line_id);
  233. productHTML += tempHTML1;
  234. }
  235. $('#line_info').html(productHTML);
  236. $('.select_line').comboSelect();
  237. // $("#line_info option[value='"+line_id+"']").attr("select","selected");
  238. $("#line_info").find("option[value='" + line_id + "']").attr("selected", true);
  239. }
  240. //切换渠道
  241. function changeChannelSelected(value) {
  242. var saleman = $("#channel_list").find("option:selected").attr('saleman');
  243. console.log(saleman);
  244. $('#salesman').val(saleman);
  245. var data = {
  246. tp: 'groupOrder_getTicketType',
  247. line_id: line_id,
  248. channel_id: value
  249. };
  250. ZZLog(data);
  251. $.ajax({
  252. url: urlstr,
  253. data: data,
  254. type: "post",
  255. dataType: "json",
  256. async: false,
  257. success: function (data) {
  258. if (data.code == "0") {
  259. console.log(data);
  260. showTicketInfo(data);
  261. } else {
  262. ZZAlertInfo(data.info);
  263. }
  264. },
  265. error: function (e) {
  266. ZZLog(e);
  267. }
  268. });
  269. }
  270. //展示票种信息
  271. function showTicketInfo(data) {
  272. var list = data.list;
  273. var newHTML = '';
  274. var sin_price_arr=new Array();
  275. var count_arr=new Array();
  276. for (var i = 0; i < list.length; i++) {
  277. var tempHTML = listHTML;
  278. sin_price_arr[i]=$('.sin_price').eq(i).val();
  279. count_arr[i]=$('.count').eq(i).val();
  280. tempHTML = tempHTML.replace('[座位等级]', list[i].seat_type_name);
  281. tempHTML = tempHTML.replace('[人群]', list[i].human_type_name);
  282. tempHTML = tempHTML.replace('[价格]', list[i].price);
  283. tempHTML = tempHTML.replace('[ticket_id]', list[i].ticket_id);
  284. // 数量
  285. var stock = 1000;
  286. var maxCount = stock > 55 ? 55 : stock;
  287. maxCount = maxCount > 0 ? maxCount : 0;
  288. var newHTML1 = '';
  289. for (var j = 0; j <= maxCount; j++) {
  290. var str = '<option value="[0]">[-]</option> ';
  291. str = str.replace('[0]', j);
  292. str = str.replace('[-]', j);
  293. newHTML1 += str;
  294. }
  295. tempHTML = tempHTML.replace('<option value="[0]">[-]</option>', newHTML1);
  296. tempHTML = tempHTML.replace('[总额]', '0');
  297. newHTML += tempHTML;
  298. }
  299. $('#list').html(newHTML);
  300. $('#list').show();
  301. for(var i =0;i<sin_price_arr.length;i++){
  302. $('.sin_price').eq(i).val(sin_price_arr[i]);
  303. $('.count').eq(i).val(count_arr[i]);
  304. if($('.sin_price').eq(i).val()==''){
  305. $('.sin_price').eq(i).val(0);
  306. }
  307. if( $('.count').eq(i).val()==''){
  308. $('.count').eq(i).val(0);
  309. }
  310. }
  311. for(var i =0;i<sin_price_arr.length;i++){
  312. changeTotalPrice($('.count').eq(i));
  313. }
  314. }
  315. //切换票种数量,更改价格
  316. function changeTotalPrice(obj) {
  317. // var single_price = $(obj).parent().parent().find('.price').val();
  318. // var total_price = parseInt($(obj).val()) * parseInt(single_price);
  319. // $(obj).parent().parent().find('.total_price').html(total_price);
  320. var single_price = $(obj).parent().parent().find('.price').val();
  321. var count= $(obj).parent().parent().find('.count').val();
  322. var total_price = parseInt(single_price)*count;
  323. $(obj).parent().parent().find('.total_price').html(total_price);
  324. }
  325. //保存按钮
  326. function basicInfoSave() {
  327. //出发日期
  328. var start_date = $('#Wdate2').val();
  329. var start_area = $('#start_area').val();
  330. if (!start_date || !start_area) {
  331. ZZAlertInfo('出发日期填写不完整!');
  332. return;
  333. }
  334. //订单渠道
  335. var order_channel = $('#channel_list').val();
  336. var channel_id = $('#channel_id').val();
  337. if (!order_channel) {
  338. ZZAlertInfo('订单渠道填写不完整!');
  339. return;
  340. }
  341. //数量
  342. var count_str = '';
  343. var rec_str = '';
  344. var count_num = 0;
  345. $('.list_info').each(function (index, dom) {
  346. var ticket_id = $(this).attr('id');
  347. var price = $(this).children().find('.price').val();
  348. var sin_price = $(this).children().find('.sin_price').val();
  349. if (!sin_price) {
  350. sin_price = 0
  351. }
  352. var count = $(this).children().find('.count').val();
  353. count_num += parseInt(count);
  354. if (count > 0) {
  355. var str = '{' + ticket_id + ',' + price + ',' + count + '}';
  356. count_str += str;
  357. var str2 = ticket_id + ',' + sin_price;
  358. rec_str += str2 + '|';
  359. } else {
  360. return;
  361. }
  362. })
  363. if (count_str == '') {
  364. ZZAlertInfo('请完善订单信息,并选择数量!');
  365. return;
  366. }
  367. //联系人
  368. var link_man = $('#name').val().trim();
  369. var link_tel = $('#tel').val().trim();
  370. var remarks = $('#remarks').val();
  371. //如果联系人或者备注中有半角逗号,替换为全角
  372. link_man = link_man.replace(/,/g, ",");
  373. remarks = remarks.replace(/,/g, ",");
  374. if (!link_man && !link_tel) {
  375. ZZAlertInfo('联系人信息输入不完整!');
  376. return;
  377. }
  378. if (link_tel != '' ) {
  379. return;
  380. }
  381. var link_info = '{' + link_man + ',' + link_tel + ',' + remarks + '}';
  382. //业务员
  383. var salesman = $('#salesman').val();
  384. //代收
  385. /*var substitute = $('#substitute').val();
  386. // substitute = substitute== " " ? '0' : substitute;
  387. if (substitute == '') {
  388. var substitute_all = $('#substitute_all').val();
  389. if (substitute_all == '') {
  390. substitute = '0';
  391. }else{
  392. substitute = substitute_all;
  393. }
  394. }else {
  395. substitute = substitute * count_num;
  396. }*/
  397. var if_sin = 0;//如果为0表示代收单价没有填写,如果非0,则表示代收总价
  398. var terrace = $('#if_online').text();
  399. var tavern_stay = $('#hotel').val();
  400. var add_line_price = $('#substitute_add').val();
  401. var if_sin = 0;//如果为0表示代收单价没有填写,如果非0,则表示代收总价
  402. $('.sin_price').each(function () {
  403. var tmp = $(this).val();
  404. if (tmp) {
  405. var snum = $(this).parent().parent().find('.count').val();
  406. if_sin += parseInt(tmp) * parseInt(snum);
  407. }
  408. })
  409. //总价计算规则改变--2017-01-20 娄梦宁
  410. var receive_value = $('#total_collection').val();
  411. // var receive_value = 0;
  412. // var substitute_all = $('#substitute_all').val();
  413. // //得到总价(如果没写任何单价[或者代收单价累计计算值为0]),则取代收总价栏的数值,否则取代收单价计算得到代收总价)
  414. // if (!if_sin) {
  415. // receive_value = substitute_all ? parseInt(substitute_all) : 0;
  416. // } else {
  417. // receive_value = if_sin;
  418. // }
  419. //####得到车次信息(3个)
  420. var bus11_run_id=$('#bus11_run_id').val();
  421. var bus12_run_id=$('#bus12_run_id').val();
  422. var bus22_run_id=$('#bus22_run_id').val();
  423. var car11={run_id:bus11_run_id,run_bus_id:$('#bus11').val(),run_date:$('#bus11_run_date').val()};
  424. var car12={run_id:bus12_run_id,run_bus_id:$('#bus12').val(),run_date:$('#bus12_run_date').val()};
  425. var car22={run_id:bus22_run_id,run_bus_id:$('#bus22').val(),run_date:$('#bus22_run_date').val()};
  426. var car_info=[car11,car12,car22];
  427. /* console.log(car_info);
  428. return;*/
  429. //####车次信息结束
  430. //站点信息 order_groupOrder_groupProductList
  431. var seq_id = $("#start_area").find("option:selected").attr('seq_id');
  432. var start_time = $("#start_area").find("option:selected").attr('start_time');
  433. var tp = order_id != '' ? 'order_groupOrder_updateGroupOrder' : 'order_groupOrder_addExtraOrder';
  434. var data = {
  435. tp: tp,
  436. line_id: line_id,
  437. car_info:car_info, //车次信息
  438. count_num:count_num,
  439. org_id: order_channel,
  440. order_id: order_id,
  441. order_no: channel_id,
  442. salesman: salesman,
  443. start_date: start_date,
  444. start_station: start_area,
  445. prod_list: count_str,
  446. rec_list: rec_str, //代收单价列表
  447. customer_info: link_info,
  448. receive_value: receive_value,
  449. seq_id: seq_id,
  450. start_time: start_time,
  451. terrace : terrace,
  452. tavern_stay : tavern_stay,
  453. add_line_price : add_line_price
  454. };
  455. ZZLog(data);
  456. $.ajax({
  457. url: newstr,
  458. data: data,
  459. type: "post",
  460. dataType: "json",
  461. async: false,
  462. success: function (data) {
  463. if (data.code == "0") {
  464. ZZLog(data);
  465. ZZAlertInfo(data.info,function(){
  466. if (order_id == '')
  467. //window.location.href = "select_product.html";
  468. window.location.reload();
  469. else {
  470. window.location.href = "order_list.html";
  471. }
  472. });
  473. /*setTimeout(function () {
  474. if (order_id == '')
  475. //window.location.href = "select_product.html";
  476. window.location.reload();
  477. else {
  478. window.location.href = "order_list.html";
  479. }
  480. }, 3000)*/
  481. } else {
  482. ZZAlertInfo(data.info);
  483. }
  484. },
  485. error: function (e) {
  486. ZZLog(e);
  487. }
  488. });
  489. }
  490. //切换线路
  491. function changeLineInfo(obj) {
  492. var ttt = $(obj).val();
  493. line_id = ttt;
  494. first_load=first_load-1;
  495. loadCar();
  496. var data = {
  497. tp: 'groupOrder_getProductBase',
  498. run_date: run_date,
  499. line_id: line_id
  500. };
  501. ZZLog(data);
  502. $.ajax({
  503. url: urlstr,
  504. data: data,
  505. type: "post",
  506. dataType: "json",
  507. async: false,
  508. success: function (data) {
  509. if (data.code == "0") {
  510. console.log(data);
  511. replace1Data(data);
  512. } else {
  513. ZZAlertInfo(data.info, function () {
  514. console.log(first_load);
  515. window.location.reload();
  516. });
  517. }
  518. },
  519. error: function (e) {
  520. ZZLog(e);
  521. }
  522. });
  523. }
  524. //修改线路数据展示
  525. function replace1Data(data) {
  526. //修改线路列表
  527. var value=$('#channel_list').val();
  528. for(var item in data.channel_list){
  529. if(data.channel_list[item].supplier_id==$('#channel_list').val()){
  530. var new_supplier_id=data.channel_list[item].supplier_id;
  531. break;
  532. }
  533. }
  534. if(typeof new_supplier_id === 'undefined'){
  535. ZZConfirm('此线路无当前渠道信息,是否确认修改?', function (ok) {
  536. //修改线路列表
  537. // changeLine();
  538. $('#line_code').html(data.line_name);
  539. var startHTML = '';
  540. var start_station = data.start_station;
  541. for (var i = 0; i < start_station.length; i++) {
  542. var tempHTML1 = '<option seq_id="[seq_id]" start_time="[start_time]" value="0">请选择</option>';
  543. tempHTML1 = tempHTML1.replace('请选择', start_station[i].res_name);
  544. tempHTML1 = tempHTML1.replace('0', start_station[i].res_id);
  545. tempHTML1 = tempHTML1.replace('[seq_id]', start_station[i].seq_id);
  546. tempHTML1 = tempHTML1.replace('[start_time]', start_station[i].start_time);
  547. startHTML += tempHTML1;
  548. }
  549. $('#start_area').html(startHTML);
  550. //如果始发站点 有 名为‘厦门未知酒店’的站点,则默认选中
  551. $('#start_area').comboSelect();
  552. $("#start_area").find("option[value='11964']").attr("selected", true);
  553. var new_supplier_id = data.channel_list[0].supplier_id;
  554. supplier_id=new_supplier_id;
  555. var channelHTML = '';
  556. var channel_list = data.channel_list;
  557. for (var j = 0; j < channel_list.length; j++) {
  558. var tempHTML = '<option saleman="[saleman]" value="0">请选择</option>';
  559. tempHTML = tempHTML.replace('请选择', channel_list[j].supplier_name);
  560. tempHTML = tempHTML.replace('0', channel_list[j].supplier_id);
  561. tempHTML = tempHTML.replace('[saleman]', channel_list[j].sales_man);
  562. $('#salesman').html(channel_list[0].sales_man);
  563. channelHTML += tempHTML;
  564. }
  565. $('#channel_list').html(channelHTML);
  566. $('.select_line').comboSelect();
  567. value = $('#channel_list').val();
  568. last_supplier_id = value;
  569. }, function (cancel) {
  570. value = last_supplier_id;
  571. }, function (close) {
  572. })
  573. }
  574. changeChannelSelected(value);
  575. }
  576. //如果是修改订单,对表单赋值
  577. function initEditData() {
  578. $("#Wdate2").val(old_data['PROD_START_STATION_DATE']);
  579. $("#start_area").val(old_data['PROD_START_STATION_RES_ID']).comboSelect();
  580. $("#channel_list").val(old_data['SUPPLIER_ID']).comboSelect();
  581. //没有触发 changeChannelSelected函数
  582. changeChannelSelected(old_data['SUPPLIER_ID']);
  583. var count_num = 0;
  584. $.each(old_data['ticket_info'], function (k, item) {
  585. $("#" + item['ticket_id'] + " .count").val(item['num']);
  586. $("#" + item['ticket_id'] + " .sin_price").val(item['sin_price']);
  587. var total_amount = item['num'] * $("#" + item['ticket_id'] + " .count").parent().prev('td').find('.price').val();
  588. $("#" + item['ticket_id'] + " .count").parent().next('.total_price').html(total_amount);
  589. count_num += parseInt(item['num']);
  590. });
  591. $("#channel_id").val(old_data['OUTSIDE_ORDER_NO']);
  592. $("#substitute_all").val(old_data['RECEIVE_VALUE']);
  593. /*if(count_num > 0)
  594. $("#substitute").val(parseInt(old_data['RECEIVE_VALUE']) / count_num);*/
  595. $("#name").val(old_data['customer_name']);
  596. $("#tel").val(old_data['customer_mobile']);
  597. $("#salesman").val(old_data['sales_man']);
  598. $("#remarks").val(old_data['customer_memo']);
  599. }
  600. //手机号验证取消,后台判断,当手机号,日期,线路一致时返回提示错误信息---娄梦宁2017-01-20
  601. //当手机输入框手机号码输完即时判断
  602. // $("#tel").bind('input propertychange', function () {
  603. //
  604. // var tel = $('#tel').val().trim();
  605. // if (tel.length == 11) {
  606. // $.ajax({
  607. // url: base_api + 'index.php', //请求地址
  608. // data: {
  609. // tp: "order_groupOrder_getPurchaseHistory",
  610. // tel: tel
  611. // },
  612. // type: "post",
  613. // dataType: "json",
  614. // success: function (data) {
  615. // console.log(data);
  616. // if (data.code == "0") {
  617. // $('#attention').text('提示:该电话号码今日已有下单记录!');
  618. // $('#attention').show();
  619. // return;
  620. // } else {
  621. // // $('#attention').text('提示:该电话号码今日已有下单记录!');
  622. // $('#attention').hide();
  623. // }
  624. //
  625. // }
  626. // });
  627. //
  628. // } else {
  629. // $('#attention').hide();
  630. // }
  631. // })
  632. //代收总价计算
  633. function total_collection(){
  634. var total_collection_price=0;
  635. var count=$('.sin_price').length;
  636. for(i=0;i<count;i++ ){
  637. if(isNaN(Number($('.sin_price').eq(i).val()))){
  638. total_collection_price+=0;
  639. }else{
  640. total_collection_price+=Number($('.sin_price').eq(i).val());
  641. }
  642. }
  643. if(isNaN(Number($('#substitute_add').val()))){
  644. total_collection_price+=0;
  645. }else{
  646. total_collection_price+=Number($('#substitute_add').val());
  647. }
  648. $('#total_collection').val(total_collection_price);
  649. }