Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/bot/botEdit.jsp
2026-01-16 14:13:44 +08:00

427 lines
16 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<script type="text/javascript">
/*** 上半部分 */
var showCompany4SelectFun = function () {
$.post(ext.contextPath + '/user/showCompany4Select.do', { formId: "botForm", hiddenId: "pid", textId: "_pname" }, function (data) {
$("#company4SelectDiv").html(data);
openModal("company4SelectModal");
});
};
function doSaveBot() {
$.post(ext.contextPath + "/bot/bot/updateBot.do", $("#botForm").serialize(), function (data) {
if (data.res == "1") {
initTreeView();
} else {
showAlert('d', '保存失败');
}
}, 'json');
}
function delCompany() {
swal({
text: "您确定要删除此记录?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
classname: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
classname: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(willDelete => {
if (willDelete) {
$.post(ext.contextPath + '/user/deleteCompany.do', $("#botForm").serialize(), function (data) {
if (data > 0) {
initTreeView();
} else {
showAlert('d', '删除失败');
}
}, 'json');
s
}
});
}
//文件上传
var fileinput = function() {
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
var masterId=$('#id').val();
var tbName='tb_bot_file'; //数据表
var nameSpace='botFile';//保存文件夹
var previews = new Array();
var previewConfigs = new Array();
/* var student = {
"caption":"lilei",
}
previewConfigs[0]=student; */
//初始化fileinput控件第一次初始化
function showFileInput(ctrlName) {
var control = $('#' + ctrlName);
control.fileinput('destroy');
control.fileinput({
language: 'zh', //设置语言
showUpload: false, //是否显示上传按钮
showDownload:true,
showRemove:false,
showCaption: true,//是否显示标题
showBrowse:false,//选择按钮
showClose:false,//右上角关闭按钮
dropZoneEnabled: false,//是否显示拖拽区域
allowedFileExtensions : ['*'],//接收的文件后缀
previewFileType:['image'],
fileActionSettings:{
showDrag:false
},
otherActionButtons:'<a type="button" onclick="downloadfile(this)" class="kv-file-down btn btn-sm btn-default" {dataKey} title="下载图片"><i class="fa fa-cloud-download"></i></a>',
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 1, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount:true,
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
initialPreviewAsData: true,
initialPreview: previews,
initialPreviewConfig:previewConfigs,
layoutTemplates:{
actionUpload:'',
actionDownload:''
},
preferIconicPreview: true,//是否强制相关文件展示icon
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a "></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12 "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 "></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
deleteExtraData:function () { //传参
var data = {
"tbName": tbName
};
return data;
}
});
//异步上传返回结果处理
control.on('fileerror', function(event, data, msg) {
console.log(data.id);
console.log(data.index);
console.log(data.file);
console.log(data.reader);
console.log(data.files);
// get message
alert(msg);
});
//异步上传返回结果处理
control.on("fileuploaded", function (event, data, previewId, index) {
console.log(data.id);
console.log(data.index);
console.log(data.file);
console.log(data.reader);
console.log(data.files);
var obj = data.response;
alert(JSON.stringify(data.success));
});
//同步上传错误处理
control.on('filebatchuploaderror', function(event, data, msg) {
console.log(data.id);
console.log(data.index);
console.log(data.file);
console.log(data.reader);
console.log(data.files);
// get message
alert(msg);
});
//同步上传返回结果处理
control.on("filebatchuploadsuccess", function (event, data, previewId, index) {
console.log(data.id);
console.log(data.index);
console.log(data.file);
console.log(data.reader);
console.log(data.files);
var obj = data.response;
alert(JSON.stringify(data.success));
});
$('#kvFileinputModal').on("hidden.bs.modal", function() {
$(this).removeData("bs.modal");
//modal重复打开会导致前面的滚动条失去作用
$('.modal').css("overflow","auto");
});
}
function downloadfile(obj){
var key = $(obj).data('key');
window.open(ext.contextPath + '/base/downloadFile.do?key='+key+'&tbName='+tbName);
}
//名称定义不可修改
var getFileList = function() {
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
//console.info(data)
if(data.length>0){
previews=new Array();
$('#typefile').show();
for(var i=0;i<data.length;i++){
var previewConfig = new Object();
var path = data[i].abspath;
path=path.substring(path.indexOf('webapps')+7,path.length);
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
previews.push(path);
previewConfig['width']= '50px';
previewConfig['caption']= data[i].filename;
previewConfig['key']= data[i].id;
previewConfigs.push(previewConfig);
}
showFileInput("typefile");
}else{
$('#typefile').hide();
}
},'json');
};
getFileList();
/*** 下半部分 */
var addUserFun = function () {
$.post(ext.contextPath + '/user/addUser.do', {}, function (data) {
$("#userDiv").html(data + "<div id='unit4SelectDiv'></div> ");
openModal('subModal');
});
};
var delUserFun = function () {
var checkedItems = $("#table").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems, function (index, item) {
datas += item.id + ",";
});
if (datas == "") {
showAlert('d', '请先选择记录', 'mainAlertdiv');
} else {
swal({
text: "您确定要禁用这些用户吗?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
classname: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
classname: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(willDelete => {
if (willDelete) {
$.post(ext.contextPath + '/user/deleteUsers.do', { ids: datas }, function (data) {
if (data > 0) {
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '禁用失败', 'mainAlertdiv');
}
});
}
});
}
};
var editUserFun = function (id) {
$.post(ext.contextPath + '/user/editUser.do', { id: id }, function (data) {
$("#userDiv").html(data);
openModal('subModal');
});
};
//重置密码
var pwdFun = function (id) {
swal({
text: "您确定要重置密码吗?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
classname: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
classname: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(willDelete => {
if (willDelete) {
$.post(ext.contextPath + '/user/resetPassword.do', { id: id }, function (data) {
if (data == 1) {
showAlert('s', '重置成功', 'mainAlertdiv');
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '重置失败', 'mainAlertdiv');
}
});
}
});
};
$(function () {
});
</script>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="doSaveBot()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="botForm">
<input id="id" name="id" type="hidden" value="${bot.id}" />
<input id="bizid" name="bizid" type="hidden" value="${bot.bizid}" />
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="company4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">设计规模</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="designScale" name="designScale" placeholder="设计规模"
value="${bot.designScale }">
</div>
<label class="col-sm-2 control-label">排放标准</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="emission" name="emission" placeholder="排放标准"
value="${bot.emission }">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">进水指标</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="influentIndex" name="influentIndex" placeholder="进水指标"
value="${bot.influentIndex}">
</div>
<!-- <div id="biz_id" style="display:none;">
<label class="col-sm-2 control-label">水厂编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="id" name ="id" placeholder="编号" value="" />
</div>
</div> -->
</div>
<div class="form-group">
<label class="col-sm-2 control-label">出水指标</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="effluentIndex" name="effluentIndex" placeholder="出水指标"
value="${bot.effluentIndex}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">处理工艺</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="process" name="process" placeholder="处理工艺"
value="${bot.process}">
</div>
<label class="col-sm-2 control-label">初始污水处理费</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="price" name="price" placeholder="初始污水处理服务费单价"
value="${bot.price}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">污水处理费核算方式</label>
<div class="col-sm-10">
<textarea class="form-control" rows="2" id ="calculation" name ="calculation" placeholder="请输入" autocomplete="off" >${bot.calculation}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">协议签订日期</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="signdate" name="signdate" placeholder="协议签订日期"
value="${bot.signdate}">
</div>
<label class="col-sm-2 control-label">特许经营期</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="franchisePeriod" name="franchisePeriod" placeholder="特许经营期"
value="${bot.franchisePeriod}">
</div>
</div>
<div class="form-group">
<div class="col-sm-2 col-md-2"></div>
<div class="col-sm-4 col-md-4">
<!-- <input id="f_upload" type="file" class="file" /> -->
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>文件上传</button>
</div>
</div>
<div class="form-group" style="margin:8px;">
<div class="col-sm-2 col-md-2"></div>
<div class="col-sm-10 col-md-10">
<input type="file" name="typefile" id="typefile" multiple class="file-loading" />
</div>
</div>
</div>
</form>
</div>
</div>