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.

842 lines
34 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <style>
  6. .btn-primary {
  7. margin-right: 2px;
  8. }
  9. .topPanel .toolbar {
  10. float: left;
  11. }
  12. /*.ui-jqgrid tr.jqgrow td {
  13. white-space: normal !important;
  14. height: auto;
  15. }*/
  16. </style>
  17. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  18. <script>
  19. //var _MenuCaption = "";
  20. var _MenuTag = "";
  21. var mold = $.request("mold");
  22. var _MenuID = "";//菜单ID
  23. var _SourceID = "";//数据源ID
  24. var _sqlTxt = "";//加上参数的sql
  25. var _sqlTxt_Condition = new Array();//加上过滤条件的sql
  26. var _sqlTxt_AddCondition = "";//加上过滤条件的sql
  27. var _IsExistsDataSource = "";
  28. var _DBName = "";//s数据库
  29. var _Cols = new Array();//列
  30. var _ReportName = "";
  31. var _Filter = "";
  32. var _TempName = "";
  33. var _footerrow = false;//是否有合计项
  34. var _footercols = new Array();//合计项
  35. var _formatcols = new Array();//个性化项
  36. var _formatcols_Row = new Array();//个性化项的行
  37. var _Mergercols = new Array();//合并项
  38. var _XCol = "";
  39. var dataRR = "";
  40. var _HiddenCols = new Array();
  41. $(function () {
  42. debugger;
  43. //1、获取当前页菜单名
  44. GetMenuID();
  45. //2、获取菜单设置
  46. GetMenu();
  47. //gridList();
  48. $(window).resize(function () {
  49. $("#gridList").setGridWidth($(window).width() * 0.99);
  50. $("#gridList").setGridWidth(document.body.clientWidth * 0.99);
  51. $("#gridList").setGridHeight($(window).height() - 132);
  52. $("#gridList").setGridHeight(document.body.clientHeight - 132);
  53. });
  54. });
  55. //1、获取当前页菜单名
  56. function GetMenuID() {
  57. debugger;
  58. var cc = self.frameElement.getAttribute('id');
  59. _MenuID = cc.replace("iframe", "");
  60. //_MenuTag = $.request("MenuTag");
  61. //$.ajax({
  62. // url: "/SystemManage/CommonReport/GetMenuID?MenuTag=" + _MenuTag + "&" + Math.random(),
  63. // dataType: "json",
  64. // async: false,
  65. // success: function (data) {
  66. // if (data != false && data != null && data.length > 0) {
  67. // _MenuID = data[0].MenuID;
  68. // }
  69. // else {
  70. // alert("获取菜单ID异常,请查看菜单配置并刷新:" + data);
  71. // }
  72. // },
  73. // error: function (aa) {
  74. // alert("异常:" + aa.responseText);
  75. // }
  76. //});
  77. }
  78. //2、获取菜单设置 URL 列 等
  79. function GetMenu() {
  80. debugger;
  81. $.ajax({
  82. url: "/SystemManage/CommonReport/GetMenu?MenuID=" + _MenuID + "&" + Math.random(),
  83. dataType: "json",
  84. async: false,
  85. success: function (data) {
  86. if (data != false && data != null) {
  87. _sqlTxt = data.sqlTxt;
  88. _sqlTxt_AddCondition = data.sqlTxt;
  89. _DBName = data.DBName;
  90. _SourceID = data.SourceID;
  91. _IsExistsDataSource = data.IsExistsDataSource;
  92. _ReportName = data.ReportName;
  93. _XCol = data.XCol;
  94. _Mergercols = eval(data.Mergercols);
  95. _formatcols = data.formatcols;
  96. _TempName = data.TempName;
  97. _footerrow = data.footerrow;
  98. _footercols = eval(data.footercols);
  99. _Cols = SetCols(eval(data.Cols));
  100. _HiddenCols = eval(data.HiddenCols);
  101. btn_Filter();
  102. }
  103. else {
  104. alert("获取菜单栏位等信息异常。" + data);
  105. }
  106. },
  107. error: function (aa) {
  108. alert("异常:" + aa.responseText);
  109. }
  110. });
  111. }
  112. //个性化栏位背景色
  113. function addCellAttr(rowId, val, rawObject, cm, rdata) {
  114. var rr = ' id=\'' + cm.name + '' + rowId + "\' ";
  115. var formatList = Getformatcol(_formatcols, cm.name);//获取format所有条件
  116. if (formatList != null && formatList.length > 0) {
  117. for (var i = 0; i < formatList.length; i++) {
  118. var formatcol = formatList[i];//条件
  119. var IsRow = false;
  120. if (formatcol.AllRowFlag) {
  121. IsRow = true;
  122. var rr = {
  123. rowid: rowId - 1,
  124. backgroundcolor: formatcol.Color,
  125. }
  126. }
  127. var FormatDataType = formatcol.DataType;
  128. var LogStr = GetLogStringByNum(parseInt(formatcol.LogStr));
  129. if (FormatDataType != "日期型") {
  130. switch (LogStr) {
  131. case "等于": if (val == formatcol.SValue) {
  132. if (IsRow) { _formatcols_Row.push(rr); }
  133. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  134. }
  135. break;
  136. case "不等于": if (val != formatcol.SValue) {
  137. if (IsRow) { _formatcols_Row.push(rr); }
  138. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  139. }
  140. break;
  141. case "小于": if (val < formatcol.SValue) {
  142. if (IsRow) { _formatcols_Row.push(rr); }
  143. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  144. }
  145. break;
  146. case "大于": if (val > formatcol.SValue) {
  147. if (IsRow) { _formatcols_Row.push(rr); }
  148. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  149. }
  150. break;
  151. case "小于等于": if (val <= formatcol.SValue) {
  152. if (IsRow) { _formatcols_Row.push(rr); }
  153. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  154. }
  155. break;
  156. case "大于等于": if (val >= formatcol.SValue) {
  157. if (IsRow) { _formatcols_Row.push(rr); }
  158. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  159. }
  160. break;
  161. case "范围内": if (val >= formatcol.SValue && val <= formatcol.DValue) {
  162. if (IsRow) { _formatcols_Row.push(rr); }
  163. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  164. }
  165. break;
  166. case "范围外": if (val < formatcol.SValue || val > formatcol.DValue) {
  167. if (IsRow) { _formatcols_Row.push(rr); }
  168. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  169. }
  170. break;
  171. case "包含": if (val.indexOf(formatcol.SValue) != -1) {
  172. if (IsRow) { _formatcols_Row.push(rr); }
  173. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  174. }
  175. break;
  176. case "头部包含": if (val.indexOf(formatcol.SValue) == 0) {
  177. if (IsRow) { _formatcols_Row.push(rr); }
  178. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  179. }
  180. break;
  181. case "尾部包含": if (val.indexOf(formatcol.SValue) == formatcol.length - val.length) {
  182. if (IsRow) { _formatcols_Row.push(rr); }
  183. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  184. }
  185. break;
  186. case "不包含": if (val.indexOf(formatcol.SValue) == -1) {
  187. if (IsRow) { _formatcols_Row.push(rr); }
  188. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  189. }
  190. break;
  191. }
  192. }
  193. else {
  194. //日期型
  195. if (val.length >= 10) {
  196. var VV = val.substring(0, 10);
  197. switch (LogStr) {
  198. case "等于":
  199. if (VV == formatcol.SValue) {
  200. if (IsRow) { _formatcols_Row.push(rr); }
  201. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  202. }
  203. break;
  204. case "不等于": if (VV != formatcol.SValue) {
  205. if (IsRow) { _formatcols_Row.push(rr); }
  206. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  207. }
  208. break;
  209. case "小于":
  210. if (VV < formatcol.SValue) {
  211. if (IsRow) { _formatcols_Row.push(rr); }
  212. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  213. }
  214. break;
  215. case "大于": if (VV > formatcol.SValue) {
  216. if (IsRow) { _formatcols_Row.push(rr); }
  217. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  218. }
  219. break;
  220. case "小于等于": if (VV <= formatcol.SValue) {
  221. if (IsRow) { _formatcols_Row.push(rr); }
  222. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  223. }
  224. break;
  225. case "大于等于": if (VV >= formatcol.SValue) {
  226. if (IsRow) { _formatcols_Row.push(rr); }
  227. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  228. }
  229. break;
  230. case "范围内": if (VV >= formatcol.SValue && VV <= formatcol.DValue) {
  231. if (IsRow) { _formatcols_Row.push(rr); }
  232. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  233. }
  234. break;
  235. case "范围外": if (VV < formatcol.SValue || VV > formatcol.DValue) {
  236. if (IsRow) { _formatcols_Row.push(rr); }
  237. else { rr += "style='background-color:" + formatcol.Color + "'"; return rr; }
  238. }
  239. break;
  240. }
  241. }
  242. }
  243. }
  244. }
  245. return rr;
  246. }
  247. //个性化栏位背景色
  248. function addCellAttr_ID(rowId, val, rawObject, cm, rdata) {
  249. var rr = ' id=\'' + cm.name + '' + rowId + "\' ";
  250. return rr;
  251. }
  252. function Getformatcol(formatcols, colname) {
  253. var formatList = new Array();
  254. if (formatcols != null && formatcols.length > 0) {
  255. for (var i = 0; i < formatcols.length; i++) {
  256. if (formatcols[i].ColFiledName == colname) {
  257. formatList.push(formatcols[i]);
  258. }
  259. }
  260. }
  261. return formatList;
  262. }
  263. //生成colModel
  264. function SetCols(datacols) {
  265. var cols = new Array();
  266. if (datacols != null && datacols.length > 0) {
  267. for (var i = 0; i < datacols.length; i++) {
  268. var ColCaption = datacols[i].ColCaption;
  269. var ColFiledName = datacols[i].ColFiledName;
  270. var DataType = datacols[i].DataType;
  271. var DataTypeStr = GetDataTypeByNum(DataType);
  272. var ColWidth = datacols[i].ColWidth;
  273. var DeciamlNum = datacols[i].DeciamlNum;
  274. var sortable = datacols[i].sortable;
  275. var ColMerFlag = datacols[i].ColMerFlag;
  276. var IsFormat = datacols[i].IsFormat;
  277. var obj = new Array();
  278. if (IsFormat == "1") {
  279. obj = {
  280. label: ColCaption,
  281. name: ColFiledName,
  282. width: ColWidth,
  283. align: "left",
  284. sortable: sortable,
  285. cellattr: addCellAttr,
  286. }
  287. }
  288. else {
  289. obj = {
  290. label: ColCaption,
  291. name: ColFiledName,
  292. width: ColWidth,
  293. align: "left",
  294. sortable: sortable,
  295. cellattr: addCellAttr_ID,
  296. }
  297. }
  298. switch (DataTypeStr) {
  299. case "数值型":
  300. var Formatoptions = new { decimalPlaces: DeciamlNum };
  301. obj.push({ formatter: "number" });
  302. obj.push({ formatoptions: Formatoptions });
  303. break;
  304. case "字符型":
  305. case "日期型":
  306. case "布尔值":
  307. break;
  308. }
  309. //if (IsFormat) {
  310. // obj.push({ cellattr: addCellAttr });
  311. //}
  312. cols.push(obj);
  313. }
  314. var collast = { label: "", name: "", width: "20", align: "left", sortable: false };
  315. cols.push(collast);
  316. }
  317. return cols;
  318. }
  319. function gridList() {
  320. document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';//重置grid
  321. _formatcols_Row = new Array();
  322. var $gridList = $("#gridList");
  323. var condion = new Array();
  324. if (_sqlTxt_Condition != undefined && _sqlTxt_Condition.length > 0) {
  325. condion = _sqlTxt_Condition;
  326. }
  327. $gridList.dataGrid({
  328. //url: "/SystemManage/CommonReport/GetGridJson",
  329. url: "/SystemManage/CommonReport/GetGridJsonNew",
  330. height: $(window).height() - 132,
  331. // postData: { sqlTxt: _sqlTxt_AddCondition, DBName: _DBName, TempName: _TempName },
  332. postData: { MenuID: _MenuID, sqlTxt_Condition: JSON.stringify(condion), DBName: _DBName, TempName: _TempName },
  333. colModel: _Cols,
  334. pager: "#gridPager",
  335. //sortname: ' ',
  336. //sortorder: ' ',
  337. sortname: _XCol,
  338. sortorder: ' ',
  339. viewrecords: true,
  340. multiselect: true,//开启选中行
  341. footerrow: _footerrow,
  342. gridComplete: function () {
  343. var strIds = $("#gridList").jqGrid("getDataIDs");
  344. if (_formatcols_Row.length > 0) {
  345. for (var i = 0; i < _formatcols_Row.length; i++) {
  346. $("#" + strIds[_formatcols_Row[i].rowid] + " td").css("background-color", _formatcols_Row[i].backgroundcolor);
  347. }
  348. }
  349. //$("#"+ids[ii]+ " td").css("background-color","red");
  350. //合并行
  351. if (_Mergercols != undefined && _Mergercols.length > 0) {
  352. for (var i = 0; i < _Mergercols.length; i++) {
  353. Merger("gridList", _Mergercols[i]);
  354. }
  355. }
  356. //合计
  357. if (_footerrow == true) {
  358. var footerData = {};
  359. for (var i = 0; i < _footercols.length; i++) {
  360. var total = 0;
  361. for (var j = 0; j < strIds.length; j++) {
  362. var qty = $("#gridList").jqGrid("getCell", strIds[j], _footercols[i]);
  363. if (qty != "") {
  364. total += parseInt(qty);
  365. }
  366. }
  367. footerData[_footercols[i]] = total;
  368. }
  369. $("#gridList").footerData('set', footerData);
  370. $("#gridList").footerData('set', { "rn": "合计" });
  371. }
  372. //隐藏列(不可见/无权限)
  373. if (_HiddenCols != null && _HiddenCols.length > 0) {
  374. for (var j = 0; j < _HiddenCols.length; j++) {
  375. $("#gridList").setGridParam().hideCol(_HiddenCols[j].ColFiledName);
  376. }
  377. }
  378. },
  379. loadError: function (data) {
  380. alert("异常:");
  381. }
  382. });
  383. $("#btn_search").click(function () {
  384. $gridList.jqGrid('setGridParam', {
  385. //sqlTxt: _sqlTxt_AddCondition, DBName: _DBName, TempName: _TempName
  386. MenuID: _MenuID, sqlTxt_Condition: JSON.stringify(condion), DBName: _DBName, TempName: _TempName
  387. }).trigger('reloadGrid');
  388. });
  389. }
  390. //过滤
  391. function btn_Filter() {
  392. $.modalOpenYC({
  393. id: "Filer",
  394. title: "过滤条件",
  395. url: "/SystemManage/CommonReport/Filter?MenuID=" + _MenuID + "&SourceID=" + _SourceID + "&" + Math.random(),
  396. width: "800px",
  397. height: "570px",
  398. //btn: ['确认', '关闭'],
  399. callBack: function (iframeId) {
  400. _sqlTxt_Condition = eval(top.frames[iframeId].submitForm());
  401. //_sqlTxt_AddCondition = _sqlTxt;
  402. if (_sqlTxt_Condition != undefined) {
  403. // if (_sqlTxt_Condition.length > 0) {
  404. // for (var i = 0; i < _sqlTxt_Condition.length; i++) {
  405. // _sqlTxt_AddCondition = ReplaceALL(_sqlTxt_AddCondition, _sqlTxt_Condition[i].CIndex, _sqlTxt_Condition[i].Content);
  406. // }
  407. // }
  408. top.frames[iframeId].Close();
  409. gridList();
  410. }
  411. }
  412. });
  413. }
  414. //数据源
  415. function btn_DataSource() {
  416. $.modalOpen({
  417. id: "DataSource",
  418. title: "数据源",
  419. url: "/SystemManage/CommonReport/DataSource?MenuID=" + _MenuID,//+ "&" + Math.random(),
  420. width: "1300px",
  421. height: "570px",
  422. btn: ['确认', '关闭'],
  423. callBack: function (iframeId) {
  424. dataRR = top.frames[iframeId].submitForm();
  425. if (dataRR == "Error")
  426. { }
  427. else {
  428. GetMenu();
  429. }
  430. }
  431. });
  432. }
  433. //列设置
  434. function btn_Cols() {
  435. if (_IsExistsDataSource != "1") {
  436. alert("请先设置数据源");
  437. }
  438. else {
  439. $.modalOpen({
  440. id: "Cols",
  441. title: "列设置",
  442. url: "/SystemManage/CommonReport/Cols?SourceID=" + _SourceID + "&MenuID=" + _MenuID + "&" + Math.random(),
  443. width: "1300px",
  444. height: "570px",
  445. btn: ['确认', '关闭'],
  446. callBack: function (iframeId) {
  447. top.frames[iframeId].submitForm();
  448. GetMenu();
  449. }
  450. });
  451. }
  452. }
  453. //个性化设置
  454. function btn_GridFormat() {
  455. if (_IsExistsDataSource != "1") {
  456. alert("请先设置数据源");
  457. }
  458. else {
  459. $.modalOpen({
  460. id: "GridFormat",
  461. title: "个性化设置",
  462. url: "/SystemManage/CommonReport/GridFormat?SourceID=" + _SourceID + "&" + Math.random(),
  463. width: "800px",
  464. height: "570px",
  465. btn: null,
  466. callBack: function (iframeId) {
  467. GetMenu();
  468. }
  469. });
  470. }
  471. }
  472. //多表头设置
  473. function btn_GridHeader() {
  474. if (_IsExistsDataSource != "1") {
  475. alert("请先设置数据源");
  476. }
  477. else {
  478. $.modalOpen({
  479. id: "GridHeader",
  480. title: "多表头设置",
  481. url: "/SystemManage/CommonReport/GridHeader?SourceID=" + _SourceID + "&" + Math.random(),
  482. width: "1300px",
  483. height: "570px",
  484. btn: ['确认', '关闭'],
  485. callBack: function (iframeId) {
  486. top.frames[iframeId].submitForm();
  487. GetMenu();
  488. }
  489. });
  490. }
  491. }
  492. //清空本菜单所有数据源相关设置
  493. function btn_Clear() {
  494. $.deleteForm({
  495. url: "/SystemManage/CommonReport/ClearAll?" + Math.random(),
  496. param: { MenuID: _MenuID },
  497. success: function () {
  498. _SourceID = "";//数据源ID
  499. _sqlTxt = "";//加上参数的sql
  500. _sqlTxt_AddCondition = "";//加上过滤条件的sql
  501. _TempName = "";
  502. _IsExistsDataSource = "";
  503. _DBName = "";//s数据库
  504. _Cols = new Array();//列
  505. _Filter = "";
  506. _footerrow = false;//是否有合计项
  507. _footercols = new Array();//合计项
  508. _formatcols = new Array();//个性化项
  509. _formatcols_Row = new Array();//个性化项的行
  510. _Mergercols = new Array();//合并项
  511. document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';
  512. },
  513. error: function (aa) {
  514. //alert("异常", aa.responseText);
  515. $.modalAlertNew("WMS00015", aa.responseText);
  516. }
  517. });
  518. }
  519. function btn_ExportAll() {
  520. var condion = new Array();
  521. if (_sqlTxt_Condition != undefined && _sqlTxt_Condition.length > 0) {
  522. condion = _sqlTxt_Condition;
  523. }
  524. //var data = "&sqlTxt=" + encodeURIComponent(_sqlTxt_AddCondition) + "&DBName=" + _DBName + "&TempName=" + _TempName + "&MenuID=" + _MenuID;
  525. var data = "&sqlTxt=" + encodeURIComponent(JSON.stringify(condion)) + "&DBName=" + _DBName + "&TempName=" + _TempName + "&MenuID=" + _MenuID + "&XCol=" + _XCol;
  526. $.download("/SystemManage/CommonReport/ExportAllNew?" + Math.random(), data, 'post');
  527. }
  528. function btn_WatchPanel() {
  529. var condion = new Array();
  530. if (_sqlTxt_Condition != undefined && _sqlTxt_Condition.length > 0) {
  531. condion = _sqlTxt_Condition;
  532. }
  533. $.modalOpen({
  534. id: "WatchPanel",
  535. title: _ReportName + "看板显示",
  536. url: "/SystemManage/CommonReport/WatchPanel?_MenuID=" + _MenuID + "&_sqlTxt_Condition=" + escape(JSON.stringify(condion)) + "&TempName=" + escape(_TempName) + "&" + Math.random(),
  537. width: "1300px",
  538. height: "570px",
  539. btn: null,
  540. callBack: function (iframeId) {
  541. top.frames[iframeId].submitForm();
  542. GetMenu();
  543. }
  544. });
  545. }
  546. //角色显示栏位
  547. function btn_ColsVisible() {
  548. $.modalOpen({
  549. id: "ColsVisible",
  550. title: _ReportName + " 角色显示栏位",
  551. url: "/SystemManage/CommonReport/ColsVisible?MenuID=" + _MenuID + "&IsCommon=Y&Cols=&" + Math.random(),
  552. width: "1000px",
  553. height: "570px",
  554. btn: null,
  555. callBack: function (iframeId) {
  556. alert("111");
  557. GetMenu();
  558. }
  559. });
  560. }
  561. //新增类型
  562. function btn_Create() {
  563. debugger;
  564. $.modalOpen({
  565. id: "ICSConfigurationAdd",
  566. title: "新增类型",
  567. url: "/WMS/BasicSettings/ICSExtensionEnableAdd" + "?" + Math.random(),
  568. width: "500px",
  569. height: "400px",
  570. callBack: function (iframeId) {
  571. top.frames[iframeId].submitForm();
  572. }
  573. });
  574. }
  575. //删除库位
  576. function btn_Delete() {
  577. debugger;
  578. var objArr = '';
  579. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  580. for (var i = 0; i < objList.length; i++) {
  581. var rowId = objList[i];
  582. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  583. objArr += "'" + rowData.ID + "',";
  584. }
  585. if (objArr == '') {
  586. $.modalAlertNew("WMS00086");
  587. return;
  588. }
  589. debugger;
  590. $.deleteForm({
  591. url: "/WMS/ICSRCVIQCs/DelectRejection" + "?" + Math.random(),
  592. param: { keyValue: JSON.stringify(objArr) },
  593. success: function () {
  594. $.currentWindow().$("#gridList").trigger("reloadGrid");
  595. }
  596. })
  597. }
  598. //修改类型
  599. function btn_Update() {
  600. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  601. if (ids.length != 1) {
  602. $.modalAlertNew("WMS00006");
  603. return;
  604. }
  605. for (var i in ids) {
  606. var rowData = jQuery("#gridList").jqGrid("getRowData", ids[i]);
  607. //ID
  608. var ID = rowData.ID;
  609. var ColCode = rowData.ColCode;
  610. var ColName = rowData.ColName;
  611. var Enable = rowData.Enable;
  612. $.modalOpen({
  613. id: "Details",
  614. title: "修改",
  615. url: "/WMS/BasicSettings/ICSExtensionEnableAdd?ID=" + ID + "&ColCode=" + ColCode + "&ColName=" + encodeURI(encodeURI(ColName)) + "&Enable=" + Enable + "&" + Math.random(),
  616. width: "500px",
  617. height: "400px",
  618. callBack: function (iframeId) {
  619. top.frames[iframeId].submitForm();
  620. }
  621. });
  622. }
  623. }
  624. //交期维护
  625. function btn_LeadTime() {
  626. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  627. var objArr = '';
  628. var arr = [];
  629. for (var i in ids) {
  630. var rowData = jQuery("#gridList").jqGrid("getRowData", ids[i]);
  631. //ID
  632. objArr += "'" + rowData.LotNo + "',";
  633. }
  634. arr.push(objArr);
  635. $.modalOpen({
  636. id: "Details",
  637. title: "维护交期",
  638. url: "/WMS/ICSRCVIQCs/UpdateLeadTime?LotNos=" + arr + "&" + Math.random(),
  639. width: "500px",
  640. height: "400px",
  641. callBack: function (iframeId) {
  642. top.frames[iframeId].submitForm();
  643. }
  644. });
  645. }
  646. //打印库位
  647. function btn_Print() {
  648. debugger;
  649. // var mold = 'FP0001'; //条码打印
  650. var objArr = '';
  651. var arr = [];
  652. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  653. for (var i = 0; i < objList.length; i++) {
  654. var rowId = objList[i];
  655. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  656. objArr += "'" + rowData.ID + "',";
  657. }
  658. objArr = objArr.slice(0, objArr.length - 1);
  659. if (objArr == "") {
  660. $.modalAlertNew("WMS00003");
  661. return;
  662. }
  663. objArr = "" + objArr + "|";
  664. arr.push(objArr);
  665. $.modalOpen({
  666. id: "PrintLot",
  667. title: "打印",
  668. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  669. width: "550px",
  670. height: "1000px",
  671. callBack: function (iframeId) {
  672. top.frames[iframeId].submitForm();
  673. }
  674. });
  675. }
  676. //导入
  677. function btn_Introduction() {
  678. debugger;
  679. $("#FileUp").click();
  680. }
  681. function btn_Clike() {
  682. $.ClickOperate();
  683. }
  684. function UpLoadFile(fileinfo) { //点击确定按钮的时候
  685. debugger;
  686. var files = fileinfo.files;
  687. var fileURL = fileinfo.value;
  688. var fileName = files[0].name;
  689. if (fileName != null && fileName != "") {
  690. var data = new FormData();
  691. jQuery.each(jQuery('#FileUp')[0].files, function (i, file) {
  692. data.append('file-' + i, file);
  693. });
  694. //var info = document.getElementById("form1");
  695. //var formData = new FormData(info);
  696. $.modalConfirm("确定上传文件吗?", function (r) {
  697. if (r) {
  698. $.ajax({
  699. url: "/WMS/BasicSettings/Import" + "?" + Math.random() + "&fileURL=" + fileURL + "",
  700. type: "post",
  701. data: "",
  702. contentType: false,
  703. processData: false,
  704. success: function (data) {
  705. if (data != "" && data != "获取文件失败" && data != "上传文件失败") {
  706. $.modalAlertNew("WMS00014");
  707. $.currentWindow().$("#gridList").trigger("reloadGrid");
  708. }
  709. else {
  710. $.modalAlertNew("WMS00015", data);
  711. }
  712. },
  713. error: function (aa) {
  714. $.modalAlertNew("WMS00016", aa);
  715. }
  716. });
  717. }
  718. });
  719. }
  720. }
  721. </script>
  722. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  723. <div class="topPanel">
  724. <div class="toolbar">
  725. <div class="btn-group">
  726. </div>
  727. <div class="btn-group">
  728. <a class="btn btn-primary" style="margin-left:3px;" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  729. <a id="NF-Create" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Create()"><i class="fa fa-pencil-square-o"></i>新增</a>
  730. <a id="NF-Delete" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Delete()"><i class="fa fa-pencil-square-o"></i>删除</a>
  731. <a id="NF-Update" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Update()"><i class="fa fa-pencil-square-o"></i>修改</a>
  732. <a id="NF-ExportAll" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_ExportAll()"><i class="fa fa-download"></i>全部导出</a>
  733. <a id="NF-LeadTime" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_LeadTime()"><i class="fa fa-download"></i>交期维护</a>
  734. <a id="NF-Print" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Print()"><i class="fa fa-print"></i>打印</a>
  735. <a href="~/File/Stack/库位资料导入模板.xlsx" id="NF-IntroductionMould" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_IntroductionMould()"><i class="fa fa-file-excel-o"></i>导入模板下载</a>
  736. <a id="NF-Introduction" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Introduction()">导入</a>
  737. <a id="NF-Clike" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Clike()"><i class="fa fa-eject"></i>...</a>
  738. @*<a id="NF-GridHeader" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_GridHeader()"><i class="fa fa-list-alt"></i>多表头设置</a>*@
  739. </div>
  740. <div class="operates">
  741. <ul class="nav nav-pills">
  742. @*<li><a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a></li>*@
  743. <li><a class="btn btn-primary dropdown-text" onclick="btn_Filter()"><i class="fa fa-filter"></i>过滤</a></li>
  744. <li><a id="NF-DataSource" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_DataSource()"><i class="fa fa-database"></i>设置数据源</a></li>
  745. <li><a id="NF-Cols" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Cols()"><i class="fa fa-text-width"></i>列设置</a></li>
  746. <li class="split"></li>
  747. <li><a id="NF-GridFormat" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_GridFormat()"><i class="fa fa-bars"></i>个性化设置</a></li>
  748. <li class="split"></li>
  749. <li><a id="NF-Clear" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Clear()"><i class="fa fa-times"></i>清空本菜单所有设置</a></li>
  750. <li><a id="NF-WatchPanel" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_WatchPanel()"><i class="fa fa-download"></i>看板显示</a></li>
  751. <li><a id="NF-ColsVisible" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_ColsVisible()"><i class="fa fa-user"></i>角色显示栏位</a></li>
  752. </ul>
  753. <a href="javascript:;" class="close"></a>
  754. </div>
  755. <script>$('.toolbar').authorizeButton()</script>
  756. </div>
  757. </div>
  758. <div class="gridPanel" id="gridPanel">
  759. <table id="gridList"></table>
  760. <div id="gridPager"></div>
  761. </div>