diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java index f74dd565..2e2e9eb4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java +++ b/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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java index b6609c1d..9dfebe9d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java +++ b/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 list = (Page) baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount); Page 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 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 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 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 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); -// } +// insertBaseExpenseAccount(baseExpenseAccount); + if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){ + insertBaseExpenseAccount(baseExpenseAccount); + } // 启动流程 String applyTitle = user.getUserName()+"发起了报销单提交审批-"+DateUtils.dateTimeNow(); String instanceType = "submit"; diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml index 792f7899..31b0dc19 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml +++ b/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 expense_code, - cost_type, + cost_type, cost_small_type, purpose, amounts, diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml index 7ef6408d..f7e2c4bf 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml @@ -79,6 +79,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and b.apply_user = #{applyUser} and b.apply_time = #{applyTime} and b.expense_code like concat('%',#{keyword},'%') + and + or expense_code in ( + select expense_code + from ck_equipCodeChild + + and cost_type = #{params.costType} + and cost_small_type = #{params.costTypeName} + + ) + diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html index 8373baaf..8e922f57 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html @@ -54,14 +54,14 @@
  • -
  • -
  • @@ -94,7 +94,7 @@
    -
    +
    @@ -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: '申请人', + {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 '' + (value ? value : "-") + ''; + return '' + value + ''; } }, - {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 '' + value + ''; + 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', - formatter: function (value, row, index) { + {title: '财务审核状态',field: 'financeAuditStatus',align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(auditStatusData, value); + } + }, + {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(' 作废'); - // 编辑 actions.push(' 编辑 '); - // 已作废 - } - else{ - actions.push(' 编辑 '); } // 有流程实例id - if(row.useStatus=="2" && !row.restoreInstanceId){ - // 恢复 + if(row.useStatus=="2" ){ actions.push(' 恢复 '); } // 有流程实例id @@ -199,9 +199,7 @@ actions.push(' '+nodeName+' '); } } - // 审批历史 actions.push(' 审批历史 '); - // 进度查看 actions.push(' 进度查看 '); } // 详情 @@ -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 += ''; + }); + $("#costSmallType").append(selectHtml); + } + }); + } + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html index d503e886..9cdfbeb5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html @@ -10,62 +10,66 @@
    - +
    - +
    - +
    - +
    - +
    -
    - -
    - + -
    - -
    - +
    + +
    + +
    -
    - -
    - -
    - +
    + +
    + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    - -
    - +
    + +
    + +
    @@ -76,7 +80,7 @@
    -
    +
    @@ -85,6 +89,7 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html index f3f596b0..91b69204 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html @@ -3,6 +3,7 @@ +
    @@ -12,8 +13,7 @@ - - +
    @@ -32,7 +32,7 @@
    - +
    - - - - - - - - - - - - - - - +
    +
    +
    + 选择报销分类信息 +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html index 8204e04b..f19f1eca 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html @@ -3,6 +3,7 @@ +
    @@ -12,8 +13,7 @@ - - +
    @@ -32,7 +32,7 @@
    - +
    + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html index 2a15ee12..51ae21a8 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html @@ -1,39 +1,285 @@ - + +
    -
    + + + + + + + +
    + +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    + 选择报销分类信息 +
    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html index 908dc9d5..e8392fea 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html @@ -3,17 +3,18 @@ +
    + - - +
    @@ -35,43 +36,39 @@
    -
    - +
    - +
    - +
    -
    -
    - - - - - - - - - - - - - - - +
    +
    +
    + 选择报销分类信息 +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html index 6d2c95d5..51297e41 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html @@ -1,27 +1,315 @@ - + + +
    -
    + + + + + + + + +
    + +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    + 选择报销分类信息 + + 添加报销 + + + 删除报销 + +
    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html index fff2a53b..e4e04a17 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html @@ -3,11 +3,13 @@ +
    -
    + + @@ -35,43 +37,39 @@
    -
    - +
    - +
    - +
    -
    - - - - - - - - - - - - - - - - +
    +
    +
    + 选择报销分类信息 +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file