Compare commits

...

7 Commits

  1. 3
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  2. 151
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java
  3. 323
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java
  4. 77
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteHistoryMapper.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java
  6. 75
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseQuoteHistoryService.java
  7. 268
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  8. 126
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java
  9. 4
      ruoyi-admin/src/main/java/com/ruoyi/stock/controller/StockInfoController.java
  10. 38
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  11. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java
  12. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccountChild.java
  13. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java
  14. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExpenseAccountService.java
  15. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java
  16. 1
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml
  17. 180
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml
  18. 12
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  19. 4
      ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html
  20. 516
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/edit.html
  21. 12
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html
  22. 99
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html
  23. 162
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html
  24. 109
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/purchaseQuoteHistory.html
  25. 209
      ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html
  26. 42
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  27. 64
      ruoyi-admin/src/main/resources/templates/system/baseExpense/detail.html
  28. 530
      ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html
  29. 82
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html
  30. 79
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html
  31. 79
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskCwVerify.html
  32. 118
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskFzjlVerify.html
  33. 47
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskModifyApply.html
  34. 101
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskZozjVerify.html
  35. 2
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  36. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  37. 4
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  38. 4
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

3
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -360,7 +360,6 @@ public class PurchaseOrderController extends BaseController
// 使用状态-是 // 使用状态-是
purchaseOrderVo.setUseStatus("1"); purchaseOrderVo.setUseStatus("1");
purchaseOrderService.addPurchaseOrderPayable(purchaseOrderVo); purchaseOrderService.addPurchaseOrderPayable(purchaseOrderVo);
} }
// 作废 // 作废
else if("cancel".equals(instanceType)){ else if("cancel".equals(instanceType)){
@ -376,7 +375,7 @@ public class PurchaseOrderController extends BaseController
purchaseOrderService.updatePurchaseOrder(purchaseOrderVo); purchaseOrderService.updatePurchaseOrder(purchaseOrderVo);
// 驳回申请后继续申请,可能修改表单 // 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) { if (saveEntityBoolean) {
purchaseOrderService.updatePurchaseOrder(purchaseOrderVo); purchaseOrderService.updatePurchaseOrderCode(purchaseOrderVo);
} }
return success("任务已完成"); return success("任务已完成");
} }

151
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java

@ -0,0 +1,151 @@
package com.ruoyi.purchase.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.purchase.domain.PurchaseQuoteHistory;
import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService;
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-08-28
*/
@Controller
@RequestMapping("/purchaseQuoteHistory/purchaseQuoteHistory")
public class PurchaseQuoteHistoryController extends BaseController
{
private String prefix = "purchaseQuoteHistory/purchaseQuoteHistory";
@Autowired
private IPurchaseQuoteHistoryService purchaseQuoteHistoryService;
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:view")
@GetMapping()
public String purchaseQuoteHistory()
{
return prefix + "/purchaseQuoteHistory";
}
/**
* 查询采购物料历史报价信息列表
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(PurchaseQuoteHistory purchaseQuoteHistory)
{
startPage();
List<PurchaseQuoteHistory> list = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
return getDataTable(list);
}
/**
* 导出采购物料历史报价信息列表
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:export")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PurchaseQuoteHistory purchaseQuoteHistory)
{
List<PurchaseQuoteHistory> list = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
ExcelUtil<PurchaseQuoteHistory> util = new ExcelUtil<PurchaseQuoteHistory>(PurchaseQuoteHistory.class);
return util.exportExcel(list, "采购物料历史报价信息数据");
}
/**
* 新增采购物料历史报价信息
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存采购物料历史报价信息
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:add")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PurchaseQuoteHistory purchaseQuoteHistory)
{
return toAjax(purchaseQuoteHistoryService.insertPurchaseQuoteHistory(purchaseQuoteHistory));
}
/**
* 修改采购物料历史报价信息
*/
@GetMapping("/edit/{purchaseQuoteChildId}")
public String edit(@PathVariable("purchaseQuoteChildId") Long purchaseQuoteChildId, ModelMap mmap)
{
PurchaseQuoteHistory purchaseQuoteHistory = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryById(purchaseQuoteChildId);
mmap.put("purchaseQuoteHistory", purchaseQuoteHistory);
return prefix + "/edit";
}
/**
* 修改保存采购物料历史报价信息
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:edit")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(PurchaseQuoteHistory purchaseQuoteHistory)
{
return toAjax(purchaseQuoteHistoryService.updatePurchaseQuoteHistory(purchaseQuoteHistory));
}
/**
* 删除采购物料历史报价信息
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:remove")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(purchaseQuoteHistoryService.deletePurchaseQuoteHistoryByIds(ids));
}
/**
* 作废采购物料历史报价信息
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:cancel")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(purchaseQuoteHistoryService.cancelPurchaseQuoteHistoryById(id));
}
/**
* 恢复采购物料历史报价信息
*/
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:restore")
@Log(title = "采购物料历史报价信息", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(purchaseQuoteHistoryService.restorePurchaseQuoteHistoryById(id));
}
}

323
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java

@ -0,0 +1,323 @@
package com.ruoyi.purchase.domain;
import java.math.BigDecimal;
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;
/**
* 采购物料历史报价信息对象 purchase_quote_history
*
* @author zhang
* @date 2024-08-28
*/
public class PurchaseQuoteHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 采购报价历史id */
@Excel(name = "采购报价历史id")
private Long purchaseQuoteChildId;
/** 关联报价编号字段 */
@Excel(name = "关联报价编号字段")
private String purchaseQuoteCode;
/** 物料表中的id */
@Excel(name = "物料表中的id")
private Long materialId;
/** 物料表中的编号 */
@Excel(name = "物料表中的编号")
private String materialCode;
/** 物料的名称 */
@Excel(name = "物料的名称")
private String materialName;
/** 物料的类型 */
@Excel(name = "物料的类型")
private String materialType;
/** 物料的加工方式 */
@Excel(name = "物料的加工方式")
private String processMethod;
/** 物料的品牌 */
@Excel(name = "物料的品牌")
private String brand;
/** 物料的图片 */
@Excel(name = "物料的图片")
private String photoUrl;
/** 物料的描述 */
@Excel(name = "物料的描述")
private String describe;
/** 国内税率 */
@Excel(name = "国内税率")
private BigDecimal taxRate;
/** 美元汇率 */
@Excel(name = "美元汇率")
private BigDecimal usdRate;
/** 物料的数量 */
@Excel(name = "物料的数量")
private BigDecimal materialNum;
/** 物料的对外报价 */
@Excel(name = "物料的对外报价")
private Long materialSole;
/** 物料的不含税单价(RMB) */
@Excel(name = "物料的不含税单价(RMB)")
private BigDecimal materialRmb;
/** 物料的含税单价(RMB) */
@Excel(name = "物料的含税单价(RMB)")
private BigDecimal materialNormb;
/** 供应商编号 */
@Excel(name = "供应商编号")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 删除状态 */
@Excel(name = "删除状态")
private String useStatus;
/** 审核状态 */
@Excel(name = "审核状态")
private String auditStatus;
/** 删除标志 */
private String delFlag;
public void setPurchaseQuoteChildId(Long purchaseQuoteChildId)
{
this.purchaseQuoteChildId = purchaseQuoteChildId;
}
public Long getPurchaseQuoteChildId()
{
return purchaseQuoteChildId;
}
public void setPurchaseQuoteCode(String purchaseQuoteCode)
{
this.purchaseQuoteCode = purchaseQuoteCode;
}
public String getPurchaseQuoteCode()
{
return purchaseQuoteCode;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialType(String materialType)
{
this.materialType = materialType;
}
public String getMaterialType()
{
return materialType;
}
public void setProcessMethod(String processMethod)
{
this.processMethod = processMethod;
}
public String getProcessMethod()
{
return processMethod;
}
public void setBrand(String brand)
{
this.brand = brand;
}
public String getBrand()
{
return brand;
}
public void setPhotoUrl(String photoUrl)
{
this.photoUrl = photoUrl;
}
public String getPhotoUrl()
{
return photoUrl;
}
public void setDescribe(String describe)
{
this.describe = describe;
}
public String getDescribe()
{
return describe;
}
public void setTaxRate(BigDecimal taxRate)
{
this.taxRate = taxRate;
}
public BigDecimal getTaxRate()
{
return taxRate;
}
public void setUsdRate(BigDecimal usdRate)
{
this.usdRate = usdRate;
}
public BigDecimal getUsdRate()
{
return usdRate;
}
public void setMaterialNum(BigDecimal materialNum)
{
this.materialNum = materialNum;
}
public BigDecimal getMaterialNum()
{
return materialNum;
}
public void setMaterialSole(Long materialSole)
{
this.materialSole = materialSole;
}
public Long getMaterialSole()
{
return materialSole;
}
public void setMaterialRmb(BigDecimal materialRmb)
{
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNormb(BigDecimal materialNormb)
{
this.materialNormb = materialNormb;
}
public BigDecimal getMaterialNormb()
{
return materialNormb;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setUseStatus(String useStatus)
{
this.useStatus = useStatus;
}
public String getUseStatus()
{
return useStatus;
}
public void setAuditStatus(String auditStatus)
{
this.auditStatus = auditStatus;
}
public String getAuditStatus()
{
return auditStatus;
}
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("purchaseQuoteChildId", getPurchaseQuoteChildId())
.append("purchaseQuoteCode", getPurchaseQuoteCode())
.append("materialId", getMaterialId())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("processMethod", getProcessMethod())
.append("brand", getBrand())
.append("photoUrl", getPhotoUrl())
.append("describe", getDescribe())
.append("taxRate", getTaxRate())
.append("usdRate", getUsdRate())
.append("materialNum", getMaterialNum())
.append("materialSole", getMaterialSole())
.append("materialRmb", getMaterialRmb())
.append("materialNormb", getMaterialNormb())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("useStatus", getUseStatus())
.append("auditStatus", getAuditStatus())
.append("delFlag", getDelFlag())
.toString();
}
}

77
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteHistoryMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.purchase.mapper;
import java.util.List;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
/**
* 采购物料历史报价信息Mapper接口
*
* @author zhang
* @date 2024-08-28
*/
public interface PurchaseQuoteHistoryMapper
{
/**
* 查询采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 采购物料历史报价信息
*/
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 查询采购物料历史报价信息列表
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 采购物料历史报价信息集合
*/
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 新增采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 修改采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 删除采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 批量删除采购物料历史报价信息
*
* @param purchaseQuoteChildIds 需要删除的数据ID
* @return 结果
*/
public int deletePurchaseQuoteHistoryByIds(String[] purchaseQuoteChildIds);
/**
* 作废采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
public int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 恢复采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId);
}

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java

@ -51,6 +51,8 @@ public interface IPurchaseOrderService
*/ */
public int updatePurchaseOrder(PurchaseOrder purchaseOrder); public int updatePurchaseOrder(PurchaseOrder purchaseOrder);
int updatePurchaseOrderCode(PurchaseOrder purchaseOrder);
/** /**
* 批量删除采购订单 * 批量删除采购订单
* *

75
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseQuoteHistoryService.java

@ -0,0 +1,75 @@
package com.ruoyi.purchase.service;
import java.util.List;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
/**
* 采购物料历史报价信息Service接口
*
* @author zhang
* @date 2024-08-28
*/
public interface IPurchaseQuoteHistoryService
{
/**
* 查询采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 采购物料历史报价信息
*/
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 查询采购物料历史报价信息列表
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 采购物料历史报价信息集合
*/
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 新增采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 修改采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory);
/**
* 批量删除采购物料历史报价信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deletePurchaseQuoteHistoryByIds(String ids);
/**
* 删除采购物料历史报价信息信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 作废采购物料历史报价信息
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return
*/
int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 恢复采购物料历史报价信息
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return
*/
int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId);
}

268
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java

