PackCenter.aspx 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <%@ Page Language="C#" MasterPageFile="~/MasterPage/ErpView.master" AutoEventWireup="true" CodeFile="PackCenter.aspx.cs" Inherits="EDelivery_PackCenter" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
  3. <script>
  4. let productHourList = []
  5. //查询按钮
  6. function searchFn() {
  7. var form = new mini.Form("#ctl00_f_all");
  8. var data = form.getData(true, false);
  9. var s = data;
  10. grid.load({
  11. supplier: s.supplier
  12. });
  13. }
  14. //清除查询内容
  15. function clearFn() {
  16. var form = new mini.Form("#ctl00_f_all");
  17. form.clear();
  18. }
  19. function orderPTimeRenderer(e) {
  20. var grid = e.sender;
  21. var record = e.record;
  22. var tid = record.tid;
  23. var rowIndex = e.rowIndex;
  24. var html = "<div style=\"display:flex;flex-direction:column;\">";
  25. html += ("<div>" + formatCommonDate(record.createtime) + "</div>");
  26. html += "</div>";
  27. return html;
  28. }
  29. function rePackData(id) {
  30. postAjax("rePackOrderInfo", { id }, function (data) { resultShow(data, "grid.reload();"); });
  31. }
  32. function supStateRenderer(e) {
  33. var record = e.record;
  34. var html = "<div style=\"display:flex;flex-direction:column;\">";
  35. if (record.upStatus == 0) {
  36. html += ("<div style=\"color:blue;\"> 待打包 </div>");
  37. }
  38. if (record.upStatus == 1) {
  39. html += ("<div style=\"color:blue;\"> 打包中 </div>");
  40. } if (record.upStatus == 2) {
  41. html += ("<div style=\"color:blue;\"> 打包完成 </div>");
  42. } if (record.upStatus == 3) {
  43. html += ("<div style=\"color:blue;\"> 打包失败 </div>");
  44. } if (record.upStatus == 4) {
  45. html += ("<div style=\"color:blue;\"> 取消 </div>");
  46. }
  47. html += "</div>";
  48. return html;
  49. }
  50. function actionRenderer(e) {
  51. var record = e.record;
  52. var html = "";
  53. if (!!record.fileUrl) {
  54. html += getGridBtn("notify1", "下载", "downUrl('" + record.fileUrl + "','" + record.ID + "')");
  55. }
  56. if (record.upStatus == 3) {
  57. html += getGridBtn("notify", "重新打包", "rePackData(" + record.ID + ")");
  58. }
  59. html += getGridBtn("task", "查看订单", "viewOrder(" + record.ID + ")");
  60. return html;
  61. }
  62. function downUrl(url, id) {
  63. postAjax("addPackDownNum", { id }, function (data) {
  64. window.open(url);
  65. resultShow(data, "grid.reload();");
  66. });
  67. }
  68. function viewOrder(id) {
  69. postAjax("get_pack_order_list", { packId: id }, function (data) {
  70. let tableHtml = "";
  71. if (data.data.length == 0) {
  72. mini.alert("无订单记录!");
  73. }
  74. for (let i = 0; i < data.data.length; i++) {
  75. let item = data.data[i];
  76. tableHtml += `<tr>
  77. <td>${item.ctid}</td>
  78. <td>${item.seller_memo}</td>
  79. <td>${item.message}</td>
  80. </tr>`;
  81. }
  82. let html = `<div style="font-size: 20px;row-gap: 10px;display: flex;flex-direction: column;">
  83. <table border="1">
  84. <tr>
  85. <th>订单编号</th>
  86. <th>文件名</th>
  87. <th>信息</th>
  88. </tr>
  89. ${tableHtml}
  90. </table>
  91. </div>
  92. <style>.mini-messagebox-content td{font-size:14px;padding: 5px;}.mini-panel-body{overflow-y: scroll !important;}</style>`;
  93. mini.showMessageBox({
  94. title: "订单!",
  95. iconCls: "mini-messagebox-question",
  96. maxWidth: 1200,
  97. maxHeight: 500,
  98. html,
  99. })
  100. });
  101. }
  102. </script>
  103. </asp:Content>
  104. <asp:Content ID="Content2" ContentPlaceHolderID="btn" runat="Server">
  105. </asp:Content>
  106. <asp:Content ID="Content4" ContentPlaceHolderID="content" runat="Server">
  107. <div class="mini-fit">
  108. <div id="m_grid" class="mini-datagrid" style="width: 98%;" contextmenu="#gridMenu" showemptytext="true" emptytext="暂无记录" url="../handler/sync.ashx?t=get_pack_list">
  109. <div property="columns">
  110. <div type="checkcolumn" width="20"></div>
  111. <div field="fileName" width="110" align="center" headeralign="center">名称</div>
  112. <div field="createtime" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">创建时间</div>
  113. <div field="upStatus" width="50" align="center" headeralign="center" renderer="supStateRenderer">状态</div>
  114. <div field="message" width="200" align="center" headeralign="center">说明</div>
  115. <div field="downNum" width="80" align="center" headeralign="center">下载次数</div>
  116. <div field="SupplierName" width="60" align="center" headeralign="center">车间</div>
  117. <div field="createName" width="60" align="center" headeralign="center">创建人</div>
  118. <div name="action" width="60" headeralign="center" align="center" renderer="actionRenderer" cellstyle="padding:0;">#</div>
  119. </div>
  120. </div>
  121. </div>
  122. </asp:Content>