Browse Source

修改;报销单新增instance_Id字段,重新编写查询方法。新增批量删除报销单分类报销子表删除方法,废弃方法,新增报销审核页面,新增报销根据下拉填写供应商信息。

dev
zhangsiqi 4 months ago
parent
commit
6b5d92fec3
  1. 123
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  2. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java
  3. 24
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccountChild.java
  4. 125
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseExpenseAccountVo.java
  5. 34
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountChildMapper.java
  6. 37
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java
  7. 36
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountChildService.java
  8. 15
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountService.java
  9. 20
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountChildServiceImpl.java
  10. 183
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java
  11. 71
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml
  12. 113
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  13. 104
      ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html
  14. 1
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  15. 4
      ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html
  16. 126
      ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html
  17. 40
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html
  18. 40
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html
  19. 40
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html
  20. 198
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxjlVerify.html
  21. 160
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxzgVerify.html

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

@ -1,6 +1,23 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.remind.service.RemindService;
import com.ruoyi.system.domain.BaseExpenseAccountChild;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
import com.ruoyi.system.mapper.BaseExpenseAccountChildMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.*;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -9,12 +26,14 @@ import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.domain.BaseExpenseAccount;
import com.ruoyi.system.service.IBaseExpenseAccountService;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/** /**
* 报销单Controller * 报销单Controller
* *
@ -30,6 +49,32 @@ public class BaseExpenseAccountController extends BaseController
@Autowired @Autowired
private IBaseExpenseAccountService baseExpenseAccountService; private IBaseExpenseAccountService baseExpenseAccountService;
@Autowired
private RedisCache redisCache;
@Autowired
private IBaseExpenseAccountChildService baseExpenseAccountChildService;
@Autowired
private ISysDictTypeService sysDictTypeService;
@Autowired
private RemindService remindService;
@Autowired
private ISysRoleService roleService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IProcessService processService;
@Autowired
@RequiresPermissions("system:baseExpense:view") @RequiresPermissions("system:baseExpense:view")
@GetMapping() @GetMapping()
public String baseExpense() public String baseExpense()
@ -43,10 +88,10 @@ public class BaseExpenseAccountController extends BaseController
@RequiresPermissions("system:baseExpense:list") @RequiresPermissions("system:baseExpense:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(BaseExpenseAccount baseExpenseAccount) public TableDataInfo list(BaseExpenseAccountVo baseExpenseAccount)
{ {
startPage(); startPage();
List<BaseExpenseAccount> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount); List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
return getDataTable(list); return getDataTable(list);
} }
@ -59,8 +104,8 @@ public class BaseExpenseAccountController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult export(BaseExpenseAccount baseExpenseAccount) public AjaxResult export(BaseExpenseAccount baseExpenseAccount)
{ {
List<BaseExpenseAccount> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount); List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
ExcelUtil<BaseExpenseAccount> util = new ExcelUtil<BaseExpenseAccount>(BaseExpenseAccount.class); ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class);
return util.exportExcel(list, "报销单数据"); return util.exportExcel(list, "报销单数据");
} }
@ -125,7 +170,75 @@ public class BaseExpenseAccountController extends BaseController
{ {
return toAjax(baseExpenseAccountService.deleteBaseExpenseAccountByIds(ids)); return toAjax(baseExpenseAccountService.deleteBaseExpenseAccountByIds(ids));
} }
@GetMapping("/showVerifyDialog/{taskId}")
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
BaseExpenseAccountVo baseExpenseAccountVo = baseExpenseAccountService.selectBaseExpenseAccountById(new Long(processInstance.getBusinessKey()));
mmap.put("formData", baseExpenseAccountVo);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
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);
}
return new BaseExpenseAccountVo();
}
/**
* 完成任务
*
* @return
*/
@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));
String instanceId = baseExpenseAccountVo.getInstanceId();
String instanceType = baseExpenseAccountVo.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, baseExpenseAccountVo.getApplyTitle(),
baseExpenseAccountVo.getSupplierCode(),
"customerQuote", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
baseExpenseAccountVo.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态 方法中传入的值为原来的instanceId,只是做了调整
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
baseExpenseAccountVo.setAuditStatus("1");
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
baseExpenseAccountVo.setUseStatus("1");
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
baseExpenseAccountVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
baseExpenseAccountVo.setUseStatus("1");
}
}
baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccountVo);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccountVo);
}
return success("任务已完成");
}
/** /**
* 作废报销单 * 作废报销单
*/ */

14
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java

@ -50,8 +50,8 @@ public class BaseExpenseAccount extends BaseEntity
@Excel(name = "姓名") @Excel(name = "姓名")
private String fullName; private String fullName;
/** 报销方式 */ /** 报销方式 个人报销 0,公转报销 1 */
@Excel(name = "报销方式") @Excel(name = "报销方式 个人报销 0,公转报销 1" )
private String expenseMethod; private String expenseMethod;
/** 是否是委外/采购采销 */ /** 是否是委外/采购采销 */
@ -82,7 +82,7 @@ public class BaseExpenseAccount extends BaseEntity
@Excel(name = "使用状态") @Excel(name = "使用状态")
private String useStatus; private String useStatus;
private String del_flag; private String delFlag;
/** 流程实例ID */ /** 流程实例ID */
private String instanceId; private String instanceId;
@ -174,12 +174,12 @@ public class BaseExpenseAccount extends BaseEntity
this.expenseAccountChildList = expenseAccountChildList; this.expenseAccountChildList = expenseAccountChildList;
} }
public String getDel_flag() { public String getDelFlag() {
return del_flag; return delFlag;
} }
public void setDel_flag(String del_flag) { public void setDelFlag(String delFlag) {
this.del_flag = del_flag; this.delFlag = delFlag;
} }
public void setExpenseId(Long expenseId) public void setExpenseId(Long expenseId)

24
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccountChild.java

