Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/sparepart/supplier_copyEdit.jsp

415 lines
18 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var editFun1 = function(id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/sparepart/supplierQualification_copy/edit.do', {id:id} , function(data) {
$("#qualificationedit").html(data);
openModal('subModal1');
});
};
var deleteFun1 = function(id) {
stopBubbleDefaultEvent();
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 + '/sparepart/supplierQualification_copy/delete.do', {id : id}, function(data) {
if(data==1){
$("#table1").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
});
}
});
};
function doTelephone() { document.getElementById('userTelephoneid').style.display = ""; }
var initTable = function(id) {
$("#table1").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/sparepart/supplierQualification_copy/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20,50], // 设置页面可以显示的数据条数
pageSize: 50, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
search_name: $('#search_name').val(),
modelid:id
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
onClickRow: function (row) {//单击行事件,执行查看功能
viewFun(row.id);
},
columns: [
{
checkbox: true, // 显示一个勾选框
},
{
field: 'name', // 返回json数据中的name
title: '资质名字', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter:function(value,row,index){
return value;
}
},{
field: 'qualificationTypeName', // 返回json数据中的name
title: '资质类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter:function(value,row,index){
return value;
}
},{
field: 'qualificationValidityTime', // 返回json数据中的name
title: '有效时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter:function(value,row,index){
return value;
}
},{
field: 'qualificationState', // 返回json数据中的name
title: '状态', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter:function(value,row,index){
return value;
}
},{
title: "操作",
field: 'resourceId',
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts= '';
buts+= '<security:authorize buttonUrl="sparepart/supplierQualification_copy/edit.do">';
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun1(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts+= '</security:authorize>';
buts+= '<security:authorize buttonUrl="sparepart/supplierQualification_copy/delete.do">';
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun1(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
buts+= '</security:authorize>';
buts='<div class="btn-group" >'+buts+'</div>';
return buts;
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
}
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table1");
$("#table1").bootstrapTable("hideRow",1)
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
};
var modelid = $("#id").val();
$(function() {
initTable(modelid);
var objArr = [
{"id":"启用","text":"启用"},
{"id":"禁用","text":"禁用"},
];
var selelct =$("#type").select2({
data: objArr,
placeholder:'请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${supplier.type}').trigger("change");
});
var addSubscribeDetailFun = function() {
var usid1 = $("#id").val();
console.info(usid1);
$.post(ext.contextPath + '/sparepart/supplierQualification_copy/add.do', {usid1:usid1},
function(data) {
$("#qualificationadd").html(data);
openModal('subModal3');
});
}
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/sparepart/supplier_copy/update.do", $("#subForm").serialize(), function(data) {
if (data.res == 1){
closeModal('subModal');
$("#table").bootstrapTable('refresh');
}else if(data.res == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '外包单位名称不能为空'
}
}
},
classId: {
validators: {
notEmpty: {
message: '外包单位类型不能为空'
}
}
},
/* address: {
validators: {
notEmpty: {
message: '地址不能为空'
}
}
},
linkMan: {
validators: {
notEmpty: {
message: '联系人不能为空'
}
}
},
mobile: {
validators: {
notEmpty: {
message: '手机号不能为空'
}
},
stringLength: {
min: 11,
max: 11,
message: '请输入11位手机号码'
},
}, */
}
});
$(function(){
//console.log("hehe.." + $("#userTelephone").val());
var userTelephone=$("#userTelephone").val();
if(userTelephone){ document.getElementById('userTelephoneid').style.display = ""; }
//选择外包单位类型
$.post(ext.contextPath + "/sparepart/supplierClass_copy/getSupplierClass4Select.do", {}, function(data) {
var selelct =$("#classId").select2({
data: data,
placeholder:'请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${supplier.classId}').trigger("change");
},'json');
})
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog ">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑外包单位</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" id="id" name ="id" value="${supplier.id}">
<div class="form-group">
<label class="col-sm-2 control-label">*外包单位名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${supplier.name}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*外包单位类型</label>
<div class="col-sm-6">
<select class="form-control select2" id="classId" name ="classId" style="width: 270px;"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">地址</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="address" name ="address" placeholder="地址" value="${supplier.address}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">联系人</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="linkMan" name ="linkMan" placeholder="联系人" value="${supplier.linkMan}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">手机号</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="mobile" name ="mobile" placeholder="手机号" value="${supplier.mobile}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">传真</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="fax" name ="fax" placeholder="传真" value="${supplier.fax}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">存续状态</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="existStatus" name ="existStatus" placeholder="存续状态" value="${supplier.existStatus}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公司简称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="abbreviation" name ="abbreviation" placeholder="公司简称" value="${supplier.abbreviation}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">法人</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="legalPerson" name ="legalPerson" placeholder="法人" value="${supplier.legalPerson}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">银行信息</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="bankInformation" name ="bankInformation" placeholder="银行信息" value="${supplier.bankInformation}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">账号</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="bankNumber" name ="bankNumber" placeholder="账号" value="${supplier.bankNumber}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">税号</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="taxNumber" name ="taxNumber" placeholder="税号" value="${supplier.taxNumber}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">用户名</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="userName" name ="userName" onclick="doTelephone()" placeholder="用户名" value="${supplier.userName}" >
</div>
</div>
<div style="display: none;" id= "userTelephoneid" class="form-group">
<label class="col-sm-2 control-label">移动设备编号</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="userTelephone" name ="userTelephone" placeholder="移动设备编号" value="${supplier.userTelephone}" >
</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 ="mainBusiness" name ="mainBusiness" placeholder="主营业务...">${supplier.mainBusiness}</textarea>
</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 ="evaluate" name ="evaluate" placeholder="评价...">${supplier.evaluate}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态</label>
<div class="col-sm-10">
<select class="form-control select2 " id="type" name="type"
style="width: 200px;"></select>
</div>
</div>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">外包单位资质</h3>
<div class="box-tools pull-right">
<a onclick="addSubscribeDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<table id="table1"></table>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>