|
@@ -17,10 +17,11 @@
|
|
|
|
|
|
<el-button @click="cancelBingding" type="primary" v-if="bingdingStatus || outboundStatus" plain>取
|
|
|
消</el-button>
|
|
|
- <el-button type="primary" style="background-color: #f9bf5c90" v-if="!bingdingStatus &&
|
|
|
+ <el-button type="primary" style="background-color: #f9bf5c90" v-if="
|
|
|
+ !bingdingStatus &&
|
|
|
selectedType == 'no' &&
|
|
|
outboundStatus == false
|
|
|
- " @click="outboundFnc" plain>出 库</el-button>
|
|
|
+ " @click="outboundFnc" plain>出 库</el-button>
|
|
|
<el-button type="primary" @click="submit" style="background-color: #f9bf5c90; color: white; border: 0px"
|
|
|
v-if="bingdingStatus" plain>确 认</el-button>
|
|
|
<el-button type="primary" @click="submit" style="background-color: #f9bf5c90; color: white; border: 0px"
|
|
@@ -36,27 +37,25 @@
|
|
|
<div>
|
|
|
已装数量:{{
|
|
|
selectRowData.completeNum
|
|
|
- ? selectRowData.completeNum
|
|
|
- : "-"
|
|
|
+ ? selectRowData.completeNum
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</div>
|
|
|
<div>所需总数:{{ selectRowData.totalMaterial }}</div>
|
|
|
<div>
|
|
|
还需数量:{{
|
|
|
selectRowData.totalMaterial -
|
|
|
- selectRowData.completeNum +
|
|
|
- topSum
|
|
|
- }}
|
|
|
+ selectRowData.completeNum -
|
|
|
+ topSum < 1 ? 0 : selectRowData.totalMaterial - selectRowData.completeNum - topSum }} </div>
|
|
|
+ </div>
|
|
|
+ <div class="selectInfoItem" v-if="selectedType == 'yes'" @click="closeTopItem(item.selectedIndex)"
|
|
|
+ v-for="item in setTopItem">
|
|
|
+ <div>料箱名称:</div>
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ <div>料箱编号:</div>
|
|
|
+ <div>{{ item.code }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="selectInfoItem" v-if="selectedType == 'yes'" @click="closeTopItem(item.selectedIndex)"
|
|
|
- v-for="item in setTopItem">
|
|
|
- <div>料箱名称:</div>
|
|
|
- <div>{{ item.name }}</div>
|
|
|
- <div>料箱编号:</div>
|
|
|
- <div>{{ item.code }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<el-scrollbar class="scrollbar">
|
|
@@ -68,7 +67,10 @@
|
|
|
: item.isEnable == 2
|
|
|
? 'item noBound'
|
|
|
: 'item'
|
|
|
- " v-if="itemShowStatus(item)" @click="setSelectIndex(index)">
|
|
|
+ " :style="index == selectIndex
|
|
|
+ ? 'border: 3px solid #6cc2ff;box-shadow: 5px #6cc2ff;'
|
|
|
+ : ''
|
|
|
+ " v-if="itemShowStatus(item)" @click="setSelectIndex(index)">
|
|
|
<div>料箱名称:</div>
|
|
|
<div>{{ item.name }}</div>
|
|
|
<div>料箱编号:</div>
|
|
@@ -143,13 +145,14 @@ const itemShowStatus = (item: any) => {
|
|
|
};
|
|
|
const setSelectedType = (type: string) => {
|
|
|
selectedType.value = type;
|
|
|
+ selectIndex.value = null;
|
|
|
};
|
|
|
const outboundFnc = () => {
|
|
|
outboundStatus.value = true;
|
|
|
disabled.value = true;
|
|
|
};
|
|
|
const selectIndexInfoData = computed(() => {
|
|
|
- if (materialData.value.length > 0) {
|
|
|
+ if (materialData.value.length > 0 && selectIndex.value) {
|
|
|
return materialData.value[selectIndex.value].list;
|
|
|
} else {
|
|
|
return [];
|
|
@@ -159,6 +162,15 @@ const selectIndexInfoData = computed(() => {
|
|
|
const setSelectIndex = (index: number) => {
|
|
|
selectIndex.value = index;
|
|
|
if (selectedType.value == "yes") {
|
|
|
+ //先判定是否现在数量已经够了
|
|
|
+ if (
|
|
|
+ selectRowData.value.totalMaterial -
|
|
|
+ selectRowData.value.completeNum -
|
|
|
+ topSum.value <
|
|
|
+ 1 &&
|
|
|
+ bingdingStatus.value
|
|
|
+ )
|
|
|
+ return ElMessage.warning("现数目已达需要值,请不要过量绑定!");
|
|
|
//在符合的条件下
|
|
|
if (bingdingStatus.value) {
|
|
|
if (materialData.value[selectIndex.value].selected == true) {
|
|
@@ -188,8 +200,8 @@ const setTopItem = computed(() => {
|
|
|
const topSum = computed(() => {
|
|
|
let sum = 0;
|
|
|
const array = materialData.value.filter((item) => item.selected == true);
|
|
|
- for (let i = 0; i++; i < array.length) {
|
|
|
- sum = array[i].xxxsum;
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
+ sum = sum + array[i].num;
|
|
|
}
|
|
|
return sum;
|
|
|
});
|
|
@@ -206,11 +218,21 @@ const cancelBingding = () => {
|
|
|
outboundStatus.value = false;
|
|
|
disabled.value = false;
|
|
|
};
|
|
|
+//确认操作
|
|
|
const submit = () => {
|
|
|
+ if (bingdingStatus.value == true) {
|
|
|
+ if (setTopItem.value.length > 0) {
|
|
|
+ bindingTitle.value = "绑定确认";
|
|
|
+ } else {
|
|
|
+ return ElMessage.warning("绑定载具数量不能为0!");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (outboundStatus.value == true) {
|
|
|
- bindingTitle.value = "确认出库";
|
|
|
- } else {
|
|
|
- bindingTitle.value = "绑定确认";
|
|
|
+ if (outboundIndex.value != null) {
|
|
|
+ bindingTitle.value = "确认出库";
|
|
|
+ } else {
|
|
|
+ return ElMessage.warning("请选择出库载具!");
|
|
|
+ }
|
|
|
}
|
|
|
showStatus.value = true;
|
|
|
};
|
|
@@ -248,9 +270,9 @@ const submitData = async () => {
|
|
|
if (code == "200") {
|
|
|
ElMessage.success("出库成功!");
|
|
|
//页面数据删除
|
|
|
-
|
|
|
materialData.value.splice(outboundIndex.value, 1);
|
|
|
outboundIndex.value = null;
|
|
|
+ showStatus.value = false;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -387,7 +409,7 @@ const submitData = async () => {
|
|
|
margin: $p20;
|
|
|
padding: $p20;
|
|
|
cursor: pointer;
|
|
|
- box-sizing: border-box;
|
|
|
+ box-sizing: border-box !important;
|
|
|
}
|
|
|
}
|
|
|
}
|