@ -22,7 +22,7 @@ public class BaseExpenseAccountChild extends BaseEntity
/** 关联报销单号 */ /** 关联报销单号 */
@Excel(name = "关联报销单号") @Excel(name = "关联报销单号")
private String quoteId; private String expenseCode;
/** 成本类型 */ /** 成本类型 */
@Excel(name = "成本类型") @Excel(name = "成本类型")
@ -51,7 +51,7 @@ public class BaseExpenseAccountChild extends BaseEntity
/** 采购单号 */ /** 采购单号 */
@Excel(name = "采购单号") @Excel(name = "采购单号")
private String purcahseCode; private String purchaseCode;
/** 委外单号 */ /** 委外单号 */
@Excel(name = "委外单号") @Excel(name = "委外单号")
@ -69,14 +69,14 @@ public class BaseExpenseAccountChild extends BaseEntity
{ {
return expenseChildId; return expenseChildId;
} }
public void setQuoteId(String quoteId) public void setExpenseCode(String expenseCode)
{ {
this.quoteId = quoteId; this.expenseCode = expenseCode;
} }
public String getQuoteId() public String getExpenseCode()
{ {
return quoteId; return expenseCode;
} }
public void setCostType(String costType) public void setCostType(String costType)
{ {
@ -132,14 +132,14 @@ public class BaseExpenseAccountChild extends BaseEntity
{ {
return evectionCode; return evectionCode;
} }
public void setPurcahseCode(String purcahseCode) public void setPurchaseCode(String purchaseCode)
{ {
this.purcahseCode = purcahseCode; this.purchaseCode = purchaseCode;
} }
public String getPurcahseCode() public String getPurchaseCode()
{ {
return purcahseCode; return purchaseCode;
} }
public void setOutsourceCode(String outsourceCode) public void setOutsourceCode(String outsourceCode)
{ {
@ -164,14 +164,14 @@ public class BaseExpenseAccountChild extends BaseEntity
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("expenseChildId", getExpenseChildId()) .append("expenseChildId", getExpenseChildId())
.append("quoteId", getQuoteId()) .append("expenseCode", getExpenseCode())
.append("cost type", getCostType()) .append("cost type", getCostType())
.append("costSmallType", getCostSmallType()) .append("costSmallType", getCostSmallType())
.append("purpose", getPurpose()) .append("purpose", getPurpose())
.append("amounts", getAmounts()) .append("amounts", getAmounts())
.append("expenseTime", getExpenseTime()) .append("expenseTime", getExpenseTime())
.append("evectionCode", getEvectionCode()) .append("evectionCode", getEvectionCode())
.append("purcahseCode", getPurcahseCode()) .append("purchaseCode", getPurchaseCode())
.append("outsourceCode", getOutsourceCode()) .append("outsourceCode", getOutsourceCode())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())

125
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseExpenseAccountVo.java

@ -0,0 +1,125 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.system.domain.BaseExpenseAccount;
import com.ruoyi.system.domain.BaseRequisitioningOrder;
import java.util.Date;
/**
*
* @Description 请购单信息Vo
*/
public class BaseExpenseAccountVo extends BaseExpenseAccount {
private static final long serialVersionUID = 1L;
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
public String getApplyUserName() {
return applyUserName;
}
public void setApplyUserName(String applyUserName) {
this.applyUserName = applyUserName;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public Date getDoneTime() {
return doneTime;
}
public void setDoneTime(Date doneTime) {
this.doneTime = doneTime;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
public String getSuspendState() {
return suspendState;
}
public void setSuspendState(String suspendState) {
this.suspendState = suspendState;
}
public String getTodoUserId() {
return todoUserId;
}
public void setTodoUserId(String todoUserId) {
this.todoUserId = todoUserId;
}
public String getInstanceTypeName() {
return instanceTypeName;
}
public void setInstanceTypeName(String instanceTypeName) {
this.instanceTypeName = instanceTypeName;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
@Override
public String toString() {
return "BaseExpenseAccountVo{" +
"applyUserName='" + applyUserName + '\'' +
", taskId='" + taskId + '\'' +
", taskName='" + taskName + '\'' +
", doneTime=" + doneTime +
", createUserName='" + createUserName + '\'' +
", suspendState='" + suspendState + '\'' +
", todoUserId='" + todoUserId + '\'' +
", instanceTypeName='" + instanceTypeName + '\'' +
", keyword='" + keyword + '\'' +
super.toString() +
"} " ;
}
}

34
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountChildMapper.java

@ -74,4 +74,38 @@ public interface BaseExpenseAccountChildMapper
* @return 结果 * @return 结果
*/ */
public int restoreBaseExpenseAccountChildById(Long expenseChildId); public int restoreBaseExpenseAccountChildById(Long expenseChildId);
/**
* 根据报销单号作废报销单分类子表数据化
*
* @param expenseCode 需要作废的数据ID
* @return 结果
*/
public int updateBaseExpenseAccountChildByExpenseCode(String expenseCode);
/**
* 根据报销单号批量作废报销单分类子表数据
*
* @param expenseCodes 需要作废的数据ID组
* @return 结果
*/
public int updateBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes);
/**
* 根据报销单号删除报销单分类子表数据化
*
* @param expenseCode 需要作废的数据ID
* @return 结果
*/
public int deleteBaseExpenseAccountChildByExpenseCode(String expenseCode);
/**
* 根据报销单号批量删除报销单分类子表数据
*
* @param expenseCodes 需要作废的数据ID组
* @return 结果
*/
public int deleteBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes);
} }

37
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.domain.BaseExpenseAccount;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
/** /**
* 报销单Mapper接口 * 报销单Mapper接口
@ -17,7 +18,7 @@ public interface BaseExpenseAccountMapper
* @param expenseId 报销单ID * @param expenseId 报销单ID
* @return 报销单 * @return 报销单
*/ */
public BaseExpenseAccount selectBaseExpenseAccountById(Long expenseId); public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId);
/** /**
* 查询报销单列表 * 查询报销单列表
@ -25,7 +26,7 @@ public interface BaseExpenseAccountMapper
* @param baseExpenseAccount 报销单 * @param baseExpenseAccount 报销单
* @return 报销单集合 * @return 报销单集合
*/ */
public List<BaseExpenseAccount> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount); public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
/** /**
* 新增报销单 * 新增报销单
@ -73,5 +74,35 @@ public interface BaseExpenseAccountMapper
* @param expenseId 报销单ID * @param expenseId 报销单ID
* @return 结果 * @return 结果
*/ */
public int restoreBaseExpenseAccountById(Long expenseId); public Integer restoreBaseExpenseAccountById(Long expenseId);
/**
* 根据报销单号批量作废
* @param expenseCodes
* @return
*/
public Integer updateExpenseAccountByExpenseCodes(String[] expenseCodes);
/**
* 根据报销单号作废
* @param expenseCode
* @return
*/
public Integer updateExpenseAccountByExpenseCode(String expenseCode);
/**
* 根据报销单号批量删除
* @param expenseCodes
* @return
*/
public Integer deleteBaseExpenseAccountByExpenseCodes(String[] expenseCodes);
/**
* 根据报销单号删除
* @param expenseCode
* @return
*/
public Integer deleteBaseExpenseAccountByExpenseCode(String expenseCode);
} }

