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

800 lines
32 KiB

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