GoGetOrder.aspx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/View.master" AutoEventWireup="true" CodeFile="GoGetOrder.aspx.cs" Inherits="EOrder_GoGetOrder" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
  3. <script src="../js/plugins/jquery.fileDownload.js"></script>
  4. <script type="text/javascript">
  5. var tradeData = null;
  6. var orderData = null;
  7. var productData = null;
  8. var _select_ProductId = "";
  9. var _select_ProName = "";
  10. var _select_Mat = "";
  11. var _select_Cra = ""
  12. var _matBtnList = [];
  13. var _craBtnList = [];
  14. $(function () {
  15. console.log("xxxxx", productData);
  16. if (tradeData != null && tradeData.length > 0) {
  17. var tData = tradeData[0];
  18. orderData = tData;
  19. $("#id_detailMemo").html("<div style='display:flex;flex-direction:row;'><div>订单号:" + tData.ctid + "</div> <div style='margin-left:50px;'>店铺:" + tData.seller_nick + " </div><div style='margin-left:50px;'> 旺旺:" + tData.buyer_nick+"</div></div>");
  20. }
  21. if (productData != null) {
  22. var pHtml = "";
  23. for (var pItem of productData) {
  24. pHtml += ("<button id=\"id_pro_" + pItem.ID + "\" class=\"pbtn\" onclick=\"onProCheckedChanged('" + pItem.ID + "')\" >" + pItem.PType + "</button>");
  25. }
  26. $("#id_product").html(pHtml);
  27. }
  28. });
  29. function onProCheckedChanged(checkID) {
  30. checkedProduct(checkID);
  31. }
  32. function checkedProduct(pID) {
  33. for (var pItem of productData) {
  34. $("#id_pro_" + pItem.ID).removeClass("pbtn_sel");
  35. if (pItem.ID == pID) {
  36. _select_ProductId = pItem.ID;
  37. _select_ProName = pItem.PType;
  38. $("#id_pro_" + pItem.ID).addClass("pbtn_sel");
  39. setMaterial(pItem.PMaterial, pItem.PCraft);
  40. }
  41. }
  42. }
  43. function setMaterial(material, craft) {
  44. var matList = material.split(';');
  45. var craList = craft.split(';');
  46. $("#id_material").html("");
  47. $("#id_craft").html("");
  48. _craBtnList = [];
  49. _matBtnList = [];
  50. var marId = 0;
  51. if (matList.length > 0) {
  52. var mHtml = "";
  53. for (var pItem of matList) {
  54. if (pItem.length > 0) {
  55. mHtml += ("<button id=\"id_mat_" + marId + "\" class=\"pbtn\" onclick=\"onMatCheckedChanged('" + pItem + "'," + marId + ")\" >" + pItem + "</button>");
  56. _matBtnList.push("id_mat_" + marId);
  57. }
  58. marId++;
  59. }
  60. $("#id_material").html(mHtml);
  61. }
  62. var craftId = 0;
  63. if (craList.length > 0) {
  64. var cHtml = "";
  65. for (var pItem of craList) {
  66. if (pItem.length > 0) {
  67. cHtml += ("<button id=\"id_cra_" + craftId + "\" class=\"pbtn\" onclick=\"onCraCheckedChanged('" + pItem + "'," + craftId + ")\" >" + pItem + "</button>");
  68. _craBtnList.push("id_cra_" + craftId);
  69. }
  70. craftId++;
  71. }
  72. $("#id_craft").html(cHtml);
  73. }
  74. }
  75. function onMatCheckedChanged(mat, matId) {
  76. for (var btn of _matBtnList) {
  77. $("#" + btn).removeClass("pbtn_sel");
  78. }
  79. $("#id_mat_" + matId).addClass("pbtn_sel");
  80. _select_Mat = mat;
  81. }
  82. function onCraCheckedChanged(cra, craId) {
  83. for (var btn of _craBtnList) {
  84. $("#" + btn).removeClass("pbtn_sel");
  85. }
  86. $("#id_cra_" + craId).addClass("pbtn_sel");
  87. _select_Cra = cra;
  88. }
  89. function setFileName() {
  90. var long = $("#txtLong").val();
  91. var width = $("#txtWidth").val();
  92. var height = $("#txtHeight").val();
  93. var psize = "";
  94. if (long.length > 0) {
  95. psize += long;
  96. }
  97. if (width.length > 0) {
  98. if (psize.length > 0) {
  99. psize += "x";
  100. }
  101. psize += width;
  102. }
  103. if (height.length > 0) {
  104. if (psize.length > 0) {
  105. psize += "x";
  106. }
  107. psize += height;
  108. }
  109. if (psize.length > 0) {
  110. psize += "mm";
  111. }
  112. var pcount = $("#txtCount").val();
  113. var filename = "("+orderData.ctid + ")-" + psize + "-" + pcount + "-" + _select_ProName + _select_Mat + _select_Cra + "-" + orderData.buyer_nick + "-" + orderData.receiver_state;
  114. mini.get("txtSellerMemo").setValue(filename);
  115. }
  116. function professionChanged(e){
  117. var id = mini.get("txtProfession").getValue();
  118. mini.get("txtSmallPro").setValue("");
  119. var url = "../handler/sync.ashx?t=get_small_profession&pid=" + id
  120. mini.get("txtSmallPro").setUrl(url);
  121. mini.get("txtSmallPro").select(0);
  122. }
  123. function saveGetOrderFn() {
  124. var parms = new Object();
  125. parms.ctid = orderData.ctid;
  126. parms.productId = _select_ProductId;
  127. parms.material = _select_Mat;
  128. parms.craft = _select_Cra;
  129. parms.sellerMemo = mini.get("txtSellerMemo").getValue();
  130. parms.otherMemo = mini.get("txtOtherMemo").getValue();
  131. parms.urgency = $("#txtUrgency")[0].checked ? "1" : "0";
  132. parms.wechat = $("#txtWechat")[0].checked ? "1" : "0";
  133. parms.command = $("#txtCommand")[0].checked ? "1" : "0";
  134. parms.pprofession = mini.get("txtProfession").getValue();
  135. parms.profession = mini.get("txtSmallPro").getValue();
  136. postAjax("getmyorder_from_init", parms, function (data) {
  137. resultShow(data, "grid.reload()");
  138. closeFn("save");
  139. });
  140. }
  141. function cancelGetOrderFn() {
  142. closeFn();
  143. }
  144. </script>
  145. <style type="text/css">
  146. .win_tb {
  147. width: 96%;
  148. margin-left: auto;
  149. margin-right: auto;
  150. margin-top: 10px;
  151. background-color: #dedede;
  152. }
  153. .pbtn_content{
  154. width:90%;
  155. }
  156. .pbtn{
  157. width:auto;
  158. text-align:center;
  159. min-width:50px;
  160. height:25px;
  161. line-height:25px;
  162. margin-left:15px;
  163. margin-top:10px;
  164. border:1px solid gray;
  165. padding-left:5px;
  166. padding-right:5px;
  167. }
  168. .pbtn_sel{
  169. width:auto;
  170. text-align:center;
  171. background-color:Highlight;
  172. color:white;
  173. min-width:50px;
  174. height:25px;
  175. line-height:25px;
  176. margin-left:15px;
  177. margin-top:10px;
  178. border:1px solid gray;
  179. padding-left:5px;
  180. padding-right:5px;
  181. }
  182. .win_tb td {
  183. height: 36px;
  184. background-color: #fff;
  185. font-size: 14px;
  186. padding: 5px;
  187. }
  188. .win_tb input[type=text] {
  189. width: 90%;
  190. height: 24px;
  191. font-size: 14px;
  192. }
  193. .win_tb input[type=checkbox] {
  194. width: 18px;
  195. height: 18px;
  196. }
  197. .win_tb select {
  198. font-size: 14px;
  199. height: 30px;
  200. padding: 0px 5px;
  201. }
  202. .win_tb .td1 {
  203. color: #666;
  204. background-color: #F8F8F8;
  205. text-align: center;
  206. }
  207. .win_tb .td2 {
  208. }
  209. .word_tui {
  210. border-radius: 50%;
  211. background-color: red;
  212. color: white;
  213. font-size: 14px;
  214. text-align: center;
  215. padding: 3px;
  216. margin-left: 5px;
  217. }
  218. .word_shou {
  219. background-color: saddlebrown;
  220. }
  221. .word_green {
  222. background-color: forestgreen;
  223. }
  224. .state_word{
  225. width:70px;
  226. text-align:center;
  227. padding:3px 6px;
  228. text-align:center;
  229. font-weight:bold;
  230. color:white;
  231. background-color:forestgreen;
  232. }
  233. .mini-grid-cell-nowrap {
  234. overflow: hidden;
  235. /* white-space: nowrap;
  236. text-overflow: ellipsis; */
  237. word-break: keep-all;
  238. word-wrap: break-word;
  239. white-space: normal;
  240. }
  241. .mini-tab-text{
  242. padding:4px;
  243. }
  244. .order-info{
  245. font-size:14px;
  246. width:98%;
  247. margin:0px auto;
  248. }
  249. .order-info fieldset{
  250. border: solid 1px #dedede; padding: 3px;
  251. margin-bottom:10px;
  252. color:#666;
  253. line-height:25px;
  254. }
  255. .order-detail{
  256. font-size:14px;
  257. width:98%;
  258. margin:0px auto;
  259. }
  260. .order-detail fieldset{
  261. border: solid 1px #dedede;
  262. padding: 3px;
  263. margin-bottom:10px;
  264. color:#666;
  265. line-height:25px;
  266. }
  267. .mini-tabs-scrollCt{
  268. border:0px;
  269. margin-top:5px;
  270. }
  271. /*.win_tb input{height:20px;}
  272. .win_tb .td1{height:35px;width:120px;font-size:12px;text-align:center;}
  273. .win_tb .td2{height:35px;width:280px;font-size:12pt;padding-left:5px;text-align:left;}*/
  274. </style>
  275. </asp:Content>
  276. <asp:Content ID="Content2" ContentPlaceHolderID="btn" runat="Server">
  277. <div style="width: 100%;">
  278. <div class="order-info">
  279. <fieldset>
  280. <legend>基本信息</legend>
  281. <div style="padding: 5px;" id="id_detailMemo">
  282. </div>
  283. </fieldset>
  284. <fieldset>
  285. <legend>文件名(产品规格)</legend>
  286. <div style="display: flex; flex-direction: column;">
  287. <div style="display: flex; flex-direction: row; border-bottom: 1px solid gray; padding-bottom: 15px;">
  288. <div style="width: 5%;">产品:</div>
  289. <div style="width: 94%;" id="id_product">
  290. </div>
  291. </div>
  292. <div style="display: flex; flex-direction: row; border-bottom: 1px solid gray; padding-bottom: 15px;">
  293. <div style="width: 5%;">材质:</div>
  294. <div style="width: 94%;" id="id_material">
  295. </div>
  296. </div>
  297. <div style="display: flex; flex-direction: row;border-bottom: 1px solid gray; padding-bottom: 15px;">
  298. <div style="width: 5%;">工艺:</div>
  299. <div style="width: 94%;" id="id_craft">
  300. </div>
  301. </div>
  302. </div>
  303. <div style="display: flex; flex-direction: column;">
  304. <div style="margin-top:6px;margin-bottom:10px;">
  305. <span style="width: 5%;">尺寸:</span><span>长</span><input style="width:50px; height:20px;" type="text" id="txtLong" /><span>宽</span><input style="width:50px; height:20px;" type="text" id="txtWidth" /><span>高</span><input style="width:50px; height:20px;" type="text" id="txtHeight" /><span>mm</span>
  306. <span style="width: 5%;margin-left:15px;">数量:</span><input style="height:20px;" type="text" id="txtCount" />
  307. </div>
  308. <div style="display:flex;flex-direction:column;">
  309. <span style="width: 100%;">产品规格(文件名)</span>
  310. <div>
  311. <textarea id="txtSellerMemo" class="mini-textarea" style="width: 60%; height: 60px;"></textarea>
  312. <textarea id="txtOtherMemo" class="mini-textarea" emptyText="请输入额外的备注" style="width: 20%; height: 60px;"></textarea>
  313. <a class="mini-button mini-button-info" style="margin-left:10px;margin-bottom:5px;" iconcls="icon-edit" onclick="setFileName">生成文件名</a>
  314. </div>
  315. </div>
  316. </div>
  317. </fieldset>
  318. <fieldset>
  319. <legend>特殊标记</legend>
  320. <div style="padding: 5px;">
  321. <span>是否加急</span>
  322. <input type="checkbox" id="txtUrgency" />
  323. <span style="margin-left:15px;">微信单</span>
  324. <input type="checkbox" id="txtWechat" />
  325. <span style="margin-left:15px;">推购单</span>
  326. <input type="checkbox" id="txtCommand" />
  327. <span style="margin-left:15px;">大行业</span>
  328. <input id="txtProfession" class="mini-combobox" style="width: 150px;" textfield="name" valuefield="id" onvaluechanged="professionChanged" url="../handler/sync.ashx?t=get_erp_profession" shownullitem="true" />
  329. <span>小行业</span>
  330. <input id="txtSmallPro" class="mini-combobox" style="width: 150px;" textfield="name" valuefield="id" />
  331. </div>
  332. </fieldset>
  333. <a class="mini-button mini-button-success" style="margin-left:40%; margin-top:15px;margin-bottom:15px;" iconcls="icon-ok" onclick="saveGetOrderFn">领单</a>&nbsp;
  334. <a class="mini-button mini-button-danger" style="margin-left:20px;margin-top:15px; margin-bottom:15px;" iconcls="icon-cancel" onclick="cancelGetOrderFn">取消</a>
  335. </div>
  336. </div>
  337. </asp:Content>