|
|
@ -33,7 +33,8 @@
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div style="text-align: center">
|
|
|
|
<div style="text-align: center">
|
|
|
|
<el-button type="success" @click="handleRawOutstock">板材领料</el-button>
|
|
|
|
<el-button type="success" @click="handleRawOutstock" v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">板材领料</el-button>
|
|
|
|
|
|
|
|
<el-button type="warning" @click="handleRawOutstock" v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">下发图纸</el-button>
|
|
|
|
<el-button type="primary" @click="accomplishPlan">完成</el-button>
|
|
|
|
<el-button type="primary" @click="accomplishPlan">完成</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -195,10 +196,12 @@
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
|
|
|
|
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
|
|
|
|
<el-form-item label="库位编码" prop="locationCode">
|
|
|
|
<el-form-item label="库位编码" prop="locationCode">
|
|
|
|
<el-input v-model="wmsForm.locationCode" autocomplete="off"></el-input>
|
|
|
|
<el-input v-model="wmsForm.locationCode" ref="locationCodeRef" autocomplete="off" placeholder="请扫描或输入库位编码"
|
|
|
|
|
|
|
|
@focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur" suffix-icon="el-icon-camera"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="物料条码" prop="materialBarcode">
|
|
|
|
<el-form-item label="物料条码" prop="materialBarcode">
|
|
|
|
<el-input v-model="wmsForm.materialBarcode" autocomplete="off"></el-input>
|
|
|
|
<el-input v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" autocomplete="off" placeholder="请扫描或输入物料条码"
|
|
|
|
|
|
|
|
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur" suffix-icon="el-icon-camera"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@ -223,6 +226,8 @@ import {
|
|
|
|
directRawOutstock,
|
|
|
|
directRawOutstock,
|
|
|
|
} from "@/api/board";
|
|
|
|
} from "@/api/board";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {monitorSerialData} from "@/utils/serial"
|
|
|
|
|
|
|
|
|
|
|
|
const setState = (e) => {
|
|
|
|
const setState = (e) => {
|
|
|
|
if (e === '1') {
|
|
|
|
if (e === '1') {
|
|
|
|
return '未开始'
|
|
|
|
return '未开始'
|
|
|
@ -237,6 +242,7 @@ const setState = (e) => {
|
|
|
|
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
|
|
|
|
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'Board1',
|
|
|
|
name: 'Board1',
|
|
|
|
|
|
|
|
mixins: [monitorSerialData],
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
Chart
|
|
|
|
Chart
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -256,6 +262,9 @@ export default {
|
|
|
|
locationCode: null,
|
|
|
|
locationCode: null,
|
|
|
|
materialBarcode: null,
|
|
|
|
materialBarcode: null,
|
|
|
|
},//板材领料入库使用
|
|
|
|
},//板材领料入库使用
|
|
|
|
|
|
|
|
loacationCodeFocused: false,
|
|
|
|
|
|
|
|
materialBarcodeFocused: false,
|
|
|
|
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
wmsRules: {
|
|
|
|
wmsRules: {
|
|
|
|
locationCode: [
|
|
|
|
locationCode: [
|
|
|
@ -275,14 +284,16 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
async mounted() {
|
|
|
|
setInterval(() => {
|
|
|
|
this.firstConnectSerial();
|
|
|
|
this.$notify.info({
|
|
|
|
|
|
|
|
title: '通知',
|
|
|
|
// setInterval(() => {
|
|
|
|
message: '通知公告',
|
|
|
|
// this.$notify.info({
|
|
|
|
position: 'bottom-right',
|
|
|
|
// title: '通知',
|
|
|
|
duration: 0
|
|
|
|
// message: '通知公告',
|
|
|
|
});
|
|
|
|
// position: 'bottom-right',
|
|
|
|
}, 60 * 1000)
|
|
|
|
// duration: 0
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }, 60 * 1000)
|
|
|
|
const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
|
|
|
|
const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
|
|
|
|
this.tableData = e.rows
|
|
|
|
this.tableData = e.rows
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
@ -904,6 +915,31 @@ export default {
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.stockType = "1";//入库
|
|
|
|
this.stockType = "1";//入库
|
|
|
|
this.title = "板材入库";
|
|
|
|
this.title = "板材入库";
|
|
|
|
|
|
|
|
this.dynamicFocus("locationCodeRef");
|
|
|
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
|
|
|
showClose: true,
|
|
|
|
|
|
|
|
// beforeClose:async(action,instance,done)=>{
|
|
|
|
|
|
|
|
// if(action==='confirm'){
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// this.connectSerialPort();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
console.log("dddd")
|
|
|
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async dynamicFocus(inputRef) {
|
|
|
|
|
|
|
|
await this.$nextTick();
|
|
|
|
|
|
|
|
this.$refs[inputRef].focus();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handleRawOutstock() {
|
|
|
|
handleRawOutstock() {
|
|
|
@ -911,6 +947,26 @@ export default {
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.stockType = "2";//出库
|
|
|
|
this.stockType = "2";//出库
|
|
|
|
this.title = "板材领料";
|
|
|
|
this.title = "板材领料";
|
|
|
|
|
|
|
|
this.dynamicFocus("locationCodeRef");
|
|
|
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
|
|
|
showClose: true,
|
|
|
|
|
|
|
|
// beforeClose:async(action,instance,done)=>{
|
|
|
|
|
|
|
|
// if(action==='confirm'){
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// this.connectSerialPort();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
console.log("dddd")
|
|
|
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
@ -920,13 +976,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
submitRawStock() {
|
|
|
|
submitRawStock() {
|
|
|
|
if (this.stockType == "1") {//入库
|
|
|
|
if (this.stockType === "1") {//入库
|
|
|
|
this.wmsForm.instockAmount = 1;
|
|
|
|
this.wmsForm.instockAmount = 1;
|
|
|
|
addRawInstock(this.wmsForm).then(response => {
|
|
|
|
addRawInstock(this.wmsForm).then(response => {
|
|
|
|
this.$modal.msgSuccess("板材入库成功");
|
|
|
|
this.$modal.msgSuccess("板材入库成功");
|
|
|
|
this.cancel();
|
|
|
|
this.cancel();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if (this.stockType == "2") {//出库
|
|
|
|
} else if (this.stockType === "2") {//出库
|
|
|
|
this.wmsForm.outstockAmount = 1;
|
|
|
|
this.wmsForm.outstockAmount = 1;
|
|
|
|
this.wmsForm.planCode = this.form.planCode;
|
|
|
|
this.wmsForm.planCode = this.form.planCode;
|
|
|
|
this.wmsForm.planDetailCode = this.form.planDetailCode;
|
|
|
|
this.wmsForm.planDetailCode = this.form.planDetailCode;
|
|
|
@ -937,10 +993,10 @@ export default {
|
|
|
|
checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
|
|
|
|
checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
|
|
|
|
let returnCode = response.data.code;
|
|
|
|
let returnCode = response.data.code;
|
|
|
|
let returnMsg = response.data.msg;
|
|
|
|
let returnMsg = response.data.msg;
|
|
|
|
if (returnCode == this.OUTSTOCKCODE.directOutstockCode) {
|
|
|
|
if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
|
|
|
|
this.directRawOutstock();
|
|
|
|
this.directRawOutstock();
|
|
|
|
} else if (returnCode == this.OUTSTOCKCODE.confirmOutstockCode) {
|
|
|
|
} else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
|
|
|
|
this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:'+returnMsg, '提示', {
|
|
|
|
this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:' + returnMsg, '提示', {
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
@ -950,7 +1006,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$modal.msgWarning("请出库:"+returnMsg);
|
|
|
|
this.$modal.msgWarning("请出库:" + returnMsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -959,14 +1015,67 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
directRawOutstock() {
|
|
|
|
directRawOutstock() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
directRawOutstock(this.wmsForm).then(response => {
|
|
|
|
directRawOutstock(this.wmsForm).then(response => {
|
|
|
|
this.$modal.msgSuccess("板材领取成功");
|
|
|
|
this.$modal.msgSuccess("板材领取成功");
|
|
|
|
this.cancel();
|
|
|
|
this.cancel();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleLocationCodeFocus() {
|
|
|
|
|
|
|
|
this.loacationCodeFocused = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleLocationCodeBlur() {
|
|
|
|
|
|
|
|
this.loacationCodeFocused = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleMaterialBarcodeFocus() {
|
|
|
|
|
|
|
|
this.materialBarcodeFocused = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleMaterialBarcodeBlur() {
|
|
|
|
|
|
|
|
this.materialBarcodeFocused = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firstConnectSerial() {
|
|
|
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
|
|
|
showClose: true,
|
|
|
|
|
|
|
|
// beforeClose:async(action,instance,done)=>{
|
|
|
|
|
|
|
|
// if(action==='confirm'){
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// this.connectSerialPort();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSerialData() {
|
|
|
|
|
|
|
|
// if (!this.checkSerialConnected()) {//判断是否已连接,如果没有连接则需要连接
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (this.open) {//板材入库
|
|
|
|
|
|
|
|
if (this.loacationCodeFocused) {
|
|
|
|
|
|
|
|
this.wmsForm.locationCode = this.serialData
|
|
|
|
|
|
|
|
this.dynamicFocus("materialBarcodeRef");
|
|
|
|
|
|
|
|
} else if (this.materialBarcodeFocused) {
|
|
|
|
|
|
|
|
this.wmsForm.materialBarcode = this.serialData;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// console.log(this.serialData)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|