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

803 lines
32 KiB

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