36
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountChildService.java

@ -64,12 +64,40 @@ public interface IBaseExpenseAccountChildService
* @param expenseChildId 报销单分类子ID * @param expenseChildId 报销单分类子ID
* @return * @return
*/ */
int cancelBaseExpenseAccountChildById(Long expenseChildId); public int cancelBaseExpenseAccountChildById(Long expenseChildId);
/** /**
* 恢复报销单分类子 * 根据报销单号作废报销单分类子表数据化
* @param expenseChildId 报销单分类子ID *
* @return * @param expenseCode 需要作废的数据ID
* @return 结果
*/ */
public int updateBaseExpenseAccountChildByExpenseCode(String expenseCode);
/**
* 根据报销单号批量作废报销单分类子表数据
*
* @param expenseCodes 需要作废的数据ID组
* @return 结果
*/
public int updateBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes);
/**
* 根据报销单号删除报销单分类子表数据化
*
* @param expenseCode 需要作废的数据ID
* @return 结果
*/
public int deleteBaseExpenseAccountChildByExpenseCode(String expenseCode);
/**
* 根据报销单号批量删除报销单分类子表数据
*
* @param expenseCodes 需要作废的数据ID组
* @return 结果
*/
public int deleteBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes);
int restoreBaseExpenseAccountChildById(Long expenseChildId); int restoreBaseExpenseAccountChildById(Long expenseChildId);
} }

15
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountService.java

