zhangsiqi
6 months ago
10 changed files with 1602 additions and 7 deletions
@ -0,0 +1,151 @@ |
|||||
|
package com.ruoyi.financial.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import com.ruoyi.common.annotation.Log; |
||||
|
import com.ruoyi.common.enums.BusinessType; |
||||
|
import com.ruoyi.financial.domain.FinacialExpense; |
||||
|
import com.ruoyi.financial.service.IFinacialExpenseService; |
||||
|
import com.ruoyi.common.core.controller.BaseController; |
||||
|
import com.ruoyi.common.core.domain.AjaxResult; |
||||
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
|
import com.ruoyi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 报销管理Controller |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-05-31 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/financial/expense") |
||||
|
public class FinacialExpenseController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "financial/expense"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IFinacialExpenseService finacialExpenseService; |
||||
|
|
||||
|
@RequiresPermissions("financial:expense:view") |
||||
|
@GetMapping() |
||||
|
public String expense() |
||||
|
{ |
||||
|
return prefix + "/expense"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询报销管理列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<FinacialExpense> list = finacialExpenseService.selectFinacialExpenseList(finacialExpense); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出报销管理列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:export") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ResponseBody |
||||
|
public AjaxResult export(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
List<FinacialExpense> list = finacialExpenseService.selectFinacialExpenseList(finacialExpense); |
||||
|
ExcelUtil<FinacialExpense> util = new ExcelUtil<FinacialExpense>(FinacialExpense.class); |
||||
|
return util.exportExcel(list, "报销管理数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增报销管理 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存报销管理 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:add") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
return toAjax(finacialExpenseService.insertFinacialExpense(finacialExpense)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改报销管理 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{expenseId}") |
||||
|
public String edit(@PathVariable("expenseId") Long expenseId, ModelMap mmap) |
||||
|
{ |
||||
|
FinacialExpense finacialExpense = finacialExpenseService.selectFinacialExpenseById(expenseId); |
||||
|
mmap.put("finacialExpense", finacialExpense); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存报销管理 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:edit") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
return toAjax(finacialExpenseService.updateFinacialExpense(finacialExpense)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除报销管理 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:remove") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String ids) |
||||
|
{ |
||||
|
return toAjax(finacialExpenseService.deleteFinacialExpenseByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废报销管理 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:cancel") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.CANCEL) |
||||
|
@GetMapping( "/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult cancel(@PathVariable("id") Long id){ |
||||
|
return toAjax(finacialExpenseService.cancelFinacialExpenseById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复报销管理 |
||||
|
*/ |
||||
|
@RequiresPermissions("financial:expense:restore") |
||||
|
@Log(title = "报销管理", businessType = BusinessType.RESTORE) |
||||
|
@GetMapping( "/restore/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult restore(@PathVariable("id")Long id) |
||||
|
{ |
||||
|
return toAjax(finacialExpenseService.restoreFinacialExpenseById(id)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,265 @@ |
|||||
|
package com.ruoyi.financial.domain; |
||||
|
|
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.ruoyi.common.annotation.Excel; |
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 报销管理对象 finacial_expense |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-05-31 |
||||
|
*/ |
||||
|
public class FinacialExpense extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 报销单索引id */ |
||||
|
private Long expenseId; |
||||
|
|
||||
|
/** 上级审核状态 */ |
||||
|
@Excel(name = "上级审核状态") |
||||
|
private String auditStatus; |
||||
|
|
||||
|
/** 总经理审核状态 */ |
||||
|
@Excel(name = "总经理审核状态") |
||||
|
private String managerAuditStatus; |
||||
|
|
||||
|
/** 财务审核状态 */ |
||||
|
@Excel(name = "财务审核状态") |
||||
|
private String financeAuditStatus; |
||||
|
|
||||
|
/** 报销单编号 */ |
||||
|
@Excel(name = "报销单编号") |
||||
|
private String expenseCode; |
||||
|
|
||||
|
/** 部门 */ |
||||
|
@Excel(name = "部门") |
||||
|
private String deptName; |
||||
|
|
||||
|
/** 岗位 */ |
||||
|
@Excel(name = "岗位") |
||||
|
private String postName; |
||||
|
|
||||
|
/** 姓名 */ |
||||
|
@Excel(name = "姓名") |
||||
|
private String fullName; |
||||
|
|
||||
|
/** 报销方式 */ |
||||
|
@Excel(name = "报销方式") |
||||
|
private String expenseMethod; |
||||
|
|
||||
|
/** 是否是委外/采购采销 */ |
||||
|
@Excel(name = "是否是委外/采购采销") |
||||
|
private String isPurchaseOutsource; |
||||
|
|
||||
|
/** 供应商ID */ |
||||
|
@Excel(name = "供应商ID") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
/** 对公收款方 */ |
||||
|
@Excel(name = "对公收款方") |
||||
|
private String corporatePayee; |
||||
|
|
||||
|
/** 对公收款账户 */ |
||||
|
@Excel(name = "对公收款账户") |
||||
|
private String corporateReceivingAccount; |
||||
|
|
||||
|
/** 对公开户行 */ |
||||
|
@Excel(name = "对公开户行") |
||||
|
private String publicAccountBanks; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@Excel(name = "申请人") |
||||
|
private String applyUser; |
||||
|
|
||||
|
/** 使用状态 */ |
||||
|
@Excel(name = "使用状态") |
||||
|
private String useStatus; |
||||
|
|
||||
|
/** 删除标志 */ |
||||
|
private String delFlag; |
||||
|
|
||||
|
public void setExpenseId(Long expenseId) |
||||
|
{ |
||||
|
this.expenseId = expenseId; |
||||
|
} |
||||
|
|
||||
|
public Long getExpenseId() |
||||
|
{ |
||||
|
return expenseId; |
||||
|
} |
||||
|
public void setAuditStatus(String auditStatus) |
||||
|
{ |
||||
|
this.auditStatus = auditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getAuditStatus() |
||||
|
{ |
||||
|
return auditStatus; |
||||
|
} |
||||
|
public void setManagerAuditStatus(String managerAuditStatus) |
||||
|
{ |
||||
|
this.managerAuditStatus = managerAuditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getManagerAuditStatus() |
||||
|
{ |
||||
|
return managerAuditStatus; |
||||
|
} |
||||
|
public void setFinanceAuditStatus(String financeAuditStatus) |
||||
|
{ |
||||
|
this.financeAuditStatus = financeAuditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getFinanceAuditStatus() |
||||
|
{ |
||||
|
return financeAuditStatus; |
||||
|
} |
||||
|
public void setExpenseCode(String expenseCode) |
||||
|
{ |
||||
|
this.expenseCode = expenseCode; |
||||
|
} |
||||
|
|
||||
|
public String getExpenseCode() |
||||
|
{ |
||||
|
return expenseCode; |
||||
|
} |
||||
|
public void setDeptName(String deptName) |
||||
|
{ |
||||
|
this.deptName = deptName; |
||||
|
} |
||||
|
|
||||
|
public String getDeptName() |
||||
|
{ |
||||
|
return deptName; |
||||
|
} |
||||
|
public void setPostName(String postName) |
||||
|
{ |
||||
|
this.postName = postName; |
||||
|
} |
||||
|
|
||||
|
public String getPostName() |
||||
|
{ |
||||
|
return postName; |
||||
|
} |
||||
|
public void setFullName(String fullName) |
||||
|
{ |
||||
|
this.fullName = fullName; |
||||
|
} |
||||
|
|
||||
|
public String getFullName() |
||||
|
{ |
||||
|
return fullName; |
||||
|
} |
||||
|
public void setExpenseMethod(String expenseMethod) |
||||
|
{ |
||||
|
this.expenseMethod = expenseMethod; |
||||
|
} |
||||
|
|
||||
|
public String getExpenseMethod() |
||||
|
{ |
||||
|
return expenseMethod; |
||||
|
} |
||||
|
public void setIsPurchaseOutsource(String isPurchaseOutsource) |
||||
|
{ |
||||
|
this.isPurchaseOutsource = isPurchaseOutsource; |
||||
|
} |
||||
|
|
||||
|
public String getIsPurchaseOutsource() |
||||
|
{ |
||||
|
return isPurchaseOutsource; |
||||
|
} |
||||
|
public void setSupplierCode(String supplierCode) |
||||
|
{ |
||||
|
this.supplierCode = supplierCode; |
||||
|
} |
||||
|
|
||||
|
public String getSupplierCode() |
||||
|
{ |
||||
|
return supplierCode; |
||||
|
} |
||||
|
public void setCorporatePayee(String corporatePayee) |
||||
|
{ |
||||
|
this.corporatePayee = corporatePayee; |
||||
|
} |
||||
|
|
||||
|
public String getCorporatePayee() |
||||
|
{ |
||||
|
return corporatePayee; |
||||
|
} |
||||
|
public void setCorporateReceivingAccount(String corporateReceivingAccount) |
||||
|
{ |
||||
|
this.corporateReceivingAccount = corporateReceivingAccount; |
||||
|
} |
||||
|
|
||||
|
public String getCorporateReceivingAccount() |
||||
|
{ |
||||
|
return corporateReceivingAccount; |
||||
|
} |
||||
|
public void setPublicAccountBanks(String publicAccountBanks) |
||||
|
{ |
||||
|
this.publicAccountBanks = publicAccountBanks; |
||||
|
} |
||||
|
|
||||
|
public String getPublicAccountBanks() |
||||
|
{ |
||||
|
return publicAccountBanks; |
||||
|
} |
||||
|
public void setApplyUser(String applyUser) |
||||
|
{ |
||||
|
this.applyUser = applyUser; |
||||
|
} |
||||
|
|
||||
|
public String getApplyUser() |
||||
|
{ |
||||
|
return applyUser; |
||||
|
} |
||||
|
public void setUseStatus(String useStatus) |
||||
|
{ |
||||
|
this.useStatus = useStatus; |
||||
|
} |
||||
|
|
||||
|
public String getUseStatus() |
||||
|
{ |
||||
|
return useStatus; |
||||
|
} |
||||
|
public void setDelFlag(String delFlag) |
||||
|
{ |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public String getDelFlag() |
||||
|
{ |
||||
|
return delFlag; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("expenseId", getExpenseId()) |
||||
|
.append("auditStatus", getAuditStatus()) |
||||
|
.append("managerAuditStatus", getManagerAuditStatus()) |
||||
|
.append("financeAuditStatus", getFinanceAuditStatus()) |
||||
|
.append("expenseCode", getExpenseCode()) |
||||
|
.append("deptName", getDeptName()) |
||||
|
.append("postName", getPostName()) |
||||
|
.append("fullName", getFullName()) |
||||
|
.append("expenseMethod", getExpenseMethod()) |
||||
|
.append("isPurchaseOutsource", getIsPurchaseOutsource()) |
||||
|
.append("supplierCode", getSupplierCode()) |
||||
|
.append("corporatePayee", getCorporatePayee()) |
||||
|
.append("corporateReceivingAccount", getCorporateReceivingAccount()) |
||||
|
.append("publicAccountBanks", getPublicAccountBanks()) |
||||
|
.append("applyUser", getApplyUser()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.append("remark", getRemark()) |
||||
|
.append("useStatus", getUseStatus()) |
||||
|
.append("delFlag", getDelFlag()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.ruoyi.financial.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.financial.domain.FinacialExpense; |
||||
|
|
||||
|
/** |
||||
|
* 报销管理Mapper接口 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-05-31 |
||||
|
*/ |
||||
|
public interface FinacialExpenseMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 报销管理 |
||||
|
*/ |
||||
|
public FinacialExpense selectFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 查询报销管理列表 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 报销管理集合 |
||||
|
*/ |
||||
|
public List<FinacialExpense> selectFinacialExpenseList(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 新增报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertFinacialExpense(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 修改报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateFinacialExpense(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 删除报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除报销管理 |
||||
|
* |
||||
|
* @param expenseIds 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteFinacialExpenseByIds(String[] expenseIds); |
||||
|
|
||||
|
/** |
||||
|
* 作废报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 恢复报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreFinacialExpenseById(Long expenseId); |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package com.ruoyi.financial.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.financial.domain.FinacialExpense; |
||||
|
|
||||
|
/** |
||||
|
* 报销管理Service接口 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-05-31 |
||||
|
*/ |
||||
|
public interface IFinacialExpenseService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 报销管理 |
||||
|
*/ |
||||
|
public FinacialExpense selectFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 查询报销管理列表 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 报销管理集合 |
||||
|
*/ |
||||
|
public List<FinacialExpense> selectFinacialExpenseList(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 新增报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertFinacialExpense(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 修改报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateFinacialExpense(FinacialExpense finacialExpense); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除报销管理 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteFinacialExpenseByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除报销管理信息 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 作废报销管理 |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelFinacialExpenseById(Long expenseId); |
||||
|
|
||||
|
/** |
||||
|
* 恢复报销管理 |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restoreFinacialExpenseById(Long expenseId); |
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
package com.ruoyi.financial.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.ruoyi.common.utils.ShiroUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.financial.mapper.FinacialExpenseMapper; |
||||
|
import com.ruoyi.financial.domain.FinacialExpense; |
||||
|
import com.ruoyi.financial.service.IFinacialExpenseService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
|
||||
|
/** |
||||
|
* 报销管理Service业务层处理 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-05-31 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class FinacialExpenseServiceImpl implements IFinacialExpenseService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private FinacialExpenseMapper finacialExpenseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 报销管理 |
||||
|
*/ |
||||
|
@Override |
||||
|
public FinacialExpense selectFinacialExpenseById(Long expenseId) |
||||
|
{ |
||||
|
return finacialExpenseMapper.selectFinacialExpenseById(expenseId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询报销管理列表 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 报销管理 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<FinacialExpense> selectFinacialExpenseList(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
return finacialExpenseMapper.selectFinacialExpenseList(finacialExpense); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertFinacialExpense(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
finacialExpense.setCreateBy(loginName); |
||||
|
finacialExpense.setCreateTime(DateUtils.getNowDate()); |
||||
|
return finacialExpenseMapper.insertFinacialExpense(finacialExpense); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改报销管理 |
||||
|
* |
||||
|
* @param finacialExpense 报销管理 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateFinacialExpense(FinacialExpense finacialExpense) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
finacialExpense.setUpdateBy(loginName); |
||||
|
finacialExpense.setUpdateTime(DateUtils.getNowDate()); |
||||
|
return finacialExpenseMapper.updateFinacialExpense(finacialExpense); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除报销管理对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteFinacialExpenseByIds(String ids) |
||||
|
{ |
||||
|
return finacialExpenseMapper.deleteFinacialExpenseByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除报销管理信息 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteFinacialExpenseById(Long expenseId) |
||||
|
{ |
||||
|
return finacialExpenseMapper.deleteFinacialExpenseById(expenseId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废报销管理 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelFinacialExpenseById(Long expenseId) |
||||
|
{ |
||||
|
return finacialExpenseMapper.cancelFinacialExpenseById(expenseId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复报销管理信息 |
||||
|
* |
||||
|
* @param expenseId 报销管理ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restoreFinacialExpenseById(Long expenseId) |
||||
|
{ |
||||
|
return finacialExpenseMapper.restoreFinacialExpenseById(expenseId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,159 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ruoyi.financial.mapper.FinacialExpenseMapper"> |
||||
|
|
||||
|
<resultMap type="FinacialExpense" id="FinacialExpenseResult"> |
||||
|
<result property="expenseId" column="expense_id" /> |
||||
|
<result property="auditStatus" column="audit_status" /> |
||||
|
<result property="managerAuditStatus" column="manager_audit_status" /> |
||||
|
<result property="financeAuditStatus" column="finance_audit_status" /> |
||||
|
<result property="expenseCode" column="expense_code" /> |
||||
|
<result property="deptName" column="deptName" /> |
||||
|
<result property="postName" column="postName" /> |
||||
|
<result property="fullName" column="fullName" /> |
||||
|
<result property="expenseMethod" column="expense_method" /> |
||||
|
<result property="isPurchaseOutsource" column="is_purchase_outsource" /> |
||||
|
<result property="supplierCode" column="supplier_code" /> |
||||
|
<result property="corporatePayee" column="corporate_payee" /> |
||||
|
<result property="corporateReceivingAccount" column="corporate_receiving_account" /> |
||||
|
<result property="publicAccountBanks" column="public_account_banks" /> |
||||
|
<result property="applyUser" column="apply_user" /> |
||||
|
<result property="createBy" column="create_by" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
<result property="updateBy" column="update_by" /> |
||||
|
<result property="updateTime" column="update_time" /> |
||||
|
<result property="remark" column="remark" /> |
||||
|
<result property="useStatus" column="use_status" /> |
||||
|
<result property="delFlag" column="del_flag" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectFinacialExpenseVo"> |
||||
|
select expense_id, audit_status, manager_audit_status, finance_audit_status, 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 from finacial_expense |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectFinacialExpenseList" parameterType="FinacialExpense" resultMap="FinacialExpenseResult"> |
||||
|
<include refid="selectFinacialExpenseVo"/> |
||||
|
<where> |
||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
||||
|
<if test="managerAuditStatus != null and managerAuditStatus != ''"> and manager_audit_status = #{managerAuditStatus}</if> |
||||
|
<if test="financeAuditStatus != null and financeAuditStatus != ''"> and finance_audit_status = #{financeAuditStatus}</if> |
||||
|
<if test="expenseCode != null and expenseCode != ''"> and expense_code = #{expenseCode}</if> |
||||
|
<if test="deptName != null and deptName != ''"> and deptName like concat('%', #{deptName}, '%')</if> |
||||
|
<if test="postName != null and postName != ''"> and postName like concat('%', #{postName}, '%')</if> |
||||
|
<if test="fullName != null and fullName != ''"> and fullName like concat('%', #{fullName}, '%')</if> |
||||
|
<if test="expenseMethod != null and expenseMethod != ''"> and expense_method = #{expenseMethod}</if> |
||||
|
<if test="isPurchaseOutsource != null and isPurchaseOutsource != ''"> and is_purchase_outsource = #{isPurchaseOutsource}</if> |
||||
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if> |
||||
|
<if test="corporatePayee != null and corporatePayee != ''"> and corporate_payee = #{corporatePayee}</if> |
||||
|
<if test="corporateReceivingAccount != null and corporateReceivingAccount != ''"> and corporate_receiving_account = #{corporateReceivingAccount}</if> |
||||
|
<if test="publicAccountBanks != null and publicAccountBanks != ''"> and public_account_banks = #{publicAccountBanks}</if> |
||||
|
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if> |
||||
|
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectFinacialExpenseById" parameterType="Long" resultMap="FinacialExpenseResult"> |
||||
|
<include refid="selectFinacialExpenseVo"/> |
||||
|
where expense_id = #{expenseId} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertFinacialExpense" parameterType="FinacialExpense" useGeneratedKeys="true" keyProperty="expenseId"> |
||||
|
insert into finacial_expense |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="auditStatus != null">audit_status,</if> |
||||
|
<if test="managerAuditStatus != null">manager_audit_status,</if> |
||||
|
<if test="financeAuditStatus != null">finance_audit_status,</if> |
||||
|
<if test="expenseCode != null">expense_code,</if> |
||||
|
<if test="deptName != null">deptName,</if> |
||||
|
<if test="postName != null">postName,</if> |
||||
|
<if test="fullName != null">fullName,</if> |
||||
|
<if test="expenseMethod != null">expense_method,</if> |
||||
|
<if test="isPurchaseOutsource != null">is_purchase_outsource,</if> |
||||
|
<if test="supplierCode != null">supplier_code,</if> |
||||
|
<if test="corporatePayee != null">corporate_payee,</if> |
||||
|
<if test="corporateReceivingAccount != null">corporate_receiving_account,</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="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="useStatus != null">use_status,</if> |
||||
|
<if test="delFlag != null">del_flag,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="auditStatus != null">#{auditStatus},</if> |
||||
|
<if test="managerAuditStatus != null">#{managerAuditStatus},</if> |
||||
|
<if test="financeAuditStatus != null">#{financeAuditStatus},</if> |
||||
|
<if test="expenseCode != null">#{expenseCode},</if> |
||||
|
<if test="deptName != null">#{deptName},</if> |
||||
|
<if test="postName != null">#{postName},</if> |
||||
|
<if test="fullName != null">#{fullName},</if> |
||||
|
<if test="expenseMethod != null">#{expenseMethod},</if> |
||||
|
<if test="isPurchaseOutsource != null">#{isPurchaseOutsource},</if> |
||||
|
<if test="supplierCode != null">#{supplierCode},</if> |
||||
|
<if test="corporatePayee != null">#{corporatePayee},</if> |
||||
|
<if test="corporateReceivingAccount != null">#{corporateReceivingAccount},</if> |
||||
|
<if test="publicAccountBanks != null">#{publicAccountBanks},</if> |
||||
|
<if test="applyUser != null">#{applyUser},</if> |
||||
|
<if test="createBy != null">#{createBy},</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="useStatus != null">#{useStatus},</if> |
||||
|
<if test="delFlag != null">#{delFlag},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateFinacialExpense" parameterType="FinacialExpense"> |
||||
|
update finacial_expense |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
||||
|
<if test="managerAuditStatus != null">manager_audit_status = #{managerAuditStatus},</if> |
||||
|
<if test="financeAuditStatus != null">finance_audit_status = #{financeAuditStatus},</if> |
||||
|
<if test="expenseCode != null">expense_code = #{expenseCode},</if> |
||||
|
<if test="deptName != null">deptName = #{deptName},</if> |
||||
|
<if test="postName != null">postName = #{postName},</if> |
||||
|
<if test="fullName != null">fullName = #{fullName},</if> |
||||
|
<if test="expenseMethod != null">expense_method = #{expenseMethod},</if> |
||||
|
<if test="isPurchaseOutsource != null">is_purchase_outsource = #{isPurchaseOutsource},</if> |
||||
|
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> |
||||
|
<if test="corporatePayee != null">corporate_payee = #{corporatePayee},</if> |
||||
|
<if test="corporateReceivingAccount != null">corporate_receiving_account = #{corporateReceivingAccount},</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="updateTime != null">update_time = #{updateTime},</if> |
||||
|
<if test="remark != null">remark = #{remark},</if> |
||||
|
<if test="useStatus != null">use_status = #{useStatus},</if> |
||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if> |
||||
|
</trim> |
||||
|
where expense_id = #{expenseId} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteFinacialExpenseById" parameterType="Long"> |
||||
|
delete from finacial_expense where expense_id = #{expenseId} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteFinacialExpenseByIds" parameterType="String"> |
||||
|
delete from finacial_expense where expense_id in |
||||
|
<foreach item="expenseId" collection="array" open="(" separator="," close=")"> |
||||
|
#{expenseId} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelFinacialExpenseById" parameterType="Long"> |
||||
|
update finacial_expense set del_flag = '1' where expense_id = #{expenseId} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreFinacialExpenseById" parameterType="Long"> |
||||
|
update finacial_expense set del_flag = '0' where expense_id = #{expenseId} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,310 @@ |
|||||
|
<!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" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-baseExpense-add"> |
||||
|
<div class="form-group" hidden> |
||||
|
<label class="col-sm-6 control-label">报销单编号:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="expenseCode" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-12 mt-5"> |
||||
|
<div class="col-xs-4"> |
||||
|
<label class="col-sm-6 control-label">部门:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="deptName" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-4"> |
||||
|
<label class="col-sm-6 control-label">岗位:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="postName" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-xs-4"> |
||||
|
<label class="col-sm-6 control-label">姓名:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<input name="fullName" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-6 control-label">报销方式:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<select name="expenseMethod" class="form-control" th:with="dictOptions=${@dict.getType('sys_expense_method')}"> |
||||
|
<option th:each="dict : ${dictOptions}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<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="dictOptions=${@dict.getType('sys_whether')}"> |
||||
|
<option th:each="dict : ${dictOptions}" 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 name="supplierCode" class="form-control" th:with="supplierList=${@supplier.selectSysSupplierListAll()}"> |
||||
|
<option th:each="supplier : ${supplierList}" th:text="${supplier.supplierName}" th:value="${supplier.supplierCode}"></option> |
||||
|
</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> |
||||
|
</form> |
||||
|
<div class="container"> |
||||
|
<div class="form-row"> |
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span> |
||||
|
<a class="btn btn-success" onclick="insertRow()"> |
||||
|
<span class="fa fa-plus"></span> 添加报销 |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-sub-table-expense"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/baseExpense" |
||||
|
$("#form-baseExpense-add").validate({focusCleanup: true}); |
||||
|
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
|
var $table = $("#bootstrap-sub-table-expense"); |
||||
|
var costTypes; |
||||
|
$(function() { |
||||
|
$.ajax({ |
||||
|
url: prefix + "/getId", |
||||
|
type: "post", |
||||
|
dataType: "json", |
||||
|
success: function (result) { |
||||
|
if (result.code == 0) { |
||||
|
$("input[name='expenseCode']").val(result.data); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
// 假设此函数返回供应商列表 |
||||
|
|
||||
|
}); |
||||
|
$('#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() { |
||||
|
var options = { |
||||
|
id:'bootstrap-sub-table-expense', |
||||
|
pagination: false, |
||||
|
sidePagination: "client", |
||||
|
model: "报销单数据", |
||||
|
columns: [ |
||||
|
{checkbox: true}, |
||||
|
{title: '主键',field: 'index',align: 'center',visible: false, |
||||
|
formatter: function (value, row, index) { |
||||
|
return index; |
||||
|
} |
||||
|
}, |
||||
|
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, |
||||
|
{title: '关联报销单号',field: 'quoteId',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', |
||||
|
validate: function(value, row, index) { |
||||
|
if (value == '') { |
||||
|
return '用途不能为空'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{title: '金额',field: 'amounts', |
||||
|
editable:{ |
||||
|
type:'text', |
||||
|
mode:'inline', |
||||
|
validate: function(value, row, index) { |
||||
|
if (value == '') { |
||||
|
return '金额不能为空'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{title: '报销时间',field: 'expenseTime',editable:{ |
||||
|
type:'text', |
||||
|
mode:'inline', |
||||
|
} |
||||
|
}, |
||||
|
{title: '出差单号',field: 'evectionCode', |
||||
|
editable:{ |
||||
|
type:'text', |
||||
|
mode:'inline', |
||||
|
validate: function(value, row, index) { |
||||
|
if (value == '') { |
||||
|
return '出差单号不能为空'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{title: '采购单号',field: 'purcahseCode', editable:{ |
||||
|
type:'text', |
||||
|
mode:'inline', |
||||
|
validate: function(value, row, index) { |
||||
|
if (value == '') { |
||||
|
return '出差单号不能为空'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{title: '委外单号',field: 'outsourceCode', |
||||
|
editable:{ |
||||
|
type:'text', |
||||
|
mode:'inline', |
||||
|
validate: function(value, row, index) { |
||||
|
if (value == '') { |
||||
|
return '出差单号不能为空'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{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(''); |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}); |
||||
|
function insertRow() { |
||||
|
$table.bootstrapTable('insertRow', { |
||||
|
index:1, |
||||
|
row: { |
||||
|
expenseChildId:'', |
||||
|
costType: "", |
||||
|
costSmallType:"", |
||||
|
purpose:'' , |
||||
|
amounts: '', |
||||
|
expenseTime: '', |
||||
|
evectionCode:'' , |
||||
|
purcahseCode:'', |
||||
|
outsourceCode: '', |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
/* 删除指定表格行 */ |
||||
|
function removeRow(index){$table.bootstrapTable('remove', {field: 'index',values: index})}; |
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var formData = $('#form-baseExpense-add').serializeArray(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var rows = tableData.length; |
||||
|
if(rows==0){ |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
}else{ |
||||
|
formData.push({"name": "expenseAccountChildList", "value": tableData}); |
||||
|
var jsonData = $.common.formDataToJson(formData); |
||||
|
$.operate.saveJson(prefix + "/add", jsonData); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// 列中获取成本类型的下拉改变数据 |
||||
|
function onCostTypeChange(selectElement, rowIndex) { |
||||
|
var newSupplierId = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costType = newSupplierId; // 更新供应商ID |
||||
|
// 重新渲染成本小类的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
|
||||
|
// 自定义供应商名称列的格式化函数 |
||||
|
function costTypeFormatter(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">'; |
||||
|
costTypeDatas.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
|
||||
|
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 |
||||
|
function getCostSmallType(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">'; |
||||
|
// 假设此函数根据供应商ID返回设备列表 |
||||
|
var costSamllTypes = []; |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/category/getChildCode', |
||||
|
type: 'post', |
||||
|
data: {code: row.costType}, |
||||
|
async: false, |
||||
|
success: function (result) { |
||||
|
console.log(result); |
||||
|
costSamllTypes = result; |
||||
|
} |
||||
|
}); |
||||
|
if (costSamllTypes) { |
||||
|
costSamllTypes.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function onCostSmallTypeChange(selectElement, rowIndex) { |
||||
|
var newCostSmallType = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costSmallType = newCostSmallType; |
||||
|
// 重新渲染当前行的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,270 @@ |
|||||
|
<!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" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-baseExpense-edit" th:object="${baseExpenseAccount}"> |
||||
|
<input name="expenseId" th:field="*{expenseId}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">报销单编号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="deptName" th:field="*{deptName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">岗位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="postName" th:field="*{postName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">姓名:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="fullName" th:field="*{fullName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">报销方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="expenseMethod" th:field="*{expenseMethod}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">供应商ID:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否是委外/采购采销:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="isPurchaseOutsource" th:field="*{isPurchaseOutsource}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">对公收款方:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">对公收款账户:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">对公开户行:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
<div class="container"> |
||||
|
<div class="form-row"> |
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span> |
||||
|
<a class="btn btn-success" onclick="insertRow()"> |
||||
|
<span class="fa fa-plus"></span> 添加报销 |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-sub-table-expense"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/baseExpense" |
||||
|
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
|
$("#form-baseExpense-add").validate({focusCleanup: true}); |
||||
|
$(function(){ |
||||
|
$.ajax({ |
||||
|
url: prefix + "/getId", |
||||
|
type: "post", |
||||
|
dataType: "json", |
||||
|
success: function(result) { |
||||
|
if (result.code == 0) { |
||||
|
$("input[name='expenseCode']").val(result.data); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
var $table = $("#bootstrap-sub-table-expense"); |
||||
|
//获取子表信息 |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
id:'bootstrap-sub-table-expense', |
||||
|
url: ctx + "system/expenseChild/list", |
||||
|
queryParams: function(params) { |
||||
|
return { |
||||
|
quoteId: $("#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: 'quoteId',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 insertRow() { |
||||
|
$table.bootstrapTable('insertRow', { |
||||
|
index:1, |
||||
|
row: { |
||||
|
expenseChildId:'', |
||||
|
costType: "", |
||||
|
costSmallType:"", |
||||
|
purpose:'' , |
||||
|
amounts: '', |
||||
|
expenseTime: '', |
||||
|
evectionCode:'' , |
||||
|
purcahseCode:'', |
||||
|
outsourceCode: '', |
||||
|
} |
||||
|
}) |
||||
|
layer.close(index); |
||||
|
} |
||||
|
/* 删除指定表格行 */ |
||||
|
function removeRow(id){ |
||||
|
$table.bootstrapTable('remove', { |
||||
|
field: 'id', |
||||
|
values: id |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var formData = $('#form-baseExpense-edit').serializeArray(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var rows = tableData.length; |
||||
|
if(rows==0){ |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
}else{ |
||||
|
formData.push({"name": "expenseAccountChildList", "value": tableData}); |
||||
|
var jsonData = $.common.formDataToJson(formData); |
||||
|
$.operate.saveJson(prefix + "/edit", jsonData); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var formData = $('#form-baseExpense-add').serializeArray(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var rows = tableData.length; |
||||
|
if(rows==0){ |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
}else{ |
||||
|
formData.push({"name": "expenseAccountChildList", "value": tableData}); |
||||
|
var jsonData = $.common.formDataToJson(formData); |
||||
|
$.operate.saveJson(prefix + "/add", jsonData); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// 列中获取成本类型的下拉改变数据 |
||||
|
function onCostTypeChange(selectElement, rowIndex) { |
||||
|
var newSupplierId = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costType = newSupplierId; // 更新供应商ID |
||||
|
// 重新渲染成本小类的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
|
||||
|
// 自定义供应商名称列的格式化函数 |
||||
|
function costTypeFormatter(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">'; |
||||
|
costTypeDatas.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
|
||||
|
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 |
||||
|
function getCostSmallType(value, row, index) { |
||||
|
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">'; |
||||
|
// 假设此函数根据供应商ID返回设备列表 |
||||
|
var costSamllTypes = []; |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/category/getChildCode', |
||||
|
type: 'post', |
||||
|
data: {code: row.costType}, |
||||
|
async: false, |
||||
|
success: function (result) { |
||||
|
console.log(result); |
||||
|
costSamllTypes = result; |
||||
|
} |
||||
|
}); |
||||
|
if (costSamllTypes) { |
||||
|
costSamllTypes.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
||||
|
}); |
||||
|
selectHtml += '</select>'; |
||||
|
return selectHtml; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function onCostSmallTypeChange(selectElement, rowIndex) { |
||||
|
var newCostSmallType = $(selectElement).val(); |
||||
|
var tableData = $table.bootstrapTable('getData'); |
||||
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
|
newRow.costSmallType = newCostSmallType; |
||||
|
// 重新渲染当前行的设备名称列 |
||||
|
// 更新行数据 |
||||
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,160 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('报销单列表')" /> |
||||
|
</head> |
||||
|
<body class="gray-bg"> |
||||
|
<div class="container-div"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 search-collapse"> |
||||
|
<form id="formId"> |
||||
|
<div class="select-list"> |
||||
|
<ul> |
||||
|
<li> |
||||
|
<label>报销单号:</label> |
||||
|
<input type="text" name="expenseCode"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>报销人:</label> |
||||
|
<select name="applyUser" > |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>生产单号:</label> |
||||
|
<input name="expenseCode" type="text"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>出差单号:</label> |
||||
|
<input name="expenseCode" type="text"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>上级审核状态:</label> |
||||
|
<select name="auditStatus" th:with="type=${@dict.getType('auditStatus')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
||||
|
th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>总经理审核状态:</label> |
||||
|
<select name="managerAuditStatus" th:with="type=${@dict.getType('auditStatus')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
||||
|
th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>财务审核状态:</label> |
||||
|
<select name="financeAuditStatus" th:with="type=${@dict.getType('auditStatus')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
||||
|
th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>成本类型:</label> |
||||
|
<select name="costType" th:with="childList=${@category.getChildByCode('costType')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="chilld: ${childList}" th:value="${chilld.code}" th:text="${chilld.name}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>成本小类:</label> |
||||
|
<select name="costSamllType"> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>报销方式:</label> |
||||
|
<select name="expenseMethod" th:with="type=${@dict.getType('sys_base_expense_method')}"> |
||||
|
<option value="">所有</option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
||||
|
th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</li> |
||||
|
<li class="select-time"> |
||||
|
<label>录入时间: </label> |
||||
|
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/> |
||||
|
<span>-</span> |
||||
|
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
|
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:baseExpense:add"> |
||||
|
<i class="fa fa-plus"></i> 添加 |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
|
var editFlag = [[${@permission.hasPermi('system:baseExpense:edit')}]]; |
||||
|
var removeFlag = [[${@permission.hasPermi('system:baseExpense:remove')}]]; |
||||
|
var cancelFlag = [[${@permission.hasPermi('system:baseExpense:cancel')}]]; |
||||
|
var restoreFlag = [[${@permission.hasPermi('system:baseExpense:restore')}]]; |
||||
|
var prefix = ctx + "system/baseExpense"; |
||||
|
$(function() { |
||||
|
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
|
var options = { |
||||
|
url: prefix + "/list", |
||||
|
createUrl: prefix + "/add", |
||||
|
updateUrl: prefix + "/edit/{id}", |
||||
|
removeUrl: prefix + "/remove", |
||||
|
cancelUrl: prefix + "/cancel/{id}", |
||||
|
restoreUrl: prefix + "/restore/{id}", |
||||
|
exportUrl: prefix + "/export", |
||||
|
modalName: "报销单", |
||||
|
columns: [ |
||||
|
{checkbox: true}, |
||||
|
{title: '报销单索引id',field: 'expenseId',visible: false}, |
||||
|
{title: '上级审核状态',field: 'auditStatus',}, |
||||
|
{title: '总经理审核状态',field: 'managerAuditStatus',}, |
||||
|
{title: '财务审核状态',field: 'financeAuditStatus',}, |
||||
|
{title: '报销单编号',field: 'expenseCode',}, |
||||
|
{title: '报销人',field: 'applyUser',}, |
||||
|
{title: '报销方式',field: 'expenseMethod', }, |
||||
|
{title: '是否是委外/采购采销',field: 'isPurchaseOutsource',visible: false}, |
||||
|
{title: '供应商ID',field: 'supplierCode',visible: false}, |
||||
|
{title: '对公收款方',field: 'corporatePayee',visible: false}, |
||||
|
{title: '对公收款账户',field: 'corporateReceivingAccount',visible: false}, |
||||
|
{title: '对公开户行',field: 'publicAccountBanks',visible: false}, |
||||
|
{title: '录入时间',field: 'createTime',}, |
||||
|
{title: '更新人',field: 'updateBy'}, |
||||
|
{title: '上次更新时间',field: 'updateTime',visible: false}, |
||||
|
{title: '备注',field: 'remark',visible: false}, |
||||
|
{title: '使用状态',field: 'useStatus',visible: false}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
formatter: function(value, row, index) { |
||||
|
var actions = []; |
||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.expenseId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.expenseId + '\')"><i class="fa fa-details"></i>详情</a> '); |
||||
|
if(row.delFlag == '0'){ |
||||
|
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> '); |
||||
|
}else{ |
||||
|
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> '); |
||||
|
} |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue