Browse Source

[feat]: 修改:报销单经理审核页面,修改子表表格字段采购单号。修改:报销单主管审核页面,新增主表修改根据子表中包含的成本类型和成本小类查询的条件。修改:报销单选择获取成本小类数据方法。成本小类下拉框信息。

新增:报销单财务审核页面,整理财务审核根据报销方式是否为公转报销,来显示供应商信息。新增:报销单修改方法新增子表修改,子表修改时获取当前登录的申请用户信息。
修改:报销单清除多余的报销人,与申请人一致的字段清除。
dev
zhangsiqi 3 months ago
parent
commit
e3ba380220
  1. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  2. 54
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java
  3. 2
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml
  4. 10
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  5. 136
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  6. 151
      ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html
  7. 173
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html
  8. 177
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html
  9. 278
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html
  10. 196
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html
  11. 319
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html
  12. 204
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html

3
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java

@ -126,7 +126,7 @@ public class BaseExpenseAccountController extends BaseController
@Log(title = "报销单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseExpenseAccount baseExpenseAccount)
public AjaxResult addSave(@RequestBody BaseExpenseAccount baseExpenseAccount)
{
baseExpenseAccount.setCreateBy(ShiroUtils.getLoginName());
baseExpenseAccount.setUseStatus("0");
@ -203,7 +203,6 @@ public class BaseExpenseAccountController extends BaseController
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@ModelAttribute("preloadObj") BaseExpenseAccountVo baseExpenseAccountVo, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
if (saveEntityBoolean){
baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccountVo);
}

54
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java

@ -6,6 +6,7 @@ import java.util.Map;
import java.util.Set;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
@ -92,6 +93,7 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
PageHelper.startPage(pageNum, pageSize);
//PageHelper 仅对第一List分页有效
Page<BaseExpenseAccountVo> list = (Page<BaseExpenseAccountVo>) baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount);
Page<BaseExpenseAccountVo> returnList = new Page<>();
@ -154,20 +156,18 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
String loginName = ShiroUtils.getLoginName();
baseExpenseAccount.setCreateBy(loginName);
baseExpenseAccount.setCreateTime(DateUtils.getNowDate());
baseExpenseAccount.setAuditStatus("0");
baseExpenseAccount.setUseStatus("0");
baseExpenseAccount.setDelFlag("0");
baseExpenseAccount.setExpenseCode(redisCache.generateBillNo("BX"));
// List<BaseExpenseAccountChild> baseExpenseAccountChildList = baseExpenseAccount.getExpenseAccountChildList();
// int baseExpaneseChildSize = baseExpenseAccountChildList.size();
// if (baseExpaneseChildSize > 0) {
// for (BaseExpenseAccountChild baseExpenseAccountChild :baseExpenseAccountChildList) {
// baseExpenseAccountChild.setCreateBy(loginName);
// baseExpenseAccountChild.setCreateTime(DateUtils.getNowDate());
// //获取父表的单号
// baseExpenseAccountChild.setExpenseCode(baseExpenseAccount.getExpenseCode());
// }
// }
List<BaseExpenseAccountChild> baseExpenseAccountChildList = baseExpenseAccount.getExpenseAccountChildList();
if (!CollectionUtils.isEmpty(baseExpenseAccountChildList)) {
for (BaseExpenseAccountChild baseExpenseAccountChild :baseExpenseAccountChildList) {
baseExpenseAccountChild.setCreateBy(loginName);
baseExpenseAccountChild.setCreateTime(DateUtils.getNowDate());
//获取父表的单号
baseExpenseAccountChild.setExpenseCode(baseExpenseAccount.getExpenseCode());
baseExpenseAccountChildService.insertBaseExpenseAccountChild(baseExpenseAccountChild);
}
}
return baseExpenseAccountMapper.insertBaseExpenseAccount(baseExpenseAccount);
}
@ -184,18 +184,17 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
baseExpenseAccount.setUpdateBy(loginName);
baseExpenseAccount.setUpdateTime(DateUtils.getNowDate());
baseExpenseAccount.setDelFlag("0");
// List<BaseExpenseAccountChild> baseExpenseAccountChildList = baseExpenseAccount.getExpenseAccountChildList();
// baseExpenseAccountChildService.deleteBaseExpenseAccountChildById(baseExpenseAccount.getExpenseId());
// int baseExpenseChildSize = baseExpenseAccountChildList.size();
// if (baseExpenseChildSize > 0) {
// baseExpenseAccountChildService.deleteBaseExpenseAccountChildByExpenseCode(baseExpenseAccount.getExpenseCode());
// for (BaseExpenseAccountChild baseExpenseAccountChild :baseExpenseAccountChildList) {
// baseExpenseAccountChild.setCreateBy(loginName);
// baseExpenseAccountChild.setCreateTime(DateUtils.getNowDate());
// //获取父表的单号
// baseExpenseAccountChild.setExpenseCode(baseExpenseAccount.getExpenseCode());
// }
// }
List<BaseExpenseAccountChild> baseExpenseAccountChildList = baseExpenseAccount.getExpenseAccountChildList();
if (!CollectionUtils.isEmpty(baseExpenseAccountChildList)) {
baseExpenseAccountChildService.deleteBaseExpenseAccountChildByExpenseCode(baseExpenseAccount.getExpenseCode());
for (BaseExpenseAccountChild baseExpenseAccountChild :baseExpenseAccountChildList) {
baseExpenseAccountChild.setCreateBy(loginName);
baseExpenseAccountChild.setCreateTime(DateUtils.getNowDate());
//获取父表的单号
baseExpenseAccountChild.setExpenseCode(baseExpenseAccount.getExpenseCode());
baseExpenseAccountChildService.insertBaseExpenseAccountChild(baseExpenseAccountChild);
}
}
return baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount);
}
@ -314,11 +313,10 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
SysUser user = ShiroUtils.getSysUser();
baseExpenseAccount.setApplyUser(user.getLoginName());
baseExpenseAccount.setApplyTime(DateUtils.getNowDate());
insertBaseExpenseAccount(baseExpenseAccount);
// if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){
// insertBaseExpenseAccount(baseExpenseAccount);
// }
if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){
insertBaseExpenseAccount(baseExpenseAccount);
}
// 启动流程
String applyTitle = user.getUserName()+"发起了报销单提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";

