var projectObj = {
personnelId: null,
accountId: null,
channelId: null,
projectId: null,
nature: null,
IsAdmin: null,
remote: null,
identify: null,
xmid: null
}
function viewModel() {
this.id = "";
//渠道信息
this.init = function () {
var search = $("#dtn-search").val();
$('#ChannelInfo').datagrid({
url: '/ProManager/Datagrid',
method: 'Get',
singleSelect: true,
rownumbers: true,
onSelect: function (rowIndex, rowData) {
$("#dtn-search-project").searchbox("setValue", "");
projectObj.channelId = $('#ChannelInfo').datagrid("getSelected")["ID"];
databindProject()
databindStation(0)
databindServer(0)
databindWorker(0)
databindProduct(0)
databindModual(0)
databindInstrument(0)
databindRemote(0)
databindInter(0)
databindSmart(0)
}
});
$('#project').datagrid({
toolbar: '#btn_func',
fit: true,
rownumbers: true,
columns: [[
{ field: '名称', title: '名称', width: 180 },
{ field: '负责人', title: '负责人', width: 80 },
{ field: '性质', title: '性质', width: 80, align: 'center' },
{ field: '实施方式', title: '实施方式', width: 80, align: 'center' },
{ field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
{
field: '状态', title: '项目状态', width: 70, align: 'center'
},
//{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
//{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
{ field: '中心数量', title: '中心数量', width: 100 },
{ field: '村站数量', title: '村站数量', width: 80 },
{ field: '网络带宽', title: '网络带宽', width: 80 },
{ field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
{ field: '账号', title: '账号', width: 80 },
{ field: '密码', title: '密码', width: 80 },
{ field: '联系方式', title: '联系方式', width: 90, align: 'center' },
{ field: '启用监控', title: '启用监控', width: 90, align: 'center' },
{ field: '概况', title: '概况', width: 300 }
]]
})
}
//加载项目
this.load = function (id) {
//ID
$("#id").val(id);
//性质
$("#nature").combobox({
url: '/ProManager/GetNature',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#nature').combobox('setValue', data[0].ID);
}
});
//工作流目录
$("#GZLMLID").combobox({
url: '/ProManager/GetCatalog?id=1',
valueField: 'ID',
textField: '名称',
onLoadSuccess: function (data) {
$('#GZLMLID').combobox('setValue', data[0].ID);
}
});
//实施方式
$("#implementation").combobox({
url: '/ProManager/GetImplementation',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#implementation').combobox('setValue', data[0].ID);
}
});
//项目状态
$("#state").combobox({
url: '/ProManager/GetState',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#state').combobox('setValue', data[0].ID);
}
});
$('#BHCustomer').combogrid({
mode: 'remote',
value: '',
idField: '编码',
textField: '名称',
panelHeight: 380,
url: "/ProManager/GetBHCustomer",
columns: [[
{
field: 'son', title: '序号', width: 40,
formatter: function (value, row, index) {//设置自动增长列
index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
return index++;//根据行的数量不断自增
}
},
{ field: 'id', title: 'id', width: 100, hidden: true },
{ field: '编码', title: '编码', width: 100, hidden: true },
{ field: '名称', title: '客户名称', width: 230 },
{ field: '社会信用代码', title: '社会信用代码', width: 170 },
{ field: '简码', title: '简码', width: 100 }
]],
onSelect: function (rowIndex, rowData) {
$('#name').val(rowData.名称);
$('#SocialCreditCode').val(rowData.社会信用代码);
$('#simple').val(rowData.简码);
$('#BHID').val(rowData.id);
}
});
//上线时间
$(function () {
var curr_time = new Date();
var str = curr_time.getFullYear() + "-";
str += curr_time.getMonth() + 1 + "-";
str += curr_time.getDate();
$('#onlineDate').datebox('setValue', str);
});
}
//绑定项目信息
this.bindData = function (id) {
//性质
$("#nature").combobox({
url: '/ProManager/GetNature',
valueField: 'ID',
textField: '显示名'
});
//实施方式
$("#implementation").combobox({
url: '/ProManager/GetImplementation',
valueField: 'ID',
textField: '显示名'
});
//项目状态
$("#state").combobox({
url: '/ProManager/GetState',
valueField: 'ID',
textField: '显示名'
});
//工作流目录
$("#GZLMLID").combobox({
url: '/ProManager/GetCatalog?id=1',
valueField: 'ID',
textField: '名称',
});
//详细信息加载
$.ajax({
url: '/ProManager/GetProInfo/' + id,
method: 'GET',
success: function (data) {
if (data.code == 200) {
$('#id').val(data.obj[0].渠道ID);
$('#charge').val(data.obj[0].负责人);
$('#name').val(data.obj[0].名称);
$('#survey').val(data.obj[0].概况);
$('#simple').val(data.obj[0].简码);
$('#SocialCreditCode').val(data.obj[0].统一社会信用代码);
$('#coreNum').val(data.obj[0].中心数量);
$('#villageNum').val(data.obj[0].村站数量);
$('#bandwidth').val(data.obj[0].网络带宽);
if (data.obj[0].服务器分离 == 1) {
$('#serveSeparate').switchbutton({ checked: true });
}
else {
$('#serveSeparate').switchbutton({ checked: false });
}
$('#nature').combobox('setValue', data.obj[0].性质);
$('#implementation').combobox('setValue', data.obj[0].实施方式);
$('#state').combobox('setValue', data.obj[0].状态);
$('#onlineDate').datebox('setValue', data.obj[0].上线时间);
$('#checkDate').datebox('setValue', data.obj[0].验收时间);
$('#endTime').val(data.obj[0].授权到期时间);
$('#another').val(data.obj[0].分管领导);
$('#anotherPhone').val(data.obj[0].分管领导电话);
$('#principal').val(data.obj[0].项目对接人);
$('#principalPhone').val(data.obj[0].项目对接人电话);
$('#attentionLevel').val(data.obj[0].关注度);
if (data.obj[0].启用监控 == 1) {
$('#enable').switchbutton({ checked: true });
}
else {
$('#enable').switchbutton({ checked: false });
}
$('#email').val(data.obj[0].邮件推送);
$('#wxin').val(data.obj[0].微信推送);
layui.use(['rate'], function () {
var rate = layui.rate;
// 单个渲染
rate.render({
elem: '.attentionLevel',
choose: function (value) {
$('#attentionLevel').val(value);
console.log(value); // 获得选中的评分值
},
value: $('#attentionLevel').val()
});
});
} else {
//弹出错误消息
ZLPMS.Alert(data.msg, 1);
}
}
})
//问题审核流程
$.ajax({
url: '/ProManager/GetXMWTLC/' + id,
method: 'GET',
success: function (data) {
if (data.length > 0) {
$("#SHID").val(data[0].ID)
$("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
} else {
//弹出错误消息
top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
}
}
})
//附件
$.post("/ProManager/Attachment?id=" + id + "&type=1", {}, function (data) {
if (data != null || data.length > 0) {
$("#attchment").html();
var html = "";
for (var i = 0; i < data.length; i++) {
if (data[i].type == 1) {
html += "
";
}
else {
html += '";
}
}
$("#attchment").html(html);
}
})
//BH客户数据获取
$('#BHCustomer').combogrid({
mode: 'remote',
value: '',
idField: '编码',
textField: '名称',
panelHeight: 380,
url: "/ProManager/GetBHCustomer",
columns: [[
{
field: 'son', title: '序号', width: 40,
formatter: function (value, row, index) {//设置自动增长列
index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
return index++;//根据行的数量不断自增
}
},
{ field: 'id', title: 'id', width: 100, hidden: true },
{ field: '编码', title: '编码', width: 100, hidden: true },
{ field: '名称', title: '客户名称', width: 230 },
{ field: '社会信用代码', title: '社会信用代码', width: 170 },
{ field: '简码', title: '简码', width: 100 }
]],
onSelect: function (rowIndex, rowData) {
$('#name').val(rowData.名称);
$('#SocialCreditCode').val(rowData.社会信用代码);
$('#simple').val(rowData.简码);
$('#BHID').val(rowData.id);
}
});
}
//加载机构
this.StationLoad = function (id) {
//ID
$("#ID").val(id);
//项目等级
$("#DJ").combobox({
url: '/ProManager/GetLevel',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#DJ').combobox('setValue', data[0].ID);
}
});
//项目状态
$("#ZT").combobox({
url: '/ProManager/GetState',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#ZT').combobox('setValue', data[0].ID);
}
});
//上线时间
$(function () {
var curr_time = new Date();
var str = curr_time.getFullYear() + "-";
str += curr_time.getMonth() + 1 + "-";
str += curr_time.getDate();
$('#SXSJ').datebox('setValue', str);
});
//工作流目录
$("#GZLMLID").combobox({
url: '/ProManager/GetCatalog?id=2',
valueField: 'ID',
textField: '名称',
onLoadSuccess: function (data) {
$('#GZLMLID').combobox('setValue', data[0].ID);
}
});
}
//绑定机构信息
this.StationBind = function (id) {
//项目等级
$("#DJ").combobox({
url: '/ProManager/GetLevel',
valueField: 'ID',
textField: '显示名'
});
//项目状态
$("#ZT").combobox({
url: '/ProManager/GetState',
valueField: 'ID',
textField: '显示名'
});
$.ajax({
url: '/ProManager/GetStationInfo/' + id,
method: 'GET',
success: function (data) {
if (data.code == 200) {
$("#ID").val(data.obj[0].ID);
$("#XMID").val(data.obj[0].项目ID);
$('#MC').val(data.obj[0].名称);
$('#GK').val(data.obj[0].概况);
$('#JM').val(data.obj[0].简码);
$('#CWL').val(data.obj[0].床位量);
$('#RMZL').val(data.obj[0].日门诊量);
$('#NSR').val(data.obj[0].年收入);
$('#DJ').combobox('setValue', data.obj[0].等级);
$('#ZT').combobox('setValue', data.obj[0].状态);
$('#SXSJ').datebox('setValue', data.obj[0].上线时间);
$('#YSSJ').datebox('setValue', data.obj[0].验收时间);
$('#IPD').val(data.obj[0].IP段);
$('#FZRM').val(data.obj[0].负责人名);
$('#DH').val(data.obj[0].电话);
$('#GLRM').val(data.obj[0].管理人名);
$('#GLRDH').val(data.obj[0].管理人电话);
ProblemLoad($("#XMID").val())
} else {
//弹出错误消息
ZLPMS.Alert(data.msg, 1);
}
}
})
//工作流目录
$("#GZLMLID").combobox({
url: '/ProManager/GetCatalog?id=2',
valueField: 'ID',
textField: '名称',
});
//问题审核流程
function ProblemLoad(XMID) {
$.ajax({
url: '/ProManager/GetProblem?XMID=' + XMID + "&ID=" + id,
method: 'GET',
success: function (data) {
if (data.length > 0) {
$("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
} else {
//弹出错误消息
top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
}
}
})
}
}
//加载服务器
this.ServerLoad = function (id) {
//ID
$("#XMID").val(id);
//服务器类型
$("#LX").combobox({
url: '/ProManager/GetServerType',
valueField: 'ID',
textField: '显示名',
multiple: true,// 开启多选
onLoadSuccess: function (data) {
$('#LX').combobox('setValue', data[0].ID);
}
});
//安装服务类型
$("#AZFW").combobox({
url: '/ProManager/GetInstallServerType',
valueField: 'ID',
textField: '显示名',
multiple: true, // 开启多选
onLoadSuccess: function (data) {
$('#AZFW').combobox('setValue', data[0].ID);
}
});
//数据库类型
$("#SJKLX").combobox({
url: '/ProManager/GetDataBaseType',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#SJKLX').combobox('setValue', '');
}
});
//产品
$("#CP").combobox({
url: '/ProManager/GetProduct',
valueField: 'ID',
textField: '显示名',
onLoadSuccess: function (data) {
$('#CP').combobox('setValue', data[0].ID);
}
});
}
//绑定服务器
this.ServerBind = function (id) {
//ID
$("#ID").val(id);
//服务器类型
$("#LX").combobox({
url: '/ProManager/GetServerType',
valueField: 'ID',
textField: '显示名',
multiple: true // 开启多选
});
//安装服务类型
$("#AZFW").combobox({
url: '/ProManager/GetInstallServerType',
valueField: 'ID',
textField: '显示名',
multiple: true // 开启多选
});
//数据库类型
$("#SJKLX").combobox({
url: '/ProManager/GetDataBaseType',
valueField: 'ID',
textField: '显示名'
});
//产品
$("#CP").combobox({
url: '/ProManager/GetProduct',
valueField: 'ID',
textField: '显示名'
});
$.ajax({
url: '/ProManager/GetServerInfo/' + id,
method: 'GET',
success: function (data) {
if (data.code == 200) {
$('#ID').val(id);
$('#XMID').val(data.obj[0].项目ID);
$('#NC').val(data.obj[0].内存);
$('#XH').val(data.obj[0].型号);
$('#CZJT').val(data.obj[0].操作系统);
$('#CPU').val(data.obj[0].CPU);
$('#IPDZ').val(data.obj[0].IP地址);
$('#SJKBB').val(data.obj[0].数据库版本);
$('#JQM').val(data.obj[0].机器码);
$('#SM').val(data.obj[0].说明);
if (data.obj[0].类型 != "" && data.obj[0].类型 != null) {
$('#LX').combobox('setValue', data.obj[0].类型.split(","));
}
if (data.obj[0].安装服务 != "" && data.obj[0].类型 != null) {
$('#AZFW').combobox('setValue', data.obj[0].安装服务.split(","));
}
$('#SJKLX').combobox('setValue', data.obj[0].数据库类型);
$('#CP').combobox('setValue', data.obj[0].产品);
$('#SJKLJC').val(data.obj[0].数据库连接串);
$('#FWFXDK').val(data.obj[0].服务发现端口);
$('#FHQ').val(data.obj[0].防火墙);
$('#SDRJ').val(data.obj[0].杀毒软件);
$('#BFFS').val(data.obj[0].备份方式);
$('#BFLJ').val(data.obj[0].备份路径);
$('#BFRJ').val(data.obj[0].备份软件);
$('#ZH').val(data.obj[0].账号);
$('#MM').val(data.obj[0].密码);
} else {
//弹出错误消息
ZLPMS.Alert(data.msg, 1);
}
}
})
}
//加载项目人员
this.Workerload = function (id) {
//ID
$("#ID").val(id);
//人员项目
$("#XM").combobox({
url: '/ProManager/GetWorkerInfo',
valueField: 'ID',
textField: '姓名'
});
//加入时间
$(function () {
var curr_time = new Date();
var str = curr_time.getFullYear() + "-";
str += curr_time.getMonth() + 1 + "-";
str += curr_time.getDate();
$('#RZSJ').datebox('setValue', str);
});
$('#RZSJ').datebox({ panelHeight: '250px' })
}
//加载产品
this.ProductLoad = function (id) {
//ID
$("#ID").val(id);
//产品
$("#CPID").combobox({
url: '/ProManager/GetProductByID',
valueField: 'ID',
textField: '名称',
onChange: function (newValue, oldValue) {
//版本
$("#BB").combobox({
url: '/ProManager/GetEditionByID/' + newValue,
valueField: 'ID',
textField: '版本号'
});
}
});
}
//绑定产品
this.ProductBind = function (id) {
var cpID = "";
//产品
$("#CPID").combobox({
url: '/ProManager/GetProductByID',
valueField: 'ID',
textField: '名称',
onChange: function (newValue, oldValue) {
cpID = newValue;
$("#BB").combobox({
url: '/ProManager/GetEditionByID/' + newValue,
valueField: 'ID',
textField: '版本号'
});
}
});
$.ajax({
url: '/ProManager/GetProductInfo/' + id,
method: 'GET',
success: function (data) {
if (data != null) {
$('#CPID').combobox('setValue', data[0].ID);
bindProduct(id);
} else {
//弹出错误消息
top.ZLPMS.Msg("系统中没有该条数据");
}
}
})
//应用状态
$("#YYZT").combobox({
//data: [{ "ID": "-1", "名称": "无" }, { "ID": "0", "名称": "停用" }, { "ID": "1", "名称": "正在使用" }, { "ID": "2", "名称": "使用元HIS" }],
url: '/ProManager/SelectNature?ID=DD2C3294-4FBB-4616-A046-07D3CAF52414',
valueField: '代码',
textField: '名称',
limitToList: true,
onLoadSuccess: function (data) {
//let found = data.find(item => item.是否默认="0");
//$(this).combobox('select', found.代码);
}
});
}
//版本和说明
function bindProduct(id) {
$.ajax({
url: '/ProManager/GetProjectProducct/' + id,
method: 'post',
success: function (data) {
$('#BB').combobox('setValue', data[0].版本);
$('#YYZT').combobox('setValue', data[0].应用状态);
$('#SM').val(data[0].说明);
}
})
}
//绑定远程方式
this.RemoteLoad = function (obj) {
obj = JSON.parse(obj.replace(/"/g, '"'))
$("#ID").val(obj.ID)
$("#MC").val(obj.名称);
$("#ZH").val(obj.账号);
$("#MM").val(obj.密码);
$("#BZ").val(obj.备注);
$("#LJR").val(obj.联系人);
$("#LJRDH").val(obj.联系人电话);
}
//加载项目个性化
this.IdentifyData = function (id) {
//项目所属的产品
$("#CPID").combobox({
url: '/Problem/GetProductByID/' + id,
valueField: '产品ID',
textField: '名称',
onChange: function (newValue, oldValue) {
//版本
$("#BB").combobox({
url: '/ProManager/GetEditionByID/' + newValue,
valueField: 'ID',
textField: '版本号',
});
}
})
$("#XGR").combobox({
url: '/ProManager/GetWorker/' + id,
valueField: '姓名',
textField: '姓名DECODE'
});
}
//绑定项目个性化
this.IdentifyLoad = function (obj) {
$.get("/ProManager/GetDataById", { id: obj }, function (data) {
//项目所属的产品
$("#CPID").combobox({
url: '/Problem/GetProductByID/' + data[0].项目ID,
valueField: '产品ID',
textField: '名称',
onChange: function (newValue, oldValue) {
//版本
$("#BB").combobox({
url: '/ProManager/GetEditionByID/' + newValue,
valueField: 'ID',
textField: '版本号',
});
}
})
$("#XGR").combobox({
url: '/ProManager/GetWorker/' + data[0].项目ID,
valueField: '姓名',
textField: '姓名DECODE'
});
switch (data[0].修改性质) {
case 1: $("input[name=XGXZ][value=1]").attr('checked', 'checked'); break;
case 2: $("input[name=XGXZ][value=2]").attr('checked', 'checked'); break;
case 3: $("input[name=XGXZ][value=3]").attr('checked', 'checked'); break;
}
$("#ID").val(data[0].ID)
$("#XMID").val(data[0].项目ID)
$("#MC").textbox("setValue", data[0].名称)
$("#CPID").combobox('setValue', data[0].产品ID);
$("#XGR").combobox('setValue', data[0].修改人);
$("#BB").combobox('setValue', data[0].版本);
UM.getEditor('XGSM').setContent(data[0].修改说明 == null ? "" : data[0].修改说明);
$("#XGSJ").datebox("setValue", data[0].修改时间)
})
//附件
$.post("/ProManager/Attachment?id=" + obj + "&type=1", {}, function (data) {
if (data != null || data.length > 0) {
$("#attchment").html();
var html = "";
for (var i = 0; i < data.length; i++) {
if (data[i].type == 1) {
html += "";
}
else {
html += '";
}
}
$("#attchment").html(html);
}
})
}
//加载验收模块数据
this.ModualData = function (id) {
//项目所属的产品
$("#CPID").combobox({
url: '/Problem/GetProductByID/' + id,
valueField: 'ID',
textField: '名称',
onChange: function (newValue, oldValue) {
//所属模块
$('#MKID').combotree({
url: "/Problem/getmk/" + newValue,
});
}
})
}
//初始化全局接口信息
this.GlobalInit = function () {
//项目
$("#XMID").combobox({
url: '/Problem/GetProjectByInfo',
valueField: 'ID',
textField: '名称',
limitToList: true,
})
//创建人
$("#CJR").combobox({
url: '/ProManager/GetinfoBynature?type=0',
valueField: 'ID',
textField: '名称',
limitToList: true,
onLoadSuccess: function () {
$.post("/ProManager/GetFeedbackID", function (data) {
$("#CJR").combobox("setValue", data.id)
})
}
})
//负责人
$("#ZRR").combobox({
url: '/ProManager/GetinfoBynature?type=0',
valueField: 'ID',
textField: '名称',
limitToList: true,
onLoadSuccess: function () {
$.post("/ProManager/GetFeedbackID", function (data) {
$("#ZRR").combobox("setValue", data.id)
})
}
})
//用户名称
$("#JKDFMC").combobox({
url: '/ProManager/GetinfoBynature?type=1',
valueField: 'ID',
textField: '名称',
})
}
//绑定全局接口信息
this.GlobalBind = function (id) {
//项目
$("#XMID").combobox({
url: '/Problem/GetProjectByInfo',
valueField: 'ID',
textField: '名称',
limitToList: true,
})
//创建人
$("#CJR").combobox({
url: '/ProManager/GetinfoBynature?type=0',
valueField: 'ID',
textField: '名称',
limitToList: true,
onLoadSuccess: function () {
$.post("/ProManager/GetFeedbackID", function (data) {
//用户名称
$("#JKDFMC").combobox({
url: '/ProManager/GetinfoBynature?type=1',
valueField: 'ID',
textField: '名称',
onLoadSuccess: function () {
//负责人
$("#ZRR").combobox({
url: '/ProManager/GetinfoBynature?type=0',
valueField: 'ID',
textField: '名称',
limitToList: true,
onLoadSuccess: function () {
$.post("/ProManager/GetFeedbackID", function (data) {
$.ajax({
url: '/ProManager/GetInterface/' + id,
method: 'post',
success: function (data) {
if (data.length > 0) {
$('#ID').val(id);
$('#XMID').combobox('setValue', data[0].项目ID);
$('#MC').textbox('setValue', data[0].名称);
$('#MS').val(data[0].描述)
$('#ZRR').combobox('setValue', data[0].责任人);
$('#CJR').combobox('setValue', data[0].创建人);
$('#JKDFMC').combobox('setValue', data[0].接口对方名称);
$("#YSSJ").datebox("setValue", data[0].验收时间)
$("#SQSJ").datebox("setValue", data[0].申请时间)
$("#WCSJ").datebox("setValue", data[0].完成时间)
switch (data[0].状态) {
case 1: $("input[name=ZT][value=1]").attr('checked', 'checked'); break;
case 2: $("input[name=ZT][value=2]").attr('checked', 'checked'); break;
case 3: $("input[name=ZT][value=3]").attr('checked', 'checked'); break;
case 4: $("input[name=ZT][value=4]").attr('checked', 'checked'); break;
case 5: $("input[name=ZT][value=5]").attr('checked', 'checked'); break;
case 6: $("input[name=ZT][value=6]").attr('checked', 'checked'); break;
}
switch (data[0].类型) {
case 1: $("input[name=LX][value=1]").attr('checked', 'checked'); break;
case 2: $("input[name=LX][value=2]").attr('checked', 'checked'); break;
case 3: $("input[name=LX][value=3]").attr('checked', 'checked'); break;
case 4: $("input[name=LX][value=4]").attr('checked', 'checked'); break;
case 5: $("input[name=LX][value=5]").attr('checked', 'checked'); break;
}
//layui重新渲染
layui.use('form', function () {
var form = layui.form;//高版本建议把括号去掉,有的低版本,需要加()
form.render()
});
} else {
//弹出错误消息
ZLPMS.Alert("数据异常,请联系管理人员", 3);
}
}
})
//附件
$.post("/ProManager/Attachment?id=" + id + "&type=3", {}, function (data) {
if (data != null && data.length > 0) {
$("#attchment").html();
var html = "";
for (var i = 0; i < data.length; i++) {
if (data[i].type == 1) {
html += " ";
}
else {
html += '下载附件' + (i + 1) + " ";
}
}
$("#attchment").html(html);
}
})
})
}
})
}
})
})
}
})
}
//绑定产品服务时间
this.ProductServicesBind = function (id) {
$.ajax({
url: '/ProManager/Get_SingleServiceRecord/' + id,
method: 'GET',
success: function (data) {
if (data != null) {
$("#ID").val(data[0].ID);
$('#QDID').val(data[0].渠道ID);
$("#XMID").val(data[0].项目ID);
$("#CPID").val(data[0].项目产品模块ID);
$("#FFLX").combobox('setValue', data[0].服务类型);
$("#SM").val(data[0].说明);
$("#ServiceStartTime").datebox("setValue", data[0].服务开始时间);
$("#ServiceEndTime").datebox("setValue", data[0].服务结束时间);
/* $("#contractDate").datebox("setValue", data[0].签订时间);*/
$("#ALL").attr('disabled', 'disabled');
} else {
//弹出错误消息
top.ZLPMS.Msg("系统中没有该条数据");
}
}
})
//应用状态
}
}
//提交请求
var Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
},
//项目信息
PostData: function (index) {
//执行提交验证
var r = $('#ff').form('validate');
var name = $("#name").val();
if (name == null || name == "") {
top.ZLPMS.Msg("项目名称不能为空");
}
else {
if (r) {//post到后台
var url = '/ProManager/Add_Project';
var param = ZLPMS.FormToObject('ff');
var dealflow = $("#GZLMLID").combobox('getValue');
if (param.enable) {
if (param.email == "" && param.wxin == "") {
top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
return;
}
}
param.GZLMLID = dealflow;
$.post(url, param, function (data) {
if (data.length == 1) {
document.getElementById("btn_upload").click()
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加成功");
} else if (data == -1) {
top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加失败");
}
});
}
}
},
//接口信息
Interface_PostData: function (index, type, mode, obj) {
var url = '/ProManager/Add_Interface';
if (type == 2) {
var url = '/ProManager/Edit_Interface';
}
//执行提交验证
var r = $('#insert_interface').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
param.JKMS = mode;
if (param.LX == null) {
top.ZLPMS.Msg("请选择类型");
return
}
if (param.ZT == null && type == 1) {
top.ZLPMS.Msg("请选择状态");
return
}
$.post(url, param, function (data) {
if (data == 1) {
document.getElementById("btn_upload").click()
obj.datagrid("reload")
top.ZLPMS.Msg("保存成功");
top.ZLPMS.CloseWindow(index);
}
else {
top.ZLPMS.Msg("保存失败");
top.ZLPMS.CloseWindow(index);
}
});
}
},
//变更接口状态
DealInte_PostData: function (index, obj) {
var r = $('#insert_interface').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
if (param.MS.length == 0) {
top.ZLPMS.Msg("请务必填写变更描述", 2);
} else {
$.post('/ProManager/DealInte', param, function (data) {
if (data == 1) {
document.getElementById("btn_upload").click()
obj.datagrid("reload")
top.ZLPMS.Msg("保存成功");
top.ZLPMS.CloseWindow(index);
}
else {
top.ZLPMS.Msg("保存失败");
top.ZLPMS.CloseWindow(index);
}
});
}
}
},
//项目个性化
identify_PostData: function (index, type) {
var url = '/ProManager/Edit_Identify';
if (type == 1) {
url = '/ProManager/Add_Identify';
}
//执行提交验证
var r = $('#insert_identify').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_identify");//取页面填写的值
param.XGSM = escape((UM.getEditor('XGSM').getContent()));
$.post(url, param, function (data) {
if (data.length == 36) {
document.getElementById("btn_upload").click()
top.ZLPMS.Msg("保存成功");
$('#identify').datagrid('reload');
top.ZLPMS.CloseWindow(index);
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存失败");
}
});
}
}
};
//项目信息
function databindProject() {
var search = $("#dtn-search-project").val();
if (projectObj.channelId != null) {
var Params = {
ChannelID: projectObj.channelId,
Search: search
}
$('#project').datagrid({
url: '/ProManager/BingProData',
method: 'Get',
singleSelect: true,
toolbar: '#btn_func',
fit: true,
rownumbers: true,
queryParams: Params,
columns: [[
{ field: '名称', title: '名称', width: 180 },
{ field: '负责人', title: '负责人', width: 80 },
{ field: '性质', title: '性质', width: 80, align: 'center' },
{ field: '实施方式', title: '实施方式', width: 80, align: 'center' },
{
field: '状态', title: '项目状态', width: 70, align: 'center', styler: function (value, row, index) {
if (value == '计划中') {
return 'color:#EEA2AD;font-weight:bold';
}
if (value == '上线中') {
return 'color:green;font-weight:bold;';
}
if (value == '已暂停') {
return 'color:#FF4500;font-weight:bold;';
}
if (value == '已终止') {
return 'color:gray;font-weight:bold;';
}
if (value == '售后中') {
return 'color:blue;font-weight:bold;';
}
}
},
{ field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
//{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
//{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
{ field: '中心数量', title: '中心数量', width: 100 },
{ field: '村站数量', title: '村站数量', width: 80 },
{ field: '网络带宽', title: '网络带宽', width: 80 },
{ field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
{
field: 'BHID', title: 'BH客户对照', width: 90, sortable: false, align: 'center'
,
styler: function (value, rowData, index) {
if (rowData.BHID == null) {
return 'color:#3c8b3c;font-weight:bold;';
}
}
, formatter: function (value, row, index) {
if (row.BHID == null) {
return '未对照';
}
else {
return '已对照';
}
}
},
{
field: '关注度', title: '关注度', width: 70, align: 'center', styler: function (value, row, index) {
if (value == '0') {
return 'color:#EEA2AD;font-weight:bold';
}
if (value == '1') {
return 'color:red;font-weight:bold;';
}
if (value == '2') {
return 'color:red;font-weight:bold;';
}
if (value == '3') {
return 'color:red;font-weight:bold;';
}
if (value == '4') {
return 'color:red;font-weight:bold;';
}
if (value == '5') {
return 'color:red;font-weight:bold;';
}
},
formatter: function (value, rowData, index) {
if (rowData.关注度 == '0') {
return '未关注';
}
if (value == '1') {
return '❤';
}
if (value == '2') {
return '❤❤';
}
if (value == '3') {
return '❤❤❤';
}
if (value == '4') {
return '❤❤❤❤';
}
if (value == '5') {
return '❤❤❤❤❤';
}
}
},
{
field: '启用监控', title: '启用监控', width: 90, align: 'center',
formatter: function (value, rowData, index) {
switch (value) {
case 1: {
return '√';
}
default: {
return '';
}
}
}
},
{ field: '概况', title: '概况', width: 300 }
]],
onSelect: function (rowIndex, rowData) {
databindStation(rowData["ID"])
databindServer(rowData["ID"])
databindWorker(rowData["ID"])
databindProduct(rowData["ID"])
//远程方式
databindRemote(rowData["ID"])
// 个性化修改
databindIdentify(rowData["ID"])
// 验收仪器
databindInstrument(rowData["ID"])
// 验收模块
databindModual(rowData["ID"])
// 接口信息
databindInter(rowData["ID"])
//项目ID
projectObj.xmid = rowData["ID"]
//智能表单
databindSmart(rowData["ID"])
}
})
}
}
//机构信息
function databindStation(id) {
if (id.length < 36) {
var search = $("#dtn-search-station").val();
id = $("#project").datagrid("getSelected")["ID"]
}
var Params = {
Search: search
}
$('#Station').datagrid({
url: '/ProManager/BingStationData?id=' + id,
method: 'GET',
toolbar: '#btn_Station',
fit: true,
singleSelect: true,
collapsible: true,
queryParams: Params,
rownumbers: true,
pagination: true,
});
}
//项目服务器信息
function databindServer(id) {
$('#Server').datagrid({
url: '/ProManager/BingServerData?id=' + id,
method: 'GET',
toolbar: '#btn_Server',
singleSelect: true,
collapsible: true,
rownumbers: true,
fit: true,
pagination: true,
onClickRow: function (index,row) {
databindServerDataBaseInfo(row.ID);
}
});
}
//项目服务器数据库
function databindServerDataBaseInfo(id) {
$('#serverDataBaseInfo').datagrid({
url: '/CloudMonitor/GetDbInfoByServerId?serverId=' + id,
method: 'GET',
toolbar: '#btn_Server_DataBaseInfo',
singleSelect: true,
collapsible: true,
rownumbers: true,
fit: true,
pagination: true
});
}
//项目人员信息
function databindWorker(id) {
$('#Worker').datagrid({
url: '/ProManager/BingWorkerData?id=' + id,
method: 'GET',
singleSelect: true,
collapsible: true,
rownumbers: true,
toolbar: '#btn_Worker',
fit: true,
pagination: true
});
}
//项目产品信息
function databindProduct(id) {
$('#product').datagrid({
url: '/ProManager/BingProductData?id=' + id,
method: 'GET',
singleSelect: true,
toolbar: "#btn_Product",
collapsible: true,
rownumbers: true,
fit: true,
pagination: true,
onClickRow: function (index, row) {
Product_StatusChange_Forms.ProductServiceRecords();
},
onLoadSuccess: function () {
$(this).datagrid('selectRow', 0);
Product_StatusChange_Forms.ProductServiceRecords();
}
});
}
//添加项目弹窗
function add_project() {
var ChannelInfo = $('#ChannelInfo').datagrid("getSelected");
if (ChannelInfo == null) {
top.ZLPMS.Msg("请选择一个渠道")
}
else {
top.ZLPMS.OpenWindow({
title: '新建项目',
url: '/ProManager/ProjectInfo/' + ChannelInfo["ID"],
area: ['800px', '715px'],
yes: function (index, layero) {
Forms.Submit(index, layero);
$('#project').datagrid('reload');
$('#Station').datagrid('reload');
$('#Server').datagrid('reload');
$('#Worker').datagrid('reload');
$('#product').datagrid('reload');
$('#ProductServiceRecords').datagrid('reload');
},
});
}
};
//修改项目弹窗
function update_project() {
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null || ProjectlInfo == "") {
top.ZLPMS.Msg("请选择一行数据");
}
else {
top.ZLPMS.OpenWindow({
title: '修改项目',
url: '/ProManager/UpdateProjectInfo/' + ProjectlInfo["ID"],
area: ['800px', '715px'],
yes: function (index, layero) {
updateForms.Submit(index, layero);
$('#project').datagrid('reload');
$('#Station').datagrid('reload');
$('#Server').datagrid('reload');
$('#Worker').datagrid('reload');
$('#product').datagrid('reload');
$('#ProductServiceRecords').datagrid('reload');
},
});
}
};
//修改项目
var updateForms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.updateForms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#project').datagrid('reload');
$('#Station').datagrid('reload');
$('#Server').datagrid('reload');
$('#Worker').datagrid('reload');
$('#product').datagrid('reload');
$('#ProductServiceRecords').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#update_project').form('validate');
if (r) {//post到后台
var dealflow = $("#GZLMLID").combobox('getValue');
var param = ZLPMS.FormToObject('update_project');
if (param.enable) {
if (param.email == "" && param.wxin == "") {
top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
return;
}
}
param.GZLMLID = dealflow;
var url = '/ProManager/Update_Project';
$.post(url, param, function (data) {
if (data == 1) {
document.getElementById("btn_upload").click()
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改成功");
} else if (data == -1) {
top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
}
else {
top.ZLPMS.Msg("修改失败");
top.ZLPMS.CloseWindow(index);
}
});
}
return null;
}
};
//删除项目提示窗体
function delete_project() {
var ProjectInfo = $('#project').datagrid("getSelected");
if (ProjectInfo != null) {
//确认删除对话框
top.ZLPMS.Confirm('您确定要删除选中的记录吗?删除后无法正常使用关于该项目的所有资源.', 5, function () {
//执行删除
Worker_Delete_Forms.Del(ProjectInfo["ID"]);
$('#project').datagrid('reload');
$('#Station').datagrid('reload');
$('#Server').datagrid('reload');
$('#Worker').datagrid('reload');
$('#product').datagrid('reload');
$('#ProductServiceRecords').datagrid('reload');
});
$('#project').datagrid('reload');
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//删除项目
var Worker_Delete_Forms = {
//表单提交
Del: function (id) {
$.ajax({
url: '/ProManager/Del_Project/' + id,
method: "post",
success: function (data) {
if (data != 0) {
$('#project').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
}
};
//添加机构窗口
function add_station() {
projectObj.projectId = $('#project').datagrid("getSelected");
if (projectObj.projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建机构',
url: '/ProManager/StationInfo/' + projectObj.projectId["ID"],
area: ['700px', '600px'],
yes: function (index, layero) {
Station_Add_Forms.Submit(index, layero);
$('#Station').datagrid('reload');
},
});
}
};
//添加机构
var Station_Add_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Station_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#Station').datagrid('reload');
},
//读取数据
PostData: function (index) {
var Name = $("#MC").val();
if (Name == null || Name == "") {
top.ZLPMS.Msg("机构名称不能为空")
}
else {
//执行提交验证
var r = $('#insert_station').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject('insert_station');
var dealflow = $("#GZLMLID").combobox('getValue');
var url = '/ProManager/Add_Station';
param.GZLMLID = dealflow;
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加成功");
} else if (data == -1) {
top.ZLPMS.Msg("机构名称已经被使用请重新输入");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加失败");
}
});
}
}
return null;
}
};
//机构修改窗口
function update_station() {
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
$.ajax({
url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
method: 'POST',
})
var StationInfo = $('#Station').datagrid("getSelected");
if (StationInfo == null) {
top.ZLPMS.Msg("请选择一行数据")
}
else {
top.ZLPMS.OpenWindow({
title: '修改机构',
url: '/ProManager/UpdatStationInfo/' + StationInfo["ID"],
area: ['700px', '600px'],
yes: function (index, layero) {
Station_Update_Forms.Submit(index, layero);
$('#Station').datagrid('reload');
},
});
}
}
};
//修改机构
var Station_Update_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Station_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#Station').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#update_station').form('validate');
if (r) {//post到后台
var url = '/ProManager/UpdateStation';
var param = ZLPMS.FormToObject('update_station');
var dealflow = $("#GZLMLID").combobox('getValue');
param.GZLMLID = dealflow;
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改成功");
} else if (data == -1) {
top.ZLPMS.Msg("机构名称已被使用请勿重新输入");
}
else {
ZLPMS.Msg("修改失败");
}
});
}
return null;
}
};
//删除机构提示窗体
function delete_station() {
var StationInfo = $('#Station').datagrid("getSelected");
if (StationInfo != null) {
//确认删除对话框
top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
//执行删除
Station_Delete_Forms.Del(StationInfo["ID"]);
$('#Station').datagrid('reload');
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//删除机构
var Station_Delete_Forms = {
//表单提交
Del: function (id) {
$.ajax({
url: '/ProManager/Del_Station/' + id,
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("删除成功");
$('#Station').datagrid('reload');
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
}
};
//将机构变成项目
function MigrationOrganization() {
var projectId = $('#project').datagrid("getSelected");
if (projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
var Station = $('#Station').datagrid("getSelected");
if (Station == null) {
top.ZLPMS.Msg("请选择一个机构")
}
$.ajax({
url: '/ProManager/MigrationOrganization?ProjectID=' + projectId["ID"] + "&SiteID=" + Station["ID"] ,
method: "post",
success: function (data) {
$("#Station").datagrid("reload");
if (data.code == 200) {
top.ZLPMS.Msg(data.msg);
}
else {
top.ZLPMS.Msg("迁移失败");
}
}
})
}
//添加服务器窗口
function add_Server() {
var project = $('#project').datagrid("getSelected");
if (project == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建服务器',
url: '/ProManager/ServerInfo/' + project["ID"],
area: ['670px', '490px'],
yes: function (index, layero) {
Server_Add_Forms.Submit(index, layero);
$('#Server').datagrid('reload');
},
});
}
};
//添加服务器数据库窗口
function add_Server_DataBase() {
var project = $('#Server').datagrid("getSelected");
if (project == null) {
top.ZLPMS.Msg("请选择一个服务器")
}
else {
top.ZLPMS.OpenWindowSuccess({
title: '新建数据库',
url: '/ProManager/ServerDataBaseInfo',
area: ['670px', '350px'],
success: function (layero) {
var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
iframeWindow.LoadPage();
},
yes: function (index, layero) {
Server_DataBase_Add_Forms.Submit(index, layero, project.ID);
$('#serverDataBaseInfo').datagrid('reload');
},
});
}
};
//添加服务器
var Server_Add_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Server_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#Server').datagrid('reload');
},
//读取数据
PostData: function (index) {
var XH = $("#XH").val();
//执行提交验证
var r = $('#insert_server')[0].reportValidity();
if (r) {//post到后台
var url = '/ProManager/Add_Server';
var param = ZLPMS.FormToObject('insert_server');
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加成功");
} else if (data = -1) {
ZLPMS.Msg("服务器型号已经被使用请重新输入");
}
});
}
return null;
}
};
//添加服务器数据库
var Server_DataBase_Add_Forms = {
//表单提交
Submit: function (index, layero,serverID) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Server_DataBase_Add_Forms.PostData(index, serverID);//调用子页面的方法,得到子页面返回的ids
},
//读取数据
PostData: function (index, serverID) {
var 名称 = $("#名称").val();
//执行提交验证
var r = $('#insert_server').form('validate');
if (名称 == null || 名称 == "") {
top.ZLPMS.Msg("数据库名称不能为空")
}
else {
if (r) {//post到后台
var url = '/CloudMonitor/InsertDbInfo';
var param = ZLPMS.FormToObject('insert_server');
param.服务器ID = serverID;
$.ajax({
url: url,
type: 'POST',
data: param,
async: false, // 设置为同步请求
success: function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加成功");
} else {
top.ZLPMS.Msg("添加失败");
}
},
error: function () {
top.ZLPMS.Msg("请求失败");
}
});
}
}
return null;
}
};
//服务器修改窗口
function update_server() {
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
$.ajax({
url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
method: 'POST'
})
var ServerInfo = $('#Server').datagrid("getSelected");
if (ServerInfo == null) {
top.ZLPMS.Msg("请选择一行数据")
}
else {
top.ZLPMS.OpenWindow({
title: '修改服务器',
url: '/ProManager/UpdateServerInfo/' + ServerInfo["ID"],
area: ['670px', '490px'],
yes: function (index, layero) {
Server_Update_Forms.Submit(index, layero);
$('#Server').datagrid('reload');
},
});
}
}
};
//服务器数据库修改窗口
function update_server_database() {
var ServerInfo = $('#Server').datagrid("getSelected");
if (ServerInfo == null) {
top.ZLPMS.Msg("请选择一个服务器")
}
else {
var DataBaseInfo = $('#serverDataBaseInfo').datagrid("getSelected");
if (DataBaseInfo == null) {
top.ZLPMS.Msg("请选择一行数据")
}
else {
top.ZLPMS.OpenWindowSuccess({
title: '修改数据库',
url: '/ProManager/ServerDataBaseInfo',
area: ['670px', '350px'],
success: function (layero) {
var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
iframeWindow.LoadPage(DataBaseInfo);
},
yes: function (index, layero) {
Server_DataBase_Update_Forms.Submit(index, layero, DataBaseInfo);
$('#serverDataBaseInfo').datagrid('reload');
},
});
}
}
};
//修改服务器
var Server_Update_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Server_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#Server').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#update_server')[0].reportValidity();
if (r) {//post到后台
var url = '/ProManager/UpdateServer';
var param = ZLPMS.FormToObject('update_server');
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改成功");
} else if (data == -1) {
top.ZLPMS.Msg("服务器型号已经被使用请重新输入");
}
else {
top.ZLPMS.Msg("添加失败");
}
});
}
return null;
}
};
//修改服务器数据库
var Server_DataBase_Update_Forms = {
//表单提交
Submit: function (index, layero,row) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Server_DataBase_Update_Forms.PostData(index,row);//调用子页面的方法,得到子页面返回的ids
},
//读取数据
PostData: function (index,row) {
var 名称 = $("#名称").val();
//执行提交验证
var r = $('#insert_server').form('validate');
if (名称 == null || 名称 == "") {
top.ZLPMS.Msg("数据库名称不能为空")
}
else {
if (r) {//post到后台
var url = '/CloudMonitor/UpdateDbInfo';
var param = ZLPMS.FormToObject('insert_server');
row.名称 = 名称;
row.数据库类型 = param.数据库类型;
row.数据库连接串 = param.数据库连接串;
$.ajax({
url: url,
type: 'POST',
data: row,
async: false, // 设置为同步请求
success: function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改成功");
} else {
top.ZLPMS.Msg("修改失败");
}
},
error: function () {
top.ZLPMS.Msg("请求失败");
}
});
//$.post(url, row, function (data) {
// if (data == 1) {
// top.ZLPMS.CloseWindow(index);
// top.ZLPMS.Msg("修改成功");
// } else {
// top.ZLPMS.Msg("修改失败");
// }
//});
}
}
return null;
}
};
//删除服务器提示窗体
function delete_server() {
var ServerInfo = $('#Server').datagrid("getSelected");
if (ServerInfo != null) {
//确认删除对话框
top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
//执行删除
Server_Delete_Forms.Del(ServerInfo["ID"]);
$('#Server').datagrid('reload');
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//删除服务器数据库提示窗体
function delete_server_DataBase() {
let table = $('#serverDataBaseInfo');
var ServerInfo = table.datagrid("getSelected");
if (ServerInfo != null) {
//确认删除对话框
top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
//执行删除
Server_DataBase_Delete_Forms.Del(ServerInfo["ID"]);
table.datagrid('reload');
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//删除服务器
var Server_Delete_Forms = {
//表单提交
Del: function (id) {
$.ajax({
url: '/ProManager/Del_Server/' + id,
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("删除成功");
$('#Server').datagrid('reload');
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
}
};
//删除服务器数据库
var Server_DataBase_Delete_Forms = {
//表单提交
Del: function (id) {
$.ajax({
url: '/CloudMonitor/DeleteDbInfoById/' + id,
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
}
};
//添加项目人员窗口
function add_Worker() {
projectObj.projectId = $('#project').datagrid("getSelected");
if (projectObj.projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建项目人员',
url: '/ProManager/WorkerInfo/' + projectObj.projectId["ID"],
area: ['670px', '420px'],
yes: function (index, layero) {
Worker_Add_Forms.Submit(index, layero);
$('#Worker').datagrid('reload');
},
});
}
}
//添加项目人员
var Worker_Add_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Worker_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#Worker').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#insert_worker').form('validate');
if (r) {//post到后台
var url = '/ProManager/Add_Worker';
var param = ZLPMS.FormToObject('insert_worker');
$.post(url, param, function (data) {
if (data != 0) {
top.ZLPMS.CloseWindow(index);
$('#product').datagrid('reload');
top.ZLPMS.Msg("成功添加" + data + "人到该项目中服务。", 1);
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加失败,请重新添加", 2);
}
});
}
return null;
}
};
//撤离项目人员窗口
function update_Worker() {
var WorkerInfo = $('#Worker').datagrid("getSelected");
if (WorkerInfo != null) {
//确认撤离对话框
top.ZLPMS.Confirm('您确定要从该项目中撤离该人员吗?', 3, function () {
//执行撤离
$.ajax({
url: '/ProManager/UpdateWorker/' + WorkerInfo["ID"],
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("撤离成功");
$('#Worker').datagrid('reload');
}
else {
top.ZLPMS.Msg("撤离失败");
}
}
})
$('#Worker').datagrid('reload');
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
}
//添加项目产品窗口
function add_Product() {
var project = $('#project').datagrid("getSelected");
if (project == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '添加项目产品',
url: '/ProManager/ProductInfo/' + project["ID"],
area: ['670px', '400px'],
yes: function (index, layero) {
Product_Add_Forms.Submit(index, layero);
$('#product').datagrid('reload');
},
});
}
}
//添加项目产品
var Product_Add_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Product_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#product').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#insert_product').form('validate');
if (r) {//post到后台
var url = '/ProManager/Add_Product';
var param = ZLPMS.FormToObject('insert_product');
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("添加成功");
} else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("该产品已试用于本产品,请勿重复添加!");
}
});
}
return null;
}
};
//修改项目产品窗口
function update_Product() {
var ProductInfo = $('#product').datagrid("getSelected");
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null) {
top.ZLPMS.Msg("请选择项目!");
}
if (ProductInfo != null) {
$.ajax({
url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
method: 'POST'
})
top.ZLPMS.OpenWindow({
title: '修改项目产品',
url: '/ProManager/UpdateProductInfo?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"],
area: ['670px', '400px'],
yes: function (index, layero) {
Product_Update_Forms.Submit(index, layero);
$('#product').datagrid('reload');
}
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//修改项目产品
var Product_Update_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Product_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#product').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#update_product').form('validate');
if (r) {//post到后台
var url = '/ProManager/UpdateProduct';
var param = ZLPMS.FormToObject('update_product');
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改成功");
} else if (data == 0) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("该产品已经在本项目中使用请勿重复添加");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("修改失败");
}
});
}
return null;
}
};
//产品服务合同时间维护1新增2修改
function StatusChange(type) {
var ProductInfo = $('#product').datagrid("getSelected");
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null) {
top.ZLPMS.Msg("请选择项目!");
}
if (ProductInfo != null) {
var title = "服务登记";
top.ZLPMS.OpenWindow({
title: title,
url: '/ProManager/UpdateProductStatusChange?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"] + '&qdid=' + projectObj.channelId + '&type=1',
area: ['670px', '500px'],
yes: function (index, layero) {
Product_StatusChange_Forms.Submit(index, layero);
}
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//修改产品服务合同记录2修改
function UpdateProductServiceRecords() {
var ServerInfo = $('#ProductServiceRecords').datagrid("getSelected");
if (ServerInfo == null) {
top.ZLPMS.Msg("请选择一条记录")
}
else {
top.ZLPMS.OpenWindowSuccess({
title: '修改服务登记',
url: '/ProManager/UpdateProductStatusChange?id=' + ServerInfo["ID"] + '&xmid=0&qdid=0&type=2',
area: ['670px', '500px'],
yes: function (index, layero) {
Product_StatusChange_Forms.UpdateSubmit(index, layero);
$('#product').datagrid('reload');
},
});
}
};
//产品服务合同时间维护
var Product_StatusChange_Forms = {
//表单提交
Submit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Product_StatusChange_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
$('#product').datagrid('reload');
},
//读取数据
PostData: function (index) {
//执行提交验证
var r = $('#productStatusChange').form('validate');
if (r) {//post到后台
var url = '/ProManager/AdjustServiceTime';
var param = ZLPMS.FormToObject('productStatusChange');
if ($('#ALL').is(":checked")) {
param.ALL = 1;
}
else {
param.ALL = 0;
}
var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
if (!state) {
return;
}
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("操作成功");
} else if (data == 0) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("系统异常");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("操作失败");
}
});
}
return null;
},
//产品合同签订记录, string XMID, string CPID
ProductServiceRecords: function() {
var ProductInfo = $('#product').datagrid("getSelected");
var ProjectlInfo = $('#project').datagrid("getSelected");
if (ProjectlInfo == null) {
$('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
return
}
if (ProductInfo == null) {
$('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
return
}
$('#ProductServiceRecords').datagrid({
url: '/ProManager/Get_ProductAdjustService?QDID=' + projectObj.channelId + '&XMID=' + ProjectlInfo["ID"] + '&CPID=' + ProductInfo["ID"],
method: 'GET',
/* toolbar: '#btn_Server_DataBaseInfo',*/
singleSelect: true,
collapsible: true,
rownumbers: true,
fit: true,
pagination: true
});
},
//删除产品服务合同记录
Del: function () {
var GetRow = $('#ProductServiceRecords').datagrid("getSelected");
if (GetRow == null) {
top.ZLPMS.Msg("请选择一行数据");
}
$.ajax({
url: '/ProManager/DeleteAdjustServiceTime/' + GetRow["ID"],
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("删除成功");
$('#product').datagrid('reload');
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
},
//刷新表格
refresh: function () {
$('#ProductServiceRecords').datagrid('reload');
},
//修改数据提交
UpdateSubmit: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Product_StatusChange_Forms.UpdatePostData(index);//调用子页面的方法,得到子页面返回的ids
$('#product').datagrid('reload');
},
//修改数据提交
UpdatePostData: function (index) {
//执行提交验证
var r = $('#productStatusChange').form('validate');
if (r) {//post到后台
var url = '/ProManager/UpdateAdjustServiceTime';
var param = ZLPMS.FormToObject('productStatusChange');
param.ALL = 0;
var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
if (!state) {
return;
}
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("操作成功");
} else if (data == 0) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("系统异常");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("操作失败");
}
});
}
return null;
},
};
//删除项目产品提示窗体
function delete_product() {
var ProductInfo = $('#product').datagrid("getSelected");
if (ProductInfo != null) {
//确认删除对话框
top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
//执行删除
Product_Delete_Forms.Del(ProductInfo["ID"]);
$('#product').datagrid('reload');
});
} else {
top.ZLPMS.Msg("请选择一行数据");
}
};
//删除项目产品
var Product_Delete_Forms = {
//表单提交
Del: function (id) {
$.ajax({
url: '/ProManager/Del_Product/' + id,
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("删除成功");
$('#product').datagrid('reload');
}
else {
top.ZLPMS.Msg("删除失败");
}
}
})
}
};
//个性化
function databindIdentify(id) {
if (id != null) {
$('#identify').datagrid({
url: '/ProManager/BingIdentify',
method: 'post',
singleSelect: true,
toolbar: '#btn_func6',
fit: true,
rownumbers: true,
queryParams: { id: id },
columns: [[
{ field: '名称', title: '标题', width: 250 },
{ field: '修改时间', title: '修改时间', width: 100, align: 'center' },
{ field: '修改人', title: '修改人', width: 100, align: 'center' },
{
field: '状态', title: '状态', width: 100, align: 'center', styler: function (value, row, index) {
if (value == '0') {
value = "放弃";
return 'color:#EEA2AD;font-weight:bold';
}
if (value == '1') {
value = "确认";
return 'color:green;font-weight:bold;';
}
if (value == '2') {
value = "删除";
return 'color:#FF4500;font-weight:bold;';
}
},
formatter: function (row) {
if (row == '0') {
return row = "放弃";
}
if (row == '1') {
return row = "确认";
}
if (row == '2') {
return row = "删除";
}
}
},
{ field: '产品名称', title: '产品', width: 120, align: 'center' },
{ field: '版本号', title: '版本', width: 150, align: 'center' },
]],
onSelect: function (rowIndex, rowData) {
projectObj.identify = rowData
var detail = rowData.修改说明 == null ? "暂无" : rowData.修改说明
$("#detail").html("" + detail + "
")
}
})
}
}
//新增个性化
function add_identify() {
var identify = $('#project').datagrid("getSelected");
if (identify == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建项目个性化',
url: '/ProManager/Identify_Window?id=' + identify["ID"] + "&type=1",
area: ['900px', '900px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.identify_PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
$('#identify').datagrid('reload');
}
});
}
};
//修改个性化
function edit_identify() {
var identify = $('#identify').datagrid("getSelected");
if (identify == null) {
top.ZLPMS.Msg("请选择一条记录")
}
else {
top.ZLPMS.OpenWindow({
title: '编辑项目个性化',
url: '/ProManager/Identify_Window?id=' + identify["ID"] + '&type=2',
area: ['900px', '900px'],
yes: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.identify_PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
$('#identify').datagrid('reload');
}
});
}
};
//删除个性化
function del_identify() {
var identify = projectObj.identify
top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
//执行删除
$.post('/ProManager/Del_Identify?id=' + identify.ID + "&type=1", function (data) {
if (data) {
$('#identify').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
})
});
}
//放弃个性化
function giveup_identify() {
var identify = projectObj.identify
if (identify == null) {
top.ZLPMS.Msg("请选择一条记录")
}
else {
top.ZLPMS.Confirm('您确定要修改选中的记录状态吗?', 3, function () {
//执行
$.ajax({
url: '/ProManager/Del_Identify?id=' + identify.ID + "&type=2",
method: "post",
success: function (data) {
if (data != 0) {
top.ZLPMS.Msg("该记录已经成功放弃使用");
$('#identify').datagrid('reload');
}
else {
top.ZLPMS.Msg("状态修改失败");
}
}
})
$('#product').datagrid('reload');
});
}
}
//远程方式
function databindRemote(id) {
if (id != null) {
$('#remote').datagrid({
url: '/ProManager/BingRemote',
method: 'post',
singleSelect: true,
toolbar: '#btn_func2',
fit: true,
rownumbers: true,
queryParams: { id: id },
columns: [[
{ field: '名称', title: '名称', width: 180, align: 'center' },
{ field: '联系人', title: '联系人', width: 100, align: 'center' },
{ field: '联系人电话', title: '联系电话', width: 120, align: 'center' },
{ field: '账号', title: '账号', width: 120, align: 'center' },
{ field: '密码', title: '密码', width: 120, align: 'center' },
{ field: '备注', title: '备注', width: 120, align: 'center' },
]],
onSelect: function (rowIndex, rowData) {
projectObj.remote = rowData
}
})
}
}
// 删除远程
function del_remote() {
var id = projectObj.remote.ID
top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
//执行删除
$.post("/ProManager/Del_Remote?id=" + id, function (data) {
if (data) {
$('#remote').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
})
});
}
//新增远程
function add_remote() {
var projectId = $('#project').datagrid("getSelected");
if (projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建远程方式',
url: '/ProManager/Remote_Window?id=' + projectId["ID"] + "&type=1",
area: ['700px', '420px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Remote_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
$('#remote').datagrid('reload');
}
});
}
};
//修改远程
function edit_remote() {
var remote = escape(JSON.stringify(projectObj.remote))
if (remote == null) {
top.ZLPMS.Msg("请选择一条记录")
}
else {
top.ZLPMS.OpenWindow({
title: '编辑远程方式',
url: '/ProManager/Remote_Window?id=' + remote + '&type=2',
area: ['700px', '420px'],
yes: function (index, layero) {
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Remote_Forms.PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
$('#remote').datagrid('reload');
}
});
}
};
//远程方式请求
var Remote_Forms = {
//读取数据
PostData: function (index, type) {
var url = '/ProManager/Edit_Remote';
if (type == 1) {
url = '/ProManager/Add_Remote';
}
//执行提交验证
var r = $('#insert_remote').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_remote");//取页面填写的值
$.post(url, param, function (data) {
if (data == 1) {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存成功");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存失败");
}
});
}
}
};
//验收仪器
function databindInstrument(id) {
if (id != null) {
$('#instrument').datagrid({
url: '/ProManager/Binginstrument',
method: 'post',
singleSelect: true,
toolbar: '#btn_func3',
fit: true,
rownumbers: true,
queryParams: { id: id },
columns: [[
{ field: '仪器名称', title: '仪器名称', width: 180, align: 'center' },
{ field: '仪器型号', title: '仪器型号', width: 100, align: 'center' },
{ field: '科室负责人', title: '科室负责人', width: 120, align: 'center' },
{ field: '科室联系电话', title: '科室联系电话', width: 120, align: 'center' },
{ field: '厂家负责人', title: '厂家负责人', width: 120, align: 'center' },
{ field: '厂家联系电话', title: '厂家联系电话', width: 120, align: 'center' },
{ field: '仪器类型', title: '仪器类型', width: 120, align: 'center' },
{ field: '仪器厂家', title: '仪器厂家', width: 120, align: 'center' },
{ field: '通讯类型', title: '通讯类型', width: 120, align: 'center' },
{ field: '通讯参数', title: '通讯参数', width: 120, align: 'center' },
{ field: '接口DLL名称', title: '接口DLL名称', width: 120, align: 'center' },
{ field: '实施人员', title: '实施人员', width: 120, align: 'center' },
{
field: '启用时间', title: '启用时间', width: 120, align: 'center', formatter: function (row) {
/*return row.substr(0, 10)*/
}
},
{
field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
/* return row.substr(0, 10)*/
}
},
{ field: '备注', title: '备注', width: 120, align: 'center' },
]],
})
}
}
// 删除验收仪器
function del_instrument() {
var id = $("#instrument").datagrid("getSelected")["ID"];
top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
//执行删除
$.post("/ProManager/Del_instrument?id=" + id, function (data) {
if (data) {
$('#instrument').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
})
});
}
//新增验收仪器
function add_instrument() {
var projectId = $('#project').datagrid("getSelected");
if (projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建验收仪器',
url: '/ProManager/Instrument_Window?id=' + projectId["ID"],
area: ['650px', '520px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Instrument_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
$('#instrument').datagrid('reload');
}
});
}
};
//验收仪器请求
var Instrument_Forms = {
//读取数据
PostData: function (index, type) {
var url = '/ProManager/Add_Instrument';
//执行提交验证
var r = $('#insert_instrument').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_instrument");//取页面填写的值
$.post(url, param, function (data) {
if (data == 1) {
$('#instrument').datagrid('reload');
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存成功");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存失败");
}
});
}
}
};
//验收模块
function databindModual(id) {
if (id != null) {
$('#modual').datagrid({
url: '/ProManager/Bingmodual',
method: 'post',
singleSelect: true,
toolbar: '#btn_func4',
fit: true,
rownumbers: true,
queryParams: { id: id },
columns: [[
{ field: '模块名称', title: '模块名称', width: 180, align: 'center' },
{ field: '验收人', title: '验收人', width: 100, align: 'center' },
{
field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
return row.substr(0, 10)
}
},
]],
})
}
}
// 删除验收模块
function del_modual() {
var id = $("#modual").datagrid("getSelected")["ID"];
top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
//执行删除
$.post("/ProManager/Del_modual?id=" + id, function (data) {
if (data) {
$('#modual').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
})
});
}
//新增验收模块
function add_modual() {
var projectId = $('#project').datagrid("getSelected");
if (projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建验收模块',
url: '/ProManager/Modual_Window?id=' + projectId["ID"],
area: ['650px', '260px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Modula_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
$('#modual').datagrid('reload');
}
});
}
};
//验收模块请求
var Modula_Forms = {
//读取数据
PostData: function (index, type) {
var url = '/ProManager/Add_modual';
//执行提交验证
var r = $('#insert_modual').form('validate');
if (r) {//post到后台
var param = ZLPMS.FormToObject("insert_modual");//取页面填写的值
$.post(url, param, function (data) {
if (data == 1) {
$('#modual').datagrid('reload');
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存成功");
}
else {
top.ZLPMS.CloseWindow(index);
top.ZLPMS.Msg("保存失败");
}
});
}
}
};
//接口信息
function databindInter(id) {
if (id != null) {
$('#interface').datagrid({
url: '/ProManager/BingInterface',
method: 'post',
singleSelect: true,
toolbar: '#btn_func5',
fit: true,
rownumbers: true,
fitColumns: true,
queryParams: {
xmid: id
},
columns: [[
{ field: '名称', title: '接口名称', align: 'left' },
{
field: '类型', title: '类型', align: 'center', formatter: function (row) {
switch (row) {
case 1: return "医保接口"; break;
case 2: return "农合接口"; break;
case 3: return "LIS接口"; break;
case 4: return "三方接口"; break;
default: return "其它接口"; break;
}
}
},
{ field: '项目名称', title: '项目名称' },
{
field: '状态', title: '状态', align: 'center', formatter: function (row) {
switch (row) {
case 1: return "未编写"; break;
case 2: return "编写中"; break;
case 3: return "已完成"; break;
case 4: return "测试完成"; break;
case 5: return "已验收"; break;
case 6: return "终止"; break;
}
}
},
{
field: '申请时间', title: '申请时间', align: 'center'
},
{ field: '完成时间', title: '完成时间', align: 'center' },
{ field: '验收时间', title: '验收时间', align: 'center' },
{ field: '创建人', title: '创建人', align: 'center' },
{ field: '责任人', title: '维护人', align: 'center' },
{ field: '接口对方名称', title: '项目对接人', align: 'center' },
]],
onSelect: function (index, row) {
$.post("/ProManager/GetInteProcess", { id: row.ID }, function (data) {
var html = ""
for (var i = 0; i < data.length; i++) {
html += " " + data[i].操作人 + " " + data[i].状态 + " " + data[i].操作时间 + " " + data[i].备注 + "
"
}
$("#timeline").html(html)
})
id = row.ID
},
onLoadSuccess: function (dd) {
$("#timeline").html("")
if (dd.rows.length > 0) {
$.post("/ProManager/GetInteProcess", { id: dd.rows[0].ID }, function (data) {
var html = ""
for (var i = 0; i < data.length; i++) {
html += " " + data[i].操作人 + " " + data[i].状态 + " " + data[i].操作时间 + " " + data[i].备注 + "
"
}
$("#timeline").html(html)
})
}
}
})
}
}
// 删除接口信息
function del_interface() {
var id = $("#interface").datagrid("getSelected")["ID"];
top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
//执行删除
$.post("/ProManager/Del_Interface?id=" + id, function (data) {
if (data) {
$('#interface').datagrid('reload');
top.ZLPMS.Msg("删除成功");
}
else {
top.ZLPMS.Msg("删除失败");
}
})
});
}
//新增接口信息
function add_interface() {
var projectId = $('#project').datagrid("getSelected");
if (projectId == null) {
top.ZLPMS.Msg("请选择一个项目")
}
else {
top.ZLPMS.OpenWindow({
title: '新建接口信息',
url: '/ProManager/Interface_Window?id=' + projectId["ID"] + '&type=1' + '&state=' + projectId.STATE,
area: ['750px', '700px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.Interface_PostData(index, 1, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
$('#interface').datagrid('reload');
}
});
}
};
//编辑接口信息
function edit_interface() {
var obj = $('#interface').datagrid("getSelected");
if (obj == null) {
top.ZLPMS.Msg("请选择一条记录")
}
else {
top.ZLPMS.OpenWindow({
title: '编辑接口信息',
url: '/ProManager/Interface_Window?id=' + obj["ID"] + '&type=2',
area: ['750px', '700px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.Interface_PostData(index, 2, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
$('#interface').datagrid('reload');
}
});
}
};
//变更接口
function deal_interface() {
var obj = $("#interface").datagrid("getSelected");
if (obj == null) {
top.ZLPMS.Msg("请选择一条记录");
return
}
top.ZLPMS.OpenWindow({
title: '变更状态',
url: '/ProManager/DealWindow?&id=' + obj["ID"],
area: ['800px', '600px'],
yes: function (index, layero) {
//表单提交
var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.Forms.DealInte_PostData(index, $("#interface"));//调用子页面的方法,得到子页面返回的ids
}
});
}
//刷新
function refresh() {
$("#Station").datagrid("reload");
$("#Server").datagrid("reload");
$("#Worker").datagrid("reload");
$("#product").datagrid("reload");
$("#serverDataBaseInfo").datagrid("reload");
}
//简码
function changename() {
var val = $("#name").val();
if (val) {//获取简码
var code = makePy(val);
$("#simple").val(code);
}
var val = $("#MC").val();
if (val) {//获取简码
var code = makePy(val);
$("#JM").val(code);
}
}
//批量导入窗口
function openItemupload() {
projectObj.projectId = $('#project').datagrid("getSelected");
if (!projectObj.projectId) {
layer.msg('请先选择需要导入数据的项目!', {
time: 1000
});
return false;
}
top.ZLPMS.OpenWindow({
url: "/ProManager/Itemupload?ItemInfoId=" + projectObj.projectId["ID"],
area: ['670px', '430px'],
title: "人员信息批量录入",
yes: false,
});
}
//导入操作
layui.use(['form', 'upload'], function () {
var form = layui.form,
$ = layui.jquery,
upload = layui.upload; //只有执行了这一步,部分表单元素才会自动修饰成功
var demoListView = $('#demoList'),
uploadListIns = upload.render({
elem: '#Xmlfiles' //允许上传的文件后缀
, url: '/ProManager/ItemSiteBatch'
, method: "post"
, accept: 'file' //普通文件
, exts: 'xml' //只允许上传压缩文件
, multiple: false
, number: '1'
, auto: false
, bindAction: '#confirm'
, choose: function (obj) {
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件
obj.preview(function (index, file, result) {
var tr = $([''
, '' + file.name + ' '
, '' + (file.size / 1014).toFixed(1) + 'kb '
, '等待导入 '
, ''
, '重传 '
, '删除 '
, ' '
, ' '].join(''));
//单个重传
tr.find('.demo-reload').on('click', function () {
obj.upload(index, file);
});
//删除
tr.find('.demo-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
demoListView.append(tr);
});
}
, done: function (res, index, upload) {
if (res.code == 1) { //上传成功
var text = "共导入" + res.sum + "条记录,添加成功" + res.addsuccess + "条,修改" + res.updatesuccess_In + "条";
top.ZLPMS.Msg(text, 1, 6000);
var tr = demoListView.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(2).html('导入成功 ');
tds.eq(3).find('.demo-reload').addClass('layui-hide'); //显示重传
//tds.eq(3).html(''); //清空操作
return delete this.files[index]; //删除文件队列已经上传成功的文件
}
else {
this.error(index, upload);
}
}
, error: function (index, upload) {
var tr = demoListView.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(2).html('导入失败 ');
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}
});
});
function Close() {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
//人员导入导出工具下载
function DowdTool() {
window.open('/Problem/ViewProblemImage?id=4197');
}
//工具上传
function toolupload() {
top.ZLPMS.OpenWindow({
url: "/ProManager/toolupload",
area: ['670px', '430px'],
title: "工具上传",
yes: false,
});
}
//附件上传
layui.use('upload', function () {
var upload = layui.upload;
var demoListView = $('#demoList');
var uploadInst = upload.render({
elem: '#ChooseFile' //文件选择按钮
, url: '/ProManager/FileUpload'
, method: "post"
, accept: 'file' //普通文件(文件类型)
, multiple: true //多文件上传
, auto: false //自动上传
, size: 10000
, bindAction: "#btn_upload"
, number: 3//最大允许上传文件数量
, choose: function (obj) {
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件
obj.preview(function (index, file, result) {
var display = "none";
if (file.type == "image/jpeg" || file.type == "image/png") {
display = "";
}
var tr = $([''
, '' + file.name + ' '
, '' + (file.size / 1014).toFixed(1) + 'kb '
, '等待上传 '
, ''
, '删除 '
, ' '
, ' '
, ' '].join(''));
//单个重传
tr.find('.demo-reload').on('click', function () {
obj.upload(index, file);
});
//删除
tr.find('.demo-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
uploadInst.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
demoListView.append(tr);
});
}
, allDone: function (obj) {
top.ZLPMS.Msg("总共上传" + obj.total + ",成功" + obj.successful + "个,失败" + obj.aborted + "个")
if ($('#Constantly').prop("checked")) {
ZLPMS.UnLoading(projectObj.index)
top.ZLPMS.UnLoading(projectObj.index2);
//根据Type选择不同的登记弹窗
ProjectProblem_Window();//项目问题
ZLPMS.CloseTopWindow(true);
return;
}
ZLPMS.UnLoading(projectObj.index)
top.ZLPMS.UnLoading(projectObj.index2);
ZLPMS.CloseTopWindow(true);
}
});
});
//下载附件文件
function downloadfile(id) {
window.open('/Problem/ViewProblemImage?id=' + id);
}
//图片放大查看
function Zoom(event) {
var img = " "
layer.open({
type: 1,//Page层类型
area: ['500px', '300px'],
title: '附件查看',
shade: 0.6,//遮罩透明度
maxmin: true,//允许全屏最小化
anim: 1,//0-6的动画形式,-1不开启
content: img
});
}
//删除附件
function Delete_img(data) {
top.ZLPMS.Confirm('删除后无法恢复,您确定要删除该附件吗?', 3, function (idx) {
$.post("/ProManager/Delete_Attachment", { id: data }, function (d) {
if (d == 1) {
top.ZLPMS.Msg("删除成功", 1);
var classname = "#Attachment" + data;
var icon = "#icon" + data;
$(classname).attr("style", "display:none;")
$(icon).attr("style", "display:none;")
}
else {
top.ZLPMS.Msg("删除失败", 2)
}
})
});
}
//预览
function View() {
if (projectObj.xmid == null) {
top.ZLPMS.Msg("请先选择项目");
return false;
}
top.ZLPMS.OpenWindow({
title: '预览',
url: "/WebForms/WebReportView.aspx?reportName=1&xmid=" + projectObj.xmid,
area: ['1000px', '800px'],
});
}
//智能表单表格
function databindSmart(id) {
var Params = {
FLID: 0,
BDXXID: "",
QDID: "",
XMID: id,
BDJLID: "",
BZ: "0,1,2",//用于传状态
};
$('#Smart').datagrid({
url: '/SmartForm/SelectRecordListAll',
method: 'post',
toolbar: '#btn_Smart',
queryParams: Params,
singleSelect: true,
collapsible: true,
rownumbers: true,
fit: true,
pagination: true,
columns: [[
{ field: 'ID', title: 'ID', width: 20, align: 'center', fixed: true, hidden: true },
{ field: 'FLID', title: '分类id', width: 20, align: 'center', fixed: true, hidden: true },
{
field: 'BDM', title: '填写表单', align: 'left', fixed: true, width: 200,
},
{
field: 'TBR', title: '填报人', align: 'left', fixed: true, width: 80,
},
{
field: 'TBSJ', title: '填报时间', width: 140, align: 'center', fixed: true,
},
{
field: 'TBZT', title: '状态', align: 'left', fixed: true, width: 80,
formatter: function (value, rowData, index) {
if (rowData.TBZT == 0) {
return "填报";
}
else if (rowData.TBZT == 1) {
return "通过";
}
else {
return "退回";
}
}, styler: function (value, rowData, index) {
if (rowData.TBZT == 0) {
return "color:#007aff";
}
else if (rowData.TBZT == 1) {
return "color:#4cd964";
}
else {
return "color: red";
}
},
},
{
field: 'SHR', title: '审核人', align: 'left', fixed: true, width: 80,
},
{
field: 'SHSJ', title: '审核时间', width: 140, align: 'center', fixed: true,
},
]],
});
$("#BD").combobox({
url: '/SmartForm/BdxxSelectList',
queryParams: {
FLID: 0
},
valueField: 'ID',
textField: 'BT'
});
}
//表单预览
function smartView() {
var row = $('#Smart').datagrid('getSelected');
if (!row) {
top.ZLPMS.Msg("请选择列");
return;
}
//if (projectObj.xmid == null) {
// top.ZLPMS.Msg("请先选择项目");
// return false;
//}
top.ZLPMS.OpenWindow({
title: row.BDM,
btn: [],
url: "/SmartForm/SmarView?ID=" + row.ID,
area: ['1000px', '800px'],
});
}
//表单新增
function smartAdd() {
var row = $('#project').datagrid('getSelected');
if (!row) {
top.ZLPMS.Msg("请选项目");
return;
}
var combox = $('#BD').combobox('getValue');
if (!combox) {
top.ZLPMS.Msg("请选表单");
return;
}
top.ZLPMS.OpenWindow({
title: row.名称 + "【" + $('#BD').combobox('getText') + "】(新增)",
btn: [],
/*url: '/SmartForm/MobileSmartDetail/' + combox,*/
url: "/SmartForm/PcSmartFormList?ID=" + combox + "&XMID=" + row.ID + "&XMMC=" + row.名称,
area: ['90%', '90%'],
yes: function (index, layero) {
//表单提交
$('#Smart').datagrid('reload');
}
});
}
//表单修改
function smartEdit() {
var rowPro = $('#project').datagrid('getSelected');
if (!rowPro) {
top.ZLPMS.Msg("请选项目");
return;
}
var row = $("#Smart").datagrid('getSelected');
if (!row) {
top.ZLPMS.Msg("请选择列");
return;
}
top.ZLPMS.OpenWindow({
title: rowPro.名称 + "【" + row.BDM + "】(修改)",
btn: [],
url: "/SmartForm/EditPcSmartFormList?ID=" + row.ID,
area: ['90%', '90%'],
yes: function (index, layero) {
//表单提交
$('#Smart').datagrid('reload');
}
});
}
//表单刷新
function smartRefresh() {
$("#Smart").datagrid("reload");
}
//删除表单
function smartDel() {
var row = $("#Smart").datagrid('getSelected');
if (!row) {
top.ZLPMS.Msg("请选择列");
return;
}
if (row.TBZT == 1) {
top.ZLPMS.Msg("当前记录不能被删除!");
return;
}
top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
var param = {
ID: row.ID,
BZ: 4
};
$.post("/SmartForm/UpdateRecord", param, function (data) {
if (data.code == 200) {
$("#Smart").datagrid("reload");
top.ZLPMS.Msg(data.msg);
} else {
top.ZLPMS.Msg(data.msg);
}
})
});
}