|
|
|
@ -18,6 +18,20 @@
|
|
|
|
|
</el-form-->
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
v-hasPermi="['mes:barcode:add']"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleAddProductBarcode"
|
|
|
|
|
v-if="addProductBarcodeBtnVisible"
|
|
|
|
|
>新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
v-hasPermi="['mes:barcode:add']"
|
|
|
|
@ -27,7 +41,7 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-if="addBarcodeBtnVisible"
|
|
|
|
|
>{{addBtnTitle}}
|
|
|
|
|
>{{ addBtnTitle }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
@ -182,7 +196,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="绑定柜体码" prop="bindBarcode">
|
|
|
|
|
<el-input v-model="form.bindBarcode" :disabled="true" v-if="this.form.barcodeType === this.BARCODE_TYPE.BACK_PLANE || this.form.barcodeType === this.BARCODE_TYPE.DOOR">
|
|
|
|
|
<el-input v-model="form.bindBarcode" :disabled="true"
|
|
|
|
|
v-if="this.form.barcodeType === this.BARCODE_TYPE.BACK_PLANE || this.form.barcodeType === this.BARCODE_TYPE.DOOR">
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
@ -240,6 +255,48 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改条码信息对话框 -->
|
|
|
|
|
<el-dialog :title="addProductBarcodeTitle" :visible.sync="addProductBarcodeOpen" append-to-body width="500px">
|
|
|
|
|
<el-form ref="addProductBarcodeForm" :model="addProductBarcodeForm" :rules="addProductBarcodeRules"
|
|
|
|
|
label-width="120px">
|
|
|
|
|
<el-form-item label="原材料条码" prop="productBarcode">
|
|
|
|
|
<el-input v-model="addProductBarcodeForm.productBarcode" placeholder="请扫描或输入原材料条码" suffix-icon="el-icon-full-screen">
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="数量" prop="amount">
|
|
|
|
|
<el-input-number v-model="addProductBarcodeForm.amount" :min="0" placeholder="请输入数量" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="生产日期" prop="productionDate">
|
|
|
|
|
<el-date-picker v-model="addProductBarcodeForm.productionDate"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择生产日期"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
|
|
|
|
|
<el-date-picker v-model="addProductBarcodeForm.lastOutstockDate"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择最晚出库日期"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="addProductBarcodeForm.remark" placeholder="请输入内容" type="textarea"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitProductBarcodeForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelProductBarcode">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加生产计划编号对话框 -->
|
|
|
|
|
<el-dialog :visible.sync="productPlanOpen" append-to-body title="选择生产计划编号">
|
|
|
|
|
<add-ProductPlan ref="productPlanRef" :defineData="defineData" @selection="handleSelection"></add-ProductPlan>
|
|
|
|
@ -291,7 +348,16 @@ export default {
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
addBtnTitle:'新增条码',
|
|
|
|
|
addBtnTitle: '新增条码',
|
|
|
|
|
|
|
|
|
|
addProductBarcodeTitle: '新增成品条码',
|
|
|
|
|
addProductBarcodeForm: {},
|
|
|
|
|
addProductBarcodeRules: {
|
|
|
|
|
productBarcode: [
|
|
|
|
|
{required: true, message: "原材料条码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
addProductBarcodeOpen: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
@ -322,7 +388,8 @@ export default {
|
|
|
|
|
bindBy: null,
|
|
|
|
|
bindTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null
|
|
|
|
|
updateTime: null,
|
|
|
|
|
singleFlag: null,
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
@ -377,16 +444,19 @@ export default {
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
addBarcodeBtnVisible: false,
|
|
|
|
|
addDoorBarcodeBtnVisible:false,
|
|
|
|
|
addDoorBarcodeBtnVisible: false,
|
|
|
|
|
batchPrintBtnDisabled: false,
|
|
|
|
|
addProductBarcodeBtnVisible: false,
|
|
|
|
|
|
|
|
|
|
BARCODE_TYPE: {
|
|
|
|
|
PRODUCT: '3',//成品
|
|
|
|
|
BACK_PLANE: '4',//背板
|
|
|
|
|
DOOR :'5'//门板
|
|
|
|
|
DOOR: '5'//门板
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
SINGLE_FLAG: {
|
|
|
|
|
YES: '1',//是
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -413,9 +483,10 @@ export default {
|
|
|
|
|
// },
|
|
|
|
|
methods: {
|
|
|
|
|
getData() {
|
|
|
|
|
if (this.defineData.barcodeType) {
|
|
|
|
|
let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
|
|
|
|
|
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
|
|
|
|
|
if(barcodeType === this.BARCODE_TYPE.BACK_PLANE){
|
|
|
|
|
if (barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
|
|
|
|
|
this.addBtnTitle = "新增背板条码";
|
|
|
|
|
}
|
|
|
|
|
this.form = {
|
|
|
|
@ -428,9 +499,14 @@ export default {
|
|
|
|
|
amount: 1,
|
|
|
|
|
}
|
|
|
|
|
this.queryParams.planDetailCode = this.defineData.planDetailCode;
|
|
|
|
|
if(barcodeType !==this.BARCODE_TYPE.PRODUCT){
|
|
|
|
|
if (barcodeType !== this.BARCODE_TYPE.PRODUCT) {
|
|
|
|
|
this.queryParams.barcodeType = null;
|
|
|
|
|
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR+","+this.BARCODE_TYPE.BACK_PLANE;
|
|
|
|
|
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR + "," + this.BARCODE_TYPE.BACK_PLANE;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT;
|
|
|
|
|
this.queryParams.singleFlag = this.SINGLE_FLAG.YES;
|
|
|
|
|
this.addProductBarcodeBtnVisible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -441,18 +517,21 @@ export default {
|
|
|
|
|
listProductBarcode(this.queryParams).then(response => {
|
|
|
|
|
this.barcodeList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
if (this.queryParams.singleFlag && this.queryParams.singleFlag === this.SINGLE_FLAG.YES) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (this.total && this.total > 0) {
|
|
|
|
|
if(this.queryParams.barcodeTypeStr){
|
|
|
|
|
if (this.queryParams.barcodeTypeStr) {
|
|
|
|
|
this.addBarcodeBtnVisible = true;
|
|
|
|
|
this.addDoorBarcodeBtnVisible = true;
|
|
|
|
|
this.barcodeList.forEach(e =>{
|
|
|
|
|
if(e.barcodeType === this.BARCODE_TYPE.BACK_PLANE){
|
|
|
|
|
this.barcodeList.forEach(e => {
|
|
|
|
|
if (e.barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
|
|
|
|
|
this.addBarcodeBtnVisible = false;
|
|
|
|
|
}else if(e.barcodeType === this.BARCODE_TYPE.DOOR){
|
|
|
|
|
} else if (e.barcodeType === this.BARCODE_TYPE.DOOR) {
|
|
|
|
|
this.addDoorBarcodeBtnVisible = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.addBarcodeBtnVisible = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -460,6 +539,8 @@ export default {
|
|
|
|
|
this.addDoorBarcodeBtnVisible = true;
|
|
|
|
|
this.handleAdd();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
@ -558,6 +639,56 @@ export default {
|
|
|
|
|
this.title = "添加条码信息";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
resetProductBarcode() {
|
|
|
|
|
this.addProductBarcodeForm = {
|
|
|
|
|
barcodeId: null,
|
|
|
|
|
productBarcode: null,
|
|
|
|
|
printTime: null,
|
|
|
|
|
printPerson: null,
|
|
|
|
|
batchFlag: '0',
|
|
|
|
|
barcodeType: '3',
|
|
|
|
|
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("addProductBarcodeForm");
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleAddProductBarcode() {
|
|
|
|
|
this.resetProductBarcode();
|
|
|
|
|
this.addProductBarcodeOpen = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancelProductBarcode() {
|
|
|
|
|
this.addProductBarcodeOpen = false;
|
|
|
|
|
this.resetProductBarcode();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 打印条码按钮操作 */
|
|
|
|
|
handlePrintBarcodes(row) {
|
|
|
|
|
const barcodeIds = row.barcodeId || this.ids;
|
|
|
|
@ -645,6 +776,21 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitProductBarcodeForm() {
|
|
|
|
|
this.$refs["addProductBarcodeForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.addProductBarcodeForm.singleFlag = this.SINGLE_FLAG.YES;
|
|
|
|
|
addProductBarcode(this.addProductBarcodeForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.addProductBarcodeOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|