From a37c0b96641368ca6c681ead413b365d8c94ea6e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 16 Jul 2024 18:57:26 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=20?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AE=9A=E4=B9=89=E6=8A=A5=E9=94=80=E5=8D=95?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E6=A8=A1=E5=9E=8B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E9=94=80=E5=88=97=E8=A1=A8=E9=9B=86?= =?UTF-8?q?=E5=90=88=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8A=A5=E9=94=80=20buildAuthority=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=8A=A8=E6=80=81=E8=AF=86=E5=88=AB=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E4=BA=BA=E5=92=8C=E5=85=B6=E5=85=B3=E8=81=94=E8=A7=92?= =?UTF-8?q?=E8=89=B2=20=E8=A7=A3=E5=86=B3=E6=8A=A5=E9=94=80=E5=8D=95?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=80=E5=8D=95=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= =?UTF-8?q?,=E4=BF=AE=E6=94=B9=E9=83=A8=E9=97=A8=E3=80=81=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E3=80=81=E5=A7=93=E5=90=8D=E5=AD=97=E6=AE=B5=E5=8D=95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7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=AD=97=E6=AE=B5=20=E8=A7=A3=E5=86=B3=E6=8A=A5?= =?UTF-8?q?=E9=94=80=E6=80=BB=E7=BB=8F=E7=90=86=E5=AE=A1=E6=A0=B8=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=A7=93=E5=90=8D=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E5=8A=A0=E4=B8=8A=E5=AE=A1=E6=89=B9=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=8A=A0=E4=B8=8Aactivity=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E6=8A=A5=E9=94=80=E7=BB=8F=E7=90=86=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=AD=97=E6=AE=B5=20=E6=96=B0=E5=A2=9E=E5=89=AF?= =?UTF-8?q?=E6=80=BB=E7=BB=8F=E7=90=86=E5=AE=A1=E6=A0=B8=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseExpenseAccountController.java | 28 ++- .../system/domain/BaseExpenseAccount.java | 1 + .../impl/BaseExpenseAccountServiceImpl.java | 176 +++++++++++---- .../system/BaseExpenseAccountMapper.xml | 13 +- .../templates/system/baseExpense/add.html | 62 +++--- .../system/baseExpense/baseExpense.html | 69 +++++- .../system/baseExpense/taskFzjlVerify.html | 210 ++++++++++++++++++ .../system/baseExpense/taskZozjVerify.html | 208 +++++++++++++++-- .../system/baseExpense/taskbxjlVerify.html | 78 ++++--- .../system/baseExpense/taskbxzgVerify.html | 126 +++++++---- 10 files changed, 790 insertions(+), 181 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html 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 e6c67f41..f74dd565 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 @@ -5,6 +5,7 @@ import java.util.List; import com.alibaba.fastjson.JSON; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.remind.service.RemindService; @@ -119,15 +120,19 @@ public class BaseExpenseAccountController extends BaseController } /** - * 新增保存报销单 + * 新增保存报销单(暂时改成没有子表的方法) */ @RequiresPermissions("system:baseExpense:add") @Log(title = "报销单", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@RequestBody BaseExpenseAccount baseExpenseAccount) + public AjaxResult addSave(BaseExpenseAccount baseExpenseAccount) { - return toAjax(baseExpenseAccountService.insertBaseExpenseAccount(baseExpenseAccount)); + baseExpenseAccount.setCreateBy(ShiroUtils.getLoginName()); + baseExpenseAccount.setUseStatus("0"); + baseExpenseAccount.setAuditStatus("0"); + baseExpenseAccountService.submitApply(baseExpenseAccount); + return AjaxResult.success(); } /** @@ -182,9 +187,9 @@ public class BaseExpenseAccountController extends BaseController return prefix + "/task" + verifyName; } @ModelAttribute("/preloadObj") - public BaseExpenseAccountVo getObj(@RequestParam(value = "id", required = false) Long id, HttpSession session) { - if (id != null) { - return baseExpenseAccountService.selectBaseExpenseAccountById(id); + public BaseExpenseAccountVo getObj(@RequestParam(value = "expenseId", required = false) Long expenseId, HttpSession session) { + if (expenseId != null) { + return baseExpenseAccountService.selectBaseExpenseAccountById(expenseId); } return new BaseExpenseAccountVo(); } @@ -196,17 +201,18 @@ public class BaseExpenseAccountController extends BaseController @RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET}) @ResponseBody public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity, - @RequestParam(value = "customerQuoteChildList", required = false) String customerQuoteChildList, @ModelAttribute("preloadObj") BaseExpenseAccountVo baseExpenseAccountVo, HttpServletRequest request) { boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); - baseExpenseAccountVo.setExpenseAccountChildList(JSON.parseArray(customerQuoteChildList, BaseExpenseAccountChild.class)); + if (saveEntityBoolean){ + baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccountVo); + } String instanceId = baseExpenseAccountVo.getInstanceId(); String instanceType = baseExpenseAccountVo.getInstanceType(); boolean approvedFlag = processService.complete(taskId, instanceId, baseExpenseAccountVo.getApplyTitle(), - baseExpenseAccountVo.getSupplierCode(), - "customerQuote", new HashMap(), request); + baseExpenseAccountVo.getExpenseCode(), + "expense", new HashMap(), request); if(!approvedFlag){ // 审核状态-审核拒绝 baseExpenseAccountVo.setAuditStatus("2"); @@ -216,6 +222,8 @@ public class BaseExpenseAccountController extends BaseController if (processIsFinish) { // 审核通过 baseExpenseAccountVo.setAuditStatus("1"); + baseExpenseAccountVo.setFinanceAuditStatus("1"); + baseExpenseAccountVo.setManagerAuditStatus("1"); // 提交 if("submit".equals(instanceType)){ // 使用状态-是 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java index 375e5961..8e79c31c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java @@ -351,6 +351,7 @@ public class BaseExpenseAccount extends BaseEntity .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .append("useStatus", getUseStatus()) + .append("delFlag", getDelFlag()) .toString(); } } 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 baad2bbd..b6609c1d 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 @@ -5,10 +5,15 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.github.pagehelper.Page; +import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.PageDomain; +import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.BaseExpenseAccountChild; @@ -17,7 +22,9 @@ import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.IBaseExpenseAccountChildService; import com.ruoyi.system.service.ISysRoleService; import org.activiti.engine.TaskService; +import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.runtime.ProcessInstance; +import org.activiti.engine.task.Task; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,6 +33,7 @@ import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.service.IBaseExpenseAccountService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * 报销单Service业务层处理 @@ -81,7 +89,57 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService @Override public List selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount) { - return baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount); + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + //PageHelper 仅对第一List分页有效 + Page list = (Page) baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount); + Page returnList = new Page<>(); + for(BaseExpenseAccountVo baseExpenseAccountVo : list){ + SysUser sysUser = userMapper.selectUserByLoginName(baseExpenseAccountVo.getCreateBy()); + if (sysUser != null) { + baseExpenseAccountVo.setCreateBy(sysUser.getUserName()); + } + SysUser sysUser2 = userMapper.selectUserByLoginName(baseExpenseAccountVo.getApplyUser()); + if (sysUser2!=null){ + baseExpenseAccountVo.setApplyUserName(sysUser2.getUserName()); + } + String instanceId = baseExpenseAccountVo.getInstanceId(); + // 当前环节 + if (StringUtils.isNotBlank(instanceId)) { + List taskList = taskService.createTaskQuery() + .processInstanceId(instanceId) +// .singleResult(); + .list(); // 例如请假会签,会同时拥有多个任务 + if (!CollectionUtils.isEmpty(taskList)) { + TaskEntityImpl task = (TaskEntityImpl) taskList.get(0); + String taskId = task.getId(); + baseExpenseAccountVo.setTaskId(taskId); + // 设置待办用户 + List todoUserList = todoItemMapper.selectUndealTodoUserList(taskId); + if(!CollectionUtils.isEmpty(taskList)){ + baseExpenseAccountVo.setTodoUserId(String.join(",",todoUserList)); + } + if (task.getSuspensionState() == 2) { + baseExpenseAccountVo.setTaskName("已挂起"); + baseExpenseAccountVo.setSuspendState("2"); + } else { + baseExpenseAccountVo.setTaskName(task.getName()); + baseExpenseAccountVo.setSuspendState("1"); + } + } else { + // 已办结或者已撤销 + baseExpenseAccountVo.setTaskName("已结束"); + } + } else { + baseExpenseAccountVo.setTaskName("未启动"); + } + returnList.add(baseExpenseAccountVo); + } + returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); + returnList.setPageNum(pageNum); + returnList.setPageSize(pageSize); + return returnList; } /** @@ -99,21 +157,22 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService baseExpenseAccount.setAuditStatus("0"); baseExpenseAccount.setUseStatus("0"); baseExpenseAccount.setDelFlag("0"); - 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()); - } - } + 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()); +// } +// } return baseExpenseAccountMapper.insertBaseExpenseAccount(baseExpenseAccount); } /** - * 修改报销单 + * 修改报销单 (暂时去掉子表数据,后续添加) * * @param baseExpenseAccount 报销单 * @return 结果 @@ -125,18 +184,18 @@ 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(); +// 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()); +// } +// } return baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount); } @@ -255,9 +314,11 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService SysUser user = ShiroUtils.getSysUser(); baseExpenseAccount.setApplyUser(user.getLoginName()); baseExpenseAccount.setApplyTime(DateUtils.getNowDate()); - 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"; @@ -272,6 +333,12 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService baseExpenseAccount.setAuditStatus("1"); // 使用状态-是 baseExpenseAccount.setUseStatus("1"); + + //设置总经理审核状态 + baseExpenseAccount.setManagerAuditStatus("1"); + //设置财务审核状态 + baseExpenseAccount.setFinanceAuditStatus("1"); + } baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount); return processInstance; @@ -279,9 +346,9 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService private ProcessInstance startProcessInstance(String applyTitle, String instanceType, BaseExpenseAccount baseExpenseAccount, SysUser user) { - Long customerId = baseExpenseAccount.getExpenseId(); - String businessKey = customerId.toString(); // 实体类 ID,作为流程的业务 key - String key = "customer"; + Long expenseId = baseExpenseAccount.getExpenseId(); + String businessKey = expenseId.toString(); // 实体类 ID,作为流程的业务 key + String key = "expense"; Map variables = new HashMap<>(); // 构造authority传参 buildAuthority(user, variables); @@ -297,15 +364,48 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService private void buildAuthority(SysUser user, Map variables) { Set roleKeys = roleService.selectRoleKeys(user.getUserId()); - // 角色不同审核人不同 - if(roleKeys.contains("zozjRole") || roleKeys.contains("zjlRole") || roleKeys.contains("admin")){ - variables.put("authority",4); - }else if(roleKeys.contains("ywzgRole")){ - variables.put("authority",3); - }else if(roleKeys.contains("ywjlRole")){ + + variables.put("authority",1); + //判断请购人的角色,进入相应的逻辑,设置节点审批人变量 + if(roleKeys.contains("ywyRole") || roleKeys.contains("ywjlRole") || roleKeys.contains("ywzgRole")){ + // 业务经理 + variables.put("bxjlRole","ywjlRole"); + // 业务主管 + variables.put("bxzgRole","ywzgRole"); + }else if(roleKeys.contains("cgyRole") || roleKeys.contains("cgjlRole") || roleKeys.contains("cgzgRole")){ + // 采购经理 + variables.put("bxjlRole","cgjlRole"); + // 采购主管 + variables.put("bxzgRole","cgzgRole"); + }else if (roleKeys.contains("gcwyRole") || roleKeys.contains("gcjlRole") || roleKeys.contains("gczgRole")){ + // 工程经理 + variables.put("bxjlRole","gcjlRole"); + // 工程主管 + variables.put("bxzgRole","gczgRole"); + } else if (roleKeys.contains("scyRole") || roleKeys.contains("scjlRole") || roleKeys.contains("sczgRole")){ + // 生产经理 + variables.put("bxjlRole","scjlRoe"); + // 生产主管 + variables.put("bxzgRole","sczgRole"); + }else if (roleKeys.contains("shgcsRole") || roleKeys.contains("shjlRole") || roleKeys.contains("shzgRole")){ + // 售后经理 + variables.put("bxjlRole","shjlRole"); + // 售后主管 + variables.put("bxzgRole","shzgRole"); + }else if(roleKeys.contains("cgyyRole") || roleKeys.contains("ckzgRole")){ + variables.put("bxjlRole","shzgRole"); + // 售后主管 + variables.put("bxzgRole","shzgRole"); + }else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")){ + variables.put("bxjlRole","cwjlRole"); + // 售后主管 + variables.put("bxzgRole","cwJlRole"); + }else{ + variables.put("authority",2); + } + if(roleKeys.contains("admin")){ + // 角色包含业务经理、采购经理、工程经理、生产经理 variables.put("authority",2); - }else if(roleKeys.contains("ywyRole")){ - variables.put("authority",1); } } @Override diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml index 151f3427..7ef6408d 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml @@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -35,6 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -42,14 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" expense_code, deptName, postName, fullName, expense_method, is_purchase_outsource, supplier_code, corporate_payee, corporate_receiving_account, public_account_banks, apply_user, create_by, create_time, update_by, update_time, remark, use_status,del_flag, - instance_id, instance_type, instance_type_name, submit_instance_id, cancel_instance_id, restore_instance_id, + instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from base_expense_account + + + + + + +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + \ 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 b495d3d5..f3f596b0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxjlVerify.html @@ -1,13 +1,13 @@ - +
-
- + + @@ -56,7 +56,7 @@
- +
@@ -102,29 +102,41 @@
- -
-
-
- 选择报销分类信息 - - 添加报销 - -
-
-
-
-
+
+ +
+
-
+ + + + + + + + + + + + + + + + +
+ \ 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 b0069de7..8204e04b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxzgVerify.html @@ -1,13 +1,13 @@ - +
-
- + + @@ -36,9 +36,9 @@
@@ -56,41 +56,91 @@
- +
- -
- + +
+
- -
-
-
- 选择报价信息 - - 添加物料 - + -
-
-
+
+ +
+
-
+ + + + + + + + + + + + + + + + +
+ \ No newline at end of file