|
|
|
@ -36,6 +36,9 @@
|
|
|
|
|
<el-button type="success" @click="handleRawOutstock"
|
|
|
|
|
v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">板材领料
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="warning" @click="handleRawReturn"
|
|
|
|
|
v-if="this.form.planDetailStatus!=null">板材退库
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" @click="accomplishPlan"
|
|
|
|
|
v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">完成
|
|
|
|
|
</el-button>
|
|
|
|
@ -100,7 +103,7 @@
|
|
|
|
|
slot="reference"
|
|
|
|
|
:disabled="i.planDetailStatus"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text">{{ !i.planDetailStatus ? "开始" : PLAN_DETAIL_STATUS_STR[i.planDetailStatus]}}
|
|
|
|
|
type="text">{{ !i.planDetailStatus ? "开始" : PLAN_DETAIL_STATUS_STR[i.planDetailStatus] }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
@ -130,7 +133,9 @@
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ (scope.row.attachId && scope.row.attachId !== '') ? scope.row.attachId.split(',').length : "1(无图纸)" }}
|
|
|
|
|
{{
|
|
|
|
|
(scope.row.attachId && scope.row.attachId !== '') ? scope.row.attachId.split(',').length : "1(无图纸)"
|
|
|
|
|
}}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
@ -154,7 +159,7 @@
|
|
|
|
|
width="200"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
<!--el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
@ -167,7 +172,7 @@
|
|
|
|
|
退库
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table-column-->
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -201,16 +206,26 @@
|
|
|
|
|
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
|
|
|
|
|
<el-form-item label="库位编码" prop="locationCode">
|
|
|
|
|
<el-input v-model="wmsForm.locationCode" ref="locationCodeRef" autocomplete="off"
|
|
|
|
|
placeholder="请扫描或输入库位编码"
|
|
|
|
|
placeholder="请扫描或输入库位编码" style="width:360px"
|
|
|
|
|
@focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur"
|
|
|
|
|
suffix-icon="el-icon-full-screen"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料条码" prop="materialBarcode">
|
|
|
|
|
<el-input v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" autocomplete="off"
|
|
|
|
|
placeholder="请扫描或输入物料条码"
|
|
|
|
|
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur"
|
|
|
|
|
suffix-icon="el-icon-full-screen"></el-input>
|
|
|
|
|
<el-select v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" placeholder="请扫描或输入物料条码"
|
|
|
|
|
style="width:360px">
|
|
|
|
|
<el-option v-for="item in locationBarcodeList" :key="item.barcodeInfo" :label="`${item.materialName}(${item.materialSpec})`"
|
|
|
|
|
:value="item.barcodeInfo"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="数量" prop="instockAmount">
|
|
|
|
|
<el-input-number v-model="wmsForm.instockAmount" ref="instockAmountRef" :min="1" :max="1000"
|
|
|
|
|
placeholder="请输入数量" style="width:360px"></el-input-number>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
@ -232,6 +247,8 @@ import {
|
|
|
|
|
addRawInstock,
|
|
|
|
|
checkSuitableSaleOrderMaterial,
|
|
|
|
|
directRawOutstock,
|
|
|
|
|
directRawReturn,
|
|
|
|
|
get4thFloorRegularBarcode
|
|
|
|
|
} from "@/api/board";
|
|
|
|
|
|
|
|
|
|
import {monitorSerialData} from "@/utils/serial"
|
|
|
|
@ -272,15 +289,19 @@ export default {
|
|
|
|
|
},//板材领料入库使用
|
|
|
|
|
loacationCodeFocused: false,
|
|
|
|
|
materialBarcodeFocused: false,
|
|
|
|
|
|
|
|
|
|
locationBarcodeList: [],
|
|
|
|
|
// 表单校验
|
|
|
|
|
wmsRules: {
|
|
|
|
|
locationCode: [
|
|
|
|
|
{required: true, message: "库位编码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
materialBarcode: [
|
|
|
|
|
{required: true, message: "物料条码不能为空", trigger: "blur"}
|
|
|
|
|
{required: true, message: "物料条码不能为空", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
instockAmount: [
|
|
|
|
|
{required: true, message: "数量不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
OUTSTOCKCODE: {
|
|
|
|
@ -301,6 +322,13 @@ export default {
|
|
|
|
|
"2": "已开始",
|
|
|
|
|
"3": "已完成",
|
|
|
|
|
"9": "异常完成"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
STOCK_TYPE:{
|
|
|
|
|
INSTOCK:"1",//入库
|
|
|
|
|
OUTSTOCK:"2",//出库
|
|
|
|
|
RETURN:"3",//退库
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -326,7 +354,10 @@ export default {
|
|
|
|
|
this.form.materialCode = e.rows[0]?.materialCode
|
|
|
|
|
this.form.materialName = e.rows[0]?.materialName
|
|
|
|
|
this.form.saleOrderId = e.rows[0]?.saleOrderId
|
|
|
|
|
this.form.planDetailStatus = setState(val.data.planDetailStatus)
|
|
|
|
|
if (val.data) {
|
|
|
|
|
this.form.planDetailStatus = setState(val.data.planDetailStatus)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.$refs.chart2.setData({
|
|
|
|
@ -523,12 +554,15 @@ export default {
|
|
|
|
|
getOrderInfo(e) {
|
|
|
|
|
this.getInfo(e)
|
|
|
|
|
getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => {
|
|
|
|
|
this.form = val.data
|
|
|
|
|
this.form.materialId = e.materialId
|
|
|
|
|
this.form.materialCode = e.materialCode
|
|
|
|
|
this.form.materialName = e.materialName
|
|
|
|
|
this.form.saleOrderId = e.saleOrderId
|
|
|
|
|
this.form.planDetailStatus = setState(val.data.planDetailStatus)
|
|
|
|
|
if (val.data) {
|
|
|
|
|
this.form = val.data
|
|
|
|
|
this.form.materialId = e.materialId
|
|
|
|
|
this.form.materialCode = e.materialCode
|
|
|
|
|
this.form.materialName = e.materialName
|
|
|
|
|
this.form.saleOrderId = e.saleOrderId
|
|
|
|
|
this.form.planDetailStatus = setState(val.data.planDetailStatus)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async expandChange(e, rows) {
|
|
|
|
@ -928,34 +962,17 @@ export default {
|
|
|
|
|
locationCode: undefined,
|
|
|
|
|
materialBarcode: undefined
|
|
|
|
|
};
|
|
|
|
|
this.locationBarcodeList = [];
|
|
|
|
|
this.resetForm("wmsForm");
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleRawInstock() {
|
|
|
|
|
this.resetWmsForm();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.stockType = "1";//入库
|
|
|
|
|
this.stockType = this.STOCK_TYPE.INSTOCK;//入库
|
|
|
|
|
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(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// this.dynamicFocus("locationCodeRef");
|
|
|
|
|
this.checkConnectSerial();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async dynamicFocus(inputRef) {
|
|
|
|
@ -966,9 +983,22 @@ export default {
|
|
|
|
|
handleRawOutstock() {
|
|
|
|
|
this.resetWmsForm();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.stockType = "2";//出库
|
|
|
|
|
this.stockType = this.STOCK_TYPE.OUTSTOCK;//出库
|
|
|
|
|
this.title = "板材领料";
|
|
|
|
|
this.dynamicFocus("locationCodeRef");
|
|
|
|
|
// this.dynamicFocus("locationCodeRef");
|
|
|
|
|
this.checkConnectSerial();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleRawReturn() {
|
|
|
|
|
this.resetWmsForm();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.stockType = this.STOCK_TYPE.RETURN;//退库
|
|
|
|
|
this.title = "板材退库";
|
|
|
|
|
// this.dynamicFocus("locationCodeRef");
|
|
|
|
|
this.checkConnectSerial();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
checkConnectSerial(){
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
@ -983,7 +1013,6 @@ export default {
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
console.log("dddd")
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
@ -997,41 +1026,80 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submitRawStock() {
|
|
|
|
|
if (this.stockType === "1") {//入库
|
|
|
|
|
this.wmsForm.instockAmount = 1;
|
|
|
|
|
if (this.stockType === this.STOCK_TYPE.INSTOCK) {//入库
|
|
|
|
|
addRawInstock(this.wmsForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("板材入库成功");
|
|
|
|
|
this.cancel();
|
|
|
|
|
});
|
|
|
|
|
} else if (this.stockType === "2") {//出库
|
|
|
|
|
this.wmsForm.outstockAmount = 1;
|
|
|
|
|
} else if (this.stockType === this.STOCK_TYPE.OUTSTOCK) {//出库
|
|
|
|
|
this.wmsForm.outstockAmount = this.wmsForm.instockAmount;
|
|
|
|
|
this.wmsForm.planCode = this.form.planCode;
|
|
|
|
|
this.wmsForm.planDetailCode = this.form.planDetailCode;
|
|
|
|
|
this.wmsForm.operationType = '1';//人工
|
|
|
|
|
this.wmsForm.taskType = '1';//生产领料
|
|
|
|
|
this.wmsForm.saleOrderId = this.form.saleOrderId;
|
|
|
|
|
|
|
|
|
|
checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
|
|
|
|
|
let returnCode = response.data.code;
|
|
|
|
|
let returnMsg = response.data.msg;
|
|
|
|
|
if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
|
|
|
|
|
this.directRawOutstock();
|
|
|
|
|
} else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
|
|
|
|
|
this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:' + returnMsg, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.directRawOutstock();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgWarning("请出库:" + returnMsg);
|
|
|
|
|
}
|
|
|
|
|
this.directRawOutstock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//板材为固定条码,不需要校验是否是安全库存
|
|
|
|
|
// checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
|
|
|
|
|
// let returnCode = response.data.code;
|
|
|
|
|
// let returnMsg = response.data.msg;
|
|
|
|
|
// if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
|
|
|
|
|
// this.directRawOutstock();
|
|
|
|
|
// } else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
|
|
|
|
|
// this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:' + returnMsg, '提示', {
|
|
|
|
|
// confirmButtonText: '确定',
|
|
|
|
|
// cancelButtonText: '取消',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
// this.directRawOutstock();
|
|
|
|
|
// }).catch(() => {
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$modal.msgWarning("请出库:" + returnMsg);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
} else if (this.stockType === this.STOCK_TYPE.RETURN) {//出库
|
|
|
|
|
this.wmsForm.returnAmount = this.wmsForm.instockAmount;
|
|
|
|
|
this.wmsForm.planCode = this.form.planCode;
|
|
|
|
|
this.wmsForm.planDetailCode = this.form.planDetailCode;
|
|
|
|
|
this.wmsForm.operationType = '1';//人工
|
|
|
|
|
this.wmsForm.taskType = '1';//余料退料
|
|
|
|
|
this.wmsForm.saleOrderId = this.form.saleOrderId;
|
|
|
|
|
|
|
|
|
|
directRawReturn(this.wmsForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("板材退库成功");
|
|
|
|
|
this.cancel();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//板材为固定条码,不需要校验是否是安全库存
|
|
|
|
|
// checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
|
|
|
|
|
// let returnCode = response.data.code;
|
|
|
|
|
// let returnMsg = response.data.msg;
|
|
|
|
|
// if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
|
|
|
|
|
// this.directRawOutstock();
|
|
|
|
|
// } else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
|
|
|
|
|
// this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:' + returnMsg, '提示', {
|
|
|
|
|
// confirmButtonText: '确定',
|
|
|
|
|
// cancelButtonText: '取消',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
// this.directRawOutstock();
|
|
|
|
|
// }).catch(() => {
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$modal.msgWarning("请出库:" + returnMsg);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1048,6 +1116,11 @@ export default {
|
|
|
|
|
|
|
|
|
|
handleLocationCodeBlur() {
|
|
|
|
|
this.loacationCodeFocused = false;
|
|
|
|
|
if (this.wmsForm.locationCode && this.wmsForm.locationCode !== '') {
|
|
|
|
|
get4thFloorRegularBarcode(this.wmsForm).then(response => {
|
|
|
|
|
this.locationBarcodeList = response.data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleMaterialBarcodeFocus() {
|
|
|
|
@ -1085,7 +1158,7 @@ export default {
|
|
|
|
|
if (this.open) {//板材出入库
|
|
|
|
|
if (this.loacationCodeFocused) {
|
|
|
|
|
this.wmsForm.locationCode = this.serialData
|
|
|
|
|
this.dynamicFocus("materialBarcodeRef");
|
|
|
|
|
// this.dynamicFocus("materialBarcodeRef");
|
|
|
|
|
} else if (this.materialBarcodeFocused) {
|
|
|
|
|
this.wmsForm.materialBarcode = this.serialData;
|
|
|
|
|
}
|
|
|
|
@ -1093,7 +1166,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|