112 lines
3.4 KiB
JavaScript
112 lines
3.4 KiB
JavaScript
|
/* * 版 本 PIT-ADMS V7.0.3 敏捷开发框架
|
|||
|
* Copyright (c) 2013-2018 Hexagon PPM
|
|||
|
* 创建人:超级管理员
|
|||
|
* 日 期:2022-03-14 10:58
|
|||
|
* 描 述:业务表
|
|||
|
*/
|
|||
|
var acceptClick;
|
|||
|
var keyValue = request('keyValue');
|
|||
|
var bootstrap = function ($, learun) {
|
|||
|
"use strict";
|
|||
|
var page = {
|
|||
|
init: function () {
|
|||
|
page.bind();
|
|||
|
page.initData();
|
|||
|
},
|
|||
|
bind: function () {
|
|||
|
|
|||
|
$('#breakerType').lrselect({
|
|||
|
data: [
|
|||
|
{
|
|||
|
id: 'MCCB', text: 'MCCB'
|
|||
|
},
|
|||
|
{
|
|||
|
id: 'MCB', text: 'MCB'
|
|||
|
},
|
|||
|
{
|
|||
|
id: 'ACB', text: 'ACB'
|
|||
|
}
|
|||
|
],
|
|||
|
value: 'id',
|
|||
|
text: 'text',
|
|||
|
});
|
|||
|
$('#breakerType').change(function () {
|
|||
|
var propertyType = $('#breakerType').lrselectGet();
|
|||
|
if (propertyType == "MCCB") {
|
|||
|
$("#s_Capacity").show();
|
|||
|
$("#s_Capacity_Max").show();
|
|||
|
|
|||
|
}
|
|||
|
else if (propertyType == "ACB"){
|
|||
|
$("#s_Capacity").hide();
|
|||
|
$("#s_Capacity_Max").show();
|
|||
|
}
|
|||
|
else if (propertyType == "MCB") {
|
|||
|
$("#s_Capacity").show();
|
|||
|
$("#s_Capacity_Max").hide();
|
|||
|
}
|
|||
|
});
|
|||
|
},
|
|||
|
initData: function () {
|
|||
|
|
|||
|
|
|||
|
if (!!keyValue) {
|
|||
|
$.lrSetForm(top.$.rootUrl + '/ZZDT_EC/RefCB/GetFormData?keyValue=' + keyValue, function (data) {
|
|||
|
for (var id in data) {
|
|||
|
if (!!data[id] && data[id].length > 0) {
|
|||
|
$('#' + id).jfGridSet('refreshdata', data[id]);
|
|||
|
}
|
|||
|
else {
|
|||
|
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
|
|||
|
}
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
}
|
|||
|
};
|
|||
|
// 保存数据
|
|||
|
acceptClick = function (callBack) {
|
|||
|
if (!$('#form').lrValidform()) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
//文字特殊字符及最大长度检测
|
|||
|
if (!verify()) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
var formData = $('#form').lrGetFormData();
|
|||
|
var postData = {
|
|||
|
strEntity: JSON.stringify(formData)
|
|||
|
}
|
|||
|
$.lrSaveForm(top.$.rootUrl + '/ZZDT_EC/RefCB/SaveForm?keyValue=' + keyValue, postData, function (res) {
|
|||
|
// 保存成功后才回调
|
|||
|
if (!!callBack) {
|
|||
|
callBack();
|
|||
|
}
|
|||
|
});
|
|||
|
};
|
|||
|
page.init();
|
|||
|
}
|
|||
|
|
|||
|
//文字特殊字符及最大长度检测
|
|||
|
function verify() {
|
|||
|
//var msg = checkStr($("#BusinessTableName").val(), 200);
|
|||
|
//if (msg) {
|
|||
|
// $.lrValidformMessage($("#BusinessTableName"), msg);
|
|||
|
// $('#BusinessTableName').click();
|
|||
|
// return false;
|
|||
|
//}
|
|||
|
//msg = checkStr($("#BusinessTableCode").val(), 200);
|
|||
|
//if (msg) {
|
|||
|
// $.lrValidformMessage($("#BusinessTableCode"), msg);
|
|||
|
// $('#BusinessTableCode').click();
|
|||
|
// return false;
|
|||
|
//}
|
|||
|
//msg = checkStr($("#Remark").val(), 500);
|
|||
|
//if (msg) {
|
|||
|
// $.lrValidformMessage($("#Remark"), msg);
|
|||
|
// $('#Remark').click();
|
|||
|
// return false;
|
|||
|
//}
|
|||
|
return true;
|
|||
|
}
|