2
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml

@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into base_expense_account_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="expenseCode != null">expense_code,</if>
<if test="cost_type != null">cost_type,</if>
<if test="costType != null">cost_type,</if>
<if test="costSmallType != null">cost_small_type,</if>
<if test="purpose != null">purpose,</if>
<if test="amounts != null">amounts,</if>

10
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml

@ -79,6 +79,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null and applyUser != ''"> and b.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and b.apply_time = #{applyTime}</if>
<if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if>
<if test="params.costType != null">and
or expense_code in (
select expense_code
from ck_equipCodeChild
<where>
<if test="params.costType != null">and cost_type = #{params.costType}</if>
<if test="params.costSmallType != null">and cost_small_type = #{params.costTypeName}</if>
</where>
)
</if>
</where>
</select>

136
ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html

@ -54,14 +54,14 @@
</li>
<li>
<label>成本类型:</label>
<select name="costType" th:with="childList=${@category.getChildByCode('costType')}">
<select id="costType" name="params.costType" th:with="childList=${@category.getChildByCode('costType')}" onchange="onCostTypeChange(this)">
<option value="">所有</option>
<option th:each="chilld: ${childList}" th:value="${chilld.code}" th:text="${chilld.name}"></option>
</select>
</li>
<li>
<label>成本小类:</label>
<select name="costSamllType">
<select id="costSmallType" name="params.costSamllType">
<option value="">所有</option>
</select>
</li>
@ -94,7 +94,7 @@
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<table id="bootstrap-table" style="white-space: nowrap"></table>
</div>
</div>
</div>
@ -107,11 +107,11 @@
var removeFlag = [[${@permission.hasPermi('system:baseExpense:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:baseExpense:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:baseExpense:restore')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var auditStatusData = [[${@dict.getType('auditStatus')}]];
var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]];
var prefix = ctx + "system/baseExpense";
$(function() {
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
@ -122,71 +122,71 @@
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
modalName: "报销单",
pageList: [5, 10, 25, 50],
pageSize: 10,
sortable: true, // 是否启用排序
sortStable: true, // 设置为 true 将获得稳定的排序
fixedColumns: true, // 启用冻结列
rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数
// fixedColumns: true, // 启用冻结列
// rightFixedColumns:1,
// fixedNumber: 1,
// fixedRightNumber: 1, // 冻结右列个数
columns: [
{checkbox: true},
{title: '报销单索引id',field: 'expenseId',visible: false},
{title: '流程实例ID',field: 'instanceId',visible: false},
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{ title:'流程作废实例ID',field: 'cancelInstanceId',visible: false},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false},
{ title: '流程实例类型', field: 'instanceTypeName',visible: false},
{title: '申请人ID',field: 'applyUser', visible: false},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
{title: '报销单索引id',field: 'expenseId',visible: false,align: 'center',},
{title: '流程实例ID',field: 'instanceId',visible: false,align: 'center',},
{title: '流程提交实例ID',field: 'submitInstanceId',visible: false,align: 'center',},
{title:'流程作废实例ID',field: 'cancelInstanceId',visible: false,align: 'center',},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false,align: 'center',},
{title: '流程实例类型', field: 'instanceTypeName',visible: false,align: 'center',},
{field: 'applyUserName', title: '申请人',align: 'center',},
{field: 'applyTime',title: '申请时间',align: 'center',},
{title: '当前任务ID',field: 'taskId',visible: false,align: 'center',},
{title: '待办用户ID',field: 'todoUserId', visible: false,align: 'center',},
{title: '当前任务名称',field: 'taskName',
align: 'center',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{field: 'applyTime',title: '申请时间'
{title: '上级审核状态',field: 'auditStatus',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusData, value);
}
},
{title: '当前任务ID',field: 'taskId',visible: false},
{ title: '待办用户ID',field: 'todoUserId', visible: false},
{ title: '当前任务名称',field: 'taskName',
align: 'center',
{title: '总经理审核状态',field: 'managerAuditStatus',align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
return $.table.selectDictLabel(auditStatusData, value);
}
},
{title: '财务审核状态',field: 'financeAuditStatus',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusData, value);
}
},
{title: '上级审核状态',field: 'auditStatus',},
{title: '总经理审核状态',field: 'managerAuditStatus',},
{title: '财务审核状态',field: 'financeAuditStatus',},
{title: '报销单编号',field: 'expenseCode',},
{title: '报销人',field: 'applyUser',},
{title: '报销方式',field: 'expenseMethod', },
{title: '是否是委外/采购采销',field: 'isPurchaseOutsource',visible: false},
{title: '供应商ID',field: 'supplierCode',visible: false},
{title: '对公收款方',field: 'corporatePayee',visible: false},
{title: '对公收款账户',field: 'corporateReceivingAccount',visible: false},
{title: '对公开户行',field: 'publicAccountBanks',visible: false},
{title: '录入时间',field: 'createTime',},
{title: '更新人',field: 'updateBy'},
{title: '上次更新时间',field: 'updateTime',visible: false},
{title: '备注',field: 'remark',visible: false},
{title: '使用状态',field: 'useStatus',visible: false},
{title: '操作',align: 'center',
{title: '报销单编号',field: 'expenseCode',align: 'center',},
{title: '报销人',field: 'applyUser',align: 'center',},
{title: '报销方式',field: 'expenseMethod', align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(expenseMethodData, value);
}
},
{title: '是否是委外/采购采销',field: 'isPurchaseOutsource',align: 'center',visible: false},
{title: '供应商ID',field: 'supplierCode',align: 'center',visible: false},
{title: '对公收款方',field: 'corporatePayee',visible: false,align: 'center',},
{title: '对公收款账户',field: 'corporateReceivingAccount',visible: false,align: 'center',},
{title: '对公开户行',field: 'publicAccountBanks',visible: false,align: 'center',},
{title: '录入时间',field: 'createTime',align: 'center',},
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',visible: false,align: 'center',},
{title: '备注',field: 'remark',visible: false,align: 'center',},
{title: '使用状态',field: 'useStatus',visible: false,align: 'center',},
{title: '操作',align: 'center', formatter: function (value, row, index) {
var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) {
// 作废
if(row.auditStatus=="1" && row.useStatus=="1") {
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.expenseId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.expenseId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废
}
else{
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
if(row.useStatus=="2" ){
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.expenseId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
@ -199,9 +199,7 @@
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
@ -209,10 +207,38 @@
return actions.join('');
}
}
]
],
rowStyle: function (row, index) {
if (row.auditStatus=="0") {
// 如果审核状态为待审核,则设置为红色
return {css:{"color":"red"}};
}
// 否则使用默认样式
return {};
}
};
$.table.init(options);
});
function onCostTypeChange(element) {
var costType = element.value;
$.ajax({
url: ctx + 'system/category/getChildCode',
type: 'post',
data: {code: costType},
async: false,
success: function (result) {
console.log(result);
costSamllTypes = result;
var selectHtml = '';
costSamllTypes.forEach(function (child) {
selectHtml += '<option value="' + child.code + '">' + child.name + '</option>';
});
$("#costSmallType").append(selectHtml);
}
});
}
</script>
</body>
</html>

