|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-05-28 10:40
- * 描 述:收入预算管理
- */
- var refreshGirdData;
- var ITopType;
- var ISecondType;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- //page.initGird();
- page.bind();
- page.initTree();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 300, 400);
- $('#ITopType').lrDataItemSelect({
- code: 'BudgetType', select: function (item) {
- if (item) {
- if (item.id == '0' || item.text == '财政预算') {
- $('#ISecondType').removeAttr("readonly");
- } else {
- $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
- $('#ISecondType').attr('readonly', 'readonly');
- }
- } else {
- $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
- $('#ISecondType').attr('readonly', 'readonly');
- }
- }
- });
- $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- if (!ITopType) {
- learun.alert.warning('请选择类型!');
- return;
- }
- if (ITopType == '0' && !ISecondType) {
- learun.alert.warning('请选择二级类型!');
- return;
- }
- var url = '';
- if (ITopType == '1' || ITopType == '2') {
- //事业收入、培训收入
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2';
- } else if (ITopType == '0' && ISecondType == '2') {
- //财政预算
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3';
- } else {
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form';
- }
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + url + '?ITopType=' + ITopType + '&ISecondType=' + ISecondType,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('IId');
- if (learun.checkrow(keyValue)) {
- var url = '';
- if (ITopType == '1' || ITopType == '2') {
- //事业收入、培训收入
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2';
- } else if (ITopType == '0' && ISecondType == '2') {
- //财政预算
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3';
- } else {
- url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form';
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + url + '?keyValue=' + keyValue + '&ITopType=' + ITopType + '&ISecondType=' + ISecondType,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('IId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- initTree: function () {
- $('#dataTree').lrtree({
- url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetTree',
- nodeClick: function (item) {
- if (item.parent) {
- ISecondType = item.value;
- ITopType = item.parent.value;
- } else {
- ITopType = item.value;
- ISecondType = '';
- }
- page.initGird();
- page.search({ ITopType: ITopType, ISecondType: ISecondType });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $("#gridtable").empty();
- $("#gridtable")[0].dfop = undefined;
- if (ITopType == '1' || ITopType == '2') {
- //事业收入、培训收入
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
- headData: [
- { label: "项目名称", name: "IName", width: 100, align: "left" },
- {
- label: "预算类型", name: "ITopType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'BudgetType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" },
- { label: "年度实际收入", name: "IActual", width: 100, align: "left" },
- { label: "年度预计收入", name: "IQuota", width: 150, align: "left" },
- { label: "金额", name: "IAmount", width: 150, align: "left" },
- { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
- { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
- { label: "备注", name: "IRemarks", width: 100, align: "left" },
- ],
- mainId: 'IId',
- isPage: true
- });
-
- } else if (ITopType == '0' && ISecondType == '2') {
- //财政预算-财政专项
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
- headData: [
- { label: "项目名称", name: "IName", width: 100, align: "left" },
- { label: "项目编号", name: "IEnCode", width: 100, align: "left" },
- {
- label: "预算类型",
- name: "ITopType",
- width: 100,
- align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'BudgetType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "预算科目",
- name: "ISecondType",
- width: 100,
- align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'financeBudgetType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "申报金额", name: "IQuota", width: 150, align: "left" },
- { label: "批复金额", name: "IAmount", width: 150, align: "left" },
- { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
- { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
- { label: "备注", name: "IRemarks", width: 100, align: "left" }
- ],
- mainId: 'IId',
- isPage: true
- });
- }
- else {
- //财政预算-人员经费、公用经费
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList',
- headData: [
- { label: "项目名称", name: "IName", width: 100, align: "left" },
- {
- label: "预算类型",
- name: "ITopType",
- width: 100,
- align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'BudgetType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "预算科目",
- name: "ISecondType",
- width: 100,
- align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'financeBudgetType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" },
- { label: "人数", name: "IPeopleNum", width: 100, align: "left" },
- { label: "定额", name: "IQuota", width: 150, align: "left" },
- { label: "金额", name: "IAmount", width: 150, align: "left" },
- { label: "使用金额", name: "IUseAmount", width: 150, align: "left" },
- { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" },
- { label: "备注", name: "IRemarks", width: 100, align: "left" },
- ],
- mainId: 'IId',
- isPage: true
- });
- }
- //page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|