@ -26,7 +26,6 @@ import com.ruoyi.erp.domain.ErpDevelopModifyorder;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderMapper; import com.ruoyi.erp.mapper.ErpDevelopModifyorderMapper;
import com.ruoyi.financial.domain.FinancialAccountsPayable; import com.ruoyi.financial.domain.FinancialAccountsPayable;
import com.ruoyi.financial.mapper.FinancialAccountsPayableMapper; import com.ruoyi.financial.mapper.FinancialAccountsPayableMapper;
import com.ruoyi.financial.service.IFinancialAccountsPayableService;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.purchase.domain.PurchaseOrder; import com.ruoyi.purchase.domain.PurchaseOrder;
@ -40,7 +39,6 @@ import com.ruoyi.purchase.service.IPurchaseOrderService;
import com.ruoyi.system.domain.SysAttachFile; import com.ruoyi.system.domain.SysAttachFile;
import com.ruoyi.system.domain.SysCompanyInformation; import com.ruoyi.system.domain.SysCompanyInformation;
import com.ruoyi.system.domain.SysSupplier; import com.ruoyi.system.domain.SysSupplier;
import com.ruoyi.system.domain.Vo.SysSupplierVo;
import com.ruoyi.system.mapper.SysCompanyInformationMapper; import com.ruoyi.system.mapper.SysCompanyInformationMapper;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService; import com.ruoyi.system.service.ISysAttachFileService;
@ -57,7 +55,6 @@ import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task; import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -67,10 +64,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -513,14 +508,28 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
//获取物料供应商的信息,采购订单的供应商数量 //获取物料供应商的信息,采购订单的供应商数量
return 0; return 0;
} }
/** /**
* 修改采购订单 * 修改采购订单
* *
* @param purchaseOrder 采购订单 * @param purchaseOrder 采购订单
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updatePurchaseOrder(PurchaseOrder purchaseOrder) public int updatePurchaseOrder(PurchaseOrder purchaseOrder)
{
purchaseOrder.setCreateTime(DateUtils.getNowDate());
purchaseOrder.setCreateBy(ShiroUtils.getLoginName());
return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder);
}
/**
* 修改采购订单
*
* @param purchaseOrder 采购订单
* @return 结果
*/
@Override
public int updatePurchaseOrderCode(PurchaseOrder purchaseOrder)
{ {
// 初始化累加变量 // 初始化累加变量
BigDecimal materialNoRmb = BigDecimal.ZERO; BigDecimal materialNoRmb = BigDecimal.ZERO;
@ -537,84 +546,167 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList(); List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList();
//订单子表去除实际物料数量位null或者0的物料信息 //订单子表去除实际物料数量位null或者0的物料信息
purchaseOrderChildList = purchaseOrderChildList.stream().filter(child -> child.getMaterialRealNum() != null).collect(Collectors.toList()); purchaseOrderChildList = purchaseOrderChildList.stream().filter(child -> child.getMaterialRealNum() != null).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(purchaseOrderChildList)) { for (PurchaseOrderChild child : purchaseOrderChildList) {
purchaseOrderChildService.deletePurchaseOrderChildByPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); purchaseOrderChildService.deletePurchaseOrderChildByPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
for (PurchaseOrderChild child : purchaseOrderChildList) { if (child.getCorrelationCode().contains(","))
if (child.getCorrelationCode().contains(",")) { {
String[] correlationCodes = child.getCorrelationCode().split(",");
String[] planCodes = child.getPurchasePlanCode().split(",");
String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(",");
for (int i = 0; i < planCodes.length - 1; i++) {
String planCode = planCodes[i];
PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode);
if (planCode != null) {
PurchaseOrderChild material = new PurchaseOrderChild();
child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
//获取物料供应商不含税采购价格
BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb();
// 获取物料供应商含税采购价格
BigDecimal suplierMaterialRmb = child.getMaterialRealRmb();
// 获取物料数量
BigDecimal suplierMaterialNum = child.getMaterialRealNum();
if(suplierMaterialNoRmb == null){suplierMaterialNoRmb = BigDecimal.ZERO;}
if(suplierMaterialRmb == null){suplierMaterialRmb = BigDecimal.ZERO;}
if(suplierMaterialNum == null){suplierMaterialNum = new BigDecimal(0);}
//获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格
BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum);
//获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格
BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum);
// 累加物料数量
materialNum = materialNum.add(suplierMaterialNum);
// 累加物料总价
materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal);
// 累加物料含税总价
materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal);
// 设置采购报价单编号和供应商信息到QuoteChild
material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
material.setPurchasePlanCorrelationCode(correlationCodes[i]);
material.setSupplierCode(child.getSupplierCode());
material.setMaterialUnit(child.getMaterialUnit());
material.setWarehouseDept(child.getWarehouseDept());
material.setSupplierName(child.getSupplierName());
material.setMaterialCode(child.getMaterialCode());
material.setMaterialName(child.getMaterialName());
material.setMaterialBrand(child.getMaterialBrand());
material.setMaterialDescribe(child.getMaterialDescribe());
material.setMaterialPhotoUrl(child.getMaterialPhotoUrl());
material.setMaterialProcessMethod(child.getMaterialProcessMethod());
material.setWarehouseDept(child.getWarehouseDept());
//计划采购数
material.setMaterialNum(child.getMaterialNum());
material.setMaterialNoRmb(child.getMaterialNoRmb());
material.setMaterialRmb(child.getMaterialRmb());
material.setMaterialNoRmbSum(child.getMaterialNoRmbSum());
material.setMaterialRmbSum(child.getMaterialRmbSum());
//实际采购数
material.setMaterialRealNum(child.getMaterialRealNum());
material.setMaterialRealNoRmb(child.getMaterialRealNoRmb());
material.setMaterialRealRmb(child.getMaterialRealRmb());
//实际采购单价合计
material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal);
material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal);
material.setCorrelationCode(correlationCodes[i]);
material.setDeliveryTime(child.getDeliveryTime());
material.setPurchasePlanCode(planCode);
material.setPurchaseQuoteCode(child.getPurchaseQuoteCode());
//收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款
material.setEceiptStatus("0");
material.setPaymentStatus("0");
// 执行子表插入操作
purchaseOrderChildService.insertPurchaseOrderChild(material);
PurchasePlan plan = new PurchasePlan();
plan.setPurchasePlanCode(planCode);
plan.setPurchasePlanStatus("1");
int result = purchasePlanService.updatePurchasePlan(plan);
}
}
}
else if ((child.getPurchasePlanCode().contains(",") && !child.getCorrelationCode().contains(",")
&& child.getCorrelationCode()!= null)) {
String[] planCodes = child.getPurchasePlanCode().split(",");
for (int i = 0; i < planCodes.length - 1; i++) {
String[] correlationCodes = child.getCorrelationCode().split(","); String[] correlationCodes = child.getCorrelationCode().split(",");
String[] planCodes = child.getPurchasePlanCode().split(","); String[] planCode2 = child.getPurchasePlanCode().split(",");
String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(","); String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(",");
for (int i = 0; i < planCodes.length - 1; i++) { String planCode = planCode2[i];
String planCode = planCodes[i]; PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode);
PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); if (planCode != null) {
if (planCode != null) { PurchaseOrderChild material = new PurchaseOrderChild();
PurchaseOrderChild material = new PurchaseOrderChild(); child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); //获取物料供应商不含税采购价格
//获取物料供应商不含税采购价格 BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb();
BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); // 获取物料供应商含税采购价格
// 获取物料供应商含税采购价格 BigDecimal suplierMaterialRmb = child.getMaterialRealRmb();
BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); // 获取物料数量
// 获取物料数量 BigDecimal suplierMaterialNum = child.getMaterialRealNum();
BigDecimal suplierMaterialNum = child.getMaterialRealNum(); if (suplierMaterialNoRmb == null) {
if(suplierMaterialNoRmb == null){suplierMaterialNoRmb = BigDecimal.ZERO;} suplierMaterialNoRmb = BigDecimal.ZERO;
if(suplierMaterialRmb == null){suplierMaterialRmb = BigDecimal.ZERO;} }
if(suplierMaterialNum == null){suplierMaterialNum = new BigDecimal(0);} if (suplierMaterialRmb == null) {
//获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 suplierMaterialRmb = BigDecimal.ZERO;
BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum);
//获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格
BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum);
// 累加物料数量
materialNum = materialNum.add(suplierMaterialNum);
// 累加物料总价
materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal);
// 累加物料含税总价
materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal);
// 设置采购报价单编号和供应商信息到QuoteChild
material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
material.setPurchasePlanCorrelationCode(child.getCorrelationCode());
material.setSupplierCode(child.getSupplierCode());
material.setMaterialUnit(child.getMaterialUnit());
material.setWarehouseDept(child.getWarehouseDept());
material.setSupplierName(child.getSupplierName());
material.setMaterialCode(child.getMaterialCode());
material.setMaterialName(child.getMaterialName());
material.setMaterialBrand(child.getMaterialBrand());
material.setMaterialDescribe(child.getMaterialDescribe());
material.setMaterialPhotoUrl(child.getMaterialPhotoUrl());
material.setMaterialProcessMethod(child.getMaterialProcessMethod());
material.setWarehouseDept(child.getWarehouseDept());
//计划采购数
material.setMaterialNum(child.getMaterialNum());
material.setMaterialNoRmb(child.getMaterialNoRmb());
material.setMaterialRmb(child.getMaterialRmb());
material.setMaterialNoRmbSum(child.getMaterialNoRmbSum());
material.setMaterialRmbSum(child.getMaterialRmbSum());
//实际采购数
material.setMaterialRealNum(child.getMaterialRealNum());
material.setMaterialRealNoRmb(child.getMaterialRealNoRmb());
material.setMaterialRealRmb(child.getMaterialRealRmb());
//实际采购单价合计
material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal);
material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal);
material.setCorrelationCode(child.getCorrelationCode());
material.setDeliveryTime(child.getDeliveryTime());
material.setPurchasePlanCode(child.getPurchasePlanCode());
material.setPurchaseQuoteCode(child.getPurchaseQuoteCode());
//收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款
material.setEceiptStatus("0");
material.setPaymentStatus("0");
// 执行子表插入操作
purchaseOrderChildService.insertPurchaseOrderChild(material);
PurchasePlan plan = new PurchasePlan();
plan.setPurchasePlanCode(child.getPurchasePlanCode());
plan.setPurchasePlanStatus("1");
int result = purchasePlanService.updatePurchasePlan(plan);
} }
if (suplierMaterialNum == null) {
suplierMaterialNum = new BigDecimal(0);
}
//获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格
BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum);
//获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格
BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum);
// 累加物料数量
materialNum = materialNum.add(suplierMaterialNum);
// 累加物料总价
materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal);
// 累加物料含税总价
materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal);
// 设置采购报价单编号和供应商信息到QuoteChild
material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
material.setCorrelationCode(purchasePlan.getCorrelationCode());
material.setPurchasePlanCorrelationCode(correlationCodes[i]);
material.setSupplierCode(child.getSupplierCode());
material.setMaterialUnit(child.getMaterialUnit());
material.setWarehouseDept(child.getWarehouseDept());
material.setSupplierName(child.getSupplierName());
material.setMaterialCode(child.getMaterialCode());
material.setMaterialName(child.getMaterialName());
material.setMaterialBrand(child.getMaterialBrand());
material.setMaterialDescribe(child.getMaterialDescribe());
material.setMaterialPhotoUrl(child.getMaterialPhotoUrl());
material.setMaterialProcessMethod(child.getMaterialProcessMethod());
material.setWarehouseDept(child.getWarehouseDept());
//计划采购数
material.setMaterialNum(child.getMaterialNum());
material.setMaterialNoRmb(child.getMaterialNoRmb());
material.setMaterialRmb(child.getMaterialRmb());
material.setMaterialNoRmbSum(child.getMaterialNoRmbSum());
material.setMaterialRmbSum(child.getMaterialRmbSum());
//实际采购数
material.setMaterialRealNum(child.getMaterialRealNum());
material.setMaterialRealNoRmb(child.getMaterialRealNoRmb());
material.setMaterialRealRmb(child.getMaterialRealRmb());
material.setDeliveryTime(child.getDeliveryTime());
//实际采购单价合计
material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal);
material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal);
material.setCorrelationCode(child.getCorrelationCode());
material.setPurchasePlanCode(planCode);
material.setPurchaseQuoteCode(child.getPurchaseQuoteCode());
//收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款
material.setEceiptStatus("0");
material.setPaymentStatus("0");
// 执行子表插入操作
purchaseOrderChildService.insertPurchaseOrderChild(material);
PurchasePlan plan = new PurchasePlan();
plan.setPurchasePlanCode(planCode);
plan.setPurchasePlanStatus("1");
int result = purchasePlanService.updatePurchasePlan(plan);
} }
} }
else if ((!child.getCorrelationCode().contains(",")) }
&& child.getPurchasePlanCode() != null) { else if(child.getCorrelationCode().contains(",") && child.getCorrelationCode().contains(",") &&
PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(child.getPurchasePlanCode()); child.getPurchasePlanCode()!=null && child.getCorrelationCode()!=null){
String planCode = child.getPurchasePlanCode();
PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode);
if (planCode != null) {
PurchaseOrderChild material = new PurchaseOrderChild(); PurchaseOrderChild material = new PurchaseOrderChild();
child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
//获取物料供应商不含税采购价格 //获取物料供应商不含税采购价格
@ -623,15 +715,21 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); BigDecimal suplierMaterialRmb = child.getMaterialRealRmb();
// 获取物料数量 // 获取物料数量
BigDecimal suplierMaterialNum = child.getMaterialRealNum(); BigDecimal suplierMaterialNum = child.getMaterialRealNum();
if(suplierMaterialNoRmb == null){suplierMaterialNoRmb = BigDecimal.ZERO;} if (suplierMaterialNoRmb == null) {
if(suplierMaterialRmb == null){suplierMaterialRmb = BigDecimal.ZERO;} suplierMaterialNoRmb = BigDecimal.ZERO;
if(suplierMaterialNum == null){suplierMaterialNum = new BigDecimal(0);} }
if (suplierMaterialRmb == null) {
suplierMaterialRmb = BigDecimal.ZERO;
}
if (suplierMaterialNum == null) {
suplierMaterialNum = new BigDecimal(0);
}
//获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格
BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum);
//获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格
BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum);
// 累加物料数量 // 累加物料数量
materialNum = materialNum.add(suplierMaterialNum); materialNum = materialNum.add(suplierMaterialNum);
// 累加物料总价 // 累加物料总价
materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal);
// 累加物料含税总价 // 累加物料含税总价
@ -681,7 +779,9 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
} }
} }
} }
// 遍历处理采购订单子表// 设置累加的物料信息到子表// 设置主表的供应商数量 // 遍历处理采购订单子表
// 设置累加的物料信息到子表
// 设置主表的供应商数量
purchaseOrder.setSupplierNum(supplierNum); purchaseOrder.setSupplierNum(supplierNum);
purchaseOrder.setNoRmbSum(materialNoRmbSum); purchaseOrder.setNoRmbSum(materialNoRmbSum);
purchaseOrder.setRmbSum(materialRmbSum); purchaseOrder.setRmbSum(materialRmbSum);
@ -694,8 +794,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
Set<String> amountSet = purchaseOrder.getPurchaseOrderChildList().stream().map(PurchaseOrderChild::getMaterialCode).collect(Collectors.toSet()); Set<String> amountSet = purchaseOrder.getPurchaseOrderChildList().stream().map(PurchaseOrderChild::getMaterialCode).collect(Collectors.toSet());
Integer amount = amountSet.size(); Integer amount = amountSet.size();
purchaseOrder.setMaterialAmount(amount); purchaseOrder.setMaterialAmount(amount);
purchaseOrder.setCreateTime(DateUtils.getNowDate());
purchaseOrder.setCreateBy(ShiroUtils.getLoginName());
return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder);
} }

126
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java

