|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-03-29 11:55
- * 描 述:出库申请明细
- */
- 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);
- $('#AOITId').lrDataSourceSelect({ code: 'Ass_AssetsType',value: 'atid',text: 'aname' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('AOIId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('AOIId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/DeleteForm', { keyValue: keyValue}, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsOutItemApply/GetPageList',
- headData: [
- { label: "资产编号", name: "AOICode", width: 100, align: "left"},
- { label: "资产名称", name: "AOIName", width: 100, align: "left"},
- { label: "资产类别", name: "AOITId", 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: "AOIEName", width: 100, align: "left"},
- { label: "资产型号", name: "AOIModel", width: 100, align: "left"},
- { label: "生产厂家", name: "AOIManufacturer", width: 100, align: "left"},
- { label: "单价", name: "AOIPrice", width: 100, align: "left"},
- { label: "数量", name: "AOIStock", width: 100, align: "left"},
- { label: "数量单位", name: "AOIUnit", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op,$cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'sldw',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }},
- { label: "出库照片", name: "AOIPhoto", width: 100, align: "left"},
- { label: "资产描述", name: "AOIContent", width: 100, align: "left"},
- { label: "资产规格", name: "AOISpecification", width: 100, align: "left"},
- { label: "用途", name: "AOIUse", width: 100, align: "left"},
- {
- label: "使用人", name: "AOIUsePeople", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
- key: value,
- keyId: 'f_userid',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- {
- label: "原部门", name: "AOIOldDepartment", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'name',
- callback: function (_data) {
- callback(_data['id']);
- }
- });
- }
- },
- {
- label: "原库房", name: "AOIStorageId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
- key: value,
- keyId: 'sid',
- callback: function (_data) {
- callback(_data['sname']);
- }
- });
- }
- },
- ],
- mainId:'AOIId',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|