151
ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html

@ -10,62 +10,66 @@
<div class="form-group">
<label class="col-sm-3 control-label">报销单编号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
<input name="expenseCode" th:field="*{expenseCode}" 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" type="text">
<input name="deptName" th:field="*{deptName}" 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="postName" th:field="*{postName}" class="form-control" type="text">
<input name="postName" th:field="*{postName}" 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="fullName" th:field="*{fullName}" class="form-control" type="text">
<input name="fullName" th:field="*{fullName}" 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="expenseMethod" th:field="*{expenseMethod}" class="form-control" type="text">
<input id="detail_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" class="form-control" type="text" disabled>
</div>
</div>
<div id="detail_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8">
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否是委外/采购采销:</label>
<div class="col-sm-8">
<input name="isPurchaseOutsource" th:field="*{isPurchaseOutsource}" class="form-control" type="text">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对公收款方:</label>
<div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" th:field="*{corporatePayee}" 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="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" 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="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div>
</div>
</div>
</form>
@ -76,7 +80,7 @@
</div>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense"></table>
<table id="bootstrap-sub-table-expense-detail"></table>
</div>
</div>
</div>
@ -85,6 +89,7 @@
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense"
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var $table = $("#bootstrap-sub-table-expense-detail");
$("#form-baseExpense-add").validate({focusCleanup: true});
$(function(){
$.ajax({
@ -100,16 +105,13 @@
}
});
})
var $table = $("#bootstrap-sub-table-expense");
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-expense',
id:'bootstrap-sub-table-expense-detail',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
return {expenseCode: $("#expenseCode").val()};
},
pagination: false,
sidePagination: "client",
@ -134,19 +136,20 @@
return getCostSmallType(value,row,index)
}
},
{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: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',editable: {type:'text',mode:'inline',}},
{title: '委外单号',field: 'outsourceCode',editable: {type:'text',mode:'inline',}},
{title: '用途',field: 'purpose',},
{title: '金额',field: 'amounts',},
{title: '报销时间',field: 'expenseTime',},
{title: '出差单号',field: 'evectionCode',},
{title: '采购单号',field: 'purcahseCode',},
{title: '委外单号',field: 'outsourceCode',},
],
};
$.table.init(options);
handleExpenseMethod();
});
function insertRow() {
$table.bootstrapTable('insertRow', {
index:1,
index:0,
row: {
expenseChildId:'',
costType: "",
@ -163,41 +166,9 @@
}
/* 删除指定表格行 */
function removeRow(id){
$table.bootstrapTable('remove', {
field: 'id',
values: id
})
}
function submitHandler() {
if ($.validate.form()) {
var formData = $('#form-baseExpense-detail').serializeArray();
var tableData = $table.bootstrapTable('getData');
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/edit", jsonData);
}
}
$table.bootstrapTable('remove', {field: 'id', values: id})
}
function submitHandler() {
if ($.validate.form()) {
var formData = $('#form-baseExpense-add').serializeArray();
var tableData = $table.bootstrapTable('getData');
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/add", jsonData);
}
}
}
// 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val();
@ -211,7 +182,7 @@
// 自定义供应商名称列的格式化函数
function costTypeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">';
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')" disabled>';
costTypeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ;
});
@ -221,8 +192,8 @@
// 自定义设备名称列的格式化函数,依赖于供应商列的选择
function getCostSmallType(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">';
// 假设此函数根据供应商ID返回设备列表
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')" disabled>';
// 假设此函数根据供应商ID返回设备列表onCostTypeChange(this, ' + index + ')
var costSamllTypes = [];
$.ajax({
url: ctx + 'system/category/getChildCode',
@ -252,6 +223,46 @@
// 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#detail_expenseMethod").val();
if (expenseMethod === '1') {
$("#detail_expenseMethodModal").show();
} else {
$("#detail_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
</script>
</body>
</html>

173
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html

@ -3,6 +3,7 @@
<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">
@ -12,8 +13,7 @@
<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="saveEntity" value="true" />
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
@ -32,7 +32,7 @@
<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" readonly>
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group" hidden="hidden">
@ -44,25 +44,27 @@
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptName" th:field="*{deptName}" class="form-control"></select>
<select 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">
<select name="postName" th:field="*{postName}" class="form-control"></select>
<select 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">
<select name="fullName" th:field="*{fullName}" class="form-control"></select>
<input name="fullName" th:field="*{fullName}" class="form-control" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<select id="bxjl_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>
@ -79,26 +81,26 @@
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" class="form-control" type="text" disabled>
</div>
</div>
</div>
@ -114,30 +116,28 @@
</div>
</form>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择报销分类信息</span>-->
<!-- <a class="btn btn-success" onclick="insertRow()">-->
<!-- <i class="fa fa-plus"></i> 添加报销-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-expense-bxjl"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<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-bxjl"></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}]];
$("#form-baseExpense-bxjl").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-bxjl',
@ -176,35 +176,114 @@
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',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> ');
return actions.join('');
}
}
],
};
$.table.init(options);
});
// 列中获取成本类型的下拉改变数据
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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxjl_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#bxjl_expenseMethodModal").show();
} else {
$("#bxjl_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-bxjl').serialize());
}
}
// function getSelections(){
// $.ajax({
// url: ctx + "system/requisitioning/getEmpUserName",
// type: "get",
// dataType: "json",
// success: function (data) {
// $("select[name='deptName']").append($('<option></option>').val(data.deptName).html(data.deptName));
// $("select[name='evectionBy']").append($('<option></option>').val(data.userName).html(data.userName));
// $("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
// }
// });
//
// }
</script>
</body>
</html>

