Merge remote-tracking branch 'origin/master'

master
夜笙歌 9 months ago
commit 96afc3985f

@ -22,8 +22,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
private Long barcodeId;
/** 打印时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "打印时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "打印时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date printTime;
/** 打印人 */
@ -31,15 +31,20 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String printPerson;
/** 批次标识(0否1是);在打印时,如果物料已设置,则根据物料的批次信息,如果没有设置则在此需要选择,选择物料等信息保存后同步设置物料信息。 */
@Excel(name = "批次标识(0否1是);在打印时,如果物料已设置,则根据物料的批次信息,如果没有设置则在此需要选择,选择物料等信息保存后同步设置物料信息。")
@Excel(name = "批次标识")
private String batchFlag;
/**
* (01)
*/
@Excel(name = "打印标识")
private String printFlag;
/** 条码类型1原材料,2半成品,3成品,4背板 */
@Excel(name = "条码类型", readConverterExp = "1=原材料,2半成品,3成品,4背板")
private String barcodeType;
/** 条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同 */
@Excel(name = "条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同")
@Excel(name = "条码内容")
private String barcodeInfo;
/** 批次代码 */
@ -51,7 +56,7 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String palletInfoCode;
/** 物料ID关联mes_base_material_info的material_id */
@Excel(name = "物料ID关联mes_base_material_info的material_id")
@Excel(name = "物料ID")
private Long materialId;
/** 供应商ID */
@ -66,39 +71,43 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "打印机台名称,打印时获取")
private String machineName;
/** 打印次数 */
@Excel(name = "打印次数")
private Long printNumber;
/** 采购订单号;适合原材料入库时 */
@Excel(name = "采购订单号;适合原材料入库时")
@Excel(name = "采购订单号")
private String poNo;
/** 生产日期;打印时根据领料单选择输入 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产日期;打印时根据领料单选择输入", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productionDate;
/** 接受日期;打印时的系统日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "接受日期;打印时的系统日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "接受日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date acceptedDate;
/** 最晚出库日期;可以直接输入,也可以根据日限计算 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最晚出库日期;可以直接输入,也可以根据日限计算", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最晚出库日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastOutstockDate;
/** 生产计划编号关联mes_pd_product_plan的plan_code;适合生产出入库等 */
@Excel(name = "生产计划编号关联mes_pd_product_plan的plan_code;适合生产出入库等")
@Excel(name = "生产计划编号")
private String planCode;
/** 生产计划明细编号关联mes_product_plan_detail的plan_detail_code;适合生产出入库等 */
@Excel(name = "生产计划明细编号关联mes_product_plan_detail的plan_detail_code;适合生产出入库等")
@Excel(name = "生产计划明细编号")
private String planDetailCode;
/** 销售订单编号;适合生产出入库等 */
@Excel(name = "销售订单ID;适合生产出入库等")
@Excel(name = "销售订单ID")
private String saleOrderId;
/** 销售订单编号;适合生产出入库等 */
@Excel(name = "销售订单编号;适合生产出入库等")
@Excel(name = "销售订单编号")
private String saleorderCode;
/** 项目号 */
@ -110,7 +119,7 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String serialNumber;
/** 绑定状态(1绑定0解绑) */
@Excel(name = "绑定状态(1绑定0解绑)")
@Excel(name = "绑定状态")
private String bindStatus;
/** 绑定托盘的人 */
@ -118,10 +127,26 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String bindBy;
/** 绑定托盘时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "绑定托盘时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "绑定托盘时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date bindTime;
public String getPrintFlag() {
return printFlag;
}
public void setPrintFlag(String printFlag) {
this.printFlag = printFlag;
}
public Long getPrintNumber() {
return printNumber;
}
public void setPrintNumber(Long printNumber) {
this.printNumber = printNumber;
}
public void setBarcodeId(Long barcodeId)
{
this.barcodeId = barcodeId;

@ -49,6 +49,10 @@ public class MesBaseMaterialInfo extends BaseEntity
@Excel(name = "物料类型关联mes_base_material_type的material_type_id")
private Long materialTypeId;
/** 物料类型名称 */
@Excel(name = "物料类型名称")
private String materialTypeName;
/** 批次标识,(0否1是) */
@Excel(name = "批次标识,(0否1是)")
private String batchFlag;
@ -112,6 +116,15 @@ public class MesBaseMaterialInfo extends BaseEntity
private Date erpModifyDate;
private Long warehouseId;
public String getMaterialTypeName() {
return materialTypeName;
}
public void setMaterialTypeName(String materialTypeName) {
this.materialTypeName = materialTypeName;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;

@ -126,7 +126,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
return;
}
MesProductOrder productOrder = new MesProductOrder();
mesProductOrder.setSaleOrderId(mesProductOrder.getSaleOrderId());
productOrder.setSaleOrderId(mesProductOrder.getSaleOrderId());
List<MesProductOrder> mesProductOrders = mesProductOrderMapper.selectMesProductOrderList(productOrder);
BigDecimal sumDecimal = new BigDecimal(0);
if (StringUtils.isNotNull(mesProductOrders)) {

@ -1,70 +1,109 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.MesBaseBarcodeInfoMapper">
<resultMap type="MesBaseBarcodeInfo" id="MesBaseBarcodeInfoResult">
<result property="barcodeId" column="barcode_id" />
<result property="printTime" column="print_time" />
<result property="printPerson" column="print_person" />
<result property="batchFlag" column="batch_flag" />
<result property="barcodeType" column="barcode_type" />
<result property="barcodeInfo" column="barcode_info" />
<result property="batchCode" column="batch_code" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="materialId" column="material_id" />
<result property="manufacturerId" column="manufacturer_id" />
<result property="amount" column="amount" />
<result property="machineName" column="machine_name" />
<result property="poNo" column="po_no" />
<result property="productionDate" column="production_date" />
<result property="acceptedDate" column="accepted_date" />
<result property="lastOutstockDate" column="last_outstock_date" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="projectNo" column="project_no" />
<result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" />
<result property="bindStatus" column="bind_status" />
<result property="bindBy" column="bind_by" />
<result property="bindTime" column="bind_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="barcodeId" column="barcode_id"/>
<result property="printTime" column="print_time"/>
<result property="printPerson" column="print_person"/>
<result property="printFlag" column="print_flag"/>
<result property="batchFlag" column="batch_flag"/>
<result property="barcodeType" column="barcode_type"/>
<result property="barcodeInfo" column="barcode_info"/>
<result property="batchCode" column="batch_code"/>
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="materialId" column="material_id"/>
<result property="manufacturerId" column="manufacturer_id"/>
<result property="amount" column="amount"/>
<result property="machineName" column="machine_name"/>
<result property="printNumber" column="print_number"/>
<result property="poNo" column="po_no"/>
<result property="productionDate" column="production_date"/>
<result property="acceptedDate" column="accepted_date"/>
<result property="lastOutstockDate" column="last_outstock_date"/>
<result property="planCode" column="plan_code"/>
<result property="planDetailCode" column="plan_detail_code"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="projectNo" column="project_no"/>
<result property="serialNumber" column="serial_number"/>
<result property="remark" column="remark"/>
<result property="bindStatus" column="bind_status"/>
<result property="bindBy" column="bind_by"/>
<result property="bindTime" column="bind_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectMesBaseBarcodeInfoVo">
select barcode_id, print_time, print_person, batch_flag, barcode_type, barcode_info, batch_code, pallet_info_code, material_id, manufacturer_id, amount, machine_name, po_no, production_date, accepted_date, last_outstock_date, plan_code, plan_detail_code, sale_order_id, saleorder_code, project_no, serial_number, remark, bind_status, bind_by, bind_time, update_by, update_time from mes_base_barcode_info
select barcode_id,
print_time,
print_person,
batch_flag,
barcode_type,
barcode_info,
batch_code,
pallet_info_code,
material_id,
manufacturer_id,
amount,
machine_name,
print_number,
po_no,
production_date,
accepted_date,
last_outstock_date,
plan_code,
plan_detail_code,
sale_order_id,
saleorder_code,
project_no,
print_flag,
serial_number,
remark,
bind_status,
bind_by,
bind_time,
update_by,
update_time
from mes_base_barcode_info
</sql>
<select id="selectMesBaseBarcodeInfoList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
<where>
<if test="printTime != null "> and print_time = #{printTime}</if>
<if test="printPerson != null and printPerson != ''"> and print_person = #{printPerson}</if>
<if test="batchFlag != null and batchFlag != ''"> and batch_flag = #{batchFlag}</if>
<if test="barcodeType != null and barcodeType != ''"> and barcode_type = #{barcodeType}</if>
<if test="barcodeInfo != null and barcodeInfo != ''"> and barcode_info = #{barcodeInfo}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="palletInfoCode != null and palletInfoCode != ''"> and pallet_info_code = #{palletInfoCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="manufacturerId != null "> and manufacturer_id = #{manufacturerId}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="productionDate != null "> and production_date = #{productionDate}</if>
<if test="acceptedDate != null "> and accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null "> and last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="bindStatus != null and bindStatus != ''"> and bind_status = #{bindStatus}</if>
<if test="bindBy != null and bindBy != ''"> and bind_by = #{bindBy}</if>
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
<if test="printTime != null ">and print_time = #{printTime}</if>
<if test="printPerson != null and printPerson != ''">and print_person = #{printPerson}</if>
<if test="printFlag != null and printFlag != ''">and print_flag = #{printFlag}</if>
<if test="batchFlag != null and batchFlag != ''">and batch_flag = #{batchFlag}</if>
<if test="barcodeType != null and barcodeType != ''">and barcode_type = #{barcodeType}</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and barcode_info = #{barcodeInfo}</if>
<if test="batchCode != null and batchCode != ''">and batch_code = #{batchCode}</if>
<if test="palletInfoCode != null and palletInfoCode != ''">and pallet_info_code = #{palletInfoCode}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="manufacturerId != null ">and manufacturer_id = #{manufacturerId}</if>
<if test="amount != null ">and amount = #{amount}</if>
<if test="machineName != null and machineName != ''">and machine_name like concat('%', #{machineName},
'%')
</if>
<if test="printNumber != null ">and print_number = #{printNumber}</if>
<if test="poNo != null and poNo != ''">and po_no = #{poNo}</if>
<if test="productionDate != null ">and production_date = #{productionDate}</if>
<if test="acceptedDate != null ">and accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null ">and last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''">and plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''">and plan_detail_code = #{planDetailCode}</if>
<if test="saleOrderId != null ">and sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''">and saleorder_code = #{saleorderCode}</if>
<if test="projectNo != null and projectNo != ''">and project_no = #{projectNo}</if>
<if test="serialNumber != null and serialNumber != ''">and serial_number = #{serialNumber}</if>
<if test="bindStatus != null and bindStatus != ''">and bind_status = #{bindStatus}</if>
<if test="bindBy != null and bindBy != ''">and bind_by = #{bindBy}</if>
<if test="bindTime != null ">and bind_time = #{bindTime}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateTime != null ">and update_time = #{updateTime}</if>
</where>
</select>
@ -73,11 +112,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where barcode_id = #{barcodeId}
</select>
<insert id="insertMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo" useGeneratedKeys="true" keyProperty="barcodeId">
<insert id="insertMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo" useGeneratedKeys="true"
keyProperty="barcodeId">
insert into mes_base_barcode_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="printTime != null">print_time,</if>
<if test="printPerson != null">print_person,</if>
<if test="printFlag != null and printFlag != ''">print_flag,</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag,</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type,</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
@ -87,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="manufacturerId != null">manufacturer_id,</if>
<if test="amount != null">amount,</if>
<if test="machineName != null">machine_name,</if>
<if test="printNumber != null">print_number,</if>
<if test="poNo != null">po_no,</if>
<if test="productionDate != null">production_date,</if>
<if test="acceptedDate != null">accepted_date,</if>
@ -107,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="printTime != null">#{printTime},</if>
<if test="printPerson != null">#{printPerson},</if>
<if test="printFlag != null and printFlag != ''">#{printFlag},</if>
<if test="batchFlag != null and batchFlag != ''">#{batchFlag},</if>
<if test="barcodeType != null and barcodeType != ''">#{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
@ -116,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="manufacturerId != null">#{manufacturerId},</if>
<if test="amount != null">#{amount},</if>
<if test="machineName != null">#{machineName},</if>
<if test="printNumber != null">#{printNumber},</if>
<if test="poNo != null">#{poNo},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="acceptedDate != null">#{acceptedDate},</if>
@ -141,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="printTime != null">print_time = #{printTime},</if>
<if test="printPerson != null">print_person = #{printPerson},</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag = #{batchFlag},</if>
<if test="printFlag != null and printFlag != ''">print_flag = #{printFlag},</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type = #{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if>
@ -149,12 +194,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="manufacturerId != null">manufacturer_id = #{manufacturerId},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="machineName != null">machine_name = #{machineName},</if>
<if test="printNumber != null">print_number = #{printNumber},</if>
<if test="poNo != null">po_no = #{poNo},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="acceptedDate != null">accepted_date = #{acceptedDate},</if>
<if test="lastOutstockDate != null">last_outstock_date = #{lastOutstockDate},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
@ -169,7 +216,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteMesBaseBarcodeInfoByBarcodeId" parameterType="Long">
delete from mes_base_barcode_info where barcode_id = #{barcodeId}
delete
from mes_base_barcode_info
where barcode_id = #{barcodeId}
</delete>
<delete id="deleteMesBaseBarcodeInfoByBarcodeIds" parameterType="String">
@ -179,12 +228,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectMesBaseBarcodeInfoByBarcodeInfo" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where barcode_info = #{barcodeInfo} limit 1
</select>
</mapper>
</mapper>

@ -13,6 +13,7 @@
<result property="materialCategories" column="material_categories"/>
<result property="materialSubclass" column="material_subclass"/>
<result property="materialTypeId" column="material_type_id"/>
<result property="materialTypeName" column="material_type_name"/>
<result property="batchFlag" column="batch_flag"/>
<result property="materialUnitId" column="material_unit_id"/>
<result property="materialUnit" column="material_unit"/>
@ -37,76 +38,78 @@
</resultMap>
<sql id="selectMesBaseMaterialInfoVo">
select material_id,
erp_id,
material_code,
old_material_code,
material_name,
material_categories,
material_subclass,
material_type_id,
batch_flag,
material_unit_id,
material_unit,
material_matkl,
material_spec,
net_weight,
gross_weight,
factory_id,
create_org_id,
use_org_id,
prodline_id,
active_flag,
deleted_flag,
remark,
create_by,
create_time,
update_by,
update_time,
approve_date,
erp_modify_date
from mes_base_material_info
select bmi.material_id,
bmi.erp_id,
bmi.material_code,
bmi.old_material_code,
bmi.material_name,
bmi.material_categories,
bmi.material_subclass,
bmi.material_type_id,
bmt.type_name material_type_name,
bmi.batch_flag,
bmi.material_unit_id,
bmi.material_unit,
bmi.material_matkl,
bmi.material_spec,
bmi.net_weight,
bmi.gross_weight,
bmi.factory_id,
bmi.create_org_id,
bmi.use_org_id,
bmi.prodline_id,
bmi.active_flag,
bmi.deleted_flag,
bmi.remark,
bmi.create_by,
bmi.create_time,
bmi.update_by,
bmi.update_time,
bmi.approve_date,
bmi.erp_modify_date
from mes_base_material_info bmi
left join mes_base_material_type bmt on bmt.matrial_type_id = bmi.material_type_id
</sql>
<select id="selectMesBaseMaterialInfoList" parameterType="MesBaseMaterialInfo"
resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
<where>
<if test="erpId != null ">and erp_id = #{erpId}</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="oldMaterialCode != null and oldMaterialCode != ''">and old_material_code = #{oldMaterialCode}
<if test="erpId != null ">and bmi.erp_id = #{erpId}</if>
<if test="materialCode != null and materialCode != ''">and bmi.material_code = #{materialCode}</if>
<if test="oldMaterialCode != null and oldMaterialCode != ''">and bmi.old_material_code = #{oldMaterialCode}
</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},
'%')
</if>
<if test="materialCategories != null and materialCategories != ''">and material_categories =
<if test="materialCategories != null and materialCategories != ''">and bmi.material_categories =
#{materialCategories}
</if>
<if test="materialSubclass != null and materialSubclass != ''">and material_subclass =
<if test="materialSubclass != null and materialSubclass != ''">and bmi.material_subclass =
#{materialSubclass}
</if>
<if test="materialTypeId != null ">and material_type_id = #{materialTypeId}</if>
<if test="batchFlag != null and batchFlag != ''">and batch_flag = #{batchFlag}</if>
<if test="materialUnitId != null ">and material_unit_id = #{materialUnitId}</if>
<if test="materialUnit != null and materialUnit != ''">and material_unit = #{materialUnit}</if>
<if test="materialMatkl != null and materialMatkl != ''">and material_matkl = #{materialMatkl}</if>
<if test="materialSpec != null and materialSpec != ''">and material_spec = #{materialSpec}</if>
<if test="netWeight != null ">and net_weight = #{netWeight}</if>
<if test="grossWeight != null ">and gross_weight = #{grossWeight}</if>
<if test="factoryId != null ">and factory_id = #{factoryId}</if>
<if test="createOrgId != null ">and create_org_id = #{createOrgId}</if>
<if test="useOrgId != null ">and use_org_id = #{useOrgId}</if>
<if test="prodlineId != null and prodlineId != ''">and prodline_id = #{prodlineId}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="deletedFlag != null and deletedFlag != ''">and deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and erp_modify_date = #{erpModifyDate}</if>
<if test="materialTypeId != null ">and bmi.material_type_id = #{materialTypeId}</if>
<if test="batchFlag != null and batchFlag != ''">and bmi.batch_flag = #{batchFlag}</if>
<if test="materialUnitId != null ">and bmi.material_unit_id = #{materialUnitId}</if>
<if test="materialUnit != null and materialUnit != ''">and bmi.material_unit = #{materialUnit}</if>
<if test="materialMatkl != null and materialMatkl != ''">and bmi.material_matkl = #{materialMatkl}</if>
<if test="materialSpec != null and materialSpec != ''">and bmi.material_spec = #{materialSpec}</if>
<if test="netWeight != null ">and bmi.net_weight = #{netWeight}</if>
<if test="grossWeight != null ">and bmi.gross_weight = #{grossWeight}</if>
<if test="factoryId != null ">and bmi.factory_id = #{factoryId}</if>
<if test="createOrgId != null ">and bmi.create_org_id = #{createOrgId}</if>
<if test="useOrgId != null ">and bmi.use_org_id = #{useOrgId}</if>
<if test="prodlineId != null and prodlineId != ''">and bmi.prodline_id = #{prodlineId}</if>
<if test="activeFlag != null and activeFlag != ''">and bmi.active_flag = #{activeFlag}</if>
<if test="deletedFlag != null and deletedFlag != ''">and bmi.deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and bmi.approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and bmi.erp_modify_date = #{erpModifyDate}</if>
</where>
</select>
<select id="selectMesBaseMaterialInfoByMaterialId" parameterType="Long" resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
where material_id = #{materialId}
where bmi.material_id = #{materialId}
</select>
<insert id="insertMesBaseMaterialInfo" parameterType="MesBaseMaterialInfo" useGeneratedKeys="true"
@ -229,7 +232,7 @@
<select id="selectMesBaseMaterialInfoListByMaterialIds" parameterType="String"
resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
where material_id in
where bmi.material_id in
<foreach item="materialId" collection="array" open="(" separator="," close=")">
#{materialId}
</foreach>

