Browse Source

[fix]采购模块:采购订单页面优化

dev
zhangsiqi 7 months ago
parent
commit
6cd38ee2b2
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  2. 3
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java
  3. 420
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java
  4. 3
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java
  5. 3
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java
  6. 7
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  7. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java
  8. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java
  9. 24
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml
  10. 570
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html

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

@ -153,7 +153,7 @@ public class PurchaseOrderController extends BaseController
for (int i = 0; i< idsStr.length; i++) {
PurchaseOrder purchaseOrder = purchaseOrderService.selectPurchaseOrderById(Long.valueOf(idsStr[i]));
PurchaseMaterial purchaseMaterial = new PurchaseMaterial();
purchaseMaterial.setPurchaseOrderNumber(purchaseOrder.getPurchaseOrderNumber());
purchaseMaterial.setPurchaseOrderNumber(purchaseOrder.getPurchaseOrderCode());
List<PurchaseMaterial> list = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial);
if (list.size()>0) {
for (int j=0;j<list.size();j++) {
@ -178,7 +178,7 @@ public class PurchaseOrderController extends BaseController
BeanUtils.copyProperties(purchaseOrder,purchaseOrderDto);
PurchaseMaterial purchaseMaterial = new PurchaseMaterial();
purchaseMaterial.setPurchaseOrderNumber(purchaseOrder.getPurchaseOrderNumber());
purchaseMaterial.setPurchaseOrderNumber(purchaseOrder.getPurchaseOrderCode());
purchaseMaterial.setSupplierCode(purchaseOrder.getSupplierCode());
purchaseMaterial.setSupplierName(purchaseOrder.getSupplierName());

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

@ -1,6 +1,8 @@
package com.ruoyi.purchase.controller;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlan;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -12,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.service.IPurchasePlanService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

420
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java

@ -19,17 +19,35 @@ public class PurchaseOrder extends BaseEntity
private Long purchaseOrderId;
/** 订购单号 */
@Excel(name = "订购单号")
private String purchaseOrderNumber;
@Excel(name = "采购订单单号")
private String purchaseOrderCode;
@Excel(name="采购员")
private String purchaseBuyer;
@Excel(name="审核状态")
private String auditStatus;
@Excel(name="使用状态")
private String useStatus;
@Excel(name="入库状态")
private String eceiptStatus;
@Excel(name="打款结案状态")
private String paymentStatus;
@Excel(name="供应商数量")
private Integer supplierNum;
@Excel(name="物料合计")
private Integer materialAmount;
@Excel(name="数量合计")
private Integer materialSum;
@Excel(name="不含税总价(RMB)")
private Double noRmbSum;
@Excel(name="含税总价")
private Double rmbSum;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 联系人 */
@Excel(name = "联系人")
private String customerContact;
@ -159,277 +177,326 @@ public class PurchaseOrder extends BaseEntity
/** 备用二 */
private String standbyTwo;
public void setPurchaseOrderId(Long purchaseOrderId)
{
public Long getPurchaseOrderId() {
return purchaseOrderId;
}
public void setPurchaseOrderId(Long purchaseOrderId) {
this.purchaseOrderId = purchaseOrderId;
}
public Long getPurchaseOrderId()
{
return purchaseOrderId;
public String getPurchaseOrderCode() {
return purchaseOrderCode;
}
public void setPurchaseOrderNumber(String purchaseOrderNumber)
{
this.purchaseOrderNumber = purchaseOrderNumber;
public void setPurchaseOrderCode(String purchaseOrderCode) {
this.purchaseOrderCode = purchaseOrderCode;
}
public String getPurchaseOrderNumber()
{
return purchaseOrderNumber;
public String getPurchaseBuyer() {
return purchaseBuyer;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
public void setPurchaseBuyer(String purchaseBuyer) {
this.purchaseBuyer = purchaseBuyer;
}
public String getSupplierCode()
{
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getUseStatus() {
return useStatus;
}
public void setUseStatus(String useStatus) {
this.useStatus = useStatus;
}
public String getEceiptStatus() {
return eceiptStatus;
}
public void setEceiptStatus(String eceiptStatus) {
this.eceiptStatus = eceiptStatus;
}
public String getPaymentStatus() {
return paymentStatus;
}
public void setPaymentStatus(String paymentStatus) {
this.paymentStatus = paymentStatus;
}
public Integer getSupplierNum() {
return supplierNum;
}
public void setSupplierNum(Integer supplierNum) {
this.supplierNum = supplierNum;
}
public Integer getMaterialAmount() {
return materialAmount;
}
public void setMaterialAmount(Integer materialAmount) {
this.materialAmount = materialAmount;
}
public Integer getMaterialSum() {
return materialSum;
}
public void setMaterialSum(Integer materialSum) {
this.materialSum = materialSum;
}
public Double getNoRmbSum() {
return noRmbSum;
}
public void setNoRmbSum(Double noRmbSum) {
this.noRmbSum = noRmbSum;
}
public Double getRmbSum() {
return rmbSum;
}
public void setRmbSum(Double rmbSum) {
this.rmbSum = rmbSum;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName()
{
public String getSupplierName() {
return supplierName;
}
public void setCustomerContact(String customerContact)
{
this.customerContact = customerContact;
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getCustomerContact()
{
public String getCustomerContact() {
return customerContact;
}
public void setContactNumber(String contactNumber)
{
this.contactNumber = contactNumber;
public void setCustomerContact(String customerContact) {
this.customerContact = customerContact;
}
public String getContactNumber()
{
public String getContactNumber() {
return contactNumber;
}
public void setCustomerFax(String customerFax)
{
this.customerFax = customerFax;
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public String getCustomerFax()
{
public String getCustomerFax() {
return customerFax;
}
public void setDeliveryAddress(String deliveryAddress)
{
this.deliveryAddress = deliveryAddress;
public void setCustomerFax(String customerFax) {
this.customerFax = customerFax;
}
public String getDeliveryAddress()
{
public String getDeliveryAddress() {
return deliveryAddress;
}
public void setPaymentTerms(String paymentTerms)
{
this.paymentTerms = paymentTerms;
public void setDeliveryAddress(String deliveryAddress) {
this.deliveryAddress = deliveryAddress;
}
public String getPaymentTerms()
{
public String getPaymentTerms() {
return paymentTerms;
}
public void setDeliveryConditions(String deliveryConditions)
{
this.deliveryConditions = deliveryConditions;
public void setPaymentTerms(String paymentTerms) {
this.paymentTerms = paymentTerms;
}
public String getDeliveryConditions()
{
public String getDeliveryConditions() {
return deliveryConditions;
}
public void setDeliveryMethod(String deliveryMethod)
{
this.deliveryMethod = deliveryMethod;
public void setDeliveryConditions(String deliveryConditions) {
this.deliveryConditions = deliveryConditions;
}
public String getDeliveryMethod()
{
public String getDeliveryMethod() {
return deliveryMethod;
}
public void setPurchaseName(String purchaseName)
{
this.purchaseName = purchaseName;
public void setDeliveryMethod(String deliveryMethod) {
this.deliveryMethod = deliveryMethod;
}
public String getPurchaseName()
{
public String getPurchaseName() {
return purchaseName;
}
public void setBillingDate(String billingDate)
{
this.billingDate = billingDate;
public void setPurchaseName(String purchaseName) {
this.purchaseName = purchaseName;
}
public String getBillingDate()
{
public String getBillingDate() {
return billingDate;
}
public void setTaxRate(String taxRate)
{
this.taxRate = taxRate;
public void setBillingDate(String billingDate) {
this.billingDate = billingDate;
}
public String getTaxRate()
{
public String getTaxRate() {
return taxRate;
}
public void setPurchaseCategory(String purchaseCategory)
{
this.purchaseCategory = purchaseCategory;
public void setTaxRate(String taxRate) {
this.taxRate = taxRate;
}
public String getPurchaseCategory()
{
public String getPurchaseCategory() {
return purchaseCategory;
}
public void setPurchaseCommander(String purchaseCommander)
{
this.purchaseCommander = purchaseCommander;
public void setPurchaseCategory(String purchaseCategory) {
this.purchaseCategory = purchaseCategory;
}
public String getPurchaseCommander()
{
public String getPurchaseCommander() {
return purchaseCommander;
}
public void setCustomerOrderNumber(String customerOrderNumber)
{
this.customerOrderNumber = customerOrderNumber;
public void setPurchaseCommander(String purchaseCommander) {
this.purchaseCommander = purchaseCommander;
}
public String getCustomerOrderNumber()
{
public String getCustomerOrderNumber() {
return customerOrderNumber;
}
public void setRemarkContent(String remarkContent)
{
this.remarkContent = remarkContent;
public void setCustomerOrderNumber(String customerOrderNumber) {
this.customerOrderNumber = customerOrderNumber;
}
public String getRemarkContent()
{
public String getRemarkContent() {
return remarkContent;
}
public void setCloseCaseNo(String closeCaseNo)
{
this.closeCaseNo = closeCaseNo;
public void setRemarkContent(String remarkContent) {
this.remarkContent = remarkContent;
}
public String getCloseCaseNo()
{
public String getCloseCaseNo() {
return closeCaseNo;
}
public void setCloseCaseName(String closeCaseName)
{
this.closeCaseName = closeCaseName;
public void setCloseCaseNo(String closeCaseNo) {
this.closeCaseNo = closeCaseNo;
}
public String getCloseCaseName()
{
public String getCloseCaseName() {
return closeCaseName;
}
public void setCloseCaseTime(String closeCaseTime)
{
this.closeCaseTime = closeCaseTime;
public void setCloseCaseName(String closeCaseName) {
this.closeCaseName = closeCaseName;
}
public String getCloseCaseTime()
{
public String getCloseCaseTime() {
return closeCaseTime;
}
public void setConfirmNo(String confirmNo)
{
this.confirmNo = confirmNo;
public void setCloseCaseTime(String closeCaseTime) {
this.closeCaseTime = closeCaseTime;
}
public String getConfirmNo()
{
public String getConfirmNo() {
return confirmNo;
}
public void setConfirmName(String confirmName)
{
this.confirmName = confirmName;
public void setConfirmNo(String confirmNo) {
this.confirmNo = confirmNo;
}
public String getConfirmName()
{
public String getConfirmName() {
return confirmName;
}
public void setConfirmTime(String confirmTime)
{
this.confirmTime = confirmTime;
public void setConfirmName(String confirmName) {
this.confirmName = confirmName;
}
public String getConfirmTime()
{
public String getConfirmTime() {
return confirmTime;
}
public void setAuditNo(String auditNo)
{
this.auditNo = auditNo;
public void setConfirmTime(String confirmTime) {
this.confirmTime = confirmTime;
}
public String getAuditNo()
{
public String getAuditNo() {
return auditNo;
}
public void setAuditName(String auditName)
{
this.auditName = auditName;
public void setAuditNo(String auditNo) {
this.auditNo = auditNo;
}
public String getAuditName()
{
public String getAuditName() {
return auditName;
}
public void setAuditTime(String auditTime)
{
this.auditTime = auditTime;
public void setAuditName(String auditName) {
this.auditName = auditName;
}
public String getAuditTime()
{
public String getAuditTime() {
return auditTime;
}
public void setApproveNo(String approveNo)
{
this.approveNo = approveNo;
public void setAuditTime(String auditTime) {
this.auditTime = auditTime;
}
public String getApproveNo()
{
public String getApproveNo() {
return approveNo;
}
public void setApproveName(String approveName)
{
this.approveName = approveName;
public void setApproveNo(String approveNo) {
this.approveNo = approveNo;
}
public String getApproveName()
{
public String getApproveName() {
return approveName;
}
public void setApproveTime(String approveTime)
{
this.approveTime = approveTime;
public void setApproveName(String approveName) {
this.approveName = approveName;
}
public String getApproveTime()
{
public String getApproveTime() {
return approveTime;
}
public void setApproveTime(String approveTime) {
this.approveTime = approveTime;
}
public String getAccountReconciliationFlag() {
return accountReconciliationFlag;
}
@ -454,48 +521,43 @@ public class PurchaseOrder extends BaseEntity
this.accountReconciliationTime = accountReconciliationTime;
}
public void setFirstAddTime(String firstAddTime)
{
this.firstAddTime = firstAddTime;
}
public String getFirstAddTime()
{
public String getFirstAddTime() {
return firstAddTime;
}
public void setUpdateInfoTime(String updateInfoTime)
{
this.updateInfoTime = updateInfoTime;
public void setFirstAddTime(String firstAddTime) {
this.firstAddTime = firstAddTime;
}
public String getUpdateInfoTime()
{
public String getUpdateInfoTime() {
return updateInfoTime;
}
public void setStandbyOne(String standbyOne)
{
this.standbyOne = standbyOne;
public void setUpdateInfoTime(String updateInfoTime) {
this.updateInfoTime = updateInfoTime;
}
public String getStandbyOne()
{
public String getStandbyOne() {
return standbyOne;
}
public void setStandbyTwo(String standbyTwo)
{
this.standbyTwo = standbyTwo;
public void setStandbyOne(String standbyOne) {
this.standbyOne = standbyOne;
}
public String getStandbyTwo()
{
public String getStandbyTwo() {
return standbyTwo;
}
public void setStandbyTwo(String standbyTwo) {
this.standbyTwo = standbyTwo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("purchaseOrderId", getPurchaseOrderId())
.append("purchaseOrderNumber", getPurchaseOrderNumber())
.append("purchaseOrderCode", getPurchaseOrderCode())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("customerContact", getCustomerContact())

3
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java

@ -1,8 +1,9 @@
package com.ruoyi.purchase.mapper;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlan;
import java.util.List;
/**
* 采购计划单Mapper接口
*

3
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java

@ -1,8 +1,9 @@
package com.ruoyi.purchase.service;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlan;
import java.util.List;
/**
* 采购计划单Service接口
*

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

@ -1,5 +1,6 @@
package com.ruoyi.purchase.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.purchase.mapper.PurchaseOrderMapper;
@ -22,6 +23,9 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Autowired
private PurchaseOrderMapper purchaseOrderMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询采购订单
*
@ -96,7 +100,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Override
public String getId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "PO" + time.substring(2);
return redisCache.generateBillNo("CG");
}
}

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

@ -3,10 +3,10 @@ package com.ruoyi.purchase.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.purchase.domain.PurchasePlan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchasePlanMapper;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.service.IPurchasePlanService;
import com.ruoyi.common.core.text.Convert;

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java

@ -70,6 +70,8 @@ public interface ISysCustomerService
public List selectSysCustomerBycode();
public SysCustomerVo selectSysCustomerByCustomer(SysCustomerVo SysCustomerVo);
public SysCustomer selectSysCustomerByEnterpriseCode(String enterpriseCode);
public int add(SysCustomer sysCustomer);

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

@ -6,7 +6,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="PurchaseOrder" id="PurchaseOrderResult">
<result property="purchaseOrderId" column="purchase_order_id" />
<result property="purchaseOrderNumber" column="purchase_order_number" />
<result property="purchaseOrderCode" column="purchase_order_code" />
<result property="purchaseBuyer" column="purchase_buyer" />
<result property="useStatus" column="use_status" />
<result property="auditStatus" column="audit_status" />
<result property="eceiptStatus" column="eceipt_status" />
<result property="payment_status" column="payment_status" />
<result property="supplierNum" column="supplier_num" />
<result property="materialAmount" column="material_amount" />
<result property="materialSum" column="material_sum" />
<result property="noRmbSum" column="noRmbSum" />
<result property="rmbSum" column="rmbSum" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="customerContact" column="customer_contact" />
@ -42,13 +52,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPurchaseOrderVo">
select purchase_order_id, purchase_order_number, supplier_code, supplier_name, customer_contact, contact_number, customer_fax, delivery_address, payment_terms, delivery_conditions, delivery_method, purchase_name, billing_date, tax_rate, purchase_category, purchase_commander, customer_order_number, remark_content, close_case_no, close_case_name, close_case_time, confirm_no, confirm_name, confirm_time, audit_no, audit_name, audit_time, approve_no, approve_name, approve_time, first_add_time, update_info_time, standby_one, standby_two from purchase_order
select purchase_order_id, purchase_order_code, supplier_code, supplier_name, customer_contact, contact_number, customer_fax, delivery_address, payment_terms, delivery_conditions, delivery_method, purchase_name, billing_date, tax_rate, purchase_category, purchase_commander, customer_order_number, remark_content, close_case_no, close_case_name, close_case_time, confirm_no, confirm_name, confirm_time, audit_no, audit_name, audit_time, approve_no, approve_name, approve_time, first_add_time, update_info_time, standby_one, standby_two from purchase_order
</sql>
<select id="selectPurchaseOrderList" parameterType="PurchaseOrder" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
<where>
<if test="purchaseOrderNumber != null and purchaseOrderNumber != ''"> and purchase_order_number like concat('%', #{purchaseOrderNumber}, '%')</if>
<if test="purchaseOrderCode != null and purchaseOrderCode != ''"> and purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="params.beginBillingDate != null and params.beginBillingDate != '' and params.endBillingDate != null and params.endBillingDate != ''"> and billing_date between #{params.beginBillingDate} and #{params.endBillingDate}</if>
@ -67,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertPurchaseOrder" parameterType="PurchaseOrder" useGeneratedKeys="true" keyProperty="purchaseOrderId">
insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderNumber != null">purchase_order_number,</if>
<if test="purchaseOrderCode != null">purchase_order_code,</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
<if test="customerContact != null">customer_contact,</if>
@ -101,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="standbyTwo != null">standby_two,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderNumber != null">#{purchaseOrderNumber},</if>
<if test="purchaseOrderCode != null">#{purchaseOrderCode},</if>
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
<if test="customerContact != null">#{customerContact},</if>
@ -139,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updatePurchaseOrder" parameterType="PurchaseOrder">
update purchase_order
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderNumber != null">purchase_order_number = #{purchaseOrderNumber},</if>
<if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
@ -191,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- </select>-->
<select id="selectOrderByIdDesc" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
WHERE purchase_order_number like '%PO%'
WHERE purchase_order_code like '%PO%'
ORDER BY purchase_order_id DESC
</select>
</mapper>

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

@ -13,53 +13,57 @@
<div class="select-list">
<ul>
<li>
<label>订购单号:</label>
<input type="text" name="purchaseOrderNumber"/>
<label>采购单号:</label>
<input type="text" name="purchaseOrderCode"/>
</li>
<li>
<label>采购员:</label>
<input type="text" name="supplierNumber"/>
</li>
<li>
<label>供应商代码:</label>
<select name="supplierCode">
<option value="">所有</option>
</select>
<input name="supplierCode" class="form-control" type="text"/>
</li>
<li>
<label>供应商名称:</label>
<input type="text" name="supplierName"/>
</li>
<li class="select-time">
<label>开单日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBillingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBillingDate]"/>
</li>
<li>
<label>结案否</label>
<select name="closeCaseNo" th:with="type=${@dict.getType('sys_whether')}">
<label>审核状态:</label>
<select name="auditStatus" th:with="type=${@dict.getType('auditStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>确认否</label>
<select name="confirmNo" th:with="type=${@dict.getType('sys_whether')}">
<label>使用状态</label>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>审核否</label>
<select name="auditNo" th:with="type=${@dict.getType('sys_whether')}">
<label>收货状态</label>
<select name="eceiptStatus" th:with="type=${@dict.getType('sys_eceipt_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>核准否</label>
<select name="approveNo" th:with="type=${@dict.getType('sys_whether')}">
<label>打款结案状态</label>
<select name="paymentStatus" th:with="type=${@dict.getType('sys_pay_close')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBillingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBillingDate]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -70,14 +74,8 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="purchase:purchaseOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="purchase:purchaseOrder:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="purchase:purchaseOrder:remove">
<i class="fa fa-remove"></i> 删除
<a class="btn btn-success" onclick="importPurchaseOrder()" shiro:hasPermission="purchase:purchaseOrder:add">
<i class="fa fa-plus"></i> 导入
</a>
<a class="btn btn-warning" onclick="exportPurchaseOrder()" shiro:hasPermission="purchase:purchaseOrder:export">
<i class="fa fa-download"></i> 导出
@ -86,15 +84,6 @@
<i class="fa fa-hand-grab-o"></i> 结案
</a>
<a class="btn btn-primary" onclick="reviewConfirm()" shiro:hasPermission="purchase:purchaseOrder:confirm">
<i class="fa fa-hand-grab-o"></i> 确认
</a>
<a class="btn btn-primary" onclick="reviewAudit()" shiro:hasPermission="purchase:purchaseOrder:audit">
<i class="fa fa-hand-grab-o"></i> 审核
</a>
<a class="btn btn-primary" onclick="reviewApprove()" shiro:hasPermission="purchase:purchaseOrder:approve">
<i class="fa fa-hand-grab-o"></i> 核准
</a>
</div>
<div class="col-sm-12 select-table table-striped" style="white-space: nowrap">
<table id="bootstrap-table"></table>
@ -156,169 +145,6 @@
</div>
</div>
</div>
<!--订单确认-->
<div class="modal fade" id="confirmModel">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">确认信息</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-confirm-edit">
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">订单id:</label>
<div class="col-sm-8">
<input id="purchaseOrderId2" name="purchaseOrderId" class="form-control" type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">确认否:</label>
<div class="col-sm-8">
<select id="confirmNo" name="confirmNo" class="form-control" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">确认日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input id="confirmTime" name="confirmTime" class="form-control" placeholder="yyyy-mm-dd hh:ii:ss" 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 id="confirmName" name="confirmName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="confirmSubmit()" class="btn btn-success" data-dismiss="modal">确定</button>
</div>
</div>
</div>
</div>
<!--订单审核-->
<div class="modal fade" id="auditModal">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">审核信息</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-audit-edit">
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">订单id:</label>
<div class="col-sm-8">
<input id="purchaseOrderId3" name="purchaseOrderId" class="form-control" type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">审核否:</label>
<div class="col-sm-8">
<select id="auditNo" name="auditNo" class="form-control"
th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">审核时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input id="auditTime" name="auditTime" class="form-control"
placeholder="yyyy-mm-dd hh:ii:ss" 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 id="auditName" name="auditName" class="form-control" type="text" th:value="${@permission.getPrincipalProperty('userName')}">-->
<input id="auditName" name="auditName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="auditSubmit()" class="btn btn-success" data-dismiss="modal">确定</button>
</div>
</div>
</div>
</div>
<!--订单核准-->
<div class="modal fade" id="approveModal">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">审核信息</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-approve-edit">
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">订单id:</label>
<div class="col-sm-8">
<input id="purchaseOrderId4" name="purchaseOrderId" class="form-control" type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">核准否:</label>
<div class="col-sm-8">
<select id="approveNo" name="approveNo" class="form-control"
th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">核准时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input id="approveTime" name="approveTime" class="form-control"
placeholder="yyyy-mm-dd hh:ii:ss" 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 id="auditName" name="auditName" class="form-control" type="text" th:value="${@permission.getPrincipalProperty('userName')}">-->
<input id="approveName" name="approveName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="approveSubmit()" class="btn btn-success" data-dismiss="modal">确定</button>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
@ -328,9 +154,12 @@
var confirmNoDatas = [[${@dict.getType('sys_whether')}]];
var auditNoDatas = [[${@dict.getType('sys_whether')}]];
var approveNoDatas = [[${@dict.getType('sys_whether')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var eceiptStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var paymentStatusDatas = [[${@dict.getType('sys_pay_status')}]];
var purchaseCategoryDatas = [[${@dict.getType('purchase_category')}]];
var prefix = ctx + "purchase/purchaseOrder";
$(function() {
var options = {
url: prefix + "/list",
@ -340,181 +169,30 @@
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "采购订单",
columns: [{
checkbox: true
},
{
field: 'purchaseOrderId',
title: '采购订单id',
visible: false
},
{
field: 'closeCaseNo',
title: '结案否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(closeCaseNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(closeCaseNoDatas, value) == "<span class=''></span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已结案</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未结案</a> ');
}
return actions.join('');
}
},
{
field: 'confirmNo',
title: '确认否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(confirmNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(confirmNoDatas, value) == "<span class=''></span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已确认</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未确认</a> ');
}
return actions.join('');
}
},
{
field: 'auditNo',
title: '审核否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(auditNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(auditNoDatas, value) == "<span class=''></span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已审核</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未审核</a> ');
}
return actions.join('');
}
},
{
field: 'approveNo',
title: '核准否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(approveNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(approveNoDatas, value) == "<span class=''></span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已核准</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未核准</a> ');
}
return actions.join('');
}
},
{
field: 'purchaseOrderNumber',
title: '订购单号'
},
{
field: 'supplierCode',
title: '供应商代码'
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'customerContact',
title: '联系人'
},
{
field: 'contactNumber',
title: '联系电话'
},
{
field: 'customerFax',
title: '传真号码'
},
{
field: 'deliveryAddress',
title: '交货地点'
},
{
field: 'paymentTerms',
title: '付款条件'
},
{
field: 'deliveryConditions',
title: '交货条件'
},
{
field: 'deliveryMethod',
title: '交货方式'
},
{
field: 'purchaseName',
title: '购方名称'
},
{
field: 'billingDate',
title: '开单日期'
},
{
field: 'taxRate',
title: '税率'
},
{
field: 'purchaseCategory',
title: '订购种类',
formatter: function (value, row, index) {
return $.table.selectDictLabel(purchaseCategoryDatas, value);
}
},
{
field: 'purchaseCommander',
title: '采购担当'
},
{
field: 'customerOrderNumber',
title: '客户订单号'
},
{
field: 'remarkContent',
title: '备注内容'
},
{
field: 'closeCaseName',
title: '结案人',
visible: false
},
{
field: 'closeCaseTime',
title: '结案时间',
visible: false
},
{
field: 'confirmName',
title: '确认人',
visible: false
},
{
field: 'confirmTime',
title: '确认时间',
visible: false
},
{
field: 'auditName',
title: '审核人',
visible: false
},
{
field: 'auditTime',
title: '审核时间',
visible: false
},
{
field: 'approveName',
title: '核准人',
visible: false
},
{
field: 'approveTime',
title: '核准时间',
visible: false
},
columns: [{checkbox: true},
{title: '采购订单id',field: 'purchaseOrderId', visible: false},
{title:'审核状态',field: 'auditStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(auditStatusDatas, value);
}},
{title:'使用状态',field: 'useStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(useStatusDatas, value);
}},
{title:'收货状态',field: 'eceiptStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(eceiptStatusDatas, value);}
},
{title:'打款结案状态',field: 'paymentStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(paymentStatusDatas, value);
}},
{title:'采购单号',field: 'purchaseOrderCode'},
{ title: '供应商ID',field: 'supplierCode'},
{title: '供应商名称',field: 'supplierName'},
{title: '联系人',field: 'customerContact',visible: false},
{title: '联系电话',field: 'contactNumber',visible: false},
{title:'供应商数量',field: 'supplierNum'},
{title:'物料合计',field: 'materialAmount'},
{title:'数量合计',field: 'materialSum'},
{title:'不含税总价(RMB)',field: 'noRmbSum'},
{title:'含税总价',field: 'rmbSum'},
{
field: 'firstAddTime',
title: '录入时间',
@ -528,7 +206,7 @@
},
{
field: 'updateInfoTime',
title: '上次修改时间',
title: '上次更新时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
@ -537,8 +215,8 @@
return vArr[0];
}
}
}]
/*{
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
@ -547,7 +225,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.purchaseOrderId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}*/
}]
};
$.table.init(options);
});
@ -614,33 +292,6 @@
}
}
//删除
function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
console.log(rows)
console.log(rows.join())
if (rows.length > 0) {
$.modal.confirm("是否删除选中的"+ rows.length +"条采购订单?", function () {
$.ajax({
url: prefix + '/removeSelected',
type: 'post',
data: {
ids : rows.join()
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else {
$.modal.msgWarning("请选择一条数据")
}
}
// 订单结案
function reviewCloseCase(){
@ -676,113 +327,6 @@
}
});
}
// 订单确认
function reviewConfirm(){
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length ===1) {
$("#purchaseOrderId2").val(data[0].purchaseOrderId)
$("#confirmNo").val(data[0].confirmNo).trigger("change")
$("#confirmName").val(userName)
$("#confirmTime").datetimepicker("setDate", new Date());
$("#confirmModel").modal("show");
}else {
$.modal.alert("请选择一条数据");
}
}
// 订单确认
function confirmSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-confirm-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#confirmModel").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//审核
function reviewAudit() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
// console.log(data.length)
if (data.length === 1) {
$("#purchaseOrderId3").val(data[0].purchaseOrderId)
$("#auditNo").val(data[0].auditNo).trigger("change")
$("#auditName").val(userName)
$("#auditTime").datetimepicker("setDate", new Date());
$("#auditModal").modal("show");
} else {
// alert("请选择一条数据")
$.modal.alert("请选择一条数据");
}
}
// 审核修改
function auditSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-audit-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#auditModal").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//核准
function reviewApprove() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
// console.log(data.length)
if (data.length === 1) {
$("#purchaseOrderId4").val(data[0].purchaseOrderId)
$("#approveNo").val(data[0].approveNo).trigger("change")
$("#approveName").val(userName)
$("#approveTime").datetimepicker("setDate", new Date());
$("#approveModal").modal("show");
} else {
// alert("请选择一条数据")
$.modal.alert("请选择一条数据");
}
}
// 核准
function approveSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-approve-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#approveModal").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save