177
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html

@ -3,6 +3,7 @@
<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">
@ -12,8 +13,7 @@
<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="saveEntity" value="true" />
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
@ -32,7 +32,7 @@
<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" readonly>
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group" hidden="hidden">
@ -44,25 +44,27 @@
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptName" th:field="*{deptName}" class="form-control"></select>
<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">
<select name="postName" th:field="*{postName}" class="form-control"></select>
<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">
<select name="fullName" th:field="*{fullName}" class="form-control"></select>
<input name="fullName" th:field="*{fullName}" class="form-control" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<select id="bxjl_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>
@ -71,7 +73,7 @@
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
@ -79,26 +81,26 @@
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" class="form-control" type="text" disabled>
</div>
</div>
</div>
@ -114,30 +116,31 @@
</div>
</form>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择报销分类信息</span>-->
<!-- <a class="btn btn-success" onclick="insertRow()">-->
<!-- <i class="fa fa-plus"></i> 添加报销-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-expense-bxzg"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报销分类信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加报销
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense-bxzg"></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}]];
$("#form-baseExpense-bxzg").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-bxzg',
@ -176,35 +179,113 @@
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',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> ');
return actions.join('');
}
}
],
};
$.table.init(options);
});
// 列中获取成本类型的下拉改变数据
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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxzg_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#bxzg_expenseMethodModal").show();
} else {
$("#bxzg_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-bxzg').serialize());
}
}
// function getSelections(){
// $.ajax({
// url: ctx + "system/requisitioning/getEmpUserName",
// type: "get",
// dataType: "json",
// success: function (data) {
// $("select[name='deptName']").append($('<option></option>').val(data.deptName).html(data.deptName));
// $("select[name='evectionBy']").append($('<option></option>').val(data.userName).html(data.userName));
// $("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
// }
// });
//
// }
</script>
</body>
</html>

