纽威
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.

360 lines
20 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. $(function () {
  7. gridList();
  8. })
  9. function gridList() {
  10. var $gridList = $("#gridList");
  11. $gridList.dataGrid({
  12. url: "/ProductManage/PreSell/GetGridJson",
  13. height: $(window).height() - 96,
  14. colModel: [
  15. { label: "主键", name: "F_Id", hidden: true, key: true },
  16. { label: 'Product No', name: 'ProductSN', width: 80, align: 'left' },
  17. { label: 'Measurement', name: 'Measurement', width: 90, align: 'left' },//尺寸
  18. { label: 'Sort', name: 'Other', width: 60, align: 'left' },//其他
  19. { label: 'Location', name: 'Location', width: 100, align: 'left' },//位置
  20. { label: 'Price', name: 'Price', width: 60, align: 'left' },//价格
  21. { label: 'Quentity', name: 'InvQty', width: 60, align: 'left' },//库存量
  22. //{ label: 'Weight', name: 'Weight', width: 60, align: 'left' },//重量
  23. {
  24. label: 'FinishedWeight', name: 'Weight', width: 100, align: 'left',
  25. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  26. },
  27. {
  28. label: 'RoughWeight', name: 'GrossWeight', width: 90, align: 'left',
  29. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  30. },
  31. { label: 'Shape', name: 'Shape', width: 60, align: 'left' },//形状
  32. {
  33. label: 'WH', name: 'WhCode', width: 60, align: 'left',
  34. formatter: function (cellvalue) {
  35. if (cellvalue == "10") {
  36. return "成品仓";
  37. } else if (cellvalue == "12") {
  38. return "评估仓";
  39. }
  40. else {
  41. return "";}
  42. }
  43. },
  44. { label: 'Certificate No', name: 'CertificateNo', width: 100, align: 'left' },//证书号码
  45. { label: 'Color', name: 'Color', width: 50, align: 'left' },//色度
  46. { label: 'Clarity', name: 'Clarity', width: 50, align: 'left' },//净度
  47. { label: 'Polish', name: 'Polish', width: 50, align: 'left' },//抛光
  48. { label: 'Symmetry', name: 'Symmetry', width: 70, align: 'left' },//对称性
  49. { label: 'Cut', name: 'Cut', width: 50, align: 'left' },//切
  50. ],
  51. pager: "#gridPager",
  52. sortname: 'ProductSN asc,Weight desc,F_CreatorTime desc',
  53. //recordpos: 'left',
  54. viewrecords: true,
  55. multiselect: true,
  56. editurl: "JqGridHandler.ashx?sign=singleEdit"
  57. });
  58. $("#divWeight a.btn-default").click(function () {
  59. $("#divWeight a.btn-default").removeClass("active");
  60. $(this).addClass("active");
  61. $('#btn_search').trigger("click");
  62. });
  63. $("#divShape a.btn-default").click(function () {
  64. $("#divShape a.btn-default").removeClass("active");
  65. $(this).addClass("active");
  66. $('#btn_search').trigger("click");
  67. });
  68. $("#divColor a.btn-default").click(function () {
  69. $("#divColor a.btn-default").removeClass("active");
  70. $(this).addClass("active");
  71. $('#btn_search').trigger("click");
  72. });
  73. $("#divClaritr a.btn-default").click(function () {
  74. $("#divClaritr a.btn-default").removeClass("active");
  75. $(this).addClass("active");
  76. $('#btn_search').trigger("click");
  77. });
  78. $("#divLab a.btn-default").click(function () {
  79. $("#divLab a.btn-default").removeClass("active");
  80. $(this).addClass("active");
  81. $('#btn_search').trigger("click");
  82. });
  83. $("#divPolish a.btn-default").click(function () {
  84. $("#divPolish a.btn-default").removeClass("active");
  85. $(this).addClass("active");
  86. $('#btn_search').trigger("click");
  87. });
  88. $("#divSymmerty a.btn-default").click(function () {
  89. $("#divSymmerty a.btn-default").removeClass("active");
  90. $(this).addClass("active");
  91. $('#btn_search').trigger("click");
  92. });
  93. $("#divCut a.btn-default").click(function () {
  94. $("#divCut a.btn-default").removeClass("active");
  95. $(this).addClass("active");
  96. $('#btn_search').trigger("click");
  97. });
  98. $("#divLoaction a.btn-default").click(function () {
  99. $("#divLoaction a.btn-default").removeClass("active");
  100. $(this).addClass("active");
  101. $('#btn_search').trigger("click");
  102. });
  103. $("#divSort a.btn-default").click(function () {
  104. $("#divSort a.btn-default").removeClass("active");
  105. $(this).addClass("active");
  106. $('#btn_search').trigger("click");
  107. });
  108. $("#btn_search").click(function () {
  109. var Weight = $("#divWeight a.active").attr('data-value');
  110. var Shape = $("#divShape a.active").attr('data-value');
  111. var Color = $("#divColor a.active").attr('data-value');
  112. var Clarity = $("#divClarity a.active").attr('data-value');
  113. var Lab = $("#divLab a.active").attr('data-value');
  114. var Polish = $("#divPolish a.active").attr('data-value');
  115. var Symmerty = $("#divSymmerty a.active").attr('data-value');
  116. var Cut = $("#divCut a.active").attr('data-value');
  117. var Location = $("#divLoaction a.active").attr('data-value');
  118. var Sort = $("#divSort a.active").attr('data-value');
  119. var queryJson = {
  120. weight: Weight,
  121. shape: Shape,
  122. color: Color,
  123. clarity: Clarity,
  124. lab: Lab,
  125. polish: Polish,
  126. symmerty: Symmerty,
  127. cut: Cut,
  128. location: Location,
  129. sort: Sort,
  130. }
  131. $gridList.jqGrid('setGridParam', {
  132. postData: { queryJson: JSON.stringify(queryJson) },
  133. }).trigger('reloadGrid');
  134. });
  135. }
  136. function btn_details(cellvalue) {
  137. //var keyValue = $("#gridList").jqGridRowValue().F_Id;
  138. var keyValues = $("#gridList").jqGrid('getGridParam', 'selrow');
  139. $.modalOpen({
  140. id: "Details",
  141. title: "Look",
  142. url: "/ProductManage/PreSell/Details?keyValue=" + keyValues,
  143. width: "550px",
  144. height: "380px",
  145. btn: null,
  146. });
  147. }
  148. function btn_order() {
  149. var ids = $('#gridList').jqGrid('getGridParam', 'selarrrow');
  150. var keyValues = "";
  151. for (var i = 0; i < ids.length; i++) {
  152. if (i == 0)
  153. keyValues += ids[i];
  154. else
  155. keyValues += "," + ids[i];
  156. }
  157. $.modalOpen({
  158. id: "Orders",
  159. title: "Order selection",
  160. url: "/ProductManage/PreSell/Orders?keyValues=" + keyValues,
  161. width: "330px",
  162. height: "360px",
  163. callBack: function (iframeId) {
  164. top.frames[iframeId].submitForm();
  165. }
  166. });
  167. }
  168. function download(options) {
  169. var defaults = {
  170. method: "GET",
  171. url: "",
  172. param: []
  173. };
  174. var options = $.extend(defaults, options);
  175. if (options.url && options.param) {
  176. var $form = $('<form action="' + options.url + '" method="' + (options.method || 'post') + '"></form>');
  177. for (var key in options.param) {
  178. var $input = $('<input type="hidden" data-back="backdw" />').attr('name', key).val(options.param[key]);
  179. $form.append($input);
  180. }
  181. $form.appendTo('body').submit().remove();
  182. };
  183. }
  184. function btn_export() {
  185. var keyValue = $("#gridList").getDataIDs();
  186. if (keyValue == null || keyValue == "") {
  187. alert("没有可导出的数据.");
  188. return false;
  189. }
  190. download({
  191. method: "POST",
  192. url: '/ProductManage/PreSell/Export',
  193. param: {
  194. keyValue: keyValue
  195. }
  196. });
  197. }
  198. </script>
  199. <div class="topPanel" style="height:200px;">
  200. <div class="toolbar">
  201. <div class="btn-group">
  202. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  203. <a id="NF-Export" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_export()"><i class="fa fa-search-plus"></i>Export</a>
  204. <a id="NF-Details" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_details()"><i class="fa fa-search-plus"></i>Look</a>
  205. <a id="NF-Order" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_order()"><i class="fa fa-plus"></i>Order</a>
  206. </div>
  207. <script>$('.toolbar').authorizeButton()</script>
  208. </div>
  209. <div class="search">
  210. <table>
  211. <tr>
  212. <td>
  213. <div class="input-group">
  214. <input id="txt_Weight" type="text" class="form-control txttotxt" value="Weight" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  215. <div id="divWeight" class="btn-group">
  216. <a class="btn btn-default btn2 active" style="min-width:35px;" data-value="0">All</a>
  217. <a class="btn btn-default btn2" data-value="1">&lt;&nbsp;0.5ct</a>
  218. <a class="btn btn-default btn2" data-value="2">0.5-0.69ct</a>
  219. <a class="btn btn-default btn2" data-value="3">0.7-0.89ct</a>
  220. <a class="btn btn-default btn2" data-value="4">0.9-0.99ct</a>
  221. <a class="btn btn-default btn2" data-value="5">1.0-1.49ct</a>
  222. <a class="btn btn-default btn2" data-value="6">1.5-1.99ct</a>
  223. <a class="btn btn-default btn2" data-value="7">2.0-2.99ct</a>
  224. <a class="btn btn-default btn2" data-value="8">3.0-3.99ct</a>
  225. <a class="btn btn-default btn2" data-value="9">4.0-4.99ct</a>
  226. <a class="btn btn-default btn2" data-value="10">5.0-5.99ct</a>
  227. </div>
  228. </div>
  229. <div class="input-group">
  230. <input id="txt_Shape" type="text" class="form-control txttotxt" value="Shape" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  231. <div id="divShape" class="btn-group">
  232. <a class="btn btn-default btn2 active" style="min-width:35px;" data-value="0">All</a>
  233. <a class="btn btn-default btn2" data-value="1">Round</a>
  234. <a class="btn btn-default btn2" data-value="2">Pear</a>
  235. <a class="btn btn-default btn2" data-value="3">Oval</a>
  236. <a class="btn btn-default btn2" data-value="4">Heart</a>
  237. <a class="btn btn-default btn2" data-value="5">Emerald</a>
  238. <a class="btn btn-default btn2" data-value="6">Radiant</a>
  239. <a class="btn btn-default btn2" data-value="7">Asscher</a>
  240. <a class="btn btn-default btn2" data-value="8">Princess</a>
  241. <a class="btn btn-default btn2" data-value="9">Cushion</a>
  242. </div>
  243. </div>
  244. @*<div class="input-group">
  245. <input id="txt_Size" type="text" class="form-control txttotxt" value="Size:" style="width:50px;border:0;padding:1px 3px;font-size:14px;" />:
  246. <div id="divSize" class="btn-group">
  247. <input id="txt_From" type="text" class="form-control txttotxt" value="From" style="width:40px;border:0;padding:1px 3px;font-size:14px;" />
  248. <input id="txt_keyword" type="text" class="form-control" placeholder="Min Size" style="width: 100px;">
  249. <input id="txt_TO" type="text" class="form-control txttotxt" value="TO" style="width:28px;border:0;padding:1px 3px;font-size:14px;" />
  250. <input id="txt_keyword2" type="text" class="form-control" placeholder="Max Size" style="width: 100px;">
  251. </div>
  252. </div>*@
  253. <div class="input-group">
  254. <input id="txt_Color" type="text" class="form-control txttotxt" value="Color" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  255. <div id="divColor" class="btn-group">
  256. <a class="btn btn-default btn3 active" data-value="0">All</a>
  257. <a class="btn btn-default btn3" data-value="1">D</a>
  258. <a class="btn btn-default btn3" data-value="2">E</a>
  259. <a class="btn btn-default btn3" data-value="3">F</a>
  260. <a class="btn btn-default btn3" data-value="4">G</a>
  261. <a class="btn btn-default btn3" data-value="5">H</a>
  262. <a class="btn btn-default btn3" data-value="6">I</a>
  263. <a class="btn btn-default btn3" data-value="7">J</a>
  264. <a class="btn btn-default btn3" data-value="8">K</a>
  265. <a class="btn btn-default btn3" data-value="9">L</a>
  266. <a class="btn btn-default btn3" data-value="10">M</a>
  267. <a class="btn btn-default btn3" data-value="11">N</a>
  268. </div>
  269. @*--------------------------------------------------------------------------------*@
  270. <input id="empty1" type="text" value="" style="border:0;width:21px;" />Lab:
  271. <div id="divLab" class="btn-group">
  272. <a class="btn btn-default btn3 active" data-value="0">All</a>
  273. <a class="btn btn-default btn3" data-value="1">IGI</a>
  274. <a class="btn btn-default btn3" style="min-width:40px;" data-value="2">Other</a>
  275. <button id="btn_search" type="button" class="btn btn-primary" style="display:none;"><i class="fa fa-search"></i></button>
  276. </div>
  277. </div>
  278. <div class="input-group">
  279. <input id="txt_Clarity" type="text" class="form-control txttotxt" value="Clarity" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  280. <div id="divClarity" class="btn-group">
  281. <a class="btn btn-default btn3 active" data-value="0">All</a>
  282. <a class="btn btn-default btn3" data-value="1">IF</a>
  283. <a class="btn btn-default btn3" data-value="2">VVS1</a>
  284. <a class="btn btn-default btn3" data-value="3">VVS2</a>
  285. <a class="btn btn-default btn3" data-value="4">VS1</a>
  286. <a class="btn btn-default btn3" data-value="5">VS2</a>
  287. <a class="btn btn-default btn3" data-value="6">SI1</a>
  288. <a class="btn btn-default btn3" data-value="7">SI2</a>
  289. <a class="btn btn-default btn3" data-value="8">SI3</a>
  290. <a class="btn btn-default btn3" data-value="9">I1</a>
  291. <a class="btn btn-default btn3" data-value="10">I2</a>
  292. <a class="btn btn-default btn3" data-value="11">I3</a>
  293. </div>
  294. @*--------------------------------------------------------------------------------*@
  295. <input id="empty3" type="text" value="" style="border:0;width:20px;" />Cut:
  296. <div id="divCut" class="btn-group">
  297. <a class="btn btn-default btn3 active" data-value="0" style="width:30px">All</a>
  298. <a class="btn btn-default btn3" data-value="1">EX</a>
  299. <a class="btn btn-default btn3" data-value="2">VG</a>
  300. <a class="btn btn-default btn3" data-value="3">G</a>
  301. <a class="btn btn-default btn3" data-value="4">F</a>
  302. <a class="btn btn-default btn3" data-value="5">P</a>
  303. <a class="btn btn-default btn3" data-value="6">N/A</a>
  304. </div>
  305. </div>
  306. <div class="input-group">
  307. <input id="txt_Polish" type="text" class="form-control txttotxt" value="Polish" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  308. <div id="divPolish" class="btn-group">
  309. <a class="btn btn-default btn3 active" data-value="0">All</a>
  310. <a class="btn btn-default btn3" data-value="1">EX</a>
  311. <a class="btn btn-default btn3" data-value="2">VG</a>
  312. <a class="btn btn-default btn3" data-value="3">G</a>
  313. <a class="btn btn-default btn3" data-value="4">F</a>
  314. <a class="btn btn-default btn3" data-value="5">P</a>
  315. <a class="btn btn-default btn3" data-value="6">N/A</a>
  316. </div>
  317. @*--------------------------------------------------------------------------------*@
  318. <input id="txt_Symmerty" type="text" value="" style="border:0;width:20px;" />Symmerty:
  319. <div id="divSymmerty" class="btn-group">
  320. <a class="btn btn-default btn3 active" data-value="0">All</a>
  321. <a class="btn btn-default btn3" data-value="1">EX</a>
  322. <a class="btn btn-default btn3" data-value="2">VG</a>
  323. <a class="btn btn-default btn3" data-value="3">G</a>
  324. <a class="btn btn-default btn3" data-value="4">F</a>
  325. <a class="btn btn-default btn3" data-value="5">P</a>
  326. <a class="btn btn-default btn3" data-value="6">N/A</a>
  327. </div>
  328. </div>
  329. <div class="input-group">
  330. <input id="txt_Loaction" type="text" class="form-control txttotxt" value="Location" style="width:55px;border:0;padding:1px 3px;font-size:14px;" />:
  331. <div id="divLoaction" class="btn-group">
  332. <a class="btn btn-default btn2 active" style="min-width:35px;" data-value="0">All</a>
  333. <a class="btn btn-default btn2" style="min-width:150px;" data-value="1">ShangHai Warehouse</a>
  334. <a class="btn btn-default btn2" style="min-width:150px;" data-value="2">HongKong Warehouse</a>
  335. <a class="btn btn-default btn2" style="min-width:150px;" data-value="3">U.S.A Warehouse</a>
  336. </div>
  337. @*--------------------------------------------------------------------------------*@
  338. <input id="txt_Sort" type="text" value="" style="border:0;width:20px;" />Sort:
  339. <div id="divSort" class="btn-group">
  340. <a class="btn btn-default btn3 active" data-value="0">All</a>
  341. <a class="btn btn-default btn3" style="min-width:78px;" data-value="1">Rough</a>
  342. <a class="btn btn-default btn3" style="min-width:78px;" data-value="2">Polished</a>
  343. </div>
  344. </div>
  345. </td>
  346. </tr>
  347. </table>
  348. </div>
  349. </div>
  350. <div class="gridPanel">
  351. <table id="gridList"></table>
  352. <div id="gridPager"></div>
  353. </div>