1
0

order.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. $(function () {
  2. let shippingStatus = getQueryString("shippingStatus");
  3. let payStatus = getQueryString("payStatus");
  4. let orderStatus = getQueryString("orderStatus");
  5. let merchOrderSn = getQueryString("merchOrderSn");
  6. let url = '../order/list?1';
  7. if (shippingStatus) {
  8. url += '&shippingStatus=' + shippingStatus;
  9. }
  10. if (payStatus) {
  11. url += '&payStatus=' + payStatus;
  12. }
  13. if (orderStatus) {
  14. url += '&orderStatus=' + orderStatus;
  15. }
  16. if (merchOrderSn) {
  17. url += '&merchOrderSn=' + merchOrderSn;
  18. }
  19. $("#jqGrid").jqGrid({
  20. url: url,
  21. datatype: "json",
  22. colModel: [
  23. {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
  24. {label: '订单号', name: 'orderSn', index: 'order_sn', width: 100},
  25. {label: '会员', name: 'userName', index: 'user_name', width: 80},
  26. {label: '支付类型', name: 'isMergePay', index: 'is_merge_pay', width: 60,
  27. formatter: function (value) {
  28. if (value == '2') {
  29. return '合并支付';
  30. }else if (value == '1') {
  31. return '合并支付';
  32. } else if (value == '0') {
  33. return '单笔支付';
  34. }
  35. return '-';
  36. }
  37. },
  38. {label: '商户订单号', name: 'merchOrderSn', index: 'merchOrderSn', width: 140},
  39. {
  40. label: '订单业务类型', name: 'orderBizType', index: 'order_biz_type', width: 80,
  41. formatter: function (value) {
  42. if (value == '00') {
  43. return '保税备货';
  44. } else if (value == '02') {
  45. return '保税展示补货';
  46. } else if (value == '10') {
  47. return '保税展示跨境';
  48. } else if (value == '11') {
  49. return '普通货物';
  50. }
  51. return '-';
  52. }
  53. },
  54. {
  55. label: '订单状态', name: 'orderStatus', index: 'order_status', width: 80,
  56. formatter: function (value) {
  57. if (value == '0') {
  58. return '订单创建成功等待付款';
  59. } else if (value == '100') {
  60. return '订单付款中';
  61. } else if (value == '101') {
  62. return '订单已取消';
  63. } else if (value == '102') {
  64. return '订单已删除';
  65. } else if (value == '201') {
  66. return '订单已付款,等待发货';
  67. } else if (value == '300') {
  68. return '订单已发货';
  69. } else if (value == '301') {
  70. return '用户确认收货';
  71. } else if (value == '401') {
  72. return '没有发货,退款';
  73. } else if (value == '402') {
  74. return '已收货,退款退货';
  75. }
  76. return value;
  77. }
  78. },
  79. {
  80. label: '订付人核验', name: 'buyerPayCheck', index: 'buyer_pay_check', width: 80,
  81. formatter: function (value) {//订购人支付人校验,0:未知,1:一致,2:不一致,3:校验异常
  82. if (value == '0') {
  83. return '未知';
  84. } else if (value == '1') {
  85. return '一致';
  86. } else if (value == '2') {
  87. return '不一致';
  88. }
  89. return "-";
  90. }
  91. },
  92. {
  93. label: '付款状态', name: 'payStatus', index: 'pay_status', width: 80,
  94. formatter: function (value) {
  95. if (value == '0') {
  96. return '未付款';
  97. } else if (value == '1') {
  98. return '付款中';
  99. } else if (value == '2') {
  100. return '已付款';
  101. } else if (value == '3') {
  102. return '退款中';
  103. } else if (value == '4') {
  104. return '退款';
  105. }
  106. return value;
  107. }
  108. },
  109. // {label: '收货人', name: 'consignee', index: 'consignee', width: 80},
  110. // {label: '收货地址', name: 'address', index: 'address', width: 80},
  111. // {label: '联系电话', name: 'mobile', index: 'mobile', width: 80},
  112. {label: '实际支付', name: 'actualPrice', index: 'actual_price', width: 60},
  113. {label: '订单总价', name: 'orderPrice', index: 'order_price', width: 60},
  114. {
  115. label: '下单时间', name: 'addTime', index: 'add_time', width: 120,
  116. formatter: function (value) {
  117. return transDate(value, 'yyyy-MM-dd hh:mm:ss');
  118. }
  119. },
  120. {label: '快递公司', name: 'shippingName', index: 'shipping_name', width: 80},
  121. {label: '配送单号', name: 'shippingNo', index: 'shipping_No', width: 80},
  122. {label: '快递费用', name: 'shippingFee', index: 'shipping_fee', width: 80},
  123. {
  124. label: '发货状态', name: 'shippingStatus', index: 'shipping_status', width: 60,
  125. formatter: function (value) {
  126. if (value == '0') {
  127. return '未发货';
  128. } else if (value == '1') {
  129. return '已发货';
  130. } else if (value == '2') {
  131. return '已收货';
  132. } else if (value == '4') {
  133. return '退货';
  134. }
  135. return value;
  136. }
  137. },
  138. {
  139. label: '操作', width: 180, sortable: false,
  140. formatter: function (value, col, row) {
  141. let htmlStr = '<button class="btn btn-outline btn-info" onclick="vm.lookDetail(' + row.id + ')"><i class="fa fa-info-circle"></i>详情</button>&nbsp;';
  142. //订单状态: 0订单创建成功等待付款, 101订单已取消, 102订单已删除,201订单已付款,等待发货,300订单已发货, 301用户确认收货,401 没有发货,退款 402 已收货,退款退货
  143. if (hasPermission('order:refund')) {
  144. if (row.orderStatus == 300 && (row.orderBizType == '10' || row.orderBizType == '02')) {
  145. htmlStr += '<button class="btn btn-outline btn-primary" onclick="vm.printDetail(' + row.id + ')"><i class="fa fa-print"></i>打印</button>&nbsp;';
  146. }
  147. if (row.orderStatus == 0) {
  148. htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.cancelUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;取消</button>&nbsp;';
  149. }
  150. if (row.orderStatus == 201) {
  151. if (row.isPaymentSend == 0 || row.isEleOrderSend == 0 || row.isCustomsSend == 0) {
  152. htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.refundUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;退款</button>&nbsp;';
  153. }
  154. }
  155. }
  156. return htmlStr;
  157. }
  158. }
  159. ],
  160. viewrecords: true,
  161. height: 675,
  162. rowNum: 10,
  163. rowList: [10, 30, 50],
  164. rownumbers: true,
  165. rownumWidth: 25,
  166. autowidth: true,
  167. multiselect: true,
  168. pager: "#jqGridPager",
  169. jsonReader: {
  170. root: "page.list",
  171. page: "page.currPage",
  172. total: "page.totalPage",
  173. records: "page.totalCount"
  174. },
  175. prmNames: {
  176. page: "page",
  177. rows: "limit",
  178. order: "order"
  179. },
  180. gridComplete: function () {
  181. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
  182. }
  183. });
  184. });
  185. let vm = new Vue({
  186. el: '#rrapp',
  187. data: {
  188. showDiv: 1, // 1查询 2编辑 3发货 4选择骑手 5退款
  189. title: null,
  190. order: {},
  191. shippings: [],
  192. q: {
  193. orderSn: '',
  194. orderStatus: '',
  195. merchOrderSn: ''
  196. },
  197. refundMoney: 0,
  198. shipping: {},
  199. logisticsInfo: {
  200. tracesList: [],
  201. logisticCode: '',
  202. shipperCode: ''
  203. },
  204. macros: [],
  205. orderProcessRecordEntity: {},
  206. orderGoodsList: []
  207. },
  208. methods: {
  209. query: function () {
  210. vm.reload(1);
  211. },
  212. getMacro: function () {
  213. $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
  214. vm.macros = r.list;
  215. });
  216. },
  217. getLogistics: function (event) {
  218. let id = getSelectedRow();
  219. if (id == null) {
  220. return;
  221. }
  222. $.get("../order/getLogistics/" + id, function (r) {
  223. if (r.code != 0) {
  224. alert(r.msg);
  225. return;
  226. }
  227. vm.logisticsInfo = r.result;
  228. vm.showDiv = 3;
  229. vm.title = "快递信息";
  230. });
  231. },
  232. getProcess: function (event) {
  233. let orderSn = getSelectedRowData().orderSn;
  234. if (orderSn == null) {
  235. return;
  236. }
  237. $.get("../order/getProcess/" + orderSn, function (r) {
  238. if (r.code != 0) {
  239. alert(r.msg);
  240. return;
  241. }
  242. if (r.orderProcessRecordEntity != null) {
  243. vm.orderProcessRecordEntity = r.orderProcessRecordEntity;
  244. vm.showDiv = 7;
  245. } else {
  246. alert(orderSn + "暂无清关信息");
  247. }
  248. });
  249. },
  250. confirm: function (event) {
  251. let id = getSelectedRow();
  252. if (id == null) {
  253. return;
  254. }
  255. confirm('确定收货?', function () {
  256. $.ajax({
  257. type: "POST",
  258. url: "../order/confirm",
  259. contentType: "application/json",
  260. data: JSON.stringify(id),
  261. dataType: "json",
  262. success: function (r) {
  263. if (r.code == 0) {
  264. alert('操作成功', function (index) {
  265. $("#jqGrid").trigger("reloadGrid");
  266. });
  267. } else {
  268. alert(r.msg);
  269. }
  270. }
  271. });
  272. });
  273. },
  274. openComment: function (event) {
  275. let id = getSelectedRow();
  276. if (id == null) {
  277. return;
  278. }
  279. openWindow({
  280. type: 2,
  281. title: '评价',
  282. content: '../shop/comment.html?orderId=' + id
  283. });
  284. },
  285. shippingChange: function (opt) {
  286. vm.order.shippingName = opt.label;
  287. vm.order.shippingCode = opt.value;
  288. },
  289. saveOrUpdate: function (event) {
  290. $.ajax({
  291. type: "POST",
  292. url: '../order/sendGoods',
  293. contentType: "application/json",
  294. data: JSON.stringify(vm.order),
  295. success: function (r) {
  296. if (r.code === 0) {
  297. alert('操作成功', function (index) {
  298. vm.reload();
  299. });
  300. } else {
  301. alert(r.msg);
  302. }
  303. }
  304. });
  305. },
  306. reload: function (event) {
  307. vm.showDiv = 1;
  308. let page = event;
  309. if (event != 1) {
  310. page = $("#jqGrid").jqGrid('getGridParam', 'page');
  311. }
  312. $("#jqGrid").jqGrid('setGridParam', {
  313. postData: {
  314. 'orderSn': vm.q.orderSn,
  315. 'orderStatus': vm.q.orderStatus,
  316. 'merchOrderSn': vm.q.merchOrderSn
  317. },
  318. page: page
  319. }).trigger("reloadGrid");
  320. },
  321. reloadSearch: function () {
  322. vm.q = {
  323. orderSn: '',
  324. orderStatus: '',
  325. merchOrderSn: ''
  326. };
  327. },
  328. lookDetail: function (rowId) { //第三步:定义编辑操作
  329. vm.showDiv = 2;
  330. vm.title = "订单详情";
  331. $.get("../order/infos/" + rowId, function (r) {
  332. vm.order = r.order;
  333. vm.orderGoodsList = r.order.orderGoodsEntityList;
  334. });
  335. vm.getMacro();
  336. },
  337. printDetail: function (rowId) {
  338. confirm('确定连接打票机打印出票?', function () {
  339. $.ajax({
  340. type: "POST",
  341. url: "../order/printMsg",
  342. contentType: "application/json",
  343. data: JSON.stringify(rowId),
  344. success: function (r) {
  345. if (r.ticket != null) {
  346. // printArea(r.ticket);
  347. var content = getPrintContent(r.ticket);
  348. printArea(content);
  349. alert('打印小票完成');
  350. }else{
  351. alert("打印小票失败");
  352. }
  353. }
  354. });
  355. })
  356. },
  357. shippingBind: function (event) {
  358. let orderId = vm.order.id;
  359. $.ajax({
  360. type: "POST",
  361. url: '../order/shippingBind',
  362. data: {orderId: orderId, shippingCode: vm.shipping},
  363. success: function (r) {
  364. if (r.code === 0) {
  365. alert('操作成功', function (index) {
  366. vm.reload();
  367. });
  368. } else {
  369. alert(r.msg);
  370. }
  371. }
  372. });
  373. },
  374. refund: function (rowId) {
  375. vm.showDiv = 5;
  376. vm.refundMoney = 0;
  377. Ajax.request({
  378. url: "../order/info/" + rowId,
  379. async: true,
  380. successCallback: function (r) {
  381. vm.order = r.order;
  382. vm.refundMoney = r.order.actualPrice;
  383. }
  384. });
  385. },
  386. cancelUpdate: function (rowId) {
  387. let params = {};
  388. params.orderId = rowId;
  389. $.ajax({
  390. type: "POST",
  391. url: '../order/cancel',
  392. data: params,
  393. success: function (r) {
  394. if (r.code === 0) {
  395. alert('取消成功', function (index) {
  396. vm.reload();
  397. });
  398. } else {
  399. alert(r.msg);
  400. }
  401. }
  402. });
  403. },
  404. refundUpdate: function (rowId) {
  405. let params = {};
  406. params.orderId = rowId;
  407. $.ajax({
  408. type: "POST",
  409. url: '../order/refund',
  410. data: params,
  411. success: function (r) {
  412. if (r.code === 0) {
  413. alert('退款成功', function (index) {
  414. vm.reload();
  415. });
  416. } else {
  417. alert(r.msg);
  418. }
  419. }
  420. });
  421. }
  422. },
  423. created: function () {
  424. $.get("../shipping/queryAll", function (r) {
  425. vm.shippings = r.list;
  426. });
  427. }
  428. });
  429. // var printAreaCount = 0;
  430. // function printArea(ticket) {
  431. // var idPrefix = "printArea_";
  432. // removePrintArea(idPrefix + printAreaCount);
  433. // printAreaCount++;
  434. // var iframeId = idPrefix + printAreaCount;
  435. // var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
  436. // iframe = document.createElement('IFRAME');
  437. // $(iframe).attr({
  438. // style: iframeStyle,
  439. // id: iframeId
  440. // });
  441. // document.body.appendChild(iframe);
  442. // var doc = iframe.contentWindow.document;
  443. // $(document).find("link").filter(function () {
  444. // return $(this).attr("rel").toLowerCase() == "stylesheet";
  445. // }).each(
  446. // function () {
  447. // doc.write('<link type="text/css" rel="stylesheet" href="'
  448. // + $(this).attr("href") + '" >');
  449. // });
  450. // doc.write('<div class="">' + content
  451. // + '</div>');
  452. // doc.close();
  453. // var frameWindow = iframe.contentWindow;
  454. // frameWindow.close();
  455. // frameWindow.focus();
  456. // frameWindow.print();
  457. // }
  458. // var removePrintArea = function (id) {
  459. // $("iframe#" + id).remove();
  460. // };
  461. function getPrintContent(ticket) {
  462. var content = "<div style=\"width: 250px;font-family: 微软雅黑;font-size: 8px;\">";
  463. //小票头
  464. content += "<div style=\"text-align: center;width: 100%;font-weight:bold;font-size: 13px;\">";
  465. content += ticket.ticketHead.title;
  466. content += "</div>";
  467. content += "<div style=\"width: 100%;\">";
  468. content += "会员:" + ticket.ticketHead.memberId;
  469. content += "</div>";
  470. content += "<div style=\"width: 100%;\">";
  471. content += "订单号:" + ticket.ticketHead.orderId;
  472. content += "</div>";
  473. content += "<div style=\"width: 100%;\">";
  474. content += "交易时间:" + ticket.ticketHead.tradeTime;
  475. content += "</div>";
  476. content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
  477. //商品信息
  478. content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  479. content += "<tr>";
  480. content += "<td style=\"width: 50%;text-align: left;font-size: 10px;font-weight: bold;\">商品名称</td>";
  481. content += "<td style=\"width: 17%;text-align: right;font-size: 10px;font-weight: bold;\">单价</td>";
  482. content += "<td style=\"width: 15%;text-align: right;font-size: 10px;font-weight: bold;\">数量</td>";
  483. content += "<td style=\"width: 18%;text-align: right;font-size: 10px;font-weight: bold;\">小计</td>";
  484. content += "</tr>";
  485. content += "</table>";
  486. content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
  487. content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  488. for (var i=0;i< ticket.goods.length;i++){
  489. content += "<tr>";
  490. content += "<td style=\"width: 50%;text-align: left;font-size: 8px;padding-top: 8px;\">";
  491. content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  492. content += "<tr>";
  493. content += "<td style=\"text-align: left;font-size: 8px;vertical-align:top;\">#</td>";
  494. content += "<td style=\"text-align: left;font-size: 8px;\">" + ticket.goods[i].gname + "</td>";
  495. content += "</tr>";
  496. content += "</table>";
  497. content += "</td>";
  498. content += "<td style=\"width: 17%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].uprice + "</td>";
  499. content += "<td style=\"width: 15%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].num + "</td>";
  500. content += "<td style=\"width: 18%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].subtotal + "元</td>";
  501. content += "</tr>";
  502. }
  503. content += "</table>";
  504. content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
  505. //收银信息
  506. content += "<div style=\"width: 100%;\">";
  507. content += "<span style=\"float: left;width: 50%;text-align: left;\">商品合计:</span>";
  508. content += "<span style=\"float: left;width: 17%;text-align: left;\">" + ticket.cashInfo.goodsTotal + "件</span>";
  509. content += "<span style=\"float: right;width: 33%;text-align: right;\">" + ticket.cashInfo.total + "元</span>";
  510. content += "</div>";
  511. content += "<div style=\"width: 100%;\">";
  512. content += "<span style=\"float: left;width: 50%;text-align: left;\">实收:</span>";
  513. content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.receipts + "元</span>";
  514. content += "</div>";
  515. content += "<div style=\"width: 100%;\">";
  516. content += "<span style=\"float: left;width: 50%;text-align: left;\">找零:</span>";
  517. content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.oddChange + "元</span>";
  518. content += "</div>";
  519. content += "<div style=\"width: 100%;\">";
  520. content += "<span style=\"float: left;width: 50%;text-align: left;\">优惠券:</span>";
  521. content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.coupon + "元</span>";
  522. content += "</div>";
  523. content += "<div style=\"width: 100%;\">";
  524. content += "<span style=\"float: left;width: 50%;text-align: left;\">运费:</span>";
  525. content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.freight + "元</span>";
  526. content += "</div>";
  527. content += "<div style=\"width: 100%;\">";
  528. content += "<span style=\"float: left;width: 50%;text-align: left;\">支付渠道:</span>";
  529. content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.paymentMode + "</span>";
  530. content += "</div>";
  531. content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
  532. //海关清单信息
  533. content += "<div style=\"width: 100%;\">";
  534. content += "订单号:" + ticket.cusListing.orderId;
  535. content += "</div>";
  536. content += "<div style=\"width: 100%;\">";
  537. content += "运单编号:" + ticket.cusListing.waybillId;
  538. content += "</div>";
  539. content += "<div style=\"width: 100%;\">";
  540. content += "海关清单号:" + ticket.cusListing.invtNo;
  541. content += "</div>";
  542. content += "<div style=\"width: 100%;\">";
  543. content += "收货人:" + ticket.cusListing.consignee;
  544. content += "</div>";
  545. content += "<div style=\"width: 100%;\">";
  546. content += "收货人电话:" + ticket.cusListing.consigneeTel;
  547. content += "</div>";
  548. content += "<div style=\"width: 100%;\">";
  549. content += "始发地:" + ticket.cusListing.originAddress;
  550. content += "</div>";
  551. content += "<div style=\"width: 100%;\">";
  552. content += "交货地:" + ticket.cusListing.deliveryAddress;
  553. content += "</div>";
  554. content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
  555. content += "<div style=\"width: 100%;\">";
  556. content += ticket.ticketFoot.summary;
  557. content += "</div>";
  558. content += "<div style=\"width: 100%;\">";
  559. content += "客服电话:" + ticket.ticketFoot.serviceTel;
  560. content += "</div>";
  561. content += "<div style=\"width: 100%;\">";
  562. content += "网址:" + ticket.ticketFoot.url1;
  563. content += "</div>";
  564. content += "<div style=\"width: 100%;\">";
  565. content += ticket.ticketFoot.welcome;
  566. content += "</div>";
  567. return content;
  568. }
  569. var printAreaCount = 0;
  570. function printArea(content) {
  571. var idPrefix = "printArea_";
  572. removePrintArea(idPrefix + printAreaCount);
  573. printAreaCount++;
  574. var iframeId = idPrefix + printAreaCount;
  575. var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
  576. iframe = document.createElement('IFRAME');
  577. $(iframe).attr({
  578. style: iframeStyle,
  579. id: iframeId
  580. });
  581. document.body.appendChild(iframe);
  582. var doc = iframe.contentWindow.document;
  583. doc.open();
  584. //$(document).find("link").filter(function () {
  585. //return $(this).attr("rel").toLowerCase() == "stylesheet";
  586. //}).each(
  587. //function () {
  588. //doc.write('<link type="text/css" rel="stylesheet" href="'
  589. //+ $(this).attr("href") + '" >');
  590. //});
  591. doc.write('<div class="">' + content
  592. + '</div>');
  593. doc.close();
  594. var frameWindow = iframe.contentWindow;
  595. frameWindow.close();
  596. frameWindow.focus();
  597. frameWindow.print();
  598. }
  599. var removePrintArea = function (id) {
  600. $("iframe#" + id).remove();
  601. };