Files
2026-01-16 14:13:44 +08:00

202 lines
8.3 KiB
Plaintext
Raw Permalink 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"%>
<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">
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/sparepart/Score/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');
}
}
$(function(){
//选择供应商
$.post(ext.contextPath + "/sparepart/Score/getSupplier.do", {}, function(data) {
var selelct =$("#supplierId").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('${score.supplierId}').trigger("change");
},'json');
//选择年份
$('#years').datepicker({
format: 'yyyy',
startView: 2,
maxViewMode: 2,
minViewMode:2,
autoclose: true,
todayHighlight: true,
language: 'zh-CN'
});
})
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
supplierId: {
validators: {
notEmpty: {
message: '供应商编号不能为空'
},
},
},
years: {
validators: {
notEmpty: {
message: '年份不能为空'
},
},
},
priceScore: {
validators: {
notEmpty: {
message: '价格打分不能为空'
}
}
},
qualityScore: {
validators: {
notEmpty: {
message: '品质打分不能为空'
}
}
},
deliveryTimeScore: {
validators: {
notEmpty: {
message: '交货期打分不能为空'
}
}
},
serviceLevelScore: {
validators: {
notEmpty: {
message: '服务水平打分不能为空'
}
}
},
creditScore: {
validators: {
notEmpty: {
message: '信用度打分不能为空'
},
}
},
matchingScore: {
validators: {
notEmpty: {
message: '配合度打分不能为空'
},
}
},
}
});
</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" class="form-control" id="id" name ="id" value="${score.id}">
<div class="form-group">
<label class="col-sm-2 control-label">*供应商</label>
<div class="col-sm-6">
<select class="form-control select2" id="supplierId" name ="supplierId" style="width: 270px;"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*年份</label>
<div class="col-sm-6">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control" id="years" name="years" style="width: 230px;" readonly value="${score.years}"></input>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*价格打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="priceScore" name ="priceScore" placeholder="价格打分" step="0.1" min="0" max="10" value="${score.priceScore}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*品质打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="qualityScore" name ="qualityScore" placeholder="品质打分" step="0.1" min="0" max="10" value="${score.qualityScore}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*交货期打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="deliveryTimeScore" name ="deliveryTimeScore" placeholder="交货期打分" step="0.1" min="0" max="10" value="${score.deliveryTimeScore}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*服务水平打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="serviceLevelScore" name ="serviceLevelScore" placeholder="服务水平打分" step="0.1" min="0" max="10" value="${score.serviceLevelScore}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*信用度打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="creditScore" name ="creditScore" placeholder="信用度打分" step="0.1" min="0" max="10" value="${score.creditScore}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*配合度打分</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="matchingScore" name ="matchingScore" placeholder="配合度打分" step="0.1" min="0" max="10" value="${score.matchingScore}">
</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>