@ -0,0 +1,126 @@
package com.ruoyi.purchase.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.purchase.mapper.PurchaseQuoteHistoryMapper;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService;
import com.ruoyi.common.core.text.Convert;
/**
* 采购物料历史报价信息Service业务层处理
*
* @author zhang
* @date 2024-08-28
*/
@Service
public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistoryService
{
@Autowired
private PurchaseQuoteHistoryMapper purchaseQuoteHistoryMapper;
/**
* 查询采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 采购物料历史报价信息
*/
@Override
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId)
{
return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryById(purchaseQuoteChildId);
}
/**
* 查询采购物料历史报价信息列表
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 采购物料历史报价信息
*/
@Override
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory)
{
return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
}
/**
* 新增采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
@Override
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory)
{
String loginName = ShiroUtils.getLoginName();
purchaseQuoteHistory.setCreateBy(loginName);
purchaseQuoteHistory.setCreateTime(DateUtils.getNowDate());
return purchaseQuoteHistoryMapper.insertPurchaseQuoteHistory(purchaseQuoteHistory);
}
/**
* 修改采购物料历史报价信息
*
* @param purchaseQuoteHistory 采购物料历史报价信息
* @return 结果
*/
@Override
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory)
{
String loginName = ShiroUtils.getLoginName();
purchaseQuoteHistory.setUpdateBy(loginName);
purchaseQuoteHistory.setUpdateTime(DateUtils.getNowDate());
return purchaseQuoteHistoryMapper.updatePurchaseQuoteHistory(purchaseQuoteHistory);
}
/**
* 删除采购物料历史报价信息对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deletePurchaseQuoteHistoryByIds(String ids)
{
return purchaseQuoteHistoryMapper.deletePurchaseQuoteHistoryByIds(Convert.toStrArray(ids));
}
/**
* 删除采购物料历史报价信息信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
@Override
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId)
{
return purchaseQuoteHistoryMapper.deletePurchaseQuoteHistoryById(purchaseQuoteChildId);
}
/**
* 作废采购物料历史报价信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
@Override
public int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId)
{
return purchaseQuoteHistoryMapper.cancelPurchaseQuoteHistoryById(purchaseQuoteChildId);
}
/**
* 恢复采购物料历史报价信息信息
*
* @param purchaseQuoteChildId 采购物料历史报价信息ID
* @return 结果
*/
@Override
public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId)
{
return purchaseQuoteHistoryMapper.restorePurchaseQuoteHistoryById(purchaseQuoteChildId);
}
}

4
ruoyi-admin/src/main/java/com/ruoyi/stock/controller/StockInfoController.java

@ -90,8 +90,8 @@ public class StockInfoController extends BaseController
/** /**
* 修改仓库信息 * 修改仓库信息
*/ */
@GetMapping("/edit/{Id}") @GetMapping("/edit/{id}")
public String edit(@PathVariable("Id") Long id, ModelMap mmap) public String edit(@PathVariable("id") Long id, ModelMap mmap)
{ {
StockInfo stockInfo = stockInfoService.selectStockInfoById(id); StockInfo stockInfo = stockInfoService.selectStockInfoById(id);
mmap.put("stockInfo", stockInfo); mmap.put("stockInfo", stockInfo);

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

@ -2,8 +2,12 @@ package com.ruoyi.system.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
@ -92,6 +96,30 @@ public class BaseExpenseAccountController extends BaseController
public TableDataInfo list(BaseExpenseAccountVo baseExpenseAccount) public TableDataInfo list(BaseExpenseAccountVo baseExpenseAccount)
{ {
startPage(); startPage();
// SysUser curUser = ShiroUtils.getSysUser();
// String loginName = ShiroUtils.getLoginName();
// Long userId = curUser.getUserId();
// Set<String> roleKeys = roleService.selectRoleKeys(userId);
// List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
// sysUserlist.add(curUser);
// //如果当前登录人的角色中包含下面其中之一,包含角色为(总经理、财务经理、财务主管、财务、 超级管理)可以查看所有的报销信息
// if(roleKeys.contains("zjlRole") || roleKeys.contains("zozjRole") || roleKeys.contains("fzjlRole") ||
// roleKeys.contains("cwyRole") || roleKeys.contains("cwjlRole") || roleKeys.contains("cwzgRole") ||
// roleKeys.contains("admin")){
// List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
// return getDataTable(list);
// }else if(roleKeys.contains(",")) {
// //部门主管查询部门的所有,查看对应部门下的所有报销单
// List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
// List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
// List<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList());
// return getDataTable(list);
// }
// if (roleKeys.contains("jlRole")) {
// List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
// List<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList());
//// String userStr = String.join(",", user);
// }
List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount); List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
return getDataTable(list); return getDataTable(list);
} }
@ -103,7 +131,7 @@ public class BaseExpenseAccountController extends BaseController
@Log(title = "报销单", businessType = BusinessType.EXPORT) @Log(title = "报销单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(BaseExpenseAccount baseExpenseAccount) public AjaxResult export(BaseExpenseAccountVo baseExpenseAccount)
{ {
List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount); List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class); ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class);
@ -221,7 +249,7 @@ public class BaseExpenseAccountController extends BaseController
if (processIsFinish) { if (processIsFinish) {
// 审核通过 // 审核通过
baseExpenseAccountVo.setAuditStatus("1"); baseExpenseAccountVo.setAuditStatus("1");
baseExpenseAccountVo.setFinanceAuditStatus("1"); baseExpenseAccountVo.setFinanceAuditStatus("0");
baseExpenseAccountVo.setManagerAuditStatus("1"); baseExpenseAccountVo.setManagerAuditStatus("1");
// 提交 // 提交
if("submit".equals(instanceType)){ if("submit".equals(instanceType)){
@ -274,4 +302,10 @@ public class BaseExpenseAccountController extends BaseController
public AjaxResult getId(){ public AjaxResult getId(){
return AjaxResult.success(baseExpenseAccountService.getId()); return AjaxResult.success(baseExpenseAccountService.getId());
} }
@RequestMapping("/getExpenseUser")
@ResponseBody
public AjaxResult getExpenseCode() throws Exception {
return AjaxResult.success(sysUserService.selectUserAll());
}
} }

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

@ -101,6 +101,7 @@ public class BaseExpenseAccount extends BaseEntity
/** 申请人 */ /** 申请人 */
private String applyTitle; private String applyTitle;
/** 申请时间 */ /** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyTime; private Date applyTime;

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

@ -60,6 +60,8 @@ public class BaseExpenseAccountChild extends BaseEntity
/** 删除状态 */ /** 删除状态 */
private String delFlag; private String delFlag;
private Integer index;
public void setExpenseChildId(Long expenseChildId) public void setExpenseChildId(Long expenseChildId)
{ {
this.expenseChildId = expenseChildId; this.expenseChildId = expenseChildId;
@ -160,6 +162,14 @@ public class BaseExpenseAccountChild extends BaseEntity
return delFlag; return delFlag;
} }
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@ -26,7 +26,7 @@ public interface BaseExpenseAccountMapper
* @param baseExpenseAccount 报销单 * @param baseExpenseAccount 报销单
* @return 报销单集合 * @return 报销单集合
*/ */
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount); public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount);
/** /**
* 新增报销单 * 新增报销单

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

@ -28,7 +28,9 @@ public interface IBaseExpenseAccountService
* @param baseExpenseAccount 报销单 * @param baseExpenseAccount 报销单
* @return 报销单集合 * @return 报销单集合
*/ */
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount); // public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount);
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount);
/** /**
* 新增报销单 * 新增报销单

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

@ -7,7 +7,6 @@ import java.util.Set;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.page.TableSupport;
@ -78,7 +77,12 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
@Override @Override
public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId) public BaseExpenseAccountVo selectBaseExpenseAccountById(Long expenseId)
{ {
return baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId); BaseExpenseAccountVo baseExpenseAccountVo = baseExpenseAccountMapper.selectBaseExpenseAccountById(expenseId);
SysUser sysUser2 = userMapper.selectUserByLoginName(baseExpenseAccountVo.getApplyUser());
if (sysUser2!=null){
baseExpenseAccountVo.setApplyUserName(sysUser2.getUserName());
}
return baseExpenseAccountVo;
} }
/** /**
@ -88,7 +92,7 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
* @return 报销单 * @return 报销单
*/ */
@Override @Override
public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccount baseExpenseAccount) public List<BaseExpenseAccountVo> selectBaseExpenseAccountList(BaseExpenseAccountVo baseExpenseAccount)
{ {
PageDomain pageDomain = TableSupport.buildPageRequest(); PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum(); Integer pageNum = pageDomain.getPageNum();

1
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml

@ -103,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierName != null and supplierName != ''"> <if test="supplierName != null and supplierName != ''">
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName}) and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName})
</if> </if>
<if test="auditStatus != null and auditStatus != ''">and pur.audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''">and pur.use_status = #{useStatus}</if> <if test="useStatus != null and useStatus != ''">and pur.use_status = #{useStatus}</if>
<if test="eceiptStatus != null and eceiptStatus !='' ">and pur.eceipt_status = #{eceiptStatus}</if> <if test="eceiptStatus != null and eceiptStatus !='' ">and pur.eceipt_status = #{eceiptStatus}</if>
<if test="paymentStatus != null and paymentStatus != '' ">and pur.payment_status = #{paymentStatus}</if> <if test="paymentStatus != null and paymentStatus != '' ">and pur.payment_status = #{paymentStatus}</if>

180
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml

