MyDesignBill.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. var exData = null;
  2. var edit_id = "";
  3. var _memo_msg = "";
  4. var cdrImgUrl = null;
  5. function actionRenderer(e) {
  6. var record = e.record;
  7. var id = record.ID;
  8. var html = "";
  9. if (record.isAudit == 0) {
  10. html += getGridBtn("edit", "修改", "modifyFn('" + id + "')");
  11. }
  12. if (record.OrderState >= 5) {
  13. html += getGridBtn("view", "预览文件", "viewCdrImg('" + id + "')");
  14. }
  15. return html;
  16. }
  17. function viewCdrImg(id) {
  18. var rec = grid.getSelected();
  19. if (rec.OrderState < 5) {
  20. mini.alert("还没有上传文件,没有图片");
  21. return;
  22. }
  23. var finish = formatCommonDate(rec.FinishDesignTime);
  24. var yearmonth = finish.substring(0, 7);
  25. var monthUrl = yearmonth.replace("/", "");
  26. var url = cdrImgUrl + "/" + monthUrl + "/" + rec.seller_memo + ".png";
  27. mini.get("viewimg_win").show();
  28. $("#r_img").attr("src", url);
  29. }
  30. function largeImage(that) {
  31. var large_image = '<img src= ' + $(that).attr("src") + '></img>';
  32. $('.image_large').html($(large_image).css({
  33. display: "block",
  34. height: '60%',
  35. //width: '40%',
  36. position: "absolute",
  37. left: "50%",
  38. top: "50%",
  39. transform: "translate(-50%,-50%)",
  40. }, 500));
  41. $('.image_large').css("display", "block");
  42. }
  43. function hideImage(that) {
  44. $(that).css("display", "none");
  45. }
  46. function numRenderer(e) {
  47. var grid = e.sender;
  48. var record = e.record;
  49. var html = "";
  50. if (record.designNum > 0) {
  51. html += "<div>设计:" + record.designNum + "款</div>";
  52. }
  53. if (record.modifyNum > 0) {
  54. html += "<div>改稿:" + record.modifyNum + "款</div>";
  55. }
  56. return html;
  57. }
  58. function timeRenderer(e) {
  59. var grid = e.sender;
  60. var record = e.record;
  61. var html = "";
  62. html += "创建时间:<br/><div>" + formatCommonDate(record.create_time) + "</div>";
  63. if (record.update_time != "") {
  64. html += "修改时间:<br/><div>" + formatCommonDate(record.update_time) + "</div>";
  65. }
  66. return html;
  67. }
  68. function orderSellerRenderer(e) {
  69. var grid = e.sender;
  70. var record = e.record;
  71. var html = "<div style=\"display:flex;flex-direction:column;\">";
  72. html += ("<div style=\"color:#666;\">" + record.seller_nick + "</div>");
  73. html += getWWurlByNick(record.buyer_nick);
  74. return html;
  75. }
  76. function orderStatusRenderer(e) {
  77. var grid = e.sender;
  78. var record = e.record;
  79. var statestr = getOrderStatestrByState(record.OrderState);
  80. var taostatus = getInitStatusstrByState(record.status);
  81. var html = "<div style=\"display:flex;flex-direction:column;\">";
  82. html += ("<div onclick=\"clickToLog('" + record.tid + "')\" style=\"color:" + (record.OrderState == 0 ? "red" : "blue") + ";margin-bottom:10px;\">" + statestr + "</div>");
  83. html += ("<div>" + taostatus + "</div>");
  84. html += "</div>";
  85. return html;
  86. }
  87. function designBillRenderer(e) {
  88. var grid = e.sender;
  89. var rec = e.record;
  90. var html = "<div onclick=\"designBillLog('" + rec.tid + "')\" style=\"color: blue\">" + rec.realPrice + "</div>";
  91. return html;
  92. }
  93. //修改金额
  94. function modifyFn(id) {
  95. var rec = grid.getSelected();
  96. edit_id = id;
  97. mini.get("modify_win").show();
  98. $("#txtModifyPrice").val(rec.price);
  99. }
  100. function saveModifyFn() {
  101. var parms = new Object();
  102. parms.ID = edit_id;
  103. parms.price = $("#txtModifyPrice").val();
  104. postAjax("upd_erp_designerbill", parms, function (data) {
  105. mini.get("modify_win").hide();
  106. resultShow(data, "grid.reload();");
  107. });
  108. }
  109. function cancelModifyFn() {
  110. mini.get("modify_win").hide();
  111. }
  112. //查询按钮
  113. function searchFn() {
  114. var form = new mini.Form("#ctl00_f_all");
  115. var data = form.getData(true, false);
  116. var s = data;
  117. grid.load({
  118. tid: s.tid, createTime1: s.createTime1, createTime2: s.createTime2, realPrice1: s.realPrice1, realPrice2: s.realPrice2, price1: s.price1,
  119. price2: s.price2, orderState: s.state
  120. });
  121. }
  122. //清除查询内容
  123. function clearFn() {
  124. //$("#ctl00_f_all").find("input").val("");
  125. var form = new mini.Form("#ctl00_f_all");
  126. form.clear();
  127. }
  128. $(function () {
  129. if (openPageData != "") {
  130. var s = openPageData;
  131. grid.load({
  132. tid: s.tid, createTime: s.createTime, realPrice: s.realPrice, price: s.price, afterSalePayment: s.afterSalePayment,
  133. orderState: s.orderState, buyer_nick: s.buyer_nick, seller_nick: s.seller_nick, seller_memo: s.seller_memo, refundFee: s.refundFee
  134. });
  135. var form = new mini.Form("#ctl00_f_all");
  136. if (form != undefined && form != null) {
  137. form.setData(s);
  138. }
  139. //$("#ic_chkNewPageSearch")[0].checked = true;
  140. }
  141. });