|
|
|
@ -74,6 +74,18 @@
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleRegularAdd"
|
|
|
|
|
v-hasPermi="['mes:barcode:regularAdd']"
|
|
|
|
|
>固定条码新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
@ -257,7 +269,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="批次标识" prop="batchFlag">
|
|
|
|
|
<el-radio-group v-model="form.batchFlag" disabled>
|
|
|
|
|
<el-radio-group v-model="form.batchFlag" :disabled="saleBatchFlagDisable">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.active_flag"
|
|
|
|
|
:key="dict.value"
|
|
|
|
@ -270,14 +282,14 @@
|
|
|
|
|
<!-- <el-form-item label="供应商ID" prop="manufacturerId">-->
|
|
|
|
|
<!-- <el-input v-model="form.manufacturerId" placeholder="请输入供应商ID" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item prop="amount" v-if="batchVisible">
|
|
|
|
|
<el-form-item prop="amount" v-if="form.batchFlag===BATCH_FLAG.YES">
|
|
|
|
|
<span slot="label">
|
|
|
|
|
<el-tooltip content="每个物料条码中包含的数量,如:一袋螺丝有60个" placement="top">
|
|
|
|
|
<i class="el-icon-question"></i>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
批次数量
|
|
|
|
|
</span>
|
|
|
|
|
<el-input v-model="form.amount" placeholder="请在物料信息中维护" disabled/>
|
|
|
|
|
<el-input v-model="form.amount" placeholder="请在物料信息中维护" :disabled="saleBatchAmountDisabled"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item prop="barcodeAmount">
|
|
|
|
@ -403,9 +415,6 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 无采购订单的原材料条码信息对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="noPurchaseOpen" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="noPurchaseForm" :model="noPurchaseForm" :rules="noPurchaseRules" label-width="100px">
|
|
|
|
@ -414,7 +423,8 @@
|
|
|
|
|
<el-input v-model="noPurchaseForm.materialId" placeholder="请输入物料ID"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
|
|
|
<el-input v-model="noPurchaseForm.materialCode" suffix-icon="el-icon-search" readonly @click.native="handleSelectMaterial" />
|
|
|
|
|
<el-input v-model="noPurchaseForm.materialCode" suffix-icon="el-icon-search" readonly
|
|
|
|
|
@click.native="handleSelectMaterial"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
|
<el-input v-model="noPurchaseForm.materialName" readonly/>
|
|
|
|
@ -422,7 +432,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="批次标识" prop="batchFlag">
|
|
|
|
|
<el-radio-group v-model="noPurchaseForm.batchFlag" disabled>
|
|
|
|
|
<el-radio-group v-model="noPurchaseForm.batchFlag" :disabled="noPurchaseBatchFlagDisable">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.active_flag"
|
|
|
|
|
:key="dict.value"
|
|
|
|
@ -435,14 +445,14 @@
|
|
|
|
|
<!-- <el-form-item label="供应商ID" prop="manufacturerId">-->
|
|
|
|
|
<!-- <el-input v-model="form.manufacturerId" placeholder="请输入供应商ID" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item prop="amount" v-if="batchVisible">
|
|
|
|
|
<el-form-item prop="amount" v-if="noPurchaseForm.batchFlag==='1'">
|
|
|
|
|
<span slot="label">
|
|
|
|
|
<el-tooltip content="每个物料条码中包含的数量,如:一袋螺丝有60个" placement="top">
|
|
|
|
|
<i class="el-icon-question"></i>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
批次数量
|
|
|
|
|
</span>
|
|
|
|
|
<el-input v-model="noPurchaseForm.amount" placeholder="请在物料信息中维护" disabled/>
|
|
|
|
|
<el-input v-model="noPurchaseForm.amount" placeholder="请在物料信息中维护"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item prop="barcodeAmount">
|
|
|
|
@ -480,11 +490,58 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitNoPurchaseAddForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelInternal">取 消</el-button>
|
|
|
|
|
<el-button @click="cancelNoPurchase">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 固定原材料条码信息对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="regularOpen" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="regularForm" :model="regularForm" :rules="regularRules" label-width="100px">
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料ID" prop="materialId" v-if="false">
|
|
|
|
|
<el-input v-model="regularForm.materialId" placeholder="请输入物料ID"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
|
|
|
<el-input v-model="regularForm.materialCode" suffix-icon="el-icon-search" readonly
|
|
|
|
|
@click.native="handleSelectMaterial"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
|
<el-input v-model="regularForm.materialName" readonly/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料规格" prop="materialSpec">
|
|
|
|
|
<el-input v-model="regularForm.materialSpec" readonly/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="生产日期" prop="productionDate">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="regularForm.productionDate"
|
|
|
|
|
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="regularForm.lastOutstockDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择最晚出库日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="regularForm.remark" type="textarea" placeholder="请输入内容"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitRegularAddForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelRegular">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 选择物料对话框 -->
|
|
|
|
|
<el-dialog title="选择物料信息" :visible.sync="selectMaterialVisible" append-to-body>
|
|
|
|
|
<select-material ref="selectMaterialRef" v-if="selectMaterialVisible"></select-material>
|
|
|
|
@ -500,7 +557,7 @@
|
|
|
|
|
import {
|
|
|
|
|
listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode,
|
|
|
|
|
printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo,
|
|
|
|
|
addInternalBarcode, regenerateBarcode,addNoPurchaseBarcode
|
|
|
|
|
addInternalBarcode, regenerateBarcode, addNoPurchaseBarcode, addRegularBarcode
|
|
|
|
|
} from "@/api/mes/barcode";
|
|
|
|
|
import addPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue';
|
|
|
|
|
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
|
|
|
|
@ -525,8 +582,6 @@ export default {
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
//批次显示
|
|
|
|
|
batchVisible: false,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 条码信息表格数据
|
|
|
|
@ -547,7 +602,7 @@ export default {
|
|
|
|
|
printTime: null,
|
|
|
|
|
printPerson: null,
|
|
|
|
|
batchFlag: null,
|
|
|
|
|
barcodeType: '1',
|
|
|
|
|
barcodeType: "1",
|
|
|
|
|
barcodeInfo: null,
|
|
|
|
|
batchCode: null,
|
|
|
|
|
palletInfoCode: null,
|
|
|
|
@ -655,6 +710,11 @@ export default {
|
|
|
|
|
noPurchaseOpen: false,
|
|
|
|
|
// 对内条码表单参数
|
|
|
|
|
noPurchaseForm: {},
|
|
|
|
|
noPurchaseBatchFlagDisable: true,
|
|
|
|
|
noPurchaseBatchAmountDisabled: true,
|
|
|
|
|
|
|
|
|
|
saleBatchFlagDisable: true,
|
|
|
|
|
saleBatchAmountDisabled: true,
|
|
|
|
|
// 表单校验
|
|
|
|
|
noPurchaseRules: {
|
|
|
|
|
batchFlag: [
|
|
|
|
@ -666,12 +726,30 @@ export default {
|
|
|
|
|
barcodeAmount: [
|
|
|
|
|
{required: true, message: "条码数量不能为空", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
materialCode: [
|
|
|
|
|
{required: true, message: "物料不能为空", trigger: "blur"}
|
|
|
|
|
materialCode11: [
|
|
|
|
|
{required: true, message: "物料不能为空", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
batchPrintBtnDisabled: false
|
|
|
|
|
regularOpen: false,
|
|
|
|
|
// 固定条码表单参数
|
|
|
|
|
regularForm: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
regularRules: {
|
|
|
|
|
materialCode2: [
|
|
|
|
|
{
|
|
|
|
|
required: true, message: "物料不能为空", trigger: ["blur", "change"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
batchPrintBtnDisabled: false,
|
|
|
|
|
|
|
|
|
|
BATCH_FLAG: {
|
|
|
|
|
YES: '1',
|
|
|
|
|
NO: '0'
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -776,24 +854,30 @@ export default {
|
|
|
|
|
this.form.poNo = selectedRow.poNo;
|
|
|
|
|
this.form.barcodeAmount = selectedRow.orderAmount;
|
|
|
|
|
|
|
|
|
|
this.form.batchFlag = null;
|
|
|
|
|
this.form.amount = null;
|
|
|
|
|
|
|
|
|
|
getMaterialInfoByErpId(selectedRow.materialId).then(response => {
|
|
|
|
|
if (response.data == null) {
|
|
|
|
|
this.$modal.msgError("物料信息不存在");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (response.data.batchFlag != null) {
|
|
|
|
|
this.form.batchFlag = response.data.batchFlag;
|
|
|
|
|
this.form.materialId = response.data.materialId;
|
|
|
|
|
if (this.form.batchFlag == "0") {
|
|
|
|
|
this.batchVisible = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.saleBatchFlagDisable = true;
|
|
|
|
|
if (this.form.batchFlag === this.BATCH_FLAG.YES) {
|
|
|
|
|
this.form.amount = response.data.batchAmount;
|
|
|
|
|
this.batchVisible = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.form.amount = 1;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.batchVisible = true;
|
|
|
|
|
this.saleBatchFlagDisable = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.saleBatchAmountDisabled = this.form.amount != null && this.form.amount > 0;
|
|
|
|
|
|
|
|
|
|
this.purchaseOrderOpen = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
@ -807,7 +891,7 @@ export default {
|
|
|
|
|
/** 打印条码按钮操作 */
|
|
|
|
|
handlePrintBarcodes(row) {
|
|
|
|
|
const barcodeIds = row.barcodeId || this.ids;
|
|
|
|
|
if (barcodeIds == null || barcodeIds == '') {
|
|
|
|
|
if (barcodeIds == null || barcodeIds === '') {
|
|
|
|
|
this.$modal.msgWarning("请选择要打印的物料条码");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1021,17 +1105,19 @@ export default {
|
|
|
|
|
|
|
|
|
|
/** 无采购订单新增按钮操作 */
|
|
|
|
|
handleNoPurchaseAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.resetNoPurchase();
|
|
|
|
|
this.noPurchaseOpen = true;
|
|
|
|
|
this.title = "添加原材料条码信息";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleSelectMaterial() {
|
|
|
|
|
this.selectMaterialVisible = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 提交选择物料按钮 */
|
|
|
|
|
submitSelectMaterialForm() {
|
|
|
|
|
if (this.noPurchaseOpen) {
|
|
|
|
|
let selectedRow = this.$refs.selectMaterialRef.selectedRow;
|
|
|
|
|
this.noPurchaseForm.barcodeType = '1';//条码类型(1原材料,2半成品,3成品,4背板)
|
|
|
|
|
this.noPurchaseForm.materialId = selectedRow.materialId;
|
|
|
|
@ -1039,14 +1125,24 @@ export default {
|
|
|
|
|
this.noPurchaseForm.materialName = selectedRow.materialName;
|
|
|
|
|
this.noPurchaseForm.batchFlag = selectedRow.batchFlag;
|
|
|
|
|
|
|
|
|
|
if (this.noPurchaseForm.batchFlag === "0") {
|
|
|
|
|
this.batchVisible = false;
|
|
|
|
|
if (this.noPurchaseForm.batchFlag == null || this.noPurchaseForm.batchFlag === '') {
|
|
|
|
|
this.noPurchaseBatchFlagDisable = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.noPurchaseBatchFlagDisable = true;
|
|
|
|
|
if (this.noPurchaseForm.batchFlag === this.BATCH_FLAG.NO) {
|
|
|
|
|
this.noPurchaseForm.amount = 1;
|
|
|
|
|
} else if (this.noPurchaseForm.batchFlag === this.BATCH_FLAG.YES) {
|
|
|
|
|
this.noPurchaseForm.amount = selectedRow.batchAmount;
|
|
|
|
|
this.batchVisible = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.noPurchaseBatchAmountDisabled = this.noPurchaseForm.amount != null && this.noPurchaseForm.amount > 0;
|
|
|
|
|
|
|
|
|
|
this.selectMaterialVisible = false;
|
|
|
|
|
} else if (this.regularOpen) {
|
|
|
|
|
this.submitRegularSelectMaterialForm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1065,6 +1161,93 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancelNoPurchase() {
|
|
|
|
|
this.noPurchaseOpen = false;
|
|
|
|
|
this.resetNoPurchase();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
resetRegular() {
|
|
|
|
|
this.regularForm = {
|
|
|
|
|
barcodeId: null,
|
|
|
|
|
printTime: null,
|
|
|
|
|
printPerson: null,
|
|
|
|
|
batchFlag: null,
|
|
|
|
|
barcodeType: '1',
|
|
|
|
|
barcodeInfo: null,
|
|
|
|
|
batchCode: null,
|
|
|
|
|
palletInfoCode: null,
|
|
|
|
|
materialId: null,
|
|
|
|
|
manufacturerId: null,
|
|
|
|
|
amount: null,
|
|
|
|
|
barcodeAmount: 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("regularForm");
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 固定条码新增按钮操作 */
|
|
|
|
|
handleRegularAdd() {
|
|
|
|
|
this.resetRegular();
|
|
|
|
|
this.regularOpen = true;
|
|
|
|
|
this.title = "添加原材料条码信息";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交选择物料按钮 */
|
|
|
|
|
submitRegularSelectMaterialForm() {
|
|
|
|
|
let selectedRow = this.$refs.selectMaterialRef.selectedRow;
|
|
|
|
|
this.regularForm.barcodeType = '9';//条码类型(1原材料,2半成品,3成品,4背板,9固定条码)
|
|
|
|
|
this.regularForm.materialId = selectedRow.materialId;
|
|
|
|
|
this.regularForm.materialCode = selectedRow.materialCode;
|
|
|
|
|
this.regularForm.materialName = selectedRow.materialName;
|
|
|
|
|
this.regularForm.materialSpec = selectedRow.materialSpec;
|
|
|
|
|
|
|
|
|
|
this.selectMaterialVisible = false;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 固定条码新增提交按钮 */
|
|
|
|
|
submitRegularAddForm() {
|
|
|
|
|
this.$refs["regularForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
addRegularBarcode(this.regularForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.regularOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancelRegular() {
|
|
|
|
|
this.regularOpen = false;
|
|
|
|
|
this.resetRegular();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|