@ -0,0 +1,180 @@
<?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.purchase.mapper.PurchaseQuoteHistoryMapper">
<resultMap type="PurchaseQuoteHistory" id="PurchaseQuoteHistoryResult">
<result property="purchaseQuoteChildId" column="purchase_quote_child_id" />
<result property="purchaseQuoteCode" column="purchase_quote_code" />
<result property="materialId" column="material_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="processMethod" column="processMethod" />
<result property="brand" column="brand" />
<result property="photoUrl" column="photoUrl" />
<result property="describe" column="describe" />
<result property="taxRate" column="tax_rate" />
<result property="usdRate" column="usd_rate" />
<result property="materialNum" column="material_num" />
<result property="materialSole" column="material_sole" />
<result property="materialRmb" column="material_rmb" />
<result property="materialNormb" column="material_noRmb" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<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="auditStatus" column="audit_status" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPurchaseQuoteHistoryVo">
select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_type, processMethod, brand, photoUrl, describe, tax_rate, usd_rate, material_num, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, del_flag from purchase_quote_history
</sql>
<select id="selectPurchaseQuoteHistoryList" parameterType="PurchaseQuoteHistory" resultMap="PurchaseQuoteHistoryResult">
<include refid="selectPurchaseQuoteHistoryVo"/>
<where>
<if test="purchaseQuoteChildId != null "> and purchase_quote_child_id = #{purchaseQuoteChildId}</if>
<if test="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase_quote_code = #{purchaseQuoteCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="processMethod != null and processMethod != ''"> and processMethod = #{processMethod}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="photoUrl != null and photoUrl != ''"> and photoUrl = #{photoUrl}</if>
<if test="describe != null and describe != ''"> and describe = #{describe}</if>
<if test="taxRate != null "> and tax_rate = #{taxRate}</if>
<if test="usdRate != null "> and usd_rate = #{usdRate}</if>
<if test="materialNum != null "> and material_num = #{materialNum}</if>
<if test="materialSole != null "> and material_sole = #{materialSole}</if>
<if test="materialRmb != null "> and material_rmb = #{materialRmb}</if>
<if test="materialNormb != null "> and material_noRmb = #{materialNormb}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
</where>
</select>
<select id="selectPurchaseQuoteHistoryById" parameterType="Long" resultMap="PurchaseQuoteHistoryResult">
<include refid="selectPurchaseQuoteHistoryVo"/>
where purchase_quote_child_id = #{purchaseQuoteChildId}
</select>
<insert id="insertPurchaseQuoteHistory" parameterType="PurchaseQuoteHistory" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId">
insert into purchase_quote_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseQuoteCode != null">purchase_quote_code,</if>
<if test="materialId != null">material_id,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="processMethod != null">processMethod,</if>
<if test="brand != null">brand,</if>
<if test="photoUrl != null">photoUrl,</if>
<if test="describe != null">describe,</if>
<if test="taxRate != null">tax_rate,</if>
<if test="usdRate != null">usd_rate,</if>
<if test="materialNum != null">material_num,</if>
<if test="materialSole != null">material_sole,</if>
<if test="materialRmb != null">material_rmb,</if>
<if test="materialNormb != null">material_noRmb,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</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="auditStatus != null">audit_status,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseQuoteCode != null">#{purchaseQuoteCode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="processMethod != null">#{processMethod},</if>
<if test="brand != null">#{brand},</if>
<if test="photoUrl != null">#{photoUrl},</if>
<if test="describe != null">#{describe},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="usdRate != null">#{usdRate},</if>
<if test="materialNum != null">#{materialNum},</if>
<if test="materialSole != null">#{materialSole},</if>
<if test="materialRmb != null">#{materialRmb},</if>
<if test="materialNormb != null">#{materialNormb},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</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="auditStatus != null">#{auditStatus},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePurchaseQuoteHistory" parameterType="PurchaseQuoteHistory">
update purchase_quote_history
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseQuoteCode != null">purchase_quote_code = #{purchaseQuoteCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="processMethod != null">processMethod = #{processMethod},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="photoUrl != null">photoUrl = #{photoUrl},</if>
<if test="describe != null">describe = #{describe},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if>
<if test="usdRate != null">usd_rate = #{usdRate},</if>
<if test="materialNum != null">material_num = #{materialNum},</if>
<if test="materialSole != null">material_sole = #{materialSole},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if>
<if test="materialNormb != null">material_noRmb = #{materialNormb},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</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="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>
<delete id="deletePurchaseQuoteHistoryById" parameterType="Long">
delete from purchase_quote_history where purchase_quote_child_id = #{purchaseQuoteChildId}
</delete>
<delete id="deletePurchaseQuoteHistoryByIds" parameterType="String">
delete from purchase_quote_history where purchase_quote_child_id in
<foreach item="purchaseQuoteChildId" collection="array" open="(" separator="," close=")">
#{purchaseQuoteChildId}
</foreach>
</delete>
<update id="cancelPurchaseQuoteHistoryById" parameterType="Long">
update purchase_quote_history set del_flag = '1' where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>
<update id="restorePurchaseQuoteHistoryById" parameterType="Long">
update purchase_quote_history set del_flag = '0' where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>
</mapper>

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

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_expense_account from base_expense_account
</sql> </sql>
<select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccount" resultMap="BaseExpenseAccountResult"> <select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccountVo" resultMap="BaseExpenseAccountResult">
select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status, select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status,
b.expense_code, b.deptName, b.postName, b.fullName, b.expense_method, b.is_purchase_outsource, b.expense_code, b.deptName, b.postName, b.fullName, b.expense_method, b.is_purchase_outsource,
b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks, b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks,
@ -79,13 +79,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null and applyUser != ''"> and b.apply_user = #{applyUser}</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="applyTime != null "> and b.apply_time = #{applyTime}</if>
<if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if> <if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if>
<if test="params.costType != null">and <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
or expense_code in ( and b.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="params.costType != null">
and expense_code in (
select expense_code select expense_code
from ck_equipCodeChild from ck_equipCodeChild
<where> <where>
<if test="params.costType != null">and cost_type = #{params.costType}</if> <if test="params.costType != null">and cost_type = #{params.costType}</if>
<if test="params.costSmallType != null">and cost_small_type = #{params.costTypeName}</if> <if test="params.costSmallType != null">and cost_small_type = #{params.costTypeName}</if>
<if test="params.evectionCode != null">and evection_code like concat('%',#{params.evectionCode},'%') </if>
<if test="params.outsourceCode != null">and outsource_code like concat('%',#{params.outsourceCode},'%') </if>
<if test="params.purchaseCode != null">and purchase_code like concat('%',#{params.purchaseCode},'%') </if>
</where> </where>
) )
</if> </if>

4
ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html

@ -234,10 +234,6 @@
function exportReceivablesVoucher() { function exportReceivablesVoucher() {
//导出前需要确定借方明细 //导出前需要确定借方明细
var bootstrap = $("#bootstrap-table").bootstrapTable('getSelections'); var bootstrap = $("#bootstrap-table").bootstrapTable('getSelections');
if ($.common.isEmpty(bootstrap.debitAccount) || $.common.isEmpty(bootstrap.debitBank)) {
$.modal.alertWarning("请先添加借方明细");
return;
}
var financialReceivablesId = bootstrap[0].financialReceivablesId; var financialReceivablesId = bootstrap[0].financialReceivablesId;
if (bootstrap.length !== 1) { if (bootstrap.length !== 1) {
$.modal.alertWarning("请选择一条数据"); $.modal.alertWarning("请选择一条数据");

516
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/edit.html

@ -69,19 +69,19 @@
<div class="form-group"> <div class="form-group">
<label for="purchaseMaterialSum" class="col-sm-2 col-form-label">物料合计:</label> <label for="purchaseMaterialSum" class="col-sm-2 col-form-label">物料合计:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" value="0" id="purchaseMaterialSum"> <input type="text" class="form-control" id="purchaseMaterialSum">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="purchaseSum" class="col-sm-2 col-form-label">采购合计:</label> <label for="purchaseSum" class="col-sm-2 col-form-label">采购合计:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" value="0" id="purchaseSum"> <input type="text" class="form-control" id="purchaseSum">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="purchaseNoRmbSum" class="col-sm-2 col-form-label">不含税采购总价:</label> <label for="purchaseNoRmbSum" class="col-sm-2 col-form-label">不含税采购总价:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" value="0" id="purchaseNoRmbSum"> <input type="text" class="form-control" id="purchaseNoRmbSum">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -99,8 +99,8 @@
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
import JSOn from "./swagger-ui-bundle"; import JSOn from "./swagger-ui-bundle";
var prefix = ctx + "purchase/purchaseOrder"; var prefix = ctx + "purchase/purchaseOrder";
var purchaseOrder = [[${formData}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
@ -108,18 +108,24 @@
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$("#form-purchaseOrder-edit").validate({focusCleanup: true}); $("#form-purchaseOrder-edit").validate({focusCleanup: true});
// var purchasePlanChildList = [[${purchasePlanChildList}]]; var purchasePlanChildList = [];
// var purchasePlanList = [[${purchasePlanList}]]; var purchasePlanCodes = [];
var purchasePlanCodes = [[${purchasePlanCodes}]]; var formId = "form-purchaseOrder-edit";
var formId = "form-plan-purchaseOrder-add";
//根据物料物料数量添加物料分类表,自动生成类似的表单对象 //根据物料物料数量添加物料分类表,自动生成类似的表单对象
//初始根据采购计划单,涉及到物料做分类表 //初始根据采购计划单,涉及到物料做分类表
//根据采购计划单,获取物料信息,自动生成物料的供应商分类表 //根据采购计划单,获取物料信息,自动生成物料的供应商分类表
//获取表单的id; //获取表单的id;
var materialList = []; var materialList = [];
var tableIdList = []; var tableIdList = [];
var $supplierForm;
var tableDatas = [];
//获取采购计划单的物料信息
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
$(function() { $(function() {
$("#purchasePlanCodes").val(purchasePlanCodes); // 初始化时默认加载仓库ID列表
// 假设purchaseOrderCode已经定义或者可以通过某种方式获取到
var purchaseOrderCode = [[${formData.purchaseOrderCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
var purchaseOrderId = [[${formData.purchaseOrderId}]];
loadWarehouseCodes(); loadWarehouseCodes();
//物料合计 = 物料实际采购数合计,不含税总价,含税采购总价不为null的情况可以合计物料,否则跳过 //物料合计 = 物料实际采购数合计,不含税总价,含税采购总价不为null的情况可以合计物料,否则跳过
$("#purchaseMaterialSum").val(purchaseOrder.materialSum); $("#purchaseMaterialSum").val(purchaseOrder.materialSum);
@ -129,103 +135,421 @@
$('#purchaseNoRmbSum').val(purchaseOrder.noRmbSum); $('#purchaseNoRmbSum').val(purchaseOrder.noRmbSum);
//采购含税总价 //采购含税总价
$('#purchaseRmbSum').val(purchaseOrder.rmbSum); $('#purchaseRmbSum').val(purchaseOrder.rmbSum);
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var purchaseOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
var purchaseOrderId = [[${purchaseOrder.purchaseOrderId}]];
// 初始化表格,假设purchasePlanChildList已定义并包含了需要处理的数据 // 初始化表格,假设purchasePlanChildList已定义并包含了需要处理的数据
$.getJSON(prefix + "/editPurchaserOrder/" + purchaseOrderId, function(data) { $.getJSON(prefix + "/editPurchaserOrder/" + purchaseOrderId, function(data) {
console.log("获取采购订单数据"); $("#purchasePlanCodes").val(data.data.purchasePlanCodes);
console.log(JSOn.stringify(data)); var datas = data.data.purchasePlanChildList;
for (var supplierCode in data) { purchasePlanChildList = datas;
if (data.hasOwnProperty(supplierCode)) { var supplierCodes = data.data.supplierCodes;
var supplierData = data[supplierCode]; var supplierMaterials = {};
datas.forEach(function(item) {
var supplierCode = item.supplierCode;
var materialCode = item.materialCode;
// 如果供应商还没有在对象中,就创建一个新的对象
if (!supplierMaterials[supplierCode]) {supplierMaterials[supplierCode] = {};}
// 如果该物料还没有在供应商的对象中,就添加它
if (!supplierMaterials[supplierCode][materialCode]) {
supplierMaterials[supplierCode][materialCode] = {
...item, materialNum: 0 // 初始化数量为0
};
}
supplierMaterials[supplierCode][materialCode].materialNum += item.materialNum;
});
for (var supplierCode in supplierMaterials) {
if (supplierMaterials.hasOwnProperty(supplierCode)) {
var supplierData = Object.values(supplierMaterials[supplierCode]);
createTableForSupplier(supplierCode, supplierData); createTableForSupplier(supplierCode, supplierData);
} }
} }
}); //按照物料的维度查看采购订单信息
// 初始化表格
// 假设purchasePlanChildList已定义并包含了需要处理的数据
//物料列表
purchasePlanChildList.forEach(function (material, index) {
var tableId = 'materialCode-' + index;
var materialTable = "bootstrap-table_" + tableId;
tableIdList.push(tableId);
// 创建物料信息的容器
var $tableWrapper = $('<div id="material-' + tableId + '""></div>');
// 将整个物料信息容器添加到页面
$('#purchasePlanMaterial').append($tableWrapper);
var uniqueSuppliers = [];
////如果物料相同,则添加供应商信息,并对比现在的关系采购计划关联单号是否有包含,没有添加。有则不添加
material.purchaseOrderChildSupplierList.forEach(supplier => {
const key = `${supplier.supplierCode}_${supplier.materialCode}`;
if (!uniqueSuppliers.map(s => `${s.supplierCode}_${s.materialCode}`).includes(key)) {
uniqueSuppliers.push(supplier);
}
});
// 添加关联销售订单号信息
// 创建表格的容器
var $headerDiv =
$('<div class="row">' +
'<div class="col-xs-12">' +
'<h3>' +
'<span><strong>物料 ' + (index + 1) + ': </strong><strong>关联订单号: </strong></span><span class="correlationCodes" id="correlateion-' + tableId + ' ">' + material.purchasePlanCorrelationCode + '</span>' +
'</h3>' +
'<div class="col-sm-12">' +
'<table class="table-materialCode" id="' + materialTable + '">' + '<table/>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($headerDiv);
//创建物料库存容器
var $stockWrapper = $('<div class="row"><div class="inventory-count " id=" inventory-count-' + tableId + '">'+
'<span><strong>可用库存数:</strong></span>'+'<span id="stock-count-' + tableId + '">10 </span>'+'<span>注:含其他订单待领取的库存,仅供参考,请以实际为准.</span>'+
'</div></div>');
$tableWrapper.append($stockWrapper);
var materialObj = {
purchasePlanCode: material.purchasePlanCode, materialCode: material.materialCode,
photoUrl: material.materialPhotourl, materialName: material.materialName,
materialType: material.materialType, describe: material.materialDescribe,
brand: material.materiaBrand, processMethod: material.materialProcessMethod,
unit: material.materialUnit, warehouseDept:material.warehouseDept,
materialNum: material.materialNum,
};
var materialData = [materialObj];
materialList.push(material);
tables(materialTable, materialData);
var supplierCode = material.supplierCode;
if (supplierCodes.includes(supplierCode)) {
var supplierInfo = $('#supplierInfo_' + tableId);
if (supplierInfo.length === 0) {
var $supplierInfo = $('<div class="supplier-card " style="height: 20px;" id="supplierInfo_' + tableId + '"></div>');
$tableWrapper.append($supplierInfo);
}
var supplierData = material.purchaseOrderChildSupplierList;
supplierData.forEach(function (supplier) {
var supplierCode = supplier.supplierCode;
});
}
//如果物料下的供应商为空,则不需要添加供应商信息,并在容器中添加一个提示信息:暂无供应商信息,请先添加供应商信息。
if (material.purchaseOrderChildSupplierList.length <= 0) {
var $noSupplierDiv = $('<div class="no-supplier">暂无供应商信息,请先添加供应商信息。</div>');
$tableWrapper.append($noSupplierDiv);
}
else{
// 循环处理每个供应商的信息
uniqueSuppliers.forEach(function (supplier, supplierIndex) {
//如果供应商相同,则不需要再次添加供应商信息
// 卡片样式容器,用于包裹每个供应商的信息
// 构建供应商信息头部
var $headerContent =
$( '<div class="card-header supplier_card" id = "supplier-' + tableId + '_' + supplierIndex + '" xmlns="http://www.w3.org/1999/html">' +
'<div class="row">' +
'<div class="crad-text">'+
'<span><strong>供应商 ' + (supplierIndex + 1) + ': </strong></span>' + '<span class="supplierCode">' + supplier.supplierCode + '</span>' + '-' + '<span class="supplierName">' + supplier.supplierName + '</span>' +
'-最新不含税采购价: ' +'<span id="supplierMaterialNoRmb-' + tableId + '" class="supplierMaterialNoRmb"></strong>' + supplier.materialRealNoRmb +'</strong></span>'+
' RMB 最新含税采购价: ' +'<span class="supplierMaterialRmb"><strong>' + supplier.materialRealRmb + '</strong> RMB </span>' +
'<span class="supplierPurchasePlanCode" hidden="hidden" >' + material.planCodes + '</span>' +
'<span class="supplierCorrelationCode" hidden="hidden" >' + material.correlationCode + '</span>' +
'<span class="supplierPurchaseQuoteCode" hidden="hidden" >' + supplier.purchaseQuoteCode + '</span>' +
'</div>' +
'</div>' +
'<div class="row">' +
'<div class="col-xs-6 form-group">' +
'<label class="col-sm-4"> 实际采购数: </label>' +
'<div class ="col-sm-6">' +
'<input type="text" name="materialNum" value="' + supplier.materialRealNum + '" class="form-control supplierMaterialNum actualPurchaseNum" id="actualPurchaseNum_' + tableId + '" disabled>' +
'</div>' +
'</div>' +
'<div class="col-xs-6 form-group">' +
'<label class="col-sm-4">计划交付时间: </label>' +
'<div class ="col-sm-6">' +
'<div class="input-group date"> ' +
'<input type="text" name="deliveryTime" value="' + supplier.deliveryTime + '" text="' + supplier.deliveryTime + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + tableId + '" disabled >' +
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' +
'</div> ' +
'</div>' +
'</div>' +
'</div>' +
'</div>');
if (supplier.supplierCode != undefined && supplier.supplierCode != '' && supplier.supplierCode != null) {
$supplierInfo.append($headerContent);
// 构建供应商信息下的输入表单
$supplierForm = $('<div class="card-body" id="card_body_' + tableId + '"></div>');
// 实际采购数输入框
// 其他表单项可以根据需要类似添加
$supplierInfo.append($supplierForm);
}else{
var $noSupplierDiv = $('<div class="no-supplier">暂无供应商信息,请先添加供应商信息。</div>');
$supplierInfo.append($noSupplierDiv);
}
});
$tableWrapper.append($supplierInfo);
}
tableSetup($supplierInfo, tableId);
});
// 给实际采购数的输入框绑定事件处理器
$('.actualPurchaseNum').off('keyup').on('keyup', function(event) {
if (event.keyCode === 13) {
var $supplierInfo = $(this).closest('.supplier-card');
var $supplierCard = $(this).closest('.supplier_card');
var crad = $supplierInfo.attr('id');
var tableId = crad.split('_')[1];
var purchaseNum = parseFloat($(this).val()) || 0;
var noRmbPrice = parseFloat($(this).find('.supplierMaterialNoRmb').text().trim()) || 0;
var rmbPrice = parseFloat($(this).find('.supplierMaterialRmb').text().trim()) || 0;
var materialIndex = tableId.split('-')[1];
// 确保实际采购数不超过计划采购数
var maxPurchaseNum = parseFloat(materialList[materialIndex].materialNum);
// if (purchaseNum > maxPurchaseNum) {
// purchaseNum = maxPurchaseNum;
// $(this).val(maxPurchaseNum);
// }
//物料所有的供应商的采购数加起来超出了materialList[materialIndex].materialNum,就提示超出计划采购数
let actualPurchaseNum = 0;
$supplierCard.find('.actualPurchaseNum').each(function () {
actualPurchaseNum += parseInt($(this).val()) || 0;
});
if (actualPurchaseNum > maxPurchaseNum) {
actualPurchaseNum - maxPurchaseNum;
}
// 更新供应商采购总价
$supplierInfo.find('.supplierPurchaseTotal').val(parseFloat(Number(purchaseNum * noRmbPrice).toFixed(2)));
if (rmbPrice) {
$supplierInfo.find('.supplierPurchaseTotalRmb').val(parseFloat(Number(purchaseNum * rmbPrice).toFixed(2)));
}
// 如果采购数量大于0,则显示供应商采购总价
if (purchaseNum > 0) {
$supplierInfo.find('.supplierPurchaseTotal').removeClass('hidden');
$supplierInfo.find('.supplierPurchaseTotalRmb').removeClass('hidden');
} else {
// 否则隐藏供应商采购总价
$supplierInfo.find('.supplierPurchaseTotal').addClass('hidden');
$supplierInfo.find('.supplierPurchaseTotalRmb').addClass('hidden');
}
recalculateTotals(tableId); // 重新计算当前物料的合计
}
});
// 定义一个函数来重新计算当前物料的合计
// 初始化总计
purchasePlanChildList.forEach(function (material, index) {recalculateTotals('materialCode-' + index);});
});
}); });
function createTableForSupplier(supplierCode, supplierData) { function createTableForSupplier(supplierCode, supplierData) {
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase(); var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId); tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive"></div>'); var $tableWrapper = $('<div class="table-responsive"></div>');
// 确保supplierData至少有一条记录,并从中提取供应商详细信息 // 确保supplierData至少有一条记录,并从中提取供应商详细信息
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在 var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外供应商信息的标题字符串 // 构建含有额外供应商信息的标题字符串
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + supplierInfo.supplierName ; var headerTitle = '供应商: ' + supplierCode + ' - ' + supplierInfo.supplierName;
var $header = $('<h4>' + headerTitle + '</h4>'); var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>'); var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({ $table.bootstrapTable({
data: supplierData, data: supplierData,
columns: [ columns: [
{checkbox: false,visible: false}, { checkbox: false, visible: false },
{title: '供应商ID',field: 'supplierCode',visible: false}, { title: '供应商ID', field: 'supplierCode', visible: false },
{title: '料号',field: 'materialCode'}, { title: '料号', field: 'materialCode' },
{title: '物料名称',field: 'materialName'}, { title: '图片', field: 'materialPhotoUrl',
{title: '物料类型',field: 'materialType', formatter: function(value, row, index) {return $.table.imageView(value);}
formatter: function (value,row, index) { },
$.table.selectCategoryLabel(materialTypeDatas, value) { title: '物料名称', field: 'materialName' },
} { title: '物料类型', field: 'materialType', align: 'center',
}, formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}
{title: '物料图片地址',field: 'materialPhotourl', },
formatter: function (value, row, index) { { title: '物料描述', field: 'materialDescribe' },
$.table.imageView(value) { title: '品牌', field: 'materialBrand' },
} { title: '加工类型', field: 'materialProcessMethod', align: 'center',
}, formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}
{title: '物料描述',field: 'materialDescribe',}, },
{title: '物料品牌',field: 'materialBrand',}, { title: '单位', field: 'materialUnit', align: 'center' },
{title: '物料单位',field: 'materialUnit', { title: '入库部门', field: 'warehouseDept', align: 'center',
formatter:function (value) { formatter: function(value, row, index) {return $.table.selectDictLabel(warehouseDeptDatas, value);}
return $.table.selectDictLabel(materialUnitDatas, value); },
} { title: '计划采购数', field: 'materialNum' },
}, { title: '币种', field: '' },
{title: '物料加工方式',field: 'materialProcessMethod', { title: '不含税采购价', field: 'materialNoRmb' },
formatter:function (value) { { title: '含税采购价', field: 'materialRmb' },
return $.table.selectDictLabel(processMethodDatas, value); { title: '实际采购数', field: 'materialRealNum' },
} { title: '实际不含税采购金额', field: 'materialRealNoRmb' },
}, { title: '实际含税采购金额', field: 'materialRealRmb' },
{title: '入库部门',field: 'warehouseDept',visible: false, { title: '已入库数', field: 'actualHasArrivedNum' },
formatter:function (value) { ]
return $.table.selectDictLabel(warehouseDeptDatas, value); });
} $tableWrapper.append($header).append($table);
}, $('#supplierMaterial').append($tableWrapper);
{title: '计划采购数',field: 'materialNum',}, }
{title: '实际采购数',field: 'materialRealNum',}, // 新增函数:重新计算某物料的采购数量合计、不含税采购总价和含税采购总价
{title: '交付时间',field: 'deliveryTime',}, function recalculateTotals(tableId) {
{title: '通知已到货数',field: 'notifyHasArrivedNum', var $tableWrapper = $('#material-' + tableId);
formatter: function (value, row, index) { var totalNoRmb = 0;
if (value == null || value == '') { var totalRmb = 0;
value = 0; var totalActualPurchase = 0;
} var $suplierInfo = $tableWrapper.find('.supplier-card');
return value; //获取所有物料表中供应商列表数据,实际采购数合计,不含税总价,含税采购总价
} $suplierInfo.find('.supplier_card').each(function() {
}, let purchaseNum = parseFloat($(this).find('.actualPurchaseNum').val()) || 0;
{title: '已入库数',field: 'hasStorageNum', let noRmbPrice = parseFloat($(this).find('.supplierMaterialNoRmb').text().trim()) || 0;
formatter: function (value, row, index) { let rmbPrice = parseFloat($(this).find('.supplierMaterialRmb').text().trim()) || 0;
if (value == null || value == '') { totalNoRmb += purchaseNum * noRmbPrice;
value = 0; totalRmb += purchaseNum * rmbPrice;
} totalActualPurchase = totalActualPurchase + purchaseNum;
return value; });
} //物料的实际采购数合计
}, $('#materialAmountSum_' + tableId).val(parseFloat(totalActualPurchase.toFixed(2)));
{title: '通知到货数',field: 'notifyArriveNum',editable: { //物料的实际不含税采购总价:
type: 'text', $('#materialNoRmbSum_' + tableId).val(parseFloat(totalNoRmb.toFixed(2)));
title: '通知到货数', //物料的实际含税总价:
validate: function (value, row, index) { $('#materialRmbSum_' + tableId).val(parseFloat(totalRmb.toFixed(2)));
var num = parseInt(value); // 采购物料合计
if (isNaN(num)) { materialActualPurchaseSum();
return '请输入数字'; }
} else if (num < 0) { function materialActualPurchaseSum(){
return '不能小于0'; var totalNoRmb = 0;
} var totalRmb = 0;
} var totalActualPurchase = 0;
} var materialAmount = 0;
tableIdList.forEach(function (material, index) {
var tableId = tableIdList[index];
var $tableWrapper = $('#material-' + tableId);
//采购合计 = 所有物料的采购数量合计
//采购不含税总价 = 所有物料的不含税总价合计
//采购含税总价 = 所有物料的含税总价合计
//查询物料表下吗整合的物料的实际采购数合计,物料的实际不含税采购总价,物料的实际含税总价
var supplierInfo = $tableWrapper.find('#supplierInfo_' + tableId );
let purchaseNum = parseInt(supplierInfo.find('.actualPurchaseTotalSum').val()) || 0;
let noRmbPrice = parseFloat(supplierInfo.find('.actualPurchaseTotal').val()) || 0;
let rmbPrice = parseFloat(supplierInfo.find('.actualPurchaseTotalTax').val()) || 0;
if (purchaseNum > 0) {
materialAmount += 1;
}
totalActualPurchase += purchaseNum;
totalNoRmb += noRmbPrice;
totalRmb += rmbPrice;
});
//物料合计 = 物料实际采购数合计,不含税总价,含税采购总价不为null的情况可以合计物料,否则跳过
$("#purchaseMaterialSum").val(parseFloat(materialAmount.toFixed(2)));
//采购数量合计
$('#purchaseSum').val(parseFloat(totalActualPurchase.toFixed(2)));
//采购不含税总价
$('#purchaseNoRmbSum').val(parseFloat(totalNoRmb.toFixed(2)));
//采购含税总价
$('#purchaseRmbSum').val(parseFloat(totalRmb.toFixed(2)));
}
function tableSetup(element, tableId) {
var $totalSection = $(
'<div class="card">' +
'<div class="card-body" class="supplierTotal_' + tableId + '">' +
'<div class="col-xs-4">' +
'<label for="actualPurchaseTotal" class="col-sm-5">实际采购数合计:</label>' +
'<div class="col-sm-6">' +
'<input type="number" name="materialAmountSum" class="form-control actualPurchaseTotalSum" id="materialAmountSum_' + tableId + '" disabled>' +
'</div>' +
'</div>' +
'<div class="col-xs-4">' +
'<label for="actualPurchaseTotal" class="col-sm-5">不含税采购总价:</label>' +
'<div class="col-sm-6">' +
'<input type="number" name="materialNoRmbSum" class="form-control actualPurchaseTotal" id="materialNoRmbSum_' + tableId + '" disabled>' +
'</div>' +
'</div>' +
'<div class="col-xs-4">' +
'<label for="actualPurchaseTotalTax" class="col-sm-5">含税采购总价:</label>' +
'<div class="col-sm-6">' +
'<input type="number" name="materialRmbSum" class="form-control actualPurchaseTotalTax" id="materialRmbSum_' + tableId + '" disabled>' +
'</div>' +
'</div>' +
'</div>'+
'</div>');
element.append($totalSection);
}
// 创建表格并添加到页面
function tables(tableId, data) {
$('#' + tableId).bootstrapTable({
showExport: false,
showFooter: false,
showSearch: false,
showRefresh: false,
showColumns: false,
showToggle: false,
data: data,
height: 70,
columns: [
{checkbox: false},
{title: '料号', field: 'materialCode'},
{title: '图片', field: 'photoUrl', formatter: function (value, row, index) {
return $.table.imageView(value);
} }
] },
{title: '物料名称', field: 'materialName'},
{title: '物料类型', field: 'materialType', align: 'center', formatter: function (value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '物料描述', field: 'describe'},
{title: '品牌', field: 'brand'},
{title: '加工类型', field: 'processMethod', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '单位', field: 'unit', align: 'center', },
{title: '入库部门', field: 'warehouseDept', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDeptDatas, value);
}},
{title: '计划采购数', field: 'materialNum'},
],
});
}
// 加载仓库Id列表函数
$("#form-cgjl-edit").validate({focusCleanup: true});
//open打开时,模态框foot下新增审核通过和审核拒绝按钮
//获取仓库相关信息Select2,根据仓库ID查询仓库名称
function loadWarehouseCodes() {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$.ajax({
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
success: function(data) {
if (data && Array.isArray(data)) {
var selectElement = $('#stockNo'); // 获取仓库编号下拉框元素
selectElement.empty();// 清空下拉框现有选项
$.each(data, function(index, item) {
selectElement.append('<option value="' + item.stockNO + '">' + item.stockNO + '</option>');
}); // 遍历返回的数据,添加为下拉框的选项
//设备当前选择的值
selectElement.val(purchaseOrder.stockNo).trigger('change');
} else {
$.modal.errMsg("数据为空");
}
}
});
}
$('#stockNo').on('change', function() {
var selectedWarehouseCode = $(this).val(); // 获取选中的仓库ID
if (selectedWarehouseCode) {
// 发起Ajax请求获取仓库名称
$.ajax({
type: 'GET',
url: ctx +'stock/stockInfo/getStockNameByWarehouseCode/' + selectedWarehouseCode,
dataType: 'json', // 假设返回的数据格式是JSON
success: function(data) {
console.log(data);
// 将获取到的仓库名称填充到输入框
if(data.data == null){
// 如果返回的数据有问题,可以给出提示或处理
$.modal.alertWarning('未能获取到仓库名称!');
}
$('input[name="stockName"]').val(data.data.stockName);
$('input[name="stockAddress"]').val(data.data.stockAddr);
$('input[name="stockContact"]').val(data.data.stockManager);
$('input[name="stockPhone"]').val(data.data.stockManagerPhone);
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error:', textStatus, errorThrown);
$.modal.alertWarning('查询仓库名称时发生错误!');
}
}); });
$tableWrapper.append($header).append($table);
$('#supplierMaterial').append($tableWrapper);
} }
});
//获取采购计划单的物料信息 //获取采购计划单的物料信息
//假设qualityOrderCode已经定义或者可以通过某种方式获取到 //假设qualityOrderCode已经定义或者可以通过某种方式获取到
function submitHandler() { function submitHandler() {
@ -306,7 +630,7 @@
purchaseOrder.supplierNum = supplierNumList.length; purchaseOrder.supplierNum = supplierNumList.length;
// 发送数据到后端API // 发送数据到后端API
$.operate.saveJson(prefix + "/addPurchaseOrder",JSON.stringify(purchaseOrder)); $.operate.saveJson(prefix + "/edit",JSON.stringify(purchaseOrder));
} }
} }

12
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html

@ -252,18 +252,20 @@
var actions = []; var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.purchaseOrderId + '\')"><i class="fa fa-detail"></i>详情</a>') // actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.purchaseOrderId + '\')"><i class="fa fa-detail"></i>详情</a>')
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) { if(row.auditStatus=="1" && row.useStatus=="1") {
// 作废 // 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.purchaseOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.purchaseOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 入库通知 // 入库通知
actions.push('<a class="btn btn-success btn-xs ' + addPurchaseOrderStorageFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'添加入库通知检验单\',\'' + prefix+"/addPurchaseOrderStorage/"+row.purchaseOrderCode + '\')">入库通知</a> '); actions.push('<a class="btn btn-success btn-xs ' + addPurchaseOrderStorageFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'添加入库通知检验单\',\'' + prefix+"/addPurchaseOrderStorage/"+row.purchaseOrderCode + '\')">入库通知</a> ');
}else if(row.auditStatus=="2" && row.cancelInstanceId){ }
// 编辑 //审核拒绝
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i> 编辑</a> '); if(row.auditStatus=="2" && row.applyUser == loginName){
//编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
} }
//else{actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');} //else{actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');}
// 有流程实例id // 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){ if(row.useStatus=="2"){
// 恢复 // 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.purchaseOrderId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.purchaseOrderId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
} }

