change - add成品条码页面、添加、打印

master
yinq 8 months ago
parent f963061fd9
commit 4eb03be936

@ -9,11 +9,22 @@ package com.hw.common.core.constant;
*/
public class MesConstants {
/*条码类型*/
public static final String MES_BARCODE_TYPE_RAW = "1";//原材料
public static final String MES_BARCODE_TYPE_SEMI = "2";//半成品
public static final String MES_BARCODE_TYPE_PRODUCT = "3";//成品
public static final String MES_BARCODE_TYPE_BACKPLATE = "4";//背板
/**
* :
*/
public static final String MES_BARCODE_TYPE_RAW = "1";
/**
* :
*/
public static final String MES_BARCODE_TYPE_SEMI = "2";
/**
* :
*/
public static final String MES_BARCODE_TYPE_PRODUCT = "3";
/**
* :
*/
public static final String MES_BARCODE_TYPE_BACKPLATE = "4";
/** 条码批次标识0-否 */
public static final String NOT_IS_BATCH = "0";

@ -99,15 +99,24 @@ public class Seq {
// 生产批次代码标识
public static final String mesBatchCodeCode = "PC";
// 条码内容记录标识
// 原材料条码内容记录标识
public static final String mesBarcodeSeqType = "BAR_CODE";
// 条码内容序列数
// 原材料条码内容序列数
private static AtomicInteger mesBarcodeSeq = new AtomicInteger(1);
// 条码内容标识
// 原材料条码内容标识
public static final String mesBarcodeCode = "TM";
// 成品条码内容记录标识
public static final String mesCompBarcodeSeqType = "COMP_BAR_CODE";
// 成品条码内容序列数
private static AtomicInteger mesCompBarcodeSeq = new AtomicInteger(1);
// 成品条码内容标识
public static final String mesCompBarcodeCode = "CP";
// 设备报修工单编号记录标识
public static final String dmsBillsFaultInstanceSeqType = "DMSBILLSFAULTINSTANCE";
@ -266,6 +275,8 @@ public class Seq {
atomicInt = planLubeSeq;
}else if(lubeInstanceSeqType.equals(type)) {
atomicInt = lubeInstanceSeq;
}else if(mesCompBarcodeSeqType.equals(type)) {
atomicInt = mesCompBarcodeSeq;
}
return getId(atomicInt, 3, code);
}

@ -128,6 +128,10 @@ public class MesProductPlan extends BaseEntity
@Excel(name = "是否标识")
private String isFlag;
/** sop附件ID关联附件信息主键 */
@Excel(name = "sop附件ID")
private String sopId;
/**
*
*/
@ -151,6 +155,14 @@ public class MesProductPlan extends BaseEntity
/** 工单已派工数量 */
private BigDecimal dispatchedAmount;
public String getSopId() {
return sopId;
}
public void setSopId(String sopId) {
this.sopId = sopId;
}
public String getOrderCode() {
return orderCode;
}

@ -68,13 +68,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
*
* barcode_type '1=,2=,3=,4='
* @param mesBaseBarcodeInfo
* @return
*/
@Override
public int insertMesBaseBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
mesBaseBarcodeInfo.setCreateTime(DateUtils.getNowDate());
// 生成原材料条码
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
//同一批次的批次代码相同
mesBaseBarcodeInfo.setBatchCode(Seq.getId(Seq.mesBatchCodeSeqType, Seq.mesBatchCodeCode));
@ -92,6 +93,18 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
}
// 生成成品条码
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
// 批次代码 == 条码内容
int frequency = mesBaseBarcodeInfo.getAmount().intValue();
for (int i = 0; i < frequency; i++) {
String code = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
mesBaseBarcodeInfo.setBatchCode(code);
mesBaseBarcodeInfo.setBarcodeInfo(code);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
}
return 1;
}

