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.

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