物料基本信息管理修改
This commit is contained in:
@@ -1,25 +1,31 @@
|
||||
package com.ruoyi.bas.BasProduct.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
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.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 物料管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
* 物料信息Controller
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/BasProduct")
|
||||
@@ -29,7 +35,7 @@ public class BasProductController extends BaseController
|
||||
private IBasProductService basProductService;
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
* 查询物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:list')")
|
||||
@GetMapping("/list")
|
||||
@@ -41,20 +47,20 @@ public class BasProductController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料管理列表
|
||||
* 导出物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:export')")
|
||||
@Log(title = "物料管理", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasProduct basProduct)
|
||||
{
|
||||
List<BasProduct> list = basProductService.selectBasProductList(basProduct);
|
||||
ExcelUtil<BasProduct> util = new ExcelUtil<BasProduct>(BasProduct.class);
|
||||
util.exportExcel(response, list, "物料管理数据");
|
||||
util.exportExcel(response, list, "物料信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料管理详细信息
|
||||
* 获取物料信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:query')")
|
||||
@GetMapping(value = "/{productGuid}")
|
||||
@@ -64,23 +70,21 @@ public class BasProductController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
* 新增物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:add')")
|
||||
@Log(title = "物料管理", businessType = BusinessType.INSERT)
|
||||
@Log(title = "物料信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasProduct basProduct)
|
||||
{
|
||||
// 使用雪花算法生成ID并转为字符串
|
||||
basProduct.setProductGuid(String.valueOf(IdUtil.getSnowflake().nextId()));
|
||||
return toAjax(basProductService.insertBasProduct(basProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
* 修改物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:edit')")
|
||||
@Log(title = "物料管理", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasProduct basProduct)
|
||||
{
|
||||
@@ -88,10 +92,10 @@ public class BasProductController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料管理
|
||||
* 删除物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProduct:remove')")
|
||||
@Log(title = "物料管理", businessType = BusinessType.DELETE)
|
||||
@Log(title = "物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{productGuids}")
|
||||
public AjaxResult remove(@PathVariable String[] productGuids)
|
||||
{
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.ruoyi.bas.BasProduct.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 物料管理对象 bas_product
|
||||
* 物料信息对象 bas_product
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BasProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -21,85 +25,66 @@ public class BasProduct extends BaseEntity
|
||||
private String productGuid;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "${bas.Product.productId}")
|
||||
@Excel(name = "物料编码")
|
||||
private String productId;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "${bas.Product.productName}")
|
||||
@Excel(name = "物料名称")
|
||||
private String productName;
|
||||
|
||||
/** 英文描述 */
|
||||
@Excel(name = "${bas.Product.spare1}")
|
||||
private String spare1;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "${bas.Product.unit}")
|
||||
private String unit;
|
||||
|
||||
/** 单件净重KG */
|
||||
@Excel(name = "${bas.Product.spare2}")
|
||||
private String spare2;
|
||||
|
||||
/** 长MM */
|
||||
@Excel(name = "${bas.Product.spare5}")
|
||||
private String spare5;
|
||||
|
||||
/** 宽MM */
|
||||
@Excel(name = "${bas.Product.spare6}")
|
||||
private String spare6;
|
||||
|
||||
/** 高MM */
|
||||
@Excel(name = "${bas.Product.spare7}")
|
||||
private String spare7;
|
||||
|
||||
/** 体积m³ */
|
||||
@Excel(name = "${bas.Product.spare8}")
|
||||
private String spare8;
|
||||
|
||||
/** 价格 */
|
||||
@Excel(name = "${bas.Product.price}")
|
||||
private String price;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "${bas.Product.remark}")
|
||||
private String remark;
|
||||
|
||||
/** 父节点id */
|
||||
// @Excel(name = "${bas.Product.parentId}")
|
||||
private String parentId;
|
||||
|
||||
/** 品牌 */
|
||||
// @Excel(name = "${bas.Product.cargoNo}")
|
||||
private String cargoNo;
|
||||
|
||||
/** 规格 */
|
||||
// @Excel(name = "${bas.Product.spec}")
|
||||
private String spec;
|
||||
|
||||
/** 备用字段3 */
|
||||
// @Excel(name = "${bas.Product.spare3}")
|
||||
private String spare3;
|
||||
|
||||
/** 备用字段4 */
|
||||
// @Excel(name = "${bas.Product.spare4}")
|
||||
/** 序列号 */
|
||||
@Excel(name = "序列号")
|
||||
private String spare4;
|
||||
|
||||
/** 相位 */
|
||||
@Excel(name = "相位")
|
||||
private String spare7;
|
||||
|
||||
/** 备用字段6 */
|
||||
// @Excel(name = "${bas.Product.spare9}")
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
private String spare1;
|
||||
|
||||
/** 净重 */
|
||||
@Excel(name = "净重")
|
||||
private String spare2;
|
||||
|
||||
/** 毛重 */
|
||||
@Excel(name = "毛重")
|
||||
private String spare8;
|
||||
|
||||
/** 颜色 */
|
||||
@Excel(name = "颜色")
|
||||
private String spare3;
|
||||
|
||||
/** 电压 */
|
||||
@Excel(name = "电压")
|
||||
private String spare5;
|
||||
|
||||
/** 功率 */
|
||||
@Excel(name = "功率")
|
||||
private String spare6;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String parentId;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String price;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String cargoNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String unit;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String spec;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String spare9;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String quantity;
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
|
||||
private String lotNo;
|
||||
|
||||
private String totalNetWeight;
|
||||
private String netWeight;
|
||||
private String grossWeight;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,74 +1,61 @@
|
||||
package com.ruoyi.bas.BasProduct.mapper;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
|
||||
/**
|
||||
* 物料管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
* 物料信息Mapper接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
*/
|
||||
public interface BasProductMapper
|
||||
public interface BasProductMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料管理
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
public BasProduct selectBasProductByProductGuid(String productGuid);
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理集合
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 物料信息集合
|
||||
*/
|
||||
public List<BasProduct> selectBasProductList(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProduct(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProduct(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 删除物料管理
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* 删除物料信息
|
||||
*
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuid(String productGuid);
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
*
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param productGuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuids(String[] productGuids);
|
||||
|
||||
/**
|
||||
* 通过物料id列表批量查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(@Param("productGuids") List<String> collect);
|
||||
|
||||
BasProduct selectBasProductByProductId(String productId);
|
||||
|
||||
List<BasProduct> selectBasProductListByProductIds(@Param("productIds") List<String> collect);
|
||||
}
|
||||
|
||||
@@ -1,73 +1,65 @@
|
||||
package com.ruoyi.bas.BasProduct.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
* 物料信息Service接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
*/
|
||||
public interface IBasProductService
|
||||
public interface IBasProductService
|
||||
{
|
||||
/**
|
||||
* 查询物料管理
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
public BasProduct selectBasProductByProductGuid(String productGuid);
|
||||
|
||||
public BasProduct selectBasProductByProductId(String productId);
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理集合
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 物料信息集合
|
||||
*/
|
||||
public List<BasProduct> selectBasProductList(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProduct(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProduct(BasProduct basProduct);
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
*
|
||||
* @param productGuids 需要删除的物料管理主键集合
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param productGuids 需要删除的物料信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuids(String[] productGuids);
|
||||
|
||||
/**
|
||||
* 删除物料管理信息
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* 删除物料信息信息
|
||||
*
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductByProductGuid(String productGuid);
|
||||
|
||||
/**
|
||||
* 通过物料id列表查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(List<String> collect);
|
||||
BasProduct selectBasProductByProductId(String productId);
|
||||
|
||||
List<BasProduct> selectBasProductListByProductIds(List<String> collect);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package com.ruoyi.bas.BasProduct.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
|
||||
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||
|
||||
/**
|
||||
* 物料管理Service业务层处理
|
||||
* 物料信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-20
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
*/
|
||||
@Service
|
||||
public class BasProductServiceImpl implements IBasProductService
|
||||
@@ -23,10 +20,10 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
private BasProductMapper basProductMapper;
|
||||
|
||||
/**
|
||||
* 查询物料管理
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @return 物料管理
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
@Override
|
||||
public BasProduct selectBasProductByProductGuid(String productGuid)
|
||||
@@ -34,16 +31,11 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
return basProductMapper.selectBasProductByProductGuid(productGuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasProduct selectBasProductByProductId(String productId) {
|
||||
return basProductMapper.selectBasProductByProductId(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @return 物料管理
|
||||
* @param basProduct 物料信息
|
||||
* @return 物料信息
|
||||
*/
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductList(BasProduct basProduct)
|
||||
@@ -52,9 +44,9 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料管理
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -64,9 +56,9 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料管理
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param basProduct 物料管理
|
||||
* @param basProduct 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -76,9 +68,9 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料管理
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param productGuids 需要删除的物料管理主键
|
||||
* @param productGuids 需要删除的物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -88,9 +80,9 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料管理信息
|
||||
* 删除物料信息信息
|
||||
*
|
||||
* @param productGuid 物料管理主键
|
||||
* @param productGuid 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -98,24 +90,14 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
{
|
||||
return basProductMapper.deleteBasProductByProductGuid(productGuid);
|
||||
}
|
||||
/**
|
||||
* 通过物料id列表查询物料信息
|
||||
* @param collect
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductListByProductGuids(List<String> collect) {
|
||||
if (CollUtil.isEmpty(collect)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return basProductMapper.selectBasProductListByProductGuids(collect);
|
||||
public BasProduct selectBasProductByProductId(String productId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductListByProductIds(List<String> collect) {
|
||||
if (CollUtil.isEmpty(collect)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return basProductMapper.selectBasProductListByProductIds(collect);
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,142 +3,117 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.bas.BasProduct.mapper.BasProductMapper">
|
||||
|
||||
|
||||
<resultMap type="BasProduct" id="BasProductResult">
|
||||
<result property="productGuid" column="product_guid" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare7" column="spare7" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare8" column="spare8" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="spare6" column="spare6" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="cargoNo" column="cargo_no" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="spare6" column="spare6" />
|
||||
<result property="spare7" column="spare7" />
|
||||
<result property="spare8" column="spare8" />
|
||||
<result property="spare9" column="spare9" />
|
||||
<result property="productName" column="product_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasProductVo">
|
||||
select product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9 from bas_product
|
||||
select product_guid, product_id, product_name, spare4, spare7, spare1, spare2, spare8, spare3, spare5, spare6, remark, parent_id, price, cargo_no, unit, spec, spare9 from bas_product
|
||||
</sql>
|
||||
|
||||
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
<where>
|
||||
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id like concat('%', #{parentId}, '%')</if>
|
||||
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
|
||||
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
|
||||
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
|
||||
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and spare6 like concat('%', #{spare6}, '%')</if>
|
||||
<if test="spare7 != null and spare7 != ''"> and spare7 like concat('%', #{spare7}, '%')</if>
|
||||
<if test="spare8 != null and spare8 != ''"> and spare8 like concat('%', #{spare8}, '%')</if>
|
||||
<if test="spare9 != null and spare9 != ''"> and spare9 like concat('%', #{spare9}, '%')</if>
|
||||
<where>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
||||
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBasProductByProductGuid" parameterType="String" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_guid = #{productGuid}
|
||||
</select>
|
||||
<select id="selectBasProductListByProductGuids" resultMap="BasProductResult">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_guid in
|
||||
<foreach collection="productGuids" item="productGuid" open="(" separator="," close=")">
|
||||
#{productGuid}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectBasProductByProductId" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
<select id="selectBasProductListByProductIds" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
|
||||
<include refid="selectBasProductVo"/>
|
||||
where product_id in
|
||||
<foreach collection="productIds" item="productId" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertBasProduct" parameterType="BasProduct">
|
||||
insert into bas_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="productId != null and productId != ''">product_id,</if>
|
||||
<if test="parentId != null and parentId != ''">parent_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare7 != null">spare7,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare8 != null">spare8,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="cargoNo != null">cargo_no,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="spec != null">spec,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
<if test="spare7 != null">spare7,</if>
|
||||
<if test="spare8 != null">spare8,</if>
|
||||
<if test="spare9 != null">spare9,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="productId != null and productId != ''">#{productId},</if>
|
||||
<if test="parentId != null and parentId != ''">#{parentId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare7 != null">#{spare7},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare8 != null">#{spare8},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="cargoNo != null">#{cargoNo},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="spec != null">#{spec},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
<if test="spare7 != null">#{spare7},</if>
|
||||
<if test="spare8 != null">#{spare8},</if>
|
||||
<if test="spare9 != null">#{spare9},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasProduct" parameterType="BasProduct">
|
||||
update bas_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null and productId != ''">product_id = #{productId},</if>
|
||||
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="spare7 != null">spare7 = #{spare7},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare8 != null">spare8 = #{spare8},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="spec != null">spec = #{spec},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||
<if test="spare7 != null">spare7 = #{spare7},</if>
|
||||
<if test="spare8 != null">spare8 = #{spare8},</if>
|
||||
<if test="spare9 != null">spare9 = #{spare9},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
</trim>
|
||||
where product_guid = #{productGuid}
|
||||
</update>
|
||||
@@ -148,9 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasProductByProductGuids" parameterType="String">
|
||||
delete from bas_product where product_guid in
|
||||
delete from bas_product where product_guid in
|
||||
<foreach item="productGuid" collection="array" open="(" separator="," close=")">
|
||||
#{productGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物料管理列表
|
||||
// 查询物料信息列表
|
||||
export function listBasProduct(query) {
|
||||
return request({
|
||||
url: '/bas/BasProduct/list',
|
||||
@@ -9,7 +9,7 @@ export function listBasProduct(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物料管理详细
|
||||
// 查询物料信息详细
|
||||
export function getBasProduct(productGuid) {
|
||||
return request({
|
||||
url: '/bas/BasProduct/' + productGuid,
|
||||
@@ -17,7 +17,7 @@ export function getBasProduct(productGuid) {
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物料管理
|
||||
// 新增物料信息
|
||||
export function addBasProduct(data) {
|
||||
return request({
|
||||
url: '/bas/BasProduct',
|
||||
@@ -26,7 +26,7 @@ export function addBasProduct(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物料管理
|
||||
// 修改物料信息
|
||||
export function updateBasProduct(data) {
|
||||
return request({
|
||||
url: '/bas/BasProduct',
|
||||
@@ -35,7 +35,7 @@ export function updateBasProduct(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物料管理
|
||||
// 删除物料信息
|
||||
export function delBasProduct(productGuid) {
|
||||
return request({
|
||||
url: '/bas/BasProduct/' + productGuid,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="物料编号" prop="productId">
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入物料编号"
|
||||
placeholder="请输入物料编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@@ -17,34 +17,66 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="英文描述" prop="spare1">
|
||||
<el-form-item label="序列号" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入序列号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="相位" prop="spare7">
|
||||
<el-input
|
||||
v-model="queryParams.spare7"
|
||||
placeholder="请输入相位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="型号" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入英文描述"
|
||||
placeholder="请输入型号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-form-item label="净重" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入单位"
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="请输入净重"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格" prop="price">
|
||||
<el-form-item label="毛重" prop="spare8">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入价格"
|
||||
v-model="queryParams.spare8"
|
||||
placeholder="请输入毛重"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-form-item label="颜色" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入描述"
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="请输入颜色"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电压" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入电压"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="功率" prop="spare6">
|
||||
<el-input
|
||||
v-model="queryParams.spare6"
|
||||
placeholder="请输入功率"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@@ -101,20 +133,21 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasProductList" @selection-change="handleSelectionChange" max-height="650">
|
||||
<el-table v-loading="loading" :data="BasProductList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物料编号" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="英文描述" align="left" prop="spare1" />
|
||||
<el-table-column label="单位" align="left" prop="unit" />
|
||||
<el-table-column label="净重(KG)" align="right" prop="spare2" />
|
||||
<el-table-column label="长度(MM)" align="right" prop="spare5" />
|
||||
<el-table-column label="宽度(MM)" align="right" prop="spare6" />
|
||||
<el-table-column label="高度(MM)" align="right" prop="spare7"/>
|
||||
<el-table-column label="体积(m³)" align="right" prop="spare8" />
|
||||
<el-table-column label="价格" align="right" prop="price" />
|
||||
<el-table-column label="描述" align="left" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
||||
<el-table-column label="主键" align="center" prop="productGuid" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" />
|
||||
<el-table-column label="序列号" align="center" prop="spare4" />
|
||||
<el-table-column label="相位" align="center" prop="spare7" />
|
||||
<el-table-column label="型号" align="center" prop="spare1" />
|
||||
<el-table-column label="净重" align="center" prop="spare2" />
|
||||
<el-table-column label="毛重" align="center" prop="spare8" />
|
||||
<el-table-column label="颜色" align="center" prop="spare3" />
|
||||
<el-table-column label="电压" align="center" prop="spare5" />
|
||||
<el-table-column label="功率" align="center" prop="spare6" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@@ -133,7 +166,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
@@ -142,46 +175,46 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- Add or Edit Product Dialog -->
|
||||
<!-- 添加或修改物料信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px" style="max-height: 500px; overflow-y: auto;">
|
||||
<el-form-item label="物料编号" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入物料编号" />
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="英文描述" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入英文描述" />
|
||||
<el-form-item label="序列号" prop="spare4">
|
||||
<el-input v-model="form.spare4" placeholder="请输入序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
<el-form-item label="相位" prop="spare7">
|
||||
<el-input v-model="form.spare7" placeholder="请输入相位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="净重(KG)" prop="spare2">
|
||||
<el-form-item label="型号" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="净重" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入净重" />
|
||||
</el-form-item>
|
||||
<el-form-item label="长度(MM)" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入长度" />
|
||||
<el-form-item label="毛重" prop="spare8">
|
||||
<el-input v-model="form.spare8" placeholder="请输入毛重" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度(MM)" prop="spare6">
|
||||
<el-input v-model="form.spare6" placeholder="请输入宽度" />
|
||||
<el-form-item label="颜色" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="请输入颜色" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高度(MM)" prop="spare7">
|
||||
<el-input v-model="form.spare7" placeholder="请输入高度" />
|
||||
<el-form-item label="电压" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="体积(m³)" prop="spare8">
|
||||
<el-input v-model="form.spare8" placeholder="请输入体积" />
|
||||
<el-form-item label="功率" prop="spare6">
|
||||
<el-input v-model="form.spare6" placeholder="请输入功率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="价格" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入价格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入描述" />
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -206,7 +239,7 @@ export default {
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料管理表格数据
|
||||
// 物料信息表格数据
|
||||
BasProductList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
@@ -217,74 +250,28 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
productId: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
remark: null,
|
||||
productName: null,
|
||||
spare4: null,
|
||||
spare7: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare8: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
productName: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
productId: [
|
||||
{ required: true, message: "请输入物料编号", trigger: "blur" }
|
||||
],
|
||||
productName: [
|
||||
{ required: true, message: "请输入物料名称", trigger: "blur" }
|
||||
],
|
||||
unit: [
|
||||
{ required: true, message: "请输入单位", trigger: "blur" }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: "请输入价格", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'form.spare2': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
// 单件净重变化时,自动计算总净重
|
||||
const netWeight = parseFloat(val || 0);
|
||||
this.form.spare8 = netWeight.toString();
|
||||
// 如果毛重小于净重,自动更新毛重
|
||||
const grossWeight = parseFloat(this.form.spare9 || 0);
|
||||
if (grossWeight < netWeight) {
|
||||
this.form.spare9 = netWeight.toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
'form.spare8': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
// 总净重变化时,如果毛重小于净重,自动更新毛重
|
||||
const netWeight = parseFloat(val || 0);
|
||||
const grossWeight = parseFloat(this.form.spare9 || 0);
|
||||
if (grossWeight < netWeight) {
|
||||
this.form.spare9 = netWeight.toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询物料管理列表 */
|
||||
/** 查询物料信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasProduct(this.queryParams).then(response => {
|
||||
@@ -304,18 +291,21 @@ export default {
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
spare1: null,
|
||||
unit: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare7: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare8: null,
|
||||
spare3: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
spare7: null,
|
||||
spare8: null,
|
||||
spare9: null,
|
||||
remark: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
remark: null
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
spare9: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
@@ -339,7 +329,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加物料"
|
||||
this.title = "添加物料信息"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@@ -348,7 +338,7 @@ export default {
|
||||
getBasProduct(productGuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改物料"
|
||||
this.title = "修改物料信息"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@@ -363,7 +353,7 @@ export default {
|
||||
})
|
||||
} else {
|
||||
addBasProduct(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
@@ -374,7 +364,7 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const productGuids = row.productGuid || this.ids
|
||||
this.$modal.confirm("是否确认删除所选物料?").then(function() {
|
||||
this.$modal.confirm('是否确认删除物料信息编号为"' + productGuids + '"的数据项?').then(function() {
|
||||
return delBasProduct(productGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
|
||||
Reference in New Issue
Block a user