476 lines
23 KiB
Plaintext
476 lines
23 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.entity.process.LibraryRoutineWork" %>
|
||
<% request.setAttribute("Frequency_Type_Day", LibraryRoutineWork.Frequency_Type_Day); %>
|
||
<% request.setAttribute("Frequency_Type_Week", LibraryRoutineWork.Frequency_Type_Week); %>
|
||
<% request.setAttribute("Frequency_Type_Month", LibraryRoutineWork.Frequency_Type_Month); %>
|
||
<% request.setAttribute("Frequency_Type_Year", LibraryRoutineWork.Frequency_Type_Year); %>
|
||
<% request.setAttribute("Type_Run", LibraryRoutineWork.Type_Run); %>
|
||
<% request.setAttribute("Type_Manage", LibraryRoutineWork.Type_Manage); %>
|
||
<% request.setAttribute("LastDay", LibraryRoutineWork.LastDay); %>
|
||
<style type="text/css">
|
||
|
||
</style>
|
||
<script type="text/javascript">
|
||
var workFrequencyType = '${Frequency_Type_Day}';//默认每日下发
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||
//获取验证结果,如果成功,执行下面代码
|
||
var param = $("#subForm").serialize() + '&workFrequencyType=' + workFrequencyType;
|
||
$.post(ext.contextPath + "/process/libraryRoutineWork/dosave.do", param, function (data) {
|
||
if (data.res == 1) {
|
||
$("#table").bootstrapTable('refresh');
|
||
closeModal("subModal");
|
||
} else if (data.res == 0) {
|
||
showAlert('d', '保存失败');
|
||
} else {
|
||
showAlert('d', data.res);
|
||
}
|
||
}, 'json');
|
||
}
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
ppositionType: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '岗位类型不能为空'
|
||
}
|
||
}
|
||
},
|
||
pworkTypeName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '工作类型不能为空'
|
||
}
|
||
}
|
||
},
|
||
workCode: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '工作编号不能为空'
|
||
}
|
||
}
|
||
},
|
||
workName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '工作名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
workContent: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '工作内容不能为空'
|
||
}
|
||
}
|
||
},
|
||
evaluationCriterion: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '评价标准不能为空'
|
||
}
|
||
}
|
||
},
|
||
workFrequencyType: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择类型'
|
||
}
|
||
}
|
||
},
|
||
workStartTime: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '设定时间不能为空'
|
||
}
|
||
}
|
||
},
|
||
baseHours: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '额定工时不能为空'
|
||
}
|
||
}
|
||
},
|
||
baseCost: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '额定费用不能为空'
|
||
}
|
||
}
|
||
},
|
||
needPeople: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '需要人数不能为空'
|
||
}
|
||
}
|
||
},
|
||
skillLevel: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '需要技能等级不能为空'
|
||
}
|
||
}
|
||
},
|
||
robWorkorder: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择抢单类型'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
//项目类型下拉数据
|
||
// var selectType = $("#typeName").select2({ minimumResultsForSearch: 10 });
|
||
// $.post(ext.contextPath + "/process/processAdjustmentType/getSelectList.do", {}, function (data) {
|
||
// $("#typeName").empty();
|
||
// var selelct_ = $("#typeName").select2({
|
||
// data: data,
|
||
// placeholder: '请选择',//默认文字提示
|
||
// allowClear: false,//允许清空
|
||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
// language: "zh-CN",
|
||
// minimumInputLength: 0,
|
||
// minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||
// formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||
// formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||
// });
|
||
// selelct_.val('').trigger("change");
|
||
// selelct_.on('change', function (e) {
|
||
// $('#typeId').val(e.target.value);
|
||
// })
|
||
// }, 'json');
|
||
|
||
// $('#workFrequencyType').select2({ minimumResultsForSearch: 10 }).val('${Frequency_Type_Day}').trigger('change');
|
||
$('#robWorkorder').select2({minimumResultsForSearch: 10}).val('是').trigger('change');
|
||
// $('#type').select2({ minimumResultsForSearch: 10 }).val('').trigger('change');
|
||
|
||
$("#weekRegister").select2({
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
multiple: true,
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
|
||
$("#dayRegister").select2({
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 24,//数据超过十个启用搜索框
|
||
multiple: true,
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
|
||
$('input[type=radio][name=optionsRadiosinline]').change(function () {
|
||
if (this.value == '${Frequency_Type_Day}') {
|
||
document.getElementById('dayDiv').style.display = 'block';
|
||
document.getElementById('weekDiv').style.display = 'none';
|
||
document.getElementById('monthDiv').style.display = 'none';
|
||
workFrequencyType = '${Frequency_Type_Day}';
|
||
} else if (this.value == '${Frequency_Type_Week}') {
|
||
document.getElementById('dayDiv').style.display = 'none';
|
||
document.getElementById('weekDiv').style.display = 'block';
|
||
document.getElementById('monthDiv').style.display = 'none';
|
||
workFrequencyType = '${Frequency_Type_Week}';
|
||
} else if (this.value == '${Frequency_Type_Month}') {
|
||
document.getElementById('dayDiv').style.display = 'none';
|
||
document.getElementById('weekDiv').style.display = 'none';
|
||
document.getElementById('monthDiv').style.display = 'block';
|
||
workFrequencyType = '${Frequency_Type_Month}';
|
||
}
|
||
});
|
||
$("#dailyRadio").attr("checked", "checked");
|
||
//日多选框
|
||
var dayItems = '${libraryRoutineWork.dayRegister}'.split(',');
|
||
$("#dayRegister").val(dayItems).trigger("change");
|
||
//周多选框
|
||
var weekItems = '${libraryRoutineWork.weekRegister}'.split(',');
|
||
$("#weekRegister").val(weekItems).trigger("change");
|
||
|
||
function selectJob() {
|
||
$.post(ext.contextPath + '/process/libraryRoutineWork/job4Select.do', {
|
||
formId: "subForm",
|
||
hiddenId: "workTypeName",
|
||
textId: "pworkTypeName",
|
||
hiddenId2: "positionType",
|
||
textId2: "ppositionType"
|
||
}, function (data) {
|
||
$("#job4SelectDiv").html(data);
|
||
openModal('job4SelectModal');
|
||
});
|
||
}
|
||
|
||
//勾选每月最后一天
|
||
function dolastday() {
|
||
//定义一个空数组
|
||
var arr = '';
|
||
$("input[name='lastday']:checked").each(function (i) {
|
||
//把所有被选中的复选框的值存入数组
|
||
arr = $(this).val();
|
||
})
|
||
if (arr != '' && arr == '${LastDay}') {
|
||
$("#monthRegister").val('${LastDay}');
|
||
$("#monthRegister").attr("readOnly", true);//不可修改
|
||
} else {
|
||
$("#monthRegister").attr("readOnly", false);//可修改
|
||
}
|
||
}
|
||
|
||
</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">×</span></button>
|
||
<h4 class="modal-title">新增</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm" autocomplete="off">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" name="id" id="id" value="${id}"/>
|
||
<input type="hidden" name="unitId" id="unitId" value="${param.unitId}"/>
|
||
<input type="hidden" name="type" id="type" value="${param.typestr}"/>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*工作类型</label>
|
||
<div class="col-sm-4">
|
||
<input type="hidden" name="workTypeName" id="workTypeName"
|
||
value="${libraryRoutineWork.workTypeName}"/>
|
||
<input type="text" class="form-control" id="pworkTypeName" name="pworkTypeName"
|
||
placeholder="点击选择"
|
||
value="${libraryRoutineWork.pworkTypeName}" onclick="selectJob();" readonly>
|
||
</div>
|
||
<label class="col-sm-2 control-label">*岗位类型</label>
|
||
<div class="col-sm-4">
|
||
<input type="hidden" name="positionType" id="positionType"
|
||
value="${libraryRoutineWork.positionType}"/>
|
||
<input type="text" class="form-control" id="ppositionType" name="ppositionType"
|
||
value="${libraryRoutineWork.ppositionType}" placeholder="请选择工作类型" readonly>
|
||
</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="workCode" name="workCode" placeholder="工作编号"
|
||
value="${libraryRoutineWork.workCode}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*工作名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="workName" name="workName" placeholder="工作名称"
|
||
value="${libraryRoutineWork.workName}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*工作内容</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="workContent" name="workContent"
|
||
placeholder="工作内容">${libraryRoutineWork.workContent}</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*评价标准及文件</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="evaluationCriterion" name="evaluationCriterion"
|
||
placeholder="工作内容">${libraryRoutineWork.evaluationCriterion}</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*作业频次类型</label>
|
||
<div class="col-sm-10">
|
||
<label class="radio-inline">
|
||
<input type="radio" name="optionsRadiosinline" id="dailyRadio"
|
||
value="${Frequency_Type_Day}"> 每日下发
|
||
</label>
|
||
<label class="radio-inline">
|
||
<input type="radio" name="optionsRadiosinline" id="weeklyRadio"
|
||
value="${Frequency_Type_Week}"> 每周下发
|
||
</label>
|
||
<label class="radio-inline">
|
||
<input type="radio" name="optionsRadiosinline" id="monthlyRadio"
|
||
value="${Frequency_Type_Month}"> 每月下发
|
||
</label>
|
||
<!-- <select class="form-control select2" id="workFrequencyType" name="workFrequencyType"
|
||
style="width: 170px;">
|
||
<option value="${Frequency_Type_Day}" selected="selected">每日</option>
|
||
<option value="${Frequency_Type_Week}">每周</option>
|
||
<option value="${Frequency_Type_Month}">每月</option>
|
||
</select> -->
|
||
</div>
|
||
<!-- <label class="col-sm-2 control-label">*设置时间</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="workStartTime" name="workStartTime" placeholder="设置时间"
|
||
value="${libraryRoutineWork.workStartTime}">
|
||
</div> -->
|
||
</div>
|
||
|
||
<!--每天下发方式-->
|
||
<div class="form-group" id="dayDiv"
|
||
style="border-radius:4px;border:2px solid seagreen;padding-top:4px;padding-bottom:4px;margin-left:4px;margin-right:4px">
|
||
<label class="col-sm-2 control-label">在第</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control select2" id="dayRegister" name="dayRegister"
|
||
style="width:260px;">
|
||
<option value="0">00</option>
|
||
<option value="1">01</option>
|
||
<option value="2">02</option>
|
||
<option value="3">03</option>
|
||
<option value="4">04</option>
|
||
<option value="5">05</option>
|
||
<option value="6">06</option>
|
||
<option value="7">07</option>
|
||
<option value="8">08</option>
|
||
<option value="9">09</option>
|
||
<option value="10">10</option>
|
||
<option value="11">11</option>
|
||
<option value="12">12</option>
|
||
<option value="13">13</option>
|
||
<option value="14">14</option>
|
||
<option value="15">15</option>
|
||
<option value="16">16</option>
|
||
<option value="17">17</option>
|
||
<option value="18">18</option>
|
||
<option value="19">19</option>
|
||
<option value="20">20</option>
|
||
<option value="21">21</option>
|
||
<option value="22">22</option>
|
||
<option value="23">23</option>
|
||
</select>
|
||
<label class="control-label">按住ctrl多选</label>
|
||
</div>
|
||
<label class="col-sm-2 control-label" style="text-align: left">小时下发</label>
|
||
</div>
|
||
|
||
<!--每周下发方式-->
|
||
<div class="form-group" id="weekDiv"
|
||
style="border-radius:4px;border:2px solid cadetblue;padding-top:4px;padding-bottom:4px;margin-left:4px;margin-right:4px;display: none;">
|
||
<label class="col-sm-2 control-label">周间隔</label>
|
||
<div class="col-sm-2">
|
||
<input type="number" class="form-control" id="weekInterval" name="weekInterval"
|
||
placeholder="" min="0" value="${libraryRoutineWork.weekInterval }"
|
||
style="border-radius:4px;">
|
||
</select>
|
||
</div>
|
||
|
||
<label class="col-sm-1 control-label">在</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control select2" id="weekRegister" name="weekRegister"
|
||
style="width:260px;">
|
||
<option value="2">周一</option>
|
||
<option value="3">周二</option>
|
||
<option value="4">周三</option>
|
||
<option value="5">周四</option>
|
||
<option value="6">周五</option>
|
||
<option value="7">周六</option>
|
||
<option value="1">周日</option>
|
||
</select>
|
||
<label class="control-label">按住ctrl多选</label>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!--每月下发方式-->
|
||
<div class="form-group" id="monthDiv"
|
||
style="border-radius:4px;border:2px solid rgb(204, 155, 20);padding-top:4px;padding-bottom:4px;margin-left:4px;margin-right:4px;display: none;">
|
||
<label class="col-sm-2 control-label">每月第</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="monthRegister" name="monthRegister" min="-1"
|
||
style="border-radius:4px;width:100%;" value="${libraryRoutineWork.monthRegister }">
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label" style="text-align: left">天下发</label>
|
||
<label class="col-sm-4 control-label" style="text-align: left">
|
||
<input type="checkbox" name="lastday" id="lastday" onchange="dolastday();" value="-1"> 最后一天
|
||
</label>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*定额工时</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="baseHours" name="baseHours" placeholder="定额工时"
|
||
value="${libraryRoutineWork.baseHours}" step="0.01">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*定额费用</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="baseCost" name="baseCost" placeholder="定额费用"
|
||
value="${libraryRoutineWork.baseCost}" step="0.01">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*需要人数</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="needPeople" name="needPeople"
|
||
placeholder="需要人数"
|
||
value="${libraryRoutineWork.needPeople}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*需要技能等级</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="skillLevel" name="skillLevel"
|
||
placeholder="需要技能等级"
|
||
value="${libraryRoutineWork.skillLevel}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*是否可抢单</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="robWorkorder" name="robWorkorder"
|
||
style="width: 170px;">
|
||
<option value="是" selected="selected">是</option>
|
||
<option value="否">否</option>
|
||
</select>
|
||
</div>
|
||
<!-- <label class="col-sm-2 control-label">*类型</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="type" name ="type" style="width: 170px;">
|
||
<option value= "" selected = "selected">请选择</option>
|
||
<option value= "${Type_Run}">运行</option>
|
||
<option value= "${Type_Manage}">行政</option>
|
||
</select>
|
||
</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="dosave()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div> |