Browse Source

[delete]

删除旧版无用的购单列表对象 buyorder_head和系统中对应的前端所有代码和后端所有代码 和对应的系统菜单数据
dev
liuxiaoxu 1 month ago
parent
commit
efe8190044
  1. 222
      ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/controller/BuyorderHeadController.java
  2. 547
      ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/domain/BuyorderHead.java
  3. 64
      ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/mapper/BuyorderHeadMapper.java
  4. 67
      ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/IBuyorderHeadService.java
  5. 132
      ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/impl/BuyorderHeadServiceImpl.java
  6. 225
      ruoyi-admin/src/main/resources/mapper/buyorderHead/BuyorderHeadMapper.xml
  7. 733
      ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/add2.html
  8. 866
      ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/buyOrderList.html
  9. 873
      ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/edit2.html
  10. 438
      ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/procurementCheck.html

222
ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/controller/BuyorderHeadController.java

@ -1,222 +0,0 @@
package com.ruoyi.buyorderHead.controller;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.buyorderHead.domain.BuyorderHead;
import com.ruoyi.buyorderHead.domain.ProcurementCheck;
import com.ruoyi.buyorderHead.service.IBuyorderHeadService;
import com.ruoyi.buyorderHead.service.ProcurementCheckService;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.po.domain.BuyorderList;
import com.ruoyi.po.service.IBuyorderListService;
import com.ruoyi.remind.domain.Remind;
import com.ruoyi.remind.service.RemindService;
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.*;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* 采购单列表Controller
*
* @author ruoyi
* @date 2021-10-25
*/
@Controller
@RequestMapping("/buyorderHead/buyOrderList")
public class BuyorderHeadController extends BaseController {
private String prefix = "buyorderHead/buyOrderList";
@Autowired
private IBuyorderHeadService buyorderHeadService;
@Autowired
private IBuyorderListService buyorderListService;
@Autowired
private RemindService remindService;
@Autowired
private ProcurementCheckService procurementCheckService;
@RequiresPermissions("buyorderHead:buyOrderList:view")
@GetMapping()
public String buyOrderList() {
return prefix + "/buyOrderList";
}
//返回采购对账页面
@GetMapping("/check")
public String check() {
return prefix + "/procurementCheck";
}
/**
* 查询采购单列表列表
*/
@RequiresPermissions("buyorderHead:buyOrderList:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BuyorderHead buyorderHead) {
startPage();
List<BuyorderHead> list = buyorderHeadService.selectBuyorderHeadList(buyorderHead);
return getDataTable(list);
}
/**
* 导出采购单列表列表
*/
@RequiresPermissions("buyorderHead:buyOrderList:export")
@Log(title = "采购单列表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BuyorderHead buyorderHead) {
List<BuyorderHead> list = buyorderHeadService.selectBuyorderHeadList(buyorderHead);
ExcelUtil<BuyorderHead> util = new ExcelUtil<BuyorderHead>(BuyorderHead.class);
return util.exportExcel(list, "采购单列表数据");
}
/**
* 新增采购单列表
*/
@GetMapping("/add")
public String add() {
return prefix + "/add2";
}
/**
* 新增保存采购单列表
*/
@RequiresPermissions("buyorderHead:buyOrderList:add")
@Log(title = "采购单列表", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public Result addSave(String jsonStr) throws Exception {
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
BuyorderHead buyorderHead = jsonObject.toJavaObject(BuyorderHead.class);
System.out.println(buyorderHead.getpName());
if ("-1".equals(buyorderHead.getpName())) {
return Result.getFailResult("请选择供应商!", null);
}
List<BuyorderList> buyOrderList = buyorderHead.getBuyOrderList();
for (BuyorderList buyorderList : buyOrderList) {
if (buyorderList.getAmt().compareTo(BigDecimal.ZERO) != 1) {
return Result.getFailResult("数量或单价不能为空!", null);
}
}
return Result.getSuccessResult(buyorderHeadService.insertBuyorderHead(buyorderHead, buyOrderList));
}
/**
* 修改采购单列表
*/
@GetMapping("/edit/{poId}")
public String edit(@PathVariable("poId") String poId, ModelMap mmap) {
System.out.println(poId);
BuyorderHead buyorderHead = buyorderHeadService.selectBuyorderHeadById(poId);
BuyorderList buyorderList1 = new BuyorderList();
buyorderList1.setPoId(poId);
List<BuyorderList> buyorderLists = buyorderListService.selectBuyorderListList(buyorderList1);
//System.out.println("buyorderHead"+buyorderHead);
mmap.put("buyorderHead", buyorderHead);
mmap.put("buyorderList", buyorderLists);
return prefix + "/edit2";
}
/**
* 修改保存采购单列表
*/
@RequiresPermissions("buyorderHead:buyOrderList:edit")
@Log(title = "采购单列表", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(String jsonStr) {
//System.out.println(jsonStr);
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
BuyorderHead buyorderHead = jsonObject.toJavaObject(BuyorderHead.class);
//System.out.println("buyorderHead"+buyorderHead);
if (buyorderHead.getEndFlag() == null) {
buyorderHead.setEndFlag(0);
}
if (buyorderHead.getApproveFlag() == null) {
buyorderHead.setApproveFlag(0);
}
if (buyorderHead.getAuditingFlag() == null) {
buyorderHead.setAuditingFlag(0);
}
if (buyorderHead.getComfirmFlag() == null) {
buyorderHead.setComfirmFlag(0);
}
return toAjax(buyorderHeadService.updateBuyorderHead(buyorderHead));
}
/**
* 删除采购单列表
*/
@RequiresPermissions("buyorderHead:buyOrderList:remove")
@Log(title = "采购单列表", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(buyorderHeadService.deleteBuyorderHeadByIds(ids));
}
@PostMapping("/count")
@ResponseBody
public Result findCountByDay() throws Exception {
return buyorderHeadService.findCountByDay();
}
@ResponseBody
@RequestMapping("/addRemind")
public Result addRemind(Remind remind) throws Exception {
if (remind.getReceiver() == null) {
return Result.getFailResult("请选择接收人!", null);
}
if (remind.getRemindContent() == null) {
return Result.getFailResult("请传入提示信息!", null);
}
// 获取当前的用户信息
SysUser currentUser = ShiroUtils.getSysUser();
// 获取当前的登录名称
String userName = currentUser.getLoginName();
remind.setRemind(userName);
LocalDate now = LocalDate.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String date = dateTimeFormatter.format(now);
remind.setRemindDate(date);
remind.setIsView("0");
int add = remindService.add(remind);
return Result.getSuccessResult(remind);
}
@ResponseBody
@RequestMapping("/changeView")
public Result changeRemindView(Remind remind) throws Exception {
remind.setIsView("1");
int edit = remindService.edit(remind);
return Result.getSuccessResult(edit);
}
@ResponseBody
@RequestMapping("/procurementCheck")
public TableDataInfo getProcurementCheckList(ProcurementCheck procurementCheck) throws Exception {
startPage();
List<ProcurementCheck> procurementCheckList = procurementCheckService.findProcurementCheckList(procurementCheck);
System.out.println(procurementCheckList);
return getDataTable(procurementCheckList);
}
}

547
ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/domain/BuyorderHead.java

@ -1,547 +0,0 @@
package com.ruoyi.buyorderHead.domain;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.po.domain.BuyorderList;
import java.util.Date;
import java.util.List;
/**
* 采购单列表对象 buyorder_head
*
* @author ruoyi
* @date 2021-10-25
*/
public class BuyorderHead extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 订购编号 */
private String poId;
/** 订购单号 */
@Excel(name = "订购单号")
private String poNo;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String pCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String pName;
/** 联系人 */
@Excel(name = "联系人")
private String pLinkman;
/** 联系电话 */
@Excel(name = "联系电话")
private String pTel;
/** 传真号码 */
@Excel(name = "传真号码")
private String pFax;
/** 交货地址 */
@Excel(name = "交货地址")
private String sendAddress;
/** 付款条件 */
@Excel(name = "付款条件")
private String GetMoneyMemo;
/** 交货条件 */
@Excel(name = "交货条件")
private String Sendmemo;
/** 交货方式 */
@Excel(name = "交货方式")
private String Sendway;
/** 开单日期 */
@JSONField(format="yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date poDate;
/** 订购种类 */
@Excel(name = "订购种类")
private String poClass;
/** 采购担当 */
@Excel(name = "采购担当")
private String poMan;
/** 备注内容 */
@Excel(name = "备注内容")
private String bzMemo;
/** 结案 */
@Excel(name = "结案")
private Integer endFlag;
/** */
private Integer chinaInOrOut;
/** 删除否 */
private Integer isDelete;
/** 税率 */
@Excel(name = "税率")
private Long TaxPercent;
/** */
private String appId;
/** 确定否 */
@Excel(name = "确定否")
private Integer comfirmFlag;
/** 确定人 */
@Excel(name = "确定人")
private String comfirmMan;
/** 确定日期 */
private Date comfirmDate;
/** 审核否 */
@Excel(name = "审核否")
private Integer auditingFlag;
/** 审核人 */
@Excel(name = "审核人")
private String auditingMan;
/** 审核日期 */
private Date auditingDate;
/** 核准否 */
@Excel(name = "核准否")
private Integer approveFlag;
/** 核准人 */
@Excel(name = "核准人")
private String approveMan;
/** 核准日期 */
private Date approveDate;
/** 购方名称 */
@Excel(name = "购方名称")
private String poPName;
/** */
private String jaMan;
/** */
private String jaTime;
/** */
private String applyId;
/** */
private String SaleOrderNO;
private List<BuyorderList> buyOrderList;
public List<BuyorderList> getBuyOrderList() {
return buyOrderList;
}
public void setBuyOrderList(List<BuyorderList> buyOrderList) {
this.buyOrderList = buyOrderList;
}
public void setPoId(String poId)
{
this.poId = poId;
}
public String getPoId()
{
return poId;
}
public void setPoNo(String poNo)
{
this.poNo = poNo;
}
public String getPoNo()
{
return poNo;
}
public void setpCode(String pCode)
{
this.pCode = pCode;
}
public String getpCode()
{
return pCode;
}
public void setpName(String pName)
{
this.pName = pName;
}
public String getpName()
{
return pName;
}
public void setpLinkman(String pLinkman)
{
this.pLinkman = pLinkman;
}
public String getpLinkman()
{
return pLinkman;
}
public void setpTel(String pTel)
{
this.pTel = pTel;
}
public String getpTel()
{
return pTel;
}
public void setpFax(String pFax)
{
this.pFax = pFax;
}
public String getpFax()
{
return pFax;
}
public void setSendAddress(String sendAddress)
{
this.sendAddress = sendAddress;
}
public String getSendAddress()
{
return sendAddress;
}
public void setGetMoneyMemo(String GetMoneyMemo)
{
this.GetMoneyMemo = GetMoneyMemo;
}
public String getGetMoneyMemo()
{
return GetMoneyMemo;
}
public void setSendmemo(String Sendmemo)
{
this.Sendmemo = Sendmemo;
}
public String getSendmemo()
{
return Sendmemo;
}
public void setSendway(String Sendway)
{
this.Sendway = Sendway;
}
public String getSendway()
{
return Sendway;
}
public void setPoDate(Date poDate)
{
this.poDate = poDate;
}
public Date getPoDate()
{
return poDate;
}
public void setPoClass(String poClass)
{
this.poClass = poClass;
}
public String getPoClass()
{
return poClass;
}
public void setPoMan(String poMan)
{
this.poMan = poMan;
}
public String getPoMan()
{
return poMan;
}
public void setBzMemo(String bzMemo)
{
this.bzMemo = bzMemo;
}
public String getBzMemo()
{
return bzMemo;
}
public void setEndFlag(Integer endFlag)
{
this.endFlag = endFlag;
}
public Integer getEndFlag()
{
return endFlag;
}
public void setChinaInOrOut(Integer chinaInOrOut)
{
this.chinaInOrOut = chinaInOrOut;
}
public Integer getChinaInOrOut()
{
return chinaInOrOut;
}
public void setIsDelete(Integer isDelete)
{
this.isDelete = isDelete;
}
public Integer getIsDelete()
{
return isDelete;
}
public void setTaxPercent(Long TaxPercent)
{
this.TaxPercent = TaxPercent;
}
public Long getTaxPercent()
{
return TaxPercent;
}
public void setAppId(String appId)
{
this.appId = appId;
}
public String getAppId()
{
return appId;
}
public void setComfirmFlag(Integer comfirmFlag)
{
this.comfirmFlag = comfirmFlag;
}
public Integer getComfirmFlag()
{
return comfirmFlag;
}
public void setComfirmMan(String comfirmMan)
{
this.comfirmMan = comfirmMan;
}
public String getComfirmMan()
{
return comfirmMan;
}
public void setComfirmDate(Date comfirmDate)
{
this.comfirmDate = comfirmDate;
}
public Date getComfirmDate()
{
return comfirmDate;
}
public void setAuditingFlag(Integer auditingFlag)
{
this.auditingFlag = auditingFlag;
}
public Integer getAuditingFlag()
{
return auditingFlag;
}
public void setAuditingMan(String auditingMan)
{
this.auditingMan = auditingMan;
}
public String getAuditingMan()
{
return auditingMan;
}
public void setAuditingDate(Date auditingDate)
{
this.auditingDate = auditingDate;
}
public Date getAuditingDate()
{
return auditingDate;
}
public void setApproveFlag(Integer approveFlag)
{
this.approveFlag = approveFlag;
}
public Integer getApproveFlag()
{
return approveFlag;
}
public void setApproveMan(String approveMan)
{
this.approveMan = approveMan;
}
public String getApproveMan()
{
return approveMan;
}
public void setApproveDate(Date approveDate)
{
this.approveDate = approveDate;
}
public Date getApproveDate()
{
return approveDate;
}
public void setPoPName(String poPName)
{
this.poPName = poPName;
}
public String getPoPName()
{
return poPName;
}
public void setJaMan(String jaMan)
{
this.jaMan = jaMan;
}
public String getJaMan()
{
return jaMan;
}
public void setJaTime(String jaTime)
{
this.jaTime = jaTime;
}
public String getJaTime()
{
return jaTime;
}
public void setApplyId(String applyId)
{
this.applyId = applyId;
}
public String getApplyId()
{
return applyId;
}
public void setSaleOrderNO(String SaleOrderNO)
{
this.SaleOrderNO = SaleOrderNO;
}
public String getSaleOrderNO()
{
return SaleOrderNO;
}
// @Override
// public String toString() {
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
// .append("poId", getPoId())
// .append("poNo", getPoNo())
// .append("pCode", getpCode())
// .append("pName", getpName())
// .append("pLinkman", getpLinkman())
// .append("pTel", getpTel())
// .append("pFax", getpFax())
// .append("sendAddress", getSendAddress())
// .append("GetMoneyMemo", getGetMoneyMemo())
// .append("Sendmemo", getSendmemo())
// .append("Sendway", getSendway())
// .append("poDate", getPoDate())
// .append("poClass", getPoClass())
// .append("poMan", getPoMan())
// .append("bzMemo", getBzMemo())
// .append("endFlag", getEndFlag())
// .append("chinaInOrOut", getChinaInOrOut())
// .append("isDelete", getIsDelete())
// .append("TaxPercent", getTaxPercent())
// .append("appId", getAppId())
// .append("comfirmFlag", getComfirmFlag())
// .append("comfirmMan", getComfirmMan())
// .append("comfirmDate", getComfirmDate())
// .append("auditingFlag", getAuditingFlag())
// .append("auditingMan", getAuditingMan())
// .append("auditingDate", getAuditingDate())
// .append("approveFlag", getApproveFlag())
// .append("approveMan", getApproveMan())
// .append("approveDate", getApproveDate())
// .append("poPName", getPoPName())
// .append("jaMan", getJaMan())
// .append("jaTime", getJaTime())
// .append("applyId", getApplyId())
// .append("SaleOrderNO", getSaleOrderNO())
// .toString();
// }
@Override
public String toString() {
return "BuyorderHead{" +
"poId='" + poId + '\'' +
", poNo='" + poNo + '\'' +
", pCode='" + pCode + '\'' +
", pName='" + pName + '\'' +
", pLinkman='" + pLinkman + '\'' +
", pTel='" + pTel + '\'' +
", pFax='" + pFax + '\'' +
", sendAddress='" + sendAddress + '\'' +
", GetMoneyMemo='" + GetMoneyMemo + '\'' +
", Sendmemo='" + Sendmemo + '\'' +
", Sendway='" + Sendway + '\'' +
", poDate=" + poDate +
", poClass='" + poClass + '\'' +
", poMan='" + poMan + '\'' +
", bzMemo='" + bzMemo + '\'' +
", endFlag=" + endFlag +
", chinaInOrOut=" + chinaInOrOut +
", isDelete=" + isDelete +
", TaxPercent=" + TaxPercent +
", appId='" + appId + '\'' +
", comfirmFlag=" + comfirmFlag +
", comfirmMan='" + comfirmMan + '\'' +
", comfirmDate=" + comfirmDate +
", auditingFlag=" + auditingFlag +
", auditingMan='" + auditingMan + '\'' +
", auditingDate=" + auditingDate +
", approveFlag=" + approveFlag +
", approveMan='" + approveMan + '\'' +
", approveDate=" + approveDate +
", poPName='" + poPName + '\'' +
", jaMan='" + jaMan + '\'' +
", jaTime='" + jaTime + '\'' +
", applyId='" + applyId + '\'' +
", SaleOrderNO='" + SaleOrderNO + '\'' +
", buyOrderList=" + buyOrderList +
'}';
}
}

64
ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/mapper/BuyorderHeadMapper.java

@ -1,64 +0,0 @@
package com.ruoyi.buyorderHead.mapper;
import com.ruoyi.buyorderHead.domain.BuyorderHead;
import java.util.List;
/**
* 采购单列表Mapper接口
*
* @author ruoyi
* @date 2021-10-25
*/
public interface BuyorderHeadMapper
{
/**
* 查询采购单列表
*
* @param poId 采购单列表ID
* @return 采购单列表
*/
public BuyorderHead selectBuyorderHeadById(String poId);
/**
* 查询采购单列表列表
*
* @param buyorderHead 采购单列表
* @return 采购单列表集合
*/
public List<BuyorderHead> selectBuyorderHeadList(BuyorderHead buyorderHead);
/**
* 新增采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
public int insertBuyorderHead(BuyorderHead buyorderHead);
/**
* 修改采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
public int updateBuyorderHead(BuyorderHead buyorderHead);
/**
* 删除采购单列表
*
* @param poId 采购单列表ID
* @return 结果
*/
public int deleteBuyorderHeadById(String poId);
/**
* 批量删除采购单列表
*
* @param poIds 需要删除的数据ID
* @return 结果
*/
public int deleteBuyorderHeadByIds(String[] poIds);
public Integer selectCountByDay();
}

67
ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/IBuyorderHeadService.java

@ -1,67 +0,0 @@
package com.ruoyi.buyorderHead.service;
import com.ruoyi.buyorderHead.domain.BuyorderHead;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.po.domain.BuyorderList;
import java.util.List;
/**
* 采购单列表Service接口
*
* @author ruoyi
* @date 2021-10-25
*/
public interface IBuyorderHeadService
{
/**
* 查询采购单列表
*
* @param poId 采购单列表ID
* @return 采购单列表
*/
public BuyorderHead selectBuyorderHeadById(String poId);
/**
* 查询采购单列表列表
*
* @param buyorderHead 采购单列表
* @return 采购单列表集合
*/
public List<BuyorderHead> selectBuyorderHeadList(BuyorderHead buyorderHead);
/**
* 新增采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
public int insertBuyorderHead(BuyorderHead buyorderHead, List<BuyorderList> buyorderLists)throws Exception;
/**
* 修改采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
public int updateBuyorderHead(BuyorderHead buyorderHead);
/**
* 批量删除采购单列表
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteBuyorderHeadByIds(String ids);
/**
* 删除采购单列表信息
*
* @param poId 采购单列表ID
* @return 结果
*/
public int deleteBuyorderHeadById(String poId);
public Result findCountByDay()throws Exception;
}

132
ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/impl/BuyorderHeadServiceImpl.java

@ -1,132 +0,0 @@
package com.ruoyi.buyorderHead.service.impl;
import com.alibaba.druid.util.StringUtils;
import com.ruoyi.buyorderHead.domain.BuyorderHead;
import com.ruoyi.buyorderHead.mapper.BuyorderHeadMapper;
import com.ruoyi.buyorderHead.service.IBuyorderHeadService;
import com.ruoyi.ck.domain.Provider;
import com.ruoyi.ck.mapper.ProviderMapper;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.po.domain.BuyorderList;
import com.ruoyi.po.mapper.BuyorderListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
/**
* 采购单列表Service业务层处理
*
* @author ruoyi
* @date 2021-10-25
*/
@Service
public class BuyorderHeadServiceImpl implements IBuyorderHeadService {
@Autowired
private BuyorderHeadMapper buyorderHeadMapper;
@Autowired
private ProviderMapper providerMapper;
@Autowired
private BuyorderListMapper buyorderListMapper;
/**
* 查询采购单列表
*
* @param poId 采购单列表ID
* @return 采购单列表
*/
@Override
public BuyorderHead selectBuyorderHeadById(String poId) {
return buyorderHeadMapper.selectBuyorderHeadById(poId);
}
/**
* 查询采购单列表列表
*
* @param buyorderHead 采购单列表
* @return 采购单列表
*/
@Override
public List<BuyorderHead> selectBuyorderHeadList(BuyorderHead buyorderHead) {
return buyorderHeadMapper.selectBuyorderHeadList(buyorderHead);
}
/**
* 新增采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
@Override
public int insertBuyorderHead(BuyorderHead buyorderHead, List<BuyorderList> buyorderLists) throws Exception {
Provider provider = new Provider();
provider.setpName(buyorderHead.getpName());
List<Provider> providers = providerMapper.selectByItem(provider);
buyorderHead.setpCode(providers.get(0).getpCode());
buyorderHead.setPoId(buyorderHead.getPoNo());
insertOrUpdateBuyOrderList(buyorderLists, buyorderHead.getPoId());
return buyorderHeadMapper.insertBuyorderHead(buyorderHead);
}
/**
* 修改采购单列表
*
* @param buyorderHead 采购单列表
* @return 结果
*/
@Override
public int updateBuyorderHead(BuyorderHead buyorderHead) {
buyorderListMapper.deleteBuyorderListById(buyorderHead.getPoId());
insertOrUpdateBuyOrderList(buyorderHead.getBuyOrderList(), buyorderHead.getPoId());
return buyorderHeadMapper.updateBuyorderHead(buyorderHead);
}
/**
* 删除采购单列表对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteBuyorderHeadByIds(String ids) {
return buyorderHeadMapper.deleteBuyorderHeadByIds(Convert.toStrArray(ids));
}
/**
* 删除采购单列表信息
*
* @param poId 采购单列表ID
* @return 结果
*/
@Override
public int deleteBuyorderHeadById(String poId) {
return buyorderHeadMapper.deleteBuyorderHeadById(poId);
}
@Override
public Result findCountByDay() throws Exception {
Integer count = buyorderHeadMapper.selectCountByDay() + 1;
LocalDate now = LocalDate.now();
String substring = now.toString().replace("-", "").substring(2);
String data = "PO" + substring + count;
return Result.getSuccessResult(data);
}
private void insertOrUpdateBuyOrderList(List<BuyorderList> buyOrderLists, String poId) {
for (BuyorderList eachBuyOrderList : buyOrderLists) {
eachBuyOrderList.setPoId(poId);
if (eachBuyOrderList.getSendDate() == null) {
eachBuyOrderList.setSendDate(new Date());
}
if (StringUtils.isEmpty(eachBuyOrderList.getCrlName())) {
eachBuyOrderList.setCrlName("RMB");
}
buyorderListMapper.insertBuyorderList(eachBuyOrderList);
}
}
}

225
ruoyi-admin/src/main/resources/mapper/buyorderHead/BuyorderHeadMapper.xml

@ -1,225 +0,0 @@
<?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.buyorderHead.mapper.BuyorderHeadMapper">
<resultMap type="BuyorderHead" id="BuyorderHeadResult">
<result property="poId" column="PO_ID" />
<result property="poNo" column="PO_NO" />
<result property="pCode" column="P_CODE" />
<result property="pName" column="P_Name" />
<result property="pLinkman" column="P_LinkMan" />
<result property="pTel" column="P_TEL" />
<result property="pFax" column="P_FAX" />
<result property="sendAddress" column="Send_Address" />
<result property="GetMoneyMemo" column="GetMoneyMemo" />
<result property="Sendmemo" column="Sendmemo" />
<result property="Sendway" column="Sendway" />
<result property="poDate" column="PO_date" />
<result property="poClass" column="PO_Class" />
<result property="poMan" column="PO_man" />
<result property="bzMemo" column="BZ_memo" />
<result property="endFlag" column="End_flag" />
<result property="chinaInOrOut" column="China_in_or_out" />
<result property="isDelete" column="Is_delete" />
<result property="TaxPercent" column="TaxPercent" />
<result property="appId" column="APP_ID" />
<result property="comfirmFlag" column="Comfirm_Flag" />
<result property="comfirmMan" column="Comfirm_man" />
<result property="comfirmDate" column="Comfirm_date" />
<result property="auditingFlag" column="Auditing_Flag" />
<result property="auditingMan" column="Auditing_MAN" />
<result property="auditingDate" column="Auditing_DATE" />
<result property="approveFlag" column="Approve_Flag" />
<result property="approveMan" column="Approve_MAN" />
<result property="approveDate" column="Approve_DATE" />
<result property="poPName" column="PO_P_NAME" />
<result property="jaMan" column="JA_MAN" />
<result property="jaTime" column="JA_TIME" />
<result property="applyId" column="Apply_ID" />
<result property="SaleOrderNO" column="SaleOrderNO" />
</resultMap>
<sql id="selectBuyorderHeadVo">
select PO_ID, PO_NO, P_CODE, P_Name, P_LinkMan, P_TEL, P_FAX, Send_Address, GetMoneyMemo, Sendmemo, Sendway, PO_date, PO_Class, PO_man, BZ_memo, End_flag, China_in_or_out, Is_delete, TaxPercent, APP_ID, Comfirm_Flag, Comfirm_man, Comfirm_date, Auditing_Flag, Auditing_MAN, Auditing_DATE, Approve_Flag, Approve_MAN, Approve_DATE, PO_P_NAME, JA_MAN, JA_TIME, Apply_ID, SaleOrderNO from buyorder_head
</sql>
<select id="selectBuyorderHeadList" parameterType="BuyorderHead" resultMap="BuyorderHeadResult">
<include refid="selectBuyorderHeadVo"/>
<where>
<if test="poId != null and poId != ''"> and PO_ID like concat('%', #{poId}, '%')</if>
<if test="poNo != null and poNo != ''"> and PO_NO like concat('%', #{poNo}, '%')</if>
<if test="pCode != null and pCode != ''"> and P_CODE like concat('%', #{pCode}, '%')</if>
<if test="pName != null and pName != ''"> and P_Name like concat('%', #{pName}, '%')</if>
<if test="pLinkman != null and pLinkman != ''"> and P_LinkMan like concat('%', #{pLinkman}, '%')</if>
<if test="pTel != null and pTel != ''"> and P_TEL like concat('%', #{pTel}, '%')</if>
<if test="pFax != null and pFax != ''"> and P_FAX like concat('%', #{pFax}, '%')</if>
<if test="sendAddress != null and sendAddress != ''"> and Send_Address like concat('%', #{sendAddress}, '%')</if>
<if test="GetMoneyMemo != null and GetMoneyMemo != ''"> and GetMoneyMemo like concat('%', #{GetMoneyMemo}, '%')</if>
<if test="Sendmemo != null and Sendmemo != ''"> and Sendmemo like concat('%', #{Sendmemo}, '%')</if>
<if test="Sendway != null and Sendway != ''"> and Sendway like concat('%', #{Sendway}, '%')</if>
<if test="poClass != null and poClass != ''"> and PO_Class like concat('%', #{poClass}, '%')</if>
<if test="poMan != null and poMan != ''"> and PO_man like concat('%', #{poMan}, '%')</if>
<if test="bzMemo != null and bzMemo != ''"> and BZ_memo like concat('%', #{bzMemo}, '%')</if>
<if test="endFlag != null "> and End_flag = #{endFlag}</if>
<if test="chinaInOrOut != null "> and China_in_or_out like concat('%', #{chinaInOrOut}, '%')</if>
<if test="isDelete != null "> and Is_delete = #{isDelete}</if>
<if test="TaxPercent != null "> and TaxPercent like concat('%', #{TaxPercent}, '%')</if>
<if test="appId != null and appId != ''"> and APP_ID like concat('%', #{appId}, '%')</if>
<if test="comfirmFlag != null "> and Comfirm_Flag = #{comfirmFlag}</if>
<if test="comfirmMan != null and comfirmMan != ''"> and Comfirm_man like concat('%', #{comfirmMan}, '%')</if>
<if test="comfirmDate != null "> and Comfirm_date = #{comfirmDate}</if>
<if test="auditingFlag != null "> and Auditing_Flag = #{auditingFlag}</if>
<if test="auditingMan != null and auditingMan != ''"> and Auditing_MAN = #{auditingMan}</if>
<if test="auditingDate != null "> and Auditing_DATE = #{auditingDate}</if>
<if test="approveFlag != null "> and Approve_Flag = #{approveFlag}</if>
<if test="approveMan != null and approveMan != ''"> and Approve_MAN = #{approveMan}</if>
<if test="approveDate != null "> and Approve_DATE = #{approveDate}</if>
<if test="poPName != null and poPName != ''"> and PO_P_NAME like concat('%', #{poPName}, '%')</if>
<if test="jaMan != null and jaMan != ''"> and JA_MAN = #{jaMan}</if>
<if test="jaTime != null and jaTime != ''"> and JA_TIME = #{jaTime}</if>
<if test="applyId != null and applyId != ''"> and Apply_ID = #{applyId}</if>
<if test="SaleOrderNO != null and SaleOrderNO != ''"> and SaleOrderNO = #{SaleOrderNO}</if>
<if test="params.beginPoDate != null and params.beginPoDate !=''"> and PO_date >= #{params.beginPoDate}</if>
<if test="params.endPoDate != null and params.endPoDate != ''">and #{params.endPoDate} >= PO_date</if>
</where>
order by PO_date desc
</select>
<select id="selectBuyorderHeadById" parameterType="String" resultMap="BuyorderHeadResult">
<include refid="selectBuyorderHeadVo"/>
where PO_ID = #{poId}
</select>
<insert id="insertBuyorderHead" parameterType="BuyorderHead">
insert into buyorder_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="poId != null">PO_ID,</if>
<if test="poNo != null">PO_NO,</if>
<if test="pCode != null">P_CODE,</if>
<if test="pName != null">P_Name,</if>
<if test="pLinkman != null">P_LinkMan,</if>
<if test="pTel != null">P_TEL,</if>
<if test="pFax != null">P_FAX,</if>
<if test="sendAddress != null">Send_Address,</if>
<if test="GetMoneyMemo != null">GetMoneyMemo,</if>
<if test="Sendmemo != null">Sendmemo,</if>
<if test="Sendway != null">Sendway,</if>
<if test="poDate != null">PO_date,</if>
<if test="poClass != null">PO_Class,</if>
<if test="poMan != null">PO_man,</if>
<if test="bzMemo != null">BZ_memo,</if>
<if test="endFlag != null">End_flag,</if>
<if test="chinaInOrOut != null">China_in_or_out,</if>
<if test="isDelete != null">Is_delete,</if>
<if test="TaxPercent != null">TaxPercent,</if>
<if test="appId != null">APP_ID,</if>
<if test="comfirmFlag != null">Comfirm_Flag,</if>
<if test="comfirmMan != null">Comfirm_man,</if>
<if test="comfirmDate != null">Comfirm_date,</if>
<if test="auditingFlag != null">Auditing_Flag,</if>
<if test="auditingMan != null">Auditing_MAN,</if>
<if test="auditingDate != null">Auditing_DATE,</if>
<if test="approveFlag != null">Approve_Flag,</if>
<if test="approveMan != null">Approve_MAN,</if>
<if test="approveDate != null">Approve_DATE,</if>
<if test="poPName != null">PO_P_NAME,</if>
<if test="jaMan != null">JA_MAN,</if>
<if test="jaTime != null">JA_TIME,</if>
<if test="applyId != null">Apply_ID,</if>
<if test="SaleOrderNO != null">SaleOrderNO,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="poId != null">#{poId},</if>
<if test="poNo != null">#{poNo},</if>
<if test="pCode != null">#{pCode},</if>
<if test="pName != null">#{pName},</if>
<if test="pLinkman != null">#{pLinkman},</if>
<if test="pTel != null">#{pTel},</if>
<if test="pFax != null">#{pFax},</if>
<if test="sendAddress != null">#{sendAddress},</if>
<if test="GetMoneyMemo != null">#{GetMoneyMemo},</if>
<if test="Sendmemo != null">#{Sendmemo},</if>
<if test="Sendway != null">#{Sendway},</if>
<if test="poDate != null">#{poDate},</if>
<if test="poClass != null">#{poClass},</if>
<if test="poMan != null">#{poMan},</if>
<if test="bzMemo != null">#{bzMemo},</if>
<if test="endFlag != null">#{endFlag},</if>
<if test="chinaInOrOut != null">#{chinaInOrOut},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="TaxPercent != null">#{TaxPercent},</if>
<if test="appId != null">#{appId},</if>
<if test="comfirmFlag != null">#{comfirmFlag},</if>
<if test="comfirmMan != null">#{comfirmMan},</if>
<if test="comfirmDate != null">#{comfirmDate},</if>
<if test="auditingFlag != null">#{auditingFlag},</if>
<if test="auditingMan != null">#{auditingMan},</if>
<if test="auditingDate != null">#{auditingDate},</if>
<if test="approveFlag != null">#{approveFlag},</if>
<if test="approveMan != null">#{approveMan},</if>
<if test="approveDate != null">#{approveDate},</if>
<if test="poPName != null">#{poPName},</if>
<if test="jaMan != null">#{jaMan},</if>
<if test="jaTime != null">#{jaTime},</if>
<if test="applyId != null">#{applyId},</if>
<if test="SaleOrderNO != null">#{SaleOrderNO},</if>
</trim>
</insert>
<update id="updateBuyorderHead" parameterType="BuyorderHead">
update buyorder_head
<trim prefix="SET" suffixOverrides=",">
<if test="poNo != null">PO_NO = #{poNo},</if>
<if test="pCode != null">P_CODE = #{pCode},</if>
<if test="pName != null">P_Name = #{pName},</if>
<if test="pLinkman != null">P_LinkMan = #{pLinkman},</if>
<if test="pTel != null">P_TEL = #{pTel},</if>
<if test="pFax != null">P_FAX = #{pFax},</if>
<if test="sendAddress != null">Send_Address = #{sendAddress},</if>
<if test="GetMoneyMemo != null">GetMoneyMemo = #{GetMoneyMemo},</if>
<if test="Sendmemo != null">Sendmemo = #{Sendmemo},</if>
<if test="Sendway != null">Sendway = #{Sendway},</if>
<if test="poDate != null">PO_date = #{poDate},</if>
<if test="poClass != null">PO_Class = #{poClass},</if>
<if test="poMan != null">PO_man = #{poMan},</if>
<if test="bzMemo != null">BZ_memo = #{bzMemo},</if>
<if test="endFlag != null">End_flag = #{endFlag},</if>
<if test="chinaInOrOut != null">China_in_or_out = #{chinaInOrOut},</if>
<if test="isDelete != null">Is_delete = #{isDelete},</if>
<if test="TaxPercent != null">TaxPercent = #{TaxPercent},</if>
<if test="appId != null">APP_ID = #{appId},</if>
<if test="comfirmFlag != null">Comfirm_Flag = #{comfirmFlag},</if>
<if test="comfirmMan != null">Comfirm_man = #{comfirmMan},</if>
<if test="comfirmDate != null">Comfirm_date = #{comfirmDate},</if>
<if test="auditingFlag != null">Auditing_Flag = #{auditingFlag},</if>
<if test="auditingMan != null">Auditing_MAN = #{auditingMan},</if>
<if test="auditingDate != null">Auditing_DATE = #{auditingDate},</if>
<if test="approveFlag != null">Approve_Flag = #{approveFlag},</if>
<if test="approveMan != null">Approve_MAN = #{approveMan},</if>
<if test="approveDate != null">Approve_DATE = #{approveDate},</if>
<if test="poPName != null">PO_P_NAME = #{poPName},</if>
<if test="jaMan != null">JA_MAN = #{jaMan},</if>
<if test="jaTime != null">JA_TIME = #{jaTime},</if>
<if test="applyId != null">Apply_ID = #{applyId},</if>
<if test="SaleOrderNO != null">SaleOrderNO = #{SaleOrderNO},</if>
</trim>
where PO_ID = #{poId}
</update>
<delete id="deleteBuyorderHeadById" parameterType="String">
delete from buyorder_head where PO_ID = #{poId}
</delete>
<delete id="deleteBuyorderHeadByIds" parameterType="String">
delete from buyorder_head where PO_ID in
<foreach item="poId" collection="array" open="(" separator="," close=")">
#{poId}
</foreach>
</delete>
<select id="selectCountByDay" resultType="Integer">
select count(*) from buyorder_head where to_days(PO_Date) = to_days(now());
</select>
</mapper>

733
ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/add2.html

@ -1,733 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增物料清单')"/>
<th:block th:include="include :: bootstrap-editable-css"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12">
</div>
<form class="form-horizontal m" id="form-buyOrderList-add" name="form-buyOrderList-add">
<div class="form-group">
<label class="col-sm-3 control-label">订购单号:</label>
<div class="col-sm-8">
<input name="poNo" 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">
<select name="pCode" class="form-control m-b" disabled>
<option value="-1">--请选择--</option>
</select>
</div>
</div>
<input type="hidden" name="bootstrapTableBody">
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<select name="pName" class="form-control m-b">
<option value="-1">--请选择--</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input name="pLinkman" 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="pTel" 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="pFax" 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="sendAddress" 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="GetMoneyMemo" 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="Sendmemo" 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="Sendway" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开单日期:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="poDate" class="form-control time-input" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订购种类:</label>
<div class="col-sm-8">
<input name="poClass" class="form-control" type="text" readonly value="进口采购">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">采购担当:</label>
<div class="col-sm-8">
<select name="poMan" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="bzMemo" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="TaxPercent" class="form-control" type="text" value="0" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">购方名称:</label>
<div class="col-sm-8">
<input name="poPName" class="form-control" type="text" value="">
</div>
</div>
</form>
<button type="button" class="btn btn-success" id="btn_addBom" onclick="addBom()">新增</button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrapTableBody">
</table>
<!-- <div class="col-sm-12" style="margin-top: 50px">-->
<!-- <div class="row">-->
<!-- <div class="col-sm-12 col-sm-offset-3">-->
<!-- <button type="button" class="btn btn-primary" onclick="submit()" style="margin-left: 230px">提交</button>-->
<!-- <button onclick="closeAdd()" class="btn btn-danger" type="button" style="margin-left: 200px">关闭</button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="modal inmodal" id="bomModal" tabindex="-1"
role="dilog" aria-hidden="true" style="padding-bottom: 100px;">
<div class="modal-dialog" style="width: 800px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true"></button>
<h4 class="modal-title">选择物料</h4>
</div>
<div class="modal-body" style="text-align: center;">
<div class="row">
<div class="col-md-5">
<form id="bomForm" class="form-group">
<label class="control-label col-md-4">物料代码:</label>
<div class="col-md-8">
<input type="text" class="form-control" name="wlCode"
id="wlCode">
</div>
</form>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success" id="bomCodeSearch">搜索</button>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success" id="reset">重置</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table id="bomTable"
class="table table-striped table-responsive" style="padding-bottom: 50px;">
</table>
</div>
</div>
</div>
<button class="btn btn-success" id="btn_addWaitTable" onclick="addBom2()">添加</button>
<div class="row">
<div class="col-md-12">
<div class="table-responsive" style="padding-bottom:30px; ">
<table id="bomTable2"
class="table table-striped table-responsive">
</table>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
onClick="confirm();">确定
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "buyorderHead/buyOrderList";
var today = new Date();
today.setTime(today.getTime());
var time = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
$("input[name='poDate']").val(time);
//引入bom2表格
function addBom2() {
let row = $("#bomTable").bootstrapTable("getSelections");
let count = $('#bomTable2').bootstrapTable('getData').length;
for (let i = 0; i < row.length; i++) {
let bootstrapTable = $("#bootstrapTableBody").bootstrapTable("getRowByUniqueId", row[i].wlCode);
//alert(bootstrapTable);
if (bootstrapTable != null) {
$.modal.alert(bootstrapTable.wlCode + "已存在!");
continue;
}
$("#bomTable2").bootstrapTable('insertRow', {
index: count + i,
row: {
wldm: row[i].wldm,
wlCode: row[i].wlCode,
hsCode: row[i].hsCode,
itemname: row[i].itemname,
itemstandard: row[i].itemstandard,
machineNo: row[i].machineNo,
stockDw: row[i].stockDw,
intakeorchina: row[i].intakeorchina,
price: row[i].price
}
});
}
reset();
}
//移除bomtable2的对应行数据
function remove(wlCode) {
$("#bomTable2").bootstrapTable("remove", {
field: 'wlCode',
values: wlCode
});
}
function remove2(wlCode) {
$("#bootstrapTableBody").bootstrapTable("remove", {
field: 'wlCode',
values: wlCode
});
}
//点击引入按钮
function addBom() {
$("#bomModal").modal("show");
}
//确认
function confirm() {
let row = $("#bomTable2").bootstrapTable("getData", true);
let count = $('#bootstrapTableBody').bootstrapTable('getData').length;
for (let i = 0; i < row.length; i++) {
$("#bootstrapTableBody").bootstrapTable('insertRow', {
index: count + i,
row: {
wlCode: row[i].wlCode,
itemname: row[i].itemname,
itemstandard: row[i].itemstandard,
machineNo: row[i].machineNo,
stockDw: row[i].stockDw,
// weight: row[i].weight,
qty: 0,
price: row[i].price,
amt: 0
}
});
}
$("#bomModal").modal("hide");
reset();
$("#bomTable2").bootstrapTable("removeAll");
}
//点击搜索,刷新表格
$("#bomCodeSearch").click(function () {
$('#bomTable').bootstrapTable('refresh');
});
//重置
$("#reset").on("click", function () {
$("#wlCode").val("");
$("#bomTable").bootstrapTable("refresh");
});
function reset() {
$("#wlCode").val("");
$("#bomTable").bootstrapTable("refresh");
}
//提交
function submit() {
let bootstrapTable = $("#bootstrapTableBody").bootstrapTable("getData", true);
let formData = new FormData($("#form-buyOrderList-add")[0]);
formData.append("buyOrderList", JSON.stringify(bootstrapTable));
let data1 = {};
formData.forEach((value, key) => data1[key] = value);
//alert(JSON.stringify(data1));
$.ajax({
url: prefix + "/add",
type: "post",
resultType: "json",
data: {"jsonStr": JSON.stringify(data1)},
success: function (resp) {
if (resp.code === 0) {
alert("添加成功!");
// window.location.href = prefix;
var index = parent.layer.getFrameIndex(window.name);
var parent2 = window.parent;
parent2.$.table.refresh();
parent.layer.close(index);//关闭当前页
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//关闭
function closeAdd() {
//alert(132);
window.location.href = prefix;
}
//查询参数
function queryParams(params) {
var search = $.table.queryParams(params);
search.wlCode = $("#cpCode2").val();
return search;
}
//全部itemList
$('#bomTable').bootstrapTable({
url: ctx + "ProviderPrice/ProviderPrice/now",
method: 'post',
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: true, // 是否显示分页(*)
contentType: "application/x-www-form-urlencoded",
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
var wlCode = $("#wlCode").val();
//alert(wlCode);
var json = $.extend(curParams, {"wlCode": wlCode});
return json;
},
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
pageNumber: 1, // 初始化加载第一页,默认第一页
pageSize: 5, // 每页的记录行数(*)
pageList: [5, 10, 50], // 可供选择的每页的行数(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
// singleSelect : true,
height: 350,
columns: [
{
checkbox: true
},
{
field: 'wlCode',
title: '物料代码'
},
{
field: 'itemname',
title: '物料名称'
},
{
field: 'itemstandard',
title: '规格型号'
},
{
field: 'machineNo',
title: '机种',
},
{
field: 'stockDw',
title: '单位'
},
{
field: 'price',
title: '单价'
},
{
field: 'pCode',
title: '厂商号'
},
{
field: 'pName',
title: '厂商名'
}
]
});
//待确认bom
$('#bomTable2').bootstrapTable({
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
// contentType :"application/x-www-form-urlencoded",
// pageNumber : 1, // 初始化加载第一页,默认第一页
// pageSize : 10, // 每页的记录行数(*)
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
// clickToSelect : true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
height: 400,
columns: [
{
field: 'wlCode',
title: '物料代码'
},
{
field: 'itemname',
title: '物料名称'
},
{
field: 'itemstandard',
title: '规格型号'
},
{
field: 'machineNo',
title: '机种',
},
{
field: 'stockDw',
title: '单位'
},
{
field: 'price',
title: '单价'
},
{
field: 'pCode',
title: '厂商号'
},
{
field: 'pName',
title: '厂商名'
},
{
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="edit()"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}
]
});
//准备提交的bom
$('#bootstrapTableBody').bootstrapTable({
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
// contentType :"application/x-www-form-urlencoded",
// pageNumber : 1, // 初始化加载第一页,默认第一页
// pageSize : 10, // 每页的记录行数(*)
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
// clickToSelect : true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
height: 400,
uniqueId: 'wlCode',
onEditableSave: function (field, row, oldValue, $el) {
//alert(row.qty);
//alert(JSON.stringify(row));
if (row.qty > 0 && row.price > 0) {
row.amt = row.qty * row.price;
}
},
columns: [
{
checkbox: false
},
{
field: 'wlCode',
title: '代码',
},
{
field: 'itemname',
title: '名称',
},
{
field: 'itemstandard',
title: '规格型号',
},
{
field: 'stockDw',
title: '单位',
},
{
field: "qty",
title: '数量',
editable: {
type: 'text',
title: '数量',
emptytext: "0",
validate: function (value) {
if (parseInt(value) < 0) {
return '数量不能小于0!';
}
if (isNaN(value)) {
return '数量必须是数字!';
}
}
}
},
{
field: 'crlName',
title: '币别',
editable: {
type: 'select',
title: '币别',
source: function () {
let result = [];
$.ajax({
url: ctx + "system/dict/data/coin",
type: "post",
resultType: "json",
data: {"type": "sys_coin_class"},
async: false,
success: function (resp) {
if (resp.code === 0) {
let temp = resp.data;
for (let i in temp) {
result.push({value: temp[i].dictValue, text: temp[i].dictLabel});
}
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
return result;
}
}
},
{
field: 'price',
title: '单价',
// editable: {
// type: 'text',
// title: '单价',
// emptytext: "0",
// validate: function (value) {
// if (parseInt(value) <= 0) {
// return '单价必须大于0!';
// }
// if (isNaN(value)) {
// return '数量必须是数字!';
// }
// }
// }
},
{
field: 'amt',
title: '金额'
},
{
field: 'sendDate',
title: '交期',
editable: {
type: 'date',
title: '交期',
emptytext: time,
validate: function (value) {
let now = new Date();
if (value.getTime() < now.getTime()) {
return "交期至少是今天!";
}
}
}
},
{
field: 'memoList',
title: '说明',
editable: {
type: 'text',
title: '说明',
emptytext: ""
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove2(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
});
$("#form-buyOrderList-add").validate({
focusCleanup: true
});
//获取采购单号
$.ajax({
url: prefix + "/count",
type: "post",
dateType: "json",
success: function (resp) {
if (resp.code === 0) {
$("input[name='poNo']").val(resp.data);
}
},
error: function () {
$.modal.msgError("失败啦");
}
});
//获取用户名
$.ajax({
url: ctx + "system/user/all",
type: "post",
resultType: "json",
success: function (resp) {
console.log(resp);
if (resp.data.length > 0) {
$("select[name='poMan']").empty();
let username = resp.data;
for (let i in username) {
$("select[name='poMan']").append("<option value='" + username[i].userName + "'>" + username[i].userName + "</option>");
}
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//获取供应商
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
$("select [name='pCode']").empty();
$("select [name='pName']").empty();
var data = resp.data;
for (var i in data) {
//alert(data[i].pCode);
$("select[name='pCode']").append("<option value='" + data[i].pCode + "'>" + data[i].pCode + "</option>");
$("select[name='pName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
}
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//选择供应商时自动填入信息
$("select[name='pName']").change(function () {
let pName = $(this).val();
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/findOne",
data: {"pName": pName},
type: "post",
resultType: "json",
success: function (resp) {
$("select[name='pCode']").val(resp.data.pCode).trigger("change");
$("input[name='pLinkman']").val(resp.data.pLinkman);
$("input[name='pTel']").val(resp.data.pTel);
$("input[name='pFax']").val(resp.data.pFax);
$("input[name='GetMoneyMemo']").val(resp.data.pComCode);
$("input[name='TaxPercent']").val(resp.data.taxPercent);
},
error: function () {
$.modal.msgError("出错了!");
}
})
});
function submitHandler() {
// if ($.validate.form()) {
// $.operate.save(prefix + "/add", $('#form-ProviderPrice-add').serialize());
// }
submit();
}
</script>
</body>
</html>

866
ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/buyOrderList.html

@ -1,866 +0,0 @@
<!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('采购单列表列表')"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</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="poNo"/>
</li>
<li class="select-time">
<label>开单日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginPoDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endPoDate]"/>
</li>
<li>
<label>物料代码:</label>
<input type="text" name="wlCode"/>
</li>
<li>
<label>供应商名:</label>
<!--<input type="text" name="pName"/>-->
<select name="pName" class="form-control m-b">
<option value="">所有</option>
</select>
</li>
<li>
<label>购方名称:</label>
<input type="text" name="poPName"/>
</li>
<li>
<label>结案选择:</label>
<select name="endFlag">
<option value="">所有</option>
<option value="1">已结案</option>
<option value="0">未结案</option>
</select>
</li>
<li>
<label>确认否:</label>
<select name="comfirmFlag">
<option value="">所有</option>
<option value="1">已确认</option>
<option value="0">未确认</option>
</select>
</li>
<li>
<label>审核否:</label>
<select name="auditingFlag">
<option value="">所有</option>
<option value="1">已审核</option>
<option value="0">未审核</option>
</select>
</li>
<li>
<label>核准否:</label>
<select name="approveFlag">
<option value="">所有</option>
<option value="1">已核准</option>
<option value="0">未核准</option>
</select>
</li>
<li>
<label>币别:</label>
<select name="crlName"
th:with="type=${@dict.getType('sys_coin_class')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></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="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-success" onclick="$.operate.add()" shiro:hasPermission="buyorderHead:buyOrderList:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="buyorderHead:buyOrderList:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="buyorderHead:buyOrderList:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="buyorderHead:buyOrderList:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-info single disabled" onclick="showInfo()"
shiro:hasPermission="buyorderHead:buyOrderList:edit">
<i class="fa fa-info"></i> 详情信息
</a>
<a class="btn btn-white single disabled" onclick="createRemind()">
<i class="fa fa-bell"></i> 生成到货提示
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<div class="modal inmodal" id="infoModal" tabindex="-1"
role="dilog" aria-hidden="true">
<div class="modal-dialog" style="width: 1000px;height: 600px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true"></button>
<h4 class="modal-title">采购单信息</h4>
</div>
<div class="modal-body" style="text-align: center;">
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-3 control-label">订购单号:</label>
<div class="col-sm-9">
<input type="text" name="poNo" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商代码:</label>
<div class="col-sm-9">
<input type="text" name="pCode" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-9">
<input type="text" name="pName" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-9">
<input type="text" name="pLinkman" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系电话:</label>
<div class="col-sm-9">
<input type="text" name="pTel" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-9">
<input type="text" name="GetMoneyMemo" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">传真号码:</label>
<div class="col-sm-9">
<input type="text" name="pFax" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货地址:</label>
<div class="col-sm-9">
<input type="text" name="sendAddress" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否结案:</label>
<div class="col-sm-9">
<label>
<input type="checkbox" id="endFlag" onclick="return false;">&nbsp;结案</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">确定否:</label>
<div class="col-sm-9">
<label>
<input type="checkbox" id="comfirmFlag" onclick="return false;">&nbsp;确定</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-3 control-label">交货方式:</label>
<div class="col-sm-9">
<input type="text" name="Sendway" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开单日期:</label>
<div class="col-sm-9">
<div class="input-group date">
<input name="poDate" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订购种类:</label>
<div class="col-sm-9">
<input type="text" name="poClass" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">采购担当:</label>
<div class="col-sm-9">
<input type="text" name="poMan" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货条件:</label>
<div class="col-sm-9">
<input type="text" name="Sendmemo" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-9">
<input type="text" name="bzMemobzMemo" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-9">
<input type="text" name="TaxPercent" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">购方名称:</label>
<div class="col-sm-9">
<input type="text" name="poPName" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核否:</label>
<div class="col-sm-9">
<label>
<input type="checkbox" id="auditingFlag" onclick="return false;">&nbsp;审核</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">核准否:</label>
<div class="col-sm-9">
<label>
<input type="checkbox" id="approveFlag" onclick="return false;">&nbsp;核准</label>
</div>
</div>
</div>
<div class="col-md-12">
<div class="table-responsive">
<table id="buyOrderListTable"
class="table table-striped table-responsive">
</table>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" name="close">确定</button>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('buyorderHead:buyOrderList:edit')}]];
var removeFlag = [[${@permission.hasPermi('buyorderHead:buyOrderList:remove')}]];
var prefix = ctx + "buyorderHead/buyOrderList";
//鼠标移入,显示完整的数据
function paramsMatter(value, row, index) {
var span = document.createElement("span");
span.setAttribute("title", value);
span.innerHTML = value;
return span.outerHTML;
}
//获取供应商代码和名称
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
var data = resp.data;
for (var i in data) {
//alert(data[i].pCode);
$("select[name='pName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
}
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//重置
function reset(){
$("select[name='pName']").val("").trigger("change");
$.form.reset();
}
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "采购单列表",
columns: [{
checkbox: true
},
{
field: 'poId',
title: '订购编号',
visible: false
},
{
field: 'poNo',
title: '订购单号'
},
{
field: 'pCode',
title: '供应商代码'
},
{
field: 'pName',
title: '供应商名称',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "130px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "150px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'pLinkman',
title: '联系人',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'pTel',
title: '联系电话',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "100px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "120px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'pFax',
title: '传真号码',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'sendAddress',
title: '交货地址',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'getMoneyMemo',
title: '付款条件',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'sendmemo',
title: '交货条件',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'sendway',
title: '交货方式',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'poDate',
title: '开单日期',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'poClass',
title: '订购种类',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'poMan',
title: '采购担当',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'bzMemo',
title: '备注内容',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'endFlag',
title: '结案',
formatter: function (val) {
if (val === 1) {
return "已结案"
} else if (val === 0) {
return "未结案"
}
},
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
{
field: 'taxPercent',
title: '税率',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'comfirmFlag',
title: '确定否',
formatter: function (val) {
if (val === 1) {
return "已确认"
} else if (val === 0) {
return "未确认"
}
},
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
{
field: 'comfirmMan',
title: '确定人',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'auditingFlag',
title: '审核否',
formatter: function (val) {
if (val === 1) {
return "已审核"
} else if (val === 0) {
return "未审核"
}
},
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
{
field: 'auditingMan',
title: '审核人',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'approveFlag',
title: '核准否',
formatter: function (val) {
if (val === 1) {
return "已核准"
} else if (val === 0) {
return "未核准"
}
},
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
{
field: 'approveMan',
title: '核准人',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'poPName',
title: '购方名称',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
}
// ,
// {
// 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="showInfo(row)"><i class="fa fa-edit"></i>详细列表</a> ');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
function showInfo() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
//console.log(".............."+data[0].endFlag);
$("input[name='poNo']").val(data[0].poNo);
$("input[name='pCode']").val(data[0].pCode);
$("input[name='pName']").val(data[0].pName);
$("input[name='pLinkman']").val(data[0].pLinkman);
$("input[name='pTel']").val(data[0].pTel);
$("input[name='pFax']").val(data[0].pFax);
$("input[name='sendAddress']").val(data[0].sendAddress);
$("input[name='GetMoneyMemo']").val(data[0].GetMoneyMemo);
$("input[name='Sendmemo']").val(data[0].Sendmemo);
$("input[name='Sendway']").val(data[0].Sendway);
$("input[name='poDate']").val(data[0].poDate);
$("input[name='poClass']").val(data[0].poClass);
$("input[name='poMan']").val(data[0].poMan);
$("input[name='bzMemo']").val(data[0].bzMemo);
$("input[name='TaxPercent']").val(data[0].TaxPercent);
$("input[name='poPName']").val(data[0].poPName);
if (data[0].endFlag===1){
$("#endFlag").attr("checked",true);
}
if (data[0].comfirmFlag===1){
$("#comfirmFlag").prop("checked",true);
}
if (data[0].auditingFlag===1){
$("#auditingFlag").prop("checked",true);
}
if (data[0].approveFlag===1){
$("#approveFlag").prop("checked",true);
}
$("#buyOrderListTable").bootstrapTable('refresh');
//$("#infoModal").show();
$("#infoModal").modal("show");
}
$('#buyOrderListTable').bootstrapTable({
url: '/po/orderlist/list',
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
showRefresh: true,
method: "post",
contentType: "application/x-www-form-urlencoded",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
height: 250,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
//console.log(curParams);
var poNo = $("input[name='poNo']").val();
var json = $.extend(curParams, {"poId":poNo});
//console.log(json);
return json;
},
columns: [
{
field: 'wlCode',
title: '代码'
}, {
field: 'itemname',
title: '名称'
}, {
field: 'itemstandard',
title: '规格型号'
}, {
field: 'stockDw',
title: '单位'
}, {
field: 'qty',
title: '数量'
}, {
field: 'crlName',
title: '币别'
}, {
field: 'price',
title: '单价'
}, {
field: 'amt',
title: '金额'
}, {
field: 'sendDate',
title: '交期'
}, {
field: 'memoList',
title: '说明'
}]
});
$("button[name='close']").on("click",function () {
//alert("1");
$("#infoModal").modal("hide");
});
function addInfo() {
window.location.href=prefix+"/add";
}
function modifyInfo() {
let row = $("#bootstrap-table").bootstrapTable("getSelections");
window.location.href=prefix+"/edit/"+row[0].poNo;
}
//添加采购入库提醒
function createRemind() {
$.ajax({
url:prefix+"/addRemind",
type:"post",
dataType:"json",
data:{"formUrl":"/","formName":"入库通知列表","remindContent":"一条新的采购到货提醒","receiver":"admin"},
success:function (resp) {
if (resp.code === 0) {
alert("生成成功!");
window.location.href=prefix;
}else {
$.modal.msgError("发送失败!");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
}
</script>
</body>
</html>

873
ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/edit2.html

@ -1,873 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增物料清单')"/>
<th:block th:include="include :: bootstrap-editable-css"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12">
</div>
<form class="form-horizontal m" id="form-buyOrderList-edit" th:object="${buyorderHead}">
<input name="poId" th:field="*{poId}" type="hidden">
<input type="hidden" name="bootstrapTableBody">
<div class="form-group">
<label class="col-sm-3 control-label">订购单号:</label>
<div class="col-sm-8">
<input name="poNo" th:field="*{poNo}" 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">
<select name="pCode" class="form-control m-b" disabled>
<!--<option value="-1">&#45;&#45;请选择&#45;&#45;</option>-->
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<select name="pName" class="form-control m-b">
<!--<option value="-1">&#45;&#45;请选择&#45;&#45;</option>-->
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input name="pLinkman" th:field="*{pLinkman}" 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="pTel" th:field="*{pTel}" 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="pFax" th:field="*{pFax}" 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="sendAddress" th:field="*{sendAddress}" 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="GetMoneyMemo" th:field="*{GetMoneyMemo}" 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="Sendmemo" th:field="*{Sendmemo}" 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="Sendway" th:field="*{Sendway}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开单日期:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="poDate" th:value="${#dates.format(buyorderHead.poDate, 'yyyy-MM-dd')}"
class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订购种类:</label>
<div class="col-sm-8">
<input name="poClass" th:field="*{poClass}" 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">
<select name="poMan" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="bzMemo" class="form-control">[[*{bzMemo}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结案:</label>
<div class="col-sm-8">
<input type="checkbox" name="endFlag" onclick="changeEndFlag()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="TaxPercent" th:field="*{TaxPercent}" 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 type="checkbox" name="comfirmFlag" onclick="changeComfirmFlag()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核否:</label>
<div class="col-sm-8">
<input type="checkbox" name="auditingFlag" onclick="changeAuditingFlag()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">核准否:</label>
<div class="col-sm-8">
<input type="checkbox" name="approveFlag" onclick="changeApproveFlag()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">购方名称:</label>
<div class="col-sm-8">
<input name="poPName" th:field="*{poPName}" class="form-control" type="text">
</div>
</div>
</form>
<button type="button" class="btn btn-success" id="btn_addBom" onclick="addBom()">新增</button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrapTableBody">
</table>
</div>
<div class="modal inmodal" id="bomModal" tabindex="-1"
role="dilog" aria-hidden="true" style="padding-bottom: 100px;">
<div class="modal-dialog" style="width: 800px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true"></button>
<h4 class="modal-title">选择物料</h4>
</div>
<div class="modal-body" style="text-align: center;">
<div class="row">
<div class="col-md-5">
<form id="bomForm" class="form-group">
<label class="control-label col-md-4">物料代码:</label>
<div class="col-md-8">
<input type="text" class="form-control" name="wlCode"
id="wlCode">
</div>
</form>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success" id="bomCodeSearch">搜索</button>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success" id="reset">重置</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table id="bomTable"
class="table table-striped table-responsive" style="padding-bottom: 50px;">
</table>
</div>
</div>
</div>
<button class="btn btn-success" id="btn_addWaitTable" onclick="addBom2()">添加</button>
<div class="row">
<div class="col-md-12">
<div class="table-responsive" style="padding-bottom:30px; ">
<table id="bomTable2"
class="table table-striped table-responsive">
</table>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
onClick="confirm();">确定
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "buyorderHead/buyOrderList";
// $("input[name='poDate']").datetimepicker({
// format: "yyyy-mm-dd",
// minView: "month",
// autoclose: true
// });
let today = new Date();
today.setTime(today.getTime());
let time = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
$("input[name='poDate']").val(time);
let getData = [[${buyorderHead}]];
//alert(getData.pName);
if (getData.endFlag === 1) {
$("input[name='endFlag']").attr("checked", true);
}
if (getData.comfirmFlag === 1) {
$("input[name='comfirmFlag']").attr("checked", true);
}
if (getData.auditingFlag === 1) {
$("input[name='auditingFlag']").attr("checked", true);
}
if (getData.approveFlag === 1) {
$("input[name='approveFlag']").attr("checked", true);
}
$("input[name='endFlag']").val(getData.endFlag);
$("input[name='comfirmFlag']").val(getData.comfirmFlag);
$("input[name='auditingFlag']").val(getData.auditingFlag);
$("input[name='approveFlag']").val(getData.approveFlag);
//引入bom2表格
function addBom2() {
var row = $("#bomTable").bootstrapTable("getSelections");
var count = $('#bomTable2').bootstrapTable('getData').length;
for (let i = 0; i < row.length; i++) {
let bootstrapTable = $("#bootstrapTableBody").bootstrapTable("getRowByUniqueId", row[i].wlCode);
//alert(bootstrapTable);
if (bootstrapTable != null) {
$.modal.alert(bootstrapTable.wlCode + "已存在!");
continue;
}
$("#bomTable2").bootstrapTable('insertRow', {
index: count + i,
row: {
wldm: row[i].wldm,
wlCode: row[i].wlCode,
hsCode: row[i].hsCode,
itemname: row[i].itemname,
itemstandard: row[i].itemstandard,
machineNo: row[i].machineNo,
stockDw: row[i].stockDw,
intakeorchina: row[i].intakeorchina,
weight: row[i].weight
}
});
}
reset();
}
//移除bomtable2的对应行数据
function remove(wlCode) {
$("#bomTable2").bootstrapTable("remove", {
field: 'wlCode',
values: wlCode
});
}
function remove2(wlCode) {
$("#bootstrapTableBody").bootstrapTable("remove", {
field: 'wlCode',
values: wlCode
});
}
//点击引入按钮
function addBom() {
$("#bomModal").modal("show");
}
//确认
function confirm() {
var row = $("#bomTable2").bootstrapTable("getData", true);
var count = $('#bootstrapTableBody').bootstrapTable('getData').length;
for (var i = 0; i < row.length; i++) {
$("#bootstrapTableBody").bootstrapTable('insertRow', {
index: count + i,
row: {
wlCode: row[i].wlCode,
itemname: row[i].itemname,
itemstandard: row[i].itemstandard,
machineNo: row[i].machineNo,
stockDw: row[i].stockDw,
weight: row[i].weight,
qty: 0,
price: 0,
amt: 0,
memoList: ""
}
});
}
$("#bomModal").modal("hide");
reset();
$("#bomTable2").bootstrapTable("removeAll");
}
//点击搜索,刷新表格
$("#bomCodeSearch").click(function () {
$('#bomTable').bootstrapTable('refresh');
});
//重置
$("#reset").on("click", function () {
$("#wlCode").val("");
$("#bomTable").bootstrapTable("refresh");
});
function reset() {
$("#wlCode").val("");
$("#bomTable").bootstrapTable("refresh");
}
//提交
function submit() {
let bootstrapTable = $("#bootstrapTableBody").bootstrapTable("getData", true);
let formData = new FormData($("#form-buyOrderList-edit")[0]);
formData.append("buyOrderList", JSON.stringify(bootstrapTable));
let data1 = {};
formData.forEach((value, key) => data1[key] = value);
//alert(JSON.stringify(data1));
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: {"jsonStr": JSON.stringify(data1)},
success: function (resp) {
if (resp.code === 0) {
alert("修改成功!");
// window.location.href = prefix;
var index = parent.layer.getFrameIndex(window.name);
var parent2 = window.parent;
parent2.$.table.refresh();
parent.layer.close(index);//关闭当前页
} else {
$.modal.msgError("修改失败!");
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//关闭
function closeAdd() {
//alert(132);
window.location.href = prefix;
}
//查询参数
function queryParams(params) {
var search = $.table.queryParams(params);
search.wlCode = $("#cpCode2").val();
return search;
}
//全部itemList
$('#bomTable').bootstrapTable({
url: ctx + "ck/itemCP/list",
method: 'post',
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: true, // 是否显示分页(*)
contentType: "application/x-www-form-urlencoded",
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
var wlCode = $("#wlCode").val();
//alert(wlCode);
var json = $.extend(curParams, {"wlCode": wlCode});
return json;
},
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
pageNumber: 1, // 初始化加载第一页,默认第一页
pageSize: 5, // 每页的记录行数(*)
pageList: [5, 10, 50], // 可供选择的每页的行数(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
// singleSelect : true,
height: 350,
columns: [
{
checkbox: true
},
{
field: 'wldm',
title: '',
visible: false
},
{
field: 'wlCode',
title: '物料代码'
},
{
field: 'hsCode',
title: '',
visible: false
},
{
field: 'itemname',
title: '名称'
},
{
field: 'enName',
title: '',
visible: false
},
{
field: 'itemstandard',
title: '规格型号'
},
{
field: 'machineNo',
title: '机种',
},
{
field: 'stockDw',
title: '单位'
},
{
field: 'intakeorchina',
title: '',
visible: false
},
{
field: 'weight',
title: '单位重量'
},
{
field: 'pCode',
title: '厂商号'
},
{
field: 'pName',
title: '厂商名'
},
{
field: 'pWldm',
title: '厂商料号',
visible: false
}
]
});
//待确认bom
$('#bomTable2').bootstrapTable({
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
// contentType :"application/x-www-form-urlencoded",
// pageNumber : 1, // 初始化加载第一页,默认第一页
// pageSize : 10, // 每页的记录行数(*)
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
// clickToSelect : true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
height: 400,
columns: [
{
field: 'wldm',
title: '',
visible: false
},
{
field: 'wlCode',
title: '物料代码'
},
{
field: 'hsCode',
title: '',
visible: false
},
{
field: 'itemname',
title: '名称'
},
{
field: 'enName',
title: '',
visible: false
},
{
field: 'itemstandard',
title: '规格型号'
},
{
field: 'machineNo',
title: '机种',
},
{
field: 'stockDw',
title: '库存单位'
},
{
field: 'intakeorchina',
title: '',
visible: false
},
{
field: 'weight',
title: '单位重量'
},
{
field: 'pCode',
title: '客户'
},
{
field: 'pName',
title: '客户名称'
},
{
field: 'pWldm',
title: '客户料号'
},
{
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="edit()"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}
]
});
//准备提交的bom
$('#bootstrapTableBody').bootstrapTable({
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
// contentType :"application/x-www-form-urlencoded",
// pageNumber : 1, // 初始化加载第一页,默认第一页
// pageSize : 10, // 每页的记录行数(*)
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
// clickToSelect : true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
height: 400,
uniqueId: 'wlCode',
onEditableSave: function (field, row, oldValue, $el) {
//alert(row.qty);
//alert(JSON.stringify(row));
row.qty *= 1;
row.price *= 1;
if (row.qty > 0 && row.price > 0) {
row.amt = row.qty * row.price;
}
},
columns: [
{
checkbox: false
},
{
field: 'wlCode',
title: '代码',
},
{
field: 'itemname',
title: '名称',
},
{
field: 'itemstandard',
title: '规格型号',
},
{
field: 'stockDw',
title: '单位',
},
{
field: "qty",
title: '数量',
editable: {
type: 'text',
title: '数量',
emptytext: "0",
validate: function (value) {
if (parseInt(value) < 0) {
return '数量不能小于0!';
}
if (isNaN(value)) {
return '数量必须是数字!';
}
}
}
},
{
field: 'crlName',
title: '币别',
editable: {
type: 'select',
title: '币别',
emptytext: "RMB",
source: function () {
let result = [];
$.ajax({
url: ctx + "system/dict/data/coin",
type: "post",
resultType: "json",
data: {"type": "sys_coin_class"},
async: false,
success: function (resp) {
if (resp.code === 0) {
let temp = resp.data;
for (let i in temp) {
result.push({value: temp[i].dictValue, text: temp[i].dictLabel});
}
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
return result;
}
}
},
{
field: 'price',
title: '单价',
editable: {
type: 'text',
title: '单价',
emptytext: "0",
validate: function (value) {
if (parseInt(value) <= 0) {
return '单价必须大于0!';
}
if (isNaN(value)) {
return '数量必须是数字!';
}
}
}
},
{
field: 'amt',
title: '金额'
},
{
field: 'sendDate',
title: '交期',
editable: {
type: 'date',
title: '交期',
emptytext: time,
validate: function (value) {
let now = new Date();
if (value.getTime() < now.getTime()) {
return "交期至少是今天!";
}
}
}
},
{
field: 'memoList',
title: '说明',
editable: {
type: 'text',
title: '说明',
emptytext: ""
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove2(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
});
//获取采购担当
$.ajax({
url: ctx + "system/user/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
$("select[name='poMan']").empty();
var username = resp.data;
for (var i in username) {
$("select[name='poMan']").append("<option value='" + username[i].userName + "'>" + username[i].userName + "</option>");
}
$("select[name='poMan']").val(getData.poMan).trigger("change");
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//获取供应商
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
$("select [name='pCode']").empty();
$("select [name='pName']").empty();
var data = resp.data;
for (var i in data) {
//alert(data[i].pCode);
$("select[name='pCode']").append("<option value='" + data[i].pCode + "'>" + data[i].pCode + "</option>");
$("select[name='pName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
}
$("select[name='pName']").val(getData.pName).trigger("change");
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//改变供应商
$("select[name='pName']").change(function () {
var pName = $(this).val();
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/findOne",
data: {"pName": pName},
type: "post",
resultType: "json",
success: function (resp) {
$("select[name='pCode']").val(resp.data.pCode).trigger("change");
$("input[name='pLinkman']").val(resp.data.pLinkman);
$("input[name='pTel']").val(resp.data.pTel);
$("input[name='pFax']").val(resp.data.pFax);
$("input[name='GetMoneyMemo']").val(resp.data.pComCode);
$("input[name='TaxPercent']").val(resp.data.taxPercent);
},
error: function () {
$.modal.msgError("出错了!");
}
})
});
//获取采购单中的物料信息
var buyorderList = [[${buyorderList}]];
//console.log(buyorderList);
for (var i = 0; i < buyorderList.length; i++) {
//alert(buyorderList[i].wlCode);
let count2 = $('#bootstrapTableBody').bootstrapTable('getData').length;
$("#bootstrapTableBody").bootstrapTable('insertRow', {
index: count2 + i,
row: {
wlCode: buyorderList[i].wlCode,
itemname: buyorderList[i].itemname,
itemstandard: buyorderList[i].itemstandard,
machineNo: buyorderList[i].machineNo,
stockDw: buyorderList[i].stockDw,
weight: buyorderList[i].weight,
qty: buyorderList[i].qty,
price: buyorderList[i].price,
amt: buyorderList[i].amt,
memoList: buyorderList[i].memoList,
sendDate: buyorderList[i].SendDate,
crlName: buyorderList[i].crlName
}
});
}
function changeEndFlag() {
if ($("input[name='endFlag']").val() === "1") {
$("input[name='endFlag']").val(0);
} else {
$("input[name='endFlag']").val(1);
}
}
function changeComfirmFlag() {
if ($("input[name='comfirmFlag']").val() === "1") {
$("input[name='comfirmFlag']").val(0);
} else {
$("input[name='comfirmFlag']").val(1);
}
}
function changeAuditingFlag() {
if ($("input[name='auditingFlag']").val() === "1") {
$("input[name='auditingFlag']").val(0);
} else {
$("input[name='auditingFlag']").val(1);
}
}
function changeApproveFlag() {
if ($("input[name='approveFlag']").val() === "1") {
$("input[name='approveFlag']").val(0);
} else {
$("input[name='approveFlag']").val(1);
}
}
function submitHandler() {
// if ($.validate.form()) {
// $.operate.edit(prefix + "/edit", $('#form-ProviderPrice-add').serialize());
// }
submit();
}
</script>
</body>
</html>

438
ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/procurementCheck.html

@ -1,438 +0,0 @@
<!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('采购对账列表')"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</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 class="select-time">
<label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginWarehousingRecordDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endWarehousingRecordDate]"/>
</li>
<li class="select-time">
<label>交货日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginSendDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endSendDate]"/>
</li>
<li>
<label>物料代码:</label>
<input type="text" name="itemNo"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="itemName"/>
</li>
<li>
<label>供应商名:</label>
<!--<input type="text" name="pName"/>-->
<select name="providerName" class="form-control m-b">
<option value="">所有</option>
</select>
</li>
<li>
<label>购方名称:</label>
<input type="text" name="customerName"/>
</li>
<li>
<label>对账否:</label>
<select name="isChecked" class="form-control m-b">
<option value="">所有</option>
<option value="1">已对账</option>
<option value="0">未对账</option>
</select>
</li>
<li>
<label>币别:</label>
<select name="crlName"
th:with="type=${@dict.getType('sys_coin_class')}" class="form-control m-b">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></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="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-success" onclick="" shiro:hasPermission="buyorderHead:buyOrderList:add" disabled>
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick=""
shiro:hasPermission="buyorderHead:buyOrderList:edit" disabled>
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick=""
shiro:hasPermission="buyorderHead:buyOrderList:remove" disabled>
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="buyorderHead:buyOrderList:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-info single disabled" onclick="accountChecking()"
shiro:hasPermission="buyorderHead:buyOrderList:edit">
<i class="fa fa-info"></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:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('buyorderHead:buyOrderList:edit')}]];
var removeFlag = [[${@permission.hasPermi('buyorderHead:buyOrderList:remove')}]];
var prefix = ctx + "buyorderHead/buyOrderList";
//鼠标移入,显示完整的数据
function paramsMatter(value, row, index) {
var span = document.createElement("span");
span.setAttribute("title", value);
span.innerHTML = value;
return span.outerHTML;
}
//获取供应商代码和名称
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
var data = resp.data;
for (var i in data) {
//alert(data[i].pCode);
$("select[name='providerName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
}
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//重置
function reset() {
$("select[name='providerName']").val("").trigger("change");
$("select[name='crlName']").val("").trigger("change");
$("select[name='isChecked']").val("").trigger("change");
$.form.reset();
}
$(function () {
var options = {
url: prefix + "/procurementCheck",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "对账列表",
columns: [{
checkbox: true
},
{
field: 'warehousingRecordNo',
title: '入库记录单号',
},
{
field: 'purchaseOrderNo',
title: '订购单号'
},
{
field: 'providerNo',
title: '供应商代码'
},
{
field: 'providerName',
title: '供应商名称',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "130px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "150px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'warehousingRecordDate',
title: '入库日期',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "100px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "120px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'itemNo',
title: '物料代码',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'itemName',
title: '物料名称',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'specificationModel',
title: '规格型号',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'unit',
title: '单位',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'warehousingAmt',
title: '入库数量',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'crlName',
title: '币别',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'price',
title: '单价',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'totalPrice',
title: '总价',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'paymentCondition',
title: '付款条件',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'isChecked',
title: '对账',
formatter: function (val) {
if (val === "1") {
return "已对账";
} else {
return "未对账";
}
},
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
{
field: 'sendDate',
title: '交货日期',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
},
formatter: paramsMatter
},
{
field: 'customerName',
title: '客户名称',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "80px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width": "100px",
"white-space": "nowrap"
}
}
}
},
// {
// 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="showInfo(row)"><i class="fa fa-edit"></i>详细列表</a> ');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
//确认对账
function accountChecking() {
$.modal.confirm("是否确认对账?", function () {
let row = $("#bootstrap-table").bootstrapTable("getSelections");
$.ajax({
url: ctx + "stock/record/check",
type: "post",
dataType: "json",
data: {"warehousingrecordNo": row[0].warehousingRecordNo},
success: function (resp) {
if (resp.code === 0) {
$.modal.msgSuccess("对账成功!");
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
});
}
</script>
</body>
</html>
Loading…
Cancel
Save