99
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html

@ -138,6 +138,7 @@
</div> </div>
</div> </div>
</div> </div>
<input name="purchaseOrder" type="hidden"/>
</form> </form>
</div> </div>
@ -298,14 +299,14 @@
'<div class="col-xs-6 form-group">' + '<div class="col-xs-6 form-group">' +
'<label class="col-sm-4"> 实际采购数: </label>' + '<label class="col-sm-4"> 实际采购数: </label>' +
'<div class ="col-sm-6">' + '<div class ="col-sm-6">' +
'<input type="text" name="materialNum" value="' + supplier.materialRealNum + '" class="form-control supplierMaterialNum actualPurchaseNum" id="actualPurchaseNum_' + tableId + '" disabled>' + '<input type="text" name="materialNum" value="' + supplier.materialRealNum + '" class="form-control supplierMaterialNum actualPurchaseNum" id="actualPurchaseNum_' + tableId + '">' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<div class="col-xs-6 form-group">' + '<div class="col-xs-6 form-group">' +
'<label class="col-sm-4">计划交付时间: </label>' + '<label class="col-sm-4">计划交付时间: </label>' +
'<div class ="col-sm-6">' + '<div class ="col-sm-6">' +
'<div class="input-group date"> ' + '<div class="input-group date"> ' +
'<input type="text" name="deliveryTime" value="' + supplier.deliveryTime + '" text="' + supplier.deliveryTime + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + tableId + '" disabled >' + '<input type="text" name="deliveryTime" value="' + supplier.deliveryTime + '" text="' + supplier.deliveryTime + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + tableId + '" >' +
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' + '<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' +
'</div> ' + '</div> ' +
'</div>' + '</div>' +
@ -359,7 +360,6 @@
$supplierInfo.find('.supplierPurchaseTotalRmb').val(parseFloat(Number(purchaseNum * rmbPrice).toFixed(2))); $supplierInfo.find('.supplierPurchaseTotalRmb').val(parseFloat(Number(purchaseNum * rmbPrice).toFixed(2)));
} }
// 如果采购数量大于0,则显示供应商采购总价 // 如果采购数量大于0,则显示供应商采购总价
if (purchaseNum > 0) { if (purchaseNum > 0) {
$supplierInfo.find('.supplierPurchaseTotal').removeClass('hidden'); $supplierInfo.find('.supplierPurchaseTotal').removeClass('hidden');
@ -369,7 +369,6 @@
$supplierInfo.find('.supplierPurchaseTotal').addClass('hidden'); $supplierInfo.find('.supplierPurchaseTotal').addClass('hidden');
$supplierInfo.find('.supplierPurchaseTotalRmb').addClass('hidden'); $supplierInfo.find('.supplierPurchaseTotalRmb').addClass('hidden');
} }
recalculateTotals(tableId); // 重新计算当前物料的合计 recalculateTotals(tableId); // 重新计算当前物料的合计
} }
}); });
@ -612,6 +611,7 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#p_B_reApply").val($("#reApply").val()); $("#p_B_reApply").val($("#reApply").val());
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var formData = $("#form-purchaseOrder-modify").serialize(); var formData = $("#form-purchaseOrder-modify").serialize();
@ -619,6 +619,97 @@
$.operate.save(prefix + "/complete/" + taskId, formData) $.operate.save(prefix + "/complete/" + taskId, formData)
} }
} }
function submitHandler() {
if ($.validate.form()) {
var materialSum = 0;
var materialRealSum = 0;
var materialNoRmbSum = 0;
var materialRmbSum = 0;
//添加去除供应商编号数组
var supplierNumList = [];
var purchaseOrder = {
supplierNum: 0,materialNum: 0,noRmbSum: 0,rmbSum: 0,
stockNo: $("#stockNo").val(),
stockName: $("#stockName").val(),
stockAddress: $("#stockAddress").val(),
stockContact: $("#stockContact").val(),
stockPhone: $("#stockPhone").val(),
purchaseOrderChildList: [],
};
// 遍历每个物料容器
$('.table-materialCode').each(function(index, tableElement) {
var tableId = tableIdList[index];
let materialObj = materialList[index];
var $tableWrapper = $('#material-' + tableId);
if (typeof materialObj === 'undefined') return;
var $suplierInfo = $tableWrapper.find('.supplier-card');
$suplierInfo.find('.supplier_card').each(function(supplierIndex, supplierCard) {
var supplierCode = $(this).find('.supplierCode').text().trim();
var supplierName = $(this).find('.supplierName').text().trim();
var materialRealNum = parseInt($(this).find('.actualPurchaseNum' ).val()) || 0;
var materialRealRmb = parseFloat($(this).find('.supplierMaterialRmb').text()) || 0;
var materialRealNoRmb = parseFloat($(this).find('.supplierMaterialNoRmb').text()) || 0;
var deliveryTime = $(this).find('.supplierDeliveryTime').val();
var purchasePlanCode = $(this).find('.supplierPurchasePlanCode').text().trim();
var correlationCode = $(this).find('.supplierCorrelationCode').text().trim();
var purchaseQuoteCode = $(this).find('.supplierPurchaseQuoteCode').text().trim();
var materialRealRmbSum = parseFloat(materialRealRmb * materialRealNum);
var materialRealNoRmbSum = parseFloat(materialRealNoRmb * materialRealNum);
materialRealSum += materialRealNum;
materialNoRmbSum += materialRealNoRmbSum;
materialRmbSum += materialRealRmbSum;
if (supplierNumList.indexOf(supplierCode) === -1) {
supplierNumList.push(supplierCode);
purchaseOrder.supplierNum += 1;
}
var materialData = {
materialCode: materialObj.materialCode,
materialName: materialObj.materialName,
materialType: materialObj.materialType,
materialBrand:materialObj.brand,
materialDescribe: materialObj.describe,
materialProcessMethod:materialObj.processMethod,
materialUnit:materialObj.unit,
materialPhotoUrl: materialObj.photoUrl,
warehouseDept: materialObj.warehouseDept,
materialNum: materialObj.materialNum,
supplierCode: supplierCode,
supplierName: supplierName,
materialNoRmb: materialObj.materialNoRmb,
materialRmb: materialObj.materialRmb,
materialRealNum: materialRealNum,
materialRealRmb: materialRealRmb,
materialRealNoRmb: materialRealNoRmb,
materialRealRmbSum: materialRealRmbSum,
materialRealNoRmbSum: materialRealNoRmbSum,
deliveryTime: deliveryTime,
purchasePlanCode:purchasePlanCode,
correlationCode:correlationCode,
purchaseQuoteCode: purchaseQuoteCode,
};
purchaseOrder.purchaseOrderChildList.push(materialData);
});
});
// 获取采购物料合计,采购物料实际合计,采购物料实际非人民币合计,采购物料实际人民币合计
var purchaseAmount = parseFloat($('#purchaseMaterialSum').val());
var purchaseSum = parseFloat($('#purchaseSum').val());
var purchaseNoRmbSum = parseFloat($('#purchaseNoRmbSum').val());
var purchaseRmbSum = parseFloat($('#purchaseRmbSum').val());
// 将合计值附加到purchaseOrder对象
purchaseOrder.materialAmount = purchaseAmount;
purchaseOrder.materialSum = purchaseSum;
purchaseOrder.materialNoRmbSum = purchaseNoRmbSum;
purchaseOrder.materialRmbSum = purchaseRmbSum;
purchaseOrder.supplierNum = supplierNumList.length;
$("#p_B_reApply").val($("#reApply").val());
var taskId = [[${taskId}]];
$("input[name='purchaserOrder']").val(JSON.stringify(purchaseOrder));
var formData = $("#form-purchaseOrder-modify").serialize()
// 发送请求
$.operate.save(prefix + "/complete/" + taskId, formData)
}
}
</script> </script>
</body> </body>
</html> </html>

