'123'
This commit is contained in:
parent
dbac2c0cf7
commit
2b370ca07e
|
@ -1,11 +1,17 @@
|
||||||
package com.ruoyi.web.controller.redBook;
|
package com.ruoyi.web.controller.redBook;
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.DataSource;
|
import com.ruoyi.common.annotation.DataSource;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.enums.DataSourceType;
|
import com.ruoyi.common.enums.DataSourceType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.uuid.UUID;
|
||||||
import com.ruoyi.redBook.domain.Product;
|
import com.ruoyi.redBook.domain.Product;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuot;
|
||||||
import com.ruoyi.redBook.service.IRedBookService;
|
import com.ruoyi.redBook.service.IRedBookService;
|
||||||
|
import com.ruoyi.web.utils.IdUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -20,7 +26,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/redBook/redBook")
|
@RequestMapping("/redBook/redBook")
|
||||||
@DataSource(DataSourceType.OAREDBOOK)
|
|
||||||
public class RedBookController extends BaseController
|
public class RedBookController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -31,6 +36,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productList")
|
@GetMapping("/productList")
|
||||||
public List<Product> productList(Product product)
|
public List<Product> productList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -43,6 +49,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productRemarkList")
|
@GetMapping("/productRemarkList")
|
||||||
public List<Product> productRemarkList(Product product)
|
public List<Product> productRemarkList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -55,6 +62,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productXinghList")
|
@GetMapping("/productXinghList")
|
||||||
public List<Product> productXinghList(Product product)
|
public List<Product> productXinghList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -67,6 +75,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/judgeparent")
|
@GetMapping("/judgeparent")
|
||||||
public Boolean judgeparent(Product product)
|
public Boolean judgeparent(Product product)
|
||||||
{
|
{
|
||||||
|
@ -83,6 +92,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productZlList")
|
@GetMapping("/productZlList")
|
||||||
public List<Product> productZlList(Product product)
|
public List<Product> productZlList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -95,6 +105,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productYsxhListCheck")
|
@GetMapping("/productYsxhListCheck")
|
||||||
public Boolean productYsxhListCheck(Product product)
|
public Boolean productYsxhListCheck(Product product)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +122,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productYsxhList")
|
@GetMapping("/productYsxhList")
|
||||||
public List<Product> productYsxhList(Product product)
|
public List<Product> productYsxhList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -123,6 +135,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productJmListCheck")
|
@GetMapping("/productJmListCheck")
|
||||||
public Boolean productJmListCheck(Product product)
|
public Boolean productJmListCheck(Product product)
|
||||||
{
|
{
|
||||||
|
@ -138,6 +151,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/productJmList")
|
@GetMapping("/productJmList")
|
||||||
public List<Product> productJmList(Product product)
|
public List<Product> productJmList(Product product)
|
||||||
{
|
{
|
||||||
|
@ -150,6 +164,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/searchData")
|
@GetMapping("/searchData")
|
||||||
public List<Product> searchData(Product product)
|
public List<Product> searchData(Product product)
|
||||||
{
|
{
|
||||||
|
@ -161,6 +176,7 @@ public class RedBookController extends BaseController
|
||||||
* @param product
|
* @param product
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@DataSource(DataSourceType.OAREDBOOK)
|
||||||
@GetMapping("/handleSearchData")
|
@GetMapping("/handleSearchData")
|
||||||
public List<Product> handleSearchData(Product product)
|
public List<Product> handleSearchData(Product product)
|
||||||
{
|
{
|
||||||
|
@ -175,4 +191,16 @@ public class RedBookController extends BaseController
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DataSource(DataSourceType.MASTER)
|
||||||
|
@Log(title = "报价单生成", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/madeQuot")
|
||||||
|
public AjaxResult madeQuot(@RequestBody OAQuot quot)
|
||||||
|
{
|
||||||
|
quot.setQuot_id(UUID.fastUUID().toString());
|
||||||
|
quot.setQuotCode(IdUtils.createNo("BJD_",2));
|
||||||
|
quot.setCreateBy(getUsername());
|
||||||
|
redBookService.insertOAQuot(quot);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.ruoyi.redBook.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class OAQuot extends BaseEntity {
|
||||||
|
private String quot_id;
|
||||||
|
private String quotCode;//报价单号
|
||||||
|
private String quotCustomer;//报价客户
|
||||||
|
private String quotProject;//报价项目
|
||||||
|
private String quotLxr;//联系人
|
||||||
|
private String quotLxrdh;//联系人电话
|
||||||
|
|
||||||
|
private List<OAQuotProduct> selectedResultData;
|
||||||
|
|
||||||
|
public String getQuot_id() { return quot_id; }
|
||||||
|
|
||||||
|
public void setQuot_id(String quot_id) { this.quot_id = quot_id; }
|
||||||
|
|
||||||
|
public String getQuotCode() { return quotCode; }
|
||||||
|
|
||||||
|
public void setQuotCode(String quotCode) { this.quotCode = quotCode; }
|
||||||
|
|
||||||
|
public String getQuotCustomer() {
|
||||||
|
return quotCustomer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuotCustomer(String quotCustomer) {
|
||||||
|
this.quotCustomer = quotCustomer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuotProject() {
|
||||||
|
return quotProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuotProject(String quotProject) {
|
||||||
|
this.quotProject = quotProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuotLxr() {
|
||||||
|
return quotLxr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuotLxr(String quotLxr) {
|
||||||
|
this.quotLxr = quotLxr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuotLxrdh() {
|
||||||
|
return quotLxrdh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuotLxrdh(String quotLxrdh) {
|
||||||
|
this.quotLxrdh = quotLxrdh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OAQuotProduct> getSelectedResultData() {
|
||||||
|
return selectedResultData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedResultData(List<OAQuotProduct> selectedResultData) {
|
||||||
|
this.selectedResultData = selectedResultData;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.ruoyi.redBook.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class OAQuotProduct {
|
||||||
|
private String name_0;//型号
|
||||||
|
private String spec;//规格
|
||||||
|
private String voltage;//电压
|
||||||
|
private String stu;//单位
|
||||||
|
private BigDecimal setPrice;//单价
|
||||||
|
private BigDecimal count;//数量
|
||||||
|
private BigDecimal allPrice;//金额
|
||||||
|
private String quot_product_id;//id
|
||||||
|
private String quot_id;//报价单id
|
||||||
|
|
||||||
|
public String getName_0() {
|
||||||
|
return name_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName_0(String name_0) {
|
||||||
|
this.name_0 = name_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpec() {
|
||||||
|
return spec;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpec(String spec) {
|
||||||
|
this.spec = spec;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVoltage() {
|
||||||
|
return voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoltage(String voltage) {
|
||||||
|
this.voltage = voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStu() {
|
||||||
|
return stu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStu(String stu) {
|
||||||
|
this.stu = stu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSetPrice() {
|
||||||
|
return setPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSetPrice(BigDecimal setPrice) {
|
||||||
|
this.setPrice = setPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(BigDecimal count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAllPrice() {
|
||||||
|
return allPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllPrice(BigDecimal allPrice) {
|
||||||
|
this.allPrice = allPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuot_product_id() {
|
||||||
|
return quot_product_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuot_product_id(String quot_product_id) {
|
||||||
|
this.quot_product_id = quot_product_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuot_id() {
|
||||||
|
return quot_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuot_id(String quot_id) {
|
||||||
|
this.quot_id = quot_id;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,8 @@ package com.ruoyi.redBook.mapper;
|
||||||
import com.ruoyi.material.domain.CMaterial;
|
import com.ruoyi.material.domain.CMaterial;
|
||||||
import com.ruoyi.material.domain.CMaterialCost;
|
import com.ruoyi.material.domain.CMaterialCost;
|
||||||
import com.ruoyi.material.domain.temp;
|
import com.ruoyi.material.domain.temp;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuot;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuotProduct;
|
||||||
import com.ruoyi.redBook.domain.Product;
|
import com.ruoyi.redBook.domain.Product;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -72,4 +74,16 @@ public interface OARedBookMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Product> handleSearchData(@Param("name_0")String name_0,@Param("model")String model);
|
List<Product> handleSearchData(@Param("name_0")String name_0,@Param("model")String model);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
void insertOAQuot(OAQuot quot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增报价单产品信息
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
void batchOAQuotProduct(List<OAQuotProduct> list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.ruoyi.redBook.service;
|
package com.ruoyi.redBook.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.DataSource;
|
||||||
|
import com.ruoyi.common.enums.DataSourceType;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuot;
|
||||||
import com.ruoyi.redBook.domain.Product;
|
import com.ruoyi.redBook.domain.Product;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -68,4 +71,10 @@ public interface IRedBookService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Product> handleSearchData(String name_0,String model);
|
List<Product> handleSearchData(String name_0,String model);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
void insertOAQuot(OAQuot quot);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
package com.ruoyi.redBook.service.impl;
|
package com.ruoyi.redBook.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.uuid.UUID;
|
||||||
|
import com.ruoyi.customer.domain.Bank;
|
||||||
|
import com.ruoyi.customer.domain.Customer;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuot;
|
||||||
|
import com.ruoyi.redBook.domain.OAQuotProduct;
|
||||||
import com.ruoyi.redBook.domain.Product;
|
import com.ruoyi.redBook.domain.Product;
|
||||||
import com.ruoyi.redBook.mapper.OARedBookMapper;
|
import com.ruoyi.redBook.mapper.OARedBookMapper;
|
||||||
import com.ruoyi.redBook.service.IRedBookService;
|
import com.ruoyi.redBook.service.IRedBookService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,4 +109,41 @@ public class RedBookServiceImpl implements IRedBookService
|
||||||
public List<Product> handleSearchData(String name_0,String model) {
|
public List<Product> handleSearchData(String name_0,String model) {
|
||||||
return oaRedBookMapper.handleSearchData(name_0,model);
|
return oaRedBookMapper.handleSearchData(name_0,model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public void insertOAQuot(OAQuot quot) {
|
||||||
|
quot.setCreateTime(DateUtils.getNowDate());
|
||||||
|
quot.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
oaRedBookMapper.insertOAQuot(quot);
|
||||||
|
insertOAQuotProduct(quot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增报价单产品信息
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
public void insertOAQuotProduct(OAQuot quot)
|
||||||
|
{
|
||||||
|
List<OAQuotProduct> productList = quot.getSelectedResultData();
|
||||||
|
String quot_id = quot.getQuot_id();
|
||||||
|
if (StringUtils.isNotNull(productList))
|
||||||
|
{
|
||||||
|
List<OAQuotProduct> list = new ArrayList<OAQuotProduct>();
|
||||||
|
for (OAQuotProduct product : productList)
|
||||||
|
{
|
||||||
|
product.setQuot_product_id(UUID.fastUUID().toString());
|
||||||
|
product.setQuot_id(quot_id);
|
||||||
|
list.add(product);
|
||||||
|
}
|
||||||
|
if (list.size() > 0)
|
||||||
|
{
|
||||||
|
oaRedBookMapper.batchOAQuotProduct(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,9 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
insert into customer
|
insert into customer
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="cusId != null">cus_id,</if>
|
<if test="cusId != null">cus_id,</if>
|
||||||
<if test="cusCode != null">cus_code,</if>
|
<if test="cusCode != null and cusCode != ''">cus_code,</if>
|
||||||
<if test="cusName != null and cusName != ''">cus_name,</if>
|
<if test="cusName != null and cusName != ''">cus_name,</if>
|
||||||
<if test="cusSapCode != null">cus_sap_code,</if>
|
<if test="cusSapCode != null and cusSapCode != ''">cus_sap_code,</if>
|
||||||
<if test="cusStreet != null and cusStreet != ''">cus_street,</if>
|
<if test="cusStreet != null and cusStreet != ''">cus_street,</if>
|
||||||
<if test="cusQccStreet != null and cusQccStreet != ''">cus_qcc_street,</if>
|
<if test="cusQccStreet != null and cusQccStreet != ''">cus_qcc_street,</if>
|
||||||
<if test="cusPaymentTerms != null and cusPaymentTerms != ''">cus_payment_terms,</if>
|
<if test="cusPaymentTerms != null and cusPaymentTerms != ''">cus_payment_terms,</if>
|
||||||
|
@ -137,9 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="cusId != null">#{cusId},</if>
|
<if test="cusId != null">#{cusId},</if>
|
||||||
<if test="cusCode != null">#{cusCode},</if>
|
<if test="cusCode != null and cusCode != ''">#{cusCode},</if>
|
||||||
<if test="cusName != null and cusName != ''">#{cusName},</if>
|
<if test="cusName != null and cusName != ''">#{cusName},</if>
|
||||||
<if test="cusSapCode != null">#{cusSapCode},</if>
|
<if test="cusSapCode != null and cusSapCode != ''">#{cusSapCode},</if>
|
||||||
<if test="cusStreet != null and cusStreet != ''">#{cusStreet},</if>
|
<if test="cusStreet != null and cusStreet != ''">#{cusStreet},</if>
|
||||||
<if test="cusQccStreet != null and cusQccStreet != ''">#{cusQccStreet},</if>
|
<if test="cusQccStreet != null and cusQccStreet != ''">#{cusQccStreet},</if>
|
||||||
<if test="cusPaymentTerms != null and cusPaymentTerms != ''">#{cusPaymentTerms},</if>
|
<if test="cusPaymentTerms != null and cusPaymentTerms != ''">#{cusPaymentTerms},</if>
|
||||||
|
|
|
@ -78,4 +78,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and A.规格 = #{model}
|
and A.规格 = #{model}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertOAQuot" parameterType="OAQuot">
|
||||||
|
insert into OAQuot
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="quot_id != null">quot_id,</if>
|
||||||
|
<if test="quotCode != null and quotCode != ''">quotCode,</if>
|
||||||
|
<if test="quotCustomer != null and quotCustomer != ''">quotCustomer,</if>
|
||||||
|
<if test="quotProject != null and quotProject != ''">quotProject,</if>
|
||||||
|
<if test="quotLxr != null and quotLxr != ''">quotLxr,</if>
|
||||||
|
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
create_time
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="quot_id != null">#{quot_id},</if>
|
||||||
|
<if test="quotCode != null and quotCode != ''">#{quotCode},</if>
|
||||||
|
<if test="quotCustomer != null and quotCustomer != ''">#{quotCustomer},</if>
|
||||||
|
<if test="quotProject != null and quotProject != ''">#{quotProject},</if>
|
||||||
|
<if test="quotLxr != null and quotLxr != ''">#{quotLxr},</if>
|
||||||
|
<if test="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
getdate()
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchOAQuotProduct">
|
||||||
|
insert into OAQuotProduct(quot_product_id, name_0, spec, voltage,stu,setPrice,count,allPrice,quot_id) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
( #{item.quot_product_id}, #{item.name_0}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -100,5 +100,14 @@ export function handleSearchData(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//生成报价单
|
||||||
|
export function madeQuot(data) {
|
||||||
|
return request({
|
||||||
|
url: '/redBook/redBook/madeQuot',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form label-width="100px" :model="form">
|
<el-form label-width="80px" :model="form">
|
||||||
<el-row :gutter="5">
|
<el-row :gutter="5">
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-input style="width:30%" size="mini" v-model="queryParams.name_0" placeholder="型号 模糊查询"></el-input>
|
<el-input style="width:30%" size="mini" v-model="queryParams.name_0" placeholder="型号 模糊查询"></el-input>
|
||||||
<el-input style="width:30%;margin-left: 5px;" size="mini" v-model="queryParams.model" placeholder="规格 模糊查询"></el-input>
|
<el-input style="width:30%;margin-left: 5px;" size="mini" v-model="queryParams.model" placeholder="规格 模糊查询"></el-input>
|
||||||
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
|
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14"></el-col>
|
<el-col :span="14">
|
||||||
|
<el-button style="float: right;margin-left: 5px;" size="mini" type="success" icon="el-icon-document" @click="handleMadeQuotClick">生成报价单</el-button>
|
||||||
|
<el-button style="float: right;" size="mini" type="warning" icon="el-icon-folder" @click="handleSaveClick">保存</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="5"class="mt5">
|
<el-row :gutter="5"class="mt5">
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
|
@ -49,6 +52,7 @@
|
||||||
<el-table width="100%" v-loading="searchResultLoading" ref="searchResultTable" :data="searchResultPagedData" @row-dblclick="handleRowDblclick">
|
<el-table width="100%" v-loading="searchResultLoading" ref="searchResultTable" :data="searchResultPagedData" @row-dblclick="handleRowDblclick">
|
||||||
<el-table-column label="uid" align="center" prop="uid_0" v-if="false"/>
|
<el-table-column label="uid" align="center" prop="uid_0" v-if="false"/>
|
||||||
<el-table-column label="型号" align="center" prop="name_0" width="180"/>
|
<el-table-column label="型号" align="center" prop="name_0" width="180"/>
|
||||||
|
<el-table-column label="规格" align="center" prop="spec" width="180" v-if="false"/>
|
||||||
<el-table-column label="电压" align="center" prop="voltage" width="120"/>
|
<el-table-column label="电压" align="center" prop="voltage" width="120"/>
|
||||||
<el-table-column label="红本价(元)" align="center" prop="price" width="100"/>
|
<el-table-column label="红本价(元)" align="center" prop="price" width="100"/>
|
||||||
<el-table-column label="单位" align="center" prop="stu"/>
|
<el-table-column label="单位" align="center" prop="stu"/>
|
||||||
|
@ -63,7 +67,7 @@
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" rowspan="2">
|
<el-col :span="14">
|
||||||
<el-card id="scroll" class="box-card scrollable" :style="{'overflow': 'auto','max-height': scrollableHeight,'height': scrollableHeight}">
|
<el-card id="scroll" class="box-card scrollable" :style="{'overflow': 'auto','max-height': scrollableHeight,'height': scrollableHeight}">
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -79,7 +83,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="业务联系人" prop="cusCode">
|
<el-form-item label="联系人" prop="cusCode">
|
||||||
<el-input v-model="form.quotLxr" placeholder="请输入业务联系人" />
|
<el-input v-model="form.quotLxr" placeholder="请输入业务联系人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -93,14 +97,17 @@
|
||||||
<span>批量调折扣率:
|
<span>批量调折扣率:
|
||||||
<el-input style="width:10%" v-model="perc" size="small" @blur="changeData"></el-input>
|
<el-input style="width:10%" v-model="perc" size="small" @blur="changeData"></el-input>
|
||||||
<el-input style="width:10%;margin-left: 5px" v-model="perc2" size="small" @blur="changeData"></el-input>
|
<el-input style="width:10%;margin-left: 5px" v-model="perc2" size="small" @blur="changeData"></el-input>
|
||||||
|
总价:<span style="color:red">{{sumSelectedResultData}}</span>
|
||||||
</span>
|
</span>
|
||||||
<el-table width="100%;" :style="{'margin-top':'5px','height': tableHeight}" ref="selectedResultTable" :data="selectedResultPagedData">
|
<el-table width="100%;" :height="tableHeight" :row-class-name="selectedResultIndex" style="margin-top:5px" ref="selectedResultTable" :data="selectedResultData">
|
||||||
|
<el-table-column fixed="left" label="" align="center" prop="index" width="50"/>
|
||||||
<el-table-column fixed="left" label="操作" align="center" width="60" class-name="small-padding fixed-width">
|
<el-table-column fixed="left" label="操作" align="center" width="60" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="handleDeleteClick(scope.$index)">删除</el-button>
|
<el-button type="text" @click="handleDeleteClick(scope.$index)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="型号" align="center" prop="name_0"/>
|
<el-table-column fixed="left" label="型号" align="center" prop="name_0" width="180"/>
|
||||||
|
<el-table-column label="规格" align="center" prop="spec" width="180" v-if="false"/>
|
||||||
<el-table-column label="电压" align="center" prop="voltage" width="100"/>
|
<el-table-column label="电压" align="center" prop="voltage" width="100"/>
|
||||||
<el-table-column label="红本价(元)" align="center" prop="price" width="100"/>
|
<el-table-column label="红本价(元)" align="center" prop="price" width="100"/>
|
||||||
<el-table-column label="单位" align="center" prop="stu" width="60"/>
|
<el-table-column label="单位" align="center" prop="stu" width="60"/>
|
||||||
|
@ -120,17 +127,17 @@
|
||||||
<el-input v-model="scope.row.count" @blur="changeRowData"/>
|
<el-input v-model="scope.row.count" @blur="changeRowData"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="总价" align="center" prop="allPrice" width="80"/>
|
<el-table-column label="总价" align="center" prop="allPrice"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<!--<pagination
|
||||||
v-show="selectedResultTotal>0"
|
v-show="selectedResultTotal>0"
|
||||||
:total="selectedResultTotal"
|
:total="selectedResultTotal"
|
||||||
:page.sync="selectedResultCurrentPage"
|
:page.sync="selectedResultCurrentPage"
|
||||||
:page-sizes="[5,10,15,20]"
|
:page-sizes="[10,20,30,40]"
|
||||||
:limit.sync="selectedResultPageSize"
|
:limit.sync="selectedResultPageSize"
|
||||||
@size-change="handleSelectedResultSizeChange"
|
@size-change="handleSelectedResultSizeChange"
|
||||||
@current-change="handleSelectedResultCurrentChange"
|
@current-change="handleSelectedResultCurrentChange"
|
||||||
/>
|
/>-->
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -161,7 +168,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import {toDecimal, productList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData} from "@/api/redBook/redBook";
|
import {toDecimal, productList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData, madeQuot} from "@/api/redBook/redBook";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "productSelect",
|
name: "productSelect",
|
||||||
|
@ -225,7 +232,7 @@
|
||||||
//已选择的数据
|
//已选择的数据
|
||||||
selectedResultTotal: 0,
|
selectedResultTotal: 0,
|
||||||
selectedResultCurrentPage: 1,
|
selectedResultCurrentPage: 1,
|
||||||
selectedResultPageSize: 5,
|
selectedResultPageSize: 10,
|
||||||
selectedResultData: [],
|
selectedResultData: [],
|
||||||
|
|
||||||
//折扣率 初始值
|
//折扣率 初始值
|
||||||
|
@ -243,7 +250,7 @@
|
||||||
/*设置内容高度*/
|
/*设置内容高度*/
|
||||||
this.scrollableHeight = (window.innerHeight - 160) + 'px';
|
this.scrollableHeight = (window.innerHeight - 160) + 'px';
|
||||||
/*设置已选择结果表格高度*/
|
/*设置已选择结果表格高度*/
|
||||||
this.tableHeight = (window.innerHeight - 400) + 'px';
|
this.tableHeight = (window.innerHeight - 350) + 'px';
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
@ -459,6 +466,7 @@
|
||||||
//双击查询结果事件
|
//双击查询结果事件
|
||||||
handleRowDblclick(row, event, column) {
|
handleRowDblclick(row, event, column) {
|
||||||
const name_0 = row.name_0;
|
const name_0 = row.name_0;
|
||||||
|
const spec = row.spec;
|
||||||
const voltage = row.voltage;
|
const voltage = row.voltage;
|
||||||
const price = row.price;
|
const price = row.price;
|
||||||
const stu = row.stu;
|
const stu = row.stu;
|
||||||
|
@ -470,6 +478,7 @@
|
||||||
|
|
||||||
const rowDate = {
|
const rowDate = {
|
||||||
name_0: name_0,
|
name_0: name_0,
|
||||||
|
spec: spec,
|
||||||
voltage: voltage,
|
voltage: voltage,
|
||||||
price: price,
|
price: price,
|
||||||
stu: stu,
|
stu: stu,
|
||||||
|
@ -481,9 +490,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectedResultData.push(rowDate)
|
this.selectedResultData.push(rowDate)
|
||||||
this.selectedResultTotal = this.selectedResultData.length;
|
|
||||||
|
//自动跳转当前页
|
||||||
|
/*this.selectedResultTotal = this.selectedResultData.length;
|
||||||
const page = Math.ceil(this.selectedResultTotal / this.selectedResultPageSize);
|
const page = Math.ceil(this.selectedResultTotal / this.selectedResultPageSize);
|
||||||
this.handleSelectedResultCurrentChange(page)
|
this.handleSelectedResultCurrentChange(page)*/
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.selectedResultTable.bodyWrapper.scrollTop = this.$refs.selectedResultTable.bodyWrapper.scrollHeight;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 已选结果数据序号 */
|
||||||
|
selectedResultIndex({ row, rowIndex }) {
|
||||||
|
row.index = rowIndex + 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
//删除已选结果数据
|
//删除已选结果数据
|
||||||
|
@ -503,14 +522,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 切换每页显示条数--已选择结果 */
|
/** 切换每页显示条数--已选择结果 */
|
||||||
handleSelectedResultSizeChange(val) {
|
/*handleSelectedResultSizeChange(val) {
|
||||||
this.selectedResultPageSize = val;
|
this.selectedResultPageSize = val;
|
||||||
this.selectedResultCurrentPage = 1;
|
this.selectedResultCurrentPage = 1;
|
||||||
},
|
},*/
|
||||||
/** 页码选择--已选择结果 */
|
/** 页码选择--已选择结果 */
|
||||||
handleSelectedResultCurrentChange(val) {
|
/*handleSelectedResultCurrentChange(val) {
|
||||||
this.selectedResultCurrentPage = val;
|
this.selectedResultCurrentPage = val;
|
||||||
},
|
},*/
|
||||||
|
|
||||||
//手动查询产品
|
//手动查询产品
|
||||||
handleSearchClick() {
|
handleSearchClick() {
|
||||||
|
@ -536,6 +555,21 @@
|
||||||
|
|
||||||
//一次折扣率变化时触发
|
//一次折扣率变化时触发
|
||||||
changeData() {
|
changeData() {
|
||||||
|
// 校验折扣率格式
|
||||||
|
const pattern = /^\d+(\.\d+)?$/;
|
||||||
|
if(this.perc) {
|
||||||
|
if (!pattern.test(this.perc)) {
|
||||||
|
this.$message.warning("折扣率格式错误!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.perc2) {
|
||||||
|
if (!pattern.test(this.perc2)) {
|
||||||
|
this.$message.warning("折扣率格式错误!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 遍历表格数据进行计算
|
// 遍历表格数据进行计算
|
||||||
this.selectedResultData.forEach((row, index) => {
|
this.selectedResultData.forEach((row, index) => {
|
||||||
// 进行其他计算
|
// 进行其他计算
|
||||||
|
@ -543,8 +577,8 @@
|
||||||
...row,
|
...row,
|
||||||
percent: this.perc,
|
percent: this.perc,
|
||||||
percent2: this.perc2,
|
percent2: this.perc2,
|
||||||
setPrice: toDecimal(row.price * this.perc * (this.perc2?this.perc2:1)),
|
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
|
||||||
allPrice: toDecimal(row.count * row.price * this.perc * (this.perc2?this.perc2:1)),
|
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -560,6 +594,19 @@
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 报价单保存
|
||||||
|
handleSaveClick() {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 报价单生成
|
||||||
|
handleMadeQuotClick() {
|
||||||
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
|
madeQuot(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("生成报价单成功");
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
updated(){
|
updated(){
|
||||||
// 监听数据变化时,滚动条保持在底部
|
// 监听数据变化时,滚动条保持在底部
|
||||||
|
@ -574,14 +621,19 @@
|
||||||
const endIndex = startIndex + this.searchResultPageSize;
|
const endIndex = startIndex + this.searchResultPageSize;
|
||||||
return this.searchResultData.slice(startIndex, endIndex);
|
return this.searchResultData.slice(startIndex, endIndex);
|
||||||
},
|
},
|
||||||
// 计算出当前页的已查询结果数据列表
|
// 计算出当前页的已选择结果数据列表
|
||||||
selectedResultPagedData() {
|
/*selectedResultPagedData() {
|
||||||
console.log(this.selectedResultData)
|
console.log(this.selectedResultData)
|
||||||
const startIndex = (this.selectedResultCurrentPage - 1) * this.selectedResultPageSize;
|
const startIndex = (this.selectedResultCurrentPage - 1) * this.selectedResultPageSize;
|
||||||
const endIndex = startIndex + this.selectedResultPageSize;
|
const endIndex = startIndex + this.selectedResultPageSize;
|
||||||
return this.selectedResultData.slice(startIndex, endIndex);
|
return this.selectedResultData.slice(startIndex, endIndex);
|
||||||
},
|
},*/
|
||||||
|
|
||||||
|
// 已选择结果数据汇总
|
||||||
|
sumSelectedResultData() {
|
||||||
|
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
|
||||||
|
return allPrice.toFixed(2);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue