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.

пре 4 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-29 11:27
  5. * 描 述:在册登记明细
  6. */
  7. var refreshGirdData;
  8. var acceptClick;
  9. var AId = request("AId");
  10. var currentUser = request("currentUser");//我的资产需要用到
  11. var IsDelete = request("IsDelete");//报废资产需要使用
  12. var bootstrap = function ($, learun) {
  13. "use strict";
  14. var page = {
  15. init: function () {
  16. page.initGird();
  17. page.bind();
  18. if (currentUser) {
  19. setTimeout("hiddenButton()", 300);
  20. }
  21. },
  22. bind: function () {
  23. // 初始化左侧树形数据lr_printBar
  24. $('#dataTree').lrtree({
  25. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetTypeTree',
  26. nodeClick: function (item) {
  27. page.search({ AIASSClass: item.value });
  28. }
  29. });
  30. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  31. page.search(queryJson);
  32. }, 400, 400);
  33. $('#AIIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' });
  34. $('#AIASSState').lrDataItemSelect({ code: 'AssState' });
  35. $('#AIAssType').lrDataItemSelect({ code: 'AssType' });
  36. $('#AIDepartment').lrDepartmentSelect();
  37. // 刷新
  38. $('#lr_refresh').on('click', function () {
  39. location.reload();
  40. });
  41. },
  42. // 初始化列表
  43. initGird: function () {
  44. $('#gridtable').jfGrid({
  45. url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetPageList',
  46. headData: [
  47. { label: "明细编号", name: "AICode", width: 200, align: "left" },
  48. { label: "金隅编号", name: "AICodeNumJY", width: 200, align: "left" },
  49. { label: "名称", name: "AIASSName", width: 200, align: "left" },
  50. {
  51. label: "部门", name: "AIDepartment", width: 100, align: "left",
  52. formatterAsync: function (callback, value, row, op, $cell) {
  53. learun.clientdata.getAsync('department', {
  54. key: value,
  55. callback: function (_data) {
  56. callback(_data.name);
  57. }
  58. });
  59. }
  60. },
  61. {
  62. label: "使用人员", name: "AIUsePeople", width: 100, align: "left",
  63. formatterAsync: function (callback, value, row, op, $cell) {
  64. learun.clientdata.getAsync('custmerData', {
  65. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  66. key: value,
  67. keyId: 'f_userid',
  68. callback: function (_data) {
  69. callback(_data['f_realname']);
  70. }
  71. });
  72. }
  73. },
  74. {
  75. label: "所在库房", name: "AIIStorageId", width: 100, align: "left",
  76. formatterAsync: function (callback, value, row, op, $cell) {
  77. learun.clientdata.getAsync('custmerData', {
  78. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
  79. key: value,
  80. keyId: 'sid',
  81. callback: function (_data) {
  82. callback(_data['sname']);
  83. }
  84. });
  85. }
  86. },
  87. { label: "所在库位", name: "AIIStoragePosition", width: 100, align: "left" },
  88. {
  89. label: "资产型号", name: "AISpecificationtype", width: 100, align: "left"
  90. },
  91. {
  92. label: "资产属性", name: "AIAssType", width: 100, align: "left",
  93. formatterAsync: function (callback, value, row, op, $cell) {
  94. learun.clientdata.getAsync('dataItem', {
  95. key: value,
  96. code: 'AssType',
  97. callback: function (_data) {
  98. callback(_data.text);
  99. }
  100. });
  101. }
  102. },
  103. {
  104. label: "计量单位", name: "AIUnits", width: 100, align: "left",
  105. formatterAsync: function (callback, value, row, op, $cell) {
  106. learun.clientdata.getAsync('dataItem',
  107. {
  108. key: value,
  109. code: 'sldw',
  110. callback: function (_data) {
  111. callback(_data.text);
  112. }
  113. })
  114. }
  115. },
  116. { label: "资产价值", name: "AIAssValue", width: 100, align: "left" },
  117. { label: "购置日期", name: "AIAddTime", width: 100, align: "left" },
  118. {
  119. label: "资产分类", name: "AIASSClass", width: 100, align: "left",
  120. formatterAsync: function (callback, value, row, op, $cell) {
  121. learun.clientdata.getAsync('custmerData', {
  122. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType',
  123. key: value,
  124. keyId: 'atid',
  125. callback: function (_data) {
  126. callback(_data['aname']);
  127. }
  128. });
  129. }
  130. },
  131. {
  132. label: "资产状态", name: "AIASSState", width: 100, align: "left",
  133. formatterAsync: function (callback, value, row, op, $cell) {
  134. learun.clientdata.getAsync('dataItem', {
  135. key: value,
  136. code: 'AssState',
  137. callback: function (_data) {
  138. callback(_data.text);
  139. }
  140. });
  141. }
  142. },
  143. {
  144. label: "增加方式", name: "AIAddType", width: 100, align: "left",
  145. formatterAsync: function (callback, value, row, op, $cell) {
  146. learun.clientdata.getAsync('dataItem', {
  147. key: value,
  148. code: 'zcly',
  149. callback: function (_data) {
  150. callback(_data.text);
  151. }
  152. });
  153. }
  154. },
  155. { label: "生产厂家", name: "AIManufacturer", width: 100, align: "left" },
  156. { label: "资产规格", name: "AISpecification", width: 100, align: "left" },
  157. { label: "用途", name: "AIUse", width: 100, align: "left" },
  158. ],
  159. mainId: 'AIId',
  160. isMultiselect: true,
  161. isPage: true,
  162. sidx: 'AICodeNum'
  163. });
  164. page.search();
  165. },
  166. search: function (param) {
  167. param = param || {};
  168. param.AId = AId;
  169. if (currentUser) {
  170. var userInfo = top.learun.clientdata.get(['userinfo']);
  171. param.userId = userInfo.userId;
  172. }
  173. param.AIIsScrap = false;
  174. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  175. }
  176. };
  177. refreshGirdData = function () {
  178. page.search();
  179. };
  180. // 保存数据
  181. acceptClick = function (callBack) {
  182. var selectedRow = $('#gridtable').jfGridGet('rowdata');
  183. callBack(selectedRow);
  184. };
  185. page.init();
  186. }
  187. Date.prototype.Format = function (fmt) { //author: meizz
  188. var o = {
  189. "M+": this.getMonth() + 1, //月份
  190. "d+": this.getDate(), //日
  191. "H+": this.getHours(), //小时
  192. "m+": this.getMinutes(), //分
  193. "s+": this.getSeconds(), //秒
  194. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  195. "S": this.getMilliseconds() //毫秒
  196. };
  197. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  198. for (var k in o)
  199. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  200. return fmt;
  201. }
  202. function datedifference(sDate1, sDate2) { //sDate1和sDate2是2006-12-18格式
  203. var dateSpan,
  204. tempDate,
  205. iDays;
  206. sDate1 = Date.parse(sDate1);
  207. sDate2 = Date.parse(sDate2);
  208. dateSpan = sDate2 - sDate1;
  209. dateSpan = Math.abs(dateSpan);
  210. iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
  211. return iDays;
  212. };
  213. function AddPrintContent(html) {
  214. var myHtml = myHtml = html;
  215. // var strBodyStyle="<style>"+document.getElementById("style1").innerHTML+"</style>";
  216. // var strFormHtml=strBodyStyle+"<body>"+myHtml+"</body>";
  217. var strFormHtml = "<body>" + myHtml + "</body>";
  218. LODOP = getLodop();
  219. LODOP.PRINT_INIT("资产编号");
  220. LODOP.SET_PRINT_PAGESIZE(2, '40mm', '32.3mm', "");
  221. LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2);
  222. LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7);
  223. LODOP.ADD_PRINT_HTM(10, 8, '40mm', '30mm', strFormHtml);
  224. //打印预览
  225. // LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1);
  226. // var TaskID1=LODOP.PREVIEW();
  227. // 直接打印
  228. var TaskID1 = LODOP.PRINT();
  229. };
  230. function hiddenButton() {
  231. $("#lr_add").hide();
  232. $("#lr_printBar").hide();
  233. $("#lr_edit").hide();
  234. $("#lr_delete").hide();
  235. $("#lr_detail").hide();
  236. $("#lr_import").hide();
  237. }