162
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html

@ -0,0 +1,162 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增采购物料历史报价信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-purchaseQuoteHistory-add">
<div class="form-group">
<label class="col-sm-3 control-label">关联报价编号字段:</label>
<div class="col-sm-8">
<input name="purchaseQuoteCode" 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="materialId" 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="materialCode" 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="materialName" 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="materialType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料的加工方式:</label>
<div class="col-sm-8">
<input name="processMethod" 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="brand" 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="photoUrl" 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="describe" 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="taxRate" 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="usdRate" 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="materialNum" 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="materialSole" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料的不含税单价(RMB):</label>
<div class="col-sm-8">
<input name="materialRmb" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料的含税单价(RMB):</label>
<div class="col-sm-8">
<input name="materialNormb" 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="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="supplierName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="useStatus" value="">
<label th:for="useStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="auditStatus" value="">
<label th:for="auditStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory"
$("#form-purchaseQuoteHistory-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-purchaseQuoteHistory-add').serialize());
}
}
</script>
</body>
</html>

109
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/purchaseQuoteHistory.html

@ -0,0 +1,109 @@
<!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="purchaseQuoteCode"/>
</li>
<li>
<label>物料编号:</label>
<input type="text" name="materialCode"/>
</li>
<li>
<label>审核状态:</label>
<select name="auditStatus">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchaseQuoteHistory:purchaseQuoteHistory:export">-->
<!-- <i class="fa fa-download"></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 editFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:edit')}]];
var removeFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:remove')}]];
var cancelFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:restore')}]];
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory";
$(function() {
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: 'purchaseQuoteChildId', visible: false},
{title: '关联报价编号字段', field: 'purchaseQuoteCode',},
{title: '物料表中的id', field: 'materialId',},
{title: '物料表中的编号', field: 'materialCode',},
{title: '物料的名称', field: 'materialName',},
{title: '物料的类型', field: 'materialType',},
{title: '物料的加工方式', field: 'processMethod',},
{title: '物料的品牌', field: 'brand',},
{title: '物料的图片', field: 'photoUrl',},
{title: '物料的描述', field: 'describe',},
{title: '国内税率', field: 'taxRate',},
{title: '美元汇率', field: 'usdRate',},
{title: '物料的数量', field: 'materialNum',},
{title: '物料的对外报价', field: 'materialSole',},
{title: '物料的不含税单价(RMB)', field: 'materialRmb',},
{title: '物料的含税单价(RMB)', field: 'materialNormb',},
{title: '供应商编号', field: 'supplierCode',},
{title: '供应商名称', field: 'supplierName',},
{title: '备注', field: 'remark',},
{title: '删除状态', field: 'useStatus',},
{title: '审核状态', field: 'auditStatus',},
{
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.purchaseQuoteChildId + '\')"><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.purchaseQuoteChildId + '\')"><i class="fa fa-remove"></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>

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

@ -2,24 +2,18 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('新增报销单')" /> <th:block th:include="include :: header('新增报销单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" /> <th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" /> <th:block th:include="include :: bootstrap-editable-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-add"> <form class="form-horizontal m" id="form-baseExpense-add">
<div class="form-group" hidden> <div class="col-xs-12">
<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"> <div class="col-xs-4">
<label class="col-sm-6 control-label">部门:</label> <label class="col-sm-6 control-label is-required">部门:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input name="deptName" class="form-control" type="text" readonly> <input name="deptName" class="form-control" type="text" readonly required>
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
@ -29,77 +23,78 @@
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<label class="col-sm-6 control-label">姓名:</label> <label class="col-sm-6 control-label is-required">姓名:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input name="fullName" class="form-control" type="text" readonly> <input name="fullName" class="form-control" type="text" readonly required>
</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 is-required">报销方式:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}"> <select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}" required>
<option th:each="dict : ${dictList}" 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 id="add_expenseMethodModal" class="container" style="display: none"> <div id="add_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-6 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-6 control-label is-required">供应商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" required>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-6 control-label is-required">对公收款方:</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" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-6 control-label is-required">对公收款账户:</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" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-6 control-label is-required">对公开户行:</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" required>
</div> </div>
</div> </div>
</div> </div>
<input type="hidden" name="expenseDetailList" id="expenseDetailList">
</form> </form>
<!-- <div class="container">--> <div class="container">
<!-- <div class="form-row">--> <div class="form-row">
<!-- <div class="btn-group-sm" id="toolbar" role="group">--> <div class="btn-group-sm" id="toolbar" role="group">
<!-- <span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span>--> <span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span>
<!-- <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()">--> <a class="btn btn-danger" onclick="removeRow()">
<!-- <span class="fa fa-remove"></span> 删除报销--> <span class="fa fa-remove"></span> 删除报销
<!-- </a>--> </a>
<!-- </div>--> </div>
<!-- </div>--> </div>
<!-- <div class="col-sm-12 select-table table-striped">--> <div class="col-sm-12 select-table table-striped">
<!-- <table id="bootstrap-sub-table-expense"></table>--> <table id="bootstrap-sub-table-expense"></table>
<!-- </div>--> </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 :: select2-js" /> <th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
@ -116,55 +111,37 @@
model: "报销单数据", model: "报销单数据",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '主键',field: 'index',align: 'center',visible: false, {title: '序号',field: 'index',align: 'center',visible: false,
formatter: function (value, row, index) { formatter: function (value, row, index) {
return index; return $.table.serialNumber(index);
} }
}, },
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, {title: '报销单分项子表',field: 'expenseChildId',visible: false},
{title: '关联报销单号',field: 'expenseCode',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);
}
}, },
{title: '成本小类',field:'costSmallType', {title: '成本小类',field:'costSmallType',
formatter:function(value, row, index){ formatter:function(value, row, index){return getCostSmallType(value,row,index)}
return getCostSmallType(value,row,index)
}
},
{title: '用途',field: 'purpose',
editable:{
type:'text',
mode:'inline',
}
}, },
{title: '用途',field: 'purpose', editable:{type:'text', mode:'inline',}},
{title: '金额',field: 'amounts', {title: '金额',field: 'amounts',
editable:{ editable:{type:'text', mode:'inline',
type:'text', validate: function(value, row){
mode:'inline', //金额可以为最多两位小数点
} var reg = /^[0-9]+([.]{1}[0-9]{1,2})?$/;
}, if(value == '') {
{title: '报销时间',field: 'expenseTime',editable:{ return '请输入金额';
type:'date', }
mode:'inline' if(!reg.test(value)){
} return '金额只能为数字,最多保留小数点后两位';
}, }
{title: '出差单号',field: 'evectionCode',editable:{ }}
type:'text',
mode:'inline',
}
},
{title: '采购单号',field: 'purcahseCode',editable:{
type:'text',
mode:'inline',
}
}, },
{title: '委外单号',field: 'outsourceCode',editable:{ {title: '报销时间',field: 'expenseTime', editable: {type: 'date',title: '报销时间', placement: 'left',}},
type:'text', {title: '出差单号',field: 'evectionCode',editable:{type:'text', mode:'inline',}},
mode:'inline', {title: '采购单号',field: 'purchaseCode',editable:{type:'text', mode:'inline',}},
} {title: '委外单号',field: 'outsourceCode',editable:{type:'text', mode:'inline',}}
}
], ],
}; };
$.table.init(options); $.table.init(options);
@ -223,14 +200,15 @@
$("input[name='corporateReceivingAccount']").val(data.bankAccount); $("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank); $("input[name='publicAccountBanks']").val(data.depositBank);
}); });
// function costTypeFormatter(value,row,index){ function removeRow(id){
// var costType = $.common.selectArrayValue(costTypeDatas,value); $("#bootstrap-sub-table-modify").bootstrapTable('remove', {
// return costType; field: 'id',
// } values: id
})
}
function insertRow() { function insertRow() {
$table.bootstrapTable('insertRow', { $table.bootstrapTable('insertRow', {
index:1, index:0,
row: { row: {
expenseChildId:'', expenseChildId:'',
costType: "", costType: "",
@ -239,33 +217,32 @@
amounts: '', amounts: '',
expenseTime: '', expenseTime: '',
evectionCode:'' , evectionCode:'' ,
purcahseCode:'', purchaseCode:'',
outsourceCode: '', outsourceCode: '',
} }
}) })
} }
/* 删除指定表格行 */
// 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 submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
var formData = $('#form-baseExpense-add').serialize(); var tableData = $("#bootstrap-sub-table-expense").bootstrapTable('getData');
$.operate.save(prefix + "/add", formData); var formData = $("#form-baseExpense-add").serializeArray();
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else {
for (var i = 0; i < rows; i++) {
tableData[i].expenseCode = $("input[name='expenseCode']").val();
//检测每行的成本类型和成本小类是否为空,金额是否为空,并列出第几行的什么每次参数列
if (tableData[i].costType == "" || tableData[i].costSmallType == "" || tableData[i].amounts == "") {
$.modal.alertWarning("第" + (i + 1) + "行成本类型、成本小类、金额不能为空!");
return;
}
}
formData.push({"name": "expenseAccountChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/add", jsonData);
}
} }
} }
@ -314,13 +291,13 @@
} }
} }
function removeRow(){ function removeRow(){
var ids = $.table.selectColumns("id"); var ids = $.table.selectColumns("index");
if (ids.length == 0) { if (ids.length == 0) {
$.modal.alertWarning("请至少选择一条记录"); $.modal.alertWarning("请至少选择一条记录");
return; return;
} }
$("#bootstrap-sub-table-1").bootstrapTable('remove', { $("#bootstrap-sub-table-expense").bootstrapTable('remove', {
field: 'id', field: 'index',
values: ids values: ids
}) })
} }
@ -345,6 +322,12 @@
} }
}); });
} }
$("input[name='expenseTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script> </script>
</body> </body>
</html> </html>

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

@ -12,21 +12,23 @@
<ul> <ul>
<li> <li>
<label>报销单号:</label> <label>报销单号:</label>
<input type="text" name="expenseCode"/> <input type="text" name="expenseCode" />
</li> </li>
<li> <li>
<label>报销人:</label> <label>报销人:</label>
<select name="applyUser" > <select name="applyUser"></select>
<option value="">所有</option>
</select>
</li> </li>
<li> <li>
<label>生产单号:</label> <label>出差单号:</label>
<input name="expenseCode" type="text"/> <input name="params[evectionCode]" type="text"/>
</li> </li>
<li> <li>
<label>出差单号:</label> <label>采购单号:</label>
<input name="expenseCode" type="text"/> <input name="params[purchaseCode]" type="text"/>
</li>
<li>
<label>委外单号:</label>
<input name="params[outsourceCode]" type="text"/>
</li> </li>
<li> <li>
<label>上级审核状态:</label> <label>上级审核状态:</label>
@ -111,6 +113,7 @@
var auditStatusData = [[${@dict.getType('auditStatus')}]]; var auditStatusData = [[${@dict.getType('auditStatus')}]];
var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]]; var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]];
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
@ -218,6 +221,7 @@
} }
}; };
$.table.init(options); $.table.init(options);
selectUserAll();
}); });
function onCostTypeChange(element) { function onCostTypeChange(element) {
var costType = element.value; var costType = element.value;
@ -229,16 +233,30 @@
success: function (result) { success: function (result) {
console.log(result); console.log(result);
costSamllTypes = result; costSamllTypes = result;
var selectHtml = ''; var selectHtml = '<option value="">所有</option>';
costSamllTypes.forEach(function (child) { costSamllTypes.forEach(function (child) {
selectHtml += '<option value="' + child.code + '">' + child.name + '</option>'; selectHtml += '<option value="' + child.code + '">' + child.name + '</option>';
}); });
$("#costSmallType").append(selectHtml); $("#costSmallType").html(selectHtml);
}
});
}
function selectUserAll(){
$.ajax({
url: prefix + '/getExpenseUser',
type: 'post',
async: false,
success: function (result) {
userList = result.data;
var selectUser = $("select[name='applyUser']");
var selectHtml = '<option value="">所有</option>';
userList.forEach(function (user) {
selectHtml += '<option value="' + user.loginName + '">' + user.userName + '</option>';
});
selectUser.html(selectHtml);
} }
}); });
} }
</script> </script>
</body> </body>
</html> </html>

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

