|
|
@@ -0,0 +1,128 @@ |
|
|
|
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) |
|
|
|
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 |
|
|
|
* 创建人:超级管理员 |
|
|
|
* 日 期:2021-08-02 16:47 |
|
|
|
* 描 述:合同审批管理 |
|
|
|
*/ |
|
|
|
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); |
|
|
|
$('#Type').lrDataItemSelect({ code: 'htlx' }); |
|
|
|
// 刷新 |
|
|
|
$('#lr_refresh').on('click', function () { |
|
|
|
location.reload(); |
|
|
|
}); |
|
|
|
// 新增 |
|
|
|
$('#lr_add').on('click', function () { |
|
|
|
learun.layerForm({ |
|
|
|
id: 'form', |
|
|
|
title: '新增', |
|
|
|
url: top.$.rootUrl + '/CustomFunction/ContractInfo/Form', |
|
|
|
width: 700, |
|
|
|
height: 500, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 编辑 |
|
|
|
$('#lr_edit').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var Status = $('#gridtable').jfGridValue('Status'); |
|
|
|
if (Status != '0') { |
|
|
|
return learun.warning.alert('选中项已提交,不可编辑!'); |
|
|
|
} |
|
|
|
learun.layerForm({ |
|
|
|
id: 'form', |
|
|
|
title: '编辑', |
|
|
|
url: top.$.rootUrl + '/CustomFunction/ContractInfo/Form?keyValue=' + keyValue, |
|
|
|
width: 700, |
|
|
|
height: 500, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 打印 |
|
|
|
$('#lr_print').on('click', function () { |
|
|
|
$('#gridtable').jqprintTable(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 初始化列表 |
|
|
|
initGird: function () { |
|
|
|
$('#gridtable').jfGrid({ |
|
|
|
url: top.$.rootUrl + '/CustomFunction/ContractInfo/GetPageList', |
|
|
|
headData: [ |
|
|
|
{ label: "合同名称", name: "Name", width: 100, align: "left" }, |
|
|
|
{ label: "合同编号", name: "EnCode", width: 100, align: "left" }, |
|
|
|
{ label: "合同开始时间", name: "StartTime", width: 100, align: "left" }, |
|
|
|
{ label: "合同结束时间", name: "EndTime", width: 100, align: "left" }, |
|
|
|
{ label: "合同标的", name: "Target", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "合同类型", name: "Type", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'htlx', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "合同金额", name: "Amount", width: 100, align: "left" }, |
|
|
|
{ label: "对方单位名称", name: "OtherParty", width: 100, align: "left" }, |
|
|
|
{ label: "对方单位联系人", name: "OtherPartyContacts", width: 100, align: "left" }, |
|
|
|
{ label: "联系方式", name: "OtherPartyMobile", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "申报人", name: "CreateUserId", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('user', { |
|
|
|
key: value, |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.name); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "申报时间", name: "CreateTime", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "状态", name: "Status", width: 100, align: "left", |
|
|
|
formatter: function (cellvalue, row) { |
|
|
|
if (cellvalue == 0) { |
|
|
|
return "<span class=\"label label-default\">草稿</span>"; |
|
|
|
} else if (cellvalue == 1) { |
|
|
|
return "<span class=\"label label-warning\">审批中</span>"; |
|
|
|
} else if (cellvalue == 2) { |
|
|
|
return "<span class=\"label label-success\">审批通过</span>"; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
], |
|
|
|
mainId: 'Id', |
|
|
|
isPage: true |
|
|
|
}); |
|
|
|
page.search(); |
|
|
|
}, |
|
|
|
search: function (param) { |
|
|
|
param = param || {}; |
|
|
|
param.SqlParameter = " and (Status>=2)"; |
|
|
|
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); |
|
|
|
} |
|
|
|
}; |
|
|
|
refreshGirdData = function () { |
|
|
|
$('#gridtable').jfGridSet('reload'); |
|
|
|
}; |
|
|
|
page.init(); |
|
|
|
} |