|
@@ -3,25 +3,68 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
<div class="type-title">载具入库</div>
|
|
|
- <ScanCodeInput v-model="boxSearch" :clearable="true" :showSuffix="true" placeholder="请扫描或输入料箱编号"
|
|
|
- @keyup.enter="enterBox" />
|
|
|
+ <ScanCodeInput
|
|
|
+ v-model="boxSearch"
|
|
|
+ :clearable="true"
|
|
|
+ :showSuffix="true"
|
|
|
+ placeholder="请扫描或输入料箱编号"
|
|
|
+ @keyup.enter="enterBox"
|
|
|
+ :disabled="outStatus || addStatus"
|
|
|
+ />
|
|
|
<el-scrollbar class="boxes-container base-container">
|
|
|
- <div v-for="(item, index) in boxesList" :key="index" :class="{ 'box-selected': index === currentBoxIndex }"
|
|
|
- class="box-item" @click="clickBox(item, index)">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in boxesList"
|
|
|
+ :key="index"
|
|
|
+ :class="{ 'box-selected': index === currentBoxIndex }"
|
|
|
+ class="box-item"
|
|
|
+ @click="clickBox(item, index)"
|
|
|
+ >
|
|
|
<div class="box-name">{{ item.vehicleNo }}</div>
|
|
|
- <div v-for="(material, index) in item.list" :key="index" class="box-info">
|
|
|
+ <div
|
|
|
+ v-for="(material, index) in item.list"
|
|
|
+ :key="index"
|
|
|
+ class="box-info"
|
|
|
+ >
|
|
|
<div>{{ material.materialName }}</div>
|
|
|
<div>{{ material.num }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
- <el-button class="sureBtn" type="primary" @click="sureToOut">出库
|
|
|
+ <el-button
|
|
|
+ class="sureBtn"
|
|
|
+ type="primary"
|
|
|
+ :disabled="outStatus || addStatus"
|
|
|
+ @click="sureToOut"
|
|
|
+ >出库
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="type-title">盒内原有物料</div>
|
|
|
<el-scrollbar class="outing-container">
|
|
|
- <div v-for="(material, index) in outingMaterials" :key="index" class="outing-box">
|
|
|
+ <div v-if="!outStatus">
|
|
|
+ <div class="addbox" v-if="addSuccessStatus">
|
|
|
+ 扫码的盒子编码:{{ addBoxInfo.code }}
|
|
|
+ </div>
|
|
|
+ <ScanCodeInput
|
|
|
+ v-if="addStatus && addSuccessStatus == false"
|
|
|
+ v-model="addBoxSearch"
|
|
|
+ :clearable="true"
|
|
|
+ :showSuffix="true"
|
|
|
+ placeholder="请扫描或输入料箱编号"
|
|
|
+ @keyup.enter="addenterBox"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ class="sureBtn"
|
|
|
+ :type="addStatus ? 'info' : 'primary'"
|
|
|
+ @click="changeAddStatus"
|
|
|
+ >{{ addStatus ? "取消" : "入库新载具" }}
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-for="(material, index) in outingMaterials"
|
|
|
+ :key="index"
|
|
|
+ class="outing-box"
|
|
|
+ >
|
|
|
<div class="material-title">
|
|
|
{{ material.materialName }} | {{ material.materialNo }}
|
|
|
</div>
|
|
@@ -41,15 +84,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
- <el-button class="sureBtn" type="info" @click="backToStorage">返库
|
|
|
+ <el-button class="sureBtn" type="info" @click="backToStorage"
|
|
|
+ >出库
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="type-title">请扫码物料</div>
|
|
|
- <ScanCodeInput v-model="scanCodeInput" placeholder="请扫描或输入物料编码" @keyup.enter="handleScanCodeInput" />
|
|
|
+ <ScanCodeInput
|
|
|
+ v-model="scanCodeInput"
|
|
|
+ placeholder="请扫描或输入物料编码"
|
|
|
+ @keyup.enter="handleScanCodeInput"
|
|
|
+ />
|
|
|
<el-scrollbar class="base-container">
|
|
|
<div class="list-container">
|
|
|
- <div v-for="(item, index) in materialList" :key="index" class="list-box">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in materialList"
|
|
|
+ :key="index"
|
|
|
+ class="list-box"
|
|
|
+ >
|
|
|
<div>
|
|
|
<div class="name">{{ item.materialName }}</div>
|
|
|
<div class="spec">{{ item.spec }}</div>
|
|
@@ -61,7 +113,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
- <el-button class="sureBtn" type="primary" @click="sureToAdd">确认添加
|
|
|
+ <el-button class="sureBtn" type="primary" @click="sureToAdd"
|
|
|
+ >确认添加
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -74,6 +127,7 @@ import {
|
|
|
getDestinationList,
|
|
|
getMaterialInfoByLabel,
|
|
|
} from "@/api/process/materialFlow";
|
|
|
+import { getVehicleInfo } from "@/api/prepare";
|
|
|
import {
|
|
|
backToStorageAPI,
|
|
|
getStorageBoxesList,
|
|
@@ -84,13 +138,43 @@ import {
|
|
|
const boxSearch = ref("");
|
|
|
//盒内原有物料data
|
|
|
const boxesList = ref<any[]>([]);
|
|
|
+const addStatus = ref(false);
|
|
|
+const addSuccessStatus = ref(false);
|
|
|
+const addBoxInfo = ref();
|
|
|
//选中的item
|
|
|
const currentBox = ref<any>({});
|
|
|
const currentBoxIndex = ref(-1);
|
|
|
+const outStatus = ref(false);
|
|
|
+const changeAddStatus = () => {
|
|
|
+ if (addStatus.value == true) {
|
|
|
+ addSuccessStatus.value = false;
|
|
|
+ addBoxInfo.value = null;
|
|
|
+ addBoxSearch.value = "";
|
|
|
+ outingBox.value = {};
|
|
|
+ outingRawBoxList = [];
|
|
|
+ outingMaterials.value = [];
|
|
|
+ materialList.value = [];
|
|
|
+ }
|
|
|
+ addStatus.value = !addStatus.value;
|
|
|
+};
|
|
|
+const addBoxSearch = ref("");
|
|
|
+//扫盒子
|
|
|
+const addenterBox = () => {
|
|
|
+ addBoxSearch.value = addBoxSearch.value.trim();
|
|
|
+ getVehicleInfo(addBoxSearch.value ? addBoxSearch.value : {}).then((res) => {
|
|
|
+ addBoxInfo.value = res.data;
|
|
|
+ addSuccessStatus.value = true;
|
|
|
+ outingBox.value.vehicleNo = addBoxInfo.value.code;
|
|
|
+ outingBox.value.vehicleId = addBoxInfo.value.id;
|
|
|
+ ElMessage.success("扫码成功!");
|
|
|
+ });
|
|
|
+};
|
|
|
//出库
|
|
|
const enterBox = () => {
|
|
|
boxSearch.value = boxSearch.value.trim();
|
|
|
- getStorageBoxesList({}).then((res) => {
|
|
|
+ getStorageBoxesList(
|
|
|
+ boxSearch.value ? { vehicleCode: boxSearch.value } : {}
|
|
|
+ ).then((res) => {
|
|
|
boxesList.value = res.data;
|
|
|
});
|
|
|
};
|
|
@@ -105,6 +189,7 @@ const sureToOut = async () => {
|
|
|
houseNo: currentBox.value.houseNo,
|
|
|
});
|
|
|
ElMessage.success("出库成功");
|
|
|
+ outStatus.value = true;
|
|
|
outingBox.value = currentBox.value;
|
|
|
if (outingBox.value.list.length > 0) {
|
|
|
outingMaterials.value = outingBox.value.list;
|
|
@@ -143,6 +228,7 @@ const materialList = ref<any>([]);
|
|
|
// 扫码料码
|
|
|
const handleScanCodeInput = () => {
|
|
|
getMaterialInfoByLabel(scanCodeInput.value).then((res) => {
|
|
|
+ //seq是序列号唯一的
|
|
|
if (res.data.codeType == "SEQ") {
|
|
|
res.data.seqNo = scanCodeInput.value;
|
|
|
} else {
|
|
@@ -167,7 +253,7 @@ const sureToAdd = () => {
|
|
|
} else {
|
|
|
if (
|
|
|
materialList.value[i].materialCode ==
|
|
|
- outingMaterials.value[b].materialNo &&
|
|
|
+ outingMaterials.value[b].materialNo &&
|
|
|
materialList.value[i].batchCode == outingMaterials.value[b].batchCode
|
|
|
) {
|
|
|
outingMaterials.value[i].num =
|
|
@@ -362,4 +448,12 @@ onMounted(() => {
|
|
|
width: 100%;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+.addbox {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: white;
|
|
|
+ text-align: center;
|
|
|
+ padding: 20px 0;
|
|
|
+ font-size: $f24;
|
|
|
+}
|
|
|
</style>
|