Browse Source

[add:] 新增客户报价子表,包含了物料信息,物料的价格,税率,美元汇率,总价,时间,创建人。

erp、
zhangsiqi 10 months ago
parent
commit
c6b53dd046
  1. 144
      ruoyi-admin/src/main/java/com/ruoyi/system/SysCustomerQuoteChildController.java
  2. 45
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java
  3. 68
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java
  4. 68
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteChildService.java
  5. 53
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteChildServiceImpl.java
  6. 149
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml
  7. 272
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html
  8. 13
      ruoyi-admin/src/main/resources/templates/erp/material/material.html
  9. 6
      ruoyi-admin/src/main/resources/templates/system/customer/add.html
  10. 765
      ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html
  11. 14
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

144
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<SysCustomerQuoteChild> 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<SysCustomerDto> selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class);
}
}

45
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;
}

68
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<SysCustomerQuoteChild> 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);
}

68
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<SysCustomerQuoteChild> 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);
}

53
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<SysCustomerQuoteChild> 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);
}
}

149
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysCustomerQuoteChildMapper">
<resultMap type="SysCustomerQuoteChild" id="SysCustomerQuoteChildResult">
<result property="id" column="id" />
<result property="materialId" column="materialId" />
<result property="materialCode" column="materialCode" />
<result property="materialName" column="materialName" />
<result property="materialType" column="materialType" />
<result property="materilaNum" column="materialNum" />
<result property="countaxRate" column="countaxRate" />
<result property="usdTax" column="usdTax" />
<result property="materialNoRmb" column="materialNoRmb" />
<result property="materialRmb" column="materialRmb" />
<result property="materialNoUsd" column="materialNoUsd" />
<result property="materialUsd" column="materialUsd" />
<result property="degin_flag" column="deginFlag" />
<result property="del_flag" column="delFlag" />
<result property="create_by" column="createBy" />
<result property="create_time" column="createTime" />
<result property="update_by" column="updateBy" />
<result property="update_time" column="updateTime" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysCustomerQuoteVo">
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
</sql>
<select id="selectSysCustomerQuoteChildList" parameterType="SysCustomerQuoChild" resultMap="SysCustomerQuoteChildResult">
<include refid="selectSysCustomerQuoteChildVo"/>
<where>
<if test="materialCode != null and materialCode != ''"> and materialCode like concat('%', #{materialCode}, '%')</if>
<if test="material != null and materialName != ''"> and materialName like concat('%', #{materialName}, '%')</if>
<if test="materialType != null and materialType != ''"> and materialType = #{materialType}</if>
<if test="countTax != null and countTax != ''"> and countTax like concat('%', #{countTax}, '%')</if>
</where>
</select>
<select id="selectSysCustomerQuoteChildById" parameterType="Long" resultMap="SysCustomerQuoteChildResult">
<include refid="selectSysCustomerQuoteChildVo"/>
where id = #{id}
</select>
<select id="selectSysCustomerByQuoteChildCode" resultMap="SysCustomerQuoteChildResult">
select materialCode,materialName from sys_customer_quoteChild
</select>
<select id="selectSysCustomerByMaterialCode" parameterType="String" resultMap="SysCustomerQuoteChildResult">
<include refid="selectSysCustomerQuoteChildVo"/>
where materialCode = #{materialCode}
</select>
<insert id="insertSysCustomerQuoteChild" parameterType="SysCustomerQuoteChild" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_quoteChild
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialId != null and materialId != ''" >materialId,</if>
<if test="materialCode != null and materialCode != ''" >materialCode,</if>
<if test="materialName != null and materialName ! =''">materialName,</if>
<if test="materialType != null and materialType != ''" >materialType,</if>
<if test="materialNum != null" >materialNum,</if>
<if test="countTax =null" >countTax,</if>
<if test="usdTax != null" >usdTax,</if>
<if test="materialNoRmbNum != null" >materialNoRmbNum,</if>
<if test="materialRmbNum != null">materialRmbNum,</if>
<if test="materialNoRmbSum != null">materialNoRmbSum,</if>
<if test="materialRmbSum != null">materialRmbSum,</if>
<if test="materialNoUsdNum != null">materialNoUsdNum,</if>
<if test="materialUsdNum != null">materialUsdNum,</if>
<if test="materialNoUsdSum != null">materialNoUsdSum,</if>
<if test="materialUsdSum != null">materialUsdSum,</if>
<if test="creatBy != null and createBy != ''" >create_by,</if>
<if test="updateBy != null and updateBy != ''" >update_by,</if>
<if test="updateTime != null and updateTime != ''" >update_time,</if>
<if test="remark != null and remark != ''" >remark,</if>
degin_flag,
del_flag,
create_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialId != null and materialId != ''" >#{materialId},</if>
<if test="materialCode != null and materialCode != ''" >#{materialCode},</if>
<if test="materialName != null and materialName ! =''">#{materialName},</if>
<if test="materialType != null and materialType != ''" >#{materialType},</if>
<if test="materialNum != null" >#{materialNum},</if>
<if test="countTax =null" >#{countTax},</if>
<if test="usdTax != null" >#{usdTax},</if>
<if test="materialNoRmb != null" >#{materialNoRmb},</if>
<if test="materialRmb != null">#{materialRmb},</if>
<if test="materialNoRmbSum != null">#{materialNoRmbSum},</if>
<if test="materialRmbSum != null">#{materialRmbSum},</if>
<if test="materialNoUsd != null">#{materialNoUsd},</if>
<if test="materialNoUsdSum != null">#{materialNoUsdSum},</if>
<if test="materialUsd != null">#{materialUsd},</if>
<if test="materialUsdSum != null">#{materialUsdSum},</if>
<if test="creatBy != null and createBy != ''" >#{createBy},</if>
<if test="updateBy != null and updateBy != ''" >#{updateBy},</if>
<if test="updateTime != null and updateTime != ''" >#{updateTime},</if>
<if test="remark != null and remark != ''" >#{remark},</if>
0,
0,
now(),
</trim>
</insert>
<update id="updateSysCustomerQuoteChild" parameterType="SysCustomerQuoteChild">
update sys_customer_quoteChild
<trim prefix="SET" suffixOverrides=",">
<if test="materialId != null and materialId != ''" > materialId = #{materialId},</if>
<if test="materialCode != null and materialCode != ''" >materialCode = #{materialCode},</if>
<if test="materialName != null and materialName ! =''">materialName = #{materialName},</if>
<if test="materialType != null and materialType != ''" >materialType = #{materialType},</if>
<if test="materialNum != null" >materialNum = #{materialNum},</if>
<if test="countTax =null" >countTax = #{countTax},</if>
<if test="usdTax != null" >usdTax = #{usdTax},</if>
<if test="materialNoRmb != null" >materialNoRmb = #{materialNoRmb},</if>
<if test="materialRmb != null">materialRmb#{materialRmb},</if>
<if test="materialNoRmbSum != null">materialNoRmbSum = #{materialNoRmbSum},</if>
<if test="materialRmbSum != null">materialRmbSum = #{materialRmbSum},</if>
<if test="materialNoUsd != null">materialNoUsd = #{materialNoUsd},</if>
<if test="materialNoUsdSum != null">materialNoUsdSum = #{materialNoUsdSum},</if>
<if test="materialUsd != null">materialUsd = #{materialUsd},</if>
<if test="materialUsdSum != null">materialUsdSum = #{materialUsdSum},</if>
<if test="creatBy != null and createBy != ''" >create_by = #{createBy},</if>
<if test="updateBy != null and updateBy != ''" >update_by = #{updateBy},</if>
<if test="updateTime != null and updateTime != ''" >update_time = #{updateTime},</if>
<if test="remark != null and remark != ''" >remark = #{remark},</if>
<if test="deginFLag != null and deginFlag != ''" >degin_flag = #{deginFlag},</if>
<if test="delFlag != null and delFlag != ''" >del_flag = #{delFlag},</if>
update_time = CONCAT_WS(',',NOW(),update_time),
</trim>
where id = #{id}
</update>
<delete id="deleteSysCustomerQuoteChildById" parameterType="Long">
delete from sys_customer_quoteChild where id = #{id}
</delete>
<delete id="deleteSysCustomerQuoteChildByIds" parameterType="String">
delete from sys_customer_quoteChild where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

272
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -0,0 +1,272 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('物料信息详情')" />
<th:block th:include="include :: select2-css" />
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-material-edit" th:object="${erpMaterial}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8">
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('auditStatus')}">
<input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}">
<label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('useStatus')}">
<input type="radio" th:id="${'useStatus_' + dict.dictCode}" name="useStatus" th:value="${dict.dictValue}" th:field="*{useStatus}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否有生产团队:</label>
<div class="col-sm-8">
<input name="havaProductTem" th:field="*{havaProductTem}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup>
<option value="">请选择</option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
</select>
</div>
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden />
</div>
<div class="form-group">
<label class="col-sm-3 control-label">加工方式:</label>
<div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8">
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8">
<input name="brand" th:field="*{brand}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8">
<textarea name="describe" class="form-control">[[*{describe}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库部门:</label>
<div class="col-sm-8">
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">照片:</label>
<div class="col-sm-8">
<el-upload
:action="fileUploadUrl"
:on-success="uploadSuccess"
:on-remove="uploadRemove"
:file-list="fileList"
list-type="picture"
accept=".jpg,.png"
multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div>
</el-upload>
</div>
<input id="photoAttachId" name = "photoAttachId" hidden th:field="*{photoAttachId}">
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden>
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: function() {
return {
fileList: [],
fileUploadUrl: ctx + "common/uploadSingleFile",
fileDeleteUrl: ctx + "common/deleteFile",
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId",
fileIdList:[],
removeFileIdList:[],
}
},
mounted() {
// 控制下拉框选中
var materialType = $("#materialType").val();
$("#selectMaterialType").val(materialType).trigger("change");
var that = this;
// 页面渲染完成,可以执行需要的操作
console.log('页面已渲染完成');
console.log($("#id").val());
console.log($("#photoAttachId").val());
var attachId = $("#photoAttachId").val();
if(attachId){
$.ajax({
type: "get",
url: that.getListByAttachIdUrl,
data: {attachId:attachId},
cache: false,
async: false, // 设置成同步
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
result.data.forEach((item) => {
that.fileIdList.push(item.id);
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true});
});
} else {
$.modal.msgError(result.msg);
}
},
error: function(error) {
$.modal.msgError("获取附件失败。");
}
});
}
},
methods: {
uploadSuccess(response, file, fileList) {
console.log(response);
if(response.code == web_status.SUCCESS){
var attachFileId = response.data.id;
file.attachFileId = attachFileId;
file.isBind = false;
this.fileIdList.push(attachFileId);
$("#fileIdStr").val(this.fileIdList.join(";"));
$.modal.msgSuccess("上传成功");
}else{
$.modal.alertError(response.msg);
}
},
uploadRemove(file, fileList) {
console.log(file, fileList);
var attachFileId = file.attachFileId;
var isBind = file.isBind;
if(isBind==false){
$.ajax({
type: "get",
url: this.fileDeleteUrl,
data: {id:attachFileId},
cache: false,
async: false, // 设置成同步
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
var index = this.fileIdList.indexOf(attachFileId);
if(index!=-1){
this.fileIdList.splice(index,1);
$("#fileIdStr").val(this.fileIdList.join(";"));
}
$.modal.msgSuccess("删除附件成功。");
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertError("删除附件失败。");
}
});
}else{
var index = this.fileIdList.indexOf(attachFileId);
if(index!=-1){
this.fileIdList.splice(index,1);
$("#fileIdStr").val(this.fileIdList.join(";"));
// 保存的时候才删除
this.removeFileIdList.push(attachFileId);
$("#removeFileIdStr").val(this.removeFileIdList.join(";"));
}
}
},
}
})
var prefix = ctx + "erp/material";
$("#form-material-edit").validate({
onkeyup: false,
rules:{
materialNo:{
isInteger: true,
minlength: 10,
maxlength: 10,
remote: {
url: prefix + "/checkMaterialNoUnique",
type: "post",
dataType: "json",
data: {
"materialNo": function() {
console.log($("#materialNo").val())
return $.common.trim($("#materialNo").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
},
messages: {
"materialNo": {
remote: "料号已经存在",
minlength: "请输入10位整数",
maxlength: "请输入10位整数",
},
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType);
$.operate.save(prefix + "/edit", $('#form-material-edit').serialize());
}
}
</script>
</body>
</html>

13
ruoyi-admin/src/main/resources/templates/erp/material/material.html

@ -38,13 +38,17 @@
</li>
<li>
<label>是否有生产团队:</label>
<input type="text" name="havaProductTem"/>
<select name="createBy" th:with="type=${@dict.getType('havaProductTem')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>物料类型:</label>
<select name="materialType">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
<select id="selectMaterialType" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
</select>
</li>
<li class="select-time">
@ -127,6 +131,7 @@
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
detailUrl: prefix + "/edit/{id}",
modalName: "物料信息",
columns: [{
checkbox: true

6
ruoyi-admin/src/main/resources/templates/system/customer/add.html

@ -302,7 +302,11 @@
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" class="form-control" type="number">
<select id="taxRate" name="taxRate" class="form-control"
th:with="type=${@dict.getType('fin_customer_taxPercent')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group" hidden="hidden">

765
ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html

@ -24,13 +24,14 @@
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label"> 业务员 </label>
<div class="col-sm-8">
<input name="createBy" class="form-control" type="text" required>
<input name="createBy" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户编号</label>
<div class="col-sm-8">
<input name="customerCode" class="form-control" type="text" readonly >
<!-- <input name="customerCode" class="form-control" type="text" >-->
<select name="customerCode" class="form-control" ></select>
</div>
</div>
<div class="form-group" >
@ -39,6 +40,18 @@
<input name="customerName" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 是否含税:</label>
<div class="col-sm-8">
<input name="customerFax" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 税率:</label>
<div class="col-sm-8">
<input name="taxRate" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 报价币种:</label>
<div class="col-sm-8">
@ -52,38 +65,74 @@
<div class="form-group" >
<label class="col-sm-3 control-label"> 美元汇率:</label>
<div class="col-sm-8">
<input name="commonCurrency" class="form-control" type="text" >
<input name="usdTax" class="form-control" type="text" >
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 物料合计:</label>
<label class="col-sm-3 control-label"> 国内税率:</label>
<div class="col-sm-8">
<select id="countaxRate" name="countaxRate" class="form-control"
th:with="type=${@dict.getType('fin_customer_taxPercent')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="division">
<h3>计算</h3>
</div>
<div class="form-group" >
<label class="col-sm-2 control-label"> 物料合计:</label>
<div class="col-sm-8">
<input name="enterprise" class="form-control" type="text" >
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 数量合计:</label>
<label class="col-sm-2 control-label"> 数量合计:</label>
<div class="col-sm-8">
<input name="enterpriseSum" class="form-control" type="text" >
<input name="enterpriseSum" class="form-control" type="number" >
</div>
</div>
<div class="form-group" >
<label class="col-sm-2 control-label"> 不含税单价(RMB):</label>
<div class="col-sm-8">
<input name="noRmbNum" class="form-control" type="number">
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 含税单价(RMB):</label>
<div class="col-sm-8">
<input name="rmbNum" class="form-control" type="number" >
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 不含税总价(RMB):</label>
<div class="col-sm-8">
<input name="noRmbTax" class="form-control" type="text" readonly>
<input name="noRmbSum" class="form-control" type="number" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> 含税总价(RMB):</label>
<div class="col-sm-8">
<input name="rmbTax" class="form-control" type="text" readonly>
<input name="rmbSum" class="form-control" type="number" readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 不含税单价(美元):</label>
<div class="col-sm-8">
<input name="noUsdNum" class="form-control" type="number" required readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 不含税总价(美元):</label>
<div class="col-sm-8">
<input name="noUsbTax" class="form-control" type="text" required readonly>
<input name="noUsdSum" class="form-control" type="number" required readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"> 含税总价(美元):</label>
<div class="col-sm-8">
<input name="usdSum" class="form-control" type="number" required readonly>
</div>
</div>
<div class="form-group" hidden="hidden">
@ -96,10 +145,10 @@
</select>
</div>
</div>
<div class="form-group">
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label"> 删除标志</label>
<div class="col-sm-8">
<input name="del_flag" class="form-control" type="text" required >
<input name="del_flag" value="0" class="form-control" type="text" required >
</div>
</div>
<div class="form-group">
@ -110,6 +159,73 @@
</div>
</form>
</div>
<div class="other-container">
<div class="other">
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-primary" onclick="addFinish()">
<i class="fa fa-plus"></i> 添加物料
</a>
<a class="btn btn-primary" onclick="addFinish()">
<i class="fa fa-plus"></i> 添加无物料号物料
</a>
<!-- <a class="btn btn-success" onclick="confirmraw()">-->
<!-- <i class="fa fa-plus"></i> 确认添加-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="addFinishbomTable" style="white-space:nowrap"></table>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="addWuliaobomTable" style="white-space:nowrap"></table>
</div>
</div>
<div class="modal inmodal" id="FinishModal"
role="dilog" aria-hidden="true">
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF">
<div class="modal-content" style="background-color: #FFFFFF">
<div class="title">成品资料</div>
<div class="modal-body">
<div class="search">
<div class="col-sm-12 search-collapse">
<form id="formFinishSearch">
<div class="select-list">
<ul>
<li>
<label>成品代码:</label>
<input type="text" name="finishProductCode"/>
</li>
<li>
<label>成品名称:</label>
<input type="text" name="finishProductName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="finishSearch()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
</li>
</ul>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table id="FinishbomTable" class="table table-striped table-responsive"
style="padding-bottom: 50px; white-space:nowrap">
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="addFinishconfirm()">
确定
</button>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js" />
@ -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("<option value='" + customerodata[i].enterpriseCode + "'>" + customerodata[i].enterpriseCode + "</option>");
// $("select[name='enterpriseName']").append("<option value='" + customerodata[i].enterpriseName + "'>" + customerodata[i].enterpriseName + "</option>");
}
} 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("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
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('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="remove(\'' + row.finishProductCode + '\')" ><i class="fa fa-remove"></i>删除</a>');
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)
},
})
}
}
</script>
</body>
</html>

14
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: '含税总价(美元)'
},
{

Loading…
Cancel
Save