278
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html

@ -1,39 +1,285 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('财务报销审核')" />
<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-expense-cw-audit" th:object="${formData}">
<form class="form-horizontal m" id="form-baseExpense-cw" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" 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" readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptName" th:field="*{deptName}" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位:</label>
<div class="col-sm-8">
<select name="postName" th:field="*{postName}" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="fullName" th:field="*{fullName}" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="cw_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div id="cw_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="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="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="cwVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_cwVerifyApproved" id="cwVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</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-cw"></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/requisitioning";
$("#form-expense-cw-audit").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-expense-cw-audit').serialize());
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
$("#form-baseExpense-cw").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-cw',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
},
pagination: false,
sidePagination: "client",
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',editable:{type:'text',mode:'inline'}},
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}},
{title: '报销时间',field: 'expenseTime',editable:{type:'date',mode:'inline',}},
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',editable: {type:'text',mode:'inline',}},
{title: '委外单号',field: 'outsourceCode',editable: {type:'text',mode:'inline',}},
],
};
$.table.init(options);
});
// 列中获取成本类型的下拉改变数据
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 getSelections(){
// 自定义供应商名称列的格式化函数
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/requisitioning/getEmpUserName",
type: "get",
dataType: "json",
success: function (data) {
$("select[name='deptName']").append($('<option></option>').val(data.deptName).html(data.deptName));
$("select[name='evectionBy']").append($('<option></option>').val(data.userName).html(data.userName));
$("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#cw_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#cw_expenseMethodModal").show();
} else {
$("#cw_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-cw').serialize());
}
}
</script>
</body>

196
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html

@ -3,17 +3,18 @@
<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-fzjl" 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="saveEntity" value="true" />
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
@ -35,43 +36,39 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptName" th:field="*{deptName}" class="form-control"></select>
<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">
<select name="postName" th:field="*{postName}" class="form-control"></select>
<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">
<select name="fullName" th:field="*{fullName}" class="form-control"></select>
<input name="fullName" th:field="*{fullName}" class="form-control" disabled/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<select id="fzjl_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="bxjl_expenseMethodModal" class="container" style="display: none">
<div id="fzjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
@ -79,26 +76,26 @@
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div>
</div>
</div>
@ -111,30 +108,35 @@
<option value="false">拒绝</option>
</select>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
</div>
</form>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择报销分类信息</span>-->
<!-- <a class="btn btn-success" onclick="insertRow()">-->
<!-- <i class="fa fa-plus"></i> 添加报销-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-expense-fzjl"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<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-fzjl"></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}]];
$("#form-baseExpense-fzjl").validate({focusCleanup: true});
@ -142,11 +144,7 @@
var options = {
id:'bootstrap-sub-table-expense-fzjl',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
},
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};},
pagination: false,
sidePagination: "client",
model: "报销单数据",
@ -174,37 +172,117 @@
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}},
{title: '报销时间',field: 'expenseTime',editable:{type:'date',mode:'inline',}},
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',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> ');
return actions.join('');
}
}
],
};
$.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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#fzjl_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#fzjl_expenseMethodModal").show();
} else {
$("#fzjl_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-fzjl').serialize());
}
}
// function getSelections(){
// $.ajax({
// url: ctx + "system/requisitioning/getEmpUserName",
// type: "get",
// dataType: "json",
// success: function (data) {
// $("select[name='deptName']").append($('<option></option>').val(data.deptName).html(data.deptName));
// $("select[name='evectionBy']").append($('<option></option>').val(data.userName).html(data.userName));
// $("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
// }
// });
//
// }
</script>
</body>
</html>

