From c6b53dd046b16f52925b590e64acfcbd15ebc831 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Tue, 28 Nov 2023 00:39:11 +0800 Subject: [PATCH] =?UTF-8?q?[add:]=20=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=AD=90=E8=A1=A8=EF=BC=8C=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E4=BA=86=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=EF=BC=8C=E7=89=A9?= =?UTF-8?q?=E6=96=99=E7=9A=84=E4=BB=B7=E6=A0=BC=EF=BC=8C=E7=A8=8E=E7=8E=87?= =?UTF-8?q?=EF=BC=8C=E7=BE=8E=E5=85=83=E6=B1=87=E7=8E=87=EF=BC=8C=E6=80=BB?= =?UTF-8?q?=E4=BB=B7=EF=BC=8C=E6=97=B6=E9=97=B4=EF=BC=8C=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BA=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysCustomerQuoteChildController.java | 144 ++++ .../system/domain/SysCustomerQuoteChild.java | 45 ++ .../mapper/SysCustomerQuoteChildMapper.java | 68 ++ .../ISysCustomerQuoteChildService.java | 68 ++ .../SysCustomerQuoteChildServiceImpl.java | 53 ++ .../system/SysCustomerQuoteChildMapper.xml | 149 ++++ .../templates/erp/material/detail.html | 272 +++++++ .../templates/erp/material/material.html | 13 +- .../templates/system/customer/add.html | 6 +- .../templates/system/customerQuote/add.html | 765 +++++++++++++++++- .../system/customerQuote/customerQuote.html | 14 +- 11 files changed, 1573 insertions(+), 24 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/SysCustomerQuoteChildController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteChildService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteChildServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml create mode 100644 ruoyi-admin/src/main/resources/templates/erp/material/detail.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/SysCustomerQuoteChildController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/SysCustomerQuoteChildController.java new file mode 100644 index 00000000..b0ca035a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/SysCustomerQuoteChildController.java @@ -0,0 +1,144 @@ +package com.ruoyi.system; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +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.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.remind.service.RemindService; +import com.ruoyi.system.domain.SysCustomerQuoteChild; +import com.ruoyi.system.domain.exportDto.SysCustomerDto; +import com.ruoyi.system.service.ISysCustomerOperService; +import com.ruoyi.system.service.ISysCustomerQuoteChildService; +import com.ruoyi.system.service.ISysDictTypeService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 客户报价子表信息Controller + * + * @author ruoyi + * @date 2022-11-02 + */ +@Controller +@RequestMapping("/system/customerQuoteChild") +public class SysCustomerQuoteChildController extends BaseController +{ + private final String prefix = "system/customerQuoteChild"; + + @Autowired + private ISysCustomerQuoteChildService sysCustomerQuoteChildService; + @Autowired + private ISysDictTypeService sysDictTypeService; + @Autowired + private RemindService remindService; + @Autowired + private ISysCustomerOperService sysCustomerOperService; + + @RequiresPermissions("system:customerQuoteChild:view") + @GetMapping() + public String customerQoute() + { + return prefix + "/customerQuoteChild"; + } + + /** + * 查询客户报价子表信息列表 + */ + @RequiresPermissions("system:customerQuoteChild:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysCustomerQuoteChild sysCustomerQoute) + { + startPage(); + List list = sysCustomerQuoteChildService.selectSysCustomerQuoteChildList(sysCustomerQoute); + return getDataTable(list); + } + + + /** + * 新增客户报价子表信息 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存客户报价子表信息 + */ + @RequiresPermissions("system:customerQuoteChild:add") + @Log(title = "客户报价子表信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(SysCustomerQuoteChild sysCustomerQuoteChild) + { + return toAjax(sysCustomerQuoteChildService.insertSysCustomerQuoteChild(sysCustomerQuoteChild)); + } + + + +// /** +// * 修改客户报价子表信息 +// */ +// @GetMapping("/edit/{id}") +// public String edit(@PathVariable("id") Long id, ModelMap mmap) +// { +// SysCustomerQuoteChild sysCustomerQuoteChild = sysCustomerQuoteChildService.selectSysCustomerQuoteChildById(id); +// mmap.put("sysCustomerQuoteChild", sysCustomerQuoteChild); +// return prefix + "/edit"; +// } + /** + * 修改保存客户报价子表信息 + */ + @RequiresPermissions("system:customer:edit") + @Log(title = "客户报价子表信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(SysCustomerQuoteChild sysCustomerQuoteChild) + { + //审核客户表 + return toAjax(sysCustomerQuoteChildService.updateSysCustomerQuoteChild(sysCustomerQuoteChild)); + } + + /** + * 删除客户报价子表信息 + */ + @RequiresPermissions("system:customerQuoteChild:remove") + @Log(title = "客户报价子表信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String[] ids) + { + return toAjax(sysCustomerQuoteChildService.deleteSysCustomerQuoteChildByIds(ids)); + } + + //查找客户代码和名称 + @PostMapping( "/getcode") + @ResponseBody + public List code(){ + List list= sysCustomerQuoteChildService.selectSysCustomerQuoteChildBycode(); + return list; + } + + @RequiresPermissions("system:customerQuoteChild:export") + @Log(title = "客户报价子表信息", businessType = BusinessType.EXPORT) + @RequestMapping("/exportCustomerInfo") + @ResponseBody + public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException { + //数据处理 + JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); + JSONArray jsonArray = jsonObject.getJSONArray("selectData"); + List selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java new file mode 100644 index 00000000..74fea8b0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java @@ -0,0 +1,45 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; +//客户报价 - 子表 +public class SysCustomerQuoteChild extends BaseEntity { + private static final long serialVersionUID = 1L; + + private Long id; + //物料表中的id + private Long materialId; + //物料编号 + private String materialCode; + //物料名称 + private String materialName; + //物料的类型 + private String mateialType; + //物料的数量 + private String materialNum; + //国内税率 + private Double countaxRate; + //美元汇率 + private Double usdTax; + //物料的不含税单价(RMB) + private Double materialNoRmb; + //物料的含税单价(RMB) + private Double materialRmb; + //物料的不含税单价(USD) + private Double materialNoUsd; + //物料的含税单价(USD) + private Double materialUsd; + //创建人 + private String createBy; + //创建时间 + private Date createTime; + //修改人 + private String updateBy; + //修改时间 + private Date updateTime; + //审核标志 + private String deginFlag; + //删除标志 + private String delFlag; + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java new file mode 100644 index 00000000..d2ea6afd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.SysCustomerQuoteChild; + +import java.util.List; + +/** + * 客户报价子表信息Mapper接口 + * + * @author ruoyi + * @date 2022-11-02 + */ +public interface SysCustomerQuoteChildMapper +{ + /** + * 查询客户报价子表信息 + * + * @param id 客户报价子表信息ID + * @return 客户报价子表信息 + */ + + SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id); + + /** + * 查询客户报价信息列表 + * + * @param sysCustomerQuoteChild 客户报价子表信息 + * @return 客户报价子表信息集合 + */ + List selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 新增客户报价子表信息 + * + * @param sysCustomerQuoteChild 客户报价信息 + * @return 结果 + */ + int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 修改客户报价子表信息 + * + * @param sysCustomerQuoteChild 客户报价信息 + * @return 结果 + */ + int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 删除客户报价子表信息 + * + * @param id 客户报价子表信息ID + * @return 结果 + */ + int deleteSysCustomerQuoteChildById(Long id); + + /** + * 批量删除客户报价子表信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteSysCustomerQuoteChildByIds(String[] ids); + + + List selectSysCustomerQuoteChildBycode(); + + SysCustomerQuoteChild selectSysCustomerByMaterialCode(String materialCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteChildService.java new file mode 100644 index 00000000..96c6e68c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteChildService.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.service; + +import com.ruoyi.system.domain.SysCustomerQuoteChild; + +import java.util.List; + +/** + * 客户报价子表信息Mapper接口 + * + * @author ruoyi + * @date 2022-11-02 + */ +public interface ISysCustomerQuoteChildService +{ + /** + * 查询客户报价子表信息 + * + * @param id 客户报价子表信息ID + * @return 客户报价子表信息 + */ + + SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id); + + /** + * 查询客户报价信息列表 + * + * @param sysCustomerQuoteChild 客户报价子表信息 + * @return 客户报价子表信息集合 + */ + List selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 新增客户报价子表信息 + * + * @param sysCustomerQuoteChild 客户报价信息 + * @return 结果 + */ + int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 修改客户报价子表信息 + * + * @param sysCustomerQuoteChild 客户报价信息 + * @return 结果 + */ + int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); + + /** + * 删除客户报价子表信息 + * + * @param id 客户报价子表信息ID + * @return 结果 + */ + int deleteSysCustomerQuoteChildById(Long id); + + /** + * 批量删除客户报价子表信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteSysCustomerQuoteChildByIds(String[] ids); + + + List selectSysCustomerQuoteChildBycode(); + + SysCustomerQuoteChild selectSysCustomerByMaterialCode(String customerCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteChildServiceImpl.java new file mode 100644 index 00000000..9befe17c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteChildServiceImpl.java @@ -0,0 +1,53 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.domain.SysCustomerQuoteChild; +import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper; +import com.ruoyi.system.service.ISysCustomerQuoteChildService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +@Service +public class SysCustomerQuoteChildServiceImpl implements ISysCustomerQuoteChildService { + @Autowired + private SysCustomerQuoteChildMapper sysCustomerQuoteChildMapper; + @Override + public SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id) { + return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildById(id); + } + + @Override + public List selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild) { + return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildList(sysCustomerQuoteChild); + } + + @Override + public int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild) { + return sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild); + } + + @Override + public int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild) { + return sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild); + } + + @Override + public int deleteSysCustomerQuoteChildById(Long id) { + return sysCustomerQuoteChildMapper.deleteSysCustomerQuoteChildById(id); + } + + @Override + public int deleteSysCustomerQuoteChildByIds(String[] ids) { + return sysCustomerQuoteChildMapper.deleteSysCustomerQuoteChildByIds(ids); + } + + @Override + public List selectSysCustomerQuoteChildBycode() { + return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildBycode(); + } + + @Override + public SysCustomerQuoteChild selectSysCustomerByMaterialCode(String materialCode) { + return sysCustomerQuoteChildMapper.selectSysCustomerByMaterialCode(materialCode); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml new file mode 100644 index 00000000..9a53a3d5 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id,materialId,materialCode,materialName,materialType,materialNum,countTax,usdTax,materialNoRmb,materialRmb,materialNoUsd,materialUsd,degin_flag,del_flag,create_by,create_time,update_by,update_time,remark from sys_customer_quoteChild + + + + + + + + + + + + + insert into sys_customer_quoteChild + + materialId, + materialCode, + materialName, + materialType, + materialNum, + countTax, + usdTax, + materialNoRmbNum, + materialRmbNum, + materialNoRmbSum, + materialRmbSum, + materialNoUsdNum, + materialUsdNum, + materialNoUsdSum, + materialUsdSum, + create_by, + update_by, + update_time, + remark, + degin_flag, + del_flag, + create_time, + + + #{materialId}, + #{materialCode}, + #{materialName}, + #{materialType}, + #{materialNum}, + #{countTax}, + #{usdTax}, + #{materialNoRmb}, + #{materialRmb}, + #{materialNoRmbSum}, + #{materialRmbSum}, + #{materialNoUsd}, + #{materialNoUsdSum}, + #{materialUsd}, + #{materialUsdSum}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + 0, + 0, + now(), + + + + + update sys_customer_quoteChild + + materialId = #{materialId}, + materialCode = #{materialCode}, + materialName = #{materialName}, + materialType = #{materialType}, + materialNum = #{materialNum}, + countTax = #{countTax}, + usdTax = #{usdTax}, + materialNoRmb = #{materialNoRmb}, + materialRmb#{materialRmb}, + materialNoRmbSum = #{materialNoRmbSum}, + materialRmbSum = #{materialRmbSum}, + materialNoUsd = #{materialNoUsd}, + materialNoUsdSum = #{materialNoUsdSum}, + materialUsd = #{materialUsd}, + materialUsdSum = #{materialUsdSum}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + degin_flag = #{deginFlag}, + del_flag = #{delFlag}, + update_time = CONCAT_WS(',',NOW(),update_time), + + where id = #{id} + + + delete from sys_customer_quoteChild where id = #{id} + + + + delete from sys_customer_quoteChild where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/detail.html b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html new file mode 100644 index 00000000..3cce40ce --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html @@ -0,0 +1,272 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + 点击上传 +
只能上传jpg/png文件,第一张图片为主图
+
+
+ + + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/material.html b/ruoyi-admin/src/main/resources/templates/erp/material/material.html index dc3801fd..5a9b0b5a 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/material.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/material.html @@ -38,13 +38,17 @@
  • - +
  • - + + +
  • @@ -127,6 +131,7 @@ cancelUrl: prefix + "/cancel/{id}", restoreUrl: prefix + "/restore/{id}", exportUrl: prefix + "/export", + detailUrl: prefix + "/edit/{id}", modalName: "物料信息", columns: [{ checkbox: true diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/add.html b/ruoyi-admin/src/main/resources/templates/system/customer/add.html index f4f75101..05d8d310 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/add.html @@ -302,7 +302,11 @@
    - +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    @@ -52,38 +65,74 @@
    - +
    - + +
    + +
    +
    +
    +

    计算

    +
    +
    +
    - +
    - + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    -
    - +
    - + +
    +
    +
    + +
    +
    - + +
    +
    +
    + +
    +
    -
    +
    @@ -110,6 +159,73 @@
    +
    + + + + +
    @@ -138,7 +254,632 @@ minView: "month", autoclose: true }); + // 获取客户信息 + var customerodata = [] + $.ajax({ + url: ctx + "system/customer/list", + type: "POST", + success: function (res) { + // console.log(res) + if (res.rows.length > 0) { + customerodata = res.rows; + //alert(JSON.stringify(data)); + // console.log(res.rows) + for (let i in customerodata) { + $("select[name='customerCode']").append(""); + // $("select[name='enterpriseName']").append(""); + } + } else { + $.modal.msgError(res.msg); + } + }, + error: function () { + $.modal.msgError("后台出错啦!"); + + } + }) + //客户选择完成填写对应的选项 + $("select[name='customerCode']").change(function () { + var enterpriseCode = $(this).val(); + for (i = 0; i < customerodata.length; i++) { + // console.log(customerodata) + $("input[name='customerName']").val(customerodata[i].enterpriseName) + $("input[name='contactNumber']").val(customerodata[i].contactNumber) + // $("input[name='businessMembers']").val(customerodata[i].businessMembers) + $("input[name='customerFax']").val(customerodata[i].customerFax) + if (customerodata[i].confirmTax == 1) { + $("input[name='isTax']").val("是") + } else { + $("input[name='isTax']").val("否") + + } + $("input[name='taxRate']").val(customerodata[i].taxRate) + } + }) + /*用户列表*/ + $.ajax({ + url: ctx + 'system/user/list', + type: 'post', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + //alert(JSON.stringify(data)); + for (let i in usertData) { + // console.log(finishProductData[i].finishProductCode) + $("#form-salesOrder-add select[name='businessMembers']").append(""); + } + let userName = [[${@permission.getPrincipalProperty('userName')}]]; + $("#form-salesOrder-add select[name='businessMembers']").val(userName).trigger("change") + + } else { + $.modal.msgError(res.msg); + } + } + }) + //报价币类型 + var commonCurrtry = $("#commonCurrency").text(); + //国内税率 + var countaxRate = $("input[name='countaxRate']").val(); + //美元汇率 + var usdTax = $("input[name = 'usdTax']").val(); + //数量 + var enterpriseSum = $("input[name = 'enterpriseSum']").val(); + if(commonCurrtry == 'RMB'){ + var noRmbNum = $("input[name = 'noRmbNum']").val(); + noRmbNum = num.toFixed(2); + // 5.2含税单价(RMB):=不含税单价(RMB) * (1+客户公司国内税率)) + var rmbNum = noRmbSum * (1 + countaxRate); + rmbNum = rmbNum.toFixed(2); + $("input[name = 'rmbNum']").val(rmbNum); + // 5.4 不含税总价(RMB):=不含税单价(RMB)数量 + var noRmbSum = noRmbNum * enterpriseSum; + noRmbSum = noRmbSum.toFixed(2); + $("input[name = 'noRmbSum']").val(noRmbSum); + // 5.5 含税总价(RMB):=含税单价(RMB)*数量 + var rmbSum = rmbNum * enterpriseSum; + rmbSum = rmbSum.toFixed(2); + // 5.6 不含税单价(美元):=不税单价(RMB)/美元汇率 + var noUsdNum = rmbNum / usdTax; + noUsdNum = noUsdNum.toFixed(2) + $("input[name = 'noUsbNum']").val(noUsdNum); + // 注:换算后,保留小数点后两位,超过后的四舍五入 + // 5.7 含税单价(美元)不含税单价(美元) + $("input[name = 'usdNum']").val(noUsdNum); + // 5.8 不含税总价(美元): =不含税单价(美元)*数量 + $("input[name = 'noUsdSum']").val(noUsdNum * enterpriseSum); + // 5.9 含税总价(美元):=含税单价(美元)*数量 + $("input[name= 'usdSum']").val(noUsdNum * enterpriseSum) + } + $("input[name='usbNum']").change(function () { + // 6、报价币种为美元 + // 6.1 不含税单价(美元): 手动输入,该价格会自动影响后续的价格。必填 + var noUsdNum = $("input[name = noUsdNum]").val(); + //6.2 含税单价(美元)=不含税单价(美元) + var usdNum = $("input[name = noUsdNum]").val(noUsdNum); + // 6.3 数量:默认为空,手动输入。必填 + // 6.4 不含税总价(美元): =不含税单价(美元)*数量 + // 6.5含税总价(美元):=含税单价(美元)*数量 + // 6.6不含税单价(RMB):不含税单价(美元)美元汇率 + // 注:换算后,保留小数点后两位,超过后的四舍五入 + // 6.7 含税单价(RMB): 不含税单价(RMB)* (1+客户公司国内税率) + // 6.8 不含税总价(RMB):=不含税单价(RMB)数量 + // 6.9 含税总价(RMB):=含税单价(RMB)*数量 + if (commonCurrtry == 'USD'){ + var noRmbNum = $("input[name = 'noRmbNum']").val(); + noRmbNum = num.toFixed(2); + //数量 + var enterpriseSum = $("input[name = 'enterpriseSum']").val(); + // 5.2含税单价(RMB):=不含税单价(RMB) * (1+客户公司国内税率)) + var rmbNum = noRmbSum * (1 + countaxRate); + rmbNum = rmbNum.toFixed(2); + $("input[name = 'rmbNum']").val(rmbNum); + // 5.4 不含税总价(RMB):=不含税单价(RMB)数量 + var noRmbSum = noRmbNum * enterpriseSum; + noRmbSum = noRmbSum.toFixed(2); + $("input[name = 'noRmbSum']").val(noRmbSum); + // 5.5 含税总价(RMB):=含税单价(RMB)*数量 + var rmbSum = rmbNum * enterpriseSum; + rmbSum = rmbSum.toFixed(2); + // 5.6 不含税单价(美元):=不税单价(RMB)/美元汇率 + var noUsdNum = rmbNum / usbTax; + noUsdNum = noUsdNum.toFixed(2) + $("input[name = 'noUsdNum']").val(noUsdNum); + // 注:换算后,保留小数点后两位,超过后的四舍五入 + // 5.7 含税单价(美元)不含税单价(美元) + $("input[name = 'usdNum']").val(noUsdNum); + // 5.8 不含税总价(美元): =不含税单价(美元)*数量 + $("input[name = 'noUsdSum']").val(noUsdNum * enterpriseSum); + // 5.9 含税总价(美元):=含税单价(美元)*数量 + $("input[name= 'usdSum']").val(noUsdNum * enterpriseSum); + } + + + + }) + //添加有物料号物料 + function addFinish() { + if($("select[name='customerCode']").val()==''||$("select[name='customerCode']").val()==null){ + $.modal.alert("请先选择客户") + }else { + $("#FinishModal").modal("show"); + $("#FinishbomTable").bootstrapTable('refresh'); + // 所有产品数据 + //全部itemList + $('#FinishbomTable').bootstrapTable({ + url: ctx + "system/productquotation/list", + pagination: true, + pageNumber: 1, + pageSize: 10, + pageList: [10, 25, 50, 100], + showRefresh: false, + 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, + paginationDetailHAlign: ' hiddenDetailInfo', + height: 250, + queryParams: function (params) { + //console.log("123"); + var curParams = { + // 传递参数查询参数 + pageSize: params.limit, + pageNum: params.offset / params.limit + 1, + enterpriseCode: $("select[name='enterpriseCode']").val() + + }; + // console.log(data[0].enterpriseCode) + let json = $.extend(curParams, $.common.formToJSON("formFinishSearch")); + return json; + // return curParams + }, + + columns: [ + { + checkbox: true + }, + { + field: 'productQuotationId', + title: '产品报价id', + visible: false + }, + { + field: 'quotationCode', + title: '报价编码' + }, + { + field: 'finishProductCode', + title: '成品代码' + }, + { + field: 'finishProductName', + title: '成品名称' + }, + { + field: 'specificationModel', + title: '规格型号' + }, + { + field: 'customerNumber', + title: '客户料号' + }, + { + field: 'typeMachine', + title: '机种' + }, + { + field: 'inventoryUnit', + title: '单位', + + }, + { + field: 'commonCurrency', + title: '币别', + formatter: function (value, row, index) { + return $.table.selectDictLabel(commonCurrencyDatas, value); + } + }, + { + field: 'processPrice', + title: '单价' + }, + { + field: 'enterpriseCode', + title: '客户编号' + }, + { + field: 'enterpriseName', + title: '客户名称' + }, + { + field: 'registrant', + title: '登记人', + visible: false + + }, + { + field: 'pricingDate', + title: '订价日期', + visible: false + + }, + { + field: 'taxRate', + title: '税率' + }, + { + field: 'priceExcludingTax', + title: '不含税价', + visible: false + + }, + { + field: 'priceIncludingTax', + title: '含税价', + visible: false + + }, + { + field: 'lastPrice', + title: '上次价格', + visible: false + + }, + { + field: 'lastPriceEnd', + title: '上次价格2', + visible: false + + }, + { + field: 'costRmb', + title: '当前材料成本RMB', + visible: false + + }, + { + field: 'currentExchangeRate', + title: '当前汇率', + visible: false + + }, + { + field: 'proportionMaterials', + title: '材料占比', + visible: false + + }, + { + field: 'quotationExplain', + title: '备注说明', + visible: false + + }, + { + field: 'currentQuote', + title: '是否为当前报价', + visible: false + + + }, + { + field: 'confirmTax', + title: '是否含税' + }, + { + field: 'confirmNo', + title: '确认否', + visible: false + + + }, + { + field: 'confirmName', + title: '确认人', + visible: false + + }, + { + field: 'confirmTime', + title: '确认时间', + visible: false + + }, + + + ] + }); + } + } + //添加无物料号物料 + // 确认添加产品 + function addFinishconfirm(){ + var data = $("#FinishbomTable").bootstrapTable("getSelections"); + var count = $('#addFinishbomTable').bootstrapTable('getData').length; + for (i = 0; i < data.length; i++) { + let salesOrderCode = $("input[name='salesOrderCode']").val() + let salesOrderNumber = $("input[name='salesOrderNumber']").val() + let enterpriseCode = $("select[name='enterpriseCode']").val() + let enterpriseName = $("input[name='enterpriseName']").val() + //获取当前日期 + let d = new Date(); + let curr_date = d.getDate(); + let curr_month = d.getMonth() + 1; + let curr_year = d.getFullYear(); + String(curr_month).length < 2 ? (curr_month = "0" + curr_month): curr_month; + String(curr_date).length < 2 ? (curr_date = "0" + curr_date): curr_date; + let yyyyMMdd = curr_year + "-" + curr_month +"-"+ curr_date; + // console.log(yyyyMMdd) + + let bootstrapTable = $('#addFinishbomTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode); + if (bootstrapTable != null) { + $.modal.alert(bootstrapTable.finishProductName + "已存在,不可重复添加!"); + continue; + } + $("#addFinishbomTable").bootstrapTable('insertRow', { + index: count + i, + row: { + finishProductCode: data[i].finishProductCode, + finishProductName: data[i].finishProductName, + specificationModel: data[i].specificationModel, + inventoryUnit: data[i].inventoryUnit, + customerNumber: data[i].customerNumber, + typeMachine: data[i].typeMachine, + stockUnitWeight: '0', + processPrice: data[i].processPrice, + versionNumber: '', + commonCurrency: data[i].commonCurrency, + amountMoney:'0', + deliveryTime: yyyyMMdd, + line:'', + salesExplain:'', + productQuantity:'0', + customerUseOrNot: customerUseOrNotDatas[0].dictValue, + accountReconciliationOrNot: accountReconciliationOrNotDatas[0].dictValue, + salesOrderCode: salesOrderCode, + salesOrderNumber:salesOrderNumber, + enterpriseCode:enterpriseCode, + enterpriseName:enterpriseName, + } + }); + } + $("#FinishbomTable").bootstrapTable("uncheckAll"); + // console.log($('#addrowbomTable').bootstrapTable('getData')) + } + + // 产品报价表格 + $('#addFinishbomTable').bootstrapTable({ + url : ctx + "system/rawmaterial/itemList", + pagination: true, + pageNumber: 1, + pageSize: 10, + showToggle: false, // 是否显示详细视图和列表视图的切换按钮 + cardView: false, // 是否显示详细视图 + detailView: false, // 是否显示父子表 + smartDisplay: false, // 加了这个才显示每页显示的行数 + showExport: false, // 是否显示导出按钮 + // singleSelect: true, + paginationDetailHAlign: ' hiddenDetailInfo', + height: 250, + uniqueId: 'finishProductCode', + onEditableSave:onEditableSave, + queryParams: function (params) { + //console.log("123"); + var curParams = { + // 传递参数查询参数 + pageSize: params.limit, + pageNum: params.offset / params.limit + 1, + // enterpriseCode: data[0].enterpriseCode + + }; + // console.log(data[0].enterpriseCode) + return curParams + }, + columns: [ + { + checkbox: true + }, + { + title: '操作', + align: 'center', + formatter: function (value, row, index) { + var actions = []; + actions.push('删除'); + return actions.join(''); + } + }, + { + field: 'finishProductCode', + title: '成品代码' + }, + { + field: 'finishProductName', + title: '成品名称' + }, + { + field: 'specificationModel', + title: '规格型号' + }, + { + field: 'customerNumber', + title: '客户料号' + }, + { + field: 'typeMachine', + title: '机种' + }, + + { + field: 'inventoryUnit', + title: '单位', + + }, + { + field: 'stockUnitWeight', + title: '重量', + + + }, + { + field: 'commonCurrency', + title: '币别', + formatter: function (value, row, index) { + return $.table.selectDictLabel(commonCurrencyDatas, value); + } + + }, + { + field: 'processPrice', + title: '单价', + + }, + { + field: 'productQuantity', + title: '数量', + editable: { + type: 'text', + title: '数量', + validate: function (value) { + if (isNaN(value)) return '使用量必须是数字'; + var price = parseFloat(value); + if (price <= 0) return '使用量必须大于0'; + } + } + + }, + { + field: 'amountMoney', + title: '金额', + + }, + { + field: 'deliveryTime', + title: '交期', + editable: { + type: 'date', + title: '交期', + emptytext: '交期', + validate: function (value) { + var now = new Date(); + if (value.getTime() < now.getTime()) { + return "交期至少是今天!"; + } + } + } + + }, + { + field: 'line', + title: 'Line#', + editable: { + type: 'text', + title: 'Line', + emptytext: 'Line', + validate: function (value) { + + } + } + + }, + { + field: 'versionNumber', + title: '版本号', + editable: { + type: 'text', + title: '版本号', + emptytext: '版本号', + validate: function (value) { + + } + } + }, + { + field: 'salesExplain', + title: '说明', + editable: { + type: 'text', + title: '说明', + emptytext: '备注说明', + validate: function (value) { + + } + } + + }, + { + field: 'customerUseOrNot', + title: '客户使用否', + formatter: function (value, row, index) { + return customerUseOrNotDatas[0].dictValue; + }, + visible: false + }, + { + field: 'accountReconciliationOrNot', + title: '对账否', + formatter:function (value, row, index) { + return accountReconciliationOrNotDatas[0].dictValue; + }, + visible: false + }, + { + field: 'standbyOne', + title: '备用一', + visible: false + }, + { + field: 'standbyTwo', + title: '备用二', + visible: false + + } + + ] + + }); + // 删除 + function remove(finishProductCode){ + var ids = []; + ids.push(finishProductCode); + $('#addFinishbomTable').bootstrapTable("remove",{ + field:'finishProductCode', + values:ids + }) + $("#addFinishbomTable").bootstrapTable('refresh'); + } + + // 添加成品 + function confirmFinish() { + $("#addFinishbomTable").bootstrapTable('refresh'); + let data = JSON.stringify($('#addFinishbomTable').bootstrapTable('getData', true)); + console.log(data) + let dataLength=$('#addFinishbomTable').bootstrapTable('getData', true) + if(dataLength.length>0){ + $.ajax({ + url: ctx + 'system/salesFinish/add', + type: "POST", + data: { + data: data + }, + dataType: "json", + success: function (resp) { + console.log(resp) + }, + + }) + } + + + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index 2378318a..50ce3f2d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -143,7 +143,7 @@ checkbox: true }, { - field: 'deginflag', + field: 'deginFlag', title: '审核状态', formatter: function (value, row, index) { if (value == 0){ @@ -158,7 +158,7 @@ }, }, { - field: 'delflag', + field: 'delFlag', title: '客户状态', formatter: function (value, row, index) { if (value == 0){ @@ -191,22 +191,22 @@ }, { field: 'entpriseSum', - title: '物料数量合计' + title: '数量合计' }, { - field: 'noRmbTax', + field: 'noRmbSum', title: '不含税总价(RMB)', }, { - field: 'rmbTax', + field: 'rmbSum', title: '含税总价(RMB)' }, { - field: 'noUsbTax', + field: 'noUsdSum', title: '不含税总价(美元)' }, { - filed: 'usbTax', + filed: 'usdSum', title: '含税总价(美元)' }, {