@ -38,36 +38,35 @@
</div> </div>
</div> </div>
<div id="detail_expenseMethodModal" class="container" style="display: none"> <div id="detail_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<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">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled>
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<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="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<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" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<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" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
@ -223,31 +222,6 @@
// 更新行数据 // 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
} }
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#detail_expenseMethod").val(); var expenseMethod = $("#detail_expenseMethod").val();
@ -257,12 +231,6 @@
$("#detail_expenseMethodModal").hide(); $("#detail_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
</script> </script>
</body> </body>
</html> </html>

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

@ -1,303 +1,307 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('修改报销单')" /> <th:block th:include="include :: header('总经理/总助审核')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-edit" th:object="${baseExpenseAccount}"> <form class="form-horizontal m" id="form-baseExpense-zozj" th:object="${baseExpenseAccount}">
<input name="expenseId" th:field="*{expenseId}" type="hidden"> <input name="expenseId" th:field="*{expenseId}" type="hidden">
<div class="form-group"> <input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<label class="col-sm-3 control-label">报销单编号:</label> <input name="instanceId" th:field="*{instanceId}" type="hidden">
<div class="col-sm-8"> <!--驳回调整允许更新内容-->
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text"> <div class="form-group">
</div> <label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<input name="deptName" th:field="*{deptName}" class="form-control" />
</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"/>
</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"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="edit_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 class="form-group"> </div>
<label class="col-sm-3 control-label">部门:</label> <div id="edit_expenseMethodModal" class="container" style="display: none">
<div class="col-xs-6">
<label class="col-sm-3 control-label">是否是委外/采购采销:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deptName" th:field="*{deptName}" class="form-control" type="text"> <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="col-xs-6">
<label class="col-sm-3 control-label">岗位:</label> <label class="col-sm-3 control-label">供应商ID</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="postName" th:field="*{postName}" class="form-control" type="text"> <select id="supplierCode" name="supplierCode" class="form-control"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-3 control-label">姓名:</label> <label class="col-sm-3 control-label">对公收款方</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="fullName" th:field="*{fullName}" class="form-control" type="text"> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<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">
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}"> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div> </div>
</div> </div>
<div id="add_expenseMethodModal" class="container" style="display: none"> <div class="col-xs-6">
<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="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}">
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6">
<select id="supplierCode" name="supplierCode" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款方:</label>
<div class="col-sm-6">
<input name="corporatePayee" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公收款账户:</label>
<div class="col-sm-6">
<input name="corporateReceivingAccount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">对公开户行:</label>
<div class="col-sm-6">
<input name="publicAccountBanks" class="form-control" type="text">
</div>
</div> </div>
</div> </div>
</form> <input type="hidden" name="expenseDetailList" id="expenseDetailList">
<div class="container"> </div>
<div class="form-row"> </form>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="container">
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span> <div class="form-row">
<a class="btn btn-success" onclick="insertRow()"> <div class="btn-group-sm" id="toolbar" role="group">
<span class="fa fa-plus"></span> 添加报销 <span>选择报销分类信息</span>
</a> <a class="btn btn-success" onclick="insertRow()">
</div> <span class="fa fa-plus"></span> 添加报销
</a>
<a class="btn btn-danger" onclick="removeRow()">
<span class="fa fa-remove"></span> 删除报销
</a>
</div> </div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense"></table> <table id="bootstrap-sub-table-expense-edit"></table>
</div> </div>
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> </div>
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <th:block th:include="include :: datetimepicker-js" />
var prefix = ctx + "system/baseExpense" <th:block th:include="include :: select2-js" />
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; <th:block th:include="include :: bootstrap-table-editable-js" />
var supplier = [[${formData.supplierCode}]]; <script th:src="@{/js/activiti.js}"></script>
$("#form-baseExpense-add").validate({focusCleanup: true}); <script th:inline="javascript">
$(function(){ var prefix = ctx + "system/baseExpense";
$.ajax({ var costTypeDatas = [[${@category.getChildByCode('costType')}]];
url: prefix + "/getId", var taskId = [[${taskId}]];
type: "post", var baseExpense = [[${baseExpenseAccount}]];
dataType: "json", var $table = $("#bootstrap-sub-table-expense-edit");
success: function(result) { $("#form-baseExpense-edit").validate({focusCleanup: true});
if (result.code == 0) {
$("input[name='expenseCode']").val(result.data); $(function() {
} else { var options = {
$.modal.msgError(result.msg); id:'bootstrap-sub-table-expense-edit',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};},
sidePagination: "client",
pagination: true,
showColumns: false,
showSearch: false,
showRefresh:false,
showToggle:false,
model: "报销单数据",
columns: [
{checkbox: true},
{title:'主键',field: 'index',align: 'center',
formatter: function (value, row, index) {
var index = index + 1;
return index;
} }
}
});
})
var $table = $("#bootstrap-sub-table-expense");
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-expense',
url: ctx + "system/expenseChild/list",
queryParams: function(params) {
return {
expenseCode: $("#expenseCode").val()
};
}, },
pagination: false, {title: '报销单分项子表',field: 'expenseChildId',visible: false},
sidePagination: "client", {title: '关联报销单号',field: 'expenseCode',visible: false},
model: "报销单数据", {title: '成本类型',field: 'costType',
editable: true, formatter:function (value, row, index) {return costTypeFormatter(value,row,index);}
columns: [ },
{checkbox: true}, {title: '成本小类',field:'costSmallType',
{title: '主键',field: 'index',visible: false, formatter:function(value, row, index){return getCostSmallType(value,row,index)}
formatter: function (value, row, index) { },
return index; {title: '用途',field: 'purpose', editable:{type:'text', mode:'inline',}},
} {title: '金额',field: 'amounts', editable:{type:'text', mode:'inline',}},
}, {title: '报销时间',field: 'expenseTime', editable: {type: 'date',title: '报销时间', placement: 'left',}},
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, {title: '出差单号',field: 'evectionCode',editable:{type:'text', mode:'inline',}},
{title: '关联报销单号',field: 'expenseCode',visible: false}, {title: '采购单号',field: 'purchaseCode',editable:{type:'text', mode:'inline',}},
{title: '成本类型',field: 'costType', {title: '委外单号',field: 'outsourceCode',editable:{type:'text', mode:'inline',}},
formatter:function (value, row, index) { {title: '操作', align: 'center',
return costTypeFormatter(value,row,index); formatter: function (value, row, index) {
} return '<a class="btn btn-danger btn-xs" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a>';
},
{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);
// 假设此函数返回供应商列表
$("#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); };
$.table.init(options);
handleExpenseMethod(this);
loadSupplierCodes();
});
function removeRow(index) {
// 使用索引值移除行
$('#bootstrap-sub-table-expense-edit').bootstrapTable('remove', {
field: 'index',
values: index
}); });
function handleExpenseMethod(expenseMethodSelect) { }
//获取页面元素中的下拉框选中的值 // 列中获取成本类型的下拉改变数据
var expenseMethod = $("#add_expenseMethod option:selected").val(); function onCostTypeChange(selectElement, rowIndex) {
if (expenseMethod === '1') { var newSupplierId = $(selectElement).val();
$("#add_expenseMethodModal").show(); var tableData = $table.bootstrapTable('getData');
} else { var newRow = tableData[rowIndex]; // 获取当前行数据
$("#add_expenseMethodModal").hide(); newRow.costType = newSupplierId; // 更新供应商ID
} // 重新渲染成本小类的设备名称列
} // 更新行数据
$('#supplierCode').on('select2:select', function (e) { $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
var data = e.params.data; }
$("input[name='corporatePayee']").val(data.supplierName); // 自定义供应商名称列的格式化函数
$("input[name='corporateReceivingAccount']").val(data.bankAccount); function costTypeFormatter(value, row, index) {
$("input[name='publicAccountBanks']").val(data.depositBank); 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>';
function insertRow() { return selectHtml;
$table.bootstrapTable('insertRow', { }
index:1, // 自定义设备名称列的格式化函数,依赖于供应商列的选择
row: { function getCostSmallType(value, row, index) {
expenseChildId:'', var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">';
costType: "", // 假设此函数根据供应商ID返回设备列表
costSmallType:"", var costSamllTypes = [];
purpose:'' , $.ajax({
amounts: '', url: ctx + 'system/category/getChildCode',
expenseTime: '', type: 'post',
evectionCode:'' , data: {code: row.costType},
purcahseCode:'', async: false,
outsourceCode: '', success: function (result) {
} console.log(result);
}) costSamllTypes = result;
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);
}
} }
} });
// 列中获取成本类型的下拉改变数据 if (costSamllTypes) {
function onCostTypeChange(selectElement, rowIndex) { costSamllTypes.forEach(function (child) {
var newSupplierId = $(selectElement).val(); selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>';
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>'; selectHtml += '</select>';
return selectHtml; return selectHtml;
} }
}
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 function onCostSmallTypeChange(selectElement, rowIndex) {
function getCostSmallType(value, row, index) { var newCostSmallType = $(selectElement).val();
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">'; var tableData = $table.bootstrapTable('getData');
// 假设此函数根据供应商ID返回设备列表 var newRow = tableData[rowIndex]; // 获取当前行数据
var costSamllTypes = []; newRow.costSmallType = newCostSmallType;
$.ajax({ // 重新渲染当前行的设备名称列
url: ctx + 'system/category/getChildCode', // 更新行数据
type: 'post', $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
data: {code: row.costType}, }
async: false, // 假设此函数返回供应商列表
success: function (result) { function handleExpenseMethod(expenseMethodSelect) {
console.log(result); //获取页面元素中的下拉框选中的值
costSamllTypes = result; var expenseMethod = $("#edit_expenseMethod option:selected").val();
} if (expenseMethod === '1') {
}); $("#edit_expenseMethodModal").show();
if (costSamllTypes) { } else {
costSamllTypes.forEach(function (child) { $("#edit_expenseMethodModal").hide();
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
} }
}
function getSelections(){
$.ajax({
url: ctx + "system/requisitioning/getEmpUserName",
type: "get",
dataType: "json",
success: function (data) {
$("input[name='deptName']").val(data.deptName);
$("input[name='fullName']").val(data.userName);
$("input[name='postName']").val(data.postName);
}
});
}
function onCostSmallTypeChange(selectElement, rowIndex) { $("input[name='expenseTime']").datetimepicker({
var newCostSmallType = $(selectElement).val(); format: "yyyy-mm-dd",
var tableData = $table.bootstrapTable('getData'); minView: "month",
var newRow = tableData[rowIndex]; // 获取当前行数据 autoclose: true
newRow.costSmallType = newCostSmallType; });
// 重新渲染当前行的设备名称列
// 更新行数据 function submitHandler() {
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); if ($.validate.form()) {
var tableData = $("#bootstrap-sub-table-expense-edit").bootstrapTable('getData');
var formData = $("#form-baseExpense-add").serializeArray();
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);
}
} }
</script> }
function loadSupplierCodes() {
var url = ctx + 'system/supplier/getSupplier';
$.ajax({
type: 'post', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
success: function(data) {
if (data.rows && Array.isArray(data.rows)) {
var selectElement = $('#supplierCode'); // 获取仓库编号下拉框元素
// 清空下拉框现有选项
selectElement.empty();
// 添加默认选项(如果需要)编辑时不需要添加默认选项
selectElement.append('<option value="">所有</option>');
// 遍历返回的数据,添加为下拉框的选项
$.each(data.rows, function(index, item) {
// 仓库ID
selectElement.append('<option value="' + item.supplierCode + '">' + item.supplierCode + '</option>');
});
selectElement.val(baseExpense.supplierCode);
} else {
$.modal.alertWarning("数据为空");
}
}
});
}
$('#supplierCode').on('change',function (e) {
$.ajax({
type: 'post', // 请求类型
url: ctx + 'system/supplier/getSupplierName', // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
data:{
supplierCode: $('#supplierCode option:selected').val(),
},
success: function(data) {
var expenseAccount = data[0];
$("input[name='corporatePayee']").val(expenseAccount.supplierName);
$("input[name='corporateReceivingAccount']").val(expenseAccount.bankAccount);
$("input[name='publicAccountBanks']").val(expenseAccount.depositBank);
},
});
});
</script>
</body> </body>
</html> </html>

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

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-bxjl" th:object="${formData}"> <form class="form-horizontal m" id="form-baseExpense-bxjl" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden"> <input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden"> <input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden"> <input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden"> <input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled> <input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div> </div>
</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"> <div class="form-group">
<label class="col-sm-3 control-label">部门:</label> <label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -59,7 +54,7 @@
<input name="fullName" th:field="*{fullName}" class="form-control" disabled> <input name="fullName" th:field="*{fullName}" class="form-control" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-12">
<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 id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" <select id="bxjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
@ -70,37 +65,36 @@
</div> </div>
</div> </div>
<div id="bxjl_expenseMethodModal" class="container" style="display: none"> <div id="bxjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="publicAccountBanks" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
</div> </div>
@ -137,6 +131,7 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-bxjl");
$("#form-baseExpense-bxjl").validate({focusCleanup: true}); $("#form-baseExpense-bxjl").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
@ -236,31 +231,6 @@
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
} }
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxjl_expenseMethod option:selected").val(); var expenseMethod = $("#bxjl_expenseMethod option:selected").val();
@ -270,12 +240,6 @@
$("#bxjl_expenseMethodModal").hide(); $("#bxjl_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

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

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-bxzg" th:object="${formData}"> <form class="form-horizontal m" id="form-baseExpense-bxzg" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden"> <input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden"> <input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden"> <input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden"> <input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled> <input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div> </div>
</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"> <div class="form-group">
<label class="col-sm-3 control-label">部门:</label> <label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -70,37 +65,36 @@
</div> </div>
</div> </div>
<div id="bxjl_expenseMethodModal" class="container" style="display: none"> <div id="bxjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporateReceivingAccount" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="publicAccountBanks" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
</div> </div>
@ -140,6 +134,7 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-bxzg");
$("#form-baseExpense-bxzg").validate({focusCleanup: true}); $("#form-baseExpense-bxzg").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
@ -239,30 +234,6 @@
} }
// 假设此函数返回供应商列表 // 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#bxzg_expenseMethod option:selected").val(); var expenseMethod = $("#bxzg_expenseMethod option:selected").val();
@ -272,12 +243,6 @@
$("#bxzg_expenseMethodModal").hide(); $("#bxzg_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

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

@ -9,6 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-cw" th:object="${formData}"> <form class="form-horizontal m" id="form-baseExpense-cw" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden"> <input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden"> <input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden"> <input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden"> <input name="instanceId" th:field="*{instanceId}" type="hidden">
@ -35,12 +36,6 @@
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> <input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div> </div>
</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"> <div class="form-group">
<label class="col-sm-3 control-label">部门:</label> <label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -68,37 +63,36 @@
</div> </div>
</div> </div>
<div id="cw_expenseMethodModal" class="container" style="display: none"> <div id="cw_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control"> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" class="form-control" type="text"> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</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" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</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" disabled required>
</div> </div>
</div> </div>
</div> </div>
@ -135,6 +129,7 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-cw");
$("#form-baseExpense-cw").validate({focusCleanup: true}); $("#form-baseExpense-cw").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
@ -234,30 +229,6 @@
} }
// 假设此函数返回供应商列表 // 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#cw_expenseMethod option:selected").val(); var expenseMethod = $("#cw_expenseMethod option:selected").val();
@ -267,12 +238,6 @@
$("#cw_expenseMethodModal").hide(); $("#cw_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

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

@ -55,8 +55,8 @@
</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">
<select id="fzjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" <select id="fzjl_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
class="form-control" class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled> th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled>
@ -65,57 +65,56 @@
</div> </div>
</div> </div>
<div id="fzjl_expenseMethodModal" class="container" style="display: none"> <div id="fzjl_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required" for="fzjlVerifyApproved">审批意见:</label> <label class="col-sm-3 control-label is-required" for="fzjlVerifyApproved">审批意见:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="p_B_fzjlVerifyApproved" id="fzjlVerifyApproved" class="form-control" required> <select name="p_B_fzjlVerifyApproved" id="fzjlVerifyApproved" class="form-control" required>
<option value=""></option> <option value=""></option>
<option value="true">同意</option> <option value="true">同意</option>
<option value="false">拒绝</option> <option value="false">拒绝</option>
</select> </select>
</div> </div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label> </div>
<div class="col-sm-6"> <div class="form-group">
<textarea name="comment" class="form-control"></textarea> <label class="col-sm-3 control-label">批注:</label>
</div> <div class="col-sm-8">
<textarea name="comment" class="form-control" width="30%"></textarea>
</div> </div>
</div> </div>
</form> </form>
<div class="container"> <div class="container">
<div class="form-row"> <div class="form-row">
@ -138,8 +137,9 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var baseExpense = [[${formData}]];
var $table = $("#bootstrap-sub-table-expense-fzjl");
$("#form-baseExpense-fzjl").validate({focusCleanup: true}); $("#form-baseExpense-fzjl").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-expense-fzjl', id:'bootstrap-sub-table-expense-fzjl',
@ -178,6 +178,31 @@
}; };
$.table.init(options); $.table.init(options);
handleExpenseMethod(this); handleExpenseMethod(this);
$("#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").select2("val", baseExpense.supplierCode).trigger("change");
}); });
// 列中获取成本类型的下拉改变数据 // 列中获取成本类型的下拉改变数据
@ -236,30 +261,7 @@
} }
// 假设此函数返回供应商列表 // 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#fzjl_expenseMethod option:selected").val(); var expenseMethod = $("#fzjl_expenseMethod option:selected").val();
@ -269,12 +271,6 @@
$("#fzjl_expenseMethodModal").hide(); $("#fzjl_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

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

@ -60,43 +60,42 @@
<div class="col-sm-6"> <div class="col-sm-6">
<select id="modify_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" <select id="modify_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)"
class="form-control" class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}" disabled> th:with="dictList=${@dict.getType('sys_base_expense_method')}">
<option th:each="dict : ${dictList}" 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 id="modify_expenseMethodModal" class="container" style="display: none"> <div id="modify_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled> <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> <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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control">
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" >
</div> </div>
</div> </div>
</div> </div>
@ -139,6 +138,7 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var $table = $("#bootstrap-sub-table-expense-modify");
$("#form-baseExpense-modify").validate({focusCleanup: true}); $("#form-baseExpense-modify").validate({focusCleanup: true});
@ -204,9 +204,6 @@
} }
}) })
} }
function removeRow(id){
$table.bootstrapTable('remove', {field: 'id', values: id})
}
// 列中获取成本类型的下拉改变数据 // 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) { function onCostTypeChange(selectElement, rowIndex) {
var newSupplierId = $(selectElement).val(); var newSupplierId = $(selectElement).val();

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

