|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-04-21 15:42
- * 描 述:一次性工资条
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
-
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- //年份
- $('#IssueYear').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
- value: 'value',
- text: 'text'
- });
- $('#IssueMonth').lrDataItemSelect({ code: 'MPMonth' });
- $('#Department').lrselect({
- type: 'tree',
- // 展开最大高度
- maxHeight: 200,
- // 是否允许搜索
- allowSearch: true,
- // 访问数据接口地址
- url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('SalaryID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('SalaryID');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/Emp_PayrollOnce/GetPageList',
- headData: [
- //{ label: "姓名", name: "UserId", width: 100, align: "left" },
- {
- label: "名称", name: "UserId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo',
- key: value,
- keyId: 'f_userid',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- { label: "应发金额", name: "TotalPayAmount", width: 100, align: "left", statistics: true },
- { label: "实发金额", name: "FinalPayAmount", width: 100, align: "left", statistics: true },
- { label: "发放月份", name: "IssueMonth", width: 100, align: "left" },
- { label: "发放年份", name: "IssueYear", width: 100, align: "left" },
- { label: "备注", name: "Remark", width: 100, align: "left" },
- ],
- mainId: 'SalaryID',
- isPage: true,
- sidx: 'IssueYear desc,IssueMonth desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|