@ -18,6 +18,8 @@
<module>hw-tdengine</module>
<module>hw-wms</module>
<module>hw-mes</module>
<module>hw-qms</module>
<module>hw-printer</module>
</modules>
<artifactId>hw-modules</artifactId>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询条码信息列表
export function listBarcode(query) {
return request({
url: '/mes/barcode/list',
method: 'get',
params: query
})
}
// 查询条码信息详细
export function getBarcode(barcodeId) {
return request({
url: '/mes/barcode/' + barcodeId,
method: 'get'
})
}
// 新增条码信息
export function addBarcode(data) {
return request({
url: '/mes/barcode',
method: 'post',
data: data
})
}
// 修改条码信息
export function updateBarcode(data) {
return request({
url: '/mes/barcode',
method: 'put',
data: data
})
}
// 删除条码信息
export function delBarcode(barcodeId) {
return request({
url: '/mes/barcode/' + barcodeId,
method: 'delete'
})
}

@ -0,0 +1,744 @@
<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="printTime">
<el-date-picker clearable
v-model="queryParams.printTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择打印时间">
</el-date-picker>
</el-form-item>
<el-form-item label="打印人" prop="printPerson">
<el-input
v-model="queryParams.printPerson"
placeholder="请输入打印人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="条码类型" prop="barcodeType">
<el-select v-model="queryParams.barcodeType" placeholder="请选择条码类型" clearable>
<el-option
v-for="dict in dict.type.barcode_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="条码内容" prop="barcodeInfo">
<el-input
v-model="queryParams.barcodeInfo"
placeholder="请输入条码内容"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次代码" prop="batchCode">
<el-input
v-model="queryParams.batchCode"
placeholder="请输入批次代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="托盘RFID代码" prop="palletInfoCode">
<el-input
v-model="queryParams.palletInfoCode"
placeholder="请输入托盘RFID代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input
v-model="queryParams.materialId"
placeholder="请输入物料ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="供应商ID" prop="manufacturerId">
<el-input
v-model="queryParams.manufacturerId"
placeholder="请输入供应商ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数量" prop="amount">
<el-input
v-model="queryParams.amount"
placeholder="请输入数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印机台名称" prop="machineName">
<el-input
v-model="queryParams.machineName"
placeholder="请输入打印机台名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印次数" prop="printNumber">
<el-input
v-model="queryParams.printNumber"
placeholder="请输入打印次数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="采购订单号" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="queryParams.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="接受日期" prop="acceptedDate">
<el-date-picker clearable
v-model="queryParams.acceptedDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择接受日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
<el-date-picker clearable
v-model="queryParams.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<el-form-item label="生产计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入生产计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产计划明细编号" prop="planDetailCode">
<el-input
v-model="queryParams.planDetailCode"
placeholder="请输入生产计划明细编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单ID" prop="saleOrderId">
<el-input
v-model="queryParams.saleOrderId"
placeholder="请输入销售订单ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
placeholder="请输入销售订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目号" prop="projectNo">
<el-input
v-model="queryParams.projectNo"
placeholder="请输入项目号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="流水号" prop="serialNumber">
<el-input
v-model="queryParams.serialNumber"
placeholder="请输入流水号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="绑定状态" prop="bindStatus">
<el-select v-model="queryParams.bindStatus" placeholder="请选择绑定状态" clearable>
<el-option
v-for="dict in dict.type.bind_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="绑定托盘的人" prop="bindBy">
<el-input
v-model="queryParams.bindBy"
placeholder="请输入绑定托盘的人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="绑定托盘时间" prop="bindTime">
<el-date-picker clearable
v-model="queryParams.bindTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择绑定托盘时间">
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updateBy">
<el-input
v-model="queryParams.updateBy"
placeholder="请输入更新人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker clearable
v-model="queryParams.updateTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:barcode:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:barcode:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:barcode:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:barcode:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="barcodeId" v-if="columns[0].visible"/>
<el-table-column label="打印时间" align="center" prop="printTime" width="180" v-if="columns[1].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.printTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="打印人" align="center" prop="printPerson" v-if="columns[2].visible"/>
<el-table-column label="批次标识" align="center" prop="batchFlag" v-if="columns[3].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="条码类型" align="center" prop="barcodeType" v-if="columns[4].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</el-table-column>
<el-table-column label="条码内容" align="center" prop="barcodeInfo" v-if="columns[5].visible"/>
<el-table-column label="批次代码" align="center" prop="batchCode" v-if="columns[6].visible"/>
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" v-if="columns[7].visible"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[8].visible"/>
<el-table-column label="供应商ID" align="center" prop="manufacturerId" v-if="columns[9].visible"/>
<el-table-column label="数量" align="center" prop="amount" v-if="columns[10].visible"/>
<el-table-column label="打印机台名称" align="center" prop="machineName" v-if="columns[11].visible"/>
<el-table-column label="打印次数" align="center" prop="printNumber" v-if="columns[12].visible"/>
<el-table-column label="采购订单号" align="center" prop="poNo" v-if="columns[13].visible"/>
<el-table-column label="生产日期" align="center" prop="productionDate" width="180" v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="接受日期" align="center" prop="acceptedDate" width="180" v-if="columns[15].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.acceptedDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="最晚出库日期" align="center" prop="lastOutstockDate" width="180" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="生产计划编号" align="center" prop="planCode" v-if="columns[17].visible"/>
<el-table-column label="生产计划明细编号" align="center" prop="planDetailCode" v-if="columns[18].visible"/>
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[19].visible"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[20].visible"/>
<el-table-column label="项目号" align="center" prop="projectNo" v-if="columns[21].visible"/>
<el-table-column label="流水号" align="center" prop="serialNumber" v-if="columns[22].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[23].visible"/>
<el-table-column label="绑定状态" align="center" prop="bindStatus" v-if="columns[24].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.bind_status" :value="scope.row.bindStatus"/>
</template>
</el-table-column>
<el-table-column label="绑定托盘的人" align="center" prop="bindBy" v-if="columns[25].visible"/>
<el-table-column label="绑定托盘时间" align="center" prop="bindTime" width="180" v-if="columns[26].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.bindTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[27].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[28].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:barcode:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:barcode:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改条码信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="打印时间" prop="printTime">
<el-date-picker clearable
v-model="form.printTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择打印时间">
</el-date-picker>
</el-form-item>
<el-form-item label="打印人" prop="printPerson">
<el-input v-model="form.printPerson" placeholder="请输入打印人" />
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="条码类型" prop="barcodeType">
<el-radio-group v-model="form.barcodeType">
<el-radio
v-for="dict in dict.type.barcode_type"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="条码内容" prop="barcodeInfo">
<el-input v-model="form.barcodeInfo" placeholder="请输入条码内容" />
</el-form-item>
<el-form-item label="批次代码" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次代码" />
</el-form-item>
<el-form-item label="托盘RFID代码" prop="palletInfoCode">
<el-input v-model="form.palletInfoCode" placeholder="请输入托盘RFID代码" />
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
</el-form-item>
<el-form-item label="供应商ID" prop="manufacturerId">
<el-input v-model="form.manufacturerId" placeholder="请输入供应商ID" />
</el-form-item>
<el-form-item label="数量" prop="amount">
<el-input v-model="form.amount" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="打印机台名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入打印机台名称" />
</el-form-item>
<el-form-item label="打印次数" prop="printNumber">
<el-input v-model="form.printNumber" placeholder="请输入打印次数" />
</el-form-item>
<el-form-item label="采购订单号" prop="poNo">
<el-input v-model="form.poNo" placeholder="请输入采购订单号" />
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="form.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="接受日期" prop="acceptedDate">
<el-date-picker clearable
v-model="form.acceptedDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择接受日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
<el-date-picker clearable
v-model="form.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<el-form-item label="生产计划编号" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入生产计划编号" />
</el-form-item>
<el-form-item label="生产计划明细编号" prop="planDetailCode">
<el-input v-model="form.planDetailCode" placeholder="请输入生产计划明细编号" />
</el-form-item>
<el-form-item label="销售订单ID" prop="saleOrderId">
<el-input v-model="form.saleOrderId" placeholder="请输入销售订单ID" />
</el-form-item>
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-input v-model="form.saleorderCode" placeholder="请输入销售订单编号" />
</el-form-item>
<el-form-item label="项目号" prop="projectNo">
<el-input v-model="form.projectNo" placeholder="请输入项目号" />
</el-form-item>
<el-form-item label="流水号" prop="serialNumber">
<el-input v-model="form.serialNumber" placeholder="请输入流水号" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="绑定状态" prop="bindStatus">
<el-radio-group v-model="form.bindStatus">
<el-radio
v-for="dict in dict.type.bind_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="绑定托盘的人" prop="bindBy">
<el-input v-model="form.bindBy" placeholder="请输入绑定托盘的人" />
</el-form-item>
<el-form-item label="绑定托盘时间" prop="bindTime">
<el-date-picker clearable
v-model="form.bindTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择绑定托盘时间">
</el-date-picker>
</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>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode } from "@/api/mes/barcode";
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
barcodeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: null,
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
},
//
form: {},
//
rules: {
printTime: [
{ required: true, message: "打印时间不能为空", trigger: "blur" }
],
batchFlag: [
{ required: true, message: "批次标识不能为空", trigger: "change" }
],
barcodeType: [
{ required: true, message: "条码类型不能为空", trigger: "change" }
],
barcodeInfo: [
{ required: true, message: "条码内容不能为空", trigger: "blur" }
],
batchCode: [
{ required: true, message: "批次代码不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
],
},
columns: [
{ key: 0, label: `主键标识`, visible: true },
{ key: 1, label: `打印时间`, visible: true },
{ key: 2, label: `打印人`, visible: true },
{ key: 3, label: `批次标识`, visible: true },
{ key: 4, label: `条码类型`, visible: true },
{ key: 5, label: `条码内容`, visible: true },
{ key: 6, label: `批次代码`, visible: true },
{ key: 7, label: `托盘RFID代码`, visible: true },
{ key: 8, label: `物料ID`, visible: true },
{ key: 9, label: `供应商ID`, visible: true },
{ key: 10, label: `数量`, visible: true },
{ key: 11, label: `打印机台名称`, visible: true },
{ key: 12, label: `打印次数`, visible: true },
{ key: 13, label: `采购订单号`, visible: true },
{ key: 14, label: `生产日期`, visible: true },
{ key: 15, label: `接受日期`, visible: true },
{ key: 16, label: `最晚出库日期`, visible: true },
{ key: 17, label: `生产计划编号`, visible: true },
{ key: 18, label: `生产计划明细编号`, visible: true },
{ key: 19, label: `销售订单ID`, visible: true },
{ key: 20, label: `销售订单编号`, visible: true },
{ key: 21, label: `项目号`, visible: true },
{ key: 22, label: `流水号`, visible: true },
{ key: 23, label: `备注`, visible: true },
{ key: 24, label: `绑定状态`, visible: true },
{ key: 25, label: `绑定托盘的人`, visible: true },
{ key: 26, label: `绑定托盘时间`, visible: true },
{ key: 27, label: `更新人`, visible: true },
{ key: 28, label: `更新时间`, visible: true },
],
};
},
created() {
this.getList();
},
methods: {
/** 查询条码信息列表 */
getList() {
this.loading = true;
listBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
barcodeId: null,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: null,
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.barcodeId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加条码信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const barcodeId = row.barcodeId || this.ids
getBarcode(barcodeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改条码信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.barcodeId != null) {
updateBarcode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const barcodeIds = row.barcodeId || this.ids;
this.$modal.confirm('是否确认删除条码信息编号为"' + barcodeIds + '"的数据项?').then(function() {
return delBarcode(barcodeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/barcode/export', {
...this.queryParams
}, `barcode_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,563 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="条码类型" prop="barcodeType">-->
<!-- <el-select v-model="queryParams.barcodeType" placeholder="请选择条码类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.barcode_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="采购订单号" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入生产计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
placeholder="请输入销售订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="绑定状态" prop="bindStatus">
<el-select v-model="queryParams.bindStatus" placeholder="请选择绑定状态" clearable>
<el-option
v-for="dict in dict.type.bind_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:barcode:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:barcode:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:barcode:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:barcode:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="barcodeId" v-if="columns[0].visible"/>
<el-table-column label="打印时间" align="center" prop="printTime" width="180" v-if="columns[1].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.printTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="打印人" align="center" prop="printPerson" v-if="columns[2].visible"/>
<el-table-column label="批次标识" align="center" prop="batchFlag" v-if="columns[3].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="条码类型" align="center" prop="barcodeType" v-if="columns[4].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</el-table-column>
<el-table-column label="条码内容" align="center" prop="barcodeInfo" v-if="columns[5].visible"/>
<el-table-column label="批次代码" align="center" prop="batchCode" v-if="columns[6].visible"/>
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" v-if="columns[7].visible"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[8].visible"/>
<el-table-column label="供应商ID" align="center" prop="manufacturerId" v-if="columns[9].visible"/>
<el-table-column label="数量" align="center" prop="amount" v-if="columns[10].visible"/>
<el-table-column label="打印机台名称" align="center" prop="machineName" v-if="columns[11].visible"/>
<el-table-column label="打印次数" align="center" prop="printNumber" v-if="columns[12].visible"/>
<el-table-column label="采购订单号" align="center" prop="poNo" v-if="columns[13].visible"/>
<el-table-column label="生产日期" align="center" prop="productionDate" width="180" v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="接受日期" align="center" prop="acceptedDate" width="180" v-if="columns[15].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.acceptedDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="最晚出库日期" align="center" prop="lastOutstockDate" width="180" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="生产计划编号" align="center" prop="planCode" v-if="columns[17].visible"/>
<el-table-column label="生产计划明细编号" align="center" prop="planDetailCode" v-if="columns[18].visible"/>
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[19].visible"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[20].visible"/>
<el-table-column label="项目号" align="center" prop="projectNo" v-if="columns[21].visible"/>
<el-table-column label="流水号" align="center" prop="serialNumber" v-if="columns[22].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[23].visible"/>
<el-table-column label="绑定状态" align="center" prop="bindStatus" v-if="columns[24].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.bind_status" :value="scope.row.bindStatus"/>
</template>
</el-table-column>
<el-table-column label="绑定托盘的人" align="center" prop="bindBy" v-if="columns[25].visible"/>
<el-table-column label="绑定托盘时间" align="center" prop="bindTime" width="180" v-if="columns[26].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.bindTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[27].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[28].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:barcode:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:barcode:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改条码信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- <el-form-item label="打印时间" prop="printTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.printTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择打印时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="打印人" prop="printPerson">-->
<!-- <el-input v-model="form.printPerson" placeholder="请输入打印人" />-->
<!-- </el-form-item>-->
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="采购订单号" prop="poNo">
<el-input v-model="form.poNo" placeholder="请输入采购订单号" />
</el-form-item>
<!-- <el-form-item label="条码类型" prop="barcodeType">-->
<!-- <el-radio-group v-model="form.barcodeType">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.barcode_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="条码内容" prop="barcodeInfo">-->
<!-- <el-input v-model="form.barcodeInfo" placeholder="请输入条码内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="批次代码" prop="batchCode">-->
<!-- <el-input v-model="form.batchCode" placeholder="请输入批次代码" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="托盘RFID代码" prop="palletInfoCode">-->
<!-- <el-input v-model="form.palletInfoCode" placeholder="请输入托盘RFID代码" />-->
<!-- </el-form-item>-->
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
</el-form-item>
<!-- <el-form-item label="供应商ID" prop="manufacturerId">-->
<!-- <el-input v-model="form.manufacturerId" placeholder="请输入供应商ID" />-->
<!-- </el-form-item>-->
<el-form-item label="数量" prop="amount">
<el-input-number v-model="form.amount" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="form.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="接受日期" prop="acceptedDate">
<el-date-picker clearable
v-model="form.acceptedDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择接受日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
<el-date-picker clearable
v-model="form.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="生产计划编号" prop="planCode">-->
<!-- <el-input v-model="form.planCode" placeholder="请输入生产计划编号" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="生产计划明细编号" prop="planDetailCode">-->
<!-- <el-input v-model="form.planDetailCode" placeholder="请输入生产计划明细编号" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="销售订单ID" prop="saleOrderId">-->
<!-- <el-input v-model="form.saleOrderId" placeholder="请输入销售订单ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="销售订单编号" prop="saleorderCode">-->
<!-- <el-input v-model="form.saleorderCode" placeholder="请输入销售订单编号" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目号" prop="projectNo">-->
<!-- <el-input v-model="form.projectNo" placeholder="请输入项目号" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="流水号" prop="serialNumber">-->
<!-- <el-input v-model="form.serialNumber" placeholder="请输入流水号" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<!-- <el-form-item label="绑定状态" prop="bindStatus">-->
<!-- <el-radio-group v-model="form.bindStatus">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.bind_status"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="绑定托盘的人" prop="bindBy">-->
<!-- <el-input v-model="form.bindBy" placeholder="请输入绑定托盘的人" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="绑定托盘时间" prop="bindTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.bindTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择绑定托盘时间">-->
<!-- </el-date-picker>-->
<!-- </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>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode } from "@/api/mes/barcode";
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type'],
data() {
return {
//
loading: true,
//
ids: [],
barcodeInfos: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
barcodeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: '1',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
},
//
form: {},
//
rules: {
batchFlag: [
{ required: true, message: "批次标识不能为空", trigger: "change" }
],
barcodeType: [
{ required: true, message: "条码类型不能为空", trigger: "change" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
],
},
columns: [
{ key: 0, label: `主键标识`, visible: true },
{ key: 1, label: `打印时间`, visible: true },
{ key: 2, label: `打印人`, visible: true },
{ key: 3, label: `批次标识`, visible: true },
{ key: 4, label: `条码类型`, visible: true },
{ key: 5, label: `条码内容`, visible: true },
{ key: 6, label: `批次代码`, visible: true },
{ key: 7, label: `托盘RFID代码`, visible: true },
{ key: 8, label: `物料ID`, visible: true },
{ key: 9, label: `供应商ID`, visible: true },
{ key: 10, label: `数量`, visible: true },
{ key: 11, label: `打印机台名称`, visible: true },
{ key: 12, label: `打印次数`, visible: true },
{ key: 13, label: `采购订单号`, visible: true },
{ key: 14, label: `生产日期`, visible: true },
{ key: 15, label: `接受日期`, visible: true },
{ key: 16, label: `最晚出库日期`, visible: true },
{ key: 17, label: `生产计划编号`, visible: true },
{ key: 18, label: `生产计划明细编号`, visible: true },
{ key: 19, label: `销售订单ID`, visible: true },
{ key: 20, label: `销售订单编号`, visible: true },
{ key: 21, label: `项目号`, visible: true },
{ key: 22, label: `流水号`, visible: true },
{ key: 23, label: `备注`, visible: true },
{ key: 24, label: `绑定状态`, visible: true },
{ key: 25, label: `绑定托盘的人`, visible: true },
{ key: 26, label: `绑定托盘时间`, visible: true },
{ key: 27, label: `更新人`, visible: true },
{ key: 28, label: `更新时间`, visible: true },
],
};
},
created() {
this.getList();
},
methods: {
/** 查询条码信息列表 */
getList() {
this.loading = true;
listBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
barcodeId: null,
printTime: null,
printPerson: null,
batchFlag: '1',
barcodeType: '1',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: 1,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.barcodeId)
this.barcodeInfos = selection.map(item => item.barcodeInfo)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加原材料条码信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const barcodeId = row.barcodeId || this.ids
getBarcode(barcodeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改原材料条码信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.barcodeId != null) {
updateBarcode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const barcodeIds = row.barcodeInfo || this.barcodeInfos;
this.$modal.confirm('是否确认删除原材料条码内容为"' + barcodeIds + '"的数据项?').then(function() {
return delBarcode(barcodeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/barcode/export', {
...this.queryParams
}, `barcode_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -19,12 +19,14 @@
/>
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input
v-model="queryParams.materialCategories"
placeholder="请输入物料大类"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.materialCategories" placeholder="请选择物料大类" clearable>
<el-option
v-for="dict in dict.type.material_categories"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料类型" prop="materialTypeId">
<el-input
@ -35,23 +37,15 @@
/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-input
v-model="queryParams.batchFlag"
placeholder="请输入批次标识"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -59,16 +53,16 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:materialinfo:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['mes:materialinfo:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="success"
@ -78,19 +72,20 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:materialinfo:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:materialinfo:remove']"
>删除</el-button>
>修改
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['mes:materialinfo:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -99,22 +94,32 @@
size="mini"
@click="handleExport"
v-hasPermi="['mes:materialinfo:export']"
>导出</el-button>
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="materialinfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="物料大类" align="center" prop="materialCategories" />
<el-table-column label="物料类型" align="center" prop="materialTypeId" />
<el-table-column label="批次标识" align="center" prop="batchFlag" />
<el-table-column label="计量单位" align="center" prop="materialUnit" />
<el-table-column label="物料规格" align="center" prop="materialSpec" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料大类" align="center" prop="materialCategories">
<template slot-scope="scope">
<dict-tag :options="dict.type.material_categories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<!-- <el-table-column label="物料类型" align="center" prop="materialTypeId"/>-->
<el-table-column label="物料类型" align="center" prop="materialTypeName"/>
<el-table-column label="批次标识" align="center" prop="batchFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" prop="materialUnit"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="净重" align="center" prop="netWeight"/>
<el-table-column label="毛重" align="center" prop="grossWeight"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -123,14 +128,15 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:materialinfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:materialinfo:remove']"
>删除</el-button>
>修改
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['mes:materialinfo:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
@ -146,85 +152,99 @@
<!-- 添加或修改物料信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="ERP的主键;对应FMATERIALID" prop="erpId">
<el-input v-model="form.erpId" placeholder="请输入ERP的主键;对应FMATERIALID" />
</el-form-item>
<el-form-item label="物料编码;对应ERP的FNumber" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码;对应ERP的FNumber" />
</el-form-item>
<el-form-item label="旧物料编码" prop="oldMaterialCode">
<el-input v-model="form.oldMaterialCode" placeholder="请输入旧物料编码" />
</el-form-item>
<el-form-item label="物料名称;对应ERP的FName" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称;对应ERP的FName" />
</el-form-item>
<el-form-item label="物料大类(1,原材料 2,半成品 3,成品)" prop="materialCategories">
<el-input v-model="form.materialCategories" placeholder="请输入物料大类(1,原材料 2,半成品 3,成品)" />
</el-form-item>
<el-form-item label="物料小类;暂时不使用,预留" prop="materialSubclass">
<el-input v-model="form.materialSubclass" placeholder="请输入物料小类;暂时不使用,预留" />
</el-form-item>
<el-form-item label="物料类型关联mes_base_material_type的material_type_id" prop="materialTypeId">
<el-input v-model="form.materialTypeId" placeholder="请输入物料类型关联mes_base_material_type的material_type_id" />
</el-form-item>
<el-form-item label="批次标识,(0否1是)" prop="batchFlag">
<el-input v-model="form.batchFlag" placeholder="请输入批次标识,(0否1是)" />
</el-form-item>
<el-form-item label="计量单位ID;对应FBaseUnitId" prop="materialUnitId">
<el-input v-model="form.materialUnitId" placeholder="请输入计量单位ID;对应FBaseUnitId" />
</el-form-item>
<el-form-item label="计量单位名称" prop="materialUnit">
<el-input v-model="form.materialUnit" placeholder="请输入计量单位名称" />
</el-form-item>
<el-form-item label="物料组" prop="materialMatkl">
<el-input v-model="form.materialMatkl" placeholder="请输入物料组" />
</el-form-item>
<el-form-item label="物料规格;对应FSpecification" prop="materialSpec">
<el-input v-model="form.materialSpec" placeholder="请输入物料规格;对应FSpecification" />
</el-form-item>
<el-form-item label="净重;FNETWEIGHT" prop="netWeight">
<el-input v-model="form.netWeight" placeholder="请输入净重;FNETWEIGHT" />
</el-form-item>
<el-form-item label="毛重;FGROSSWEIGHT" prop="grossWeight">
<el-input v-model="form.grossWeight" placeholder="请输入毛重;FGROSSWEIGHT" />
</el-form-item>
<el-form-item label="所属工厂关联mes_base_factory_info的factory_id" prop="factoryId">
<el-input v-model="form.factoryId" placeholder="请输入所属工厂关联mes_base_factory_info的factory_id" />
</el-form-item>
<el-form-item label="创建组织;对应FCreateOrgId" prop="createOrgId">
<el-input v-model="form.createOrgId" placeholder="请输入创建组织;对应FCreateOrgId" />
</el-form-item>
<el-form-item label="使用组织;对应FUseOrgId" prop="useOrgId">
<el-input v-model="form.useOrgId" placeholder="请输入使用组织;对应FUseOrgId" />
</el-form-item>
<el-form-item label="所属产线;多个用,隔开" prop="prodlineId">
<el-input v-model="form.prodlineId" placeholder="请输入所属产线;多个用,隔开" />
</el-form-item>
<el-form-item label="激活标识1-是0-否" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入激活标识1-是0-否" />
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" :disabled="true"/>
</el-form-item>
<el-form-item label="删除标识(0否1是)" prop="deletedFlag">
<el-input v-model="form.deletedFlag" placeholder="请输入删除标识(0否1是)" />
<!-- <el-form-item label="旧物料编码" prop="oldMaterialCode">-->
<!-- <el-input v-model="form.oldMaterialCode" placeholder="请输入旧物料编码" />-->
<!-- </el-form-item>-->
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" :disabled="true"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-form-item label="物料大类" prop="materialCategories">
<el-radio-group v-model="form.materialCategories">
<el-radio
v-for="dict in dict.type.material_categories"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核日期;对应FApproveDate" prop="approveDate">
<el-date-picker clearable
v-model="form.approveDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核日期;对应FApproveDate">
</el-date-picker>
<!-- <el-form-item label="物料小类" prop="materialSubclass">-->
<!-- <el-input v-model="form.materialSubclass" placeholder="请输入物料小类" />-->
<!-- </el-form-item>-->
<el-form-item label="物料类型" prop="materialTypeId">
<!-- <el-input v-model="form.materialTypeId" placeholder="请输入物料类型"/>-->
<treeselect v-model="form.materialTypeId" :options="baseMaterialTypeOptions" :normalizer="normalizer"
placeholder="请选择物料类型"/>
</el-form-item>
<el-form-item label="erp最后更新日期;对应FModifyDate" prop="erpModifyDate">
<el-date-picker clearable
v-model="form.erpModifyDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择erp最后更新日期;对应FModifyDate">
</el-date-picker>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="计量单位" prop="materialUnitId">-->
<!-- <el-input v-model="form.materialUnitId" placeholder="请输入计量单位" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="计量单位名称" prop="materialUnit">-->
<!-- <el-input v-model="form.materialUnit" placeholder="请输入计量单位名称" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料组" prop="materialMatkl">-->
<!-- <el-input v-model="form.materialMatkl" placeholder="请输入物料组" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料规格" prop="materialSpec">-->
<!-- <el-input v-model="form.materialSpec" placeholder="请输入物料规格" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="净重" prop="netWeight">-->
<!-- <el-input v-model="form.netWeight" placeholder="请输入净重" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="毛重" prop="grossWeight">-->
<!-- <el-input v-model="form.grossWeight" placeholder="请输入毛重" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="所属工厂" prop="factoryId">-->
<!-- <el-input v-model="form.factoryId" placeholder="请输入所属工厂" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="创建组织" prop="createOrgId">-->
<!-- <el-input v-model="form.createOrgId" placeholder="请输入创建组织" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="使用组织" prop="useOrgId">-->
<!-- <el-input v-model="form.useOrgId" placeholder="请输入使用组织" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="所属产线" prop="prodlineId">-->
<!-- <el-input v-model="form.prodlineId" placeholder="请输入所属产线" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="激活标识1-是0-否" prop="activeFlag">-->
<!-- <el-input v-model="form.activeFlag" placeholder="请输入激活标识1-是0-否" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="删除标识(0否1是)" prop="deletedFlag">-->
<!-- <el-input v-model="form.deletedFlag" placeholder="请输入删除标识(0否1是)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="审核日期" prop="approveDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.approveDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择审核日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="erp最后更新日期" prop="erpModifyDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.erpModifyDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择erp最后更新日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -235,10 +255,23 @@
</template>
<script>
import { listMaterialinfo, getMaterialinfo, delMaterialinfo, addMaterialinfo, updateMaterialinfo } from "@/api/mes/materialinfo";
import {
listMaterialinfo,
getMaterialinfo,
delMaterialinfo,
addMaterialinfo,
updateMaterialinfo
} from "@/api/mes/materialinfo";
import {listBaseMaterialType} from "@//api/mes/baseMaterialType";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Materialinfo",
dicts: ['active_flag', 'material_categories'],
components: {
Treeselect
},
data() {
return {
//
@ -253,6 +286,8 @@ export default {
showSearch: true,
//
total: 0,
//
baseMaterialTypeOptions: [],
//
materialinfoList: [],
//
@ -290,20 +325,17 @@ export default {
form: {},
//
rules: {
erpId: [
{ required: true, message: "ERP的主键;对应FMATERIALID不能为空", trigger: "blur" }
],
materialCode: [
{ required: true, message: "物料编码;对应ERP的FNumber不能为空", trigger: "blur" }
{required: true, message: "物料编码不能为空", trigger: "blur"}
],
materialName: [
{ required: true, message: "物料名称;对应ERP的FName不能为空", trigger: "blur" }
{required: true, message: "物料名称不能为空", trigger: "blur"}
],
materialCategories: [
{ required: true, message: "物料大类(1,原材料 2,半成品 3,成品)不能为空", trigger: "blur" }
{required: true, message: "物料大类不能为空", trigger: "blur"}
],
materialTypeId: [
{ required: true, message: "物料类型关联mes_base_material_type的material_type_id不能为空", trigger: "blur" }
{required: true, message: "物料类型不能为空", trigger: "blur"}
],
}
};
@ -373,7 +405,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.materialId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -385,6 +417,10 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
if (row != null) {
// this.form.parentId = row.matrialTypeId;
}
const materialId = row.materialId || this.ids
getMaterialinfo(materialId).then(response => {
this.form = response.data;
@ -412,15 +448,36 @@ export default {
}
});
},
/** 转换物料类型信息数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.matrialTypeId,
label: node.typeName,
children: node.children
};
},
/** 查询物料类型信息下拉树结构 */
getTreeselect() {
listBaseMaterialType().then(response => {
this.baseMaterialTypeOptions = [];
const data = {matrialTypeId: 0, typeName: '顶级节点', children: []};
data.children = this.handleTree(response.data, "matrialTypeId", "parentId");
this.baseMaterialTypeOptions.push(data);
});
},
/** 删除按钮操作 */
handleDelete(row) {
const materialIds = row.materialId || this.ids;
this.$modal.confirm('是否确认删除物料信息编号为"' + materialIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除物料信息编号为"' + materialIds + '"的数据项?').then(function () {
return delMaterialinfo(materialIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {

@ -17,24 +17,24 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="物料ID" prop="materialId">-->
<!-- <el-input-->
<!-- v-model="queryParams.materialId"-->
<!-- placeholder="请输入物料ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="派工类型" prop="dispatchType">-->
<!-- <el-select v-model="queryParams.dispatchType" placeholder="请选择派工类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.dispatch_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料ID" prop="materialId">-->
<!-- <el-input-->
<!-- v-model="queryParams.materialId"-->
<!-- placeholder="请输入物料ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="派工类型" prop="dispatchType">-->
<!-- <el-select v-model="queryParams.dispatchType" placeholder="请选择派工类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.dispatch_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable>
<el-option
@ -343,12 +343,12 @@
<el-form-item label="工单编号" prop="orderCode">
<el-input v-model="form.orderCode" :disabled="true"/>
</el-form-item>
<!-- <el-form-item label="项目编号" prop="projectNo">-->
<!-- <el-input v-model="form.projectNo" placeholder="请输入项目编号"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目编号" prop="projectNo">-->
<!-- <el-input v-model="form.projectNo" placeholder="请输入项目编号"/>-->
<!-- </el-form-item>-->
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
</el-input>
</el-form-item>
<el-form-item label="物料BOM" prop="materialBomId">
@ -421,7 +421,7 @@
</el-dialog>
<!-- 添加物料信息对话框 -->
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialForm"> </el-button>
@ -534,6 +534,15 @@ export default {
dispatchId: [
{required: true, message: "工艺路线不能为空", trigger: "blur"}
],
planDeliveryDate: [
{required: true, message: "计划交货日期不能为空", trigger: "blur"}
],
planBeginTime: [
{required: true, message: "计划开始时间不能为空", trigger: "blur"}
],
planEndTime: [
{required: true, message: "计划结束时间不能为空", trigger: "blur"}
],
saleAmount: [
{required: true, message: "销售数量不能为空", trigger: "blur"},
{
@ -673,10 +682,11 @@ export default {
this.form.materialName = selectedRow.materialName;
getMaterialVisionList(this.form.materialId).then(response => {
this.materialBomList = response.data
if (this.materialBomList.length !== 0){
if (this.materialBomList.length !== 0) {
this.form.materialBomId = this.materialBomList[0].materialBomId
} else {
this.form.materialBomId = null;
this.$modal.msgError("该物料未维护BOM信息");
}
})
this.materialOpen = false;
@ -692,16 +702,17 @@ export default {
this.form.materialCode = selectedRow.materialCode;
this.form.materialName = selectedRow.materialName;
this.form.saleAmount = selectedRow.orderAmount;
this.form.planBeginTime = selectedRow.beginDate + " 00:00:00";
this.form.planEndTime = selectedRow.endDate + " 00:00:00";
this.form.planDeliveryDate = selectedRow.planDeliveryDate + " 00:00:00";
this.form.planBeginTime = selectedRow.beginDate == null ? null : selectedRow.beginDate + " 00:00:00";
this.form.planEndTime = selectedRow.endDate == null ? null : selectedRow.endDate + " 00:00:00";
this.form.planDeliveryDate = selectedRow.planDeliveryDate == null ? null : selectedRow.planDeliveryDate + " 00:00:00";
this.form.saleOrderFlag = '1';
getMaterialVisionList(this.form.materialId).then(response => {
getMaterialVisionList(selectedRow.materialId).then(response => {
this.materialBomList = response.data
if (this.materialBomList.length !== 0){
this.form.materialBomId = this.materialBomList[0].materialBomId
if (this.materialBomList.length !== 0) {
this.form.materialBomId = this.materialBomList[0].materialBomId;
} else {
this.form.materialBomId = null;
this.$modal.msgError("该销售订单物料未维护BOM信息");
}
})
this.saleOrderOpen = false;
@ -776,7 +787,7 @@ export default {
handleDispatch(row) {
const productOrderId = row.productOrderId || this.ids[0];
const orderCode = row.orderCode;
const params = { pageNum: this.queryParams.pageNum };
const params = {pageNum: this.queryParams.pageNum};
this.$tab.openPage("工单[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params);
},

@ -0,0 +1,314 @@
<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="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="purchaseOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="purchaseOrderId" v-if="columns[0].visible"/>
<el-table-column label="ERP主键信息" align="center" prop="erpId" v-if="columns[1].visible"/>
<el-table-column label="金蝶ERP订单明细ID" align="center" prop="fentryId" v-if="columns[2].visible"/>
<el-table-column label="采购订单编号" align="center" prop="poNo" v-if="columns[3].visible"/>
<el-table-column label="单据状态" align="center" prop="documentStatus" v-if="columns[4].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.document_status" :value="scope.row.documentStatus"/>
</template>
</el-table-column>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[5].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[6].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[7].visible"/>
<el-table-column label="订单计划数量" align="center" prop="orderAmount" v-if="columns[8].visible"/>
<el-table-column label="完成采购数量" align="center" prop="completeAmount" v-if="columns[9].visible"/>
<el-table-column label="审核日期" align="center" prop="approveDate" width="180" v-if="columns[10].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" width="180" v-if="columns[11].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180" v-if="columns[12].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划开始日期" align="center" prop="beginDate" width="180" v-if="columns[13].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划结束日期" align="center" prop="endDate" width="180" v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="orderStatus" v-if="columns[15].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="完成日期" align="center" prop="completeDate" width="180" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.completeDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="是否标识" align="center" prop="isFlag" v-if="columns[17].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[18].visible"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listPurchaseOrder, getPurchaseOrder, delPurchaseOrder, addPurchaseOrder, updatePurchaseOrder } from "@//api/mes/purchaseOrder";
export default {
name: "PurchaseOrder",
dicts: ['active_flag', 'order_status', 'document_status'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
purchaseOrderList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
erpId: null,
fentryId: null,
poNo: null,
documentStatus: null,
materialId: null,
materialCode: null,
materialName: null,
orderAmount: null,
completeAmount: null,
approveDate: null,
erpModifyDate: null,
planDeliveryDate: null,
beginDate: null,
endDate: null,
orderStatus: null,
completeDate: null,
isFlag: null,
},
//
form: {},
//
rules: {
materialCode: [
{ required: true, message: "物料编码不能为空", trigger: "blur" }
],
orderAmount: [
{ required: true, message: "订单计划数量不能为空", trigger: "blur" }
],
isFlag: [
{ required: true, message: "是否标识不能为空", trigger: "change" }
],
},
columns: [
{ key: 0, label: `主键标识`, visible: true },
{ key: 1, label: `ERP主键信息`, visible: true },
{ key: 2, label: `金蝶ERP订单明细ID`, visible: true },
{ key: 3, label: `采购订单编号`, visible: true },
{ key: 4, label: `单据状态`, visible: true },
{ key: 5, label: `物料ID`, visible: true },
{ key: 6, label: `物料编码`, visible: true },
{ key: 7, label: `物料名称`, visible: true },
{ key: 8, label: `订单计划数量`, visible: true },
{ key: 9, label: `完成采购数量`, visible: true },
{ key: 10, label: `审核日期`, visible: true },
{ key: 11, label: `ERP最后修改日期`, visible: true },
{ key: 12, label: `计划交货日期`, visible: true },
{ key: 13, label: `计划开始日期`, visible: true },
{ key: 14, label: `计划结束日期`, visible: true },
{ key: 15, label: `订单状态`, visible: true },
{ key: 16, label: `完成日期`, visible: true },
{ key: 17, label: `是否标识`, visible: true },
{ key: 18, label: `备注`, visible: true },
{ key: 19, label: `创建人`, visible: true },
{ key: 20, label: `创建时间`, visible: true },
{ key: 21, label: `更新人`, visible: true },
{ key: 22, label: `更新时间`, visible: true },
],
};
},
created() {
this.getList();
},
methods: {
/** 查询采购订单信息列表 */
getList() {
this.loading = true;
listPurchaseOrder(this.queryParams).then(response => {
this.purchaseOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
purchaseOrderId: null,
erpId: null,
fentryId: null,
poNo: null,
documentStatus: null,
materialId: null,
materialCode: null,
materialName: null,
orderAmount: null,
completeAmount: null,
approveDate: null,
erpModifyDate: null,
planDeliveryDate: null,
beginDate: null,
endDate: null,
orderStatus: null,
completeDate: null,
isFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.purchaseOrderId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加采购订单信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const purchaseOrderId = row.purchaseOrderId || this.ids
getPurchaseOrder(purchaseOrderId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改采购订单信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.purchaseOrderId != null) {
updatePurchaseOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPurchaseOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const purchaseOrderIds = row.purchaseOrderId || this.ids;
this.$modal.confirm('是否确认删除采购订单信息编号为"' + purchaseOrderIds + '"的数据项?').then(function() {
return delPurchaseOrder(purchaseOrderIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/purchaseOrder/export', {
...this.queryParams
}, `purchaseOrder_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -227,6 +227,20 @@
<version>${hw.version}</version>
</dependency>
<!-- job接口 -->
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-job</artifactId>
<version>${hw.version}</version>
</dependency>
<!-- dms接口 -->
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-dms</artifactId>
<version>${hw.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -237,8 +251,6 @@
<module>hw-modules</module>
<module>hw-api</module>
<module>hw-common</module>
<module>hw-api-dms</module>
<module>hw-api-job</module>
</modules>
<packaging>pom</packaging>

Loading…
Cancel
Save