431 lines
21 KiB
Plaintext
431 lines
21 KiB
Plaintext
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%request.setAttribute("DEPARTMENT", SparePartCommString.PURCHASE_DEPARTMENT); %>
|
||
<%-- <%request.setAttribute("PASS", SparePartCommString.STATUS_PASS); %>
|
||
<%request.setAttribute("REJECT", SparePartCommString.STATUS_REJECT); %>
|
||
<%request.setAttribute("SUBMIT", SparePartCommString.STATUS_SUBMIT); %> --%>
|
||
<%request.setAttribute("INSTOCK_OTHER", SparePartCommString.INSTOCK_OTHER); %>
|
||
<%request.setAttribute("INSTOCK_PURCHASE", SparePartCommString.INSTOCK_PURCHASE); %>
|
||
<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 doPass(routeNum) {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||
.validateField('targetUsersName');
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$("#passstatus").val(true);
|
||
$("#routeNum").val(routeNum)
|
||
$.post(ext.contextPath + "/sparepart/inStockRecord/AuditInStockRecord.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 doBack(routeNum) {
|
||
swal({
|
||
title: "退回!",
|
||
text: "请输入审核不通过理由:",
|
||
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
|
||
}
|
||
},
|
||
content: {
|
||
element: "input",
|
||
attributes: {
|
||
placeholder: "审核不通过理由...",
|
||
},
|
||
},
|
||
})
|
||
.then(function(value){
|
||
if(value){
|
||
$("#auditopinion").val(value);
|
||
$("#passstatus").val(false);
|
||
$("#routeNum").val(routeNum)
|
||
$.post(ext.contextPath + "/sparepart/inStockRecord/AuditInStockRecord.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');
|
||
}
|
||
});
|
||
} */
|
||
//流程审核文件上传所需参数
|
||
var masterId_process = '${inStockRecord.id}';//业务Id
|
||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||
var status = 'delete';//有删除权限
|
||
|
||
function doSubmit() {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||
.validateField('targetUsersName');
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||
$.post(ext.contextPath + "/sparepart/inStockRecord/AuditInStockRecord.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');
|
||
}
|
||
}
|
||
var showUser4SelectsFun = function() {
|
||
var userIds= $("#targetusers").val();
|
||
var jobIds= $("#targetjobs").val();
|
||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal("user4SelectModal");
|
||
});
|
||
};
|
||
$(function(){
|
||
|
||
if ('${inStockRecord.fareAdjustment}' != '') {
|
||
if (0 == '${inStockRecord.fareAdjustment}') {
|
||
document.getElementById('iDiv').style.display = 'block';
|
||
document.getElementById('vDiv').style.display = 'block';
|
||
}
|
||
}
|
||
if ('${inStockRecord.vatInvoice}' != '') {
|
||
if (1 == '${inStockRecord.vatInvoice}')
|
||
document.getElementById('tDiv').style.display = 'block';
|
||
}
|
||
|
||
//初始化文件显示
|
||
getFileList_process();
|
||
//初始化选择框,方法在workflow.js里
|
||
processSelectNode("${businessUnitAudit.taskid}");
|
||
|
||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/sparepart/inStockRecord/getInStockDetailList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
showFooter:true,//添加页脚
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
showFooter:true,//添加页脚
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
pid:'${inStockRecord.id}',
|
||
<%--type:'${INSTOCK_OTHER}'--%>
|
||
<%--type:'${INSTOCK_PURCHASE}'--%>
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
},{
|
||
field: 'type', // 返回json数据中的name
|
||
title: '入库类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function(value, row, index){
|
||
console.log(value)
|
||
if (value == ${INSTOCK_PURCHASE}) {
|
||
return '采购入库';
|
||
}
|
||
if (value == ${INSTOCK_OTHER}) {
|
||
return '其他入库';
|
||
}
|
||
},
|
||
},{
|
||
field: 'goods.name', // 返回json数据中的name
|
||
title: '物品名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'goods.model', // 返回json数据中的name
|
||
title: '规格型号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'goods.brand', // 返回json数据中的name
|
||
title: '品牌', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'goods.unit', // 返回json数据中的name
|
||
title: '单位', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'instockNumber', // 返回json数据中的name
|
||
title: '入库数量', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'includeTaxratePrice', // 返回json数据中的name
|
||
title: '含税单价/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
footerFormatter:"合计"
|
||
},{
|
||
field: 'includeTaxrateTotalMoney', // 返回json数据中的name
|
||
title: '含税合计/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
footerFormatter:function(value){
|
||
if(value==""){
|
||
return"";
|
||
}else{
|
||
var count = 0;
|
||
for(var i in value){
|
||
count += value[i].includeTaxrateTotalMoney;
|
||
}
|
||
return count.toFixed(2);
|
||
}
|
||
},
|
||
formatter:function(value, row, index){
|
||
return value.toFixed(2);
|
||
},
|
||
},{
|
||
field: 'price', // 返回json数据中的name
|
||
title: '不含税单价/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
footerFormatter:"总计",
|
||
},{
|
||
field: 'totalMoney', // 返回json数据中的name
|
||
title: '不含税合计/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
footerFormatter:function(value){
|
||
if(value==""){
|
||
return"";
|
||
}else{
|
||
var count = 0;
|
||
for(var i in value){
|
||
count += value[i].totalMoney;
|
||
}
|
||
return count.toFixed(2);
|
||
}
|
||
},
|
||
formatter:function(value, row, index){
|
||
return value.toFixed(2);
|
||
},
|
||
},
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_Detail");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
});
|
||
//输入框验证
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
targetUsersName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '提交人员不能为空'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
//显示流程详情
|
||
var id = '${inStockRecord.id}';
|
||
$.post(ext.contextPath + '/sparepart/inStockRecord/showProcessInStockView.do', {id:id,inModal:'inModal'} , function(data) {
|
||
$("#showView").html(data);
|
||
});
|
||
})
|
||
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-xlg">
|
||
<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">入库登记(${taskName})</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<div class="col-md-7 col-xs-12">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">所属厂区</label>
|
||
<div class="col-sm-4" >
|
||
<p class="form-control-static" >${inStockRecord.company.name}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">所属仓库</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.warehouse.name}</p>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">入库单号</label>
|
||
<div class="col-sm-4" >
|
||
<p class="form-control-static" >${inStockRecord.id}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">入库日期</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.instockDate.substring(0,10)}</p>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">票据单号</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.billNumber}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">入库人</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.instockManName}</p>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">是否后期补票</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.fareAdjustmentText}</p>
|
||
</div>
|
||
<div id="iDiv" style="display: none;">
|
||
<label class="col-sm-2 control-label">发票号</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.invoiceNumber}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div id="vDiv" style="display: none;">
|
||
<label class="col-sm-2 control-label">是否专票</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.vatInvoiceText}</p>
|
||
</div>
|
||
</div>
|
||
<div id="tDiv" style="display: none;">
|
||
<label class="col-sm-2 control-label">税率(%)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static" >${inStockRecord.taxrate}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<input type="hidden" class="form-control" name ="id" value="${businessUnitAudit.id}">
|
||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitAudit.processid}">
|
||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitAudit.taskid}">
|
||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitAudit.businessid}">
|
||
<input type="hidden" class="form-control" name =unitid value="${param.unitId}">
|
||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||
<!-- <input type="hidden" class="form-control" id ="passstatus" name ="passstatus" value=true>
|
||
<input type="hidden" class="form-control" id ="auditopinion" name ="auditopinion" >
|
||
<input type="hidden" class="form-control" id ="routeNum" name ="routeNum" > -->
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*审核结果</label>
|
||
<div class="col-sm-6">
|
||
<select class="form-control select2" id="passstatus" name ="passstatus" style="width: 270px;">
|
||
<option value= true>通过</option>
|
||
<option value= false>驳回</option>
|
||
</select>
|
||
</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="routeNum" name ="routeNum" style="width: 270px;">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<!-- <div id = "reject" class="form-group">
|
||
<label class="col-sm-2 control-label">*驳回原因</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="auditopinion" name ="auditopinion" placeholder="驳回原因"></textarea>
|
||
</div>
|
||
</div> -->
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">审核意见</label>
|
||
<div class="col-sm-6">
|
||
<textarea class="form-control" rows="2" id ="auditopinion" name ="auditopinion" placeholder="审核意见">通过</textarea>
|
||
</div>
|
||
</div>
|
||
<div id = "selectUsers" class="form-group">
|
||
<label class="col-sm-2 control-label">提交至:</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||
</div>
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
<div class="form-group" style="margin:8px">
|
||
<label class="col-sm-2 control-label"></label>
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||
</div>
|
||
<div id="fileArea">
|
||
</div>
|
||
</form>
|
||
<div class="box box-primary" >
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">入库明细</h3>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<table id="table_Detail"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-5 col-xs-12" id="showView">
|
||
</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="processExecute(doPass,${businessUnitAudit.taskid},true)" id="btn_update">通过</button>
|
||
<button type="button" class="btn btn-danger" onclick="processExecute(doBack,${businessUnitAudit.taskid},false)" id="btn_submit">驳回</button> --%>
|
||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">提交</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|