@ -2,6 +2,9 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.domain.BaseExpenseAccount;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 报销单Service接口 * 报销单Service接口
@ -17,7 +20,7 @@ public interface IBaseExpenseAccountService
* @param expenseId 报销单ID * @param expenseId 报销单ID
* @return 报销单 * @return 报销单
*/ */
public BaseExpenseAccount selectBaseExpenseAccountById(Long expenseId); public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId);
/** /**
* 查询报销单列表 * 查询报销单列表
@ -25,7 +28,7 @@ public interface IBaseExpenseAccountService
* @param baseExpenseAccount 报销单 * @param baseExpenseAccount 报销单
* @return 报销单集合 * @return 报销单集合
*/ */
public List<BaseExpenseAccount> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount); public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
/** /**
* 新增报销单 * 新增报销单
@ -74,5 +77,13 @@ public interface IBaseExpenseAccountService
int restoreBaseExpenseAccountById(Long expenseId); int restoreBaseExpenseAccountById(Long expenseId);
@Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelSysCustomerById(Long id);
@Transactional(rollbackFor = Exception.class)
public ProcessInstance restoreSysCustomerById(Long id);
public ProcessInstance submitApply(BaseExpenseAccount baseExpenseAccount);
public Object getId(); public Object getId();
} }

20
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountChildServiceImpl.java

@ -112,6 +112,26 @@ public class BaseExpenseAccountChildServiceImpl implements IBaseExpenseAccountCh
return baseExpenseAccountChildMapper.cancelBaseExpenseAccountChildById(expenseChildId); return baseExpenseAccountChildMapper.cancelBaseExpenseAccountChildById(expenseChildId);
} }
@Override
public int updateBaseExpenseAccountChildByExpenseCode(String expenseCode) {
return baseExpenseAccountChildMapper.updateBaseExpenseAccountChildByExpenseCode(expenseCode);
}
@Override
public int updateBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes) {
return baseExpenseAccountChildMapper.updateBaseExpenseAccountChildByExpenseCodes(expenseCodes);
}
@Override
public int deleteBaseExpenseAccountChildByExpenseCode(String expenseCode) {
return baseExpenseAccountChildMapper.deleteBaseExpenseAccountChildByExpenseCode(expenseCode);
}
@Override
public int deleteBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes) {
return baseExpenseAccountChildMapper.deleteBaseExpenseAccountChildByExpenseCodes(expenseCodes);
}
/** /**
* 恢复报销单分类子信息 * 恢复报销单分类子信息
* *

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

@ -1,16 +1,31 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.BaseExpenseAccountChild;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
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.runtime.ProcessInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseExpenseAccountMapper; import com.ruoyi.system.mapper.BaseExpenseAccountMapper;
import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.domain.BaseExpenseAccount;
import com.ruoyi.system.service.IBaseExpenseAccountService; import com.ruoyi.system.service.IBaseExpenseAccountService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 报销单Service业务层处理 * 报销单Service业务层处理
@ -27,6 +42,24 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired
private IBaseExpenseAccountChildService baseExpenseAccountChildService;
@Autowired
private SysUserMapper userMapper;
@Autowired
private TaskService taskService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private IProcessService processService;
@Autowired
private ISysRoleService roleService;
/** /**
* 查询报销单 * 查询报销单
* *
@ -34,7 +67,7 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
* @return 报销单 * @return 报销单
*/ */
@Override @Override
public BaseExpenseAccount selectBaseExpenseAccountById(Long expenseId) public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId)
{ {
return baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId); return baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId);
} }
@ -46,7 +79,7 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
* @return 报销单 * @return 报销单
*/ */
@Override @Override
public List<BaseExpenseAccount> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount) public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount)
{ {
return baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount); return baseExpenseAccountMapper.selectBaseExpenseAccountList(baseExpenseAccount);
} }
@ -63,6 +96,19 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
baseExpenseAccount.setCreateBy(loginName); baseExpenseAccount.setCreateBy(loginName);
baseExpenseAccount.setCreateTime(DateUtils.getNowDate()); baseExpenseAccount.setCreateTime(DateUtils.getNowDate());
baseExpenseAccount.setAuditStatus("0");
baseExpenseAccount.setUseStatus("0");
baseExpenseAccount.setDelFlag("0");
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());
}
}
return baseExpenseAccountMapper.insertBaseExpenseAccount(baseExpenseAccount); return baseExpenseAccountMapper.insertBaseExpenseAccount(baseExpenseAccount);
} }
@ -78,6 +124,19 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
baseExpenseAccount.setUpdateBy(loginName); baseExpenseAccount.setUpdateBy(loginName);
baseExpenseAccount.setUpdateTime(DateUtils.getNowDate()); 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());
}
}
return baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount); return baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount);
} }
@ -128,7 +187,127 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
{ {
return baseExpenseAccountMapper.restoreBaseExpenseAccountById(expenseId); return baseExpenseAccountMapper.restoreBaseExpenseAccountById(expenseId);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelSysCustomerById(Long id) {
BaseExpenseAccountVo baseExpenseAccountVo = baseExpenseAccountMapper.selectBaseExpenseAccountById(id);
// 审核状态-待审核
baseExpenseAccountVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了客户信息作废审批-"+ DateUtils.dateTimeNow();
String instanceType = "cancel";
BaseExpenseAccount baseExpenseAccount = new BaseExpenseAccount();
BeanUtils.copyProperties(baseExpenseAccountVo,baseExpenseAccount);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,baseExpenseAccount, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
baseExpenseAccount.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
baseExpenseAccount.setAuditStatus("1");
// 使用状态-已作废
baseExpenseAccount.setUseStatus("2");
}
baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount);
return processInstance;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance restoreSysCustomerById(Long id) {
BaseExpenseAccountVo baseExpenseAccountVo = baseExpenseAccountMapper.selectBaseExpenseAccountById(id);
// 审核状态-待审核
baseExpenseAccountVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了客户恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
BaseExpenseAccount baseExpenseAccount = new BaseExpenseAccount();
BeanUtils.copyProperties(baseExpenseAccountVo,baseExpenseAccount);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,baseExpenseAccount, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
baseExpenseAccount.setRestoreInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
baseExpenseAccount.setAuditStatus("1");
// 使用状态-是
baseExpenseAccount.setUseStatus("1");
}
baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount);
return processInstance;
}
/**
* 提交申请
* @param baseExpenseAccount
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance submitApply(BaseExpenseAccount baseExpenseAccount) {
SysUser user = ShiroUtils.getSysUser();
baseExpenseAccount.setApplyUser(user.getLoginName());
baseExpenseAccount.setApplyTime(DateUtils.getNowDate());
if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){
insertBaseExpenseAccount(baseExpenseAccount);
}
// 启动流程
String applyTitle = user.getUserName()+"发起了报销单提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,baseExpenseAccount, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
baseExpenseAccount.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
baseExpenseAccount.setAuditStatus("1");
// 使用状态-是
baseExpenseAccount.setUseStatus("1");
}
baseExpenseAccountMapper.updateBaseExpenseAccount(baseExpenseAccount);
return processInstance;
}
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, BaseExpenseAccount baseExpenseAccount, SysUser user) {
Long customerId = baseExpenseAccount.getExpenseId();
String businessKey = customerId.toString(); // 实体类 ID,作为流程的业务 key
String key = "customer";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
baseExpenseAccount.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle,
baseExpenseAccount.getExpenseCode(), key, variables);
String processInstanceId = processInstance.getId();
baseExpenseAccount.setInstanceId(processInstanceId); // 建立双向关系
baseExpenseAccount.setInstanceType(instanceType);
return processInstance;
}
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> 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",2);
}else if(roleKeys.contains("ywyRole")){
variables.put("authority",1);
}
}
@Override @Override
public Object getId() { public Object getId() {
return redisCache.generateBillNo("BX"); return redisCache.generateBillNo("BX");

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

@ -5,27 +5,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.BaseExpenseAccountChildMapper"> <mapper namespace="com.ruoyi.system.mapper.BaseExpenseAccountChildMapper">
<resultMap type="BaseExpenseAccountChild" id="BaseExpenseAccountChildResult"> <resultMap type="BaseExpenseAccountChild" id="BaseExpenseAccountChildResult">
<result property="expenseChildId" column="expense_child_id" /> <result property="expenseChildId" column="expense_child_id" />
<result property="quoteId" column="quote_id" /> <result property="expenseCode" column="expense_code" />
<result property="costType" column="cost_type" /> <result property="costType" column="cost_type" />
<result property="costSmallType" column="cost_small_type" /> <result property="costSmallType" column="cost_small_type" />
<result property="purpose" column="purpose" /> <result property="purpose" column="purpose" />
<result property="amounts" column="amounts" /> <result property="amounts" column="amounts" />
<result property="expenseTime" column="expense_time" /> <result property="expenseTime" column="expense_time" />
<result property="evectionCode" column="evection_code" /> <result property="evectionCode" column="evection_code" />
<result property="purcahseCode" column="purcahse_code" /> <result property="purchaseCode" column="purchase_code" />
<result property="outsourceCode" column="outsource_code" /> <result property="outsourceCode" column="outsource_code" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
</resultMap> </resultMap>
<sql id="selectBaseExpenseAccountChildVo"> <sql id="selectBaseExpenseAccountChildVo">
select expense_child_id, quote_id, cost_type, cost_small_type, select expense_child_id, expense_code, cost_type, cost_small_type,
purpose, amounts, expense_time, evection_code, purcahse_code, purpose, amounts, expense_time, evection_code, purchase_code,
outsource_code, create_time, create_by, update_by, update_time, outsource_code, create_time, create_by, update_by, update_time,
del_flag, remark del_flag, remark
from base_expense_account_child from base_expense_account_child
@ -34,14 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseExpenseAccountChildList" parameterType="BaseExpenseAccountChild" resultMap="BaseExpenseAccountChildResult"> <select id="selectBaseExpenseAccountChildList" parameterType="BaseExpenseAccountChild" resultMap="BaseExpenseAccountChildResult">
<include refid="selectBaseExpenseAccountChildVo"/> <include refid="selectBaseExpenseAccountChildVo"/>
<where> <where>
<if test="quoteId != null and quoteId != ''"> and quote_id = #{quoteId}</if> <if test="expenseCode != null and expenseCode != ''"> and expense_code = #{expenseCode}</if>
<if test="costType != null and costType != ''"> and cost_type = #{costType}</if> <if test="costType != null and costType != ''"> and cost_type = #{costType}</if>
<if test="costSmallType != null and costSmallType != ''"> and cost_small_type = #{costSmallType}</if> <if test="costSmallType != null and costSmallType != ''"> and cost_small_type = #{costSmallType}</if>
<if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if> <if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
<if test="amounts != null and amounts != ''"> and amounts = #{amounts}</if> <if test="amounts != null and amounts != ''"> and amounts = #{amounts}</if>
<if test="expenseTime != null "> and expense_time = #{expenseTime}</if> <if test="expenseTime != null "> and expense_time = #{expenseTime}</if>
<if test="evectionCode != null and evectionCode != ''"> and evection_code = #{evectionCode}</if> <if test="evectionCode != null and evectionCode != ''"> and evection_code = #{evectionCode}</if>
<if test="purcahseCode != null and purcahseCode != ''"> and purcahse_code = #{purcahseCode}</if> <if test="purchaseCode != null and purchaseCode != ''"> and purchase_code = #{purchaseCode}</if>
<if test="outsourceCode != null and outsourceCode != ''"> and outsource_code = #{outsourceCode}</if> <if test="outsourceCode != null and outsourceCode != ''"> and outsource_code = #{outsourceCode}</if>
</where> </where>
</select> </select>
@ -54,14 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild" useGeneratedKeys="true" keyProperty="expenseChildId"> <insert id="insertBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild" useGeneratedKeys="true" keyProperty="expenseChildId">
insert into base_expense_account_child insert into base_expense_account_child
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="quoteId != null">quote_id,</if> <if test="expenseCode != null">expense_code,</if>
<if test="cost_type != null">cost_type,</if> <if test="cost_type != null">cost_type,</if>
<if test="costSmallType != null">cost_small_type,</if> <if test="costSmallType != null">cost_small_type,</if>
<if test="purpose != null">purpose,</if> <if test="purpose != null">purpose,</if>
<if test="amounts != null">amounts,</if> <if test="amounts != null">amounts,</if>
<if test="expenseTime != null">expense_time,</if> <if test="expenseTime != null">expense_time,</if>
<if test="evectionCode != null">evection_code,</if> <if test="evectionCode != null">evection_code,</if>
<if test="purcahseCode != null">purcahse_code,</if> <if test="purchaseCode != null">purchase_code,</if>
<if test="outsourceCode != null">outsource_code,</if> <if test="outsourceCode != null">outsource_code,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
@ -71,14 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="quoteId != null">#{quoteId},</if> <if test="expenseCode != null">#{expenseCode},</if>
<if test="costType != null">#{costType},</if> <if test="costType != null">#{costType},</if>
<if test="costSmallType != null">#{costSmallType},</if> <if test="costSmallType != null">#{costSmallType},</if>
<if test="purpose != null">#{purpose},</if> <if test="purpose != null">#{purpose},</if>
<if test="amounts != null">#{amounts},</if> <if test="amounts != null">#{amounts},</if>
<if test="expenseTime != null">#{expenseTime},</if> <if test="expenseTime != null">#{expenseTime},</if>
<if test="evectionCode != null">#{evectionCode},</if> <if test="evectionCode != null">#{evectionCode},</if>
<if test="purcahseCode != null">#{purcahseCode},</if> <if test="purchaseCode != null">#{purchaseCode},</if>
<if test="outsourceCode != null">#{outsourceCode},</if> <if test="outsourceCode != null">#{outsourceCode},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
@ -92,14 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild"> <update id="updateBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild">
update base_expense_account_child update base_expense_account_child
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="quoteId != null">quote_id = #{quoteId},</if> <if test="expenseCode != null">expense_code = #{expenseCode},</if>
<if test="costType != null">cost_type = #{costType},</if> <if test="costType != null">cost_type = #{costType},</if>
<if test="costSmallType != null">cost_small_type = #{costSmallType},</if> <if test="costSmallType != null">cost_small_type = #{costSmallType},</if>
<if test="purpose != null">purpose = #{purpose},</if> <if test="purpose != null">purpose = #{purpose},</if>
<if test="amounts != null">amounts = #{amounts},</if> <if test="amounts != null">amounts = #{amounts},</if>
<if test="expenseTime != null">expense_time = #{expenseTime},</if> <if test="expenseTime != null">expense_time = #{expenseTime},</if>
<if test="evectionCode != null">evection_code = #{evectionCode},</if> <if test="evectionCode != null">evection_code = #{evectionCode},</if>
<if test="purcahseCode != null">purcahse_code = #{purcahseCode},</if> <if test="purchaseCode != null">purchase_code = #{purchaseCode},</if>
<if test="outsourceCode != null">outsource_code = #{outsourceCode},</if> <if test="outsourceCode != null">outsource_code = #{outsourceCode},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
@ -121,7 +121,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{expenseChildId} #{expenseChildId}
</foreach> </foreach>
</delete> </delete>
<update id="cancelBaseExpenseAccountChildById" parameterType="Long"> <update id="cancelBaseExpenseAccountChildById" parameterType="Long">
update base_expense_account_child set del_flag = '1' where expense_child_id = #{expenseChildId} update base_expense_account_child set del_flag = '1' where expense_child_id = #{expenseChildId}
</update> </update>
@ -130,4 +129,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update base_expense_account_child set del_flag = '0' where expense_child_id = #{expenseChildId} update base_expense_account_child set del_flag = '0' where expense_child_id = #{expenseChildId}
</update> </update>
<delete id="deleteBaseExpenseAccountChildByExpenseCode" parameterType="String">
delete from base_expense_account_child where expense_code = #{expenseCode}
</delete>
<delete id="deleteBaseExpenseAccountChildByExpenseCodes" parameterType="String">
delete from base_expense_account_child where expense_code in
<foreach item="expenseCode" collection="array" open="(" separator="," close=")">
#{expenseCode}
</foreach>
</delete>
<update id="updateBaseExpenseAccountChildByExpenseCodes" parameterType="String">
update base_expense_account_child set del_flag = '1' where expense_code in
<foreach item="expenseCode" collection="array" open="(" separator="," close=")">
#{expenseCode}
</foreach>
</update>
<update id="updateBaseExpenseAccountChildByExpenseCode" parameterType="String">
update base_expense_account_child set del_flag = '1' where expense_code = #{expenseCode}
</update>
</mapper> </mapper>

113
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"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseExpenseAccountMapper"> <mapper namespace="com.ruoyi.system.mapper.BaseExpenseAccountMapper">
<resultMap type="BaseExpenseAccount" id="BaseExpenseAccountResult"> <resultMap type="BaseExpenseAccountVo" id="BaseExpenseAccountResult">
<result property="expenseId" column="expense_id" /> <result property="expenseId" column="expense_id" />
<result property="auditStatus" column="audit_status" /> <result property="auditStatus" column="audit_status" />
<result property="managerAuditStatus" column="manager_audit_status" /> <result property="managerAuditStatus" column="manager_audit_status" />
@ -26,26 +26,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="useStatus" column="use_status" /> <result property="useStatus" column="use_status" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
</resultMap> </resultMap>
<sql id="selectBaseExpenseAccountVo"> <sql id="selectBaseExpenseAccountVo">
select expense_id, audit_status, manager_audit_status, finance_audit_status, select expense_id, audit_status, manager_audit_status, finance_audit_status,
expense_code, deptName, postName, fullName, expense_method, is_purchase_outsource, expense_code, deptName, postName, fullName, expense_method, is_purchase_outsource,
supplier_code, corporate_payee, corporate_receiving_account, public_account_banks, 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 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,
apply_title, apply_user, apply_time
from base_expense_account from base_expense_account
</sql> </sql>
<select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccount" resultMap="BaseExpenseAccountResult"> <select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccount" resultMap="BaseExpenseAccountResult">
<include refid="selectBaseExpenseAccountVo"/> select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status,
b.expense_code, d.dept_name, e.post_name, f.full_name, b.expense_method, b.is_purchase_outsource,
b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks,
b.apply_user, b.create_by, b.create_time, b.update_by, b.update_time, b.remark, b.use_status,b.del_flag,
b.instance_id, b.instance_type, p.dict_value as instance_type_name, b.submit_instance_id, b.cancel_instance_id, b.restore_instance_id,
b.apply_title, b.apply_user, b.apply_time
from base_expense_account as b
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
) as p
on b.instance_type = p.dict_value
<where> <where>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> <if test="auditStatus != null and auditStatus != ''"> and b.audit_status = #{auditStatus}</if>
<if test="managerAuditStatus != null and managerAuditStatus != ''"> and manager_audit_status = #{managerAuditStatus}</if> <if test="managerAuditStatus != null and managerAuditStatus != ''"> and b.manager_audit_status = #{managerAuditStatus}</if>
<if test="financeAuditStatus != null and financeAuditStatus != ''"> and finance_audit_status = #{financeAuditStatus}</if> <if test="financeAuditStatus != null and financeAuditStatus != ''"> and b.finance_audit_status = #{financeAuditStatus}</if>
<if test="expenseCode != null and expenseCode != ''"> and expense_code = #{expenseCode}</if> <if test="expenseCode != null and expenseCode != ''"> and b.expense_code = #{expenseCode}</if>
<if test="expenseMethod != null and expenseMethod != ''"> and expense_method = #{expenseMethod}</if> <if test="expenseMethod != null and expenseMethod != ''"> and b.expense_method = #{expenseMethod}</if>
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if> <if test="useStatus != null and useStatus != ''"> and b.use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and b.audit_status = #{auditStatus}</if>
<if test="instanceId != null and instanceId != ''"> and b.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and b.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and b.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and b.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and b.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and b.apply_title = #{applyTitle}</if>
<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>
</where> </where>
</select> </select>
@ -70,13 +101,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="corporatePayee != null">corporate_payee,</if> <if test="corporatePayee != null">corporate_payee,</if>
<if test="corporateReceivingAccount != null">corporate_receiving_account,</if> <if test="corporateReceivingAccount != null">corporate_receiving_account,</if>
<if test="publicAccountBanks != null">public_account_banks,</if> <if test="publicAccountBanks != null">public_account_banks,</if>
<if test="applyUser != null">apply_user,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="useStatus != null">use_status,</if> <if test="useStatus != null">use_status,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="auditStatus != null">#{auditStatus},</if> <if test="auditStatus != null">#{auditStatus},</if>
@ -92,13 +130,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="corporatePayee != null">#{corporatePayee},</if> <if test="corporatePayee != null">#{corporatePayee},</if>
<if test="corporateReceivingAccount != null">#{corporateReceivingAccount},</if> <if test="corporateReceivingAccount != null">#{corporateReceivingAccount},</if>
<if test="publicAccountBanks != null">#{publicAccountBanks},</if> <if test="publicAccountBanks != null">#{publicAccountBanks},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="useStatus != null">#{useStatus},</if> <if test="useStatus != null">#{useStatus},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="delFlag != null">#{del_flag},</if>
</trim> </trim>
</insert> </insert>
@ -118,13 +163,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="corporatePayee != null">corporate_payee = #{corporatePayee},</if> <if test="corporatePayee != null">corporate_payee = #{corporatePayee},</if>
<if test="corporateReceivingAccount != null">corporate_receiving_account = #{corporateReceivingAccount},</if> <if test="corporateReceivingAccount != null">corporate_receiving_account = #{corporateReceivingAccount},</if>
<if test="publicAccountBanks != null">public_account_banks = #{publicAccountBanks},</if> <if test="publicAccountBanks != null">public_account_banks = #{publicAccountBanks},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if> <if test="useStatus != null">use_status = #{useStatus},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim> </trim>
where expense_id = #{expenseId} where expense_id = #{expenseId}
</update> </update>
@ -148,4 +200,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update base_expense_account set del_flag = '0' where expense_id = #{expenseId} update base_expense_account set del_flag = '0' where expense_id = #{expenseId}
</update> </update>
<update id="updateExpenseAccountByExpenseCodes" parameterType="String">
update base_expense_account set del_flag = '1' where expense_code in
<foreach item="expenseCode" collection="array" open="(" separator="," close=")">
#{expenseCode}
</foreach>
</update>
<update id="updateExpenseAccountByExpenseCode" parameterType="String">
update base_expense_account set del_flag = '1' where expense_code = #{expenseCode}
</update>
<delete id="deleteBaseExpenseAccountByExpenseCode" parameterType="String">
delete from base_expense_account where expense_code = #{expenseCode}
</delete>
<delete id="deleteBaseExpenseAccountByExpenseCodes" parameterType="String">
delete from base_expense_account where expense_code in
<foreach item="expenseId" collection="array" open="(" separator="," close=")">
#{expenseCode}
</foreach>
</delete>
</mapper> </mapper>

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

@ -35,47 +35,47 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label> <label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="expenseMethod" class="form-control" th:with="dictOptions=${@dict.getType('sys_expense_method')}"> <select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictOptions}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div id="add_expenseMethodModal" class="container" style="display: none">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <div class="form-group">
<div class="col-sm-6"> <label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<select name="isPurchaseOutsource" class="form-control" th:with="dictOptions=${@dict.getType('sys_whether')}"> <div class="col-sm-6">
<option th:each="dict : ${dictOptions}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
</select> <option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">供应商ID:</label>
<label class="col-sm-6 control-label">供应商ID:</label> <div class="col-sm-6">
<div class="col-sm-6"> <select id="supplierCode" name="supplierCode" class="form-control">
<select id="supplierCode" name="supplierCode" class="form-control"> </select>
</div>
</select>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">对公收款方:</label>
<label class="col-sm-6 control-label">对公收款方:</label> <div class="col-sm-6">
<div class="col-sm-6"> <input name="corporatePayee" class="form-control" type="text">
<input name="corporatePayee" class="form-control" type="text"> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">对公收款账户:</label>
<label class="col-sm-6 control-label">对公收款账户:</label> <div class="col-sm-6">
<div class="col-sm-6"> <input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" class="form-control" type="text"> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">对公开户行:</label>
<label class="col-sm-6 control-label">对公开户行:</label> <div class="col-sm-6">
<div class="col-sm-6"> <input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" class="form-control" type="text"> </div>
</div> </div>
</div> </div>
</form> </form>
@ -86,6 +86,9 @@
<a class="btn btn-success" onclick="insertRow()"> <a class="btn btn-success" onclick="insertRow()">
<span class="fa fa-plus"></span> 添加报销 <span class="fa fa-plus"></span> 添加报销
</a> </a>
<a class="btn btn-danger" onclick="removeRow()">
<span class="fa fa-remove"></span> 删除报销
</a>
</div> </div>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
@ -93,6 +96,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
@ -103,7 +107,6 @@
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var $table = $("#bootstrap-sub-table-expense"); var $table = $("#bootstrap-sub-table-expense");
var costType; var costType;
//获取子表信息 //获取子表信息
$(function() { $(function() {
getSelections(); getSelections();
@ -119,7 +122,7 @@
} }
}, },
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, {title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',visible: false}, {title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType', {title: '成本类型',field: 'costType',
formatter:function (value, row, index) { formatter:function (value, row, index) {
return costTypeFormatter(value,row,index); return costTypeFormatter(value,row,index);
@ -143,8 +146,8 @@
} }
}, },
{title: '报销时间',field: 'expenseTime',editable:{ {title: '报销时间',field: 'expenseTime',editable:{
type:'text', type:'date',
mode:'inline', mode:'inline'
} }
}, },
{title: '出差单号',field: 'evectionCode',editable:{ {title: '出差单号',field: 'evectionCode',editable:{
@ -161,13 +164,6 @@
type:'text', type:'text',
mode:'inline', 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(\'' + index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
} }
], ],
}; };
@ -192,6 +188,7 @@
ajax: { ajax: {
url: '/system/supplier/getSupplier', url: '/system/supplier/getSupplier',
dataType: 'json', dataType: 'json',
method: "post",
delay: 250, delay: 250,
processResults: function (res, params) { processResults: function (res, params) {
var options = []; var options = [];
@ -210,8 +207,16 @@
} }
} }
}); });
}); });
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#add_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#add_expenseMethodModal").show();
} else {
$("#add_expenseMethodModal").hide();
}
}
$('#supplierCode').on('select2:select', function (e) { $('#supplierCode').on('select2:select', function (e) {
var data = e.params.data; var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName); $("input[name='corporatePayee']").val(data.supplierName);
@ -240,7 +245,6 @@
}) })
} }
/* 删除指定表格行 */ /* 删除指定表格行 */
function removeRow(index){$table.bootstrapTable('remove', {field: 'index',values: index})};
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
var formData = $('#form-baseExpense-add').serializeArray(); var formData = $('#form-baseExpense-add').serializeArray();
@ -299,7 +303,17 @@
return selectHtml; return selectHtml;
} }
} }
function removeRow(){
var ids = $.table.selectColumns("id");
if (ids.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$("#bootstrap-sub-table-1").bootstrapTable('remove', {
field: 'id',
values: ids
})
}
function onCostSmallTypeChange(selectElement, rowIndex) { function onCostSmallTypeChange(selectElement, rowIndex) {
var newCostSmallType = $(selectElement).val(); var newCostSmallType = $(selectElement).val();
var tableData = $table.bootstrapTable('getData'); var tableData = $table.bootstrapTable('getData');

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

@ -123,7 +123,6 @@
pageSize: 10, pageSize: 10,
sortable: true, // 是否启用排序 sortable: true, // 是否启用排序
sortStable: true, // 设置为 true 将获得稳定的排序 sortStable: true, // 设置为 true 将获得稳定的排序
detailView: true,
fixedColumns: true, // 启用冻结列 fixedColumns: true, // 启用冻结列
rightFixedColumns:1, rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数 fixedRightNumber: 1, // 冻结右列个数

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

@ -108,7 +108,7 @@
url: ctx + "system/expenseChild/list", url: ctx + "system/expenseChild/list",
queryParams: function(params) { queryParams: function(params) {
return { return {
quoteId: $("#expenseCode").val() expenseCode: $("#expenseCode").val()
}; };
}, },
pagination: false, pagination: false,
@ -123,7 +123,7 @@
} }
}, },
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, {title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',visible: false}, {title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType', {title: '成本类型',field: 'costType',
formatter:function (value, row, index) { formatter:function (value, row, index) {
return costTypeFormatter(value,row,index); return costTypeFormatter(value,row,index);

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

@ -32,40 +32,46 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">报销方式:</label> <label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-8"> <div class="col-sm-6">
<input name="expenseMethod" th:field="*{expenseMethod}" class="form-control" type="text"> <select id="add_expenseMethod" name="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> </div>
<div class="form-group"> <div id="add_expenseMethodModal" class="container" style="display: none">
<label class="col-sm-3 control-label">供应商ID:</label> <div class="form-group">
<div class="col-sm-8"> <label class="col-sm-6 control-label">是否是委外/采购采销:</label>
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text"> <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>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">供应商ID:</label>
<label class="col-sm-3 control-label">是否是委外/采购采销:</label> <div class="col-sm-6">
<div class="col-sm-8"> <select id="supplierCode" name="supplierCode" class="form-control">
<input name="isPurchaseOutsource" th:field="*{isPurchaseOutsource}" class="form-control" type="text"> </select>
</div>
</div> </div>
</div> <div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="form-group"> <div class="col-sm-6">
<label class="col-sm-3 control-label">对公收款方:</label> <input name="corporatePayee" class="form-control" type="text">
<div class="col-sm-8"> </div>
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">对公收款账户:</label>
<label class="col-sm-3 control-label">对公收款账户:</label> <div class="col-sm-6">
<div class="col-sm-8"> <input name="corporateReceivingAccount" class="form-control" type="text">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text"> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-sm-6 control-label">对公开户行:</label>
<label class="col-sm-3 control-label">对公开户行:</label> <div class="col-sm-6">
<div class="col-sm-8"> <input name="publicAccountBanks" class="form-control" type="text">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text"> </div>
</div> </div>
</div> </div>
</form> </form>
@ -88,6 +94,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/baseExpense" var prefix = ctx + "system/baseExpense"
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var supplier = [[${formData.supplierCode}]];
$("#form-baseExpense-add").validate({focusCleanup: true}); $("#form-baseExpense-add").validate({focusCleanup: true});
$(function(){ $(function(){
$.ajax({ $.ajax({
@ -111,7 +118,7 @@
url: ctx + "system/expenseChild/list", url: ctx + "system/expenseChild/list",
queryParams: function(params) { queryParams: function(params) {
return { return {
quoteId: $("#expenseCode").val() expenseCode: $("#expenseCode").val()
}; };
}, },
pagination: false, pagination: false,
@ -126,7 +133,7 @@
} }
}, },
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, {title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'quoteId',visible: false}, {title: '关联报销单号',field: 'expenseCode',visible: false},
{title: '成本类型',field: 'costType', {title: '成本类型',field: 'costType',
formatter:function (value, row, index) { formatter:function (value, row, index) {
return costTypeFormatter(value,row,index); return costTypeFormatter(value,row,index);
@ -153,7 +160,51 @@
], ],
}; };
$.table.init(options); $.table.init(options);
// 假设此函数返回供应商列表
$("#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
};
}
}
});
$("#supplierCode").val(supplier);
}); });
function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值
var expenseMethod = $("#add_expenseMethod option:selected").val();
if (expenseMethod === '1') {
$("#add_expenseMethodModal").show();
} else {
$("#add_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 insertRow() { function insertRow() {
$table.bootstrapTable('insertRow', { $table.bootstrapTable('insertRow', {
index:1, index:1,
@ -193,21 +244,6 @@
} }
} }
} }
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) { function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val(); var newSupplierId = $(selectElement).val();

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

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('财务报销审核')" />
<th:block th:include="include :: datetimepicker-css" />
</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>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<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());
}
}
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>

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

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改出差单')" />
<th:block th:include="include :: datetimepicker-css" />
</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>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-modifyApply").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-requisitioning-modifyApply').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>

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

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('总助/总经理审核')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-requisitioning-zozj-audit" th:object="${formData}">
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-zozj-audit").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-requisitioning-zozj-audit').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>

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

@ -0,0 +1,198 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('报销人上级经理审核出差单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-bxjl-audit" th:object="${formData}">
<input name="requisitioningId" 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="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" 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="userName" th:field="*{userName}" 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="bxjl_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="bxjl_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>
</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>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense";
var taskId = [[${taskId}]];
$("#form-baseExpense-bxjl-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense-bxjl',
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',}},
{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 submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-requisitioning-qgjl-audit').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>

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

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('报销人上级经理审核出差单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-requisitioning-qgjl-audit" th:object="${formData}">
<input name="requisitioningId" th:field="*{requisitioningId}" 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" hidden="hidden">
<label class="col-sm-3 control-label">请购单号:</label>
<div class="col-sm-8">
<input name="code" th:field="*{requisitioningCode}" 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="userName" th:field="*{userName}" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="correlationCode" th:field="*{correlationCode}" class="form-control" type="text">
</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_bxzg"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/requisitioning";
var taskId = [[${taskId}]];
$("#form-requisitioning-qgjl-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-expense_bxzg',
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',}},
{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 submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/complete/"+taskId, $('#form-requisitioning-qgjl-audit').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