319
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html

@ -1,27 +1,315 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改出差单')" />
<th:block th:include="include :: header('驳回调整')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-requisitioning-modifyApply" th:object="${formData}">
<form class="form-horizontal m" id="form-baseExpense-modify" 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="saveEntity" value="true" />
<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" 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>
</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-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="modify_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="modify_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label>
<div class="col-sm-8">
<select id="reApply" name="p_B_reApply" class="form-control m-b">
<option value="true">重新申请</option>
<option value="false">结束流程</option>
</select>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报销分类信息</span>
<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>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-export-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-modifyApply").validate({focusCleanup: true});
var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]];
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-requisitioning-modifyApply').serialize());
$("#form-baseExpense-modify").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-modify',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};},
pagination: false,
sidePagination: "client",
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',editable:{type:'text',mode:'inline'}},
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}},
{title: '报销时间',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> ');
return actions.join('');
}
}
],
};
$.table.init(options);
handleExpenseMethod(this);
});
function insertRow() {
$("bootstrap-sub-table-expense-modify").bootstrapTable('insertRow', {
index:0,
row: {
expenseChildId:'',
costType: "",
costSmallType:"",
purpose:'' ,
amounts: '',
expenseTime: '',
evectionCode:'' ,
purchaseCode:'',
outsourceCode: '',
}
})
}
function removeRow(id){
$table.bootstrapTable('remove', {field: 'id', values: id})
}
// 列中获取成本类型的下拉改变数据
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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#modify_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#modify_expenseMethodModal").show();
} else {
$("#modify_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-modify').serialize());
}
}
function getSelections(){
$.ajax({
url: ctx + "system/requisitioning/getEmpUserName",
@ -33,8 +321,25 @@
$("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
}
});
}
function removeRow(){
var ids = $.table.selectColumns("index");
if (ids.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$("#bootstrap-sub-table-expense").bootstrapTable('remove', {
field: 'index',
values: ids
})
}
$("input[name='expenseTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

204
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html

@ -3,11 +3,13 @@
<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-zozj" th:object="${formData}">
<form class="form-horizontal m" id="form-baseExpense-fzjl" 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">
@ -35,43 +37,39 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptName" th:field="*{deptName}" class="form-control"></select>
<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">
<select name="postName" th:field="*{postName}" class="form-control"></select>
<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">
<select name="fullName" th:field="*{fullName}" class="form-control"></select>
<input name="fullName" th:field="*{fullName}" class="form-control" disabled/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<select id="zozj_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="bxjl_expenseMethodModal" class="container" style="display: none">
<div id="zozj_expenseMethodModal" class="container" style="display: none">
<div class="form-group">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
@ -79,26 +77,26 @@
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div>
</div>
</div>
@ -111,30 +109,35 @@
<option value="false">拒绝</option>
</select>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
</div>
</form>
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择报销分类信息</span>-->
<!-- <a class="btn btn-success" onclick="insertRow()">-->
<!-- <i class="fa fa-plus"></i> 添加报销-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-expense-zozj"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<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-zozj"></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}]];
$("#form-baseExpense-zozj").validate({focusCleanup: true});
@ -142,11 +145,7 @@
var options = {
id:'bootstrap-sub-table-expense-zozj',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
},
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};},
pagination: false,
sidePagination: "client",
model: "报销单数据",
@ -170,41 +169,120 @@
return getCostSmallType(value,row,index)
}
},
{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: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}},
{title: '采购单号',field: 'purcahseCode',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> ');
return actions.join('');
}
}
{title: '用途',field: 'purpose',},
{title: '金额',field: 'amounts',},
{title: '报销时间',field: 'expenseTime',},
{title: '出差单号',field: 'evectionCode',},
{title: '采购单号',field: 'purchaseCode',},
{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});
}
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#zozj_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#zozj_expenseMethodModal").show();
} else {
$("#zozj_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
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-zozj').serialize());
}
}
// function getSelections(){
// $.ajax({
// url: ctx + "system/requisitioning/getEmpUserName",
// type: "get",
// dataType: "json",
// success: function (data) {
// $("select[name='deptName']").append($('<option></option>').val(data.deptName).html(data.deptName));
// $("select[name='evectionBy']").append($('<option></option>').val(data.userName).html(data.userName));
// $("select[name='postName']").append($('<option></option>').val(data.postName).html(data.postName));
// }
// });
//
// }
</script>
</body>
</html>
Loading…
Cancel
Save