/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-03-28 16:42 * 描 述:采购申请明细 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'formAss_PurchaseItemApply', title: '新增', url: top.$.rootUrl + '/AssetManagementSystem/Ass_PurchaseItemApply/Form', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('PAIId'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'formAss_PurchaseItemApply', title: '编辑', url: top.$.rootUrl + '/AssetManagementSystem/Ass_PurchaseItemApply/Form?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('PAIId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_PurchaseItemApply/DeleteForm', { keyValue: keyValue}, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/AssetManagementSystem/Ass_PurchaseItemApply/GetPageList', headData: [ { label: "资产名称", name: "PAIName", width: 100, align: "left"}, //{ label: "英文名称", name: "PAIEName", width: 100, align: "left"}, { label: "规格型号", name: "PAIModel", width: 100, align: "left"}, { label: "资产类别", name: "PAITId", width: 100, align: "left", formatterAsync: function (callback, value, row, op,$cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType', key: value, keyId: 'atid', callback: function (_data) { callback(_data['aname']); } }); }}, { label: "所需金额", name: "PAIPrice", width: 100, align: "left"}, { label: "所需数量", name: "PAIAmount", width: 100, align: "left"}, //{ label: "生产厂家", name: "PAIManufacturer", width: 100, align: "left"}, { label: "资产要求", name: "PAIRequest", width: 100, align: "left"}, //{ label: "用途", name: "PAIUse", width: 100, align: "left"}, { label: "资产描述", name: "PAIContent", width: 100, align: "left"}, ], mainId:'PAIId', isPage: true }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }