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

871 lines
35 KiB

  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 _MenuID = "";//菜单ID
  22. var _SourceID = "";//数据源ID
  23. var _sqlTxt = "";//加上参数的sql
  24. var _sqlTxt_Condition = new Array();//加上过滤条件的sql
  25. var _sqlTxt_AddCondition = "";//加上过滤条件的sql
  26. var _IsExistsDataSource = "";
  27. var _DBName = "";//s数据库
  28. var _Cols = new Array();//列
  29. var _ReportName = "";
  30. var _Filter = "";
  31. var _TempName = "";
  32. var _footerrow = false;//是否有合计项
  33. var _footercols = new Array();//合计项
  34. var _formatcols = new Array();//个性化项
  35. var _formatcols_Row = new Array();//个性化项的行
  36. var _Mergercols = new Array();//合并项
  37. var _XCol = "";
  38. var dataRR = "";
  39. var _HiddenCols = new Array();
  40. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  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. $.modalOpen({
  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. else {
  427. GetMenu();
  428. }
  429. }
  430. });
  431. }
  432. //列设置
  433. function btn_Cols() {
  434. if (_IsExistsDataSource != "1") {
  435. alert("请先设置数据源");
  436. }
  437. else {
  438. $.modalOpen({
  439. id: "Cols",
  440. title: "列设置",
  441. url: "/SystemManage/CommonReport/Cols?SourceID=" + _SourceID + "&MenuID=" + _MenuID + "&" + Math.random(),
  442. width: "1300px",
  443. height: "570px",
  444. btn: ['确认', '关闭'],
  445. callBack: function (iframeId) {
  446. top.frames[iframeId].submitForm();
  447. GetMenu();
  448. }
  449. });
  450. }
  451. }
  452. //个性化设置
  453. function btn_GridFormat() {
  454. if (_IsExistsDataSource != "1") {
  455. alert("请先设置数据源");
  456. }
  457. else {
  458. $.modalOpen({
  459. id: "GridFormat",
  460. title: "个性化设置",
  461. url: "/SystemManage/CommonReport/GridFormat?SourceID=" + _SourceID + "&" + Math.random(),
  462. width: "800px",
  463. height: "570px",
  464. btn: null,
  465. callBack: function (iframeId) {
  466. GetMenu();
  467. }
  468. });
  469. }
  470. }
  471. //多表头设置
  472. function btn_GridHeader() {
  473. if (_IsExistsDataSource != "1") {
  474. alert("请先设置数据源");
  475. }
  476. else {
  477. $.modalOpen({
  478. id: "GridHeader",
  479. title: "多表头设置",
  480. url: "/SystemManage/CommonReport/GridHeader?SourceID=" + _SourceID + "&" + Math.random(),
  481. width: "1300px",
  482. height: "570px",
  483. btn: ['确认', '关闭'],
  484. callBack: function (iframeId) {
  485. top.frames[iframeId].submitForm();
  486. GetMenu();
  487. }
  488. });
  489. }
  490. }
  491. //清空本菜单所有数据源相关设置
  492. function btn_Clear() {
  493. $.deleteForm({
  494. url: "/SystemManage/CommonReport/ClearAll?" + Math.random(),
  495. param: { MenuID: _MenuID },
  496. success: function () {
  497. _SourceID = "";//数据源ID
  498. _sqlTxt = "";//加上参数的sql
  499. _sqlTxt_AddCondition = "";//加上过滤条件的sql
  500. _TempName = "";
  501. _IsExistsDataSource = "";
  502. _DBName = "";//s数据库
  503. _Cols = new Array();//列
  504. _Filter = "";
  505. _footerrow = false;//是否有合计项
  506. _footercols = new Array();//合计项
  507. _formatcols = new Array();//个性化项
  508. _formatcols_Row = new Array();//个性化项的行
  509. _Mergercols = new Array();//合并项
  510. document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';
  511. },
  512. error: function (aa) {
  513. //alert("异常", aa.responseText);
  514. $.modalAlertNew("WMS00015", aa.responseText);
  515. }
  516. });
  517. }
  518. function btn_ExportAll() {
  519. var condion = new Array();
  520. if (_sqlTxt_Condition != undefined && _sqlTxt_Condition.length > 0) {
  521. condion = _sqlTxt_Condition;
  522. }
  523. //var data = "&sqlTxt=" + encodeURIComponent(_sqlTxt_AddCondition) + "&DBName=" + _DBName + "&TempName=" + _TempName + "&MenuID=" + _MenuID;
  524. var data = "&sqlTxt=" + encodeURIComponent(JSON.stringify(condion)) + "&DBName=" + _DBName + "&TempName=" + _TempName + "&MenuID=" + _MenuID;
  525. $.download("/SystemManage/CommonReport/ExportAllNew?" + Math.random(), data, 'post');
  526. }
  527. function btn_WatchPanel() {
  528. var condion = new Array();
  529. if (_sqlTxt_Condition != undefined && _sqlTxt_Condition.length > 0) {
  530. condion = _sqlTxt_Condition;
  531. }
  532. $.modalOpen({
  533. id: "WatchPanel",
  534. title: _ReportName + "看板显示",
  535. url: "/SystemManage/CommonReport/WatchPanel?_MenuID=" + _MenuID + "&_sqlTxt_Condition=" + escape(JSON.stringify(condion)) + "&TempName=" + escape(_TempName) + "&" + Math.random(),
  536. width: "1300px",
  537. height: "570px",
  538. btn: null,
  539. callBack: function (iframeId) {
  540. top.frames[iframeId].submitForm();
  541. GetMenu();
  542. }
  543. });
  544. }
  545. //角色显示栏位
  546. function btn_ColsVisible() {
  547. $.modalOpen({
  548. id: "ColsVisible",
  549. title: _ReportName + " 角色显示栏位",
  550. url: "/SystemManage/CommonReport/ColsVisible?MenuID=" + _MenuID + "&IsCommon=Y&Cols=&" + Math.random(),
  551. width: "1000px",
  552. height: "570px",
  553. btn: null,
  554. callBack: function (iframeId) {
  555. alert("111");
  556. GetMenu();
  557. }
  558. });
  559. }
  560. //新增类型
  561. function btn_Create() {
  562. debugger;
  563. $.modalOpen({
  564. id: "ICSConfigurationAdd",
  565. title: "新增容器",
  566. url: "/WMS/BasicSettings/ICSContainerAdd" + "?" + Math.random(),
  567. width: "500px",
  568. height: "400px",
  569. callBack: function (iframeId) {
  570. top.frames[iframeId].submitForm();
  571. }
  572. });
  573. }
  574. //删除库位
  575. function btn_Delete() {
  576. debugger;
  577. var objArr = '';
  578. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  579. for (var i = 0; i < objList.length; i++) {
  580. var rowId = objList[i];
  581. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  582. objArr += "'" + rowData.ID + "',";
  583. }
  584. if (objArr == '') {
  585. $.modalAlertNew("WMS00021");
  586. return;
  587. }
  588. debugger;
  589. $.deleteForm({
  590. url: "/WMS/BasicSettings/DeleteICSContainer" + "?" + Math.random(),
  591. param: { keyValue: JSON.stringify(objArr) },
  592. success: function () {
  593. $.currentWindow().$("#gridList").trigger("reloadGrid");
  594. }
  595. })
  596. }
  597. //修改类型
  598. function btn_Update() {
  599. debugger;
  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 ContainerID = rowData.ContainerID;
  610. var ContainerCODE = rowData.ContainerCODE;
  611. var ContainerName = rowData.ContainerName;
  612. var Memo = rowData.Memo;
  613. $.modalOpen({
  614. id: "Details",
  615. title: "修改",
  616. url: "/WMS/BasicSettings/ICSContainerAdd?ID=" + ID + "&ContainerID=" + ContainerID + "&ContainerCODE=" + ContainerCODE + "&ContainerName=" + ContainerName + "&Memo=" + Memo + "&" + Math.random(),
  617. width: "500px",
  618. height: "400px",
  619. callBack: function (iframeId) {
  620. top.frames[iframeId].submitForm();
  621. }
  622. });
  623. }
  624. }
  625. //打印库位
  626. function btn_Print() {
  627. debugger;
  628. var objArr = '';
  629. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  630. //if (objList.length != 1) {
  631. // $.modalAlert("一次只能打印一个送货单!");
  632. // return;
  633. //}
  634. for (var i = 0; i < objList.length; i++) {
  635. var rowId = objList[i];
  636. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  637. objArr += "'" + rowData.ID + "',";
  638. }
  639. var strPrintData;
  640. var bIsInstallPrintControl;
  641. var strPrintControlCookie;
  642. $.ajax({
  643. url: "/WMS/BasicSettings/PrintStack",
  644. type: "post",
  645. data: { keyValue: JSON.stringify(objArr) },
  646. dataType: "json",
  647. async: false,
  648. success: function (data) {
  649. strPrintData = data.strPrintData_1;
  650. bIsInstallPrintControl = data.bIsInstallPrintControl_1;
  651. strPrintControlCookie = data.strPrintControlCookie_1;
  652. }
  653. });
  654. if (strPrintData != '') {
  655. var test = "ChuLinPrint:" + strPrintData;
  656. $("#ifrm")[0].src = "ChuLinPrint:" + strPrintData;
  657. }
  658. if (bIsInstallPrintControl == 'False') {
  659. if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  660. $("#downPrintControl").click();
  661. }
  662. }
  663. if (bIsInstallPrintControl == 'True') {
  664. var strPrintControlCookie = strPrintControlCookie;
  665. if (strPrintControlCookie != '') { //延时3秒后再次检测打印控件是否安装
  666. setTimeout("checkPrintControlInstall()", 8000);
  667. function checkPrintControlInstall() {
  668. $.ajax({
  669. url: "/SRM/ASNManage/IsCheckInstall?checkInstall=" + strPrintControlCookie,
  670. dataType: "json",
  671. async: false,
  672. success: function (strResult) {
  673. if (strResult.indexOf("PrintControlInstall") == -1) {
  674. if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  675. $("#downPrintControl").click();
  676. }
  677. }
  678. }
  679. });
  680. }
  681. }
  682. }
  683. $("#btn_search").click();
  684. }
  685. //导入
  686. function btn_Introduction() {
  687. debugger;
  688. $("#FileUp").click();
  689. }
  690. function btn_Clike() {
  691. $.ClickOperate();
  692. }
  693. function UpLoadFile(fileinfo) { //点击确定按钮的时候
  694. debugger;
  695. var files = fileinfo.files;
  696. var fileURL = fileinfo.value;
  697. var fileName = files[0].name;
  698. if (fileName != null && fileName != "") {
  699. var data = new FormData();
  700. jQuery.each(jQuery('#FileUp')[0].files, function (i, file) {
  701. data.append('file-' + i, file);
  702. });
  703. //var info = document.getElementById("form1");
  704. //var formData = new FormData(info);
  705. $.modalConfirm("确定上传文件吗?", function (r) {
  706. if (r) {
  707. $.ajax({
  708. url: "/WMS/BasicSettings/Import" + "?" + Math.random() + "&fileURL=" + fileURL + "",
  709. type: "post",
  710. data: "",
  711. contentType: false,
  712. processData: false,
  713. success: function (data) {
  714. if (data != "" && data != "获取文件失败" && data != "上传文件失败") {
  715. $.modalAlertNew("WMS00014");
  716. $.currentWindow().$("#gridList").trigger("reloadGrid");
  717. }
  718. else {
  719. $.modalAlertNew("WMS00015", data);
  720. }
  721. },
  722. error: function (aa) {
  723. $.modalAlertNew("WMS00016", aa);
  724. }
  725. });
  726. }
  727. });
  728. }
  729. }
  730. function btn_HGRecall() {
  731. var DisPatchCodeList = "";
  732. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  733. if (ids.length == 0) {
  734. $.modalAlertNew("WMS00110");
  735. return;
  736. }
  737. for (var i in ids) {
  738. DisPatchCodeList += $("#gridList").jqGrid('getRowData', ids[i]).ID + ',';
  739. }
  740. if (DisPatchCodeList != "") {
  741. $.modalConfirm("是否要手动上传选中的数据?", function (r) {
  742. if (r) {
  743. $.submitForm({
  744. url: "/WMS/ICSHGErrorHandle/WMSInterfaceReCall?IDList=" + DisPatchCodeList + "&WorkPoint=" + WorkPoints + "&" + Math.random(),
  745. async: false,
  746. success: function () {
  747. $.currentWindow().$("#gridList").trigger("reloadGrid");
  748. }
  749. })
  750. }
  751. });
  752. }
  753. }
  754. </script>
  755. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  756. <div class="topPanel">
  757. <div class="toolbar">
  758. <div class="btn-group">
  759. </div>
  760. <div class="btn-group">
  761. <a class="btn btn-primary" style="margin-left:3px;" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  762. <a id="NF-Create" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Create()"><i class="fa fa-pencil-square-o"></i>新增</a>
  763. <a id="NF-Delete" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Delete()"><i class="fa fa-pencil-square-o"></i>删除</a>
  764. <a id="NF-Update" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Update()"><i class="fa fa-pencil-square-o"></i>修改</a>
  765. <a id="NF-ExportAll" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_ExportAll()"><i class="fa fa-download"></i>全部导出</a>
  766. <a id="NF-Print" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Print()"><i class="fa fa-print"></i>打印</a>
  767. <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>
  768. <a id="NF-Introduction" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Introduction()">导入</a>
  769. <a id="NF-Clike" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Clike()"><i class="fa fa-eject"></i>...</a>
  770. @*<a id="NF-GridHeader" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_GridHeader()"><i class="fa fa-list-alt"></i>多表头设置</a>*@
  771. </div>
  772. <div class="operates">
  773. <ul class="nav nav-pills">
  774. @*<li><a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a></li>*@
  775. <li><a class="btn btn-primary dropdown-text" onclick="btn_Filter()"><i class="fa fa-filter"></i>过滤</a></li>
  776. <li><a id="NF-DataSource" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_DataSource()"><i class="fa fa-database"></i>设置数据源</a></li>
  777. <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>
  778. <li class="split"></li>
  779. <li><a id="NF-GridFormat" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_GridFormat()"><i class="fa fa-bars"></i>个性化设置</a></li>
  780. <li class="split"></li>
  781. <li><a id="NF-Clear" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Clear()"><i class="fa fa-times"></i>清空本菜单所有设置</a></li>
  782. <li><a id="NF-WatchPanel" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_WatchPanel()"><i class="fa fa-download"></i>看板显示</a></li>
  783. <li><a id="NF-ColsVisible" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_ColsVisible()"><i class="fa fa-user"></i>角色显示栏位</a></li>
  784. <li><a id="NF-ToSAP" class="btn btn-primary dropdown-text" onclick="btn_HGRecall()">手动上传</a></li>
  785. </ul>
  786. <a href="javascript:;" class="close"></a>
  787. </div>
  788. <script>$('.toolbar').authorizeButton()</script>
  789. </div>
  790. </div>
  791. <div class="gridPanel" id="gridPanel">
  792. <table id="gridList"></table>
  793. <div id="gridPager"></div>
  794. </div>