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

666 lines
32 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" %>
<%@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); %>
<%@page import="com.sipai.entity.document.DocFileRelation" %>
<% request.setAttribute("Type_libraryRoutineWork", DocFileRelation.Type_libraryRoutineWork); %>
<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/doupdate.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: '请选择抢单类型'
}
}
},
type: {
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('${libraryRoutineWork.workFrequencyType}').trigger('change');
$('#robWorkorder').select2({minimumResultsForSearch: 10}).val('${libraryRoutineWork.robWorkorder}').trigger('change');
// $('#type').select2({ minimumResultsForSearch: 10 }).val('${libraryRoutineWork.type}').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}';
}
});
//下发内容初次加载器
if ("${libraryRoutineWork.workFrequencyType }" == "${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}';
$("#dailyRadio").attr("checked", "checked");
$("#monthlyRadio").removeAttr("checked");
$("#weeklyRadio").removeAttr("checked");
//日多选框
var dayItems = '${libraryRoutineWork.dayRegister}'.split(',');
$("#dayRegister").val(dayItems).trigger("change");
} else if ("${libraryRoutineWork.workFrequencyType }" == '${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}';
$("#weeklyRadio").attr("checked", "checked");
$("#dailyRadio").removeAttr("checked");
$("#monthlyRadio").removeAttr("checked");
//周多选框
var weekItems = '${libraryRoutineWork.weekRegister}'.split(',');
$("#weekRegister").val(weekItems).trigger("change");
} else if ("${libraryRoutineWork.workFrequencyType }" == '${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}';
$("#monthlyRadio").attr("checked", "checked");
$("#dailyRadio").removeAttr("checked");
$("#weeklyRadio").removeAttr("checked");
} else {
document.getElementById('dayDiv').style.display = 'block';
document.getElementById('weekDiv').style.display = 'none';
document.getElementById('monthDiv').style.display = 'none';
workFrequencyType = '${Frequency_Type_Day}';
$("#dailyRadio").attr("checked", "checked");
$("#monthlyRadio").removeAttr("checked");
$("#weeklyRadio").removeAttr("checked");
//日多选框
var dayItems = '${libraryRoutineWork.dayRegister}'.split(',');
$("#dayRegister").val(dayItems).trigger("change");
}
var fileRelation = function () {
$.post(ext.contextPath + '/document/docFileRelation/show4select.do', {
unitId: unitId,
type: '${Type_libraryRoutineWork}',
masterid: $("#id").val()
}, function (data) {
$("#docFileRelationDiv").html(data);
openModal('docFileRelationModal');
});
};
//下载文件
var fileDownload = function (id) {
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=tb_doc_file");
};
function delRelation(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(function (willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/document/docFileRelation/delete.do', {id: id}, function (data) {
if (data.code == 1) {
$("#fileRelationTable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
}, 'json');
}
});
}
$(function () {
$("#fileRelationTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/docFileRelation/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
masterid: $("#id").val()
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'asc', // 排序规则
// onClickRow: function (row) {//单击行事件,执行查看功能
// },
columns: [
// {
// checkbox: true, // 显示一个勾选框
// },
{
field: '', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return row.commonFile.filename;
}
}, {
field: '', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return row.insuserName;
}
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: '100',
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.docId + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="delRelation(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
buts = '<div class = "btn-group">' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
//月最后天判断
if('${libraryRoutineWork.monthRegister}'=='${LastDay}'){
$("#monthRegister").attr("readOnly", true);//不可修改
$("#lastday").attr("checked","checked");
}
})
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">&times;</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 name="id" id="id" type="hidden" value="${libraryRoutineWork.id}"/>
<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}" 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">
<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">
<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">&nbsp;&nbsp;最后一天
</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="box-body ">
<div>
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default" onclick="fileRelation();"><i
class="fa fa-plus"></i>文件关联
</button>
<!-- <button type="button" class="btn btn-default" onclick="delDocFun();"><i class="fa fa-trash"></i> 删除</button> -->
</div>
<!-- <div class="input-group input-group-sm pull-right" style="width:250px" >
<input type="text" id="search_fileName" name="search_fileName" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearchFile();"><i class="fa fa-search"></i></button>
</div>
</div> -->
<table id="fileRelationTable"></table>
</div>
</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>