Browse Source
基础资料 报销单 修改报销单列表页面表格,去除申请人显示样式; 修改报销管理列表页面,新增当前状态字段; 修改报销管理、报销单列表查询controller接口; 修改报销单分页查询、获取用户名下可见用户列表、根据角色设置节点变量service方法; 修改列表查询mapper方法,截取日期查询; 新增研发总监审批页面;dev
王晓迪
1 month ago
8 changed files with 465 additions and 110 deletions
@ -0,0 +1,268 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('研发总监审核')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-baseExpense-yfzj" th:object="${formData}"> |
||||
|
<input name="expenseId" th:field="*{expenseId}" type="hidden"> |
||||
|
<input name="expenseCode" th:field="*{expenseCode}" type="hidden"> |
||||
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
||||
|
<input name="taskName" th:field="*{taskName}" type="hidden"> |
||||
|
<input name="instanceId" th:field="*{instanceId}" type="hidden"> |
||||
|
<input name="instanceType" th:field="*{instanceType}" type="hidden"> |
||||
|
<input type="hidden" name="p_COM_comment" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请时间:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="deptName" th:field="*{deptName}" class="form-control" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">岗位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="postName" th:field="*{postName}" class="form-control" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">姓名:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="fullName" th:field="*{fullName}" class="form-control" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">报销方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="yfzj_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" |
||||
|
class="form-control" |
||||
|
th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled> |
||||
|
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div id="yfzj_expenseMethodModal" class="container" style="display: none;margin-left: 150px;border: 1px dashed #ddd;padding-top: 10px;padding-bottom: 10px;"> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-4 control-label is-required" style="text-align: left;padding-left: 0px;padding-right: 0px;">是否是委外/采购采销:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required> |
||||
|
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-4 control-label is-required">供应商ID:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-4 control-label is-required">对公收款方:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-4 control-label is-required">对公收款账户:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-4 control-label is-required">对公开户行:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group" style="padding-top: 10px;"> |
||||
|
<label class="col-sm-3 control-label is-required" for="yfzjVerifyApproved">审批意见:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<select name="p_B_yfzjVerifyApproved" id="yfzjVerifyApproved" class="form-control" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group" style="padding-top: 10px;"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control" width="30%"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
<div class="container"> |
||||
|
<div class="form-row"> |
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<span>选择报销分类信息</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-sub-table-expense-yfzj"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/baseExpense"; |
||||
|
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
|
var taskId = [[${taskId}]]; |
||||
|
var $table = $("#bootstrap-sub-table-expense-yfzj"); |
||||
|
$("#form-baseExpense-yfzj").validate({focusCleanup: true}); |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
id:'bootstrap-sub-table-expense-yfzj', |
||||
|
url: ctx + "system/expenseChild/list", |
||||
|
queryParams: function(params) { |
||||
|
return { |
||||
|
expenseCode: $("#expenseCode").val() |
||||
|
}; |
||||
|
}, |
||||
|
pagination: false, |
||||
|
sidePagination: "client", |
||||
|
showFooter: true, |
||||
|
model: "报销单数据", |
||||
|
editable: true, |
||||
|
columns: [ |
||||
|
{checkbox: true}, |
||||
|
{title: '主键',field: 'index',visible: false, |
||||
|
formatter: function (value, row, index) { |
||||
|
return index; |
||||
|
} |
||||
|
}, |
||||
|
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, |
||||
|
{title: '关联报销单号',field: 'expenseCode',visible: false}, |
||||
|
{title: '成本类型',field: 'costType', |
||||
|
formatter:function (value, row, index) { |
||||
|
return costTypeFormatter(value,row,index); |
||||
|
} |
||||
|
}, |
||||
|
{title: '成本小类',field: 'costSmallType', |
||||
|
formatter:function(value, row, index){ |
||||
|
return getCostSmallType(value,row,index) |
||||
|
} |
||||
|
}, |
||||
|
{title: '用途',field: 'purpose',}, |
||||
|
{title: '金额',field: 'amounts', |
||||
|
footerFormatter: function (value) { |
||||
|
var sum = 0; |
||||
|
for (var i in value) { |
||||
|
sum += parseFloat(value[i].amounts)|| 0; |
||||
|
} |
||||
|
return "总金额: " + sum.toFixed(2); |
||||
|
} |
||||
|
}, |
||||
|
{title: '报销时间',field: 'expenseTime',visible: false}, |
||||
|
{title: '出差单号',field: 'evectionCode',}, |
||||
|
{title: '采购单号',field: 'purcahseCode',}, |
||||
|
{title: '委外单号',field: 'outsourceCode',}, |
||||
|
], |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
handleExpenseMethod(this); |
||||
|
}); |
||||
|
|
||||
|
// 列中获取成本类型的下拉改变数据 |
||||
|
function onCostTypeChange(selectElement, rowIndex) { |
||||
|
var newSupplierId = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costType = newSupplierId; // 更新供应商ID |
||||
|
// 重新渲染成本小类的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
|
||||
|
// 自定义供应商名称列的格式化函数 |
||||
|
function costTypeFormatter(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" disabled onchange="onCostTypeChange(this, ' + index + ')">'; |
||||
|
costTypeDatas.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
|
||||
|
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 |
||||
|
function getCostSmallType(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" disabled onchange="onCostSmallTypeChange(this, ' + index + ')">'; |
||||
|
// 假设此函数根据供应商ID返回设备列表 |
||||
|
var costSamllTypes = []; |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/category/getChildCode', |
||||
|
type: 'post', |
||||
|
data: {code: row.costType}, |
||||
|
async: false, |
||||
|
success: function (result) { |
||||
|
console.log(result); |
||||
|
costSamllTypes = result; |
||||
|
} |
||||
|
}); |
||||
|
if (costSamllTypes) { |
||||
|
costSamllTypes.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function onCostSmallTypeChange(selectElement, rowIndex) { |
||||
|
var newCostSmallType = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costSmallType = newCostSmallType; |
||||
|
// 重新渲染当前行的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
|
||||
|
function handleExpenseMethod(expenseMethodSelect) { |
||||
|
//获取页面元素中的下拉框选中的值 |
||||
|
var expenseMethod = $("#yfzj_expenseMethod option:selected").val(); |
||||
|
if (expenseMethod === '1') { |
||||
|
$("#yfzj_expenseMethodModal").show(); |
||||
|
} else { |
||||
|
$("#yfzj_expenseMethodModal").hide(); |
||||
|
} |
||||
|
} |
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
if ($('textarea[name="comment"]').val()) { |
||||
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
||||
|
} |
||||
|
$.operate.save(prefix + "/complete/"+taskId, $('#form-baseExpense-yfzj').serialize()); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue