|
|
@ -31,33 +31,35 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="form-group" hidden> |
|
|
|
<label class="col-sm-3 control-label">标题:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="title" th:field="*{applyTitle}" 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"> |
|
|
|
<input name="deptName" th:field="*{deptName}" class="form-control" disabled/> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<div class="col-xs-3" style="margin-left: 80px;"> |
|
|
|
<label class="col-sm-4 control-label is-required">部门:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="deptName" class="form-control" type="text" th:field="*{deptName}" readonly required> |
|
|
|
</div> |
|
|
|
</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 class="col-xs-3"> |
|
|
|
<label class="col-sm-4 control-label">岗位:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="postName" class="form-control" th:field="*{postName}" type="text" readonly> |
|
|
|
</div> |
|
|
|
</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 class="col-xs-3"> |
|
|
|
<label class="col-sm-4 control-label is-required">姓名:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="fullName" class="form-control" th:field="*{fullName}" type="text" readonly required> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label">报销方式:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="form-group" style="margin-top: 20px;"> |
|
|
|
<label class="col-sm-4 control-label">报销方式:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select id="modify_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" |
|
|
|
class="form-control" |
|
|
|
th:with="dictList=${@dict.getType('sys_base_expense_method')}"> |
|
|
@ -65,37 +67,46 @@ |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="modify_expenseMethodModal" class="container" style="display: none"> |
|
|
|
<div id="modify_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-3 control-label is-required">是否是委外/采购采销:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> |
|
|
|
<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" id="purchaseOutsourceSelect" th:field="*{isPurchaseOutsource}" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> |
|
|
|
<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-3 control-label is-required">供应商ID:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control"> |
|
|
|
<div class="col-xs-6" id="supplierCodeDiv"> |
|
|
|
<label class="col-sm-4 control-label is-required">供应商ID:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<select id="supplierCode" name="supplierCode" class="form-control"></select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-xs-6"> |
|
|
|
<label class="col-sm-3 control-label is-required">对公收款方:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<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"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-xs-6"> |
|
|
|
<label class="col-sm-3 control-label is-required">对公收款账户:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<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"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-xs-6"> |
|
|
|
<label class="col-sm-3 control-label is-required">对公开户行:</label> |
|
|
|
<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"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<input type="hidden" name="expenseDetailList" id="expenseDetailList"> |
|
|
|
</div> |
|
|
|
<div class="col-xs-6" style="margin-left: 100px;padding-top: 10px;"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-4 control-label">备注:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" > |
|
|
|
<textarea name="remark" class="form-control" th:text="*{remark}"></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -116,14 +127,11 @@ |
|
|
|
<a class="btn btn-success" onclick="insertRow()"> |
|
|
|
<span class="fa fa-plus"></span> 添加报销 |
|
|
|
</a> |
|
|
|
<a class="btn btn-danger" onclick="removeRow()"> |
|
|
|
<span class="fa fa-remove"></span> 删除报销 |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-sub-table-expense-modify"></table> |
|
|
|
<table id="bootstrap-sub-table-expense-modify" style="white-space:nowrap;"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -146,7 +154,9 @@ |
|
|
|
var options = { |
|
|
|
id:'bootstrap-sub-table-expense-modify', |
|
|
|
url: ctx + "system/expenseChild/list", |
|
|
|
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};}, |
|
|
|
queryParams: function(params) { |
|
|
|
return {expenseCode: $("#expenseCode").val()}; |
|
|
|
}, |
|
|
|
pagination: false, |
|
|
|
sidePagination: "client", |
|
|
|
model: "报销单数据", |
|
|
@ -172,14 +182,14 @@ |
|
|
|
}, |
|
|
|
{title: '用途',field: 'purpose',editable:{type:'text',mode:'inline'}}, |
|
|
|
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}}, |
|
|
|
{title: '报销时间',field: 'expenseTime',editable:{type:'date',mode:'inline',}}, |
|
|
|
{title: '报销时间',visible: false,field: 'expenseTime',editable:{type:'date',mode:'inline',}}, |
|
|
|
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}}, |
|
|
|
{title: '采购单号',field: 'purchaseCode',editable: {type:'text',mode:'inline',}}, |
|
|
|
{title: '委外单号',field: 'outsourceCode',editable: {type:'text',mode:'inline',}}, |
|
|
|
{title: '操作', align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
var actions = []; |
|
|
|
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> '); |
|
|
|
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.expenseChildId + '\')"><i class="fa fa-remove"></i>删除</a> '); |
|
|
|
return actions.join(''); |
|
|
|
} |
|
|
|
} |
|
|
@ -187,6 +197,20 @@ |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
|
handleExpenseMethod(this); |
|
|
|
|
|
|
|
loadSupplierCodes(); |
|
|
|
|
|
|
|
// 根据是否委外/采购控制显示/隐藏供应商ID框 |
|
|
|
$('#purchaseOutsourceSelect').on('change',function() { |
|
|
|
var selectedValue = $(this).val(); |
|
|
|
|
|
|
|
if (selectedValue === '1') { |
|
|
|
$('#supplierCodeDiv').show(); |
|
|
|
} else { |
|
|
|
$('#supplierCodeDiv').hide(); |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#purchaseOutsourceSelect').trigger('change'); |
|
|
|
}); |
|
|
|
function insertRow() { |
|
|
|
$("bootstrap-sub-table-expense-modify").bootstrapTable('insertRow', { |
|
|
@ -320,18 +344,39 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function removeRow(){ |
|
|
|
var ids = $.table.selectColumns("index"); |
|
|
|
if (ids.length == 0) { |
|
|
|
$.modal.alertWarning("请至少选择一条记录"); |
|
|
|
return; |
|
|
|
} |
|
|
|
$("#bootstrap-sub-table-expense").bootstrapTable('remove', { |
|
|
|
field: 'index', |
|
|
|
values: ids |
|
|
|
}) |
|
|
|
function removeRow(expenseChildId) { |
|
|
|
console.log(expenseChildId); |
|
|
|
// 使用索引值移除行 |
|
|
|
$('#bootstrap-sub-table-expense-modify').bootstrapTable('remove', { |
|
|
|
field: 'expenseChildId', |
|
|
|
values: expenseChildId |
|
|
|
}); |
|
|
|
} |
|
|
|
function loadSupplierCodes() { |
|
|
|
var url = ctx + 'system/supplier/getSupplier'; |
|
|
|
$.ajax({ |
|
|
|
type: 'post', // 请求类型 |
|
|
|
url: url, // 后端接口URL |
|
|
|
dataType: 'json', // 预期服务器返回的数据类型 |
|
|
|
success: function(data) { |
|
|
|
if (data.rows && Array.isArray(data.rows)) { |
|
|
|
var selectElement = $('#supplierCode'); // 获取仓库编号下拉框元素 |
|
|
|
// 清空下拉框现有选项 |
|
|
|
selectElement.empty(); |
|
|
|
// 添加默认选项(如果需要)编辑时不需要添加默认选项 |
|
|
|
selectElement.append('<option value="">所有</option>'); |
|
|
|
// 遍历返回的数据,添加为下拉框的选项 |
|
|
|
$.each(data.rows, function(index, item) { |
|
|
|
// 仓库ID |
|
|
|
selectElement.append('<option value="' + item.supplierCode + '">' + item.supplierCode + '</option>'); |
|
|
|
}); |
|
|
|
selectElement.val(baseExpense.supplierCode); |
|
|
|
} else { |
|
|
|
$.modal.alertWarning("数据为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
$("input[name='expenseTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|