@ -7,7 +7,7 @@
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-fzjl" th:object="${formData}"> <form class="form-horizontal m" id="form-baseExpense-zozj" th:object="${formData}">
<input name="expenseId" th:field="*{expenseId}" type="hidden"> <input name="expenseId" th:field="*{expenseId}" type="hidden">
<input name="expenseCode" th:field="*{expenseCode}" type="hidden"> <input name="expenseCode" th:field="*{expenseCode}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden"> <input name="taskId" th:field="*{taskId}" type="hidden">
@ -66,37 +66,36 @@
</div> </div>
</div> </div>
<div id="zozj_expenseMethodModal" class="container" style="display: none"> <div id="zozj_expenseMethodModal" class="container" style="display: none">
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> <label class="col-sm-3 control-label is-required">是否是委外/采购采销:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled> <select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}" disabled required>
<option th:each="dict : ${dictList}" 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 class="col-xs-6">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control" disabled> <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" disabled required>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款方:</label> <label class="col-sm-3 control-label is-required">对公收款方:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled> <input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公收款账户:</label> <label class="col-sm-3 control-label is-required">对公收款账户:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled> <input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="col-xs-6">
<label class="col-sm-6 control-label">对公开户行:</label> <label class="col-sm-3 control-label is-required">对公开户行:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled> <input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text" disabled required>
</div> </div>
</div> </div>
</div> </div>
@ -139,6 +138,8 @@
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var baseExpense = [[${formData}]];
var $table = $("#bootstrap-sub-table-expense-zozj");
$("#form-baseExpense-zozj").validate({focusCleanup: true}); $("#form-baseExpense-zozj").validate({focusCleanup: true});
$(function() { $(function() {
@ -179,6 +180,31 @@
}; };
$.table.init(options); $.table.init(options);
handleExpenseMethod(this); handleExpenseMethod(this);
$("#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").select2("val", baseExpense.supplierCode).trigger("change");
}); });
// 列中获取成本类型的下拉改变数据 // 列中获取成本类型的下拉改变数据
function onCostTypeChange(selectElement, rowIndex) { function onCostTypeChange(selectElement, rowIndex) {
@ -235,31 +261,6 @@
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
} }
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
method: "post",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {results: options};
}
}
});
function handleExpenseMethod(expenseMethodSelect) { function handleExpenseMethod(expenseMethodSelect) {
//获取页面元素中的下拉框选中的值 //获取页面元素中的下拉框选中的值
var expenseMethod = $("#zozj_expenseMethod option:selected").val(); var expenseMethod = $("#zozj_expenseMethod option:selected").val();
@ -269,12 +270,6 @@
$("#zozj_expenseMethodModal").hide(); $("#zozj_expenseMethodModal").hide();
} }
} }
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java

@ -170,4 +170,6 @@ public interface SysUserMapper
* */ * */
String selectLoginNameByUserName(String businessMembers); String selectLoginNameByUserName(String businessMembers);
List<SysUser> selectUserAll() throws Exception;
} }

2
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@ -219,4 +219,6 @@ public interface ISysUserService
List<Map<String,String>> selectUserSelList(String userName); List<Map<String,String>> selectUserSelList(String userName);
List<SysUser> selectRoleToUserList(String roleKeys); List<SysUser> selectRoleToUserList(String roleKeys);
public List<SysUser> selectUserAll() throws Exception;
} }

4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@ -546,4 +546,8 @@ public class SysUserServiceImpl implements ISysUserService
public List<SysUser> selectRoleToUserList(String roleKeys) { public List<SysUser> selectRoleToUserList(String roleKeys) {
return userMapper.selectRoleToUserList(Convert.toStrArray(roleKeys)); return userMapper.selectRoleToUserList(Convert.toStrArray(roleKeys));
} }
@Override
public List<SysUser> selectUserAll() throws Exception {
return userMapper.selectUserAll();
}
} }

4
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -268,5 +268,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectLoginNameByUserName" parameterType="String" resultType="String"> <select id="selectLoginNameByUserName" parameterType="String" resultType="String">
select login_name from sys_user where del_flag = '0' and user_name = #{userName} select login_name from sys_user where del_flag = '0' and user_name = #{userName}
</select> </select>
<select id="selectUserAll" resultMap="SysUserResult">
select login_name,user_name from sys_user where del_flag = '0'
</select>
</mapper> </mapper>
Loading…
Cancel
Save