@ -40,6 +40,7 @@
<result property="materialName" column="material_name"/>
<result property="processName" column="process_name"/>
<result property="stationName" column="station_name"/>
<result property="sopId" column="sop_id"/>
</resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -91,6 +92,7 @@
mpp.real_begin_time,
mpp.real_end_time,
mpp.attach_id,
mpp.sop_id,
mpp.plan_status,
mpp.is_flag,
mpp.remark,
@ -208,6 +210,7 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="sopId != null and sopId != ''">sop_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
@ -235,6 +238,7 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="sopId != null and sopId != ''">#{sopId},</if>
</trim>
</insert>
@ -266,6 +270,7 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="sopId != null and sopId != ''">sop_id = #{sopId},</if>
</trim>
where plan_id = #{planId}
</update>

@ -1,162 +1,26 @@
<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 :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="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
@ -165,64 +29,8 @@
@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>
@ -238,19 +46,21 @@
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-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"
@ -260,7 +70,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:barcode:remove']"
>删除</el-button>
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -270,39 +81,32 @@
size="mini"
@click="handleExport"
v-hasPermi="['mes:barcode:export']"
>导出</el-button>
>导出
</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 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">
<el-table-column label="条码类型" align="center" prop="barcodeType" v-if="columns[4].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.printTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</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" >
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[20].visible" width="110"/>
<el-table-column label="采购订单号" align="center" prop="poNo" v-if="columns[13].visible" width="100"/>
<el-table-column label="批次代码" align="center" prop="batchCode" v-if="columns[6].visible" width="100"/>
<el-table-column label="条码内容" align="center" prop="barcodeInfo" v-if="columns[5].visible" width="100"/>
<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="物料名称" align="center" prop="materialName" v-if="columns[8].visible" width="100"/>
<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>
@ -318,19 +122,27 @@
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" v-if="columns[7].visible" width="110"/>
<el-table-column label="打印机台名称" align="center" prop="machineName" v-if="columns[11].visible" width="110"/>
<el-table-column label="打印次数" align="center" prop="printNumber" v-if="columns[12].visible"/>
<el-table-column label="打印人" align="center" prop="printPerson" v-if="columns[2].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="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" >
<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="bindBy" v-if="columns[25].visible" width="110"/>
<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>
@ -342,22 +154,31 @@
<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">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<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>
icon="el-icon-printer"
@click="handlePrintBarCode(scope.row)"
>打印
</el-button>
<!-- <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>
@ -372,63 +193,43 @@
<!-- 添加或修改条码信息对话框 -->
<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 ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-input v-model="form.saleorderCode" placeholder="请点击右侧检索销售订单编号" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleSaleOrderAdd"></el-button>
</el-input>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
<!-- <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" v-if="false">
<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 label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" :disabled="true"/>
</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-input-number v-model="form.amount" placeholder="请输入数量"/>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="form.productionDate"
@ -437,14 +238,14 @@
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="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"
@ -453,68 +254,65 @@
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-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>
<!-- 添加销售订单信息对话框 -->
<el-dialog title="选择销售订单" :visible.sync="saleOrderOpen" append-to-body>
<add-SaleOrder @selection="handleSelection" ref="saleOrderRef"></add-SaleOrder>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitSaleOrderForm"> </el-button>
<el-button @click="saleOrderOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode } from "@/api/mes/barcode";
import {listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode, printBarCode} from "@/api/mes/barcode";
import {getMaterialinfo} from "@//api/mes/materialinfo";
import addSaleOrder from '@//views/mes/productOrder/addSaleOrder.vue';
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type'],
components: {
'add-SaleOrder': addSaleOrder,
},
data() {
return {
//
loading: true,
//
ids: [],
barcodeInfos: [],
//
single: true,
//
@ -525,6 +323,8 @@ export default {
total: 0,
//
barcodeList: [],
//
saleOrderOpen: false,
//
title: "",
//
@ -536,7 +336,7 @@ export default {
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: null,
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
@ -565,61 +365,65 @@ export default {
form: {},
//
rules: {
printTime: [
{ required: true, message: "打印时间不能为空", trigger: "blur" }
saleorderCode: [
{required: true, message: "销售订单编号不能为空", trigger: "blur"}
],
batchFlag: [
{ required: true, message: "批次标识不能为空", trigger: "change" }
{required: true, message: "批次标识不能为空", trigger: "change"}
],
barcodeType: [
{ required: true, message: "条码类型不能为空", trigger: "change" }
],
barcodeInfo: [
{ required: true, message: "条码内容不能为空", trigger: "blur" }
],
batchCode: [
{ required: true, message: "批次代码不能为空", trigger: "blur" }
{required: true, message: "条码类型不能为空", trigger: "change"}
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
{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 },
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `打印时间`, visible: true},
{key: 2, label: `打印人`, visible: true},
{key: 3, label: `批次标识`, visible: true},
{key: 4, label: `条码类型`, visible: false},
{key: 5, label: `条码内容`, visible: true},
{key: 6, label: `批次代码`, visible: true},
{key: 7, label: `托盘RFID代码`, visible: true},
{key: 8, label: `物料名称`, visible: true},
{key: 9, label: `供应商ID`, visible: false},
{key: 10, label: `数量`, visible: true},
{key: 11, label: `打印机台名称`, visible: true},
{key: 12, label: `打印次数`, visible: true},
{key: 13, label: `采购订单号`, visible: false},
{key: 14, label: `生产日期`, visible: true},
{key: 15, label: `接受日期`, visible: true},
{key: 16, label: `最晚出库日期`, visible: true},
{key: 17, label: `生产计划编号`, visible: false},
{key: 18, label: `生产计划明细编号`, visible: false},
{key: 19, label: `销售订单ID`, visible: false},
{key: 20, label: `销售订单编号`, visible: true},
{key: 21, label: `项目号`, visible: false},
{key: 22, label: `流水号`, visible: false},
{key: 23, label: `备注`, visible: true},
{key: 24, label: `绑定状态`, visible: true},
{key: 25, label: `绑定托盘的人`, visible: true},
{key: 26, label: `绑定托盘时间`, visible: true},
{key: 27, label: `更新人`, visible: false},
{key: 28, label: `更新时间`, visible: false},
],
};
},
created() {
this.getList();
},
// watch: {
// 'form.batchFlag': function (newVal, oldVal) {
// // form.batchFlag
// if (newVal === '1') {
// this.amountVisible = true;
// } else if (newVal === '0') {
// this.amountVisible = false;
// }
// },
// },
methods: {
/** 查询条码信息列表 */
getList() {
@ -641,14 +445,14 @@ export default {
barcodeId: null,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: null,
batchFlag: '0',
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
amount: 1,
machineName: null,
printNumber: null,
poNo: null,
@ -683,14 +487,45 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.barcodeId)
this.single = selection.length!==1
this.barcodeInfos = selection.map(item => item.barcodeInfo)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleSelection(selection) {
this.ids = selection.map(item => item.barcodeId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 提交采购订单按钮 */
submitSaleOrderForm() {
let selectedRow = this.$refs.saleOrderRef.selectedRow;
this.form.barcodeType = '3';//1,2,3,4
this.form.materialId = selectedRow.materialId;
this.form.materialName = selectedRow.materialName;
this.form.saleOrderId = selectedRow.saleOrderId;
this.form.saleorderCode = selectedRow.saleorderCode;
this.form.batchFlag = '0';
this.saleOrderOpen = false;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加条码信息";
this.title = "添加成品条码信息";
},
/** 打印条码按钮操作 */
handlePrintBarCode(row) {
const barcodeIds = row.barcodeId || this.ids;
printBarCode(barcodeIds).then(response => {
this.$modal.msgSuccess("打印条码成功");
}).catch(() => {
});
},
/** 新增销售订单按钮操作 */
handleSaleOrderAdd() {
this.saleOrderOpen = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -699,7 +534,7 @@ export default {
getBarcode(barcodeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改条码信息";
this.title = "修改成品条码信息";
});
},
/** 提交按钮 */
@ -725,12 +560,14 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const barcodeIds = row.barcodeId || this.ids;
this.$modal.confirm('是否确认删除条码信息编号为"' + barcodeIds + '"的数据项?').then(function() {
const barcodeInfos = row.barcodeInfo || this.barcodeInfos;
this.$modal.confirm('是否确认删除成品条码内容为"' + barcodeInfos + '"的数据项?').then(function () {
return delBarcode(barcodeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
@ -741,4 +578,3 @@ export default {
}
};
</script>

@ -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>
Loading…
Cancel
Save