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.
 
 
 
 
 
 

278 lines
13 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-05-28 10:40
  5. * 描 述:收入预算管理
  6. */
  7. var refreshGirdData;
  8. var ITopType;
  9. var ISecondType;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. //page.initGird();
  15. page.bind();
  16. page.initTree();
  17. },
  18. bind: function () {
  19. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  20. page.search(queryJson);
  21. }, 300, 400);
  22. $('#ITopType').lrDataItemSelect({
  23. code: 'BudgetType', select: function (item) {
  24. if (item) {
  25. if (item.id == '0' || item.text == '财政预算') {
  26. $('#ISecondType').removeAttr("readonly");
  27. } else {
  28. $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
  29. $('#ISecondType').attr('readonly', 'readonly');
  30. }
  31. } else {
  32. $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
  33. $('#ISecondType').attr('readonly', 'readonly');
  34. }
  35. }
  36. });
  37. $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
  38. // 刷新
  39. $('#lr_refresh').on('click', function () {
  40. location.reload();
  41. });
  42. // 新增
  43. $('#lr_add').on('click', function () {
  44. if (!ITopType) {
  45. learun.alert.warning('请选择类型!');
  46. return;
  47. }
  48. if (ITopType == '0' && !ISecondType) {
  49. learun.alert.warning('请选择二级类型!');
  50. return;
  51. }
  52. var url = '';
  53. if (ITopType == '1' || ITopType == '2') {
  54. //事业收入、培训收入
  55. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2';
  56. } else if (ITopType == '0' && ISecondType == '2') {
  57. //财政预算
  58. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3';
  59. } else {
  60. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form';
  61. }
  62. learun.layerForm({
  63. id: 'form',
  64. title: '新增',
  65. url: top.$.rootUrl + url + '?ITopType=' + ITopType + '&ISecondType=' + ISecondType,
  66. width: 600,
  67. height: 400,
  68. callBack: function (id) {
  69. return top[id].acceptClick(refreshGirdData);
  70. }
  71. });
  72. });
  73. // 编辑
  74. $('#lr_edit').on('click', function () {
  75. var keyValue = $('#gridtable').jfGridValue('IId');
  76. if (learun.checkrow(keyValue)) {
  77. var url = '';
  78. if (ITopType == '1' || ITopType == '2') {
  79. //事业收入、培训收入
  80. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2';
  81. } else if (ITopType == '0' && ISecondType == '2') {
  82. //财政预算
  83. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3';
  84. } else {
  85. url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form';
  86. }
  87. learun.layerForm({
  88. id: 'form',
  89. title: '编辑',
  90. url: top.$.rootUrl + url + '?keyValue=' + keyValue + '&ITopType=' + ITopType + '&ISecondType=' + ISecondType,
  91. width: 600,
  92. height: 400,
  93. callBack: function (id) {
  94. return top[id].acceptClick(refreshGirdData);
  95. }
  96. });
  97. }
  98. });
  99. // 删除
  100. $('#lr_delete').on('click', function () {
  101. var keyValue = $('#gridtable').jfGridValue('IId');
  102. if (learun.checkrow(keyValue)) {
  103. learun.layerConfirm('是否确认删除该项!', function (res) {
  104. if (res) {
  105. learun.deleteForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/DeleteForm', { keyValue: keyValue }, function () {
  106. refreshGirdData();
  107. });
  108. }
  109. });
  110. }
  111. });
  112. // 打印
  113. $('#lr_print').on('click', function () {
  114. $('#gridtable').jqprintTable();
  115. });
  116. },
  117. initTree: function () {
  118. $('#dataTree').lrtree({
  119. url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetTree',
  120. nodeClick: function (item) {
  121. if (item.parent) {
  122. ISecondType = item.value;
  123. ITopType = item.parent.value;
  124. } else {
  125. ITopType = item.value;
  126. ISecondType = '';
  127. }
  128. page.initGird();
  129. page.search({ ITopType: ITopType, ISecondType: ISecondType });
  130. }
  131. });
  132. },
  133. // 初始化列表
  134. initGird: function () {
  135. $("#gridtable").empty();
  136. $("#gridtable")[0].dfop = undefined;
  137. if (ITopType == '1' || ITopType == '2') {
  138. //事业收入、培训收入
  139. $('#gridtable').jfGrid({
  140. url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
  141. headData: [
  142. { label: "项目名称", name: "IName", width: 100, align: "left" },
  143. {
  144. label: "预算类型", name: "ITopType", width: 100, align: "left",
  145. formatterAsync: function (callback, value, row, op, $cell) {
  146. learun.clientdata.getAsync('dataItem', {
  147. key: value,
  148. code: 'BudgetType',
  149. callback: function (_data) {
  150. callback(_data.text);
  151. }
  152. });
  153. }
  154. },
  155. //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" },
  156. { label: "年度实际收入", name: "IActual", width: 100, align: "left" },
  157. { label: "年度预计收入", name: "IQuota", width: 150, align: "left" },
  158. { label: "金额", name: "IAmount", width: 150, align: "left" },
  159. { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
  160. { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
  161. { label: "备注", name: "IRemarks", width: 100, align: "left" },
  162. ],
  163. mainId: 'IId',
  164. isPage: true
  165. });
  166. } else if (ITopType == '0' && ISecondType == '2') {
  167. //财政预算-财政专项
  168. $('#gridtable').jfGrid({
  169. url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
  170. headData: [
  171. { label: "项目名称", name: "IName", width: 100, align: "left" },
  172. { label: "项目编号", name: "IEnCode", width: 100, align: "left" },
  173. {
  174. label: "预算类型",
  175. name: "ITopType",
  176. width: 100,
  177. align: "left",
  178. formatterAsync: function (callback, value, row, op, $cell) {
  179. learun.clientdata.getAsync('dataItem',
  180. {
  181. key: value,
  182. code: 'BudgetType',
  183. callback: function (_data) {
  184. callback(_data.text);
  185. }
  186. });
  187. }
  188. },
  189. {
  190. label: "预算科目",
  191. name: "ISecondType",
  192. width: 100,
  193. align: "left",
  194. formatterAsync: function (callback, value, row, op, $cell) {
  195. learun.clientdata.getAsync('dataItem',
  196. {
  197. key: value,
  198. code: 'financeBudgetType',
  199. callback: function (_data) {
  200. callback(_data.text);
  201. }
  202. });
  203. }
  204. },
  205. { label: "申报金额", name: "IQuota", width: 150, align: "left" },
  206. { label: "批复金额", name: "IAmount", width: 150, align: "left" },
  207. { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
  208. { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
  209. { label: "备注", name: "IRemarks", width: 100, align: "left" }
  210. ],
  211. mainId: 'IId',
  212. isPage: true
  213. });
  214. }
  215. else {
  216. //财政预算-人员经费、公用经费
  217. $('#gridtable').jfGrid({
  218. url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
  219. headData: [
  220. { label: "项目名称", name: "IName", width: 100, align: "left" },
  221. {
  222. label: "预算类型",
  223. name: "ITopType",
  224. width: 100,
  225. align: "left",
  226. formatterAsync: function (callback, value, row, op, $cell) {
  227. learun.clientdata.getAsync('dataItem',
  228. {
  229. key: value,
  230. code: 'BudgetType',
  231. callback: function (_data) {
  232. callback(_data.text);
  233. }
  234. });
  235. }
  236. },
  237. {
  238. label: "预算科目",
  239. name: "ISecondType",
  240. width: 100,
  241. align: "left",
  242. formatterAsync: function (callback, value, row, op, $cell) {
  243. learun.clientdata.getAsync('dataItem',
  244. {
  245. key: value,
  246. code: 'financeBudgetType',
  247. callback: function (_data) {
  248. callback(_data.text);
  249. }
  250. });
  251. }
  252. },
  253. //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" },
  254. { label: "人数", name: "IPeopleNum", width: 100, align: "left" },
  255. { label: "定额", name: "IQuota", width: 150, align: "left" },
  256. { label: "金额", name: "IAmount", width: 150, align: "left" },
  257. { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
  258. { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
  259. { label: "备注", name: "IRemarks", width: 100, align: "left" },
  260. ],
  261. mainId: 'IId',
  262. isPage: true
  263. });
  264. }
  265. //page.search();
  266. },
  267. search: function (param) {
  268. param = param || {};
  269. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  270. }
  271. };
  272. refreshGirdData = function () {
  273. $('#gridtable').jfGridSet('reload');
  274. };
  275. page.init();
  276. }